def UrnStringToHuntId(urn):
 if urn.startswith(AFF4_PREFIX):
  urn = urn[len(AFF4_PREFIX):]
 components = urn.split('/')
 if ((len(components) != 2) or (components[0] != 'hunts')):
  raise ValueError('Invalid hunt URN: %s', urn)
 return components[(-1)]

def UrnStringToHuntId ( urn ) : if urn . startswith ( AFF4_PREFIX ) : urn = urn [ len ( AFF4_PREFIX ) : ] components = urn . split ( '/' ) if ( ( len ( components ) != 2 ) or ( components [ 0 ] != 'hunts' ) ) : raise ValueError ( 'Invalid hunt URN: %s' , urn ) return components [ ( - 1 ) ]
converts given urn string to a flow id string .