code: def _generate_linkable_time_dimensions(
      semantic_model_origin: SemanticModelReference,
      dimension: Dimension,
      entity_links: Tuple[EntityReference, ...],
      join_path: Sequence[SemanticModelJoinPathElement],
      with_properties: FrozenSet[LinkableElementProperties],
  ) -> Sequence[LinkableDimension]:
      """Generates different versions of the given dimension, but at other valid time granularities."""
      linkable_dimensions = []
  
      defined_time_granularity = (
          dimension.type_params.time_granularity
          if dimension.type_params
          else DEFAULT_TIME_GRANULARITY
      )
      for time_granularity in TimeGranularity:
          if time_granularity < defined_time_granularity:
              continue
          properties = set(with_properties)
          if time_granularity != defined_time_granularity:
              properties.add(
                  LinkableElementProperties.DERIVED_TIME_GRANULARITY
              )
  
          linkable_dimensions.append(
              LinkableDimension(
                  semantic_model_origin=semantic_model_origin,
                  element_name=dimension.reference.element_name,
                  entity_links=entity_links,
                  join_path=tuple(join_path),
                  time_granularity=time_granularity,
                  date_part=None,
                  properties=frozenset(properties),
              )
          )
  
          # Add the time dimension aggregated to a different date part.
          for date_part in DatePart:
              if time_granularity.to_int() <= date_part.to_int():
                  linkable_dimensions.append(
                      LinkableDimension(
                          semantic_model_origin=semantic_model_origin,
                          element_name=dimension.reference.element_name,
                          entity_links=entity_links,
                          join_path=tuple(join_path),
                          time_granularity=time_granularity,
                          date_part=date_part,
                          properties=frozenset(properties),
                      )
                  )
  
      return linkable_dimensions
  
imports: from __future__ import annotations
  import logging
  import time
  from collections import defaultdict
  from dataclasses import dataclass
  from typing import Dict, FrozenSet, List, Optional, Sequence, Set, Tuple
  from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
  from dbt_semantic_interfaces.pretty_print import pformat_big_objects
  from dbt_semantic_interfaces.protocols.dimension import Dimension, DimensionType
  from dbt_semantic_interfaces.protocols.semantic_manifest import SemanticManifest
  from dbt_semantic_interfaces.protocols.semantic_model import SemanticModel
  from dbt_semantic_interfaces.references import DimensionReference, MeasureReference, MetricReference, SemanticModelReference, TimeDimensionReference
  from dbt_semantic_interfaces.type_enums import MetricType
  from dbt_semantic_interfaces.type_enums.date_part import DatePart
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from metricflow.dataset.dataset import DataSet
  from metricflow.errors.errors import UnknownMetricLinkingError
  from metricflow.model.semantics.linkable_element_properties import LinkableElementProperties
  from metricflow.model.semantics.semantic_model_join_evaluator import SemanticModelJoinEvaluator
  from metricflow.model.semantics.semantic_model_lookup import SemanticModelLookup
  from metricflow.protocols.semantics import SemanticModelAccessor
  from metricflow.specs.specs import DEFAULT_TIME_GRANULARITY, DimensionSpec, EntityReference, EntitySpec, LinkableSpecSet, TimeDimensionSpec
label_desc: Use image node_id 1 for calling a global function with example usage: _generate_linkable_time_dimensions(semantic_model_origin, dimension, entity_links, join_path, with_properties) and returns: linkable_dimensions