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
#!/usr/bin/python3 ################################ # File Name: unittestExample.py # Author: Chadd Williams # Date: 10/20/2014 # Class: CS 360 # Assignment: Lecture Examples # Purpose: Demonstrate unit tests ################################ # adapted from https://docs.python.org/3/libr...
mcco-cs360/Python-CI-Testing
unittestExample.py
Python
gpl-2.0
1,967
# -*- coding: utf-8 -*- # Copyright(C) 2010 Romain Bignon # # 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 3 of the License. # # This program is distributed in the hope that it will b...
jocelynj/weboob
weboob/backends/ouifm/test.py
Python
gpl-3.0
920
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating.py
Python
mit
2,017
from . import teachers
StamKaly/altitude-mod
altitude/teachers/__init__.py
Python
mit
22
import os import sys import time import ldap import logging import pytest from lib389 import DirSrv, Entry, tools, tasks from lib389.tools import DirSrvTools from lib389._constants import * from lib389.properties import * from lib389.tasks import * from lib389.utils import * from lib389.idm.user import UserAccounts, T...
Ilias95/lib389
lib389/tests/idm/user_and_group_test.py
Python
gpl-3.0
2,095
"""list portable IP ranges""" from baseCmd import * from baseResponse import * class listPortableIpRangesCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "false" """Id of the portable ip range""" self.id = None self.typeInfo['id'] = 'uuid' """List by key...
MissionCriticalCloud/marvin
marvin/cloudstackAPI/listPortableIpRanges.py
Python
apache-2.0
2,708
from django.urls import path, include from rest_framework import routers # from rest.l2_serializers import DoctorSerializer, PodrazdeleniyaSerializer # from rest.l2_view_sets import UserViewSet router = routers.DefaultRouter() # router.register(r'users', UserViewSet) # router.register(r'doctorprofiles', DoctorSeriali...
moodpulse/l2
rest/urls.py
Python
mit
516
__all__ = [ "display", "graphics", "winstar_weg", "_winstar_weg", "hd44780", "lcd_curses", "fonts" ] import display import graphics import lcd_curses import winstar_weg try: import _winstar_weg except: print "No C driver found" pass import hd44780 import fonts
dhrone/pydKeg
displays/__init__.py
Python
mit
266
# 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...
jaypipes/vif_plug_ivs
vif_plug_ivs/linux_net.py
Python
apache-2.0
12,806
from decimal import Decimal from voluptuous import MultipleInvalid from minfraud.validation import validate_transaction, validate_report import unittest class ValidationBase: def setup_transaction(self, transaction): if "device" not in transaction: transaction["device"] = {} if "ip_...
maxmind/minfraud-api-python
tests/test_validation.py
Python
apache-2.0
15,656
import logging import os import sys import yaml from functools import partial from lxml import etree from collections import namedtuple from pkg_resources import ( resource_exists, resource_listdir, resource_string, resource_isdir, ) from webob import Response from webob.multidict import MultiDict fro...
pelikanchik/edx-platform
common/lib/xmodule/xmodule/x_module.py
Python
agpl-3.0
44,058
from dnsfiles.files import DnsFileStore from dnsfiles.gandi import GandiDns def init_store(): return DnsFileStore('.') def init_dns_service(): return GandiDns() def init(file_store, dns_service): for zone, records in dns_service.list_zones().items(): file_store.write_zone_file(zone, records)
peachjean/dnsfiles
dnsfiles/actions.py
Python
gpl-2.0
310
__source__ = 'https://leetcode.com/problems/tag-validator/' # Time: O() # Space: O() # Link to check regex: # http://regexr.com/ # # Description: 591. Tag Validator # # Given a string representing a code snippet, you need to implement a tag validator to parse the code and # return whether it is valid. A code snippet i...
JulyKikuAkita/PythonPrac
cs15211/TagValidator.py
Python
apache-2.0
7,313
HOST = "wfSciwoncGW:enw1989@172.31.2.76:27001/?authSource=admin" PORT = "" USER = "" PASSWORD = "" DATABASE = "googlew" READ_PREFERENCE = "secondary" COLLECTION_INPUT = "stats_cpumemory" PREFIX_COLUMN = "" ATTRIBUTES = ["standard deviation cpu", "average cpu","standard deviation memory", "average memory","standard de...
elainenaomi/sciwonc-dataflow-examples
dissertation2017/Experiment 1B/instances/7_1_workflow_full_10files_secondary_w1_1sh_3rs_noannot_with_proj_3s/taskevent_0/ConfigDB_Task_StatsCPUMemory_0.py
Python
gpl-3.0
415
import frappe from frappe.utils import get_time, getdate, today from erpnext.accounts.utils import update_gl_entries_after from erpnext.stock.stock_ledger import update_entries_after def execute(): for doctype in ('repost_item_valuation', 'stock_entry_detail', 'purchase_receipt_item', 'purchase_invoice_item', 'd...
mhbu50/erpnext
erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py
Python
gpl-3.0
2,110
''' Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the following matrix: [ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ] ''' class Solution(object): def generateMatrix(self, n): """ :type n: int :rt...
wufangjie/leetcode
059. Spiral Matrix II.py
Python
gpl-3.0
1,481
# Copyright 2008 Red Hat, Inc. and/or its affiliates. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the fo...
openSUSE/vdsm
vdsm/SecureXMLRPCServer.py
Python
gpl-2.0
7,492
# Licensed Materials - Property of IBM # Copyright IBM Corp. 2016 import unittest import sys import os import tempfile import time import uuid from streamsx.topology.topology import * from streamsx.topology.tester import Tester from streamsx.topology.context import build, run, JobConfig class TestContext(unittest.Te...
ddebrunner/streamsx.topology
test/python/topology/test2_context.py
Python
apache-2.0
3,132
import numpy as np from pandas._libs import algos as libalgos, index as libindex from pandas import compat import pandas.util.testing as tm class TestNumericEngine(object): def test_is_monotonic(self, numeric_indexing_engine_type_and_dtype): engine_type, dtype = numeric_indexing_engine_type_and_dtype ...
GuessWhoSamFoo/pandas
pandas/tests/indexing/test_indexing_engines.py
Python
bsd-3-clause
6,145
from pyosm.parsing import iter_osm_file from pyosm.model import Node, Way, Relation from shapely.geometry import Point, LineString, Polygon from shapely.ops import polygonize polygon_way_tags = { 'area': ('yes'), 'building': ('yes'), } def way_is_polygon(way): return (way.nds[-1] == next(iter(way.nds))) ...
iandees/pyosm
pyosm/shapeify.py
Python
mit
2,326
# import heapq # class Solution: # def mergeStones(self, stones: List[int], K: int) -> int: # heapq.heapify(stones) # ans = 0 # while len(stones) >= K: # t = 0 # for _ in range(K): # x = heapq.heappop(stones) # print(x) ...
FiveEye/ProblemSet
LeetCode/lc1000.py
Python
mit
2,508
''' Float Layout ============ :class:`FloatLayout` honors the :attr:`~kivy.uix.widget.Widget.pos_hint` and the :attr:`~kivy.uix.widget.Widget.size_hint` properties of its children. .. only:: html .. image:: images/floatlayout.gif :align: right .. only:: latex .. image:: images/floatlayout.png ...
arlowhite/kivy
kivy/uix/floatlayout.py
Python
mit
3,650
#! /usr/bin/python import os import sys import unittest # to launch manually sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) from pOCCI import occi from pOCCI import render attributes = [ occi.Attribute({ 'name': 'occi.core.id', 'type': 'number', 'value': 1, }), ...
jeanparpaillon/pOCCI
tests/test_basic.py
Python
mit
5,063
# -*- coding: utf-8 -*- # # gcmfaces documentation build configuration file, created by # sphinx-quickstart on Tue Jan 16 02:04:13 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
gaelforget/gcmfaces
docs/conf.py
Python
mit
5,755
import random import pandas as pd from sklearn.cross_validation import StratifiedKFold import numpy as np from sklearn.metrics import classification_report from sklearn.metrics import roc_auc_score from sklearn.neighbors import KNeighborsClassifier from tests import shelve_api def yield_patient_names(name, d): ...
schae234/gingivere
tests/ensemble_gradient.py
Python
mit
2,184
# -*- coding: utf-8 -*- """QGIS Unit tests for the postgres raster provider. Note: to prepare the DB, you need to run the sql files specified in tests/testdata/provider/testdata_pg.sh Read tests/README.md about writing/launching tests with PostgreSQL. Run with ctest -V -R PyQgsPostgresProvider .. note:: This progra...
SrNetoChan/Quantum-GIS
tests/src/python/test_provider_postgresraster.py
Python
gpl-2.0
20,564
# -*- coding: utf-8 -*- # Copyright (c) 2014 Simon Jagoe and Enthought Ltd. # All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE.txt file for details. from __future__ import absolute_import, unicode_literals import json import os from...
sjagoe/usagi
usagi/plugins/var_loaders.py
Python
bsd-3-clause
7,260
# Script to update the Solr metadata using input metadata stored in JSON files. # # Example invocation: python common/src/main/python/gov/nasa/jpl/edrn/labcas/client/update_solr_metadata.py datasets add input.json # where input.json is as follows: # #{ # "id:Boston_University_Lung_Tumor_Sequencing.FFPE_Lung_Tumor_Seq...
EDRN/labcas-backend
common/src/main/python/gov/nasa/jpl/edrn/labcas/client/update_solr_metadata.py
Python
apache-2.0
1,020
## ## error.py ## Login : David Rousselie <dax@happycoders.org> ## Started on Sun Nov 5 20:13:48 2006 David Rousselie ## $Id$ ## ## Copyright (C) 2006 David Rousselie ## 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 ...
dax/jcl
src/jcl/error.py
Python
lgpl-2.1
2,425
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google/clusterfuzz
src/python/bot/startup/android_heartbeat.py
Python
apache-2.0
2,475
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
fajoy/horizon-example
openstack_dashboard/dashboards/project/instances/urls.py
Python
apache-2.0
1,941
from collections import namedtuple from django.test import TestCase from .utils import distance class UtilsTest(TestCase): LatLonCoordinates = namedtuple('LatLonCoordinated', ['lat', 'lon']) def test_distance_close(self): fishermans_wharf = self.LatLonCoordinates(37.80833, -122.41555) gg_br...
flebel/django-bixi
bixi/tests.py
Python
bsd-3-clause
1,077
# 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 # distributed under the...
mattjhayes/nmeta
nmeta/api_definitions/pi_time.py
Python
apache-2.0
1,606
# Part of Odoo. See LICENSE file for full copyright and licensing details. from . import main
jeremiahyan/odoo
addons/pos_cache/controllers/__init__.py
Python
gpl-3.0
94
# -*- coding: utf-8 -*- ''' Phoenix Add-on Copyright (C) 2015 Blazetamer Copyright (C) 2015 lambda 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 Lic...
krisawatson/plugin.video.genesis
modules/indexers/nhlcom.py
Python
gpl-3.0
9,617
from django.conf.urls import patterns,url from .views import * urlpatterns = patterns("", url(r"^$", "bookmarks.views.bookmarks", name="all_bookmarks"), url(r"^your_bookmarks/$", "bookmarks.views.your_bookmarks", name="your_bookmarks"), url(r"^add/$", "bookmarks.views.add", name="add_bookmark"), url(...
PirateLearner/pi
PirateLearner/bookmarks/urls.py
Python
gpl-2.0
959
import commands arguments = ["self", "info", "args"] helpstring = "dns6 <IP or domain name>" minlevel = 1 def main(connection, info, args) : """Returns the dns path using IPv6""" connection.ircsend(info["channel"], lookup(args[1], 6)) def lookup(data, v=4) : """This code is not by me. It was written by n...
sonicrules1234/sonicbot
oldplugins/dns6.py
Python
bsd-3-clause
1,209
#!/usr/bin/env python3 #-*-coding: utf-8-*- # Version: 0.1 # Author: Song Huang <huangxiaohen2738@gmail.com> # License: Copyright(c) 2015 Song.Huang # Summary: import sys from os.path import abspath, dirname, join, normpath PREFIX = normpath(dirname(abspath(__file__))) for path in (PREFIX, normpath(join(PREFIX, '.....
huangxiaohen2738/tornado-rpc
game/main.py
Python
apache-2.0
1,219
import defcon import sys sys.path.append("..") from kernFeatureWriter import * def read_file(path): ''' Read a file, split lines into a list, close the file. ''' with open(path, 'r', encoding='utf-8') as f: data = f.read().splitlines() return data def test_WhichApp(): assert WhichA...
adobe-type-tools/python-modules
tests/test_kernFeatureWriter.py
Python
mit
790
""" test docstring inspection""" def foo1(a, b): """ @param a: @param b: @return: """ pass def foo(a, <weak_warning descr="Missing parameter b in docstring">b</weak_warning>, <weak_warning descr="Missing parameter n in docstring">n</weak_warning>): """ @param a: @return: """ pass def foo(): ...
MichaelNedzelsky/intellij-community
python/testData/inspections/PyDocstringParametersInspection/test.py
Python
apache-2.0
868
from __future__ import division from future import standard_library standard_library.install_aliases() from builtins import range from builtins import object from past.utils import old_div import urllib.request, urllib.parse, urllib.error,json import pprint class Recipe(object): id_counter = 0 def __init__(se...
flagos/pico-brewUI
Recipe.py
Python
mit
3,125
# This file is part of ledgertools # Copyright (C) 2011 Fraser Tweedale # # ledgertools 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....
frasertweedale/ledgertools
ltlib/util.py
Python
gpl-3.0
960
from __future__ import division from __future__ import print_function import sys from os import path import numpy as np from argparse import ArgumentParser import logging sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__)))) + '/utils/') sys.path.append(path.dirname(path.dirname(p...
madgik/exareme
Exareme-Docker/src/mip-algorithms/MULTIPLE_HISTOGRAMS/1/global.py
Python
mit
1,173
# -*- coding: utf-8 -*- # # qq documentation build configuration file, created by # sphinx-quickstart on Sun Jun 5 19:38:23 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All conf...
floh1695/monstergame
monstergame/qq/docs/conf.py
Python
apache-2.0
6,979
from myhdl import * from pihdf import * from myhdl_lib import * #--- Custom code begin ---# #--- Custom code end ---# def hsd_custom_rtl(rst, clk, rx_port_flds, tx_port_flds): '''| | Top-level MyHDL description. This is converted to RTL velilog... |________''' """ Interface signals """ rx_port_...
hnikolov/pihdf
examples/hsd_custom/src/hsd_custom_rtl.py
Python
mit
1,081
#!/usr/bin/env python digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} found = True while found: input_string = input('Please give me some digits... \n') found = False for character in input_string: if character not in digits: # we have a non digit! print('Error, ...
veltzer/demos-python
src/exercises/basic/digits_report/solution9.py
Python
gpl-3.0
433
import recon import ssl import sys from flask import Flask, jsonify app = Flask(__name__) player = recon.get_player("recon/steve.recon") @app.route('/') def root(): return app.send_static_file('index.html') @app.route('/dialog/test/') def dialog(): return jsonify( **player.play(continuous=F...
arexx/recon
server.py
Python
mit
1,192
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals # mappings for table dumps # "remember to add indexes!" data_map = { "Company": { "columns": ["name"], "conditions": ["docstatus < 2"] }, "Fisc...
gangadharkadam/saloon_erp
erpnext/startup/report_data_map.py
Python
agpl-3.0
8,872
#!/opt/local/bin/python # coding: utf8 class Var: def __init__ (self,name): self.name = name self.var = {} self.min = {} self.max = {} def show ( self ): print ("\n Contents of ", self.name ) for k,v in self.var.items(): print (" ", k, "=", v ) ...
AlexandreBiguet/NJLlikeModels
PythonStuffs/OtherStuffs/tests/variables.py
Python
gpl-3.0
1,361
import unittest import six from engineio import packet from engineio import payload class TestPayload(unittest.TestCase): def test_encode_empty_payload(self): p = payload.Payload() self.assertEqual(p.packets, []) self.assertEqual(p.encode(), b'') def test_decode_empty_payload(self):...
thekingofkings/focusread
libs/tests/common/test_payload.py
Python
mit
2,084
# -*- coding: utf-8 -*- import codecs, filecmp, os, subprocess, sys def main(): startApplication("sasview") mouseClick(waitForObject(":MainWindow.Data Explorer_QWorkspace"), 676, 556, 0, Qt.LeftButton) mouseClick(waitForObject(":groupBox_6.cbCategory_QComboBox_2"), 83, 13, 0, Qt.LeftButton) mouseClick(...
SasView/sasview
src/sas/qtgui/UnitTesting/SquishTestSuites/suite_sasview_qt/tst_SaveImage_1D/test.py
Python
bsd-3-clause
3,630
from _abstract import abstract class featureservicetools(abstract.baseToolsClass): #---------------------------------------------------------------------- def EnableEditingOnService(self, url, definition = None): adminFS = AdminFeatureService(url=url, securityHandler=self._securityHandler) ...
achapkowski/ArcREST
src/arcresthelper/featureservicetools.py
Python
apache-2.0
8,739
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
RedhawkSDR/integration-gnuhawk
components/streams_to_stream_ff_2i/tests/test_streams_to_stream_ff_2i.py
Python
gpl-3.0
4,089
# encoding: utf-8 import argparse import logging from os import environ as env from collections import Iterable import pika from twisted.internet import defer, reactor, protocol, task from .utils import AMQPConnection, asleep logger = logging.getLogger(__name__) def default_converter(message): return message...
Fatal1ty/amqpipe
amqpipe/amqpipe.py
Python
mit
14,727
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('monitoring', '0011_notification_def'), ] operations = [ migrations.AlterField( model_name='metric', name='type', field=models.Ch...
francbartoli/geonode
geonode/monitoring/migrations/0012_notifications_service.py
Python
gpl-3.0
768
# ipython --gui=wx from os import chdir from scipy.io import loadmat from surfer import Brain import numpy as np from mne import read_forward_solution chdir('/home/yuval/Data/marik/som2/MNE') pow = loadmat('pow1.mat') pow=pow['pow'] powL=np.empty(4098) powR=powL powL=pow[0,:4098] powR=pow[0,4098:] fwd=read_forward_so...
yuval-harpaz/MNE4D
pyScripts/marikSom1.py
Python
gpl-2.0
715
from django.http import HttpResponse from django.http import Http404, HttpResponse from django.template.loader import get_template from django.template import Template, Context import datetime import os.path def hello(request): return HttpResponse("Hello world, Aadithya!! This is your first DJANGO application") ...
acudupa/simple-django-app
mysite/mysite/views.py
Python
gpl-2.0
1,148
''' SDL Window: Windowing provider directly based on our own wrapped version of SDL ''' __all__ = ('WindowSDL', ) from kivy.logger import Logger from kivy.core.window import WindowBase from kivy.base import EventLoop, ExceptionManager, stopTouchApp from kivy.clock import Clock from kivy.config import Config import sy...
JulienMcJay/eclock
windows/kivy/kivy/core/window/window_sdl.py
Python
gpl-2.0
10,453
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
KaranToor/MA450
google-cloud-sdk/lib/surface/compute/target_https_proxies/update.py
Python
apache-2.0
3,998
#!/usr/bin/env python # coding: utf-8 #encoding: latin1 def ingresar_numero(numero_minimo, numero_maximo): ''' Muestra un cursor de ingreso al usuario para que ingrese un número tal que numero_mínimo <= ingreso <= numero_máximo. Ante un ingreso inválido muestra un mensaje descriptivo de error y repregunta....
sit0x/farmasoft
interaccion_usuario.py
Python
gpl-3.0
2,473
# # Pan.py -- Pan plugin for fits viewer # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import sys import traceback import math from ginga.gw import Widgets, Viewers from ginga.misc import Bunch from ginga import GingaPlugin class Pan(GingaPlugin.GlobalP...
rupak0577/ginga
ginga/misc/plugins/Pan.py
Python
bsd-3-clause
13,375
import urllib2 try: import httplib2 except ImportError: httplib2 = None from errors import HTTPError def best_fetcher(): if httplib2: return CachedFetcher() else: return Fetcher() class Fetcher(object): "Default implementation, using urllib2" def get(self, url): try: ...
simonw/python-guardianapi
guardianapi/fetchers.py
Python
bsd-2-clause
1,267
#!/usr/bin/env python import argparse import csv import itertools import math import matplotlib import os import subprocess import sys class WorkingDirectory: "Scoped context for changing working directory" def __init__(self, working_dir): self.original_dir = os.getcwd() self.working_dir = w...
drobilla/serd
scripts/serd_bench.py
Python
isc
6,979
#!/usr/local/bin/python3 import matplotlib.pyplot as plt import numpy as np plt.rcParams['savefig.facecolor'] = "0.8" def example_plot(ax, fontsize=12): ax.plot([1, 2]) ax.locator_params(nbins=3) ax.set_xlabel('x-label', fontsize=fontsize) ax.set_ylabel('y-label', fontsize=fontsize) ax.set_titl...
MarsBighead/mustang
Python/sample-plt.py
Python
mit
484
##NFA Simulation ##3.4 等价性 ##python 3.4.1 from pprint import pprint ##NFA class FARule(object): def __init__(self, state, character, next_state): self.state = state self.character = character self.next_state = next_state def applies_to(self, state, character): return self.state...
slideclick/toys
Automaton/NFASimulation3.4.py
Python
gpl-2.0
6,734
DEFINITE_ARTICLES = ( 'ال', # (The) The main definite article 'وال', # And the 'بال', # In the 'كال', # like the 'فال', # so the ) ADDED_LETTERS = ( 'س', 'أ', 'ل', 'ت', 'م', 'و', 'ن', 'ي', 'ه', 'ا', )
ahmedaljazzar/arabic-nlp
arabic_script/special_articles.py
Python
agpl-3.0
291
#!/usr/bin/env python """ This module solves Project Euler #19 """ from datetime import date, timedelta ONE_DAY = timedelta(days=1) ONE_WEEK = timedelta(days=7) TWO_WEEKS = timedelta(days=14) THREE_WEEKS = timedelta(days=21) FOUR_WEEKS = timedelta(days=28) FIVE_WEEKS = timedelta(days=35) SIX_WEEKS = timedelta(days=42...
blakebye/project-euler
euler019.py
Python
gpl-2.0
1,674
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2014 Vincent Jacques <vincent@vincent-ja...
pymedusa/Medusa
ext/github/StatsCodeFrequency.py
Python
gpl-3.0
3,190
class ObjectRegistry(object): """ Registry for constructed objects so they can be all broken down before the process ends """ objects = [] @staticmethod def register(obj): ObjectRegistry.objects.append(obj) @staticmethod def destroy_all(): for o in ObjectRegistry.objects: try: o.destroy() exce...
XerxesDGreat/py_photo_browser
wsgi/src/registry.py
Python
mit
333
# Copyright (c) 2019-2020 Manfred Moitzi # License: MIT License import pytest import math import pickle # Import from 'ezdxf.math._vector' to test Python implementation from ezdxf.math._vector import Vec2, Vec3 from ezdxf.acc import USE_C_EXT all_vec_classes = [Vec2, Vec3] vec2_only = [Vec2] if USE_C_EXT: from e...
mozman/ezdxf
tests/test_06_math/test_603_vec2.py
Python
mit
8,066
#!/usr/bin/env python # -*- coding: utf-8 -*- # This is a port of the original in testprogs/ejs/ldap.js import optparse import sys import time import random import os sys.path.insert(0, "bin/python") import samba samba.ensure_external_module("testtools", "testtools") samba.ensure_external_module("subunit", "subunit/p...
amitay/samba
source4/dsdb/tests/python/ldap_schema.py
Python
gpl-3.0
21,457
from datetime import date, datetime, timedelta from decimal import Decimal from uuid import uuid4 import pytest from django.test import TestCase from django.utils.timezone import utc from rest_framework.compat import coreapi from rest_framework.utils.encoders import JSONEncoder class MockList(object): def tolis...
linovia/django-rest-framework
tests/test_encoders.py
Python
bsd-2-clause
2,681
#! /usr/bin/python import yaml def main(): #f = open("data.yaml", "r") f = open("data2.yaml", "r") yd = yaml.load(f) #print "YAML Data: %s" % str(yd) for key in yd: print "%s" % key print "Type: %s" % str(type(yd[key])) print str(yd[key]) print "" def yaml_test():...
CospanDesign/python
yaml/example1.py
Python
mit
620
''' Created on 16 iun. 2016 @author: Paul ''' import RPi.GPIO as gp from utility import util import constants dig_pin = util.get_sensor_attribute_value(constants.MQ2, constants.SENSOR_PIN) gp.setmode(gp.BOARD) gp.setup(dig_pin, gp.IN, pull_up_down=gp.PUD_DOWN) SMOKE = 0 def _set_smoke(pin): gl...
pauldamian/-casa
acasa/things/gas.py
Python
apache-2.0
519
#!/usr/bin/env python from optparse import OptionParser import json import os from subprocess import check_call, PIPE, Popen import sys from textwrap import dedent def main(): usage = dedent("""\ %prog [options] </base/repo/dir> Simulate, more or less, a git push event from...
hut8labs/githubstub
extra/fp.py
Python
mit
1,855
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
krafczyk/spack
var/spack/repos/builtin/packages/r-pamr/package.py
Python
lgpl-2.1
1,602
from tuxeatpi.tux import Tux #from tuxeatpi.nlu.tux import NLUTux mytux = Tux("tuxeatpi-conf.yml") #print ret #import ipdb;ipdb.set_trace() #if ret == "tux__get_name": #print(ret()) #mytux.voice.tts("My name is {}".format(ret())) #print(mytux.write_birthday()) #print(mytux.write_uptime()) #print(mytux.write_name()) #n...
TuxEatPi/tuxeatpi
toto.py
Python
apache-2.0
871
import logging import os import socket import time import urllib.error from urllib.request import urlopen logger = logging.getLogger('captcha') class CaptchaHandler: def __init__(self, params): self.png_exists = False self.key = params.get('antigate_key') self.png_filename = params.get('pn...
kalinochkind/vkbot
captcha.py
Python
mit
3,827
""" create specializer projects basically copies all files and directories from a template. """ from __future__ import print_function import sys import argparse import collections import shutil import os import ctree from ctree.tools.generators.builder import Builder if sys.version_info >= (3, 0, 0): # python 3 ...
ucb-sejits/ctree
ctree/tools/runner.py
Python
bsd-2-clause
5,410
from flask_wtf import Form from wtforms.validators import Required from wtforms import StringField, SubmitField class SubmitRecordForm(Form): name = StringField("Name", validators=[Required()]) price = StringField("Price", validators=[Required()]) submit = SubmitField('Submit') class QueryRecordForm(For...
ccqpein/apartmentAccountingWeb
py-version/applib/accountingForm.py
Python
mit
357
# Solution to exercise FrogJmp # http://www.codility.com/train/ def solution(X, Y, D): if (Y-X) % D == 0: return (Y-X) / D else: return (Y-X) / D + 1
jmaidens/Codility
FrogJmp.py
Python
mit
180
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import ldap import logging from ldap.filter import filter_format from odoo import _, api, fields, models, tools from odoo.exceptions import AccessDenied from odoo.tools.pycompat import to_text _logger = logging.getLogg...
jeremiahyan/odoo
addons/auth_ldap/models/res_company_ldap.py
Python
gpl-3.0
9,204
from setuptools import setup long_description = """ API Wrapper to access the Open Source License API The Open Source API can be found at https://api.opensource.org, and some (very brief!) documentation can be found in the API server documentation (https://github.com/OpenSourceOrg/api/blob/master/doc/endpoints.md). ...
OpenSourceOrg/python-opensource
setup.py
Python
mit
772
""" Map loader for TMX Files bitcraft (leif.theden at gmail.com) v.7 -- for python 3.x If you have any problems, please contact me via email. Tested with Tiled 0.7.1 for Mac. released under the LGPL v3 ====================================================================== Design Goals: Simple api Memory eff...
z9484/ALoMA
pytmx/tmxloader3.py
Python
gpl-3.0
18,775
# coding=utf-8 # Licensed Materials - Property of IBM # Copyright IBM Corp. 2016,2017 """ REST API bindings for IBM® Streams & Streaming Analytics service. **************** Streams REST API **************** The Streams REST API provides programmatic access to configuration and status information for IBM Streams obje...
wmarshall484/streamsx.topology
com.ibm.streamsx.topology/opt/python/packages/streamsx/rest.py
Python
apache-2.0
16,307
import unittest import os import redis import sys from impulsare_config import Reader from redis.exceptions import ConnectionError from impulsare_distributer import QueueManager base_dir = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.abspath(base_dir + '/../')) def fake_print(message: str, ...
impulsare/distributer
tests/test_queue_manager.py
Python
agpl-3.0
2,350
import json from indra.statements import * from indra.preassembler import Preassembler from indra.ontology.world import world_ontology from indra.preassembler.custom_preassembly import * import indra.tools.assemble_corpus as ac def test_event_assemble_location(): rainfall = Concept('rainfall') loc1 = RefConte...
johnbachman/belpy
indra/tests/test_custom_preassembly.py
Python
mit
2,099
from PyQt4 import Qt, QtCore, Qt class OkScrollArea(Qt.QScrollArea): def __init__(self, parent=None): Qt.QScrollArea.__init__(self, parent) self.setVerticalScrollBar(OkScrollBar()) self.setStyleSheet("QScrollArea{" "border: 0px;" "background: #323232;"...
ghold/OneKeySql
onekey/OkScroll.py
Python
apache-2.0
1,321
__VERSION__='0.0.4'
omarkhan/bookkeeper
swingtix/bookkeeper/__init__.py
Python
agpl-3.0
20
import toolz from toolz.curried import take, first, second, sorted, merge_with def test_take(): assert list(take(2)([1, 2, 3])) == [1, 2] def test_first(): assert first is toolz.itertoolz.core.first def test_merge_with(): assert merge_with(sum)({1: 1}, {1: 2}) == {1: 3} def test_sorted(): assert...
obmarg/toolz
toolz/tests/test_curried.py
Python
bsd-3-clause
378
#---------------------------------------------------------------------- # Name: wx.lib.stattext # Purpose: A generic wxGenStaticText class. Using this should # eliminate some of the platform differences in wxStaticText, # such as background colours and mouse sensitivity. # # ...
ktan2020/legacy-automation
win/Lib/site-packages/wx-3.0-msw/wx/lib/stattext.py
Python
mit
6,147
""" Base objects for the harvester plugins. """ import abc from ..base import PluginBase class CrawlerPluginBase(PluginBase): __metaclass__ = abc.ABCMeta def __init__(self, url, conf=None): self.url = url self.conf = conf or {} @abc.abstractmethod def fetch_data(self, storage): ...
opendatatrentino/opendata-harvester
harvester/ext/crawler/base.py
Python
bsd-2-clause
609
"""Module for testing long and long raw variables.""" import sys class TestLongVar(BaseTestCase): def __PerformTest(self, a_Type, a_InputType): self.cursor.execute("truncate table Test%ss" % a_Type) longString = "" for i in range(1, 11): char = chr(ord('A') + i - 1) ...
jayceyxc/hue
desktop/core/ext-py/cx_Oracle-5.2.1/test/LongVar.py
Python
apache-2.0
4,054
from __future__ import unicode_literals __version__ = '1.0.1'
ORGAN-IZE/fiftythree-client
fiftythree/__init__.py
Python
mit
63
# (c) 2015, 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 the License, or # (at your option) any lat...
agaurav/ansible
lib/ansible/plugins/action/template.py
Python
gpl-3.0
7,745
""" reporter used by gui.py """ import sys from pylint.interfaces import IReporter from pylint.reporters import BaseReporter from logilab.common.ureports import TextWriter class GUIReporter(BaseReporter): """saves messages""" __implements__ = IReporter extension = '' def __init__(self, gui, output...
JetChars/vim
vim/bundle/python-mode/pymode/libs/pylint/reporters/guireporter.py
Python
apache-2.0
682
from datetime import timedelta from django.contrib import messages from django.contrib.auth.models import AnonymousUser from freezegun import freeze_time from ws import models from ws.messages.lottery import Messages from ws.tests import factories from ws.tests.messages import MessagesTestCase from ws.utils.dates imp...
DavidCain/mitoc-trips
ws/tests/messages/test_lottery.py
Python
gpl-3.0
7,289
from ..question import Question from StringIO import StringIO import dpath import yaml import os __all__ = ["Context"] def _class_loader(cls): def result(loader, node): fields = loader.construct_mapping(node, deep=True) return cls(**fields) return result yaml.add_constructor("!Question",...
jackmaney/interrogator
interrogator/context/context.py
Python
mit
2,305
# python setup.py sdist upload from setuptools import setup setup( name='canister', version='1.5.2', description='A bottle wrapper to provide logging, sessions and authentication.', url='https://github.com/dagnelies/canister', author='Arnaud Dagnelies', author_email='arnaud.dagnelies@gmail.com'...
dagnelies/canister
setup.py
Python
mit
572
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_stressboard ------------ Tests for `stressboard` modules module. """ import os import shutil import unittest from stressboard import models class TestStressboard(unittest.TestCase): def setUp(self): pass def test_something(self): pas...
EnTeQuAk/stressboard
tests/test_models.py
Python
bsd-3-clause
359