import ast


def to_dict(value):
    """ Create a dictionary from any kind of incoming object """
    if value is None:
        return {}
    if isinstance(value, dict):
        myreturn = value
    else:
        myreturn = ast.literal_eval(value)
    return myreturn