Gets the error correction level
516934
function _getErrorCorrectLevel(ecl) {
    switch (ecl) {
        case "L":
          return QRErrorCorrectLevel.L;

        case "M":
          return QRErrorCorrectLevel.M;

        case "Q":
          return QRErrorCorrectLevel.Q;

        case "H":
          return QRErrorCorrectLevel.H;

        default:
          throw new Error("Unknown error correction level: " + ecl);
      }
  }
457695
def get_error_hint(ctx, opts, exc):
    """"""
    module = sys.modules[__name__]
    get_specific_error_hint = getattr(module, "get_%s_error_hint" % exc.status, None)
    if get_specific_error_hint:
        return get_specific_error_hint(ctx, opts, exc)
    return None
35198
def get_error(self):
        """"""
        exc_info = sys.exc_info()
        if exc_info[0] is None:
            return None
        else:
            err_type, err_value, err_trace = exc_info[0], exc_info[1], None
            if self.verbose and len(exc_info) > 2:
                err_trace = exc_info[2]
            return format_error(err_type, err_value, err_trace)
1046493
def _get_fault_mechanism_flags(self, rake):
        

        CN, CR = 0, 0

        # Pure Normal: rake = -90
        if rake > -147 and rake < -33:
            CN = -1

        # Pure Reverse: rake = 90
        if rake > 67 and rake < 123:
            CR = 1

        # Pure Oblique Reverse: rake = 45
        if rake > 33 and rake < 66:
            CR = 0.5

        return CN, CR
654664
public String getError() {
    if (GoldenGrammarError_Type.featOkTst
        && ((GoldenGrammarError_Type) jcasType).casFeat_error == null)
      jcasType.jcas.throwFeatMissing("error", "cogroo.uima.GoldenGrammarError");
    return jcasType.ll_cas.ll_getStringValue(addr,
        ((GoldenGrammarError_Type) jcasType).casFeatCode_error);
  }
1247232
private int getMinErrorRateWindowSize() {

		int numSamples = this.stm.numInstances();
		if (numSamples < 2 * this.minSTMSizeOption.getValue()) {
			return numSamples;
		} else {
			List<Integer> numSamplesRange = new ArrayList<>();
			numSamplesRange.add(numSamples);
			while (numSamplesRange.get(numSamplesRange.size() - 1) >= 2 * this.minSTMSizeOption.getValue())
				numSamplesRange.add(numSamplesRange.get(numSamplesRange.size() - 1) / 2);

			Iterator it = this.predictionHistories.keySet().iterator();
			while (it.hasNext()) {
				Integer key = (Integer) it.next();
				if (!numSamplesRange.contains(numSamples - key)) {
					it.remove();
				}
			}
			List<Double> errorRates = new ArrayList<>();
			for (Integer numSamplesIt : numSamplesRange) {
				int idx = numSamples - numSamplesIt;
				List<Integer> predHistory;
				if (this.predictionHistories.containsKey(idx)) {
					predHistory = this.getIncrementalTestTrainPredHistory(this.stm, idx, this.predictionHistories.get(idx));
				} else {
					predHistory = this.getTestTrainPredHistory(this.stm, idx);
				}
				this.predictionHistories.put(idx, predHistory);
				errorRates.add(this.getHistoryErrorRate(predHistory));
			}
			int minErrorRateIdx = errorRates.indexOf(Collections.min(errorRates));
			int windowSize = numSamplesRange.get(minErrorRateIdx);
			if (windowSize < numSamples) {
				this.adaptHistories(minErrorRateIdx);
			}
			return windowSize;
		}
	}
294866
def getPropErrorNameFromEnum(self, error):
        

        fn = self.function_table.getPropErrorNameFromEnum
        result = fn(error)
        return result
1093910
def _check_err(data):
    
    if data['d'] is None:
        raise NoDataReturned()
    if data['d']['Messages'] is None:
        return

    msg = data['d']['Messages']
    if len(msg) == 0 or msg[0]['Code'] is None:
        raise UnknownError()

    code = int(msg[0]['Code'])
    if code == 3006:
        raise CalendarNotExist()
    elif code == 3007:
        raise CalendarOwnByDiffAccount()
    else:
        logger.warn(
            "Unexpected Error Code: %s %s" % (
                code, msg[0]['Description']))
        raise UnexpectedError()
