code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
#!/usr/bin/python # # 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 b...
vanant/googleads-dfa-reporting-samples
python/v2.1/get_files.py
Python
apache-2.0
2,171
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
Fokko/incubator-airflow
airflow/sensors/sql_sensor.py
Python
apache-2.0
4,819
from libpcapy import pcap import signal import argparse import sys import threading counter = 0 def handler(signum, frame): print('Signal handler called with signal ', signum, counter) sys.exit(0) def callback(pkthdr, data, user_data): global counter counter += 1 print('%d.%d(%d/%d) '%(pkthdr.ts....
public0821/libpcapy
libpcapy/tcpdump.py
Python
apache-2.0
1,512
import logging from mobilebdd.drivers.android import AndroidWebDriver, SelendroidWebDriver from mobilebdd.drivers.desktop import DesktopChromeWebDriver, DesktopInternetExplorerWebDriver, DesktopFirefoxWebDriver from mobilebdd.drivers.ios import iOSWebDriver from mobilebdd.drivers.mobileweb import ChromeWebDriver, WebV...
PhoenixWright/MobileBDDCore
mobilebdd/drivers/drivers.py
Python
apache-2.0
3,463
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google/pymql
emql/adapters/search.py
Python
apache-2.0
5,119
# Copyright 2021 gRPC 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 writing...
ejona86/grpc
tools/run_tests/xds_k8s_test_driver/tests/authz_test.py
Python
apache-2.0
12,850
#! /usr/bin/env python # from autopyfactory.interfaces import SchedInterface import logging class WeightedActivated(SchedInterface): id = 'weightedactivated' def __init__(self, apfqueue, config, section): try: self.apfqueue = apfqueue self.log = logging.g...
btovar/autopyfactory
autopyfactory/plugins/queue/sched/WeightedActivated.py
Python
apache-2.0
3,777
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # ArviZ documentation build configuration file, created by # sphinx-quickstart on Wed Apr 11 18:33:59 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
arviz-devs/arviz
doc/source/conf.py
Python
apache-2.0
9,816
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class PluginrepoConfig(AppConfig): name = 'pluginrepo'
weichen2046/IntellijPluginDevDemo
enterprise-repo/enterprepo/pluginrepo/apps.py
Python
apache-2.0
160
__author__ = 'bkeroack' import logging import collections import pprint class RootTree(collections.MutableMapping): def __init__(self, db, updater, tree, doc, *args, **kwargs): self.pp = pprint.PrettyPrinter(indent=4) self.db = db self.tree = tree self.doc = doc self.updat...
bkeroack/elita
elita/dataservice/root_tree.py
Python
apache-2.0
2,449
############################################################################## # # Copyright (c) 2001, 2002, 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution...
mdworks2016/work_development
Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/zope/interface/tests/test_registry.py
Python
apache-2.0
109,233
# 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, software # d...
openstack/sahara-dashboard
sahara_dashboard/test/integration_tests/pages/project/data_processing/jobs/jobtemplatespage.py
Python
apache-2.0
5,101
import os import time import unittest from typing import Callable from unittest.mock import patch from uuid import uuid4 from freezegun import freeze_time from ray_release.exception import ( ClusterCreationError, ClusterStartupError, ClusterStartupTimeout, ClusterStartupFailed, ClusterEnvBuildErro...
ray-project/ray
release/ray_release/tests/test_cluster_manager.py
Python
apache-2.0
24,218
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
h2oai/sparkling-water
py/src/ai/h2o/sparkling/ml/algos/H2OAutoMLExtras.py
Python
apache-2.0
1,464
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
h2oai/sparkling-water
py/tests/unit/with_runtime_sparkling/test_mojo_parameters.py
Python
apache-2.0
6,596
# Copyright 2017-2018 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
google/ffn
train.py
Python
apache-2.0
27,262
from sys import stdin import signal # for i in xrange(1,10): # print "Stuff", i # print stdin.readline() import os pid = int(stdin.readline().strip()) print pid os.kill(pid, signal.SIGINT)
sbarton272/StreetPong
IPC/printer.py
Python
apache-2.0
195
# Copyright (c) 2016 Infoblox 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 require...
infobloxopen/heat-infoblox
heat_infoblox/resources/ospf.py
Python
apache-2.0
7,481
# Copyright 2012 Managed I.T. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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 r...
melodous/designate
designate/api/v1/domains.py
Python
apache-2.0
3,573
from rx.observable import Observable from rx.internal import DisposedException from rx.disposables import Disposable from rx.abstractobserver import AbstractObserver from .anonymoussubject import AnonymousSubject from .innersubscription import InnerSubscription class BehaviorSubject(Observable, AbstractObserv...
Reactive-Extensions/RxPy
rx/subjects/behaviorsubject.py
Python
apache-2.0
2,617
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
sunqm/pyscf
pyscf/tdscf/uhf.py
Python
apache-2.0
36,399
""" Copyright 2020 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/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
google/report2bq
application/classes/sa360_reports.py
Python
apache-2.0
3,492
"""game11_11 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
zerovip/link-link
game11_11/game11_11/urls.py
Python
apache-2.0
824
#!/bin/env python import SimpleITK as sitk import numpy as np import math import time def marschner_lobb(size=40, alpha=0.25, f_M=6.0): img = sitk.PhysicalPointSource( sitk.sitkVectorFloat32, [size]*3, [-1]*3, [2.0/size]*3) imgx = sitk.VectorIndexSelectionCast(img, 0) imgy = sitk.VectorIndexSelectionCast(...
blowekamp/itkBinShrink
Documentation/utils/make_marschner_lobb.py
Python
apache-2.0
2,435
# Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved. ''' Test the qgl2/basic_sequences to ensure they replicate the QGL1 functionality. ''' import datetime import unittest import numpy as np from math import pi import random from pyqgl2.main import compile_function from pyqgl2.qreg import QRegiste...
BBN-Q/pyqgl2
test/test_basic_mins.py
Python
apache-2.0
34,859
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2017-04-05 23:08 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import stocksApi.models class Migration(migrations.Migration): initial = True dependenci...
ddsnowboard/FantasyStocks
fantasyStocks/stocksApi/migrations/0001_initial.py
Python
apache-2.0
996
from sklearn.decomposition import PCA, TruncatedSVD import numpy as np import matplotlib.pyplot as plt from scipy.linalg import decomp_svd x = np.linspace(-2, 2) y = 2 - x x += np.random.normal(0, 0.25, *x.shape) y += np.random.normal(0, 0.25, *y.shape) X = np.column_stack((x, y)) plt.scatter(x, y) pca = PCA(1) pc...
amozie/amozie
testzie/pca_and_svd.py
Python
apache-2.0
429
import csv import os from typing import Callable, Dict from SNOMEDCTToOWL.RF2Files.RF2DictWriter import RF2DictWriter class DirectoryWalker: def __init__(self, indir: str, outdir: str, init: bool): """ Directory walking utility :param indir: directory root to walk from :param outd...
hsolbrig/SNOMEDToOWL
SNOMEDCTToOWL/RF2Files/DirectoryWalker.py
Python
apache-2.0
2,104
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
mbohlool/client-python
kubernetes/client/models/v1alpha1_role_list.py
Python
apache-2.0
6,307
"""Helper stuff for things""" import gc gc.disable() print 'Disabled GC' def timeit(func, iter = 1000, *args, **kwargs): """timeit(func, iter = 1000 *args, **kwargs) -> elapsed time calls func iter times with args and kwargs, returns time elapsed """ import time r = range(iter) t = time...
hortonworks/hortonworks-sandbox
desktop/core/ext-py/Twisted/doc/core/benchmarks/timer.py
Python
apache-2.0
401
# -*- coding: utf-8 -*- '''Custom exceptions for the framework.''' import copy import httplib as http from flask import request class FrameworkError(Exception): """Base class from which framework-related errors inherit.""" pass class HTTPError(FrameworkError): error_msgs = { http.BAD_REQUEST: { ...
AndrewSallans/osf.io
framework/exceptions/__init__.py
Python
apache-2.0
2,900
import pytest import unittest.mock as mock import datetime import open_cp.gui.tk.date_picker as date_picker @pytest.fixture def dp(): with mock.patch("open_cp.gui.tk.date_picker._DatePickerView") as clazzmock: yield date_picker.DatePicker() def test_days_to_text(dp): import locale if locale.getde...
QuantCrimAtLeeds/PredictCode
tests/gui/tk/date_picker_test.py
Python
artistic-2.0
2,322
from tests import BaseTestCase from redash.models import Alert, db from redash.utils import json_dumps class TestAlertAll(BaseTestCase): def test_returns_all_alerts_for_given_groups(self): ds1 = self.factory.data_source group = self.factory.create_group() ds2 = self.factory.create_data_sou...
chriszs/redash
tests/models/test_alerts.py
Python
bsd-2-clause
2,513
from datetime import date from unittest.mock import patch from nose.tools import istest from base.clients import ClientConfigurationError, YouTubeClient from base.tests.utils import YouTubeTestCase class YouTubeClientTest(YouTubeTestCase): @istest def raises_exception_if_misconfigured_api_key(self): ...
diogobaeder/giva
base/tests/test_clients.py
Python
bsd-2-clause
1,375
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('freebasics', '0005_remove_selected_template_field'), ] operations = [ migrations.AlterField( model_name='freebas...
praekeltfoundation/mc2-freebasics
freebasics/migrations/0006_change_site_url_field_type.py
Python
bsd-2-clause
477
# # # Copyright (C) 2014 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 copyright notice, # this list of conditions and ...
grnet/snf-ganeti
lib/tools/common.py
Python
bsd-2-clause
6,956
from setuptools import setup, find_packages __version__ = '0' with open('LICENSE.txt') as f: license = f.read() setup( name='TradingTools', version=__version__, author='Rob Innes Hislop', author_email='robinneshislop@gmail.com', license=license, packages=find_packages(), url = 'https:...
innes213/TradingTools
setup.py
Python
bsd-2-clause
624
class Operation: """ Operation, single operation within execution plan. """ def __init__(self, name, args=None): """ Create a new operation. Args: name: string that represents the name of the operation args: operation arguments """ self.n...
swilly22/redisgraph-py
redisgraph/execution_plan.py
Python
bsd-2-clause
5,416
""" DynIP Client A embarrisingly-simple client with sends UDP packets to the DynIP server. """ """ Copyright (c) 2011, R. Kristoffer Hardy All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribu...
krishardy/dynip
dynip/client.py
Python
bsd-2-clause
4,662
import os import threading import time import zipfile import shutil from update_from_github import request, xlog, hash_file_sum current_path = os.path.dirname(os.path.abspath(__file__)) root_path = os.path.abspath(os.path.join(current_path, os.pardir)) top_path = os.path.abspath(os.path.join(root_path, os.pardir, os....
xyuanmu/XX-Net
code/default/launcher/download_modules.py
Python
bsd-2-clause
4,591
#!/usr/bin/env python3 import unittest import fileLists class TestFileLists(unittest.TestCase): def testOneEntry(self): l=fileLists.listTableFiles([ '2014.3765.1.1.department.diff.csv', ]) self.assertEqual(len(l),1) t=l[0] self.assertEqual(t.stageYear,2014) self.assertEqual(t.documentNumber,3765) s...
AntonKhorev/spb-budget-db
3-db/testFileLists.py
Python
bsd-2-clause
1,567
import sys from indra import reach from indra.assemblers import GraphAssembler orig_txt = [ln.strip() for ln in open('ras_pathway.txt', 'rt').readlines()] correct_txt = [ln.strip() for ln in open('correction.txt', 'rt').readlines()] for ln in correct_txt: if ln.startswith('<'): remove_line = ln[2:] ...
jmuhlich/indra
models/ras_pathway/run_correction.py
Python
bsd-2-clause
855
#!/usr/bin/env python # -*- coding: utf-8 -*- from body_membership_copy import get_or_copy_body_membership_to_session, replicate_all_body_memberships_into_session
access-missouri/am-django-project
am/legislative/management/__init__.py
Python
bsd-2-clause
164
from numpy import array, compress, zeros import wx from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin from spacq.interface.list_columns import ListParser """ Embeddable, generic, virtual, tabular display. """ class VirtualListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin): """ A generic virtual list. """ ma...
ghwatson/SpanishAcquisitionIQC
spacq/gui/display/table/generic.py
Python
bsd-2-clause
4,604
import pyglet from pyglet.window import key from pyglet_app_gl_helper import set_gl_defaults, gl_enable_line_smoothing from pyglet_app_gl_axes import check_y_lims ''' abstract Screen class ''' class BasicScreen(object): def __init__(self, mainapp): self.mainapp = mainapp pass def start(s...
StimOMatic/StimOMatic
python/OpenGLPlotting/pomp/libs/pyglet_app_basic_screens.py
Python
bsd-2-clause
6,962
import pygame class EndBlock(pygame.sprite.Sprite): locked = True def __init__(self, pos = [0,0]): pygame.sprite.Sprite.__init__(self, self.containers) # always initialize locked endblock self.lock() self.rect = self.image.get_rect() self.place(pos) self.living = True def lock(self): self.image ...
KRHS-GameProgramming-2014/Arkansas-Smith
EndBlock.py
Python
bsd-2-clause
630
"""Provide the Front class.""" from ..const import API_PATH from .listing.generator import ListingGenerator from .base import PRAWBase from .util import stream_generator class Inbox(PRAWBase): """Inbox is a Listing class that represents the Inbox.""" def all(self, **generator_kwargs): """Return a Lis...
leviroth/praw
praw/models/inbox.py
Python
bsd-2-clause
9,119
#!/usr/bin/env python import os import sys def run(): from django.core.management import execute_from_command_line os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.app.settings' execute_from_command_line([sys.argv[0], 'test'] + sys.argv[1:]) if __name__ == '__main__': run()
absperf/wagtailapproval
runtests.py
Python
bsd-2-clause
293
"""A mod to scale the data.""" from colorview2d import imod class Scale(imod.IMod): """ The mod class to scale the values in the 2d data array according to the value entered in the widget: args (float): The float that is multiplied with the data array. """ def __init__(self): imod.IMod...
Loisel/colorview2d
colorview2d/mods/Scale.py
Python
bsd-2-clause
455
from django import forms from django.contrib.auth.models import User as user_model from django.contrib.auth.forms import UserCreationForm from mc2.models import UserSettings class UserSettingsForm(forms.ModelForm): settings_level = forms.ChoiceField( choices=UserSettings.SETTINGS_LEVEL_CHOICES, ...
praekelt/mc2
mc2/forms.py
Python
bsd-2-clause
1,161
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) from powerline.renderer import Renderer from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE def attrs_to_tmux_attrs(attrs): if attrs is False: return ['nobold', 'noitalics', 'nou...
codeprimate/arid
powerline/powerline/renderers/tmux.py
Python
bsd-2-clause
2,201
""" Plugin for Czech TV (Ceska televize). Following channels are working: * CT1 - http://www.ceskatelevize.cz/ct1/zive/ * CT2 - http://www.ceskatelevize.cz/ct2/zive/ * CT24 - http://www.ceskatelevize.cz/ct24/ * CT sport - http://www.ceskatelevize.cz/sport/zive-vysilani/ * CT Decko - http://decko.ce...
mmetak/streamlink
src/streamlink/plugins/ceskatelevize.py
Python
bsd-2-clause
4,014
#################################################################### # Author: Limodou@gmail.com # License: BSD #################################################################### __author__ = 'limodou' __author_email__ = 'limodou@gmail.com' __url__ = 'https://github.com/limodou/uliweb' __license__ = 'BSD' v...
wwfifi/uliweb
uliweb/__init__.py
Python
bsd-2-clause
1,358
from __future__ import unicode_literals # -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.delete_column('pages_page', 'in_navigation') db.delete_column('pa...
eRestin/MezzGIS
mezzanine/pages/migrations/0011_delete_nav_flags.py
Python
bsd-2-clause
5,290
#!/usr/bin/env python import redhawk.common.node as N import redhawk.common.types as T import redhawk.utils.util as U from . import writer import itertools import pygraphviz def WriteToDot(tree): s = DotWriter() return s.WriteTree(tree) def WriteToImage(tree, fmt='png', filename=None): s = DotWriter() s.Ad...
JordanMilne/Redhawk
redhawk/common/writers/dot_writer.py
Python
bsd-2-clause
3,490
import matplotlib matplotlib.use('Agg') from collections import namedtuple import matplotlib.pylab as plt import numpy as np import os.path from pySDC.implementations.datatype_classes.mesh import mesh from pySDC.implementations.problem_classes.HeatEquation_1D_FD import heat1d # setup id for gathering the results (wi...
Parallel-in-Time/pySDC
pySDC/tutorial/step_1/B_spatial_accuracy_check.py
Python
bsd-2-clause
5,857
from contextlib import contextmanager from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound from sqlalchemy.orm.exc import NoResultFound @contextmanager def keyerror_is_bad_request(): try: yield except KeyError as exc: raise HTTPBadRequest('missing required key {}'.format(exc)) @co...
nthuion/nthuion-backend
nthuion/utils.py
Python
bsd-2-clause
437
#!/usr/bin/env python """ fileaction.py 'display' '*.ps' '*.jpg' '*.gif' creates a GUI with a list of all PostScript, JPEG, and GIF files in the directory tree with the current working directory as root. Clicking on one of the filenames in the list launches the display program, which displays the image file. As ano...
sniemi/SamPy
sandbox/src1/TCSE3-3rd-examples/src/tools/fileaction.py
Python
bsd-2-clause
3,008
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_cond_format01.py
Python
bsd-2-clause
1,643
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() # Add the urlpatterns for any custom Django applications here. # You can also change the ``home`` view to add your own functionality # to the project's homepage. urlpatterns = patterns("", ("^admin/", includ...
ambientsound/cash-generator
urls.py
Python
bsd-2-clause
717
import hashlib import os.path from django.db import models from django.core.files.uploadedfile import InMemoryUploadedFile from django.dispatch import receiver from importlib import import_module from django.urls import reverse from . import utils from .settings import IMAGE_SIZES, IMAGE_PATH, IMAGE_AUTO_DELETE d...
pinry/pinry
django_images/models.py
Python
bsd-2-clause
4,263
""" This script is an example of how to use the random gaussian noise generator module. |br| In this example only one signal is generated. Both the minimum and the maximum frequency component in the signal is regulated. After the generation, spectrum fo the signal is analyzed with an Welch analysis and ploted. *...
JacekPierzchlewski/RxCS
examples/signals/gaussNoise_ex1.py
Python
bsd-2-clause
1,774
# -*- coding: utf-8 -*- import os romie_sqlite = os.path.join(CURRENT_PATH, "romie_labpsico.db") romie_table = 'users' romie_time = 194.159 # 3 minutes, 14.159 seconds romie_server = 'http://192.168.0.190:8000/' romie_labpsico = True romie_demo = False questions = [ [ # 0 difficulty { "questio...
zstars/weblabdeusto
server/launch/sample/main_machine/main_instance/experiment_romie_labpsico/server_config.py
Python
bsd-2-clause
24,328
# # doctest.py: Syntax Highlighting for doctest blocks # Edward Loper # # Created [06/28/03 02:52 AM] # $Id: restructuredtext.py 1210 2006-04-10 13:25:50Z edloper $ # """ Syntax highlighting for doctest blocks. This module defines two functions, L{doctest_to_html()} and L{doctest_to_latex()}, which can be used to per...
akiokio/centralfitestoque
src/.pycharm_helpers/epydoc/markup/doctest.py
Python
bsd-2-clause
13,099
from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from collections import OrderedDict from datetime import date, timedelta import signals class UserProfile(models.Model): user = models.OneToOneField(User, primary_key=True) # Optional new fields...
badp/weather
weather/models.py
Python
bsd-2-clause
8,309
# coding: utf-8 from datetime import datetime import os import tempfile import shutil from django.conf import settings from onadata.apps.main.tests.test_base import TestBase from onadata.apps.logger.models import Instance from onadata.apps.logger.import_tools import django_file from onadata.apps.logger.import_tools i...
kobotoolbox/kobocat
onadata/apps/logger/tests/test_backup_tools.py
Python
bsd-2-clause
3,654
# -*- coding: utf-8 -*- """ Test file question type. """ from tests.pyxform_test_case import PyxformTestCase class FileWidgetTest(PyxformTestCase): """ Test file widget class. """ def test_file_type(self): """ Test file question type. """ self.assertPyxformXform( ...
XLSForm/pyxform
tests/test_file.py
Python
bsd-2-clause
622
""" raven.utils ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import hashlib import hmac import logging try: import pkg_resources except ImportError: pkg_resources = None import sys import raven def construct_check...
mitsuhiko/raven
raven/utils/__init__.py
Python
bsd-3-clause
3,540
import os import unittest import warnings from dotenv import parse_dotenv, read_dotenv class ParseDotenvTestCase(unittest.TestCase): def test_parses_unquoted_values(self): env = parse_dotenv('FOO=bar') self.assertEqual(env, {'FOO': 'bar'}) def test_parses_values_with_spaces_around_equal_sign...
kevgathuku/django-dotenv
tests.py
Python
bsd-3-clause
4,694
from soppa.contrib import * class Celery(Soppa): def setup(self): self.action('up', 'celery_supervisor.conf', '{supervisor_conf_dir}celery_supervisor_{project}.conf', handler=['supervisor.restart'], when=lambda x: x.soppa_proc_daemon=='supervisor',)
futurice/fabric-deployment-helper
soppa/celery/__init__.py
Python
bsd-3-clause
311
import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup( name = 'simplui', version = '1.0.4', author = 'Tristam MacDonald', author_email = 'swiftcoder@gmail.com', description = 'Light-weight GUI toolkit for pyglet', url = 'http://simplui.googlecode.com/', platforms = ['all']...
boskee/simplui
setup.py
Python
bsd-3-clause
803
import cgi import errno import mimetypes import os import posixpath import re import shutil import stat import sys import tempfile from os import path import django from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import handle_extensions from django.template import C...
bretlowery/snakr
lib/django/core/management/templates.py
Python
bsd-3-clause
13,259
"""The public module, including the homepage and user auth.""" from . import views
whiskyechobravo/flask-debut
debut/public/__init__.py
Python
bsd-3-clause
84
#!/usr/bin/python # Copyright (c) 2009 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. """Extract UserMetrics "actions" strings from the Chrome source. This program generates the list of known actions we expect to see in ...
rwatson/chromium-capsicum
chrome/tools/extract_actions.py
Python
bsd-3-clause
4,264
from __future__ import absolute_import, print_function, unicode_literals class ShowHelp(Exception): pass class ClyentError(Exception): pass
GiovanniConserva/TestDeploy
venv/Lib/site-packages/clyent/errors.py
Python
bsd-3-clause
150
from django.conf.urls import url, include from django.contrib import admin from rest_framework import routers, serializers, viewsets from .views import HomePageView urlpatterns = [ url(r'^$', HomePageView.as_view(), name='home'), url(r'^admin/', admin.site.urls), url(r'^', include('slackdata.urls')), ]
jbarciauskas/slack-stats
openedxstats/urls.py
Python
bsd-3-clause
319
# -*- coding: utf-8 -*- # store User and Token tables in the memory DATABASES = { 'default': { 'backend': 'aiorest_ws.db.backends.sqlite3', 'name': ':memory:' } }
Relrin/aiorest-ws
examples/auth_token/settings.py
Python
bsd-3-clause
187
GROUP_INDEX = "hqgroups_htj2o87ep2rugag3k46hh2a67tn0r8d9" GROUP_MAPPING = { "date_formats": [ "yyyy-MM-dd", "yyyy-MM-dd'T'HH:mm:ssZZ", "yyyy-MM-dd'T'HH:mm:ss.SSSSSS", "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'", "yyyy-MM-dd'T'HH:mm:ss'Z'", "yyyy-MM-dd'T'HH:mm:ssZ", "yyy...
SEL-Columbia/commcare-hq
corehq/pillows/mappings/group_mapping.py
Python
bsd-3-clause
1,716
from distutils.version import LooseVersion import os import pytest import pandas.util.testing as tm from pandas.io.parsers import read_csv @pytest.fixture def tips_file(datapath): """Path to the tips dataset""" return datapath('io', 'parser', 'data', 'tips.csv') @pytest.fixture def jsonl_file(datapath): ...
cbertinato/pandas
pandas/tests/io/conftest.py
Python
bsd-3-clause
2,699
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name = 'django_sprinkler', version = '0.4', packages = ["django_...
jpardobl/django_sprinkler
setup.py
Python
bsd-3-clause
1,456
# -*- coding:utf-8 -*- __version__ = '2.6.0+whyfly.3'
whyflyru/django-seo
djangoseo/version.py
Python
bsd-3-clause
54
""" Copyright (c) 2015, 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import json import os from osbs.exceptions import OsbsResponseException from atomic_reactor.plugins.pre_reactor_config import get_open...
DBuildService/atomic-reactor
atomic_reactor/plugins/exit_store_metadata_in_osv3.py
Python
bsd-3-clause
12,020
import numpy as np import pytest from pandas import ( DataFrame, Series, date_range, ) import pandas._testing as tm class TestTZLocalize: # See also: # test_tz_convert_and_localize in test_tz_convert def test_tz_localize(self, frame_or_series): rng = date_range("1/1/2011", periods=10...
pandas-dev/pandas
pandas/tests/frame/methods/test_tz_localize.py
Python
bsd-3-clause
2,050
import copy import resource import sys import traceback import unittest import mock import numpy as np import sklearn.datasets import sklearn.decomposition import sklearn.ensemble import sklearn.svm from sklearn.utils.testing import assert_array_almost_equal from HPOlibConfigSpace.configuration_space import Configura...
hmendozap/auto-sklearn
test/test_pipeline/test_regression.py
Python
bsd-3-clause
18,360
from .site import Site
msosvi/flask-pyco
flask_pyco/__init__.py
Python
bsd-3-clause
23
import logging import sys from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from cms.models import Page, PagePermission from django_cms_tools.fixtures.pages import CmsPageCreator # https://github.com/jed...
wearehoods/django-model-publisher-ai
publisher_test_project/fixtures.py
Python
bsd-3-clause
6,789
#! /usr/bin/env python '''lint for sets of items There are many things that really shouldn't exist with a set of items. One of the biggest is that the dependencies should form a directed acyclic graph, with absolutely no cycles. e.g. given the set of items {a.b,c}, if a depends on b, b depends on c, and c depends ...
anchor/make-magic
tools/lint.py
Python
bsd-3-clause
3,918
#!/usr/bin/env python2.7 """ Copyright 2018 Couchbase, 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 agree...
daverigby/kv_engine
scripts/cbnt_perfsuite_strip_results.py
Python
bsd-3-clause
2,943
import distutils.command.clean import distutils.spawn import glob import os import shutil import subprocess import sys import torch from pkg_resources import parse_version, get_distribution, DistributionNotFound from setuptools import setup, find_packages from torch.utils.cpp_extension import BuildExtension, CppExtens...
pytorch/vision
setup.py
Python
bsd-3-clause
20,786
from string import printable import re from urlparse import urlunparse from itertools import chain, ifilter from fnmatch import fnmatch from werkzeug import cached_property from swarm import transport, swarm from swarm.ext.http.helpers import parser, URL from ..text import PageText from .tree import TrieTree as Tree ...
denz/swarm-crawler
swarm_crawler/dataset/datasource.py
Python
bsd-3-clause
7,406
from __future__ import absolute_import import os import subprocess import sys import tarfile import tempfile import traceback import zipfile from threading import Thread import six from django.utils.text import get_valid_filename from django.core.files import File from django.conf import settings from celery import T...
wooey/Wooey
wooey/tasks.py
Python
bsd-3-clause
10,721
""" byceps.blueprints.site.board.views_category ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from flask import abort, g, url_for from flask_babel import gettext from ....services.board import ( category_query_ser...
homeworkprod/byceps
byceps/blueprints/site/board/views_category.py
Python
bsd-3-clause
2,673
# -*- coding: utf-8 -*- from django.forms.models import ModelForm from .models import IntModel class IntArrayForm(ModelForm): class Meta: model = IntModel
niwinz/djorm-ext-pgjson
testing/pg_json_fields/forms.py
Python
bsd-3-clause
169
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-09-28 18:38 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('financialaid', '0005_switch_jsonfield'), ] operatio...
mitodl/micromasters
financialaid/migrations/0006_update_tierprogram.py
Python
bsd-3-clause
574
from django.db import models from ckeditor.fields import RichTextField from django.contrib.auth.models import User class Categoria(models.Model): id = models.AutoField(primary_key=True) nome = models.CharField(max_length=100, blank=False) def __str__(self): return self.nome def __unicode__(self): return se...
MatheusDaeuble/admsolucoesblog
blog/models.py
Python
bsd-3-clause
1,053
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import inspect import warnings from unittest import TestCase from traitlets import TraitError from ipywidgets import Dropdown, SelectionSlider, Select class TestDropdown(TestCase): def test_construction(self):...
ipython/ipywidgets
ipywidgets/widgets/tests/test_widget_selection.py
Python
bsd-3-clause
2,058
import json import logging import asyncio import random import socket from hbmqtt.client import MQTTClient, ClientException from hbmqtt.mqtt.constants import QOS_1 logging.basicConfig(format='%(asctime)s - %(name)14s - ' '%(levelname)5s - %(message)s') logger = logging.getLogger("mqtt_test_...
pyaiot/pyaiot
utils/mqtt/mqtt-test-node.py
Python
bsd-3-clause
5,525
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='bloom', version='0.4.4', packages=find_packages(exclude=['test']), package_data={ 'bloom.generators.debian': [ 'bloom/generators/debian/templates/*', 'bloom/generators/debian/templates/source...
130s/bloom
setup.py
Python
bsd-3-clause
2,778
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################### # Copyright/License Notice (BSD License) # ######################################################################### ###################################################...
haxwithaxe/ddp
ddp_specification_03.py
Python
bsd-3-clause
6,771
# -*- coding: utf-8 -*- """Factories to help in tests.""" from factory import PostGenerationMethodCall, Sequence from factory.alchemy import SQLAlchemyModelFactory from authmgr.database import db from authmgr.user.models import User class BaseFactory(SQLAlchemyModelFactory): """Base factory.""" class Meta: ...
bcarroll/authmgr
authmgr/tests/factories.py
Python
bsd-3-clause
761