return element object regarding the keyword configuration
765832
def makeElement(self, kw):
        
        kw_name = kw
        kw_type = self.getElementType(kw_name)
        kw_config = {k.lower(): v for k, v in self.getElementConf(kw_name).items()}
        objtype = 'Element' + kw_type.capitalize()
        retobj = getattr(element, objtype)(name=kw_name, config=kw_config)
        # set up EPICS control configs
        ctrlconf = self.getElementCtrlConf(kw)
        if ctrlconf != {}:
            retobj.setConf(ctrlconf, type='ctrl')

        return retobj
1218464
def get(self):
        ''''''
        value = {}
        for (elementname, elementvar) in self._elementvars.items():
            value[elementname] = elementvar.get()
        return value
311363
def elements(self):
        """"""
        offset = self.EXTRA_DIGITS
        if offset:
            return (self._id[:offset], self.company_prefix, self._reference,
                    self.check_digit)
        else:
            return (self.company_prefix, self._reference, self.check_digit)
741763
def _alephResultToDict(dom):
    
    result = {}
    for i in dom.childs:
        if not i.isOpeningTag():
            continue

        keyword = i.getTagName().strip()
        value = _tryConvertToInt(i.getContent().strip())

        # if there are multiple tags with same keyword, add values into
        # array, instead of rewriting existing value at given keyword
        if keyword in result:                  # if it is already there ..
            if isinstance(result[keyword], list):  # and it is list ..
                result[keyword].append(value)          # add it to list
            else:                                  # or make it array
                result[keyword] = [result[keyword], value]
        else:                                  # if it is not in result, add it
            result[keyword] = value

    return result
767167
def element_attribs_to_dict(self, element):
        
        return {self.ns+':'+key: val for (key, val) in element.attrib.items()
                if key != add_ns('id')}
855506
def _elements_to_dict(data, position, obj_end, opts, result=None):
    """"""
    if result is None:
        result = opts.document_class()
    end = obj_end - 1
    while position < end:
        key, value, position = _element_to_dict(data, position, obj_end, opts)
        result[key] = value
    if position != obj_end:
        raise InvalidBSON('bad object or element length')
    return result
91004
def get_options(cls, items, options, warnfn):
        ""
        options = cls.update_options(options, items)
        for keyword in cls.defaults:
            if keyword in items:
                value = items[keyword]
                allowed = cls.allowed[keyword]
                if isinstance(allowed, set):  pass
                elif isinstance(allowed, dict):
                    if not isinstance(value, dict):
                        raise ValueError("Value %r not a dict type" % value)
                    disallowed = set(value.keys()) - set(allowed.keys())
                    if disallowed:
                        raise ValueError("Keywords %r for %r option not one of %s"
                                         % (disallowed, keyword, allowed))
                    wrong_type = {k: v for k, v in value.items()
                                  if not isinstance(v, allowed[k])}
                    if wrong_type:
                        errors = []
                        for k,v in wrong_type.items():
                            errors.append("Value %r for %r option's %r attribute not of type %r" %
                                          (v, keyword, k, allowed[k]))
                        raise ValueError('\n'.join(errors))
                elif isinstance(allowed, list) and value not in allowed:
                    if keyword in cls.custom_exceptions:
                        cls.custom_exceptions[keyword](value, keyword, allowed)
                    else:
                        raise ValueError("Value %r for key %r not one of %s"
                                         % (value, keyword, allowed))
                elif isinstance(allowed, tuple):
                    if not (allowed[0] <= value <= allowed[1]):
                        info = (keyword,value)+allowed
                        raise ValueError("Value %r for key %r not between %s and %s" % info)
                options[keyword] = value
        return cls._validate(options, items, warnfn)
441589
private Properties getElementProperties(Map<String, Object> configProps, String elementName, String... attrKeys) {
        Properties properties = new Properties();
        for (String attrKey : attrKeys) {
            String value = (String) configProps.get(attrKey);
            if (value != null && value.length() > 0) {
                value = (String) getValue(value);
                properties.put(attrKey, value);
            }
        }

        if (properties.isEmpty() || properties.size() != attrKeys.length) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                //TODO: NLS warning msg
                Tr.debug(tc, "The authFilter element " + elementName + " specified in the server.xml file is missing one or more of these attributes "
                             + printAttrKeys(attrKeys));
            }
            return null;
        } else
            return properties;
    }
1155502
def visit_keyword(self, node):
        """"""
        if node.arg is None:
            return "**%s" % node.value.accept(self)
        return "%s=%s" % (node.arg, node.value.accept(self))
407306
def _return_value(content, ns):
    
    doc = ElementTree.fromstring(content)
    query = './/{%(ns)s}%(item)s' % {'ns': ns, 'item': 'ReturnValue'}
    rv = doc.find(query)
    return int(rv.text)
209146
def getConfig(self, key):
        
        if hasattr(self, key):
            return getattr(self, key)
        else:
            return False
584586
function(element, style) {
  Object.keys(style).forEach(function(key) {
    if (key in element.style) {
      element.style[key] = style[key];
    } else if (prefix(key) in element.style) {
      element.style[prefix(key)] = style[key];
    } else {
      util.warn('No such style property: ' + key);
    }
  });
  return element;
}
1211844
String getElementKeyString(Element element) {
		JsonKey key = element.getAnnotation(JsonKey.class);
		JsonModel model = element.getEnclosingElement().getAnnotation(JsonModel.class);
		if (!"".equals(key.value())) {
			return key.value();
		} else if ("".equals(key.value()) && key.decamelize()) {
			return decamelize(element.toString());
		} else if ("".equals(key.value()) && model.decamelize()) {
			return decamelize(element.toString());
		} else {
			return element.toString();
		}
	}
1114974
def getElementProperties(self, name):
        
        try:
            allp = self.all_elements[name.upper()]
            if isinstance(allp, dict):
                type = allp.keys()[0]
                properties = allp.values()[0]
                return {'type': type, 'properties': properties}
            else:
                type = allp
                return {'type': type, 'properties': None}
        except:
            pass
1351369
def get(cls, scope=None):
        """"""
        if scope is None:
            scope = cls.default
        if isinstance(scope, string_types) and scope in cls._keywords:
            return getattr(cls, scope)
        return scope
1101030
def _parse_keywords(self, prop):
        

        keywords = []

        if prop in KEYWORD_PROPS:
            xpath_root = self._data_map['_keywords_root']
            xpath_map = self._data_structures[prop]

            xtype = xpath_map['keyword_type']
            xpath = xpath_map['keyword']
            ktype = KEYWORD_TYPES[prop]

            for element in get_elements(self._xml_tree, xpath_root):
                if get_element_text(element, xtype).lower() == ktype.lower():
                    keywords.extend(get_elements_text(element, xpath))

        return keywords
913622
def _buildElementNsmap(using_elements):
    '''
    
    '''
    thisMap = {}
    for e in using_elements:
        thisMap[e.attrib['prefix']] = e.attrib['namespace']
    return thisMap