Extracts the values from a string that represents a dict and returns them
    sorted by key.

    Args:
        str_in (string) that contains python dict
    Returns:
        (list) with values or None if no valid dict was found
    Raises:
        -
4237
def str2dict_values(str_in):
    '''
    
    '''
    tmp_dict = str2dict(str_in)
    if tmp_dict is None:
        return None
    return [tmp_dict[key] for key in sorted(k for k in tmp_dict)]
994994
def get_values(self):
        
        return_dict = {}
        for i,ctrl in enumerate(self.list_ctrls):
            if hasattr(self.parse_funcs,'__getitem__') and len(self.parse_funcs)>i and hasattr(self.parse_funcs[i],'__call__'):
                try: return_dict[self.inputs[i]] = self.parse_funcs[i](ctrl.GetValue())
                except: return_dict[self.inputs[i]] = ctrl.GetValue()
            else:
                return_dict[self.inputs[i]] = ctrl.GetValue()
        return ('' not in list(return_dict.values()), return_dict)
433618
def str_if_nested_or_str(s):
    """"""
    if isinstance(s, ALL_STRING_TYPES):
        return str(s)
    if isinstance(s, (list, tuple)):
        return type(s)(map(str_if_nested_or_str, s))
    if isinstance(s, (dict, )):
        return stringify_dict_contents(s)
    return s
399732
def to_dict_str(origin_value, encode=None):
    
    value = copy.deepcopy(origin_value)
    for k, v in value.items():
        if isinstance(v, dict):
            value[k] = to_dict_str(v, encode)
            continue

        if isinstance(v, list):
            value[k] = to_list_str(v, encode)
            continue

        if encode:
            value[k] = encode(v)
        else:
            value[k] = default_encode(v)

    return value
662878
def _get_changes_from_diff_dict(diff_dict):
    '''
    
    '''
    changes_strings = []
    for p in diff_dict.keys():
        if not isinstance(diff_dict[p], dict):
            raise ValueError('Unexpected diff difct \'{0}\''.format(diff_dict))
        if sorted(diff_dict[p].keys()) == ['val1', 'val2']:
            # Some string formatting
            from_str = diff_dict[p]['val1']
            if isinstance(diff_dict[p]['val1'], six.string_types):
                from_str = '\'{0}\''.format(diff_dict[p]['val1'])
            elif isinstance(diff_dict[p]['val1'], list):
                from_str = '\'{0}\''.format(', '.join(diff_dict[p]['val1']))
            to_str = diff_dict[p]['val2']
            if isinstance(diff_dict[p]['val2'], six.string_types):
                to_str = '\'{0}\''.format(diff_dict[p]['val2'])
            elif isinstance(diff_dict[p]['val2'], list):
                to_str = '\'{0}\''.format(', '.join(diff_dict[p]['val2']))
            changes_strings.append('{0} from {1} to {2}'.format(
                p, from_str, to_str))
        else:
            sub_changes = _get_changes_from_diff_dict(diff_dict[p])
            if sub_changes:
                changes_strings.append('{0}:'.format(p))
                changes_strings.extend(['\t{0}'.format(c)
                                       for c in sub_changes])
    return changes_strings
844076
def _extract_values(values_list):
        
        values = []
        # check if file or list of values to iterate
        if isinstance(values_list, str):
            with open(values_list) as ff:
                reading = csv.reader(ff)
                for j in reading:
                    values.append(j[0])
        elif isinstance(values_list, list):
            values = values_list
        else:
            raise Exception("input datatype not supported.")
        return values
917327
def extract_key_values(array_value, separators=(';', ',', ':'), **kwargs):
    
    items_sep, fields_sep, keys_sep = separators
    return items_sep.join(fields_sep.join(keys_sep.join(x) for x in sorted(it.items()))
                          for it in array_value)
541288
def from_string(self, value):
        """"""
        # Remove optional {}
        if value.startswith('{') and value.endswith('}'):
            text = value[1:-1].strip()
        else:
            text = value.strip()
        # Result is a dictionary
        result = {}
        # Convert each pair of <int>:<float> into a key, value pair.
        for val in text.split(','):
            tokens = val.split(':')
            if len(tokens) != 2:
                raise ValueError('invalid entry in dictionary: ' + val)
            result[str(int(tokens[0].strip()))] = float(tokens[1].strip())
        return result
892165
def convert_values(self, matchdict: Dict[str, str]) -> Dict[str, Any]:
        

        converted = {}
        for varname, value in matchdict.items():
            converter = self.converters[varname]
            converted[varname] = converter(value)
        return converted
611082
def to_str(cls, values, callback=None):
        
        if callback and callable(callback):
            if isinstance(values, dict):
                return callback(_es.to_str(values))

            return [callback(_es.to_str(i)) for i in values]
        return _es.to_str(values)
137870
def stringify_values(data):
    
    if not isinstance(data, dict):
        raise ValueError('Data must be dict. %r is passed' % data)

    values_dict = {}
    for key, value in data.items():
        items = []
        if isinstance(value, six.string_types):
            items.append(value)
        elif isinstance(value, Iterable):
            for v in value:
                # Convert to str int values
                if isinstance(v, int):
                    v = str(v)
                try:
                    item = six.u(v)
                except TypeError:
                    item = v
                items.append(item)
            value = ','.join(items)
        values_dict[key] = value
    return values_dict
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
734078
def get_dictkey(In, k, dtype):
    

    Out = []
    for d in In:
        if dtype == '':
            Out.append(d[k])
        if dtype == 'f':
            if d[k] == "":
                Out.append(0)
            elif d[k] == None:
                Out.append(0)
            else:
                Out.append(float(d[k]))
        if dtype == 'int':
            if d[k] == "":
                Out.append(0)
            elif d[k] == None:
                Out.append(0)
            else:
                Out.append(int(d[k]))
    return Out
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_
248179
def get_keys_from_value(self, value):
        

        return [key for key, data in self.iteritems() if data == value]
615382
def _dict_to_map_str_str(self, d):
        
        return dict(map(
            lambda (k, v): (k, str(v).lower() if isinstance(v, bool) else str(v)),
            d.iteritems()
        ))
521374
def format_string_values(obj, err_fallback=(IndexError, KeyError), *args, **kwargs):
    
    if isinstance(obj, dict):
        new = {}
        for key in obj.keys():
            new[key] = format_string_values(obj[key], *args, **kwargs)
        return new
    elif isinstance(obj, list):
        new = []
        for item in obj:
            new.append(format_string_values(item, *args, **kwargs))
        return new
    elif isinstance(obj, six.string_types):
        try:
            return obj.format(*args, **kwargs)
        except err_fallback:
            return obj
    else:
        return obj