code: def _pick_or_create_inserted_op_moment_index(
              self, splitter_index: int, op: ops.Operation,
              strategy: InsertStrategy) -> int:
          
  
          if (strategy is InsertStrategy.NEW or
                  strategy is InsertStrategy.NEW_THEN_INLINE):
              self._moments.insert(splitter_index, ops.Moment())
              return splitter_index
  
          if strategy is InsertStrategy.INLINE:
              if (0 <= splitter_index - 1 < len(self._moments) and
                      self._can_add_op_at(splitter_index - 1, op)):
                  return splitter_index - 1
  
              return self._pick_or_create_inserted_op_moment_index(
                  splitter_index, op, InsertStrategy.NEW)
  
          if strategy is InsertStrategy.EARLIEST:
              if self._can_add_op_at(splitter_index, op):
                  p = self._prev_moment_available(op, splitter_index)
                  return p or 0
  
              return self._pick_or_create_inserted_op_moment_index(
                  splitter_index, op, InsertStrategy.INLINE)
  
          raise ValueError('Unrecognized append strategy: {}'.format(strategy))
docs: Determines and prepares where an insertion will occur.
  
          Args:
              splitter_index: The index to insert at.
              op: The operation that will be inserted.
              strategy: The insertion strategy.
  
          Returns:
              The index of the (possibly new) moment where the insertion should
                  occur.
  
          Raises:
              ValueError: Unrecognized append strategy.