Return assembled DOT a_list string.

    >>> a_list('spam', {'spam': None, 'ham': 'ham ham', 'eggs': ''})
    'label=spam eggs="" ham="ham ham"'
436181
def a_list(label=None, kwargs=None, attributes=None):
    
    result = ['label=%s' % quote(label)] if label is not None else []
    if kwargs:
        items = ['%s=%s' % (quote(k), quote(v))
            for k, v in tools.mapping_items(kwargs) if v is not None]
        result.extend(items)
    if attributes:
        if hasattr(attributes, 'items'):
            attributes = tools.mapping_items(attributes)
        items = ['%s=%s' % (quote(k), quote(v))
            for k, v in attributes if v is not None]
        result.extend(items)
    return ' '.join(result)
857092
def used_labels(self):
        
        result = []

        tmp = self.asm.strip(' \n\r\t')
        if not len(tmp) or tmp[0] in ('#', ';'):
            return result

        try:
            tmpLexer = asmlex.lex.lex(object=asmlex.Lexer(), lextab='zxbasmlextab')
            tmpLexer.input(tmp)

            while True:
                token = tmpLexer.token()
                if not token:
                    break

                if token.type == 'ID':
                    result += [token.value]
        except:
            pass

        return result
1204933
def label_from_lists(self, train_labels:Iterator, valid_labels:Iterator, label_cls:Callable=None, **kwargs)->'LabelList':
        ""
        label_cls = self.train.get_label_cls(train_labels, label_cls)
        self.train = self.train._label_list(x=self.train, y=label_cls(train_labels, **kwargs))
        self.valid = self.valid._label_list(x=self.valid, y=self.train.y.new(valid_labels, **kwargs))
        self.__class__ = LabelLists
        self.process()
        return self
1041041
def list(cls,
             l,
             order=None,
             header=None,
             output="table",
             sort_keys=True,
             show_none=""
             ):
        
        d = {}
        count = 0
        for entry in l:
            name = str(count)
            d[name] = entry
            count += 1
        return cls.dict(d,
                        order=order,
                        header=header,
                        sort_keys=sort_keys,
                        output=output,
                        show_none=show_none)
488530
def as_list(self):
        
        if hasattr(self, 'cust_list'):
            return self.cust_list
        if hasattr(self, 'attr_check'):
            self.attr_check()
        cls_bltns = set(dir(self.__class__))
        ret = [a for a in dir(self) if a not in cls_bltns and getattr(self, a)]
        return ret
408172
def listscripts(self):
        
        code, data, listing = self.__send_command(
            "LISTSCRIPTS", withcontent=True)
        if code == "NO":
            return None
        ret = []
        active_script = None
        for l in listing.splitlines():
            if self.__size_expr.match(l):
                continue
            m = re.match(br'"([^"]+)"\s*(.+)', l)
            if m is None:
                ret += [l.strip(b'"').decode("utf-8")]
                continue
            script = m.group(1).decode("utf-8")
            if self.__active_expr.match(m.group(2)):
                active_script = script
                continue
            ret += [script]
        self.__dprint(ret)
        return (active_script, ret)
1099356
def list2str(self, l: List, joiner: str) -> str:
        
        result = str()
        for item in l:
            if isinstance(item, list):
                result = result + self.list2str(item, joiner) + joiner
            elif isinstance(item, dict):
                result = result + self.dict2str(item, joiner) + joiner
            elif item:
                result = result + str(item) + joiner
        return result
750032
def generate_ul(self, a_list):
        '''  '''
        return len(a_list) > 0 and (isinstance(a_list[0], Rule) or
                                    isinstance(a_list[0], LabelDecl))
1013764
def _joinedQnames(self, _list):
        """"""
        try:
            s = "; ".join([p.qname for p in _list])
        except:
            s = "; ".join([p for p in _list])
        return s
712752
def access_labels(self):
        
        access_labels = []
        for referrer in self.referrers:
            referrer_labels = [key for key, val in self.root.labels.items()
                               if val == referrer]
            port_labels = [key for key, val in referrer.labels.items()
                           if val == self]
            if referrer is self.root:
                for label in port_labels:
                    access_labels.append("['{}']".format(label))
            for label in itertools.product(referrer_labels, port_labels):
                access_labels.append("['{}']".format("']['".join(label)))

        return access_labels
