Outputs badges list.
972170
public function print_badges_list($badges, $userid, $profile = false, $external = false) {
        global $USER, $CFG;
        foreach ($badges as $badge) {
            if (!$external) {
                $context = ($badge->type == BADGE_TYPE_SITE) ? context_system::instance() : context_course::instance($badge->courseid);
                $bname = $badge->name;
                $imageurl = moodle_url::make_pluginfile_url($context->id, 'badges', 'badgeimage', $badge->id, '/', 'f1', false);
            } else {
                $bname = s($badge->assertion->badge->name);
                $imageurl = $badge->imageUrl;
            }

            $name = html_writer::tag('span', $bname, array('class' => 'badge-name'));

            $image = html_writer::empty_tag('img', array('src' => $imageurl, 'class' => 'badge-image'));
            if (!empty($badge->dateexpire) && $badge->dateexpire < time()) {
                $image .= $this->output->pix_icon('i/expired',
                        get_string('expireddate', 'badges', userdate($badge->dateexpire)),
                        'moodle',
                        array('class' => 'expireimage'));
                $name .= '(' . get_string('expired', 'badges') . ')';
            }

            $download = $status = $push = '';
            if (($userid == $USER->id) && !$profile) {
                $url = new moodle_url('mybadges.php', array('download' => $badge->id, 'hash' => $badge->uniquehash, 'sesskey' => sesskey()));
                $notexpiredbadge = (empty($badge->dateexpire) || $badge->dateexpire > time());
                $backpackexists = badges_user_has_backpack($USER->id);
                if (!empty($CFG->badges_allowexternalbackpack) && $notexpiredbadge && $backpackexists) {
                    $assertion = new moodle_url('/badges/assertion.php', array('b' => $badge->uniquehash));
                    $action = new component_action('click', 'addtobackpack', array('assertion' => $assertion->out(false)));
                    $push = $this->output->action_icon(new moodle_url('#'), new pix_icon('t/backpack', get_string('addtobackpack', 'badges')), $action);
                }

                $download = $this->output->action_icon($url, new pix_icon('t/download', get_string('download')));
                if ($badge->visible) {
                    $url = new moodle_url('mybadges.php', array('hide' => $badge->issuedid, 'sesskey' => sesskey()));
                    $status = $this->output->action_icon($url, new pix_icon('t/hide', get_string('makeprivate', 'badges')));
                } else {
                    $url = new moodle_url('mybadges.php', array('show' => $badge->issuedid, 'sesskey' => sesskey()));
                    $status = $this->output->action_icon($url, new pix_icon('t/show', get_string('makepublic', 'badges')));
                }
            }

            if (!$profile) {
                $url = new moodle_url('badge.php', array('hash' => $badge->uniquehash));
            } else {
                if (!$external) {
                    $url = new moodle_url('/badges/badge.php', array('hash' => $badge->uniquehash));
                } else {
                    $hash = hash('md5', $badge->hostedUrl);
                    $url = new moodle_url('/badges/external.php', array('hash' => $hash, 'user' => $userid));
                }
            }
            $actions = html_writer::tag('div', $push . $download . $status, array('class' => 'badge-actions'));
            $items[] = html_writer::link($url, $image . $actions . $name, array('title' => $bname));
        }

        return html_writer::alist($items, array('class' => 'badges'));
    }
868776
def list_tags(context, id):
    

    result = job.list_tags(context, id)
    utils.format_output(result, context.format)
669374
def display_modules_list(self):
        """"""
        print("Plugins list: {}".format(
            ', '.join(sorted(self.stats.getPluginsList(enable=False)))))
        print("Exporters list: {}".format(
            ', '.join(sorted(self.stats.getExportsList(enable=False)))))
272743
def add_badge_roles(app):
    
    from docutils.nodes import inline, make_id
    from docutils.parsers.rst.roles import set_classes

    def create_badge_role(color=None):
        def badge_role(name, rawtext, text, lineno, inliner,
                       options=None, content=None):
            options = options or {}
            set_classes(options)
            classes = ['badge']
            if color is None:
                classes.append('badge-' + make_id(text))
            else:
                classes.append('badge-' + color)
            if len(text) == 1:
                classes.append('badge-one')
            options['classes'] = classes
            node = inline(rawtext, text, **options)
            return [node], []
        return badge_role

    app.add_role('badge', create_badge_role())
    app.add_role('badge-red', create_badge_role('red'))
    app.add_role('badge-blue', create_badge_role('blue'))
    app.add_role('badge-green', create_badge_role('green'))
    app.add_role('badge-yellow', create_badge_role('yellow'))
