"""
This type stub file was generated by pyright.
"""

""" Utility functions. """

def listify(obj):  # -> list[Unknown] | tuple[Unknown] | None:
    """Wraps all non-list or tuple objects in a list; provides a simple way
    to accept flexible arguments."""
    ...

def matches_entities(obj, entities, strict=...):  # -> bool:
    """Checks whether an object's entities match the input."""
    ...

def natural_sort(l, field=...):  # -> list[Unknown]:
    """
    based on snippet found at http://stackoverflow.com/a/4836734/2445984
    """
    ...

def convert_JSON(j):  # -> dict[Unknown, Unknown]:
    """Recursively convert CamelCase keys to snake_case.
    From: https://stackoverflow.com/questions/17156078/
    converting-identifier-naming-between-camelcase-and-
    underscores-during-json-seria
    """
    ...

def splitext(path):  # -> list[Unknown]:
    """splitext for paths with directories that may contain dots.
    From https://stackoverflow.com/questions/5930036/separating-file-extensions-using-python-os-path-module
    """
    ...

def make_bidsfile(filename):  # -> Any:
    """Create a BIDSFile instance of the appropriate class."""
    ...

def collect_associated_files(layout, files, extra_entities=...):  # -> list[Unknown]:
    """Collect and group BIDSFiles with multiple files per acquisition.

    Parameters
    ----------
    layout
    files : list of BIDSFile
    extra_entities

    Returns
    -------
    collected_files : list of list of BIDSFile
    """
    ...

def validate_multiple(val, retval=...):  # -> tuple[Unknown] | None:
    """Any click.Option with the multiple flag will return an empty tuple if not set.

    This helper method converts empty tuples to a desired return value (default: None).
    This helper method selects the first item in single-item tuples.
    """
    ...
