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
from __future__ import annotations import numbers from typing import ( TYPE_CHECKING, overload, ) import warnings import numpy as np from pandas._libs import ( lib, missing as libmissing, ) from pandas._typing import ( ArrayLike, AstypeArg, Dtype, DtypeObj, npt, type_t, ) from...
jorisvandenbossche/pandas
pandas/core/arrays/boolean.py
Python
bsd-3-clause
23,248
# -*- coding: utf-8 -*- """ Basic processing procedures for analog signals (e.g., performing a z-score of a signal, or filtering a signal). :copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`. :license: Modified BSD, see LICENSE.txt for details. """ from __future__ import division, print_funct...
JuliaSprenger/elephant
elephant/signal_processing.py
Python
bsd-3-clause
36,918
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 = 30, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_None/trend_LinearTrend/cycle_30/ar_/test_artificial_128_None_LinearTrend_30__20.py
Python
bsd-3-clause
262
#----------------------------------------------------------------------------- # Python module level constants #----------------------------------------------------------------------------- import ZeroMQ _Version = ZeroMQ.lib.zmq.version() VERSION = _Version.ToString() VERSION_MAJOR = _Version[0] VERSION_MINOR = _Versi...
swn1/pyzmq
zmq/backend/cli/constants.py
Python
bsd-3-clause
6,712
#!/usr/bin/env python # coding=utf-8 # # Copyright 2017 ihasy.com # Do have a faith in what you're doing. # Make your life a story worth telling. import time import re import random from htmlentity import unescape from HTMLParser import HTMLParser def date(timestamp, formatter): return time.strftime(formatter, t...
ddong8/ihasy
lib/variables.py
Python
bsd-3-clause
1,059
import copy import re import numpy as np from plotly import colors from ..util import color_intervals, process_cmap # Constants # --------- # Trace types that are individually positioned with their own domain. # These are traces that don't overlay on top of each other in a shared subplot, # so they are positioned i...
basnijholt/holoviews
holoviews/plotting/plotly/util.py
Python
bsd-3-clause
22,636
# 3rd party import logging import requests # project from monasca_agent.collector.checks import AgentCheck import monasca_agent.collector.checks.services_checks as services_checks from monasca_agent.common.util import headers log = logging.getLogger(__name__) class Etcd(AgentCheck): DEFAULT_TIMEOUT = 5 SE...
sapcc/monasca-agent
monasca_agent/collector/checks_d/etcd.py
Python
bsd-3-clause
7,535
from datetime import datetime from django.db.models import Count import olympia.core.logger from olympia.amo.celery import task from olympia.amo.decorators import use_primary_db from .models import Collection, CollectionAddon log = olympia.core.logger.getLogger('z.task') @task @use_primary_db def collection_met...
bqbn/addons-server
src/olympia/bandwagon/tasks.py
Python
bsd-3-clause
1,228
""" Legacy Email backend, docs at: http://psa.matiasaguirre.net/docs/backends/email.html """ from social.backends.legacy import LegacyAuth class EmailAuth(LegacyAuth): name = 'email' ID_KEY = 'email' REQUIRES_EMAIL_VALIDATION = True
imsparsh/python-social-auth
social/backends/email.py
Python
bsd-3-clause
251
import doctest import unittest import zeit.calendar.calendar import zeit.calendar.testing import zeit.cms.testing def test_suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite( zeit.calendar.calendar, optionflags=zeit.cms.testing.optionflags)) suite.addTest(doctest.DocF...
ZeitOnline/zeit.calendar
src/zeit/calendar/tests/test_doctest.py
Python
bsd-3-clause
581
# -*- coding: utf-8 -*- # # Module providing the `Pool` class for managing a process pool # # multiprocessing/pool.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import # # Imports # import errno import itertools import os import platform i...
flaviogrossi/billiard
billiard/pool.py
Python
bsd-3-clause
64,479
y = 2 class b: def g(self): print y a = b() x = a.g x()
jplevyak/pyc
tests/t24.py
Python
bsd-3-clause
62
#-*- coding: utf-8 -*- from django.conf import settings MOLLIE_API_URL = 'https://secure.mollie.nl/xml/ideal' MOLLIE_BANKLIST_DIR = getattr(settings, 'MOLLIE_BANKLIST_DIR', '/var/tmp') MOLLIE_BTW = getattr(settings, 'MOLLIE_BTW', 19) # A range of logos and buttons can be found at http://www.mollie.nl/support/klanten/...
nederhoed/django-mollie-ideal
mollie/ideal/settings.py
Python
bsd-3-clause
1,003
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("SVR_poly" , "diabetes" , "hive")
antoinecarme/sklearn2sql_heroku
tests/regression/diabetes/ws_diabetes_SVR_poly_hive_code_gen.py
Python
bsd-3-clause
122
from decimal import Decimal from customers.models import Customer from django.contrib import auth from products.models import * from django_quickblocks.models import * import re from smartmin.views import * from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django...
nyaruka/motome
motome/public/views.py
Python
bsd-3-clause
11,780
import errno import psycopg2 from socket import error as socket_error #from jenks import jenks from django.conf import settings from django.template.loader import get_template from geodash.enumerations import MONTHS_SHORT3 from geodash.cache import provision_memcached_client from geodash.data import data_local_coun...
geodashio/geodash-server
geodashserver/data.py
Python
bsd-3-clause
1,085
# # Copyright 2015 chinaskycloud.com.cn # # Author: Chunyang Liu <liucy@chinaskycloud.com> # # 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 ...
whiteear/newrelic-plugin-agent
newrelic_plugin_agent/publisher/__init__.py
Python
bsd-3-clause
918
#! /usr/bin/env python """Execute a .ipynb file, write out a processed .rst and clean .ipynb. The functions in this script were copied from the nbstripout tool: Copyright (c) 2015 Min RK, Florian Rathgeber, Michael McNeil Forbes 2019 Casper da Costa-Luis Permission is hereby granted, free of charge, to any person ob...
anntzer/seaborn
doc/tools/nb_to_doc.py
Python
bsd-3-clause
8,312
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ psutil test suite. Run it with: $ make test If you're on Python < 2.7 unittest2 module must be installe...
ProfessorKaos64/psutil
test/test_psutil.py
Python
bsd-3-clause
96,442
from django.core.exceptions import ValidationError from django.db import connection from django.db.models import ( CharField, ForeignKey, ManyToManyField, PROTECT, BooleanField) from django.urls import reverse from django.utils.html import strip_tags from django.utils.safestring import mark_safe from django.utils.t...
dezede/dezede
libretto/models/individu.py
Python
bsd-3-clause
12,969
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='davis-weatherlink-scraper', version='0.1.0', description='Scrap...
ojarva/davis-weatherlink-scraper
setup.py
Python
bsd-3-clause
1,407
""" Force10 Backend. This backend will only work with SSH version 2 capable Force10 switches. This excludes most, if not all, of the etherscale series. The backend has been developed for the E series. The backend has been developed and tested on a Terascale E300 switch. The switch (or router, depending on your leve...
NORDUnet/opennsa
opennsa/backends/force10.py
Python
bsd-3-clause
10,163
from ..core import * from ..datadir import dirformat from .open_subpath import open_subpath import os.path import re import struct import numpy as np from numpy import nan bruker_data = nddata # should work by inheritance but doesn't def det_phcorr(v): if v['DIGMOD']==1: logger.debug('DIGMOD is 1') ...
jmfranck/pyspecdata
pyspecdata/load_files/bruker_nmr.py
Python
bsd-3-clause
14,840
from .backends import AzureActiveDirectoryBackend from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME, login from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.views.decorators.csrf import csrf_exempt from django.views.decorators.cache ...
csabatini/deploy-azurerm-django
azure_ad_auth/views.py
Python
bsd-3-clause
2,354
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
kdmurray91/scikit-bio
skbio/metadata/_repr.py
Python
bsd-3-clause
5,981
#!/usr/bin/env python # # ROS node to serve NAOqi Vision functionalities # This code is currently compatible to NaoQI version 1.6 # # Copyright 2014 Manos Tsardoulias, CERTH/ITI # http://www.ros.org/wiki/nao # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
ros-naoqi/nao_interaction
nao_vision/nodes/nao_vision.py
Python
bsd-3-clause
18,061
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # module imports from nipype.externals.pynifti import volumeutils as vu from nipype.externals.pynifti import spm2analyze as spm2 from nipype.externals.pynifti import nifti1 from nipype.externals.pynifti imp...
satra/NiPypeold
nipype/externals/pynifti/loadsave.py
Python
bsd-3-clause
1,766
# -*- coding: utf-8 -*- from __future__ import with_statement import os import dj_database_url gettext = lambda s: s urlpatterns = [] def configure(db_url, **extra): from django.conf import settings os.environ['DJANGO_SETTINGS_MODULE'] = 'cms.test_utils.cli' if not 'DATABASES' in extra: DB = dj_d...
datakortet/django-cms
cms/test_utils/cli.py
Python
bsd-3-clause
9,013
""" Django app for: - Generate favicon in multiple format - Put in a storage backend - Include HTML tags for use favicon """ VERSION = (0, 6, 0) __version__ = '.'.join([str(i) for i in VERSION]) __author__ = 'Anthony Monthe (ZuluPro)' __email__ = 'anthony.monthe@gmail.com' __url__ = 'https://github.com/ZuluPro/django-s...
ryankaiser/django-super-favicon
favicon/__init__.py
Python
bsd-3-clause
334
''' BSD Licence Copyright (c) 2012, Science & Technology Facilities Council (STFC) 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 n...
kusamau/cedaMarkup
ceda_markup/markup.py
Python
bsd-3-clause
2,962
# # Copyright 2010-2014 Fabric Technologies Inc. All rights reserved. # import os import json import collections from kraken.ui.Qt import QtGui, QtWidgets, QtCore class PreferenceEditor(QtWidgets.QDialog): """A widget providing the ability to nest """ def __init__(self, parent=None): # constructo...
oculusstorystudio/kraken
Python/kraken/ui/preference_editor.py
Python
bsd-3-clause
7,028
# vim: set ts=4 sw=4 et: coding=UTF-8 from .rpmsection import Section class RpmInstall(Section): ''' Remove commands that wipe out the build root. Replace %makeinstall (suse-ism). ''' def add(self, line): line = self._complete_cleanup(line) # we do not want to cleanup b...
plusky/spec-cleaner
spec_cleaner/rpminstall.py
Python
bsd-3-clause
1,588
""" kombu.transport.pyamqp ====================== pure python amqp transport. """ from __future__ import absolute_import, unicode_literals import amqp from kombu.five import items from kombu.utils.amq_manager import get_manager from kombu.utils.text import version_string_as_tuple from . import base DEFAULT_PORT =...
Elastica/kombu
kombu/transport/pyamqp.py
Python
bsd-3-clause
5,262
from sympy import SYMPY_DEBUG from sympy.core import Basic, S, C, Add, Mul, Pow, Rational, Integer, \ Derivative, Wild, Symbol, sympify, expand, expand_mul, expand_func, \ Function, Equality from sympy.core.numbers import igcd from sympy.core.relational import Equality from sympy.utilities import mak...
KevinGoodsell/sympy
sympy/simplify/simplify.py
Python
bsd-3-clause
50,745
# -*- coding: utf-8 -*- """Tests that use cross-checks for generic methods Should be easy to check consistency across models Does not cover tsa Initial cases copied from test_shrink_pickle Created on Wed Oct 30 14:01:27 2013 Author: Josef Perktold """ from statsmodels.compat.python import range import numpy as np i...
rgommers/statsmodels
statsmodels/base/tests/test_generic_methods.py
Python
bsd-3-clause
12,158
from django import template from django.conf import settings from ccpages.models import Page register = template.Library() @register.inclusion_tag('ccpages/_js.html') def ccpages_js(): return { 'STATIC_URL': settings.STATIC_URL, } @register.inclusion_tag('ccpages/_css.html') def ccpages_css(): re...
designcc/django-ccpages
ccpages/templatetags/ccpages_tags.py
Python
bsd-3-clause
921
import sys,os, pickle, numpy, pylab, operator, itertools import cv2 from shutil import copy as copyfile from PyQt4.QtCore import * from PyQt4.QtGui import * import matplotlib.pyplot as plt from DataParseApp import dataparseDialog from sklearn.decomposition import NMF projectpath=os.path.split(os.path.abspath(__file__)...
johnmgregoire/JCAPRamanDataProcess
PlateAlignViaEdge_v4.py
Python
bsd-3-clause
16,899
# coding=utf-8 """HCTSA test time series.""" import os.path as op import numpy as np from pyopy.hctsa.hctsa_config import HCTSA_TESTTS_DIR def hctsa_sine(): return np.loadtxt(op.join(HCTSA_TESTTS_DIR, 'SY_sine.dat')) def hctsa_noise(): return np.loadtxt(op.join(HCTSA_TESTTS_DIR, 'SY_noise.dat')) def hctsa...
strawlab/pyopy
pyopy/hctsa/hctsa_data.py
Python
bsd-3-clause
540
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth.models import Group, User def add_moderator_group(apps, schema_editor): g = Group.objects.create(name="moderators") g.save() for user in User.objects.all(): # add any existing...
DemocracyClub/EveryElection
every_election/apps/core/migrations/0001_initial.py
Python
bsd-3-clause
621
from django.conf import settings INTERCOM_APPID = getattr(settings, 'INTERCOM_APPID', None) INTERCOM_SECURE_KEY = getattr(settings, 'INTERCOM_SECURE_KEY', None) INTERCOM_ENABLE_INBOX = getattr(settings, 'INTERCOM_ENABLE_INBOX', True) INTERCOM_ENABLE_INBOX_COUNTER = getattr(settings, 'INTERCOM_ENABLE_INBOX_COUNTER', Tr...
kencochrane/django-intercom
django_intercom/settings.py
Python
bsd-3-clause
925
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-07 15:13 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb import django.contrib.postgres.indexes import django.contrib.postgres.search from django.contrib.postgres.operations import TrigramExtension from django.db import...
django/djangoproject.com
docs/migrations/0003_auto_20171107_1513.py
Python
bsd-3-clause
1,072
# coding: utf-8 """ Display information from mpd. Configuration parameters: cache_timeout = how often we refresh this module in seconds (2s default) color = enable coloring output (default False) color_pause = custom pause color (default i3status color degraded) color_play = custom play color (default ...
Shir0kamii/py3status
py3status/modules/mpd_status.py
Python
bsd-3-clause
8,004
import itertools import json from urllib.parse import urljoin from django import template from django.conf import settings from django.contrib.admin.utils import quote from django.contrib.humanize.templatetags.humanize import intcomma from django.contrib.messages.constants import DEFAULT_TAGS as MESSAGE_TAGS from dja...
mikedingjan/wagtail
wagtail/admin/templatetags/wagtailadmin_tags.py
Python
bsd-3-clause
17,059
from datetime import datetime from uuid import UUID from django.utils.timezone import make_aware, now, FixedOffset from django.test import TestCase from django_vend.auth.models import VendRetailer from .models import VendOutlet, VendRegister from .forms import VendOutletForm, VendRegisterForm class VendOutletFormTe...
remarkablerocket/django-vend
django_vend/stores/tests.py
Python
bsd-3-clause
7,713
""" MooseGesture Test application Al Sweigart al@coffeeghost.net http://coffeeghost.net/2011/05/09/moosegesture-python-mouse-gestures-module Run the app and then draw by dragging the mouse. When you release the mouse button, the gesture you drew will be identified. This script requires the MooseGesture library, whic...
asweigart/moosegesture
tests/demoGestureApp.py
Python
bsd-3-clause
3,638
import copy from datetime import timedelta from textwrap import dedent from typing import Dict, Optional, Union, no_type_check import numpy as np from pandas._libs import lib from pandas._libs.tslibs import ( IncompatibleFrequency, NaT, Period, Timedelta, Timestamp, to_offset, ) from pandas._t...
TomAugspurger/pandas
pandas/core/resample.py
Python
bsd-3-clause
60,682
""" fs.expose.dokan =============== Expose an FS object to the native filesystem via Dokan. This module provides the necessary interfaces to mount an FS object into the local filesystem using Dokan on win32:: http://dokan-dev.net/en/ For simple usage, the function 'mount' takes an FS object and a drive letter, ...
wylieswanson/agilepyfs
fs/expose/dokan/__init__.py
Python
bsd-3-clause
37,866
import functools import os import re from collections import namedtuple from datetime import datetime, time, timedelta from flask import Flask, request, render_template, jsonify from raven.contrib.flask.utils import get_data_from_request from dateutil.parser import parse as parse_datetime import requests from pyqu...
wilsonssun/baseball-gamethread
app.py
Python
bsd-3-clause
9,712
from caduceus.transform.templateEntity import CaduceusTemplateEntity class CaduceusTemplateHtmlComment(CaduceusTemplateEntity): def __init__(self, text): CaduceusTemplateEntity.__init__(self) self._text = text def render(self, dictGlob, dictLoc, results): return "<!-- %s -->%s" % (self._text, Caduceu...
aprudent/caduceus
caduceus/transform/templateHtmlComment.py
Python
bsd-3-clause
378
# -*- coding: utf-8 -*- import json import re from django.shortcuts import render_to_response from django import forms from django.contrib import admin from django.contrib import messages from django.core.exceptions import ImproperlyConfigured, ValidationError from django.template.defaultfilters import force_escape f...
evildmp/django-cms
cms/plugin_base.py
Python
bsd-3-clause
18,541
""" raven.contrib.django.client ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :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 logging from django.conf import settings from django.core.exceptions import Suspicio...
Goldmund-Wyldebeast-Wunderliebe/raven-python
raven/contrib/django/client.py
Python
bsd-3-clause
6,779
# Generated by Django 3.1.2 on 2021-01-13 17:11 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('product', '0014_auto_20210113_1803'), ] operations = [ migrations.RemoveField( model_name='product', name='company', ...
KlubJagiellonski/pola-backend
pola/product/migrations/0015_remove_product_company.py
Python
bsd-3-clause
330
import datetime import textwrap import unittest import toml # TODO steal the hard tests from toml-ply class HappyDayTest(unittest.TestCase): def test_convert_example_test(self): example = textwrap.dedent('''\ # This is a TOML document. Boom. title = "TOML Example" ...
tartley/toml
test_sys/test_happy_day.py
Python
bsd-3-clause
2,067
# -*- coding: utf-8 -*- """ datastore ~~~~~~~~~ base datastore module How to use: - with SQLAlchemy: datastore = SQLAlchemyDatastore(db) - with MongoDB: (TODO(hoatle): add this) and use the methods provided from Datastore """ from abc import ABCMeta, abstractmethod from sqlalchem...
teracyhq/flask-boilerplate
app/datastore.py
Python
bsd-3-clause
4,882
from datetime import datetime, timedelta from django.core.management import BaseCommand from corehq.apps.saved_reports.models import ReportNotification class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('domains', nargs='+') parser.add_argument('-F', '--forward', act...
dimagi/commcare-hq
corehq/apps/saved_reports/management/commands/daylight_savings.py
Python
bsd-3-clause
1,620
# -*- coding: utf-8 -*- # # DistArray documentation build configuration file, created by # sphinx-quickstart on Fri Jan 31 01:11:34 2014. # # 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 # autogenerated file. # # A...
RaoUmer/distarray
docs/sphinx/source/conf.py
Python
bsd-3-clause
8,831
from canvas import MappingCanvas from viewport import MappingViewport try: from geojson_overlay import GeoJSONOverlay except ImportError: # No geojson pass # Tile managers from mbtile_manager import MBTileManager from http_tile_manager import HTTPTileManager
nmichaud/enable-mapping
mapping/enable/api.py
Python
bsd-3-clause
273
# gagestation.py # # David J. Lampert (djlampert@gmail.com) # # Last updated: 01/10/2015 # # Contains the GageStation class that is used to extract, store and manipulate # data from the USGS National Water Information System gages. import os, csv, pickle, datetime, io from urllib import request from s...
kbrannan/PyHSPF
src/pyhspf/preprocessing/gagestation.py
Python
bsd-3-clause
8,429
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from django.db import transaction from sentry import options from sentry.utils import json from sentry.utils.compat import filter from sentry.utils.http import absolute_uri from sentry.integrations.base import ( Integ...
beeftornado/sentry
src/sentry/integrations/pagerduty/integration.py
Python
bsd-3-clause
7,387
#!/usr/bin/env python # Copyright (c) 2012 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. """Creates Windows and POSIX stub files for a given set of signatures. For libraries that need to be loaded outside of the standar...
endlessm/chromium-browser
tools/generate_stubs/generate_stubs.py
Python
bsd-3-clause
44,612
from django.contrib import admin from .models import Mapping from .tasks import feedmapper_sync def run_mapping(modeladmin, request, queryset): """ Initiates the `benchmarking` (TODO: ref required) of the selected epubs. """ for mapping in queryset.all(): feedmapper_sync.delay(mapping.id) r...
papercapp/django-feedmapper
feedmapper/admin.py
Python
bsd-3-clause
963
from extracontent.tests.testing import * def run(): import sys from django.conf import settings from django.test.simple import run_tests failures = run_tests(['extracontent'], verbosity=1) if failures: sys.exit(failures)
lsbardel/django-extracontent
extracontent/tests/__init__.py
Python
bsd-3-clause
249
"""Tests for UIAWrapper""" from __future__ import print_function from __future__ import unicode_literals import time import os import sys import unittest import mock import six sys.path.append(".") from pywinauto.application import Application, WindowSpecification # noqa: E402 from pywinauto.sysinfo import is_x64_Py...
airelil/pywinauto
pywinauto/unittests/test_uiawrapper.py
Python
bsd-3-clause
89,050
# proxy module from __future__ import absolute_import from codetools.contexts.with_mask import *
enthought/etsproxy
enthought/contexts/with_mask.py
Python
bsd-3-clause
97
import unittest import rdflib import re from rdflib.py3compat import b class TestTrig(unittest.TestCase): def testEmpty(self): g=rdflib.Graph() s=g.serialize(format='trig') self.assertTrue(s is not None) def testRepeatTriples(self): g=rdflib.ConjunctiveGraph() g.get_c...
lrowe/rdflib
test/test_trig.py
Python
bsd-3-clause
1,653
# 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. # mojom's classes provide an interface to mojo modules. Modules are collections # of interfaces and structs to be used by mojo ipc clients and servers. #...
cvsuser-chromium/chromium
mojo/public/bindings/generators/mojom.py
Python
bsd-3-clause
3,043
class NiprovError(Exception): pass class UnknownFileError(NiprovError): pass
ilogue/niprov
niprov/exceptions.py
Python
bsd-3-clause
89
import pytest from mpmath import * def ae(a, b): return abs(a-b) < 10**(-mp.dps+5) def test_basic_integrals(): for prec in [15, 30, 100]: mp.dps = prec assert ae(quadts(lambda x: x**3 - 3*x**2, [-2, 4]), -12) assert ae(quadgl(lambda x: x**3 - 3*x**2, [-2, 4]), -12) assert ae(qu...
fredrik-johansson/mpmath
mpmath/tests/test_quad.py
Python
bsd-3-clause
3,893
# -*- coding: utf-8 -*-" import sys import threading from celery.datastructures import ExceptionInfo from celery.exceptions import MaxRetriesExceededError, RetryTaskError from celery.execute.trace import TaskTrace from celery.registry import tasks, _unpickle_task from celery.result import EagerResult from celery.utils...
WoLpH/celery
celery/app/task/__init__.py
Python
bsd-3-clause
27,392
import efl.elementary as elm elm.init() from efl.elementary.window import StandardWindow from efl.elementary.label import Label from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL from elmextensions import TabbedBox EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL class M...
JeffHoogland/python-elm-extensions
test_tabbedbox.py
Python
bsd-3-clause
1,214
from django.contrib.localflavor.it.forms import (ITZipCodeField, ITRegionSelect, ITSocialSecurityNumberField, ITVatNumberField) from django.test import SimpleTestCase class ITLocalFlavorTests(SimpleTestCase): def test_ITRegionSelect(self): f = ITRegionSelect() out = u'''<select name="regions"...
mixman/djangodev
tests/regressiontests/localflavor/it/tests.py
Python
bsd-3-clause
2,453
# -*- coding: utf-8 -*- from twoq.support import unittest #pylint: disable-msg=w0614,w0401 from twoq.tests.auto.filtering import * # @UnusedWildImport from twoq.tests.auto.queuing import AQMixin class TestAutoFilterQ(unittest.TestCase, AQMixin, AFilterQMixin): def setUp(self): self.maxDiff = None ...
lcrees/twoq
twoq/tests/lazy/auto/test_filtering.py
Python
bsd-3-clause
962
""" This module is for contrast computation and operation on contrast to obtain fixed effect results. Author: Bertrand Thirion, Martin Perez-Guevara, 2016 """ from warnings import warn import numpy as np import scipy.stats as sps from .utils import z_score DEF_TINY = 1e-50 DEF_DOFMAX = 1e10 def compute_contrast...
bthirion/nistats
nistats/contrasts.py
Python
bsd-3-clause
9,609
from collections import defaultdict import storm class WordCountBolt(storm.BasicBolt): def initialize(self, conf, context): self._count = defaultdict(int) def process(self, tup): word = tup.values[0] self._count[word] += 1 storm.emit([word, self._count[word]]) WordCountBolt()....
prio/pyconie
wordcount/multilang/resources/wordcount.py
Python
bsd-3-clause
326
from django.contrib.auth.models import User from django.db import models from django.db.models import signals from cyder.core.cyuser import backends from cyder.core.ctnr.models import Ctnr class UserProfile(models.Model): user = models.OneToOneField(User) default_ctnr = models.ForeignKey(Ctnr, default=2) ...
ngokevin/cyder
cyder/core/cyuser/models.py
Python
bsd-3-clause
730
from filtering.morphology import ssm from rivuletpy.utils.io import * import matplotlib.pyplot as plt import skfmm ITER = 30 img = loadimg('/home/siqi/ncidata/rivuletpy/tests/data/test-crop.tif') bimg = (img > 0).astype('int') dt = skfmm.distance(bimg, dx=1) sdt = ssm(dt, anisotropic=True, iterations=ITER) try: ...
RivuletStudio/rivuletpy
tests/testssm.py
Python
bsd-3-clause
624
""""""""" Pytorch implementation of "A simple neural network module for relational reasoning Code is based on pytorch/examples/mnist (https://github.com/pytorch/examples/tree/master/mnist) """"""""" from __future__ import print_function import argparse import os #import cPickle as pickle import pickle import random imp...
kimhc6028/relational-networks
main.py
Python
bsd-3-clause
10,006
# A handler to manage the data ending up in CIF output file from __future__ import annotations import bz2 import datetime import iotbx.cif.model import xia2.Handlers.Citations from xia2.Handlers.Versions import versions mmcif_software_header = ( "_software.pdbx_ordinal", "_software.citation_id", "_soft...
xia2/xia2
src/xia2/Handlers/CIF.py
Python
bsd-3-clause
9,133
default_app_config = "modoboa.limits.apps.LimitsConfig"
carragom/modoboa
modoboa/limits/__init__.py
Python
isc
56
import asposecellscloud from asposecellscloud.CellsApi import CellsApi from asposecellscloud.CellsApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi apiKey = "XXXXX" #sepcify App Key appSid = "XXXXX" #sepcify App SID apiServer = "http://api.aspose.com/v1.1" data_fol...
asposecells/Aspose_Cells_Cloud
Examples/Python/Examples/DeleteHyperlinksFromExcelWorksheet.py
Python
mit
1,503
# flake8: noqa from functools import partial from operator import getitem, delitem, setitem from six.moves.urllib.parse import urlparse, urljoin from weakref import WeakValueDictionary import requests try: from collections.abc import MutableMapping except ImportError: from collections import MutableMapping # ...
onecodex/onecodex
onecodex/vendored/potion_client/__init__.py
Python
mit
6,097
import pickle from revscoring.datasources import revision_oriented from revscoring.dependencies import solve from revscoring.languages import greek from .util import compare_extraction BAD = [ "αδερφάρα", "αδελφάρα", "αλήτης", "αλητήριος", "αλητήρια", "αλητήριο", "αλητάμπουρας", "άχρηστος", "άχρη...
wiki-ai/revscoring
tests/languages/test_greek.py
Python
mit
5,978
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectiona...
mmottahedi/neuralnilm_prototype
scripts/e452.py
Python
mit
16,657
from django.conf.urls import patterns, include, url try: from djcelery.views import apply urlpatterns = patterns('', url(r'^apply/(?P<task_name>.+?)/', apply, name='celery-apply'), url(r'^celery/', include('djcelery.urls')), ) except ImportError: urlpatterns = patterns('')
PolicyStat/jobtastic
test_projects/django/testproj/urls.py
Python
mit
307
from __future__ import absolute_import import urwid from . import common def _mkhelp(): text = [] keys = [ ("A", "accept all intercepted flows"), ("a", "accept this intercepted flow"), ("C", "clear flow list or eventlog"), ("d", "delete flow"), ("D", "duplicate flow"), ...
xtso520ok/mitmproxy
libmproxy/console/flowlist.py
Python
mit
8,997
from django.test import TestCase from pyquery import PyQuery as pq from ..utils import collapse_whitespace, html_to_text class UtilsTests(TestCase): def test_collapse_whitespace(self): text = '\r\n\f\u200b \n\t ' self.assertEqual(collapse_whitespace(text), "") def test_html_to_text_one_elem...
flupzor/newsdiffs
news/parsers/tests/test_utils.py
Python
mit
1,938
# encoding: utf-8 """ decorators.py """ from django.contrib.auth import authenticate from django.http import HttpResponse, HttpResponseForbidden from django.conf import settings from membership.utils import get_client_ip from sikteeri.iptools import IpRangeList import base64 def trusted_host_required(view_func):...
annttu/sikteeri
membership/decorators.py
Python
mit
1,735
from __future__ import division, absolute_import, print_function,\ unicode_literals import ctypes import platform import sys if sys.platform in ('win32', 'cygwin'): _functype = ctypes.WINFUNCTYPE _lib = ctypes.windll.nanomsg else: _functype = ctypes.CFUNCTYPE _lib = ctypes.cdll.LoadLibrary('libnanoms...
romanoved/nanomsg-python
_nanomsg_ctypes/__init__.py
Python
mit
8,282
""" homeassistant.components.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets up a demo environment that mimics interaction with devices. """ import time import homeassistant.core as ha import homeassistant.bootstrap as bootstrap import homeassistant.loader as loader from homeassistant.const import ( CONF_PLATFORM, ATTR_E...
tomduijf/home-assistant
homeassistant/components/demo.py
Python
mit
5,021
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2008, Frank Scholz <coherence@beebits.net> import os.path from twisted.internet import reactor, defer from twisted.python import failure, util from coherence.upnp.core import DIDLLite from coherence.upnp.core.soap_service ...
sreichholf/python-coherence
coherence/backends/tracker_storage.py
Python
mit
28,384
from django.contrib import admin # import your models # Register your models here. # admin.site.register(YourModel)
datamade/la-metro-councilmatic
lametro/admin.py
Python
mit
116
"""Order/create a VLAN instance.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.managers import ordering from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting @click.command() @click.option('--name', required=Fa...
softlayer/softlayer-python
SoftLayer/CLI/vlan/create.py
Python
mit
2,493
from pkg_resources import parse_version from pyramid.interfaces import ( PHASE1_CONFIG, PHASE2_CONFIG, ) import venusian def includeme(config): config.registry['migrator'] = Migrator() config.add_directive('add_upgrade', add_upgrade) config.add_directive('add_upgrade_step', add_upgrade_step) c...
ClinGen/clincoded
src/contentbase/upgrader.py
Python
mit
6,948
""" The MIT License (MIT) Copyright (c) Serenity Software, LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, m...
hickeroar/cahoots
cahoots/parser.py
Python
mit
5,798
import io, sys import json import pandas as pd from . import categories from . import proc_df_labels from . import data_formats from . import make_unique_labels try: from StringIO import StringIO except ImportError: from io import StringIO def load_file(net, filename): # reset network when loaing file, prev...
MaayanLab/clustergrammer-widget
clustergrammer_widget/clustergrammer/load_data.py
Python
mit
2,352
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import sys from gunicorn.app.base import Application from gunicorn import util def find_settings_module(path): path = os.path.abspath(path) project_path = None settings...
samabhi/pstHealth
venv/lib/python2.7/site-packages/gunicorn/app/djangoapp.py
Python
mit
3,881
''' NetNS, network namespaces support ================================= Pyroute2 provides basic network namespaces support. The core class is `NetNS`. Please be aware, that in order to run system calls the library uses `ctypes` module. It can fail on platforms where SELinux is enforced. If the Python interpreter, loa...
alexliyu/CDMSYSTEM
pyroute2/netns/nslink.py
Python
mit
10,211
from utils import peak_measurement, background_subtract from utils import absolute_efficiency, isotope_activity import SPEFile class ReferenceBase(object): """ Generates a reference object that contains a reference mass and concentrations. Mass is in kg and concentrations are in percent for K-40 and p...
yarocoder/radwatch-analysis
Gamma_Reference.py
Python
mit
4,730
import interact class EvtInteract(interact.Interact): def __init__(self): self.events = [] def checkEventInteraction(self, events): self.events = events self.checkInteraction()
m4nolo/steering-all
src/interact/evtInteract.py
Python
mit
196
# Copyright (c) 2015-2017 Cisco Systems, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge...
retr0h/maquina
test/unit/test_scenario.py
Python
mit
2,054