def load(f, _dict=dict):
if isinstance(f, basestring):<EOL><INDENT>with io.open(f, encoding='<STR_LIT:utf-8>') as ffile:<EOL><INDENT>return loads(ffile.read(), _dict)<EOL><DEDENT><DEDENT>elif isinstance(f, list):<EOL><INDENT>from os import path as op<EOL>from warnings import warn<EOL>if not [path for path in f if op.exists(path)]:<EOL><INDENT>error_msg = "<STR_LIT>"<EOL>error_msg += linesep<EOL>error_msg += ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>raise FNFError(error_msg)<EOL><DEDENT>d = _dict()<EOL>for l in f:<EOL><INDENT>if op.exists(l):<EOL><INDENT>d.update(load(l))<EOL><DEDENT>else:<EOL><INDENT>warn("<STR_LIT>"<EOL>"<STR_LIT:filename>")<EOL><DEDENT><DEDENT>return d<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>return loads(f.read(), _dict)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT:list>")<EOL><DEDENT><DEDENT>
Parses named file or files as toml and returns a dictionary

    Args:
        f: Path to the file to open, array of files to read into single dict
           or a file descriptor
        _dict: (optional) Specifies the class of the returned toml dictionary

    Returns:
        Parsed toml file represented as a dictionary

    Raises:
        TypeError -- When f is invalid type
        TomlDecodeError: Error while decoding toml
        IOError / FileNotFoundError -- When an array with no valid (existing)
        (Python 2 / Python 3)          file paths is passed