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
# ---------------------------------------------------------------------------- # Copyright (C) 2013-2014 Huynh Vi Lam <domovilam@gmail.com> # # This file is part of pimucha. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
domovilam/pimucha
piHAparsers/trxdetectors.py
Python
gpl-3.0
2,943
from system.core.model import Model class User(Model): def __init__(self): super(User, self).__init__() def get_user(self, user_id): query = "SELECT * FROM users WHERE user_id = :user_id LIMIT 1" data = { "user_id": user_id } user = self.db.get_one(query, d...
RydrDojo/Ridr_app
app/models/User.py
Python
mit
2,163
import pyjd # this is dummy in pyjs from pyjamas.ui.Button import Button from pyjamas.ui.RootPanel import RootPanel from pyjamas.ui.HTML import HTML from pyjamas.ui.DockPanel import DockPanel from pyjamas.ui import HasAlignment from pyjamas.ui.Hyperlink import Hyperlink from pyjamas.ui.VerticalPanel import VerticalPan...
pyrrho314/recipesystem
trunk/astrodata/adutils/reduceutils/pyjamaface/prsproxygui/KitchenSink.py
Python
mpl-2.0
4,170
#! /usr/bin/env python3 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more ...
nsnam/ns-3-dev-git
src/internet/test/examples-to-run.py
Python
gpl-2.0
607
def test_example(app): app.litecard_helper.login_admin() app.get("http://localhost/litecart/admin/?app=countries&doc=countries") app.get("http://localhost/litecart/admin/?app=countries&doc=edit_country") links=app.driver.find_elements_by_css_selector("i.fa.fa-external-link") for n in range(0,len...
talareq/selenium
test/link_opener.py
Python
apache-2.0
753
# encoding: utf-8 """ Standard cells for the Brian module. :copyright: Copyright 2006-2016 by the PyNN team, see AUTHORS. :license: CeCILL, see LICENSE for details. """ import logging from brian import ms from pyNN.standardmodels import synapses, build_translations from ..simulator import state logger = logging.get...
anupkdas-nus/global_synapses
pyNN-dispackgaes/brian/standardmodels/synapses.py
Python
gpl-3.0
7,403
from flask import Flask app = Flask(__name__) app.config['DEBUG'] = True # Note: We don't need to call run() since our application is embedded within # the App Engine WSGI application server. import sys sys.path.insert(0, 'lib') import json import urllib, urllib2 import httplib import time from BeautifulSoup import ...
colinmcd94/kickdata
main.py
Python
apache-2.0
4,798
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Cyril Sester <csester@compassion.ch> # # The licence is in the file __op...
ndtran/compassion-accounting
recurring_contract/model/__init__.py
Python
agpl-3.0
538
# coding=utf-8 """ Main WSGI based app. Assumes that there is an 'UID' & TOKEN key in the environ. Please make sure that the WSGI middleware adds this. """ __author__ = 'tmetsch' import bottle import csv import inspect import json import os from StringIO import StringIO from bottle import template from suricate.u...
tmetsch/suricate
suricate/ui/ui_app.py
Python
mit
13,231
# Copyright (C) 2010-2014 Lars Wirzenius # # 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 distribu...
michel-slm/obnam
obnamlib/plugins/verify_plugin.py
Python
gpl-3.0
8,131
#!/usr/bin/env python3 # technical debt: # -------------- # - add command line option for delete scope from codekit.codetools import debug, error from codekit import codetools, pygithub from getpass import getpass import argparse import github import os import platform import sys import textwrap def parse_args(): ...
lsst-sqre/sqre-codekit
codekit/cli/github_auth.py
Python
mit
4,692
#!/usr/bin/python import os import console console.success("Generando lista de imagenes ...") current_path = os.path.dirname(os.path.realpath(__file__)) image_path = os.path.join(current_path, '..', 'node_modules', 'pilas-bloques-exercises','dist', 'data') output_path = os.path.join(current_path, '..', 'app', 'compon...
Program-AR/pilas-engine-bloques
scripts/generarListaImagenes.py
Python
gpl-3.0
795
# Copyright 2013 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...
hanlind/nova
nova/tests/unit/virt/xenapi/image/test_glance.py
Python
apache-2.0
10,892
""" Migration 38 - Armor hardener tiericide """ CONVERSIONS = { 16357: ( # Experimental Enduring EM Armor Hardener I 16353, # Upgraded Armor EM Hardener I ), 16365: ( # Experimental Enduring Explosive Armor Hardener I 16361, # Upgraded Armor Explosive Hardener I ), 16373: ( # ...
pyfa-org/Pyfa
eos/db/migrations/upgrade38.py
Python
gpl-3.0
1,481
#!/usr/bin/env python # -*- coding: utf-8 -*- # # monedas.py # # Copyright 2010 Jesús Hómez <jesus@jesus-laptop> # # 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; e...
jehomez/pymeadmin
monedas.py
Python
gpl-2.0
8,115
""" noxfile ~~~~~~~ Nox configuration script """ # pylint: disable=resource-leakage,3rd-party-module-not-gated import datetime import glob import os import shutil import sys import tempfile # fmt: off if __name__ == "__main__": sys.stderr.write( "Do not execute this file directly. Use nox instead, it wi...
saltstack/salt
noxfile.py
Python
apache-2.0
36,914
# -*- coding: utf-8 -*- # © 2016 Lorenzo Battistini - Agile Business Group # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import stock
houssine78/addons
stock_picking_back2draft/models/__init__.py
Python
agpl-3.0
161
import mole #import re from math import sqrt #import os.path #import frag def _readlinesFromFile(filename): with open(filename, 'r') as f: return f.read().split('\n') def moleculeFromGau(filename): """ Load molecule from file containing: Charge Multiplicity AtomType x y z ... AtomType x y z Atom1...
zizzy1991/xo-frag
fio.py
Python
gpl-2.0
5,014
#! /usr/bin/env python sources = """ eNrsvWt3JMlxKMZ7/bi+betKsuXr17FPscejqtpt1GCGS4nC3d7VcDhDjrjcmTMPcXVAqKfQXQCK KFT1VFUPAFH08Xd/8T/wj7g/wv/Gv8HxymdldTdmd0n5HK/EAdCdGZkZGRkZERmP//1f//79D5K3 f7a+zRZVc54tFmVd9ovF+3/19u+m02kEn52X9Xn0+OXzKInXbbPaLIu2i6O8XkXxsqm7zRX9Db/W xbIvVtGHMo8ui9vrpl11aQRAJpP3//rtv8ERun71/j9583/9qx/...
TheAceMan/dotfiles
tools/dotfiles/runtests.py
Python
mit
225,599
from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe from multiprocessing import cpu_count from os.path import join class ScipyRecipe(CompiledComponentsPythonRecipe): version = '1.5.4' url = f'https://github.com/scipy/scipy/releases/download/v{version}/scipy-{version}.zip' site_pack...
kivy/python-for-android
pythonforandroid/recipes/scipy/__init__.py
Python
mit
2,185
#!/usr/bin/env python3 # Copyright (c) 2019 The Firo Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCExcept...
zcoinofficial/zcoin
qa/rpc-tests/sigma_nonhd_wallet.py
Python
mit
1,512
from .base import Resource from ..constants.url import URL class RegistrationLink(Resource): def __init__(self, client=None): super(RegistrationLink, self).__init__(client) self.base_url = URL.REGISTRATION_LINK_URL def create(self, data={}, **kwargs): """" Create a Registratio...
razorpay/razorpay-python
razorpay/resources/registration_link.py
Python
mit
924
#!/usr/bin/python # import colorsys could also use this import math from globals.global_utils import euclid, print_run_main_error def to_grayscale(pixel): ''' converts a pixel to grayscale http://stackoverflow.com/a/9780689 :param pixel: the pixel :return: grayscale value of the pixel ''' ...
FireElementalNE/RetroColorAnalysis
color_tests/color_utils.py
Python
gpl-2.0
4,848
# -*- coding: UTF-8 -*- #! python3 # noqa E265 """ Isogeo API v1 - Enums for Links actions See: http://help.isogeo.com/api/complete/index.html#definition-resourceLink """ # ############################################################################# # ########## Libraries ############# # ##################...
isogeo/isogeo-plugin-qgis
modules/isogeo_pysdk/enums/link_actions.py
Python
gpl-3.0
1,994
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2...
resmo/ansible
test/units/modules/network/f5/test_bigip_appsvcs_extension.py
Python
gpl-3.0
2,904
from collections import ChainMap from django.conf import settings from django.core.urlresolvers import reverse_lazy from django.shortcuts import render, redirect, resolve_url from django.contrib import messages from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.tokens import default_token_gene...
nm6061/toolshare
app/views/account.py
Python
mit
9,912
#!/usr/bin/env python import sys, os, argparse, datetime, stat, glob import numpy as np import re # set up libradtran files # assumes by default that loction of librdtran data files is in "." # but overriden by LIBRADTRAN_PATH def checkFile(fname): try: fp = open(fname, 'rw') return fp except IOError as e: #...
netceteragroup/esa-beam
beam-3dveglab-vlab/src/main/scenes/librat_scenes/dolibradtran.py
Python
gpl-3.0
8,100
from pyramid.view import view_config from pyramid.httpexceptions import HTTPSeeOther from sqlalchemy.orm.exc import NoResultFound from toomuchwin.models import DBSession, Play, Tx def history_post(request): try: play_id = int(request.POST['play']) play = DBSession.query(Play).filter_by(id=play_id...
0xa/toomuchwin
toomuchwin/views/account/history.py
Python
mit
1,993
# 2014-10-08 15:50 import os import sys dir_name = os.path.split(os.path.dirname(__file__))[0] chapter_dirs = filter(os.path.isdir, (os.path.join(dir_name, item) for item in os.listdir(dir_name))) sys.path.extend(chapter_dirs) import humansize si_suffixes = humansize.SUFFIXES[1000] print(si_suff...
myd7349/DiveIntoPython3Practices
chapter_04_Strings/replacement_field.py
Python
lgpl-3.0
676
#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (C) 2009-2010 Nicolas P. Rougier # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #---------------...
Flavsditz/projects
eyeTracking/pupil/pupil_src/shared_modules/atb/__init__.py
Python
gpl-2.0
27,057
# # Copyright (c) 2015 Cossack Labs Limited # # 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 i...
storojs72/themis
tools/python/keygen.py
Python
apache-2.0
1,385
from django.core.urlresolvers import reverse from django_dynamic_fixture import G from oscar.test.testcases import WebTestCase from oscar.core.compat import get_user_model from oscar.apps.catalogue.models import ProductClass, Category, Product User = get_user_model() class ProductWebTest(WebTestCase): is_staff...
Idematica/django-oscar
tests/functional/dashboard/product_tests.py
Python
bsd-3-clause
5,462
# Copyright 2012 NetApp # Copyright 2014 Mirantis 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 #...
NetApp/manila
manila/tests/share/test_driver.py
Python
apache-2.0
24,186
#!/usr/bin/python # (c) Nelen & Schuurmans. PGL licansed, see LICENSE.txt. import csv import logging import datetime from lizard_area.models import Area from lizard_layers.models import AreaValue from lizard_layers.models import ValueType from lizard_measure.models import Score from lizard_measure.models import Measu...
lizardsystem/lizard-measure
lizard_measure/import_krw_scores_from_csv.py
Python
gpl-3.0
2,431
from .PricewarsObject import PricewarsObject class SoldOffer(PricewarsObject): def __init__(self, offer_id=-1, uid=-1, product_id=-1, quality=0, amount_sold=0, price_sold=0.0, price=0.0, merchant_id='', amount=0): self.offer_id = offer_id self.uid = uid self.product_id = p...
hpi-epic/pricewars-merchant
models/SoldOffer.py
Python
mit
536
import unittest from CelestialMechanics.canonical_units.canonical_units import * class MyTestCase(unittest.TestCase): def test_something(self): m2 = 0.25 L = lagrange_points(m2) self.assertAlmostEqual(-1.10317, L[0], places=5) self.assertAlmostEqual(0.36074, L[1], places=5) ...
Camiloasc1/AstronomyUNAL
CelestialMechanics/canonical_units/test/test_canonical_units.py
Python
mit
480
""" # 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...
OBIGOGIT/etch
binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py
Python
apache-2.0
3,477
## hold-the-line - Simple Python voicemail and SMS/MMS receiver ## for holding onto phone numbers in Twilio ## ## Written in 2015 and 2016 and 2017 by Vitorio Miliano <http://vitor.io/> ## ## To the extent possible under law, the author has dedicated all ## copyright and related and neighboring rights...
vitorio/hold-the-line
holdtheline.py
Python
cc0-1.0
7,034
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
annarev/tensorflow
tensorflow/compiler/mlir/tfr/examples/customization/ops_defs.py
Python
apache-2.0
2,327
# Copyright 2015 Deutsche Telekom AG # 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...
zsoltdudas/lis-tempest
tempest/api/compute/keypairs/base.py
Python
apache-2.0
1,421
import RPi.GPIO as GPIO import Gmail CHECK_NOW_PIN = 12 def initialize_gpio(): GPIO.setmode(GPIO.BOARD) GPIO.setup(Gmail.PIN, GPIO.OUT) GPIO.setup(CHECK_NOW_PIN, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.add_event_detect(CHECK_NOW_PIN, GPIO.RISING, callback=check_mail_now, bouncetime=1000) def chec...
grantwinney/52-Weeks-of-Pi
03-Blink-LED-When-New-Email-Arrives/NewEmailIndicator.py
Python
mit
550
# Copyright 2015 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 a...
DailyActie/Surrogate-Model
01-codes/tensorflow-master/tensorflow/python/ops/gradients_test.py
Python
mit
16,420
# Copyright 2012 Loris Corazza, Sakis Christakidis # # 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 applic...
schristakidis/p2ner
p2ner/components/plugin/loggergui/loggergui/vizirdb.py
Python
apache-2.0
3,147
from flask import Flask, redirect, render_template, request, url_for from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) app.config["DEBUG"] = True SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{hostname}/{databasename}".format( username="barbaras", password="???", ...
bradmontgomery/young-coders-tutorial
2016/Intermediate/flask/flask_app4.py
Python
mit
952
# -*- 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...
jalavik/invenio
invenio/base/bundles.py
Python
gpl-2.0
4,856
N=100 # gcd == 1 def idx2v(idx): # print('idx',idx) if idx == 0: return 2 if idx % 3 < 2: return 1 return (idx//3+1)*2 fz,fm = 1,0 for i in range(0,N): # print(N-1-i) fz,fm = fm+fz*idx2v(N-1-i),fz print(fz) s=0 while fz !=0: s+=fz%10 fz//=10 print(s)
CroMarmot/MyOICode
ProjectEuler/p065.py
Python
gpl-3.0
302
import struct import unittest import json from manticore.platforms import evm from manticore.core import state from manticore.core.smtlib import Operators, ConstraintSet import os class EVMTest_CALLER(unittest.TestCase): _multiprocess_can_split_ = True maxDiff = None def _execute(self, new_vm): l...
montyly/manticore
tests/ethereum/EVM/test_EVMCALLER.py
Python
apache-2.0
1,923
# Copyright 2016-2017 Capital One Services, 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 ...
scotwk/cloud-custodian
c7n/credentials.py
Python
apache-2.0
3,856
"""followers Revision ID: 8a041a1f8a49 Revises: 0a549826008f Create Date: 2016-08-28 01:12:21.336017 """ # revision identifiers, used by Alembic. revision = '8a041a1f8a49' down_revision = '0a549826008f' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - plea...
1dot75cm/flasky
migrations/versions/8a041a1f8a49_followers.py
Python
mit
910
''' Get system os language, region, support win, osx ''' import sys import locale import subprocess def osx_read_language(): ret = '' try: cmd = 'defaults read -g AppleLanguages' arglist = cmd.split(' ') ret = subprocess.Popen(arglist, stdout=subprocess....
tcp813/mouTools
python/lang_region.py
Python
mit
1,631
from django.contrib import admin from models import Feedback admin.site.register(Feedback)
eRestin/MezzGIS
IslandGIS/feedback/admin.py
Python
bsd-2-clause
92
import math import django try: from django.contrib.gis.db.models.functions import Intersection except ImportError: pass from django.views.generic import ListView from django.utils.decorators import method_decorator from django.views.decorators.gzip import gzip_page from django.core.exceptions import Suspiciou...
sikmir/django-geojson
djgeojson/views.py
Python
lgpl-3.0
5,654
#!/usr/bin/env python # -*- coding: utf-8 -*- """Provides an apt backend to PackageKit Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com> Copyright (C) 2007 Tom Parker <palfrey@tevp.net> Copyright (C) 2008-2009 Sebastian Heinlein <glatzor@ubuntu.com> Copyright (C) 2012 Martin Pitt <martin.pitt@ubuntu.com> Licensed un...
coolo/packagekit
backends/apt/aptBackend.py
Python
gpl-2.0
99,604
#!/usr/bin/python sabnzbd_url = 'http://champ:8888/' savefile = '/var/www/default/stats.html' import curl c = curl.Curl() page = c.get(sabnzbd_url) fs = page.find('<b>Download Dir') fe = page.find('</body') f = page[fs:fe-len('</body>')] # save to file for now stats = open(savefile, 'w+') stats.write(f) stats.close...
glennkentwell/code
python/statscrape.py
Python
unlicense
412
''' Created on May 11, 2012 @author: h87966 ''' import random import hashlib class Crypt(): ''' classdocs ''' def __init__(self): ''' Constructor ''' pass def crypt_user_id(self, user_id): secret = 'foobar forever!' hashed_user_id = hashlib.sh...
cdoremus/udacity-python_web_development-cs253
src/unit6/crypt.py
Python
apache-2.0
1,349
import math class segment_tree(): def __init__(self,a): self.a = a self.root = self.build(0,len(a)-1) def build(self,left,right): if left == right: node = {} node['value'] = self.a[left] node['left'] = None node['right'] = None ...
saisankargochhayat/algo_quest
hackerearth/segment_tree_problem.py
Python
apache-2.0
1,757
from __future__ import print_function, division from sympy.core import S, C, sympify, cacheit from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg from sympy.functions.elementary.miscellaneous import sqrt ############################################################################### ##########...
kmacinnis/sympy
sympy/functions/elementary/hyperbolic.py
Python
bsd-3-clause
26,514
import doctest print 'Before testing be sure to set your key in README.txt..\n\n' doctest.testfile('README.rst')
gregelin/python-ideascaleapi
test_sunlightapi.py
Python
bsd-3-clause
115
''' Plugin for ResolveURL Copyright (C) 2018 gujal 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. ...
repotvsupertuga/tvsupertuga.repository
script.module.resolveurl/lib/resolveurl/plugins/vkspeed.py
Python
gpl-2.0
1,918
import numpy as np import scipy.stats #import sklearn.cross_decomposition from numpy.linalg import lstsq,eig from numpy import cov,dot,arange,c_ import rpy2.robjects as robjects from rpy2.robjects import numpy2ri def cca(x_tn,y_tm, reg=0.00000001): x_tn = x_tn-x_tn.mean(axis=0) y_tm = y_tm-y_tm.mean(axis=0) ...
adrinjalali/Network-Classifier
common/rdc.py
Python
gpl-3.0
2,855
import os from tests import test_settings from base_page import BasePage, script_returns_true from page_locators import GraphPageLocators as locators from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from arches.urls import uuid_regex class GraphPage(BasePage)...
cvast/arches
tests/ui/pages/graph_page.py
Python
agpl-3.0
2,196
""" Django settings for garzonfilmsback project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ i...
xtornasol512/garzonfilms
garzonfilmsback/garzonfilmsback/settings.py
Python
mit
3,338
"""test black listed name """ __revision__ = 1 A = None def baz(): """yo""" pass
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/pylint/test/input/func_w0111.py
Python
agpl-3.0
92
from django.db import models from django.utils.translation import ugettext_lazy as _ from market.models import MarketPlace class FlatPage(models.Model): url = models.CharField(_('URL'), max_length=100, db_index=True) title = models.CharField(_('title'), max_length=200) content = models.TextField(_('conte...
codepython/CollectorCity-Market-Place
marketplaces/apps/flatpages/models.py
Python
apache-2.0
1,099
import os import pytest from pages.desktop.home import Home from pages.desktop.privacy import Privacy from pages.desktop.terms import Terms from pages.desktop.about import About @pytest.mark.nondestructive def test_copter_loads(base_url, selenium): """Test Firefox 'copter' loads on home page""" page = Home(...
fzzzy/testpilot
frontend/test/ui/test_homepage.py
Python
mpl-2.0
2,707
from __future__ import absolute_import from sentry.constants import INTEGRATION_ID_TO_PLATFORM_DATA from sentry.testutils import TestCase class ThingTest(TestCase): def test_thing(self): assert len(INTEGRATION_ID_TO_PLATFORM_DATA) > 0
gencer/sentry
tests/network/test_thing.py
Python
bsd-3-clause
250
import sys sys.path.insert(1, "../../../") import h2o def binop_gt(ip,port): iris = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader.csv")) rows, cols = iris.dim iris.show() #frame/scaler res = iris > 5 res_rows, res_cols = res.dim assert res_rows == rows and res_col...
PawarPawan/h2o-v3
h2o-py/tests/testdir_munging/binop/pyunit_binop2_gt.py
Python
apache-2.0
1,792
from .TrainingSet import TrainingSet from .Bootstrap import Bootstrap from . import utils from .utils import bounding_box_from_annotation, expected_eye_positions, quasi_random_indices, parallel_part from .annotations import read_annotation_file
bioidiap/bob.ip.facedetect
bob/ip/facedetect/train/__init__.py
Python
gpl-3.0
245
""" The rcsetup module contains the default values and the validation code for customization using matplotlib's rc settings. Each rc setting is assigned a default value and a function used to validate any attempted changes to that setting. The default values and validation functions are defined in the rcsetup module, ...
Solid-Mechanics/matplotlib-4-abaqus
matplotlib/rcsetup.py
Python
mit
31,862
# MFC base classes. import sys import win32ui class Object: def __init__(self, initObj = None): self.__dict__['_obj_'] = initObj # self._obj_ = initObj if initObj is not None: initObj.AttachObject(self) def __del__(self): self.close() def __getattr__(self, attr): # Make this object look like the u...
Southpaw-TACTIC/Team
src/python/Lib/site-packages/pythonwin/pywin/mfc/object.py
Python
epl-1.0
1,852
# -*- coding: utf-8 -*- """ REST Service 'nozama-cloudsearch' """ import os import logging from pyramid.config import Configurator from nozama.cloudsearch.data import db from nozama.cloudsearch.service import docs from nozama.cloudsearch.service import restfulhelpers from nozama.cloudsearch.service import environ_se...
oisinmulvihill/nozama-cloudsearch
nozama/cloudsearch/service/__init__.py
Python
bsd-3-clause
3,020
#/* author:@shivkrthakur */ # Enter your code here. Read input from STDIN. Print output to STDOUT input = raw_input().strip() print ' '.join([x.capitalize() for x in input.split(' ')])
shivkrthakur/HackerRankSolutions
Practice/AllDomains/Languages/Python/Strings/Capitalize.py
Python
mit
187
import logging from dao import DAO, TableDesc, FieldDesc log = logging.getLogger(__name__) card_td = TableDesc("Cards", "multiverseid", [FieldDesc("multiverseid", "int"), FieldDesc("set_code", "text"), FieldDesc("number", "int"), Fiel...
nuxgu/magic_db
sqldb/card_dao.py
Python
gpl-3.0
1,343
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
Stargrazer82301/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/do/modeling/seba/make_pdfs.py
Python
mit
8,921
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.db.models.fields.files import ImageFieldFile, ImageField from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import pre_save, pre_delete from PIL import Image as PILImage from storageimage import settings class StorageImageFie...
sixpearls/wagtail-storageimage
storageimage/models.py
Python
bsd-2-clause
2,687
import json from django.utils.translation import ugettext_lazy as _ from django.http import HttpResponse, HttpRequest, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.core.urlresolvers import reverse from django.core.except...
Cotidia/cotidia-cms-base
cmsbase/admin_views.py
Python
mit
5,865
# Copyright (C) 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google-research/lottery-ticket-hypothesis
foundations/pruning_test.py
Python
apache-2.0
1,427
import ExtractNodes ExtractNodes.DoIt("ExplodedLego", debug=False)
ShipleyCollege/ViPteam1
ExtractAndAnalyzeCode/BuildExplodedNodesLego.py
Python
gpl-3.0
67
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflow/tensorflow
tensorflow/python/distribute/tpu_strategy_compilation_test.py
Python
apache-2.0
2,888
#!/usr/bin/env python3 ''' A standalone HTTP server, implementing a REST API ''' import os import base64 import ipaddress import json import http.server from orderedattrdict import AttrDict import dnsmgr_util as util from dnsmgr import DNS_Mgr auth_handler = None config = None mgr = DNS_Mgr() class Auth: """...
lowinger42/dnsmgr
dnsmgr_api.py
Python
mit
6,417
import unittest from entities.machines import MachinesHelper from entities.machines.Machine import Machine class MachineTests(unittest.TestCase): def test_parse_machines_file(self): content = '{ \ "machines": [ \ { \ "name": ...
EvilKhaosKat/docker_services_deployer
tests/entities/machines/MachineTests.py
Python
apache-2.0
877
"""Test `openid.dh` module.""" from __future__ import unicode_literals import base64 import os import unittest import warnings import six from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric.dh import DHPrivateNumbers...
openid/python-openid
openid/test/test_dh.py
Python
apache-2.0
9,138
from datetime import datetime class Logger(object): FATAL = 0 ERROR = 1 WARN = 2 INFO = 3 DEBUG = 4 TRACE = 5 def __init__(self, f, log_level=3): level = int(log_level) if level < 0 or level > Logger.TRACE: raise Exception("Invalid Log Level %d" % level) ...
zmap/ztag
ztag/log.py
Python
apache-2.0
1,994
# Copyright 2014 - Rackspace Hosting # # 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...
ziadsawalha/solum
solum/cmd/conductor.py
Python
apache-2.0
1,569
''' Created on Feb 19, 2013 @author: stefano ''' from Helpers.General_Helper_Functions import SubclassResponsibility, withAllSubclasses from Helpers.QObjectProxyEmitter import emitter import numpy from PyQt4.QtCore import QObject, SIGNAL class HomeoUniselectorError(Exception): pass class HomeoUniselector(obje...
cleinias/Homeo
src/Core/HomeoUniselector.py
Python
gpl-3.0
3,651
from collections import deque from random import choice from .notation import Notation class BaseUser(object): """ """ def set_board_data(self, width, height, board): self.width = width self.height = height self.board = board class CmdLineUser(BaseUser): """ """ def ...
tomviner/chess
chess/user.py
Python
mit
1,340
"""Offer Adventure at a custom command prompt.""" import argparse import os import re from sys import executable, stdout from time import sleep from . import load_advent_dat from .game import Game def loop(): parser = argparse.ArgumentParser( description='Adventure into the Colossal Caves.', prog=...
electricant/cavebot
adventure-1.3/adventure/__main__.py
Python
gpl-3.0
928
# -*- coding: utf-8 -*- # Copyright 2013-2014, Simon Kennedy, sffjunkie+code@gmail.com # # Part of 'hiss' the asynchronous notification library import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from hiss.hash import HashInfo from hiss.handler.snp i...
sffjunkie/hiss
src/test/test_SNP_Request.py
Python
apache-2.0
2,393
__author__ = 'paulo.rodenas' from fuzzyset import FuzzySet import unittest class TestFuzzyMatcher(unittest.TestCase): def setUp(self): with open('../bulk/cnpjs.txt') as f: self.fuzzy_set = f.read().splitlines() self.fuzzy_matcher = FuzzySet(self.fuzzy_set) def test_validate(...
nfscan/fuzzy_cnpj_matcher
tests/test_fuzzysetlib_matcher.py
Python
mit
1,110
from PIL import Image from StringIO import StringIO from Missing import Value as MissingValue from Acquisition import aq_parent from zope.app.annotation.interfaces import IAnnotations from Products.Archetypes.interfaces import IBaseObject from Products.CMFCore.interfaces._content import IDynamicType from Products.CMFCo...
socialplanning/opencore
opencore/nui/indexing.py
Python
gpl-3.0
11,666
""" Some codes from https://github.com/Newmu/dcgan_code """ from __future__ import division import math import json import random import pprint import scipy.misc import numpy as np from time import gmtime, strftime from six.moves import xrange import tensorflow as tf import tensorflow.contrib.slim as slim pp = pprint...
kennygea/6853-Project
utils.py
Python
mit
8,454
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "Also available in": "Također dostupno i u", "Archive": "Arhiva", "Categories": "", "LANGUAGE": "hrvatski", "More posts about": "Više postova o", "Newer posts": "Noviji postovi", "Next post": "Sljedeći post", ...
damianavila/nikola
nikola/data/themes/base/messages/messages_hr.py
Python
mit
824
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Jul 16, 2014 @author: anroco In Python how to convert a integer to float? En Python, ¿Cómo convertir un integer a float? ''' #create a integer number i = 359 print(type(i)) print(i) #convert using the float() function built-in python f = float(i) print(t...
OxPython/Python_float_int_to_float
src/int_to_float.py
Python
epl-1.0
451
# Copyright 2015 Huawei Technologies Co., Ltd. # 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 # # Un...
ityaptin/ceilometer
ceilometer/tests/unit/api/test_hooks.py
Python
apache-2.0
1,354
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import json from frappe import _ from frappe.model.document import Document from frappe.utils import now from frappe.utils.user import is...
treejames/erpnext
erpnext/support/doctype/issue/issue.py
Python
agpl-3.0
2,814
import re from ._shared import * class Retour(Rule): """Handles tools borrowings""" def __init__(self, bot): self.bot = bot def query_retour(self, serv, author, id): """Handles end of borrowings with private answers to notifications""" query = ("UPDATE borrowings SET back=true WH...
hackEns/Jarvis
Rules/Retour.py
Python
mit
2,026
""" This module will test basic app functionalities, like iteraction with typer and the checks of the current folder (git repo and rapydo structure required) """ import os import tempfile from pathlib import Path from faker import Faker from controller import PROJECT_DIR, __version__, colors from tests import ( C...
rapydo/do
tests/test_base.py
Python
mit
3,893
"""Add `audio_volume` property to station Revision ID: 50b58d5a1a3c Revises: 4c1ec907fb88 Create Date: 2018-12-09 23:55:45.995092 """ # revision identifiers, used by Alembic. revision = '50b58d5a1a3c' down_revision = '4c1ec907fb88' from alembic import op import sqlalchemy as sa def upgrade(): ### commands aut...
rootio/rootio_web
alembic/versions/50b58d5a1a3c_add_volume_to_station.py
Python
agpl-3.0
654
# encoding: utf-8 # module gtk._gtk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject class PathPriorityType(__gobject.GEnum): # no doc def __ini...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/PathPriorityType.py
Python
gpl-2.0
761
# coding: utf-8 from digitalocean.api.baseapi import BaseAPI class Keys(BaseAPI): def all(self): "List all Keys" return self.request('account/keys', 'GET') def create(self, name, public_key): "Create a new Key" params = {'name': name, 'public_key': public_key} retu...
valerylisay/digitalocean-api
digitalocean/api/v2/keys.py
Python
mit
909