code: def compute_rows_length(pa_array: pa.Array) -> NDArray[np.int32]:
      type_ = pa_array.type
      if pa.types.is_list(type_) or pa.types.is_large_list(type_):
          length_col = pa.compute.list_value_length(pa_array).to_numpy()
      elif pa.types.is_string(type_):
          length_col = pa.compute.utf8_length(pa_array).to_numpy()
      else:
          length_col = np.asarray(pa_array.to_pandas().apply(len))
  
      length_col = length_col.copy()
      length_col[np.isnan(length_col)] = 0
      return np.asarray(length_col, dtype=np.int32)
  
imports: from contextlib import contextmanager
  from typing import Dict, Generator, List, Optional, Union
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  import torch
  from numpy.typing import NDArray
  from pyarrow.dataset import get_partition_keys
  from fairseq2.data import CString
  from fairseq2.data.data_pipeline import DataPipeline, DataPipelineBuilder, read_sequence
label_desc: Use image node_id 13 for calling a global function with example usage: compute_rows_length(pa_array) and returns: np