Builds localized metazone name mapping.
484134
private void buildMetaZoneNames(MethodSpec.Builder method, TimeZoneData data) {
    CodeBlock.Builder code = CodeBlock.builder();
    code.beginControlFlow("\nthis.$L = new $T<$T, $T>() {", "metazoneNames", 
        HASHMAP, STRING, TIMEZONE_NAMES);
    
    for (MetaZoneInfo info : data.metaZoneInfo) {
      if (info.nameLong == null && info.nameShort == null) {
        continue;
      }
      code.add("\nput($S, new $T($S, ", info.zone, TIMEZONE_NAMES, info.zone);
      if (info.nameLong == null) {
        code.add("\n  null,");
      } else {
        code.add("\n  new $T.Name($S, $S, $S),", TIMEZONE_NAMES, 
            info.nameLong.generic, info.nameLong.standard, info.nameLong.daylight);
      }
      if (info.nameShort == null) {
        code.add("\n  null");
      } else {
        code.add("\n  new $T.Name($S, $S, $S)", TIMEZONE_NAMES, 
            info.nameShort.generic, info.nameShort.standard, info.nameShort.daylight);
      }
      code.add("));\n");
    }
    code.endControlFlow("}");
    method.addCode(code.build());
  }
1090225
def _localized_name(val, klass):
    """"""
    try:
        (text, lang) = val
        return klass(text=text, lang=lang)
    except ValueError:
        return klass(text=val, lang="en")
1047820
def _context_names():
    """"""
    import inspect

    from renku.models import provenance
    from renku.models._jsonld import JSONLDMixin

    for name in dir(provenance):
        cls = getattr(provenance, name)
        if inspect.isclass(cls) and issubclass(cls, JSONLDMixin):
            yield name
451724
public static ZoneInfo of(String name, String dnsName, String description) {
    return new BuilderImpl(name).setDnsName(dnsName).setDescription(description).build();
  }
911117
def _set_zone_name(self, zoneid, name):
        """"""
        # zone starts with index 0
        zoneid -= 1
        data = {
            '_set_zone_name': 'Set Name',
            'select_zone': str(zoneid),
            'zone_name': name,
        }
        self._controller.post(data)
427132
def createSimpleResourceMap(ore_pid, sci_meta_pid, data_pids):
    """"""
    ore = ResourceMap()
    ore.initialize(ore_pid)
    ore.addMetadataDocument(sci_meta_pid)
    ore.addDataDocuments(data_pids, sci_meta_pid)
    return ore
1070104
void addUrlNameMapping(String name, Locale locale, CmsUUID structureId) {

        m_urlNameMappingEntries.add(new InternalUrlNameMappingEntry(structureId, name, locale));
    }
1211062
def standardizeMapName(mapName):
    """"""
    #print("foreignName: %s  (%s)"%(mapName, mapName in c.mapNameTranslations))
    #if mapName in c.mapNameTranslations:
    #    return c.mapNameTranslations[mapName]
    newName = os.path.basename(mapName)
    newName = newName.split(".")[0]
    newName = newName.split("(")[0]
    newName = re.sub("[LT]E+$", "", newName)
    newName = re.sub("-", "", newName)
    newName = re.sub(' ', '', newName, flags=re.UNICODE)
    foreignName = newName#bytes(mapName, 'utf-16')
    #print("foreignName: %s  (%s)"%(foreignName, foreignName in c.mapNameTranslations))
    if foreignName in c.mapNameTranslations:
        return c.mapNameTranslations[foreignName]
    return newName
1139475
def _get_zone_id_from_name(self, name):
        """"""
        results = self.client['Account'].getDomains(
            filter={"domains": {"name": utils.query_filter(name)}})
        return [x['id'] for x in results]
1355609
def _get_po_paths(locales=[]):
    """"""
    basedirs = [os.path.join('conf', 'locale'), 'locale']
    if os.environ.get('DJANGO_SETTINGS_MODULE'):
        from django.conf import settings
        basedirs.extend(settings.LOCALE_PATHS)

    # Gather existing directories.
    basedirs = set(map(os.path.abspath, filter(os.path.isdir, basedirs)))

    if not basedirs:
        raise CommandError("This script should be run from the Django SVN tree or your project or app tree, or with the settings module specified.")

    po_paths = []
    for basedir in basedirs:
        for locale in locales:
            basedir_locale = os.path.join(basedir, locale, 'LC_MESSAGES')
            for dirpath, dirnames, filenames in os.walk(basedir_locale):
                for f in filenames:
                    if f.endswith('.po'):
                        po_paths.append(os.path.join(dirpath, f))
    return po_paths
