code: def normalize_prefix(prefix: Optional[str]) -> str:
      new_prefix = ""
      if prefix is not None and prefix != "":
          banned_patterns = (
              r"^.*\/\.\.\/.*$",
              r"^\.\.\/.*",
              r".*\/\.\.$",
              r"^\.\.$",
          )
          if any(re.match(bp, prefix) for bp in banned_patterns):
              raise ValueError(
                  f"prefix must not match: {' '.join(banned_patterns)}"
              )
          new_prefix = os.path.normpath(prefix).lstrip("/")
      return new_prefix
  
file_path: determined/harness/determined/common/storage/s3.py
imports: import logging
  import os
  import re
  import tempfile
  from typing import Dict, List, Optional, Union
  import requests
  from determined import errors
  from determined.common import storage, util
label_desc: Use image node_id 1 for calling a global function with example usage: normalize_prefix(prefix) and returns: new_prefix