def _normalize_sequence(input, rank, array_type=None):
 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

def _normalize_sequence ( input , rank , array_type = None ) : 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
if input is a scalar .