def min(dictionary, key=None, recursive=True):
    """

    Return the smallest item in a dictionary. The optional key argument 
    specifies a one-argument ordering function like that used for list.sort(). 
    The key argument, if supplied, must be in keyword form 
    (for example, min(dictionary, key=func)).
    """
    minimum = None
    if key == None:
        keyfunc = lambda key, _: key
    else:
        keyfunc = key
    for key in dictionary:
        value = dictionary[key]
        if minimum == None:
            minimum = keyfunc(key, value)
        if recursive and type(value) == dict:
            sub_minimum = min(value, key=keyfunc, recursive=recursive)
            if sub_minimum != None and sub_minimum < minimum:
                minimum = sub_minimum
        current_min = keyfunc(key, value)
        if current_min < minimum:
            minimum = current_min
    return minimum
