nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, return_statement; 9, comment:"""Sort by detection time.
  
          .. rubric:: Example
  
          >>> family = Family(
          ...     template=Template(name='a'), detections=[
          ...     Detection(template_name='a', detect_time=UTCDateTime(0) + 200,
          ...               no_chans=8, detect_val=4.2, threshold=1.2,
          ...               typeofdet='corr', threshold_type='MAD',
          ...               threshold_input=8.0),
          ...     Detection(template_name='a', detect_time=UTCDateTime(0),
          ...               no_chans=8, detect_val=4.5, threshold=1.2,
          ...               typeofdet='corr', threshold_type='MAD',
          ...               threshold_input=8.0),
          ...     Detection(template_name='a', detect_time=UTCDateTime(0) + 10,
          ...               no_chans=8, detect_val=4.5, threshold=1.2,
          ...               typeofdet='corr', threshold_type='MAD',
          ...               threshold_input=8.0)])
          >>> family[0].detect_time
          UTCDateTime(1970, 1, 1, 0, 3, 20)
          >>> family.sort()[0].detect_time
          UTCDateTime(1970, 1, 1, 0, 0)
          """; 10, assignment; 11, identifier:self; 12, attribute; 13, call; 14, identifier:self; 15, identifier:detections; 16, identifier:sorted; 17, argument_list; 18, attribute; 19, keyword_argument; 20, identifier:self; 21, identifier:detections; 22, identifier:key; 23, lambda; 24, lambda_parameters; 25, attribute; 26, identifier:d; 27, identifier:d; 28, identifier:detect_time
code: def sort(self):
          """Sort by detection time.
  
          .. rubric:: Example
  
          >>> family = Family(
          ...     template=Template(name='a'), detections=[
          ...     Detection(template_name='a', detect_time=UTCDateTime(0) + 200,
          ...               no_chans=8, detect_val=4.2, threshold=1.2,
          ...               typeofdet='corr', threshold_type='MAD',
          ...               threshold_input=8.0),
          ...     Detection(template_name='a', detect_time=UTCDateTime(0),
          ...               no_chans=8, detect_val=4.5, threshold=1.2,
          ...               typeofdet='corr', threshold_type='MAD',
          ...               threshold_input=8.0),
          ...     Detection(template_name='a', detect_time=UTCDateTime(0) + 10,
          ...               no_chans=8, detect_val=4.5, threshold=1.2,
          ...               typeofdet='corr', threshold_type='MAD',
          ...               threshold_input=8.0)])
          >>> family[0].detect_time
          UTCDateTime(1970, 1, 1, 0, 3, 20)
          >>> family.sort()[0].detect_time
          UTCDateTime(1970, 1, 1, 0, 0)
          """
          self.detections = sorted(self.detections, key=lambda d: d.detect_time)
          return self