docs: def _resolve_global_entity(project_or_job_id, folderpath, entity_name, describe=True, visibility="either"):
      """
      :param project_or_job_id: The project ID to which the entity belongs
                                (then the entity is an existing data object),
                                or the job ID to which the entity belongs
                                (then the entity is a job-based object
                                reference to an object that may not exist yet)
      :type project_or_job_id: string
      :param folderpath: Full path to the object (parsed from command line)
      :type folderpath: string
      :param entity_name: Name of the object
      :type entity_name: string
      :param describe: Input mapping used to describe the job's project if
                       project_or_job_id is a job ID, or True if the input
                       mapping is to be empty
      :type describe: dict or True
      :param visibility: The expected visibility of the entity ("either",
                         "hidden", or "visible"); to be used in resolution
      :type visibility: string
      :returns: The results obtained from attempting to resolve the entity;
                the expected format of the return value is described below
      :rtype: list
      :raises: ResolutionError if dxpy.find_data_objects throws an error
  
      If project_or_job_id is a job ID, then return value will be like:
          [{"id": ..., "describe": {...}}, ...]
  
      Otherwise, the return value will be like:
          [{"id": ..., "project": ..., "describe": {...}}, ...]
      Note that if the entity is successfully resolved, then the "describe"
      key will be in the dictionary if and only if a nonempty describe
      mapping was provided.
  
      TODO: Inspect entity_name and conditionally treat it as a "glob" pattern.
  
      TODO: Callers should specify exactly what fields they want, and then
      hopefully we can avoid having a default set of fields that may be very
      expensive
      """
      if is_job_id(project_or_job_id):
          if describe is True:
              describe = {}
          # The following function call will raise a ResolutionError if no results
          # could be found.
          # If the call is successful, then the project will be incorporated into the
          # "describe" mapping of the returned dictionaries.
          return resolve_job_ref(project_or_job_id, entity_name, describe=describe)
      else:
          try:
              return list(dxpy.find_data_objects(project=project_or_job_id,
                                                 folder=folderpath,
                                                 name=entity_name,
                                                 name_mode='glob',
                                                 recurse=False,
                                                 describe=describe,
                                                 visibility=visibility))
          except Exception as details:
              raise ResolutionError(str(details))