parameters: (key_or_string)
docstring: Convert the given (Test or TestMetadata) key or test_path string to a
       TestMetadata key.
  
    We are in the process of converting from Test entities to TestMetadata.
    Unfortunately, we haver trillions of Row entities which have a parent_test
    property set to a Test, and it's not possible to migrate them all. So we
    use the Test key in Row queries, and convert between the old and new format.
  
    Note that the Test entities which the keys refer to may be deleted; the
    queries over keys still work.
docstring_summary: Convert the given (Test or TestMetadata) key or test_path string to a
       TestMetadata key.
docstring_tokens: Convert the given ( Test or TestMetadata ) key or test_path string to a TestMetadata key .
function: def TestMetadataKey(key_or_string):
    """Convert the given (Test or TestMetadata) key or test_path string to a
       TestMetadata key.
  
    We are in the process of converting from Test entities to TestMetadata.
    Unfortunately, we haver trillions of Row entities which have a parent_test
    property set to a Test, and it's not possible to migrate them all. So we
    use the Test key in Row queries, and convert between the old and new format.
  
    Note that the Test entities which the keys refer to may be deleted; the
    queries over keys still work.
    """
    if key_or_string is None:
      return None
    if isinstance(key_or_string, basestring):
      return ndb.Key('TestMetadata', key_or_string)
    if key_or_string.kind() == 'TestMetadata':
      return key_or_string
    if key_or_string.kind() == 'Test':
      return ndb.Key('TestMetadata', TestPath(key_or_string))
function_tokens: def TestMetadataKey ( key_or_string ) : if key_or_string is None : return None if isinstance ( key_or_string , basestring ) : return ndb . Key ( 'TestMetadata' , key_or_string ) if key_or_string . kind ( ) == 'TestMetadata' : return key_or_string if key_or_string . kind ( ) == 'Test' : return ndb . Key ( 'TestMetadata' , TestPath ( key_or_string ) )