Incooperate composite field's media.
509792
def media(self):
        
        media_list = []
        media_list.append(super(SuperFormMixin, self).media)
        for composite_name in self.composite_fields.keys():
            form = self.get_composite_field_value(composite_name)
            media_list.append(form.media)
        return reduce(lambda a, b: a + b, media_list)
484964
def _field(self, *keys) -> Any:
        """"""
        try:
            d = self._node
            for key in keys:
                d = d[key]
            return d
        except KeyError:
            d = self._full_metadata
            for key in keys:
                d = d[key]
            return d
644696
def map_field(fn, m) :
    
    if m is None:
        return fn
    if fn in m:
        return m[fn]
    else:
        return fn
1128667
private Object prepareCompositeIdObject(final SingularAttribute attribute, Object compositeId,
            Map<String, String> uniquePKs, MetamodelImpl metaModel)
    {
        Field[] fields = attribute.getBindableJavaType().getDeclaredFields();
        EmbeddableType embeddable = metaModel.embeddable(attribute.getBindableJavaType());

        for (Field field : attribute.getBindableJavaType().getDeclaredFields())
        {
            if (!ReflectUtils.isTransientOrStatic(field))
            {
                if (metaModel.isEmbeddable(((AbstractAttribute) embeddable.getAttribute(field.getName()))
                        .getBindableJavaType()))
                {
                    try
                    {
                        field.setAccessible(true);
                        Object embeddedObject = prepareCompositeIdObject(
                                (SingularAttribute) embeddable.getAttribute(field.getName()),
                                KunderaCoreUtils.initialize(((AbstractAttribute) embeddable.getAttribute(field
                                        .getName())).getBindableJavaType(), field.get(compositeId)), uniquePKs,
                                metaModel);
                        PropertyAccessorHelper.set(compositeId, field, embeddedObject);
                    }
                    catch (IllegalAccessException e)
                    {
                        log.error(e.getMessage());
                    }
                }
                else
                {
                    PropertyAccessorHelper.set(
                            compositeId,
                            field,
                            PropertyAccessorHelper.fromSourceToTargetClass(field.getType(), String.class,
                                    uniquePKs.get(field.getName())));
                }
            }
        }
        return compositeId;
    }
872034
def fill_with_model(self, model, *fields):
        
        model_dct = model.to_dict(include=self._fields.keys())
        localized_dct = self.localize(*fields, **model_dct)
        if model.key:
            localized_dct['id'] = model.key.id()
        return localized_dct
934448
def hdel(self, key, field, *fields):
        """"""
        return self.execute(b'HDEL', key, field, *fields)
701469
def _get_media(media_types):
    """"""
    get_mapped_media = (lambda x: maps.VIRTUAL_MEDIA_TYPES_MAP[x]
                        if x in maps.VIRTUAL_MEDIA_TYPES_MAP else None)
    return list(map(get_mapped_media, media_types))
51201
def _pack(self):
        """"""
        data = ByteBuffer()
        if not hasattr(self, '__fields__'):
            return data.array

        for field in self.__fields__:
            field.encode(self, data)
        return data.array
937157
def convert_field(self, value, conversion):
        """"""
        func = self.CONV_FUNCS.get(conversion)
        if func is not None:
            value = getattr(value, func)()
        elif conversion not in ['R']:
            # default conversion ('r', 's')
            return super(StringFormatter, self).convert_field(value, conversion)

        if conversion in ['h', 'H', 'R']:
            value = value.replace('-', '').replace('_', '').replace(':', '').replace(' ', '')
        return value
1315847
def _collect_fields(field_parts_list, include_parents):
    """"""
    fields = []
    subpart_lists = defaultdict(list)

    for parts in field_parts_list:
        field, subparts = parts[0], parts[1:]
        if subparts:
            if include_parents and field not in fields:
                fields.append(field)
            subpart_lists[field].append(subparts)
        else:
            fields.append(field)

    subfields = dict((field, _collect_fields(subparts, include_parents))
                     for field, subparts in six.iteritems(subpart_lists))

    return ParsedFieldList(fields, subfields)
764619
def getfield(f):
    """"""
    if isinstance(f, list):
        return [getfield(x) for x in f]
    else:
        return f.value
617435
def get_used_media():
    

    media = set()

    for field in get_file_fields():
        is_null = {
            '%s__isnull' % field.name: True,
        }
        is_empty = {
            '%s' % field.name: '',
        }

        storage = field.storage

        for value in field.model.objects \
                .values_list(field.name, flat=True) \
                .exclude(**is_empty).exclude(**is_null):
            if value not in EMPTY_VALUES:
                media.add(storage.path(value))

    return media
