code: def get_project(url=None, username=None, password=None, token=None, scope=None, scope_id=None,
                  env_filename=None, status=ScopeStatus.ACTIVE):
      if env.bool(kecenv.KECHAIN_FORCE_ENV_USE, default=False):
          if not os.getenv(kecenv.KECHAIN_URL):
              raise ClientError(
                  "Error: KECHAIN_URL should be provided as environment variable (use of env vars is enforced)")
          if not (os.getenv(kecenv.KECHAIN_TOKEN) or
                  (os.getenv(kecenv.KECHAIN_PASSWORD) and os.getenv(kecenv.KECHAIN_PASSWORD))):
              raise ClientError("Error: KECHAIN_TOKEN or KECHAIN_USERNAME and KECHAIN_PASSWORD should be provided as "
                                "environment variable(s) (use of env vars is enforced)")
          if not (os.getenv(kecenv.KECHAIN_SCOPE) or os.getenv(kecenv.KECHAIN_SCOPE_ID)):
              raise ClientError("Error: KECHAIN_SCOPE or KECHAIN_SCOPE_ID should be provided as environment variable "
                                "(use of env vars is enforced)")
      if env.bool(kecenv.KECHAIN_FORCE_ENV_USE, default=False) or \
              not any((url, username, password, token, scope, scope_id)):
          client = Client.from_env(env_filename=env_filename)
          scope_id = env(kecenv.KECHAIN_SCOPE_ID, default=None)
          scope = env(kecenv.KECHAIN_SCOPE, default=None)
          status = env(kecenv.KECHAIN_SCOPE_STATUS, default=None)
      elif (url and ((username and password) or (token)) and (scope or scope_id)) and \
              not env.bool(kecenv.KECHAIN_FORCE_ENV_USE, default=False):
          client = Client(url=url)
          client.login(username=username, password=password, token=token)
      else:
          raise ClientError("Error: insufficient arguments to connect to KE-chain. "
                            "See documentation of `pykechain.get_project()`")
      if scope_id:
          return client.scope(pk=scope_id, status=status)
      else:
          return client.scope(name=scope, status=status)