code: def api(root_url, service, version, path):
      
      root_url = root_url.rstrip('/')
      path = path.lstrip('/')
      if root_url == OLD_ROOT_URL:
          return 'https://{}.taskcluster.net/{}/{}'.format(service, version, path)
      else:
          return '{}/api/{}/{}/{}'.format(root_url, service, version, path)
docs: Generate URL for path in a Taskcluster service.