def attr(key, value=None):
 key = target(key)
 if (key is False):
  return False
 elif os.path.isdir(key):
  return key
 elif (value is not None):
  return write(key, value)
 else:
  return read(key)

def attr ( key , value = None ) : key = target ( key ) if ( key is False ) : return False elif os . path . isdir ( key ) : return key elif ( value is not None ) : return write ( key , value ) else : return read ( key )
access/write a sysfs attribute .