class_docstr: Figures out what linkable specs are valid for a given metric.
  
  e.g. Can you query the metric "bookings" by "listing__country_latest"?
docstr: Gets the elements in the semantic model, without requiring any joins.
  
  Elements related to metric_time are handled separately in _create_elements_for_metric_time().
docstr_tok: ["Gets","the","elements","in","the","semantic","model",",","without","requiring","any","joins",".","Elements","related","to","metric_time","are","handled","separately","in","_create_elements_for_metric_time","(",")","."]
code: def _get_elements_in_semantic_model(
      semantic_model: SemanticModel,
  ) -> LinkableElementSet:
      """Gets the elements in the semantic model, without requiring any joins.
  
      Elements related to metric_time are handled separately in _create_elements_for_metric_time().
      """
      linkable_dimensions = []
      linkable_entities = []
      for entity in semantic_model.entities:
          linkable_entities.append(
              LinkableEntity(
                  semantic_model_origin=semantic_model.reference,
                  element_name=entity.reference.element_name,
                  entity_links=(),
                  join_path=(),
                  properties=frozenset(
                      {
                          LinkableElementProperties.LOCAL,
                          LinkableElementProperties.ENTITY,
                      }
                  ),
              )
          )
          for (
              entity_link
          ) in SemanticModelLookup.entity_links_for_local_elements(
              semantic_model
          ):
              linkable_entities.append(
                  LinkableEntity(
                      semantic_model_origin=semantic_model.reference,
                      element_name=entity.reference.element_name,
                      entity_links=(entity_link,),
                      join_path=(),
                      properties=frozenset(
                          {
                              LinkableElementProperties.LOCAL,
                              LinkableElementProperties.ENTITY,
                          }
                      ),
                  )
              )
  
      for (
          entity_link
      ) in SemanticModelLookup.entity_links_for_local_elements(
          semantic_model
      ):
          dimension_properties = frozenset(
              {LinkableElementProperties.LOCAL}
          )
          for dimension in semantic_model.dimensions:
              dimension_type = dimension.type
              if dimension_type is DimensionType.CATEGORICAL:
                  linkable_dimensions.append(
                      LinkableDimension(
                          semantic_model_origin=semantic_model.reference,
                          element_name=dimension.reference.element_name,
                          entity_links=(entity_link,),
                          join_path=(),
                          properties=dimension_properties,
                          time_granularity=None,
                          date_part=None,
                      )
                  )
              elif dimension_type is DimensionType.TIME:
                  linkable_dimensions.extend(
                      _generate_linkable_time_dimensions(
                          semantic_model_origin=semantic_model.reference,
                          dimension=dimension,
                          entity_links=(entity_link,),
                          join_path=(),
                          with_properties=dimension_properties,
                      )
                  )
              else:
                  assert_values_exhausted(dimension_type)
  
      return LinkableElementSet(
          path_key_to_linkable_dimensions={
              linkable_dimension.path_key: (linkable_dimension,)
              for linkable_dimension in linkable_dimensions
          },
          path_key_to_linkable_entities={
              linkable_entity.path_key: (linkable_entity,)
              for linkable_entity in linkable_entities
          },
      )
  
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 3 for calling the ValidLinkableSpecResolver obj's underlying member method code with example usage: obj._get_elements_in_semantic_model(semantic_model) and returns: LinkableElementSet