original_docstring: 
          Tells the colour of the traffic light
          :return: color detected
          
docstring: Tells the colour of the traffic light
docstring_tokens: Tells the colour of the traffic light
code: def what_color_is(self):
          """
          Tells the colour of the traffic light
          :return: color detected
          """
          sleep(0.5)
  
          files = glob.glob('live_images/*')
          for f in files:
              os.remove(f)
          print("Cleaning directory")
          self.camera.capture(self.run_image_directory)
          print("Picture taken ..... ")
          url = 'https://api.vize.ai/v2/classify/'
          headers = {
              'Authorization': "Token ee353c77a1d0b5fdde2a2520d7f142ae6193e370",
              'Content-Type': 'application/json'
          }
          with open(self.run_image_directory, "rb") as image_file:
              encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
  
          data = {
              'task_id': 'e7011970-c1e5-4935-a3ab-1488f41c55e4',
              'records': [{"_base64": encoded_string}]
          }
  
          response = requests.post(url, headers=headers, data=json.dumps(data))
          json_obj = json.loads(response.text)
          result = json_obj['records'][0]['best_label']['name']
          self.mirto.set_lcd_message(result, 0)
          print(result)
          return json_obj['records'][0]['best_label']['name']
code_tokens: def what_color_is ( self ) : sleep ( 0.5 ) files = glob . glob ( 'live_images/*' ) for f in files : os . remove ( f ) print ( "Cleaning directory" ) self . camera . capture ( self . run_image_directory ) print ( "Picture taken ..... " ) url = 'https://api.vize.ai/v2/classify/' headers = { 'Authorization' : "Token ee353c77a1d0b5fdde2a2520d7f142ae6193e370" , 'Content-Type' : 'application/json' } with open ( self . run_image_directory , "rb" ) as image_file : encoded_string = base64 . b64encode ( image_file . read ( ) ) . decode ( 'utf-8' ) data = { 'task_id' : 'e7011970-c1e5-4935-a3ab-1488f41c55e4' , 'records' : [ { "_base64" : encoded_string } ] } response = requests . post ( url , headers = headers , data = json . dumps ( data ) ) json_obj = json . loads ( response . text ) result = json_obj [ 'records' ] [ 0 ] [ 'best_label' ] [ 'name' ] self . mirto . set_lcd_message ( result , 0 ) print ( result ) return json_obj [ 'records' ] [ 0 ] [ 'best_label' ] [ 'name' ]
short_docstring: Tells the colour of the traffic light
short_docstring_tokens: Tells the colour of the traffic light
comment: """
          Tells the colour of the traffic light
          :return: color detected
          """