def label_search(self, key=None, value=None):
if key is not None:<EOL><INDENT>key = key.lower()<EOL><DEDENT>if value is not None:<EOL><INDENT>value = value.lower()<EOL><DEDENT>show_details = True<EOL>if key is None and value is None:<EOL><INDENT>url = '<STR_LIT>' % (self.base)<EOL>show_details = False<EOL><DEDENT>elif key is not None and value is not None:<EOL><INDENT>url = '<STR_LIT>' % (self.base, key, value)<EOL><DEDENT>elif key is None:<EOL><INDENT>url = '<STR_LIT>' % (self.base, value)<EOL><DEDENT>else:<EOL><INDENT>url = '<STR_LIT>' % (self.base, key)<EOL><DEDENT>result = self._get(url)<EOL>if len(result) == <NUM_LIT:0>:<EOL><INDENT>bot.info("<STR_LIT>")<EOL>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>bot.info("<STR_LIT>")<EOL>rows = []<EOL>for l in result:        <EOL><INDENT>if show_details is True:<EOL><INDENT>entry = ["<STR_LIT>" %(l['<STR_LIT:key>'],l['<STR_LIT:value>']),<EOL>"<STR_LIT>" %"<STR_LIT:\n>".join(l['<STR_LIT>'])]<EOL><DEDENT>else:<EOL><INDENT>entry = ["<STR_LIT>" %len(l['<STR_LIT>']),<EOL>"<STR_LIT>" %(l['<STR_LIT:key>'],l['<STR_LIT:value>']) ]<EOL><DEDENT>rows.append(entry)<EOL><DEDENT>bot.table(rows)<EOL>return rows<EOL>
search across labels