code: def _remove_non_methods():
    
    cur_module = sys.modules[__name__]
    my_globals = dict(globals())
    # Import here so that it doesn't get added to the global namespace or deleted.
    # pylint: disable=g-import-not-at-top
    from prettytensor.pretty_tensor_class import PrettyTensor
    for name, _ in six.iteritems(my_globals):
      if not hasattr(PrettyTensor, name):
        delattr(cur_module, name)
    # Remove a couple of special ones....
    if hasattr(cur_module, 'bookkeeper'):
      delattr(cur_module, 'bookkeeper')
docs: Removes any object in dict that is not a registered method.