-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
34 lines (26 loc) · 909 Bytes
/
test.py
File metadata and controls
34 lines (26 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# from tensorflow.python.client import device_lib
# import tensorflow as tf
# def get_available_gpus():
# local_device_protos = device_lib.list_local_devices()
# return [x.name for x in local_device_protos]# """ if x.device_type == 'GPU' """]
# print(get_available_gpus())
# print(tf.test.gpu_device_name())
import json
import os
import sys
import pprint
pp = pprint.PrettyPrinter(indent=4)
Join = os.path.join
PATH = os.path.abspath(os.path.dirname(__file__))
def main():
file1 = Join(PATH, "data/CNN_transcript/cnnt/trancript.cnn.com.TRANSCRIPTS.1612.01.cnnt.01.html.json")
with open(file1) as jsonFile:
jsonData = json.load(jsonFile)
for i, (key, value) in enumerate(jsonData.items()):
print(key)
if key == "sections":
# pass
pp.pprint(value)
# pp.pprint(jsonData)
if __name__ == '__main__':
main()