def _select_binary_base_path(self, supportdir, version, name, uname_func=None):
    """Calculate the base path.

    Exposed for associated unit tests.
    :param supportdir: the path used to make a path under --pants_bootstrapdir.
    :param version: the version number of the tool used to make a path under --pants-bootstrapdir.
    :param name: name of the binary to search for. (e.g 'protoc')
    :param uname_func: method to use to emulate os.uname() in testing
    :returns: Base path used to select the binary file.
    """
    uname_func = uname_func or os.uname

    sysname, _, release, _, machine = uname_func()
    try:
      os_id = get_os_id(uname_func=uname_func)
    except __HOLE__:
      os_id = None
    if os_id is None:
      raise self.MissingMachineInfo("Pants has no binaries for {}".format(sysname))

    try:
      middle_path = self._path_by_id[os_id]
    except KeyError:
      raise self.MissingMachineInfo(
        "Update --binaries-path-by-id to find binaries for {sysname} {machine} {release}.".format(
          sysname=sysname, release=release, machine=machine))
    return os.path.join(supportdir, *(middle_path + [version, name]))
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/binaries/binary_util.py/BinaryUtil._select_binary_base_path