@classmethod<EOL><INDENT>def from_location(cls, location):<DEDENT>
if not location:<EOL><INDENT>return cls()<EOL><DEDENT>try:<EOL><INDENT>if hasattr(location, '<STR_LIT>'):<EOL><INDENT>return location<EOL><DEDENT>elif hasattr(location, '<STR_LIT>'):<EOL><INDENT>return cls(city=str(location.Name.replace("<STR_LIT:U+002C>", "<STR_LIT:U+0020>")),<EOL>latitude=location.Latitude,<EOL>longitude=location.Longitude)<EOL><DEDENT>elif location.startswith('<STR_LIT>'):<EOL><INDENT>loc, city, latitude, longitude, time_zone, elevation =[x.strip() for x in re.findall(r'<STR_LIT>',<EOL>location, re.DOTALL)]<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>city, latitude, longitude, time_zone, elevation =[key.split("<STR_LIT::>")[-<NUM_LIT:1>].strip()<EOL>for key in location.split("<STR_LIT:U+002C>")]<EOL><DEDENT>except ValueError:<EOL><INDENT>return cls(city=location)<EOL><DEDENT><DEDENT>return cls(city=city, country=None, latitude=latitude,<EOL>longitude=longitude, time_zone=time_zone,<EOL>elevation=elevation)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % (location, e))<EOL><DEDENT>
Try to create a Ladybug location from a location string.

        Args:
            locationString: Location string

        Usage:

            l = Location.from_location(locationString)