code: def regression_tests(binaries, pypi, conda, nightly):
      now = datetime.datetime.now()
      print(
          "Current date and time : " + now.strftime("%Y-%m-%d %H:%M:%S")
      )
  
      check_python_version()
  
      if binaries:
          if pypi:
              if nightly:
                  cmd = f"pip install torchserve-nightly torch-model-archiver-nightly torch-workflow-archiver-nightly"
              else:
                  cmd = f"pip install torchserve torch-model-archiver torch-workflow-archiver"
          elif conda:
              if nightly:
                  cmd = f"conda install -c pytorch-nightly torchserve torch-model-archiver torch-workflow-archiver"
              else:
                  cmd = f"conda install -c pytorch torchserve torch-model-archiver torch-workflow-archiver"
          try_and_handle(cmd, False)
          print(
              f"## In directory: {os.getcwd()}; Executing command: {cmd}"
          )
      else:
          # Install from source
          install_from_src()
  
      # Generate mar file
      mg.generate_mars()
  
      # Run newman api tests
      test_api(
          "all"
      )  # "all" > management, inference, increased_timeout_inference, https collections
  
      # Run regression tests
      test_regression()
  
      # delete mar_gen_dir
      mg.delete_model_store_gen_dir()
  
file_path: serve/test/regression_tests.py
imports: import argparse
  import os
  import sys
  import datetime
  from ts_scripts import marsgen
  from ts_scripts.api_utils import test_api
  from ts_scripts.install_from_src import install_from_src
  from ts_scripts.regression_utils import test_regression
  from ts_scripts.utils import check_python_version, try_and_handle
label_desc: Use image node_id 1 for calling a global function with example usage: regression_tests(binaries, pypi, conda, nightly) without return types