Get a single OID value.
428159
def get(self, oid):
        
        snmpsecurity = self._get_snmp_security()

        try:
            engine_error, pdu_error, pdu_error_index, objects = self._cmdgen.getCmd(
                snmpsecurity,
                cmdgen.UdpTransportTarget((self.host, self.port), timeout=self.timeout,
                                          retries=self.retries),
                oid,
            )

        except Exception as e:
            raise SNMPError(e)
        if engine_error:
            raise SNMPError(engine_error)
        if pdu_error:
            raise SNMPError(pdu_error.prettyPrint())

        _, value = objects[0]
        value = _convert_value_to_native(value)
        return value
526946
def get_value(self):
        """"""

        if self.data_type == self.BOOLEAN_TYPE:
            return self.value_boolean
        elif self.data_type == self.NUMBER_TYPE:
            return self.value_number
        elif self.data_type == self.SSH_KEY_TYPE:
            return self.value_ssh_key.private_key_file._get_path()
        else:
            return self.value
1319147
private Properties getObjectMetadata(String oid) {
		try {
			DigitalObject object = storage.getObject(oid);
			return object.getMetadata();
		} catch (StorageException ex) {
			log.error("Error accessing object '{}' in storage: ", oid, ex);
			return null;
		}
	}
967215
def oid(v = nil)
      return BSON::ObjectId.new if v.nil?; BSON::ObjectId.from_string(v) rescue v
    end
68055
def get_next(self,oid):
		""""""
		try: # Nested try..except because of Python 2.4
			self.lock.acquire()
			try:
				# remove trailing zeroes from the oid
				while len(oid) > 0 and oid[-2:] == ".0" and oid not in self.data:
					oid = oid[:-2];
				return self.get(self.data_idx[self.data_idx.index(oid)+1])
			except ValueError:
				# Not found: try to match partial oid
				for real_oid in self.data_idx:
					if real_oid.startswith(oid):
						return self.get(real_oid)
				return "NONE" # Unknown OID
			except IndexError:
				return "NONE" # End of MIB
		finally:
			self.lock.release()
610128
public static String getDigest(String oid) {
        String ret = (String)digestNames.get(oid);
        if (ret == null)
            return oid;
        else
            return ret;
    }
702901
def get_ioos_def(self, ident, elem_type, ont):
        """"""
        if elem_type == "identifier":
            getter_fn = self.system.get_identifiers_by_name
        elif elem_type == "classifier":
            getter_fn = self.system.get_classifiers_by_name
        else:
            raise ValueError("Unknown element type '{}'".format(elem_type))
        return DescribeSensor.get_named_by_definition(
            getter_fn(ident), urljoin(ont, ident)
        )
397602
def individual(self, ind_id):
        """"""
        ind_obj = self.query(Individual).filter_by(ind_id=ind_id).first()
        if ind_obj is None:
            ind_obj = BaseIndividual(ind_id='unknown')
        return ind_obj
974527
def uuid(self, value):
        """"""
        if value is not None:
            self.keystore['id'] = value
        elif 'id' in self.keystore:
            self.keystore.pop('id')
208388
function readObjectIdentifier(s, oid) {
	var size = readLength(s);
	if(size !== 5) {
		return false;
	}

	var a_oid = [0, 0, 0, 0, 0, 0];
	var t12 = new type.UInt8().read(s).value;
	a_oid[0] = t12 >> 4;
	a_oid[1] = t12 & 0x0f;
	a_oid[2] = new type.UInt8().read(s).value;
	a_oid[3] = new type.UInt8().read(s).value;
	a_oid[4] = new type.UInt8().read(s).value;
	a_oid[5] = new type.UInt8().read(s).value;

	for(var i in oid) {
		if(oid[i] !== a_oid[i]) return false;
	}

	return true;
}
951218
public Object getAttributeValue(ObjectIdentifier oid)
    throws IOException {
        try {
            Object value = getAttribute(oid).getValue();
            return value;
        } catch (NullPointerException ex) {
            throw new IOException("No value found for attribute " + oid);
        }

    }
