returns a formatted view of the local variables in a frame

def get_locals(f):
    ''' returns a formatted view of the local variables in a frame '''
    return pformat({i:f.f_locals[i] for i in f.f_locals if not i.startswith('__')})