Try to create a Ladybug location from a location string.

        Args:
            locationString: Location string

        Usage:

            l = Location.from_location(locationString)
331114
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))
34035
public static function fromString($string)
    {
        list($lat, $long) = explode(',', $string);
        return new self($lat, $long);
    }
198398
function fromString( $contentObjectAttribute, $string )
    {
    	$data = $string !== '' && strpos( $string, '|#' ) !== false ? explode( '|#', $string ) : array( 0 );

    	if ( $data[0] != 0 )
    	{
            $location = new eZGmapLocation( array(
                            'contentobject_attribute_id' => $contentObjectAttribute->attribute('id'),
                            'contentobject_version' => $contentObjectAttribute->attribute('version'),
                            'latitude' => $data[1],
                            'longitude' => $data[2],
                            'address' => $data[3]
                         ));
            $contentObjectAttribute->setContent( $location );
    	}
    	$contentObjectAttribute->setAttribute( 'data_int', $data[0] );
    }
56801
def resp_set_location(self, resp, location=None):
        
        if location:
            self.location=location
        elif resp:
            self.location=resp.label.decode().replace("\x00", "")
1223851
function locate(fn, location) {
    try {
        return fn();
    } catch (e) {
        if (e instanceof JuttleError && !e.info.location) {
            e.info.location = location;
        }

        throw e;
    }
}
184936
public static Location createLocation(String rawJSON) throws TwitterException {
        try {
            return new LocationJSONImpl(new JSONObject(rawJSON));
        } catch (JSONException e) {
            throw new TwitterException(e);
        }
    }
318815
def fromTuple(self, locationTuple):
        
        for key, value in locationTuple:
            try:
                self[key] = float(value)
            except TypeError:
                self[key] = tuple([float(v) for v in value])
1132186
def from_str(cls, coordinate):
        """"""

        m = cls._coordinate_str_regex.match(coordinate)

        if m is None:
            raise ValueError('invalid coordinate string')

        if m.group(1) == '++':
            relative = True
        else:
            relative = False

        return TikZCoordinate(
            float(m.group(2)), float(m.group(4)), relative=relative)
680021
@Programmatic
    @Override
    public Location getLocation() {
        final String latLng = getLatLng();
        return latLng != null? Location.fromString(latLng.replace(",",";")): null;
    }
579617
@Override
    @Deprecated
    public T from(final String string) throws IllegalArgumentException, DescriptorImportException {
        return fromString(string);
    }
429927
def cp_string(self, source, dest, **kwargs):
        

        assert isinstance(source, six.string_types), "source must be a string"
        assert self._is_s3(dest), "Destination must be s3 location"

        return self._put_string(source, dest, **kwargs)
588277
def from_string(cls, string):
        
        lines = string.split("\n")
        timestep = int(lines[1])
        natoms = int(lines[3])
        box_arr = np.loadtxt(StringIO("\n".join(lines[5:8])))
        bounds = box_arr[:, :2]
        tilt = None
        if "xy xz yz" in lines[4]:
            tilt = box_arr[:, 2]
            x = (0, tilt[0], tilt[1], tilt[0] + tilt[1])
            y = (0, tilt[2])
            bounds -= np.array([[min(x), max(x)], [min(y), max(y)], [0, 0]])
        box = LammpsBox(bounds, tilt)
        data_head = lines[8].replace("ITEM: ATOMS", "").split()
        data = pd.read_csv(StringIO("\n".join(lines[9:])), names=data_head,
                           delim_whitespace=True)
        return cls(timestep, natoms, box, data)
654733
def fromstring(cls, string):
        
        parser = etree.XMLParser(remove_blank_text=True)
        root = etree.fromstring(string, parser)
        tree = root.getroottree()

        return cls.fromtree(tree)
819021
def get_location(opts=None, provider=None):
    '''
    
    '''
    if opts is None:
        opts = {}
    ret = opts.get('location')
    if ret is None and provider is not None:
        ret = provider.get('location')
    if ret is None:
        ret = get_region_from_metadata()
    if ret is None:
        ret = DEFAULT_LOCATION
    return ret
353365
def _coerce_point_to_string(point, output_format="%(lat)s,%(lon)s"):
        
        try:
            if not isinstance(point, Point):
                point = Point(point)
        except ValueError as e:
            if isinstance(point, string_compare):
                warnings.warn(
                    'Unable to parse the string as Point: "%s". Using the value '
                    'as-is for the query. In geopy 2.0 this will become an '
                    'exception.' % str(e), DeprecationWarning, stacklevel=3
                )
                return point
            raise
        else:
            # Altitude is silently dropped.
            return output_format % dict(lat=point.latitude,
                                        lon=point.longitude)
1007648
private static LocaleStore createLocaleStore(Map<TextStyle, Map<Long, String>> valueTextMap) {
        valueTextMap.put(TextStyle.FULL_STANDALONE, valueTextMap.get(TextStyle.FULL));
        valueTextMap.put(TextStyle.SHORT_STANDALONE, valueTextMap.get(TextStyle.SHORT));
        if (valueTextMap.containsKey(TextStyle.NARROW) && valueTextMap.containsKey(TextStyle.NARROW_STANDALONE) == false) {
            valueTextMap.put(TextStyle.NARROW_STANDALONE, valueTextMap.get(TextStyle.NARROW));
        }
        return new LocaleStore(valueTextMap);
    }
1240189
public void insertString( int offset, String str, AttributeSet a ) throws BadLocationException {
        if (str.equals("{"))
            str = addMatchingBrace(offset);
        super.insertString(offset, str, a);
        processChangedLines(offset, str.length());
    }