def METHOD_NAME(file, file_extension=None):
    """Read files into objects."""
    if not file_extension:
        file_extension = file.split('.')[-1]
    if not os.path.exists(file):
        raise FileNotFoundError(f"Can't find the file {file}.")
    logger.debug(
        'Using \"{}\" as input file and \"{}\" as file extension'.format(
            file, file_extension
        )
    )
    try:
        if file_extension == 'json':
            with open(file) as f:
                config = json.load(f)
            return config
        elif file_extension in ('yaml', 'yml'):
            # Try normal and then for documents that will output as list
            yaml = YAML()
            try:
                with open(file, encoding='utf-8') as f:
                    config = yaml.load(f)
                return config
            except ComposerError:
                output = []
                with open(file, encoding='utf-8') as f:
                    for doc in yaml.load_all(f.read()):
                        output.append(doc)
                return output
        elif file_extension == 'toml':
            try:
                import toml
            except ImportError:
                raise TackleImportError(
                    f"Error parsing {file} No toml package installed. Install it with "
                    "`pip install toml` and try again."
                ) from None
            with open(file) as f:
                data = toml.load(f)
            return data
        else:
            raise UnsupportedBaseFileTypeException(
                'Unable to parse file {}. Error: Unsupported extension (json/yaml only)'
                ''.format(file)
            )  # noqa
    except ValueError as e:
        # JSON decoding error.  Let's throw a new exception that is more
        # friendly for the developer or user.
        message = (
            f'JSON decoding error while loading "{file}".  Decoding'
            f' error details: "{str(e)}"'
        )
        raise ContextDecodingException(message) from None