:param by:
    :param value:
    :param el_class:
    :rtype: tuple[type, str|tuple[str, str]]
    :return:
488000
def define_selector(by, value, el_class):
    
    el = el_class
    selector = by
    if isinstance(value, six.string_types):
        selector = (by, value)
    elif value is not None:
        el = value

    if el is None:
        el = elements.PageElement

    return el, selector
486801
def _get_el_attributes(lxml_el, ns=None, nsmap=None):
    
    attrs = {}
    for attr, val in lxml_el.items():
        attr = _to_colon_ns(attr, default_ns=ns, nsmap=nsmap)
        attrs[attr] = val
    return attrs
786340
def load(value: Any, type_: Type[T], **kwargs) -> T:
    
    from . import dataloader
    loader = dataloader.Loader(**kwargs)
    return loader.load(value, type_)
251878
def find_elements(self, by=By.ID, value=None):
        
        if self._w3c:
            if by == By.ID:
                by = By.CSS_SELECTOR
                value = '[id="%s"]' % value
            elif by == By.TAG_NAME:
                by = By.CSS_SELECTOR
            elif by == By.CLASS_NAME:
                by = By.CSS_SELECTOR
                value = ".%s" % value
            elif by == By.NAME:
                by = By.CSS_SELECTOR
                value = '[name="%s"]' % value

        return self._execute(Command.FIND_CHILD_ELEMENTS,
                             {"using": by, "value": value})['value']
715465
def _ensure_element(tup, elem):
    
    try:
        return tup, tup.index(elem)
    except ValueError:
        return tuple(chain(tup, (elem,))), len(tup)
934
def iterclass(cls):
    
    for field in dir(cls):
        if hasattr(cls, field):
            value = getattr(cls, field)
            yield field, value
418537
def validate(self, value, model_instance):
        
        return super(self.__class__, self).validate(value.value, model_instance)
824145
async def load_tuple(self, elem_type, params=None, elem=None, obj=None):
        
        if obj is None:
            return None

        elem_fields = params[0] if params else None
        if elem_fields is None:
            elem_fields = elem_type.f_specs()

        c_len = len(obj)
        if len(elem_fields) != c_len:
            raise ValueError('Size mismatch')

        res = elem if elem else []
        for i in range(len(elem_fields)):
            try:
                self.tracker.push_index(i)
                fvalue = await self._load_field(params[1:] if params else None,
                                                x.eref(res, i) if elem else None,
                                                obj=obj[i])
                self.tracker.pop()

                if not elem:
                    res.append(fvalue)

            except Exception as e:
                raise helpers.ArchiveException(e, tracker=self.tracker) from e

        return res
1220781
async def field(self, elem=None, elem_type=None, params=None):
        
        elem_type = elem_type if elem_type else elem.__class__
        fvalue = None

        etype = self._get_type(elem_type)
        if self._is_type(etype, UVarintType):
            fvalue = await self.uvarint(get_elem(elem))

        elif self._is_type(etype, IntType):
            fvalue = await self.uint(
                elem=get_elem(elem), elem_type=elem_type, params=params
            )

        elif self._is_type(etype, BlobType):
            fvalue = await self.blob(
                elem=get_elem(elem), elem_type=elem_type, params=params
            )

        elif self._is_type(etype, UnicodeType):
            fvalue = await self.unicode_type(get_elem(elem))

        elif self._is_type(etype, VariantType):
            fvalue = await self.variant(
                elem=get_elem(elem), elem_type=elem_type, params=params
            )

        elif self._is_type(etype, ContainerType):  # container ~ simple list
            fvalue = await self.container(
                container=get_elem(elem), container_type=elem_type, params=params
            )

        elif self._is_type(etype, TupleType):  # tuple ~ simple list
            fvalue = await self.tuple(
                elem=get_elem(elem), elem_type=elem_type, params=params
            )

        elif self._is_type(etype, MessageType):
            fvalue = await self.message(get_elem(elem), msg_type=elem_type)

        else:
            raise TypeError(
                "unknown type: %s %s %s" % (elem_type, type(elem_type), elem)
            )

        return fvalue if self.writing else set_elem(elem, fvalue)
43665
def get_by(lst, field, value):
    ''''''
    for row in lst:
        if ((isinstance(row, dict) and row.get(field) == value) or
                (getattr(row, field, None) == value)):
            return row
289909
def value(self, value):
        
        self.client.nowait(
            'set_field', (Literal('browser'), self.element, value))
991404
def _add_element_attrs(elem, attrs):
	
	for attr, value in attrs.items():
		elem.attrib[attr] = value
	return elem
