code: def callback(
      ctx: typer.Context,
      name: Optional[str] = typer.Option(
          None, help="Name of the workspace to which apply the command."
      ),
  ) -> None:
      init_callback()
  
      if ctx.invoked_subcommand not in _COMMANDS_REQUIRING_WORKSPACE:
          return
  
      if name is None:
          raise typer.BadParameter(
              "The command requires a workspace name provided using '--name' option"
          )
  
      from argilla.cli.rich import echo_in_panel
      from argilla.client.workspaces import Workspace
  
      try:
          workspace = Workspace.from_name(name)
      except ValueError as e:
          echo_in_panel(
              f"Workspace with name={name} does not exist.",
              title="Workspace not found",
              title_align="left",
              success=False,
          )
          raise typer.Exit(code=1) from e
      except RuntimeError as e:
          echo_in_panel(
              "An unexpected error occurred when trying to get the workspace from the Argilla server",
              title="Unexpected error",
              title_align="left",
              success=False,
          )
          raise typer.Exit(code=1) from e
  
      ctx.obj = workspace
  
file_path: argilla/src/argilla/cli/workspaces/__main__.py
imports: from typing import Optional
  import typer
  from argilla.cli.callback import init_callback
  from .add_user import add_user
  from .create import create_workspace
  from .delete_user import delete_user
  from .list import list_workspaces
label_desc: Use image node_id 1 for calling a global function with example usage: callback(ctx, name) without return types