def padarray(arr, amount):
    padded = np.zeros(arr.shape[0:1] +
                      (arr.shape[1]+2*amount[0], arr.shape[2]+2*amount[1]) +
                      arr.shape[3:])
    padded[:, amount[0]:-amount[0], amount[1]:-amount[1], ...] = arr
    return padded
Easily allow the breadcrumb to be generated in the admin change templates.
dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/helpers.py/padarray--crossover with--dataset/ETHPy150Open chrisglass/django_polymorphic/polymorphic/templatetags/polymorphic_admin_tags.py/breadcrumb_scope