code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
from django.contrib import admin from models import UserProfile, Project, Category, SubCategory, DifficultyLevel, FAQ, InformationArticle # Register your models here. admin.site.register(UserProfile) admin.site.register(Project) admin.site.register(Category) admin.site.register(SubCategory) admin.site.register(Difficu...
Gorgel/khd_projects
khd_projects/projects/admin.py
Python
mit
558
from benchmarker.data.synthetic.img_300_cls_1000 import get_data
undertherain/benchmarker
benchmarker/kernels/ssd300/data.py
Python
mpl-2.0
65
#!/usr/bin/python """ @file batch0103to0110.py @author Daniel Krajzewicz @author Michael Behrisch @date 2007 @version $Id: batch0103to0110.py 11671 2012-01-07 20:14:30Z behrisch $ Applies the transformation on all nets in the given folder or - if no folder is given - in the base folder (../..). SUMO, Simula...
rudhir-upretee/Sumo_With_Netsim
tools/net/batch0103to0110.py
Python
gpl-3.0
1,060
#!/usr/bin/env python """ bibwatch: watch for changes to bibtex files and update Unite bibtex cache Author : Mark Sprevak <mark.sprevak@ed.ac.uk> Copyright : Copyright 2015, Mark Sprevak License : BSD3 """ import argparse import bibtex import cache import datetime import os import sys import time VERSION = "0.1"...
msprev/unite-bibtex
pythonx/core/bibwatch.py
Python
bsd-3-clause
3,634
#!/usr/bin/env python import argparse from datetime import datetime import os import re import subprocess import sys import time import unittest test_root = os.path.join(os.path.dirname(__file__), 'test') class IntegrationTestFailure(Exception): pass class TestRunner(object): def __init__(self, args=None...
StanfordBioinformatics/loom
client/loomengine/test_runner.py
Python
agpl-3.0
3,291
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from config.template_middleware import TemplateResponse from gaebusiness.business import CommandExecutionException from tekton import router from gaecookie.decorator import no_csrf from book_app import facade from routes.books import admin...
marcosxddh/aula_script
backend/appengine/routes/books/admin/edit.py
Python
mit
965
from twisted.internet.defer import inlineCallbacks, fail, succeed from globaleaks import models from globaleaks.orm import transact from globaleaks.tests import helpers from globaleaks.jobs.delivery_sched import DeliverySchedule from globaleaks.jobs.notification_sched import NotificationSchedule, MailGenerator cla...
vodkina/GlobaLeaks
backend/globaleaks/tests/jobs/test_notification_sched.py
Python
agpl-3.0
1,811
# -*- coding: utf-8 -*- """ Created on Mon Feb 8 02:34:44 2016 @author: irnakat """ import pickle import pylab as plt import sys import numpy as np sys.path.insert(0,'..') from TSCalculator import TSCalculator as TSC print('previous scanning is detected! Loading previous data instead!') with open('empiricalTF.bin'...
blueray45/GSRT
supplementary/KIKnetDataManagement_load.py
Python
gpl-2.0
3,409
"""SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not require any external libraries, except optionally for ...
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/sympy/__init__.py
Python
mit
2,176
''' pydevd - a debugging daemon This is the daemon you launch for python remote debugging. Protocol: each command has a format: id\tsequence-num\ttext id: protocol command number sequence-num: each request has a sequence number. Sequence numbers originating at the debugger are odd, sequence numbers ori...
MichaelNedzelsky/intellij-community
python/helpers/pydev/pydevd_comm.py
Python
apache-2.0
55,573
import logging import re import requests from copy import deepcopy from mozilla_version.balrog import BalrogReleaseName BALROG_API_ROOT = 'https://aus5.mozilla.org/api/v1' log = logging.getLogger(name=__name__) class BalrogError(Exception): pass class TooManyBlobsFoundError(BalrogError): def __init__(sel...
lundjordan/releasewarrior-2.0
releasewarrior/balrog.py
Python
mpl-2.0
6,332
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() traindat = lm.load_dna('../data/fm_train_dna.dat') testdat = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindat,testdat,4,0,False, False],[traindat,testdat,4,0,False,False]] def kernel_comm_word_string_modular (fm_train_dna=traind...
c4goldsw/shogun
examples/undocumented/python_modular/kernel_comm_word_string_modular.py
Python
gpl-3.0
1,453
#!/usr/bin/env python # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png fi...
EntropyFactory/creativechain-core
contrib/devtools/optimize-pngs.py
Python
mit
3,391
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
tkaitchuck/nupic
tests/unit/py/nupic/research/tp_test.py
Python
gpl-3.0
6,646
VERSION = (0, 3, 8, 'stable') def get_release(): return '-'.join([get_version(), VERSION[-1]]) def get_version(): """ Returns only digit parts of version. """ return '.'.join(str(i) for i in VERSION[:3]) __author__ = 'dlancer' __docformat__ = 'restructuredtext en' __copyright__ = 'Copyright 20...
dlancer/django-crispy-contact-form
contact_form/__init__.py
Python
bsd-3-clause
562
#!/usr/bin/env python """ This script takes a finished ARC run, maps the reads which were recruited per-target against the contigs which were assembled from those reads, and then calls varaints. New strategy: iterate over samples and targets withing samples, pass sample + target + i to a multiprocessing call ...
ibest/ARC
contrib/ARC_Call_and_Inject_hets.py
Python
apache-2.0
19,989
# -*- coding: utf-8 -*- """ all configuration options and dicts of external information (dormitory mapping etc.) Project-specific options should be included in the `config.py`, which is a file not tracked in git containing IPs, user names, passwords, etc. """ SENTRY_DSN = None CONTENT_URL = None LOCALE_COOKIE_NAME ...
agdsn/sipa
sipa/config/default.py
Python
mit
2,434
# # Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. # from mesos_manager.vnc.vnc_utils import (get_vn_fq_name_from_dict_string, get_domain_name_from_vn_dict_string, get_project_name_from_vn_dict_string, ...
rombie/contrail-controller
src/container/mesos-manager/mesos_manager/vnc/vnc_mesos_config.py
Python
apache-2.0
5,447
import datetime import decimal import hashlib import logging from time import time from django.conf import settings from django.utils.encoding import force_bytes from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') class CursorWrapper: def __init__(self, cursor, db): se...
mattseymour/django
django/db/backends/utils.py
Python
bsd-3-clause
7,044
# -*- coding: utf-8 -*- """ Location module. `author` : Quentin Lampin <quentin.lampin@orange.com> `license` : MPL `date` : 2015/10/12 Copyright 2015 Orange """ from .. import m_common from . import m_gpsd import threading import bottle # experiment states GPS_UNDEFINED = 0 GPS_OFFLINE = 1 GPS_ONLIN...
glarue-ol/sensorlab-observer
observer/bin/m_location/location.py
Python
mpl-2.0
5,860
import string import subprocess from distutils.spawn import find_executable from distutils.version import LooseVersion from txtorcon.util import find_tor_binary as tx_find_tor_binary from ooni.settings import config class TorVersion(LooseVersion): pass class OBFSProxyVersion(LooseVersion): pass def find...
0xPoly/ooni-probe
ooni/utils/onion.py
Python
bsd-2-clause
3,654
from django.db import models from .lib.AvailableEntities import AVAILABLE_ENTITIES # Create your models here. class UserDefinedEntity(models.Model): name = models.CharField(max_length=128) description = models.CharField(blank=True, max_length=256) entity_type = models.CharField( max_length=64, ...
tomaslibal/datalab
lab/models.py
Python
gpl-3.0
1,328
#!/usr/bin/python # -*- coding: utf-8 -*- """Shape-Out - scatter plot methods""" from __future__ import division, unicode_literals import time import chaco.api as ca import chaco.tools.api as cta from chaco.default_colormaps import color_map_name_dict from dclab import definitions as dfn import numpy as np from . im...
ZellMechanik-Dresden/ShapeOut
shapeout/gui/plot_scatter.py
Python
gpl-2.0
9,603
#!/usr/bin/python # email_url.py # emails the video URL to the presenters from django.core.mail import get_connection, EmailMessage from django.template import Context, Template from process import process from email_ab import email_ab # from django.conf import settings class email_title(email_ab): ready_stat...
yoe/veyepar
dj/scripts/email_title.py
Python
mit
2,552
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv class ResCompany(osv.Model): _inherit = 'res.company' def _prepare_report_view_action(self, cr, uid, template): template_id = self.pool['ir.model.data'].xmlid_to_res_id(cr, ...
vileopratama/vitech
src/addons/report/models/res_company.py
Python
mit
1,006
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
alb-i986/selenium
py/test/selenium/webdriver/browser_specific_template.py
Python
apache-2.0
1,641
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eithe...
ngpestelos/ansible
lib/ansible/plugins/connection/ssh.py
Python
gpl-3.0
28,684
#! python3 # formFiller.py - Automatically fills in the form. import pyautogui, time # Set these to the correct coordinates for your particular computer. nameField = (648, 319) submitButton = (651, 817) submitButtonColor = (75, 141, 249) submitAnotherLink = (760, 224) formData = [{'name': 'Alice', 'fear': 'eavesdrop...
cyberlearner13/techshots13
automate_online-materials/formFiller.py
Python
gpl-2.0
2,686
"""Python 3 Unicode test.""" def main(args): sep = args['delimiter'] str = sep + " ☃ " + sep print(str) return {"winter": str}
duynguyen/incubator-openwhisk
tests/dat/actions/unicode3.py
Python
apache-2.0
147
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under the terms...
o11c/shiboken2
tests/samplebinding/reference_test.py
Python
gpl-2.0
4,665
# @file Word Pattern # @brief Given 2 sets check if it is a bijection # https://leetcode.com/problems/word-pattern/ ''' Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. Exam...
ngovindaraj/Python
leetcode/ds_string_word_pattern.py
Python
mit
1,637
# source # http://nbviewer.ipython.org/github/tritemio/notebooks/blob/master/Mixture_Model_Fitting.ipynb from easydev import DevTools, AttrDict devtools = DevTools() from sequana.lazy import numpy as np from sequana.lazy import pylab from . import criteria half_log_two_pi = 0.5 * np.log(2 * np.pi) __all__ = ["F...
sequana/sequana
sequana/mixture.py
Python
bsd-3-clause
13,063
#!/usr/bin/python # Using IF, ELIF and ELSE in python # Read a value from console; make sure its a number otherwise quit program try: answer=int(raw_input("What is 1 + 1?\n")) except ValueError: print "Please enter a number" exit() if answer == 2: print "Correct!" elif (answer == 1) or (answer == 2): print "Clos...
jklee7/python101
04. Conditionals.py
Python
unlicense
349
# -*- coding: utf-8 -*- from ..internal.XFSHoster import XFSHoster class FilejokerNet(XFSHoster): __name__ = "FilejokerNet" __type__ = "hoster" __version__ = "0.04" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?filejoker\.net/\w{12}' __config__ = [("activated", "bool", "Activate...
Arno-Nymous/pyload
module/plugins/hoster/FilejokerNet.py
Python
gpl-3.0
1,357
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/neighbors/plot_nearest_centroid.py
Python
bsd-3-clause
1,804
#!/usr/bin/env python3 from mediawords.db import connect_to_db, DatabaseHandler from mediawords.job import JobBroker from mediawords.util.log import create_logger log = create_logger(__name__) def add_all_media_to_sitemap_queue(db: DatabaseHandler): """Add all media IDs to XML sitemap fetching queue.""" log...
berkmancenter/mediacloud
apps/sitemap-fetch-media-pages/bin/add_all_media_to_sitemap_queue.py
Python
agpl-3.0
2,965
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cart', '0005_auto_20150328_0210'), ] operations = [ migrations.RemoveField( model_name='cartproducts', ...
juntatalor/qexx
cart/migrations/0006_remove_cartproducts_total.py
Python
mit
354
""" A limited test module is used for a limited spatial database. """ import os, unittest from models import Country, City, State, Feature from django.contrib.gis import gdal from django.contrib.gis.geos import * from django.core.exceptions import ImproperlyConfigured class GeoModelTest(unittest.TestCase): d...
paulsmith/geodjango
django/contrib/gis/tests/geoapp/tests_mysql.py
Python
bsd-3-clause
7,860
# Copyright 2015 TellApart, 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 writi...
thinker0/aurproxy
tellapart/aurproxy/source/sources/mesos.py
Python
apache-2.0
3,561
""" HyperOptAuto class. This module implements a convenience auto-hyperopt class, which can be used together with strategies that implement IHyperStrategy interface. """ import logging from contextlib import suppress from typing import Callable, Dict, List from freqtrade.exceptions import OperationalException with ...
flightcom/freqtrade
freqtrade/optimize/hyperopt_auto.py
Python
gpl-3.0
3,488
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
Ictp/indico
bin/utils/getNameBadIndexed.py
Python
gpl-3.0
1,515
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_hyperlink13.py
Python
bsd-2-clause
1,208
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
espadrine/opera
chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
Python
bsd-3-clause
23,430
from django.test import TestCase, override_settings from .factories import GalleryFactory @override_settings(ROOT_URLCONF='photologue.tests.test_urls') class RequestGalleryTest(TestCase): def setUp(self): super(RequestGalleryTest, self).setUp() self.gallery = GalleryFactory(slug='test-gallery') ...
RossLYoung/django-photologue
photologue/tests/test_views_gallery.py
Python
bsd-3-clause
2,146
import os import shutil import sys import zipfile import platform from distutils.core import setup from distutils.sysconfig import get_python_lib import py2exe version = __import__('p2pool').__version__ im64 = '64' in platform.architecture()[0] extra_includes = [] import p2pool.networks extra_includes.extend('p2pool...
DenisZagvozkin/p2pool
setup.py
Python
gpl-3.0
2,450
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Helpful routines for regression testing.""" from base64 import b64encode from binascii import hexlify,...
MazaCoin/maza
test/functional/test_framework/util.py
Python
mit
21,786
""" Common code and definitions used by Link extractors (located in scrapy.contrib.linkextractor). """ # common file extensions that are not followed if they occur in links IGNORED_EXTENSIONS = [ # images 'mng', 'pct', 'bmp', 'gif', 'jpg', 'jpeg', 'png', 'pst', 'psp', 'tif', 'tiff', 'ai', 'drw', 'dxf', 'ep...
pablohoffman/scrapy
scrapy/linkextractor.py
Python
bsd-3-clause
676
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google/clusterfuzz
src/local/butler/reproduce_tool/prompts.py
Python
apache-2.0
908
from django.test import TestCase class SvnToGitTests(TestCase): def test_redirect(self): response = self.client.get('/svntogit/1/', follow=False) target = 'https://github.com/django/django/commit/d6ded0e91b' self.assertEquals(response.status_code, 301) self.assertEquals(response['...
xavierdutreilh/djangoproject.com
svntogit/tests.py
Python
bsd-3-clause
651
def qdebug(cmd, args): import sys import linecache import inspect import os class Dumper: def __init__(self): self.output = '' def evaluateTooltip(self, args): self.updateData(args) def updateData(self, args): self.expandedINames = set(args.get("expanded", [])) ...
martyone/sailfish-qtcreator
share/qtcreator/debugger/pdbbridge.py
Python
lgpl-2.1
9,070
# -*- coding: utf-8 -*- # Natural Language Toolkit: Twitter client # # Copyright (C) 2001-2015 NLTK Project # Author: Ewan Klein <ewan@inf.ed.ac.uk> # Lorenzo Rubio <lrnzcig@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ NLTK Twitter client This module offers methods for ...
nelango/ViralityAnalysis
model/lib/nltk/twitter/twitterclient.py
Python
mit
18,873
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. Yo...
nikesh-mahalka/nova
nova/virt/vmwareapi/vmops.py
Python
apache-2.0
93,068
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ from sleekxmpp.plugins.base import register_plugin from sleekxmpp.plugins.xep_0033 import stanza from sleekxmpp.plugins.xep_00...
danielvdao/facebookMacBot
venv/lib/python2.7/site-packages/sleekxmpp/plugins/xep_0033/__init__.py
Python
mit
546
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
Star2Billing/cdr-stats
cdr_stats/mod_registration/forms.py
Python
mpl-2.0
1,884
import sys import time import traceback from StringIO import StringIO from multiprocessing import Pool, TimeoutError from unittest import defaultTestLoader, TestSuite, TextTestResult, TextTestRunner DEFAULT_WORKERS = 4 DEFAULT_TIMEOUT = 30 class _WritelnDecorator(object): """Used to decorate file-like objects wi...
tcooc/multitest
multitest/runner.py
Python
mit
6,034
import time import numpy as np from kid_readout.interactive import * from kid_readout.measurement import acquire from kid_readout.roach import r2heterodyne, attenuator, hardware_tools from equipment.custom import mmwave_source from equipment.hittite import signal_generator from equipment.srs import lockin hittite =...
ColumbiaCMB/kid_readout
apps/data_taking_scripts/2017-05-bnl-hex-271/heterodyne_scan_measurement_roach2.py
Python
bsd-2-clause
2,185
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
opadron/girder
plugins/oauth/server/providers/__init__.py
Python
apache-2.0
1,018
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib.admin import autodiscover as django_autodiscover from django.utils.translation import ugettext_lazy as _ from rest_framework_swagger.views import get_swagger_view import contentstor...
teltek/edx-platform
cms/urls.py
Python
agpl-3.0
14,719
from pyllicalabspdf import * pdfpress(url="http://gallicalabs.bnf.fr/ark:/12148/cb32817642h/date", title="moderniste", year=1889, month=5, day=25, item=10, rate=7)
Dorialexander/Pyllica
actionpyllicalabspdf.py
Python
gpl-2.0
168
# -*- coding: utf-8 -*- """ Created on Fri Mar 09 16:00:27 2012 Author: Josef Perktold """ import pickle import numpy as np import statsmodels.api as sm from numpy.testing import assert_ from nose import SkipTest import platform iswin = platform.system() == 'Windows' npversionless15 = np.__version__ < '1.5' wino...
yarikoptic/pystatsmodels
statsmodels/base/tests/test_shrink_pickle.py
Python
bsd-3-clause
7,069
#!/usr/bin/env python from subprocess import Popen, PIPE import json import os import re import sys config = dict() if os.path.isfile('/usr/lib/simple-vmcontrol/config.json'): config = json.loads(open('/usr/lib/simple-vmcontrol/config.json', 'r').read()) datadisklocation = '/srv/vm/' if 'datadisklocation' in con...
allanrbo/simple-vmcontrol
vmcontrol/deletedatadisk.py
Python
mit
1,214
# Test Loop.stop() to stop the event loop try: import uasyncio as asyncio except ImportError: try: import asyncio except ImportError: print("SKIP") raise SystemExit async def task(): print("task") async def main(): print("start") # Stop the loop after next yield ...
kerneltask/micropython
tests/extmod/uasyncio_loop_stop.py
Python
mit
795
from abc import ABCMeta, abstractmethod from datetime import datetime class Settings(metaclass=ABCMeta): """ Interface that represents the settings for the spider scheduler. """ def need_refresh(self) -> bool: """ Tels if the scheduler should start the spiders. :return: True ...
manu0466/BookingBot
src/booking/scheduler/settings/Settings.py
Python
gpl-2.0
931
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
rahulunair/nova
nova/tests/fixtures.py
Python
apache-2.0
100,463
import unittest import math from event_analyse.tf_idf import * from event_analyse.website_link_arborescence import * def is_equal(a, b): return math.fabs(a-b) < 10**-6 class TestTfIdf(unittest.TestCase): def setUp(self): # With stopwords self.corpus = Corpus() self.co...
Diego999/Social-Recommendation-System
tests.py
Python
mit
4,443
# -*- coding: utf-8 -*- import collections Type = collections.namedtuple('Type', ['name', '_type', 'examples']) class SchemaMeta(type): def __init__(self, name, parents, attrs): super().__init__(name, parents, attrs) assert isinstance(attrs['fields']) for field in attrs['fields']: ...
faith0811/makiki
makiki/schema.py
Python
mit
425
#!/usr/bin/env python # b2u b2u = open('uao250-b2u.big5.txt', 'r').readlines() b2u = [line.strip().split(' ') for line in b2u if line.strip().startswith('0x')] b2u = dict((int(b, 0), int(u, 0)) for (b, u) in b2u) print """#include <stdint.h> extern const uint16_t b2u_table[]; extern const uint16_t u2b_t...
wisperwinter/pttbbs
common/sys/big5_gen.py
Python
gpl-2.0
1,376
"""Cache administration tools for Django.""" __version__ = '0.1.2'
7kfpun/django-simple-cache-admin
simple_cache_admin/__init__.py
Python
mit
68
from django.test import TestCase from tribes.models import Tribe class TribesTest(TestCase): fixtures = ["tribes_auth.json"] def test_unauth_create_get(self): """can an unauth'd user get to page?""" response = self.client.get("/tribes/create/") self.assertEqual(response.s...
alex/pinax
pinax/apps/tribes/tests/__init__.py
Python
mit
2,486
# -*- coding:utf-8 -*- # @author xupingmao <578749341@qq.com> # @since 2019/10/05 20:23:43 # @modified 2021/12/05 10:59:08 # @filename test_note.py import xutils # cannot perform relative import try: import test_base except ImportError: from tests import test_base from handlers.note.dao import get_by_id, vis...
xupingmao/xnote
tests/test_note.py
Python
gpl-3.0
13,895
import sqlite3 import re import os import logging from ccloud import utils from .driver import Driver class SQLiteDriver(Driver): def __init__(self, config, *args, **kwargs): def require(field): if not config.has_key(field): raise ValueError('SQLite driver: "%s" configuraiton f...
peterkuma/ccloud
src/ccloud/storage/sqlite.py
Python
mit
2,496
#!/usr/bin/env python import sys, os sys.path.append(os.path.dirname(__file__)) import multitetris.frontend.running_game as game if len(sys.argv) > 1: game.run(sys.argv[1]) else: game.run()
sygi/multitetris
run_client.py
Python
gpl-2.0
199
from .. utils import TranspileTestCase, BuiltinTwoargFunctionTestCase class HasattrTests(TranspileTestCase): def test_minimal(self): self.assertCodeExecution(""" class MyClass(object): class_value = 42 def __init__(self, val): self.value = v...
cflee/voc
tests/builtins/test_hasattr.py
Python
bsd-3-clause
1,219
from numpy import * Nobs = 20 x_true = random.uniform(0,10, size=Nobs) y_true = random.uniform(-1,1, size=Nobs) alpha_true = 0.5 beta_x_true = 1.0 beta_y_true = 10.0 eps_true = 0.5 z_true = alpha_true + beta_x_true*x_true + beta_y_true*y_true z_obs = z_true + random.normal(0, eps_true, size=Nobs) from matplotlib impo...
sheqi/TVpgGLM
test/practice6_pystan_example1.py
Python
mit
1,262
#!/usr/bin/python # Written by Antonio Galea - 2010/11/18 # Distributed under Gnu LGPL 3.0 # see http://www.gnu.org/licenses/lgpl-3.0.txt import sys,struct,zlib,os from optparse import OptionParser DEFAULT_DEVICE="0x0483:0xdf11" def named(tuple,names): return dict(zip(names.split(),tuple)) def consume(fmt,data,na...
feilongfl/micropython
tools/dfu.py
Python
mit
4,586
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
xclxxl414/rqalpha
rqalpha/data/instrument_mixin.py
Python
apache-2.0
2,988
from tethys_sdk.testing import TethysTestCase import tethys_portal.routing as routing class TestRoutings(TethysTestCase): def set_up(self): pass def tear_down(self): pass def test_routings(self): application = routing.application self.assertIn('websocket', application.a...
CI-WATER/tethys
tests/unit_tests/test_tethys_portal/test_routing.py
Python
bsd-2-clause
403
# Copyright (c) 2018 Cisco and/or its affiliates. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
Jorge-Rodriguez/ansible
test/units/modules/network/ftd/test_ftd_configuration.py
Python
gpl-3.0
5,145
""" Module with network code """ import warnings import numpy as np import random import json import os import collections import configobj import shelve import net.utilities warnings.filterwarnings('error') class NetHyperparameters: """ A very simple structure bundling together net hyperparameters """ ...
PuchatekwSzortach/printed_characters_net
net/network.py
Python
mit
10,309
# Copyright 2014 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 sys import traceback from telemetry import value as value_module class FailureValue(value_module.Value): def __init__(self, page, exc_info, desc...
guorendong/iridium-browser-ubuntu
tools/telemetry/telemetry/value/failure.py
Python
bsd-3-clause
2,727
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import fields, models class MrpBomDetailHistory(models.Model): _name = 'mrp.bom.detail.history' _description = 'Mrp Bom Detail History' product_master_id = fields.Many2one(...
Gebesa-Dev/Addons-gebesa
mrp_bom_detail_history/models/mrp_bom_detail_history.py
Python
agpl-3.0
1,232
from django.contrib import admin from core.homepage_elements.featured import models admin_list = [ (models.FeaturedArticle, ), ] [admin.site.register(*t) for t in admin_list]
BirkbeckCTP/janeway
src/core/homepage_elements/featured/admin.py
Python
agpl-3.0
182
# Copyright 2013 - 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
pravisankar/solum
solum/tests/api/v1/test_extension.py
Python
apache-2.0
6,938
# Copyright 2011 Greplin, Inc. All Rights Reserved. """Defines Twisted Web resources for "thread" reporting.""" from greplin.defer import thread import cgi import urllib from twisted.web import resource class ThreadsResource(resource.Resource): """Twisted web resource for a status page.""" isLeaf = True ...
Cue/greplin-twisted-utils
src/greplin/defer/threadbrowser.py
Python
apache-2.0
1,437
def get_lang(data): # maps data cleaner # function # Geocode(location) # bad arrays are bad and ireadble for x in data: if def get_long(data):
vickydasta/flask-gis
maps/cleaner.py
Python
mit
173
from rename_strip_encoder import * s = SomeWidget() a = AnotherWidget() a.DoSomething()
DGA-MI-SSI/YaCo
deps/swig-3.0.7/Examples/test-suite/python/rename_strip_encoder_runme.py
Python
gpl-3.0
89
#!/usr/bin/env python #----------------------------------------------------------------------- # Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribut...
google/refr
src/reranker/pyutil.py
Python
bsd-3-clause
4,331
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import sys import os import platform try: from setuptools import setup, find_packages, Command except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Command from distutils.command...
frac/celerymon
setup.py
Python
bsd-3-clause
3,953
#!/usr/bin/python ############################################## ###Python template ###Author: Elizabeth Lee ###Date: 8/25/14 ###Function: scatter plot zOR metrics vs. trivalent vaccine match and vaccine efficacy at national level ###Import data: Py_export/SDI_national_classifications.csv, SQL_export/subtype5.csv ##...
eclee25/flu-SDI-exploratory-age
scripts/create_fluseverity_figs/Supp_zOR_vax.py
Python
mit
3,293
# Copyright 2017 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...
eadgarchen/tensorflow
tensorflow/python/grappler/model_analyzer.py
Python
apache-2.0
1,476
# Copyright (c) 2010 Resolver Systems Ltd. # All Rights Reserved # from functionaltest import FunctionalTest class Test_2595_Throbber(FunctionalTest): def test_spinner_appears_during_recalcs(self): # * Harold likes to know when dirigible is working hard on his calculations # * He ...
jmptrader/dirigible-spreadsheet
dirigible/fts/tests/test_2595_Spinner.py
Python
mit
1,149
import os import math import filetool ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org # # License: # LGPL: http://www.gnu.org/licenses/...
technosaurus/samba4-GPL2
webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/graph.py
Python
gpl-2.0
2,177
import unittest import pytest from auslib.global_state import dbo from auslib.web.public.base import app @pytest.mark.usefixtures("current_db_schema") class UnicodeTest(unittest.TestCase): def setUp(self): dbo.setDb("sqlite:///:memory:") self.metadata.create_all(dbo.engine) self.client =...
testbhearsum/balrog
tests/web/test_unicode.py
Python
mpl-2.0
878
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models, _ class CouponReward(models.Model): _inherit = 'coupon.reward' _description = "Coupon Reward" reward_type = fields.Selection(selection_add=[('free_shipping', 'Free Shipping...
jeremiahyan/odoo
addons/sale_coupon_delivery/models/sale_coupon_reward.py
Python
gpl-3.0
697
"""Tests for the WLED sensor platform.""" from datetime import datetime from unittest.mock import patch import pytest from homeassistant.components.sensor import ( DEVICE_CLASS_CURRENT, DEVICE_CLASS_SIGNAL_STRENGTH, DEVICE_CLASS_TIMESTAMP, DOMAIN as SENSOR_DOMAIN, ) from homeassistant.components.wled....
kennedyshead/home-assistant
tests/components/wled/test_sensor.py
Python
apache-2.0
6,432
"""computes Hadamard matrices. A Hadamard matrix is a square matrix whose entries are either +1 or −1 and whose rows are mutually orthogonal.The Hadamard matrix is used to derive the BRR replicate weights. It is conjectured that a Hadamard matrix exist for all n divisible by 4. However, the *hadarmard(n)* functions f...
survey-methods/samplics
src/samplics/utils/hadamard.py
Python
mit
6,813
# Copyright (c) 2017-2018 {Flair Inc.} WESLEY PENG # # 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 agre...
WesleyPeng/uiXautomation
src/main/python/taf/foundation/plugins/web/selenium/browser.py
Python
apache-2.0
5,046
""" Pelican BibTeX ============== A Pelican plugin that populates the context with a list of formatted citations, loaded from a BibTeX file at a configurable path. The use case for now is to generate a ``Publications'' page for academic websites. """ # Author: Vlad Niculae <vlad@vene.ro> # Unlicense (see UNLICENSE fo...
trovao/pelican-bibtex
pelican_bibtex.py
Python
unlicense
3,337
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Cartman0/roboto
scripts/glyph_area_pen.py
Python
apache-2.0
2,360
#!/usr/bin/env python """Script to generate certificate and key file.""" from OpenSSL import crypto from socket import gethostname import argparse def generate_cert_and_key(cert_name, key_name): pub_key = crypto.PKey() pub_key.generate_key(crypto.TYPE_RSA, 1024) cert = crypto.X509() # Self-signed ...
MSFTOSSMgmt/WPSDSCLinux
Providers/nxOMSAutomationWorker/automationworker/scripts/certgenerator.py
Python
mit
1,556