Create new synthetic variable with given flags, name, type, owner
761580
private VarSymbol makeSyntheticVar(long flags, Name name, Type type, Symbol owner) {
        return new VarSymbol(flags | SYNTHETIC, name, type, owner);
    }
165300
function makeVar(id, expr) {
  return assignmentExpression('=',
    memberExpression(identifier('vars'), literal(id), true),
    expr);
}
849557
def assign_variable(type, name, value, node)
      scope    = assignment_scope(type)
      variable = scope.lookup(type, name)

      # If there's already a variable we'll just update it.
      if variable
        variable.reference_amount += 1

        # `value` is not for conditional assignments as those are handled
        # manually.
        variable.value = value if value
      else
        variable = Definition::RubyObject.new(
          :type             => type,
          :name             => name,
          :value            => value,
          :instance_type    => :instance,
          :reference_amount => 0,
          :line             => node.line,
          :column           => node.column,
          :file             => node.file
        )
      end

      buffer_assignment_value(value)

      # Primarily used by #after_send to support variable assignments as method
      # call arguments.
      if value and !value_stack.empty?
        value_stack.push(variable.value)
      end

      add_variable(variable, scope)
    end
755614
private void saveNestedVariables() {
	if (nestedVars != null) {
	    Iterator iter = nestedVars.iterator();
	    while (iter.hasNext()) {
		String varName = (String) iter.next();
		varName = findAlias(varName);
		Object obj = invokingJspCtxt.getAttribute(varName);
		if (obj != null) {
		    originalNestedVars.put(varName, obj);
		}
	    }
	}
    }
1320545
def const_variable(name, shape, value, trainable):
        
        return tf.get_variable(name, shape, initializer=tf.constant_initializer(value), trainable=trainable)
818275
def make_varname(tree):
    
    if tree.tag == 'identifier':
        return tree.attrib['name']

    if tree.tag in ('string', 'boolean'):
        return tree.text

    if tree.tag == 'number':
        return tree.attrib['value']

    if tree.tag in ('property', 'object'):
        return make_varname(_xpath_one(tree, '*'))

    if tree.tag.endswith('accessor'):
        kind = tree.tag[:-len('accessor')]
        obj = make_varname(_xpath_one(tree, 'object'))
        prop = make_varname(_xpath_one(tree, 'property'))
        if kind == 'dot':
            fmt = '%s.%s'
        elif kind == 'bracket':
            fmt = '%s[%s]'
        else:
            raise ValueError("Unknown accessor: %s" % tree.tag)
        return fmt % (obj, prop)

    raise ValueError("Unknown tag: %s" % tree.tag)
871862
def create(self, obj, ref=None):
        
        if isinstance(ref, Variable):
            ref = ref.name
        elif isinstance(ref, string_types) and ref.startswith('gl_'):
            # gl_ names not allowed for variables
            ref = ref[3:].lower()
        
        # Allow any type of object to be converted to ShaderObject if it
        # provides a magic method:
        if hasattr(obj, '_shader_object'):
            obj = obj._shader_object()
        
        if isinstance(obj, ShaderObject):
            if isinstance(obj, Variable) and obj.name is None:
                obj.name = ref
        elif isinstance(obj, string_types):
            obj = TextExpression(obj)
        else:
            obj = Variable(ref, obj)
            # Try prepending the name to indicate attribute, uniform, varying
            if obj.vtype and obj.vtype[0] in 'auv':
                obj.name = obj.vtype[0] + '_' + obj.name 
        
        return obj
827522
def _create_value(self, data, name, spec):
        

        field = getattr(self, 'create_' + name, None)
        if field:
            # this factory has a special creator function for this field
            return field(data, name, spec)
        value = data.get(name)
        return spec.fields[name].clean(value)
