code: def main(conda_fname, pip_fname):
      """
      Generate the pip dependencies file from the conda file, or compare that
      they are synchronized (``compare=True``).
  
      Parameters
      ----------
      conda_fname : str
          Path to the conda file with dependencies (e.g. `environment.yml`).
      pip_fname : str
          Path to the pip file with dependencies (e.g. `requirements-dev.txt`).
      compare : bool, default False
          Whether to generate the pip file (``False``) or to compare if the
          pip file has been generated with this script and the last version
          of the conda file (``True``).
  
      Returns
      -------
      bool
          True if the comparison fails, False otherwise
      """
      with open(conda_fname) as conda_fd:
          deps = yaml.safe_load(conda_fd)["dependencies"]
  
      pip_deps = []
      for dep in deps:
          if isinstance(dep, str):
              conda_dep = conda_package_to_pip(dep)
              if conda_dep:
                  pip_deps.append(conda_dep)
          elif isinstance(dep, dict) and len(dep) == 1 and "pip" in dep:
              pip_deps += dep["pip"]
          else:
              raise ValueError(f"Unexpected dependency {dep}")
  
      header = (
          "# This file is auto-generated by scripts/generate_pip_deps_from_conda.py, "
          "do not modify.\n# See that file for comments about the need/usage of each dependency.\n\n"
      )
      pip_content = header + "\n".join(sorted(pip_deps)) + "\n"
  
      with open(pip_fname, "w", newline="") as pip_fd:
          pip_fd.write(pip_content)
  
imports: import argparse
  import re
  import yaml
label_desc: Use image node_id 2 for calling a global function with example usage: main(conda_fname, pip_fname) without return types