docs: def setupEnvironment(self=None):
          """Set the environment (argv, sys.path and module import) of
          scoop.MAIN_MODULE.
          """
          # get the module path in the Python path
          sys.path.append(os.path.dirname(os.path.abspath(scoop.MAIN_MODULE)))
  
          # Add the user arguments to argv
          sys.argv = sys.argv[:1]
          if self:
              sys.argv += self.args.args
  
          try:
              if scoop.IS_ORIGIN:
                  _ = open(scoop.MAIN_MODULE, 'r')
                  user_module = None
              else:
                  user_module = importFunction(
                      "SCOOP_WORKER",
                      scoop.MAIN_MODULE,
                  )
          except FileNotFoundError as e:
              # Could not find file
              sys.stderr.write('{0}\nFile: {1}\nIn path: {2}\n'.format(
                      str(e),
                      scoop.MAIN_MODULE,
                      sys.path[-1],
                  )
              )
              sys.stderr.flush()
              sys.exit(-1)
  
          globs = {}
          try:
              attrlist = user_module.__all__
          except AttributeError:
              attrlist = dir(user_module)
          for attr in attrlist:
              globs[attr] = getattr(user_module, attr)
  
          if self and scoop.IS_ORIGIN:
              return {}
          elif self:
              return globs
          return user_module