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, vehicle_id, access_token, unit_system='metric'):
""" Initializes a new Vehicle to use for making requests to the Smartcar API.
Args:
vehicle_id (str): the vehicle's unique identifier
access_token (str): a valid access token
unit_system (str, optional): the unit system to use for vehicle data.
Defaults to metric.
"""
self.vehicle_id = vehicle_id
self.access_token = access_token
self.api = Api(access_token, vehicle_id)
self.api.set_unit_system(
'metric' if unit_system == 'metric' else 'imperial')