code: def main():
      install("gitpython")
  
      if not os.path.exists(
          conda_prefix + "/blazingsql-testing-files/"
      ):
          git_clone()
      else:
          git_pull()
  
      unzip()
  
      queryType = " Local Tests "
  
      if len(sys.argv) == 2:
          n_nodos = sys.argv[1]
      else:
          n_nodos = "1"
  
      if n_nodos == "1":
          print("Executing test in Single Node")
          bc = BlazingContext()
      else:
          print("Executing test in Distributed Mode")
          from dask.distributed import Client
  
          client = Client("127.0.0.1:8786")
          print("Dask client ready!")
          bc = BlazingContext(
              dask_client=client, network_interface="lo"
          )
  
      log_dict = {}
  
      def executionLocalTest(queryType):
          # Read Data TPCH------------------------------------------------------------------------------------------------------------
  
          tables = [
              "nation",
              "region",
              "supplier",
              "customer",
              "lineitem",
              "orders",
              "part",
              "partsupp",
          ]
  
          data_types = [DataType.PARQUET]  # TODO json
  
          for fileSchemaType in data_types:
              create_tables(bc, data_dir, fileSchemaType, tables=tables)
  
              #   Run Query -----------------------------------------------------------------------------
              worder = 1  # Parameter to indicate if its necessary to order the resulsets before compare them
              use_percentage = False
              acceptable_difference = 0.01
  
              print("==============================")
              print(queryType)
              print("==============================")
  
              queryId = "TEST_01"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_02"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_03"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  spark,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_04"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              queryId = "TEST_05"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_06"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  spark,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_07"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
      executionLocalTest(queryType)
  
      queryType = " S3 Tests "
  
      def executionS3Test(queryType):
          # Read Data TPCH------------------------------------------------------------------------------------------------------------
  
          authority = "tpch_s3"
  
          print(authority)
          print(bucket_name)
          hola = S3EncryptionType.NONE
          print(hola)
          print(access_key_id)
          print(secret_key)
  
          bc.s3(
              authority,
              bucket_name=bucket_name,
              encryption_type=S3EncryptionType.NONE,
              access_key_id=access_key_id,
              secret_key=secret_key,
          )
  
          dir_data_lc = "s3://" + authority + "/" + "DataSet100Mb2part/"
  
          tables = [
              "nation",
              "region",
              "supplier",
              "customer",
              "lineitem",
              "orders",
              "part",
              "partsupp",
          ]
          data_types = [DataType.PARQUET]  # TODO json
  
          for fileSchemaType in data_types:
              create_tables(bc, data_dir, fileSchemaType, tables=tables)
  
              #   Run Query -----------------------------------------------------------------------------
              worder = 1  # Parameter to indicate if its necessary to order the resulsets before compare them
              use_percentage = False
              acceptable_difference = 0.01
  
              print("==============================")
              print(queryType)
              print("==============================")
  
              queryId = "TEST_08"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_09"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              queryId = "TEST_10"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_11"
              # print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              # result = run_query(bc, drill, query, queryId, queryType, worder, '', acceptable_difference, use_percentage, fileSchemaType)
  
              queryId = "TEST_12"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_13"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_14"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
      executionS3Test(queryType)
  
      queryType = " GS Tests "
  
      def executionGSTest(queryType):
          authority = "tpch_gs"
  
          bc.gs(
              authority,
              project_id=gs_project_id,
              bucket_name=gs_bucket_name,
              use_default_adc_json_file=True,
              adc_json_file="",
          )
  
          dir_data_lc = "gcs://" + authority + "/100MB2Part/"
  
          tables = [
              "nation",
              "region",
              "supplier",
              "customer",
              "lineitem",
              "orders",
              "part",
              "partsupp",
          ]
          data_types = [DataType.PARQUET]
  
          for fileSchemaType in data_types:
              create_tables(bc, data_dir, fileSchemaType, tables=tables)
  
              #   Run Query -----------------------------------------------------------------------------
              worder = 1  # Parameter to indicate if its necessary to order the resulsets before compare them
              use_percentage = False
              acceptable_difference = 0.01
  
              print("==============================")
              print(queryType)
              print("==============================")
  
              queryId = "TEST_15"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  spark,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_16"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              queryId = "TEST_17"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  spark,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_18"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_19"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  drill,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_20"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  spark,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_21"
              print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              result = run_query(
                  bc,
                  spark,
                  query,
                  queryId,
                  queryType,
                  worder,
                  "",
                  acceptable_difference,
                  use_percentage,
                  fileSchemaType,
              )
  
              log_dict[queryId] = result
  
              queryId = "TEST_22"
              # print("Executing " + queryId + " ... ")
              query = tpch.get_tpch_query(queryId)
              # result = run_query(bc, drill, query, queryId, queryType, worder, '', acceptable_difference, use_percentage, fileSchemaType)
  
      executionGSTest(queryType)
  
      green = bcolors.OKGREEN
      endc = bcolors.ENDC
  
      print(green + "=======================================")
      print("SUMMARY TESTS")
      print("=======================================" + endc)
  
      for key, value in log_dict.items():
          print('"{}" : {} '.format(key, value))
  
      print(green + "=======================================" + endc)
  
imports: from blazingsql import BlazingContext
  from blazingsql import DataType, S3EncryptionType
  import numpy
  import pandas
  import os
  import subprocess
  import sys
  from EndToEndTests import tpchQueries
label_desc: Use image node_id 15 for calling a global function with example usage: main() without return types