includes a cyclic reference to a JSchema already under construction.
769967
JSchema box(Map context) {
    if (boxed != null)
      return boxed; // only do it once
    JSVariant subTop = new JSVariant();
    subTop.cases = cases;
    subTop.boxedBy = this;
    boxed = (JSchema)context.get(subTop);
    if (boxed == null) {
      boxed = new JSchema(subTop, context);
      for (int i = 0; i < cases.length; i++)
        cases[i].parent = subTop;
      context.put(subTop, boxed);
    }
    return boxed;
  }
737358
def autoschema(self, objects, **kwargs):
        '''  '''
        return autoschema(objects=objects, exclude_keys=self.RESTRICTED_KEYS,
                          **kwargs)
1096707
function(p, propertyName) {
	
	   var fieldDef = { label: propertyName, name: propertyName };
	   var schemaMap = this.schemaToParamMap;
    	var referencedSchema = p["$ref"];
		var key;
	    
	   if(referencedSchema){
	    	var new_schema = null;
	    	if(this.referenceResolver) {
		       new_schema = this.referenceResolver(referencedSchema);
		    }
	    	if(new_schema === null) {
	    		new_schema = this.defaultReferenceResolver(referencedSchema);
	    	}
	    	if(new_schema === null) {
	    		throw new Error('Schema for property : "'+propertyName+'" $references "'+referencedSchema+'", not found');
	    	}
	    	// copy options into new schema, for example we can overide presentation
	    	// of a defined schema depending on where it is used
	    	new_schema = lang.merge(new_schema);	// copy new_schema
	    	
	    	for(var pk in p) {
	    		if(p.hasOwnProperty(pk) && lang.isUndefined(new_schema[pk]) && pk != '$ref') {
	    			new_schema[pk] = p[pk];
	    		}
	    	}
	    	p = new_schema;
	   }

	   if(!p.optional) {
	      fieldDef.required = true;
	   }

	    for(key in schemaMap) {
	        if(schemaMap.hasOwnProperty(key)) {
	      	  var paramName = schemaMap[key]; 
	      	  var v = p[key];
	      	  if(!lang.isUndefined(v)) {
	      		  if(paramName === null) {
	      			  // copy / merge values from v directly into options
	      			  if(lang.isObject(v)) {
	      				  // v must be an object, copy key/value pairs into options
	      				  for(var vkey in v) {
	      					  if(v.hasOwnProperty(vkey)) {
	      						  fieldDef[vkey] = v[vkey];
	      					  }
	      				  }
	      			  }
	      		  } else {
	      			  fieldDef[paramName] = v;
	      		  }
	      	  }
	        }
	    }
	    if(!p.type) p.type = 'object';
	    var type = p.type;
	       
	       // If type is a "Union type definition", we'll use the first type for the field
	       // "array" <=>  [] <=> ["any"]
	       if(lang.isArray(type)) {
	          if(type.length === 0 || (type.length == 1 && type[0] == "any") ) {
	             type = "array";
	          }
	          else {
	             type = type[0];
	          }
	       }
	       //else if(lang.isObject(type) ) {
	          // What do we do ??
	          //console.log("type is an object !!");
	       //}
	       
	       fieldDef.type = type;
	       
	       // default value
	       if( !lang.isUndefined(p["default"]) ) {
	          fieldDef.value = p["default"];
	       }
	    
	       if(type == "array" ) {
	          fieldDef.type = "list";
	          if(lang.isObject(p.items) && !lang.isArray(p.items)) {
	        	  // when items is an object, it's a schema that describes each item in the list
	        	  fieldDef.elementType = this.schemaToInputEx(p.items, propertyName);
	          }
	
		       if(p.minItems) { fieldDef.minItems = p.minItems; }
				 if(p.maxItems) { fieldDef.maxItems = p.maxItems; }
	
	       }
	       else if(type == "object" ) {
	          fieldDef.type = "group";
	          if(p.title && lang.isUndefined(fieldDef.legend)) {
	        	  fieldDef.legend = p.title; 
	          }
	          //fieldDef = this.schemaToInputEx(p, propertyName);
	          //fieldDef = this._parseSchemaProperty(p, propertyName);
	          var fields = [];
	          if(propertyName) {
	        	  fieldDef.name = propertyName;
	          }
	
	          for(key in p.properties) {
	             if(p.properties.hasOwnProperty(key)) {
	                fields.push( this.schemaToInputEx(p.properties[key], key) );
	             }
	          }
	
	          fieldDef.fields = fields;
	          
	       }
	       else if(type == "string" && (p["enum"] || p["choices"]) ) {
	          fieldDef.type = "select";
	          
	          if(p.choices) {
	             fieldDef.choices = [];
	             for(var i = 0 ; i < p.choices.length ; i++) {
	                var o = p.choices[i];
	                fieldDef.choices[i] = { label: o.label, value: o.value };
	             }
             }
             else { // p.choices
	             fieldDef.choices = [];
	             for(var i = 0 ; i < p["enum"].length ; i++) {
	                var o = p["enum"][i];
						 if(YAHOO.lang.isObject(o)) {
	                	fieldDef.choices[i] = { label: o.label, value: o.value };
						 }
						 else {
							fieldDef.choices[i] = { value: o };
						 }
	             }
             }		
	       }
	       else if(type == "string") {
	    	  if(!lang.isUndefined(p.pattern) && lang.isUndefined(fieldDef.regexp)) {
	    		  if(lang.isString(p.pattern)) {
	    			  fieldDef.regexp = new RegExp(p.pattern);
	    		  } else {
	    			  fieldDef.regexp = p.pattern;
	    		  }
	    	  }
	    	  if(!lang.isUndefined(p.maxLength) && lang.isUndefined(fieldDef.maxLength)) {
	    		  fieldDef.maxLength = p.maxLength; 
	    	  }

	    	  if(!lang.isUndefined(p.minLength) && lang.isUndefined(fieldDef.minLength)) {
	    		  fieldDef.minLength = p.minLength; 
	    	  }

	    	  if(!lang.isUndefined(p.readonly) && lang.isUndefined(fieldDef.readonly)) {
	    		  fieldDef.readonly = p.readonly; 
	    	  }

           // According to http://groups.google.com/group/json-schema/web/json-schema-possible-formats
	          if( p.format ) {
	             if(p.format == "html") {
	                fieldDef.type = "html";
	             } else if(p.format == "date") {
	                fieldDef.type = "date";
	                fieldDef.tooltipIcon = true;
	             } else if(p.format == 'url') {
	            	 fieldDef.type = 'url';
	             } else if(p.format == 'email') {
	            	 fieldDef.type = 'email';
	             } else if(p.format == 'text') {
	            	 fieldDef.type = 'text';
	             } else if(p.format == 'time') {
	                fieldDef.type = 'time';
	             } else if(p.format == 'ip-address') {
    	             fieldDef.type = 'IPv4';
    	          } else if(p.format == 'color') {
    	             fieldDef.type = 'color';
    	          }
	          }
	       }
	
			 // Override inputEx's type with the "_type" attribute
			 if( !!p["_inputex"] && !!p["_inputex"]["_type"]) {
				fieldDef.type = p["_inputex"]["_type"];
			 }
	
	    // Add the defaultOptions
	    for(var kk in this.defaultOptions) {
	        if(this.defaultOptions.hasOwnProperty(kk) && lang.isUndefined(fieldDef[kk])) {
	        	fieldDef[kk] = this.defaultOptions[kk]; 
	        }	    	
	    }
	    return fieldDef;
	}
