code: def infer_location(
              self,
              location_query,
              max_distance,
              google_key,
              foursquare_client_id,
              foursquare_client_secret,
              limit
          ):
          
  
          self.location_from = infer_location(
              self.points[0],
              location_query,
              max_distance,
              google_key,
              foursquare_client_id,
              foursquare_client_secret,
              limit
          )
          self.location_to = infer_location(
              self.points[-1],
              location_query,
              max_distance,
              google_key,
              foursquare_client_id,
              foursquare_client_secret,
              limit
          )
  
          return self
docs: In-place location inferring
  
          See infer_location function
  
          Args:
          Returns:
              :obj:`Segment`: self