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
# # 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...
sassoftware/rbuild
rbuild/productstore/__init__.py
Python
apache-2.0
861
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================================== # Copyright 2017 Julien LE CLEACH # # 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 Lice...
julien6387/supvisors
supvisors/test/scripts/check_starting_strategy.py
Python
apache-2.0
14,658
from template.test import TestCase, main class StringTest(TestCase): def testString(self): self.Expect(DATA) DATA = r""" -- test -- [% USE String -%] string: [[% String.text %]] -- expect -- string: [] -- test -- [% USE String 'hello world' -%] string: [[% String.text %]] -- expect -- string: [hello world] ...
gsnedders/Template-Python
t/string_test.py
Python
artistic-2.0
6,966
try: import json except ImportError: import simplejson as json from soundcloud.resource import wrapped_resource, ResourceList, Resource from soundcloud.tests.utils import MockResponse from nose.tools import eq_ def test_json_list(): """Verify that a json list is wrapped in a ResourceList object.""" ...
Fauxmoehawkeen/soundcloud-python-master
soundcloud/tests/test_resource.py
Python
bsd-2-clause
1,217
#!/usr/bin/env python import pyppp if __name__ == '__main__': print 'PyPPP Version: %s' % pyppp.__version__ p = pyppp.PyPPP() print 'PPP Specification Version: %s' % p.__version__ p.generate_random_sequence_key() print 'PPP Key: %s' % p.key passcode = 5 print 'Passcode: %d' % passcode p...
kylef/pyppp
test.py
Python
bsd-2-clause
362
# -*- coding:utf8 -*- from . import server __VERSION__ = server.__VERSION__ __author__ = 'drz' __email__ = 'drzunny@hotmail.com'
drzunny/hydrus
hydrus/__init__.py
Python
bsd-2-clause
131
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('groups', '00...
incuna/incuna-groups
groups/migrations/0016_attachedfile.py
Python
bsd-2-clause
997
# Copyright (c) 2013 Yubico AB # 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 conditi...
Yubico/yubiadmin
yubiadmin/util/app.py
Python
bsd-2-clause
7,953
# -*- mode: python; coding: utf-8 -*- # Copyright 2017 the HERA Collaboration # Licensed under the 2-clause BSD license. """ Functions to handle various cm revision queries and checks. LAST, ACTIVE, ALL, <specific> are handled (typically) via get_revisions_of_type. FULL revisions are called directly (get_full_revisio...
HERA-Team/hera_mc
hera_mc/cm_revisions.py
Python
bsd-2-clause
9,851
from ctypes import c_byte, c_short def s8(byte: int) -> int: return c_byte(byte).value def s16(word: int) -> int: return c_short(word).value
AndreaOrru/Gilgamesh
gilgamesh/utils/signed_types.py
Python
bsd-2-clause
153
import logging import angr ###################################### # getrlimit ###################################### l = logging.getLogger(name=__name__) #pylint:disable=redefined-builtin,arguments-differ class getrlimit(angr.SimProcedure): def run(self, resource, rlim): if self.state.solver.eval(resour...
angr/angr
angr/procedures/linux_kernel/getrlimit.py
Python
bsd-2-clause
832
#The audio card number to be used; use "aplay -l" output to determine the card number AUDIO_CARD_NUMBER = 1 # Define the IR/button input pin INP_PIN = 2 # Speed with which the converted text is to be spoken TTS_SPEED = 70 # Config server to spawned ot not, set to false if you do not want the config server CONF...
navin-bhaskar/NewsReader-on-Linkit7688
config.py
Python
bsd-2-clause
522
# -*- coding: utf-8 -*- from simplescheduler import Scheduler, Job from datetime import timedelta import unittest class FakeRedis(object): def __init__(self): self._r = {} self._ledger = [] def sadd(self, key, member): self._ledger.append('SADD %s:%s' % (key, member)) if n...
dps/simplescheduler
tests/test_scheduler.py
Python
bsd-2-clause
2,897
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org # from ..excel_comparison_test import ExcelComparisonTest from ...workbook import Workbook class TestCompar...
jmcnamara/XlsxWriter
xlsxwriter/test/comparison/test_chart_line02.py
Python
bsd-2-clause
1,364
# coding:UTF-8 """ Copyright (c) 2009-2010 Marian Tietz 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...
sushi-irc/tekka
signal_handler.py
Python
bsd-2-clause
38,295
import disk import dos33disk import os import sys def main(): disks = {} for root, dirs, files in os.walk(sys.argv[1]): for f in files: if not f.lower().endswith('.dsk') and not f.lower().endswith('.do'): continue print f b = bytearray(open(os.path....
KrisKennaway/pyapple2disk
src/apple2disk/process.py
Python
bsd-2-clause
1,497
""" This is a self genrated test created by scaffolding.py. you will need to fill it up with all your necessities. Safe hacking :). """ from zope.interface import implements from twisted.python import usage from twisted.plugin import IPlugin from ooni.plugoo.tests import ITest, OONITest from ooni.plugoo.assets import A...
hackerberry/ooni-probe
old-to-be-ported-code/old-api/httpt.py
Python
bsd-2-clause
3,102
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # ###Description and preliminary code for Continuous-Time Markov Chain Model # # This model will test the importance of including a spatial component in the system. We will use ODEs to describe the dynamics of each lineage and competition between li...
rbirger/OxfordHCVNonSpatial
Non-Spatial Model Outline and Code_old.py
Python
bsd-2-clause
44,084
from django import http from django.conf import settings from google.appengine.api import users from .exceptions import ParameterRequired, ApiException class User (object): def __init__ (self): self._email = None self._is_super = None self._is_auth = None self._userid = None self.user = No...
pizzapanther/GAE-Bulk-Mailer
bulkmail/middleware.py
Python
bsd-2-clause
2,043
#!/usr/bin/python import os,sys,json,re for dirpath,dirnames,filenames in os.walk("data/courts/us"): indexPath = os.path.join(dirpath,"index.txt") if not os.path.exists(indexPath): print "Oops: %s" % indexPath sys.exit() fh = open(indexPath) lines = [] template = None firstCon...
fbennett/legal-resource-registry
attic/WALK-FILES.py
Python
bsd-2-clause
1,115
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "guidcoin.settings_prod") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
kbarnes3/guidcoin
web/manage_prod.py
Python
bsd-2-clause
256
# coding: utf-8 """ MINDBODY Public API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import impo...
mindbody/API-Examples
SDKs/Python/test/test_client_api.py
Python
bsd-2-clause
5,280
""" Dummy node for bee.segments.test in the GUI """ class test(object): guiparams = dict( __beename__="test", antennas=dict( inp=("push", "bool"), ), outputs=dict( outp=("push", "trigger"), ), parameters={}, )
agoose77/hivesystem
hiveguilib/segments/test.py
Python
bsd-2-clause
293
from ..vendor.lexicon import Lexicon from .argument import Argument def to_flag(name): name = name.replace('_', '-') if len(name) == 1: return '-' + name return '--' + name def sort_candidate(arg): names = arg.names # TODO: is there no "split into two buckets on predicate" builtin? s...
thedrow/invoke
invoke/parser/context.py
Python
bsd-2-clause
7,616
# Copyright (c) 2012-2022, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** from . import AWSObject, PropsDictType, Tags from .validators import boolean class Graph(AWSObject): """ `Graph <http://docs.aws.amazon.co...
cloudtools/troposphere
troposphere/detective.py
Python
bsd-2-clause
990
import angr import claripy import nose import os import subprocess try: import avatar2 from angr_targets import AvatarGDBConcreteTarget except ImportError: raise nose.SkipTest() binary_x86 = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.join('..', '..', 'bina...
iamahuman/angr
tests/test_concrete_packed_elf32.py
Python
bsd-2-clause
3,926
#! /usr/bin/env python """ Extract mean parameter estimates from ROI """ import os import sys import re import os.path as op from textwrap import dedent import argparse from subprocess import call from scipy import stats import scipy as sp import numpy as np import pandas as pd import nibabel as nib import lyman fro...
sgagnon/lyman-tools
roi/extract_copes.py
Python
bsd-2-clause
9,264
from datetime import datetime import peewee import itertools import random from time import sleep from models import Sensor, SensorData, init_db sensors = [{"id": 1, "location": "Living Room", "late_updated": datetime.now(), "name": "greenpi", "refresh_rate": 30} ...
jeffrobots/senseRF
app/add_data.py
Python
bsd-2-clause
2,377
import djng, os, datetime djng.template.configure( os.path.join(os.path.dirname(__file__), 'example_templates') ) def index(request): return djng.TemplateResponse(request, 'example.html', { 'time': str(datetime.datetime.now()), }) if __name__ == '__main__': djng.serve(index, '0.0.0.0', 8888)
simonw/djng
example_template.py
Python
bsd-2-clause
320
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-07-05 21:26 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('legislative', '0001_initial'), ] operations = [ migrations.AlterField( ...
access-missouri/am-django-project
am/legislative/migrations/0002_auto_20170705_2126.py
Python
bsd-2-clause
1,234
# Auto-clustering, suggested by Matt Terry from skimage import io, color, exposure from sklearn import cluster, preprocessing import numpy as np import matplotlib.pyplot as plt url = 'http://blogs.mathworks.com/images/steve/2010/mms.jpg' import os if not os.path.exists('mm.jpg'): print("Downloading M&M's...") ...
scikit-image/skimage-demos
mm_color_cluster.py
Python
bsd-3-clause
2,030
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
lastweek/gem5
src/mem/Bus.py
Python
bsd-3-clause
4,073
""" Powers of Three: Given a positive integer N, return the largest integer k such that 3**k < N. For example, >>> largestPower(3) 0 >>> largestPower(4) 1 >>> largestPower(28) 3 >>> largestPower(80) 3 >>> largestPower(82) 4 >>> largestPower(20700) 9 >>> largestPower(10**7) 14 >>> largestPower(10**8) 16 """ from mat...
FranzSchubert92/cw
python/powers_of_3.py
Python
bsd-3-clause
908
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from setuptools.command.test import test as TestCommand try: from setuptools import setup except ImportError: from distutils.core import setup import plugz readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. ...
mistermatti/plugz
setup.py
Python
bsd-3-clause
1,412
# Copyright (c) 2006-2009 The Trustees of Indiana University. # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
matthiaskramm/corepy
examples/spu_interspu.py
Python
bsd-3-clause
5,421
"""For backward compatibility only.""" # pylint: skip-file from neurom.core.morphology import * # pragma: no cover from neurom.utils import deprecated_module # pragma: no cover deprecated_module('Module `neurom.core.neuron` is deprecated. Use `neurom.core.morphology`' ' instead.') # pragma: no co...
BlueBrain/NeuroM
neurom/core/neuron.py
Python
bsd-3-clause
324
import os from setuptools import setup, find_packages from setuptools.dist import Distribution import pkg_resources import taggit_live setup(name='django-taggit-live', version=taggit_live.__version__, description="It's an autocomplete widget for django-taggit TagField", author='20tab srl: Raffaele Co...
20tab/django-taggit-live
setup.py
Python
bsd-3-clause
1,287
import abc from sqlalchemy.orm import exc from watson.auth import crypto from watson.auth.providers import exceptions from watson.common import imports from watson.common.decorators import cached_property class Base(object): config = None session = None def __init__(self, config, session): self....
watsonpy/watson-auth
watson/auth/providers/abc.py
Python
bsd-3-clause
3,673
# Copyright 2013 Virgil Dupras (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. import os.path as op from urllib.request import urlopen import subprocess import json from bs4 import BeautifulSoup HERE =...
hsoft/aurdiff
update.py
Python
bsd-3-clause
2,337
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('accounting', '0018_datamigration_product_rates_to_product_rate'), ] operations = [ migrations.RemoveField( model_name='s...
qedsoftware/commcare-hq
corehq/apps/accounting/migrations/0019_remove_softwareplanversion_product_rates.py
Python
bsd-3-clause
392
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-06-25 15:19 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('shipping', '0005_auto_20170616_1351'), ('teamstore'...
jonathanmeier5/teamstore
saleor/teamstore/migrations/0004_teamstore_shipping_method.py
Python
bsd-3-clause
672
import os import subprocess import atexit import signal from django.conf import settings from django.contrib.staticfiles.management.commands.runserver import Command\ as StaticfilesRunserverCommand class Command(StaticfilesRunserverCommand): def inner_run(self, *args, **options): self.start_grunt() ...
kiddhustle/wiardfmblog
wiardfmblog/management/commands/gruntserver.py
Python
bsd-3-clause
1,027
""" This file is part of pyS5p https://github.com/rmvanhees/pys5p.git Provides access to the S5P Tropomi CKD (static and dynamic) ToDo ---- - access to UVN CKD, still incomplete - identify latest Static CKD product, e.g. using the validity period Copyright (c) 2018-2021 SRON - Netherlands Institute for Space Rese...
rmvanhees/pys5p
src/pys5p/ckd_io.py
Python
bsd-3-clause
23,526
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 30, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_Integration/trend_LinearTrend/cycle_30/ar_/test_artificial_1024_Integration_LinearTrend_30__100.py
Python
bsd-3-clause
271
import requests from corehq.apps.sms.models import SQLSMSBackend from corehq.messaging.smsbackends.push.forms import PushBackendForm from django.conf import settings from lxml import etree from xml.sax.saxutils import escape OUTBOUND_REQUEST_XML = """<?xml version="1.0" encoding="UTF-8"?> <methodCall> <methodName...
qedsoftware/commcare-hq
corehq/messaging/smsbackends/push/models.py
Python
bsd-3-clause
3,673
#!/usr/bin/env python import sys import os import inspect import unittest import StringIO import shutil import tempfile curPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) if not curPath in sys.path: sys.path.insert(0, curPath) grapePath = os.path.join(curPath, "..") if grapePath n...
robinson96/GRAPE
test/testGrape.py
Python
bsd-3-clause
7,398
""" implement the TimedeltaIndex """ from datetime import datetime import warnings import numpy as np from pandas._libs import ( NaT, Timedelta, index as libindex, join as libjoin, lib) import pandas.compat as compat from pandas.util._decorators import Appender, Substitution from pandas.core.dtypes.common import...
GuessWhoSamFoo/pandas
pandas/core/indexes/timedeltas.py
Python
bsd-3-clause
27,500
class CommandArgs(): def __init__(self): self.operation = None self.errorLevel = 2 self.recursive = False self.printFlag = False self.extension = '.ckstyle.txt' self.include = 'all' self.exclude = 'none' self.standard = '' self.exportJson = Fal...
wangjeaf/CSSCheckStyle
ckstyle/command/args.py
Python
bsd-3-clause
1,369
__version__ = '0.19' from .usertools import monitor, timing from .ctx_fp import FPContext from .ctx_mp import MPContext from .ctx_iv import MPIntervalContext fp = FPContext() mp = MPContext() iv = MPIntervalContext() fp._mp = mp mp._mp = mp iv._mp = mp mp._fp = fp fp._fp = fp mp._iv = iv fp._iv = iv iv._iv = iv # ...
bjodah/mpmath
mpmath/__init__.py
Python
bsd-3-clause
8,555
# -*- coding: utf-8 -*- # equalize.py # by Jens Kutilek # https://github.com/jenskutilek/Curve-Equalizer #----------------------- # EQMethods/geometry.py #----------------------- from math import atan2, cos, pi, sin, sqrt # helper functions def getTriangleArea(a, b, c): return (b.x - a.x) * (c.y - a.y) - (c.x...
gferreira/hTools2_extension
hTools2.roboFontExt/lib/hTools2/extras/equalize.py
Python
bsd-3-clause
4,304
from __future__ import absolute_import from tridiagonal_core import *
otherlab/tridiagonal
__init__.py
Python
bsd-3-clause
71
def extractXiaoyuusTranslations(item): """ Xiaoyuu's Translations """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None return False
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractXiaoyuusTranslations.py
Python
bsd-3-clause
244
def extractShibbsdenCom(item): ''' Parser for 'shibbsden.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('GOOD CHILD', 'Reborn as a Good Child', 'translated'), (...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractShibbsdenCom.py
Python
bsd-3-clause
714
import os.path import subprocess from django import template from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.templatetags.static import StaticNode from django.contrib.staticfiles import finders from django.contrib.staticfiles.storage import staticfiles_storage from...
JoltLabs/django-web-sugar
web_sugar/templatetags/jslint.py
Python
bsd-3-clause
2,355
def extractTokyoESPScans(item): """ Tokyo ESP Scans """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None return False
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractTokyoESPScans.py
Python
bsd-3-clause
230
from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('pillow_retry', '0001_initial'), ] operations = [ migrations.AddField( model_name='pillowerror', name='queued', field=models.BooleanField(default=False), ...
dimagi/commcare-hq
corehq/ex-submodules/pillow_retry/migrations/0002_pillowerror_queued.py
Python
bsd-3-clause
372
from argparse import ArgumentParser from flask import Flask, abort, send_from_directory import json import logging import os app = Flask(__name__) log = logging.getLogger(__name__) packages = {} @app.route('/<package>/<version>/<database>/<collection>/index.<extension>') def serve_index(package, version, database, c...
OpenEntityMap/oem-client-anidb
examples/anidb_incremental_local_server.py
Python
bsd-3-clause
2,697
""" Field classes. """ import datetime import os import re import time import urlparse import warnings from decimal import Decimal, DecimalException try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core.exceptions import ValidationError from django.core import valida...
tjsavage/rototutor_djangononrel
django/forms/fields.py
Python
bsd-3-clause
31,759
from django.conf import settings try: from PIL import Image dir(Image) # Placate PyFlakes except ImportError: import Image AVATAR_DEFAULT_SIZE = getattr(settings, 'AVATAR_DEFAULT_SIZE', 80) AUTO_GENERATE_AVATAR_SIZES = getattr(settings, 'AUTO_GENERATE_AVATAR_SIZES', (AVATAR_DEFAULT_SIZE,)) AVATAR_RESIZE_M...
alexlovelltroy/django-avatar
avatar/settings.py
Python
bsd-3-clause
1,436
from mock import patch import pytest from bokeh.models import ColumnDataSource import bokeh.core.property.containers as pc def test_notify_owner(): result = {} class Foo(object): @pc.notify_owner def test(self): pass def _notify_owners(self, old): result['old'] = old ...
schoolie/bokeh
bokeh/core/property/tests/test_containers.py
Python
bsd-3-clause
7,196
a=['abc' ,'123' ,'ABDD'] for i in range(len(a)): print i ,a[i] ,len(a) ,len(a[i]) for i in range(10): print i #while True: # pass def fib(n): """Print a Fib """ a ,b = 0 ,1 while b < n: print b, a ,b = b ,a+b fib(30)
1GHL/PythonLearn
study/use-function.py
Python
bsd-3-clause
232
# -*- coding: utf8 -*- import sys import os import pybossa_github_builder as plugin from mock import patch # Use the PyBossa test suite sys.path.append(os.path.abspath("./pybossa/test")) from default import with_context def setUpPackage(): """Setup the plugin.""" from default import flask_app with flask...
alexandermendes/pybossa-github-builder
tests/__init__.py
Python
bsd-3-clause
554
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 0, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 12);
antoinecarme/pyaf
tests/artificial/transf_Anscombe/trend_LinearTrend/cycle_0/ar_12/test_artificial_128_Anscombe_LinearTrend_0_12_20.py
Python
bsd-3-clause
266
# packet.py # # Copyright 2002-2005,2007 Wichert Akkerman <wichert@wiggy.net> # # A RADIUS packet as defined in RFC 2138 import struct import random try: import hashlib md5_constructor = hashlib.md5 except ImportError: # BBB for python 2.4 import md5 md5_constructor = md5.new import six from pyrad...
jaredhoney/pyrad
pyrad/packet.py
Python
bsd-3-clause
21,519
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from django.contrib.auth.models import User from django.db.utils import IntegrityError from django.core.exceptions import ValidationError from loans.models import Business class BusinessTestCase(TestCase): ''' Cr...
Amandil/django-tech-test
loans/tests/tests_model_business.py
Python
bsd-3-clause
5,699
import logging import json import datetime import math from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from expenses.forms import ExpenseForm, SignupForm from expenses.models import Expense, Balance from django.core import serializers from django.db import IntegrityError fro...
deanproxy/register
expenses/views.py
Python
bsd-3-clause
6,474
# -*- coding: utf8 -*- """ Some utils """ from __future__ import absolute_import, division, print_function from .config_arg_parser import ConfigArgParser from .lazy_helper import LazyHelper from .lazy_helper_wrapper import LazyHelperWrapper from .log_meta import LogMeta from .log_settings import LogSetting from...
w495/python-video-shot-detector
shot_detector/utils/__init__.py
Python
bsd-3-clause
348
""" :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from byceps.services.orga_team import service as orga_team_service from byceps.services.party import service as party_service from tests.helpers import create_party def test_teams_for_party(orga_team_admin_clie...
homeworkprod/byceps
tests/integration/blueprints/admin/orga_team/test_team_views.py
Python
bsd-3-clause
4,119
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Set of interfaces that allow interaction with data. Currently available interfaces are: DataSource: Generic nifti to named Nifti interface DataSink: Generic named output from interfaces to ...
FredLoney/nipype
nipype/interfaces/io.py
Python
bsd-3-clause
58,935
from django import forms from django.conf import settings from django.forms.util import ErrorDict import happyforms from tower import ugettext_lazy as _lazy import amo from amo import helpers from search.utils import floor_version collection_sort_by = ( ('weekly', _lazy(u'Most popular this week')), ('monthly...
clouserw/olympia
apps/search/forms.py
Python
bsd-3-clause
5,239
# %matplotlib inline import pyaf import numpy as np import pandas as pd DATA_FREQ = 'H' PERIODS = ["D" , "H"] H = 365 N = H * 10 lDateColumn = "Date" lSignalVar = "Signal"; START_TIME = "2001-01-25" # generate a daily signal covering one year 2016 in a pandas dataframe np.random.seed(seed=1960) df_train = pd.DataFra...
antoinecarme/pyaf
tests/basic_checks/test_temporal_demo_hourly_D_H_ErrorMessage.py
Python
bsd-3-clause
1,208
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Jan 2018 do metropolis sampling to estimate PDF of chessboard calibration. this involves intrinsic and extrinsic parameters, so it's a very high dimensional search space (before it was only intrinsic) @author: sebalander """ # %% # import glob import os i...
sebalander/sebaPhD
dev/intrinsicCalibFullPyMC3.py
Python
bsd-3-clause
80,011
#!/usr/bin/env python3 import struct import unittest import rostest from rosbridge_library.internal.cbor_conversion import ( TAGGED_ARRAY_FORMATS, extract_cbor_values, ) try: from cbor import Tag except ImportError: from rosbridge_library.util.cbor import Tag from std_msgs.msg import ( Bool, ...
RobotWebTools/rosbridge_suite
rosbridge_library/test/internal/test_cbor_conversion.py
Python
bsd-3-clause
5,509
from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ from . import category_views from . import feed urlpatterns = patterns('', url(r'(\d+)$', category_views.main_view, name='category'), url(r'(\d+)/%s$' % _('contracts'), cate...
jorgecarleitao/public-contracts
contracts/category_urls.py
Python
bsd-3-clause
977
#!/usr/bin/env python # # Examples from the talk: # Sameer Ajmani - Advanced Go Concurrency Patterns - Google I/O 2013 # https://www.youtube.com/watch?v=QDDwwePbDtw # https://code.google.com/p/go/source/browse/2013/advconc?repo=talks import argparse import collections import random import threading import time f...
stuglaser/pychan
examples/ajmani-adv-patt.py
Python
bsd-3-clause
4,939
#!/usr/local/bin/python from website import carts import urllib2 import json def load(): carts.remove_all() request = 'http://data.cityofnewyork.us/resource/akqf-qv4n.json' for i in range(0, 24000, 1000): query = '?$offset=%d' % i data = urllib2.urlopen(request + query) results =...
stuycs-softdev-fall-2013/proj3-7-cartwheels
utils/load.py
Python
bsd-3-clause
1,823
# proxy module from __future__ import absolute_import from chaco.overlays.simple_inspector_overlay import *
enthought/etsproxy
enthought/chaco/overlays/simple_inspector_overlay.py
Python
bsd-3-clause
108
from __future__ import absolute_import import copy import mock from sentry.models import ( ApiKey, AuditLogEntry, AuditLogEntryEvent, Commit, File, OrganizationMember, OrganizationMemberTeam, OrganizationOption, Project, Release, ReleaseCommit, ReleaseEnvironment, ReleaseFile, Team, TotpInterface, User, )...
ifduyue/sentry
tests/sentry/models/test_organization.py
Python
bsd-3-clause
16,452
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import unittest import datetime import json import mock from elasticsearch.serializer import JSONSerializer from django.test import TestCase from django.db.models import Q from wagtail.wagtailsearch.backends import get_search_backend from wag...
serzans/wagtail
wagtail/wagtailsearch/tests/test_elasticsearch_backend.py
Python
bsd-3-clause
38,709
# Django settings for advreport_test_project project. import importlib DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or '...
vikingco/django-advanced-reports
advreport_test_project/advreport_test_project/settings.py
Python
bsd-3-clause
6,452
""" This process takes in the training dataset and outputs a data structure that includes the name of the molecule, the predictor, and the CAS number Attributes: input_file (str): This is the training file that is read by the output Instance (class): This is a private class which structures each instan...
sandialabs/BioCompoundML
bcml/Parser/read_training.py
Python
bsd-3-clause
2,349
import errno import io import os import secrets import shutil from contextlib import suppress from functools import wraps from fsspec.spec import AbstractFileSystem from fsspec.utils import infer_storage_options, mirror_from, stringify_path def wrap_exceptions(func): @wraps(func) def wrapper(*args, **kwargs)...
intake/filesystem_spec
fsspec/implementations/arrow.py
Python
bsd-3-clause
6,762
import os, extended_messages from setuptools import setup, find_packages if extended_messages.VERSION[-1] == 'final': CLASSIFIERS = ['Development Status :: 5 - Stable'] elif 'beta' in extended_messages.VERSION[-1]: CLASSIFIERS = ['Development Status :: 4 - Beta'] else: CLASSIFIERS = ['Development Status ::...
Anber/django-extended-messages
setup.py
Python
bsd-3-clause
1,190
from flask import Blueprint api = Blueprint('api', __name__, url_prefix='/rest/v1.0') from . import authentication, errors, views
pixmeter/enma
enma/rest/__init__.py
Python
bsd-3-clause
131
# Copyright (c) 2013 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. import json import math import os from telemetry.core import util from telemetry.page import page_measurement from telemetry.page import page_set def ...
loopCM/chromium
tools/perf/perf_tools/dom_perf.py
Python
bsd-3-clause
2,746
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides the tools used to internally run the astropy test suite from the installed astropy. It makes use of the `pytest` testing framework. """ from __future__ import (absolute_import, division, print_function, uni...
AustereCuriosity/astropy
astropy/tests/helper.py
Python
bsd-3-clause
18,299
from unittest import SkipTest from wtforms import __version__ as wtforms_version if int(wtforms_version[0]) < 2: raise SkipTest('MongoEngine does not support WTForms 1.') from flask import Flask from flask_admin import Admin from flask_mongoengine import MongoEngine def setup(): app = Flask(__name__) ap...
flask-admin/flask-admin
flask_admin/tests/mongoengine/__init__.py
Python
bsd-3-clause
537
# # Catalogs.py -- Catalogs plugin for fits viewer # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from __future__ import print_function from ginga.qtw.QtHelp import ...
sosey/ginga
ginga/qtw/plugins/Catalogs.py
Python
bsd-3-clause
19,290
# # Callback.py -- Mixin class for programmed callbacks. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import sys, traceback class CallbackError(Exception): pass...
astrofrog/ginga
ginga/misc/Callback.py
Python
bsd-3-clause
2,723
""" kombu.serialization =================== Serialization utilities. :copyright: (c) 2009 - 2011 by Ask Solem :license: BSD, see LICENSE for more details. """ import codecs import sys import pickle as pypickle try: import cPickle as cpickle except ImportError: cpickle = None # noqa from kombu.utils.encodi...
softak/webfaction_demo
vendor-local/lib/python/kombu/serialization.py
Python
bsd-3-clause
11,002
from django.conf import settings from django.db.models import Prefetch from midnight_catalog.models import Product, ParamValue def get_all(slug=None): """ Возвращает QuerySet содержащий выборку товаров :param slug: символьный код категории каталога, если не задан выбираются товары в не зависимости от кате...
webadmin87/midnight
midnight_catalog/services.py
Python
bsd-3-clause
1,282
def extractAhgashonixnoveltranslationWordpressCom(item): ''' Parser for 'ahgashonixnoveltranslation.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', ...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractAhgashonixnoveltranslationWordpressCom.py
Python
bsd-3-clause
592
# !usr/bin/env python2 # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: Brian Cherinka # @Date: 2016-12-08 14:24:58 # @Last modified by: Brian Cherinka # @Last Modified time: 2018-07-13 18:21:26 from __future__ import print_function, division, absolute_import from flask_classful impo...
sdss/marvin
python/marvin/web/controllers/__init__.py
Python
bsd-3-clause
2,791
import numpy as np from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.hyperparameters import CategoricalHyperparameter from ParamSklearn.components.base import \ ParamSklearnPreprocessingAlgorithm from ParamSklearn.constants import * class Balancing(ParamSklearnPreproces...
automl/paramsklearn
ParamSklearn/components/data_preprocessing/balancing.py
Python
bsd-3-clause
4,086
# -*- coding: utf-8 -*- # Copyright (c) 2015 Jason Power # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of con...
Nirvedh/CoarseCoherence
configs/tutorial/simple.py
Python
bsd-3-clause
3,883
import plata from django.db import models from django.template import RequestContext from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from feincms.admin.item_editor import FeinCMSInline from django import forms class ProductInline(FeinCMSInline): raw_id_fi...
sbaechler/simpleshop
simpleshop/content.py
Python
bsd-3-clause
1,129
""" sentry.utils.samples ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import os.path import random from datetime import datetime, timedelta import six from sentry.constants import D...
jean/sentry
src/sentry/utils/samples.py
Python
bsd-3-clause
5,584
# -*- coding: utf-8 -*- from django.contrib.auth import authenticate from django.forms import ValidationError import floppyforms as forms class LoginForm(forms.Form): """ Simple login form. """ username = forms.CharField() password = forms.CharField(widget=forms.widgets.PasswordInput) redir_...
ainmosni/jolly_roger
jolly_roger/core/forms.py
Python
bsd-3-clause
1,078
from rest_framework import routers from drf_demo.model_less.views import TaskViewSet, userlocviewset, groupviewset from django.conf.urls import patterns, include, url from django.contrib import admin router = routers.DefaultRouter() router.register(r'tasks', TaskViewSet, base_name='tasks') router.register(r'users', u...
Thiyageshv/PizzaReminder
drf_demo/urls.py
Python
bsd-3-clause
497
"""Script to build the xpi add-in for firefox Usage : python build-implicit-wait.py "x.x.x.x" """ import os, re, sys, shutil, datetime, zipfile, glob CD = os.path.dirname(os.path.abspath(__file__)) SRC_DIR = CD + r'\implicit-wait' OUT_DIR = CD + r'\bin' RDF_PATH = CD + r'\implicit-wait\install.rdf' def main(args):...
florentbr/SeleniumBasic
FirefoxAddons/build-implicit-wait.py
Python
bsd-3-clause
3,005