code: def time_frame(
      columns: Optional[Mapping[str, Collection]] = None,
      *,
      index: Optional[Periods] = None,
      start: Optional[Union[Period, str]] = None,
      freq: Optional[Union[str, Freq]] = None,
      static: Optional[Mapping[str, Any]] = None,
      tdims: Optional[Mapping[str, int]] = None,
      length: Optional[int] = None,
      default_tdim: int = -1,
      metadata: Optional[Mapping] = None,
  ):
      """Create a ``zebras.TimeFrame`` object that represents one
      or more time series.
  
      Parameters
      ----------
      columns, optional
          A dictionary where keys are strings representing column names and
          values are sequences (e.g., list, numpy arrays). All columns must have
          the same length in the time dimension, by default None
      index, optional
          A ``zebras.Periods`` object representing timestamps.
          Must have the same length as the columns, by default None
      start, optional
          The start time represented by a string (e.g., "2023-01-01"),
          or a ``zebras.Period`` object. An index will be constructed using
          this start time and the specified frequency, by default None
      freq, optional
          The frequency of the period, e.g, "H" for hourly, by default None
      static, optional
          A dictionary of static-in-time features, by default None
      tdims, optional
          A dictionary specifying the time dimension for each column. The keys
          should match those in `columns`. If unspecified for a column,
          the `default_tdim` is used, by default None
      length, optional
          The length (in time) of the TimeFrame, by default None
      default_tdim, optional
          The default time dimension, by default -1
      metadata, optional
          A dictionary of metadata associated with the TimeFrame, by default None
  
      Returns
      -------
          A ``zebras.TimeFrame`` object.
      """
      assert (
          index is None or start is None
      ), "Both index and start cannot be specified."
  
      columns = maybe.unwrap_or_else(columns, dict)
      tdims = maybe.unwrap_or_else(tdims, dict)
      static = maybe.unwrap_or_else(static, dict)
  
      columns = valmap(np.array, columns)
      static = valmap(np.array, static)
  
      if length is None:
          if index is not None:
              length = len(index)
          elif columns:
              column = first(columns)
              length = columns[column].shape[
                  tdims.get(column, default_tdim)
              ]
          else:
              length = 0
  
      tf = TimeFrame(
          columns=columns,
          index=index,
          static=static,
          tdims=cast(dict, tdims),
          length=length,
          default_tdim=default_tdim,
          metadata=cast(Optional[dict], metadata),
      )
      if tf.index is None and start is not None:
          if freq is not None:
              start = period(start, freq)
          else:
              assert isinstance(start, Period)
  
          return tf.with_index(start.periods(len(tf)))
  
      return tf
  
imports: from __future__ import annotations
  import dataclasses
  from operator import itemgetter
  from typing import cast, Optional, List, Union, Collection, Any, Mapping
  import numpy
  from toolz import first, valmap, dissoc, merge, itemmap, take
  from gluonts import maybe
  from gluonts.itertools import pluck_attr, columns_to_rows, rows_to_columns, select, join_items
  from ._base import Pad, TimeBase
  from ._freq import Freq
  from ._period import Periods, Period, period
  from ._repr import html_table
  from ._util import AxisView, pad_axis, _replace
  from ._time_series import BatchTimeSeries, TimeSeries
  from ._split_frame import SplitFrame
label_desc: Use image node_id 1 for calling a global function with example usage: time_frame(columns) and returns: tf, tf