generate the field initializer for the map
195420
void translate() {
            make.at(pos.getStartPosition());
            JCClassDecl owner = classDef((ClassSymbol)mapVar.owner);

            // synthetic static final int[] $SwitchMap$Color = new int[Color.values().length];
            MethodSymbol valuesMethod = lookupMethod(pos,
                                                     names.values,
                                                     forEnum.type,
                                                     List.nil());
            JCExpression size = make // Color.values().length
                .Select(make.App(make.QualIdent(valuesMethod)),
                        syms.lengthVar);
            JCExpression mapVarInit = make
                .NewArray(make.Type(syms.intType), List.of(size), null)
                .setType(new ArrayType(syms.intType, syms.arrayClass));

            // try { $SwitchMap$Color[red.ordinal()] = 1; } catch (java.lang.NoSuchFieldError ex) {}
            ListBuffer<JCStatement> stmts = new ListBuffer<>();
            Symbol ordinalMethod = lookupMethod(pos,
                                                names.ordinal,
                                                forEnum.type,
                                                List.nil());
            List<JCCatch> catcher = List.<JCCatch>nil()
                .prepend(make.Catch(make.VarDef(new VarSymbol(PARAMETER, names.ex,
                                                              syms.noSuchFieldErrorType,
                                                              syms.noSymbol),
                                                null),
                                    make.Block(0, List.nil())));
            for (Map.Entry<VarSymbol,Integer> e : values.entrySet()) {
                VarSymbol enumerator = e.getKey();
                Integer mappedValue = e.getValue();
                JCExpression assign = make
                    .Assign(make.Indexed(mapVar,
                                         make.App(make.Select(make.QualIdent(enumerator),
                                                              ordinalMethod))),
                            make.Literal(mappedValue))
                    .setType(syms.intType);
                JCStatement exec = make.Exec(assign);
                JCStatement _try = make.Try(make.Block(0, List.of(exec)), catcher, null);
                stmts.append(_try);
            }

            owner.defs = owner.defs
                .prepend(make.Block(STATIC, stmts.toList()))
                .prepend(make.VarDef(mapVar, mapVarInit));
        }
192431
public void init(BaseField field, ScreenComponent screenField, BaseField fldTarget)
    {
        super.init(field);
        m_screenField = screenField;
        m_fldTarget = fldTarget;

        m_bScreenMove = true;   // Only respond to user change
        m_bInitMove = false;
        m_bReadMove = false;
        if (screenField == null)
            this.lookupSField();
    }
965249
def initialize_fields(self, content):
        
        for name, value in content.items():
            item = self[name]
            # Container or Pointer
            if is_mixin(item):
                item.initialize_fields(value)
            # Fields
            elif is_field(item):
                item.value = value
            else:
                raise MemberTypeError(self, item, name)
473075
def _init_map(self):
        """"""
        ItemTextsFormRecord._init_map(self)
        ItemFilesFormRecord._init_map(self)
        edXBaseFormRecord._init_map(self)
        IRTItemFormRecord._init_map(self)
        TimeValueFormRecord._init_map(self)
        ProvenanceFormRecord._init_map(self)
        super(edXItemFormRecord, self)._init_map()
1281533
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['rubricId'] = self._rubric_default
        self._my_map['assignedBankIds'] = [str(kwargs['bank_id'])]
        self._my_map['levelId'] = self._level_default
        if self._supports_simple_sequencing():
            self._my_map['childIds'] = []
181806
public void init(BaseField field, BaseField fldDest, BaseField fldSource)
    {
        super.init(field, fldDest, fldSource, false, false, false);
    }
703739
def _init(self):
        '''
        
        '''
        num = 0
        for field in self._fields:
            field._initialize()
            self._need_second_pass |= field._need_second_pass
        for field in self._fields:
            num += field.num_mutations()
        self._calculate_mutations(num)
        self._initialize_default_buffer()
720354
@SuppressWarnings("unchecked")
    protected void initialise() {
        if (getBean() == null) {
            return;
        }

        this.beanClass = (Class<T>) bean.getClass();
        if (!(getBean() instanceof Map)) {
            Class currentClass = beanClass;

            List<Class> classes = Lists.newLinkedList();

            while (currentClass != null) {
                classes.add(0, currentClass);
                currentClass = currentClass.getSuperclass();
            }

            for (Class clazz : classes) {
                for (Method m : clazz.getMethods()) {
                    String name = m.getName();
                    Class rtype = m.getReturnType();
                    if (void.class != rtype && !name.equals("getClass")) {
                        boolean getType = name.startsWith(HandleType.GET.name().toLowerCase());
                        boolean isType = false;
                        if (!getType) {
                            isType = name.startsWith(HandleType.IS.name().toLowerCase())
                                    && (Boolean.class.isAssignableFrom(rtype) || rtype == boolean.class);
                        }
                        if (getType || isType) {
                            String fn = transformPropertyName(StringUtils.uncapitalize(name.substring(isType ? 2 : 3)));
                            if (StringUtils.isNotBlank(fn)) {
                                types.put(fn, rtype);
                                readHandleType.put(fn, isType ? HandleType.IS : HandleType.GET);
                            }
                        }
                    }
                }
            }
        } else {
            if (getBean() instanceof BeanMap) {
                types = ((BeanMap) getBean()).types;
                readInvokers = ((BeanMap) getBean()).readInvokers;
                writeInvokers = ((BeanMap) getBean()).writeInvokers;
                beanClass = (Class<T>) bean.getClass();
                bean = (T) ((BeanMap) bean).getBean();
            } else {
                Set<Map.Entry> entries = ((Map) getBean()).entrySet();
                for (Map.Entry entry : entries) {
                    String name = transformPropertyName((String) entry.getKey());
                    if (StringUtils.isNotBlank(name) && entry.getValue() != null) {
                        types.put(name, entry.getValue().getClass());
                    }
                }
            }
        }
    }
