Deserialize a new WebhookInfo from a given dictionary.

        :return: new WebhookInfo instance.
        :rtype: WebhookInfo
498312
def from_array(array):
        
        if array is None or not array:
            return None
        # end if
        assert_type_or_raise(array, dict, parameter_name="array")

        data = {}
        data['url'] = u(array.get('url'))
        data['has_custom_certificate'] = bool(array.get('has_custom_certificate'))
        data['pending_update_count'] = int(array.get('pending_update_count'))
        data['last_error_date'] = int(array.get('last_error_date')) if array.get('last_error_date') is not None else None
        data['last_error_message'] = u(array.get('last_error_message')) if array.get('last_error_message') is not None else None
        data['max_connections'] = int(array.get('max_connections')) if array.get('max_connections') is not None else None
        data['allowed_updates'] = WebhookInfo._builtin_from_array_list(required_type=unicode_type, value=array.get('allowed_updates'), list_level=1) if array.get('allowed_updates') is not None else None
        data['_raw'] = array
        return WebhookInfo(**data)
812271
def from_httplib(cls, message, duplicates=('set-cookie',)): # Python 2
        """"""
        ret = cls(message.items())
        # ret now contains only the last header line for each duplicate.
        # Importing with all duplicates would be nice, but this would
        # mean to repeat most of the raw parsing already done, when the
        # message object was created. Extracting only the headers of interest 
        # separately, the cookies, should be faster and requires less
        # extra code.
        for key in duplicates:
            ret.discard(key)
            for val in message.getheaders(key):
                ret.add(key, val)
            return ret
591917
def from_dict(cls, d):
        
        if "ICOHP" in d:
            icohp = {Spin(int(key)): np.array(val)
                     for key, val in d["ICOHP"].items()}
        else:
            icohp = None
        return Cohp(d["efermi"], d["energies"],
                    {Spin(int(key)): np.array(val)
                     for key, val in d["COHP"].items()},
                    icohp=icohp, are_coops=d["are_coops"])
319275
def webhooks
      webhooks = JSON.parse(API::Server.webhooks(@bot.token, @id))
      webhooks.map { |webhook| Webhook.new(webhook, @bot) }
    end
1302621
def from_dict(cls, info_d):
        '''
        
        '''
        info = SessionInfo()
        for k, v in info_d.items():
            setattr(info, k, v)
        return info
1151572
def deserialize(self, value, **kwargs):
        
        kwargs.update({'trusted': kwargs.get('trusted', False)})
        if self.deserializer is not None:
            return self.deserializer(value, **kwargs)
        if value is None:
            return None
        if isinstance(value, string_types):
            return value
        if issubclass(self.instance_class, base.HasProperties):
            return self.instance_class.deserialize(value, **kwargs)
        return self.from_json(value, **kwargs)
990500
def new_from_json_dict(cls, data):
        
        new_data = {utils.to_snake_case(key): value
                    for key, value in data.items()}

        return cls(**new_data)
1095622
def from_dict(cls, d):
        
        s = Structure.from_dict(d)
        return cls(s, history=d["history"],
                   other_parameters=d.get("other_parameters", None))
1157579
def from_dict(data, ctx):
        

        type = data.get("type")

        if type == "TAKE_PROFIT":
            return TakeProfitOrder.from_dict(data, ctx)
        if type == "STOP_LOSS":
            return StopLossOrder.from_dict(data, ctx)
        if type == "TRAILING_STOP_LOSS":
            return TrailingStopLossOrder.from_dict(data, ctx)
        if type == "MARKET":
            return MarketOrder.from_dict(data, ctx)
        if type == "FIXED_PRICE":
            return FixedPriceOrder.from_dict(data, ctx)
        if type == "LIMIT":
            return LimitOrder.from_dict(data, ctx)
        if type == "STOP":
            return StopOrder.from_dict(data, ctx)
        if type == "MARKET_IF_TOUCHED":
            return MarketIfTouchedOrder.from_dict(data, ctx)

        data = data.copy()

        if data.get('clientExtensions') is not None:
            data['clientExtensions'] = \
                ctx.transaction.ClientExtensions.from_dict(
                    data['clientExtensions'], ctx
                )

        return Order(**data)