179363
def base_object(name,
                no_perms=False,
                has_owner=True,
                hide_owner=True,
                has_uuid=True,
                roles_write=None,
                roles_read=None,
                roles_list=None,
                roles_create=None,
                all_roles=None):
    """"""
    base_schema = {
        'id': '#' + name,
        'type': 'object',
        'name': name,
        'properties': {}
    }

    if not no_perms:
        if all_roles:
            roles_create = ['admin', all_roles]
            roles_write = ['admin', all_roles]
            roles_read = ['admin', all_roles]
            roles_list = ['admin', all_roles]
        else:
            if roles_write is None:
                roles_write = ['admin']
            if roles_read is None:
                roles_read = ['admin']
            if roles_list is None:
                roles_list = ['admin']
            if roles_create is None:
                roles_create = ['admin']

        if isinstance(roles_create, str):
            roles_create = [roles_create]
        if isinstance(roles_write, str):
            roles_write = [roles_write]
        if isinstance(roles_read, str):
            roles_read = [roles_read]
        if isinstance(roles_list, str):
            roles_list = [roles_list]

        if has_owner:
            roles_write.append('owner')
            roles_read.append('owner')
            roles_list.append('owner')

        base_schema['roles_create'] = roles_create
        base_schema['properties'].update({
            'perms': {
                'id': '#perms',
                'type': 'object',
                'name': 'perms',
                'properties': {
                    'write': {
                        'type': 'array',
                        'default': roles_write,
                        'items': {
                            'type': 'string',
                        }
                    },
                    'read': {
                        'type': 'array',
                        'default': roles_read,
                        'items': {
                            'type': 'string',
                        }
                    },
                    'list': {
                        'type': 'array',
                        'default': roles_list,
                        'items': {
                            'type': 'string',
                        }
                    }
                },
                'default': {},
                'x-schema-form': {
                    'condition': "false"
                }
            },
            'name': {
                'type': 'string',
                'description': 'Name of ' + name
            }
        })

        if has_owner:
            # TODO: Schema should allow specification of non-local owners as
            #  well as special accounts like admin or even system perhaps
            # base_schema['required'] = base_schema.get('required', [])
            # base_schema['required'].append('owner')
            base_schema['properties'].update({
                'owner': uuid_object(title='Unique Owner ID', display=hide_owner)
            })
    else:
        base_schema['no_perms'] = True

    # TODO: Using this causes all sorts of (obvious) problems with the object
    # manager
    if has_uuid:
        base_schema['properties'].update({
            'uuid': uuid_object(title='Unique ' + name + ' ID', display=False)
        })
        base_schema['required'] = ["uuid"]

    return base_schema
1192759
function getVariable() {
  const type = NodeType.VariableType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [];

  // Skip `$`.
  pos++;

  if (checkVariable(pos)) content.push(getVariable());
  else content.push(getIdent());

  return newNode(type, content, line, column);
}
577289
def create_from_name_and_dictionary(self, name, datas):
        
        if "type" not in datas:
            str_type = "any"
        else:
            str_type = str(datas["type"]).lower()

        if str_type not in ObjectRaw.Types:
            type = ObjectRaw.Types("type")
        else:
            type = ObjectRaw.Types(str_type)

        if type is ObjectRaw.Types.object:
            object = ObjectObject()
            if "properties" in datas:
                object.properties = self.create_dictionary_of_element_from_dictionary("properties", datas)
            if "patternProperties" in datas:
                object.pattern_properties = self.create_dictionary_of_element_from_dictionary("patternProperties", datas)
            if "additionalProperties" in datas:
                if isinstance(datas["additionalProperties"], dict):
                    object.additional_properties = self.create_from_name_and_dictionary("additionalProperties", datas["additionalProperties"])
                elif not to_boolean(datas["additionalProperties"]):
                    object.additional_properties = None
                else:
                    raise ValueError("AdditionalProperties doe not allow empty value (yet)")
        elif type is ObjectRaw.Types.array:
            object = ObjectArray()
            if "items" in datas:
                object.items = self.create_from_name_and_dictionary("items", datas["items"])
            else:
                object.items = ObjectObject()
            if "sample_count" in datas:
                object.sample_count = int(datas["sample_count"])
        elif type is ObjectRaw.Types.number:
            object = ObjectNumber()
        elif type is ObjectRaw.Types.integer:
            object = ObjectInteger()
        elif type is ObjectRaw.Types.string:
            object = ObjectString()
        elif type is ObjectRaw.Types.boolean:
            object = ObjectBoolean()
            if "sample" in datas:
                object.sample = to_boolean(datas["sample"])
        elif type is ObjectRaw.Types.reference:
            object = ObjectReference()
            if "reference" in datas:
                object.reference_name = str(datas["reference"])
        elif type is ObjectRaw.Types.type:
            object = ObjectType()
            object.type_name = str(datas["type"])
        elif type is ObjectRaw.Types.none:
            object = ObjectNone()
        elif type is ObjectRaw.Types.dynamic:
            object = ObjectDynamic()
            if "items" in datas:
                object.items = self.create_from_name_and_dictionary("items", datas["items"])
            if "sample" in datas:
                if isinstance(datas["sample"], dict):
                    object.sample = {}
                    for k, v in datas["sample"].items():
                        object.sample[str(k)] = str(v)
                else:
                    raise ValueError("A dictionnary is expected for dynamic\s object in \"%s\"" % name)
        elif type is ObjectRaw.Types.const:
            object = ObjectConst()
            if "const_type" in datas:
                const_type = str(datas["const_type"])
                if const_type not in ObjectConst.Types:
                    raise ValueError("Const type \"%s\" unknwon" % const_type)
            else:
                const_type = ObjectConst.Types.string
            object.const_type = const_type
            if "value" not in datas:
                raise ValueError("Missing const value")
            object.value = datas["value"]
        elif type is ObjectRaw.Types.enum:
            object = ObjectEnum()
            if "values" not in datas or not isinstance(datas['values'], list):
                raise ValueError("Missing enum values")
            object.values = [str(value) for value in datas["values"]]
            if "descriptions" in datas and isinstance(datas['descriptions'], dict):
                for (value_name, value_description) in datas["descriptions"].items():
                    value = EnumValue()
                    value.name = value_name
                    value.description = value_description
                    object.descriptions.append(value)

            descriptions = [description.name for description in object.descriptions]
            for value_name in [x for x in object.values if x not in descriptions]:
                value = EnumValue()
                value.name = value_name
                object.descriptions.append(value)
        else:
            object = ObjectRaw()

        self.set_common_datas(object, name, datas)
        if isinstance(object, Constraintable):
            self.set_constraints(object, datas)
        object.type = type

        if "optional" in datas:
            object.optional = to_boolean(datas["optional"])

        return object
