code: def get_shared_times(
      *series_or_times: Union[TimeSeries, pd.Index, None],
      sort: bool = True,
  ) -> pd.Index:
      """
      Returns the times shared by all of the specified `TimeSeries` or time indexes (i.e. the intersection of all
      these times). If `sort = True`, then these shared times are sorted from earliest to latest. Any `TimeSeries` or
      time indices in `series_or_times` that aren't specified (i.e. are `None`) are simply ignored.
  
      Parameters
      ----------
      series_or_times
          The `TimeSeries` and/or time indices that should 'intersected'.
      sort
          Optionally, specifies that the returned shared times should be sorted from earliest to latest.
  
      Returns
      -------
      shared_times
          The time indices present in all of the specified `TimeSeries` and/or time indices.
  
      Raises
      ------
      TypeError
          If the specified `TimeSeries` and/or time indices do not all share the same type of time index (i.e. must
          either be all `pd.DatetimeIndex` or all `pd.RangeIndex`).
      """
  
      # `sort = None` specifies to `pd.Index.intersection` that values should be sorted:
      sort = None if sort else False
  
      def intersection_func(series_or_times_1, series_or_times_2):
          times_1 = (
              series_or_times_1.time_index
              if isinstance(series_or_times_1, TimeSeries)
              else series_or_times_1
          )
          times_2 = (
              series_or_times_2.time_index
              if isinstance(series_or_times_2, TimeSeries)
              else series_or_times_2
          )
          return times_1.intersection(times_2, sort=sort)
  
      specified_inputs = [
          series for series in series_or_times if series is not None
      ]
  
      if not specified_inputs:
          shared_times = None
      elif len(specified_inputs) == 1:
          shared_times = (
              specified_inputs[0].time_index
              if isinstance(specified_inputs[0], TimeSeries)
              else specified_inputs[0]
          )
          shared_times = (
              None if len(shared_times) == 0 else shared_times
          )
      else:
          shared_times = reduce(intersection_func, specified_inputs)
          # Empty intersection may result from intersecting time indices being of different types - throw error if so:
          if shared_times.empty:
              shared_times = None
              times_types = [
                  type(
                      ts.time_index
                      if isinstance(ts, TimeSeries)
                      else ts
                  )
                  for ts in specified_inputs
              ]
              raise_if_not(
                  len(set(times_types)) == 1,
                  (
                      "Specified series and/or times must all "
                      "have the same type of `time_index` (i.e. all "
                      "`pd.RangeIndex` or all `pd.DatetimeIndex`)."
                  ),
              )
      return shared_times
  
imports: import warnings
  from functools import reduce
  from math import inf
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  from itertools import chain
  import numpy
  import pandas
  from numpy.lib.stride_tricks import as_strided
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.timeseries import TimeSeries
  from darts.utils.utils import get_single_series, series2seq
label_desc: Use image node_id 10 for calling a global function with example usage: get_shared_times() and returns: shared_times, times_1