Method: schemaLocationAttr
Generate the xsi:schemaLocation attribute value.

Returns:
{String} The xsi:schemaLocation attribute or undefined if none.
763942
function(options) {
        options = OpenLayers.Util.extend({
            featurePrefix: this.featurePrefix,
            schema: this.schema
        }, options);
        var schemaLocations = OpenLayers.Util.extend({}, this.schemaLocations);
        if(options.schema) {
            schemaLocations[options.featurePrefix] = options.schema;
        }
        var parts = [];
        var uri;
        for(var key in schemaLocations) {
            uri = this.namespaces[key];
            if(uri) {
                parts.push(uri + " " + schemaLocations[key]);
            }
        }
        var value = parts.join(" ") || undefined;
        return value;
    }
931565
function() {
      // if we have no publish lookup table, we have no attributes to take
      // TODO(sjmiles): ad hoc
      if (this._publishLC) {
        for (var i=0, a$=this.attributes, l=a$.length, a; (a=a$[i]) && i<l; i++) {
          this.attributeToProperty(a.name, a.value);
        }
      }
    }
991997
function SchemaMoment(key, options) {
		SchemaType.call(this, key, options);

		this.get(function(val, self){
			if(!val){
				return val;
			} else {
				return new Moment(val);
			}
		});
	}
1219628
function instrumentAst(ast, getNextLocationNumber) {
  function createRecordLocationExpression() {
    return {
      type: 'CallExpression',
      callee: {
        type: 'Identifier',
        name: 'recordLocation'
      },
      arguments: [{ type: 'Literal', value: getNextLocationNumber() }]
    };
  }

  function createRecordLocationStatement() {
    return {
      type: 'ExpressionStatement',
      expression: createRecordLocationExpression()
    };
  }

  const binaryOperatorsToWrap = new Set([
    '===',
    '!==',
    '==',
    '<',
    '<=',
    '>',
    '>='
  ]);

  const magicValues = new Set();

  ast = estraverse.replace(ast, {
    enter(node) {
      if (
        node.type === 'CallExpression' &&
        ((node.callee.type === 'Identifier' &&
          node.callee.name === 'require') ||
          node.callee.type === 'Import') &&
        node.arguments.length === 1 &&
        node.arguments[0].type === 'Literal' &&
        typeof node.arguments[0].value === 'string'
      ) {
        // Module names passed to require(...) aren't really magic, skip them:
        return this.skip();
      } else if (
        node.type === 'ImportDeclaration' ||
        node.type === 'ExportNamedDeclaration'
      ) {
        return this.skip();
      } else if (
        node.type === 'Literal' &&
        (typeof node.value === 'string' || typeof node.value === 'number')
      ) {
        magicValues.add(node.value);
      }
    },

    leave(node) {
      if (
        node.type === 'CallExpression' &&
        node.callee.type === 'Identifier' &&
        (node.callee.name === 'recordLocation' ||
          node.callee.name === 'recordProximity')
      ) {
        // Skip the injected instrumentation code so we don't gather magic values from it :)
        return this.skip();
      } else if (
        node.type === 'BinaryExpression' &&
        binaryOperatorsToWrap.has(node.operator)
      ) {
        return {
          type: 'CallExpression',
          callee: {
            type: 'Identifier',
            name: 'recordProximity'
          },
          arguments: [
            node.left,
            { type: 'Literal', value: node.operator },
            node.right
          ]
        };
      } else if (
        node.type === 'FunctionDeclaration' ||
        node.type === 'FunctionExpression' ||
        node.type === 'ArrowFunctionExpression'
      ) {
        if (node.body.type === 'BlockStatement') {
          node.body.body.unshift(createRecordLocationStatement());
        } else {
          // *Expression
          node.body = {
            type: 'SequenceExpression',
            expressions: [createRecordLocationExpression(), node.body]
          };
        }
      } else if (node.type === 'IfStatement') {
        if (node.consequent.type !== 'BlockStatement') {
          node.consequent = {
            type: 'BlockStatement',
            body: [node.consequent]
          };
        }
        node.consequent.body.unshift(createRecordLocationStatement());
        if (node.alternate) {
          if (node.alternate.type !== 'BlockStatement') {
            node.alternate = {
              type: 'BlockStatement',
              body: [node.alternate]
            };
          }
        } else {
          node.alternate = {
            type: 'BlockStatement',
            body: []
          };
        }
        node.alternate.body.unshift(createRecordLocationStatement());
      } else if (
        node.type === 'WhileStatement' ||
        node.type === 'DoWhileStatement' ||
        node.type === 'ForStatement' ||
        node.type === 'ForInStatement' ||
        node.type === 'ForOfStatement'
      ) {
        if (node.body.type === 'EmptyStatement') {
          node.body = {
            type: 'BlockStatement',
            body: []
          };
        } else if (node.body.type !== 'BlockStatement') {
          node.body = {
            type: 'BlockStatement',
            body: [node.body]
          };
        }
        node.body.body.unshift(createRecordLocationStatement());
      } else if (node.type === 'TryStatement') {
        if (node.handler) {
          node.handler.body.body.unshift(createRecordLocationStatement());
        }
      } else if (node.type === 'SwitchStatement') {
        for (const switchCaseNode of node.cases) {
          switchCaseNode.consequent.unshift(createRecordLocationStatement());
        }
      } else if (node.type === 'ConditionalExpression') {
        node.consequent = {
          type: 'SequenceExpression',
          expressions: [createRecordLocationExpression(), node.consequent]
        };
        node.alternate = {
          type: 'SequenceExpression',
          expressions: [createRecordLocationExpression(), node.alternate]
        };
      } else if (
        node.type === 'LogicalExpression' ||
        node.type === 'AssignmentPattern'
      ) {
        node.right = {
          type: 'SequenceExpression',
          expressions: [createRecordLocationExpression(), node.right]
        };
      }
    }
  });
  return { instrumentedAst: ast, magicValues };
}
800960
def _get_attributes(schema, location):
        """"""
        schema = DottedNameResolver(__name__).maybe_resolve(schema)

        def _filter(attr):
            if not hasattr(attr, "location"):
                valid_location = 'body' in location
            else:
                valid_location = attr.location in to_list(location)
            return valid_location

        return list(filter(_filter, schema().children))
279551
function(schema, definitions) {

    if (typeof schema['default'] !== 'undefined') {

      return schema['default'];

    } else if (typeof schema.allOf !== 'undefined') {

      var mergedItem = mergeAllOf(schema.allOf, definitions);
      return defaults(mergedItem, definitions);

    } else if (typeof schema.$ref !== 'undefined') {

      var reference = getLocalRef(schema.$ref, definitions);
      return defaults(reference, definitions);

    } else if (schema.type === 'object') {

      if (!schema.properties) { return {}; }

      for (var key in schema.properties) {
        if (schema.properties.hasOwnProperty(key)) {
          schema.properties[key] = defaults(schema.properties[key], definitions);

          if (typeof schema.properties[key] === 'undefined') {
            delete schema.properties[key];
          }
        }
      }

      return schema.properties;

    } else if (schema.type === 'array') {

      if (!schema.items) { return []; }

      // minimum item count
      var ct = schema.minItems || 0;
      // tuple-typed arrays
      if (schema.items.constructor === Array) {
        var values = schema.items.map(function (item) {
          return defaults(item, definitions);
        });
        // remove undefined items at the end (unless required by minItems)
        for (var i = values.length - 1; i >= 0; i--) {
          if (typeof values[i] !== 'undefined') {
            break;
          }
          if (i + 1 > ct) {
            values.pop();
          }
        }
        return values;
      }
      // object-typed arrays
      var value = defaults(schema.items, definitions);
      if (typeof value === 'undefined') {
        return [];
      } else {
        var values = [];
        for (var i = 0; i < Math.max(1, ct); i++) {
          values.push(cloneJSON(value));
        }
        return values;
      }

    }

  }
