def get_gates(cur_state, hard_boundaries, buffer_width):
    """Obtains the gates that represent the edges that a dihedral must exit
    from to undergo a buffered transition.

    Parameters
    -----------
    cur_state : int,
        Rotameric basin index presently being occupied by the dihedral
    hard_boundaries : array-like, shape=(1, n_boundaries)
        Single set of numbers containing the "hard" boundaries denoting
        rotamer basins. This array MUST contain 0 as the first value and
        360 as the last value.
    buffer_width : int, default=15
        size of the buffer region on either side of the
        rotamer barrier.

    Returns
    ----------
    lower_bound : int
        Lower gate that must be crossed for a transition to occur
    upper_bound : int
        Upper gate that must be crossed for a transition to occur

    See also
    ---------
    _rotamers, is_buffered_transition

    """
    n_basins = len(hard_boundaries) - 1
    state_num = int(cur_state)
    lower_bound = hard_boundaries[state_num]
    upper_bound = hard_boundaries[state_num + 1]
    if lower_bound == 0:
        lower_bound = 360
    if upper_bound == 360:
        upper_bound = 0
    lower_bound -= buffer_width
    upper_bound += buffer_width
    return lower_bound, upper_bound
