code: def from_location(cls, location):
          
          if not location:
              return cls()
          try:
              if hasattr(location, 'isLocation'):
                  # Ladybug location
                  return location
  
              elif hasattr(location, 'Latitude'):
                  # Revit's location
                  return cls(city=str(location.Name.replace(",", " ")),
                             latitude=location.Latitude,
                             longitude=location.Longitude)
  
              elif location.startswith('Site:'):
                  loc, city, latitude, longitude, time_zone, elevation = \
                      [x.strip() for x in re.findall(r'\r*\n*([^\r\n]*)[,|;]',
                                                     location, re.DOTALL)]
              else:
                  try:
                      city, latitude, longitude, time_zone, elevation = \
                          [key.split(":")[-1].strip()
                           for key in location.split(",")]
                  except ValueError:
                      # it's just the city name
                      return cls(city=location)
  
              return cls(city=city, country=None, latitude=latitude,
                         longitude=longitude, time_zone=time_zone,
                         elevation=elevation)
  
          except Exception as e:
              raise ValueError(
                  "Failed to create a Location from %s!\n%s" % (location, e))
docs: Try to create a Ladybug location from a location string.
  
          Args:
              locationString: Location string
  
          Usage:
  
              l = Location.from_location(locationString)