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 kubernetes.config.config_exception import ConfigException # noqa: F401 from kubernetes.config.incluster_config import load_incluster_config # noqa: F401 from kubernetes.config.kube_config import list_kube_config_contexts, load_kube_config # noqa: F401 from .kube_config import new_client_from_config # noqa: F40...
chouseknecht/openshift-restclient-python
openshift/config/__init__.py
Python
apache-2.0
322
# Copyright (c) 2020 PaddlePaddle 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 appli...
luotao1/Paddle
python/paddle/fluid/dygraph/io.py
Python
apache-2.0
56,803
import re import SourceModel.SM_CaseStmt import SourceModel.SM_Class import SourceModel.SM_Constants as SMCONSTS import SourceModel.SM_Define import SourceModel.SM_Define import SourceModel.SM_Element import SourceModel.SM_Exec import SourceModel.SM_FileResource import SourceModel.SM_IfStmt import SourceModel.SM_Inclu...
tushartushar/Puppeteer
SourceModel/SM_File.py
Python
apache-2.0
17,577
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand from gaeforms.ndb.form import ModelForm from gaegraph.business_base import UpdateNode from categoria.model import Categoria class CategoriaForm(ModelForm): _model_class = Ca...
iwilliam317/tekton
backend/apps/categoria/validation.py
Python
mit
382
from __future__ import division import numpy as np from numpy.testing import run_module_suite from scipy.sparse import csr_matrix from sklearn.utils.testing import (assert_array_equal, assert_almost_equal, assert_false, assert_raises, assert_equal, ...
Titan-C/scikit-learn
sklearn/feature_selection/tests/test_mutual_info.py
Python
bsd-3-clause
6,881
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # api-feiras-livres documentation build configuration file, created by # sphinx-quickstart on Tue Mar 28 03:04:19 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in...
samukasmk/api-feiras-livres
docs/conf.py
Python
apache-2.0
5,943
# -*- test-case-name: txweb2.dav.test.test_copy,twext.web2.dav.test.test_move -*- ## # Copyright (c) 2005-2017 Apple Inc. All rights reserved. # # 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 Softwar...
macosforge/ccs-calendarserver
txweb2/dav/method/copymove.py
Python
apache-2.0
9,316
n = abs(int(input())) k = 0 b = 17 while n != 0: if n % 17 == 16: k += 1 n //= 17 print(k)
Senbjorn/mipt_lab_2016
contest_222/digits.py
Python
gpl-3.0
95
import os from .conf import init_conf class Local(object): def __init__(self, conf='toraconf'): self._conf = conf @property def conf(self): try: from flask import current_app return current_app.config except: if isinstance(self._conf, str): ...
Answeror/torabot
torabot/ut/local.py
Python
mit
724
""" Custom Sphinx documentation module to link to parts of the OAuth2 draft. """ from docutils import nodes base_url = "http://tools.ietf.org/html/rfc6749" def rfclink(name, rawtext, text, lineno, inliner, options={}, content=[]): """Link to the OAuth2 draft. Returns 2 part tuple containing list of nodes to ...
frasern/ADL_LRS
oauth2_provider/provider/sphinx.py
Python
apache-2.0
1,097
import sys import unittest from sure import expect from social.utils import sanitize_redirect, user_is_authenticated, \ user_is_active, slugify, build_absolute_uri PY3 = sys.version_info[0] == 3 class SanitizeRedirectTest(unittest.TestCase): def test_none_redirect(self): expec...
nvbn/python-social-auth
social/tests/test_utils.py
Python
bsd-3-clause
3,895
""" Class for reading data from Neuralynx files. This IO supports NCS, NEV and NSE file formats. Depends on: numpy Supported: Read Author: Julia Sprenger, Carlos Canova """ from neo.io.basefromrawio import BaseFromRaw from neo.rawio.neuralynxrawio.neuralynxrawio import NeuralynxRawIO class NeuralynxIO(NeuralynxRa...
samuelgarcia/python-neo
neo/io/neuralynxio.py
Python
bsd-3-clause
2,096
# 各組分別在各自的 .py 程式中建立應用程式 (第1步/總共3步) from flask import Blueprint, render_template # 利用 Blueprint建立 ag1, 並且 url 前綴為 /ag1, 並設定 template 存放目錄 scrum5_task40323208 = Blueprint('scrum5_task40323208', __name__, url_prefix='/bg4', template_folder='templates') # scrum1_task1 為完整可以單獨執行的繪圖程式 @scrum5_task40323208.route('/scrum5_G...
2015fallhw/cdw2
users/s2b/g4/40323208/scrum5_task40323208.py
Python
agpl-3.0
5,630
import pkg_resources import unittest def with_requires(*requirements): """Run a test case only when given requirements are satisfied. .. admonition:: Example This test case runs only when `numpy>=1.10` is installed. >>> from chainer import testing ... class Test(unittest.TestCase): ...
AlpacaDB/chainer
chainer/testing/helper.py
Python
mit
829
import asyncio from rx import Observable from counter_rxt import frame, unframe, Router, CounterItem class FramedTransport(object): def __init__(self, transport): self.transport = transport def write(self, data): self.transport.write(frame(data).encode()) class CounterServerProtocol(asyncio....
rxtender/rxt-backend-base
example/counter/server.py
Python
mit
1,808
from __future__ import unicode_literals from django.test import TestCase from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import Group, AnonymousUser from django.db import models from guardian.compat import get_user_model from guardian.testapp.tests.conf import skipUnlessTestA...
benkonrath/django-guardian
guardian/testapp/tests/test_utils.py
Python
bsd-2-clause
4,406
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # CherryMusic - a standalone music server # Copyright (c) 2012 - 2016 Tom Wallroth & Tilman Boerner # # Project page: # http://fomori.org/cherrymusic/ # Sources on github: # http://github.com/devsnd/cherrymusic/ # # CherryMusic is based on # jPlayer (GPL/MIT licens...
MartijnRas/cherrymusic
cherrymusicserver/__init__.py
Python
gpl-3.0
22,205
""" sentry.web.frontend.teams ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from django.core.context_processors import csrf from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from ...
simmetria/sentry
src/sentry/web/frontend/teams.py
Python
bsd-3-clause
11,432
# Copyright (C) 2010 Simon Wessing # TU Dortmund University # # 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 # (at your option) any later v...
GrimRanger/GeneticAlgorithm
helps/deap/deap-master/deap/tools/indicator.py
Python
mit
3,372
from __future__ import division, print_function, absolute_import __all__ = ['fixed_quad','quadrature','romberg','trapz','simps','romb', 'cumtrapz','newton_cotes'] from scipy.special.orthogonal import p_roots from scipy.special import gammaln from numpy import sum, ones, add, diff, isinf, isscalar, \ a...
kmspriyatham/symath
scipy/scipy/integrate/quadrature.py
Python
apache-2.0
26,794
description = "check len() on cows" filedata = """ {$ locals { x : [ 1, 2, 3], y : [], z : [ "bar", "jam", "jiggles", "wiggle" ], d : { a : 1, b : 2, c: 3 } } print (len (x), " ", len (y), " ", len (z), " ", len (d)); $} """ outcome = "3 0 4 3"
OkCupid/okws
test/regtest/cases/73.py
Python
gpl-2.0
291
#!/usr/bin/env python3 import unittest, inspect, os from fn_helper import compare_output, strarray_setup class TestJump(unittest.TestCase): @unittest.skipIf('TRAVIS' in os.environ, "FIXME: figure out why this doesn't work in travis") def test_skip(self): # See that we can jump wi...
rocky/python3-trepan
test/functional/test-jump.py
Python
gpl-3.0
1,126
{ 'name': 'Send Notifications By Emails', 'version': '1.0', 'category': 'notifications', 'depends': ['mail','sale','marketplace','auth_signup'], 'author': 'Genpex for Valeureux', 'website': 'https://www.wezer.org/', 'description': """ Features.... ====================================== * 1 *...
Valeureux/wezer-exchange
__unreviewed__/community_send_notification/__openerp__.py
Python
agpl-3.0
452
import os import glob def getFnames(dir, dtype="apr", minimumsize=7000.): # def getFnames(dir, type="apr", minimumsize=7000.): fnames = [] # os.chdir("../data/ChungCheonDC/") os.chdir("../data/IdongDC/") # print glob.glob("*.apr") for file in glob.glob("*.apr"): if os.path.getsize(file) > ...
sgkang/DamGeophysics
codes/Readfiles.py
Python
mit
414
from version import VERSION import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'matroid')) setup( name='matroid', version=VERSION, description='Matroid API Python Library', author='...
matroid/matroid-python
setup.py
Python
mit
504
import unicodecsv from django.http import HttpResponse def export_as_csv_action(description="Export selected objects as CSV file", fields=None, exclude=None, header=True): """ This function returns an export csv action 'fields' and 'exclude' work like in django ModelForm 'heade...
GrayAreaorg/InnovateSF-Map
repsf/map/actions.py
Python
gpl-3.0
1,320
# -*- coding: utf-8 -*- from __future__ import print_function import collections import json import os import pytest import curlrc EXAMPLE_CONFIG = '''# output timing data -s -S -o = /dev/null -w = "url_effective: %{url_effective}\ntime_namelookup: %{time_namelookup}\ntime_connect: %{time_connect}\ntime_appconnec...
benwebber/curlrc
test_curlrc.py
Python
mit
4,035
# # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in th...
mysql/mysql-utilities
mysql-test/suite/replication/t/binlog_purge_rpl.py
Python
gpl-2.0
10,386
from django.contrib.comments.models import Comment from regressiontests.comment_tests.models import Author, Article from regressiontests.comment_tests.tests import CommentTestCase class CommentModelTests(CommentTestCase): def testSave(self): for c in self.createSomeComments(): self.failIfEqual...
Smarsh/django
tests/regressiontests/comment_tests/tests/model_tests.py
Python
bsd-3-clause
1,920
import vrep import numpy import time import sys import matplotlib.pyplot as plt hello = numpy.genfromtxt('hello.csv',delimiter=',',skip_header=3,usecols = (1, 2, 3),dtype=numpy.float) object_name = 'feltPen_invisible' # object_name = 'Sphere' plt.figure() plt.plot(-hello[300:,0],-hello[300:,1]) plt.show() hello =...
ricardodeazambuja/BaxterHello_V-REP
v-rep_python/hello_writer.py
Python
cc0-1.0
2,546
"""0MQ polling related functions and classes.""" # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import zmq from zmq.backend import zmq_poll from .constants import POLLIN, POLLOUT, POLLERR #----------------------------------------------------------------------------- # Po...
dash-dash/pyzmq
zmq/sugar/poll.py
Python
bsd-3-clause
5,324
from ledstripcontroller import LedStripController from encoder import Encoder def main(): enc = Encoder(pin_clk=13, pin_dt=12, pin_mode=Pin.PULL_UP, min_val=40, max_val=1020, clicks=1, accel=5) enc._value = 1020 controller = LedStripController(enc) controller.run() if __name__ == ...
HowManyOliversAreThere/led_strip
main.py
Python
mit
343
import os import platform import unittest import sys import time try: from tests_pydevd_python import debugger_unittest except: sys.path.append(os.path.dirname(os.path.dirname(__file__))) IS_CPYTHON = platform.python_implementation() == 'CPython' IS_PY36 = sys.version_info[0] == 3 and sys.version_info[1] == ...
goodwinnk/intellij-community
python/helpers/pydev/tests_pydevd_python/test_frame_eval_and_tracing.py
Python
apache-2.0
8,663
from .InfoJobs import InfoJobs
diego-bernardes/PyTIJobs
sites/__init__.py
Python
gpl-3.0
31
# encoding: 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 'Entry' db.create_table('blog_entry', ( ('id', self.gf('django.db.models.fields...
vikingco/django-blog
blog/migrations/0001_initial.py
Python
bsd-3-clause
6,353
# -*- coding: utf-8 -*- # parts of pygchem (Python interface for GEOS-Chem Chemistry Transport Model) # # Copyright (C) 2013-2014 Christoph Keller, Benoît Bovy # see license.txt for more details # """ Read / Write Harvard-NASA Emissions Component (HEMCO) settings files. """ import re import itertools from types imp...
benbovy/PyGChem
pygchem/io/hemco.py
Python
gpl-3.0
22,916
class Solution(object): def countPrimes(self, n): """ :type n: int :rtype: int """ """ A naive way to solve the problem is to judge every number from the range[m,n] isprime, isprime can be optimal take n^(1/2) so the total is n^(1.5). ...
Tanych/CodeTracking
204-Count-Primes/solution.py
Python
mit
751
"""Stores configuration in the database.""" import logging from typing import Sequence from plumeria.core.storage import migrations from plumeria.transport import Server from plumeria.core.scoped_config.manager import ScopedConfigProvider, ScopedValue logger = logging.getLogger(__name__) class DatabaseConfig(Scope...
sk89q/Plumeria
plumeria/core/scoped_config/storage.py
Python
mit
2,133
#!/usr/bin/env python ''' test_frontier.py - fairly narrow tests of frontier management, requires rethinkdb running on localhost Copyright (C) 2017-2018 Internet Archive 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 co...
internetarchive/brozzler
tests/test_frontier.py
Python
apache-2.0
39,298
# Example of working with non-blocking "wrapper" sockers, SSL sockets in this # case. Working with complex wrapper sockets involves handling of special # uio.WANT_READ return from .write(), and uio.WANT_WRITE from .read(). This # is in addition to handling None special return from both of these. # For comparison, in CP...
pfalcon/micropython
examples/network/http_client_ssl_nonblock.py
Python
mit
2,463
# # -*- coding: utf-8 -*- # gui_skeleton.py # Author: d10n # No copyright # Public domain from __future__ import unicode_literals import wx from i18n import _ class MainFrameBase(wx.Frame): def __init__(self, parent): wx.Frame.__init__( self, parent, title=_('SOS PiP ...
d10n/sos-pip-tool
sos_pip_tool/gui_skeleton.py
Python
unlicense
5,091
import sys from PyQt5.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog from PyQt5.QtGui import QIcon class App(QWidget): def __init__(self): super().__init__() self.title = 'PyQt5 file dialogs - pythonspot.com' self.left = 10 self.top = 10 ...
steinnymir/RegAscope2017
test_scripts/GUI_test/PyQt5 Examples/filedialogs.py
Python
mit
1,770
import contextlib import mmap import os import unittest import aiy.vision.proto.protocol_pb2 as pb2 from aiy.vision._spicomm import SPICOMM_DEV from aiy.vision._spicomm import SPICOMM_IOCTL_TRANSACT from aiy.vision._spicomm import SPICOMM_IOCTL_TRANSACT_MMAP from aiy.vision._spicomm import AsyncSpicomm from aiy.visi...
google/aiyprojects-raspbian
src/tests/spicomm_test.py
Python
apache-2.0
6,254
''' Description: This is the 3DS file parser, it produces a 3ds file object with the File3Ds.open method Status: Nearly complete, some bone data missing License: AGPLv3, see LICENSE for more details Copyright: 2011 Florian Boesch <pyalot@gmail.com> Helpful Links: http://en.wikipedia....
pyalot/parse-3d-files
3ds/parse.py
Python
agpl-3.0
7,134
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
diogocs1/comps
web/addons/claim_from_delivery/__openerp__.py
Python
apache-2.0
1,576
#from stock_scraper.spiders.SpotValueSpider import SpotValueSpider #from stock_scraper.spiders.StockOptionSpider import StockOptionSpider
puchchi/stock_scraper_latest
scraper/spiders/__init__.py
Python
mit
137
# # 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 # "License"); you may not...
nathanielvarona/airflow
tests/providers/google/cloud/hooks/test_dlp.py
Python
apache-2.0
49,765
#!/usr/bin/python """tests for panel button function :author: `Patrick Kanzler <patrick.kanzler@fablab.fau.de>`_ :organization: `python-escpos <https://github.com/python-escpos>`_ :copyright: Copyright (c) 2016 `python-escpos <https://github.com/python-escpos>`_ :license: MIT """ from __future__ import absolute_impor...
belono/python-escpos
test/test_function_panel_button.py
Python
mit
917
# Eloipool - Python Bitcoin pool server # Copyright (C) 2011-2013 Luke Dashjr <luke-jr+eloipool@utopios.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # L...
darrenturn90/eloipool-merged-vtc
stratumserver.py
Python
agpl-3.0
8,661
# codicefiscale.py - library for Italian fiscal code # # This file is based on code from pycodicefiscale, a Python library for # working with Italian fiscal code numbers officially known as Italy's # Codice Fiscale. # https://github.com/baxeico/pycodicefiscale # # Copyright (C) 2009-2013 Emanuele Rocca # Copyright (C) ...
dchoruzy/python-stdnum
stdnum/it/codicefiscale.py
Python
lgpl-2.1
5,301
# -*- coding: utf-8 -*- # © 2016 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)nses/agpl). from odoo.tests.common import TransactionCase from dateutil.rrule import MONTHLY class DateRangeGeneratorTest(TransactionCase): def setUp(self): super(DateRangeGen...
thinkopensolutions/server-tools
date_range/tests/test_date_range_generator.py
Python
agpl-3.0
1,203
# -*- coding: utf-8 -*- # 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/. import pygame from UserList import UserList from collections import namedtuple Point = name...
yensa/Nalfein
utils.py
Python
mpl-2.0
1,199
# Copyright 2020 The TensorFlow Probability 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 applicable law o...
tensorflow/probability
spinoffs/oryx/oryx/core/interpreters/inverse/__init__.py
Python
apache-2.0
973
# Copyright (c) 2013 Hitachi Data Systems, Inc. # Copyright (c) 2013 OpenStack LLC. # 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.apac...
inkerra/cinder
cinder/tests/test_hds.py
Python
apache-2.0
11,056
from __future__ import print_function import sys import numpy as np import numba.unittest_support as unittest from numba.compiler import compile_isolated, Flags from numba import jit, types from .support import TestCase, MemoryLeakMixin, tag from numba import testing enable_pyobj_flags = Flags() enable_pyobj_flags.s...
stefanseefeld/numba
numba/tests/test_generators.py
Python
bsd-2-clause
15,547
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-10 04:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coffee', '0002_auto_20170310_0429'), ] operations = [ migrations.AlterField...
greg-ruane/coffee-catalog
src/coffee/migrations/0003_auto_20170310_0431.py
Python
mit
803
def can_build(env, platform): return True def configure(env): pass
NateWardawg/godot
modules/webp/config.py
Python
mit
76
from datetime import time from http.client import OK, BAD_REQUEST from io import BytesIO from unittest.mock import patch from django.contrib.auth import authenticate from django.core.urlresolvers import reverse from django.test import TestCase import xlwt from email_user.tests.factories import EmailUserFactory from s...
theirc/ServiceInfo
services/tests/test_import.py
Python
bsd-3-clause
33,398
from toee import * from utilities import * from Co8 import * from familiar_protos import familiar_table # modularize for KotB def OnBeginSpellCast( spell ): print "Summon Familiar OnBeginSpellCast" print("Removing caster from target list") spell.target_list.remove_target(spell.caster) # added because OnBeginRoun...
GrognardsFromHell/TemplePlus
tpdatasrc/co8infra/scr/Spell760 - Summon Familiar.py
Python
mit
11,171
#!/usr/bin/env python # # Copyright 2011 The Closure Linter 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 #...
ghostx2013/FabricEngine_Backup
Native/ThirdParty/Private/Python/closure_linter/javascriptlintrules.py
Python
agpl-3.0
19,602
# -*- coding: utf-8 -*- from django.conf.urls import url from app_administrativo.candidato.views import * urlpatterns = [ url(r'^$', CandidatoListView.as_view(), name=u'candidato_home'), url(r'^cadastar/$', CandidatoFormView.as_view(), na...
dparaujo/projeto
app_administrativo/candidato/urls.py
Python
gpl-3.0
688
from chat import application, init_db from gevent import monkey from socketio.server import SocketIOServer monkey.patch_all() init_db() if __name__ == '__main__': SocketIOServer( ('', application.config['PORT']), application, resource="socket.io").serve_forever()
yakudzam/promuatest
runserver.py
Python
apache-2.0
295
# Copyright 2008 Alex Collins # # This file is part of Pyela. # # Pyela 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. # # Pyela is ...
atc-/pyela
pyela/el/logic/__init__.py
Python
gpl-3.0
710
# # ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2020 # Copyright by UWA (in the framework of the ICRAR) # All rights reserved # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser G...
steve-ord/daliuge
daliuge-engine/dlg/runtime/tool_commands.py
Python
lgpl-2.1
1,948
import pymongo import configparser def db(): config = configparser.RawConfigParser() config.read('./.config') host = config.get('tumblr', 'host') port = config.get('tumblr', 'port') user = config.get('tumblr', 'user') passwd = config.get('tumblr', 'passwd') client = pymongo.MongoClient(hos...
blacksky0000/tools
tumblr/dbconnect.py
Python
mit
463
import os def listdir(path, data): for f in os.listdir(path): if path != ".": full = path + "/" + f else: full = f if os.path.isdir(full): listdir(full, data) else: ext = os.path.splitext(f)[1] if ext n...
unitpoint/oxygine-objectscript
examples/HelloWorld/data/pack.py
Python
mit
579
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run Performance Test Bisect Tool This script is used by a try bot to run the bisect script with the parameters specified in the...
heke123/chromium-crosswalk
tools/run-bisect-perf-regression.py
Python
bsd-3-clause
31,904
#!/usr/bin/python import os import commands import termios import sys def enable_echo(fd, enabled): (iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr (fd) if enabled: lflag |= termios.ECHO else: lflag &= ~termios.ECHO new_attr = [iflag, oflag, cflag, lflag, ispeed, o...
ASPLes/turbulence
tools/tbc-ctl/tbc-setup-mod-radmin.py
Python
lgpl-2.1
4,910
from Tools.Profile import profile from Tools.BoundFunction import boundFunction # workaround for required config entry dependencies. import Screens.MovieSelection from Screen import Screen from Screens.MessageBox import MessageBox profile("LOAD:enigma") import enigma profile("LOAD:InfoBarGenerics") from Screens.Inf...
postla/e2-gui
lib/python/Screens/InfoBar.py
Python
gpl-2.0
16,344
#!/usr/bin/python3 import random from itertools import chain, repeat cards = { 'green': 0, 'white': 0, 'blue': 0, 'red': 0, 'gold': 0, 'colorless': 0 } def set_cards(): for color in cards: prompt_string = '# of {} cards: '.format(color.capitalize()) prompts = chain([promp...
LudwigTirazona/mtg-booster-maker
booster-maker.py
Python
gpl-2.0
1,728
from pydomainr import PyDomainr dom = PyDomainr("naumanahmad.com") for i in dom.taken_domains(): print i
davidhax0r/PyDomainr
tests.py
Python
mit
109
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-05-14 21:19 from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('logger', '0004_tidy_progress_range'), ] operations = [ ...
DXCanas/kolibri
kolibri/core/logger/migrations/0005_auto_20180514_1419.py
Python
mit
638
#!/usr/bin/python -Wall # ================================================================ # John Kerl # kerl.john.r@gmail.com # 2005-11-07 # # This is a Python library for simple I/O and arithmetic on vectors # and matrices of floating-point numbers. # # Why not use packages such as Numpy? Sometimes, I prefer to hav...
johnkerl/scripts-math
pythonlib/sackmat_m.py
Python
bsd-2-clause
56,032
import codecs from copy import deepcopy import csv import imp import os import profile import re import sys import time from pymongo import Connection from django.template.defaultfilters import slugify PARSER_PATH = os.path.abspath(os.path.dirname(__file__)) settings = imp.load_source('app_settings', os.path.join(PA...
hampelm/Michigan-School-Data
parser/parser.py
Python
bsd-3-clause
33,174
"""Provides managed registration services on behalf of :func:`.listen` arguments. By "managed registration", we mean that event listening functions and other objects can be added to various collections in such a way that their membership in all those collections can be revoked at once, based on an equivalent :class:`....
alex/sqlalchemy
lib/sqlalchemy/event/registry.py
Python
mit
6,907
import json from urllib import urlencode from twisted.web import http from twisted.trial import unittest from twisted.internet.defer import inlineCallbacks from diamondash import utils from diamondash.tests.utils import MockHttpServer class UtilsTestCase(unittest.TestCase): def test_isint(self): """ ...
praekelt/diamondash
diamondash/tests/test_utils.py
Python
bsd-3-clause
9,903
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Run the BOLD reference+mask workflow""" import os def get_parser(): """Build parser object.""" from argparse import ArgumentParser from argparse import RawTextHelpFormatter, RawDescriptionH...
poldracklab/niworkflows
niworkflows/cli/boldref.py
Python
bsd-3-clause
2,183
# -*- coding: utf8 -*- from lib.constants import ALL_CURRENCIES from tower import ugettext_lazy as _lazy # From page 10 of the Mozilla Exporter API docs v1.0.0 # # BDT not in docs, but added in for bug 1043481. BANGO_CURRENCIES = ['AUD', 'BDT', 'CAD', 'CHF', 'COP', 'DKK', 'EGP', 'EUR', 'GBP', 'IDR...
ngokevin/zamboni
mkt/constants/bango.py
Python
bsd-3-clause
9,752
import sublime, sublime_plugin class MytestCommand(sublime_plugin.TextCommand): def run(self, edit): # self.view.insert(edit, 0, "Hello, World! ") self.view.run_command("show_panel", {"panel": "console"}) # "toggle": 0}) # print self.view.file_name(), "is now the active view" class SublimeOnSave(sublime_plugin...
Dancore/SubTrigger
SubTrigger.py
Python
gpl-3.0
2,599
# 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 # "License"); you may not u...
apache/incubator-airflow
airflow/api_connexion/endpoints/task_endpoint.py
Python
apache-2.0
2,401
import mock from .... import base from pulp.server.db.migrate.models import MigrationModule from pulp.server import managers from pulp.server.db.model.event import EventListener class TestMigration0002(base.PulpServerTests): @mock.patch('pulp.server.db.model.event.EventListener.get_collection') def test_upda...
credativ/pulp
server/test/unit/server/db/migrations/test_0002_rename_http_notifier.py
Python
gpl-2.0
1,448
import time import rlp import trie import db import utils import processblock import transactions import logging import copy import sys from repoze.lru import lru_cache # logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger() INITIAL_DIFFICULTY = 2 ** 17 GENESIS_PREVHASH = '\00' * 32 GENESIS_COINBASE =...
jnnk/pyethereum
pyethereum/blocks.py
Python
mit
32,057
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.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 3 of the License, or # (at your option) any later vers...
gigitux/lollypop
src/pop_tunein.py
Python
gpl-3.0
8,812
#!/usr/bin/env python import curses import random import os from samplebase import SampleBase from threading import Thread, Lock from golbase import GameOfLifeBase, Cell COLUMNS = 'qwertyuiopasdfgh' class KeyboardInput(GameOfLifeBase): def __init__(self, *args, **kwargs): super(KeyboardInput, self).__ini...
yanigisawa/coffee-scale
pubsub/animation/gol-keyboard.py
Python
mit
5,570
# This file is part of the ISIS IBEX application. # Copyright (C) 2012-2016 Science & Technology Facilities Council. # All rights reserved. # # This program is distributed in the hope that it will be useful. # This program and the accompanying materials are made available under the # terms of the Eclipse Public License...
ISISComputingGroup/EPICS-inst_servers
BlockServer/core/on_the_fly_pv_interface.py
Python
bsd-3-clause
2,822
from datamodel import Library, Version, Status, VersionCache, CollectionReference, Dependency from google.appengine.ext import ndb from test_base import TestBase class VersionCacheTests(TestBase): def test_versions_for_key(self): library_key = ndb.Key(Library, 'a/b') Version(id='v2.0.0', sha='x', status=St...
webcomponents/webcomponents.org
src/datamodel_test.py
Python
apache-2.0
5,078
# 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...
openstack/neutron-lib
neutron_lib/tests/unit/api/definitions/test_port.py
Python
apache-2.0
793
from itertools import product class Factor (object): """ Clase Factor para distribuciones de probabilidad conjuntas que implementa las operaciones Multiplicación, Reducción, Normalización y Marginalización. """ def __init__ (self, variables, probabilidades): """ Crea un nuevo factor con la lista de variables...
Gilberto-Lopez/Inteligencia-Artificial
Practica08/Factor.py
Python
lgpl-3.0
2,616
# 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
aquadem/run_aquadqn.py
Python
apache-2.0
4,277
__version__="1.5.7.2"
darvin/qtdjango
src/qtdjango/__init__.py
Python
gpl-2.0
22
from devassistant import argument from devassistant import assistant_base from devassistant import settings from devassistant import yaml_assistant_loader class ExecutableAssistant(assistant_base.AssistantBase): aliases = [] args = [argument.Argument('deps_only', settings.DEPS_ON...
oskopek/devassistant
devassistant/bin.py
Python
gpl-2.0
2,407
# -*- coding:utf-8 -*- # !/usr/bin/env python # # Author: promisejohn # Email: promise.john@gmail.com # # Manage.py实现应用管理工具 # from flask.ext.script import Manager, Shell from flask.ext.migrate import Migrate, MigrateCommand # Run python scripts/manage.py cmd import sys sys.path.append('.') from prony import app, db ...
promisejohn/storeback
scripts/manage.py
Python
apache-2.0
907
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Partially based on AboutMessagePassing in the Ruby Koans # from runner.koan import * class AboutAttributeAccess(Koan): class TypicalObject(object): pass def test_calling_undefined_functions_normally_results_in_errors(self): typical = self.T...
exu/poligon
python/python_koans/python2/koans/about_attribute_access.py
Python
mit
7,261
# This is the configuration file for your powerline-shell prompt # Every time you make a change to this file, run install.py to apply changes # # For instructions on how to use the powerline-shell.py script, see the README # Add, remove or rearrange these segments to customize what you see on the shell # prompt. Any s...
theno/fabsetup
fabsetup/fabfile-data/files/home/USERNAME/repos/powerline-shell/config.py
Python
mit
1,604
from daversy.utils import * from daversy.db.object import UniqueKey, UniqueKeyColumn class UniqueKeyColumnBuilder(object): """ Represents a builder for a column in a unique key. """ DbClass = UniqueKeyColumn XmlTag = 'constraint-column' Query = """ SELECT cols.column_name, c.constraint...
kalyptorisk/daversy
src/daversy/db/oracle/unique_key.py
Python
gpl-2.0
2,398
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json from frappe.model.document import Document from frappe.utils import getdate class EmployeeAttendanceTool(Doc...
StrellaGroup/erpnext
erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
Python
gpl-3.0
1,995
"""add password field Revision ID: 18ae56e5a0f Revises: 43e4e3402b9 Create Date: 2015-06-29 19:31:39.056586 """ # revision identifiers, used by Alembic. revision = '18ae56e5a0f' down_revision = '43e4e3402b9' from alembic import op import sqlalchemy as sa def upgrade(): with op.batch_alter_table('user') as bat...
karlorg/drunken-octo-avenger
migrations/versions/18ae56e5a0f_add_password_field.py
Python
cc0-1.0
540
#!/usr/bin/env python2 import os import socket from struct import pack from bithordetest import message, BithordeD, TestConnection class EncryptedConnection(TestConnection): def __init__(self, tgt): TestConnection.__init__(self, tgt) self.encryptor = None self.decryptor = None def f...
rawler/bithorde
tests/proto/encryption.py
Python
apache-2.0
4,148
# -*- coding: utf-8 -*- ## ## __init__.py ## Login : <freyes@wampa> ## Started on Sun Jul 5 13:44:11 2009 Felipe Reyes ## $Id$ ## ## Copyright (C) 2009 Felipe Reyes ## 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 Fr...
freyes/hawck
hawck/data/__init__.py
Python
gpl-3.0
813
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from time import sleep from django.contrib.auth.models import User from django.core.cache import cache from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from online_sta...
hovel/django-online-status
online_status/tests.py
Python
unlicense
5,346