438879
function createTableColumn (model, name, spec) {
    // require spec to be object
    assert.ok(typeof spec === 'object', `${name} spec must be object`)
    // require valid type
    assert.ok(columnTypes[spec.type], `invalid type ${spec.type} for ${name}`)
    // build sql string
    var columnType = spec.type === 'id'
        ? (model.binaryIds ? 'BINARY(16)' : 'CHAR(32)')
        : columnTypes[spec.type]
    var sql = `${quoteName(name)} ${columnType}`
    // add unsigned flag if set
    if (spec.unsigned && (spec.type === 'int' || spec.type === 'smallint')) {
        sql += ' UNSIGNED'
    }
    // add not null if null specifically set to false
    if (spec.null === false) {
        sql += ' NOT NULL'
    }
    // add auto increment
    if (spec.auto) {
        sql += ' AUTO_INCREMENT PRIMARY KEY'
    }
    // add default value if set
    if (spec.default !== undefined) {
        // use 0/1 for boolean
        if (spec.type === 'boolean') {
            sql += ` DEFAULT ${spec.default ? 1 : 0}`
        }
        // otherwise use quoteNamed value
        else {
            sql += ` DEFAULT '${spec.default}'`
        }
    }
    // return sql string
    return sql
}
1211874
def instantiate_from_config(cfg):
    """"""
    for h in cfg:
        if h.get("type") in data_types:
            raise KeyError("Data type '%s' already exists" % h)
        data_types[h.get("type")] = DataType(h)
1141885
def generate(
        cls: Type[T], data: Generic, name: str = None, *, recursive: bool = True
    ) -> T:
        """"""
        if name is None:
            name = cls.__name__
        kls = make_class(name, {k: ib(default=None) for k in data}, bases=(cls,))
        data = {
            k: (
                cls.generate(v, k.title())
                if recursive and isinstance(v, Mapping)
                else v
            )
            for k, v in data.items()
        }
        return kls(**data)
364547
def instantiate_by_name_with_default(self, object_name, default_value=None):
        
        if object_name not in self.instances:
            if object_name not in self.environment:
                return default_value
            else:
                instance = self.instantiate_from_data(self.environment[object_name])

                self.instances[object_name] = instance
                return instance
        else:
            return self.instances[object_name]
730145
private MethodSymbol makePrivateSyntheticMethod(long flags, Name name, Type type, Symbol owner) {
        return new MethodSymbol(flags | SYNTHETIC | PRIVATE, name, type, owner);
    }
1332228
private JSType createRecordTypeFromNodes(Node n, String sourceName, StaticTypedScope scope) {

    RecordTypeBuilder builder = new RecordTypeBuilder(this);

    // For each of the fields in the record type.
    for (Node fieldTypeNode = n.getFirstChild();
         fieldTypeNode != null;
         fieldTypeNode = fieldTypeNode.getNext()) {

      // Get the property's name.
      Node fieldNameNode = fieldTypeNode;
      boolean hasType = false;

      if (fieldTypeNode.getToken() == Token.COLON) {
        fieldNameNode = fieldTypeNode.getFirstChild();
        hasType = true;
      }

      String fieldName = fieldNameNode.getString();

      // TODO(user): Move this into the lexer/parser.
      // Remove the string literal characters around a field name,
      // if any.
      if (fieldName.startsWith("'") || fieldName.startsWith("\"")) {
        fieldName = fieldName.substring(1, fieldName.length() - 1);
      }

      // Get the property's type.
      JSType fieldType = null;

      if (hasType) {
        // We have a declared type.
        fieldType = createFromTypeNodesInternal(
            fieldTypeNode.getLastChild(), sourceName, scope, true);
      } else {
        // Otherwise, the type is UNKNOWN.
        fieldType = getNativeType(JSTypeNative.UNKNOWN_TYPE);
      }

      builder.addProperty(fieldName, fieldType, fieldNameNode);
    }

    return builder.build();
  }