code: def collect(
      paths: list[str] = paths, env: Mapping[str, str] | None = None
  ) -> dict:
      """
      Collect configuration from paths and environment variables
  
      Parameters
      ----------
      paths : list[str]
          A list of paths to search for yaml config files
  
      env : Mapping[str, str]
          The system environment variables
  
      Returns
      -------
      config: dict
  
      See Also
      --------
      dask.config.refresh: collect configuration and update into primary config
      """
      if env is None:
          env = os.environ
  
      configs = collect_yaml(paths=paths)
      configs.append(collect_env(env=env))
  
      return merge(*configs)
  
imports: from __future__ import annotations
  import ast
  import base64
  import builtins
  import json
  import os
  import site
  import sys
  import threading
  import warnings
  from collections.abc import Mapping, Sequence
  from typing import Any, Literal
  import yaml
  from dask.typing import no_default
label_desc: Use image node_id 9 for calling a global function with example usage: collect(paths, env) and returns: merge