code: def UrnStringToClientId(urn):
    
    if urn.startswith(AFF4_PREFIX):
      urn = urn[len(AFF4_PREFIX):]
  
    components = urn.split("/")
    return components[0]
docs: Converts given URN string to a client id string.