get bibliographic container uuid from an image_id
356548
def get_bibl_uuid(image_id)
      url = "#{@server_url}/items/local_image_id/#{image_id}.json"   
      json = self.get_json(url)
      bibl_uuid = nil
      if json["nyplAPI"]["response"]["numResults"].to_i > 0
        bibl_uuid = json["nyplAPI"]["response"]["uuid"]
      end
     
      return bibl_uuid
    end
959819
def uuid(self):
        '''
        '''
        pk = self.pkvalue()
        if not pk:
            raise self.DoesNotExist(
                'Object not saved. Cannot obtain universally unique id')
        return self.get_uuid(pk)
1055465
def get_cached_document_ids(ids, doc_type):
    """"""
    for batch in _split_list(ids):
        for id in _get_cached_document_ids(batch, doc_type):
            yield id
1153744
def _get_label_uuid(xapi, rectype, label):
    '''
    
    '''
    try:
        return getattr(xapi, rectype).get_by_name_label(label)[0]
    except Exception:
        return False
427012
def __uuid(*args):
        """"""

        s = '-'.join(args)

        sha1 = hashlib.sha1(s.encode('utf-8', errors='surrogateescape'))
        uuid_sha1 = sha1.hexdigest()

        return uuid_sha1
631284
public CustomIcon getIconByUuid(UUID uuid) {
        for (CustomIcon customIcon : customIconList) {
            if (customIcon.getUuid() != null && customIcon.getUuid().compareTo(uuid) == 0) {
                return customIcon;
            }
        }

        return null;
    }
875897
def compile_fetch(raw, doi_id):
    
    fetch_dict = OrderedDict()
    order = {'author': 'author', 'type': 'type', 'identifier': '', 'title': 'title', 'journal': 'container-title',
            'pubYear': '', 'volume': 'volume', 'publisher': 'publisher', 'page':'page', 'issue': 'issue'}

    for k, v in order.items():
        try:
            if k == 'identifier':
                fetch_dict[k] = [{"type": "doi", "id": doi_id, "url": "http://dx.doi.org/" + doi_id}]
            elif k == 'author':
                fetch_dict[k] = compile_authors(raw[v])
            elif k == 'pubYear':
                fetch_dict[k] = compile_date(raw['issued']['date-parts'])
            else:
                fetch_dict[k] = raw[v]
        except KeyError as e:
            # If we try to add a key that doesn't exist in the raw dict, then just keep going.
            pass
    return fetch_dict
257207
function _getBarById(id) {
			return _rawdata.reduce(function (result, item) {
				if (item.uid === id) {
					result = item;
				}

				return result;
			}, null);
		}
318994
def uuid(dataset_uri):
    """"""
    dataset = dtoolcore.DataSet.from_uri(dataset_uri)
    click.secho(dataset.uuid)
284892
def create_guid(self, collection=None):
        
        guid = str(uuid.uuid4())
        if collection:
            return str.join('/', [collection, guid])
        else:
            return guid
607569
def get_uids(self, filename=None):
        
        self._update()
        return [Abook._gen_uid(self._book[entry]) for entry in self._book.sections()]
750271
function getIdsFromPayload(payload, conf, path) {
    return payload.map(function (payloadPiece) { return getId(payloadPiece, conf, path, payload); });
}
117304
def image_id_from_k8s():
    """"""
    token_path = "/var/run/secrets/kubernetes.io/serviceaccount/token"
    if os.path.exists(token_path):
        k8s_server = "https://{}:{}/api/v1/namespaces/default/pods/{}".format(
            os.getenv("KUBERNETES_SERVICE_HOST"), os.getenv(
                "KUBERNETES_PORT_443_TCP_PORT"), os.getenv("HOSTNAME")
        )
        try:
            res = requests.get(k8s_server, verify="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt",
                               timeout=3, headers={"Authorization": "Bearer {}".format(open(token_path).read())})
            res.raise_for_status()
        except requests.RequestException:
            return None
        try:
            return res.json()["status"]["containerStatuses"][0]["imageID"].strip("docker-pullable://")
        except (ValueError, KeyError, IndexError):
            logger.exception("Error checking kubernetes for image id")
            return None
1279275
function getContentUid(content) {
    var id = content.id_;
    if (!id)
      id = content.id_ = contentUidCounter++;
    return id;
  }
194021
def image_query_record(self, imagename=None):
        """"""

        if imagename:
            with get_image_conn() as conn:
                result = conn.execute("SELECT * FROM image WHERE "
                                      "imagename=?", (imagename,))
                image_list = result.fetchall()
            if not image_list:
                obj_desc = "Image with name: %s" % imagename
                raise exception.SDKObjectNotExistError(obj_desc=obj_desc,
                                                   modID=self._module_id)
        else:
            with get_image_conn() as conn:
                result = conn.execute("SELECT * FROM image")
                image_list = result.fetchall()

        # Map each image record to be a dict, with the key is the field name in
        # image DB
        image_keys_list = ['imagename', 'imageosdistro', 'md5sum',
                      'disk_size_units', 'image_size_in_bytes', 'type',
                      'comments']

        image_result = []
        for item in image_list:
            image_item = dict(zip(image_keys_list, item))
            image_result.append(image_item)
        return image_result
318374
def from_uuid(value: uuid.UUID) -> ulid.ULID:
    
    return ulid.ULID(value.bytes)
1099015
def getICMByUUID(uuid: str):
    
    _metadata = ICMMetadata.query.filter_by(id=uuid).first().deserialize()
    del _metadata["model_id"]
    return jsonify(_metadata)