code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
#!/usr/bin/env python """Tests for GRR settings-related views.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from absl import app from grr_response_server.gui import gui_test_lib from grr_response_server.gui.api_plugins import config_test as api_conf...
dunkhong/grr
grr/server/grr_response_server/gui/selenium_tests/settings_view_test.py
Python
apache-2.0
2,790
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os from pant...
square/pants
tests/python/pants_test/tasks/test_eclipse_integration.py
Python
apache-2.0
3,401
from __future__ import print_function from copy import copy, deepcopy import datetime import inspect import sys import traceback from django.core.management import call_command from django.core.management.commands import loaddata from django.db import models import south.db from south import exceptions from south.db...
RaD/django-south
south/migration/migrators.py
Python
apache-2.0
12,278
from __future__ import absolute_import from django.conf import settings from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.base import BaseHandler from zerver.models import get_user_profile_by_email, \ get_user_profile_by_id, get_prereg_user_by_email, get_client from zerver.lib.context_man...
atomic-labs/zulip
zerver/worker/queue_processors.py
Python
apache-2.0
13,796
""" Parameter scan """ from __future__ import print_function, division import tellurium as te # -------------------------------------------------- # Parameter Scan 1 # -------------------------------------------------- cell = ''' J1: $Xo -> x; 0.1 + k1*x^4/(k2+x^4); x -> $w; k3*x; k1 = 0.9; k2 = 0.3; ...
kirichoi/tellurium
examples/tellurium-files/parameterscan/parameter_scan.py
Python
apache-2.0
1,273
"""Constants for the pi_hole intergration.""" from datetime import timedelta DOMAIN = "pi_hole" CONF_LOCATION = "location" CONF_SLUG = "slug" DEFAULT_LOCATION = "admin" DEFAULT_METHOD = "GET" DEFAULT_NAME = "Pi-Hole" DEFAULT_SSL = False DEFAULT_VERIFY_SSL = True SERVICE_DISABLE = "disable" SERVICE_DISABLE_ATTR_DURA...
leppa/home-assistant
homeassistant/components/pi_hole/const.py
Python
apache-2.0
1,452
# Copyright 2015 Huawei Technologies India Pvt Ltd, 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 ...
eayunstack/python-neutronclient
neutronclient/neutron/v2_0/qos/bandwidth_limit_rule.py
Python
apache-2.0
3,455
from future.utils import python_2_unicode_compatible from django.db import models from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem from fluent_contents.utils import validate_html_size @python_2_unicode_compatible class IframeItem(ContentItem): """ An ``<if...
jpotterm/django-fluent-contents
fluent_contents/plugins/iframe/models.py
Python
apache-2.0
895
from django.conf import settings from .utils import is_valid_ip from . import defaults as defs NON_PUBLIC_IP_PREFIX = tuple([ip.lower() for ip in defs.IPWARE_NON_PUBLIC_IP_PREFIX]) TRUSTED_PROXY_LIST = tuple([ip.lower() for ip in getattr(settings, 'IPWARE_TRUSTED_PROXY_LIST', [])]) def get_ip(request, real_ip_only=...
kawamon/hue
desktop/core/ext-py/django-ipware-2.1.0/ipware/ip.py
Python
apache-2.0
2,438
from __init__ import * import sys import os.path from PIL import Image import numpy as np from arg_parser import parse_args from printer import print_header, print_usage, print_line sys.path.insert(0, ROOT) from utils import * def init_images(app_data): print("[init.py] : initializing images...") app_args ...
bollu/polymage
sandbox/apps/python/img_proc/pyramid_blend/init.py
Python
apache-2.0
3,126
# Copyright 2015 ARM Limited # # 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 writin...
freedomtan/workload-automation
wlauto/result_processors/notify.py
Python
apache-2.0
2,244
# -*- coding: utf-8 -*- """ equip.utils.files ~~~~~~~~~~~~~~~~~ :copyright: (c) 2014 by Romain Gaucher (@rgaucher) :license: Apache 2, see LICENSE for more details. """ import os __normalize_path = lambda x: os.path.abspath(x) def file_extension(filename): if '.' not in filename: return None return ...
neuroo/equip
equip/utils/files.py
Python
apache-2.0
1,118
"""Copyright 2014 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 ...
GoogleCloudPlatform/PerfKitExplorer
server/perfkit/test_util.py
Python
apache-2.0
2,349
# Copyright 2014: Intel 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 a...
pandeyop/rally
tests/unit/benchmark/scenarios/neutron/test_network.py
Python
apache-2.0
24,839
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$Nov 05, 2015 13:54$" import collections from contextlib import contextmanager import errno import itertools import glob import numbers import os import shutil import tempfile import uuid import zipfile import scandir import h5py import numpy impor...
nanshe-org/nanshe_workflow
nanshe_workflow/data.py
Python
apache-2.0
24,568
from __future__ import print_function import importlib, inspect, os, sys sys.path.insert(1, os.path.join("..","..")) from tests import pyunit_utils sklearn_estimator_methods = ['fit', 'predict', 'fit_predict', 'get_params', 'set_params'] sklearn_transformer_methods = ['fit', 'fit_transform', 'transform', 'inverse_tr...
michalkurka/h2o-3
h2o-py/tests/testdir_sklearn/pyunit_sklearn_api.py
Python
apache-2.0
4,022
# coding: utf-8 from __future__ import unicode_literals from mock import ANY, call from boxsdk.config import API def test_automatic_refresh( box_client, mock_box_network, generic_successful_response, successful_token_response, unauthorized_response, ): mock_box_network.ses...
jwkozel/demobx
test/integration/test_retry_and_refresh.py
Python
apache-2.0
1,045
# -*- encoding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals #----------------------------------------------------------------------------------------------------------------------- # AutoEncoder Grid Search #-------------------------------------------------------------...
mathemage/h2o-3
h2o-py/h2o/grid/metrics.py
Python
apache-2.0
34,611
# Copyright 2013 OpenStack Foundation # Copyright 2014 NEC Corporation # 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/licens...
queria/my-tempest
tempest/api/compute/v3/admin/test_quotas_negative.py
Python
apache-2.0
4,153
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # Copyright 2011 - 2012, Red Hat, Inc. # # 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 # # ...
citrix-openstack-build/trove
trove/openstack/common/rpc/impl_qpid.py
Python
apache-2.0
26,203
# -*- coding: utf-8 -*- ################################################################################ # Copyright 2013-2015 Aerospike, Inc. # # 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 ...
trupty/aerospike-client-python
examples/client/get_key_digest.py
Python
apache-2.0
4,371
#!/usr/bin/env python # # Copyright 2011-2015 Splunk, Inc. # # 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...
ww9rivers/splunk-sdk-python
tests/test_conf.py
Python
apache-2.0
3,799
#!/usr/bin/python -tt # # Copyright 2009-2010 Facebook, Inc. # # 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 applicab...
bcwalrus/git-tutorial
src/gitreview/cli/tokenize.py
Python
apache-2.0
6,276
# -*- coding: utf-8 -*- # Copyright 2017, Digital Reasoning # # 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 applica...
clarkperkins/stackdio
stackdio/api/cloud/utils.py
Python
apache-2.0
2,418
# # Copyright (c) SAS Institute Inc. # # 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 w...
fedora-conary/rmake-2
rmake/db/logstore.py
Python
apache-2.0
2,060
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-lines # noqa: E301,E302,E303,T001 class OpenShiftCLIError(Exception): '''Exception class for openshiftcli''' pass ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')] def locate_oc_binary(): ''' Find and return oc binar...
abutcher/openshift-ansible
roles/lib_openshift/src/lib/base.py
Python
apache-2.0
21,696
import os, sys from contextlib import contextmanager support = os.path.join(os.path.dirname(__file__), '_support') @contextmanager def support_path(): sys.path.insert(0, support) yield sys.path.pop(0) def load(name): with support_path(): return __import__(name)
alex/invoke
tests/_utils.py
Python
bsd-2-clause
290
from datetime import date, timedelta from random import randint from django.utils import timezone from rest_framework.test import APITestCase from example.factories import CommentFactory, EntryFactory from example.models import Author, Blog, Comment, Entry, LabResults, ResearchProject class PerformanceTestCase(APIT...
django-json-api/rest_framework_ember
example/tests/test_performance.py
Python
bsd-2-clause
4,273
#!/usr/bin/env python # -*- coding: utf-8 -*- # # mainnav-reader - Version: 0.5.1 # # Copyright (c) 2009-2013, Dennis Keitzel # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions...
pbabik/mainnav-reader
setup.py
Python
bsd-2-clause
1,980
import sys import logging import argparse argparser = argparse.ArgumentParser(description='Hummingbird - ' 'Monitoring and Analysing FXI experiments.') _group = argparser.add_mutually_exclusive_group() _group.add_argument("-i", "--interface", help="start the con...
SPIhub/hummingbird
src/utils/cmdline_args.py
Python
bsd-2-clause
2,729
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2010, 2012, 2013, 2016 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above co...
andir/ganeti
test/py/ganeti.storage.bdev_unittest.py
Python
bsd-2-clause
27,296
#!/usr/bin/python # ex:set fileencoding=utf-8: # flake8: noqa from __future__ import unicode_literals from django.test import TestCase from unittest import expectedFailure class SettingTests(TestCase): @expectedFailure def test_fails(self): self.assertTrue(False)
django-bmf/django-bmf
tests/appapis/test_sites_setting.py
Python
bsd-3-clause
285
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- coding: utf-8 -*- # # This file is based upon the file generated by sphinx-quickstart. However, # where sphinx-quickstart hardcodes values in this file that you input, this # file has been changed to pull from your module's metadata module. # # This file is execfile(...
echevemaster/fedora-college
docs/source/conf.py
Python
bsd-3-clause
8,753
# # This sets up how models are displayed # in the web admin interface. # from builtins import object from django import forms from django.conf import settings from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.forms import UserChangeForm, UserCre...
titeuf87/evennia
evennia/players/admin.py
Python
bsd-3-clause
9,894
import webuntis import mock from webuntis.utils.third_party import json from .. import WebUntisTestCase, BytesIO class BasicUsage(WebUntisTestCase): def test_parse_result(self): x = webuntis.utils.remote._parse_result a = {'id': 2} b = {'id': 3} self.assertRaisesRegex(webuntis.err...
maphy-psd/python-webuntis
tests/utils/test_remote.py
Python
bsd-3-clause
1,228
# -*- coding: utf-8 -*- """ database.use_tornado_database ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using tornado.database with MySQL http://flask.pocoo.org/snippets/11/ """ import os import sys sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from tornado.database import Connectio...
fengsp/flask-snippets
database/use_tornado_database.py
Python
bsd-3-clause
1,247
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Utilities for console input and output. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import codecs import locale import re import math import multiprocessing i...
joergdietrich/astropy
astropy/utils/console.py
Python
bsd-3-clause
33,248
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/pdfgeom.py __version__=''' $Id: pdfgeom.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__=""" This module includes any mathematical methods ...
nickpack/reportlab
src/reportlab/pdfgen/pdfgeom.py
Python
bsd-3-clause
3,119
from django.core.checks.urls import check_url_config from django.test import SimpleTestCase from django.test.utils import override_settings class CheckUrlsTest(SimpleTestCase): @override_settings(ROOT_URLCONF='check_framework.urls_no_warnings') def test_include_no_warnings(self): result = check_url_co...
cainmatt/django
tests/check_framework/test_urls.py
Python
bsd-3-clause
1,638
""" raven.transport.registry ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys # TODO(dcramer): we really should need to import all of these by default from raven.trans...
inspirehep/raven-python
raven/transport/registry.py
Python
bsd-3-clause
2,913
''' Notice: 1. The function for jit should locate in mfs 2. For the usage of jit types and signatures, please refer Numba documentation <http://numba.github.com/numba-doc/0.10/index.html> ''' from dpark import _ctx as dpark, jit, autojit import numpy @jit('f8(f8[:])') def add1(x): sum = 0.0 for i ...
ee08b397/dpark
examples/jit.py
Python
bsd-3-clause
757
from django.template.defaultfilters import phone2numeric_filter from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import render, setup class Phone2numericTests(SimpleTestCase): @setup({'phone2numeric01': '{{ a|phone2numeric }} {{ b|phone2numeric }}'}) def test...
webostin/django-btc
tests/template_tests/filter_tests/test_phone2numeric.py
Python
bsd-3-clause
1,450
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import functools import os import sys import constants sys.path.insert(0, constants.SOURCE_ROOT) from chromite.buildbot import rep...
coreos/chromite
buildbot/repository_unittest.py
Python
bsd-3-clause
3,059
# Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Ignore indention messages, since legacy scripts use 2 spaces instead of 4. # pylint: disable=bad-indentation,docstring-section-indent # pylint: disable...
coreboot/chrome-ec
extra/tigertool/ecusb/tiny_servod.py
Python
bsd-3-clause
1,767
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) from copy import deepcopy from math import sqrt import numpy as np from scipy import linalg from ._eloret...
olafhauk/mne-python
mne/minimum_norm/inverse.py
Python
bsd-3-clause
66,037
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Handling of the <message> element. ''' import re import types from grit.node import base import grit.format.rc_header imp...
kuiche/chromium
tools/grit/grit/node/message.py
Python
bsd-3-clause
9,031
import os import os.path import socket import textwrap import shutil import subprocess import contextlib import sys import tempfile import time import random try: import pytest except ImportError: print >> sys.stderr, "Integ tests require pytests!" sys.exit(1) def pytest_funcarg__servers(request): "R...
nwangtw/statsite
integ/test_integ.py
Python
bsd-3-clause
15,415
"""LCM package __init__.py file This file automatically generated by lcm-gen. DO NOT MODIFY BY HAND!!!! """ from image_t import image_t
bthcode/cmake_scipy_ctypes_example
src/lcm_zmq_integration/python/example_lcm/__init__.py
Python
bsd-3-clause
137
""" Test runner for Evennia test suite. Run with "game/manage.py test". """ from django.conf import settings from django.test.simple import DjangoTestSuiteRunner class EvenniaTestSuiteRunner(DjangoTestSuiteRunner): """ This test runner only runs tests on the apps specified in src/ and game/ to avoid r...
TaliesinSkye/evennia
src/utils/test_utils.py
Python
bsd-3-clause
952
from django.test import TransactionTestCase from django.contrib.auth.models import Group from django.conf import settings from hs_core import hydroshare from hs_core.hydroshare import utils from hs_core.models import CoreMetaData from hs_core.testing import TestCaseCommonUtilities class TestRasterMetaData(TestCaseCo...
RENCI/xDCIShare
hs_geo_raster_resource/tests/test_raster_metadata_user_zone.py
Python
bsd-3-clause
8,568
"""Release data for NetworkX. When NetworkX is imported a number of steps are followed to determine the version information. 1) If the release is not a development release (dev=False), then version information is read from version.py, a file containing statically defined version information. This file...
jtorrents/networkx
networkx/release.py
Python
bsd-3-clause
8,792
from sympy import ( symbols, expand, expand_func, nan, oo, Float, conjugate, diff, re, im, Abs, O, factorial, exp_polar, polar_lift, gruntz, limit, Symbol, I, integrate, S, sqrt, sin, cos, sinh, cosh, exp, log, pi, EulerGamma, erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv, gamma, uppergamma, l...
wdv4758h/ZipPy
edu.uci.python.benchmark/src/benchmarks/sympy/sympy/functions/special/tests/test_error_functions.py
Python
bsd-3-clause
24,044
""" PLPY helper module for applying row events from pgq.logutriga(). """ import plpy import pkgloader pkgloader.require('skytools', '3.0') import skytools ## TODO: automatic fkey detection # find FK columns FK_SQL = """ SELECT (SELECT array_agg( (SELECT attname::text FROM pg_attribute W...
overdrive3000/skytools
python/skytools/plpy_applyrow.py
Python
isc
6,707
""" tests.test_component_demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests demo component. """ import unittest import homeassistant.core as ha import homeassistant.components.automation as automation import homeassistant.components.automation.event as event from homeassistant.const import CONF_PLATFORM, ATTR_ENTITY_ID class T...
Nzaga/home-assistant
tests/components/automation/test_init.py
Python
mit
2,584
# Copyright (C) 2009, Benjamin Berg, Sebastian Berg # Copyright (C) 2010, Walter Bender # # 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; either version 2 of the License, or # ...
walterbender/turtle3D
plugins/audio_sensors/ringbuffer.py
Python
mit
4,149
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
Alecto3-D/testable-greeter
bb-master/sandbox/lib/python3.5/site-packages/autobahn/wamp/types.py
Python
mit
36,554
from django.conf import settings import sys def import_name(name): components = name.split('.') if len(components) == 1: # direct module, import the module directly mod = __import__(name, globals(), locals(), [name]) else: # the module is within another, so we # need to im...
KrzysiekJ/django-getpaid
getpaid/utils.py
Python
mit
1,875
# Build GodotSharpTools solution import os from SCons.Script import Builder, Dir def find_nuget_unix(): import os if 'NUGET_PATH' in os.environ: hint_path = os.environ['NUGET_PATH'] if os.path.isfile(hint_path) and os.access(hint_path, os.X_OK): return hint_path hint_pa...
okamstudio/godot
modules/mono/build_scripts/godotsharptools_build.py
Python
mit
8,471
""" A sample encryption library using rot13. """ # File encoding PEP, see: http://legacy.python.org/dev/peps/pep-0263/ # -*- coding: utf-8 -*- import re alphabet = 'abcdefghijklmnopqrstuvwxyz' def assign_and_return_positions(alphabet, rotation): """ Build and return a dictionary for substitution. """ ...
razzius/PyClassLessons
instructors/projects/decoding_fun/examples/rot13.py
Python
mit
2,202
from pandac.PandaModules import Vec3 from direct.interval.IntervalGlobal import Sequence, Parallel, Wait, Func from direct.interval.IntervalGlobal import LerpScaleInterval from direct.interval.IntervalGlobal import WaitInterval, ActorInterval, FunctionInterval from direct.task.Task import Task from direct.directnotify ...
ksmit799/Toontown-Source
toontown/parties/PartyCatchActivityToonSD.py
Python
mit
9,299
from trackers import *
MikeDMorgan/scRNAseq
pipeline_docs/pipeline_scRnaseq/__init__.py
Python
mit
24
from .serializers import LearnerClassroomSerializer from django.db.models.query import F from kolibri.auth.api import KolibriAuthPermissionsFilter from kolibri.auth.filters import HierarchyRelationsFilter from kolibri.auth.models import Classroom from kolibri.auth.serializers import ClassroomSerializer from kolibri.cor...
christianmemije/kolibri
kolibri/plugins/learn/viewsets.py
Python
mit
2,084
""" check_mod.py Copyright 2015 Adam Greig Licensed under the MIT licence, see LICENSE file for details. Check all footprint files in a directory against a set of consistency fules. """ from __future__ import print_function, division import sys import os import glob from decimal import Decimal import argparse from ...
adamgreig/agg-kicad
scripts/check_mod.py
Python
mit
4,233
from django.db import models from django.template import Context, loader from django.utils import timezone from hendrix.experience import hey_joe from hendrix.contrib.concurrency.signals import message_signal # Create your models here. class ChatMessage(models.Model): """ a model that stores chat histor...
jMyles/hendrix
examples/django_hx_chatserver/example_app/chat/models.py
Python
mit
1,505
# -*- coding: utf-8 -*- """Define the base module for server test.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys from influxdb.tests import using_pypy from influxdb.tests.server_tests.influxdb_instanc...
BenHewins/influxdb-python
influxdb/tests/server_tests/base.py
Python
mit
2,621
# This loop monitors the rf Discharges for a particular amplitude, then repeats for other amplitudes # n from DAQ.Environment import * def scanRF(LowestAmp, HighestAmp, step, numScans): # setup AmpList = [] fileSystem = Environs.FileSystem file = \ fileSystem.GetDataDirectory(\ fileSystem.Paths["scanMaster...
ColdMatter/EDMSuite
EDMScripts/OldScripts/MonitorRFDischargesScanSynthAmp.py
Python
mit
1,182
## www.pubnub.com - PubNub Real-time push service in the cloud. # coding=utf8 ## PubNub Real-time Push APIs and Notifications Framework ## Copyright (c) 2010 Stephen Blum ## http://www.pubnub.com/ import sys from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys....
teddywing/pubnub-python
python/examples/history.py
Python
mit
1,293
# -*- coding: utf-8 -*- from __future__ import print_function """ ScriptProcessor processes a script file (generally), loading data using the requested loading routine and printing This is part of Acq4 Paul B. Manis, Ph.D. 2011-2013. Pep8 compliant (via pep8.py) 10/25/2013 Refactoring begun 3/21/2015 """ import ...
pbmanis/acq4
acq4/analysis/tools/ScriptProcessor.py
Python
mit
13,216
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the rawtransaction RPCs. Test the following RPCs: - createrawtransaction - signrawtransacti...
GlobalBoost/GlobalBoost-Y
test/functional/rpc_rawtransaction.py
Python
mit
24,022
from typing import ( Any, List, ) from pcs import resource from pcs.cli.common.parse_args import InputModifiers from pcs.cli.common.routing import ( CliCmdInterface, create_router, ) def resource_defaults_cmd(parent_cmd: List[str]) -> CliCmdInterface: def _get_router( lib: Any, argv: List...
tomjelinek/pcs
pcs/cli/routing/resource_stonith_common.py
Python
gpl-2.0
2,770
import sys import re def cleancss(text): text=re.compile('\s+').sub(' ', text) text=re.compile('\s*(?P<a>,|:)\s*').sub('\g<a> ', text) text=re.compile('\s*;\s*').sub(';\n ', text) text=re.compile('\s*\{\s*').sub(' {\n ', text) text=re.compile('\s*\}\s*').sub('\n}\n\n', text) return text ...
trosa/forca
scripts/cleanhtml.py
Python
gpl-2.0
2,334
def AlphabetSoup(str): temp = list(str) temp.sort() for x in temp: print x AlphabetSoup(raw_input())
ohgodscience/Python
Exercises/AlphabetSoup.py
Python
gpl-2.0
109
import concurrent.futures from itertools import islice import xbmc import threading Executor = concurrent.futures.ThreadPoolExecutor def execute(f, iterable, stop_flag=None, workers=10, timeout=30): with Executor(max_workers=workers) as executor: threading.Timer(timeout, stop_flag.set) for future...
repotvsupertuga/tvsupertuga.repository
script.module.universalscrapers/lib/universalscrapers/executor.py
Python
gpl-2.0
842
# # Copyright 2011-2013 Blender Foundation # # 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...
pawkoz/dyplom
blender/intern/cycles/blender/addon/osl.py
Python
gpl-2.0
4,371
## # Copyright 2012-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
migueldiascosta/easybuild-framework
easybuild/toolchains/gmpich2.py
Python
gpl-2.0
1,420
# -*- coding: utf-8 -*- # pylint: disable=W0102 import nose import numpy as np from pandas import Index, MultiIndex, DataFrame, Series, Categorical from pandas.compat import OrderedDict, lrange from pandas.sparse.array import SparseArray from pandas.core.internals import * import pandas.core.internals as internals im...
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/tests/test_internals.py
Python
gpl-2.0
42,078
"""Example extension, also used for testing. See extend.txt for more details on creating an extension. See config-extension.def for configuring an extension. """ from idlelib.config import idleConf from functools import wraps def format_selection(format_line): "Apply a formatting function to all of the selected...
bruderstein/PythonScript
PythonLib/full/idlelib/zzdummy.py
Python
gpl-2.0
2,005
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib import urlparse def encode_unicode_dict(unicodedict, encoding="utf-8"): bytedict = {} for key in unicodedict: if isinstance(unicodedict[key], unicode): bytedict[key] = unicodedict[key].encode(encoding) elif isinstance(unic...
ThomasJunk/ringo
ringo/lib/request/helpers.py
Python
gpl-2.0
2,171
## # Copyright 2012-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
ULHPC/easybuild-framework
easybuild/toolchains/compiler/__init__.py
Python
gpl-2.0
1,248
# $Id$ # import inc_const as const PJSUA = ["--null-audio --max-calls=1 --auto-answer=200 --no-tcp --srtp-secure 0 --use-srtp 2 --srtp-keying=1"] PJSUA_EXPECTS = [[0, "SRTP uses keying method DTLS-SRTP", ""]]
asterisk/pjproject
tests/pjsua/scripts-sipp/uac-srtp-dtls.py
Python
gpl-2.0
211
"""Most of these tests come from the examples in Bronstein's book.""" from sympy import (Poly, I, S, Function, log, symbols, exp, tan, sqrt, Symbol, Lambda, sin, Eq, Ne, Piecewise, factor, expand_log, cancel, expand, diff, pi, atan) from sympy.integrals.risch import (gcdex_diophantine, frac_in, as_poly_1t, ...
wxgeo/geophar
wxgeometrie/sympy/integrals/tests/test_risch.py
Python
gpl-2.0
35,961
############################################################################### # Name: txtutil.py # # Purpose: Text Utilities. # # Author: Cody Precord <cprecord@editra.org> # ...
163gal/Time-Line
libs/wx/tools/Editra/src/ebmlib/txtutil.py
Python
gpl-3.0
1,195
# (c) 2013, Michael DeHaan <michael.dehaan@gmail.com> # Stephen Fromm <sfromm@gmail.com> # Brian Coca <briancoca+dev@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
bezhermoso/home
lib/ansible/runner/action_plugins/assemble.py
Python
gpl-3.0
4,340
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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, either version 3 of the Licen...
oliver-sanders/cylc
tests/unit/tui/test_data.py
Python
gpl-3.0
1,331
from frappe import _ def get_data(): return { 'heatmap': True, 'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'), 'fieldname': 'customer', 'transactions': [ { 'label': _('Pre Sales'), 'items': ['Opportunity', 'Quotation'] }, { 'lab...
patilsangram/erpnext
erpnext/selling/doctype/customer/customer_dashboard.py
Python
gpl-3.0
679
import quark_hash import weakref import binascii import StringIO from binascii import unhexlify teststart = '700000005d385ba114d079970b29a9418fd0549e7d68a95c7f168621a314201000000000578586d149fd07b22f3a8a347c516de7052f034d2b76ff68e0d6ecff9b77a45489e3fd511732011df0731000'; testbin = unhexlify(teststart) hash_bin = x11_...
ptcrypto/p2pool-adaptive
extra_modules/x11_hash/test.py
Python
gpl-3.0
344
# -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the aut...
sirkubax/ansible
lib/ansible/module_utils/cloudstack.py
Python
gpl-3.0
13,783
# Copyright (C) 2013 Statoil ASA, Norway. # # The file 'test_run.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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, teither version 3 of...
arielalmendral/ert
python/python/ert/test/test_run.py
Python
gpl-3.0
5,315
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from frappe.model.document import Document class EmployeeTaxExemptionCategory(Document): pass
mhbu50/erpnext
erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py
Python
gpl-3.0
218
from p2pool.bitcoin import networks PARENT = networks.nets['solcoin'] SHARE_PERIOD = 20 # seconds target spacing CHAIN_LENGTH = 12*60*60//20 # shares REAL_CHAIN_LENGTH = 12*60*60//20 # shares TARGET_LOOKBEHIND = 15 # shares SPREAD = 20 # blocks IDENTIFIER = 'e0f0b08e5af1e89a'.decode('hex') PREFIX = 'a6f2b07e0ac18b6e'....
0x0aNL/p2pool-0x0a
p2pool/networks/solcoin.py
Python
gpl-3.0
599
lst = 1132424 if 'a' in lst: # Error on this line print('unsupported membership test')
pyta-uoft/pyta
examples/pylint/e1135_unsupported_membership_test.py
Python
gpl-3.0
92
# -*- coding: utf-8 -*- # emailfirewall.py # Copyright (C) 2014 LEAP # # 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, either version 3 of the License, or # (at your option) any later version. #...
ivanalejandro0/bitmask_client
src/leap/bitmask/services/mail/emailfirewall.py
Python
gpl-3.0
3,225
import datetime import json from constance.test import override_config from django.conf import settings from django.core.files.base import ContentFile from django.db import transaction from django.utils.http import parse_http_date_safe from kuma.core.urlresolvers import reverse from kuma.users.tests import UserTestCa...
safwanrahman/kuma
kuma/attachments/tests/test_views.py
Python
mpl-2.0
9,771
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.conf.urls import patterns, url from oneanddone.users import views urlpatterns = patterns('', url(r'^lo...
adini121/oneanddone
oneanddone/users/urls.py
Python
mpl-2.0
1,193
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from nose.tools import eq_, ok_, assert_raises from mock import ( Mock, call, patch ) from threading import ...
adngdb/socorro
socorro/unittest/external/rabbitmq/test_connection_context.py
Python
mpl-2.0
8,203
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero G...
odoousers2014/LibrERP
l10n_it_sale_group/__init__.py
Python
agpl-3.0
1,004
from django import forms from django.contrib import admin from django.contrib.gis import db from django.contrib.contenttypes.generic import GenericTabularInline from django.core.exceptions import ValidationError from ajax_select import make_ajax_form from ajax_select.admin import AjaxSelectAdmin from pombola.core imp...
hzj123/56th
pombola/core/admin.py
Python
agpl-3.0
8,525
#!/usr/bin/python # # \file 0_setup.py # \brief setup pacs_prim_list # \date 2011-09-28 7:22GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Setup pacs_prim_list # # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # Copyright (C) 2010 Winch Gate Property Limited # # This prog...
osgcc/ryzom
nel/tools/build_gamedata/processes/pacs_prim_list/0_setup.py
Python
agpl-3.0
1,786
import os from queue import Queue from bears.python.requirements.PySafetyBear import PySafetyBear from coalib.settings.Section import Section from coalib.settings.Setting import Setting from coalib.testing.LocalBearTestHelper import LocalBearTestHelper from coalib.results.Result import Result from coalib.results.RESUL...
coala/coala-bears
tests/python/requirements/PySafetyBearWithoutMockTest.py
Python
agpl-3.0
5,749
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): orm.ChartType.objects.all().filter(shortname='google-fusion-map').delete() t, _ = orm.ChartType.objects.all().get_or_cr...
chispita/epiwork
apps/pollster/migrations/0011_fix_google_fusion_map.py
Python
agpl-3.0
16,680