MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / post_gist

Function post_gist

tools/gh_api.py:81–97  ·  view source on GitHub ↗

Post some text to a Gist, and return the URL.

(content, description='', filename='file', auth=False)

Source from the content-addressed store, hash-verified

79 requests.post(url, data=payload, headers=make_auth_header())
80
81def post_gist(content, description='', filename='file', auth=False):
82 """Post some text to a Gist, and return the URL."""
83 post_data = json.dumps({
84 "description": description,
85 "public": True,
86 "files": {
87 filename: {
88 "content": content
89 }
90 }
91 }).encode('utf-8')
92
93 headers = make_auth_header() if auth else {}
94 response = requests.post("https://api.github.com/gists", data=post_data, headers=headers)
95 response.raise_for_status()
96 response_data = json.loads(response.text)
97 return response_data['html_url']
98
99def get_pull_request(project, num, auth=False):
100 """Return the pull request info for a given PR number."""

Callers

nothing calls this directly

Calls 1

make_auth_headerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…