316787
async def field(self, elem=None, elem_type=None, params=None):
        
        elem_type = elem_type if elem_type else elem.__class__
        fvalue = None

        src = elem
        if issubclass(elem_type, x.UVarintType):
            fvalue = await self.uvarint(x.get_elem(src))

        elif issubclass(elem_type, x.IntType):
            fvalue = await self.uint(elem=x.get_elem(src), elem_type=elem_type, params=params)

        elif issubclass(elem_type, x.BlobType):
            fvalue = await self.blob(elem=x.get_elem(src), elem_type=elem_type, params=params)

        elif issubclass(elem_type, x.UnicodeType):
            fvalue = await self.unicode_type(x.get_elem(src))

        elif issubclass(elem_type, x.VariantType):
            fvalue = await self.variant(elem=x.get_elem(src), elem_type=elem_type, params=params)

        elif issubclass(elem_type, x.ContainerType):  # container ~ simple list
            fvalue = await self.container(container=x.get_elem(src), container_type=elem_type, params=params)

        elif issubclass(elem_type, x.TupleType):  # tuple ~ simple list
            fvalue = await self.tuple(elem=x.get_elem(src), elem_type=elem_type, params=params)

        elif issubclass(elem_type, x.MessageType):
            fvalue = await self.message(x.get_elem(src), msg_type=elem_type)

        else:
            raise TypeError

        return fvalue if self.writing else x.set_elem(elem, fvalue)
206697
function (el, cls) {
        cls = getString(cls);
        if (!cls) return;
        if (Array.isArray(cls)) {
            cls.forEach(function(c) {
                dom.addClass(el, c);
            });
        } else if (el.classList) {
            el.classList.add(cls);
        } else {
            if (!hasClass(el, cls)) {
                if (el.classList) {
                    el.classList.add(cls);
                } else {
                    el.className += ' ' + cls;
                }
            }
        }
    }
1279060
def fromElement(cls, elem):
        

        self = cls()

        self.oid = elem.get("OID")
        self.name = elem.get("Name")
        return self
214504
def tag(self, tag, child='', enclose=0, newline=True, **kwargs):
        
        kw = kwargs.copy()
        _class = ''
        if '_class' in kw:
            _class = kw.pop('_class')
        if 'class' in kw:
            _class += ' ' + kw.pop('class')
        tag_class = self.tag_class.get(tag, '')
        if tag_class:
            #if tag_class definition starts with '+', and combine it with original value
            if tag_class.startswith('+'):
                kw['class'] = tag_class[1:] + ' ' + _class.lstrip()
            else:
                kw['class'] = tag_class.lstrip()
        else:
            kw['class'] = _class.lstrip()
            
        #process inner and outter link
        if tag == 'a':
            print ('------', kw)
            href = kw.get('href', '#')
            if href and (href.startswith('http:') or href.startswith('https:') or href.startswith('ftp:')):
                _cls = 'outter'
            else:
                _cls = 'inner'
                kw['href'] = href
            if kw.get('class'):
                kw['class'] = kw['class'] + ' ' + _cls
            else:
                kw['class'] = _cls
            
        attrs = ' '.join(['%s="%s"' % (x, y) for x, y in sorted(kw.items()) if y])
        if attrs:
            attrs = ' ' + attrs
        nline = '\n' if newline else ''
        if child:
            enclose = 2
        if enclose == 1:
            return '<%s%s/>%s' % (tag, attrs, nline)
        elif enclose == 2:
            return '<%s%s>%s</%s>%s' % (tag, attrs, child, tag, nline)
        else:
            return '<%s%s>%s' % (tag, attrs, nline)
778849
async def load_field(obj, elem_type, params=None, elem=None):
    
    if issubclass(elem_type, x.UVarintType) or issubclass(elem_type, x.IntType) or isinstance(obj, (int, bool)):
        return set_elem(elem, obj)

    elif issubclass(elem_type, x.BlobType):
        fvalue = await load_blob(obj, elem_type)
        return set_elem(elem, fvalue)

    elif issubclass(elem_type, x.UnicodeType) or isinstance(elem, str):
        return set_elem(elem, obj)

    elif issubclass(elem_type, x.VariantType):
        fvalue = await load_variant(obj, elem=get_elem(elem), elem_type=elem_type, params=params)
        return set_elem(elem, fvalue)

    elif issubclass(elem_type, x.ContainerType):  # container ~ simple list
        fvalue = await load_container(obj, elem_type, params=params, container=get_elem(elem))
        return set_elem(elem, fvalue)

    elif issubclass(elem_type, x.MessageType):
        fvalue = await load_message(obj, msg_type=elem_type, msg=get_elem(elem))
        return set_elem(elem, fvalue)

    else:
        raise TypeError