def METHOD_NAME(  # pylint: disable=too-many-arguments
    content: TextDocument,
    src: Path,
    exclude: Collection[str],
    edited_linenums_differ: EditedLinenumsDiffer,
    config: Optional[str] = None,
    line_length: Optional[int] = None,
) -> TextDocument:
    """Run isort on the given Python source file content
    :param content: The contents of the Python source code file to sort imports in
    :param src: The relative path to the file. This must be the actual path in the
                repository, which may differ from the path given on the command line in
                case of VSCode temporary files.
    :param exclude: The file path patterns to exclude from import sorting
    :param edited_linenums_differ: Helper for finding out which lines were edited
    :param config: Path to configuration file
    :param line_length: Maximum line length to use
    :return: Original Python source file contents with imports sorted
    """
    if glob_any(src, exclude):
        return content
    edited_linenums = edited_linenums_differ.revision_vs_lines(
        src,
        content,
        context_lines=0,
    )  # pylint: disable=duplicate-code
    if not edited_linenums:
        return content
    isort_args = _build_isort_args(src, config, line_length)
    rev2_isorted = _call_isort_code(content, isort_args)
    # Get the chunks in the diff between the edited and import-sorted file
    isort_chunks = diff_chunks(content, rev2_isorted)
    if not isort_chunks:
        # No imports were sorted. Return original content.
        return content
    if not _diff_overlaps_with_edits(edited_linenums, isort_chunks):
        # No lines had been modified in the range of modified import lines. Return
        # original content.
        return content
    # The range lines modified by sorted imports overlaps with user modifications in the
    # code. Return the import-sorted file.
    return rev2_isorted