code: def list_flights(args, client, connection_args={}):
      print("Flights\n=======")
      for flight in client.list_flights():
          descriptor = flight.descriptor
          if (
              descriptor.descriptor_type
              == pyarrow.flight.DescriptorType.PATH
          ):
              print("Path:", descriptor.path)
          elif (
              descriptor.descriptor_type
              == pyarrow.flight.DescriptorType.CMD
          ):
              print("Command:", descriptor.command)
          else:
              print("Unknown descriptor type")
  
          print("Total records:", end=" ")
          if flight.total_records >= 0:
              print(flight.total_records)
          else:
              print("Unknown")
  
          print("Total bytes:", end=" ")
          if flight.total_bytes >= 0:
              print(flight.total_bytes)
          else:
              print("Unknown")
  
          print("Number of endpoints:", len(flight.endpoints))
          print("Schema:")
          print(flight.schema)
          print("---")
  
      print("\nActions\n=======")
      for action in client.list_actions():
          print("Type:", action.type)
          print("Description:", action.description)
          print("---")
  
file_path: arrow/python/examples/flight/client.py
imports: import argparse
  import sys
  import pyarrow
  import pyarrow.flight
  import pyarrow.csv
label_desc: Use image node_id 1 for calling a global function with example usage: list_flights(args, client, connection_args) without return types