code: def init_bundle(
      bundle_dir: PathLike,
      ckpt_file: PathLike | None = None,
      network: torch.nn.Module | None = None,
      dataset_license: bool = False,
      metadata_str: dict | str | None = None,
      inference_str: dict | str | None = None,
  ) -> None:
      """
      Initialise a new bundle directory with some default configuration files and optionally network weights.
  
      Typical usage example:
  
      .. code-block:: bash
  
          python -m monai.bundle init_bundle /path/to/bundle_dir network_ckpt.pt
  
      Args:
          bundle_dir: directory name to create, must not exist but parent direct must exist
          ckpt_file: optional checkpoint file to copy into bundle
          network: if given instead of ckpt_file this network's weights will be stored in bundle
          dataset_license: if `True`, a default license file called "data_license.txt" will be produced. This
              file is required if there are any license conditions stated for data your bundle uses.
          metadata_str: optional metadata string to write to bundle, if not given a default will be used.
          inference_str: optional inference string to write to bundle, if not given a default will be used.
      """
      if metadata_str is None:
          metadata_str = DEFAULT_METADATA
      if inference_str is None:
          inference_str = DEFAULT_INFERENCE
  
      bundle_dir = Path(bundle_dir).absolute()
  
      if bundle_dir.exists():
          raise ValueError(
              f"Specified bundle directory '{str(bundle_dir)}' already exists"
          )
  
      if not bundle_dir.parent.is_dir():
          raise ValueError(
              f"Parent directory of specified bundle directory '{str(bundle_dir)}' does not exist"
          )
  
      configs_dir = bundle_dir / "configs"
      models_dir = bundle_dir / "models"
      docs_dir = bundle_dir / "docs"
  
      bundle_dir.mkdir()
      configs_dir.mkdir()
      models_dir.mkdir()
      docs_dir.mkdir()
  
      if isinstance(metadata_str, dict):
          metadata_str = json.dumps(metadata_str, indent=4)
  
      if isinstance(inference_str, dict):
          inference_str = json.dumps(inference_str, indent=4)
  
      with open(str(configs_dir / "metadata.json"), "w") as o:
          o.write(metadata_str)
  
      with open(str(configs_dir / "inference.json"), "w") as o:
          o.write(inference_str)
  
      with open(str(docs_dir / "README.md"), "w") as o:
          readme = """
          # Your Model Name
  
          Describe your model here and how to run it, for example using `inference.json`:
  
          ```
          python -m monai.bundle run \
              --meta_file /path/to/bundle/configs/metadata.json \
              --config_file /path/to/bundle/configs/inference.json \
              --dataset_dir ./input \
              --bundle_root /path/to/bundle
          ```
          """
  
          o.write(dedent(readme))
  
      with open(str(bundle_dir / "LICENSE"), "w") as o:
          o.write("Select a license and place its terms here\n")
  
      if dataset_license is True:
          with open(str(docs_dir / "data_license.txt"), "w") as o:
              o.write(
                  "Select a license for dataset and place its terms here\n"
              )
  
      if ckpt_file is not None:
          copyfile(str(ckpt_file), str(models_dir / "model.pt"))
      elif network is not None:
          save_state(network, str(models_dir / "model.pt"))
  
imports: from __future__ import annotations
  import ast
  import json
  import os
  import re
  import warnings
  from collections.abc import Mapping, Sequence
  from pathlib import Path
  from pydoc import locate
  from shutil import copyfile
  from textwrap import dedent
  from typing import Any, Callable
  import torch
  from torch.cuda import is_available
  from monai.apps.mmars.mmars import _get_all_ngc_models
  from monai.apps.utils import _basename, download_url, extractall, get_logger
  from monai.bundle.config_item import ConfigComponent
  from monai.bundle.config_parser import ConfigParser
  from monai.bundle.utils import DEFAULT_INFERENCE, DEFAULT_METADATA
  from monai.bundle.workflows import BundleWorkflow, ConfigWorkflow
  from monai.config import IgniteInfo, PathLike
  from monai.data import load_net_with_metadata, save_net_with_metadata
  from monai.networks import convert_to_onnx, convert_to_torchscript, convert_to_trt, copy_model_state, get_state_dict, save_state
  from monai.utils import check_parent_dir, deprecated_arg, ensure_tuple, get_equivalent_dtype, min_version, optional_import, pprint_edges
label_desc: Use image node_id 33 for calling a global function with example usage: init_bundle(bundle_dir, ckpt_file, network, dataset_license, metadata_str, inference_str) without return types