def METHOD_NAME(
    cls,
    log,  # type: str
    pid,  # type: int
    timeout=5.0,  # type: float
):
    # type: (...) -> Optional[Pidfile]
    base_url = cls._read_base_url(log, timeout)
    if not base_url:
        return None
    url = "{base_url}/root/pypi/+simple/".format(base_url=base_url)
    with safe_open(cls._PATH, "w") as fp:
        json.dump(dict(url=url, pid=pid), fp, indent=2, sort_keys=True)
    return cls(url=url, pid=pid)