693558
def get_precision(self):
        
        assert self.classifier is not None, 'not calibrated'
        arr = np.zeros((self._som.nrows, self._som.ncols))
        for ij, (lbl, p) in self.classifier.items():
            arr[ij] = p
        return arr
210068
def get_signum(val, err, max_sig=numpy.inf):
    
    coeff, pwr = ('%e' % err).split('e')
    if pwr.startswith('-'):
        pwr = int(pwr[1:])
        if round(float(coeff)) == 10.:
            pwr -= 1
        pwr = min(pwr, max_sig)
        tmplt = '%.' + str(pwr+1) + 'f'
        return tmplt % val
    else:
        pwr = int(pwr[1:])
        if round(float(coeff)) == 10.:
            pwr += 1
        # if the error is large, we can sometimes get 0;
        # adjust the round until we don't get 0 (assuming the actual
        # value isn't 0)
        return_val = round(val, -pwr+1)
        if val != 0.:
            loop_count = 0
            max_recursion = 100
            while return_val == 0.:
                pwr -= 1
                return_val = round(val, -pwr+1)
                loop_count += 1
                if loop_count > max_recursion:
                    raise ValueError("Maximum recursion depth hit! Input " +\
                        "values are: val = %f, err = %f" %(val, err))
        return drop_trailing_zeros(return_val)
1216438
private int getLevel(final Level recordLevel) {
    if (recordLevel.equals(Level.OFF)) {
      return 0;
    } else if (recordLevel.equals(Level.SEVERE)) {
      return 1;
    } else if (recordLevel.equals(Level.WARNING)) {
      return 2;
    } else if (recordLevel.equals(Level.ALL)) {
      return 4;
    } else {
      return 3;
    }
  }
333809
def _find_error(vals):
    

    err_vals = []
    for en in vals:
        c = en[2]
        conc = [float(i)/sum(c) for i in c]

        err = abs(en[0]-en[1])

        err_vals.append([conc,err])

    return err_vals
291579
def get_last_error(self):
        
        error = ctypes.c_int32()
        result = self.library.Par_GetLastError(self.pointer, ctypes.byref(error))
        check_error(result, "partner")
        return error
916184
private static function catchError()
    {
        switch (json_last_error()) {
            case JSON_ERROR_NONE:
                self::$error = false;
                break;
            case JSON_ERROR_DEPTH:
                self::$error = 'Maximum stack depth exceeded';
                break;
            case JSON_ERROR_STATE_MISMATCH:
                self::$error = 'Underflow or the modes mismatch';
                break;
            case JSON_ERROR_CTRL_CHAR:
                self::$error = 'Unexpected control character found';
                break;
            case JSON_ERROR_SYNTAX:
                self::$error = 'Syntax error, malformed JSON';
                break;
            case JSON_ERROR_UTF8:
                self::$error = 'Malformed UTF-8 characters, possibly incorrectly encoded';
                break;
            default:
                self::$error = 'Unknown error';
                break;
        }
    }
1038616
def extract_status_code(error):
    
    try:
        return int(error.code)
    except (AttributeError, TypeError, ValueError):
        try:
            return int(error.status_code)
        except (AttributeError, TypeError, ValueError):
            try:
                return int(error.errno)
            except (AttributeError, TypeError, ValueError):
                return 500
1310355
@VisibleForTesting
  static Level getLogLevel(Throwable t) {
    if (t instanceof IOException && t.getMessage() != null) {
      for (String msg : QUIET_ERRORS) {
        if (t.getMessage().equals(msg)) {
          return Level.FINE;
        }
      }
    }
    return Level.INFO;
  }
573270
public double errorSum() {
        if (isLeaf()) {
            return 0.0;
        } else if (isPreTerminal()) {
            return error();
        } else {
            double error = 0.0;
            for (Tree child : children()) {
                error += child.errorSum();
            }
            return error() + error;
        }
    }