# Path: pytest_bdd/parsers.py
# def get_parser(step_name: Any) -> StepParser:
#     """Get parser by given name."""
# 
#     if isinstance(step_name, StepParser):
#         return step_name
# 
#     return string(step_name)
# 
# Path: pytest_bdd/types.py
# GIVEN = "given"
# 
# THEN = "then"
# 
# WHEN = "when"
# 
# Path: pytest_bdd/utils.py
# def get_caller_module_locals(depth: int = 2) -> dict[str, Any]:
#     """Get the caller module locals dictionary.
# 
#     We use sys._getframe instead of inspect.stack(0) because the latter is way slower, since it iterates over
#     all the frames in the stack.
#     """
#     return _getframe(depth).f_locals


import typing
import pytest
from _pytest.fixtures import FixtureDef, FixtureRequest
from .parsers import get_parser
from .types import GIVEN, THEN, WHEN
from .utils import get_caller_module_locals
    from typing import Any, Callable
    return f"pytestbdd_{type_}_{name}"


def given(
    name: Any,
    converters: dict[str, Callable] | None = None,
    target_fixture: str | None = None,
) -> Callable:
    """Given step decorator.

    :param name: Step name or a parser object.
    :param converters: Optional `dict` of the argument or parameter converters in form
                       {<param_name>: <converter function>}.
    :param target_fixture: Target fixture name to replace by steps definition function.

    :return: Decorator function for the step.
    """
    return _step_decorator(GIVEN, name, converters=converters, target_fixture=target_fixture)


def when(name: Any, converters: dict[str, Callable] | None = None, target_fixture: str | None = None) -> Callable:
    """When step decorator.

    :param name: Step name or a parser object.
    :param converters: Optional `dict` of the argument or parameter converters in form
                       {<param_name>: <converter function>}.
    :param target_fixture: Target fixture name to replace by steps definition function.

    :return: Decorator function for the step.
    """

# Path: pytest_bdd/parsers.py
# def get_parser(step_name: Any) -> StepParser:
#     """Get parser by given name."""
# 
#     if isinstance(step_name, StepParser):
#         return step_name
# 
#     return string(step_name)
# 
# Path: pytest_bdd/types.py
# GIVEN = "given"
# 
# THEN = "then"
# 
# WHEN = "when"
# 
# Path: pytest_bdd/utils.py
# def get_caller_module_locals(depth: int = 2) -> dict[str, Any]:
#     """Get the caller module locals dictionary.
# 
#     We use sys._getframe instead of inspect.stack(0) because the latter is way slower, since it iterates over
#     all the frames in the stack.
#     """
#     return _getframe(depth).f_locals


# Path: pytest_bdd/steps.py
import typing
import pytest
from _pytest.fixtures import FixtureDef, FixtureRequest
from .parsers import get_parser
from .types import GIVEN, THEN, WHEN
from .utils import get_caller_module_locals
    from typing import Any, Callable

    return f"pytestbdd_{type_}_{name}"


def given(
    name: Any,
    converters: dict[str, Callable] | None = None,
    target_fixture: str | None = None,
) -> Callable:
    """Given step decorator.

    :param name: Step name or a parser object.
    :param converters: Optional `dict` of the argument or parameter converters in form
                       {<param_name>: <converter function>}.
    :param target_fixture: Target fixture name to replace by steps definition function.

    :return: Decorator function for the step.
    """
    return _step_decorator(GIVEN, name, converters=converters, target_fixture=target_fixture)


def when(name: Any, converters: dict[str, Callable] | None = None, target_fixture: str | None = None) -> Callable:
    """When step decorator.

    :param name: Step name or a parser object.
    :param converters: Optional `dict` of the argument or parameter converters in form
                       {<param_name>: <converter function>}.
    :param target_fixture: Target fixture name to replace by steps definition function.

    :return: Decorator function for the step.
    """

    return _step_decorator(WHEN, name, converters=converters, target_fixture=target_fixture)