nodes: 0, module; 1, function_definition; 2, function_name:get_segment_efforts; 3, parameters; 4, block; 5, identifier:self; 6, identifier:segment_id; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, if_statement; 15, if_statement; 16, if_statement; 17, expression_statement; 18, return_statement; 19, identifier:athlete_id; 20, None; 21, identifier:start_date_local; 22, None; 23, identifier:end_date_local; 24, None; 25, identifier:limit; 26, None; 27, comment:"""
          Gets all efforts on a particular segment sorted by start_date_local
  
          Returns an array of segment effort summary representations sorted by
          start_date_local ascending or by elapsed_time if an athlete_id is
          provided.
  
          If no filtering parameters is provided all efforts for the segment
          will be returned.
  
          Date range filtering is accomplished using an inclusive start and end time,
          thus start_date_local and end_date_local must be sent together. For open
          ended ranges pick dates significantly in the past or future. The
          filtering is done over local time for the segment, so there is no need
          for timezone conversion. For example, all efforts on Jan. 1st, 2014
          for a segment in San Francisco, CA can be fetched using
          2014-01-01T00:00:00Z and 2014-01-01T23:59:59Z.
  
          http://strava.github.io/api/v3/segments/#all_efforts
  
          :param segment_id: ID of the segment.
          :type segment_id: param
  
          :int athlete_id: (optional) ID of athlete.
          :type athlete_id: int
  
          :param start_date_local: (optional) efforts before this date will be excluded.
                                              Either as ISO8601 or datetime object
          :type start_date_local: datetime.datetime or str
  
          :param end_date_local: (optional) efforts after this date will be excluded.
                                             Either as ISO8601 or datetime object
          :type end_date_local: datetime.datetime or str
  
          :param limit: (optional), limit number of efforts.
          :type limit: int
  
          :return: An iterator of :class:`stravalib.model.SegmentEffort` efforts on a segment.
          :rtype: :class:`BatchedResultsIterator`
  
          """; 28, assignment; 29, comparison_operator:athlete_id is not None; 30, block; 31, identifier:start_date_local; 32, block; 33, identifier:end_date_local; 34, block; 35, comparison_operator:limit is not None; 36, block; 37, assignment; 38, call; 39, identifier:params; 40, dictionary; 41, identifier:athlete_id; 42, None; 43, expression_statement; 44, if_statement; 45, expression_statement; 46, if_statement; 47, expression_statement; 48, identifier:limit; 49, None; 50, expression_statement; 51, identifier:result_fetcher; 52, call; 53, identifier:BatchedResultsIterator; 54, argument_list; 55, pair; 56, assignment; 57, call; 58, block; 59, assignment; 60, call; 61, block; 62, assignment; 63, assignment; 64, attribute; 65, argument_list; 66, keyword_argument; 67, keyword_argument; 68, keyword_argument; 69, keyword_argument; 70, string:"segment_id"; 71, identifier:segment_id; 72, subscript; 73, identifier:athlete_id; 74, identifier:isinstance; 75, argument_list; 76, expression_statement; 77, subscript; 78, call; 79, identifier:isinstance; 80, argument_list; 81, expression_statement; 82, subscript; 83, call; 84, subscript; 85, identifier:limit; 86, identifier:functools; 87, identifier:partial; 88, attribute; 89, string; 90, dictionary_splat; 91, identifier:entity; 92, attribute; 93, identifier:bind_client; 94, identifier:self; 95, identifier:result_fetcher; 96, identifier:result_fetcher; 97, identifier:limit; 98, identifier:limit; 99, identifier:params; 100, string; 101, identifier:start_date_local; 102, attribute; 103, assignment; 104, identifier:params; 105, string:"start_date_local"; 106, attribute; 107, argument_list; 108, identifier:end_date_local; 109, attribute; 110, assignment; 111, identifier:params; 112, string:"end_date_local"; 113, attribute; 114, argument_list; 115, identifier:params; 116, string:"limit"; 117, attribute; 118, identifier:get; 119, string_content:/segments/{segment_id}/all_efforts; 120, identifier:params; 121, identifier:model; 122, identifier:BaseEffort; 123, string_content:athlete_id; 124, identifier:six; 125, identifier:string_types; 126, identifier:start_date_local; 127, attribute; 128, identifier:start_date_local; 129, identifier:strftime; 130, string:"%Y-%m-%dT%H:%M:%SZ"; 131, identifier:six; 132, identifier:string_types; 133, identifier:end_date_local; 134, attribute; 135, identifier:end_date_local; 136, identifier:strftime; 137, string:"%Y-%m-%dT%H:%M:%SZ"; 138, identifier:self; 139, identifier:protocol; 140, call; 141, identifier:naive; 142, call; 143, identifier:naive; 144, attribute; 145, argument_list; 146, attribute; 147, argument_list; 148, identifier:arrow; 149, identifier:get; 150, identifier:start_date_local; 151, identifier:arrow; 152, identifier:get; 153, identifier:end_date_local
code: def get_segment_efforts(self, segment_id, athlete_id=None,
                              start_date_local=None, end_date_local=None,
                              limit=None):
          """
          Gets all efforts on a particular segment sorted by start_date_local
  
          Returns an array of segment effort summary representations sorted by
          start_date_local ascending or by elapsed_time if an athlete_id is
          provided.
  
          If no filtering parameters is provided all efforts for the segment
          will be returned.
  
          Date range filtering is accomplished using an inclusive start and end time,
          thus start_date_local and end_date_local must be sent together. For open
          ended ranges pick dates significantly in the past or future. The
          filtering is done over local time for the segment, so there is no need
          for timezone conversion. For example, all efforts on Jan. 1st, 2014
          for a segment in San Francisco, CA can be fetched using
          2014-01-01T00:00:00Z and 2014-01-01T23:59:59Z.
  
          http://strava.github.io/api/v3/segments/#all_efforts
  
          :param segment_id: ID of the segment.
          :type segment_id: param
  
          :int athlete_id: (optional) ID of athlete.
          :type athlete_id: int
  
          :param start_date_local: (optional) efforts before this date will be excluded.
                                              Either as ISO8601 or datetime object
          :type start_date_local: datetime.datetime or str
  
          :param end_date_local: (optional) efforts after this date will be excluded.
                                             Either as ISO8601 or datetime object
          :type end_date_local: datetime.datetime or str
  
          :param limit: (optional), limit number of efforts.
          :type limit: int
  
          :return: An iterator of :class:`stravalib.model.SegmentEffort` efforts on a segment.
          :rtype: :class:`BatchedResultsIterator`
  
          """
          params = {"segment_id": segment_id}
  
          if athlete_id is not None:
              params['athlete_id'] = athlete_id
  
          if start_date_local:
              if isinstance(start_date_local, six.string_types):
                  start_date_local = arrow.get(start_date_local).naive
              params["start_date_local"] = start_date_local.strftime("%Y-%m-%dT%H:%M:%SZ")
  
          if end_date_local:
              if isinstance(end_date_local, six.string_types):
                  end_date_local = arrow.get(end_date_local).naive
              params["end_date_local"] = end_date_local.strftime("%Y-%m-%dT%H:%M:%SZ")
  
          if limit is not None:
              params["limit"] = limit
  
          result_fetcher = functools.partial(self.protocol.get,
                                             '/segments/{segment_id}/all_efforts',
                                             **params)
  
          return BatchedResultsIterator(entity=model.BaseEffort, bind_client=self,
                                        result_fetcher=result_fetcher, limit=limit)