Returns the qtype information to attach to question element.
507738
protected function define_question_plugin_structure() {
        $qtype = self::qtype_name();
        $plugin = $this->get_plugin_element(null, '../../qtype', $qtype);

        $pluginwrapper = new backup_nested_element($this->get_recommended_name());

        $plugin->add_child($pluginwrapper);

        $dds = new backup_nested_element($qtype, array('id'), array(
            'shuffleanswers', 'correctfeedback', 'correctfeedbackformat',
            'partiallycorrectfeedback', 'partiallycorrectfeedbackformat',
            'incorrectfeedback', 'incorrectfeedbackformat', 'shownumcorrect'));

        $pluginwrapper->add_child($dds);
        $drags = new backup_nested_element('drags');

        $drag = new backup_nested_element('drag', array('id'),
                                                array('no', 'draggroup', 'infinite', 'label'));
        $drops = new backup_nested_element('drops');

        $drop = new backup_nested_element('drop', array('id'),
                                                array('no', 'xleft', 'ytop', 'choice', 'label'));

        $dds->set_source_table("qtype_{$qtype}",
                                                array('questionid' => backup::VAR_PARENTID));

        $pluginwrapper->add_child($drags);
        $drags->add_child($drag);
        $pluginwrapper->add_child($drops);
        $drops->add_child($drop);

        $drag->set_source_table("qtype_{$qtype}_drags",
                                                    array('questionid' => backup::VAR_PARENTID));

        $drop->set_source_table("qtype_{$qtype}_drops",
                                                    array('questionid' => backup::VAR_PARENTID));

        return $plugin;
    }
863934
function getValType(el) {
        var ret = el.tagName.toLowerCase()
        return ret === "input" && /checkbox|radio/.test(el.type) ? "checked" : ret
    }
1327369
function lookupQualifiedType(qname) {
	var t = type_env.get(qname)
	if (!t)
		throw new TypeError("Unresolved type: " + qname)
	return t;
}
362742
private Stream<Quad> fetchContainmentQuads() {
        if (getInteractionModel().getIRIString().endsWith("Container")) {
            final Query q = new Query();
            q.setQuerySelectType();
            q.addResultVar(OBJECT);

            final ElementPathBlock epb = new ElementPathBlock();
            epb.addTriple(create(OBJECT, rdf.asJenaNode(DC.isPartOf), rdf.asJenaNode(identifier)));

            final ElementNamedGraph ng = new ElementNamedGraph(rdf.asJenaNode(Trellis.PreferServerManaged), epb);

            final ElementGroup elg = new ElementGroup();
            elg.addElement(ng);
            q.setQueryPattern(elg);

            final Stream.Builder<Quad> builder = builder();
            rdfConnection.querySelect(q, qs -> builder.accept(rdf.createQuad(LDP.PreferContainment,
                            identifier, LDP.contains, getObject(qs))));
            return builder.build();
        }
        return Stream.empty();
    }
1106470
def getElementType(self, elementKw):
        
        try:
            etype = list(self.all_elements.get(elementKw.upper()).keys())[0]
        except:
            etype = self.all_elements.get(elementKw.upper())
        return etype.upper()
227959
def element_type(self):
        
        result = conf.lib.clang_getElementType(self)
        if result.kind == TypeKind.INVALID:
            raise Exception('Element type not available on this type.')

        return result
1200356
def get_elem_type(elem):
    
    elem_type = None
    if isinstance(elem, list):
        if elem[0].get("type") == "radio":
            elem_type = "radio"
        else:
            raise ValueError(u"Unknown element type: {}".format(elem))

    elif elem.name == "select":
        elem_type = "select"

    elif elem.name == "input":
        elem_type = elem.get("type")

    else:
        raise ValueError(u"Unknown element type: {}".format(elem))

    # To be removed
    assert elem_type is not None

    return elem_type
412934
def show_qparams(qtype, stream=sys.stdout):
    """"""
    for cls in all_subclasses(QueueAdapter):
        if cls.QTYPE == qtype: return stream.write(cls.QTEMPLATE)

    raise ValueError("Cannot find class associated to qtype %s" % qtype)
897275
def get_type_data(self, name):
        """"""
        try:
            return {
                'authority': 'DLKIT',
                'namespace': 'relationship.Relationship',
                'identifier': name.lower(),
                'domain': 'Generic Types',
                'display_name': name.title() + ' Type',
                'display_label': name.title(),
                'description': ('The ' + name.title() + ' Type.')
            }
        except IndexError:
            raise NotFound('RelationshipType: ' + name.title())
1202952
def interface_type(self):
        
        value = "if="
        lst = self._attributes.get("if")
        if lst is None:
            value = ""
        else:
            value += "\"" + str(lst) + "\""
        return value
