def title_to_ids(title):
 all_info = title.split(' ')
 id_info = all_info[0]
 rest = all_info[1:]
 descr = ' '.join(rest)
 id_info_items = id_info.split('|')
 if (len(id_info_items) >= 4):
  assert (id_info_items[2] in ['gb', 'emb', 'dbj', 'pdb']), title
  id = id_info_items[3]
  name = id_info_items[4]
 else:
  id = id_info_items[0]
  name = id_info_items[0]
 return (id, name, descr)

def title_to_ids ( title ) : all_info = title . split ( ' ' ) id_info = all_info [ 0 ] rest = all_info [ 1 : ] descr = ' ' . join ( rest ) id_info_items = id_info . split ( '|' ) if ( len ( id_info_items ) >= 4 ) : assert ( id_info_items [ 2 ] in [ 'gb' , 'emb' , 'dbj' , 'pdb' ] ) , title id = id_info_items [ 3 ] name = id_info_items [ 4 ] else : id = id_info_items [ 0 ] name = id_info_items [ 0 ] return ( id , name , descr )
function to convert a title into the id .