Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, body, network):
"""As a way to make sure the body and network
instances have the required method, this class
only accept bodies that inherit from BaseBody
and networks that inherit from BaseNetwork.
"""
if isinstance(body, BaseBody):
self.body = body
else:
raise Exception(
"body is not an instance of BaseRobot.BaseBody()")
if isinstance(network, BaseNetwork):
self.network = network
else:
raise Exception(
"network is not an instance of BaseRobot.BaseNetwork")
self.working = False
self.printing = False
self.last_target = [0., 0.]
return