989123
function generateModelDefinition () {
    var definition = {};
    var schema = controller.model().schema;

    definition.id = capitalize(controller.model().singular());
    definition.properties = {};

    Object.keys(schema.paths).forEach(function (name) {
      var path = schema.paths[name];
      var property = generatePropertyDefinition(name, path);
      definition.properties[name] = property;
    });

    Object.keys(schema.virtuals).forEach(function (name) {
      var path = schema.virtuals[name];
      var property = generatePropertyDefinition(name, path);
      definition.properties[name] = property;
    });

    return definition;
  }
320797
def get_schemaloc_pairs(node):
    
    schemalocs = node.attrib[TAG_SCHEMALOCATION]
    l = schemalocs.split()
    return zip(l[::2], l[1::2])
801217
function getValueToValidate (schema, value) {
  // Is the value empty?
  if (value === undefined || value === "" ||
    (schema.type === "object" && _.isObject(value) && _.isEmpty(value))) {

    // It's blank, so return the default/example value (if there is one)
    if (schema.default !== undefined) {
      value = schema.default;
    }
    else if (schema.example !== undefined) {
      value = schema.example;
    }
  }

  // Special case for Buffers
  if (value && value.type === "Buffer" && _.isArray(value.data)) {
    value = new Buffer(value.data);
  }

  // It's not empty, so return the existing value
  return value;
}
895404
def get_uri_schemaloc_map(self):
        """"""
        mapping = {}

        for ni in six.itervalues(self.__ns_uri_map):
            if ni.schema_location:
                mapping[ni.uri] = ni.schema_location

        return mapping
437550
def _load_schema(self, location, xml=None):
        
        cachedir = self._cachedir
        # wsdl2py: deal with XML Schema
        if not os.path.isdir(cachedir): os.mkdir(cachedir)
    
        file = os.path.join(cachedir, '.cache')
        section = 'TYPES'
        cp = ConfigParser()
        try:
            cp.readfp(open(file, 'r'))
        except IOError:
            del cp;  cp = None
            
        option = location.replace(':', '-') # colons seem to screw up option
        if (cp is not None and cp.has_section(section) and 
            cp.has_option(section, option)):
            types = cp.get(section, option)
        else:
            # dont do anything to anames
            if not self._pyclass:
                containers.ContainerBase.func_aname = lambda instnc,n: str(n)
                
            from pyremotevbox.ZSI.wstools import XMLSchema
            reader = XMLSchema.SchemaReader(base_url=location)
            if xml is not None and isinstance(xml, basestring):
                schema = reader.loadFromString(xml)
            elif xml is not None:
                raise RuntimeError, 'Unsupported: XML must be string'
            elif not os.path.isfile(location):
                schema = reader.loadFromURL(location)
            else:
                schema = reader.reader.loadFromFile(location)
                
            # TODO: change this to keyword list
            class options:
                output_dir = cachedir
                schema = True
                simple_naming = False
                address = False
                lazy = self._lazy
                complexType = self._pyclass

            schema.location = location
            files = commands._wsdl2py(options, schema)
            if cp is None: cp = ConfigParser()
            if not cp.has_section(section): cp.add_section(section)
            types = filter(lambda f: f.endswith('_types.py'), files)[0]
            cp.set(section, option, types)
            cp.write(open(file, 'w'))
            
        if os.path.abspath(cachedir) not in sys.path:
            sys.path.append(os.path.abspath(cachedir))
            
        mod = os.path.split(types)[-1].rstrip('.py')
        return __import__(mod)
779154
function(context, options) {
        var name = "OWSContext";
        this.nestingLayerLookup = {}; //start with empty lookup
        options = options || {};
        OpenLayers.Util.applyDefaults(options, context);
        var root = this.writeNode(name, options);
        this.nestingLayerLookup = null; //clear lookup
        this.setAttributeNS(
            root, this.namespaces["xsi"],
            "xsi:schemaLocation", this.schemaLocation
        );
        return OpenLayers.Format.XML.prototype.write.apply(this, [root]);
    }
