{
  "$schema": "https://ambiqai.github.io/helia-ui/schema/reference-model-1.json",
  "generatedFrom": {
    "sourceCommit": "f341fb11f7f5d77a4974ba8273c4cd55d67c21f0",
    "tool": "pyref",
    "version": "1.7.3"
  },
  "language": "python",
  "modules": [
    {
      "description": "# Environment Utility API\n\nThis module provides utility functions to interact with the environment.\n\n**Functions**\n\n| Name | Description |\n| --- | --- |\n| `setup_logger` | Setup logger with Rich |\n| `env_flag` | Return the specified environment variable coerced to a bool |\n| `silence_tensorflow` | Silence every unnecessary warning from tensorflow |\n| `disable_tensorflow_gpu` | Disable TensorFlow GPU |",
      "name": "env",
      "path": "helia_edge.utils.env",
      "submodules": [],
      "summary": "Environment Utility API",
      "symbols": [
        {
          "description": "Setup logger with Rich",
          "examples": [],
          "id": "helia_edge.utils.env.setup_logger",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "setup_logger",
          "params": [
            {
              "description": "Logger name",
              "name": "log_name",
              "type": "str"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "logging.Logger: Logger",
              "type": "logging.Logger"
            }
          ],
          "signature": "setup_logger(\n    log_name: str,\n    level: int | None = None,\n    recursive: bool = True,\n    file_path: os.PathLike | None = None,\n) -> logging.Logger",
          "source": {
            "line": 21,
            "path": "helia_edge/utils/env.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/utils/env.py#L21"
          },
          "summary": "Setup logger with Rich"
        },
        {
          "description": "Return the specified environment variable coerced to a bool, as follows:\n- When the variable is unset, or set to the empty string, return `default`.\n- When the variable is set to a truthy value, returns `True`.\n  These are the truthy values:\n      - 1\n      - true, yes, on\n- When the variable is set to the anything else, returns False.\n   Example falsy values:\n      - 0\n      - no\n- Ignore case and leading/trailing whitespace.",
          "examples": [],
          "id": "helia_edge.utils.env.env_flag",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "env_flag",
          "params": [
            {
              "description": "Environment variable name",
              "name": "env_var",
              "type": "str"
            },
            {
              "default": "False",
              "description": "Default value. Defaults to False.",
              "name": "default",
              "type": "bool"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "Value of environment variable",
              "name": "bool",
              "type": "bool"
            }
          ],
          "signature": "env_flag(env_var: str, default: bool = False) -> bool",
          "source": {
            "line": 68,
            "path": "helia_edge/utils/env.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/utils/env.py#L68"
          },
          "summary": "Return the specified environment variable coerced to a bool, as follows: - When the variable is unset, or set to the empty string, return default."
        },
        {
          "description": "Silence every unnecessary warning from tensorflow.",
          "examples": [],
          "id": "helia_edge.utils.env.silence_tensorflow",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "silence_tensorflow",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "silence_tensorflow()",
          "source": {
            "line": 94,
            "path": "helia_edge/utils/env.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/utils/env.py#L94"
          },
          "summary": "Silence every unnecessary warning from tensorflow."
        },
        {
          "description": "Disable TensorFlow GPU",
          "examples": [],
          "id": "helia_edge.utils.env.disable_tensorflow_gpu",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "disable_tensorflow_gpu",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "disable_tensorflow_gpu()",
          "source": {
            "line": 115,
            "path": "helia_edge/utils/env.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/utils/env.py#L115"
          },
          "summary": "Disable TensorFlow GPU"
        },
        {
          "description": "Redirects the OS stdout (fd=1) and stderr (fd=2) to /dev/null, then restores them on exit.\nSuppresses all output **unless** an exception is raised, in which case it will be logged.\n\n:::note[Example]\nwith suppress_os_stdio():\n    noisy_function()\n\n:::",
          "examples": [],
          "id": "helia_edge.utils.env.suppress_os_stdio",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "suppress_os_stdio",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "suppress_os_stdio()",
          "source": {
            "line": 123,
            "path": "helia_edge/utils/env.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/utils/env.py#L123"
          },
          "summary": "Redirects the OS stdout (fd=1) and stderr (fd=2) to /dev/null, then restores them on exit."
        }
      ]
    }
  ],
  "name": "helia_edge"
}
