code: def main(argv):
      """Generates synthetic pricing data."""
      del argv
      np.random.seed(seed=FLAGS.random_seed)
      # Generate and write market data.
      output_path = FLAGS.output_path
      local_directory = (
          tempfile.gettempdir()
          if is_gcs_path(output_path)
          else output_path
      )
      market_data_file_path = path.join(
          local_directory, FLAGS.market_data_file_name
      )
      num_underliers = FLAGS.num_underliers
      market_data = generate_market_data(num_underliers)
      write_local(market_data_file_path, market_data)
      logging.info("Wrote market data to %s", market_data_file_path)
      # Generate the portfolio conditioned on the market data.
      num_files = FLAGS.num_files
      output_file_prefix = FLAGS.output_file_prefix
      file_name_gen = (
          lambda i: f"{output_file_prefix}_{i+1}-of-{num_files}.tfrecords"
      )
      local_full_path_gen = lambda i: path.join(
          local_directory, file_name_gen(i)
      )
  
      local_paths = []
      options_per_file = FLAGS.options_per_file
      for i in range(num_files):
          start_id = i * options_per_file
          portfolio = generate_portfolio(
              options_per_file,
              market_data,
              start_instrument_id=start_id,
          )
          local_path = local_full_path_gen(i)
          write_local(local_path, portfolio)
          logging.info("Wrote portfolio shard to %s", local_path)
          local_paths.append(local_path)
  
      # Upload stuff to GCS
      if is_gcs_path(output_path):
          logging.info("Uploading data to gcs")
          upload_to_gcs(output_path, [market_data_file_path])
          upload_to_gcs(output_path, local_paths)
  
file_path: tf-quant-finance/tf_quant_finance/examples/demos/option_pricing_basic/data_generator/data_generation.py
imports: import datetime
  from os import path
  import tempfile
  from typing import Tuple, List
  from absl import app
  from absl import flags
  from absl import logging
  from common import datatypes
  import dataclasses
  import numpy
  import tf_quant_finance
  from google.cloud import storage
label_desc: Use image node_id 7 for calling a global function with example usage: main(argv) without return types