def _code_search(query, github_user=None):
github_client = temple.utils.GithubClient()<EOL>headers = {'<STR_LIT>': '<STR_LIT>'}<EOL>resp = github_client.get('<STR_LIT>',<EOL>params={'<STR_LIT:q>': query, '<STR_LIT>': <NUM_LIT:100>},<EOL>headers=headers)<EOL>if resp.status_code == requests.codes.unprocessable_entity and github_user:<EOL><INDENT>raise temple.exceptions.InvalidGithubUserError(<EOL>'<STR_LIT>'.format(github_user))<EOL><DEDENT>resp.raise_for_status()<EOL>resp_data = resp.json()<EOL>repositories = collections.defaultdict(dict)<EOL>while True:<EOL><INDENT>repositories.update({<EOL>'<STR_LIT>'.format(repo['<STR_LIT>']['<STR_LIT>']): repo['<STR_LIT>']<EOL>for repo in resp_data['<STR_LIT>']<EOL>})<EOL>next_url = _parse_link_header(resp.headers).get('<STR_LIT>')<EOL>if next_url:<EOL><INDENT>resp = requests.get(next_url, headers=headers)<EOL>resp.raise_for_status()<EOL>resp_data = resp.json()<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>return repositories<EOL>
Performs a Github API code search

    Args:
        query (str): The query sent to Github's code search
        github_user (str, optional): The Github user being searched in the query string

    Returns:
        dict: A dictionary of repository information keyed on the git SSH url

    Raises:
        `InvalidGithubUserError`: When ``github_user`` is invalid