def check_list(list, ignore=0):
 if ignore:
  try:
   list[int(ignore)]
  except:
   raise ValueError('non-integer ignore index or ignore index not in list')
 list1 = list[:ignore]
 list2 = list[ignore:]
 try:
  first_none = list2.index(None)
 except:
  return tuple((list1 + list2))
 for i in range(first_none, len(list2)):
  if list2[i]:
   raise ValueError('non-None entry after None entry in list at index {0}'.format(i))
 while True:
  list2.remove(None)
  try:
   list2.index(None)
  except:
   break
 return tuple((list1 + list2))

def check_list ( list , ignore = 0 ) : if ignore : try : list [ int ( ignore ) ] except : raise ValueError ( 'non-integer ignore index or ignore index not in list' ) list1 = list [ : ignore ] list2 = list [ ignore : ] try : first_none = list2 . index ( None ) except : return tuple ( ( list1 + list2 ) ) for i in range ( first_none , len ( list2 ) ) : if list2 [ i ] : raise ValueError ( 'non-None entry after None entry in list at index {0}' . format ( i ) ) while True : list2 . remove ( None ) try : list2 . index ( None ) except : break return tuple ( ( list1 + list2 ) )
checks a list for none elements .