code: def log_dataset(
      path, name=None, metadata={}, description="raw dataset"
  ):
      "Log dataset folder"
      # Check if wandb.init has been called in case datasets are logged manually
      if wandb.run is None:
          raise ValueError(
              "You must call wandb.init() before log_dataset()"
          )
      path = Path(path)
      if not path.is_dir():
          raise f"path must be a valid directory: {path}"
      name = ifnone(name, path.name)
      _format_metadata(metadata)
      artifact_dataset = wandb.Artifact(
          name=name,
          type="dataset",
          metadata=metadata,
          description=description,
      )
      # log everything except "models" folder
      for p in path.ls():
          if p.is_dir():
              if p.name != "models":
                  artifact_dataset.add_dir(
                      str(p.resolve()), name=p.name
                  )
          else:
              artifact_dataset.add_file(str(p.resolve()))
      wandb.run.use_artifact(artifact_dataset)
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from ..text.data import TensorText
  from ..tabular.all import TabularDataLoaders, Tabular
  from .hook import total_params
  from .tracker import SaveModelCallback
  import wandb
label_desc: Use image node_id 6 for calling a global function with example usage: log_dataset(path, name, metadata, description) without return types