def get_ebnf_template():
spec_dir = config["<STR_LIT>"]["<STR_LIT>"]["<STR_LIT>"]<EOL>local_fp = f"<STR_LIT>"<EOL>repo_url = (<EOL>"<STR_LIT>"<EOL>)<EOL>params = {}<EOL>github_access_token = os.getenv("<STR_LIT>", "<STR_LIT>")<EOL>if github_access_token:<EOL><INDENT>params = {"<STR_LIT>": github_access_token}<EOL><DEDENT>try:<EOL><INDENT>r = requests.get(repo_url, params=params)<EOL>if r.status_code == <NUM_LIT:200>:<EOL><INDENT>template_url = r.json()["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>log.warning("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>r = requests.get(template_url, params=params, allow_redirects=True)<EOL>if r.status_code == <NUM_LIT:200>:<EOL><INDENT>open(local_fp, "<STR_LIT>").write(r.text)<EOL><DEDENT>else:<EOL><INDENT>log.warning(<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>log.warning(<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>log.warning("<STR_LIT>")<EOL>if not os.path.exists(f"<STR_LIT>"):<EOL><INDENT>log.error("<STR_LIT>")<EOL><DEDENT><DEDENT>return local_fp<EOL>
Get EBNF template from Github belbio/bel_specifications repo