249350
def label(self):
        
        value = self._element_dict.get("value")
        type_name = type(value).__name__

        if type_name == "NoneType":
            return ""

        if type_name == "list":
            # ---like '10-15' or 'A-F'---
            return "-".join([str(item) for item in value])

        if type_name in ("float", "int"):
            return str(value)

        if type_name in ("str", "unicode"):
            return value

        # ---For CA and MR subvar dimensions---
        name = value.get("references", {}).get("name")
        return name if name else ""
899650
def labelset_heads(self, label):
        
        _eps = self._eps
        _vars = self._vars
        _hcons = self._hcons
        nodeids = {nodeid: _eps[nodeid][3].get(IVARG_ROLE, None)
                for nodeid in _vars[label]['refs']['LBL']}
        if len(nodeids) <= 1:
            return list(nodeids)

        scope_sets = {}
        for nid in nodeids:
            scope_sets[nid] = _ivs_in_scope(nid, _eps, _vars, _hcons)

        out = {}
        for n in nodeids:
            out[n] = 0
            for role, val in _eps[n][3].items():
                if role == IVARG_ROLE or role == CONSTARG_ROLE:
                    continue
                elif any(val in s for n2, s in scope_sets.items() if n2 != n):
                    out[n] += 1

        candidates = [n for n, out_deg in out.items() if out_deg == 0]
        rank = {}
        for n in candidates:
            iv = nodeids[n]
            pred = _eps[n][1]
            if iv in _vars and self.nodeid(iv, quantifier=True) is not None:
                rank[n] = 0
            elif pred.is_quantifier():
                rank[n] = 0
            elif pred.type == Pred.ABSTRACT:
                rank[n] = 2
            else:
                rank[n] = 1

        return sorted(candidates, key=lambda n: rank[n])
896880
def make_indices_to_labels(labels: Set[str]) -> Dict[int, str]:
    

    return {index: label for index, label in
            enumerate(["pad"] + sorted(list(labels)))}
554951
def _repr_label_vector(self, label_vector):
        

        string = ["1"]
        for cross_terms in label_vector:
            sub_string = []
            for index, order in cross_terms:
                _ = self.grid_points.dtype.names[index]
                if order > 1:
                    sub_string.append("{0}^{1}".format(_, order))
                else:
                    sub_string.append(_)
            string.append(" * ".join(sub_string))
        return " + ".join(string)
516431
def instruction_list_to_easm(instruction_list: list) -> str:
    
    result = ""

    for instruction in instruction_list:
        result += "{} {}".format(instruction["address"], instruction["opcode"])
        if "argument" in instruction:
            result += " " + instruction["argument"]
        result += "\n"

    return result
442994
def list_(self):
        
        with self.lock:
            self.send('LIST')
            list_ = {}

            while self.readable():
                msg = self._recv(expected_replies=('322', '321', '323'))

                if msg[0] == '322':
                    channel, usercount, modes, topic = msg[2].split(' ', 3)
                    modes = modes.replace(':', '', 1).replace(':', '', 1)
                    modes = modes.replace('[', '').replace( \
                                                    ']', '').replace('+', '')
                    list_[channel] = usercount, modes, topic
                elif msg[0] == '321':
                    pass
                elif msg[0] == '323':
                    break

            return list_
1289078
def p_identlist(self, t):
    '''              
                  '''
    if len(t)==5 : 
      #print(t[1],t[2],t[3],t[4])
      t[0] = t[1]+t[2]+t[3]+t[4]
    elif len(t)==4 : 
      #print(t[1],t[2],t[3])
      t[0] = t[1]+t[2]+t[3]
    elif len(t)==3 : 
      #print(t[1],t[2])
      t[0] = t[1]+t[2]
    elif len(t)==2 :
      #print(t[0],t[1])
      t[0]=t[1]
    else:
      print("Syntax error at '",str(t),"'")