Return a fully-qualified monitored_resource_descriptor string.
358661
def monitored_resource_descriptor_path(cls, project, monitored_resource_descriptor):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}",
            project=project,
            monitored_resource_descriptor=monitored_resource_descriptor,
        )
635812
def facilityMsToNet(SsVersionIndicator_presence=0):
    """"""
    a = TpPd(pd=0x3)
    b = MessageType(mesType=0x3a)  # 00111010
    c = Facility()
    packet = a / b / c
    if SsVersionIndicator_presence is 1:
        d = SsVersionIndicatorHdr(ieiSVI=0x7F, eightBitSVI=0x0)
        packet = packet / d
    return packet
774979
def to_api_repr(self):
        """"""
        configuration = self._configuration.to_api_repr()

        resource = {
            "jobReference": self._properties["jobReference"],
            "configuration": configuration,
        }
        configuration["query"]["query"] = self.query

        return resource
140487
def RCScan():
    """"""

    res_re= r'^(?:\s*#\s*(?:include)|' \
            '.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \
            '\s*.*?)' \
            '\s*(<|"| )([^>"\s]+)(?:[>"\s])*$'
    resScanner = SCons.Scanner.ClassicCPP("ResourceScanner",
                                          "$RCSUFFIXES",
                                          "CPPPATH",
                                          res_re,
                                          recursive=no_tlb)
    
    return resScanner
1095501
def identify(self, req, resp, resource, uri_kwargs):
        """"""
        try:
            return req.get_header('X-Api-Key', True)
        except (KeyError, HTTPMissingHeader):
            pass
773021
def _get_tracker(self, resource):
        
        with self._lock:
            for rt in self._reference_queue:
                if rt is not None and resource is rt.resource:
                    return rt

        raise UnknownResourceError('Resource not created by pool')
587062
def get_descriptor_for_idcode(idcode):
    """"""
    idcode = idcode&0x0fffffff
    id_str = "XXXX"+bin(idcode)[2:].zfill(28)

    descr_file_path = _check_cache_for_idcode(id_str)
    if descr_file_path:
        with open(descr_file_path, 'r') as f:
            dat = json.load(f)
        if dat.get("_file_version",-1) == JTAGDeviceDescription.version:
            return JTAGDeviceDescription(dat.get('idcode'),
                                         dat.get('name'),
                                         dat.get('ir_length'),
                                         dat.get('instruction_opcodes'),
                                         dat.get('registers'),
                                         dat.get('instruction_register_map'))

    print("    Device detected ("+id_str+"). Fetching missing descriptor...")
    sid = get_sid(id_str)
    details = get_details(sid)
    attribs = decode_bsdl(sid)

    #VERIFYING PARSED DATA FROM 2 SOURCES. MESSY BUT USEFUL.
    instruction_length = 0
    if attribs.get('INSTRUCTION_LENGTH') ==\
       details.get('INSTRUCTION_LENGTH'):
        instruction_length = attribs.get('INSTRUCTION_LENGTH')
    elif attribs.get('INSTRUCTION_LENGTH') and\
       details.get('INSTRUCTION_LENGTH'):
        raise Exception("INSTRUCTION_LENGTH can not be determined")
    elif attribs.get('INSTRUCTION_LENGTH'):
        instruction_length = attribs.get('INSTRUCTION_LENGTH')
    else:
        instruction_length = details.get('INSTRUCTION_LENGTH')

    for instruction_name in details.get('instructions'):
        if instruction_name not in\
           attribs.get('INSTRUCTION_OPCODE',[]):
            raise Exception("INSTRUCTION_OPCODE sources do not match")

    #print(attribs['IDCODE_REGISTER'])
    descr = JTAGDeviceDescription(attribs['IDCODE_REGISTER'].upper(),
                                  details['name'], instruction_length,
                                  attribs['INSTRUCTION_OPCODE'],
                                  attribs['REGISTERS'],
                                  attribs['INSTRUCTION_TO_REGISTER'])

    #CACHE DESCR AS FILE!
    if not os.path.isdir(base_descr_dir):
        os.makedirs(base_descr_dir)
    descr_file_path = os.path.join(base_descr_dir,
                                   attribs['IDCODE_REGISTER']\
                                   .upper()+'.json')
    with open(descr_file_path, 'w') as f:
        json.dump(descr._dump(), f)

    return descr
950073
def _monitoring_metrics_list(args, _):
  """"""
  project_id = args['project']
  pattern = args['type'] or '*'
  descriptors = gcm.MetricDescriptors(context=_make_context(project_id))
  dataframe = descriptors.as_dataframe(pattern=pattern)
  return _render_dataframe(dataframe)
226912
def _build_resource(self):
        """"""
        additions = [
            {
                "name": added.name,
                "type": added.record_type,
                "ttl": str(added.ttl),
                "rrdatas": added.rrdatas,
            }
            for added in self.additions
        ]

        deletions = [
            {
                "name": deleted.name,
                "type": deleted.record_type,
                "ttl": str(deleted.ttl),
                "rrdatas": deleted.rrdatas,
            }
            for deleted in self.deletions
        ]

        return {"additions": additions, "deletions": deletions}
1193839
def _list_metric_descriptors(args, _):
  """"""
  project_id = args['project']
  pattern = args['type'] or '*'
  descriptors = gcm.MetricDescriptors(project_id=project_id)
  dataframe = descriptors.as_dataframe(pattern=pattern)
  return _render_dataframe(dataframe)
576103
def name_server_monitor(self, query, days_back=0, page=1, **kwargs):
        """"""
        return self._results('name-server-monitor', '/v1/name-server-monitor', query=query, days_back=days_back,
                            page=page, items_path=('alerts', ), **kwargs)
1347646
def resource_string(self):
        """"""

        if self._resources_initialized:
            res_str = "{} CPUs, {} GPUs".format(self._avail_resources.cpu,
                                                self._avail_resources.gpu)
            if self._avail_resources.custom_resources:
                custom = ", ".join(
                    "{} {}".format(
                        self._avail_resources.get_res_total(name), name)
                    for name in self._avail_resources.custom_resources)
                res_str += " ({})".format(custom)
            return res_str
        else:
            return "? CPUs, ? GPUs"
1335998
def getResourceMapPid(self):
        
        ore = [
            o for o in self.subjects(predicate=rdflib.RDF.type, object=ORE.ResourceMap)
        ][0]
        pid = [str(o) for o in self.objects(predicate=DCTERMS.identifier, subject=ore)][
            0
        ]
        return pid
858910
def GetSecurityDescriptor(self):
    
    fwnt_security_descriptor = pyfwnt.security_descriptor()
    fwnt_security_descriptor.copy_from_byte_stream(
        self._fsntfs_file_entry.security_descriptor_data)

    return fwnt_security_descriptor
1351480
def description(self):
        """"""
        return (
            self.name,
            self.type_code,
            None,  # TODO: display_length; should this be self.length?
            self.get_column_length(),  # 'internal_size'
            self.get_column_length(),  # 'precision'  # TODO: why!?!?
            self.scale,
            self.flags % 2 == 0)
120216
def _resource_context(fn):
    
    return os.path.join(
        os.path.dirname(__file__),
        DES_DIR,
        fn
    )
596619
@Exported(inline=true)
    public Map<String/*monitor name*/,Object> getMonitorData() {
        Map<String,Object> r = new HashMap<>();
        if (hasPermission(CONNECT)) {
            for (NodeMonitor monitor : NodeMonitor.getAll())
                r.put(monitor.getClass().getName(), monitor.data(this));
        }
        return r;
    }