def shift_bins(arr, phase=0, nonneg=False):
    if (phase != 0):
        diff = np.diff(arr)
        if np.allclose(diff, diff[::(- 1)]):
            diff = diff[0]
            arr = (arr + (phase * diff))
            return arr
        else:
            arr = np.log10(arr)
            diff = np.diff(arr)[0]
            arr = (arr + (phase * diff))
            return np.power(10.0, arr)
    else:
        return arr
def shift_bins(arr, phase=0, nonneg=False):
    if (phase != 0):
        diff = np.diff(arr)
        if np.allclose(diff, diff[::(- 1)]):
            diff = diff[0]
            arr = (arr + (phase * diff))
            return arr
        else:
            arr = np.log10(arr)
            diff = np.diff(arr)[0]
            arr = (arr + (phase * diff))
            return np.power(10.0, arr)
    else:
        return arr