Try to translate 3-bit CRID to 2-bit version stored in the map

@param cuData the cultivar data record
@param id the field id for contain crop id info
@param defVal the default value when id is not available
@return 2-bit crop ID
765586
private String translateTo2BitCrid(Map cuData, String id, String defVal) {
        String crid = getValueOr(cuData, id, "");
        if (!crid.equals("")) {
            return DssatCRIDHelper.get2BitCrid(crid);
        } else {
            return defVal;
        }
    }
997515
def cred_def_id2seq_no(cd_id: str) -> int:
    

    if ok_cred_def_id(cd_id):
        return int(cd_id.split(':')[3])  # sequence number is token at 0-based position 3
    raise BadIdentifier('Bad credential definition identifier {}'.format(cd_id))
518712
public static function op_IntegerDivide( $val1, $val2 )
	{
		switch ( ValueProxy::$conv_t[ $val1->GetValueCode() ][ $val2->GetValueCode() ] )
		{
			case -1:
				return $val2->Promote( $val1 )->IDiv( $val2 );

			case 0:
				return $val1->IDiv( $val2 );

			case 1:
				return $val1->IDiv( $val1->Promote( $val2 ) );

			default:
				if ( ValueProxy::$conv_t[ $val2->GetValueCode() ][ $val1->GetValueCode() ] == 1 )
					return $val2->Promote( $val1 )->IDiv( $val2 );

				throw XPath2Exception::withErrorCodeAndParams( "XPTY0004", Resources::BinaryOperatorNotDefined,
					array(
						"op:idiv",
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $val1 ), XmlTypeCardinality::One ),
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $val2 ), XmlTypeCardinality::One )
					)
				);
		}
	}
453880
protected String getID(int cv, Point<Object> values) {
    String	result;
    int	i;

    result = "" + cv;

    for (i = 0; i < values.dimensions(); i++)
      result += "\t" + values.getValue(i);

    return result;
  }
708704
public static int getId(Context context, String id, String defType) {
        String type = "R." + defType + ".";
        if (id.startsWith(type)) {
            id = id.substring(type.length());
        }

        Resources r = context.getResources();
        int resId = r.getIdentifier(id, defType,
                context.getPackageName());
        if (resId > 0) {
            return resId;
        } else {
            throw new RuntimeAssertion("Specified resource '%s' could not be found", id);
        }
    }
428139
def indexdelta(self, stop_id, start_id):
        
        return self.tokenid2index(stop_id) - self.tokenid2index(start_id)
809241
function (def) {

                // prepare error stack
                this._errors = [];

                var beans = def.$beans;
                for (var beanName in beans) {
                    if (!beans.hasOwnProperty(beanName) || beanName.indexOf(':') != -1) {
                        continue;
                    }
                    // check that keys for beans are valid
                    if (!Aria.checkJsVarName(beanName)) {
                        this._logError(this.INVALID_NAME, [beanName, this._currentBeanName]);
                    }
                    this._preprocessBean(beans[beanName], def.$package + "." + beanName, def);
                }

                // Generate fast normalization functions at the end:
                var toGenerateFastNorm = this.__toGenerateFastNorm;
                while (toGenerateFastNorm.length > 0) {
                    var beanDef = toGenerateFastNorm.shift();
                    var baseType = beanDef[this._MD_BASETYPE];

                    if (baseType.makeFastNorm) {
                        // generate fast normalizer
                        baseType.makeFastNorm(beanDef);
                    }
                }

                return this._errors;
            }
202146
private void loadID3v2(InputStream in)
	{		
		int size = -1;
		try
		{
			// Read ID3v2 header (10 bytes).
			in.mark(10);			
			size = readID3v2Header(in);
			header_pos = size;			
		}
		catch (IOException e)
		{}
		finally
		{
			try
			{
				// Unread ID3v2 header (10 bytes).
				in.reset();
			}
			catch (IOException e)
			{}
		}
		// Load ID3v2 tags.
		try
		{
			if (size > 0)
			{
				rawid3v2 = new byte[size];
				in.read(rawid3v2,0,rawid3v2.length);
			}			
		}
		catch (IOException e)
		{}
	}
1243433
function id(d) {

    if (!d.d3plus.id) {
      d.d3plus.id = "";
      for (var i = 0; i <= vars.depth.value; i++) {
        d.d3plus.id += fetchValue(vars,d,vars.id.nesting[i])+"_"
      }

      d.d3plus.id += shape;

      ["x", "y", "x2", "y2"].forEach(function(axis){
        if (vars[axis].scale.value == "discrete") {
          var val = fetchValue(vars, d, vars[axis].value)
          if (val.constructor === Date) val = val.getTime()
          d.d3plus.id += "_"+val
        }
      })

      if (d.d3plus.suffix) {
        d.d3plus.id += "_" + d.d3plus.suffix;
      }

      d.d3plus.id = stringStrip(d.d3plus.id)
    }

    return d
  }
735639
public static void insertFromDevVarDoubleStringArray(final DevVarDoubleStringArray value,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {
	if (dataType == TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY) {
	    deviceDataArgin.insert(value);
	} else {
	    Except
		    .throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
			    + deviceDataArgin.getType() + " not supported",
			    "CommandHelper.insertFromDevVarDoubleStringArray(DevVarDoubleStringArray value,deviceDataArgin)");
	}
    }
338484
function normalizeId(idFromRoot, root) {
  var id = idFromRoot.substring().trim();
  if (root && id.length > 0 && id[0] === '/') {
    id = id.substring(1);
  }
  id = root + id;
  return id;
}
971099
public void cdataProperty(final QName tag, final String val) throws IOException {
    blanks();
    openTagSameLine(tag);
    cdataValue(val);
    closeTagSameLine(tag);
    newline();
  }
955092
public static void insertFromDevState(final DevState devStateValue,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {

	final Integer integerValue = Integer.valueOf(devStateValue.value());
	switch (deviceDataArgin.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    deviceDataArgin.insert_us(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_CHAR not supported",
		    "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_LONG:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    deviceDataArgin.insert_ul(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    deviceDataArgin.insert_u64(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_INT:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    deviceDataArgin.insert(integerValue.floatValue());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    deviceDataArgin.insert(integerValue.doubleValue());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    deviceDataArgin.insert(integerValue.toString());
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    if (integerValue.doubleValue() == 1) {
		deviceDataArgin.insert(true);
	    } else {
		deviceDataArgin.insert(false);
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    deviceDataArgin.insert(devStateValue);
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
		    + deviceDataArgin.getType() + " not supported",
		    "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)");
	    break;
	}
    }
230608
@SuppressWarnings("unchecked")
	public <T> DataSet<T> getDataSet(int id) {
		return verifyType(id, dataSets.get(id), SetType.DATA_SET);
	}
1332874
public static String setProperty(String value, String defValue) {
        if (value != null && !"".equals(value)) {
            return value;
        }
        return defValue;
    }
375813
public int (final DeviceAttribute da, final boolean fwd) throws DevFailed {
	final int rid = _i(da, fwd, next_req_id());
	arp.put(new Integer(rid), new Boolean(fwd));
	return rid;
    }
935437
public static DoubleDBIDPair newPair(double val, DBIDRef id) {
    return DBIDFactory.FACTORY.newPair(val, id);
  }