def prefix(prefix):
    """Returns a dictionary of all environment variables starting with
    the given prefix, lower cased and stripped.
    """

    d = {}
    e = lower_dict(environ.copy())

    prefix = prefix.lower()

    for k, v in e.items():
        try:
            if k.startswith(prefix):
                k = k[len(prefix):]
                d[k] = v
        except AttributeError:
            pass

    return d
def prefix ( prefix ) : d = { } e = lower_dict ( environ . copy ( ) ) prefix = prefix . lower ( ) for k , v in e . items ( ) : try : if k . startswith ( prefix ) : k = k [ len ( prefix ) : ] d [ k ] = v except AttributeError : pass return d
Returns a dictionary of all environment variables starting with
    the given prefix, lower cased and stripped.