def consoledict(mydict, members=None, printval=True, indent=0, retval=False, plainprint=False):
    """
    @type mydict: dict
    @type members: str, None
    @type retval: bool
    @type indent: int
    @type printval: bool
    @type plainprint: bool
    @return: None
    """
    dbs = ""

    if printval is True:
        dbs = "\033[32m" + log_date_time_string() + " | "
        dbs += stack_trace(line_num_only=3).strip()
        dbs += " - consoledict:\033[0m\n"

    if plainprint is True:
        dbs = log_date_time_string() + " | "
        dbs += stack_trace(line_num_only=3).strip()
        dbs += " - consoledict:\n"

    if indent > 0:
        dbs = ""

    if isinstance(mydict, dict):
        if members is None:
            members = list(mydict.keys())

        members.sort()

        for i in members:
            dbs += "    " * indent

            if isinstance(mydict[i], dict):
                newindent = indent + 1

                if plainprint is False:
                    dbs += "\033[35m" + str(i) + ":\n" + "\033[0m"
                else:
                    dbs += str(i) + ":\n"

                dbs += consoledict(mydict[i], printval=printval, indent=newindent, retval=True, plainprint=plainprint)
            else:
                if plainprint is False:
                    dbs += "\033[35m" + str(i) + ": " + "\033[0m"
                    dbs += colorize_for_print(str(mydict[i])) + "\n"
                else:
                    dbs += str(i) + ": " + str(mydict[i]) + "\n"
    else:
        dbs += "not dict: " + str(mydict) + "\n"

    if printval is True and retval is False:
        sys.stderr.write(dbs)

    if indent == 0:
        dbs = dbs.strip()

    return dbs
def consoledict ( mydict , members = None , printval = True , indent = 0 , retval = False , plainprint = False ) : dbs = "" if printval is True : dbs = "\033[32m" + log_date_time_string ( ) + " | " dbs += stack_trace ( line_num_only = 3 ) . strip ( ) dbs += " - consoledict:\033[0m\n" if plainprint is True : dbs = log_date_time_string ( ) + " | " dbs += stack_trace ( line_num_only = 3 ) . strip ( ) dbs += " - consoledict:\n" if indent > 0 : dbs = "" if isinstance ( mydict , dict ) : if members is None : members = list ( mydict . keys ( ) ) members . sort ( ) for i in members : dbs += "    " * indent if isinstance ( mydict [ i ] , dict ) : newindent = indent + 1 if plainprint is False : dbs += "\033[35m" + str ( i ) + ":\n" + "\033[0m" else : dbs += str ( i ) + ":\n" dbs += consoledict ( mydict [ i ] , printval = printval , indent = newindent , retval = True , plainprint = plainprint ) else : if plainprint is False : dbs += "\033[35m" + str ( i ) + ": " + "\033[0m" dbs += colorize_for_print ( str ( mydict [ i ] ) ) + "\n" else : dbs += str ( i ) + ": " + str ( mydict [ i ] ) + "\n" else : dbs += "not dict: " + str ( mydict ) + "\n" if printval is True and retval is False : sys . stderr . write ( dbs ) if indent == 0 : dbs = dbs . strip ( ) return dbs
@type mydict: dict
    @type members: str, None
    @type retval: bool
    @type indent: int
    @type printval: bool
    @type plainprint: bool
    @return: None