<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_numpy_bins(bins) -> np.ndarray: """Convert physt bin format to numpy edges. Parameters bins: array_like 1-D (n) or 2-D (n, 2) array of edges Returns ------- edges: all edges """

    bins = np.asarray(bins)
    if bins.ndim == 1:     # Already in the proper format
        return bins
    if not is_consecutive(bins):
        raise RuntimeError("Cannot create numpy bins from inconsecutive edges")
    return np.concatenate([bins[:1, 0], bins[:, 1]])