1102867
private void initializeMapper() {
    if (valueClass == null) {
      valueMapper = CatchAllMapper.getInstance();
    } else {
      try {
        valueMapper = MapperFactory.getInstance().getMapper(valueClass);
      } catch (NoSuitableMapperException exp) {
        valueMapper = CatchAllMapper.getInstance();
      }

    }
  }
27400
private void initAnnotatedFields() {
        final Set<Field> hiddenFields = Reflections.getHiddenFields(beanClass);
        inject(hiddenFields);

        final Set<Field> inheritedFields = Reflections.getInheritedFields(beanClass);
        inject(inheritedFields);

        final Set<Field> ownFields = Reflections.getOwnFields(beanClass);
        inject(ownFields);
    }
1342413
def initialize_fields(self):
        
        for field in dir(self):
            obj = getattr(self, field)
            if isinstance(obj, Field):
                self._meta.fields[field] = obj
595336
public void init(BaseField field, Converter converterDest, Converter converterSource, boolean bFreeChainedConverters)
    {
        m_converterDest = converterDest;
        m_converterSource = converterSource;
        m_bFreeChainedConverters = bFreeChainedConverters;
        super.init(field);
    }
1237515
def init_fields(self):
        

        if self.class_dont_cache.get(self.__class__, False):
            self.do_init_fields(self.fields_desc)
        else:
            self.do_init_cached_fields()
748277
def _init_fields(self):
        """"""
        if self.opts.fields:
            available_field_names = self.set_class(self.opts.fields)
        else:
            available_field_names = self.set_class(self.declared_fields.keys())
            if self.opts.additional:
                available_field_names |= self.set_class(self.opts.additional)

        invalid_fields = self.set_class()

        if self.only is not None:
            # Return only fields specified in only option
            field_names = self.set_class(self.only)

            invalid_fields |= field_names - available_field_names
        else:
            field_names = available_field_names

        # If "exclude" option or param is specified, remove those fields.
        exclude_field_names = set(self.opts.exclude) | set(self.exclude)
        if exclude_field_names:
            # Note that this isn't available_field_names, since we want to
            # apply "only" for the actual calculation.
            field_names = field_names - exclude_field_names

            invalid_fields |= exclude_field_names - available_field_names

        if invalid_fields:
            message = 'Invalid fields for {}: {}.'.format(self, invalid_fields)
            raise ValueError(message)

        fields_dict = self.dict_class()
        for field_name in field_names:
            field_obj = self.declared_fields.get(field_name, ma_fields.Inferred())
            self._bind_field(field_name, field_obj)
            fields_dict[field_name] = field_obj

        dump_data_keys = [
            obj.data_key or name for name, obj in iteritems(fields_dict) if not obj.load_only
        ]
        if len(dump_data_keys) != len(set(dump_data_keys)):
            data_keys_duplicates = {x for x in dump_data_keys if dump_data_keys.count(x) > 1}
            raise ValueError(
                'The data_key argument for one or more fields collides '
                "with another field's name or data_key argument. "
                'Check the following field names and '
                'data_key arguments: {}'.format(list(data_keys_duplicates)),
            )

        load_attributes = [
            obj.attribute or name for name, obj in iteritems(fields_dict) if not obj.dump_only
        ]
        if len(load_attributes) != len(set(load_attributes)):
            attributes_duplicates = {x for x in load_attributes if load_attributes.count(x) > 1}
            raise ValueError(
                'The attribute argument for one or more fields collides '
                "with another field's name or attribute argument. "
                'Check the following field names and '
                'attribute arguments: {}'.format(list(attributes_duplicates)),
            )

        return fields_dict
816600
protected void _generate(SarlField field, PyAppendable it, IExtraLanguageGeneratorContext context) {
		if (field.isStatic()) {
			// Static field
			generatePythonField(field, it, context);
		} else {
			final String key = this.qualifiedNameProvider.getFullyQualifiedName(field.getDeclaringType()).toString();
			final List<SarlField> fields = context.getMultimapValues(INSTANCE_VARIABLES_MEMENTO, key);
			fields.add(field);
		}
	}
1292912
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['levelId'] = self._level_default
        self._my_map['startTime'] = self._start_time_default
        self._my_map['gradeSystemId'] = self._grade_system_default
        self._my_map['itemsShuffled'] = self._items_shuffled_default
        self._my_map['scoreSystemId'] = self._score_system_default
        self._my_map['deadline'] = self._deadline_default
        self._my_map['assignedBankIds'] = [str(kwargs['bank_id'])]
        self._my_map['duration'] = self._duration_default
        self._my_map['assessmentId'] = str(kwargs['assessment_id'])
        self._my_map['itemsSequential'] = self._items_sequential_default
75353
function mapper(fields, map) {
  var obj = {};
  fields.forEach((cur, i) => {
    let kv = pair(map[i], cur, i);
    obj[kv.name] = kv.value;
  });
  return obj;
}