code: def _parse_flags(argv: List[str]) -> argparse.Namespace:
      """Command lines flag parsing."""
      parser = argparse_flags.ArgumentParser()
      parser.add_argument(
          "--json_serialized_invocation_args",
          type=str,
          required=True,
          help="JSON-serialized metadata for this execution.",
      )
      # Ignore unknown args which is expected. Beam related args are also supplied
      # as command line arguments.
      # TODO(b/182333035): Wrap beam related flags into a dedicated flag.
      namespace, _ = parser.parse_known_args(argv)
      return namespace
  
imports: import argparse
  import os
  from typing import List
  from absl import app
  from absl import logging
  from absl.flags import argparse_flags
  from kfp.pipeline_spec import pipeline_spec_pb2
  from tfx.components.example_gen import driver
  from tfx.components.example_gen import input_processor
  from tfx.components.example_gen import utils
  from tfx.dsl.io import fileio
  from tfx.orchestration.kubeflow.v2.container import kubeflow_v2_entrypoint_utils
  from tfx.proto import example_gen_pb2
  from tfx.proto import range_config_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_component_specs
  from tfx.utils import proto_utils
  from google.protobuf import json_format
label_desc: Use image node_id 2 for calling a global function with example usage: _parse_flags(argv) and returns: namespace