parameters: (
          self,
          time_func: Callable,
          opr_filter: Callable = lambda opr: True,
          aggregate: Callable = None,
          aggregate_by: str = None,
          sort_by: str = None,
          top_k: int = 0,
      )
return_statement: return self._sort(records, sort_by)[0 : len(records) if top_k == 0 else top_k]
docstring: r"""Select operation.
  
          Args:
              time_func: time_func provided by user, would apply to every
                  OprProfRst.
              opr_filter: filter satisfied operatiors.
              aggregate: function that apply to list of records which are
                  aggregated by atype.
              aggregate_by: the type aggregated by.
              sort_by: keyword for sorting all records.
              top_k: specify the maximum number of records.
  
          Returns:
              the records that go through select, aggregate, sort.
docstring_summary: r"""Select operation.
docstring_tokens: r Select operation .
function: def select(
          self,
          time_func: Callable,
          opr_filter: Callable = lambda opr: True,
          aggregate: Callable = None,
          aggregate_by: str = None,
          sort_by: str = None,
          top_k: int = 0,
      ) -> List[Record]:
          r"""Select operation.
  
          Args:
              time_func: time_func provided by user, would apply to every
                  OprProfRst.
              opr_filter: filter satisfied operatiors.
              aggregate: function that apply to list of records which are
                  aggregated by atype.
              aggregate_by: the type aggregated by.
              sort_by: keyword for sorting all records.
              top_k: specify the maximum number of records.
  
          Returns:
              the records that go through select, aggregate, sort.
          """
  
          records = []
          for opr in self._opr_set.values():
              if opr_filter(opr):
                  time = time_func(opr)
                  if time is None:
                      continue
                  item = Record(time, opr.opr_info, opr.footprint)
                  records.append(item)
  
          records = self._aggregate(records, aggregate, aggregate_by)
          if not records:
              return records
          return self._sort(records, sort_by)[0 : len(records) if top_k == 0 else top_k]
function_tokens: def select ( self , time_func : Callable , opr_filter : Callable = lambda opr : True , aggregate : Callable = None , aggregate_by : str = None , sort_by : str = None , top_k : int = 0 , ) -> List [ Record ] : records = [ ] for opr in self . _opr_set . values ( ) : if opr_filter ( opr ) : time = time_func ( opr ) if time is None : continue item = Record ( time , opr . opr_info , opr . footprint ) records . append ( item ) records = self . _aggregate ( records , aggregate , aggregate_by ) if not records : return records return self . _sort ( records , sort_by ) [ 0 : len ( records ) if top_k == 0 else top_k ]