def check_named(option, opt, value):
 if isinstance(value, dict):
  return value
 values = []
 for value in check_csv(option, opt, value):
  if (value.find('=') != (-1)):
   values.append(value.split('=', 1))
  elif (value.find(':') != (-1)):
   values.append(value.split(':', 1))
 if values:
  return dict(values)
 msg = 'option %s: invalid named value %r, should be <NAME>=<VALUE> or <NAME>:<VALUE>'
 raise OptionValueError((msg % (opt, value)))

def check_named ( option , opt , value ) : if isinstance ( value , dict ) : return value values = [ ] for value in check_csv ( option , opt , value ) : if ( value . find ( '=' ) != ( - 1 ) ) : values . append ( value . split ( '=' , 1 ) ) elif ( value . find ( ':' ) != ( - 1 ) ) : values . append ( value . split ( ':' , 1 ) ) if values : return dict ( values ) msg = 'option %s: invalid named value %r, should be <NAME>=<VALUE> or <NAME>:<VALUE>' raise OptionValueError ( ( msg % ( opt , value ) ) )
check a named value return a dictionary containing associations .