def build_github_url(<EOL>repo,<EOL>branch=None,<EOL>path='<STR_LIT>',<EOL>token=None<EOL>):
repo = re.sub(r"<STR_LIT>", "<STR_LIT>", repo).strip('<STR_LIT:/>')<EOL>if not path:<EOL><INDENT>path = '<STR_LIT>'<EOL><DEDENT>if not branch:<EOL><INDENT>branch = get_default_branch(repo)<EOL><DEDENT>url = '<STR_LIT>'.format(<EOL>repo, branch, path<EOL>)<EOL>if token:<EOL><INDENT>url = '<STR_LIT>'.format(url, token)<EOL><DEDENT>return url<EOL>
Builds a URL to a file inside a Github repository.