Creates a new metadata cache instance appropriate for this platform.
359183
def _create_metadata_cache(cache_location):
    
    cache_url = os.getenv('GUTENBERG_FUSEKI_URL')
    if cache_url:
        return FusekiMetadataCache(cache_location, cache_url)

    try:
        return SleepycatMetadataCache(cache_location)
    except InvalidCacheException:
        logging.warning('Unable to create cache based on BSD-DB. '
                        'Falling back to SQLite backend. '
                        'Performance may be degraded significantly.')

    return SqliteMetadataCache(cache_location)
525903
def add_custom_metadata(self, key, value, meta_type=None):
        
        self.metadata.append({'key': key, 'value': value, 'type': meta_type})
204352
def set_metadata(self, key, metadata):
        
        with self._lock:
            self._metadata[key] = metadata
726092
@Override
  public Metadata createMetadata() {
    Metadata metadata = new Metadata();
    try {
      for (DataSet ds : iimFile.getDataSets()) {
        Object value = "";
        try {
          value = ds.getValue();
        } catch (Exception ex) {

        }
        DataSetInfo info = ds.getInfo();
        //System.out.println(info.toString() + " " + info.getName() + ": " + value);

        metadata.add(info.getName(), new Text(value.toString()));
      }
    } catch (Exception ex) {
      /*Nothing to be shown*/
    }

    return metadata;
  }
266215
@Override
    public void create(SchemaMigrationMetadata metadata) {
        session.execute(
                insertInto(METADATA_TABLE)
                        .ifNotExists()
                        .value(ID_COL, metadata.getId())
                        .value(INDEX_COL, metadata.getIndex())
                        .value(TOKEN_COL, metadata.getToken())
                        .value(STATUS_COL, metadata.getStatus().name())
                        .value(FINGERPRINT_COL, metadata.getFingerprint()));
    }
141822
protected function createCacheAdapter()
    {
        $adapter = new Adapter\File($this->options['files_cache_directory']);
        $adapter->setOption('ttl', $this->options['files_cache_ttl']);

        return new Cache($adapter);
    }
1234003
private function createFileCache($subClassName, array $cacheConfig, ContainerBuilder $container)
    {
        $cacheDir = $this->getFileCacheDir($cacheConfig, $container);
        Utility::appendParameter('dirs', 'metadata_cache_dir', $cacheDir, $container);

        return new Definition(
            Utility::getLibraryClass($subClassName),
            [$cacheDir]
        );
    }
781834
public static <T extends Entity<?>> T newInstance(final Class<T> clazz) {
    return meta.newInstance(clazz);
  }
1283571
def create_cookbook(metadata, overrides = {})
        cookbook = Cookbook.new({
          :name        => metadata.name,
          :category    => nil,
          :maintainer  => metadata.maintainer,
          :description => metadata.description,
          :version     => metadata.version
        }.merge(overrides))

        store.add(cookbook)

        cookbook
      end
837082
private EntityMetadata build(Class<V> clazz) throws MetadataException {
        return EntityMetadata.buildEntityMetadata(clazz, getCassandraClient());
    }
182754
public static EmbeddedCacheManager create(long idleTime) {
        Configuration configuration = new ConfigurationBuilder()
                .expiration().maxIdle(idleTime, TimeUnit.SECONDS)
                .build();
        return new DefaultCacheManager(configuration);
    }
1286226
def create(self, name, metadata=None, prefix=None, *args, **kwargs):
        
        uri = "/%s" % name
        headers = {}
        if prefix is None:
            prefix = CONTAINER_META_PREFIX
        if metadata:
            metadata = _massage_metakeys(metadata, prefix)
            headers = metadata
        resp, resp_body = self.api.method_put(uri, headers=headers)
        if resp.status_code in (201, 202):
            hresp, hresp_body = self.api.method_head(uri)
            num_obj = int(hresp.headers.get("x-container-object-count", "0"))
            num_bytes = int(hresp.headers.get("x-container-bytes-used", "0"))
            cont_info = {"name": name, "object_count": num_obj,
                    "total_bytes": num_bytes}
            return Container(self, cont_info)
        elif resp.status_code == 400:
            raise exc.ClientException("Container creation failed: %s" %
                    resp_body)
802900
public Metadata createMetadata() {
    Metadata metadata = new Metadata();
    for (TagValue tag : getMetadata().getTags()) {
      if (tag.getCardinality() == 1) {
        abstractTiffType t = tag.getValue().get(0);
        if (t.isIFD()) {
          Metadata metadata2 = ((IFD) t).createMetadata();
          for (String key : metadata2.keySet()) {
            metadata.add(key, metadata2.get(key));
          }
        } else if (t.containsMetadata()) {
          try {
            Metadata meta = t.createMetadata();
            metadata.addMetadata(meta);
          } catch (Exception ex) {
            // TODO: What?
          }
        }
      }
    }
    return metadata;
  }
388848
public Metadata registerMetadata(String name, Connector c, File archive)
   {
      Metadata md = new MetadataImpl(name, c, archive);
      metadataRepository.registerMetadata(md);
      return md;
   }
1245219
public static <K, V> Cache<K, V> createCache(int maximumSize, long expiryDurationSeconds) {
        Cache<K, V> cache = CacheBuilder.newBuilder().maximumSize(maximumSize)
                .expireAfterAccess(expiryDurationSeconds, TimeUnit.SECONDS).build();
        return cache;
    }
802553
def create_cache(self, **kwargs):
        
        cache = predix.admin.cache.Cache(**kwargs)
        cache.create(**kwargs)
        cache.add_to_manifest(self)
        return cache
417433
def create_new_metadata(self, rsa_public_key):
        # type: (EncryptionMetadata,
        #        cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey)
        #        -> None
        
        self._rsa_public_key = rsa_public_key
        self._symkey = os.urandom(
            blobxfer.operations.crypto._AES256_KEYLENGTH_BYTES)
        self._signkey = os.urandom(
            blobxfer.operations.crypto._AES256_KEYLENGTH_BYTES)
        self.content_encryption_iv = os.urandom(AES256_BLOCKSIZE_BYTES)
        self.encryption_agent = EncryptionAgent(
            encryption_algorithm=EncryptionMetadata._ENCRYPTION_ALGORITHM,
            protocol=EncryptionMetadata._ENCRYPTION_PROTOCOL_VERSION,
        )
        self.encryption_mode = EncryptionMetadata._ENCRYPTION_MODE