This file contains 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
def session_test(session): | |
session.interpreter = 'python2.7' | |
session.install('-e', '.[grpc]') | |
session.install('pytest') | |
session.run('pytest', '-x', 'google') |
This file contains 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
# Copyright 2015 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains 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 gcr.io/google_appengine/python-compat-multicore | |
# Install scipy dependences | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
python-scipy | |
# Add app code | |
ADD . /app/ |
This file contains 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
#! /bin/bash | |
# Copyright 2013 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains 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 google.appengine.ext import ndb | |
def reaping_task(): | |
search_string = "spam" | |
# Disable all caching, this prevents out of memory errors as we | |
# go through the whole dataset. If we don't do this, ndb will | |
# try to keep a copy of every entity we look at. | |
ndb.get_context().set_cache_policy(lambda key: False) |
This file contains 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
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, 'http://metadata/computeMetadata/v1/instance/service-accounts/default/token'); | |
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Metadata-Flavor: Google']); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | |
$resp = curl_exec($curl); | |
curl_close($curl); | |
// The client library expects the 'created' property to be set on the access token. | |
$token = json_decode($resp, true); | |
$token['created'] = time(); |
This file contains 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 luxe.collision.ShapeDrawerLuxe; | |
import luxe.collision.shapes.Shape; | |
import luxe.collision.Collision; | |
import luxe.collision.CollisionData; | |
import luxe.Entity; | |
import luxe.Color; | |
class CollisionManager { |
This file contains 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 ferris3 | |
import endpoints | |
import protopigeon | |
from protorpc import messages | |
from google.appengine.ext import ndb | |
class ExampleProperty(ndb.StringProperty): | |
def _to_base_type(self, value): | |
return "---" + str(value) + "---" |
This file contains 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 | |
import json | |
import argparse | |
import random | |
import string | |
PROJECT = None | |
REGION = 'us-central1' | |
ZONE = 'us-central1-f' |
This file contains 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 ferris3 | |
from google.appengine.ext import ndb | |
class Todo(ndb.Model): | |
text = ndb.StringProperty(default='', indexed=False) | |
done = ndb.BooleanProperty(default=False) | |
created = ndb.DateTimeProperty(auto_now_add=True) | |