def METHOD_NAME(v):
  appspot_version = tag_to_appspot_version(v)
  if v == 'nightly':
    return V2_URL_TEMPLATE.format(v, 'compiled.js')
  elif (version_key(v) == version_key('v1.6.5') or
        version_key(v) >= version_key('v2.0.6')):
    return HOSTED_URL_TEMPLATE.format(v.replace('v', ''), 'compiled.js')
  elif appspot_version in DEPLOYED_APPSPOT_VERSIONS:
    if version_key(v) >= version_key('v2.0.0-beta'):
      return V2_URL_TEMPLATE.format(appspot_version, 'compiled.js')
    else:
      return V1_URL_TEMPLATE.format(appspot_version, 'compiled.js')
  else:
    return None