def step_size_to_bound(x, s, lb, ub):
    non_zero = np.nonzero(s)
    s_non_zero = s[non_zero]
    steps = np.empty_like(x)
    steps.fill(np.inf)
    with np.errstate(over='ignore'):
        steps[non_zero] = np.maximum((lb - x)[non_zero] / s_non_zero,
                                     (ub - x)[non_zero] / s_non_zero)
    min_step = np.min(steps)
    return min_step, np.equal(steps, min_step) * np.sign(s).astype(int)
Saves any relevant billing data (eg a billing address).
dataset/ETHPy150Open scipy/scipy/scipy/optimize/_lsq/common.py/step_size_to_bound--crossover with--dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/checkout/mixins.py/OrderPlacementMixin.create_billing_address