Params:
            action           - start or stop
            channel          - channel number
            vertical_speed   - range is 1-8
            horizontal_speed - range is 1-8
169406
def move_right_down(self, action=None, channel=0,
                        vertical_speed=1, horizontal_speed=1):
        

        ret = self.command(
            'ptz.cgi?action={0}&channel={1}&code=RightDown&arg1=0'
            '&arg2={2}&arg3=0'.format(action, channel, vertical_speed)
        )
        return ret.content.decode('utf-8')
346047
def go_to_preset(self, action=None, channel=0, preset_point_number=1):
        
        ret = self.command(
            'ptz.cgi?action={0}&channel={1}&code=GotoPreset&arg1=0'
            '&arg2={2}&arg3=0'.format(action, channel, preset_point_number)
        )
        return ret.content.decode('utf-8')
89926
def _action_allowed(self, action):
    
    if getattr(self.layer.participation_settings, '{0}_allowed'.format(action)) is False:
        return False
    else:
        return getattr(self.participation_settings, '{0}_allowed'.format(action))
740607
def select_action(self, q_values):
        
        assert q_values.ndim == 1
        action = np.argmax(q_values)
        return action
1340808
def step(self, action):
    """"""
    total_reward = 0.0
    done = None
    for i in range(self._skip):
      obs, reward, done, info = self.env.step(action)
      if i == self._skip - 2:
        self._obs_buffer[0] = obs
      if i == self._skip - 1:
        self._obs_buffer[1] = obs
      total_reward += reward
      if done:
        break
    # Note that the observation on the done=True frame doesn't matter.
    max_frame = self._obs_buffer.max(axis=0)
    return max_frame, total_reward, done, info
924776
def frame(self, action):
        '''
        '''
        choices = {'on': '1',
                   'off': '0'}
        if action in choices:
            self.send(chr(27)+'if'+choices[action])
        else:
            raise RuntimeError('Invalid action for function frame, choices are on and off')
1210093
def max_action_length
      @max_action_length ||= actions.reduce(0) { |m, a| [m, a.to_s.length].max }
    end
433315
function range(start, stop, step){
  utils.assertType(start, 'unit', 'start');
  utils.assertType(stop, 'unit', 'stop');
  if (step) {
    utils.assertType(step, 'unit', 'step');
    if (0 == step.val) {
      throw new Error('ArgumentError: "step" argument must not be zero');
    }
  } else {
    step = new nodes.Unit(1);
  }
  var list = new nodes.Expression;
  for (var i = start.val; i <= stop.val; i += step.val) {
    list.push(new nodes.Unit(i, start.type));
  }
  return list;
}
1173249
def run(action: str, args: dict) -> int:
    
    if args.get('show_version_info'):
        return run_version(args)

    actions = dict(
        shell=run_shell,
        kernel=run_kernel,
        serve=run_kernel,
        version=run_version
    )

    if action not in actions:
        print('[ERROR]: Unrecognized sub command "{}"'.format(action))
        parser = args['parser']  # type: ArgumentParser
        parser.print_help()
        return 1

    return actions.get(action)(args)
1074503
def double_strike(self, action):
        '''
        '''
        if action == 'on':
            action = 'G'
        elif action == 'off':
            action = 'H'
        else:
            raise RuntimeError('Invalid action for function doubleStrike. Options are on and off')
        self.send(chr(27)+action)
643719
def send_action(action, channel = nil, data = {})
      data = data.is_a?(Hash) ? data : {}
      publishing_data = { 'client_action' => action, 'channel' => channel, 'data' => data }.reject { |_key, value| value.blank? }
      async.chat(publishing_data)
    end
1100133
def run(action, args)
      args = args.respond_to?(:fixed_flatten) ? args.fixed_flatten(1) : args.flatten(1)
      begin
        unless(@action_timeout.zero?)
          Timeout::timeout(@action_timeout) do
            action.call(*args)
          end
        else
          action.call(*args)
        end
      rescue Timeout::Error => boom
        @logger.warn("Pool thread reached max execution time for action: #{boom}")
        raise boom
      end
    end
1234274
public void parameterizeChannel(Channel channel) {
		LocalProperties current = channel.getLocalProperties();
		
		if (isMetBy(current)) {
			// we are met, all is good
			channel.setLocalStrategy(LocalStrategy.NONE);
		}
		else if (this.ordering != null) {
			channel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections());
		}
		else if (this.groupedFields != null) {
			boolean[] dirs = new boolean[this.groupedFields.size()];
			Arrays.fill(dirs, true);
			channel.setLocalStrategy(LocalStrategy.SORT, Utils.createOrderedFromSet(this.groupedFields), dirs);
		}
		else {
			channel.setLocalStrategy(LocalStrategy.NONE);
		}
	}
601968
def perform(action, options = {})
      return unless %i[
        backtrace
        down
        finish
        frame
        next
        step
        up
      ].include?(action)

      send("perform_#{action}", options)
    end
1335988
def add_range(self, start, stop, step=1, pad=0):
        
        assert start < stop, "please provide ordered node index ranges"
        assert step > 0
        assert pad >= 0
        assert stop - start < 1e9, "range too large"

        if pad > 0 and self.padding is None:
            self.padding = pad
        set.update(self, range(start, stop, step))
818443
def ipop_range(self, start=0, stop=-1, callback=None, withscores=True):
        ''''''
        backend = self.backend
        res = backend.structure(self).ipop_range(start, stop,
                                                 withscores=withscores)
        if not callback:
            callback = self.load_data if withscores else self.load_values
        return backend.execute(res, callback)
307861
def set_current_limit(self, value, channel=1):
        
        cmd = "I%d %f" % (channel, value)
        self.write(cmd)