Queries the Last.fm servers for metadata about a given
    fingerprint ID (an integer). Returns the XML response (a string).
358822
def metadata_query(fpid, apikey):
    
    params = {
        'method': 'track.getFingerprintMetadata',
        'fingerprintid': fpid,
        'api_key': apikey,
    }
    url = '%s?%s' % (URL_METADATA, urllib.urlencode(params))
    try:
        fh = _query_wrap(urllib.urlopen, url)
    except urllib2.HTTPError:
        raise CommunicationError('metadata query failed')
    except httplib.BadStatusLine:
        raise CommunicationError('bad response in metadata query')
    except IOError:
        raise CommunicationError('metadata query failed')
    return fh.read()
1014709
private static String getServerIdString(String id) {

        if (id.contains(CmsADEManager.CLIENT_ID_SEPERATOR)) {
            id = id.substring(0, id.indexOf(CmsADEManager.CLIENT_ID_SEPERATOR));
        }
        return id;
    }
1159695
def get_metadata(ident_hash):
    
    id, version = get_id_n_version(ident_hash)

    stmt = _get_sql('get-metadata.sql')
    args = dict(id=id, version=version)

    # FIXME The license_url and license_text metadata attributes need to
    # change to a License structure similar to what is used in cnx-authoring.

    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            cursor.execute(stmt, args)
            try:
                metadata = cursor.fetchone()[0]
            except TypeError:
                raise NotFound(ident_hash)
    return metadata
253746
def get_meta_data(self, request_adu):
        "
        try:
            transaction_id, protocol_id, length, unit_id = \
                unpack_mbap(request_adu[:7])
        except struct.error:
            raise ServerDeviceFailureError()

        return {
            'transaction_id': transaction_id,
            'protocol_id': protocol_id,
            'length': length,
            'unit_id': unit_id,
        }
608503
def file_fingerprint(fullpath):
    
    stat = os.stat(fullpath)
    return ','.join([str(value) for value in [stat.st_ino, stat.st_mtime, stat.st_size] if value])
268291
public static String getTimestampForId(String context, String ip) {
    	BDBMap bdbMap = getContextMap(context);
        String dateStr = bdbMap.get(ip);
        return (dateStr != null) ? dateStr : Timestamp.currentTimestamp().getDateStr();
    }
1313412
def get_metadata(self, refresh=True):
        
        if refresh or not self._metadata:
            ident = self._id or self.name
            if not ident:
                raise ConuException(
                    "This container does not have a valid identifier.")
            out = run_cmd(["machinectl", "--no-pager", "show", ident], return_output=True, ignore_status=True)
            if "Could not get path to machine" in out:
                self._metadata = {}
            else:
                self._metadata = convert_kv_to_dict(out)
        return self._metadata
1066670
def playlist_detail(self, playlist_id):
        
        action = 'mtop.alimusic.music.list.collectservice.getcollectdetail'
        payload = {'listId': playlist_id}
        code, msg, rv = self.request(action, payload)
        return rv['data']['data']['collectDetail']
868262
def enable_ip_stack_fingerprinting=(enable)
      ns = REXML::XPath.first(@xml, 'ScanTemplate/Plugins/Plugin[@name="java/NetworkScanners"]')
      param = REXML::XPath.first(ns, './param[@name="ipFingerprintEnabled"]')
      if param
        param.text = (enable ? 1 : 0)
      else
        param = REXML::Element.new('param')
        param.add_attribute('name', 'ipFingerprintEnabled')
        param.text = (enable ? 1 : 0)
        ns.add_element(param)
      end
    end
1225949
function() {
    return this.timestamp().substr( -2 ) +
      this.count().toString( this.base ).substr( -4 ) +
      this._fingerprint[0] +
      this._fingerprint[ this._fingerprint.length - 1 ] +
      this.randomBlock().substr( -2 )
  }
514210
@Override
    public Map<OpenPgpV4Fingerprint, Date> getAnnouncedFingerprintsOf(BareJid contact) throws IOException {
        return metadataStore.getAnnouncedFingerprintsOf(contact);
    }
863275
private MetadataDatabase getDatabase(String deviceUrl) throws TheDavidBoxClientException{
		ResponseCheckDatabase responseCheckDatabase = buildCheckDatabaseOperation(deviceUrl).execute();
			
		String databasePath = responseCheckDatabase.getDatabasePath();
		MetadataDatabase database = new MetadataDatabase(deviceUrl, databasePath);
		return database;
	}
1221709
def get_metadata(self):
        
        metadata_path = "{}/{}/{}".format(self.url,
                                          self.metadata_dir,
                                          self.metadata_file)
        metadata_sig_path = "{}/{}/{}.sig".format(self.url.rstrip('/'),
                                                  self.metadata_dir,
                                                  self.metadata_file)
        # load metadata
        req = requests.get(metadata_path)
        if req.status_code is 200:
            raw_metadata = req.content
        else:
            raise RepositoryError(metadata_path, ("status code not 200: "
                                                  "{}".format(req.status_code)))

        if self.gpg_verify:
            self.verify_data_signature(metadata_sig_path, metadata_path,
                                       raw_metadata)

        return self.parse_metadata(raw_metadata)
858515
def get_last_response_xml(self, pretty_print_if_possible=False):
        
        response = None
        if self.__last_response is not None:
            if isinstance(self.__last_response, compat.str_type):
                response = self.__last_response
            else:
                response = tostring(self.__last_response, encoding='unicode', pretty_print=pretty_print_if_possible)
        return response
724220
protected long getRevisionIdFromResponse(JsonNode response) throws JsonMappingException {
		if(response == null) {
			throw new JsonMappingException("API response is null");
		}
		JsonNode entity = null;
		if(response.has("entity")) {
			entity = response.path("entity");
		} else if(response.has("pageinfo")) {
			entity = response.path("pageinfo");
		} 
		if(entity != null && entity.has("lastrevid")) {
			return entity.path("lastrevid").asLong();
		}
		throw new JsonMappingException("The last revision id could not be found in API response");
	}
772754
def parse_metadata(xml):
    
    try:
        root = etree.fromstring(xml)
    except (ExpatError, etree.ParseError):
        # The Last.fm API occasionally generates malformed XML when its
        # includes an illegal character (UTF8-legal but prohibited by
        # the XML standard).
        raise CommunicationError('malformed XML response')
    
    status = root.attrib['status']
    if status == 'failed':
        error = root.find('error')
        raise APIError(int(error.attrib['code']), error.text)
    
    out = []
    for track in root.find('tracks').findall('track'):
        out.append({
            'rank': float(track.attrib['rank']),
            'artist': track.find('artist').find('name').text,
            'artist_mbid': track.find('artist').find('mbid').text,
            'title': track.find('name').text,
            'track_mbid': track.find('mbid').text,
        })
    return out
1374238
def getMetadataId(self, metadata):
        
        return str(datamodel.VariantSetMetadataCompoundId(
            self.getCompoundId(), 'metadata:' + metadata.key))