def TokenFromUrl(url):
 if (url.find('?') > (-1)):
  query_params = url.split('?')[1]
 else:
  query_params = url
 for pair in query_params.split('&'):
  if pair.startswith('token='):
   return pair[6:]
 return None

def TokenFromUrl ( url ) : if ( url . find ( '?' ) > ( - 1 ) ) : query_params = url . split ( '?' ) [ 1 ] else : query_params = url for pair in query_params . split ( '&' ) : if pair . startswith ( 'token=' ) : return pair [ 6 : ] return None
extracts the authsub token from the url .