Creates a dictionary representation of the enclave.

        :param remove_nones: Whether ``None`` values should be filtered out of the dictionary.  Defaults to ``False``.
        :return: A dictionary representation of the enclave.
183557
def to_dict(self, remove_nones=False):
        

        if remove_nones:
            return super().to_dict(remove_nones=True)

        return {
            'id': self.id,
            'name': self.name,
            'type': self.type
        }
1077248
def as_dict(self, env=None, internal=False):
        
        ctx_mgr = suppress() if env is None else self.using_env(env)
        with ctx_mgr:
            data = self.store.copy()
            # if not internal remove internal settings
            if not internal:
                for name in dir(default_settings):
                    data.pop(name, None)
            return data
889803
def _parse_section_to_dict(cls, section_options, values_parser=None):
        
        value = {}
        values_parser = values_parser or (lambda val: val)
        for key, (_, val) in section_options.items():
            value[key] = values_parser(val)
        return value
589645
def _replace_none(self, aDict):
        
        for k, v in aDict.items():
            if v is None:
                aDict[k] = 'none'
57433
def _dictify(field, value):
    
    if value is None:
        return None
    elif field.type_:
        return value.to_dict()
    return field.dict_value(value)
317531
def _opts_to_dict(*opts):
	''''''
	ret = {}
	for key, val in opts:
		if key[:2] == '--':
			key = key[2:]
		elif key[:1] == '-':
			key = key[1:]
		if val == '':
			val = True
		ret[key.replace('-','_')] = val
	return ret
1162781
def elem_remove(self, idx=None):
        
        if idx is not None:
            if idx in self.uid:
                key = idx
                item = self.uid[idx]
            else:
                self.log('The item <{:s}> does not exist.'.format(idx), ERROR)
                return None
        else:
            return None

        convert = False
        if isinstance(self.__dict__[self._params[0]], matrix):
            self._param_to_list()
            convert = True

        # self.n -= 1
        self.uid.pop(key, '')
        self.idx.pop(item)
        self.mdl_from.pop(item)
        self.mdl_to.pop(item)

        for x, y in self.uid.items():
            if y > item:
                self.uid[x] = y - 1

        for param in self._data:
            self.__dict__[param].pop(item)

        for param in self._service:
            if len(self.__dict__[param]) == (self.n + 1):
                if isinstance(self.__dict__[param], list):
                    self.__dict__[param].pop(item)
                elif isinstance(self.__dict__[param], matrix):
                    service = list(self.__dict__[param])
                    service.pop(item)
                    self.__dict__[param] = matrix(service)

        for x in self._states:
            if len(self.__dict__[x]):
                self.__dict__[x].pop(item)

        for y in self._algebs:
            if self.__dict__[y]:
                self.__dict__[y].pop(item)

        for key, param in self._ac.items():
            if isinstance(param, list):
                for subparam in param:
                    if len(self.__dict__[subparam]):
                        self.__dict__[subparam].pop(item)
            else:
                self.__dict__[param].pop(item)

        for key, param in self._dc.items():
            self.__dict__[param].pop(item)

        self.name.pop(item)
        if convert and self.n:
            self._param_to_matrix()
1370437
def _caveat_v1_to_dict(c):
    ''' 
    '''
    serialized = {}
    if len(c.caveat_id) > 0:
        serialized['cid'] = c.caveat_id
    if c.verification_key_id:
        serialized['vid'] = utils.raw_urlsafe_b64encode(
            c.verification_key_id).decode('utf-8')
    if c.location:
        serialized['cl'] = c.location
    return serialized
290331
def to_odict(self, exclude=None):
        
        if exclude is None:
            exclude = tuple()
        colnames = [c.name for c in self.__table__.columns
                    if c.name not in exclude]
        return OrderedDict(((col, getattr(self, col)) for col in colnames))
1230553
def _clean_dic(self, dic):
        
        aux_dic = dic.copy()
        for key, value in iter(dic.items()):

            if value is None or value == '':
                del aux_dic[key]
            elif type(value) is dict:
                cleaned_dict = self._clean_dic(value)
                if not cleaned_dict:
                    del aux_dic[key]
                    continue
                aux_dic[key] = cleaned_dict
        return aux_dic
959940
def create_dhcp_options(input_dict, ignoreError = False, generateNone = False):
    
    retdict = {}
    for k,v in dict(input_dict).items():
        try:
            if generateNone and v is None:
                retdict[k] = None
            else:
                try:
                    retdict[k] = create_option_from_value(k, v)
                except _EmptyOptionException:
                    if generateNone:
                        retdict[k] = None
        except Exception:
            if ignoreError:
                continue
            else:
                raise
    return retdict
20646
def remove_empty_from_dict(dictionary):
    
    if isinstance(dictionary, dict):
        return dict(
            (k,
             remove_empty_from_dict(v)) for k, v in iteritems(
                 dictionary) if v and remove_empty_from_dict(v))
    elif isinstance(dictionary, list):
        return [remove_empty_from_dict(v) for v in dictionary if v and remove_empty_from_dict(v)]
    return dictionary
608950
def _remove_none(data):
    
    if isinstance(data, list) or isinstance(data, tuple):
        return [x for x in data if x is not None]

    out = OrderedDict()
    for key, val in data.iteritems():
        if val is not None:
            out[key] = val

    return out
1155632
def _remove_none_values(dictionary):
    
    return list(map(dictionary.pop,
                    [i for i in dictionary if dictionary[i] is None]))
80199
def remove_option(self, section, option):
        """"""
        if not section or section == DEFAULTSECT:
            sectdict = self._defaults
        else:
            try:
                sectdict = self._sections[section]
            except KeyError:
                raise NoSectionError(section)
        option = self.optionxform(option)
        existed = option in sectdict
        if existed:
            del sectdict[option]
        return existed
1333856
def __clean_dict(dictionary):
        
        key_dict = {}
        value_dict = {}
        final_list = []
        for key in dictionary.keys():
            key_dict[key] = "seq"

        for value in dictionary.values():
            value_dict[value] = "text"

        for (key1, value1), (key2, value2) in zip(key_dict.items(), value_dict.items()):
            final_list.append({value1: int(key1), value2: key2})

        return final_list
1023508
def remove_properties_containing_None(properties_dict):
    
    # remove empty properties - as validations may fail
    new_dict  = dict()
    for key in properties_dict.keys():
        value = properties_dict[key]
        if value is not None:
            new_dict[key] = value
    return new_dict