content stringlengths 4 20k |
|---|
"""create recipe task result comment table
Revision ID: 4b9b07299243
Revises: 2cc8e59635f5
Create Date: 2016-02-05 16:27:38.887778
"""
# revision identifiers, used by Alembic.
revision = '4b9b07299243'
down_revision = '2cc8e59635f5'
from alembic import op
from sqlalchemy import Column, ForeignKey, Integer, Unicode,... |
"""
Exception for errors raised while parsing OPENQASM.
"""
from qiskit import QISKitError
class QasmError(QISKitError):
"""Base class for errors raised while parsing OPENQASM."""
def __init__(self, *msg):
"""Set the error message."""
super().__init__(*msg)
self.msg = ' '.join(msg)
... |
from octario.lib import logger
LOG = logger.LOG
class OctarioException(Exception):
"""Base Octario Exception
To use this class, inherit from it and define a
a 'msg_fmt' property. That msg_fmt will get printf'd
with the keyword arguments provided to the constructor.
"""
msg_fmt = "An unknow... |
from django.db import models
from django import template
from django.utils.functional import cached_property
from polymorphic import PolymorphicModel
class Tracking(models.Model):
'''
ABC for keeping created/edited fields up to date.
'''
created = models.DateTimeField(default=timezone.now, editable=F... |
"""
Dtella - Client Main Module
Copyright (C) 2008 Dtella Labs (http://www.dtella.org/)
Copyright (C) 2008 Paul Marks (http://www.pmarks.net/)
Copyright (C) 2008 Jacob Feisley (http://www.feisley.com/)
$Id$
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General P... |
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
# We use /people/[query] to automatically load the people list view
# and search for query. There are tree reserved urls, r'/people/me/?',
# r'/people/invite/?' and r'/people/alumni/?' which we want to point to
# 'profiles_view_my... |
#!/usr/bin/python
#cconsole.log processing
#Casep, <EMAIL>
#2010/12/27
import sys
import re
import os.path
###
USAGE = '''PARSE ERROR: ''' + (sys.argv[0]) + ''' logFile countLogFileName '''
###
def hasWarning(s):
return s.find('SIGDANGER') != -1
def getLines():
countFileName = sys.argv[2]
if os.path.exi... |
# -*- coding: utf-8 -*-
import copy
from django.contrib.auth.models import User, Permission
from django.contrib.sites.models import Site
from django.contrib.flatpages.models import FlatPage
from django.contrib.contenttypes.models import ContentType
from admin_extras import conf
def create_obj(model, defaults, commit... |
import itertools
from lollypop.sqlcursor import SqlCursor
from lollypop.define import Lp, Type
class MpdDatabase:
"""
Databse request from MPD module
"""
def count(self, album, artist_id, genre_id, year):
"""
Count songs and play time
@param album as string
... |
from __future__ import unicode_literals
from six.moves.urllib.parse import parse_qs
from botocore.awsrequest import AWSPreparedRequest
from moto.elb.responses import ELBResponse
from moto.elbv2.responses import ELBV2Response
def api_version_elb_backend(*args, **kwargs):
"""
ELB and ELBV2 (Classic and Applica... |
from collections import defaultdict
import numpy
def cluster_data(clusters, data):
'''
Given the cluster identities and data return a dictionary keyed on
cluster identity with data in the form of a numpy array.
'''
adict = defaultdict(list)
for cluster_id, thing in zip(clusters, data):
... |
import discord
import asyncio
import botinfo
client = discord.Client() # initialize client
client.start(botinfo.token) # log in
@client.event
async def on_message(message):
server = client.get_server(botinfo.serverid) # I have to do this here because scope
args = message.content.split(" ") # split message int... |
import logging
from datetime import datetime
from waitlist.base import db
from waitlist.storage.database import APICacheCorporationInfo
from waitlist.utility.outgate.exceptions import ESIException, check_esi_response
from waitlist.utility.swagger.eve.corporation import CorporationEndpoint, CorporationInfo
logger = lo... |
"""
Some utility functions to perform actions lazily upon the first
call to a function.
"""
import functools
class lazycall(object):
"""Wrap a callable which returns itself callables,
so that it is executed lazily, i.e. the wrapped callable
is only called (once) on the first call to the returned callable... |
# -*- coding: utf-8 -*-
"""This file contains a plugin for cron syslog entries."""
import pyparsing
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.parsers import syslog
from plaso.parsers.syslog_plugins import interface
class CronTaskRunEventData(syslog.SyslogLineEventData):
... |
#!/usr/bin/env python
from setuptools import setup
__version__ = '0.6.1'
CLASSIFIERS = map(str.strip,
"""Environment :: Console
License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Natural Language :: English
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming ... |
#! /usr/bin/env python
from openturns import *
from math import sqrt, pi, exp
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
ResourceMap.SetAsUnsignedInteger("RandomMixture-DefaultMaxSize", 4000000)
try:
# Create a collection of test-cases and the associated references
numberOfTests = 3
testCases = list()
... |
# -*- coding: utf-8 -*-
import collections
from six.moves import collections_abc
from ..operator import Operator
from ..constants import STR_TYPES
class StarEndBaseOpeartor(Operator):
# Is the operator a keyword
kind = Operator.Type.MATCHER
# Chain aliases
aliases = (
'word', 'string', 'num... |
from couchpotato import get_session
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.core.settings.model import Status
lo... |
"""
.. moduleauthor:: Mihai Andrei <<EMAIL>>
"""
import numpy
from tvb.core.adapters.abcadapter import ABCAsynchronous
from tvb.core.entities.storage import dao
from tvb.datatypes.connectivity import Connectivity
from tvb.datatypes.region_mapping import RegionMapping
class ConnectivityCreator(ABCAsynchronous):
"... |
"""
Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false.
Example 1:
Input: nums = [1,2,3,4,5]
Output: true
Explanation: Any triplet where i < j < k is valid.
Example 2:
Input: nums = [5,... |
import io
import os
import pytest
import uqbar.io
import supriya.cli
expected_files = [
"test_project/test_project/materials/.gitignore",
"test_project/test_project/materials/__init__.py",
"test_project/test_project/materials/test_material/__init__.py",
"test_project/test_project/materials/test_mater... |
"""
Name: 'PyPRP Importer'
Blender: 249
Group: 'Import'
Submenu: 'Full age (.age)' i_age
Submenu: 'Single prp (.prp)' i_prp
Submenu: 'Single prp, extract all textures (.prp)' i_prp_tex
Tooltip: 'GoW PyPRP Importer'
"""
#temporany removed options
#Submenu: 'Raw span (.raw)' i_raw_span
__author__ = "GoW PyPRP Team"
__u... |
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... |
# -*- coding: utf-8 -*-
import datetime
import json
import os.path
from enum import Enum
from collections import defaultdict
import fitbit
from torimotsu import settings
FITBIT_TOKEN = os.path.join(os.path.dirname(__file__), '../../.token.json')
class MealType(Enum):
"""
@see: https://dev.fitbit.com/docs/f... |
import webtest
import web
import tempfile
class SessionTest(webtest.TestCase):
def setUp(self):
app = web.auto_application()
session = self.make_session(app)
class count(app.page):
def GET(self):
session.count += 1
return str(session.count)
... |
ts_reserved_keywords = {'abstract', 'await', 'boolean', 'break', 'byte', 'case', 'catch', 'char', 'class',
'const', 'continue', 'debugger', 'default', 'delete', 'do', 'double', 'else', 'enum',
'export', 'extends', 'false', 'final', 'finally', 'float', 'for', 'function', '... |
"""
Code for rpc message dispatching.
Messages that come in have a version number associated with them. RPC API
version numbers are in the form:
Major.Minor
For a given message with version X.Y, the receiver must be marked as able to
handle messages of version A.B, where:
A = X
B >= Y
The Major versi... |
from __future__ import print_function
import espressomd._system as es
import espressomd
from espressomd import thermostat
from espressomd import code_info
from espressomd import analyze
from espressomd import integrate
from espressomd import electrostatics
from espressomd import electrostatic_extensions
import numpy
p... |
import numpy as np
import random
import Grid
from IPython.display import clear_output
from keras.layers.core import Dense, Activation
from keras.models import Sequential
from keras.optimizers import RMSprop
def create_model():
model = Sequential()
model.add(Dense(164, init='lecun_uniform', input_shape=(64,)))... |
import subprocess
import re
class DockerWrapper:
board = "Num\t CONTAINER ID IMAGE " \
"COMMAND CREATED STATUS PORTS NAMES"
board_image = "Num\t REPOSITORY ... |
"""
Remove unneeded Regressions table.
This table can and should be reintroduced by an experiment that requires it.
"""
import sqlalchemy as sa
from sqlalchemy import Column, ForeignKey, Integer, String, Table
from benchbuild.utils.schema import exceptions, metadata
META = metadata()
REGRESSION = Table(
'regress... |
import zlib
import httplib
import urllib
import urllib2
import gzip
import StringIO
import json
from urlparse import urlparse
# POST
def post(host, url, params):
parameters = urllib.urlencode(params)
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain",
"Accept... |
from django.contrib import admin
import models
admin.site.register(models.Currency) |
import heapq, weakref
import numpy
import cuda
class Variable(object):
"""Array with a structure to keep track of computation
Every variable holds a data array of type either :class:`~numpy.ndarray` or
:class:`~pycuda.gpuarray.GPUArray`.
A Variable object may be constructed in two ways: by the user ... |
#!/usr/bin/env python3
# New Transactions
import pymysql
def mainactions(args_list, configs, db_cur) :
help_string='''
Usage:
* Default: Returns the number of new transactions added over a period of time
(By Default 1 Day). By Default Warn Crit Time is the format for
customization otherwise it's 50/100'''
unkn... |
import numpy as np
#Trowing a dice for N times and evaluating the expectation
dice = np.random.randint(low=1, high=7, size=3)
print("Expectation (3 times): " + str(np.mean(dice)))
dice = np.random.randint(low=1, high=7, size=10)
print("Expectation (10 times): " + str(np.mean(dice)))
dice = np.random.randint(low=1, hig... |
__source__ = 'https://leetcode.com/problems/find-and-replace-in-string/'
# Time: O(NQ)
# Space: O(N)
#
# Description: Leetcode # 833. Find And Replace in String
#
# To some string S, we will perform some replacement operations that
# replace groups of letters with new ones (not necessarily the same size).
#
# Each rep... |
from __future__ import unicode_literals
from flask import Markup, url_for
from babel.dates import format_date, format_datetime
def _single_get(item, key):
# First, try to lookup the key as if the item were a dict. If
# that fails, lookup the key as an atrribute of an item.
try:
val = item[key]
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Script to download time tables as PDF and calculate route durations based on relations for the routes in OpenStreetMap
from common import *
import os
import sys
import io
import logging
import json
import datetime
import time
#from unidecode import unidecode
import overpas... |
#! ../env/bin/python
# -*- coding: utf-8 -*-
from silverflask import create_app
from silverflask import db
from silverflask.models import Page, User, SiteTree, SuperPage, GalleryImage, ImageObject
from test_base import BaseTest
class TestVersioning(BaseTest):
# Test for testing versioning
def setUp(self):
... |
import logging
import urlparse
import openerp.http
_logger = logging.getLogger(__name__)
try:
from raven.handlers.logging import SentryHandler
from raven.processors import SanitizePasswordsProcessor
from raven.utils.wsgi import get_environ, get_headers
except ImportError:
_logger.debug('Cannot import ... |
import tempfile
import unittest
import os
from coalib import coala_delete_orig
from coala_utils.ContextManagers import retrieve_stderr
from coalib.parsing.DefaultArgParser import PathArg
from coalib.settings.Section import Section
from coalib.settings.Setting import Setting
class coalaDeleteOrigTest(unittest.TestCas... |
# Hunter's Meal (a 2D Game)
# Developers : Abdul Mohsin Siddiqi
import random, sys, time, math, pygame
from random import randint
from pygame.locals import *
FPS = 30 # frames per second to update the screen
WINWIDTH = 640 # width of the program's window, in pixels
WINHEIGHT = 480 # height in pixels
HALF_WINWIDTH = i... |
"""Provide info to system health."""
import os
from homeassistant.components import system_health
from homeassistant.core import HomeAssistant, callback
SUPERVISOR_PING = f"http://{os.environ['HASSIO']}/supervisor/ping"
OBSERVER_URL = f"http://{os.environ['HASSIO']}:4357"
@callback
def async_register(
hass: Hom... |
from sqlalchemy import Column, ForeignKey, Unicode
from sqlalchemy.orm import relationship
from condor.models.base import AuditableMixing, DeclarativeBase
class Query(AuditableMixing, DeclarativeBase):
__tablename__ = 'query'
bibliography_eid = Column(
Unicode(40),
ForeignKey('bibliography.... |
from numpy import absolute, full, linspace, meshgrid, nan, product, rot90
from ._plot_2d import _plot_2d
from .estimate_kernel_density import estimate_kernel_density
from .infer import infer
from .plot_points import plot_points
def infer_assuming_independence(
variables,
variable_types=None,
bandwidths="... |
import numpy as np
import matplotlib.pyplot as plt
class prettyfloat(float):
def __repr__(self):
return "%0.2f" % self
data=[]
data.extend(np.random.normal(8,1,10))
data.extend(np.random.normal(16,1,26))
X=[i for i in range(len(data))]
print map(prettyfloat,data)
#data=[7.46, 9.60, 7.45, 9.03, 9.65, 8.42, ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 10 15:15:55 2016
Script to extract location data from a set of las files and produce a summary
table.
@author: Simon J Oldfield
"""
# MVP - Script that extracts location data from a series of las files
# result should be assembled in a form that can later be manipulate... |
from __future__ import division
import time
import math
import json
import numpy as np
from libmushu.amplifier import Amplifier
PRESETS = [
['Random noise at 50Hz, 16Channels',
{'fs' : 50, 'channels' : 16}],
['Random noise at 1kHz, 128Channels',
{'fs' : 1000, 'channels' : 12... |
naicsmatch = [
{'NAICS': 111, 'IO': 1, 'desc': 'Farms'},
{'NAICS': 112, 'IO': 1, 'desc': 'Farms'},
{'NAICS': 113, 'IO': 2, 'desc': 'Forestry, fishing, and related activities'},
{'NAICS': 114, 'IO': 2, 'desc': 'Forestry, fishing, and related activities'},
{'NAI... |
#
# v0.1
# <EMAIL>
#
import json, urllib2
def axapi_auth(host, username, password):
base_uri = 'https://'+host
auth_payload = {"credentials": {"username": username, "password": password}}
r = axapi_action(base_uri + '/axapi/v3/auth', payload=auth_payload)
signature = json.loads(r)['authresponse']['si... |
# Create a script to run a random hyperparameter search.
import copy
import getpass
import os
import random
import numpy as np
import gflags
import sys
NYU_NON_PBS = False
NAME = "07_03_sm_bidir"
SWEEP_RUNS = 20
LIN = "LIN"
EXP = "EXP"
EXP_OPT = "EXP_OPT"
SS_BASE = "SS_BASE"
BOOL = "BOOL"
CHOICE = "CHOICE"
FLAGS = ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import deque, OrderedDict
import numpy as np
from ray.rllib.utils import try_import_tf
tf = try_import_tf()
def unflatten(vector, shapes):
i = 0
arrays = []
for shape in shapes:... |
import os
import sys
from sqlalchemy import Table, Column, ForeignKey, Integer, String, Date, Numeric
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy.sql import select, func
Base = declarative_base()
class Shelter(B... |
from datetime import datetime
from typing import Optional, TYPE_CHECKING
from superset.db_engine_specs.base import BaseEngineSpec
from superset.utils import core as utils
if TYPE_CHECKING:
from superset.connectors.sqla.models import TableColumn
class CrateEngineSpec(BaseEngineSpec):
engine = "crate"
en... |
"""Unit tests for the `iris.io.run_callback` function."""
# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests
import mock
import iris.exceptions
import iris.io
class Test_run_callback(tests.IrisTest):
def setUp(self):
tests.IrisTe... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AdAccount'
db.create_table('facebook_ads_adaccount', (
('id', self.gf('django.... |
# coding: utf-8
from __future__ import unicode_literals
import copy
import json
from mock import Mock, MagicMock
import pytest
from boxsdk.config import API, Client, Proxy
from boxsdk.network import default_network
from boxsdk.network.default_network import DefaultNetworkResponse, DefaultNetwork
from boxsdk.session... |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from shoop.admin.base import AdminModule, MenuEntry
from shoop.admin.utils.urls import derive_model_url, get_edit_and_list_urls
from shoop.core.models import Supplier
class SupplierModule(AdminModule):
name = _("Supp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Cassandra Stress Test
Usage:
stresstest [--username=<name>] [--passwd=<passwd>] [--port=<number>] [--keyspace=<name>] [--keys=<num>] [--size=<bytes>] [--ttl=<secs>] [--replication=<num>] [--timeout=<secs>] <servers>...
stresstest -h | --help
stresstest -v | --ver... |
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from tuskar_ui import api as tuskar
from tuskar_ui.infrastructure. \
resource_management.flavors.tabs import FlavorDetailTabs
class DetailView(tabs.TabView... |
import numpy as n
size = 300000000
NN = 3 # or any positive integer
x = n.random.normal(size=(size, NN))
x /= n.linalg.norm(x, axis=1)[:, n.newaxis]
theta = n.arctan(x.T[1]/x.T[2])*180/n.pi
phi = n.arctan((x.T[0]**2+x.T[1]**2)**0.5/x.T[2])*180/n.pi
#topdir = '/data17s/darksim/MD/MD_1.0Gpc/h5_lc/clustering_catalogs_... |
import csv
import json
import sys
import os
import random
from datetime import datetime
from sqlalchemy import and_, or_
# Add the top level of the repo so this script can import application modules
sys.path.insert(0, os.path.dirname('..'))
from bcycle import db
from bcycle.v1.models import Kiosk, Rider, Trip, Rout... |
import json
import logging
import getpass
import argparse
from sleekxmpp.jid import JID, InvalidJID
import armonic.common
from armonic.utils import OsTypeMBS, OsTypeDebianWheezy, OsTypeAll
def jidType(string):
try:
jid = JID(string)
except InvalidJID:
raise argparse.ArgumentTypeError('Incorr... |
import numpy
import pytest
import marvin
from tests.conftest import set_the_config
# Inputs are [class, plateifu, release, coords,
# aperture_params, aperture_type, coord_type, threshold]
# Outputs are [n_pixels, n_spaxels]. n_pixels are pixels on the mask that have
# a value of 1. n_spaxels are the numb... |
r"""
PYTHONPATH=./gen-py:../../lib/py/build/lib... ./FastbinaryTest.py
"""
# TODO(dreiss): Test error cases. Check for memory leaks.
import math
import os
import sys
import timeit
from copy import deepcopy
from pprint import pprint
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol... |
# -*- coding: utf-8 -*-
# run.py
#
# Created by Thomas Nelson <<EMAIL>>
#
# Created..........2015-03-12
# Modified.........2015-03-12
# Import required modules
import random
# Import required user made modules
from scheduler import Store, Employee, Individual
common_grounds = Store()
employee_list = []
employee... |
import pytest
from airflow.providers.google.firebase.example_dags.example_firestore import (
DATASET_NAME, EXPORT_DESTINATION_URL,
)
from tests.providers.google.cloud.utils.gcp_authenticator import G_FIREBASE_KEY
from tests.test_utils.gcp_system_helpers import FIREBASE_DAG_FOLDER, GoogleSystemTest, provide_gcp_con... |
import os
import sys
from gpu_tests import gpu_integration_test
from gpu_tests import path_util
data_path = os.path.join(
path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'media')
wait_timeout = 60 # seconds
harness_script = r"""
var domAutomationController = {};
domAutomationController._succeede... |
from oslotest import mockpatch
from tempest.tests.lib import fake_auth_provider
from tempest.lib.services.compute import server_groups_client
from tempest.tests.lib import fake_http
from tempest.tests.lib.services import base
class TestServerGroupsClient(base.BaseServiceTest):
server_group = {
"id": "5b... |
"""Validators to determine the current webserver configuration"""
import logging
import socket
import requests
import zope.interface
import six
from acme import crypto_util
from acme import errors as acme_errors
from certbot import interfaces
logger = logging.getLogger(__name__)
@zope.interface.implementer(interf... |
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import DEAD_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_0
from ryu.ofp... |
#!/usr/bin/python
# This is run by the BUILDER, never on the actual nodes.
# It will test to see if the domains exist, and only if they do not,
# Attempt to create and initialize.
import boto.sdb
from boto.sts import STSConnection
import sys
from pprint import pprint
appId ="{{ priam_cluster_name }}"
def put_record... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import *
from ansible.playbook.attribute import FieldAttribute
from ansible.template import Templar
class Conditional:
'''
This is a mix-in class, to be used with Base to allow the object
to be run... |
import sys
import logging
from luma.core import error, cmdline
from .ticker import run
from .endpoint import create_endpoint
def main(actual_args=None):
"""
Entry point for console script.
"""
if actual_args is None:
actual_args = sys.argv[1:]
# logging
logging.basicConfig(
... |
""" Django specific database helper functions. """
from tldap import Q
from tldap.database import Changeset, Database, LdapObjectClass, get_one
from tldap.django.models import Counters
from tldap.exceptions import ObjectDoesNotExist
def _check_exists(database: Database, table: LdapObjectClass, key: str, value: str):... |
# encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Proposal.institution'
db.add_column('votes_proposal', 'institution', self.gf('django.db.models.fields.CharField')(default='EU', max_length=63),... |
from scitbx import matrix
from dials.algorithms.refinement.parameterisation.crystal_parameters import (
CrystalOrientationMixin,
CrystalUnitCellMixin,
)
from dials.algorithms.refinement.parameterisation.scan_varying_model_parameters import (
GaussianSmoother,
ScanVaryingModelParameterisation,
ScanV... |
"""
By starting at the top of the triangle below and moving to adjacent numbers on
the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below:
75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 ... |
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
import os.path
import os
import time
import schedule
from datetime import date
from pollio import PollIO
from pollparse import PollParse, FileLoadError
from polltweet import PollTweet, MediaTweet
class ConfigFileError(Exception):... |
"""
vtkImageImportFromArray: a NumPy front-end to vtkImageImport
Load a python array into a vtk image.
To use this class, you must have NumPy installed (http://numpy.scipy.org/)
Methods:
GetOutput() -- connect to VTK image pipeline
SetArray() -- set the array to load in
Convert python 'Int' to VTK_UNSIGNED_S... |
"""
Tool for automatically suggesting the next version of a project
according to semantic versioning.
Autobump inspects how a version-controlled project has changed over time, identifies
the major, minor and patch changes as specified by semantic versioning, and proposes
a new version based on the previous one.
The t... |
""" Charon: nosetests /api/v1/seqrun
Requires env vars CHARON_API_TOKEN and CHARON_BASE_URL.
"""
import os
import json
import requests
import nose
def url(*segments):
"Synthesize absolute URL from path segments."
return "{0}api/v1/{1}".format(BASE_URL,'/'.join([str(s) for s in segments]))
API_TOKEN = os.get... |
import re
import requests
from scrapers.models.dog import Dog
#Small reverse engineering of the pet finder api
class PetFinderApi():
def __init__(self, zip_code):
self.zip_code = zip_code
@staticmethod
def _get_api_key():
response = requests.get('https://www.petfinder.com/wp-content/th... |
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import render_to_response, get_object_or_404
from annoying.functions import get_object_or_None
from django.template import RequestContext
from django.utils.translation import ugett... |
"""Add fields to VPN service table
Revision ID: 24f28869838b
Revises: 30018084ed99
Create Date: 2015-07-06 14:52:24.339246
"""
from alembic import op
import sqlalchemy as sa
from neutron.db import migration
# revision identifiers, used by Alembic.
revision = '24f28869838b'
down_revision = '30018084ed99'
# milest... |
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchemy import desc
from sqlalchemy import exc
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import Numeric
from sqlalchemy import select
from sqlalchemy import Table
from sqlalchemy import table
from sqlalchemy.ext.com... |
import re
from ark.cli import *
from ark.event_handler import EventHandler
from ark.rcon import Rcon
from ark.scheduler import Scheduler
from ark.storage import Storage
class Task_GetChat(Scheduler):
@staticmethod
def run():
if len(Storage.players_online_steam_name):
Rcon.send('GetChat',T... |
from gamegrid import *
# ---------------- Constantes clavier --------
K_LEFT = 37
K_UP = 38
K_RIGHT = 39
K_DOWN = 40
# ---------------- classe Frog ---------------
class Frog(Actor):
def __init__(self):
Actor.__init__(self, "sprites/frog.gif")
def collide(self, actor... |
import json
import os
import tempfile
import time
import unittest
from pyflink.common import ExecutionConfig, RestartStrategies
from pyflink.dataset import ExecutionEnvironment
from pyflink.table import DataTypes, BatchTableEnvironment, CsvTableSource, CsvTableSink
from pyflink.testing.test_case_utils import PyFlinkT... |
"""
Tools for sending email.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the int... |
"""Interface for aggregators."""
import datetime
import logging
from flask import current_app
import elasticsearch
import pandas
from timesketch.lib.charts import manager as chart_manager
from timesketch.lib.datastores.elastic import ElasticsearchDataStore
from timesketch.models.sketch import Sketch as SQLSketch
l... |
#-*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.core.validators import RegexValidator
from django.db import models
class CompanyInfo(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL)
name = models.CharField(max_length=100)
nip =... |
from collections import OrderedDict
import json
from pathlib import Path
import shutil
import tempfile
import unittest
import migrator.config
class TestConfig(unittest.TestCase):
def test_default_driver(self):
self.assertEqual('psql', migrator.config.DEFAULT_DATABASE_DRIVER)
def test_config(self):
... |
def test_other_conferences(app):
"""Tests if citation datatables work for records."""
with app.test_client() as client:
response = client.get('/ajax/conferences/series?recid=1331207&seriesname=Rencontres%20de%20Moriond')
assert response.status_code == 200
response = client.get('/ajax/co... |
from gnuradio.filter import filter_design
from gnuradio import gr, filter
from gnuradio import blocks
import sys
try:
from gnuradio import qtgui
from PyQt4 import QtGui, QtCore
import sip
except ImportError:
sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n")
sys.exit(1)
try:
fr... |
"""job_runner is a scheduler that runs specific commands at certain times.
Each command is represented by an Action class that may have
information about when and how often a job should be run, as well as
information about jobs that should be run before or after itself; see
the class documentation for details.
job_ru... |
from __future__ import unicode_literals
from django.template.defaultfilters import slugify
from mezzanine.conf import settings
from mezzanine.pages.page_processors import processor_for
from mezzanine.utils.views import paginate
from cartridge.shop.models import Category, Product
@processor_for(Category)
def catego... |
"""
************************************************************************
FOR THE TIME BEING WHATEVER MODIFICATIONS ARE APPLIED TO THIS FILE
SHOULD ALSO BE APPLIED TO sdk_package_registry IN ANY OTHER PARTNER REPOS
************************************************************************
"""
import json
import loggin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.