Convert object to meta by value.
552211
function (obj) {
  return Object.getOwnPropertyNames(obj).map(function (name) {
    return {
      name: name,
      value: obj[name]
    }
  })
}
794342
def to_value(self, obj, resource, visited=set()):
        """"""

        if id(obj) in visited:
            raise ValueError('Circular reference detected when attempting to serialize object')

        if isinstance(obj, (list, tuple, set)):
            return [self.to_value(x, resource) if hasattr(x, '__dict__') else x for x in obj]
        elif hasattr(obj, '__dict__'):
            attrs = obj.__dict__.copy()
            for key in six.iterkeys(obj.__dict__):
                if key.startswith('_'):
                    del attrs[key]

            return {
                self.reverse_aliases.get(k, k):
                    self.to_value(v, resource) if hasattr(v, '__dict__') or isinstance(v, (list, tuple, set)) else v
                for k, v in six.iteritems(attrs)
            }
        else:
            return obj
990023
private static function convertValues(Meta $m)
    {
        if ($m->getType() === "json" && Check::isJson($m->getValue()))
            $m->setValue(json_decode($m->getValue(), true), !1);
        elseif ($m->getGroup() === "boolean")
            $m->setValue($m->getValue() === "true" || $m->getValue() === "1" || $m->getValue() === 1 || $m->getValue() === true ? 1 : 0, !1);

        if (!empty($m->getValue()) && $m->getFormat() === "password" || $m->getFormat() === "passwordRequired") {
            $m->setValue(Check::password($m->getValue()), !1);

        } elseif ($m->getFormat() === "valor") {
            $value = $m->getValue();
            $f = "";
            for($i=0; $i < strlen($value); $i ++) {
                if(is_numeric($value[$i]))
                    $f .= $value[$i];
                elseif($value[$i] === "." || $value[$i] === ",")
                    $f = str_replace([',', '.'], '', $f) . ".";
            }
            $value = (float) number_format((float) $f, 2, '.', '');
            $m->setValue($value, !1);
        }

        if ($m->getKey() === "link")
            $m->setValue(Check::name($m->getValue()), !1);
    }
382688
private String metadataValueOf(String value) {
        if (value == null || value.trim().isEmpty())
            return null;
        return value;
    }
1300840
def _parse_meta(self, meta):
        
        for hostname, hostvars in meta.get('hostvars', {}).items():
            for var_key, var_val in hostvars.items():
                self._get_host(hostname)['hostvars'][var_key] = var_val
1064026
def set_meta(self, _props):
        """"""
        if self.is_fake:
            return

        props = {}
        for key, value in _props.items():
            key, value = self.meta_mappings.map_set(key, value)
            props[key] = value

        # Pop out tag which we don't want
        props.pop("tag", None)

        self.journal.update_info({})
        self.journal.update_info(props)
        self.journal.save()
184747
def convert(self):
        
        try:
            return utils.encode_dict(self.metainfo)
        except ValueError as e:
            raise error.MetainfoError(str(e))
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
347897
def meta(self):
        """"""
        if not self._pv.meta_data_property or not self._meta_target:
            return {}

        return getattr(self._meta_target, self._pv.meta_data_property)
234874
def meta(self, meta):
        ''''''
        data = meta.as_dict()
        data['namespace'] = self.basekey(meta)
        return data
805372
def json_options_to_metadata(options, add_brackets=True):
    """"""
    try:
        options = loads('{' + options + '}' if add_brackets else options)
        return options
    except ValueError:
        return {}
1197551
def to_internal_value_single(self, data, serializer):
        """"""
        related_model = serializer.Meta.model
        if isinstance(data, related_model):
            return data
        try:
            instance = related_model.objects.get(pk=data)
        except related_model.DoesNotExist:
            raise ValidationError(
                "Invalid value for '%s': %s object with ID=%s not found" %
                (self.field_name, related_model.__name__, data)
            )
        return instance
1280010
function metaToPlainObject (meta) {
  const obj = (() => meta.type === 'error' ? new Error() : {})()
  for (let i = 0; i < meta.members.length; i++) {
    const { name, value } = meta.members[i]
    obj[name] = value
  }
  return obj
}
267007
def to_representation(self, value):
        """"""
        content_type = ContentType.objects.get_for_id(value)
        return "_".join(content_type.natural_key())
132237
def transfer_metadata_to_dict(self, meta):
        
        dic = {}
        arr = meta.strip(' ,').split(',')
        for i in arr:
            temp = i.split('=')
            key = temp[0].strip()
            value = temp[1].strip()
            dic[key] = value
        return dic
729691
public Object setMetadata(String key, Object value) {
        return metadata.put(key, value);
    }
1072202
def get_value(self, meta, base_model_meta, mcs_args: McsArgs):
        """"""
        if mcs_args.Meta.abstract:
            return None
        value = getattr(base_model_meta, self.name, {}) or {}
        value.update(getattr(meta, self.name, {}))
        return value