def fetch_git(repo, filename, branch="<STR_LIT>", hash=None):
url = git_url(repo, filename, branch, hash)<EOL>response = requests.get(url)<EOL>if response.status_code != <NUM_LIT:200>:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>body = response.text<EOL>if not body:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>return body<EOL>
Fetch a gist and return the contents as a string.