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/env python import unittest from werkzeug.exceptions import NotFound, Forbidden from tests.logic_t.layer.LogicLayer.util import generate_ll class TaskPrioritizeBeforeLogicLayerTest(unittest.TestCase): def setUp(self): self.ll = generate_ll() self.pl = self.ll.pl def test_add_prio...
izrik/tudor
tests/logic_t/layer/LogicLayer/test_task_prioritize.py
Python
gpl-2.0
36,403
# -*- coding: utf-8 -*- # Default libs import json import logging # Project modules from ..settings import SKETCHTOOL from ..utils import execute, extension from .parse import parse_pages logger = logging.getLogger(__name__) def is_sketchfile(src_path): ''' Returns True if src_path is a sketch file ''' if exten...
Pixelapse/pyglass
pyglass/sketch/api.py
Python
mit
2,517
def median(a): a = sorted(a) b = len(a) if b%2 == 0: return (a[len(a)/2] + a[(len(a)/2) - 1]) / 2.0 else: return a[(len(a)-1)/2]
vpstudios/Codecademy-Exercise-Answers
Language Skills/Python/Unit 8/2-Practice makes perfect/Listing your problems/15-Median.py
Python
mit
161
# Copyright 2011 Rackspace # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2013 IBM Corp. # 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 # # ...
rajalokan/nova
nova/tests/unit/network/test_manager.py
Python
apache-2.0
172,081
from django.views.generic import TemplateView class MainView(TemplateView): template_name = 'main.html' main_page = MainView.as_view()
zvadim/django-stored-settings
example/my_app/views.py
Python
mit
142
import logging from numpy.lib.twodim_base import diag, eye from numpy.ma.core import asarray import os from os.path import expanduser from pickle import dump from independent_jobs.tools.Log import Log from kameleon_mcmc.distribution.Gaussian import Gaussian from kameleon_mcmc.mcmc.MCMCChain import MCMCChain from kamel...
karlnapf/ozone-roulette
ozone/scripts/sample_ozone_posterior_ground_truth.py
Python
bsd-2-clause
1,847
from venusian.tests.fixtures import decorator @decorator(superclass=True) class SuperClass(object): pass @decorator(subclass=True) class SubClass(SuperClass): pass
gamesbrewer/kegger
kegger/myapp/libs/venusian/tests/fixtures/classdecorator.py
Python
cc0-1.0
175
from flask.ext.wtf import Form from wtforms import StringField, BooleanField, TextAreaField from wtforms.validators import DataRequired, Length class EditForm(Form): password = StringField('password', validators=[DataRequired()]) Retype_password = StringField('Retype_password', validators=[Length(min=0, max=1...
Mugunthangit/Flask-Basic-Application
form.py
Python
lgpl-3.0
782
__package__ = 'archivebox.parsers' import re from typing import IO, Iterable from datetime import datetime from ..index.schema import Link from ..util import ( htmldecode, enforce_types, ) @enforce_types def parse_netscape_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]: """Parse netscape...
pirate/bookmark-archiver
archivebox/parsers/netscape_html.py
Python
mit
1,296
# -*- coding: utf-8 -*- """ *************************************************************************** r_what_color.py --------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ****************************...
dwadler/QGIS
python/plugins/processing/algs/grass7/ext/r_what_color.py
Python
gpl-2.0
1,324
# 6.00 Problem Set 8 # # Intelligent Course Advisor # # Name: Felipo Soranz # Time: # 18:18 started # 18:24 problem 1 # 19:00 problem 2 # 19:17 problem 3 import time SUBJECT_FILENAME = "subjects.txt" VALUE, WORK = 0, 1 # # Problem 1: Building A Subject Dictionary # def loadSubjects(filename): """ Returns ...
feliposz/learning-stuff
python/ps8.py
Python
mit
11,093
from django.db import models from django.contrib import auth from threading import Lock from vt_manager_kvm.models.VTServer import VTServer from vt_manager_kvm.models.Action import Action from vt_manager_kvm.models.VirtualMachine import VirtualMachine from vt_manager_kvm.models.XenVM import XenVM from vt_manager_kvm.ut...
ict-felix/stack
vt_manager_kvm/src/python/vt_manager_kvm/models/XenServer.py
Python
apache-2.0
3,740
# 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 wtforms import BooleanField, StringField from wtforms.valida...
mic4ael/indico
indico/modules/designer/forms.py
Python
mit
976
#!/usr/bin/env python import rospy import actionlib from ros_start.msg import GoUntilBumperAction from ros_start.msg import GoUntilBumperGoal def go_until_bumper(): action_client = actionlib.SimpleActionClient('bumper_action', GoUntilBumperAction) action_client.wait_for_server() goal = GoUntilBumperGoal()...
ega1979/ros_book_programs
ros_start/src/ros_start/bumper_client.py
Python
bsd-2-clause
757
def func(): value = "not-none" <caret>if value is None: print("None") else: print("Not none")
siosio/intellij-community
python/testData/intentions/PyInvertIfConditionIntentionTest/generalElse.py
Python
apache-2.0
122
''' Window GLUT: windowing provider based on GLUT ''' __all__ = ('MTWindowGlut', ) import sys import os from pymt.ui.window import BaseWindow from pymt.logger import pymt_logger from pymt.base import stopTouchApp, getEventLoop from OpenGL.GLUT import GLUT_RGBA, GLUT_DOUBLE, GLUT_ALPHA, GLUT_DEPTH, \ GLUT_MULT...
nuigroup/pymt-widgets
pymt/ui/window/win_glut.py
Python
lgpl-3.0
4,290
# -*- coding: utf-8 -*- # © 2015-2017 Therp BV <https://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_base_bank_account_number_unique
acsone/bank-statement-import
base_bank_account_number_unique/tests/__init__.py
Python
agpl-3.0
187
#"10 Minutes to pandas" tutorial import pandas as pd import numpy as np import matplotlib.pyplot as plt class ObjectCreator: """Object creation demo""" def __init__(self): self.data = [] def createSeries(self): s = pd.Series( [1,3,5,np.nan,6,8] ); return s def createDataFram...
mattmcd/PyAnalysis
mda/tutorial/pandastut.py
Python
apache-2.0
1,920
''' Support of WM_TOUCH message (Window platform) ============================================= ''' __all__ = ('WM_MotionEventProvider', 'WM_MotionEvent') import os from kivy.input.providers.wm_common import (WM_TABLET_QUERYSYSTEMGESTURE, GWL_WNDPROC, QUERYSYSTEMGESTURE_WNDPROC, WM_TOUCH, WM_MOUSEMOVE, ...
nuigroup/kivy
kivy/input/providers/wm_touch.py
Python
lgpl-3.0
8,481
from astropy.coordinates import SkyCoord import astropy.units as u import datetime from datetime import date from astropy.coordinates import SkyCoord from astropy.coordinates import ICRS, Galactic, AltAz from astropy.time import Time import astropy.units as u import os from subprocess import Popen import threading im...
transientlunatic/acreroad_1420
acreroad_1420/schedule.py
Python
bsd-3-clause
14,769
# # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2012 Star2Billing S.L. # # The Init...
faddai/newfies-dialer
newfies/dialer_cdr/urls.py
Python
mpl-2.0
878
#!/usr/bin/python # # 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 b...
dietrichc/streamline-ppc-reports
examples/adwords/v201406/shopping/get_product_category_taxonomy.py
Python
apache-2.0
3,039
import tensorflow as tf from tensorflow.python.ops.rnn_cell import LSTMStateTuple import dnc import utility from cached_dnc import cached_memory import numpy as np class CachedDNC(dnc.DNC): def __init__(self, controller_class, input_size, output_size, max_sequence_length=100, memory_words_num = 2...
thaihungle/deepexp
gen-dnc/cached_dnc/cached_dnc.py
Python
mit
22,632
import os, os.path import string import cherrypy from PIL import Image import time, datetime # Hard Coded Image Size Required (pixel width) N = 200 MAX_PIXELS = N**2 PATH = './public/images/counter.png' STATIC_PATH = '/static/images/counter.png' # Takes a text string intended for RLE decoding and santizes it # Interp...
sssundar/boogie
src/barebones/barebones.py
Python
gpl-3.0
3,300
import stripe from stripe.test.helper import StripeResourceTest class TransferTest(StripeResourceTest): def test_list_transfers(self): stripe.Transfer.all() self.requestor_mock.request.assert_called_with( 'get', '/v1/transfers', {} ) def test_cance...
opencloudinfra/orchestrator
venv/Lib/site-packages/stripe/test/resources/test_transfers.py
Python
gpl-3.0
581
'''***************************************************************************** AToMPM - A Tool for Multi-Paradigm Modelling Copyright (c) 2011 Raphael Mannadiar (raphael.mannadiar@mail.mcgill.ca) This file is part of AToMPM. AToMPM is free software: you can redistribute it and/or modify it under the terms of the G...
hergin/DelTa
mt/mtworker.py
Python
gpl-3.0
9,488
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = "Osman Baskaya" """ """ import sys import os from embedding_utils import concat_XYw, read_embedding_vectors from fastsubs_utils import read_sub_vectors embeddings = read_embedding_vectors('aiku/on/scode-pos-90/noun.scode.gz') print "reading embedding done" su...
ai-ku/uwsd
run/test_embedding_concate.py
Python
mit
515
import os import sys import magic import re import logging import subprocess from time import sleep import RPi.GPIO as GPIO from utils import findBin, whichUSBboard, getBoardConfigs from target import Target from pin import Pin class NAsatbus(Target): """ Return an instance of Target specific to the NanoAvionics S...
kubostech/KubOS
test/integration/jenkinsnode/cistack/nasatbus.py
Python
apache-2.0
3,378
try: print "a" * "b" except TypeError as e: print e try: print "a" * 3.4 except TypeError as e: print e try: print 3.4 * "b" except TypeError as e: print e try: print "a" * [2] except TypeError as e: print e try: print [2] * "b" except TypeError as e: print e
ArcherSys/ArcherSys
skulpt/test/run/t514.py
Python
mit
308
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains functions for reading and writing HDF5 tables that are not meant to be used directly, but instead are available as readers/writers in `astropy.table`. See :ref:`astropy:table_io` for more details. """ import os import warnings i...
mhvk/astropy
astropy/io/misc/hdf5.py
Python
bsd-3-clause
14,459
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: model.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflect...
pprett/grpc-kubernetes-skl-tutorial
skl-server/model_pb2.py
Python
bsd-3-clause
2,225
## ## This copyrighted software is distributed under the GPL v2.0 license. ## See the LICENSE file for more details. ## ## Fly Dispenser class file import sys import os import numpy as np import time sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import flysorterSerial class FlyDispenser: MaxThic...
FlySorterLLC/SantaFeControlSoftware
WorkspaceModules/FlyDispenser.py
Python
gpl-2.0
2,367
# -*- coding: utf-8 -*- """ Created on Mon Jul 11 12:32:26 2016 @author: login """ import os p1 = '/Users/login/Documents/GLM_Wrapper/glm_case_folders/testcase' p2 = '/Users/login/Documents/GLM_Wrapper/GLM_Executables/examples_2.2/coldlake/fabm' handles = [open(os.path.join(i,'glm2.nml'), 'r') for i in [p1, p2]] for...
karoraw1/GLM_Wrapper
bin/format_test.py
Python
mit
435
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Edgewall Software # Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2006 Matthew Good <trac@matt-good.net> # Copyright (C) 2005-2006 Christian Boos <cboos@neuf.fr> # All rights reserved. # # This software is licensed as described in the fi...
zjj/trac_hack
trac/util/text.py
Python
bsd-3-clause
10,014
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <alquerci@email.com> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. from __future__ import absolute_import; import unittest; from pymfony.compo...
pymfony/event_dispatcher
test/test_container_aware_event_dispatcher.py
Python
mit
6,415
from math import degrees from approxeng.chassis import HoloChassis, DeadReckoning, rotate_vector, Motion from approxeng.chassis.dynamics import MotionLimit, RateLimit from approxeng.input import Controller from approxeng.task import Task from euclid import Vector2 from triangula.hardware import Arduino, P017LCD from ...
BaseBot/Triangula
src/python/triangula/manual_motion.py
Python
apache-2.0
6,233
# python setup file, uses setuptools and easy_install instead of distutils from setuptools import setup, find_packages setup( # distribution name name="DDM", version="0.1", description="DDM, A distributed download manager", long_description="Nothing yet ...", author="amin", author_email="am...
dotamin/migmig
setup.py
Python
agpl-3.0
732
# Copyright (C) 2016 Maxime Busy # # 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 program is distributed in th...
Pandhariix/FalconBindings
falcon_controller.py
Python
gpl-3.0
2,111
"""Implementation of JSONDecoder """ import re import sys import struct from json import scanner try: from _json import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES = '7FF800000000...
teeple/pns_server
work/install/Python-2.7.4/Lib/json/decoder.py
Python
gpl-2.0
13,882
# # Copyright (c) 2013-2014 Tom Keffer <tkeffer@gmail.com> # # See the file LICENSE.txt for your full rights. # # $Id$ # """Publish weather data to RESTful sites such as the Weather Underground. GENERAL ARCHITECTURE Each protocol uses two classes: o A weewx service, that runs in...
crmorse/weewx-waterflow
bin/weewx/restx.py
Python
gpl-3.0
67,857
from google import search # importing the search module from google import webbrowser def search_first_link(input_query): for url in search(input_query): print(url) webbrowser.open(url) break
shafaypro/PYSHA
__linksearch.py
Python
gpl-3.0
232
# coding: utf8 { '!langcode!': 'es', '!langname!': 'Español', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%s %%{ro...
ccpgames/eve-metrics
web2py/applications/welcome/languages/es.py
Python
mit
15,414
## # Copyright (c) 2006-2014 Apple 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 l...
trevor/calendarserver
txdav/who/directory.py
Python
apache-2.0
19,009
import logging;logging.basicConfig(level=logging.INFO) import asyncio,os,json,time from datetime import datetime from aiohttp import web def index(request): return web.Response(body=b'<h1>HelloTest<h1>') @asyncio.coroutine def init(loop): app=web.Application(loop=loop) app.router.add_route('GET','/',index) srv =...
thankslife/first_web
www/app.py
Python
gpl-3.0
518
# -*- coding: utf-8 -*- ############################################################################## # # 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 #...
OpenAT/cu_eura
eura_config/__init__.py
Python
agpl-3.0
904
'''Send SMTP email alerts in case of sump pump failure.''' # Raspi-sump, a sump pump monitoring system. # Al Audet # http://www.linuxnorth.org/raspi-sump/ # # All configuration changes should be done in raspisump.conf # MIT License -- http://www.linuxnorth.org/raspi-sump/license.html import os import time import smtp...
alaudet/raspi-sump
raspisump/alerts.py
Python
mit
4,886
# -*- coding: utf-8; -*- # # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. Crate licenses # this file to you under the Apache License, Version 2.0 (the "License"...
crate/crate-python
src/crate/client/sqlalchemy/dialect.py
Python
apache-2.0
11,751
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import psutil import random if os.name == 'posix': import resource els...
mindnervestech/mnrp
openerp/service/server.py
Python
agpl-3.0
36,292
class SequenceError(Exception) : def __init__(self, desc, tb, deepertb): super().__init__(desc) self.tb = tb self.deepertb = deepertb
szecsi/Gears
GearsPy/SequenceError.py
Python
gpl-2.0
164
""" Dispatches functions like ``sum`` to builtins, numpy, or blaze depending on input >>> from blaze import sum, symbol >>> sum([1, 2, 3]) 6 >>> type(sum([1, 2, 3])).__name__ 'int' >>> type(sum(np.array([1, 2, 3], dtype=np.int64))).__name__ 'int64' >>> t = symbol('t', 'var * {x: int, y: int}') >>> type(sum(t.x))._...
ContinuumIO/blaze
blaze/expr/functions.py
Python
bsd-3-clause
3,572
### ############################################################################################################ ### # ### # Project: # videolinks - by The Highway 2013. ### # Author: # The Highway ### # Version: # 2.x (ever changing) ### # Description: # My collection of tools for metadata and video url ...
HIGHWAY99/plugin.video.theanimehighway
videolinks2.py
Python
gpl-3.0
70,878
# -*- coding: utf-8 -*- import Tkinter, tkMessageBox, tkFileDialog, time, re, os, shutil, codecs, imp, tweepy, networkx as nx from Tkinter import * from keys import * ##Autenticacion con Tweepy y listas globales auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) ...
paredespablo/NodosApp
lib/pyfollowers.py
Python
bsd-3-clause
13,446
def itemTemplate(): # Doesn't work because of https://github.com/projectswg/engine/blob/master/src/engine/resources/objects/Baseline.java#L446 #return ['object/draft_schematic/furniture/shared_furniture_hide_rack_s03.iff'] # just returning a dummy template for now return ['object/tangible/loot/loot_schematic/shar...
ProjectSWGCore/NGECore2
scripts/loot/lootItems/rarelootchest/animal_hide_rack_style_3.py
Python
lgpl-3.0
350
n = int(input("Enter a number: ")) i = 1 a = [] for i in range(1,n/2+1): if n % i == 0: a.append(i) print a
yadavpooja/practice
assign1/divisor.py
Python
gpl-3.0
121
from __future__ import print_function from collections import OrderedDict from importlib import import_module from . import Device def getDeviceClass(name): """Return a device class given its name. The class must have been defined already, or it must be importable from ``acq4.devices.name``. """ devC...
pbmanis/acq4
acq4/devices/__init__.py
Python
mit
1,403
from __future__ import print_function, division from sympy.combinatorics.perm_groups import PermutationGroup from sympy.combinatorics.permutations import Permutation from sympy.utilities.iterables import uniq from sympy.core.compatibility import range _af_new = Permutation._af_new def DirectProduct(*groups): ""...
wxgeo/geophar
wxgeometrie/sympy/combinatorics/group_constructs.py
Python
gpl-2.0
2,030
import os, scipy import scipy.ndimage as nd from pyKinectTools.utils.DepthUtils import posImage2XYZ from pyKinectTools.algs.BackgroundSubtraction import extract_people, removeNoise from pyKinectTools.algs.GeodesicSkeleton import * from pyKinectTools.algs.PictorialStructures import * from pyKinectTools.algs.STIP import ...
colincsl/pyKinectTools
pyKinectTools/scripts/Old_Experiments/PoseByGeodesicExtrema.py
Python
bsd-2-clause
3,964
"""Convenient HTTP UserAgent class. This is a subclass of urllib2.OpenerDirector. Copyright 2003-2006 John J. Lee <jjl@pobox.com> This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ impor...
Pathoschild/stewbot
stewbot/components/modules/mechanize/_useragent.py
Python
isc
14,351
# vim:fileencoding=utf-8:noet # WARNING: using unicode_literals causes errors in argparse from __future__ import (division, absolute_import, print_function) import argparse import sys from itertools import chain from powerline.lib.overrides import parsedotval, parse_override_var from powerline.lib.dict import mergea...
gorczynski/dotfiles
vim/bundle/powerline/powerline/commands/main.py
Python
gpl-3.0
6,647
# -*- coding: utf-8 -*- """ Django-machina ============== Django-machina is a Django forum engine for building powerful community driven websites. """ from __future__ import unicode_literals import os __version__ = '0.7.0.dev' MACHINA_VANILLA_APPS = [ 'machina', 'machina.apps.forum', 'm...
franga2000/django-machina
machina/__init__.py
Python
bsd-3-clause
1,428
""" Restore Grids Restore the view dependant properties of the saved grids Only single segment (i.e. non-split) grids are supported yet Grid leaders are added as needed, but there is no API to restore them Only saved grids will be restored. If there are preselected grids, only they will be restored. Handy to fine-...
gtalarico/pyrevitplus
pyRevitPlus.tab/VP Tools.panel/Grids.pulldown/Restore Grids.pushbutton/script.py
Python
gpl-3.0
7,146
# Copyright (C) 2013 Johan Hake # # This file is part of DOLFIN. # # DOLFIN 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 # (at your option) any later version. # # ...
FEniCS/dolfin
cmake/scripts/copy-swig-files.py
Python
lgpl-3.0
2,000
from contrib.rfc3315.client import dhcpv6_transmission_of_renew_messages as suite from scapy.all import * from veripy.testability import ComplianceTestTestCase class DHCPv6TransmissionOfRenewMessagesTestCase(ComplianceTestTestCase): def test_flow_label_DHCP_normal_test_case(self): #Start by sending s...
mwrlabs/veripy
contrib/rfc3315/client/tests/dhcpv6_transmission_of_renew_messages_client_tests.py
Python
gpl-3.0
12,104
#!/usr/bin/python # # Copyright (c) 2011 Red Hat, Inc. # # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or implied...
beav/pulp
server/test/unit/test_repo_importer_manager.py
Python
gpl-2.0
21,359
import os from os.path import expanduser DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'jmbo', 'USER': 'postgres', 'PASSWORD': '', 'HOST': '', 'PORT': '', } } INSTALLED_APPS = ( 'jmbo_sitemap', 'fou...
praekelt/jmbo-sitemap
test_settings.py
Python
bsd-3-clause
1,516
from itertools import cycle import random import sys import pygame from pygame.locals import * FPS = 30 SCREENWIDTH = 288 SCREENHEIGHT = 512 # amount by which base can maximum shift to left PIPEGAPSIZE = 100 # gap between upper and lower part of pipe BASEY = SCREENHEIGHT * 0.79 # image, sound and hitmask d...
Yaoshicn/FlappyFrog
flappy.py
Python
gpl-3.0
16,196
from sivicncdriver.app import main main()
Klafyvel/SiviCNCDriver
run.py
Python
gpl-3.0
42
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet class TestAssemble...
ivmech/iviny-scope
lib/xlsxwriter/test/worksheet/test_cond_format07.py
Python
gpl-3.0
4,407
# coding:utf-8 ''' Created on 19/1/2015 @author: PC30 ''' from flaskext.mysql import MySQL#importar mysql from flask import Flask#importar flask class DBcon(): ''' classdocs ''' pass def __init__(self): ''' Constructor ''' pass def conexion(self): ...
git-pedro-77/proyecto_final_p_f
proyectoITSAE/ec/edu/itsae/conn/DBcon.py
Python
gpl-2.0
772
from PyQt5 import QtCore, QtGui, QtWidgets import random from .uic_files import thumbnails_ui class ThumbnailsDock(QtWidgets.QDockWidget): def __init__(self, parent=None): super().__init__(parent=parent) self.ui = thumbnails_ui.Ui_Thumbnails() self.ui.setupUi(self) self.thumb_si...
mstuttgart/pynocchio-comic-reader
pynocchio/thumbnails.py
Python
gpl-3.0
2,964
#!/usr/bin/env python3 # Copyright (C) 2014 Russell Haley # # This file is part of euler. # # 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 optio...
yump/euler
p7.py
Python
gpl-3.0
913
# ========================================================================= # Copyright 2012-present Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the Licens...
yunify/qingcloud-cli
qingcloud/cli/iaas_client/actions/volume/create_volumes.py
Python
apache-2.0
2,807
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_yuuno ---------------------------------- Tests for `yuuno` module. """ import unittest from IPython.testing import globalipapp from traitlets import Bool from yuuno import Yuuno from yuuno.core.settings import Settings from yuuno_ipython.ipython.feature impo...
stuxcrystal/yuuno
tests/test_ipython_environment.py
Python
lgpl-3.0
2,785
"""passlib.handlers.sha2_crypt - SHA256-Crypt / SHA512-Crypt""" #============================================================================= # imports #============================================================================= # core import hashlib import logging; log = logging.getLogger(__name__) # site # pkg fro...
morreene/tradenews
venv/Lib/site-packages/passlib/handlers/sha2_crypt.py
Python
bsd-3-clause
21,169
import argparse from wrappers import routahe class RoutaheAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): print(values) routaheResponse = routahe(values[0], values[1]) setattr(namespace, self.dest, routaheResponse)
tommikarkas/cowsay-slackbot
src/RoutaheAction.py
Python
mit
290
#!/usr/bin/env python3 import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_crypto_fields.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
erikvw/django-crypto-fields
manage.py
Python
gpl-3.0
264
import os import collections import operator import timeit import megadb.settings as settings from megadb.tree import LeafNode, TreeNode from megadb.algebra.plan import Field class Plan(object): def open(self): raise NotImplementedError() def run(self): start_at = timeit.default_timer() ...
itswindtw/pyMega
megadb/execution/plan.py
Python
mit
4,998
from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from grappelli.dashboard import modules, Dashboard from grappelli.dashboard.utils import get_admin_site_name class CustomIndexDashboard(Dashboard): """ Custom index dashboard for www. """ def ini...
palankai/xadrpy
src/xadrpy/management/skeletons/web/project_template/project_name/dashboard.py
Python
lgpl-3.0
1,736
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import functools import os import sys import constants sys.path.insert(0, constants.SOURCE_ROOT) from chromite.buildbot import rep...
coreos/chromite
buildbot/repository_unittest.py
Python
bsd-3-clause
3,059
import ujson, json import sets import io busdata = [] with open('business.json', 'rb') as bus: for line in bus: business = ujson.loads(line) busdata.append(business) print "Opened Yelp JSON file" citydict = {} citylist = [] for business in busdata: citylist.append(business['city'].lower()) c...
tsmanikandan/CSE469-Yelp
yelp_data_parsing.py
Python
mit
1,300
#!/usr/bin/python # # Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com> # # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
mheap/ansible
lib/ansible/modules/cloud/azure/azure_rm_postgresqldatabase.py
Python
gpl-3.0
10,823
######################################################################## # $HeadURL $ # File: Request.py # Date: 2012/07/16 13:43:45 ######################################################################## """ :mod: Request .. module: Request :synopsis: request implementation request implementation """ # for proper...
fibbo/DIRAC
RequestManagementSystem/Client/Request.py
Python
gpl-3.0
15,135
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-securitycenter
google/cloud/securitycenter_v1p1beta1/__init__.py
Python
apache-2.0
4,078
import numpy as np import uncertainties.unumpy as unp from uncertainties import ufloat import math from scipy.optimize import curve_fit import matplotlib.pyplot as plt from pint import UnitRegistry u = UnitRegistry() Q_ = u.Quantity #umrechnung einheiten mit var.to('unit') # Einheiten für pint:dimensionless, meter, s...
stefangri/s_s_productions
PHY341/V_302_Brueckenschaltung/Messdaten/auswertung.py
Python
mit
10,629
import requests import pytest from suite.fixtures import PublicEndpoint from suite.resources_utils import create_secret_from_yaml, delete_secret, replace_secret,\ ensure_connection_to_public_endpoint, wait_before_test from suite.resources_utils import create_items_from_yaml, delete_items_from_yaml, create_example_...
nginxinc/kubernetes-ingress
tests/suite/test_jwt_auth_mergeable.py
Python
apache-2.0
9,452
# Copyright (c) 2013 Mirantis, 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...
satish-avninetworks/murano
murano/tests/unit/common/test_is_different.py
Python
apache-2.0
3,276
""" MetPX Copyright (C) 2004-2006 Environment Canada MetPX comes with ABSOLUTELY NO WARRANTY; For details type see the file named COPYING in the root of the source directory tree. """ import os, sys from ColumboPaths import * print os.getcwd() os.chdir(CLUES) print os.getcwd() file = open('mytest.txt', "r") lines =...
khosrow/metpx
columbo/lib/chroot.py
Python
gpl-2.0
423
# coding=utf-8 """ Collect stats via MX4J from Kafka #### Dependencies * urllib2 * xml.etree """ import urllib2 from urllib import urlencode from xml.etree import ElementTree try: from ElementTree import ParseError as ETParseError except ImportError: ETParseError = Exception import diamond.collector ...
MediaMath/Diamond
src/collectors/kafka/kafka.py
Python
mit
4,093
from libsaas.services import base from . import resource class TokensBaseResource(resource.StripeResource): path = 'tokens' def update(self, *args, **kwargs): raise base.MethodNotSupported() def delete(self, *args, **kwargs): raise base.MethodNotSupported() class Token(TokensBaseReso...
ducksboard/libsaas
libsaas/services/stripe/tokens.py
Python
mit
520
import numpy as np from brew.base import Ensemble from brew.metrics.diversity.paired import kuncheva_double_fault_measure from .base import DCS class DSKNN(DCS): """DS-KNN The DS-KNN selects an ensemble of classifiers based on their accuracy and diversity in the neighborhood of the test sample. ...
thypad/brew
skensemble/selection/dynamic/dsknn.py
Python
mit
3,563
#!/usr/bin/env python """ A very simple and not 100% compliant parser for the OBO file format This parser is supplied "as is". It is not an official parser, it might refuse to parse perfectly valid OBO files, or it might parse perfectly invalid OBO files; on the other hand, it can parse the official Gene Ontology OBO ...
marco-mariotti/selenoprofiles
libraries/annotations/GO/Parsers/oboparser.py
Python
gpl-2.0
13,919
# Copyright initOS GmbH 2016 # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import website from . import res_config
Vauxoo/website
website_canonical_url/models/__init__.py
Python
agpl-3.0
141
import numpy as np from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right from pySDC.implementations.controller_classes.allinclusive_classic_nonMPI import allinclusive_classic_nonMPI from pySDC.implementations.problem_classes.PenningTrap_3D import penningtrap from pySDC.implementat...
danielru/pySDC
tutorial/step_3/B_adding_statistics.py
Python
bsd-2-clause
4,043
from .core import File from .OpenEphys import * __version__ = "0.1"
CINPLA/expipe-dev
py-open-ephys/pyopenephys/__init__.py
Python
gpl-3.0
69
## @file # This file is used to parse a xml file of .PKG file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. The f...
google/google-ctf
third_party/edk2/BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py
Python
apache-2.0
11,611
import math import random from hokuyolx import HokuyoLX # Dimensions of the playing field WORLD_X = 3000 WORLD_Y = 2000 INT_MAX = 99999990 mark_r = 40 landmarks = [[WORLD_X/2, 0.0], [WORLD_X+mark_r, WORLD_Y], [-mark_r, WORLD_Y]] # position of 4 landmarks in (x, y) format. # Noises distance_noise = 5.0 # Noise par...
SkRobo/Eurobot-2017
HighLevel/localisation/ParticleFilter.py
Python
mit
8,791
# hashids Python port # Written by Eric Martel - www.ericmartel.com # Licensed under MIT - see LICENSE import re class hashids(): version = '0.0.1' __alphabet = 'xcS4F6h89aUbideAI7tkynuopqrXCgTE5GBKHLMjfRsz' __primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43] __minHashLength = 0 def _...
hanneshapke/hashids.py
hashids.py
Python
mit
7,591
#!/usr/bin/env python2.7 def printer(): print [x for x in range(10)] if __name__ == '__main__': printer()
eselyavka/my_tests
dummy.py
Python
apache-2.0
116
# vim: tabstop=4 shiftwidth=4 softtabstop=4 '''------------------------------------------------------------------------- Copyright IBM Corp. 2015, 2015 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 c...
os-cloud-storage/openstack-workload-disaster-recovery
dragon/db/sqlalchemy/api.py
Python
apache-2.0
12,988
def checkpan(nstr): return sorted(nstr) == sorted("123456789") def gen_nums(limit): numbers = [] for i in xrange(limit): concat = '' x = 1 while len(concat) < 9: concat+=str(i*x) x+=1 if checkpan(concat): numbers.append(int(concat)) re...
jamtot/PyProjectEuler
38 - Pandigital multiples/pm.py
Python
mit
495