code: def setup_workspace(
      workspace_name,
      subscription_id,
      resource_group,
      cli_auth,
      location,
  ):
      """
      This sets up an Azure Workspace.
      An existing Azure Workspace is used or a new one is created if needed for
      the pytest run.
  
      Args:
          workspace_name  (str): Centralized location on Azure to work
                                 with all the artifacts used by AzureML
                                 service
          subscription_id (str): the Azure subscription id
          resource_group  (str): Azure Resource Groups are logical collections of
                           assets associated with a project. Resource groups
                           make it easy to track or delete all resources
                           associated with a project by tracking or deleting
                           the Resource group.
          cli_auth         Azure authentication
          location        (str): workspace reference
  
      Returns:
          ws: workspace reference
      """
      logger.debug("setup: workspace_name is {}".format(workspace_name))
      logger.debug("setup: resource_group is {}".format(resource_group))
      logger.debug("setup: subid is {}".format(subscription_id))
      logger.debug("setup: location is {}".format(location))
  
      try:
          # use existing workspace if there is one
          ws = Workspace.get(
              name=workspace_name,
              subscription_id=subscription_id,
              resource_group=resource_group,
              auth=cli_auth,
          )
      except WorkspaceException:
          # this call might take a minute or two.
          logger.debug("Creating new workspace")
          ws = Workspace.create(
              name=workspace_name,
              subscription_id=subscription_id,
              resource_group=resource_group,
              # create_resource_group=True,
              location=location,
              auth=cli_auth,
              show_output=False,
          )
      return ws
  
file_path: recommenders/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py
imports: import argparse
  import logging
  import glob
  from azureml.core.authentication import AzureCliAuthentication
  from azureml.core import Workspace
  from azureml.core import Experiment
  from azureml.core.runconfig import RunConfiguration
  from azureml.core.conda_dependencies import CondaDependencies
  from azureml.core.script_run_config import ScriptRunConfig
  from azureml.core.compute import ComputeTarget, AmlCompute
  from azureml.core.compute_target import ComputeTargetException
  from azureml.core.workspace import WorkspaceException
label_desc: Use image node_id 1 for calling a global function with example usage: setup_workspace(workspace_name, subscription_id, resource_group, cli_auth, location) and returns: ws