579204
function (schema, refResolver) {

                logger.debug("Creating reader for schema", schema);

                if (!refResolver) {
                    refResolver = new AmdResolver({path: "", altSeparator: "\\.", synchronous: true}).resolver;
                }

                this.smd = schema;

                //finds all $ref instances and replaces with the actual object
                //similar to dojox.json.ref.resolveJson, but doesn't get hung up on circular references
                //TODO: should we assume all schemas have been resolved prior, and remove this step?
                function resolveRef(subobj, parent, parentKey) {
                    if (!subobj.resolved) {
                        Object.keys(subobj).forEach(function (key) {
                            var Ref, value = subobj[key];
                            if (key === "$ref") {
                                logger.debug("Resolving $ref: " + value);
                                Ref = refResolver(value);
                                value = typeof Ref === 'function' ? new Ref() : Ref;
                                if (!util.isUndefined(value) && !value.resolved) {
                                    subobj.resolved = true;
                                    resolveRef(value, subobj, key);
                                }
                                parent[parentKey] = value;
                            } else if (typeof value === "object") {
                                resolveRef(value, subobj, key);
                            }
                        });
                    }
                }

                function getExtendedProperties(obj, props) {
                    var parent = (obj && obj["extends"]), propsObj = [], items = [], itemProps;

                    if (typeof parent !== "undefined") {

                        items = util.isArray(parent) ? parent : [parent]; //can be multiple-inheritance

                        items.forEach(function (item) {
                            itemProps = item.properties || {};
                            Object.keys(itemProps).forEach(function (key) {
                                var value = item.properties[key];
                                if (key !== "__parent") {
                                    propsObj.push({
                                        parentId: item.id,
                                        key: key,
                                        value: value
                                    });
                                }
                            });

                        }, this); // jshint ignore:line

                        props.push(propsObj);
                        props = getExtendedProperties(parent, props);
                    }

                    return props;

                }

                //looks in JSONSchema objects for "extends" and copies properties to children
            function resolveExtensions(schema) {

                var xprops, props;

                xprops = getExtendedProperties(schema, []);

                //unwind the property stack so that the earliest gets inheritance link
                schema.properties = schema.properties || {};
                function copyprop(item) { //util to get around jslint complaints about doing this directly in loop
                    schema.properties[item.key] = item.val;
                }

                while (xprops.length > 0) {
                    props = xprops.pop();
                    props.forEach(copyprop);
                }
            }

            // mix-in parameters for extended schemas
            function resolveExtendedParameters(obj) {

                // assume all references are resolved, just copy parameters down the
                // inheritence chain. If I am derived check base first.
                if (obj["extends"]) {
                    resolveExtendedParameters(obj["extends"]);
                    obj.parameters = obj.parameters || [];
                    obj.parameters = obj.parameters.concat(obj["extends"].parameters);
                }
            }

            //copies properties from parent as defaults, as well as extensions for params
            function resolveProperties(schema) {

                logger.debug("Resolving sub-properties for " + schema.id);

                // resolve inherited global parameters
                resolveExtendedParameters(schema);

                Object.keys(schema.services || {}).forEach(function (key) {
                    var value = schema.services[key];
                    //value.target = value.target ? schema.target + value.target : schema.target; //TODO: should this build concat paths? that is currently handled in getServiceUrl function
                    value.returns = value.returns || schema.returns;
                    value.transport = value.transport || schema.transport;
                    value.contentType = value.contentType || schema.contentType;
                    value.envelope = value.envelope || schema.envelope || "URL";
                    value.description = value.description || "";

                    if (value.returns) {
                        resolveExtensions(value.returns);
                    }

                    if (value.parameters) {
                        value.parameters.forEach(function (item) {
                            item.envelope = item.envelope || value.envelope;
                            item.description = item.description || "";
                        });
                    }


                    var ext = value["extends"];

                    if (ext) {

                        //resolution hasn't been completed or extends object isn't proper JSONSchema
                        if (!ext.id) {
                            throw new Error("Parent schema for method [" + key + "] in schema " + schema.id + " is invalid.");
                        }

                        //TODO: resolveExtensions for params object properties? not really needed yet (the name is fine for now...)
                        if (!value.parameters) {
                            value.parameters = ext.parameters;
                        } else {
                            value.parameters = value.parameters.concat(ext.parameters);
                        }
                    }
                });

                if (!schema.tag) {
                    schema.tag = {};
                }
                schema.tag.resolved = true;
                schema.resolvedProperties = true;
            }

            //if a schema has already been resolved, don't do it again - we can get into endless recursion
            if (!schema.resolved) {
                resolveRef(schema, null, null);
                schema.resolved = true;
            }

            //only resolve these once, or else our concats will be a problem
            if (!schema.resolvedProperties) {
                resolveProperties(schema);
            }

            var hash = {};

            //index params array by name for lookup
            hash.parameters = {};
            this.getMethodNames().forEach(function (methodName) {
                var service = this.smd.services[methodName];
                if (service.parameters) {
                    service.parameters.forEach(function (parameter) {
                        hash[methodName + "-" + parameter.name] = parameter;
                    });
                }
            }, this);

            this.findParameter = function (methodName, parameterName) {
                return hash[methodName + "-" + parameterName];
            };

        }
