Returns the representation of this FeatureSet as the corresponding
        ProtocolElement.
420182
def toProtocolElement(self):
        
        gaFeatureSet = protocol.FeatureSet()
        gaFeatureSet.id = self.getId()
        gaFeatureSet.dataset_id = self.getParentContainer().getId()
        gaFeatureSet.reference_set_id = pb.string(self._referenceSet.getId())
        gaFeatureSet.name = self._name
        gaFeatureSet.source_uri = self._sourceUri
        attributes = self.getAttributes()
        for key in attributes:
            gaFeatureSet.attributes.attr[key] \
                .values.extend(protocol.encodeValue(attributes[key]))
        return gaFeatureSet
12952
def _as_rdf_xml(self, ns):
        
        self.rdf_identity = self._get_identity(ns)
        elements = []
        elements.append(ET.Element(NS('sbol', 'persistentIdentity'),
                                   attrib={NS('rdf', 'resource'):
                                           self._get_persistent_identitity(ns)}))
        if self.name is not None:
            name = ET.Element(NS('dcterms', 'title'))
            name.text = self.name
            elements.append(name)
        if self.display_id is not None:
            display_id = ET.Element(NS('sbol', 'displayId'))
            display_id.text = self.display_id
            elements.append(display_id)
        if self.version is not None:
            version = ET.Element(NS('sbol', 'version'))
            version.text = self.version
            elements.append(version)
        if self.was_derived_from is not None:
            elements.append(ET.Element(NS('prov', 'wasDerivedFrom'),
                                       attrib={NS('rdf', 'resource'): self.was_derived_from}))
        if self.description is not None:
            description = ET.Element(NS('dcterms', 'description'))
            description.text = self.description
            elements.append(description)
        for a in self.annotations:
            elements.append(a._as_rdf_xml(ns))
        return elements
666070
def features(self):
        
        buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
        self._dll.JLINKARM_GetFeatureString(buf)

        result = ctypes.string_at(buf).decode().strip()
        if len(result) == 0:
            return list()

        return result.split(', ')
1204998
function ()
        {
            var name = this.name;
            if (name === undefined)
                name = '{' + this.canonicalNames.join(', ') + '}';
            var str = '[Feature ' + name + ']';
            return str;
        }
29315
def to_sdp(self):
        
        sdp = '%s %d %s %d %s %d typ %s' % (
            self.foundation,
            self.component,
            self.transport,
            self.priority,
            self.host,
            self.port,
            self.type)
        if self.related_address is not None:
            sdp += ' raddr %s' % self.related_address
        if self.related_port is not None:
            sdp += ' rport %s' % self.related_port
        if self.tcptype is not None:
            sdp += ' tcptype %s' % self.tcptype
        if self.generation is not None:
            sdp += ' generation %d' % self.generation
        return sdp
354126
def get_protocols(self, protocol):
        
        if isinstance(protocol, packet_base.PacketBase):
            protocol = protocol.__class__
        assert issubclass(protocol, packet_base.PacketBase)
        return [p for p in self.protocols if isinstance(p, protocol)]
1049966
def get_protocol_from_name(name):
    
    cls = protocol_map.get(name)
    if not cls:
        raise ValueError('Unsupported protocol "%s".' % name)
    return cls
274415
@Override
    public List<ProtocolDef> getProtocols() {
        List<ProtocolDef> protocols = new ArrayList<ProtocolDef>();
        for (Node proto : container.get("protocol")) {
            protocols.add(new ProtocolDefImpl(getDescriptorName(), getRootNode(), container, proto));
        }
        return protocols;
    }
842217
def getFeatureSetByName(self, name):
        
        if name not in self._featureSetNameMap:
            raise exceptions.FeatureSetNameNotFoundException(name)
        return self._featureSetNameMap[name]
374509
def element(self):
        
        return self.adapter.wrap_node(
            self.impl_element, self.adapter.impl_document, self.adapter)
127995
def toProtocolElement(self):
        
        protocolElement = protocol.RnaQuantification()
        protocolElement.id = self.getId()
        protocolElement.name = self._name
        protocolElement.description = self._description
        protocolElement.read_group_ids.extend(self._readGroupIds)
        protocolElement.programs.extend(self._programs)
        protocolElement.biosample_id = self._biosampleId
        protocolElement.feature_set_ids.extend(self._featureSetIds)
        protocolElement.rna_quantification_set_id = \
            self._parentContainer.getId()
        self.serializeAttributes(protocolElement)
        return protocolElement
296645
def toProtocolElement(self):
        
        variantSet = self.getParentContainer()
        gaCallSet = protocol.CallSet(
            biosample_id=self.getBiosampleId())
        if variantSet.getCreationTime():
            gaCallSet.created = variantSet.getCreationTime()
        if variantSet.getUpdatedTime():
            gaCallSet.updated = variantSet.getUpdatedTime()
        gaCallSet.id = self.getId()
        gaCallSet.name = self.getLocalId()
        gaCallSet.variant_set_ids.append(variantSet.getId())
        self.serializeAttributes(gaCallSet)
        return gaCallSet
1033951
def serialize(self):
        

        self.data = bytearray()
        r = self.protocols[::-1]
        for i, p in enumerate(r):
            if isinstance(p, packet_base.PacketBase):
                if i == len(r) - 1:
                    prev = None
                else:
                    prev = r[i + 1]
                data = p.serialize(self.data, prev)
            else:
                data = six.binary_type(p)
            self.data = bytearray(data + self.data)
1023204
def to_string(self):
        
        if self._string is None:
            tokens = []
            if self.name:
                if self.scale:
                    token = self.name + ':' + str(self.scale)
                else:
                    token = self.name
            else:
                token = ''  # Spacing element to indicate next string is a feature
            tokens.append(token)
            for label, value in self.features:
                if value is None:
                    token = label
                else:
                    token = label + ':' + str(value)
                tokens.append(token)
            tokens.append('')  # Spacing element to separate from next pipe character
            output = ' '.join(tokens)
            if self.cache_string:
                self._string = output
        else:
            output = self._string
        return output
253332
def genotypesPhenotypesGenerator(self, request):
        
        # TODO make paging work using SPARQL?
        compoundId = datamodel.PhenotypeAssociationSetCompoundId.parse(
            request.phenotype_association_set_id)
        dataset = self.getDataRepository().getDataset(compoundId.dataset_id)
        phenotypeAssociationSet = dataset.getPhenotypeAssociationSet(
            compoundId.phenotypeAssociationSetId)
        featureSets = dataset.getFeatureSets()
        annotationList = phenotypeAssociationSet.getAssociations(
            request, featureSets)
        return self._protocolListGenerator(request, annotationList)
1017646
def protocols(self):
        
        if self.__protocols is None:
            self.__protocols = self.proto_tree_model.protocols
        return self.__protocols
43320
def _GetPrimitiveEncoder(self):
    """"""
    # Decide what should the primitive type be for packing the target rdfvalue
    # into the protobuf and create a delegate descriptor to control that.
    primitive_cls = self._PROTO_DATA_STORE_LOOKUP[self.type.data_store_type]
    self.primitive_desc = primitive_cls(**self._kwargs)

    # Our wiretype is the same as the delegate's.
    self.wire_type = self.primitive_desc.wire_type
    self.proto_type_name = self.primitive_desc.proto_type_name

    # Recalculate our tags.
    self.CalculateTags()