def _tosequence(X):
 if isinstance(X, Mapping):
  return [X]
 else:
  return tosequence(X)

def _tosequence ( X ) : if isinstance ( X , Mapping ) : return [ X ] else : return tosequence ( X )
turn x into a sequence or ndarray .