def wait_until_stable(self, body, linear_velocity_threshold=0.005, angular_velocity_threshold=0.005, check_after_steps=100, min_stable_steps=100, max_steps=2000):
    'Wait until the objects are stable.\n\n        Args:\n            body: An instance of body or a list of bodies.\n            linear_velocity_threshold: Linear velocity threshold of being\n                stable.\n            angular_velocity_threshold: Angular velocity threshold of being\n                stable.\n            check_after_steps: Number of steps before checking.\n            min_stable_steps: Minimum number of steps required to be stable.\n            max_steps: Maximum steps to wait for objects being stable.\n        '
    if isinstance(body, (list, tuple)):
        body_list = body
    else:
        body_list = [body]
    num_steps = 0
    num_stable_steps = 0
    while 1:
        self.step()
        num_steps += 1
        if (num_steps < check_after_steps):
            continue
        all_stable = True
        for b in body_list:
            is_stable = self.check_stable(b, linear_velocity_threshold, angular_velocity_threshold)
            if (not is_stable):
                all_stable = False
                break
        if all_stable:
            num_stable_steps += 1
        if ((num_stable_steps >= min_stable_steps) or (num_steps >= max_steps)):
            break
Wait until the objects are stable.

Args:
    body: An instance of body or a list of bodies.
    linear_velocity_threshold: Linear velocity threshold of being
        stable.
    angular_velocity_threshold: Angular velocity threshold of being
        stable.
    check_after_steps: Number of steps before checking.
    min_stable_steps: Minimum number of steps required to be stable.
    max_steps: Maximum steps to wait for objects being stable.
def wait_until_stable(self, body, linear_velocity_threshold=0.005, angular_velocity_threshold=0.005, check_after_steps=100, min_stable_steps=100, max_steps=2000):
    'Wait until the objects are stable.\n\n        Args:\n            body: An instance of body or a list of bodies.\n            linear_velocity_threshold: Linear velocity threshold of being\n                stable.\n            angular_velocity_threshold: Angular velocity threshold of being\n                stable.\n            check_after_steps: Number of steps before checking.\n            min_stable_steps: Minimum number of steps required to be stable.\n            max_steps: Maximum steps to wait for objects being stable.\n        '
    if isinstance(body, (list, tuple)):
        body_list = body
    else:
        body_list = [body]
    num_steps = 0
    num_stable_steps = 0
    while 1:
        self.step()
        num_steps += 1
        if (num_steps < check_after_steps):
            continue
        all_stable = True
        for b in body_list:
            is_stable = self.check_stable(b, linear_velocity_threshold, angular_velocity_threshold)
            if (not is_stable):
                all_stable = False
                break
        if all_stable:
            num_stable_steps += 1
        if ((num_stable_steps >= min_stable_steps) or (num_steps >= max_steps)):
            break