Instantiate :py:class:`ofxclient.Institution` from dictionary

        :param raw: serialized ``Institution``
        :param type: dict per :py:method:`~Institution.serialize`
        :rtype: subclass of :py:class:`ofxclient.Institution`
430593
def deserialize(raw):
        
        return Institution(
            id=raw['id'],
            org=raw['org'],
            url=raw['url'],
            broker_id=raw.get('broker_id', ''),
            username=raw['username'],
            password=raw['password'],
            description=raw.get('description', None),
            client_args=raw.get('client_args', {})
        )
1022430
def factory(cls, object_raw):
        
        if object_raw is None:
            return None
        if object_raw.type is ObjectRaw.Types.object:
            return ObjectObject(object_raw)
        elif object_raw.type is ObjectRaw.Types.type:
            return ObjectType(object_raw)
        elif object_raw.type is ObjectRaw.Types.array:
            return ObjectArray(object_raw)
        elif object_raw.type is ObjectRaw.Types.dynamic:
            return ObjectDynamic(object_raw)
        elif object_raw.type is ObjectRaw.Types.const:
            return ObjectConst(object_raw)
        elif object_raw.type is ObjectRaw.Types.enum:
            return ObjectEnum(object_raw)
        else:
            return Object(object_raw)
46758
def deserialize(cls, cls_target, obj_raw):
        

        cls._initialize()
        deserializer = cls._get_deserializer(cls_target)

        if deserializer == cls:
            return cls._deserialize_default(cls_target, obj_raw)
        else:
            return deserializer.deserialize(cls_target, obj_raw)
944042
def IOWR(cls, op, structure):
        
        return cls._IOC(READ | WRITE, op, structure)
11081
Type instantiate(Env<AttrContext> env,
                     Type site,
                     Symbol m,
                     ResultInfo resultInfo,
                     List<Type> argtypes,
                     List<Type> typeargtypes,
                     boolean allowBoxing,
                     boolean useVarargs,
                     Warner warn) {
        try {
            return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                                  allowBoxing, useVarargs, warn);
        } catch (InapplicableMethodException ex) {
            return null;
        }
    }
429279
def create_objects(self, raw_objects):
        
        types_creations = self.__class__.types_creations
        early_created_types = self.__class__.early_created_types

        logger.info("Creating objects...")

        # Before really creating the objects, we add some ghost
        # ones like the bp_rule for correlation
        self.add_self_defined_objects(raw_objects)

        for o_type in sorted(types_creations):
            if o_type not in early_created_types:
                self.create_objects_for_type(raw_objects, o_type)
        logger.info("Done")
1041437
def _from_json_array_nested(cls, response_raw):
        

        json = response_raw.body_bytes.decode()
        obj = converter.json_to_class(dict, json)
        value = converter.deserialize(cls, obj[cls._FIELD_RESPONSE])

        return client.BunqResponse(value, response_raw.headers)
432296
def object_from_json(self, object_type, object_json, parent=None):
        
        if not isinstance(object_json, dict):
            return object_json
        obj = self.instantiate_object(object_type, parent)
        for key, value in object_json.items():
            if key not in self.skip_attrs:
                key, value = self._deserialize(key, obj, value)
            if isinstance(value, dict):
                value = ProxyDict(value, dirty_callback=getattr(
                    obj, '_dirty_callback', None))
            elif isinstance(value, list):
                value = ProxyList(value, dirty_callback=getattr(
                    obj, '_dirty_callback', None))
            setattr(obj, key, value)
        if hasattr(obj, '_clean_dirty'):
            obj._clean_dirty()
        self.api.cache.add(obj)
        return obj
315043
def get_object_from_dictionary_representation(dictionary, class_type):
        
        assert inspect.isclass(class_type), 'Cannot instantiate an object that is not a class'

        instance = class_type()

        CoyoteDb.update_object_from_dictionary_representation(dictionary, instance)

        return instance
1206389
def from_raw(self, raw: RawScalar) -> Optional[ScalarValue]:
        
        if isinstance(raw, str):
            return raw
234208
def read_raw(self, params=None):
        
        path_type = self._meta.get('read_type', 'self')

        return client.get(
            self.path(path_type),
            params=params,
            **self._server_config.get_client_kwargs()
        )
1058402
private Object deserialize(TypeInfo type, Object rawValue)
            throws SerDeException {
        Object value = null;

        if (rawValue != null) {
            switch (type.getCategory()) {
                case PRIMITIVE:
                    value = deserializePrimitive((PrimitiveTypeInfo) type, rawValue);
                    break;
                case STRUCT:
                    value = deserializeStruct((StructTypeInfo) type, rawValue);
                    break;
                case MAP:
                    value = deserializeMap((MapTypeInfo) type, rawValue);
                    break;
                case LIST:
                    value = deserializeList((ListTypeInfo) type, rawValue);
                    break;
                case UNION:
                    value = deserializeUnion((UnionTypeInfo) type, rawValue);
                    break;
            }
        }

        return value;
    }
592934
def create(cls, api_context, public_key_string):
        

        api_client = client.ApiClient(api_context)
        body_bytes = cls.generate_request_body_bytes(
            public_key_string
        )
        response_raw = api_client.post(cls._ENDPOINT_URL_POST, body_bytes, {})

        return cls._from_json_array_nested(response_raw)
67414
def _parse(self, raw, next_cls):
        '''
        
        '''
        if next_cls is None:
            from switchyard.lib.packet import Ethernet
            next_cls = Ethernet

        self._headers = []
        while issubclass(next_cls, PacketHeaderBase):
            packet_header_obj = next_cls()
            raw = packet_header_obj.from_bytes(raw)
            self.add_header(packet_header_obj)
            next_cls = packet_header_obj.next_header_class()
            if next_cls is None:
                break
        if raw:
            self.add_header(RawPacketContents(raw))
763047
def load(raw_bytes):
        
        try:
            if not isinstance(raw_bytes, string_type):
                raw_bytes = raw_bytes.decode()
            return json.loads(raw_bytes)
        except ValueError as e:
            raise SerializationException(str(e))
1025093
def _get_by_type(self, key, operation, create, type_, default, return_default=True):
        
        key = self._encode(key)
        if self.type(key) in [type_, b'none']:
            if create:
                return self.redis.setdefault(key, default)
            else:
                return self.redis.get(key, default if return_default else None)

        raise TypeError("{} requires a {}".format(operation, type_))
1276022
def from_raw(self, rval: RawObject, jptr: JSONPointer = "") -> ObjectValue:
        """"""
        if not isinstance(rval, dict):
            raise RawTypeError(jptr, "object")
        res = ObjectValue()
        for qn in rval:
            if qn.startswith("@"):
                if qn != "@":
                    tgt = qn[1:]
                    if tgt not in rval:
                        raise MissingAnnotationTarget(jptr, tgt)
                    jptr += '/' + tgt
                res[qn] = self._process_metadata(rval[qn], jptr)
            else:
                cn = self._iname2qname(qn)
                ch = self.get_data_child(*cn)
                npath = jptr + "/" + qn
                if ch is None:
                    raise RawMemberError(npath)
                res[ch.iname()] = ch.from_raw(rval[qn], npath)
        return res