56907
def get_element_types(obj, **kwargs):
    """"""

    max_iterable_length = kwargs.get('max_iterable_length', 10000)
    consume_generator = kwargs.get('consume_generator', False)

    if not isiterable(obj):
        return None

    if isgenerator(obj) and not consume_generator:
        return None

    t = get_types(obj, **kwargs)

    if not t['too_big']:
        if t['types']:
            return "Element types: {}".format(', '.join([extract_type(t) for t in t['types']]))
        else:
            return None
    else:
        return "Element types: {}".format(', '.join([extract_type(t) for t in t['types']])) + " (based on first {} elements.)".format(max_iterable_length)
666110
function getTypes()
    {
        $t = array();
        foreach ($this->getElements('xrd:Type') as $elem) {
            $c = $this->parser->content($elem);
            if ($c) {
                $t[] = $c;
            }
        }
        return $t;
    }
734645
def ask(question, answer_type=String, &details)
     $log.debug "XXXX inside ask win #{@window} "
      @window ||= _create_footer_window
      #@window.show #unless @window.visible?
    
      @question ||= Question.new(question, answer_type, &details)
      say(@question) #unless @question.echo == true

      @completion_proc = @question.completion_proc
      @change_proc = @question.change_proc
      @key_handler_proc = @question.key_handler_proc
      @default = @question.default
      $log.debug "XXX: ASK RBGETS got default: #{@default} "
      @help_text = @question.help_text
      @answer_type = @question.answer_type
      if @question.answer_type.is_a? Array
        @completion_proc = Proc.new{|str| @answer_type.dup.grep Regexp.new("^#{str}") }
      end

      begin
        # FIXME a C-c still returns default to user !
        @answer = @question.answer_or_default(get_response) 
        unless @question.valid_answer?(@answer)
          explain_error(:not_valid)
          raise QuestionError
        end

        @answer = @question.convert(@answer)

        if @question.in_range?(@answer)
          if @question.confirm
            # need to add a layer of scope to ask a question inside a
            # question, without destroying instance data
            context_change = self.class.new(@input, @output, @wrap_at, @page_at)
            if @question.confirm == true
              confirm_question = "Are you sure?  "
            else
              # evaluate ERb under initial scope, so it will have
              # access to @question and @answer
              template  = ERB.new(@question.confirm, nil, "%")
              confirm_question = template.result(binding)
            end
            unless context_change.agree(confirm_question)
              explain_error(nil)
              raise QuestionError
            end
          end

          @answer
        else
          explain_error(:not_in_range)
          raise QuestionError
        end
      rescue QuestionError
        retry
      rescue ArgumentError, NameError => error
        #raise
        raise if error.is_a?(NoMethodError)
        if error.message =~ /ambiguous/
          # the assumption here is that OptionParser::Completion#complete
          # (used for ambiguity resolution) throws exceptions containing 
          # the word 'ambiguous' whenever resolution fails
          explain_error(:ambiguous_completion)
        else
          explain_error(:invalid_type)
        end
        retry
      rescue Question::NoAutoCompleteMatch
        explain_error(:no_completion)
        retry
      rescue Interrupt
        $log.warn "User interrupted ask() get_response does not want operation to proceed"
        return nil
      ensure
        @question = nil    # Reset Question object.
        $log.debug "XXX: HIDE B AT ENSURE OF ASK"
        hide_bottomline # assuming this method made it visible, not sure if this is called.
      end
    end
450915
def fqn(self):
        '''  '''
        prefix = type(self).cls_key()

        return '{}:{}'.format(prefix, self.id)
364681
def _get_question(self, qcount):
        """"""

        if self.updating and qcount > 1:
            raise dns.exception.FormError

        for i in xrange(0, qcount):
            (qname, used) = dns.name.from_wire(self.wire, self.current)
            if not self.message.origin is None:
                qname = qname.relativize(self.message.origin)
            self.current = self.current + used
            (rdtype, rdclass) = \
                     struct.unpack('!HH',
                                   self.wire[self.current:self.current + 4])
            self.current = self.current + 4
            self.message.find_rrset(self.message.question, qname,
                                    rdclass, rdtype, create=True,
                                    force_unique=True)
            if self.updating:
                self.zone_rdclass = rdclass
529624
public String getOtherTrackType()
	{
		final Element element = getElement("Type", 0);

		if (element != null)
		{
			return element.getText();
		}
		else
		{
			return null;
		}
	}
326819
def data(self, index, role=Qt.DisplayRole):
        """"""
        if not index.isValid():
            return to_qvariant()
        if role == Qt.DisplayRole:
            if index.column() == 0:
                value = osp.basename(self.get_value(index))
                return to_qvariant(value)
            else:
                value = self.get_value(index)
                return to_qvariant(value)
        elif role == Qt.TextAlignmentRole:
            return to_qvariant(int(Qt.AlignLeft|Qt.AlignVCenter))
        elif role == Qt.ToolTipRole:
            if index.column() == 0:
                value = self.get_value(index)
                return to_qvariant(value)
            else:
                return to_qvariant()