Skip to content

Instantly share code, notes, and snippets.

View joshourisman's full-sized avatar

Josh Ourisman joshourisman

View GitHub Profile
def test_bulk_create_timestamps(self):
provider = Provider.objects.create(**{
'url': 'http://www.google.com/',
'name': 'Google',
'names': json.dumps(['Google', ]),
'favicon_url': 'http://www.google.com/favicon.ico',
})
import_id = uuid4()
pre_create = utc.localize(datetime.datetime.utcnow())
from celery_haystack.indexes import CelerySearchIndex
from celery_haystack.signals import CelerySignalProcessor
from celery_haystack.utils import enqueue_task
from haystack.exceptions import NotHandled
class CelerySignalProcessor(CelerySignalProcessor):
def enqueue(self, action, instance, sender, **kwargs):
using_backends = self.connection_router.for_write(instance=instance)
class hashtable:
"""It's a hashtable..."""
__bucketuse = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
__table = {} # The actual hash table
__used = 0.0 # The number of entries in the table
def __init__(self, keys=None):
if keys:
for key in keys:
# Install only runtime dependencies.
FROM node:8.5-alpine AS base
RUN apk add --no-cache build-base python
COPY package.json.tmp ./package.json
COPY yarn.lock ./
ENV NODE_ENV production
RUN yarn --pure-lockfile --production=true
# Build the app.
FROM node:8.5-alpine AS build
from invoke import task
from tablib import Dataset
from yaml import load
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
from .base import set_gcloud_config, SERVICES
class hashtable:
"""It's a hashtable..."""
__bucketuse = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
__table = {} # The actual hash table
__used = 0.0 # The number of entries in the table
def __init__(self, keys=None):
if keys:
for key in keys: