code: def extract_project_and_workspace(
      name: str, workspace: Optional[str] = None
  ):
      project_spec = re.search(PROJECT_QUALIFIED_NAME_PATTERN, name)
  
      if not project_spec:
          raise InvalidProjectName(name=name)
  
      extracted_workspace, extracted_project_name = (
          project_spec["workspace"],
          project_spec["project"],
      )
  
      if not workspace and not extracted_workspace:
          raise MissingWorkspaceName(name=name)
  
      if (
          workspace
          and extracted_workspace
          and workspace != extracted_workspace
      ):
          raise ConflictingWorkspaceName(name=name, workspace=workspace)
  
      final_workspace_name = extracted_workspace or workspace
  
      return final_workspace_name, extracted_project_name
  
file_path: neptune-client/src/neptune/management/internal/utils.py
imports: import re
  from enum import Enum
  from typing import Optional
  from neptune.common.patterns import PROJECT_QUALIFIED_NAME_PATTERN
  from neptune.management.exceptions import ConflictingWorkspaceName, InvalidProjectName, MissingWorkspaceName
label_desc: Use image node_id 1 for calling a global function with example usage: extract_project_and_workspace(name, workspace) and returns: final_workspace_name,  extracted_project_name