def _do_parse(inp, fmt, encoding, force_types):
res = {}<EOL>_check_lib_installed(fmt, '<STR_LIT>')<EOL>if fmt == '<STR_LIT>':<EOL><INDENT>cfg = configobj.ConfigObj(inp, encoding=encoding)<EOL>res = cfg.dict()<EOL><DEDENT>elif fmt == '<STR_LIT>':<EOL><INDENT>if six.PY3:<EOL><INDENT>inp = io.TextIOWrapper(inp, encoding=encoding)<EOL><DEDENT>res = json.load(inp, encoding=encoding)<EOL><DEDENT>elif fmt == '<STR_LIT>':<EOL><INDENT>if six.PY3:<EOL><INDENT>inp = io.TextIOWrapper(inp, encoding=encoding)<EOL><DEDENT>res = json5.load(inp, encoding=encoding)<EOL><DEDENT>elif fmt == '<STR_LIT>':<EOL><INDENT>if not _is_utf8(encoding):<EOL><INDENT>raise AnyMarkupError('<STR_LIT>')<EOL><DEDENT>if six.PY3:<EOL><INDENT>inp = io.TextIOWrapper(inp, encoding=encoding)<EOL><DEDENT>res = toml.load(inp)<EOL><DEDENT>elif fmt == '<STR_LIT>':<EOL><INDENT>res = xmltodict.parse(inp, encoding=encoding)<EOL><DEDENT>elif fmt == '<STR_LIT>':<EOL><INDENT>res = yaml.safe_load(inp)<EOL><DEDENT>else:<EOL><INDENT>raise  <EOL><DEDENT>return _ensure_proper_types(res, encoding, force_types)<EOL>
Actually parse input.

    Args:
        inp: bytes yielding file-like object
        fmt: format to use for parsing
        encoding: encoding of `inp`
        force_types:
            if `True`, integers, floats, booleans and none/null
                are recognized and returned as proper types instead of strings;
            if `False`, everything is converted to strings
            if `None`, backend return value is used
    Returns:
        parsed `inp` (dict or list) containing unicode values
    Raises:
        various sorts of errors raised by used libraries while parsing