516563
def visit_desc(self):
        
        desc = []

        if self.__desc__:
            desc += [self.__desc__]

        for node in pe.utils.topological_sort(self._graph)[0]:
            if isinstance(node, LiterateWorkflow):
                add_desc = node.visit_desc()
                if add_desc not in desc:
                    desc.append(add_desc)

        if self.__postdesc__:
            desc += [self.__postdesc__]

        return ''.join(desc)
181424
def team_info():
    """"""
    teams = __get_league_object().find('teams').findall('team')
    output = []
    for team in teams:
        info = {}
        for x in team.attrib:
            info[x] = team.attrib[x]
        output.append(info)
    return output
1255230
def list(self, out=sys.stdout):
        

        out.write('-- listing properties --\n')
        for key,value in self._properties.items():
            out.write(''.join((key,'=',value,'\n')))
1361367
def show_objects(self):
        '''  '''
        for key in self.nodes:
            node = self.nodes[key]
            value = node.obj
            print(key, '-', repr(value), '-', node)
1089374
def display_list(prefix, l, color):
    
    for itm in l: print colored(prefix + itm['path'], color)
469121
def as_list(self):
        """"""
        go_id = self.go_term.id
        
        qual_str = '|'.join(self.qualifier)
        db_ref_str = '|'.join(self.db_ref)
        taxon_str = '|'.join(self.taxon)

        # with_from is currently left as a string
        # with_from = '|'.join()
        with_from_str = self.with_from or ''
        db_name_str = self.db_name or ''
        db_syn_str = '|'.join(self.db_syn)
        ext_str = '|'.join(self.ext)
        product_id_str = self.product_id or ''

        l = [
            self.db,
            self.db_id,
            self.db_symbol,
            qual_str,
            go_id,
            db_ref_str,
            self.ev_code,
            with_from_str,
            self.aspect,
            db_name_str,
            db_syn_str,
            self.db_type,
            taxon_str,
            self.date,
            self.assigned_by,
            ext_str,
            product_id_str,
        ]
        return l
836008
def listed(self):
        
        print("\nPackages in the blacklist:\n")
        for black in self.get_black():
            if black:
                print("{0}{1}{2}".format(self.meta.color["GREEN"], black,
                                         self.meta.color["ENDC"]))
                self.quit = True
        if self.quit:
            print("")
634711
public function renderBadges()
    {
        $badges = $this->badges;
        if (!$badges) {
            return '';
        }
        $pm = $this->take('package')->getPackageManager();
        $res = '';
        foreach ($badges as $badge => $tpl) {
            if (!$tpl) {
                $tpl = $this->knownBadges[$badge];
            }
            if ($tpl === 'disabled') {
                continue;
            }
            $res .= $this->renderBadge($tpl) . "\n";
        }

        return $res ? "\n$res" : '';
    }
189089
def badge(self, *args, **kwargs):
        

        return self._makeApiCall(self.funcinfo["badge"], *args, **kwargs)
496726
private function classes(): string
    {
        $classes = '';

        if ($this->bg_color !== null) {
            $classes = ' badge-' . $this->bg_color;
        }

        if ($this->text_color !== null) {
            $classes .= ' text-' . $this->text_color;
        }

        if ($this->pill === true) {
            $classes .= ' badge-pill';
        }

        return $classes;
    }
826297
def outputs(self_):
        
        outputs = {}
        for cls in classlist(self_.cls):
            for name in dir(cls):
                method = getattr(self_.self_or_cls, name)
                dinfo = getattr(method, '_dinfo', {})
                if 'outputs' not in dinfo:
                    continue
                for override, otype, idx in dinfo['outputs']:
                    if override is not None:
                        name = override
                    outputs[name] = (otype, method, idx)
        return outputs
1173109
public function getBadges()
    {

        $uri = $this->buildUserResourceUri('badges');
        $response = $this->makeAuthenticatedApiRequest($uri);

        return $response->badges;

    }
1011202
def show(self):
        """"""
        for entry in self._entries:
            print "{'%s': %s, 'records': %s}" % (
                entry._record_type, entry.host, entry.records)
        print