23310
private void cascadeMarkedForInsert()
    {
        // This list was used to avoid endless recursion on circular references
        List alreadyPrepared = new ArrayList();
        for(int i = 0; i < markedForInsertList.size(); i++)
        {
            ObjectEnvelope mod = (ObjectEnvelope) markedForInsertList.get(i);
            // only if a new object was found we cascade to register the dependent objects
            if(mod.needsInsert())
            {
                cascadeInsertFor(mod, alreadyPrepared);
                alreadyPrepared.clear();
            }
        }
        markedForInsertList.clear();
    }
873897
public SchemaRepositoryModelBuilder addSchema(SchemaModel schema) {
        if (model.getSchemas() == null) {
            model.setSchemas(new SchemaRepositoryModel.Schemas());
        }

        model.getSchemas().getSchemas().add(schema);
        return this;
    }
1322954
function buildReferenceDefinition() {
    //Read the current configuration in the reference config.
    let referenceConf = refConfigAccessor.get();
    //Warn the user if empty.
    if (!referenceConf || isEmpty(referenceConf)) {
        console.warn('You did not set any reference list in the reference configuration, see Focus.reference.config.set.');
    }
    //Build an object from the keys.
    return Object.keys(referenceConf).reduce((acc, elt) => {
        acc[elt] = elt;
        return acc;
    }, {});
}
26611
function TrackPlayedSchema() {
    /**
     * The track of value
     * @member
     * @type { Track }
     */
    this.track = Object.create(Track.prototype);
    /**
     * The album of value
     * @member
     * @type { Album }
     */
    this.album = Object.create(Album.prototype);

}
1278004
private static boolean isSetFromPrecedingModule(
      Ref originalRef, Ref set, JSModuleGraph moduleGraph) {
    return set.type == Ref.Type.SET_FROM_GLOBAL
        && (originalRef.getModule() == set.getModule()
            || moduleGraph.dependsOn(originalRef.getModule(), set.getModule()));
  }
