Convert an individual :class:`Identifier` to a model instance,
        or a list of Identifiers to a list of model instances.
549317
def convert_identifiers(self, identifiers: Union[Identifier, List[Identifier]]):
        
        if not identifiers:
            return identifiers

        def _create_or_update(identifier):
            data = self._cache[identifier.key]
            return self.factory.create_or_update(identifier, data)[0]

        if isinstance(identifiers, Identifier):
            return _create_or_update(identifiers)
        elif isinstance(identifiers, list) and isinstance(identifiers[0], Identifier):
            return [_create_or_update(identifier) for identifier in identifiers]
        else:
            raise TypeError('`identifiers` must be an Identifier or list of Identifiers.')
536925
def make_instance(self, data):
        """"""
        if not self.opts.model:
            return data

        if self.instance is not None:
            for key, value in data.items():
                setattr(self.instance, key, value)
            return self.instance

        return self.opts.model(**data)
1267415
def to_instance(self, response):
        
        klass = self.schema['title']
        cls = get_model_class(klass, api=self.__api__)
        jdict = json.loads(response.content, encoding="utf-8")
        ### check if we have a response
        properties_dict = jdict[self.schema['title']]
        # @todo: find a way to handle the data
        # validation fails if the none values are not removed
        new_dict = helpers.remove_properties_containing_None(properties_dict)
        #jdict[self.schema['title']] = new_dict
        obj = cls(new_dict)
        #obj.links = jdict[self.schema['title']]['links']
        return obj
609901
def update(self, identifier, new_instance):
        
        with self.flushing():
            instance = self.retrieve(identifier)
            self.merge(instance, new_instance)
            instance.updated_at = instance.new_timestamp()
        return instance
413276
def convert(cls, record):
        
        if isinstance(record, list):
            return [cls._convert(r) for r in record]
        else:
            return [cls._convert(record)]
723233
def _to_instances(self, pks):
        
        # we want instances, so create an object for each pk, without
        # checking for pk existence if asked
        meth = self.cls.lazy_connect if self._instances_skip_exist_test else self.cls
        return [meth(pk) for pk in pks]
1175336
def model(self, *args, **kwargs):
        
        return self._client.model(*args, bucket=self.bucket.get('id'), **kwargs)
723015
def convert_instancenorm(node, **kwargs):
    
    name, input_nodes, attrs = get_inputs(node, kwargs)

    eps = float(attrs.get("eps", 0.001))

    node = onnx.helper.make_node(
        'InstanceNormalization',
        inputs=input_nodes,
        outputs=[name],
        name=name,
        epsilon=eps)

    return [node]
892387
def rtype_to_model(rtype):
    

    models = goldman.config.MODELS
    for model in models:
        if rtype.lower() == model.RTYPE.lower():
            return model
    raise ValueError('%s resource type not registered' % rtype)
582616
def to_dict(self, instance, d):
        

        value = self.__get__(instance, type(instance))
        if value == self.default:
            return

        d[self.tag] = self.type_.format(value)
595169
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'classifier_id' in _dict:
            args['classifier_id'] = _dict.get('classifier_id')
        else:
            raise ValueError(
                'Required property \'classifier_id\' not present in Classifier JSON'
            )
        if 'name' in _dict:
            args['name'] = _dict.get('name')
        else:
            raise ValueError(
                'Required property \'name\' not present in Classifier JSON')
        if 'owner' in _dict:
            args['owner'] = _dict.get('owner')
        if 'status' in _dict:
            args['status'] = _dict.get('status')
        if 'core_ml_enabled' in _dict:
            args['core_ml_enabled'] = _dict.get('core_ml_enabled')
        if 'explanation' in _dict:
            args['explanation'] = _dict.get('explanation')
        if 'created' in _dict:
            args['created'] = string_to_datetime(_dict.get('created'))
        if 'classes' in _dict:
            args['classes'] = [
                Class._from_dict(x) for x in (_dict.get('classes'))
            ]
        if 'retrained' in _dict:
            args['retrained'] = string_to_datetime(_dict.get('retrained'))
        if 'updated' in _dict:
            args['updated'] = string_to_datetime(_dict.get('updated'))
        return cls(**args)
250843
function (identifier) {
            var self = this;

            return this.findByIdentifier(identifier).then(function (record) {
                if (!record) {
                    throw new Errors.NotFoundError(
                        'Could not find %s with identifier %s'.format(
                            pluralize.singular(self.identity),
                            identifier
                        ), {
                            identifier: identifier,
                            collection: self.identity
                        });
                }

                return record;
            });
        }
984315
def to_identifier(self):
        

        return {
            'number': self.pk,
            'episodes': [
                episode.to_dict()
                for episode in self.episodes.values()
            ]
        }
429654
def _convert_internal(cls, record):
        
        if isinstance(record, list):
            return [cls._convert(r) for r in record]
        else:
            return cls._convert(record)
545616
def to_obj(ref)
      return front if ref.nil?
      return front[ref.to_s] if DRbURIOption === ref
      @idconv.to_obj(ref)
    end
111031
def create_model(cls, name, field=None):
        
        if field:
            attrs = {'name': name, 'field': field}
        else:
            attrs = {'name': name, 'field': {'_id': ObjectId()}}

        return type(str(name), (cls, ), attrs)()
586825
def modelrepr(instance) -> str:
    
    elements = []
    # noinspection PyProtectedMember
    for f in instance._meta.get_fields():
        # https://docs.djangoproject.com/en/2.0/ref/models/meta/
        if f.auto_created:
            continue
        if f.is_relation and f.related_model is None:
            continue
        fieldname = f.name
        try:
            value = repr(getattr(instance, fieldname))
        except ObjectDoesNotExist:
            value = "<RelatedObjectDoesNotExist>"
        elements.append("{}={}".format(fieldname, value))
    return "<{} <{}>>".format(type(instance).__name__,
                              ", ".join(elements))