def check_stable(self, body, linear_velocity_threshold, angular_velocity_threshold):
    'Check if the loaded object is 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\n        Returns:\n            is_stable: True if the linear velocity and the angular velocity are\n                almost zero; False otherwise.\n        '
    linear_velocity = np.linalg.norm(body.linear_velocity)
    angular_velocity = np.linalg.norm(body.angular_velocity)
    if (linear_velocity_threshold is None):
        has_linear_velocity = False
    else:
        has_linear_velocity = (linear_velocity >= linear_velocity_threshold)
    if (angular_velocity_threshold is None):
        has_angular_velocity = False
    else:
        has_angular_velocity = (angular_velocity >= angular_velocity_threshold)
    is_stable = ((not has_linear_velocity) and (not has_angular_velocity))
    return is_stable
Check if the loaded object is 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.

Returns:
    is_stable: True if the linear velocity and the angular velocity are
        almost zero; False otherwise.
def check_stable(self, body, linear_velocity_threshold, angular_velocity_threshold):
    'Check if the loaded object is 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\n        Returns:\n            is_stable: True if the linear velocity and the angular velocity are\n                almost zero; False otherwise.\n        '
    linear_velocity = np.linalg.norm(body.linear_velocity)
    angular_velocity = np.linalg.norm(body.angular_velocity)
    if (linear_velocity_threshold is None):
        has_linear_velocity = False
    else:
        has_linear_velocity = (linear_velocity >= linear_velocity_threshold)
    if (angular_velocity_threshold is None):
        has_angular_velocity = False
    else:
        has_angular_velocity = (angular_velocity >= angular_velocity_threshold)
    is_stable = ((not has_linear_velocity) and (not has_angular_velocity))
    return is_stable