793985
def mag_field_df(MAG, ofs=None):
    ''''''
    mag = Vector3(MAG.MagX, MAG.MagY, MAG.MagZ)
    offsets = Vector3(MAG.OfsX, MAG.OfsY, MAG.OfsZ)
    if ofs is not None:
        mag = (mag - offsets) + Vector3(ofs[0], ofs[1], ofs[2])
    return mag.length()
1120024
def attach_many(self, *medias: typing.Union[InputMedia, typing.Dict]):
        
        for media in medias:
            self.attach(media)
241518
def __meta_metadata(self, field, key):
        """"""
        mf = ''
        try:
            mf = str([f[key] for f in self.metadata
                     if f['field_name'] == field][0])
        except IndexError:
            print("%s not in metadata field:%s" % (key, field))
            return mf
        else:
            return mf
822419
def to_representation(self, field, instance):
        
        self.parent_field = field
        return super(FacetFieldSerializer, self).to_representation(instance)
877783
function createSplitterForField(multiFieldDefinitionPart, fieldName) {

	if (multiFieldDefinitionPart === undefined) {
		throw ("'multiFieldDefinitionPart' must not be undefined");
	}
	if (fieldName === undefined) {
		throw ("'fieldName' must not be undefined");
	}

	const delimiter = multiFieldDefinitionPart.delimiter;
	let escapeChar = multiFieldDefinitionPart.escapeChar;
	let removeWhiteSpace = true;
	let uniqueFields = true;
	let sortFields = true;
	let removeEmpty = true;

	// set default values
	if (multiFieldDefinitionPart.removeWhiteSpace !== undefined) {
		// remove leading and trailing whitespaces
		removeWhiteSpace = multiFieldDefinitionPart.removeWhiteSpace;
	}

	if (multiFieldDefinitionPart.uniqueFields !== undefined) {
		// remove duplicates from the list
		uniqueFields = multiFieldDefinitionPart.uniqueFields;
	}

	if (multiFieldDefinitionPart.sortFields !== undefined) {
		// sort the fields
		sortFields = multiFieldDefinitionPart.sortFields;
	}
	if (multiFieldDefinitionPart.removeEmpty !== undefined) {
		// Empty fields will be deleted
		removeEmpty = multiFieldDefinitionPart.removeEmpty;
	}


	return function (content) {
		if (content.hasOwnProperty(fieldName)) {
			// the field exists in the content record
			let fieldValue = content[fieldName];
			if (fieldValue) {

				// ------------------------------------------------
				// escape delimiter
				// ------------------------------------------------
				if (escapeChar) {
					escapeChar = escapeChar.replace(/\\/, "\\\\");
					escapeChar = escapeChar.replace(/\//, "\\/");

					// The escaped delimiter will be replaced by the string '<--DIVIDER-->'
					let re = new RegExp(escapeChar + delimiter, 'g');
					fieldValue = fieldValue.replace(re, TMP_DEVIDER);
				}

				// ------------------------------------------------
				// split the string
				// ------------------------------------------------
				let values = fieldValue.split(delimiter);

				if (escapeChar) {
					// remove the escape char
					let re = new RegExp(TMP_DEVIDER, 'g');
					for (let i = 0; i < values.length; i++) {
						values[i] = values[i].replace(re, delimiter);
					}
				}


				// ------------------------------------------------
				// remove the leading and trailing whiteSpaces
				// ------------------------------------------------
				if (removeWhiteSpace) {
					for (let i = 0; i < values.length; i++) {
						values[i] = values[i].trim();
					}
				}

				// ------------------------------------------------
				// remove empty fields
				// ------------------------------------------------
				if (removeEmpty) {
					let i = 0;
					let j = 0;
					for (i = 0; i < values.length; i++) {
						if (values[i]) {
							values[j] = values[i];
							j++;
						}
					}
					values.splice(j, i);
				}

				// ------------------------------------------------
				// sort fields
				// ------------------------------------------------
				if (sortFields) {
					values.sort();
				}

				// ------------------------------------------------
				// remove duplicates
				// ------------------------------------------------
				if (uniqueFields) {
					values = values.filter(function (elem, pos) {
						return values.indexOf(elem) == pos;
					});
				}

				// ------------------------------------------------
				// store the splited fields back to the content
				// ------------------------------------------------
				content[fieldName] = values;
			}
		}

		return null;
	};
}