<commit_before>#! /usr/bin/env python2.7

'''
Perform CRUD operations on GitHub Gists.
Common arguments to all fucnctions:
    1. token: The access token for the API.
    2. api: API URL for the endpoint, other than GitHub.
'''

import re
import json

import requests

# For testing only.
VAULT = json.loads(open('vault/login.json', 'r').read())
LOGIN = (VAULT['username'], VAULT['password'])
GH_TOKEN = VAULT['gh_token']
GHE_TOKEN = VAULT['ghe_token']

# Default API URL.
GITHUB_API_URL = 'https://api.github.com'

# Common headers.
GIST_HEADER = {
    'Accept': ('application/vnd.github.VERSION.raw+json,'
               'application/vnd.github.VERSION.base64+json'),
}


def parse_link_header(page, expression):
    '''
    Helper method for check_page_limit.
    '''<commit_msg>Updated HTTP headers.<commit_after>#! /usr/bin/env python2.7

'''
Perform CRUD operations on GitHub Gists.
Common arguments to all fucnctions:
    1. token: The access token for the API.
    2. api: API URL for the endpoint, other than GitHub.
'''

import re
import json

import requests

# For testing only.
VAULT = json.loads(open('vault/login.json', 'r').read())
LOGIN = (VAULT['username'], VAULT['password'])
GH_TOKEN = VAULT['gh_token']
GHE_TOKEN = VAULT['ghe_token']

# Default API URL.
GITHUB_API_URL = 'https://api.github.com'

# Common headers.
GIST_HEADER = {
    'Accept': ('application/vnd.github.v3.raw+json,'
               'application/vnd.github.v3.base64+json'),
}


def parse_link_header(page, expression):
    '''
    Helper method for check_page_limit.
    '''
{'fraction_non_alphanumeric': 0.14276568501920614, 'fraction_numerical': 0.008962868117797696, 'mean_word_length': 3.8540372670807455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1598996', 'n_tokens_mistral': 541, 'n_tokens_neox': 530, 'n_words': 140}