This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess, getpass | |
| def get_gpu_usage(): | |
| """ | |
| Returns a dict which contains information about memory usage for each GPU. | |
| In the following output, the GPU with id "0" uses 5774 MB of 16280 MB. | |
| 253 MB are used by other users, which means that we are using 5774 - 253 MB. | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import sys | |
| access_key = "..." | |
| secret_key = "..." | |
| session = boto3.Session( | |
| aws_access_key_id=access_key, | |
| aws_secret_access_key=secret_key | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import subprocess | |
| import re | |
| import optparse | |
| import boto | |
| dynamodb_conn = boto.connect_dynamodb(aws_access_key_id='MY_ACCESS_KEY_ID', aws_secret_access_key='MY_SECRET_ACCESS_KEY') | |
| table_name = 'mytable' | |
| dynamodb_table = dynamodb_conn.get_table(table_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from boto.dynamodb2.exceptions import ValidationException | |
| from boto.dynamodb2.fields import HashKey, RangeKey | |
| from boto.dynamodb2.layer1 import DynamoDBConnection | |
| from boto.dynamodb2.table import Table | |
| from boto.exception import JSONResponseError | |
| from time import sleep | |
| import sys | |
| if len(sys.argv) != 3: | |
| print 'Usage: %s <source_table_name> <destination_table_name>' % sys.argv[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link rel="import" href="../core-icon-button/core-icon-button.html"> | |
| <link rel="import" href="../core-toolbar/core-toolbar.html"> | |
| <link rel="import" href="../paper-tabs/paper-tab.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |