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
../../../../../../../share/pyshared/orca/scripts/toolkits/WebKitGtk/script_utilities.py
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/dist-packages/orca/scripts/toolkits/WebKitGtk/script_utilities.py
Python
gpl-3.0
87
from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured def runchecks(include_extended=False): """ Iterates through a tuple of systems checks, then returns a dictionary containing the check name as the key, and a dict containing a statu...
jolyonb/edx-platform
openedx/core/djangoapps/heartbeat/runchecks.py
Python
agpl-3.0
1,359
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: test_config.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 _r...
luci/luci-py
appengine/components/components/config/test_config_pb2.py
Python
apache-2.0
1,863
# Copyright (c) 2011, 2012 Free Software Foundation # 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 # License, or (at your option) any later vers...
gnowledge/ncert_nroer
gstudio/plugins/cms_plugins.py
Python
agpl-3.0
7,879
# -*- coding: utf-8 -*- # ##### BEGIN GPL LICENSE BLOCK ##### # # 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 2 # of the License, or (at your option) any later version. # # ...
PLyczkowski/Sticky-Keymap
2.74/scripts/addons_contrib/cursor_control/history.py
Python
gpl-2.0
9,295
from lib20k.primitives import VERSION open("version.txt", "wt", encoding="utf-8").write( "VERSION={}.{}.{}\n".format(*VERSION))
20kly/20kly
pyinstaller/linux/version_setup.py
Python
gpl-2.0
135
# -*- coding: utf-8 -*- # # Tuxemon # Copyright (c) 2014-2017 William Edwards <shadowapex@gmail.com>, # Benjamin Bean <superman2k5@gmail.com> # # This file is part of Tuxemon # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
treetrunk/Tuxemon
tuxemon/core/components/event/conditions/npc_facing_tile.py
Python
gpl-3.0
3,443
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Administrator # # Created: 08/10/2011 # Copyright: (c) Administrator 2011 # Licence: <your licence> #--------------------------------------------------------------------...
hemmerling/codingdojo
src/game_of_life/python_coderetreat_socramob/cr_socramob09/gol01.py
Python
apache-2.0
1,168
import math, threading, time from . matrix import Matrix from .. util import deprecated if deprecated.allowed(): # pragma: no cover class POV(Matrix): def __init__(self, *args, **kwds): raise ValueError('layout.POV has been removed. Use animation.POV') LEDPOV = POV
rec/BiblioPixel
bibliopixel/layout/pov.py
Python
mit
297
# -*- coding: utf-8 -*- from __future__ import unicode_literals from tempfile import gettempdir from subprocess import check_output def test_free_songs(): '''Tries to download a list of free songs''' result = run_cmd('yt-songs get -v test_songs ' + gettempdir()) assert '3/3 songs downloaded successfully'...
MinikOlsen/yt-songs
test_yt-songs.py
Python
mit
467
# Capture the original matplotlib rcParams import matplotlib as mpl _orig_rc_params = mpl.rcParams.copy() # Import seaborn objects from .rcmod import * from .utils import * from .palettes import * from .linearmodels import * from .categorical import * from .distributions import * from .timeseries import * from .matrix...
JWarmenhoven/seaborn
seaborn/__init__.py
Python
bsd-3-clause
518
import multiprocessing from .FrameProtocol import Protocol from .DistantIOProtocol import distantio_protocol import logging import binascii class Worker(multiprocessing.Process): def __init__(self,input_queue,output_connection,new_data_condition,stop_condition): multiprocessing.Process.__init__(self) ...
Overdrivr/DistantIO
distantio/Worker.py
Python
mit
1,489
# -*- coding: utf-8 -*- # # Copyright © 2016 Mark Wolf # # This file is part of Xanespy. # # Xanespy 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 l...
canismarko/xanespy
xanespy/beamlines.py
Python
gpl-3.0
17,275
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from future import standard_library from pyload.requests.bucket import Bucket from pyload.requests.curl.download import CurlDownload from pyload.requests.curl.request import CurlRequest from pyload.utils.fs import lopen # nee...
pyblub/pyload
tests/misc/test_curldownload.py
Python
agpl-3.0
1,704
# Copyright (C) 2018 DataArt # # 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, ...
devicehive/devicehive-python
devicehive/__init__.py
Python
apache-2.0
1,077
import os import warnings import inspect import shutil import locale import types from copy import deepcopy import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.testing.compare import compare_images from plotnine import ggplot, theme TOLERANCE = 2 # Default tolerance for the tests DPI ...
has2k1/plotnine
plotnine/tests/conftest.py
Python
gpl-2.0
7,587
# Copyright (c) 2017 University Corporation for Atmospheric Research/Unidata. # Distributed under the terms of the MIT License. # SPDX-License-Identifier: MIT """Test Wyoming upper air dataset access.""" from datetime import datetime from numpy.testing import assert_almost_equal from siphon.simplewebservice.wyoming ...
dopplershift/siphon
siphon/tests/test_wyoming.py
Python
mit
1,925
from google.appengine.ext import db from google.appengine.ext.blobstore import blobstore import string import random import access import hashlib import time import datetime import exceptions class User(db.Model): confirmation_status = db.StringProperty() first_name = db.StringProperty() last_name...
nicodee/mestmentorplatform
models.py
Python
mit
33,885
# File generated from python blocks in "doc/quick-start.tex" >>> import sys >>> HOST = sys.argv[2] >>> PORT = int(sys.argv[3]) >>> import hyperdex.admin >>> a = hyperdex.admin.Admin(HOST, PORT) >>> a.add_space(''' ... space phonebook ... key username ... attributes first, last, int phone ... subspace first, last, phone...
hyc/HyperDex
test/doc.quick-start.py
Python
bsd-3-clause
3,110
from __future__ import unicode_literals from django.db import models from django.conf import settings from django.utils.encoding import python_2_unicode_compatible from viewflow.models import Process, Task class Carrier(models.Model): DEFAULT = 'Default' name = models.CharField(max_length=50) ...
codingjoe/viewflow
tests/examples/shipment/models.py
Python
agpl-3.0
2,867
#! /usr/bin/env python """ Module with frame parallactica angles calculations and de-rotation routines for ADI. """ __author__ = 'V. Christiaens @ UChile/ULg, Carlos Alberto Gomez Gonzalez' __all__ = ['compute_paral_angles', 'compute_derot_angles_pa', 'compute_derot_angles_cd', 'chec...
vortex-exoplanet/VIP
vip_hci/preproc/parangles.py
Python
mit
16,243
# -*- coding: utf-8 -*- from datetime import datetime import configs.signals as Signals import application.models as Models from application.models.order.logistic import gen_uid import application.services.jobs as Jobs from configs.enum import LOG_STATS, ORDER_TYPE from application.utils import groupby, to_utc class ...
seasonstar/bibi
application/services/logistic.py
Python
apache-2.0
4,141
"""This file contains functions that implement the following approaches to consistency-based belief change in a graph-oriented setting: 1. Global completion: ``eb.global_completion(G)`` 2. Simple iteration: ``eb.iterate_simple(G)`` 3. Expanding iteration: ``eb.iterate_expanding(G)`` 4. Augmenting iteration: ``eb.iter...
asteroidhouse/equibel
equibel/solver.py
Python
mit
42,474
import django try: from django.conf.urls import url, patterns except ImportError: from django.conf.urls.defaults import url, patterns from actstream import feeds urlpatterns = [ url(r'^custom/(?P<verb>[-\w\s]+)/$', feeds.CustomJSONActivityFeed.as_view(name='testbar'), name='testapp_custom_...
mikek2/actstream
actstream/runtests/testapp/urls.py
Python
bsd-3-clause
408
#!/usr/bin/env python import xmlrpclib import time import threading import random server = 'http://localhost:9911' def run(server, count, known_crackers): #print("Connecting to server {}".format(server)) s = xmlrpclib.ServerProxy(server) start_time = time.time() s.debug.test_bulk_insert(count, known_c...
sergey-dryabzhinsky/denyhosts_sync
tests/fill_database.py
Python
agpl-3.0
1,675
""" Evaluation metrics for quality of outputs of generative models. """ from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from sklearn.dummy import DummyClassifier from sklearn.svm import SVC, LinearSVC from sklearn...
iaroslav-ai/noxer
noxer/gm/metrics.py
Python
mit
5,869
"""Test the iRobot Roomba config flow.""" from unittest.mock import MagicMock, PropertyMock, patch import pytest from roombapy import RoombaConnectionError, RoombaInfo from homeassistant import config_entries, data_entry_flow, setup from homeassistant.components.dhcp import HOSTNAME, IP_ADDRESS, MAC_ADDRESS from home...
kennedyshead/home-assistant
tests/components/roomba/test_config_flow.py
Python
apache-2.0
33,845
#/!usr/bin/python3 from ..handlers.phraselist import PhraseList; LIST = [ "BQADBAADaAYAAocbZAciIWq9C74SAgI", "BQADBAAD3TgAAu8cZAcqlrGqOSV22wI", "BQADBAADiyAAAlgXZAezKLZ9MT_SrAI", "BQADBAADdgMAAuAYZAdM22FCusLMPQI", "BQADBAADsB4AAtUYZAd4L46CbUw5TQI", "BQADBAADliEAAlgdZAf_QoDpHJTeXwI", "BQADBAADwCAAAnUdZAciR8DiCEN5CQI",...
grcanosa/my-telegram-bot
src/mybot/data/catgifs.py
Python
gpl-3.0
958
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.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, either version 3 of...
Sodki/ansible
lib/ansible/modules/source_control/git.py
Python
gpl-3.0
42,171
# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import copy from portage.cache import template class database(template.database): autocommits = True serialize_eclasses = False def __init__(self, *args, **config): config.pop("gid", None) super(databas...
fastinetserver/portage-idfetch
pym/portage/cache/volatile.py
Python
gpl-2.0
644
#!/usr/bin/env python ''' Builds synthetic feature file that includes all core, provider, and application features, so that we can pre-stage all bundles required to run ONOS off-line. ''' import os import xml.etree.ElementTree as ET FEATURE_TAG = '{http://karaf.apache.org/xmlns/features/v1.2.0}feature' STAGED_REP...
planoAccess/clonedONOS
tools/package/karaf-assembly/onos-assembly.py
Python
apache-2.0
2,879
# -*- coding: utf-8 -*- import pytest from tests.utils import Rule, CorrectedCommand from thefuck import corrector, const from thefuck.system import Path from thefuck.types import Command from thefuck.corrector import get_corrected_commands, organize_commands class TestGetRules(object): @pytest.fixture def g...
SimenB/thefuck
tests/test_corrector.py
Python
mit
2,735
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Miscellaneous stuff for coverage.py.""" import errno import hashlib import inspect import locale import os import sys import types from coverage import env fro...
thundernet8/WRGameVideos-API
venv/lib/python2.7/site-packages/coverage/misc.py
Python
gpl-2.0
7,159
import asyncio import builtins from .base import NotFoundError, ParametersError class _MethodCall: __slots__ = ("_proto", "_timeout", "_names") def __init__(self, proto, timeout=None, names=()): self._proto = proto self._timeout = timeout self._names = names def __getattr__(sel...
aio-libs/aiozmq
aiozmq/rpc/util.py
Python
bsd-2-clause
1,374
#pylint: skip-file """dnstwister web app. This is the pattern from http://flask.pocoo.org/docs/0.11/patterns/packages/ which generates circular imports hence the comment at the top to just ignore this file. """ import flask import logging app = flask.Flask(__name__) # Logging app.logger.setLevel(logging...
thisismyrobot/dnstwister
dnstwister/__init__.py
Python
unlicense
763
__version__ = '1.0' __author__ = 'Outernet Inc <apps@outernet.is>' from .builder import *
Outernet-Project/sqlize-pg
sqlize_pg/__init__.py
Python
gpl-3.0
91
from __future__ import unicode_literals import logging import swapper from django.conf import settings from django.db import models from accelerator_abstract.models.accelerator_model import AcceleratorModel logger = logging.getLogger(__file__) NOT_AVAILABLE_MSG = ("You have indicated that you are not available for...
masschallenge/django-accelerator
accelerator_abstract/models/base_judge_round_commitment.py
Python
mit
1,258
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import _, api, exceptions, fields, models, modules from odoo.addons.base.models.res_users import is_selection_groups class Users(models.Model): """ Update of res.users class - add a preference abo...
ygol/odoo
addons/mail/models/res_users.py
Python
agpl-3.0
8,616
# encoding: utf-8 # Copyright (c) 2001-2021, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobilit...
CanalTP/navitia
source/navitiacommon/navitiacommon/constants.py
Python
agpl-3.0
1,530
# 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
""" Pyjamas UI BuilderWidget: takes a PyJsGlade builder spec and creates a widget. Copyright (C) 2010 Luke Kenneth Casson Leighton <lkcl@lkcl.net> Create a BuilderWidget as follows: from pyjamas.builder.Builder import Builder from pyjamas.ui.BuilderWidget import BuilderWidget either: class ApplicationEventRece...
minghuascode/pyj
library/pyjamas/ui/BuilderWidget.py
Python
apache-2.0
3,231
""" This script makes a dataset of two million approximately whitened patches, extracted at random uniformly from a downsampled version of the STL-10 unlabeled and train dataset. It assumes that you have already run make_downsampled_stl10.py, which downsamples the STL-10 images to 1/3 of their original resolution. Th...
TNick/pylearn2
pylearn2/scripts/datasets/make_stl10_patches_8x8.py
Python
bsd-3-clause
2,978
# Copyright 2019 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...
tensorflow/addons
tensorflow_addons/optimizers/moving_average.py
Python
apache-2.0
7,824
# 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. """Chromium presubmit script for src/ui/events See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit...
js0701/chromium-crosswalk
ui/events/PRESUBMIT.py
Python
bsd-3-clause
684
# Copyright 2018 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...
ppwwyyxx/tensorflow
tensorflow/python/distribute/mirrored_strategy_test.py
Python
apache-2.0
53,908
# (c) 2013, Jayson Vantuyl <jayson@aggressive.ly> # (c) 2012-17 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ name: sequence author: Jayson ...
nitzmahone/ansible
lib/ansible/plugins/lookup/sequence.py
Python
gpl-3.0
9,093
# # Copyright 2003-2006 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any lat...
translate/translate
translate/convert/po2csv.py
Python
gpl-2.0
3,950
# Copyright 2020 Alfredo de la Fuente - AvanzOSC # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). def pre_init_hook(cr): stored_partner_in_stock_move(cr) def stored_partner_in_stock_move(cr): cr.execute(""" UPDATE stock_move set partner_id = (SELECT stock_picking.part...
oihane/odoo-addons
stock_move_with_partner/init_hook.py
Python
agpl-3.0
536
#!/usr/bin/env python # testing.py # # TODO # have buttons for cvc selection rather than the scale. # Will do when rest is OK. # Libraries needed. from psychopy import visual, event, core, misc, data, gui, sound, log import datetime, string, sys, os, time # Participant needs to press y to continue or q t...
vivithemage/constraints
testing/fas-sif/testing-fas-sif-3.py
Python
gpl-2.0
15,257
# 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 field 'Label.color' db.add_column('lizard_waterbalance_label', 'color', self.gf('lizard_map.model...
lizardsystem/lizard-waterbalance
lizard_waterbalance/migrations/0003_auto__add_field_label_color__add_field_label_color_increment.py
Python
gpl-3.0
18,021
############################################################################### # Name: info.py # # Purpose: Global project information # # Author: Cody Precord <cprecord@editra.org> # ...
iut-ibk/P8-WSC-GUI
3dparty/Editra/src/info.py
Python
gpl-2.0
1,035
# -*- coding: utf-8 -*- """ *************************************************************************** i_evapo_mh.py ------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ********************************...
ghtmtt/QGIS
python/plugins/processing/algs/grass7/ext/i_evapo_mh.py
Python
gpl-2.0
1,610
#/usr/bin/env python3 import sys, os import pickle from pprint import pprint from subprocess import Popen, PIPE import string def answer_me(question): print(question+" [yes/no]") while True: answer = input('-->') if answer.lower() == "yes": return True elif answer.lower() ==...
danielhollas/AmaraUpload
utils.py
Python
mit
4,769
#!/usr/bin/env python # # molecular.py # Copyright (c) 2001, Chris Gonnerman # 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...
canvasnetworks/canvas
deploy/ec2/molecular.py
Python
bsd-3-clause
7,577
#!/usr/bin/env python from hal.main import main if __name__ == '__main__': main()
smarkets/hal
main.py
Python
mit
88
# -*- coding: utf-8 -*- from django.conf.urls import url, patterns, include from rest_framework.routers import DefaultRouter from coffeecups.views import TakeView, ThrowView, CupPolicyView router = DefaultRouter() router.register(r'takes', TakeView) router.register(r'throws', ThrowView) router.register(r'policies', C...
J1bz/ecoloscore
coffeecups/urls.py
Python
bsd-3-clause
406
# File: SchedulerServer.py ; This file is part of Twister. # version: 3.003 # Copyright (C) 2012-2014 , Luxoft # Authors: # Cristi Constantin <crconstantin@luxoft.com> # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
ctgriffiths/twister
services/Scheduler/SchedulerServer.py
Python
apache-2.0
19,189
import sys from rpython.rlib.rarithmetic import intmask, r_uint, LONG_BIT from rpython.rlib.objectmodel import we_are_translated from rpython.rlib import rmmap from rpython.rlib.debug import debug_start, debug_print, debug_stop from rpython.rlib.debug import have_debug_prints from rpython.rtyper.lltypesystem import llt...
oblique-labs/pyVM
rpython/jit/backend/llsupport/asmmemmgr.py
Python
mit
13,596
# Copyright 2015-2017, Damian Johnson and The Tor Project # See LICENSE for licensing information """ Information available about Tor from `its manual <https://www.torproject.org/docs/tor-manual.html.en>`_. This provides three methods of getting this information... * :func:`~stem.manual.Manual.from_cache` provides ma...
tparks5/tor-stem
stem/manual.py
Python
lgpl-3.0
20,582
import numpy as np from copy import deepcopy # note the assumption that location of the nucleosome is the first element in # the corresponding vector class layerOfNodes: # list of nodes in the layer nodes = [] def __init__(self, listNodes=None): '''(listNodes=None) Initialize node layer ...
ucrbioinfo/ThIEF
TrackGenerator/TrNM.py
Python
mit
12,080
from flask import Blueprint user = Blueprint('user', __name__, template_folder='templates') from . import views
cburmeister/flask-bones
app/user/__init__.py
Python
mit
114
# # 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...
spektom/incubator-airflow
tests/providers/google/marketing_platform/hooks/test_display_video.py
Python
apache-2.0
4,876
#!/opt/local/bin/python2.7 import os #import numpy import math from numpy import * from sys import * import sys import getopt ### --- Arguments --- ### program = "XYZ-to-ForceField.py" ifile = '' ofile = '' ### Read command line args try: myopts, args = getopt.getopt(sys.argv[1:],"i:o:h") except getopt.GetoptError:...
PHYC/Assign_Forcefield
XYZ-to-ForceField.py
Python
mit
14,964
# pyc2py - The smart python decompiler. # Copyright (C) 2012 Centre National de la Recherche Scientifique # # 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,...
YelaSeamless/pyc2py
inspection/classes.py
Python
gpl-3.0
1,904
"""Leetcode 48. Rotate Image Medium URL: https://leetcode.com/problems/rotate-image/ You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another ...
bowen0701/algorithms_data_structures
lc0048_rotate_image.py
Python
bsd-2-clause
1,807
from csrv.model import actions from csrv.model import events from csrv.model import modifiers from csrv.model.cards import card_info from csrv.model.cards import event class Card01036RunAction(actions.PlayEventAction): def __init__(self, game, player, card=None): actions.PlayEventAction.__init__(self, game, pl...
mrroach/CentralServer
csrv/model/cards/runner/card01036.py
Python
apache-2.0
1,190
from sys import exit from ccquiz.logic import Quiz def intro(): kind = input("What kind of quiz u want? Capitals, Countries, or Random? \n Q to quit, h for a hint (the answer)").lower().strip() if kind not in 'capitals countries random q': raise ValueError("not a valid quiz type") def structure...
elanorigby/EndlessCapitalsQuiz
ccquiz/cmdlineapp.py
Python
apache-2.0
1,217
import unittest import numpy as np import pyoptima as opt class SimulatedAnnealingTest(unittest.TestCase): def test_with_parabola(self): """ Test with a simple parabolic function with 2 variables """ def neighbour_func(params): new_params = params params['x0'] += np.rando...
samueljackson92/metaopt
python_tests/simulated_annealing_test.py
Python
mit
1,038
from __future__ import print_function import pyuv import signal import sys import os import optparse def fsevent_callback(fsevent_handle, filename, events, error): if error is not None: txt = 'error %s: %s' % (error, pyuv.errno.strerror(error)) else: evts = [] if events & pyuv.fs.UV_...
fivejjs/pyuv
examples/filesystem_watch.py
Python
mit
1,191
from math import log10 from src.resolve import BasicResolver class SimpleResolver(BasicResolver): def load_sources(self, group_id): cursor = self.conn.get_cursor(""" select runcatid, wm_ra, wm_ra_err, wm_decl, wm_decl_err from runningcatalog r where exists (select 1 from temp_associations ta ...
kernsuite-debian/lofar
CEP/GSM/bremen/src/resolveSimple.py
Python
gpl-3.0
2,541
# 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 https://mozilla.org/MPL/2.0/. from unittest.mock import Mock, patch from django.test import TestCase from django.test.client import RequestFactory f...
mozilla/bedrock
bedrock/base/tests/test_urlresolvers.py
Python
mpl-2.0
6,341
import logging import re import sys import emoji import markdown2 from slackviewer.user import User # Workaround for ASCII encoding error in Python 2.7 # See https://github.com/hfaran/slack-export-viewer/issues/81 if sys.version_info[0] == 2: reload(sys) sys.setdefaultencoding('utf8') class SlackFormatter(o...
hfaran/slack-export-viewer
slackviewer/formatter.py
Python
mit
5,541
# coding=utf-8 # Copyright 2022 TF.Text 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 or ag...
tensorflow/text
tensorflow_text/python/ops/sentence_breaking_ops.py
Python
apache-2.0
7,117
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
pmisik/buildbot
master/buildbot/test/unit/data/test_buildrequests.py
Python
gpl-2.0
25,460
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from . import Node from . import Edge from collections import deque class Graph: """ Main class which represent a Graph :param na...
hadim/pygraphml
pygraphml/graph.py
Python
bsd-3-clause
6,171
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, 'tslib.cp35-win32.pyd') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
stevenzhang18/Indeed-Flask
lib/pandas/tslib.py
Python
apache-2.0
293
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('drchronoAPI', '0003_doctor'), ] operations = [ migrations.AlterField( model_name='doctor', name='cel...
TimothyBest/Happy_Birthday_drchrono
happy_birthday_drchrono/drchronoAPI/migrations/0004_auto_20150820_1823.py
Python
mit
1,414
def len_(env, expr): if expr[0] != "string": raise Exception("len() can only be called for a string.") return ("number", len(expr[1]))
andybalaam/cell
pycell/prologue/native/len_.py
Python
mit
152
""" fg.py: fg stands for FunctionGraph Contains the FunctionGraph class and exception types that it can raise """ from __future__ import print_function import sys import time import traceback import theano from theano.gof import graph from theano.gof import utils from theano.gof import toolbox from theano import confi...
nke001/attention-lvcsr
libs/Theano/theano/gof/fg.py
Python
mit
32,569
#! /usr/bin/python ######################################################################## # Backend to dynamicly create and destroy virtual machines # Copyright (C) 2015 Carl J Smith # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
dude56987/TVD
tvd.py
Python
gpl-3.0
7,141
# Copyright 2009-2014 MongoDB, 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 writin...
cortext/crawtextV2
~/venvs/crawler/lib/python2.7/site-packages/pymongo/cursor_manager.py
Python
mit
2,846
import time import gevent import hashlib import six from six.moves import xrange from . import events from .exception import StopLocust from .log import console_logger STATS_NAME_WIDTH = 60 class RequestStatsAdditionError(Exception): pass class RequestStats(object): def __init__(self): self.entries...
cgoldberg/locust
locust/stats.py
Python
mit
18,833
# flake8: noqa from . import account, email_events, geoname, markdown, oauth, pwa, resource, sms_events
hasgeek/funnel
funnel/views/api/__init__.py
Python
agpl-3.0
105
# coding=utf-8 # Copyright 2022 The init2winit 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 la...
google/init2winit
hessian/test_run_lanczos.py
Python
apache-2.0
8,567
from numpy.testing import assert_allclose, assert_equal import numpy as np import unittest from qspectra import operator_tools class TestVibrationOperators(unittest.TestCase): def test(self): assert_allclose(operator_tools.vib_annihilate(3), [[0, 1, 0], [0, 0, np.sqrt(2)], [0, 0, ...
shoyer/qspectra
tests/test_operator_tools.py
Python
bsd-2-clause
6,434
#!/usr/bin/env python """ Convert a bit score to an e-value. Example usage: $ bit-score-to-evalue.py --dbSize 168142520 --dbSequenceCount 5660 \ --queryLength 111 --lengthAdjustment 26 --bitScore 37.3537 0.0813077725194 """ from __future__ import print_function import argparse from dark.blast.score import bitSc...
acorg/dark-matter
bin/bit-score-to-e-value.py
Python
mit
1,273
# coding: utf-8 # Copyright (c) 2009-2021 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. # Maintainer: joaander / All Developers are free to add commands for new # features from hoomd.md import _md import hoomd from hoomd.integrate ...
joaander/hoomd-blue
hoomd/minimize/fire.py
Python
bsd-3-clause
8,315
# 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...
xodus7/tensorflow
tensorflow/python/kernel_tests/init_ops_test.py
Python
apache-2.0
44,023
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 # # ...
tomasdubec/openstack-cinder
cinder/tests/api/contrib/test_volume_host_attribute.py
Python
apache-2.0
4,834
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps from django.core.exceptions import ObjectDoesNotExist from django.forms import widgets from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.utils.saf...
rfleschenberg/djangocms-cascade
cmsplugin_cascade/link/plugin_base.py
Python
mit
3,748
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
rajiteh/taiga-back
taiga/users/filters.py
Python
agpl-3.0
2,013
#coding:utf-8 class md5_str(object): def __init__(self,value):
51reboot/actual_09_homework
11/zhouyang/cmdb/user/md5_str.py
Python
mit
67
"""Client interfaces for local and backend (binary) data storage. Example ------- >>> import pybackend.storage as S >>> store = S.Storage(name='blah-blah-5678', project='my-project-3', backend=S.LOCAL, local_dir="tmp") >>> key = "my_song" >>> store.upload(b"never gonna give you up...", key) >>> p...
cosmir/open-mic
backend_server/pybackend/storage.py
Python
mit
4,555
#!/usr/bin/env python # # asn2wrs.py # ASN.1 to Wireshark dissector compiler # Copyright 2004 Tomas Kukosa # # 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 # ...
weizhenwei/wireshark
tools/asn2wrs.py
Python
gpl-2.0
307,726
# DATABASE db_name = '' db_user = '' db_host = '' db_password = ''; # WEBFACTION wf_login = '' wf_password = '' # SMTP smtp_server = '' smtp_login = '' smtp_password = ''
jmorel/Naphtaline
passwords.py
Python
mit
175
import numpy as np import datetime from datetime import timedelta import sys import os import pickle #debug_logs_directory = r'C:\PROJECTS\TEMP' # Based on QA Band - https://landsat.usgs.gov/collectionqualityband QA_BAND_NUM = 7 landsat_5_clear_pix_vals = [672, 676, 680, 684] #landsat_8_clear_pix_vals = [2720, 2724...
Esri/raster-functions
functions/Landsat_Image_Synthesis.py
Python
apache-2.0
6,422
# Copyright 2018 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 ...
openstack/python-tripleoclient
tripleoclient/v1/overcloud_bios.py
Python
apache-2.0
5,109
import unittest from unittest import mock from pathlib import Path from tempfile import TemporaryDirectory from contextlib import contextmanager from cumulusci.core.exceptions import TaskOptionsError from cumulusci.tasks.bulkdata.tests.utils import _make_task import yaml import pytest from sqlalchemy import create_en...
SalesforceFoundation/CumulusCI
cumulusci/tasks/bulkdata/tests/test_generate_from_snowfakery_task.py
Python
bsd-3-clause
10,700
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-08 04:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('confirmation', '0003_emailchangeconfirmation'), ] operations = [ migrations...
vabs22/zulip
confirmation/migrations/0004_remove_confirmationmanager.py
Python
apache-2.0
1,026
# Copyright (c) 2020 Cloudification GmbH. 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 r...
mahak/neutron
neutron/extensions/rbac_address_scope.py
Python
apache-2.0
898