Repository: psf/black
File: src/black/__init__.py (Python)

Code before:
from multiprocessing import Manager, freeze_support
import os
from pathlib import Path
import regex as re
import signal
import sys
import tokenize
import traceback
from typing import (
    Any,
    Dict,
    Generator,
    Iterator,
    List,
    Optional,
    Pattern,
    Set,
    Sized,
    Tuple,
    Union,
)

from dataclasses import replace
import click

from black import output
from black.const import DEFAULT_LINE_LENGTH, DEFAULT_INCLUDES, DEFAULT_EXCLUDES
from black.const import STDIN_PLACEHOLDER
from black.nodes import STARS, syms, is_simple_decorator_expression
from black.lines import Line, EmptyLineTracker
from black.linegen import transform_line, LineGenerator, LN
from black.comments import normalize_fmt_off
from black.mode import Mode, TargetVersion
from black.mode import Feature, supports_feature, VERSION_TO_FEATURES
from black.cache import read_cache, write_cache, get_cache_info, filter_cached, Cache
from black.concurrency import cancel, shutdown
from black.output import dump_to_file, diff, color_diff, out, err
from black.report import Report, Changed
from black.files import find_project_root, find_pyproject_toml, parse_pyproject_toml
from black.files import gen_python_files, get_gitignore, normalize_path_maybe_ignore
from black.files import wrap_stream_for_windows
from black.parsing import InvalidInput  # noqa F401
from black.parsing import lib2to3_parse, parse_ast, stringify_ast


# lib2to3 fork
from blib2to3.pytree import Node, Leaf
from blib2to3.pgen2 import token

from _black_version import version as __version__


Review comment (suggestion):
This seems unnecessary since `diff` (and other output members like `color_diff`) are already imported below. 

Code after:
from multiprocessing import Manager, freeze_support
import os
from pathlib import Path
import regex as re
import signal
import sys
import tokenize
import traceback
from typing import (
    Any,
    Dict,
    Generator,
    Iterator,
    List,
    Optional,
    Pattern,
    Set,
    Sized,
    Tuple,
    Union,
)

from dataclasses import replace
import click

from black.const import DEFAULT_LINE_LENGTH, DEFAULT_INCLUDES, DEFAULT_EXCLUDES
from black.const import STDIN_PLACEHOLDER
from black.nodes import STARS, syms, is_simple_decorator_expression
from black.lines import Line, EmptyLineTracker
from black.linegen import transform_line, LineGenerator, LN
from black.comments import normalize_fmt_off
from black.mode import Mode, TargetVersion
from black.mode import Feature, supports_feature, VERSION_TO_FEATURES
from black.cache import read_cache, write_cache, get_cache_info, filter_cached, Cache
from black.concurrency import cancel, shutdown
from black.output import dump_to_file, diff, color_diff, out, err
from black.report import Report, Changed
from black.files import find_project_root, find_pyproject_toml, parse_pyproject_toml
from black.files import gen_python_files, get_gitignore, normalize_path_maybe_ignore
from black.files import wrap_stream_for_windows
from black.parsing import InvalidInput  # noqa F401
from black.parsing import lib2to3_parse, parse_ast, stringify_ast


# lib2to3 fork
from blib2to3.pytree import Node, Leaf
from blib2to3.pgen2 import token

from _black_version import version as __version__

# If our environment has uvloop installed lets use it