def get_cursor(source, spelling):
 root_cursor = (source if isinstance(source, Cursor) else source.cursor)
 for cursor in root_cursor.walk_preorder():
  if (cursor.spelling == spelling):
   return cursor
 return None

def get_cursor ( source , spelling ) : root_cursor = ( source if isinstance ( source , Cursor ) else source . cursor ) for cursor in root_cursor . walk_preorder ( ) : if ( cursor . spelling == spelling ) : return cursor return None
obtain a cursor from a source object .