class_docstr: Environment configuration for teams and clusters.
  
  AudioCraftEnvironment picks compute cluster settings (slurm, dora) from the current running environment
  or declared variable and the loaded team configuration. Additionally, the AudioCraftEnvironment
  provides pointers to a reference folder resolved automatically across clusters that is shared across team members,
  allowing to share sigs or other files to run jobs. Finally, it provides dataset mappers to automatically
  map dataset file paths to new locations across clusters, allowing to use the same manifest of files across cluters.
  
  The cluster type is identified automatically and base configuration file is read from config/teams.yaml.
  Use the following environment variables to specify the cluster, team or configuration:
  
      AUDIOCRAFT_CLUSTER (optional): Cluster type to enforce. Useful if the cluster type
          cannot be inferred automatically.
      AUDIOCRAFT_CONFIG (optional): Path to yaml config holding the teams configuration.
          If not set, configuration is read from config/teams.yaml.
      AUDIOCRAFT_TEAM (optional): Name of the team. Recommended to set to your own team.
          Cluster configuration are shared across teams to match compute allocation,
          specify your cluster configuration in the configuration file under a key mapping
          your team name.
class_docstr_tok: ["Environment","configuration","for","teams","and","clusters",".","AudioCraftEnvironment","picks","compute","cluster","settings","(","slurm",",","dora",")","from","the","current","running","environment","or","declared","variable","and","the","loaded","team","configuration",".","Additionally",",","the","AudioCraftEnvironment","provides","pointers","to","a","reference","folder","resolved","automatically","across","clusters","that","is","shared","across","team","members",",","allowing","to","share","sigs","or","other","files","to","run","jobs",".","Finally",",","it","provides","dataset","mappers","to","automatically","map","dataset","file","paths","to","new","locations","across","clusters",",","allowing","to","use","the","same","manifest","of","files","across","cluters",".","The","cluster","type","is","identified","automatically","and","base","configuration","file","is","read","from","config\/teams.yaml",".","Use","the","following","environment","variables","to","specify","the","cluster",",","team","or","configuration",":","AUDIOCRAFT_CLUSTER","(","optional",")",":","Cluster","type","to","enforce",".","Useful","if","the","cluster","type","can","not","be","inferred","automatically",".","AUDIOCRAFT_CONFIG","(","optional",")",":","Path","to","yaml","config","holding","the","teams","configuration",".","If","not","set",",","configuration","is","read","from","config\/teams.yaml",".","AUDIOCRAFT_TEAM","(","optional",")",":","Name","of","the","team",".","Recommended","to","set","to","your","own","team",".","Cluster","configuration","are","shared","across","teams","to","match","compute","allocation",",","specify","your","cluster","configuration","in","the","configuration","file","under","a","key","mapping","your","team","name","."]
docstr: Converts reference placeholder in path with configured reference dir to resolve paths.
  
  Args:
      path (str or Path): Path to resolve.
  Returns:
      Path: Resolved path.
docstr_tok: ["Converts","reference","placeholder","in","path","with","configured","reference","dir","to","resolve","paths",".","Args",":","path","(","str","or","Path",")",":","Path","to","resolve",".","Returns",":","Path",":","Resolved","path","."]
code: def resolve_reference_path(cls, path: tp.Union[str, Path]) -> Path:
      """Converts reference placeholder in path with configured reference dir to resolve paths.
  
      Args:
          path (str or Path): Path to resolve.
      Returns:
          Path: Resolved path.
      """
      path = str(path)
  
      if path.startswith("//reference"):
          reference_dir = cls.get_reference_dir()
          logger.warn(f"Reference directory: {reference_dir}")
          assert (
              reference_dir.exists() and reference_dir.is_dir()
          ), f"Reference directory does not exist: {reference_dir}."
          path = re.sub("^//reference", str(reference_dir), path)
  
      return Path(path)
  
file_path: audiocraft/audiocraft/environment.py
imports: import logging
  import os
  from pathlib import Path
  import re
  import typing
  import omegaconf
  from .utils.cluster import _guess_cluster_type
label_desc: Use image node_id 11 for calling the AudioCraftEnvironment obj's underlying member method code with example usage: obj.resolve_reference_path(cls, path) and returns: Path