<commit_before>from google.cloud import bigquery

bigquery_client = bigquery.Client()<commit_msg>I can now create a dataset and table automatically<commit_after>from google.cloud import bigquery
from google.cloud.bigquery import dataset
from google.cloud.bigquery.schema import SchemaField
import logging

# Not sure if the following helps
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()

# Here we go http://gcloud-python.readthedocs.io/en/latest/bigquery-schema.html

GOOGLE_SERVICE_ACCOUNT = None

def put(json):
    client = bigquery.Client(project='gaend-157207')
    dataset = bigquery.dataset.Dataset("testing", client=client)


    if dataset.exists():
        logging.error("dataset already created")
    else:
        dataset.create()

    schema = [
        SchemaField(name='name', field_type='STRING'),
        SchemaField(name='breed', field_type='STRING'),
        SchemaField(name='born', field_type='DATETIME'),
    ]

    table = bigquery.table.Table("dogs", dataset, schema=schema)
    if table.exists():
        logging.error("table already created")
    else:
        table.create()

put("pug")
{'fraction_non_alphanumeric': 0.1097872340425532, 'fraction_numerical': 0.005957446808510639, 'mean_word_length': 4.273542600896861, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6391044', 'n_tokens_mistral': 339, 'n_tokens_neox': 332, 'n_words': 78}