Resets the tracking for the motor position.

 @param [Symbol] port The port the motor is attached to. Should be `:a`, `:b`, or `:c`
 @param [Boolean] set_relative Sets the position tracking to relative if true, otherwise absolute if false.
 @return [nil]
489103
def reset_motor_position port, set_relative
      transmit(
        DirectOps::NO_RESPONSE,
        DirectOps::RESETMOTORPOSITION,
        normalize_motor_port(port),
        normalize_boolean(set_relative)
      )
    end
791373
def __Port_spinBox_set_ui(self):
        

        # Adding settings key if it doesn't exists.
        self.__settings.get_key(self.__settings_section, "port").isNull() and \
        self.__settings.set_key(self.__settings_section, "port", self.__port)

        port = foundations.common.get_first_item(self.__settings.get_key(self.__settings_section, "port").toInt())
        LOGGER.debug("> Setting '{0}' with value '{1}'.".format("Port_spinBox",
                                                                port))
        self.Port_spinBox.setValue(port)
        self.__port = port
1217568
def _set_speed(self, motor, speed):
        
        self._validate_motor(motor)
        en, in1, in2 = self._motors[motor-1]

        if speed == 0:
            en.pwm_stop()
            in1.set(False)
            in2.set(False)
        elif speed > 0:
            en.pwm_start(abs(speed))
            in1.set(True)
            in2.set(False)
        else:
            en.pwm_start(abs(speed))
            in1.set(False)
            in2.set(True)
603497
def remote_port_uneq_store(self, remote_port):
        
        if remote_port != self.remote_port:
            self.remote_port = remote_port
            return True
        return False
596265
def set_ports(self, port0 = 0x00, port1 = 0x00):
        ''
        self.bus.write_byte_data(self.address, self.CONTROL_PORT0, port0)
        self.bus.write_byte_data(self.address, self.CONTROL_PORT0, port1)
        return
331954
def sweep(port, rate, ID, retry=3):
	
	if port == 'dummy':
		s = ServoSerial(port, rate, fake=True)
	else:
		s = ServoSerial(port, rate)

	if ID < 0:
		ID = xl320.XL320_BROADCAST_ADDR

	try:
		s.open()
	except SerialException as e:
		# print('Error opening serial port:')
		print('-'*40)
		print(sys.argv[0], ':')
		print(e)
		exit(1)

	pkt = makePingPacket(ID)
	# print('ping', pkt)
	s.write(pkt)

	# as more servos add up, I might need to increase the cnt number???
	for cnt in range(retry):
		ans = s.read()

		if ans:
			for pkt in ans:
				servo = packetToDict(pkt)
				utils.prettyPrintPacket(servo)
				print('raw pkt: {}'.format(pkt))
		else:
			print('Try {}: no servos found'.format(cnt))

		time.sleep(0.1)

	s.close()
976839
public void reset() {
		trackerLeft.reset();
		trackerRight.reset();
		keyToWorld.reset();
		currToKey.reset();
		first = true;
		tick = 0;
	}
1108763
def set_trace(addr=DEFAULT_ADDR, port=DEFAULT_PORT):
    
    atexit.register(close_port, port)
    try:
        log("Starting a remote python debugger session on %s:%s" % (addr,
                                                                    port))
        open_port(port)
        debugger = Rpdb(addr=addr, port=port)
        debugger.set_trace(sys._getframe().f_back)
    except Exception:
        _error("Cannot start a remote debug session on %s:%s" % (addr,
                                                                 port))
422079
public function setPort($port)
    {
        if ( ! is_null($port)) $port = (int) $port;

        $this->setAttribute('port', $port);

        return $this;
    }
147352
def set_destination_data!
      route_info = Rails.application.routes.recognize_path self.path
      self.controller = route_info[:controller]
      self.action = route_info[:action]
      self.defaults = route_info.reject { |k, v| [:controller, :action].include? k }
    end
