def _dict_itemstrs(dict_, **kwargs):
import ubelt as ub<EOL>explicit = kwargs.get('<STR_LIT>', False)<EOL>kwargs['<STR_LIT>'] = _rectify_countdown_or_bool(explicit)<EOL>precision = kwargs.get('<STR_LIT>', None)<EOL>kvsep = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>if explicit:<EOL><INDENT>kvsep = '<STR_LIT:=>'<EOL><DEDENT>def make_item_str(key, val):<EOL><INDENT>if explicit or kwargs.get('<STR_LIT>', False):<EOL><INDENT>key_str = six.text_type(key)<EOL><DEDENT>else:<EOL><INDENT>key_str = repr2(key, precision=precision, newlines=<NUM_LIT:0>)<EOL><DEDENT>prefix = key_str + kvsep<EOL>kwargs['<STR_LIT>'] = True<EOL>val_str, _leaf_info = repr2(val, **kwargs)<EOL>pos = val_str.find('<STR_LIT:\n>')<EOL>first_line = val_str if pos == -<NUM_LIT:1> else val_str[:pos]<EOL>compact_brace = kwargs.get('<STR_LIT>', kwargs.get('<STR_LIT>', False))<EOL>if compact_brace or not first_line.rstrip().endswith(tuple('<STR_LIT>')):<EOL><INDENT>rest = '<STR_LIT>' if pos == -<NUM_LIT:1> else val_str[pos:]<EOL>val_str = first_line.lstrip() + rest<EOL>if '<STR_LIT:\n>' in prefix:<EOL><INDENT>item_str = prefix + val_str<EOL><DEDENT>else:<EOL><INDENT>item_str = ub.hzcat([prefix, val_str])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>item_str = prefix + val_str<EOL><DEDENT>return item_str, _leaf_info<EOL><DEDENT>items = list(six.iteritems(dict_))<EOL>_tups = [make_item_str(key, val) for (key, val) in items]<EOL>itemstrs = [t[<NUM_LIT:0>] for t in _tups]<EOL>max_height = max([t[<NUM_LIT:1>]['<STR_LIT>'] for t in _tups]) if _tups else <NUM_LIT:0><EOL>_leaf_info = {<EOL>'<STR_LIT>': max_height + <NUM_LIT:1>,<EOL>}<EOL>sort = kwargs.get('<STR_LIT>', None)<EOL>if sort is None:<EOL><INDENT>sort = True<EOL><DEDENT>if isinstance(dict_, collections.OrderedDict):<EOL><INDENT>sort = False<EOL><DEDENT>if sort:<EOL><INDENT>itemstrs = _sort_itemstrs(items, itemstrs)<EOL><DEDENT>return itemstrs, _leaf_info<EOL>
Create a string representation for each item in a dict.

Example:
    >>> from ubelt.util_format import *
    >>> dict_ =  {'b': .1, 'l': 'st', 'g': 1.0, 's': 10, 'm': 0.9, 'w': .5}
    >>> kwargs = {'strkeys': True}
    >>> itemstrs, _ = _dict_itemstrs(dict_, **kwargs)
    >>> char_order = [p[0] for p in itemstrs]
    >>> assert char_order == ['b', 'g', 'l', 'm', 's', 'w']