code: def construct_in_dims(bdim_choice_for_tensors, is_tensors):
      result = []
      bdim = iter(bdim_choice_for_tensors)
      for is_tensor in is_tensors:
          if not is_tensor:
              result.append(None)
              continue
          result.append(next(bdim))
      return tuple(result)
  
imports: import itertools
  import torch
  from functorch import vmap
  import torch.utils._pytree
  from functorch_additional_op_db import additional_op_db
  from torch.testing._internal.common_methods_invocations import DecorateInfo
  from torch.testing._internal.common_methods_invocations import op_db
  from torch.testing._internal.common_modules import module_db
  import os
  import unittest
  from torch.testing._internal.common_device_type import toleranceOverride
  from torch.testing._internal.autograd_function_db import autograd_function_db
  from collections import namedtuple
label_desc: Use image node_id 8 for calling a global function with example usage: construct_in_dims(bdim_choice_for_tensors, is_tensors) and returns: tuple