def validate_attributes(config):
 if (CONF_ATTRS not in config):
  config[CONF_ATTRS] = {}
 elif (not isinstance(config[CONF_ATTRS], dict)):
  _LOGGER.warning('Universal Media Player (%s) specified attributes not dict in config. They will be ignored.', config[CONF_NAME])
  config[CONF_ATTRS] = {}
 for (key, val) in config[CONF_ATTRS].items():
  attr = val.split('|', 1)
  if (len(attr) == 1):
   attr.append(None)
  config[CONF_ATTRS][key] = attr

def validate_attributes ( config ) : if ( CONF_ATTRS not in config ) : config [ CONF_ATTRS ] = { } elif ( not isinstance ( config [ CONF_ATTRS ] , dict ) ) : _LOGGER . warning ( 'Universal Media Player (%s) specified attributes not dict in config. They will be ignored.' , config [ CONF_NAME ] ) config [ CONF_ATTRS ] = { } for ( key , val ) in config [ CONF_ATTRS ] . items ( ) : attr = val . split ( '|' , 1 ) if ( len ( attr ) == 1 ) : attr . append ( None ) config [ CONF_ATTRS ] [ key ] = attr
validate attributes .