def as_dict(config):
 if isinstance(config, text_or_bytes):
  config = Parser().dict_from_file(config)
 elif hasattr(config, 'read'):
  config = Parser().dict_from_file(config)
 return config

def as_dict ( config ) : if isinstance ( config , text_or_bytes ) : config = Parser ( ) . dict_from_file ( config ) elif hasattr ( config , 'read' ) : config = Parser ( ) . dict_from_file ( config ) return config
return a dict from config whether it is a dict .