1304624
function move (leftPort, rightPort) {
  leftPort = leftPort || 'b'
  rightPort = rightPort || 'c'
  var write = writeAction('motors_write', [leftPort, rightPort])
  /**
   * Run motors forever
   * @param  {Number} speed speed of motor
   * @param  {Object} opts  object of optional params
   */
  function * forever (speed, turn, opts) {
    speed = speed || motorDefaults.speed
    var speeds = turnToSpeeds(turn, speed)

    yield write('run-forever', {
      left: {
        'speed_sp': speeds.left.toString()
      }, right: {
        'speed_sp': speeds.right.toString()
      }
    })
  }

  /**
   * Run drive motors for a number of degrees
   * @param  {Number} degrees degrees to turn motor
   * @param  {Number} speed   speed at which to turn motors
   * @param  {Number} turn    turn direction
   */
  function * degrees (deg, speed, turn) {
    speed = speed || motorDefaults.speed

    var opts = turnToDegrees(turn, speed, deg)
    yield * writeAndWait('run-to-rel-pos', {
      left: {
        'position_sp': opts.left.degrees.toString(),
        'speed_sp': opts.left.speed.toString()
      },
      right: {
        'position_sp': opts.right.degrees.toString(),
        'speed_sp': opts.right.speed.toString()
      }
    })
  }

  /**
   * Run drive motors for a number of rotations
   * @param  {Number} rotations number of rotations to turn the motor
   * @param  {Number} speed     speed at which to turn motors
   * @param  {Number} turn      turn direction
   */
  function * rotations (rots, speed, turn) {
    speed = speed || motorDefaults.speed
    yield * this.degrees(Math.round(rots * 360), speed, turn)
  }

  /**
   * Run drive motors for a specified amount of time
   * @param  {Number} time  time to run the motors for (in milliseconds)
   * @param  {Number} speed speed at which to turn motors
   * @param  {Number} turn  turn direction
   */
  function * timed (time, speed, turn) {
    speed = speed || motorDefaults.speed

    var speeds = turnToSpeeds(turn, speed)
    yield * writeAndWait('run-timed', {
      left: {
        'time_sp': time.toString(),
        'speed_sp': speeds.left.toString()
      },
      right: {
        'time_sp': time.toString(),
        'speed_sp': speeds.right.toString()
      }
    })
  }

  /**
   * Stops motors
   */
  function * stop () {
    yield write('stop', {left: {}, right: {}})
  }

  /**
   * Write and hold execution until the motors are done moving
   * @param  {string} command move command
   * @param  {object} opts    move options
   */
  function * writeAndWait (command, opts) {
    var ran = false
    yield write(command, opts)
    while (true) {
      var devices = yield * read()
      if (devices.motor(leftPort) === 'running' || devices.motor(rightPort) === 'running') {
        ran = true
      }
      if (devices.motor(leftPort) === '' && devices.motor(rightPort) === '' && ran) {
        break
      }
    }
  }

  return {
    forever: forever,
    degrees: degrees,
    rotations: rotations,
    timed: timed,
    stop: stop
  }
}
794019
def _connect_temporarily(self, port_v, target=True):
        
        if target:
            handle = self._connection_v.to_handle()
        else:
            handle = self._connection_v.from_handle()
        port_v.add_connected_handle(handle, self._connection_v, moving=True)
        port_v.tmp_connect(handle, self._connection_v)
        self._connection_v.set_port_for_handle(port_v, handle)
        # Redraw state of port to make hover state visible
        self._redraw_port(port_v)
310852
def clear_port_stats(self):
        
        stat = IxeStat(self)
        stat.ix_set_default()
        stat.enableValidStats = True
        stat.ix_set()
        stat.write()
1344685
function motor (port) {
  port = port || 'a'
  var write = writeAction('motor_write', port)

  /**
   * Run motor forever
   * @param  {Number} speed speed of motor
   * @param  {Object} opts  object of optional params
   */
  function * forever (speed, opts) {
    speed = speed || motorDefaults.speed
    speed = percentToSpeed(speed)

    yield write('run-forever', {
      'speed_sp': speed.toString()
    })
  }

  /**
   * Run motor for a number of degrees
   * @param  {Number} degrees degrees to turn motor
   * @param  {Number} speed   speed at which to turn motors
   */
  function * degrees (deg, speed) {
    speed = speed || motorDefaults.speed
    speed = percentToSpeed(speed)

    yield * writeAndWait('run-to-rel-pos', {
      'position_sp': deg.toString(),
      'speed_sp': speed.toString()
    })
  }

  /**
   * Run motor for a number of rotations
   * @param  {Number} rotations number of rotations to turn the motor
   * @param  {Number} speed     speed at which to turn motors
   */
  function * rotations (rots, speed) {
    speed = speed || motorDefaults.speed
    yield * this.degrees(Math.round(rots * 360), speed)
  }

  /**
   * Run drive motors for a specified amount of time
   * @param  {Number} time  time to run the motors for (in milliseconds)
   * @param  {Number} speed speed at which to turn motors
   */
  function * timed (time, speed) {
    speed = speed || motorDefaults.speed
    speed = percentToSpeed(speed)

    yield * writeAndWait('run-timed', {
      'time_sp': time.toString(),
      'speed_sp': speed.toString()
    })
  }

  /**
   * Stops motors
   */
  function * stop () {
    yield write('stop')
  }

 /**
  * Write and hold execution until the motor are done moving
  * @private
  * @param  {string} command move command
  * @param  {object} opts    move options
  */
  function * writeAndWait (command, opts) {
    var ran = false
    yield write(command, opts)
    while (true) {
      var devices = yield read()
      if (devices.motor(port) === 'running') {
        ran = true
      }
      if (devices.motor(port) === '' && ran) {
        break
      }
    }
  }

  /**
   * @typedef {object} MoveFunctions
   * @property {function} forever     {@link forever}
   * @property {function} degrees     {@link degrees}
   * @property {function} rotations   {@link rotations}
   * @property {function} timed       {@link timed}
   * @property {function} Stops       {@link stop}
   */
  return {
    forever: forever,
    degrees: degrees,
    rotations: rotations,
    timed: timed,
    stop: stop
  }
}
480276
def _validate_rpc_port(port):
    
    if not port:
        raise NetworkControllerError(desc='Invalid rpc port number.')
    if isinstance(port, str):
        port = int(port)

    if port <= 0:
        raise NetworkControllerError(desc='Invalid rpc port number %s' % port)
    return port
615475
def remove_port_callback(self, port, cb):
        """"""
        logger.debug('Removing callback on port [%d] to [%s]', port, cb)
        for port_callback in self.cb:
            if port_callback.port == port and port_callback.callback == cb:
                self.cb.remove(port_callback)
752762
func (s *RestoreDBInstanceToPointInTimeInput) SetPort(v int64) *RestoreDBInstanceToPointInTimeInput {
	s.Port = &v
	return s
}