code: def _create_tf_example_records(
      n, exec_properties
  ) -> Iterable[tf.train.Example]:
      records = []
      has_empty = exec_properties.get("has_empty", True)
  
      for i in range(n):
          feature = {}
          feature["i"] = (
              tf.train.Feature()
              if i % 10 == 0 and has_empty
              else tf.train.Feature(
                  int64_list=tf.train.Int64List(value=[i])
              )
          )
          feature["f"] = (
              tf.train.Feature()
              if i % 10 == 0 and has_empty
              else tf.train.Feature(
                  float_list=tf.train.FloatList(value=[float(i)])
              )
          )
          feature["s"] = (
              tf.train.Feature()
              if i % 10 == 0 and has_empty
              else tf.train.Feature(
                  bytes_list=tf.train.BytesList(
                      value=[tf.compat.as_bytes(str(i))]
                  )
              )
          )
  
          if exec_properties.get("sequence_example", False):
              feature_list = {}
              feature_list["list"] = tf.train.FeatureList(
                  feature=[feature["s"]]
              )
              records.append(
                  tf.train.SequenceExample(
                      context=tf.train.Features(feature=feature),
                      feature_lists=tf.train.FeatureLists(
                          feature_list=feature_list
                      ),
                  )
              )
          else:
              records.append(
                  tf.train.Example(
                      features=tf.train.Features(feature=feature)
                  )
              )
  
      return records
  
imports: import os
  from typing import Any, Dict, Iterable
  import apache_beam
  import pyarrow
  import tensorflow
  from tfx.components.example_gen import base_example_gen_executor
  from tfx.dsl.io import fileio
  from tfx.proto import example_gen_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.types import standard_component_specs
  from tfx.utils import proto_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _create_tf_example_records(n, exec_properties) and returns: records