code: def _normalize_sequence(input, rank):
      """If input is a scalar, create a sequence of length equal to the
      rank by duplicating the input. If input is a sequence,
      check if its length is equal to the length of array.
      """
      is_str = isinstance(input, string_types)
      if hasattr(input, "__iter__") and not is_str:
          normalized = list(input)
          if len(normalized) != rank:
              err = "sequence argument must have length equal to input rank"
              raise RuntimeError(err)
      else:
          normalized = [input] * rank
      return normalized
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from scipy._lib.six import string_types
label_desc: Use image node_id 2 for calling a global function with example usage: _normalize_sequence(input, rank) and returns: normalized