Returned a formated longitude format for the file
515405
def _format_lon(self, lon):
        '''  '''
        if self.ppd in [4, 16, 64, 128]:
            return None
        else:
            return map(lambda x: "{0:0>3}".format(int(x)), self._map_center('long', lon))
1068828
def format_file_params(files):
        '''
            
        '''
        files_payload = {}
        if files:
            for idx, filename in enumerate(files):
                files_payload["file[" + str(idx) + "]"] = open(filename, 'rb')
        return files_payload
660767
def longitude(self):
        ''''''
        sd = dm_to_sd(self.lon)
        if self.lon_dir == 'E':
            return +sd
        elif self.lon_dir == 'W':
            return -sd
        else:
            return 0.
533608
def format_value(self):
        
        return format_value(
            self.data_type,
            self.data,
            self.parent.stringpool_main.getString
        )
1277162
def T(self):
    "'"
    name = self.timezone and self.timezone.tzname(self.data) or None
    if name is None:
      name = self.format('O')
    return unicode(name)
601279
def parseFilename(self, filename):
        """"""
        match = self.filename_regex.match(filename)
        if match is None:
            # TODO?: Raise exception?
            '''print("Filename", filename, "unrecognized!")'''
            return None
        lat = int(match.group(2))
        lon = int(match.group(4))
        if match.group(1) == "S":
            lat = -lat
        if match.group(3) == "W":
            lon = -lon
        return lat, lon
1083191
def _format_lat(self, lat):
        '''  '''
        if self.ppd in [4, 16, 64, 128]:
            return None
        else:
            if lat < 0:
                return map(lambda x: "{0:0>2}"
                           .format(int(np.abs(x))) + 'S', self._map_center('lat', lat))
            else:
                return map(lambda x: "{0:0>2}"
                           .format(int(x)) + 'N', self._map_center('lat', lat))
1335295
def format(self, altitude=None, deg_char='', min_char='m', sec_char='s'):
        
        latitude = "%s %s" % (
            format_degrees(abs(self.latitude), symbols={
                'deg': deg_char, 'arcmin': min_char, 'arcsec': sec_char
            }),
            self.latitude >= 0 and 'N' or 'S'
        )
        longitude = "%s %s" % (
            format_degrees(abs(self.longitude), symbols={
                'deg': deg_char, 'arcmin': min_char, 'arcsec': sec_char
            }),
            self.longitude >= 0 and 'E' or 'W'
        )
        coordinates = [latitude, longitude]

        if altitude is None:
            altitude = bool(self.altitude)
        if altitude:
            if not isinstance(altitude, string_compare):
                altitude = 'km'
            coordinates.append(self.format_altitude(altitude))

        return ", ".join(coordinates)
438512
def obtain_to(filename):
    
    root, _ = nc.open(filename)
    lat, lon = nc.getvar(root, 'lat')[0,:], nc.getvar(root, 'lon')[0,:]
    nc.close(root)
    return obtain(lat, lon)
937129
def marshal(self, v):
        
        return "{lat},{lon}".format(lat=v.lat, lon=v.lon) if v else None
42168
def format(tokens, formatter, outfile=None):  # pylint: disable=redefined-builtin
    
    try:
        if not outfile:
            realoutfile = getattr(formatter, 'encoding', None) and BytesIO() or StringIO()
            formatter.format(tokens, realoutfile)
            return realoutfile.getvalue()
        else:
            formatter.format(tokens, outfile)
    except TypeError as err:
        if (isinstance(err.args[0], str) and
            ('unbound method format' in err.args[0] or
             'missing 1 required positional argument' in err.args[0])):
            raise TypeError('format() argument must be a formatter instance, '
                            'not a class')
        raise
171796
def read_locations(filename):
    
    data = ConfigParser()
    if filename == '-':
        data.read_file(sys.stdin)
    else:
        data.read(filename)
    if not data.sections():
        logging.debug('Config file is empty')

    locations = {}
    for name in data.sections():
        if data.has_option(name, 'locator'):
            latitude, longitude = utils.from_grid_locator(data.get(name,
                                                                   'locator'))
        else:
            latitude = data.getfloat(name, 'latitude')
            longitude = data.getfloat(name, 'longitude')
        locations[name] = (latitude, longitude)
    return locations
202031
def parse_location(location):
    
    def split_dms(text, hemisphere):
        """Split degrees, minutes and seconds string.

        Args:
            text (str): Text to split

        Returns::
            float: Decimal degrees
        """
        out = []
        sect = []
        for i in text:
            if i.isdigit():
                sect.append(i)
            else:
                out.append(sect)
                sect = []
        d, m, s = [float(''.join(i)) for i in out]
        if hemisphere in 'SW':
            d, m, s = [-1 * x for x in (d, m, s)]
        return to_dd(d, m, s)

    for sep in ';, ':
        chunks = location.split(sep)
        if len(chunks) == 2:
            if chunks[0].endswith('N'):
                latitude = float(chunks[0][:-1])
            elif chunks[0].endswith('S'):
                latitude = -1 * float(chunks[0][:-1])
            else:
                latitude = float(chunks[0])
            if chunks[1].endswith('E'):
                longitude = float(chunks[1][:-1])
            elif chunks[1].endswith('W'):
                longitude = -1 * float(chunks[1][:-1])
            else:
                longitude = float(chunks[1])
            return latitude, longitude
        elif len(chunks) == 4:
            if chunks[0].endswith(('s', '"')):
                latitude = split_dms(chunks[0], chunks[1])
            else:
                latitude = float(chunks[0])
                if chunks[1] == 'S':
                    latitude = -1 * latitude
            if chunks[2].endswith(('s', '"')):
                longitude = split_dms(chunks[2], chunks[3])
            else:
                longitude = float(chunks[2])
                if chunks[3] == 'W':
                    longitude = -1 * longitude
            return latitude, longitude
151985
def _format_coordinate(self, ax, m):
        '''  '''
        lon_m, lon_M, lat_m, lat_M = self.window
        xlocs = np.linspace(lon_m, lon_M, 5)
        ylocs = np.linspace(lat_m, lat_M, 5)
        xlocs = map(lambda x: float('%1.2f' % (x)), xlocs)
        ylocs = map(lambda x: float('%1.2f' % (x)), ylocs)
        m.drawparallels(ylocs, labels=[1, 0, 0, 1], ax=ax, fontsize=18)
        m.drawmeridians(xlocs, labels=[1, 0, 0, 1], ax=ax, fontsize=18)
1143289
def _format_name_map(self, lon, lat):
        '''  '''

        if self.ppd in [4, 16, 64, 128]:
            lolaname = '_'.join(['LDEM', str(self.ppd)])
        elif self.ppd in [512]:
            lolaname = '_'.join(
                ['LDEM', str(self.ppd), lat[0], lat[1], lon[0], lon[1]])
        return lolaname
1139181
function formatLine({ rule, message, location }, metrics) {
  const { line, col } = location;
  const { line: lineW, col: colW, message: msgW } = metrics;
  const loc = sprintf(`%${lineW}d:%-${colW}d`, line, col);
  const msg = sprintf(`%-${msgW}s`, message);
  return `  ${loc}  ${msg}  ${rule}`;
}
572077
def get_formatted_datetime_string(cls, timestamp: int, fmt="%Y-%m-%d %H:%M:%S"):
        
        return time.strftime(fmt, time.localtime(timestamp))