code: def fallback_which(command, location=None, allow_global=False, system=False):
      
  
      from .vendor.pythonfinder import Finder
      if not command:
          raise ValueError("fallback_which: Must provide a command to search for...")
      if not isinstance(command, six.string_types):
          raise TypeError("Provided command must be a string, received {0!r}".format(command))
      global_search = system or allow_global
      if location is None:
          global_search = True
      finder = Finder(system=False, global_search=global_search, path=location)
      if is_python_command(command):
          result = find_python(finder, command)
          if result:
              return result
      result = finder.which(command)
      if result:
          return result.path.as_posix()
      return ""
docs: A fallback implementation of the `which` utility command that relies exclusively on
      searching the path for commands.
  
      :param str command: The command to search for, optional
      :param str location: The search location to prioritize (prepend to path), defaults to None
      :param bool allow_global: Whether to search the global path, defaults to False
      :param bool system: Whether to use the system python instead of pipenv's python, defaults to False
      :raises ValueError: Raised if no command is provided
      :raises TypeError: Raised if the command provided is not a string
      :return: A path to the discovered command location
      :rtype: str