code: def format_name(
      flow_name, project_name, deploy_prod, given_branch, user_name
  ):
      if not project_name:
          # an empty string is not a valid project name
          raise MetaflowException(
              "@project needs a name. " "Try @project(name='some_name')"
          )
      elif re.search(VALID_NAME_RE, project_name):
          raise MetaflowException(
              "The @project name must contain only "
              "lowercase alphanumeric characters "
              "and underscores."
          )
      elif len(project_name) > VALID_NAME_LEN:
          raise MetaflowException(
              "The @project name must be shorter than "
              "%d characters." % VALID_NAME_LEN
          )
  
      if given_branch:
          if re.search(VALID_NAME_RE, given_branch):
              raise MetaflowException(
                  "The branch name must contain only "
                  "lowercase alphanumeric characters "
                  "and underscores."
              )
          elif len(given_branch) > VALID_NAME_LEN:
              raise MetaflowException(
                  "Branch name is too long. "
                  "The maximum is %d characters." % VALID_NAME_LEN
              )
          if deploy_prod:
              branch = "prod.%s" % given_branch
          else:
              branch = "test.%s" % given_branch
      elif deploy_prod:
          branch = "prod"
      else:
          # For AWS Step Functions, we set the branch to the value of
          # environment variable `METAFLOW_OWNER`, since AWS Step Functions
          # has no notion of user name.
          branch = "user.%s" % os.environ.get(
              "METAFLOW_OWNER", user_name
          )
  
      return ".".join((project_name, branch, flow_name)), branch
  
file_path: metaflow/metaflow/plugins/project_decorator.py
imports: from metaflow.exception import MetaflowException
  from metaflow.decorators import FlowDecorator
  from metaflow import current
  from metaflow.util import get_username
  import os
  import re
label_desc: Use image node_id 1 for calling a global function with example usage: format_name(flow_name, project_name, deploy_prod, given_branch, user_name) and returns: str,  branch