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 unittest import TestCase from unittest.mock import sentinel, patch import os from gnucashcategorizer.config import MatchPattern, Config class TestMatchPattern(TestCase): @classmethod def setUpClass(cls): cls.match_pattern = MatchPattern(pattern='CASH * FOO', account_name='foo') def test_is_m...
seddonym/gnucash-categorizer
tests/test_config.py
Python
bsd-2-clause
4,971
# # Functions for interacting with the leases table in the database # # Thierry Parmentelat -- INRIA # from datetime import datetime from PLC.Faults import * from PLC.Parameter import Parameter, Mixed from PLC.Filter import Filter from PLC.Table import Row, Table from PLC.Nodes import Node, Nodes from PLC.Slices impo...
dreibh/planetlab-lxc-plcapi
PLC/Leases.py
Python
bsd-3-clause
3,000
#!/usr/bin/env python import sys, logging, getpass, subprocess, os, json # List of Heroku App ids to update _heroku_app_ids = None _HEROKU_APP_IDS_ENV_KEY = "HEROKU_APP_IDS" def get_heroku_app_ids(): global _heroku_app_ids # Lazy load if _heroku_app_ids is None: env = os.environ.get(_HEROKU_APP_ID...
AdmitHub/heroku-auto-ssl
hooks/heroku-auto-ssl/hook.py
Python
mit
8,401
# Copyright (C) 2015 ZhiQiang Fan <aji.zqfan@gmail.com> # # 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 version. # # This progr...
zqfan/leetcode
algorithms/217. Contains Duplicate/solution.py
Python
gpl-3.0
939
from checktime_sqlte import checktime import unittest import urllib2 class test_checktime(unittest.TestCase): def test_basic(self): a=checktime(urllib2.urlopen) a.check('http://www.99114.com') a.get_time() def test_MOREERR(self): #HTTP404 test a=checktime(urllib2.urlopen) for i in range(1,20): url...
popexizhi/web-ana
checktime_test.py
Python
gpl-2.0
510
# 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/arrow
dev/archery/archery/lang/python.py
Python
apache-2.0
7,754
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) Copyright 2013 to 2017 University of Manchester # # HydraPlatform is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or...
hydraplatform/hydra-base
hydra_base/__init__.py
Python
lgpl-3.0
2,368
"""Bitcoin information service that uses blockchain.com.""" from __future__ import annotations from datetime import timedelta import logging from blockchain import exchangerates, statistics import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, SensorEntity, SensorEntityD...
lukas-hetzenecker/home-assistant
homeassistant/components/bitcoin/sensor.py
Python
apache-2.0
7,700
from functools import partial from itertools import groupby from couchdbkit import ResourceNotFound from corehq.apps.domain import SHARED_DOMAIN, UNKNOWN_DOMAIN from corehq.blobs import CODES from corehq.blobs.mixin import BlobHelper, BlobMetaRef from corehq.blobs.models import BlobMigrationState, BlobMeta from coreh...
dimagi/commcare-hq
corehq/blobs/migrate_metadata.py
Python
bsd-3-clause
10,498
#-*- coding: utf-8 -*- """ This package is an implementation of the OpenID specification in Python. It contains code for both server and consumer implementations. For information on implementing an OpenID consumer, see the C{L{openid.consumer.consumer}} module. For information on implementing an OpenID server, see t...
necaris/python3-openid
openid/__init__.py
Python
apache-2.0
1,372
''' ''' from rest_framework import serializers import models class PluginSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = models.Plugin fields = ('id', 'name', ) class ScoredServiceSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = models...
nuccdc/scoring_engine
scoring_engine/engine/serializers.py
Python
mit
1,320
#!/usr/bin/python3 import csv import os # import csv_sheet import base_sheet import canonical_sheet import named_column_sheet import qsutils class diff_sheet(base_sheet.base_sheet): """A sheet representing the timeline of differences between columns in two input sheets (or they could be the same sheet).""" ...
hillwithsmallfields/qs
financial/diff_sheet.py
Python
gpl-3.0
7,394
""" Test lldb process launch flags. """ from __future__ import print_function import os import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil import six class ProcessLaunchTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) ...
apple/swift-lldb
packages/Python/lldbsuite/test/commands/process/launch/TestProcessLaunch.py
Python
apache-2.0
7,144
""" WSGI config for vidascontadas 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...
VidasContadas/nomesevoces_viz
vidascontadas/wsgi.py
Python
gpl-2.0
403
import threading import tuna import unittest import zmq class ThreadedBus(threading.Thread): def __init__(self): super(self.__class__, self).__init__() self.zmq_bus_instance = tuna.zeromq.ZMQProxy() def close(self): self.zmq_bus_instance.close() def run(self): self.zmq_bus...
rcbrgs/tuna
tuna/test/unit/unit_zmq/unit_test_zmq_client.py
Python
gpl-3.0
1,019
import mt, os, mimetypes from time import strftime class HTTPOut(): class mtEntry(): def __init__(self): self.html = False self.css = False self.js = False self.data = "" self.target = "" def __init__(self, session = None): self.sessi...
andr3wmac/metaTower
packages/http/HTTPOut.py
Python
gpl-3.0
7,153
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging logger = logging.getLogger(__name__) from django.conf.urls import include, url, patterns from .views import TestView urlpatterns = patterns( '', url(r'^testview/(?P<arg1>\d+)/(?P<arg2>\d+)/', TestView.as_view(), name='tes...
celerityweb/django-jade-tools
testproject/local/urls.py
Python
gpl-3.0
332
from django.conf.urls import patterns, url from django.contrib.auth.decorators import login_required from promotions import views from promotions.forms import PromotionWizardDetailsPage, PromotionWizardLayoutPage from promotions.views import IndexView, PromotionList, PromotionWizard, FORMS urlpatterns = patterns...
fergalmoran/robotopro
promotions/urls.py
Python
apache-2.0
866
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-03-17 00:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('Client...
carnadaxxx/lotizados
src/Contratos/migrations/0001_initial.py
Python
apache-2.0
1,401
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2015 BigML # # 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 b...
ShaguptaS/python
bigml/tests/test_24_cluster_derived.py
Python
apache-2.0
4,749
# Copyright (c) 2010 by Cisco Systems, Inc. """ Default Print plugin. """ from instmakelib import instmake_log as LOG import sys import time description = "Print all fields in multi-line format." def PrintHeader(): pass def PrintFooter(): pass def Print(self, fh=sys.stdout, indent=0, vspace=1): spaces =...
gilramir/instmake
instmakeplugins/print_default.py
Python
bsd-3-clause
4,366
# Flexlay - A Generic 2D Game Editor # Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com> # # 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)...
SuperTux/flexlay
flexlay/input_event.py
Python
gpl-3.0
2,061
""" Summary measures for ergodic Markov chains. """ __author__ = "Sergio J. Rey <sjsrey@gmail.com>, Wei Kang <weikang9009@gmail.com>" __all__ = ["steady_state", "var_fmpt_ergodic", "fmpt"] import numpy as np import numpy.linalg as la import quantecon as qe from .util import fill_empty_diagonals def _steady_state_er...
weikang9009/giddy
giddy/ergodic.py
Python
bsd-3-clause
13,092
from django.test import TestCase from builds.models import Version from projects.models import Project class RedirectTests(TestCase): fixtures = ["eric", "test_data"] def setUp(self): self.client.login(username='eric', password='test') r = self.client.post( '/dashboard/import/', ...
ojii/readthedocs.org
readthedocs/rtd_tests/tests/test_redirects.py
Python
mit
3,374
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 ve...
jwoglom/ionbot
commands/dvorak.py
Python
gpl-2.0
2,481
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from pyzufall.version import __version__ from pyzufall.generator import adjektiv, band, bandart, baum, beilage, beruf_m, beruf_w, color, datum, essen, farbe, firma,...
davidak/PyZufall
demo.py
Python
gpl-3.0
1,801
from flask import Blueprint, render_template from flask_security import login_required front = Blueprint("front", __name__) @front.route("/") def index(): return render_template("front/index.html") @front.route("/secure") @login_required def admin(): return render_template("front/index.html")
AthelasPeru/laborapp
app/blueprints/front/views.py
Python
mit
301
import socket import threading import select import os import time os.chdir("/home/ilan/game_server") logFile = open("server.log", "a") #Fonction de communication def commute(): while True: try: senders, wlist, xlist = select.select(clients, [], []) except select.error: pass else: for sender in senders:...
trog-levrai/game_server
server.py
Python
gpl-3.0
1,586
from django.contrib import admin from polls.models import Poll, Choice # Register your models here. class ChoiceInline(admin.TabularInline): model = Choice extra = 3 class PollAdmin(admin.ModelAdmin): fieldsets = [(None, {'fields': ['question', 'author']}), ('Date informat...
dralley/pollsite
polls/admin.py
Python
mit
627
import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT6 @pytest.mark.skipif((PYSIDE6 or PYQT6), reason="not available with qt 6.0") def test_qtxmlpatterns(): """Test the qtpy.QtXmlPatterns namespace""" from qtpy import QtXmlPatterns assert QtXmlPatterns.QAbstractMessageHandler is not None assert QtXmlPa...
stonebig/winpython
winpython/_vendor/qtpy/tests/test_qtxmlpatterns.py
Python
mit
1,117
"""Interface to the model learning part of LibARTOS. Provides the ModelLearner class on the one hand, which can be used to learn WHO models based on image data from ImageNet, from file or from PIL.Image.Image objects. On the other hand, this module contains the ModelManager and Model classes, which can be used to ...
cmisenas/artos
PyARTOS/learning.py
Python
gpl-3.0
35,136
#Copyright 2012 EasyDevStdio , wes342 # #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, ...
wes342/EasyDevStudio
scripts/RomOther.py
Python
apache-2.0
18,124
class URLOpener(object): def __init__(self, x): self.x = x def urlopen(self): return file(self.x)
idea4bsd/idea4bsd
python/testData/refactoring/move/class/before/src/lib1.py
Python
apache-2.0
122
""" PyEmu Module Settings updated 16/09/2010 """ from pygame.locals import * from keys import N64Keys # GUI Settings LISTPOS = ((40,100),(600,340)) ENDINGS = (".zip",".smc",".rar",".rom") LOGO = "media/nintendo_snes_small.png" # Key Definitions JOYSTICK_ACTIONS = { N64Keys.A : "start_game" } KEYBOARD_ACTION...
merten/controlpanel
settings/pyemu.py
Python
gpl-3.0
412
# coding: utf-8 # # Copyright 2018 The Oppia 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 requi...
prasanna08/oppia
scripts/linters/pylint_extensions.py
Python
apache-2.0
78,064
""" seqdb contains a set of classes for interacting with sequence databases. Primary sequence database classes: - SequenceDB - base class for sequence databases - SequenceFileDB - file-based sequence database - PrefixUnionDict - container to combine multiple sequence databases - XMLRPCSequenceD...
theoryno3/pygr
pygr/seqdb.py
Python
bsd-3-clause
43,251
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. #Shoopdawoop from . import OBJReader from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("uranium") def getMetaData(): return { "mesh_reader": [ { "extension": "obj", ...
thopiekar/Uranium
plugins/FileHandlers/OBJReader/__init__.py
Python
lgpl-3.0
509
import os from subprocess import call annotation_file = '/Users/idriver/Downloads/Mus_musculus_UCSC_mm10/Mus_musculus/UCSC/mm10/Annotation/Archives/archive-2014-05-23-16-05-10/Genes/genes.gtf' result_file = '/Users/idriver/RockLab-files/test' for h, k, l in os.walk(result_file): g_cell_name = (h.split('/')[-1]) ...
idbedead/RNA-sequence-tools
Tophat_Cluster_submission/cuffquant_call.py
Python
mit
650
from ctypes import cdll lib = cdll.LoadLibrary("../target/release/libembed.so") lib.process() print("done!")
synasius/backyard
rust/embed/python/embed.py
Python
unlicense
112
# -*- coding: utf-8 -*- from south.db import db, engine from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Category.slug' db.alter_column('qa_category', 'slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=255...
sharifelguindi/qatrackplus
qatrack/qa/migrations/0003_auto__chg_field_category_slug__chg_field_category_name__chg_field_refe.py
Python
mit
23,983
# -*- coding: utf-8 -*- """Tests for the VGG19 architecture on the CIFAR-100 dataset.""" import os import sys import unittest import tensorflow as tf import numpy as np sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from deepobs.tensorflow import testproblems class...
fsschneider/DeepOBS
tests/testproblems/test_cifar100_vgg19.py
Python
mit
2,722
# -*- coding: utf-8 -*- # External imports import collections import json import numpy import os.path import pandas import re import sys # Internal imports (if any) SIMPLE_MECHANICS = {u'Charge', u'Stealth', u'Windfury', u'Taunt', u'Divine Shield'} CARD_COLUMNS = list(map(lambda x: x.lower(), SIMPLE_MECHANICS)) + [...
skasi7/HearthPricer
hearthpricer/hearthpricer.py
Python
mit
12,346
import copy import logging import json from collections import OrderedDict class World(object): def __init__(self, shuffle, logic, mode, difficulty, goal, algorithm, place_dungeon_items, check_beatable_only, shuffle_ganon, quickswap): self.shuffle = shuffle self.logic = logic self.mode = ...
LLCoolDave/ALttPEntranceRandomizer
BaseClasses.py
Python
mit
24,811
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017-2019 HASEBA Junya # # 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 # # Unle...
7pairs/kac6vote
setup.py
Python
apache-2.0
1,271
""" ============================ Brainstorm tutorial datasets ============================ Here we compute the evoked from raw for the Brainstorm tutorial dataset. For comparison, see: http://neuroimage.usc.edu/brainstorm/Tutorials/MedianNerveCtf References ---------- .. [1] Tadel F, Baillet S, Mosher JC, Pantazis D,...
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/mne-python-0.10/examples/datasets/plot_brainstorm_data.py
Python
bsd-3-clause
2,004
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/oval_5/sc/windows/EntityItemFileTypeType.py
Python
gpl-3.0
1,206
import random, shelve, os from decimal import Decimal from geraldo.utils import get_attr_value, calculate_size, memoize from geraldo.widgets import Widget, Label, SystemField from geraldo.graphics import Graphic, RoundRect, Rect, Line, Circle, Arc,\ Ellipse, Image from geraldo.barcodes import BarCode f...
olivierdalang/stdm
third_party/geraldo/generators/base.py
Python
gpl-2.0
39,695
from __future__ import unicode_literals import os import shutil from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage from django.test import TestCase from pipeline import glob local_path = lambda path: os.path.join(os.path.dirname(__file__), path) class GlobTest(T...
ei-grad/django-pipeline
tests/tests/test_glob.py
Python
mit
3,708
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from indico.core import signals from indico.core.db import db fro...
mic4ael/indico
indico/modules/events/registration/clone.py
Python
mit
6,771
# -*- coding: utf-8 -*- import logging import re try: import json except: import simplejson as json from hashlib import md5 from time import time from datetime import datetime,timedelta from urllib import urlencode from common import BaseHandler, authorized, safe_encode, cnnow, clear_cache_by_pathlist, quot...
Yong-Lee/liyong_sae_blog
admin.py
Python
mit
17,722
from __future__ import print_function import argparse import os import stat import sys # find the import for catkin's python package - either from source space or from an installed underlay if os.path.exists(os.path.join('/opt/ros/indigo/share/catkin/cmake', 'catkinConfig.cmake.in')): sys.path.insert(0, os.path.jo...
heiscsy/evolutus_ros_src
beginner_tutorials/catkin_generated/generate_cached_setup.py
Python
gpl-2.0
1,313
# Copyright 2011 OpenStack Foundation # 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 requ...
rajalokan/glance
glance/db/sqlalchemy/migrate_repo/versions/008_add_image_members_table.py
Python
apache-2.0
3,000
from __future__ import division, print_function, absolute_import from scipy.special import logit import numpy as np import itertools as itr import amitgroup as ag from pnet.layer import Layer from pnet.parts_layer import PartsLayer import pnet @Layer.register('random-forest-parts-layer') class RandomForestPartsLayer(...
amitgroup/parts-net
pnet/old_layers/random_forest_parts_layer.py
Python
bsd-3-clause
4,790
def analyze(data, weight_fn=None): """Returns the average and sample variance (s**2) of a list of floats. `weight_fn` is a function that takes a list index and a window width, and returns a weight that is used to calculate a weighted average. For example, see `default_weights` or `linear_weights` belo...
avih/treeherder
treeherder/perfalert/perfalert/__init__.py
Python
mpl-2.0
5,173
#!/usr/bin/env python import gobject, pygst pygst.require("0.10") import gst # Stream to: LOCAL_HOST = '192.168.1.2' LOCAL_PORT = 9000 pipeline = gst.Pipeline('server') tcpserversrc_audio = gst.element_factory_make('tcpserversrc', 'src0') tcpserversrc_audio.set_property('host', LOCAL_HOST) tcpserversrc_audio.set_pr...
i02sopop/Kirinki
gstreamer/server/rstr_server.py
Python
agpl-3.0
3,016
"""Base Command class, and related routines""" import os import socket import sys import traceback import time from pip import commands from pip.log import logger from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter from pip.download import urlopen from pip.exceptions import BadCommand...
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/site-packages/pip/basecommand.py
Python
mit
7,119
import datetime import matplotlib.pyplot as plot import numpy as np import os import scipy.ndimage as ndimage debug = False #def main(): ### load the initial variables temp = np.load('0_RES_432x400_temp.npy') temp = temp/12. ### factor 1/12 as in netlogo version precip = np.load('0_RES_432x400_precip.npy') elev = np...
jakobkolb/MayaSim
mayasim/Mayasim_original.py
Python
gpl-3.0
31,865
f = open('objDict') lines = f.readlines() f.close() dictionary = {} for line in lines: temp=line.strip() line=temp.split('\t') key = line[0] value = line[1] dictionary[key] = value f = open('list') lines = f.readlines() f.close() for line in lines: temp=line.strip() if temp in dictionary: print ...
ENCODE-DCC/WranglerScripts
Examples_for_assistants/associateGeneral.py
Python
mit
563
""" userSetup runs at startup *Author:* * Nicholas Silveira, Nicholas.Silveira@gmail.com, Jul 21, 2013 4:46:06 PM """ import os import sys import maya.cmds as cmds # @UnresolvedImport import maya.mel as mel # @UnresolvedImport PIPELINE_INSTALL_WINDOW = 'pipeline_install_window' PIPELINE_PATH = 'pipeline_path.txt...
nicholas-silveira/art_pipeline
maya/startup/userSetup.py
Python
bsd-3-clause
4,712
"""small rna pipeline""" from seqcluster.libs import config __version__ = config.version
lpantano/seqcluster
seqcluster/__init__.py
Python
mit
89
extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'OctopodesKing' copyright = u'2016, Elmer Yu' version = '0.1' release = '0.1' exclude_patterns = ['_build'] pygments_style = 'sphinx' html_theme = 'default' html_static_path = ['_static'] htmlhelp_basename = 'Oct...
ak64th/octopodes-king
docs/conf.py
Python
mit
753
from pytest import raises from revscoring.dependencies.dependent import Dependent from revscoring.dependencies.functions import (dig, draw, expand, normalize_context, solve) from revscoring.errors import DependencyError, DependencyLoop def test_solve(): # Simple fun...
he7d3r/revscoring
tests/dependencies/test_functions.py
Python
mit
4,846
""" Registers signal handlers at startup. """ # pylint: disable=unused-import import openedx.core.djangoapps.monitoring.exceptions
synergeticsedx/deployment-wipro
openedx/core/djangoapps/monitoring/startup.py
Python
agpl-3.0
131
from unittest import TestCase from django.contrib import admin class Bug8245Test(TestCase): """ Test for bug #8245 - don't raise an AlreadyRegistered exception when using autodiscover() and an admin.py module contains an error. """ def test_bug_8245(self): # The first time autodiscover is...
yceruto/django
tests/bug8245/tests.py
Python
bsd-3-clause
787
import json import copy with open('contour-feet.tmp.geojson', 'r') as f: old = json.load(f) new = copy.deepcopy(old) new['features'] = [] for feature in old['features']: new_feature = copy.deepcopy(old[feature]) new_feature['properties']['index'] = old[feature]['properties']['index'] / 12.19 * 40.0 n...
abkfenris/inferno-react
elevation/meters_to_feet.py
Python
mit
423
# 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...
pczerkas/tempest
tempest/api/baremetal/admin/test_nodes.py
Python
apache-2.0
7,058
from django.conf.urls import url from . import views app_name = 'persons' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^contact/$', views.contact, name='contact'), url(r'^thanks/$', views.thanks, name='thanks'), url(r'^upload/$', views.upload_file, name='upload_file'), url(r'^success...
grodrigo/django_general
persons/urls.py
Python
gpl-3.0
427
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Phil Adams http://philadams.net clc: simple charts on the command line. http://github.com/philadams/clc """ import logging import sys def cli(): import argparse # populate and parse command line options description = 'clc: simple charts on the command ...
philadams/clc
clc/core.py
Python
isc
1,875
from operator import methodcaller from unittest import TestCase from unittest.mock import MagicMock import pytest import bonobo from bonobo.constants import EMPTY, NOT_MODIFIED from bonobo.util import ValueHolder, ensure_tuple from bonobo.util.bags import BagType from bonobo.util.testing import BufferingNodeExecution...
python-bonobo/bonobo
tests/nodes/test_basics.py
Python
apache-2.0
4,753
# coding=utf-8 """Provider code for Newznab provider.""" from __future__ import unicode_literals import logging import os import re from builtins import range from builtins import zip from collections import namedtuple from medusa import ( app, tv, ) from medusa.bs4_parser import BS4Parser from medusa.helpe...
pymedusa/Medusa
medusa/providers/nzb/newznab.py
Python
gpl-3.0
22,451
# -*- coding:utf-8 -*- # repoman: Checks # Copyright 2007-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 """This module contains functions used in Repoman to ascertain the quality and correctness of an ebuild.""" from __future__ import unicode_literals from itertools import...
dol-sen/portage
repoman/pym/repoman/modules/scan/ebuild/checks.py
Python
gpl-2.0
30,705
""" Unittests for creating a course in an chosen modulestore """ from StringIO import StringIO import ddt from django.core.management import CommandError, call_command from django.test import TestCase from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase...
ahmedaljazzar/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
Python
agpl-3.0
4,567
""" Deletes SQL database from Azure """ from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt import sql from common.methods import set_progress from resourcehandlers.azure_arm.models import AzureARMHandler def _get_client(handler): """ Get the client using newer methods from the C...
CloudBoltSoftware/cloudbolt-forge
blueprints/azure_sql_database/delete.py
Python
apache-2.0
2,172
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User # Create your models here. class Category(models.Model): title = models.CharField(_('title'), max_length=100) created_date = models.DateTimeF...
marifersahin/pyfolio
entry/models.py
Python
mit
1,177
import numpy as np from src.analysis import visualization from sklearn.decomposition import PCA def load(filename): data = np.memmap(filename,dtype='float32',mode='r') return np.reshape(data,(np.sqrt(data.shape),-1)) data = load('./data/test-similarity-matrix.npy') pca = PCA(n_components=5) data_r = pca.fit(dat...
mac389/semantic-distance
analyze.py
Python
mit
432
# -*- coding:UTF-8 -*- """ Pbox Modbus RTU""" # !/usr/bin/python # Python: 3.5.2 # Platform: Windows # Author: Heyn # Program: Modbus RTU # History: 2017/02/14 V1.0.0[Heyn] # 2017/03/08 V1.0.1[Heyn] Send return string. import pymodbus import imx6_ixora_led as led class PboxRtu: """Pbox Modbus Cla...
Heyn2016/Python
ApalisT30/Pbox/proto/Modbus-RTU/PboxRtu.py
Python
gpl-3.0
1,434
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # from functools import reduce import numpy from pyscf import gto, scf, ao2mo from pyscf import tools from pyscf import symm ''' Write FCIDUMP file ''' mol = gto.M( atom = [['H', 0, 0, i] for i in range(6)], basis = '6-31g', verbose = 0,...
shivupa/pyci
methods/misc/fcidump.py
Python
gpl-3.0
2,153
""" Django settings for sfotipy project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
damianpv/sfotipy
sfotipy/settings.py
Python
mit
3,934
# sql/expression.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Defines the public namespace for SQL expression constructs. Prior to version 0.9...
jessekl/flixr
venv/lib/python2.7/site-packages/sqlalchemy/sql/expression.py
Python
mit
5,624
from ekklesia_portal.datamodel import User from ekklesia_portal.lib.password import password_context class Login: def __init__(self, request=None, username=None, password=None, back_url=None, from_redirect=None, internal_login=None): self.request = request self.username = username self.pa...
dpausp/arguments
src/ekklesia_portal/concepts/ekklesia_portal/login.py
Python
agpl-3.0
1,194
# -*- coding: utf-8 -*- from datetime import date from cms.utils.compat.metaclasses import with_metaclass from django.core.urlresolvers import reverse, NoReverseMatch from django.utils.safestring import mark_safe import os import warnings from django.core.exceptions import ValidationError, ObjectDoesNotExist from djan...
SinnerSchraderMobileMirrors/django-cms
cms/models/pluginmodel.py
Python
bsd-3-clause
16,996
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.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 Lice...
phw/weblate
weblate/trans/forms.py
Python
gpl-3.0
77,997
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio 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 l...
dset0x/invenio
invenio/modules/deposit/config.py
Python
gpl-2.0
1,957
# -*- coding: utf-8 -*- from __future__ import ( absolute_import, division, unicode_literals, print_function, ) from functools import wraps import collections import inspect import numbers import pendulum try: unicode = unicode except NameError: basestring = (str, bytes) PASSTHROUGH_TYPES =...
SpotOnInc/pendulumify
pendulumify/pendulumify.py
Python
mit
1,493
"""Defines the interface for executing a job""" from __future__ import unicode_literals import logging import re from jsonschema import validate from jsonschema.exceptions import ValidationError from job.configuration.interface import job_interface_1_1 as previous_interface from job.configuration.interface.exception...
ngageoint/scale
scale/job/configuration/interface/job_interface_1_2.py
Python
apache-2.0
13,711
# # Copyright (C) 2014 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # This program is distributed in the hope...
sigmunau/nav
python/nav/web/navlets/status2.py
Python
gpl-2.0
4,820
from fabric.api import run, sudo from fabric.api import prefix, warn, abort from fabric.api import settings, task, env, shell_env from fabric.context_managers import cd from fabric.contrib.files import exists from datetime import datetime import json import os import shlex env.hosts = ["web2.openprescribing.net"] en...
ebmdatalab/openprescribing
fabfile.py
Python
mit
10,090
import time import threading # 假定银行存款 balance = 0 lock = threading.Lock() def change_it(n): # 先存后取, 结果应该为0: global balance balance = balance + n balance = balance - n def run_thread(n): for i in range(100000): # 先要获取锁: lock.acquire() try: change_it(n) f...
KECB/learn
线程进程/lock.py
Python
mit
584
#!/usr/bin/python # # Copyright (c) 2020 by VMware, Inc. ("VMware") # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. # ("NetDEF") in this file. # # Permission to use, copy, modify, and/or distribute this software # for any purpose with or without fee is hereby granted, provided # that the above c...
freerangerouting/frr
tests/topotests/ospf_basic_functionality/test_ospf_chaos.py
Python
gpl-2.0
17,756
# -*- coding: utf-8 -*- ''' Unittest ''' import grs import unittest from datetime import datetime from types import BooleanType from types import NoneType class TestGrs(unittest.TestCase): def get_data(self): self.stock_no = '2618' self.data = grs.Stock(self.stock_no) def test_stock(self): ...
toomore/grs
test_unittest.py
Python
mit
5,685
from django.contrib import admin import models admin.site.register(models.DonationSubscriptionPlan) admin.site.register(models.Donation)
SYNHAK/spiff
spiff/donations/admin.py
Python
agpl-3.0
138
# @Time : 2016/9/26 18:06 # @Author : lixintong import os from PyQt5 import uic from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QCursor from PyQt5.QtWidgets import QWidget, QTableWidgetItem, QAbstractItemView, QMessageBox, QMenu, QAction from uitester.case_data_manager.case_data_manager import Cas...
IfengAutomation/uitester
uitester/ui/case_data/case_data.py
Python
apache-2.0
6,159
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 - 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance w...
ozamiatin/oslo.messaging
oslo_messaging/_drivers/amqp.py
Python
apache-2.0
4,367
import numpy __author__ = 'gk' from PageRank.Iterator import MatrixInfo # Implements matrix builder helper classes to build link, Teleport matrix used in Page rank calculation # P = (1- α) * link matrix + α * teleport matrix , input α from scipy import sparse class LinkMatrix: matrix = sparse.csr_matrix([],...
ganesh-karthick/TwitterUserRanker
PageRank/TransitionProbablity.py
Python
apache-2.0
3,272
from errno import * ############################################################################### # # Try to rename hardlinked files # ############################################################################### def subtest_1(ctx): """Rename hardlinked file""" f = ctx.reg_file() + ctx.termslash() f2 ...
amir73il/unionmount-testsuite
tests/rename-hard-link.py
Python
gpl-2.0
718
# Copyright 2012-2013 Peter Williams # Licensed under the GNU General Public License version 3 or higher """tasklib - library of clones of CASA tasks The way that the casapy code is written it's basically impossible to import its tasks into a straight-Python environment (trust me, I've tried), so we're more-or-less d...
caseyjlaw/rtpipe-docker-nersc
tasklib.py
Python
bsd-3-clause
52,884
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ from __future__ import print_function import argparse from icecream import ic import sys ic.configureOutput(outputFunction=lambda *a: print(*a, file=sys.stderr)) ic.configureOutput(prefix='> ') def get_parser(): parser = argparse.ArgumentParser( descr...
m4rx9/rna-pdb-tools
rna_tools/tools/misc/rna_csv_sort.py
Python
mit
916
# Copyright 2013-2018 Donald Stufft and individual contributors # # 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 applicabl...
pyca/pynacl
tests/test_secretstream.py
Python
apache-2.0
10,266
# Copyright (C) 2009-2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
hcs/mailman
src/mailman/commands/cli_version.py
Python
gpl-3.0
1,359
from django.contrib.auth.models import AnonymousUser from django.test import TestCase from mock import MagicMock, patch from . import BillingAddressStep, ShippingStep from ..checkout import STORAGE_SESSION_KEY from ..checkout.steps import BaseAddressStep from ..userprofile.models import Address NEW_ADDRESS = { 'f...
Drekscott/Motlaesaleor
saleor/checkout/test_checkout.py
Python
bsd-3-clause
4,970