515448
private void recordCompatibilityInfo(JMFType access, JSchema accSchema, JMFType encoding,
      JSchema encSchema) throws JMFSchemaViolationException
  {
    if (access instanceof JSPrimitive)
      if (encoding instanceof JSPrimitive)
        recordCompatibilityInfo((JSPrimitive)access, accSchema, (JSPrimitive)encoding,
          encSchema);
      else if (encoding instanceof JSVariant)
        checkForDeletingVariant(access, (JSVariant)encoding, false, accSchema, encSchema);
      else {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JmfTr.debug(this, tc, "Compatibility violation (type mismatch) for JSPrimitive");
        violation(access, encoding);
       }
    else if (access instanceof JSEnum)
      if (encoding instanceof JSEnum)
        recordCompatibilityInfo((JSEnum)access, accSchema, (JSEnum)encoding, encSchema);
      else if (encoding instanceof JSVariant)
        checkForDeletingVariant(access, (JSVariant)encoding, false, accSchema, encSchema);
      else {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JmfTr.debug(this, tc, "Compatibility violation (type mismatch) for JSEnum");
        violation(access, encoding);
      }
    else if (access instanceof JSDynamic)
      if (encoding instanceof JSDynamic)
        recordOnePair((JSField)access, accSchema, (JSField)encoding, encSchema);
      else if (encoding instanceof JSVariant)
        checkForDeletingVariant(access, (JSVariant)encoding, false, accSchema, encSchema);
      else {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JmfTr.debug(this, tc, "Compatibility violation (type mismatch) for JSDynamic");
        violation(access, encoding);
      }
    else if (access instanceof JSRepeated)
      if (encoding instanceof JSRepeated)
        recordCompatibilityInfo(((JSRepeated)access).getItemType(), accSchema,
          ((JSRepeated)encoding).getItemType(), encSchema);
      else if (encoding instanceof JSVariant)
        checkForDeletingVariant(access, (JSVariant)encoding, false, accSchema, encSchema);
      else {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JmfTr.debug(this, tc, "Compatibility violation (type mismatch) for JSRepeated");
        violation(access, encoding);
      }
    else if (access instanceof JSTuple)
      if (encoding instanceof JSTuple)
        recordCompatibilityInfo((JSTuple)access, accSchema, (JSTuple)encoding, encSchema);
      else if (encoding instanceof JSVariant)
        checkForDeletingVariant(access, (JSVariant)encoding, false, accSchema, encSchema);
      else {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JmfTr.debug(this, tc, "Compatibility violation (type mismatch) for JSTuple");
        violation(access, encoding);
      }
    else if (access instanceof JSVariant) {
      JSVariant accVar = (JSVariant)access;
      if (encoding instanceof JSVariant) {
        JSVariant encVar = (JSVariant)encoding;
        recordCompatibilityInfo(accVar, accSchema, encVar, encSchema);
      } else
        checkForDeletingVariant(encoding, accVar, true, accSchema, encSchema);
    }
  }