385207
def FromDictionary(cls, msg_dict):
        

        level = msg_dict.get('level')
        msg = msg_dict.get('message')
        now = msg_dict.get('now_time')
        created = msg_dict.get('created_time')
        count = msg_dict.get('count', 1)
        msg_id = msg_dict.get('id', 0)

        new_msg = ServiceMessage(level, msg, msg_id, created, now)
        if count > 1:
            new_msg.count = count

        return new_msg
193101
def from_dict(cls, data):
        
        auth_info = _AuthenticationInformation.from_dict(data.get("auth_info"))
        instance = cls(auth_info=auth_info)
        instance.user_id_hash_type = data.get("hash_type")
        instance.attributes = data.get("attributes", {})
        instance.user_id = data.get("user_id")
        instance.requester = data.get("requester")
        return instance
625822
def from_dict(cls, serialized):
        '''
        '''
        if serialized is None:
            return None
        macaroon = serialized.get('Macaroon')
        if macaroon is not None:
            macaroon = bakery.Macaroon.from_dict(macaroon)
        path = serialized.get('MacaroonPath')
        cookie_name_suffix = serialized.get('CookieNameSuffix')
        visit_url = serialized.get('VisitURL')
        wait_url = serialized.get('WaitURL')
        interaction_methods = serialized.get('InteractionMethods')
        return ErrorInfo(macaroon=macaroon, macaroon_path=path,
                         cookie_name_suffix=cookie_name_suffix,
                         visit_url=visit_url, wait_url=wait_url,
                         interaction_methods=interaction_methods)
391241
def from_dict(cls, label=None, label2=None, icon=None, thumbnail=None,
                  path=None, selected=None, info=None, properties=None,
                  context_menu=None, replace_context_menu=False,
                  is_playable=None, info_type='video', stream_info=None):
        '''
        '''
        listitem = cls(label, label2, icon, thumbnail, path)

        if selected is not None:
            listitem.select(selected)

        if info:
            listitem.set_info(info_type, info)

        if is_playable:
            listitem.set_is_playable(True)

        if properties:
            # Need to support existing tuples, but prefer to have a dict for
            # properties.
            if hasattr(properties, 'items'):
                properties = properties.items()
            for key, val in properties:
                listitem.set_property(key, val)

        if stream_info:
            for stream_type, stream_values in stream_info.items():
                listitem.add_stream_info(stream_type, stream_values)

        if context_menu:
            listitem.add_context_menu_items(context_menu, replace_context_menu)

        return listitem
1000526
def from_dict(cls, serialized):
        '''
        '''
        # Some servers return lower case field names for message and code.
        # The Go client is tolerant of this, so be similarly tolerant here.
        def field(name):
            return serialized.get(name) or serialized.get(name.lower())
        return Error(
            code=field('Code'),
            message=field('Message'),
            info=ErrorInfo.from_dict(field('Info')),
            version=bakery.LATEST_VERSION,
        )
1198330
def to_dict(self):
        
        cache_info = None
        if self.cache_info:
            cache_info = self.cache_info.to_dict()
        return {
            'cache_info': cache_info,
            'html': self.html,
            'scraped': self.scraped,
            'raw': self.raw
        }
1214626
def deserialize(data):
        
        # Import module & get class
        try:
            module = import_module(data.get('class').get('module'))
            cls = getattr(module, data.get('class').get('name'))
        except ImportError:
            raise ImportError("No module named: %r" % data.get('class').get('module'))
        except AttributeError:
            raise ImportError("module %r does not contain class %r" % (
                data.get('class').get('module'),
                data.get('class').get('name')
            ))

        # Deserialize parameters
        class_params = cls.class_params(hidden=True)
        params = dict(
            (name, class_params[name].deserialize(value))
            for (name, value) in data.get('params').items()
        )

        # Instantiate new instance
        return cls(**params)
523077
def fromdict(dict):
        
        seed = hb_decode(dict['seed'])
        index = dict['index']
        return Challenge(seed, index)