347343
private function buildToOneAssociationMappings(Mapping\ClassMetadata $metadata)
    {
        $tableName   = $metadata->getTableName();
        $primaryKeys = $this->getTablePrimaryKeys($this->tables[$tableName]);
        $foreignKeys = $this->getTableForeignKeys($this->tables[$tableName]);

        foreach ($foreignKeys as $foreignKey) {
            $foreignTableName   = $foreignKey->getForeignTableName();
            $fkColumns          = $foreignKey->getColumns();
            $fkForeignColumns   = $foreignKey->getForeignColumns();
            $localColumn        = current($fkColumns);
            $associationMapping = [
                'fieldName'    => $this->getFieldNameForColumn($tableName, $localColumn, true),
                'targetEntity' => $this->getClassNameForTable($foreignTableName),
            ];

            if ($metadata->getProperty($associationMapping['fieldName'])) {
                $associationMapping['fieldName'] .= '2'; // "foo" => "foo2"
            }

            if ($primaryKeys && in_array($localColumn, $primaryKeys, true)) {
                $associationMapping['id'] = true;
            }

            for ($i = 0, $l = count($fkColumns); $i < $l; $i++) {
                $joinColumn = new Mapping\JoinColumnMetadata();

                $joinColumn->setColumnName($fkColumns[$i]);
                $joinColumn->setReferencedColumnName($fkForeignColumns[$i]);

                $associationMapping['joinColumns'][] = $joinColumn;
            }

            // Here we need to check if $fkColumns are the same as $primaryKeys
            if (! array_diff($fkColumns, $primaryKeys)) {
                $metadata->addProperty($associationMapping);
            } else {
                $metadata->addProperty($associationMapping);
            }
        }
    }
83263
function buildElastiCacheSubnetGroup(numZones = 0, { name = 'ElastiCacheSubnetGroup' } = {}) {
  if (numZones < 1) {
    return {};
  }

  const subnetIds = [];
  for (let i = 1; i <= numZones; i += 1) {
    subnetIds.push({ Ref: `${DB_SUBNET}Subnet${i}` });
  }

  return {
    [name]: {
      Type: 'AWS::ElastiCache::SubnetGroup',
      Properties: {
        CacheSubnetGroupName: {
          Ref: 'AWS::StackName',
        },
        Description: {
          Ref: 'AWS::StackName',
        },
        SubnetIds: subnetIds,
      },
    },
  };
}
594027
@Override
    public Resource qualifiedNameToResource(QualifiedName name) {
	String unescapedLocalName = qnU.unescapeProvLocalName(name.getLocalPart());
	if (isBlankName(name)) {
	    return new BNodeImpl(unescapedLocalName);
	} else {
	    return new URIImpl(name.getNamespaceURI() + unescapedLocalName);

	}
    }
505086
def labels_for_zone(zone):
    '''
    
    '''
    labels = set([zone.name, zone.code] + zone.keys_values)
    for lang in current_app.config['LANGUAGES'].keys():
        with language(lang):
            labels.add(_(zone.name))
    return list(labels)
739037
def reload_localzone():
    """"""
    global _cache_tz
    _cache_tz = pytz.timezone(get_localzone_name())
    utils.assert_tz_offset(_cache_tz)
    return _cache_tz
1011610
public void populateL10nStrings() {
    AllPropertiesMessageSource allPropertiesMessageSource = new AllPropertiesMessageSource();
    String[] namespaces =
        localizationMessageSources
            .stream()
            .map(PropertiesMessageSource::getNamespace)
            .toArray(String[]::new);
    allPropertiesMessageSource.addMolgenisNamespaces(namespaces);
    localizationPopulator.populateLocalizationStrings(allPropertiesMessageSource);
  }
863069
private void buildSymbolsMap()
    {
        int sid = myFirstLocalSid;
        for (int i = 0; i < mySymbolNames.length; i++, sid++)
        {
            String symbolText = mySymbolNames[i];
            if (symbolText != null)
            {
                putToMapIfNotThere(mySymbolsMap, symbolText, sid);
            }
        }
    }