code: def from_ligolw_table(cls, table, columns=None, cast_to_dtypes=None):
          
          name = table.tableName.split(':')[0]
          if columns is None:
              # get all the columns
              columns = table.validcolumns
          else:
              # note: this will raise a KeyError if one or more columns is
              # not in the table's validcolumns
              new_columns = {}
              for col in columns:
                  new_columns[col] = table.validcolumns[col]
              columns = new_columns
          if cast_to_dtypes is not None:
              dtype = [cast_to_dtypes[col] for col in columns]
          else:
              dtype = columns.items()
          # get the values
          if _default_types_status['ilwd_as_int']:
              input_array = \
                  [tuple(getattr(row, col) if dt != 'ilwd:char'
                         else int(getattr(row, col))
                         for col,dt in columns.items())
                   for row in table]
          else:
              input_array = \
                  [tuple(getattr(row, col) for col in columns) for row in table]
          # return the values as an instance of cls
          return cls.from_records(input_array, dtype=dtype,
              name=name)
docs: Converts the given ligolw table into an FieldArray. The `tableName`
          attribute is copied to the array's `name`.
  
          Parameters
          ----------
          table : LIGOLw table instance
              The table to convert.
          columns : {None|list}
              Optionally specify a list of columns to retrieve. All of the
              columns must be in the table's validcolumns attribute. If None
              provided, all the columns in the table will be converted.
          dtype : {None | dict}
              Override the columns' dtypes using the given dictionary. The
              dictionary should be keyed by the column names, with the values
              a tuple that can be understood by numpy.dtype. For example, to
              cast a ligolw column called "foo" to a field called "bar" with
              type float, cast_to_dtypes would be: ``{"foo": ("bar", float)}``.
  
          Returns
          -------
          array : FieldArray
              The input table as an FieldArray.