For debug only ... Write a schema name(id) details
349119
private static String debugSchema(JMFSchema schema) {
    if (schema != null)
      return schema.getName() + "(" + Long.toHexString(schema.getID()) + ")";
    else
      return "<null>";
  }
718148
private String getDbTableName(String schemaName) {
    Preconditions.checkArgument(schemaName.matches(".+_.+_.+"));
    return schemaName.replaceFirst("_", ".").substring(0, schemaName.lastIndexOf('_'));
  }
173428
public void writeMetadataDocument() throws ODataRenderException {

        try {
            xmlWriter.writeStartElement(EDMX_NS, EDMX);
            xmlWriter.writeNamespace(EDMX_PREFIX, EDMX_NS);
            xmlWriter.writeAttribute(VERSION, ODATA_VERSION);
            xmlWriter.writeStartElement(EDMX_NS, EDMX_DATA_SERVICES);

            boolean entityContinerWritten = false;
            // Loop over all the schemas present in the Entity Data Model
            for (Schema schema : entityDataModel.getSchemas()) {
                xmlWriter.writeStartElement(SCHEMA);
                xmlWriter.writeDefaultNamespace(EDM_NS);
                xmlWriter.writeAttribute(NAMESPACE, schema.getNamespace());
                for (Type type : schema.getTypes()) {
                    switch (type.getMetaType()) {
                        case ENTITY:
                            entityTypeWriter.write((EntityType) type);
                            break;
                        case COMPLEX:
                            complexTypeWriter.write((ComplexType) type);
                            break;
                        case ENUM:
                            enumTypeWriter.write((EnumType) type);
                            break;
                        default:
                            LOG.error("Unexpected type: {}", type.getFullyQualifiedName());
                            throw new ODataRenderException("Unexpected type: " + type.getFullyQualifiedName());
                    }
                }
                if (!entityContinerWritten) {
                    writeEntityContainer(entityDataModel.getEntityContainer());
                    entityContinerWritten = true;
                }

                // End of <Schema> element
                xmlWriter.writeEndElement();
            }

            xmlWriter.writeEndElement();
        } catch (XMLStreamException e) {
            LOG.error("Not possible to start stream XML");
            throw new ODataRenderException("Not possible to start stream XML: ", e);
        }
    }
617910
function generateSchemaFile( $schema, $params = array() )
    {
        $sql = '';

        $i = 0;
        foreach ( $schema as $table => $tableDef )
        {
            // Skip the info structure, this is not a table
            if ( $table == '_info' )
                continue;

            if ( $i > 0 )
                $sql .= "\n\n";
            $sql .= $this->generateTableSchema( $table, $tableDef, $params );
            ++$i;
        }

        return $sql;
    }
1011341
SchemaProperty createDatabaseSchema(final App app, final AbstractSchemaNode schemaNode) throws FrameworkException {

		final PropertyMap getOrCreateProperties = new PropertyMap();
		final PropertyMap updateProperties      = new PropertyMap();

		getOrCreateProperties.put(SchemaProperty.name, getName());
		getOrCreateProperties.put(SchemaProperty.schemaNode, schemaNode);

		SchemaProperty property = app.nodeQuery(SchemaProperty.class).and(getOrCreateProperties).getFirst();
		if (property == null) {

			getOrCreateProperties.put(SchemaProperty.compound, isCompoundUnique());
			getOrCreateProperties.put(SchemaProperty.unique, isUnique());
			getOrCreateProperties.put(SchemaProperty.indexed, isIndexed());
			getOrCreateProperties.put(SchemaProperty.notNull, isRequired());
			getOrCreateProperties.put(SchemaProperty.readOnly, isReadOnly());
			getOrCreateProperties.put(SchemaProperty.format, getFormat());
			getOrCreateProperties.put(SchemaProperty.hint, getHint());
			getOrCreateProperties.put(SchemaProperty.category, getCategory());
			getOrCreateProperties.put(SchemaProperty.validators, validators.toArray(new String[0]));
			getOrCreateProperties.put(SchemaProperty.transformers, transformers.toArray(new String[0]));
			getOrCreateProperties.put(SchemaProperty.defaultValue, defaultValue);

			property = app.create(SchemaProperty.class, getOrCreateProperties);
		}

		if (parent != null) {

			final JsonSchema root = parent.getSchema();
			if (root != null) {

				if (SchemaService.DynamicSchemaRootURI.equals(root.getId())) {

					updateProperties.put(SchemaProperty.isPartOfBuiltInSchema, true);
				}
			}
		}

		// update properties
		property.setProperties(SecurityContext.getSuperUserInstance(), updateProperties);

		// return modified property
		return property;
	}
