class_docstr: A mapped task group.
  
  This doesn't really do anything special, just holds some additional metadata
  for expansion later.
  
  Don't instantiate this class directly; call *expand* or *expand_kwargs* on
  a ``@task_group`` function instead.
class_docstr_tok: ["A","mapped","task","group",".","This","does","n't","really","do","anything","special",",","just","holds","some","additional","metadata","for","expansion","later",".","Do","n't","instantiate","this","class","directly",";","call","*","expand","*","or","*","expand_kwargs","*","on","a","``","@","task_group","``","function","instead","."]
docstr: Return the number of instances a task in this group should be mapped to at run time.
  
  This considers both literal and non-literal mapped arguments, and the
  result is therefore available when all depended tasks have finished. The
  return value should be identical to ``parse_time_mapped_ti_count`` if
  all mapped arguments are literal.
  
  If this group is inside mapped task groups, all the nested counts are
  multiplied and accounted.
  
  :meta private:
  
  :raise NotFullyPopulated: If upstream tasks are not all complete yet.
  :return: Total number of mapped TIs this task should have.
docstr_tok: ["Return","the","number","of","instances","a","task","in","this","group","should","be","mapped","to","at","run","time",".","This","considers","both","literal","and","non-literal","mapped","arguments",",","and","the","result","is","therefore","available","when","all","depended","tasks","have","finished",".","The","return","value","should","be","identical","to","``","parse_time_mapped_ti_count","``","if","all","mapped","arguments","are","literal",".","If","this","group","is","inside","mapped","task","groups",",","all","the","nested","counts","are","multiplied","and","accounted",".",":","meta","private",":",":","raise","NotFullyPopulated",":","If","upstream","tasks","are","not","all","complete","yet",".",":","return",":","Total","number","of","mapped","TIs","this","task","should","have","."]
code: def get_mapped_ti_count(
      self, run_id: str, *, session: Session
  ) -> int:
      """
      Return the number of instances a task in this group should be mapped to at run time.
  
      This considers both literal and non-literal mapped arguments, and the
      result is therefore available when all depended tasks have finished. The
      return value should be identical to ``parse_time_mapped_ti_count`` if
      all mapped arguments are literal.
  
      If this group is inside mapped task groups, all the nested counts are
      multiplied and accounted.
  
      :meta private:
  
      :raise NotFullyPopulated: If upstream tasks are not all complete yet.
      :return: Total number of mapped TIs this task should have.
      """
      groups = self.iter_mapped_task_groups()
      return functools.reduce(
          operator.mul,
          (
              g._expand_input.get_total_map_length(
                  run_id, session=session
              )
              for g in groups
          ),
      )
  
imports: from __future__ import annotations
  import copy
  import functools
  import operator
  import weakref
  from typing import TYPE_CHECKING, Any, Generator, Iterator, Sequence
  import re2
  from airflow.compat.functools import cache
  from airflow.exceptions import AirflowDagCycleException, AirflowException, DuplicateTaskIdFound, TaskAlreadyInTaskGroup
  from airflow.models.taskmixin import DAGNode
  from airflow.serialization.enums import DagAttributeTypes
  from airflow.utils.helpers import validate_group_key
label_desc: Use image node_id 4 for calling the MappedTaskGroup obj's underlying member method code with example usage: obj.get_mapped_ti_count(run_id) and returns: functools