1306764
def get_det_id(self, det_oid):
        """"""
        try:
            return self.detectors[self.detectors.OID == det_oid
                                  ].SERIALNUMBER.iloc[0]
        except IndexError:
            log.critical("No det ID found for OID '{}'".format(det_oid))
            return None
1161400
def find_one(self, cls, id):
        """"""
        one = self._find(cls, {"_id": id})
        if not one:
            return None
        return one[0]
1010762
def get_by_id(cls, id):
        

        if any((isinstance(id, basestring) and id.isdigit(), isinstance(id,
               (int, float)))):
            return cls.query.get(int(id))
        return None
1238625
public Object getResultValue(String actionId) {
        if (actionId == null) {
            return null;
        }
        if (!actionId.contains(ActivityContext.ID_SEPARATOR)) {
            ActionResult actionResult = getActionResult(actionId);
            return (actionResult != null ? actionResult.getResultValue() : null);
        } else {
            String[] ids = StringUtils.tokenize(actionId, ActivityContext.ID_SEPARATOR, true);
            if (ids.length == 1) {
                ActionResult actionResult = getActionResult(actionId);
                return (actionResult != null ? actionResult.getResultValue() : null);
            } else {
                ActionResult actionResult = getActionResult(ids[0]);
                if (actionResult == null || !(actionResult.getResultValue() instanceof ResultValueMap)) {
                    return null;
                }
                ResultValueMap resultValueMap = (ResultValueMap)actionResult.getResultValue();
                for (int i = 1; i < ids.length - 1; i++) {
                    Object value = resultValueMap.get(ids[i]);
                    if (!(value instanceof ResultValueMap)) {
                        return null;
                    }
                }
                return resultValueMap.get(ids[ids.length - 1]);
            }
        }
    }
750773
def get(self, request):
        """"""
        state = get_random_string(self.get_settings('OIDC_STATE_SIZE', 32))
        redirect_field_name = self.get_settings('OIDC_REDIRECT_FIELD_NAME', 'next')
        reverse_url = self.get_settings('OIDC_AUTHENTICATION_CALLBACK_URL',
                                        'oidc_authentication_callback')

        params = {
            'response_type': 'code',
            'scope': self.get_settings('OIDC_RP_SCOPES', 'openid email'),
            'client_id': self.OIDC_RP_CLIENT_ID,
            'redirect_uri': absolutify(
                request,
                reverse(reverse_url)
            ),
            'state': state,
        }

        params.update(self.get_extra_params(request))

        if self.get_settings('OIDC_USE_NONCE', True):
            nonce = get_random_string(self.get_settings('OIDC_NONCE_SIZE', 32))
            params.update({
                'nonce': nonce
            })
            request.session['oidc_nonce'] = nonce

        request.session['oidc_state'] = state
        request.session['oidc_login_next'] = get_next_url(request, redirect_field_name)

        query = urlencode(params)
        redirect_url = '{url}?{query}'.format(url=self.OIDC_OP_AUTH_ENDPOINT, query=query)
        return HttpResponseRedirect(redirect_url)
755403
private GeneralNameInterface getGNI(ObjectIdentifier oid, byte[] nameValue)
            throws IOException {
        try {
            Class<?> extClass = OIDMap.getClass(oid);
            if (extClass == null) {   // Unsupported OtherName
                return null;
            }
            Class<?>[] params = { Object.class };
            Constructor<?> cons = extClass.getConstructor(params);

            Object[] passed = new Object[] { nameValue };
            GeneralNameInterface gni =
                       (GeneralNameInterface)cons.newInstance(passed);
            return gni;
        } catch (Exception e) {
            throw new IOException("Instantiation error: " + e, e);
        }
    }