571589
def _prepend_schema_name(self, message):
        
        if self._name:
            message = "{0!r} {1!s}".format(self._name, message)
        return message
709684
SchemaMethodParameter createDatabaseSchema(final App app, final SchemaMethod schemaMethod, final int index) throws FrameworkException {

		final PropertyMap getOrCreateProperties = new PropertyMap();
		final PropertyMap updateProperties      = new PropertyMap();

		getOrCreateProperties.put(SchemaMethodParameter.name,         getName());
		getOrCreateProperties.put(SchemaMethodParameter.schemaMethod, schemaMethod);

		SchemaMethodParameter parameter = app.nodeQuery(SchemaMethodParameter.class).and(getOrCreateProperties).getFirst();
		if (parameter == null) {

			parameter = app.create(SchemaMethodParameter.class, getOrCreateProperties);
		}

		updateProperties.put(SchemaMethodParameter.parameterType, type);
		updateProperties.put(SchemaMethodParameter.index, index);

		// update properties
		parameter.setProperties(SecurityContext.getSuperUserInstance(), updateProperties);

		// return modified property
		return parameter;
	}
780412
def schema(self):
        
        if self.status == "DELETING":
            return ""
        parts = ["GLOBAL", self.index_type, "INDEX"]
        parts.append("('%s', %s," % (self.name, self.hash_key.name))
        if self.range_key:
            parts.append("%s," % self.range_key.name)
        if self.includes:
            parts.append("[%s]," % ", ".join(("'%s'" % i for i in self.includes)))

        parts.append(
            "THROUGHPUT (%d, %d))" % (self.read_throughput, self.write_throughput)
        )
        return " ".join(parts)
1178323
def print_schemas(self):
        '''
        
        '''
        self.indent_depth += 1
        for i in self.definitions:
            def_name = i.split('/')[-1]
            self.write('.. _{}:'.format(def_name))
            self.write('')
            self.write('{} Schema'.format(def_name))
            self.write('{}'.format('`' * (len(def_name) + 7)))
            self.write('')
            self.write('.. code-block:: json', self.indent_depth)
            self.indent_depth += 1
            self.write('')
            self.definition_rst(def_name)
            self.indent_depth -= 1
            self.write('')
            self.write('')
        self.indent_depth -= 1
756263
private static boolean setName(String ns, String name, Schema property) {
        boolean apply = false;
        final String cleanName = StringUtils.trimToNull(name);
        final String useName;
        if (!isEmpty(cleanName) && !cleanName.equals(((SchemaImpl) property).getName())) {
            useName = cleanName;
            apply = true;
        } else {
            useName = null;
        }
        final String cleanNS = StringUtils.trimToNull(ns);
        final String useNS;
        if (!isEmpty(cleanNS)) {
            useNS = cleanNS;
            apply = true;
        } else {
            useNS = null;
        }
        // Set everything or nothing
        if (apply) {
            getXml(property).name(useName).namespace(useNS);
        }
        return apply;
    }
872715
def document(schema_file):
    ''''''
    schema = load_schema_file(open(schema_file, 'r'))
    documentation = generate_documentation(schema)
    sys.stdout.write(documentation)
640434
def cli_schema(self, *args):
        """"""

        key = None
        if len(args) > 1:
            key = args[1]
            args = list(args)

        if '-config' in args or '-c' in args:
            store = configschemastore
            try:
                args.remove('-c')
                args.remove('-config')
            except ValueError:
                pass
        else:
            store = schemastore

        def output(schema):
            self.log("%s :" % schema)
            if key == 'props':
                self.log(store[schema]['schema']['properties'], pretty=True)
            elif key == 'perms':
                try:
                    self.log(store[schema]['schema']['roles_create'], pretty=True)
                except KeyError:
                    self.log('Schema', schema, 'has no role for creation', lvl=warn)
                try:
                    self.log(store[schema]['schema']['properties']['perms']['properties'], pretty=True)
                except KeyError:
                    self.log('Schema', schema, 'has no permissions', lvl=warn)
            else:
                self.log(store[schema]['schema'], pretty=True)

        if '*' in args:
            for schema in store:
                output(schema)
        else:
            output(args[0])
