class_docstr: Base class for other distance algorithms. Represents a distance.
  
  Can be used for units conversion::
  
      >>> from geopy.distance import Distance
      >>> Distance(miles=10).km
      16.09344
  
  Distance instances have all *distance* properties from :mod:`geopy.units`,
  e.g.: ``km``, ``m``, ``meters``, ``miles`` and so on.
  
  Distance instances are immutable.
  
  They support comparison::
  
      >>> from geopy.distance import Distance
      >>> Distance(kilometers=2) == Distance(meters=2000)
      True
      >>> Distance(kilometers=2) > Distance(miles=1)
      True
  
  String representation::
  
      >>> from geopy.distance import Distance
      >>> repr(Distance(kilometers=2))
      'Distance(2.0)'
      >>> str(Distance(kilometers=2))
      '2.0 km'
      >>> repr(Distance(miles=2))
      'Distance(3.218688)'
      >>> str(Distance(miles=2))
      '3.218688 km'
  
  Arithmetics::
  
      >>> from geopy.distance import Distance
      >>> -Distance(miles=2)
      Distance(-3.218688)
      >>> Distance(miles=2) + Distance(kilometers=1)
      Distance(4.218688)
      >>> Distance(miles=2) - Distance(kilometers=1)
      Distance(2.218688)
      >>> Distance(kilometers=6) * 5
      Distance(30.0)
      >>> Distance(kilometers=6) / 5
      Distance(1.2)
docstr: There are 3 ways to create a distance:
  
  - From kilometers::
  
      >>> from geopy.distance import Distance
      >>> Distance(1.42)
      Distance(1.42)
  
  - From units::
  
      >>> from geopy.distance import Distance
      >>> Distance(kilometers=1.42)
      Distance(1.42)
      >>> Distance(miles=1)
      Distance(1.609344)
  
  - From points (for non-abstract distances only),
    calculated as a sum of distances between all points::
  
      >>> from geopy.distance import geodesic
      >>> geodesic((40, 160), (40.1, 160.1))
      Distance(14.003702498106215)
      >>> geodesic((40, 160), (40.1, 160.1), (40.2, 160.2))
      Distance(27.999954644813478)
docstr_tok: ["There","are","3","ways","to","create","a","distance",":","-","From","kilometers",":",":",">",">",">","from","geopy.distance","import","Distance",">",">",">","Distance","(","1.42",")","Distance","(","1.42",")","-","From","units",":",":",">",">",">","from","geopy.distance","import","Distance",">",">",">","Distance","(","kilometers=1.42",")","Distance","(","1.42",")",">",">",">","Distance","(","miles=1",")","Distance","(","1.609344",")","-","From","points","(","for","non-abstract","distances","only",")",",","calculated","as","a","sum","of","distances","between","all","points",":",":",">",">",">","from","geopy.distance","import","geodesic",">",">",">","geodesic","(","(","40",",","160",")",",","(","40.1",",","160.1",")",")","Distance","(","14.003702498106215",")",">",">",">","geodesic","(","(","40",",","160",")",",","(","40.1",",","160.1",")",",","(","40.2",",","160.2",")",")","Distance","(","27.999954644813478",")"]
code: def __init__(self, *args, **kwargs):
      """
      There are 3 ways to create a distance:
  
      - From kilometers::
  
          >>> from geopy.distance import Distance
          >>> Distance(1.42)
          Distance(1.42)
  
      - From units::
  
          >>> from geopy.distance import Distance
          >>> Distance(kilometers=1.42)
          Distance(1.42)
          >>> Distance(miles=1)
          Distance(1.609344)
  
      - From points (for non-abstract distances only),
        calculated as a sum of distances between all points::
  
          >>> from geopy.distance import geodesic
          >>> geodesic((40, 160), (40.1, 160.1))
          Distance(14.003702498106215)
          >>> geodesic((40, 160), (40.1, 160.1), (40.2, 160.2))
          Distance(27.999954644813478)
      """
  
      kilometers = kwargs.pop("kilometers", 0)
      if len(args) == 1:
          # if we only get one argument we assume
          # it's a known distance instead of
          # calculating it first
          kilometers += args[0]
      elif len(args) > 1:
          for a, b in util.pairwise(args):
              kilometers += self.measure(a, b)
  
      kilometers += units.kilometers(**kwargs)
      self.__kilometers = kilometers
  
imports: from math import asin, atan2, cos, sin, sqrt
  from geographiclib.geodesic import Geodesic
  from geopy import units, util
  from geopy.point import Point
  from geopy.units import radians
label_desc: Use image node_id 1 to create a new Distance object  with example: obj = Distance()