Converts a string representation of debug arguments to a dictionary.
    The string can be of the form

       IDENTIFIER1=val1,IDENTIFIER2=val2


     :param a: the argument string
     :return: the dictionary
554313
def debugArgsToDict(a):
    
    s = a.replace('+', ' ')
    s = s.replace('=', ':')
    s = re.sub(r'([A-Z][A-Z_]+)', r"'\1'", s)
    return ast.literal_eval('{ ' + s + ' }')
787234
def get_dictionary(self):
        

        # output
        k = list()
        d = dict()

        # loop over the root items
        for i in range(self._widget.topLevelItemCount()):

            # grab the parameter item, and start building the name
            x = self._widget.topLevelItem(i).param

            # now start the recursive loop
            self._get_parameter_dictionary('', d, k, x)

        return k, d
1252023
def bdecode(bstring):
    '''
        
    '''

    def get_val():
        i = reader.next()
        if i.isdigit():
            str_len = get_len(i)
            return get_str(str_len)
        if i == 'd':
            return get_dict()
        if i == 'l':
            return get_list()
        if i == 'i':
            return get_int()
        if i == 'e':
            return None

    def get_len(i=''):
        len_str = str(i)
        next_char = reader.next()
        if next_char == 'e':  # The line that collapses the dictionary
            return None
        while next_char is not ':':
            len_str += next_char
            next_char = reader.next()
        else:
            return int(len_str)

    def get_dict():
        this_dict = {}
        while 1:
            str_len = get_len()
            if str_len is None:  # This dict is done
                return this_dict
            key = get_str(str_len)
            val = get_val()
            this_dict[key] = val

    def get_int():
        int_str = ''
        i = reader.next()
        while i is not 'e':
            int_str += i
            i = reader.next()
        else:
            return int(int_str)

    def get_str(str_len):
        this_str = ''
        for i in range(str_len):
            this_str += reader.next()
        return this_str

    def get_list():
        this_list = []
        while 1:
            val = get_val()
            if not val:
                return this_list
            this_list.append(val)

    reader = _readchar(bstring)
    dict_repr = get_val()
    return dict_repr
628378
def deparse_code2str(code, out=sys.stdout, version=None,
                     debug_opts=DEFAULT_DEBUG_OPTS,
                     code_objects={}, compile_mode='exec',
                     is_pypy=IS_PYPY, walker=SourceWalker):
    
    return deparse_code(version, code, out, showasm=debug_opts.get('asm', None),
                        showast=debug_opts.get('tree', None),
                        showgrammar=debug_opts.get('grammar', None), code_objects=code_objects,
                        compile_mode=compile_mode, is_pypy=is_pypy, walker=walker).text
1252834
def str2dict(dotted_str, value=None, separator='.'):
    
    dict_ = {}
    parts = dotted_str.split(separator)
    d, prev = dict_, None
    for part in parts:
        prev = d
        d = d.setdefault(part, {})
    else:
        if value is not None:
            prev[part] = value
    return dict_
211612
def parse(self, *args):
        

        if isinstance(self.dictionary, dict):
            return self.dictionary

        raise self.subparserException("Argument passed to Dictionary SubParser is not a dict: %s" % type(self.dictionary))
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
        }
1144641
def as_dict(self):
        
        return {self.FLD_OP: self._op.name,
                self.FLD_MARK: self._pos,
                self.FLD_FLD: self._fld}
75867
def parse_vars(self, args):
        
        result = {}
        for arg in args:
            if '=' not in arg:
                raise ValueError(
                    'Variable assignment %r invalid (no "=")'
                    % arg)
            name, value = arg.split('=', 1)
            result[name] = value
        return result
1208335
def arg_string_from_dict(arg_dict, **kwds):
    
    # the filters dictionary
    filters = {
        **arg_dict,
        **kwds,
    }
    # return the correctly formed string
    return ", ".join("{}: {}".format(key, json.dumps(value)) for key,value in filters.items())
26781
def to_dict(self):
        ''''''
        d = {'name': self.name}
        if self.data:
            d['data'] = self.data
        return d
415732
def kvp_dict(d):
    
    return ', '.join(
        ["{}={}".format(k, quotable(v)) for k, v in d.items()])
153929
def get_params(self):
        ""
        import inspect
        a = inspect.getargspec(self.__init__)[0]
        out = dict()
        for key in a[1:]:
            value = getattr(self, "_%s" % key, None)
            out[key] = value
        return out
312659
def pot_dict_from_string(pot_data):
        

        pot_dict = {}
        pot_dict_reverse = {}
        begin = 0
        ln = -1

        for line in pot_data.split("\n"):
            try:
                if begin == 0 and line.split()[0] == "0":
                    begin += 1
                    ln = 0
                if begin == 1:
                    ln += 1
                if ln > 0:
                    atom = line.split()[2]
                    index = int(line.split()[0])
                    pot_dict[atom] = index
                    pot_dict_reverse[index] = atom
            except (ValueError, IndexError):
                pass
        return pot_dict, pot_dict_reverse
942966
def format_args(self, args):
        ''''''

        def format_arg(a):
            if isinstance(a, dbus.Boolean):
                return str(bool(a))
            if isinstance(a, dbus.Byte):
                return str(int(a))
            if isinstance(a, int) or isinstance(a, long):
                return str(a)
            if isinstance(a, str):
                return '"' + str(a) + '"'
            if isinstance(a, unicode):  # Python 2 only
                return '"' + repr(a.encode('UTF-8'))[1:-1] + '"'
            if isinstance(a, list):
                return '[' + ', '.join([format_arg(x) for x in a]) + ']'
            if isinstance(a, dict):
                fmta = '{'
                first = True
                for k, v in a.items():
                    if first:
                        first = False
                    else:
                        fmta += ', '
                    fmta += format_arg(k) + ': ' + format_arg(v)
                return fmta + '}'

            # fallback
            return repr(a)

        s = ''
        for a in args:
            if s:
                s += ' '
            s += format_arg(a)
        if s:
            s = ' ' + s
        return s
591438
def all_as_dict():
    '''
    
                    
    '''
    cmd = ['lxc-list']
    out = subprocess.check_output(cmd).splitlines()
    stopped = []
    running = []
    frozen = []
    current = None
    for c in out:
        c = c.strip()
        if c == 'RUNNING':
            current = running
            continue
        if c == 'STOPPED':
            current = stopped
            continue
        if c == 'FROZEN':
            current = frozen
            continue
        if not len(c):
            continue
        current.append(c)
    return {'Running': running,
            'Stopped': stopped,
            'Frozen': frozen}
1046099
def as_dict(self):
        

        output_dictionary = dict()

        for attribute_name, type_instance in inspect.getmembers(self):

            if attribute_name.startswith('__') or inspect.ismethod(type_instance):
                continue

            if isinstance(type_instance, bool):
                output_dictionary[attribute_name] = type_instance
            elif isinstance(type_instance, self.__class__):
                output_dictionary[attribute_name] = type_instance.as_dict()

        return output_dictionary