def parse_keywords(strings=[]):
 keywords = {}
 for string in strings:
  if (':' in string):
   (funcname, indices) = string.split(':')
  else:
   (funcname, indices) = (string, None)
  if (funcname not in keywords):
   if indices:
    indices = tuple([int(x) for x in indices.split(',')])
   keywords[funcname] = indices
 return keywords

def parse_keywords ( strings = [ ] ) : keywords = { } for string in strings : if ( ':' in string ) : ( funcname , indices ) = string . split ( ':' ) else : ( funcname , indices ) = ( string , None ) if ( funcname not in keywords ) : if indices : indices = tuple ( [ int ( x ) for x in indices . split ( ',' ) ] ) keywords [ funcname ] = indices return keywords
parse keywords specifications from the given list of strings .