Return a mode value that is predictable
774875
def _refine_mode(mode):
    '''
    
    '''
    mode = six.text_type(mode).lower()
    if any([mode.startswith('e'),
            mode == '1',
            mode == 'on']):
        return 'Enforcing'
    if any([mode.startswith('p'),
            mode == '0',
            mode == 'off']):
        return 'Permissive'
    if any([mode.startswith('d')]):
        return 'Disabled'
    return 'unknown'
869962
function opt(argv, arg, index, key) {
    var value = argv[index + 1], equals = arg.indexOf('=');
    if(equals > -1) {
      value = arg.substr(equals + 1);
    }
    if(value && ~keys.indexOf(value)) {
      return value;
    }
    if(arg === option[key]) {
      return modes[key];
    }
  }
306794
def mode_number(self, rows: List[Row], column: NumberColumn) -> Number:
        
        most_frequent_list = self._get_most_frequent_values(rows, column)
        if not most_frequent_list:
            return 0.0  # type: ignore
        most_frequent_value = most_frequent_list[0]
        if not isinstance(most_frequent_value, Number):
            raise ExecutionError(f"Invalid valus for mode_number: {most_frequent_value}")
        return most_frequent_value
86983
def _check_constant_value_data(self, data):
        """"""

        arrayval = data.flat[0]
        if np.all(data == arrayval):
            return arrayval
        return None
997695
def _check_modes(self, modes):
        """"""
        if not isinstance(modes, (tuple, list, set)):
            modes = [modes]
        if self.mode not in modes:
            raise ValueError("Image not in suitable mode, expected: %s, got: %s" % (modes, self.mode))
491550
def pre_operations(self, mode=None):
        
        version_mode = self._get_version_mode(mode=mode)
        return version_mode.pre_operations
1186615
def a_expected_prompt(ctx):
    """"""
    prompt = ctx.ctrl.match.group(0)
    ctx.device.update_driver(prompt)
    ctx.device.update_config_mode()
    ctx.device.update_hostname()
    ctx.finished = True
    return True
291766
def __dynamic_expected_value(self, y):
        

        return self.model.predict(self.data, np.ones(self.data.shape[0]) * y, output=self.model_output).mean(0)
1090013
def _checkMode(self, ax_args):
        
        mode = ax_args.get('mode')
        if isinstance(mode, bytes):
            mode = str(mode, encoding="utf-8")
        if mode != self.mode:
            if not mode:
                raise NotAXMessage()
            else:
                raise AXError('Expected mode %r; got %r' % (self.mode, mode))
443843
def get_default_val(self):
        """"""
        val = self.default
        while callable(val):
            val = val()
        return val
336489
def valid_modes(self):
        """"""
        default_mode = (self.mode,) if self.mode is not None else None
        return getattr(self, '_valid_mode', default_mode)
1310521
function mode() {
      var value = (attr.mdMode || "").trim();
      if (value) {
        switch (value) {
          case MODE_DETERMINATE:
          case MODE_INDETERMINATE:
          case MODE_BUFFER:
          case MODE_QUERY:
            break;
          default:
            value = MODE_INDETERMINATE;
            break;
        }
      }
      return value;
    }
712787
def wait_for_mode(self, mode, timeout=None):
        '''
        '''

        if not isinstance(mode, VehicleMode):
            mode = VehicleMode(mode)

        self.mode = mode

        self.wait_for(lambda: self.mode.name == mode.name,
                      timeout=timeout,
                      errmsg='failed to set flight mode')
1048955
def _match_modes(self, remote_path, l_st):
        """"""
        self.sftp.chmod(remote_path, S_IMODE(l_st.st_mode))
        self.sftp.utime(remote_path, (l_st.st_atime, l_st.st_mtime))

        if self.chown:
            self.sftp.chown(remote_path, l_st.st_uid, l_st.st_gid)
399910
function subMode(lexeme, mode) {
    var values = mode.contains
    var length = values.length
    var index = -1

    while (++index < length) {
      if (test(values[index].beginRe, lexeme)) {
        return values[index]
      }
    }
  }
796026
def get_value(repo_directory, key, expect_type=None):
    """"""
    config = read_config(repo_directory)
    value = config.get(key)
    if expect_type and value is not None and not isinstance(value, expect_type):
        raise ConfigSchemaError('Expected config variable %s to be type %s, got %s'
            % (repr(key), repr(expect_type), repr(type(value))))
    return value
578872
def damping(self):
        """"""
        try:
            value = self._damping.value
        except AttributeError:
            value = self._damping
        return value