text stringlengths 12 6.59M |
|---|
from tapiriik.settings import WEB_ROOT
from tapiriik.services.service_base import ServiceAuthenticationType, ServiceBase
from tapiriik.services.interchange import UploadedActivity, ActivityType, ActivityStatistic, ActivityStatisticUnit
from tapiriik.services.api import APIException, UserException, UserExceptionType, AP... |
# Django settings for video project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Lincoln de Sousa', 'lincoln@comum.org'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NA... |
#!/usr/bin/env python
"""
A tool that automatically formats Python code to conform to the PEP 8 style
guide.
"""
import copy
import os
import re
import sys
try:
from cStringIO import StringIO
except ImportError:
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
i... |
import sys
import os
# ===========================
# = Directory Declaractions =
# ===========================
CURRENT_DIR = os.path.dirname(__file__)
NEWSBLUR_DIR = CURRENT_DIR
TEMPLATE_DIRS = (os.path.join(CURRENT_DIR, 'templates'),
os.path.join(CURRENT_DIR, 'vendor/zebra/templates'))
MEDIA_ROOT... |
#coding: latin-1
import socket
import time
import picamera
import thread
import Configuration as conf
class H264VideoStreamer:
def __init__(self):
self.name = 'streamer'
self.keeprunning = True
self.ip = conf.shinkeybotip
self.videoport = conf.videoport
self.fps = 1
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from har2tree import CrawledTree
from pathlib import Path
import datetime
import os
import uuid
class SimpleTest(unittest.TestCase):
http_redirect_ct: CrawledTree
@classmethod
def setUpClass(cls) -> None:
test_dir = ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
'''
Keeps your MPD playlist filled with music you like
Dependencies : python-mpd
pysqlite
'''
import os
import mpd
import random
import sqlite3
import time
import io
import sys
import socket
## Config
playtime = 70 # Percentage of a song that must be pla... |
# Django settings for store project.
import os
import socket
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, "apps"))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
if socket.gethostname() == "force... |
"""Utility file for generating synthetic phrases from input phrases"""
# Copyright 2022 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LIC... |
import unittest
import sys
import os
import shutil
import numpy
import traceback
from osgeo import gdal, gdal_array
TEMPLATE_GRAY = 'data/2x2_gray_template.tif'
TEMPLATE_RGB = 'data/2x2_rgb_template.tif'
TEMPLATE_RGBA = 'data/2x2_rgba_template.tif'
class Tests(unittest.TestCase):
def setUp(self):
self.... |
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
rel = lambda *x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
'''
SITE SPECIFIC CONFIGURATION
These parameters are read from file 'cog_settings.cfg'
located in directory COG_CONFIG_DIR (or by default '/usr/local/cog').
Eac... |
# Copyright (c) 2008-2016 Szczepan Faber, Serhiy Oplakanets, Herr Kaste
#
# 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... |
import Tkinter
import ttk
import tkMessageBox
from PIL import Image, ImageTk
import re
import sys
import os
import json
import reflowrestclient.utils as rest
VERSION = '0.1'
if hasattr(sys, '_MEIPASS'):
# for PyInstaller 2.0
# noinspection PyProtectedMember
RESOURCE_DIR = sys._MEIPASS
else:
# for dev... |
import time
import random
#game function
def game():
print ("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print ("Welcome to the cavern of secrets!")
print ("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
time.sleep(3)
print ("You enter a dark cavern out of curiosity. It is dark and you can only make out a sma... |
from __future__ import with_statement
from contextlib import contextmanager
import sqlite3
import simplejson as json
from common import TestCase
from api_spec import _HTablesApiTest
@contextmanager
def db_session(pool):
session = pool.get_session()
try:
yield session
finally:
pool.put_sess... |
# -*- encoding: utf-8 -*-
import os
from wafer.settings import *
try:
from localsettings import *
except ImportError:
pass
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse_lazy
pyconzadir = os.path.dirname(__file__)
STATICFILES_DIRS = (
os.path.join(... |
# -*- coding: utf-8 -*-
# Django settings for cronos project.
ADMINS = (
('cephalon, tampakrap', ''),
)
SEND_BROKEN_LINK_EMAILS = False
MANAGERS = ADMINS
from local_settings import *
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# alth... |
class BaseSettings:
USERS = ()
PROXIES = ()
CONF_CODE = ""
SCOPE = 140489887
APP_ID = 5982451
CAPTCHA_KEY = ""
CAPTCHA_SERVER = "rucaptcha"
READ_OUT = False
PLUGINS = ()
DEBUG = False
# Заполнять ниже `BotSettings`
from plugins import *
class BotSettings(BaseSettings):
... |
# Django settings for promisely project.
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'apps'))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
# Local time zone for this installation. Choices can be found here:
# h... |
import csv
import gzip
import pymongo
import os
from collections import defaultdict
ADMINS = (
('Brett Thomas', 'brettpthomas@gmail.com'),
('Ben Weisburd', 'weisburd@broadinstitute.org'),
)
MANAGERS = ADMINS
TIME_ZONE = 'America/New_York'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = Tru... |
JSON_SETTINGS = {
}
ES_SETTINGS = {
'host': 'localhost:9200',
'ssl': 'false'
}
S3_SETTINGS = {
'access_key': 'use_localsettings',
'secret_key': 'use_localsettings'
}
MONGO_SETTINGS = {
}
HBASE_SETTINGS = {
'host': 'localhost'
}
KAFKA_SETTINGS = {
'host': 'localhost:9092',
'prefix': 'd... |
import dj_database_url
import os
try:
from urlparse import urlparse
except ImportError:
from urllib import parse as urlparse
if 'DATABASE_URL' in os.environ:
DATABASES = {'default': dj_database_url.config()}
es = urlparse(os.environ.get('SEARCHBOX_SSL_URL') or
'http://127.0.0.1:92... |
from settings_common import *
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20090410')
# debug toolbar
#INSTALLED_APPS += ('debug_t... |
# -*- coding: utf-8 -*-
"""
"""
import os
# We want to seamlessy run our API both locally and on Heroku. If running on
# Heroku, sensible DB connection settings are stored in environment variables.
#MONGO_HOST = os.environ.get('MONGO_HOST', 'localhost')
#MONGO_PORT = os.environ.get('MONGO_PORT', 27017)
#MONGO_USERN... |
title = "astroConverter"
version = "0.4.1"
size = "800x600"
license = """
The MIT License (MIT)
Copyright (c) 2015 Konrad Wybraniec, <konrad.wybraniec@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal i... |
DEBUG = False
SECRET_KEY = 'something secret'
APP_NAME = 'CMAsk'
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_CHAN = 'cmask'
BROKER_URL = 'redis://%s:%s/0' % (REDIS_HOST, REDIS_PORT)
CELERY_BROKER_URL=BROKER_URL
CELERY_RESULT_BACKEND=BROKER_URL
# Configure Flask-User
USER_LOGIN_URL = "/login"
US... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from collections import defaultdict
import sys, os
from django.contrib import messages
# odd celery fix
import djcelery;
djcelery.setup_loader()
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
try:
UNIT_TESTIN... |
#!/usr/bin/env python
# Copyright (c) 2001 Joao Prado Maia. See the LICENSE file for more information.
# $Id: settings.py,v 1.2 2002-01-11 01:51:15 jpm Exp $
import time
log_path = "/home/jpm/papercut/logs/"
log_file = log_path + "papercut.log"
hostname = 'phpbrasil.com'
backend_type = "mysql"
dbname = "phpbrasil_dev"... |
"""
Default settings for the FlightDeck site
For local configuration please use settings_local.py
"""
import os
import logging
import socket
import tempfile
# Make filepaths relative to settings.
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
# Set the project version
PROJE... |
DATA_PATH = 'data/normal/pos'
DATA_TAGGED_PATH = 'data/tagged/'
CLASSES = ['pos', 'neg']
STOP_WORD_FILE_PATH = 'data/frenchST.txt'
STOP_WORDS = []
with open(STOP_WORD_FILE_PATH, 'r') as f:
for l in f.read().splitlines():
STOP_WORDS.append(l.decode('utf-8')) |
# Django settings for pycon_site project.
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('dvd', 'dvd@gnx.it'),
('c8e', 'carlo.miron@gmail.com'),
)
MANAGERS = ADMINS
SERVER_EMAIL = 'wtf@python.it'
DEFAULT_FROM_EMAIL = 'site@pycon.it'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqli... |
def identity(value):
return value
CUSTOM_SETTINGS_MAPPINGS = {
'omero.web.ome_seadragon.search.default_group': ['DEFAULT_SEARCH_GROUP', None, identity, None],
# configure this value using OMERO.cli
# <ome_home>/bin/omero config set omero.web.ome_seadragon.repository $(<ome_home>/bin/omero config get o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_Tessen
----------------------------------
Tests for `Tessen` module.
"""
# Standard Library Imports
import sys
import os
import datetime
from dateutil.parser import parse
# C Library Imports
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt... |
# -*- encoding: UTF-8 -*-
from django.conf import settings as st
from enum import IntEnum, Enum
import datetime
import os
# Enable translations in this file
_ = lambda s: s
# FECYT webservice configuration
USER_FECYT = "cvnPdfULL01"
PASSWORD_FECYT = "MXz8T9Py7Xhr"
WS_FECYT_PDF2XML = "https://www.cvnet.es/cvn2RootBea... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import operator
import pytest
import numpy as np
import dask.array as da
import dask.array.utils as dau
import dask_ndmeasure._utils
def test__norm_input_labels_index_err():
shape = (15, 16)
chunks = (4, 5)
ind = No... |
# Django settings for kitsune project.
from datetime import date
import logging
import os
import platform
from django.utils import simplejson as json
from django.utils.functional import lazy
from django.utils.translation import ugettext_lazy as _
from sumo_locales import LOCALES
DEBUG = False
TEMPLATE_DEBUG = DEBUG
... |
# -*- coding: utf-8 -*-
import os
import datetime
import httplib as http
import time
import functools
import furl
import itsdangerous
import jwe
import jwt
import mock
import pytest
from django.utils import timezone
from django.contrib.auth.models import Permission
from framework.auth import cas, signing
from framewo... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import os
import logging
from django.contrib import messages
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = ()
MANAGERS = ADMINS
# default to the system's timezone settings
TIME_ZONE = "UTC"
# Langua... |
# -*- coding: utf-8 -*-
"""
Basic CLexer Test
~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import unittest
import os
import textwrap
from pygments.token import Text, Number, Token
from pygments.lexers import CLexer
... |
import sys
import os
# ===========================
# = Directory Declaractions =
# ===========================
CURRENT_DIR = os.path.dirname(__file__)
NEWSBLUR_DIR = CURRENT_DIR
TEMPLATE_DIRS = (os.path.join(CURRENT_DIR, 'templates'),
os.path.join(CURRENT_DIR, 'vendor/zebra/templates'))
MEDIA_ROOT... |
import json
from functools import partial
from nose.tools import ok_, eq_
from solnado import SolrClient
from tornado import gen
from tornado.testing import AsyncTestCase, gen_test
class ClientTestCase(AsyncTestCase):
def setUp(self):
super(ClientTestCase, self).setUp()
self.client = SolrClient()
... |
# Django settings for kitsune project.
from datetime import date
import logging
import os
import platform
from sumo_locales import LOCALES
DEBUG = True
TEMPLATE_DEBUG = DEBUG
STAGE = False
LOG_LEVEL = logging.INFO
SYSLOG_TAG = 'http_sumo_app'
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.pa... |
from unittest import TestCase
from kogniserver.client import main_entry, Client
from mock import MagicMock
import threading
import subprocess
import time
import thread
from os.path import exists
from os import remove
def terminate():
time.sleep(8)
subprocess.call(['crossbar', 'stop'])
time.sleep(2)
t... |
# Copyright 2008 the Melange authors.
#
# 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 wr... |
# Django settings for wp_backport project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be a... |
# encoding: utf-8
import sys
from unittest import TestCase
from pulp.util import compat
if sys.version_info >= (3, 0):
def uchar():
return 'ü'
else:
def uchar():
return u'ü'
class TestPy3K(TestCase):
def test_exception(self):
try:
1/0
except:
... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... |
#!/usr/bin/env python
import os
import shutil
from setuptools import setup
from distutils.dist import Distribution as old_Distribution
from distutils.command.install import install as old_install
from distutils.command.install_data import install_data as old_install_data
# BEFORE importing distutils, remove MANIFEST.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test scriptharness.config
"""
from copy import deepcopy
import unittest
import scriptharness.config as config
from scriptharness import ScriptHarnessException
CONTROL_DICT = {
'b': '2',
'c': {
'd': '4',
},
'd': {
'turtles': ['turtle1']
... |
import os
class Core(object):
"""
The core of the Romaine, provides BDD test API.
"""
# All located features
feature_file_paths = []
instance = None
def __init__(self):
"""
Initialise Romaine core.
"""
self.steps = {}
Core.instance = self
... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... |
import os
import tempfile
from unittest.mock import sentinel, patch
import pytest
import toml
from srm.config import Conf, GlobalConf, LocalConf
# value for testing set/get
V = sentinel.V
def test_config_not_exists():
with tempfile.TemporaryDirectory() as d:
c = Conf(d)
assert not c.exists()
d... |
"""Plot sound fields etc."""
from __future__ import division
import matplotlib.pyplot as plt
from matplotlib import __version__ as matplotlib_version
from matplotlib.patches import PathPatch
from matplotlib.path import Path
from matplotlib.collections import PatchCollection
from mpl_toolkits import axes_grid1
from mpl_... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... |
LOG_NAME = 'test.log' # set the log file name
KEY = '011817511e094d62034845f35a1be826'
SECRET = 'ed55f78fe13b7538'
CALLBACK = 'http://www.baidu.com'
TOKEN = '559a4790abde8c7f00ced6b2039ba57d'
#KEY = '0d43ff0724b5b9ac27cbfd156e212d04'
#SECRET = 'e3d12f3b7fdb98a0'
#CALLBACK = 'http://www.baidu.com'
#TOKEN = '7fb6f546c... |
#!/usr/bin/env python3
import argparse
import curses
import curses.ascii
import os
import sys
import text_unidecode
# constants
QUIT_CHARS = {chr(curses.ascii.ESC), curses.ascii.ctrl('[')}
DELETE_CHARS = {chr(curses.ascii.DEL), chr(curses.ascii.BS),
chr(curses.KEY_BACKSPACE), chr(curses.KEY_DC)}
CL... |
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
"""
USAGE: %(program)s INPUT_DIRECTORY
Compare speed and accuracy of several similarity retrieval methods, using the corpus prepared by prepare_shootout.py.
Example: ./shootout.py ~/data/wiki/shootout
"""
impor... |
import sys
import os
import unittest2 as unittest
import mock
from mock import patch
from parcel.deploy import Deployment
from parcel.distro import Debian
from parcel.versions import Version
from parcel_mocks import run, local, rsync, version_mock, update_packages, build_deps, mock_put
# add mocks to this list if th... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Superbil'
__version__ = '0.2.1'
from motc import tools
import argparse
import datetime
import sys
from tqdm import tqdm
import pymssql
import shapefile
CREATE_TABLE = """
CREATE TABLE [dbo].[tblRoad](
[PID] [int] IDENTITY(1,1) NOT NULL,
[Ro... |
import pytest
pytest_plugins = ("pytester",)
@pytest.fixture(
params=["pytest.assume({expr}, {msg})", "with pytest.assume: assert {expr}, {msg}"],
)
def assume_call(request):
return request.param
def test_passing_expect(testdir, assume_call):
testdir.makepyfile(
"""
import pytest
... |
import json, urlparse, urllib
from django.conf import settings
from django.core import urlresolvers
from mongoengine.django import auth
from piplmesh.account import models
class MongoEngineBackend(auth.MongoEngineBackend):
# TODO: Implement object permission support
supports_object_permissions = False
#... |
import pytest
import idb
from fixtures import *
def pluck(prop, s):
'''
generate the values from the given attribute with name `prop` from the given sequence of items `s`.
Args:
prop (str): the name of an attribute.
s (sequnce): a bunch of objects.
Yields:
any: the values of the ... |
class LaTeX:
def preamble(self, typeface):
return """
\\documentclass[a4paper,12pt]{{article}}
\\usepackage{{setspace}}
\\usepackage{{fontspec}}
\\usepackage{{dblfnote}}
\\usepackage{{pfnote}}
\\usepackage{{polyglossia}}
\\setdefaultlanguage[variant=ancient]{{greek}}
\\setromanfont{{{typeface}}}
\\lines... |
#
# rpclib - Copyright (C) Rpclib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This lib... |
# type: ignore
import os.path
import tempfile
import time
import unittest
from unittest.mock import patch
from freezegun import freeze_time
from simplemonitor.Loggers import logger
from simplemonitor.Loggers.file import FileLogger
from simplemonitor.Monitors.monitor import MonitorNull
from simplemonitor.simplemonitor... |
# Copyright 2012 Jussi Pakkanen
# 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, ... |
"""Copied and modified this script from the SciPy sources version for
the purposes of TVTK.
numerix imports either Numeric, numarray or numpy based on various
selectors.
0. If the value "--numarray" or "--numeric" or "--numpy" is specified
on the command line, then numerix imports the specified array package.
1. If... |
"""
Just to make sure the plugin doesn't choke on doctests::
>>> print('Yay, doctests!')
Yay, doctests!
"""
import sys
import time
from functools import partial
import pytest
@pytest.mark.skipif('sys.platform == "win32"')
def test_fast(benchmark):
@benchmark
def result():
return time.sleep(... |
import sys
import pytest
import ansible
import mock
import re
from _pytest.main import EXIT_OK, EXIT_TESTSFAILED, EXIT_USAGEERROR, EXIT_NOTESTSCOLLECTED, EXIT_INTERRUPTED
from pkg_resources import parse_version
if sys.version_info[0] == 2:
import __builtin__ as builtins # NOQA
else:
import builtins # NOQA
... |
import logging
import logging.config
from path import Path
from qface.generator import FileSystem
# logging.config.fileConfig('logging.ini')
logging.basicConfig()
log = logging.getLogger(__name__)
inputPath = Path('tests/in')
log.debug('input path folder: {0}'.format(inputPath.abspath()))
def load_tuner():
pa... |
import unittest
import sure
from compiler import parse, lex, error, ast, type
class TestParser(unittest.TestCase):
def setUp(self):
self.parsers = {}
self.one = self._parse("1", "expr")
self.two = self._parse("2", "expr")
self.true = self._parse("true", "expr")
def _parse(s... |
import os
import tempfile
import shutil
import json
import pytest
from pipenv.vendor import toml
from pipenv.vendor import delegator
os.environ['PIPENV_DONT_USE_PYENV'] = '1'
class PipenvInstance():
"""An instance of a Pipenv Project..."""
def __init__(self, pipfile=True, chdir=False):
self.original... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pypepa
----------------------------------
Tests for `pypepa` module.
"""
import unittest
import logging
import numpy
from pypepa import pypepa
Action = pypepa.Action
simple_components = """
P = (a,1.0).P1;
P1 = (b, 1.0).P;
Q = (a,1.0).Q1;
Q1 = (b, 1.0).Q;
""... |
from django.core import management
import pytest
from model_mommy import mommy
import time
from example.app.models import SimpleObject, RelatableObject
@pytest.mark.django_db
def test_simple_get(es_client):
management.call_command("sync_es")
test_object = mommy.make(SimpleObject)
time.sleep(1) # Let t... |
# -*- coding: utf-8 -*-
"""
tests.routes
~~~~~~~~~~~~~~~~~
tests for application routes and view logic
"""
import pytest
class MockMeetupGroup():
def __init__(self, *args, **kwargs):
self.name = 'Mock Meetup Group'
self.link = 'https://www.meetup.com/MeetupGroup/'
self.next_e... |
import collections
import domino
import unittest
class TestSeries(unittest.TestCase):
def test_init(self):
s1 = domino.Series()
self.assertEqual(len(s1.games), 1)
self.assertEqual(len(s1.games[0].board), 1)
self.assertEqual(s1.games[0].board.left_end(), 6)
self.assertEqual(... |
import os
import sys
import pytest
import socket
from .fixtures import * # noqa
from datetime import timedelta
from mock import patch, MagicMock
from devns.server import _intify, DevNS
@pytest.mark.parametrize("value, expected", [
(1, 1),
("1", 49),
(b"\x01", 1)
])
def test_intify(value, expected):
... |
from datetime import datetime
from decimal import Decimal, InvalidOperation
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry, Point
from currency_convert import convert
from geodata.models import Country, Region
# FIXME:
from iati import models
from iati.parser import post_save, post_... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import os
import signal
import uuid
from multiprocessing import Process
import pytest
from builtins import str
from freezegun import ... |
#!/usr/bin/python
import requests, json, argparse, re, subprocess
# Fetch docker host IP
ps = subprocess.Popen(['ip', 'ro', 'get', '8.8.8.8',], stdout=subprocess.PIPE)
ETCD_HOST = re.search('via ([0-9.]*) ', ps.stdout.readlines()[0]).groups()[0]
#ETCD_HOST='172.17.42.1'
ETCD_PROTO='http://'
ETCD_PORT=2379
ETCD_BASE_... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2011 Umeå University
#
# 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... |
import logging
from xml.etree import ElementTree as ET
from six import BytesIO
from rets.exceptions import RETSException, MaxrowException
from rets.parsers.base import Base
logger = logging.getLogger('rets')
class OneXSearchCursor(Base):
"""Parses Search Result Data"""
def __init__(self):
self.par... |
"""
This file receives numbers from the --N flag, and for each number n, creates an smt2
file containing an n-bit multiplier equivalence proof. For example, to create and smt2
file for 2-bit multiplication and an smt2 file for 4-bit multiplication, we can run
$ bazel-bin/xls/experimental/smtlib/n_bit_add_generator --... |
#! /usr/bin/env python3
#-*- coding: UTF-8 -*-
### Legal
#
# Author: Thomas DEBESSE <dev@illwieckz.net>
# License: ISC
#
file_common_deps = {
"file_base": "DEPS",
"description": "Package DEPS file",
"action": "copy",
}
file_common_external_editor = {
"file_ext": [
"xcf",
"psd",
"ora",
],
"description":... |
# -*- coding: utf-8 -*-
"""
Copyright(C) 2010 Romain Bignon, Christophe Benz
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that ... |
__doc_all__ = []
import unittest
import random
import threading
import socket
import time
import sys
import errno
import exceptions
import datetime
import traceback
import thread
from cStringIO import StringIO
from cogen.common import *
from cogen.core import reactors
from base import priorities
... |
import sys
import os
stdout = sys.stdout
reload(sys)
sys.setdefaultencoding('utf-8')
sys.stdout = stdout
# import all extractors
from spacy_extractors import age_extractor as spacy_age_extractor
from spacy_extractors import social_media_extractor as spacy_social_media_extractor
from spacy_extractors import date_extrac... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import requests
import json
from time import time
import gzip
import urllib
from operator import itemgetter
from app import doaj_issns
from app import doaj_titles
from app import logger
from util import elapsed, normalize_issn
from util import remove_punctuation
fr... |
from __future__ import annotations
import collections
from datetime import timedelta
import functools
import gc
from io import StringIO
import json
import operator
import pickle
import re
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Op... |
from django.utils.datastructures import MultiValueDictKeyError
from rest_framework.parsers import JSONParser
from ..models import Course
from ..models import CourseResult
from ..models import CourseUniversity
from ..models import CourseFaculty
from rest_framework.decorators import api_view, permission_classes
from res... |
#
# Copyright (c) 2016 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
from datetime import datetime
import pytest
from jsonmodels import models, fields, errors
class _DateField(fields.BaseField):
_types = (datetime,)
def test_to_struct_basic():
class Person(models.Base):
name = fields.StringField(required=True)
surname = fields.StringField(required=True)
... |
# -*- coding: utf-8 -*-
import click
import json
from .deployment import deployment
from ... import Client
from ...deployment.update._strategies import DirectUpdateStrategy, CanaryUpdateStrategy
from ...deployment.update.rules import _UpdateRule
@deployment.group()
def update():
pass
@update.command(name="endp... |
import sys
stdout = sys.stdout
reload(sys)
sys.setdefaultencoding('utf-8')
sys.stdout = stdout
# import all extractors
from spacy_extractors import age_extractor as spacy_age_extractor
from spacy_extractors import social_media_extractor as spacy_social_media_extractor
from spacy_extractors import date_extractor as spac... |
import time
import random
class Listener:
def __init__(self, subject, name):
print 'create listeners ' + name
self.name = name
subject.register(self)
def notify(self):
print "I'm listen, ", self.name, '\n and go read'
class Subject:
def __init__(self, name, exemplars):
... |
"""
Django settings for OmniDB project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... |
"""
module __OpenPNMbase__: contains OpenPNM base classes
=====================================================
"""
import sys, os, string, random, time
parent_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(1, parent_dir)
import OpenPNM
import scipy.constants
import ... |
import datetime
from pprint import pprint
from django.db import connections
from estoque import queries
from estoque.classes import TransacoesDeAjuste
from estoque.functions.base import transfo2_num_doc
def ajuste_por_inventario(
dep,
ref,
tam,
cor,
qtd,
data,
hora,
force=False,
... |
import bleach
ALLOWED_TAGS = [
"!doctype", "html", "body", "a", "abbr", "address", "area", "article",
"aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br",
"button", "canvas", "caption", "cite", "code", "col", "colgroup",
"command", "datalist", "dd", "del", "details", "dfn", "div", "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.