code: def set_pin_mode(self, pin_number, pin_state, callback=None, cb_type=None):
          
          task = asyncio.ensure_future(self.core.set_pin_mode(pin_number, pin_state, callback, cb_type))
          self.loop.run_until_complete(task)
docs: This method sets the  pin mode for the specified pin.
  
          :param pin_number: Arduino Pin Number
  
          :param pin_state: INPUT/OUTPUT/ANALOG/PWM/PULLUP - for SERVO use
                            servo_config()
  
          :param callback: Optional: A reference to a call back function to be
                           called when pin data value changes
  
          :param cb_type: Constants.CB_TYPE_DIRECT = direct call or
                          Constants.CB_TYPE_ASYNCIO = asyncio coroutine
  
          :returns: No return value