# Path: pylama/check_async.py
# def check_async(
#     paths: List[str], code: str = None, options: Namespace = None, rootdir: Path = None
# ) -> List[Error]:
#     """Check given paths asynchronously."""
#     with ProcessPoolExecutor(CPU_COUNT) as pool:
#         return [
#             err
#             for res in pool.map(
#                 worker, [(path, code, options, rootdir) for path in paths]
#             )
#             for err in res
#         ]
# 
# Path: pylama/config.py
# DEFAULT_LINTERS = "pycodestyle", "pyflakes", "mccabe"
# CURDIR = Path.cwd()
# HOMECFG = Path.home() / ".pylama.ini"
# CONFIG_FILES = "pylama.ini", "setup.cfg", "tox.ini", "pytest.ini"
# STREAM = logging.StreamHandler(sys.stdout)
# DEFAULT_CONFIG_FILE = get_default_config_file(CURDIR)
# class _Default:
#     def __init__(self, value=None):
#     def __str__(self):
#     def __repr__(self):
# def split_csp_str(val: Union[Collection[str], str]) -> Set[str]:
# def prepare_sorter(val: Union[Collection[str], str]) -> Optional[Dict[str, int]]:
# def parse_linters(linters: str) -> List[str]:
# def get_default_config_file(rootdir: Path = None) -> Optional[str]:
# def setup_parser() -> ArgumentParser:
# def parse_options(  # noqa
#     args: List[str] = None, config: bool = True, rootdir: Path = CURDIR, **overrides
# ) -> Namespace:
# def process_value(actions: Dict, name: str, value: Any) -> Any:
# def get_config(ini_path: str = None, rootdir: Path = None) -> inirama.Namespace:
# def setup_logger(options: Namespace):
# def fix_pathname_sep(val: str) -> str:
# 
# Path: pylama/core.py
# def run(
#     path: str, code: str = None, rootdir: Path = CURDIR, options: Namespace = None
# ) -> List[Error]:
# 
# Path: pylama/errors.py
# class Error:
#     """Store an error's information."""
# 
#     __slots__ = "source", "col", "lnum", "etype", "message", "filename", "number"
# 
#     def __init__(
#         self,
#         source="pylama",
#         col=1,
#         lnum=1,
#         type=None,  # pylint: disable=R0913
#         text="unknown error",
#         filename="",
#         number="",
#         **_,
#     ):
#         """Init error information with default values."""
#         text = str(text).strip().replace("\n", " ")
#         if number:
#             self.number = number
#         else:
#             number = PATTERN_NUMBER.match(text)
#             self.number = number.group(1).upper() if number else ""
# 
#         self.etype = type[:1] if type else (number[0] if number else "E")
#         self.col = max(col, 1)
#         self.filename = filename
#         self.source = source
#         self.lnum = int(lnum)
#         self.message = text
# 
#     def __repr__(self):
#         return f"<Error:{self.lnum}:{self.col}: {self.number} {self.message}>"
# 
#     def format(self, pattern: str) -> str:
#         """Format the error with the given pattern."""
#         return pattern.format(
#             filename=self.filename,
#             lnum=self.lnum,
#             col=self.col,
#             message=self.message,
#             etype=self.etype,
#             source=self.source,
#             number=self.number,
#         )
# 
#     def to_dict(self) -> Dict[str, Any]:
#         """Return the error as a dict."""
#         return {
#             "source": self.source,
#             "col": self.col,
#             "lnum": self.lnum,
#             "etype": self.etype,
#             "message": self.message,
#             "filename": self.filename,
#             "number": self.number,
#         }
# 
# Path: pylama/utils.py
# def read_stdin() -> str:
#     """Get value from stdin."""
#     value = stdin.buffer.read()
#     return value.decode("utf-8")


import sys
import warnings
from json import dumps
from os import path as op
from os import walk
from pathlib import Path
from typing import List, Optional
from .check_async import check_async
from .config import CURDIR, Namespace, parse_options, setup_logger
from .core import LOGGER, run
from .errors import Error
from .utils import read_stdin
        from .hook import install_hook  # noqa
                continue

            if not op.isdir(path):
                candidates.append(op.abspath(path))

            for root, _, files in walk(path):
                candidates += [op.relpath(op.join(root, f), CURDIR) for f in files]
    else:
        candidates = [paths[0]]

    if not candidates:
        return []

    if rootdir is None:
        path = candidates[0]
        rootdir = Path(path if op.isdir(path) else op.dirname(path))

    candidates = [path for path in candidates if path.endswith(".py")]

    if options.concurrent:
        return check_async(candidates, code=code, options=options, rootdir=rootdir)

    errors = []
    for path in candidates:
        errors += run(path=path, code=code, rootdir=rootdir, options=options)

    return errors


