<commit_before>#!/usr/bin/env python

# RADIOLOGY ---------------------------------------------------
# This is an example script to upload data (images, text, metadata) to
# google cloud storage and datastore. Data MUST be de-identified

import os

# Start google storage client for pmc-stanford
from som.api.google import Client
client = Client(use_bigquery=False, bucket_name='radiology')
collection = client.create_collection(uid='IRB41449')

# Let's load some dummy data from deid
from deid.data import get_dataset
from deid.dicom import get_files
dicom_files = get_files(get_dataset('dicom-cookies'))

# Now de-identify to get clean files
from deid.dicom import get_identifiers, replace_identifiers<commit_msg>use datastore client in example<commit_after>#!/usr/bin/env python

# RADIOLOGY ---------------------------------------------------
# This is an example script to upload data (images, text, metadata) to
# google cloud storage and datastore. Data MUST be de-identified

import os

# Start google storage client for pmc-stanford
from som.api.google.datastore import DataStoreClient as Client
client = Client(bucket_name='radiology')

# big_query not developed yet
collection = client.create_collection(uid='IRB41449')

# Let's load some dummy data from deid
from deid.data import get_dataset
from deid.dicom import get_files
dicom_files = get_files(get_dataset('dicom-cookies'))

# Now de-identify to get clean files
from deid.dicom import get_identifiers, replace_identifiers
{'fraction_non_alphanumeric': 0.138255033557047, 'fraction_numerical': 0.006711409395973154, 'mean_word_length': 3.825242718446602, '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': '3517070', 'n_tokens_mistral': 445, 'n_tokens_neox': 426, 'n_words': 146}