code: def write_pip_lock_file(build_metadata):
      build_name = build_metadata["name"]
      python_version = build_metadata["python_version"]
      environment_name = f"pip-tools-python{python_version}"
      # To make sure that the Python used to create the pip lock file is the same
      # as the one used during the CI build where the lock file is used, we first
      # create a conda environment with the correct Python version and
      # pip-compile and run pip-compile in this environment
  
      command = (
          "conda create -c conda-forge -n"
          f" pip-tools-python{python_version} python={python_version} pip-tools -y"
      )
      execute_command(shlex.split(command))
  
      json_output = execute_command(shlex.split("conda info --json"))
      conda_info = json.loads(json_output)
      environment_folder = [
          each
          for each in conda_info["envs"]
          if each.endswith(environment_name)
      ][0]
      environment_path = Path(environment_folder)
      pip_compile_path = environment_path / "bin" / "pip-compile"
  
      folder_path = Path(build_metadata["folder"])
      requirement_path = folder_path / f"{build_name}_requirements.txt"
      lock_file_path = folder_path / f"{build_name}_lock.txt"
      pip_compile(pip_compile_path, requirement_path, lock_file_path)
  
imports: import json
  import logging
  import re
  import shlex
  import subprocess
  import sys
  from importlib.metadata import version
  from pathlib import Path
  import click
  from jinja2 import Environment
  from packaging.version import Version
label_desc: Use image node_id 14 for calling a global function with example usage: write_pip_lock_file(build_metadata) without return types