Takes a dictionary as an argument and returns a new Proof object
        from the dictionary.

        :param dict: the dictionary to convert
182908
def fromdict(dict):
        
        key = hb_decode(dict['key'])
        check_fraction = dict['check_fraction']
        return Merkle(check_fraction, key)
1334770
def from_dict(cls, dictionary, root=False):
        

        def create_tree(value):
            if isinstance(value, dict):
                res = ConfigTree(root=root)
                for key, child_value in value.items():
                    res.put(key, create_tree(child_value))
                return res
            if isinstance(value, list):
                return [create_tree(v) for v in value]
            else:
                return value

        return create_tree(dictionary)
126934
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'authors' in _dict:
            args['authors'] = [
                Author._from_dict(x) for x in (_dict.get('authors'))
            ]
        if 'publication_date' in _dict:
            args['publication_date'] = _dict.get('publication_date')
        if 'title' in _dict:
            args['title'] = _dict.get('title')
        if 'image' in _dict:
            args['image'] = _dict.get('image')
        if 'feeds' in _dict:
            args['feeds'] = [Feed._from_dict(x) for x in (_dict.get('feeds'))]
        return cls(**args)
802926
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'text' in _dict:
            args['text'] = _dict.get('text')
        if 'location' in _dict:
            args['location'] = Location._from_dict(_dict.get('location'))
        if 'element_locations' in _dict:
            args['element_locations'] = [
                ElementLocations._from_dict(x)
                for x in (_dict.get('element_locations'))
            ]
        return cls(**args)
56215
def append_from_dict(self, the_dict):
        
        m = Measurement.from_dict(the_dict)
        self.append(m)
346835
def _dict_if(self, *args):
        
        call_args = list(args)
        do_cond = call_args.pop(0)
        do_if = call_args.pop(0)
        do_else = ''

        if len(call_args):
            do_else = call_args.pop()
        return do_if if self.truth(do_cond) else do_else
333409
def fromdict(self, src_dict, method='set'):
        
        if method == 'set':
            _method = self.set_method
        else:
            _method = self.add_method
        if hasattr(src_dict, 'iteritems'):
            for (key, val) in src_dict.iteritems():
                _method(self, key, len(key), val)
                if self.k:
                    self._update(key, val)
        else:
            for (key, val) in src_dict.items():
                _method(self, key, len(key), val)
                if self.k:
                    self._update(key, val)
651904
def from_dict(cls, raw_data, **kwargs):
        
        instance = cls()
        instance.populate(raw_data, **kwargs)
        instance.validate(**kwargs)
        return instance
739686
def make_dict(self):
        
        out = {}
        while True:
            try:
                key = self.dict_key()
                self.separator(separator=":")
                value = self.value_assign(end_token="]")
                out[key] = value
                self.separator(end_token="}")
            except self.ParseEnd:
                return out
581285
def dictlist_convert_to_bool(dict_list: Iterable[Dict], key: str) -> None:
    
    for d in dict_list:
        # d[key] = True if d[key] == "Y" else False
        d[key] = 1 if d[key] == "Y" else 0
611661
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'models' in _dict:
            args['models'] = [
                Model._from_dict(x) for x in (_dict.get('models'))
            ]
        return cls(**args)
1098866
def safe_dict(obj_or_func, **kwargs):
    
    if callable(obj_or_func):
        res = obj_or_func(**kwargs)
    else:
        res = obj_or_func
    if hasattr(res, '__dict__'):
        return res.__dict__

    attributes = [i for i in dir(res) if not i.startswith('_')]
    out = {}
    for a in attributes:
        val = getattr(res, a)
        if val and not callable(val):
            out[a] = val

    return out
442200
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'matching_results' in _dict:
            args['matching_results'] = _dict.get('matching_results')
        if 'results' in _dict:
            args['results'] = [
                QueryNoticesResult._from_dict(x) for x in (_dict.get('results'))
            ]
        if 'aggregations' in _dict:
            args['aggregations'] = [
                QueryAggregation._from_dict(x)
                for x in (_dict.get('aggregations'))
            ]
        if 'passages' in _dict:
            args['passages'] = [
                QueryPassages._from_dict(x) for x in (_dict.get('passages'))
            ]
        if 'duplicates_removed' in _dict:
            args['duplicates_removed'] = _dict.get('duplicates_removed')
        return cls(**args)
741059
def from_dict(self, the_dict):
        
        geom = geojson.loads(json.dumps(the_dict))
        result = MultiPolygon([
            [[[0, 0], [0, 0]]],
            [[[1, 1], [1, 1]]]
        ])
        result._geom = geom
        return result
587550
def from_dict(cls, d):
        
        instance = super(Simulation, cls).from_dict(d)
        #  The instance's input_files and cmd_line_args members still point to data structures in the original
        #  dictionary.  Copy them to avoid surprises if they are changed in the original dictionary.
        instance.input_files = dict(instance.input_files)
        instance.cmd_line_args = list(instance.cmd_line_args)
        return instance
1155925
def _from_dict(cls, mapping):
        
        if mapping.get("all"):
            return cls(all_=True)

        r_mappings = mapping.get("ranges", ())
        ranges = [KeyRange(**r_mapping) for r_mapping in r_mappings]

        return cls(keys=mapping.get("keys", ()), ranges=ranges)
1177990
def _from_dict(cls, _dict):
        """"""
        args = {}
        xtra = _dict.copy()
        if 'intent' in _dict:
            args['intent'] = _dict.get('intent')
            del xtra['intent']
        else:
            raise ValueError(
                'Required property \'intent\' not present in RuntimeIntent JSON'
            )
        if 'confidence' in _dict:
            args['confidence'] = _dict.get('confidence')
            del xtra['confidence']
        else:
            raise ValueError(
                'Required property \'confidence\' not present in RuntimeIntent JSON'
            )
        args.update(xtra)
        return cls(**args)