907022
function Schema(options, descriptors) {

    if (!descriptors) {
        descriptors = options;
        options = null;
    }

    function opt(name, type) {
        var value = options[name];
        if (value !== undefined) {
            if (typeof value === type) return value;
            else throw new TypeError(current + 'options : ' + name + ': "' +
                value + '" is not of type [' + type + ']');
        }
        else return false;
    }

    var current = 'Schema: arguments: ',
        defaults = { required: false };

    if (hasValue(options)) {
        if (type(options) === 'object') {
            defaults.required = opt('required', 'boolean');
            if (opt('validator', 'function')) defaults.validator = options.validator;
        }
        else throw new TypeError(current + 'options: must be of type [object]');
    }

    current += 'descriptors: ';
    if (typeof descriptors !== 'object')
        throw new TypeError(current + 'must be of type [object]');
    if (!Array.isArray(descriptors)) {
        descriptors = this.toDescriptors(descriptors, defaults);
    }
    if (options && options.extends instanceof Schema) {
        descriptors = this.extendDescriptors(descriptors, options.extends.descriptors);
    }
    if (!descriptors.length)
        throw new TypeError(current + 'contains no values');
    else if (!(descriptors[0] instanceof Descriptor)) {
        throw new TypeError(current + 'must be instances of Descriptor class');
    }
    var instance = this;
    this.descriptors = descriptors;

}
404042
def schema():
        """"""
        return Schema({
            'script': And(Or(type(' '), type(u' ')), len),
            Optional('title', default=''): str,
            Optional('model', default={}): {Optional(And(str, len)): object},
            Optional('env', default={}): {Optional(And(str, len)): And(str, len)},
            Optional('item', default=None): object,
            Optional('dry_run', default=False): bool,
            Optional('debug', default=False): bool,
            Optional('strict', default=False): bool,
            Optional('variables', default={}): {
                Optional(And(Or(type(' '), type(u' ')), len, Regex(r'([a-zA-Z][_a-zA-Z]*)'))):
                    Or(type(' '), type(u' '))
            },
            Optional('temporary_scripts_path', default=''): Or(type(''), type(u'')),
            Optional('internal', default=False): bool
        })
701092
private void generateOpen(String schemaName) {
		MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("open")
				.addModifiers(Modifier.PUBLIC, Modifier.STATIC).returns(className(schemaName));

		methodBuilder.addJavadoc("Retrieve data source instance and open it.\n");
		methodBuilder.addJavadoc("@return opened dataSource instance.\n");

		methodBuilder.addStatement("$L instance=getInstance()", schemaName);

		methodBuilder.addStatement("instance.openWritableDatabase()");
		methodBuilder.addCode("return instance;\n");

		classBuilder.addMethod(methodBuilder.build());
	}
123881
public function setSchemaByName($schema_name = null)
    {
        if (! $schema_name) {
            $schema_name = $this->namespace;
        }
        if (strpos($schema_name, '.') === false) {
            $schema_name = (String) $this->db . '.' . $schema_name;
        }

        // Check formats
        if ($this->client->schema_format === 'php') {
            $schema_file = $this->client->schema_dir . '/' . $schema_name . '.php';
            if (file_exists($schema_file)) {
                $schema = include $schema_file;
                if (! is_array($schema)) {
                    throw new \Exception('Possible PHP syntax error in ' . $schema_file);
                }
            }
        } elseif ($this->client->schema_format === 'json') {
            $schema_file = $this->client->schema_dir . '/' . $schema_name . '.json';
            if (file_exists($schema_file)) {
                $json_string = file_get_contents($schema_file);
                $schema = json_decode($json_string, true);
                if (empty($schema)) {
                    throw new \Exception('Possible JSON parse error in ' . $schema_file);
                }
            }
        } else {
            throw new \Exception('Unknown schema format: ' . $this->client->schema_format);
        }

        // Assign Schema
        if (! empty($schema)) {
            $this->setSchema($schema);
        }

    }
657058
def schema_id(origin_did: str, name: str, version: str) -> str:
    

    return '{}:2:{}:{}'.format(origin_did, name, version)