62422
function schemaToEdmDocument(schema) {
    var doc = new XDocument();
    var rootElement = doc.createElement("edmx:Edmx");
    rootElement.setAttribute("xmlns:edmx", "http://docs.oasis-open.org/odata/ns/edmx");
    rootElement.setAttribute("Version","4.0");
    doc.appendChild(rootElement);
    var dataServicesElement = doc.createElement("edmx:DataServices");
    var schemaElement = doc.createElement("Schema");
    schemaElement.setAttribute("xmlns", "http://docs.oasis-open.org/odata/ns/edm");
    if (schema.namespace) {
        schemaElement.setAttribute("Namespace", schema.namespace);
    }
    var actionElements = [], functionElements = [];
    //append edmx:DataServices > Schema
    dataServicesElement.appendChild(schemaElement);
    _.forEach(schema.entityType,
        /**
         *
         * @param {EntityTypeConfiguration} entityType
         */
        function(entityType) {

            //search for bound actions
            _.forEach(entityType.actions.concat(entityType.collection.actions), function(action) {
                var actionElement = doc.createElement("Action");
                actionElement.setAttribute("Name", action.name);
                actionElement.setAttribute("IsBound", true);
                if (action.isComposable) {
                    actionElement.setAttribute("IsComposable", action.isComposable);
                }
                _.forEach(action.parameters, function(parameter) {
                    var paramElement =  doc.createElement("Parameter");
                    paramElement.setAttribute("Name", parameter.name);
                    paramElement.setAttribute("Type", parameter.type);
                    var nullable = _.isBoolean(parameter.nullable) ? parameter.nullable : false;
                    if (!nullable) {
                        paramElement.setAttribute("Nullable", nullable);
                    }
                    //append Action > Parameter
                    actionElement.appendChild(paramElement)
                });
                if (action.returnType || action.returnCollectionType) {
                    var returnTypeElement =  doc.createElement("ReturnType");
                    var returnType = action.returnType;
                    if (action.returnCollectionType) {
                        returnType = action.returnCollectionType;
                        returnTypeElement.setAttribute("Type", sprintf("Collection(%s)", returnType));
                    }
                    else {
                        returnTypeElement.setAttribute("Type", returnType);
                    }
                    returnTypeElement.setAttribute("Nullable", true);
                    actionElement.appendChild(returnTypeElement);
                }
                actionElements.push(actionElement);
            });

            //search for bound functions
            _.forEach(entityType.functions.concat(entityType.collection.functions), function(func) {
                var functionElement = doc.createElement("Function");
                functionElement.setAttribute("Name", func.name);
                functionElement.setAttribute("IsBound", true);
                if (func.isComposable) {
                    functionElement.setAttribute("IsComposable", func.isComposable);
                }
                _.forEach(func.parameters, function(parameter) {
                    var paramElement =  doc.createElement("Parameter");
                    paramElement.setAttribute("Name", parameter.name);
                    paramElement.setAttribute("Type", parameter.type);
                    var nullable = _.isBoolean(parameter.nullable) ? parameter.nullable : false;
                    if (!nullable) {
                        paramElement.setAttribute("Nullable", nullable);
                    }
                    //append Function > Parameter
                    functionElement.appendChild(paramElement)
                });
                if (func.returnType || func.returnCollectionType) {
                    var returnTypeElement =  doc.createElement("ReturnType");
                    var returnType = func.returnType;
                    if (func.returnCollectionType) {
                        returnType = func.returnCollectionType;
                        returnTypeElement.setAttribute("Type", sprintf("Collection(%s)", returnType));
                    }
                    else {
                        returnTypeElement.setAttribute("Type", returnType);
                    }
                    returnTypeElement.setAttribute("Nullable", true);
                    functionElement.appendChild(returnTypeElement);
                }
                functionElements.push(functionElement);
            });

            //create element Schema > EntityType
            var entityTypeElement = doc.createElement("EntityType");
            entityTypeElement.setAttribute("Name", entityType.name);
            entityTypeElement.setAttribute("OpenType", true);
            if (entityType.baseType) {
                entityTypeElement.setAttribute("BaseType", entityType.baseType);
            }

            if (entityType.key && entityType.key.propertyRef) {
                var keyElement = doc.createElement('Key');
                _.forEach(entityType.key.propertyRef, function(key) {
                    var keyRefElement = doc.createElement('PropertyRef');
                    keyRefElement.setAttribute("Name",key.name);
                    keyElement.appendChild(keyRefElement);
                });
                entityTypeElement.appendChild(keyElement);
            }
            //enumerate properties
            _.forEach(entityType.property, function(x) {
                var propertyElement = doc.createElement('Property');
                propertyElement.setAttribute("Name",x.name);
                propertyElement.setAttribute("Type",x.type);
                if (_.isBoolean(x.nullable) && (x.nullable===false)) {
                    propertyElement.setAttribute("Nullable",false);
                }
                entityTypeElement.appendChild(propertyElement);
            });
            //enumerate navigation properties
            _.forEach(entityType.navigationProperty, function(x) {
                var propertyElement = doc.createElement('NavigationProperty');
                propertyElement.setAttribute("Name",x.name);
                propertyElement.setAttribute("Type",x.type);
                if (!x.nullable) {
                    propertyElement.setAttribute("Nullable",false);
                }
                entityTypeElement.appendChild(propertyElement);
            });
            //append Schema > EntityType
            schemaElement.appendChild(entityTypeElement);
        });

    //append action elements to schema
    _.forEach(actionElements, function(actionElement) {
        schemaElement.appendChild(actionElement);
    });
    //append function elements to schema
    _.forEach(functionElements, function(functionElement) {
        schemaElement.appendChild(functionElement);
    });



    //create Schema > EntityContainer
    var entityContainerElement = doc.createElement("EntityContainer");
    entityContainerElement.setAttribute("Name", schema.entityContainer.name || "DefaultContainer");

    _.forEach(schema.entityContainer.entitySet,
        /**
         * @param {EntitySetConfiguration} child
         */
        function(child) {
            var childElement = doc.createElement(child.kind);
            childElement.setAttribute("Name", child.name);
            if ((child.kind === EntitySetKind.EntitySet) || (child.kind === EntitySetKind.Singleton)) {
                childElement.setAttribute("EntityType", child.entityType.name);
            }
            var childAnnotation = doc.createElement("Annotation");
            childAnnotation.setAttribute("Term", "Org.OData.Core.V1.ResourcePath");
            childAnnotation.setAttribute("String", child.getUrl());
            childElement.appendChild(childAnnotation);
            //append Schema > EntityContainer > (EntitySet, Singleton, FunctionImport)
            entityContainerElement.appendChild(childElement);
        });

    //append Schema > EntityContainer
    schemaElement.appendChild(entityContainerElement);

    //append edmx:Edmx > edmx:DataServices
    rootElement.appendChild(dataServicesElement);
    return doc;

}
828967
def get_schema_type_name(node, context):
    """"""
    query_path = node.query_path
    if query_path not in context.query_path_to_location_info:
        raise AssertionError(
            u'Unable to find type name for query path {} with context {}.'.format(
                query_path, context))
    location_info = context.query_path_to_location_info[query_path]
    return location_info.type.name
469381
function SchemaTypeWrapper(type) {
  var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];


  return new SchemaType(type, options);
}
307443
function SchemaString (key, options) {
  this.enumValues = [];
  this.regExp = null;
  SchemaType.call(this, key, options, 'String');
}
622925
def get_schema_compiler(self, schema):
        
        # Schema type
        schema_type = self.get_schema_type(schema)
        if schema_type is None:
            return None

        # Compiler
        compilers = {
            const.COMPILED_TYPE.LITERAL: self._compile_literal,
            const.COMPILED_TYPE.TYPE: self._compile_type,
            const.COMPILED_TYPE.SCHEMA: self._compile_schema,
            const.COMPILED_TYPE.ENUM: self._compile_enum,
            const.COMPILED_TYPE.CALLABLE: self._compile_callable,
            const.COMPILED_TYPE.ITERABLE: self._compile_iterable,
            const.COMPILED_TYPE.MAPPING: self._compile_mapping,
            const.COMPILED_TYPE.MARKER: self._compile_marker,
        }

        return compilers[schema_type]