code: def pickled_bytes_to_python_obj(data, type_info):
      if isinstance(type_info, RowTypeInfo):
          row_kind = RowKind(int.from_bytes(data[0], "little"))
          field_data_with_types = zip(
              list(data[1:]), type_info.get_field_types()
          )
          fields = []
          for field_data, field_type in field_data_with_types:
              if len(field_data) == 0:
                  fields.append(None)
              else:
                  fields.append(
                      pickled_bytes_to_python_obj(
                          field_data, field_type
                      )
                  )
          row = Row.of_kind(row_kind, *fields)
          row.set_field_names(type_info.get_field_names())
          return row
      elif isinstance(type_info, TupleTypeInfo):
          field_data_with_types = zip(data, type_info.get_field_types())
          fields = []
          for field_data, field_type in field_data_with_types:
              if len(field_data) == 0:
                  fields.append(None)
              else:
                  fields.append(
                      pickled_bytes_to_python_obj(
                          field_data, field_type
                      )
                  )
          return tuple(fields)
      else:
          data = pickle.loads(data)
          if type_info == Types.SQL_TIME():
              seconds, microseconds = divmod(data, 10**6)
              minutes, seconds = divmod(seconds, 60)
              hours, minutes = divmod(minutes, 60)
              return datetime.time(
                  hours, minutes, seconds, microseconds
              )
          elif type_info == Types.SQL_DATE():
              return type_info.from_internal_type(data)
          elif type_info == Types.SQL_TIMESTAMP():
              return type_info.from_internal_type(
                  int(data.timestamp() * 10**6)
              )
          elif type_info == Types.FLOAT():
              return type_info.from_internal_type(
                  ast.literal_eval(data)
              )
          elif isinstance(
              type_info,
              (
                  BasicArrayTypeInfo,
                  PrimitiveArrayTypeInfo,
                  ObjectArrayTypeInfo,
              ),
          ):
              element_type = type_info._element_type
              elements = []
              for element_bytes in data:
                  elements.append(
                      pickled_bytes_to_python_obj(
                          element_bytes, element_type
                      )
                  )
              return elements
          elif isinstance(type_info, MapTypeInfo):
              key_type = type_info._key_type_info
              value_type = type_info._value_type_info
              zip_kv = zip(data[0], data[1])
              return dict(
                  (
                      pickled_bytes_to_python_obj(k, key_type),
                      pickled_bytes_to_python_obj(v, value_type),
                  )
                  for k, v in zip_kv
              )
          elif isinstance(type_info, ListTypeInfo):
              element_type = type_info.elem_type
              elements = []
              for element_bytes in data:
                  elements.append(
                      pickled_bytes_to_python_obj(
                          element_bytes, element_type
                      )
                  )
              return elements
          else:
              return type_info.from_internal_type(data)
  
file_path: flink/flink-python/pyflink/datastream/utils.py
imports: import ast
  import datetime
  import pickle
  from abc import abstractmethod
  from pyflink.common import Row, RowKind, Configuration
  from pyflink.common.typeinfo import RowTypeInfo, TupleTypeInfo, Types, BasicArrayTypeInfo, PrimitiveArrayTypeInfo, MapTypeInfo, ListTypeInfo, ObjectArrayTypeInfo, ExternalTypeInfo, TypeInformation
  from pyflink.java_gateway import get_gateway
label_desc: Use image node_id 4 for calling a global function with example usage: pickled_bytes_to_python_obj(data, type_info) and returns: row, tuple, datetime, type_info, type_info, type_info, elements, dict, elements, type_info