def mod_to_context(mod):
  """Converts the loaded module of :any:`load` to a dictionary context.
  This function removes all the variables that start and end with ``__``.

  Parameters
  ----------
  mod : object
      What is returned by :any:`load`

  Returns
  -------
  dict
      The context that was in ``mod``.
  """
  return {k: v for k, v in mod.__dict__.items()
          if not (k.startswith('__') and k.endswith('__'))}