def get_summary(config, bugnumber):
bugzilla_url_regex = re.compile(<EOL>re.escape("<STR_LIT>") + r"<STR_LIT>"<EOL>)<EOL>if bugzilla_url_regex.search(bugnumber.split("<STR_LIT:#>")[<NUM_LIT:0>]):<EOL><INDENT>bugzilla_id, = bugzilla_url_regex.search(bugnumber.split("<STR_LIT:#>")[<NUM_LIT:0>]).groups()<EOL>bugzilla_id = int(bugzilla_id)<EOL>summary, url = bugzilla.get_summary(config, bugzilla_id)<EOL>return summary, bugzilla_id, url<EOL><DEDENT>github_url_regex = re.compile(r"<STR_LIT>")<EOL>if github_url_regex.search(bugnumber.split("<STR_LIT:#>")[<NUM_LIT:0>]):<EOL><INDENT>org, repo, id_, = github_url_regex.search(bugnumber.split("<STR_LIT:#>")[<NUM_LIT:0>]).groups()<EOL>id_ = int(id_)<EOL>title, url = github.get_title(config, org, repo, id_)<EOL>return title, id_, url<EOL><DEDENT>if bugnumber.isdigit():<EOL><INDENT>repo = config.repo<EOL>state = read(config.configfile)<EOL>fork_name = state.get("<STR_LIT>", getpass.getuser())<EOL>if config.verbose:<EOL><INDENT>info_out("<STR_LIT>".format(fork_name))<EOL><DEDENT>candidates = []<EOL>for origin in repo.remotes:<EOL><INDENT>if origin.name == fork_name:<EOL><INDENT>continue<EOL><DEDENT>url = origin.url<EOL>org, repo = parse_remote_url(origin.url)<EOL>github_title, github_url = github.get_title(<EOL>config, org, repo, int(bugnumber)<EOL>)<EOL>if github_title:<EOL><INDENT>candidates.append((github_title, int(bugnumber), github_url))<EOL><DEDENT><DEDENT>bugzilla_summary, bugzilla_url = bugzilla.get_summary(config, bugnumber)<EOL>if bugzilla_summary:<EOL><INDENT>candidates.append((bugzilla_summary, int(bugnumber), bugzilla_url))<EOL><DEDENT>if len(candidates) > <NUM_LIT:1>:<EOL><INDENT>info_out(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>for title, _, url in candidates:<EOL><INDENT>info_out("<STR_LIT>".format(url))<EOL>info_out("<STR_LIT>".format(title))<EOL><DEDENT>error_out("<STR_LIT>")<EOL><DEDENT>elif len(candidates) == <NUM_LIT:1>:<EOL><INDENT>return candidates[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>error_out("<STR_LIT>")<EOL><DEDENT>raise Exception(bugnumber)<EOL><DEDENT>return bugnumber, None, None<EOL>
return a summary for this bug/issue. If it can't be found,
    return None.