def check_path(

# Path: pylama/check_async.py
# def check_async(
#     paths: List[str], code: str = None, options: Namespace = None, rootdir: Path = None
# ) -> List[Error]:
#     """Check given paths asynchronously."""
#     with ProcessPoolExecutor(CPU_COUNT) as pool:
#         return [
#             err
#             for res in pool.map(
#                 worker, [(path, code, options, rootdir) for path in paths]
#             )
#             for err in res
#         ]
# 
# Path: pylama/config.py
# DEFAULT_LINTERS = "pycodestyle", "pyflakes", "mccabe"
# CURDIR = Path.cwd()
# HOMECFG = Path.home() / ".pylama.ini"
# CONFIG_FILES = "pylama.ini", "setup.cfg", "tox.ini", "pytest.ini"
# STREAM = logging.StreamHandler(sys.stdout)
# DEFAULT_CONFIG_FILE = get_default_config_file(CURDIR)
# class _Default:
#     def __init__(self, value=None):
#     def __str__(self):
#     def __repr__(self):
# def split_csp_str(val: Union[Collection[str], str]) -> Set[str]:
# def prepare_sorter(val: Union[Collection[str], str]) -> Optional[Dict[str, int]]:
# def parse_linters(linters: str) -> List[str]:
# def get_default_config_file(rootdir: Path = None) -> Optional[str]:
# def setup_parser() -> ArgumentParser:
# def parse_options(  # noqa
#     args: List[str] = None, config: bool = True, rootdir: Path = CURDIR, **overrides
# ) -> Namespace:
# def process_value(actions: Dict, name: str, value: Any) -> Any:
# def get_config(ini_path: str = None, rootdir: Path = None) -> inirama.Namespace:
# def setup_logger(options: Namespace):
# def fix_pathname_sep(val: str) -> str:
# 
# Path: pylama/core.py
# def run(
#     path: str, code: str = None, rootdir: Path = CURDIR, options: Namespace = None
# ) -> List[Error]:
# 
# Path: pylama/errors.py
# class Error:
#     """Store an error's information."""
# 
#     __slots__ = "source", "col", "lnum", "etype", "message", "filename", "number"
# 
#     def __init__(
#         self,
#         source="pylama",
#         col=1,
#         lnum=1,
#         type=None,  # pylint: disable=R0913
#         text="unknown error",
#         filename="",
#         number="",
#         **_,
#     ):
#         """Init error information with default values."""
#         text = str(text).strip().replace("\n", " ")
#         if number:
#             self.number = number
#         else:
#             number = PATTERN_NUMBER.match(text)
#             self.number = number.group(1).upper() if number else ""
# 
#         self.etype = type[:1] if type else (number[0] if number else "E")
#         self.col = max(col, 1)
#         self.filename = filename
#         self.source = source
#         self.lnum = int(lnum)
#         self.message = text
# 
#     def __repr__(self):
#         return f"<Error:{self.lnum}:{self.col}: {self.number} {self.message}>"
# 
#     def format(self, pattern: str) -> str:
#         """Format the error with the given pattern."""
#         return pattern.format(
#             filename=self.filename,
#             lnum=self.lnum,
#             col=self.col,
#             message=self.message,
#             etype=self.etype,
#             source=self.source,
#             number=self.number,
#         )
# 
#     def to_dict(self) -> Dict[str, Any]:
#         """Return the error as a dict."""
#         return {
#             "source": self.source,
#             "col": self.col,
#             "lnum": self.lnum,
#             "etype": self.etype,
#             "message": self.message,
#             "filename": self.filename,
#             "number": self.number,
#         }
# 
# Path: pylama/utils.py
# def read_stdin() -> str:
#     """Get value from stdin."""
#     value = stdin.buffer.read()
#     return value.decode("utf-8")


# Path: pylama/main.py
import sys
import warnings
from json import dumps
from os import path as op
from os import walk
from pathlib import Path
from typing import List, Optional
from .check_async import check_async
from .config import CURDIR, Namespace, parse_options, setup_logger
from .core import LOGGER, run
from .errors import Error
from .utils import read_stdin
        from .hook import install_hook  # noqa

                continue

            if not op.isdir(path):
                candidates.append(op.abspath(path))

            for root, _, files in walk(path):
                candidates += [op.relpath(op.join(root, f), CURDIR) for f in files]
    else:
        candidates = [paths[0]]

    if not candidates:
        return []

    if rootdir is None:
        path = candidates[0]
        rootdir = Path(path if op.isdir(path) else op.dirname(path))

    candidates = [path for path in candidates if path.endswith(".py")]

    if options.concurrent:
        return check_async(candidates, code=code, options=options, rootdir=rootdir)

    errors = []
    for path in candidates:
        errors += run(path=path, code=code, rootdir=rootdir, options=options)

    return errors


def check_path(

    options: Namespace,