from typing import Any


def create_mapping(key: str, value: Any):
    """
    Creates a mapping of a given key and value.

    Parameters
    ----------
    key : str
        The key for the mapping.
    value : Any
        The value for the mapping.

    Returns
    -------
    dict
        A dictionary containing the mapping created.

    Examples
    --------

    >>> import asyncio
    >>> from dffml import *
    >>>
    >>> dataflow = DataFlow.auto(create_mapping, GetSingle)
    >>> dataflow.seed.append(
    ...     Input(
    ...         value=[create_mapping.op.outputs["mapping"].name],
    ...         definition=GetSingle.op.inputs["spec"],
    ...     )
    ... )
    >>> inputs = [
    ...     Input(
    ...         value="key1", definition=create_mapping.op.inputs["key"],
    ...     ),
    ...     Input(
    ...         value=42, definition=create_mapping.op.inputs["value"],
    ...     ),
    ... ]
    >>>
    >>> async def main():
    ...     async for ctx, result in MemoryOrchestrator.run(dataflow, inputs):
    ...         print(result)
    >>>
    >>> asyncio.run(main())
    {'mapping': {'key1': 42}}
    """
    return {"mapping": {key: value}}