(input, rank, array_type=None)
return normalized
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.
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.
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 .
def _normalize_sequence(input, rank, array_type=None):
    """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.
    """
    if hasattr(input, '__iter__'):
        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 ) : if hasattr ( input , '__iter__' ) : 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