Fetches the list of old tz names and returns a mapping
347233
def update_old_names():
    """"""

    url = urlparse(ZONEINFO_URL)
    log.info('Connecting to %s' % url.netloc)
    ftp = ftplib.FTP(url.netloc)
    ftp.login()
    gzfile = BytesIO()

    log.info('Fetching zoneinfo database')
    ftp.retrbinary('RETR ' + url.path, gzfile.write)
    gzfile.seek(0)

    log.info('Extracting backwards data')
    archive = tarfile.open(mode="r:gz", fileobj=gzfile)
    backward = {}
    for line in archive.extractfile('backward').readlines():
        if line[0] == '#':
            continue
        if len(line.strip()) == 0:
            continue
        parts = line.split()
        if parts[0] != b'Link':
            continue

        backward[parts[2].decode('ascii')] = parts[1].decode('ascii')

    return backward
1106607
def get_raw(self):
        
        return [self.name, self.size, self.last_modified, self.location]
429798
private Set<String> getMappedCorpora(List<String> originalNames)
  {
    WebResource rootRes = Helper.getAnnisWebResource();
    Set<String> mappedNames = new HashSet<>();
    // iterate over given corpora and map names if necessary
    for (String selectedCorpusName : originalNames)
    {
      // get the real corpus descriptions by the name (which could be an alias)
      try
      {
        List<AnnisCorpus> corporaByName
          = rootRes.path("query").path("corpora").path(urlPathEscape.escape(
              selectedCorpusName))
          .get(new GenericType<List<AnnisCorpus>>()
          {
          });

        if (corporaByName != null && !corporaByName.isEmpty())
        {
          for (AnnisCorpus c : corporaByName)
          {
            mappedNames.add(c.getName());
          }
        }
      }
      catch (ClientHandlerException ex)
      {
        String msg = "alias mapping does not work for alias: "
          + selectedCorpusName;
        log.error(msg, ex);
        Notification.show(msg, Notification.Type.TRAY_NOTIFICATION);
      }
    }
    return mappedNames;
  }
388625
def get_old(dataset_label, data_id, destination_dir=None):
    
    # TODO implement
    if destination_dir is None:
        destination_dir = op.join(dataset_path(get_root=True), "medical", "orig")

    destination_dir = op.expanduser(destination_dir)
    data_url, url, expected_hash, hash_path, relative_output_path = get_dataset_meta(
        dataset_label
    )
    paths = glob.glob(os.path.join(destination_dir, hash_path))
    paths.sort()
    import fnmatch

    print(paths)
    print(data_id)
    pathsf = fnmatch.filter(paths, data_id)
    print(pathsf)
    datap = io3d.read(pathsf[0], dataplus_format=True)
    return datap
881897
def get_records(self, name):
        
        if name in self._cache:
            return self._cache[name].values()
        else:
            return []
16937
def _get(self):
        """"""

        data, stat = self.zk.get(self.path)
        if not len(data):
            return {}, stat.version
        if self.OLD_SEPARATOR in data:
            return self._get_old()
        return json.loads(data), stat.version
676075
def get_catalog():
    
    tforms = {}
    for name, value in list(globals().items()):
        if name.endswith('Transform'):
            tforms[name] = value

    return Bunch.Bunch(tforms, caseless=True)
1072707
def get_emb_szs(self, sz_dict=None):
        ""
        return [def_emb_sz(self.classes, n, sz_dict) for n in self.cat_names]
1019742
def version(self):
        
        return [x for x in self.session.query(models.Version).all()]
869631
def get_mapping(self):  # TODO: rename to _as_dict
        
        return {
            key: val
            for key, val in self.__dict__.iteritems()
            if val
        }
1164843
def list(latest = false)
      result = []
      @os.map do |os, versions|
        unless latest
          versions.each { |version| result << {os: os, version: version}}
        else
          result << {os: os, version: versions.last} if versions.length > 0
        end
      end
      result
    end
144270
def ancestors_objects(self):
        """"""
        ancestors_objects = []
        for ancestor in self.ancestors:
            try:
                ancestor_object = GeoZone.objects.get(id=ancestor)
            except GeoZone.DoesNotExist:
                continue
            ancestors_objects.append(ancestor_object)
        ancestors_objects.sort(key=lambda a: a.name)
        return ancestors_objects
677881
def get_names(cs):
    """"""
    records = []
    for c in cs:
        records.extend(c.get('names', []))
    return records
1323371
private String[] getAlternateNames(String name) {
    String oldName, altNames[] = null;
    DeprecatedKeyInfo keyInfo = deprecatedKeyMap.get(name);
    if (keyInfo == null) {
      altNames = (reverseDeprecatedKeyMap.get(name) != null) ?
                   new String [] {reverseDeprecatedKeyMap.get(name)} : null;
      if (altNames != null && altNames.length > 0) {
        //To help look for other new configs for this deprecated config
        keyInfo = deprecatedKeyMap.get(altNames[0]);
      }
    }
    if (keyInfo != null && keyInfo.newKeys.length > 0) {
      List<String> list = new ArrayList<String>();
      if (altNames != null) {
        list.addAll(Arrays.asList(altNames));
      }
      list.addAll(Arrays.asList(keyInfo.newKeys));
      altNames = list.toArray(new String[list.size()]);
    }
    return altNames;
  }
159125
def _get_cache_contents(self):
        
        if not os.path.isdir(self._path):
            return []

        def sort_key(name):
            path, stamp = self._get_cache_dir(name)
            try:
                return os.stat(stamp).st_mtime
            except OSError:
                return 0

        names = os.listdir(self._path)
        names.sort(key=sort_key, reverse=True)
        return names
233764
def load_lists(keys=[], values=[], name='NT'):
    
    mapping = dict(zip(keys, values))
    return mapper(mapping, _nt_name=name)
728965
def get_list(self, name):
        ''''''
        normalized_name = normalize_name(name, self._normalize_overrides)
        return self._map[normalized_name]