894563
function () {
                        //noinspection JSReferencingMutableVariableFromClosure
                        res.push({
                            combine: 1,
                            path: prefix + currentComboUrls.join(comboSep) + suffix,
                            mods: currentComboMods
                        });
                    }
557156
public SchemaRepositoryModelBuilder addSchemaReference(String schemaId) {
        SchemaRepositoryModel.Schemas.Reference schemaRef = new SchemaRepositoryModel.Schemas.Reference();
        schemaRef.setSchema(schemaId);

        if (model.getSchemas() == null) {
            model.setSchemas(new SchemaRepositoryModel.Schemas());
        }

        model.getSchemas().getReferences().add(schemaRef);
        return this;
    }
536989
function SchemaDefinition(_ref24) {
    var directives = _ref24.directives,
        operationTypes = _ref24.operationTypes;
    return join(['schema', join(directives, ' '), block(operationTypes)], ' ');
  }
219902
def attach_schema(self, schem):
    """"""
    self.tuple_schema = schema.AndSchema.make(self.tuple_schema, schem)
1015888
private void addMissingSchemas(Set<String> missingSchemas) {
		if (missingSchemas.isEmpty()) {
			return;
		}
		for (String className: missingSchemas) {
			Class<?> cls;
			try {
				cls = Class.forName(className);
			} catch (ClassNotFoundException e) {
				throw DBLogger.newFatal("Invalid field type in schema", e);
			}
			//TODO primary node is not always right here...
			createSchema(cache.getSession().getPrimaryNode(), cls);
		}
	}
366484
function buildSchema(jsObj, key) {
  if (jsObj === undefined) return null;

  var type = typeOf(jsObj);
  switch (type) {
    case "array":
      {
        let schema = {
          type: "list",
          detail: buildSchema(jsObj[0])
        };
        key && (schema.name = key);
        return schema;
      }
    case "object":
      {
        let schema = {
          type: "map",
          detail: []
        };
        key && (schema.name = key);
        let keys = Object.keys(jsObj);
        for (var i in keys) {
          let key = keys[i];
          if (jsObj[key] !== undefined) {
            schema.detail.push(buildSchema(jsObj[key], key));
          }
        }
        return schema;
      }
    case "null":
    case "string":
    case "number":
    case "date":
    case "boolean":
      {
        let schema = {
          type: type
        };
        key && (schema.name = key);
        return schema;
      }
    default:
      throw Error("Unacceptable type : " + type);
  }
}
551204
void recomposeIncludes(Stylesheet including)
  {

    int n = including.getIncludeCount();

    if (n > 0)
    {
      if (null == m_includesComposed)
        m_includesComposed = new Vector();

      for (int i = 0; i < n; i++)
      {
        Stylesheet included = including.getInclude(i);
        m_includesComposed.addElement(included);
        recomposeIncludes(included);
      }
    }
  }