def matdims(arr, oned_as='column'):
    shape = arr.shape
    if shape == ():  # scalar
        return (1,1)
    if reduce(operator.mul, shape) == 0:  # zero elememts
        return (0,) * np.max([arr.ndim, 2])
    if len(shape) == 1:  # 1D
        if oned_as == 'column':
            return shape + (1,)
        elif oned_as == 'row':
            return (1,) + shape
        else:
            raise ValueError('1D option "%s" is strange'
                             % oned_as)
    return shape
Use git.init to init a new repo
dataset/ETHPy150Open scipy/scipy/scipy/io/matlab/miobase.py/matdims--crossover with--dataset/ETHPy150Open saltstack/salt/tests/integration/modules/git.py/GitModuleTest.test_init