docstr: Read .env and merge it with explicitly passed parameters.
docstr_tok: ["Read",".env","and","merge","it","with","explicitly","passed","parameters","."]
code: def _read_env(self, dotenv_path, params):
      """
      Read .env and merge it with explicitly passed parameters.
      """
      self.dotenv = dotenv_values(str(dotenv_path))
      if params is None:
          self.params = {}
      else:
          self.params = {
              k: v for k, v in params.items() if k in self.dotenv
          }
  
      # forward the process' environment variables
      self.env = os.environ.copy()
      # set the defaults from the dotenv files
      self.env.update(self.dotenv)
      # override the defaults passed as parameters
      self.env.update(self.params)
  
      # translate docker's architecture notation to a more widely used one
      arch = self.env.get("ARCH", "amd64")
      self.env["ARCH_ALIAS"] = _arch_alias_mapping.get(arch, arch)
      self.env["ARCH_SHORT"] = _arch_short_mapping.get(arch, arch)
  
imports: import os
  import shlex
  import subprocess
  from io import StringIO
  from dotenv import dotenv_values
  from ruamel.yaml import YAML
  from ..utils.command import Command, default_bin
  from ..utils.source import arrow_path
  from ..compat import _ensure_path
label_desc: Use image node_id 2 for calling the ComposeConfig obj's underlying member method code with example usage: obj._read_env(dotenv_path, params) without return types