text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
class AbstractMicromagneticModell: def __init__(self, name, Ms): self.name = name self.Ms = Ms self.field = None self.energies = [] def __str__(self): return "AbstractMicromagneticModell(name={})".format(self.name) def relax(self): self._relax() #rai...
fangohr/oommf-python
dev/umm-exploration-inheritance.py
Python
bsd-2-clause
1,614
0.004337
### This script fetches level-1 PACS imaging data, using a list generated by the ### archive (in the CSV format), attaches sky coordinates and masks to them ### (by calling the convertL1ToScanam task) and save them to disk in the correct ### format for later use by Scanamorphos. ### See important instructions below. ...
alvaroribas/modeling_TDs
Herschel_mapmaking/scanamorphos/PACS/general_script_L1_PACS.py
Python
mit
2,499
0.012405
from time import time from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_delete from django.dispatch import receiver import os def upload_path(instance, filename): return 'uploads/user_{0}/{1}_{2}'.format( instance.owner.id, str(time...
andela-ooshodi/django-photo-application
djangophotoapp/photoapp/models.py
Python
gpl-2.0
1,310
0
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from . import CuraProfileReader from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") def getMetaData(): return { "plugin": { "name": catalog.i18nc("@label", "Cura Profile Reader"), ...
senttech/Cura
plugins/CuraProfileReader/__init__.py
Python
agpl-3.0
807
0.006196
# coding: utf-8 """ Paasta API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 impor...
Yelp/paasta
paasta_tools/paastaapi/model/kubernetes_container.py
Python
apache-2.0
6,917
0.000578
""" Low-level LAPACK functions (:mod:`scipy.linalg.lapack`) ======================================================= This module contains low-level functions from the LAPACK library. .. versionadded:: 0.12.0 .. warning:: These functions do little to no error checking. It is possible to cause crashes by mis-usi...
andim/scipy
scipy/linalg/lapack.py
Python
bsd-3-clause
6,884
0.000291
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="icicle.outsidetextfont", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=p...
plotly/plotly.py
packages/python/plotly/plotly/validators/icicle/outsidetextfont/_color.py
Python
mit
469
0.002132
# encoding: latin1 import urllib2, re from Tkinter import * import tkMessageBox import sqlite3 def extraer_datos(): f = urllib2.urlopen("http://www.us.es/rss/feed/portada") s = f.read() l = re.findall(r'<item>\s*<title>(.*)</title>\s*<link>(.*)</link>\s*<description>.*</description>\s*<author>.*...
manuelgomezsuarez/practicasAII
practicasAII/Practica1/practica1.py
Python
gpl-3.0
2,831
0.020134
import unittest from pathlib import Path from html_minifier import Minifier from html_minifier import DjangoMinifier class TestMinify(unittest.TestCase): ext_min = "_min" file_name = "base" _file = "{0}.html" location = "html" def setUp(self): path = Path(__file__).parent file_n...
Kaumer/html-minifier
test/test.py
Python
mit
999
0
""" This workload presents a simple interface that can be reused in other workloads. It summary, it runs several subprocesses using the multiprocessing package, makes the connections between them, and then starts working. This particular workload spawns NETWORK_SIZE machines, two of which are proposer. We can run wit...
victordomene/ram-paxos
workloads/workload_B.py
Python
mit
4,156
0.009625
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api class CrmClaim(mo...
oihane/odoomrp-utils
crm_claim_extra_ref/model/crm_claim.py
Python
agpl-3.0
2,116
0
from testfixtures import log_capture from testsuite.base_fs import BaseFilesystem from testsuite import config from core.sessions import SessionURL from core import modules import utils from core import messages import subprocess import os class FileCd(BaseFilesystem): def setUp(self): self.session = Sess...
ncrocfer/weevely3
testsuite/test_file_cd.py
Python
gpl-3.0
2,398
0.007506
# -*- 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): # Adding field 'Version.privacy_level' db.add_column('builds_version', 'privacy_level', ...
d0ugal/readthedocs.org
readthedocs/builds/migrations/0015_add_privacy.py
Python
mit
11,730
0.007758
# 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...
sebrandon1/neutron
neutron/tests/unit/ipam/test_requests.py
Python
apache-2.0
16,389
0.000732
#!/usr/bin/python # # Check/update default wiki pages from the Trac project website. # # Note: This is a development tool used in Trac packaging/QA, not something # particularly useful for end-users. # # Author: Daniel Lundin <daniel@edgewall.com> import httplib import re import sys import getopt # Pages to inc...
zjj/trac_hack
contrib/checkwiki.py
Python
bsd-3-clause
3,475
0.003453
# # This module is a pure Python version of pypy.module.struct. # It is only imported if the vastly faster pypy.module.struct is not # compiled in. For now we keep this version for reference and # because pypy.module.struct is not ootype-backend-friendly yet. # """Functions to convert between Python values and C stru...
google/grumpy
third_party/pypy/_struct.py
Python
apache-2.0
12,831
0.012937
#!/usr/bin/env python # # Copyright 2006,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr from gnuradio import blocks from argparse import ArgumentParser import sys try: from gnuradio import audio except ImportErr...
dl1ksv/gnuradio
gnuradio-runtime/examples/network/audio_sink.py
Python
gpl-3.0
1,818
0.00055
# -*- coding: utf-8 -*- # # privacyIDEA is a fork of LinOTP # May 08, 2014 Cornelius Kölbel # License: AGPLv3 # contact: http://www.privacyidea.org # # Copyright (C) 2010 - 2014 LSE Leading Security Experts GmbH # License: AGPLv3 # contact: http://www.linotp.org # http://www.lsexperts.de # ...
privacyidea/privacyidea
privacyidea/lib/error.py
Python
agpl-3.0
5,601
0.00125
import re with open('England.txt') as f: data = f.read() pat = re.compile(r"\{\{基礎情報 (.*?)\n\}\}", re.S) baseInfo = '\n'.join(pat.findall(data)) print(baseInfo) pat = re.compile(r"\|(.*?) = (.*)") Info = pat.findall(baseInfo) dic = {key: cont for key, cont in Info} # print(dic)
knuu/nlp100
chap03/25.py
Python
mit
328
0.00625
#!/usr/bin/env python import logging __author__ = 'rolandh' from pymongo import Connection #import cjson import time from datetime import datetime from saml2 import time_util from saml2.cache import ToOld from saml2.time_util import TIME_FORMAT logger = logging.getLogger(__name__) class Cache(object): def __i...
tpazderka/pysaml2
src/saml2/mdbcache.py
Python
bsd-2-clause
6,873
0.000436
#!/usr/bin/env python # Copyright 2020 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Helper script to execute a single-processed fuzzing session. Creates fuzz tests in workdir/output/dir-<dir number>/fuzz-XXX.js....
youtube/cobalt
third_party/v8/tools/clusterfuzz/js_fuzzer/tools/fuzz_one.py
Python
bsd-3-clause
1,328
0.000753
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014, 2015 CERN. # # INSPIRE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
jalavik/inspire-next
inspire/modules/forms/fields/__init__.py
Python
gpl-2.0
999
0
""" WSGI config for django-example project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICA...
gen1us2k/django-example
config/wsgi.py
Python
mit
1,453
0
#!/usr/bin/env python import os, sys, time from ctypesgencore.descriptions import * from ctypesgencore.ctypedescs import * from ctypesgencore.messages import * import ctypesgencore.libraryloader # So we can get the path to it import test # So we can find the path to local files in the printer package def path_to_loc...
AsherBond/MondocosmOS
grass_trunk/lib/python/ctypes/ctypesgencore/printer/printer.py
Python
agpl-3.0
11,921
0.011576
from gluon.contrib.appconfig import AppConfig import uuid app_conf = AppConfig(reload=True) DATABASE_NAME = app_conf.take("monitutor_env.database_name") DATABASE_USER = app_conf.take("monitutor_env.database_user") DATABASE_PASSWORD = app_conf.take("monitutor_env.database_password") DATABASE_HOST = app_conf.take("monitu...
its-lab/MoniTutor
models/0tutordb.py
Python
gpl-3.0
7,838
0.004721
""" WSGI config for gocms project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
taojy123/GoCMS
gocms/wsgi.py
Python
mit
1,300
0.000769
# -*- 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): # Adding model 'Message' db.create_table(u'message_message', ( (u'id', self.gf('django.db.models...
ContributeToScience/participant-booking-app
booking/message/migrations/0001_initial.py
Python
gpl-2.0
7,560
0.008466
# GNU Solfege - free ear training software # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Tom Cato Amundsen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versio...
gabrielelanaro/solfege
solfege/const.py
Python
gpl-3.0
1,656
0.012681
#!/usr/bin/python2 # # Copyright 2016 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. """Archive all source files that are references in binary debug info. Invoked by libfuzzer buildbots. Executes dwarfdump to parse debug...
nwjs/chromium.src
testing/libfuzzer/zip_sources.py
Python
bsd-3-clause
1,995
0.014035
#!/usr/bin/python from pisi.actionsapi import shelltools, get, autotools, pisitools def setup(): autotools.configure ("--prefix=/usr\ --disable-static\ --disable-docs\ --docdir=/usr/share/doc/fontconfig-2.10.2") def build(): aut...
richard-fisher/repository
system/base/fontconfig/actions.py
Python
gpl-2.0
410
0.014634
from django.conf.urls import patterns, include, url urlpatterns = patterns('displays.views', url(r'^$', 'index', name = 'index'), url(r'^(?P<id>\d+)/$', 'display', name = 'display'), url(r'^(?P<id>\d+)/settings\.json$', 'ajax_settings', name = 'ajax-settings'), url(r'^(?P<id>\d+)/bitmap\.json$', 'ajax_...
Mezgrman/mezgrmanDE
displays/urls.py
Python
agpl-3.0
511
0.027397
#http://codeforces.com/problemset/problem/71/A T = int(raw_input()) while(not T == 0): word = str(raw_input()) if len(word)>10: print word[0]+str(len(word[1:len(word)-1]))+word[len(word)-1] else: print word T-=1
creativcoder/AlgorithmicProblems
codeforces/long_words.py
Python
mit
227
0.057269
# Template loader to retrieve templates from the database from django.template import TemplateDoesNotExist from django.template.loader import BaseLoader from pages.models import Page from appearance.models import Template class DBTemplateLoader(BaseLoader): is_usable = True def load_template_source(self, te...
bevenky/dev-cms
dev_cms/loader.py
Python
mit
890
0.001124
# Copyright 2017, Xavier Snelgrove import argparse import os import sys import numpy as np from scipy import ndimage import gram from gram import JoinMode if __name__ == "__main__": parser = argparse.ArgumentParser(description="Synthesize image from texture", formatter_class=argparse.ArgumentDefaultsHelpFormatter)...
wxs/subjective-functions
synthesize.py
Python
mit
7,775
0.013248
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
ychfan/tensorflow
tensorflow/contrib/nccl/python/ops/nccl_ops_test.py
Python
apache-2.0
6,643
0.007978
""" Studio Index, home and dashboard pages. These are the starting pages for users. """ from bok_choy.page_object import PageObject from selenium.webdriver import ActionChains from selenium.webdriver.common.keys import Keys from common.test.acceptance.pages.studio import BASE_URL from common.test.acceptance.pages.st...
cpennington/edx-platform
common/test/acceptance/pages/studio/index.py
Python
agpl-3.0
13,539
0.002807
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-error-reporting
google/cloud/errorreporting_v1beta1/services/report_errors_service/client.py
Python
apache-2.0
22,790
0.001624
import numpy as np from pylab import mean, log from matplotlib import mlab from kokako.score import Detector class SimpleKiwi(Detector): code = 'simple-north-island-brown-kiwi' description = 'Simple detector for north-island brown kiwi, based on energy between 1600 and 2200 Hz' version = '0.1.2' window...
dragonfly-science/kokako
kokako/detectors/kiwi.py
Python
gpl-3.0
1,133
0.006178
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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 appli...
iwaseyusuke/ryu
ryu/services/protocols/bgp/base.py
Python
apache-2.0
19,278
0
#! /usr/bin/env python ## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Nils Weiss <nils@we155.de> ## This program is published under a GPLv2 license """ CANSocket. """ from kamene.packet import * from kamene.fields import * import kamene.sendrecv as se...
phaethon/scapy
kamene/layers/can.py
Python
gpl-2.0
4,119
0.00437
class A: @staticmethod def m(x): return x print A.m(1)
asedunov/intellij-community
python/testData/quickFixes/PyMakeMethodStaticQuickFixTest/usage_after.py
Python
apache-2.0
72
0.013889
# encoding: utf-8 # # Copyright 2018 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your op...
unioslo/cerebrum
testsuite/tests/test_core/test_utils/test_json.py
Python
gpl-2.0
1,860
0
# coding: utf-8 """ Wheel will try to read configurations from environment variables so you dont need this local_settings.py file if you have env vars. 1. You can set as a file export WHEEL_SETTINGS='/path/to/settings.py' 2. You can set individual values export WHEEL_MONGODB_DB="wheel_db" export WHEEL_MONGODB_HOST...
seraphln/wheel
wheel/example.local_settings.py
Python
gpl-3.0
1,093
0.000915
from matplotlib import rcParams, rc import numpy as np import sys from fitFunctions import gaussian import scipy.interpolate import scipy.signal from baselineIIR import IirFilter import pickle import smooth # common setup for matplotlib params = {'savefig.dpi': 300, # save figures to 300 dpi 'axes.labelsize'...
mstrader/MkidDigitalReadout
DarknessFilters/triggerPhotons.py
Python
gpl-2.0
7,378
0.013283
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
odejesush/tensorflow
tensorflow/python/ops/gradients_test.py
Python
apache-2.0
23,474
0.011459
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
pierreg/tensorflow
tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py
Python
apache-2.0
5,787
0.006566
# -*- coding: utf-8 -*- # Scrapy settings for crawlAll project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/lates...
RennesUsher/crawlAll
crawlAll/settings.py
Python
apache-2.0
3,379
0.007103
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009-2013 Renato Lima - Akretion # # ...
rodrigoasmacedo/l10n-brazil
__unported__/l10n_br_account/__openerp__.py
Python
agpl-3.0
2,625
0.00381
import viper.lexer as vl import cmd class InteractiveLexerException(Exception): def __init__(self, output: str): self.output = output class InteractiveLexer(cmd.Cmd): # pragma: no cover prompt = 'viper_lex> ' def default(self, line): lexemes = vl.lex_line(line) print(lexemes) ...
pdarragh/Viper
viper/interactive/lexer.py
Python
apache-2.0
900
0
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-redis
google/cloud/redis_v1/types/cloud_redis.py
Python
apache-2.0
23,259
0.000516
import sys, os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'code'))) import core, graphs graph = graphs.one print 'import tensorflow as tf' print core.__fill__(graph, 'add', dict(), 0)[0] print 'with tf.Session() as sess:' print '\tsess.run(tf.global_variables_initializer())' prin...
aaiijmrtt/TENSORCHALK
tests/core.py
Python
mit
374
0.010695
# RUN: %python -m artiq.compiler.testbench.signature %s >%t # RUN: OutputCheck %s --file-to-check=%t # CHECK-L: f: ()->NoneType delay(30 mu) def f(): for _ in range(10): delay_mu(3) # CHECK-L: g: ()->NoneType delay(60 mu) def g(): for _ in range(10): for _ in range(2): delay_mu(3)
JQIamo/artiq
artiq/test/lit/iodelay/loop.py
Python
lgpl-3.0
320
0.003125
""" Module that provides a connection to the ModuleStore specified in the django settings. Passes settings.MODULESTORE as kwargs to MongoModuleStore """ from __future__ import absolute_import from importlib import import_module import gettext import logging from pkg_resources import resource_filename import re from...
solashirai/edx-platform
common/lib/xmodule/xmodule/modulestore/django.py
Python
agpl-3.0
12,834
0.001792
from django.test import SimpleTestCase class MaintenanceModeTestCase(SimpleTestCase): def test_maintenance_mode_enabled_home_page(self): with self.settings(MAINTENANCE_MODE=True): response = self.client.get("/", follow=True) self.assertEqual(503, response.status_code) s...
ministryofjustice/cla_frontend
cla_frontend/apps/core/testing/test_views.py
Python
mit
1,532
0.003916
from core_types import IncompatibleTypes, ImmutableT class FnT(ImmutableT): """Type of a typed function""" def __init__(self, input_types, return_type): self.input_types = tuple(input_types) self.return_type = return_type self._hash = hash(self.input_types + (return_type,)) def __str__(self): ...
pombredanne/parakeet
parakeet/ndtypes/fn_type.py
Python
bsd-3-clause
1,204
0.015781
# Copyright 2012 Nebula, 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...
ChameleonCloud/horizon
openstack_dashboard/dashboards/admin/volumes/views.py
Python
apache-2.0
11,089
0
"""A script for watching all traffic on the IOPub channel (stdout/stderr/pyerr) of engines. This connects to the default cluster, or you can pass the path to your ipcontroller-client.json Try running this script, and then running a few jobs that print (and call sys.stdout.flush), and you will see the print statements...
cloud9ers/gurumate
environment/share/doc/ipython/examples/parallel/iopubwatcher.py
Python
lgpl-3.0
2,903
0.004823
# -*- coding: utf-8 -*- """API test module.""" # # (C) Pywikibot team, 2007-2015 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' import datetime import types import pywikibot.data.api as api import pywikibot.family import pywikibot....
darthbhyrava/pywikibot-local
tests/api_tests.py
Python
mit
38,915
0.000437
def abs(x): if x < 0: return -x else: return x
safl/chplforpyp-docs
docs/source/examples/func_decl.py
Python
apache-2.0
71
0
import collections class Vertex(object): def __init__(self, v): self.v = v self.d = -1 self.neighbors = set() def add_neighbor(self, v): self.neighbors.add(v) def __repr__(self): return str(self.v) + " " + str(self.d) + " " def is_bipartite(vertex): if not ...
misscindy/Interview
Graph/19_06_Bipartite.py
Python
cc0-1.0
1,033
0.001936
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
ghchinoy/tensorflow
tensorflow/python/keras/layers/wrappers_test.py
Python
apache-2.0
37,589
0.009418
# -*- coding: utf-8 -*- import os MODULE_PATH = os.path.split(os.path.realpath(__file__))[0] def typical_fixtures(): # models.User.add_system_users() # typical_users() pass def typical_picture(): return open(os.path.join(MODULE_PATH, "data/led-hallway.jpg"), 'rb') # def typical_users(): # mod...
msarfati/InstaCommander
instacommander/tests/fixtures.py
Python
apache-2.0
657
0.003044
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-30 08:44 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
duozhilin/Blog
blogs/migrations/0009_topic_owner.py
Python
unlicense
685
0.00146
# -*- coding: utf-8 -*- import functools from django.conf import settings from django.db.models import signals def signals_switch(): pre_save = signals.pre_save.receivers post_save = signals.post_save.receivers def disconnect(): signals.pre_save.receivers = [] signals.post_save.receiver...
pythonindia/junction
tests/utils.py
Python
mit
1,964
0.001018
from django.contrib import admin from .models import PizzaPlace admin.site.register(PizzaPlace)
nicole-a-tesla/meetup.pizza
pizzaplace/admin.py
Python
mit
99
0.010101
import math import mmap import gzip import os import codecs import pytz import const from util import ip2long from timezone import time_zone_by_country_and_region MMAP_CACHE = const.MMAP_CACHE MEMORY_CACHE = const.MEMORY_CACHE STANDARD = const.STANDARD class GeoIPError(Exception): pass class GeoIPMetaclass(t...
ContributeToScience/participant-booking-app
booking/core/ip2geo/__init__.py
Python
gpl-2.0
10,628
0.001976
# This is a sample quisk_conf.py configuration file for a SoftRock Rx/Tx Ensemble or # other SoftRock that has both transmit and receive capability. You need two sound # cards, a high quality card to capture radio samples and play microphone sound; and # a lower quality card to play radio sound and capture the microph...
gonesurfing/Quisk_rpi_remote
softrock/conf_rx_tx_ensemble.py
Python
gpl-2.0
2,177
0.012402
# Author: Mathieu Blondel <mathieu@mblondel.org> # Arnaud Joly <a.joly@ulg.ac.be> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, ClassifierMixin, RegressorMixin from .externals.six.moves import xrange from .utils import check_random_state from .utils.validation import safe_asarray...
johnowhitaker/bobibabber
sklearn/dummy.py
Python
mit
11,519
0
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
punalpatel/st2
st2actions/tests/unit/test_rescheduler.py
Python
apache-2.0
4,718
0.004663
import unittest import os os.environ['MIAMI_ENV'] = 'test' import simplejson as json from miami.models import Team, User, Task class ModelsTest(unittest.TestCase): def test_team_toJSON(self): team = Team('Log') team.id = 1 self.assertEquals({'id':1, 'name': 'Log', 'color': '2a33d8'}, team...
archiechen/miami
tests/models_tests.py
Python
mit
1,133
0.010591
import datetime import itertools import unittest from copy import copy from django.db import ( DatabaseError, IntegrityError, OperationalError, connection, ) from django.db.models import Model from django.db.models.fields import ( BigIntegerField, BinaryField, BooleanField, CharField, DateTimeField, Intege...
abhattad4/Digi-Menu
tests/schema/tests.py
Python
bsd-3-clause
61,911
0.001179
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-07-01 20:13 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('flocks', '0015_auto_20170624_1312'), ('feeding', '000...
forcaeluz/easy-fat
feeding/migrations/0006_auto_20170701_2013.py
Python
gpl-3.0
1,270
0.002362
# -*- 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 #...
akosel/incubator-airflow
tests/models.py
Python
apache-2.0
100,341
0.000897
import unittest import tempfile import shutil import os from path import Path class TestGetLocalPathsFunctional(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() self.path = Path('localpath', 'remotepath') def tearDown(self): shutil.rmtree(self.temp_dir) def...
kyokley/MediaConverter
tests/functional/test_path.py
Python
mit
800
0.00125
''' Created on Apr 8, 2014 @author: cmills ''' from unittest import TestLoader, TextTestRunner from test_tasr import TestTASR from test_app_topic import TestTASRTopicApp from test_app_core import TestTASRCoreApp from test_app_subject import TestTASRSubjectApp from test_client_legacy_methods import TestTASRLegacyClien...
ifwe/tasr
test/pyunit/test_all.py
Python
apache-2.0
1,248
0
"""Cover entities for the Overkiz (by Somfy) integration."""
rohitranjan1991/home-assistant
homeassistant/components/overkiz/cover_entities/__init__.py
Python
mit
61
0
#from . import action from . import glk from . import message from .debug import log #from . import * NOUN_TOKEN = 1 HELD_TOKEN = 2 MULTI_TOKEN = 3 MULTIHELD_TOKEN = 4 MULTIEXCEPT_TOKEN = 5 MULTIINSIDE_TOKEN = 6 TOPIC_TOKEN = 7 CREATURE_TOKEN = 8 def tokenise_string(string): "Tran...
dcsch/pyif
pyif/parser.py
Python
mit
3,790
0.006596
#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def set_datapath_arg(): parser.add_argument('--datapath', ...
materials-commons/materialscommons.org
backend/scripts/demo-project/build_project.py
Python
mit
1,400
0.005
import json from django.contrib import messages from django.core.exceptions import PermissionDenied from django.forms.formsets import formset_factory from django.http import HttpResponse, HttpResponseRedirect from django.http.response import Http404 from django.utils.decorators import method_decorator from django.views...
qedsoftware/commcare-hq
custom/ewsghana/views.py
Python
bsd-3-clause
11,616
0.002497
# -*- coding: utf-8 -*- # Copyright(C) 2019 Vincent A # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
laurentb/weboob
modules/airparif/pages.py
Python
lgpl-3.0
3,898
0.000257
import numpy as np import pdb #from dtree import * import model def main(): # detree = DTree(np.zeros(3), [1., 2., 3.]) # # inputs = [0.2, 0.6, 0.1] # print detree.infer(inputs) # detree.feedback(inputs, 1) # pdb.set_trace() # cuts = detree.save() # print cuts # detree.feedback(inputs, 0) ...
tianrui/FlappyClone
test_dtree.py
Python
mit
440
0.034091
''' Implements the RTSRoot class. This file is part of RTSLib. Copyright (c) 2011-2013 by Datera, Inc Copyright (c) 2011-2014 by Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at h...
mikenawrocki/rtslib-fb
rtslib/root.py
Python
apache-2.0
10,297
0.002137
# -*- coding: utf-8 -*- import django import sys from itertools import chain from django import forms from django.conf import settings from django.db.models.query import QuerySet from django.template.loader import render_to_string from django.utils.encoding import force_text from django.utils.html import conditional_es...
Venturi/oldcms
env/lib/python2.7/site-packages/sortedm2m/forms.py
Python
apache-2.0
4,668
0.001714
# # pronounce.py # Record pronunciations for word entries # # Jonatan H Sundqvist # May 18 2015 # # TODO | - # - # SPEC | - # - import mozart import sqlite3 import queue import tkinter as tk class Pronounce(object): ''' Docstring goes here ''' def __init__(self): ''' Docstring goes ...
GrandmasterShadowMorgue/KerfuffleOfTheDandelions
pronounce.py
Python
mit
662
0.04236
"""Represent a mood on the gateway.""" from .const import ROOT_MOODS from .resource import ApiResource class Mood(ApiResource): def __init__(self, raw, parent): super().__init__(raw) self._parent = parent @property def path(self): return [ROOT_MOODS, self._parent, self.id] de...
ggravlingen/pytradfri
pytradfri/mood.py
Python
mit
400
0
######################################### # Servo.py # categories: servo # more info @: http://myrobotlab.org/service/Servo ######################################### # uncomment for virtual hardware Platform.setVirtual(True) # Every settings like limits / port number / controller are saved after initial use # so you c...
MyRobotLab/myrobotlab
src/main/resources/resource/Servo/Servo.py
Python
apache-2.0
2,843
0.006331
# -*- coding: utf-8 -*- """ Created on Sun Sep 17 22:06:52 2017 Based on: print_MODFLOW_inputs_res_NWT.m @author: gcng """ # print_MODFLOW_inputs import numpy as np import MODFLOW_NWT_lib as mf # functions to write individual MODFLOW files import os # os functions from ConfigParser import SafeConfigParser parser ...
UMN-Hydro/GSFLOW_pre-processor
python_scripts/MODFLOW_scripts/print_MODFLOW_inputs_res_NWT.py
Python
gpl-3.0
3,667
0.011181
def check_input_data(costs, vector_a, vector_b): if not _is_list(vector_a): raise VectorANotListError if not _is_list(vector_b): raise VectorBNotListError if not _is_list(costs): raise CostsNotListError if 0 in (len(costs), len(vector_a), len(vector_b)): raise EmptyLi...
Pavaka/Pygorithms
input_checkers/TP_input_checker.py
Python
gpl-2.0
1,080
0
#Pass in a photo url to the script and it performs 5 label detection on the photo. import sys import argparse import io from google.cloud import vision #capture the argument passed in to script url=sys.argv[1] client = vision.Client() #pass commange line url into uri image = client.image(source_uri=url) labels = i...
jakemathai/computer-vision
label_detect.py
Python
apache-2.0
437
0.029748
class Comment(object): # See documentation at https://api.imgur.com/ for available fields def __init__(self, *initial_data, **kwargs): for dictionary in initial_data: for key in dictionary: setattr(self, key, dictionary[key]) for key in kwargs: setattr(se...
atareao/nautilus-imgur-uploader
src/imgurpython/imgur/models/comment.py
Python
gpl-3.0
342
0
#!/usr/bin/env python import unittest from arni_countermeasure.rated_statistic_storage import * from rosgraph_msgs.msg import Clock from arni_countermeasure.outcome import * import rospy import time import arni_countermeasure.helper as helper PKG = "arni_countermeasure" class TestStorage(unittest.TestCase): pub ...
ROS-PSE/arni
arni_countermeasure/tests/test_storage.py
Python
bsd-2-clause
5,630
0
import os import sys import logging class UserEntity(object): def __init__(self, user_id): self.user_id = user_id #self.prefs = {"locale": "zh_CN"} self.prefs = {} def load(self, entity): self.nickname = entity.nickname self.prefs['locale'] = entity.language sel...
xiangcai/todother
module/user.py
Python
lgpl-3.0
344
0.008721
""" Diabicus: A calculator that plays music, lights up, and displays facts. Copyright (C) 2016 Michael Lipschultz This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (...
lipschultz/diabicus
src/numeric_tools.py
Python
gpl-3.0
8,003
0.003124
# -*- coding: utf-8 -*- from cms.models import Page from cms.test_utils.util.context_managers import (UserLoginContext, SettingsOverride) from django.conf import settings from django.contrib.auth.models import User, AnonymousUser from django.contrib.sites.models import Site from django.core.exceptions import Object...
foobacca/django-cms
cms/test_utils/testcases.py
Python
bsd-3-clause
12,223
0.001964
from main import GuessManager def test_init_uppercase(): g = GuessManager('SOMEWORD') assert g.word == 'SOMEWORD' assert g.mask == [False]*8 def test_init_mask(): mask = [True, False, True, False, True, False, True, False] g = GuessManager('SOMEWORD', mask=mask) assert g.word == 'SOMEWORD' ...
lgiordani/slack_hangman
tests/test_guess_manager.py
Python
mit
5,541
0.000361
import shutil import numpy as np import dill import gzip import os import subprocess import struct from array import array import warnings from dps import cfg from dps.utils import image_to_string, cd, resize_image # This link seems not to work anymore... # emnist_url = 'https://cloudstor.aarnet.edu.au/plus/index.ph...
e2crawfo/dps
dps/datasets/load/emnist.py
Python
apache-2.0
11,445
0.001922
# vim: ts=4:sw=4:expandtab # -*- coding: UTF-8 -*- # BleachBit # Copyright (C) 2008-2021 Andrew Ziem # https://www.bleachbit.org # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
bleachbit/bleachbit
tests/TestWindows.py
Python
gpl-3.0
19,770
0.000304
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" # pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long from import_shims.warn import warn_deprecated_import warn_deprecated_import('instructor_task.tests.test_base', 'lms.djangoapps....
eduNEXT/edunext-platform
import_shims/lms/instructor_task/tests/test_base.py
Python
agpl-3.0
416
0.009615
# ================================================================================================== # Copyright 2013 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
Yasumoto/commons
src/python/twitter/common/__init__.py
Python
apache-2.0
957
0
import sys, os, os.path import MySQLdb, SpiffGuard, config, shutil from sqlalchemy import * from SpiffIntegrator import PackageManager, \ version_is_greater, \ InvalidDescriptor from ConfigParser import RawConfigParser from services import Extension...
Letractively/spiff
src/pkg.py
Python
gpl-2.0
7,448
0.005505