def setup(self, **kwargs) -> "Self":
        """Setup variables to pass to UDF functions.

        Use before running map/gen/agg/batch_map to save an object and pass it as an
        argument to the UDF.

        The value must be a callable (a `lambda: <value>` syntax can be used to quickly
        create one) that returns the object to be passed to the UDF. It is evaluated
        lazily when UDF is running, in case of multiple machines the callable is run on
        a worker machine.

        Example:
            ```py
            import anthropic
            from anthropic.types import Message
            import datachain as dc

            (
                dc.read_storage(DATA, type="text")
                .settings(parallel=4, cache=True)

                # Setup Anthropic client and pass it to the UDF below automatically
                # The value is callable (see the note above)
                .setup(client=lambda: anthropic.Anthropic(api_key=API_KEY))

                .map(
                    claude=lambda client, file: client.messages.create(
                        model=MODEL,
                        system=PROMPT,
                        messages=[{"role": "user", "content": file.get_value()}],
                    ),
                    output=Message,
                )
            )
            ```
        """
        intersection = set(self._setup.keys()) & set(kwargs.keys())
        if intersection:
            keys = ", ".join(intersection)
            raise DatasetPrepareError(self.name, f"this value(s) already setup: {keys}")

        self._setup = self._setup | kwargs
        return self
Setup variables to pass to UDF functions.

        Use before running map/gen/agg/batch_map to save an object and pass it as an
        argument to the UDF.

        The value must be a callable (a `lambda: <value>` syntax can be used to quickly
        create one) that returns the object to be passed to the UDF. It is evaluated
        lazily when UDF is running, in case of multiple machines the callable is run on
        a worker machine.

        Example:
            ```py
            import anthropic
            from anthropic.types import Message
            import datachain as dc

            (
                dc.read_storage(DATA, type="text")
                .settings(parallel=4, cache=True)

                # Setup Anthropic client and pass it to the UDF below automatically
                # The value is callable (see the note above)
                .setup(client=lambda: anthropic.Anthropic(api_key=API_KEY))

                .map(
                    claude=lambda client, file: client.messages.create(
                        model=MODEL,
                        system=PROMPT,
                        messages=[{"role": "user", "content": file.get_value()}],
                    ),
                    output=Message,
                )
            )
            ```
        
src/datachain/lib/dc/datachain.py