get field instance from fields array
@param string $field_name
@param array $attributes
@return \Zofe\Rapyd\DataForm\Field $field
497192
public function field($field_name, array $attributes = array())
    {
        if (isset($this->fields[$field_name])) {
            $field = $this->fields[$field_name];
            if (count($attributes)) {
                $field->attributes($attributes);
                $field->build();
            }

            return $field;
        }
    }
592180
def _get_fields(attrs, field_class, pop=False, ordered=False):
    
    fields = [
        (field_name, field_value)
        for field_name, field_value in iteritems(attrs)
        if is_instance_or_subclass(field_value, field_class)
    ]
    if pop:
        for field_name, _ in fields:
            del attrs[field_name]
    if ordered:
        fields.sort(key=lambda pair: pair[1]._creation_index)
    return fields
437949
def get_field_by_name(self, name):
        

        for f in self.fields:
            if f.get_name() == name:
                return f
        return None
204547
public function getFieldsAttribute()
    {
        $fields = new Collection();

        foreach ($this->attributes['fields'] as $field) {
            if (! ($field instanceof Field)) {
                $field = $this->discord->factory(Field::class, $field, true);
            }

            $fields->push($field);
        }

        return $fields;
    }
1254701
public function getFieldsByName($name)
    {
        $result = [];

        foreach ($this->fields as $field) {
            if ($field->getName() == $name) {
                $result[] = $field;
            }
        }

        return $result;
    }
636820
public static function input($field, $value = null, array $attributes = array())
	{
		return static::$instance->input($field, $value, $attributes);
	}
274503
public function normalizeFormFieldTagParams($name, $value, array $attributes, $fieldType = null)
    {
        if (!isset($attributes['id'])) {
            $attributes['id'] = trim(
                str_replace(['[', ']', '()', '__'], ['_', '_', '', '_'], $name),
                '_'
            );
        }
        if ($name) {
            $attributes['name'] = $name;
        }
        return [$name, (string)$value, $attributes];
    }
386762
public function getFieldByName($name)
    {
        foreach ($this->fieldList as $field) {
            if ($field->getFieldName() === $name) {
                return $field;
            }
        }

        return null;
    }
55075
public static function array_row_field_to_key(array $array, $row_field_name )
    {
        if (!is_array($array)) {
            return array();
        }
        $temp_data = array();
        foreach($array as $key => $row ){
            if (isset($row[$row_field_name])) {
                $temp_data[$row[$row_field_name]] = $row;
            }
            unset($array[$key]);
        }
        return $temp_data;
    }
1220519
def parse_fields(attributes):
        """"""
        return tuple(field.bind_name(name)
                     for name, field in six.iteritems(attributes)
                     if isinstance(field, fields.Field))
937470
function addField( $attributes ) {
		if( isset( $attributes['NAME'] ) ) {
			$name = $attributes['NAME'];
		} else {
			$name = count($this->data[$this->row]);
		}

		// Set the field index so we know where we are
		$this->current_field = $this->FieldID( $name );
	}
390632
public function getCleanedFieldAsString(string $field_name): string
    {
        if (empty($this->initial_data[$field_name])) {
            return '';
        }

        if (!is_scalar($this->initial_data[$field_name])) {
            return '';
        }

        return (string)$this->initial_data[$field_name];
    }
1110597
public static function select(string $name = '', array $values = [], array $selected = [],
                                  array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'class' => 'form-select'];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $attributes = [];
        $attributes['name'] = $userAttributes['method-get'] === false ? \sprintf('MFVARS[%s]', $name) : $name;
        $attributes['id'] = isset($userAttributes['id']) ? $userAttributes['id'] : $name;
        $attributes['data-selected'] = \implode(',', $selected);
        $wrapperClass = ['select-wrapper'];

        if (\array_key_exists('multiple', $userAttributes) && $userAttributes['multiple'] === true) {
            $attributes['multiple'] = 'multiple';
            $attributes['name'] = \sprintf('%s[]', $attributes['name']);
            $wrapperClass[] = 'multiple';
        }
        if (\array_key_exists('wrapper-class', $userAttributes)) {
            $wrapperClass[] = $userAttributes['wrapper-class'];
        }
        if (\array_key_exists('disabled', $userAttributes)) {
            $wrapperClass[] = 'disabled';
        }
        $clearAttributes = ['method-get', 'id', 'multiple', 'wrapper-class'];
        $userAttributes = static::clearAttributes($userAttributes, $clearAttributes);
        $select = Tags::select(self::getOptions($values, $selected, 0), \array_merge($attributes, $userAttributes));

        return Tags::div($select, ['class' => \implode(' ', $wrapperClass)]);
    }
200302
public function add($name, $label = '', array $attributes = array(), array $rules = array())
	{
		if ($name instanceof Fieldset_Field)
		{
			if ($name->name == '' or $this->field($name->name) !== false)
			{
				throw new \RuntimeException('Fieldname empty or already exists in this Fieldset: "'.$name->name.'".');
			}

			$name->set_fieldset($this);
			$this->fields[$name->name] = $name;
			return $name;
		}
		elseif ($name instanceof Fieldset)
		{
			if (empty($name->name) or $this->field($name->name) !== false)
			{
				throw new \RuntimeException('Fieldset name empty or already exists in this Fieldset: "'.$name->name.'".');
			}

			$name->set_parent($this);
			$this->fields[$name->name] = $name;
			return $name;
		}

		if (empty($name) || (is_array($name) and empty($name['name'])))
		{
			throw new \InvalidArgumentException('Cannot create field without name.');
		}

		// Allow passing the whole config in an array, will overwrite other values if that's the case
		if (is_array($name))
		{
			$attributes = $name;
			$label = isset($name['label']) ? $name['label'] : '';
			$rules = isset($name['rules']) ? $name['rules'] : array();
			$name = $name['name'];
		}

		// Check if it exists already, if so: return and give notice
		if ($field = $this->field($name))
		{
			\Error::notice('Field with this name exists already in this fieldset: "'.$name.'".');
			return $field;
		}

		$this->fields[$name] = new \Fieldset_Field($name, $label, $attributes, $rules, $this);

		return $this->fields[$name];
	}
67771
def _get_field_by_name(model_class, field_name):
    
    field = model_class._meta.get_field(field_name)
    return (
        field,                                       # field
        field.model,                                 # model
        not field.auto_created or field.concrete,    # direct
        field.many_to_many                           # m2m
    )
178518
public function getAttribute($field, $name, $default = null, $group = null)
    {
        $field = $this->getField($field, $group);

        if ($field) {
            return $field->getAttribute($name, $default);
        }

        return $default;
    }
1196129
def get_field(name)
      @fields ||= {}
      field = fields[name]
      raise Tripod::Errors::FieldNotPresent.new unless field
      field
    end