code: def script_lstm(
      input_size,
      hidden_size,
      num_layers,
      bias=True,
      batch_first=False,
      dropout=False,
      bidirectional=False,
  ):
      """Returns a ScriptModule that mimics a PyTorch native LSTM."""
  
      # The following are not implemented.
      assert bias
      assert not batch_first
  
      if bidirectional:
          stack_type = StackedLSTM2
          layer_type = BidirLSTMLayer
          dirs = 2
      elif dropout:
          stack_type = StackedLSTMWithDropout
          layer_type = LSTMLayer
          dirs = 1
      else:
          stack_type = StackedLSTM
          layer_type = LSTMLayer
          dirs = 1
  
      return stack_type(
          num_layers,
          layer_type,
          first_layer_args=[LSTMCell, input_size, hidden_size],
          other_layer_args=[LSTMCell, hidden_size * dirs, hidden_size],
      )
  
imports: import numbers
  import warnings
  from collections import namedtuple
  from typing import List, Tuple
  import torch
  import torch.jit
  import torch.nn
  from torch import Tensor
  from torch.nn import Parameter
label_desc: Use image node_id 1 for calling a global function with example usage: script_lstm(input_size, hidden_size, num_layers, bias, batch_first, dropout, bidirectional) and returns: stack_type