code stringlengths 1 199k |
|---|
from mindfeed.mindfeed import main
if __name__ == "__main__":
main() |
import falcon
import json
class QuoteResource:
def on_get(self, req, resp):
"""Handles GET requests"""
quote = {
'quote': 'I\'ve always been more interested in the future than in the past.',
'author': 'Grace Hopper'
}
resp.body = json.dumps(quote)
api = falcon... |
from __future__ import absolute_import
from celery import shared_task
import os.path
import logging
import csv
from django.core.exceptions import ObjectDoesNotExist
from .RandomAuthorSet import RandomAuthorSet
from ..CitationFinder import CitationFinder, EmptyPublicationSetException
from scholarly_citation_finder impor... |
"""
helloworld.py
Author: Nils Kingston
Credit: none
Assignment:
Write and submit a Python program that prints the following:
Hello, world!
"""
print("Hello, world!") |
import sys
CONTINUATION_ENDLINE = "&\n"
CONTINUATION_STARTLINE = " &"
MIN_LENGTH = len(CONTINUATION_STARTLINE) + len(CONTINUATION_ENDLINE) + 1
FIXED_LINE_LENGTH = 80 # We don't actually do fixed format files, but I prefer 80 col anyway.
FREE_LINE_LENGTH = 132
DEFAULT_LINE_LENGTH = FREE_LINE_LENGTH
STDERR = sys.std... |
import socket
import pytest
import mock
from pygelf import GelfTcpHandler, GelfUdpHandler, GelfHttpHandler, GelfTlsHandler, GelfHttpsHandler
from tests.helper import logger, get_unique_message, log_warning, log_exception
SYSLOG_LEVEL_ERROR = 3
SYSLOG_LEVEL_WARNING = 4
@pytest.fixture(params=[
GelfTcpHandler(host='1... |
from setuptools import setup, find_packages
try:
from pyqt_distutils.build_ui import build_ui
cmdclass = {'build_ui': build_ui}
except ImportError:
cmdclass = {}
setup(
name='foo',
version='0.1',
packages=find_packages(),
license='MIT',
author='Colin Duquesnoy',
author_email='colin.d... |
from __future__ import absolute_import, unicode_literals, division
import hashlib
import hmac
import time
from quadriga.exceptions import RequestError
class RestClient(object):
"""REST client using HMAC SHA256 authentication.
:param url: QuadrigaCX URL.
:type url: str | unicode
:param api_key: QuadrigaC... |
import os
import stat
def which(name, all = False):
"""which(name, flags = os.X_OK, all = False) -> str or str set
Works as the system command ``which``; searches $PATH for ``name`` and
returns a full path if found.
If `all` is :const:`True` the set of all found locations is returned, else
the first... |
import os
import sys
import time
from pycket import impersonators as imp
from pycket import values, values_string
from pycket.cont import continuation, loop_label, call_cont
from pycket.arity import Arity
from pycket import values_parameter
from pycket import values_struct
from pycket import values_regex
from pycket im... |
class Item(object):
def __init__(self, path, name):
self.path = path
self.name = name |
import functools
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline impo... |
from sys import platform as sys_plat
import platform
import os
from ctypes import *
if sys_plat == "win32":
def find_win_dll(arch):
""" Finds the highest versioned windows dll for the specified architecture. """
dlls = []
filename = 'VimbaC.dll'
# look in local working directory firs... |
import sys
sys.path.append('../fml/')
import os
import numpy as np
import fml
import random
t_width = np.pi / 4.0 # 0.7853981633974483
d_width = 0.2
cut_distance = 6.0
r_width = 1.0
c_width = 0.5
PTP = {\
1 :[1,1] ,2: [1,8]#Row1
,3 :[2,1] ,4: [2,2]#Row2\
,5 :[2,3] ,6: [2,4] ,7 :[2,5] ,8 ... |
"""
This file implements a wrapper for facilitating domain randomization over
robosuite environments.
"""
import numpy as np
from robosuite.utils.mjmod import CameraModder, DynamicsModder, LightingModder, TextureModder
from robosuite.wrappers import Wrapper
DEFAULT_COLOR_ARGS = {
"geom_names": None, # all geoms ar... |
from sfmutils.api_client import ApiClient
import argparse
import logging
import sys
log = logging.getLogger(__name__)
def main(sys_argv):
# Arguments
parser = argparse.ArgumentParser(description="Return WARC filepaths for passing to other commandlines.")
parser.add_argument("--harvest-start", help="ISO8601 ... |
NAME="Phone Alert Status" |
import requests, urllib, httplib, base64
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route("/")
def hello():
return render_template("index.html")
@app.route("/search", methods=['POST', 'GET'])
def callAPI():
error = None
_url = 'https://api.projectoxford.ai/vision/v1.0/oc... |
from libcontractvm import Wallet, WalletExplorer, ConsensusManager
from forum import ForumManager
import sys
import time
consMan = ConsensusManager.ConsensusManager ()
consMan.bootstrap ("http://127.0.0.1:8181")
wallet = WalletExplorer.WalletExplorer (wallet_file='test.wallet')
srMan = ForumManager.ForumManager (consMa... |
"""
Production Configurations
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis for cache
- Use sentry for error logging
"""
from __future__ import absolute_import, unicode_literals
from boto.s3.connection import OrdinaryCallingFormat
from django.utils import six
imp... |
from path import Path
import zipfile
import urllib2
Path('tmp').mkdir_p()
for model_name in ('seq2seq','seq2tree'):
for data_name in ('jobqueries','geoqueries','atis'):
fn = '%s_%s.zip' % (model_name, data_name)
link = 'http://dong.li/lang2logic/' + fn
with open('tmp/' + fn, 'wb') as f_out:
f_out.wr... |
"""
RESTful API Auth resources
--------------------------
"""
import logging
from flask_login import current_user
from flask_restplus_patched import Resource
from flask_restplus._http import HTTPStatus
from werkzeug import security
from app.extensions.api import Namespace
from . import schemas, parameters
from .models ... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "InBrowserEditor.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
"""
Copyright (C) 2012 Alan J Lockett
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, copy, modify, merge, publish, distribute, ... |
__all__ = ['chatcommand', 'execute_chat_command', 'save_matchsettings', '_register_chat_command']
import functools
import inspect
from .events import eventhandler, send_event
from .log import logger
from .asyncio_loop import loop
_registered_chat_commands = {} # dict of all registered chat commands
async def execute_c... |
"""Callback a callable asset."""
import struct
import decimal
D = decimal.Decimal
from . import (util, config, exceptions, litecoin, util)
from . import order
FORMAT = '>dQ'
LENGTH = 8 + 8
ID = 21
def validate (db, source, fraction, asset, block_time, block_index, parse):
cursor = db.cursor()
problems = []
... |
from __future__ import unicode_literals
import logging
log = logging.getLogger(__name__) # noqa
log.addHandler(logging.NullHandler()) # noqa
from netmiko.ssh_dispatcher import ConnectHandler
from netmiko.ssh_dispatcher import ssh_dispatcher
from netmiko.ssh_dispatcher import redispatch
from netmiko.ssh_dispatcher impor... |
from django.conf.urls import patterns, url
from .views import FeedList, ImportView, AddView
from .ajax import mark_as_read
urlpatterns = patterns(
'',
url(r'^$', FeedList.as_view(), name="feedme-feed-list"),
url(r'^by_category/(?P<category>[-\w]+)/$', FeedList.as_view(),
name='feedme-feed-list-by-ca... |
from modules.chart_module import ChartModule
import tornado.web
import logging
class LineChartModule(ChartModule):
def render(self, raw_data, keys, chart_id="linechart"):
self.chart_id = chart_id
self.chart_data = self.overtime_linechart_data(raw_data, keys)
return self.render_string('module... |
import glob
import re
import sys
import time
from src.io.storage import get_request_items, store_fingerprint, get_number_of_malformed_requests
from static import variables
from static.arguments import parse_arguments
from static.blacklist import Blacklist
from static.logger import setup_logger, LOGNAME_START
from src.e... |
class Board(object):
"""This class defines the board"""
def __init__(self, board_size):
"""The initializer for the class"""
self.board_size = board_size
self.board = []
for index in range(0, self.board_size):
self.board.append(['0'] * self.board_size)
def is_on_bo... |
import os.path
import time
import urllib
import json
import requests
from tencentyun import conf
from .auth import Auth
class ImageProcess(object):
def __init__(self, appid, secret_id, secret_key, bucket):
self.IMAGE_FILE_NOT_EXISTS = -1
self._secret_id,self._secret_key = secret_id,secret_key
... |
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following automatically:
- fetch all translations using the tx tool
- post-process them into valid and committable format
- remove invalid control characters
- remove location tags (makes diffs less noisy)
... |
import time
from ctypes import *
from io import BytesIO
import wave
import platform
import logging
import os
import contextlib
logging.basicConfig(level=logging.DEBUG)
BASEPATH=os.path.split(os.path.realpath(__file__))[0]
def not_none_return(obj, defobj):
if obj:
return obj
else:
return defobj
c... |
import unittest
from fam.tests.models.test01 import Dog, Cat, Person, JackRussell, Monarch
from fam.mapper import ClassMapper
class MapperTests(unittest.TestCase):
def setUp(self):
self.mapper = ClassMapper([Dog, Cat, Person, JackRussell, Monarch])
def tearDown(self):
pass
def test_sub_class... |
import random
lista = []
for x in range(10):
numero = random.randint(1, 100)
if x == 0:
maior, menor = numero, numero
elif numero > maior:
maior = numero
elif numero < menor:
menor = numero
lista.append(numero)
lista.sort()
print(lista)
print("Maior: %d" % maior)
print("Menor... |
import pyb
import micropython
micropython.alloc_emergency_exception_buf(100)
led1 = pyb.LED(4) # 4 = Blue
led2 = pyb.LED(3) # 3 = Yellow
pin = pyb.Pin('SW', pyb.Pin.IN, pull=pyb.Pin.PULL_UP)
def callback(line):
led1.toggle()
if pin.value(): # 1 = not pressed
led2.off()
else:
led2.on()
ext = ... |
from webalchemy import config
FREEZE_OUTPUT = 'webglearth.html'
class Earth:
def __init__(self):
self.width = window.innerWidth
self.height = window.innerHeight
# Earth params
self.radius = 0.5
self.segments = 64
self.rotation = 6
self.scene = new(THREE.Scene)... |
"""cdbgui.py
Developers: Christina Hammer, Noelle Todd
Last Updated: August 19, 2014
This file contains a class version of the interface, in an effort to
make a program with no global variables.
"""
from datetime import datetime, timedelta, date
from tkinter import *
from tkinter import ttk
from cdbifunc2 import *
impo... |
"""This module contains functions to :meth:`~reload` the database, load work and
citations from there, and operate BibTeX"""
import importlib
import re
import textwrap
import warnings
import subprocess
from copy import copy
from collections import OrderedDict
from bibtexparser.bwriter import BibTexWriter
from bibtexpar... |
import sys
sys.path.insert(0, '/Users/neo/workspace/devops')
from netkiller.docker import *
from compose.devops import devops
from compose.demo import demo
if __name__ == "__main__":
try:
docker = Docker()
# docker.env({'DOCKER_HOST':'ssh://root@192.168.30.13','COMPOSE_PROJECT_NAME':'experiment'})
... |
from setuptools import setup
setup(
name='nspawn-api',
packages=['nspawn'],
include_package_data=True,
install_requires=[
'gunicorn',
'nsenter',
'flask',
'pydbus',
'supervisor'
],
) |
LIST_NUM = [(1,4),(5,1),(2,3),(6,9),(7,1)]
'''
用max函数获取到元素的最大值,然后用冒泡进行排序
'''
for j in range(len(LIST_NUM) -1):
for i in range(len(LIST_NUM) -1):
if max(LIST_NUM[i]) > max(LIST_NUM[i + 1]):
A = LIST_NUM[i]
LIST_NUM[i] = LIST_NUM[i + 1]
LIST_NUM[i + 1] = A
print LIST_NUM |
from psyrun.backend import DistributeBackend, LoadBalancingBackend
from psyrun.mapper import (
map_pspace,
map_pspace_parallel,
map_pspace_hdd_backed)
from psyrun.pspace import Param
from psyrun.scheduler import ImmediateRun, Sqsub
from psyrun.store import DefaultStore, PickleStore
from psyrun.version impor... |
""" discover and run doctests in modules and test files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import platform
import sys
import traceback
from contextlib import contextmanager
import pytest
from _pytest._code.code import Exception... |
import ldap
class Connection:
def __init__(self, url='ldap://annuaire.math.univ-paris-diderot.fr:389', \
base='ou=users,dc=chevaleret,dc=univ-paris-diderot,dc=fr'):
self.base = base
self.url = url
self.con = ldap.initialize(self.url)
self.con.bind_s('', '')
def __del_... |
"""Approximating spectral functions with tensor networks.
"""
import numpy as np
import random
import quimb as qu
from .tensor_gen import MPO_rand, MPO_zeros_like
def construct_lanczos_tridiag_MPO(A, K, v0=None, initial_bond_dim=None,
beta_tol=1e-6, max_bond=None, seed=False,
... |
import sublime
import sublime_plugin
from ..core import oa_syntax, decorate_pkg_name
from ..core import ReportGenerationThread
from ...lib.packages import PackageList
class PackageReportThread(ReportGenerationThread):
"""
Generate a tabular report of all installed packages and their state.
"""
def _proc... |
import numpy as np
import cv2
from sys import argv
class Test:
def __init__(self, name, image):
self.image = image
self.name = name
self.list = []
def add(self, function):
self.list.append(function)
def run(self):
cv2.imshow(self.name, self.image)
for function... |
"""
Component that performs TensorFlow classification on images.
For a quick start, pick a pre-trained COCO model from:
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md
For more details about this platform, please refer to the documentation at
https://home-assistan... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
('id', models.AutoField(auto_created=Tr... |
import subprocess
import sys
import os
numLambda = 512
numStepsEquilib = 1600000
numStepsAnal = 16000
numStepsSnapshot = 1000
numStepsReq = 16000
sysWidth = 32
sysLength = 32
analInterval = 1
numPasses = 100
timeInterval = 1.0
dataLocation = "dim2Runs/lambdaScan1/"
lambdaMin = 0.05
lambdaMax = 1.25
rateStepSize = (lamb... |
from __future__ import division
import codecs
import re
def calWordProbability(infile, outfile):
'''
计算词概率,源语言词翻译成目标语言词的概率
一个源语言可能对应多个目标语言,这里计算平均值
infile: 输入文件 格式:source word \t target word
outfile: source word \t target word \t probability
'''
with codecs.open(infile, 'r', 'utf8') as fin:... |
import pyaudiogame
spk = pyaudiogame.speak
MyApp = pyaudiogame.App("My Application")
my_name = "Frastlin"
my_age = 42
my_song = """
My application tis to be,
the coolest you've ever seen!
"""
def logic(actions):
key = actions['key']
if key == "a":
#Here is our one line of text, it will speak when we press a
spk(m... |
import numpy as np
import pandas as pd
from scipy.optimize import least_squares
import re
import lmfit
class Calibrate:
def __init__(self, model):
"""initialize Calibration class
Parameters
----------
model : ttim.Model
model to calibrate
"""
self.model = ... |
from app import db, GenericRecord
class Case(GenericRecord):
__collection__ = 'cases'
db.register([Case]) |
from __future__ import absolute_import
from __future__ import print_function
import argparse
import distutils.spawn
import subprocess
import sys
import virtualenv
def main(argv=None):
parser = argparse.ArgumentParser(description=(
'A wrapper around virtualenv that avoids sys.path sadness. '
'Any add... |
def run():
import sys, os
try:
uri = sys.argv[1]
except IndexError:
uri = os.getcwd()
import gtk
from .app import App
from uxie.utils import idle
application = App()
idle(application.open, uri)
gtk.main() |
from django.shortcuts import render
from table.views import FeedDataView
from app.tables import (
ModelTable, AjaxTable, AjaxSourceTable,
CalendarColumnTable, SequenceColumnTable,
LinkColumnTable, CheckboxColumnTable,
ButtonsExtensionTable
)
def base(request):
table = ModelTable()
return render(... |
from . import common
import hglib
class test_branches(common.basetest):
def test_empty(self):
self.assertEquals(self.client.branches(), [])
def test_basic(self):
self.append('a', 'a')
rev0 = self.client.commit('first', addremove=True)
self.client.branch('foo')
self.append... |
from .utils import Serialize
class Symbol(Serialize):
__slots__ = ('name',)
is_term = NotImplemented
def __init__(self, name):
self.name = name
def __eq__(self, other):
assert isinstance(other, Symbol), other
return self.is_term == other.is_term and self.name == other.name
de... |
from datetime import datetime
from flask import Blueprint, jsonify, request
from app.dao.fact_notification_status_dao import (
get_total_notifications_for_date_range,
)
from app.dao.fact_processing_time_dao import (
get_processing_time_percentage_for_date_range,
)
from app.dao.services_dao import get_live_servi... |
import os
import requests
import sys
structure_template = 'src/{}/kotlin/solutions/day{}'
solver_template = """
package solutions.{package}
import solutions.Solver
class {clazz}: Solver {{
override fun solve(input: List<String>, partTwo: Boolean): String {{
TODO("not implemented")
}}
}}
"""
test_templat... |
import logging
from sanic.signals import RESERVED_NAMESPACES
from sanic.touchup import TouchUp
def test_touchup_methods(app):
assert len(TouchUp._registry) == 9
async def test_ode_removes_dispatch_events(app, caplog):
with caplog.at_level(logging.DEBUG, logger="sanic.root"):
await app._startup()
log... |
"""
Codec_Map.py
Created by amounra on 2010-10-05.
Copyright (c) 2010 __artisia__. All rights reserved.
This file allows the reassignment of the controls from their default arrangement. The order is from left to right;
Buttons are Note #'s and Faders/Rotaries are Controller #'s
"""
CHANNEL = 0 #main channel (0 - 15)
... |
from __future__ import print_function
import datetime
import calendar
import logging
import time
import re
import os
import os.path
from abc import ABCMeta
from abc import abstractmethod
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
fr... |
import os
from cauldron.test import support
from cauldron.test.support import scaffolds
class TestAlias(scaffolds.ResultsTest):
"""..."""
def test_unknown_command(self):
"""Should fail if the command is not recognized."""
r = support.run_command('alias fake')
self.assertTrue(r.failed, 's... |
def test1():
SINK(SOURCE)
def test2():
s = SOURCE
SINK(s)
def source():
return SOURCE
def sink(arg):
SINK(arg)
def test3():
t = source()
SINK(t)
def test4():
t = SOURCE
sink(t)
def test5():
t = source()
sink(t)
def test6(cond):
if cond:
t = "Safe"
else:
... |
"""
This module contains a single class that manages the scraping of data
from one or more supermarkets on mysupermarket.co.uk
"""
from datetime import datetime
from os import remove
from os.path import isfile, getmtime
from time import time
from scrapy import signals
from scrapy.crawler import Crawler
from scrapy.util... |
from django.contrib.sites import models as site_models
from django.db import models
def _get_current_site(request):
# Attempts to use monodjango.middleware.SiteProviderMiddleware
try:
return Site.objects.get_current(request)
except TypeError:
pass
return Site.objects.get_current()
class ... |
import unittest
from datetime import datetime
from balance import BasicLoader, RepayLoader
from base_test import BaseTest
class LoaderTests(BaseTest, unittest.TestCase):
def test_basic_loader(self):
loader = BasicLoader('tests/data/basic_loader')
entries, errors = loader.load(return_errors=True)
... |
GENDER = ((u'男',u'男'),(u'女',u'女')) |
"""
Package constants
"""
__author__ = 'krishna bhogaonker'
__copyright__ = 'copyright 2017'
__credits__ = ['krishna bhogaonker']
__license__ = "MIT"
__version__ = '0.1.0'
__maintainer__ = 'krishna bhogaonker'
__email__ = 'cyclotomiq@gmail.com'
__status__ = 'pre-alpha'
from aenum import Enum
class RequestTypes(Enum):
... |
from Models.Submission import Submission
from Core.Database import Database
from Core.Scorer import Score
from sqlalchemy import func, desc
class Ranking():
@staticmethod
def get_all():
session = Database.session()
scores = session.query(Score).order_by(desc(Score.score)).all()
return [{... |
from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from gaegraph.model import Node, Arc
class Escravo(Node):
name = ndb.StringProperty(required=True)
age = ndb.IntegerProperty()
birth = ndb.DateProperty(auto_now=True)
price = ndb.FloatProperty()
estatura = ... |
"""
Created on Wed Sep 09 14:51:02 2015
@author: Methinee
"""
import pandas as pd
import numpy as np
from collections import defaultdict
from astropy.table import Table, Column
df = pd.read_csv('../data/CS_table_No2_No4_new.csv',delimiter=";", skip_blank_lines = True,
error_bad_lines=False)
headers=lis... |
import os
import json
from subprocess import check_output, CalledProcessError
_TREE_PATH="data/graph/"
def renderGraph(query):
"""
Returns the path to a svg file that
contains the graph render of the query.
Creates the svg file itself if it
does not already exist.
"""
#Comput... |
quicksort(A, lo, hi):
if lo < hi:
p := partition(A, lo, hi)
quicksort(A, lo, p - 1)
quicksort(A, p + 1, hi) |
import click
from click.testing import CliRunner
import docker
import sys
import time
import requests
this = sys.modules[__name__]
BASE_URL = 'unix://var/run/docker.sock'
REGISTRY = 'pokeybill/bftest'
DIGEST = 'sha256:79215d32e5896c1ccd3f57d22ee6aaa7c9d79c9c87737f2b96673186de6ab060'
@click.group()
def default():
""... |
import random
import sys
import traceback
import os
import math
import argparse
import time
import random_connected_graph
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='Simulates a P2P network with random dynamic connectivity in order... |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
... |
import pendulum
locale = "nb"
def test_diff_for_humans():
with pendulum.test(pendulum.datetime(2016, 8, 29)):
diff_for_humans()
def diff_for_humans():
d = pendulum.now().subtract(seconds=1)
assert d.diff_for_humans(locale=locale) == "for 1 sekund siden"
d = pendulum.now().subtract(seconds=2)
... |
import django
django.setup()
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.test import APIClient
from customers.models import Customer, Email
class CustomersTest(APITestCase, TestCase):
def test_api_should_accept_multiple_emails_fo... |
import os
import sys
import fnmatch
directory = os.path.dirname(os.path.realpath(sys.argv[0])) #get the directory of your script
for subdir, dirs, files in os.walk(directory):
print(files)
for filename in files:
if fnmatch.fnmatch(filename,'mpsdk_*') > 0:
subdirectoryPath = os.path.relpath(subdir, directory) #ge... |
import asyncio
import inspect
import itertools
import string
import typing
from .. import helpers, utils, hints
from ..requestiter import RequestIter
from ..tl import types, functions, custom
if typing.TYPE_CHECKING:
from .telegramclient import TelegramClient
_MAX_PARTICIPANTS_CHUNK_SIZE = 200
_MAX_ADMIN_LOG_CHUNK_... |
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^profiles/', include('easy_profiles.urls')),
(r'^admin/', include(admin.site.urls)),
) |
"""
Created on Wed Nov 15 14:09:59 2017
@author: SaintlyVi
"""
import pandas as pd
import numpy as np
from support import writeLog
def uncertaintyStats(submodel):
"""
Creates a dict with statistics for observed hourly profiles for a given year.
Use evaluation.evalhelpers.observedHourlyProfiles() to generate... |
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^img1x1$', 'ses_analytics.views.img1x1', name='img1x1'), # used to trace email opening
# TODO: unsubscription and SNS feedback notifications
) |
import pickle
import pytest
from doit.cmdparse import DefaultUpdate, CmdParseError, CmdOption, CmdParse
class TestDefaultUpdate(object):
def test(self):
du = DefaultUpdate()
du.set_default('a', 0)
du.set_default('b', 0)
assert 0 == du['a']
assert 0 == du['b']
du['b'] ... |
"""
Created on Jan 24, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Jan 24, 2012"
import os
import unittest
from pymatgen.core.structure import Structure
from pymatgen.io.cs... |
subreddit = 'comedynecrophilia'
t_channel = '@comedynecrophilia'
def send_post(submission, r2t):
return r2t.send_simple(submission) |
from collections import defaultdict
def topsort(graph):
if not graph:
return []
# 1. Count every node's dependencies
count = defaultdict(int)
for node in graph:
for dependency in graph[node]:
count[dependency] += 1
# 2. Find initial nodes - The ones with no incoming edges... |
from PyQt4 import QtCore, QtGui
from acq4.util.DataManager import *
import acq4.pyqtgraph as pg
from acq4.util.DictView import *
import acq4.util.metaarray as metaarray
import weakref
class FileDataView(QtGui.QSplitter):
def __init__(self, parent):
QtGui.QSplitter.__init__(self, parent)
#self.manage... |
"""
CritSend test proyect urls.
Copyright (C) 2013 Nicolas Valcárcel Scerpella
Authors:
Nicolas Valcárcel Scerpella <nvalcarcel@gmail.com>
"""
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^', include('upload.urls'... |
"""The IPython kernel implementation"""
import getpass
import sys
import traceback
from IPython.core import release
from IPython.html.widgets import Widget
from IPython.utils.py3compat import builtin_mod, PY3
from IPython.utils.tokenutil import token_at_cursor, line_at_cursor
from IPython.utils.traitlets import Instanc... |
"""Test cases for JSON lws_logger module, assumes Pytest."""
from jsonutils.lws import lws_logger
class TestDictToTreeHelpers:
"""Test the helper functions for dict_to_tree."""
def test_flatten_list(self):
"""Test flattening of nested lists."""
f = lws_logger.flatten_list
nested = [1, [2... |
import os
import unittest
import random
import xmlrunner
host = os.environ['FALKONRY_HOST_URL'] # host url
token = os.environ['FALKONRY_TOKEN'] # auth token
class TestDatastream(unittest.TestCase):
def setUp(self):
self.created_datastreams = []
self.fclient = FClient(host=host, token=token, op... |
"""
aaaaaa bbbb cc dddd ee
d
aa d d
d a b c
"""
"""
c 100
e 101
a 00
d 01
b 11
"""
import sys # Nutný pro zjištění parametrů příkazové řádky
import copy # Jen pro můj duševní klid
def countCharactersInFile( filename ):
"""
Spočítá počet výskytů znak... |
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject
class ErpInventory(IdentifiedObject):
"""Utility inventory-related information about an item or part (and not for description of the item and its attributes). It is used by ERP applications to enable the synchronization of Inventory data that exists ... |
from TimeWorked import *
import os
files = [TIME_WORKED]
print get_total_time_by_day_files(files)
raw_input() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.