code: def from_config(config: Dict[str, str]) -> "DeployConfig":
      location = env_var_or_default("location", config["location"])
      domain = env_var_or_default("domain", config["domain"])
      ns = env_var_or_default(
          "default_namespace", config["default_namespace"]
      )
      base_path = (
          env_var_or_default("base_path", config.get("base_path"))
          or None
      )
      if base_path is None and ns != "default":
          domain = f'internal.{config["domain"]}'
          base_path = f"/{ns}"
  
      return DeployConfig(location, ns, domain, base_path)
  
imports: from typing import Dict, Optional, TypeVar, Union
  import os
  import json
  import logging
  from ..utils import first_extant_file
  from .user_config import get_user_config
label_desc: Use image node_id 1 for calling the DeployConfig obj's underlying member method code with example usage: obj.from_config(config) and returns: DeployConfig