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
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-14 17:57 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("election_snooper", "0002_auto_20170314_1754")] operations = [ migrations.AddField( ...
DemocracyClub/EveryElection
every_election/apps/election_snooper/migrations/0003_snoopedelection_extra.py
Python
bsd-3-clause
447
0
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import contextlib import errno import os import random import signal import socket import subprocess import sys import time import urllib2 try: xrange except NameError: xrange = range if __name__ == "__main__": tornado...
Lancher/tornado
maint/test/appengine/common/runtests.py
Python
apache-2.0
1,918
0
class CollectData(): """每小时数据收集类 利用微博高级搜索功能,按关键字搜集一定时间范围内的微博。 大体思路:构造URL,爬取网页,然后解析网页中的微博ID。后续利用微博API进行数据入库。本程序只负责收集微博的ID。 登陆新浪微博,进入高级搜索,输入关键字”空气污染“,选择”实时“,时间为”2013-07-02-2:2013-07-09-2“,地区为”北京“,之后发送请求会发现地址栏变为如下: http://s.weibo.com/wb/%25E7%25A9%25BA%25E6%25B0%2594%25E6%25B1%25A1%25E6%259F%2593&xsort=time&region=cu...
osDanielLee/SelfThinkingRobot
AchieveData/CollectData.py
Python
bsd-3-clause
8,610
0.038329
# -*- coding: utf-8 -*- """ Tests for WFS-T provider using QGIS Server through qgis_wrapped_server.py. This is an integration test for QGIS Desktop WFS-T provider and QGIS Server WFS-T that check if QGIS can talk to and uderstand itself. The test uses testdata/wfs_transactional/wfs_transactional.qgs and three initia...
gioman/QGIS
tests/src/python/test_qgsserver_wfst.py
Python
gpl-2.0
12,220
0.001227
import cProfile from pathlib import Path def main(args, results_dir: Path, scenario_dir: Path): try: scenario_dir.mkdir(parents=True) except FileExistsError: pass cProfile.runctx( 'from dmprsim.scenarios.python_profile import main;' 'main(args, results_dir, scenario_dir)', ...
reisub-de/dmpr-simulator
dmprsim/analyze/profile_core.py
Python
mit
432
0
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
Distrotech/scons
test/Entry.py
Python
mit
1,860
0.003226
from datetime import timedelta import operator from sys import getsizeof import warnings import numpy as np from pandas._libs import index as libindex, lib import pandas.compat as compat from pandas.compat import get_range_parameters, lrange, range from pandas.compat.numpy import function as nv from pandas.util._deco...
GuessWhoSamFoo/pandas
pandas/core/indexes/range.py
Python
bsd-3-clause
24,595
0
#!/usr/bin/env python import sys for _ in range(101): print "P\n." sys.stdout.flush()
ethercrow/ai-challenger
game-rps/paper.py
Python
mit
95
0.010526
#!/usr/bin/env python """xplot.py: This program uses matplotlib to plot xplot like data. Last modified: Thu Jul 23, 2015 04:54PM """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2013, NCBS Bangalore" __credits__ = ["NCBS Bangalore", "Bhalla Lab"] __license__ ...
BhallaLab/benchmarks
moose_nrn_equivalence_testing/comparision_with_simple_HH_model/xplot.py
Python
gpl-2.0
2,472
0.023463
from setuptools import setup import minify.command setup(name='cloaca', version='0.1.0', url='https://github.com/mhmurray/cloaca', author='Michael Murray', author_email='michaelhamburgmurray@gmail.com', license='MIT', packages=['cloaca'], zip_safe=False, ...
mhmurray/cloaca
setup.py
Python
mit
696
0.018678
# Copyright 2015 OpenStack Foundation. # # 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...
wolverineav/neutron
neutron/agent/metadata/config.py
Python
apache-2.0
5,135
0
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
google-research/google-research
representation_batch_rl/batch_rl/train_eval_online.py
Python
apache-2.0
9,735
0.006471
#!/usr/bin/env python def run(c, *channels): server = c['MainWindow'].ui_plugins['ServerList'].active_server connection = c['MainWindow'].ui_plugins['ServerList'].servers[server]['connection'] if isinstance(channels, str): channels = [channels] for channel in channels: if channel.start...
Sjc1000/PyRC
Commands/join.py
Python
gpl-2.0
505
0.00396
"""Tests for the preset and the history of queries.""" import json import os from qgis.core import QgsCoordinateReferenceSystem, QgsRectangle from qgis.testing import unittest from QuickOSM.core.utilities.json_encoder import as_enum from QuickOSM.core.utilities.query_saved import QueryManagement from QuickOSM.core.ut...
Gustry/QuickOSM
QuickOSM/test/test_saved_query.py
Python
gpl-2.0
17,258
0.002318
from JumpScale import j # import re import os # import jinja2 from watchdog.events import FileSystemEventHandler # The default Observer on Linux (InotifyObserver) hangs in the call to `observer.schedule` because the observer uses `threading.Lock`, which is # monkeypatched by `gevent`. To work around this, I use `Poll...
Jumpscale/jumpscale_portal8
lib/portal/docpreprocessor/DocHandler.py
Python
apache-2.0
2,305
0.004338
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
mganeva/mantid
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SingleCrystalDiffuseReduction.py
Python
gpl-3.0
21,263
0.007149
# -*- coding: utf-8 -*- from troubleshooting.framework.modules.manager import ManagerFactory from troubleshooting.framework.variable.variable import * from troubleshooting.framework.libraries.baseList import list2stringAndFormat from troubleshooting.framework.libraries.system import createDir from troubleshooting.frame...
gaoxiaofeng/troubleShooting
src/troubleshooting/framework/output/writehtml.py
Python
apache-2.0
9,570
0.009613
import unittest from nose2 import events, loader, session from nose2.plugins.loader import functions from nose2.tests._common import TestCase class TestFunctionLoader(TestCase): def setUp(self): self.session = session.Session() self.loader = loader.PluggableTestLoader(self.session) self.p...
ptthiem/nose2
nose2/tests/unit/test_functions_loader.py
Python
bsd-2-clause
1,464
0
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy as np setup( cmdclass = {'build_ext': build_ext}, ext_modules = [Extension("_orange", ["_orange.pyx"], include_dirs=[np.get_include()] )]...
PythonCharmers/orange3
Orange/src/setup.py
Python
gpl-3.0
324
0.018519
__author__ = 'wangp11' AA=1 l1 = [13, 13] n = 1 def print_l1(): print "id A.py: %d" % id(l1) print l1 def extend_l1(): l1.extend([1,31,31]) print l1 def print_n(): print n
peter-wangxu/python_play
test/A.py
Python
apache-2.0
195
0.035897
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), migrations.swappable_dependency(settings.AUTH_USER_...
lafactura/datea-api
datea_api/apps/follow/migrations/0001_initial.py
Python
agpl-3.0
1,483
0.004046
#!/usr/bin/env python # octavo-admin # An administrative script for our bookclub # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Sun Mar 30 20:26:20 2014 -0400 # # Copyright (C) 2014 Bengfort.com # For license information, see LICENSE.txt # # ID: octavo-admin.py [] benjamin@bengfort.com $ """ An a...
DistrictDataLabs/science-bookclub
bin/octavo-admin.py
Python
apache-2.0
1,356
0.004425
from rest_framework import ( serializers, viewsets, ) from rest_framework.decorators import api_view from rest_framework.response import Response from .models import Author, Book class BookSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Book fields = ( ...
rockymeza/django-local-requests
tests/views.py
Python
bsd-2-clause
1,217
0
from .. import Provider as CurrencyProvider class Provider(CurrencyProvider): # Format: (code, name) # See currency names in Russian: https://ru.wikipedia.org/wiki/Список_существующих_валют#Валюты currencies = ( ("AED", "Дирхам ОАЭ"), ("AFN", "Афгани"), ("ALL", "Лек"), ("AM...
danhuss/faker
faker/providers/currency/ru_RU/__init__.py
Python
mit
7,994
0.00017
import feedparser import time # Create display instance on default I2C address (0x70) and bus number. from Adafruit_LED_Backpack import AlphaNum4 display = AlphaNum4.AlphaNum4() # Initialize the display. Must be called once before using the display. display.begin() #create string(s) with rss address for multiple feed...
Epikarsios/RssLEDBackpack
RssLED.py
Python
gpl-3.0
1,628
0.032555
from coalib.bearlib.aspects.meta import issubaspect, assert_aspect class aspectlist(list): """ List-derived container to hold aspects. """ def __init__(self, seq=()): super().__init__(map(assert_aspect, seq)) def __contains__(self, aspect): for item in self: if issuba...
refeed/coala
coalib/bearlib/aspects/collections.py
Python
agpl-3.0
390
0
"""Pexpect is a Python module for spawning child applications and controlling them automatically. Pexpect can be used for automating interactive applications such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup scripts for duplicating software package installations on different servers. It can be u...
mikewesner-wf/glasshouse
appengine/lib/invoke/vendor/pexpect/__init__.py
Python
apache-2.0
78,307
0.004572
from rest_framework.routers import SimpleRouter from api.formattedmetadatarecords import views router = SimpleRouter() router.register(r'formattedmetadatarecords', views.FormattedMetadataRecordViewSet, basename='formattedmetadatarecord') urlpatterns = router.urls
CenterForOpenScience/SHARE
api/formattedmetadatarecords/urls.py
Python
apache-2.0
266
0.003759
import asyncio import datetime import importlib import logging import os import platform import signal import sys import time from typing import Any, Dict, List, Optional, Set, Union, cast import tomodachi.__version__ import tomodachi.container import tomodachi.importer import tomodachi.invoker from tomodachi.containe...
kalaspuff/tomodachi
tomodachi/launcher.py
Python
mit
12,014
0.002164
# a = 7 or a = 12 b = a b -= 1 d = a a = 0 # a += b*d c = b a += 1 c -= 1 while c != 0 d -= 1 while d !=0 b -= 1 c = b # c *= 2 d = c d -= 1 c += 1 while d != 0 tgl c c = -16 while b > 1 c = 1 # a += 95*95 c = 95 d = 95 a += 1 d -= 1 while d != 0 c -= 1 w...
tbjoern/adventofcode
Twentythree/reverse.py
Python
mit
331
0.096677
import itertools, os import pandas as pd, sys import numpy as np, matplotlib.pylab as plt Q = 1.0 ; T = 1.0 class Game: def __init__(self,df): self.df = df.copy() self.df_orig = self.df.copy() # dictionaries of df variables - used for speedy access self.df_capability = df.Capabili...
burakbayramli/classnotes
algs/algs_105_mesquita/test1.py
Python
gpl-3.0
7,691
0.021194
# -*- coding: utf-8 -*- ############################################################################### # # FunnelList # Gets the names and funnel_ids of your funnels. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
jordanemedlock/psychtruths
temboo/core/Library/Mixpanel/DataExport/Funnels/FunnelList.py
Python
apache-2.0
3,581
0.004468
from django.db.models import Count from django.http import HttpResponse from rest_framework.generics import ListAPIView from rest_framework.views import APIView from rest_framework.authentication import TokenAuthentication from prometheus_client import generate_latest from core import models from core import serializ...
telminov/ansible-manager
core/views/rest.py
Python
mit
2,316
0.003454
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( qualities, str_or_none, ) class ReverbNationIE(InfoExtractor): _VALID_URL = r'^https?://(?:www\.)?reverbnation\.com/.*?/song/(?P<id>\d+).*?$' _TESTS = [{ 'url': 'http://www.reverbnation.com/alkilad...
fluxw42/youtube-dl
youtube_dl/extractor/reverbnation.py
Python
unlicense
1,627
0.000615
#!C:\Users\SeanSaito\Dev\aviato\flask\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'kartograph.py==0.6.8','console_scripts','kartograph' __requires__ = 'kartograph.py==0.6.8' import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.exit( load_entry_point('kartograph.py==0.6.8...
hrishioa/Aviato
flask/Scripts/kartograph-script.py
Python
gpl-2.0
364
0.005495
#!/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of the VecNet Zika modeling interface. # For copyright and licensing information about this package, see the # NOTICE.txt and LICENSE.txt files in its top-level directory; they are # available at https://github.com/vecnet/zika # # This Source Code Form is...
ecaldwe1/zika
website/mixins.py
Python
mpl-2.0
1,140
0.000877
import subprocess from random import choice, randint from time import sleep import yaml from ooni.otime import timestamp import const class Test(object): def __init__(self, testfile, args=[]): self.testfile = testfile self.args = args self.output = None self.status = None ...
edagar/censorship-analyser
test.py
Python
bsd-3-clause
5,035
0.000199
import _plotly_utils.basevalidators class TickcolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="tickcolor", parent_name="parcats.line.colorbar", **kwargs ): super(TickcolorValidator, self).__init__( plotly_name=plotly_name, pa...
plotly/python-api
packages/python/plotly/plotly/validators/parcats/line/colorbar/_tickcolor.py
Python
mit
480
0.002083
#!/usr/bin/python # 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 version. # # Ansible is distributed...
thaim/ansible
lib/ansible/modules/cloud/amazon/lambda.py
Python
mit
23,103
0.002813
# -*- coding: utf-8 -*- ''' Django settings for foodcheck project ''' # Copyright (C) 2013 Timothy James Austen, Eileen Qiuhua Lin, # Richard Esplin <richard-oss@esplins.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Ge...
esplinr/foodcheck
wsgi/foodcheck_proj/settings.py
Python
agpl-3.0
8,249
0.003758
# $Id$ # # Copyright (C) 2001-2006 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ periodic table data...
jandom/rdkit
rdkit/Chem/PeriodicTable.py
Python
bsd-3-clause
5,870
0.018739
# Copyright 2017 Speech Lab, EE Dept., IITM (Author: Srinivas Venkattaramanujam) class Entry: def __init__(self, begin_time, end_time, status, word_begin, word_end): self.begin_time=float(begin_time) self.end_time=float(end_time) self.status=status self.word_begin=int(word_begin) self.word_end=int(word_end...
dreaming-dog/kaldi-long-audio-alignment
scripts/classes/entry.py
Python
apache-2.0
326
0.04908
# Copyright 2016 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...
waprin/gcloud-python
gcloud/logging/test_logger.py
Python
apache-2.0
25,904
0
# Generated by Django 2.2.4 on 2019-08-07 19:56 import awx.main.utils.polymorphic import awx.main.fields from django.db import migrations, models import django.db.models.deletion from awx.main.migrations._rbac import ( rebuild_role_parentage, rebuild_role_hierarchy, migrate_ujt_organization, migrate_ujt_organ...
GoogleCloudPlatform/sap-deployment-automation
third_party/github.com/ansible/awx/awx/main/migrations/0109_v370_job_template_organization_field.py
Python
apache-2.0
3,857
0.002074
""" Player The Player represents the game "account" and each login has only one Player object. A Player is what chats on default channels but has no other in-game-world existance. Rather the Player puppets Objects (such as Characters) in order to actually participate in the game world. Guest Guest players are simpl...
vlegoff/mud
typeclasses/players.py
Python
bsd-3-clause
4,163
0.001681
# Copyright 2021 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-research/plur
plur/stage_1/code2seq_dataset.py
Python
apache-2.0
16,900
0.006154
#!/usr/bin/env python3 import asyncio import pq class Countdown(pq.Ahsm): def __init__(self, count=3): super().__init__(Countdown.initial) self.count = count @pq.Hsm.state def initial(me, event): print("initial") me.te = pq.TimeEvent("TIME_TICK") return me.tran...
dwhall/pq
examples/countdown.py
Python
mit
1,269
0.002364
# -*- coding:utf-8 -*- # @author xupingmao # @since 2021/12/05 11:25:18 # @modified 2022/01/24 14:47:38 # @filename dbutil_sortedset.py """【待实现】有序集合,用于各种需要排名的场景,比如 - 最近编辑的笔记 - 访问次数最多的笔记 如果使用了LdbTable的索引功能,其实就不需要这个了 """ from xutils.dbutil_base import * from xutils.dbutil_hash import LdbHashTable register_table("_ran...
xupingmao/xnote
xutils/dbutil_sortedset.py
Python
gpl-3.0
3,154
0.013316
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'bar.ui' # # Created: Thu Aug 11 10:41:59 2011 # by: PyQt4 UI code generator 4.8.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeEr...
dparks1134/STAMP
stamp/plugins/samples/plots/configGUI/barUI.py
Python
gpl-3.0
9,975
0.00381
from src.module.deploy_utils import parse_war_path from commands import getoutput from log import LOG import utility def invoke(fingerengine, fingerprint, deployer): """ """ if fingerengine.service in ["jboss", "tomcat"]: return invoke_war(fingerengine, fingerprint) elif fingerengine.service...
breenmachine/clusterd
src/module/invoke_payload.py
Python
mit
3,120
0.003526
#!/usr/bin/env python import sys import os import threading import traceback import json import multiprocessing import subprocess import http import html import urllib import argparse from .aserver import AsyncCache, AsyncTCPServer, AsyncHTTPRequestHandler from ..fpbench import fpcparser from ..arithmetic import nat...
billzorn/fpunreal
titanfp/web/old_webdemo.py
Python
mit
14,240
0.00302
from . import shim tmpdir = None def setUp(): global tmpdir tmpdir = shim.setup_shim_for('kubectl') def tearDown(): global tmpdir shim.teardown_shim_dir(tmpdir)
SpectoLabs/myna
contrib/python-myna/myna/__init__.py
Python
apache-2.0
180
0.011111
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 from .doc import selfdoc # noqa: F401 from .elaborate import elaborate # noqa: F401 from .generate import generate # noqa: F401 from .generate_tb import generate_tb # n...
lowRISC/opentitan
util/tlgen/__init__.py
Python
apache-2.0
465
0
import boardgame as bg class Card(bg.GamePiece): pass
tcstewar/boardgame
boardgame/card.py
Python
gpl-2.0
59
0.016949
import pytest from linguee_api.const import LANGUAGE_CODE, LANGUAGES from linguee_api.linguee_client import LingueeClient from linguee_api.models import SearchResult @pytest.mark.asyncio async def test_linguee_client_should_redirect_on_not_found( linguee_client: LingueeClient, ): search_result = await lingue...
imankulov/linguee-api
tests/test_linguee_client.py
Python
mit
863
0
import discord from discord.ext import commands import time import datetime import pytz class GameTime(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def time(self, ctx): """Displays current game time.""" locationName = self.bo...
Eylesis/Botfriend
Cogs/GameTime.py
Python
mit
1,883
0.012746
#!/usr/bin/env python from setuptools import setup from setuptools.command.test import test as TestCommand import sys class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = ['--strict', '--verbose', '--tb=long', '-s', 'tests'] self.test_...
casbeebc/abenity-python
setup.py
Python
mit
1,394
0
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Nils Weiss <nils@we155.de> # This program is published under a GPLv2 license # scapy.contrib.description = Unified Diagnostic Service (UDS) # scapy.contrib.status = loads import struct import time from iterto...
4shadoww/usploit
lib/scapy/contrib/automotive/uds.py
Python
mit
44,266
0
""" Defines common types and type related utilities: Singleton, etc. These types can be shared by other utils modules and imported into util main namespace for use by other pymel modules """ import inspect, types, operator, sys, warnings class Singleton(type): """ Metaclass for Singleton classes. >>> cl...
CountZer0/PipelineConstructionSet
python/maya/site-packages/pymel-1.0.3/pymel/util/utilitytypes.py
Python
bsd-3-clause
43,474
0.006073
import optparse from math import sqrt, pi import numpy as np from ase.dft.kpoints import monkhorst_pack def str2dict(s, namespace={}, sep='='): """Convert comma-separated key=value string to dictionary. Examples: >>> str2dict('xc=PBE,nbands=200,parallel={band:4}') {'xc': 'PBE', 'nbands': 200, 'par...
alexei-matveev/ase-local
ase/tasks/calcfactory.py
Python
gpl-2.0
6,674
0.00015
import os import sys if os.environ.get("DJANGO_PRODUCTION_MODE"): from settings.cloud import * else: # When not using production mode try to load local.py try: from settings.local import * except ImportError: sys.stderr.write( "Couldn't import settings.local, have you creat...
thorgate/django-project-template
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/__init__.py
Python
isc
392
0.002551
import time import json import pytz from datetime import datetime, timedelta from django.utils import timezone from django.conf import settings from rest_framework import status from rest_framework.decorators import api_view, permission_classes from rest_framework.response import Response from rest_framework.permissi...
dspichkin/djangodashpanel
djangodashpanel/security/views.py
Python
gpl-3.0
9,113
0.002743
import smbl __RULES=set() def register_rule(rule): registered_rules=[r.encode() for r in get_registered_rules()] if rule.encode() not in registered_rules: __RULES.add(rule) def get_registered_rules(): return list(__RULES) class Rule: def __init__(self,input,output,run): self.__input=input self.__output=o...
karel-brinda/smbl
smbl/utils/rule.py
Python
mit
572
0.050699
import numpy as np from numpy.testing import assert_allclose from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score import pytest from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper from sklearn.ensemble._hist_gradient_...
kevin-intel/scikit-learn
sklearn/ensemble/_hist_gradient_boosting/tests/test_predictor.py
Python
bsd-3-clause
6,256
0
# 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...
hehongliang/tensorflow
tensorflow/python/kernel_tests/conv_ops_test.py
Python
apache-2.0
73,074
0.005351
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20141128_0831'), ] operations = [ migrations.AlterField( model_name='acl', name='us...
Virako/authapi
authapi/api/migrations/0004_auto_20141128_0914.py
Python
agpl-3.0
419
0
# Benchmarks for nibabel
ME-ICA/me-ica
meica.libs/nibabel/benchmarks/__init__.py
Python
lgpl-2.1
25
0
# ex:set ts=4 sw=4: <- for vim # # EPANET File Utility # Uses EPAENTOutputFile.py to read the EPANET output file into memory and # then displays the content in different ways. # # Dependencies: # - Python 2.6 or 2.7 (32- or 64-bit) # - wxPython 3.0.0 (32- or 64-bit to match installed version of Python) # - EPANETOutput...
WaterSums/EPANETFileUtility
EPANETFileUtility.py
Python
mit
16,145
0.006813
#Working with variables import pyaudiogame spk = pyaudiogame.speak MyApp = pyaudiogame.App("My Application") #Here are some variables #Lets first write one line of text my_name = "Frastlin" #now lets write a number my_age = 42 #now lets write several lines of text my_song = """ My application tis to be, the coolest ...
frastlin/PyAudioGame
examples/basic_tutorial/ex1.py
Python
mit
712
0.030899
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
rackerlabs/horizon
openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py
Python
apache-2.0
3,100
0.000645
""" File-based Checkpoints implementations. """ import os import shutil from tornado.web import HTTPError from .checkpoints import ( Checkpoints, GenericCheckpointsMixin, ) from .fileio import FileManagerMixin from IPython.utils import tz from IPython.utils.path import ensure_dir_exists from IPython.utils.py...
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/IPython/html/services/contents/filecheckpoints.py
Python
mit
6,954
0
import psycopg2 import unittest import sys class LDropTablesTest(unittest.TestCase): def setUp(self): conn = psycopg2.connect("dbname=teste user=postgres") conn.set_isolation_level(0) # set autocommit self.cur = conn.cursor() def tearDown(self): self.c...
UFCGProjects/sig
src/tests/DropTablesTest.py
Python
mit
1,528
0.003927
from rx.core import ObservableBase class AnonymousSubject(ObservableBase): def __init__(self, observer, observable): super(AnonymousSubject, self).__init__() self.observer = observer self.observable = observable def _subscribe_core(self, observer): return self.observable.subs...
Sprytile/Sprytile
rx/subjects/anonymoussubject.py
Python
mit
548
0
from datetime import datetime from django import forms from django.utils.translation import ugettext_lazy as _ from tendenci.apps.base.fields import SplitDateTimeField from tendenci.apps.payments.models import Payment, PaymentMethod PAYMENT_METHODS = PaymentMethod.objects.filter().values_list( 'machine_name', 'hum...
alirizakeles/tendenci
tendenci/apps/payments/forms.py
Python
gpl-3.0
2,831
0.000706
from __future__ import print_function __title__ = 'pif.utils' __author__ = 'Artur Barseghyan' __copyright__ = 'Copyright (c) 2013 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ('ensure_autodiscover', 'list_checkers', 'get_public_ip') from pif.base import registry from pif.discover import autodiscover ...
djabber/Dashboard
bottle/dash/local/lib/pif-0.7/src/pif/utils.py
Python
mit
1,686
0.002372
# Licensed under a 3-clause BSD style license - see LICENSE.rst # 1. standard library imports from numpy import nan from numpy import isnan from numpy import ndarray from collections import OrderedDict import warnings # 2. third party imports from astropy.table import Table, Column from astropy.io import ascii from ...
ceb8/astroquery
astroquery/jplhorizons/core.py
Python
bsd-3-clause
67,058
0.000224
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('aldryn_newsblog', '0004_auto_20150622_1606'), ] operations = [ migrations.AlterField( model_name='newsblogconfig...
Venturi/cms
env/lib/python2.7/site-packages/aldryn_newsblog/migrations/0005_auto_20150807_0207.py
Python
gpl-2.0
558
0.001792
#!/usr/bin/env python # Aid tools to quality checker. # Qchecklib # Eliane Araujo, 2016 import os import sys import commands import json try: from cc import measure_complexity except ImportError: print("tst quality checker needs cc.py to work.") sys.exit(1) try: sys.path.append('/usr/local/bin/radon...
elianearaujo/tst-qcheck
bin/qchecklib.py
Python
agpl-3.0
3,348
0.011947
import numpy as np from numpy import all from numpy.testing import assert_almost_equal from nose.tools import ok_ from ..blas import * def ndrange(shape, dtype=np.double, order='C'): return np.arange(np.prod(shape), dtype=dtype).reshape(shape).copy(order) def assert_dgemm(dgemm_func, A_order, B_order, C_order): ...
wavemoth/wavemoth
wavemoth/test/test_blas.py
Python
gpl-2.0
812
0.004926
""" WSGI config for cfg project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_...
vyscond/my-college-api
cfg/wsgi.py
Python
mit
546
0
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import supe...
amagdas/superdesk
server/apps/aap/import_text_archive/commands.py
Python
agpl-3.0
9,503
0.001789
import re import requests import logging logger = logging.getLogger(__name__) class JsUnPacker(object): """ It takes the javascript file's url which contains the port numbers for the encrypted strings. The file has to be unpacked to a readable form just like http://matthewfl.com/unPacker.html does. T...
pgaref/HTTP_Request_Randomizer
http_request_randomizer/requests/parsers/js/UnPacker.py
Python
mit
1,507
0.004645
#!/usr/bin/python3 import json import numpy as np import random class Payload(): ''' Instance contains altitude data for a balloon flight. Use alt() method to get interpolated data. ''' addr = None name = "Payload" time_index = 0.0 # index into the flight profile data, in seconds. tim...
liberza/bacon
simulator/payload.py
Python
mit
4,318
0.003475
from sklearn.datasets import load_iris from sklearn.cross_validation import StratifiedKFold, KFold iris = load_iris() X, y = iris.data, iris.target print(cross_val_score(LinearSVC(), X, y, cv=KFold(len(X), 3))) print(cross_val_score(LinearSVC(), X, y, cv=StratifiedKFold(y, 3)))
amueller/strata_singapore_2015
solutions/cross_validation_iris.py
Python
cc0-1.0
280
0
# Copyright 2014 Treode, 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 writing,...
Treode/store
client/python/tx_clock.py
Python
apache-2.0
2,394
0.003759
""" Django settings for the admin project. """ import os from urlparse import urlparse from website import settings as osf_settings from django.contrib import messages from api.base.settings import * # noqa # TODO ALL SETTINGS FROM API WILL BE IMPORTED AND WILL NEED TO BE OVERRRIDEN # TODO THIS IS A STEP TOWARD INTEG...
caseyrollins/osf.io
admin/base/settings/defaults.py
Python
apache-2.0
7,533
0.00146
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre.gui2.convert.azw3_output_ui import Ui_Form from calibre.gui2.convert i...
drxaero/calibre
src/calibre/gui2/convert/azw3_output.py
Python
gpl-3.0
978
0.00818
from django.shortcuts import render def home(request): return render(request, "core/home.html")
qubs/climate-data-api
core/views.py
Python
apache-2.0
102
0
#!/usr/bin/python # coding: utf8 """ Окно просмотра информации по объектам кода (константы, поля, записи, таблицы, списки) """ import sys from PyQt4 import QtGui class ObjectViewer (QtGui.QTableView): def __init__ (self, main_window): QtGui.QTableView.__init__ (self) main_window.object_viewer = self self.ma...
rimsleur/QSLime
debugger/ObjectViewer.py
Python
gpl-2.0
412
0.026239
import pygame def arrow_image(color): img = pygame.Surface((7, 6)) img.fill((226, 59, 252)) img.set_colorkey((226, 59, 252), pygame.RLEACCEL) pygame.draw.polygon(img, color, ((0, 0), (3, 3), (6, 0))) return img class Menu(object): def __init__(self, font, options): self.font = fon...
jmimu/pyNekketsu
retrogamelib/dialog.py
Python
gpl-3.0
4,110
0.007056
#!/usr/bin/env python # # barman - Backup and Recovery Manager for PostgreSQL # # Copyright (C) 2011-2015 2ndQuadrant Italia (Devise.IT S.r.l.) <info@2ndquadrant.it> # # 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...
terrorobe/barman
setup.py
Python
gpl-3.0
3,778
0.001853
# coding: utf-8 # # commands.py # Part of SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Ryan Hileman and Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter3 # License: MIT # """This module implements the Sublime Text commands provided by SublimeLinter.""" impor...
michael-ball/sublime-text
sublime-text-3/Packages/SublimeLinter/commands.py
Python
unlicense
39,327
0.001653
# -*- coding:utf-8 -*- # # Copyright (C) 2008 The Android Open Source Project # # 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 re...
couchbasedeps/git-repo
git_config.py
Python
apache-2.0
21,644
0.014692
class base(object): proc = dict pagesize = pow(2, 12) arch = None # and other host-specific attributes def __init__(self, **kwds): pass def __getitem__(self, processid): return self.proc[processid] def list(self): pass def create(self, executable, args, env=[]...
arizvisa/syringe
lib/mpdebug/default/host.py
Python
bsd-2-clause
491
0
import pytest from nex.reader import Reader, ReaderBuffer from common import (test_not_here_file_name, test_file_name, test_chars, test_2_chars) def test_buffer_init(): """Check buffer works sensibly.""" r = ReaderBuffer(test_chars) assert r.i == -1 assert r.chars == test_chars ...
eddiejessup/nex
tests/test_reader.py
Python
mit
3,129
0.00032
# -insar.py- coding: utf-8 -*- """ Created on Fri Sep 3 10:46:50 2010 @author: bosmanoglu InSAR module. Includes functions for analyzing SAR interferometry with python. """ from numpy import * from pylab import * from basic import * import scipy from scipy import ndimage #scipy.pkgload('ndimage') from scipy import ...
bosmanoglu/adore-doris
lib/python/insar/__init__.py
Python
gpl-2.0
25,698
0.033349
import warnings from .std import TqdmExperimentalWarning with warnings.catch_warnings(): warnings.simplefilter("ignore", category=TqdmExperimentalWarning) from .autonotebook import tqdm, trange __all__ = ["tqdm", "trange"]
drammock/mne-python
mne/externals/tqdm/_tqdm/auto.py
Python
bsd-3-clause
231
0
"""Selenium tests.""" from .conftest import assert_regex, wait_for, wait_for_true from selenium.common.exceptions import NoSuchElementException from um.exercises.factories import ExerciseFactory import pytest import time def test_florian_adds_a_new_exercise(browser, live_server): # Florian wants to add a new ...
FlowFX/unkenmathe.de
src/system_tests/test_adding_and_editing_exercises.py
Python
agpl-3.0
4,459
0.000673
# -*- encoding: utf-8 -*- """Test class for Roles UI""" from ddt import ddt from fauxfactory import gen_string from nailgun import entities from robottelo.decorators import data from robottelo.helpers import generate_strings_list, invalid_names_list from robottelo.test import UITestCase from robottelo.ui.factory impor...
abalakh/robottelo
tests/foreman/ui/test_role.py
Python
gpl-3.0
3,848
0
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: model.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflect...
transcranial/keras-js
python/model_pb2.py
Python
mit
6,998
0.003144