Converts a dictionary into a list of strings.

    Args:
      data_dict (dict[str, object]): dictionary to convert.

    Returns:
      list[str]: list of strings.
765567
def _DictToListOfStrings(self, data_dict):
    
    ret_list = []
    for key, value in iter(data_dict.items()):
      if key in ('body', 'datetime', 'type', 'room', 'rooms', 'id'):
        continue
      ret_list.append('{0:s} = {1!s}'.format(key, value))

    return ret_list
657723
def to_dict(self):
        
        dyn_dict = {}
        for (key, val) in six.iteritems(self.__dict__):
            if key not in self._printable_exclude:
                dyn_dict[key] = val
        return dyn_dict
933087
def decode_data_items(self, concatenated_str):
        

        data_items = []
        str_list = concatenated_str.split(self.SEPARATOR)
        for str in str_list:

            # '~base-64-strings' are decoded into integers.
            if len(str)>=1 and str[0]==self.INTEGER_PREFIX:
                item = self.decode_int(str[1:])

            # Strings are decoded as-is.
            else:
                item = str

            data_items.append(item)

        # Return list of data items
        return data_items
1077764
def dict_to_table(dictionary, list_of_keys=None):
    

    # assert len(dictionary.values()) > 0, "Dictionary cannot be empty"

    # Create an empty table

    table = Table()

    # If the dictionary is not empty, fill the table

    if len(dictionary) > 0:

        # Add the names as first column

        table['name'] = dictionary.keys()

        # Now add all other properties

        # Use the first parameter as prototype

        prototype = dictionary.values()[0]

        column_names = prototype.keys()

        # If we have a white list for the columns, use it

        if list_of_keys is not None:

            column_names = filter(lambda key: key in list_of_keys, column_names)

        # Fill the table

        for column_name in column_names:

            table[column_name] = map(lambda x: x[column_name], dictionary.values())

    return table
989867
def _dictlist_to_lists(dl, *keys):
    ''' 
    '''
    lists = []
    for k in keys:
        lists.append([])
    for item in dl:
        for i, key in enumerate(keys):
            x = item[key]
            if isinstance(x, unicode):
                x = str(x)
            lists[i].append(x)
    return lists
785930
def csv_dict(d):
    
    if len(d) == 0:
        return "{}"
    return "{" + ', '.join(["'{}': {}".format(k, quotable(v))
                            for k, v in d.items()]) + "}"
453239
def as_dict(self):
        
        d = {k:v for (k,v) in self.__dict__.items()}
        return d
1147292
def from_dict(self, d):
        
        for key in d:
            if key == 'data':
                for dkey in d['data']:
                    if dkey in self._encode_fields:
                        setattr(self, str(dkey), base64.b64decode(d['data'][dkey]))
                    else:
                        setattr(self, str(dkey), d['data'][dkey])
            else:
                setattr(self, str(key), d[key])
276362
def to_utf8(self, data):
        
        # if this is a unicode string, return its string representation
        if isinstance(data, unicode):
            return data.encode('utf-8')

        # if this is a list of values, return list of string values
        if isinstance(data, list):
            return [self.to_utf8(item) for item in data]

        # if this is a dictionary, return dictionary of string keys and values
        if isinstance(data, dict):
            return {
                self.to_utf8(key): self.to_utf8(value)
                for key, value in data.iteritems()
            }

        # if it's anything else, return it in its original form
        return data
779759
def to_dict(self):
        
        list_data = []
        for key, value in list(self.data.items()):
            row = list(key)
            row.append(value)
            list_data.append(row)
        return {
            'groups': self.groups,
            'data': list_data
        }
340762
def dict(self):
        
        d = {p.key: getattr(self, p.key) for p in self.__mapper__.attrs
             if p.key not in ('table', 'stats', '_codes', 'data')}

        if not d:
            raise Exception(self.__dict__)

        d['schema_type'] = self.schema_type

        if self.data:
            # Copy data fields into top level dict, but don't overwrite existind values.
            for k, v in six.iteritems(self.data):
                if k not in d and k not in ('table', 'stats', '_codes', 'data'):
                    d[k] = v

        return d
880071
def list_of_dict(self):
        
        ret = []
        for row in self:
            ret.append(dict([(self._col_names[i], row[i]) for i in
                             range(len(self._col_names))]))
        return ReprListDict(ret, col_names=self._col_names,
                            col_types=self._col_types,
                            width_limit=self._width_limit,
                            digits=self._digits,
                            convert_unicode=self._convert_unicode)
1079099
def dict(self):
        
        return_obj = {}
        for attr in dir(self):
            if not attr.startswith('__') and attr not in self.__reserved:
                if isinstance(getattr(self, attr), list):
                    return_val = []
                    for item in getattr(self, attr):
                        if isinstance(item, DictClass):
                            return_val.append(dict(item))
                        else:
                            return_val.append(item)
                elif isinstance(getattr(self, attr), dict):
                    return_val = {}
                    for key, item in getattr(self, attr).items():
                        if isinstance(item, DictClass):
                            return_val[key] = item.dict()
                        else:
                            return_val[key] = item
                elif isinstance(getattr(self, attr), DictClass):
                    return_val = getattr(self, attr).dict()
                else:
                    return_val = getattr(self, attr)
                return_obj[attr] = return_val
        return return_obj
803700
def serialize(dictionary):
    

    data = []
    for key, value in dictionary.items():
        data.append('{0}="{1}"'.format(key, value))
    return ', '.join(data)
925156
def to_dict(self):
        
        def _json_safe(v):
            if isinstance(v, np.ndarray):
                return v.tolist()
            elif is_unit(v)[0]:
                return v.to_string()
            else:
                return v
        d = {k:_json_safe(v) for k,v in self._descriptors.items()}
        d['nparray'] = self.__class__.__name__.lower()
        return d
261567
def _dictionary_to_stringlist(input_dict):
    '''
    
    '''
    string_value = ""
    for s in input_dict:
        string_value += "{0}={1},".format(s, input_dict[s])
    string_value = string_value[:-1]
    return string_value
326548
def encode_csv(data_dict, column_names):
  
  import csv
  import six
  values = [str(data_dict[x]) for x in column_names]
  str_buff = six.StringIO()
  writer = csv.writer(str_buff, lineterminator='')
  writer.writerow(values)
  return str_buff.getvalue()