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/python import subprocess import praw from hashlib import sha1 from flask import Flask from flask import Response from flask import request from cStringIO import StringIO from base64 import b64encode from base64 import b64decode from ConfigParser import ConfigParser import OAuth2Util import os import markdow...
foobarbazblarg/stayclean
stayclean-2016-october/serve-signups-with-flask.py
Python
mit
8,086
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qt\dlg_about.ui' # # Created: Mon May 20 14:37:48 2013 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUt...
gem/sidd
ui/qt/dlg_about_ui.py
Python
agpl-3.0
4,085
import time from django.test import TestCase from inviteme.forms import ContactMailSecurityForm, ContactMailForm class ContactMailSecurityFormTestCase(TestCase): def test_constructor(self): # timestamp and security_hash calculated during construction form = ContactMailSecurityForm() sel...
danirus/django-inviteme
inviteme/tests/forms.py
Python
bsd-2-clause
2,637
# Copyright 2013-15 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright 2015-2016 AvanzOSC # Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import _, fields, models from odoo.exceptions import UserError class StockMove...
OCA/stock-logistics-workflow
stock_picking_invoice_link/models/stock_move.py
Python
agpl-3.0
1,338
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from pylib import constants from pylib.local.device import local_device_environment try: from pylib.remote.device import remote_device_environment except I...
junhuac/MQUIC
src/build/android/pylib/base/environment_factory.py
Python
mit
914
from django.core.exceptions import ValidationError from django.forms import ModelForm from survey.models.households import Household from django import forms class HouseholdForm(ModelForm): class Meta: model = Household exclude = ['investigator', 'location', 'survey', 'household_code'] widg...
antsmc2/mics
survey/forms/household.py
Python
bsd-3-clause
1,263
import unittest import configparser import logging from queue import Queue from maxima_threads import MaximaWorker from maxima_threads import RequestController from config_loader import Config class MaximaWorkerTests(unittest.TestCase): def setUp(self): config = Config() # I only need the logger...
navigium/tcp2maxima
maxima_threads_tests.py
Python
agpl-3.0
2,203
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
pavelchristof/gomoku-ai
tensorflow/contrib/keras/python/keras/applications/imagenet_utils.py
Python
apache-2.0
7,528
import random import time from itertools import permutations as perm from math import factorial import numpy as np from sacorg.utils.utils import binomial def is_graphical(deg_seq, method="Erdos-Gallai", is_sorted=False): """ Checks whether given degree sequence d is graphical or not :param deg_...
abdcelikkanat/sacorg
unused/simple2.py
Python
apache-2.0
25,791
# -*- python -*- # This file is part of pybliographer # # Copyright (C) 1998-2004 Frederic GOBRY # Email : gobry@pybliographer.org # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either ...
zkota/pyblio-1.3
scripts/pybconvert.py
Python
gpl-2.0
1,510
''' Created on Feb 20, 2013 @author: maribelacosta ''' class Revision(object): ''' classdocs ''' def __init__(self): self.id = 0 # Fake sequential id. Starts in 0. self.wikipedia_id = 0 # Wikipedia revision id. self.contributor_id = 0; # Id of the ...
maribelacosta/wikiwho
structures/Revision.py
Python
mit
1,813
import sys import os import common from common import USER_ROOT class RemarkTests(common.AegisTestCase): def test_wipe_cleared_data(self): self.assertEqual(0, len(self.get("test_harness/remarks/a", auth=USER_ROOT).json())) def test_root_create_remark(self): self.assertEqual(200, self.post("...
AegisTools/aegis-appengine
tests/api/remarks.py
Python
gpl-2.0
1,838
from .base import * DEBUG = True
dyzajash/TB_cms
tb_cms/settings/testing.py
Python
bsd-3-clause
34
#!/usr/bin/env python """ test_pacman-mirrors ---------------------------------- Tests for `pacman-mirrors` module. """ import unittest from unittest.mock import patch from pacman_mirrors.functions import httpFn, config_setup, cliFn, defaultFn from pacman_mirrors.pacman_mirrors import PacmanMirrors from . import mo...
fhdk/pacman-mirrors
tests/test_httpfn.py
Python
gpl-3.0
3,056
#!/usr/bin/python from __future__ import print_function """ # Boot test routines. """ from boot import * # get the test engine @ok # run+test something at load time def noop(): return True # never fails @ok # ditto def oops(): 1/0 # always fails @ok # eg3: test the test engine def unittestok(): ok(oops, ...
boddulavineela/mase
src/old/bootok.py
Python
unlicense
772
SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 NO_MATCHES_FOUND = 23
ktan2020/legacy-automation
win/Lib/site-packages/pip-1.3.1-py2.7.egg/pip/status_codes.py
Python
mit
87
from django import forms from micro_admin.models import User, career class ChangePasswordForm(forms.Form): oldpassword = forms.CharField() newpassword = forms.CharField() retypepassword = forms.CharField() class UserForm(forms.ModelForm): class Meta: model = User exclude = [ ...
ashwin31/MicroSite
micro_admin/forms.py
Python
gpl-2.0
753
import binascii import itertools import os import random import subprocess from weaver.stack import WeaverNests from weaver.util import Stash def nstdir(path): return os.path.join(CurrentNest().work_dir, path) # Thoughts: # - For shared files: fifo-0,push-async-1 is equivalent to fifo-0,pull-inf TASKS = 25 SHAR...
nkremerh/cctools
chirp/tools/workflows/pull-tests.py
Python
gpl-2.0
2,512
""" This module describes the unlogged state of the default game. The setting STATE_UNLOGGED should be set to the python path of the state instance in this module. """ from src.commands.cmdset import CmdSet from src.commands.default import unloggedin class UnloggedinCmdSet(CmdSet): """ Sets up the unlogged cmd...
TaliesinSkye/evennia
src/commands/default/cmdset_unloggedin.py
Python
bsd-3-clause
700
import numpy as np from project.dat.property_steel import thermal # EQUATIONS # [5.66] def _lambda_LT(W_ply, f_y, M_cr): return np.sqrt(W_ply * f_y / M_cr) # [5.65] def _lambda_LT_theta_com(lambda_LT, k_y_theta_com, k_E_theta_com): return lambda_LT * np.sqrt(k_y_theta_com / k_E_theta_com) # [5.64] def _alph...
fuyans/janas
project/func/buckling.py
Python
mit
1,362
import sys import traceback import os import time import PyQt4 from PyQt4 import Qt, QtCore, QtGui, uic from PyQt4.Qt import * import numpy from PyEngine3D.Utilities import Singleton, Attribute, Attributes from PyEngine3D.UI import logger from PyEngine3D.Common.Command import * from .Widgets import InputDialogDemo ...
ubuntunux/GuineaPig
PyEngine3D/UI/QT/MainWindow.py
Python
bsd-2-clause
26,801
import os from winsys import dialogs, fs DEFAULT = "temp.csv" filename, = dialogs.dialog ( "Open a filename", ("Filename", DEFAULT, dialogs.get_filename) ) if not fs.file (filename): raise RuntimeError ("%s does not exist" % filename) else: os.startfile (filename)
one2pret/winsys
docs/cookbook/dialogs/ask_for_filename.py
Python
mit
286
# Author: Jason Lu import matplotlib as mpl mpl.use('TkAgg') import matplotlib.pyplot as plt #导入图像库 plt.rcParams['font.sans-serif'] = ['SimHei'] #用来正常显示中文标签 plt.rcParams['axes.unicode_minus'] = False #用来正常显示负号 plt.figure(figsize=(7, 5)) #创建图像区域,指定比例 labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' #定义标签 sizes = [15, 30, 45, 1...
jinzekid/codehub
python/数据分析/a3/3_6_饼图.py
Python
gpl-3.0
790
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Test documentation build configuration file, created by # sphinx-quickstart on Wed Jul 26 10:01:56 2017. # # 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 # autog...
KTH-dESA/PyOnSSET
OnSSET_Manual/conf.py
Python
mit
4,675
import numpy as np from stcad.source_dev.chip import Base_Chip from stcad.source_dev.objects import Drum import gdsCAD as cad chipsize = 50 chip = Base_Chip('drum', chipsize, chipsize,label=False) inductor = Drum(base_layer = 1, sacrificial_layer = 2 , top_layer = 3, outer_radius = 9, head_radius =...
srpeiter/ChipDesignCad
testing_scripts/mario_drum.py
Python
gpl-3.0
674
# -*- coding: utf-8 -*- import ast import os import requests import models from config import config, sqla from gevent.pool import Pool from helpers import random_str, down base_path = config.get('photo', 'path') base_path = os.path.join(base_path, 'celebrity') cookies = { 'bid': '' } def create_down(str_u...
billvsme/videoSpider
webs/douban/tasks/down_celebrity_images.py
Python
mit
1,702
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Killer.py # Manage running proc # # Copyright (C) 2012-2015 Tommy Alex. All Rights Reserved. # # 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...
iptux/DroidUi
examples/Killer.py
Python
gpl-3.0
1,065
# CourseResource from django.contrib.auth.models import User from django.test import TestCase from tastypie.test import ResourceTestCaseMixin from oppia.tests.utils import get_api_key, get_api_url class CourseResourceTest(ResourceTestCaseMixin, TestCase): fixtures = ['user.json', 'oppia.json', 'permissions.json'...
DigitalCampus/django-nurhi-oppia
oppia/tests/api/test_course.py
Python
gpl-3.0
4,962
# Copyright 2011-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
wujuguang/motor
motor/motor_gridfs.py
Python
apache-2.0
19,133
""" =================== Canny edge detector =================== The Canny filter is a multi-stage edge detector. It uses a filter based on the derivative of a Gaussian in order to compute the intensity of the gradients.The Gaussian reduces the effect of noise present in the image. Then, potential edges are thinned dow...
michaelpacer/scikit-image
doc/examples/plot_canny.py
Python
bsd-3-clause
1,633
#!/usr/bin/python # Filename: cty.py def load_cty(filename): """ Load Country Information from plist file (http://www.country-files.com/cty/history.htm)""" try: import plistlib country_list = plistlib.readPlist(filename) return(country_list) except: return(False) # End of cty.py
dh1tw/DX-Cluster-Parser
cty.py
Python
gpl-3.0
293
# -*- coding: utf-8 -*- # # Sibyl: A modular Python chat bot framework # Copyright (c) 2015-2017 Joshua Haas <jahschwa.com> # # This file is part of Sibyl. # # Sibyl 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 Foundat...
jfrederickson/sibyl
protocols/skeleton.py
Python
gpl-3.0
7,096
# -*- coding: utf-8 -*- from __future__ import division def swbd_folds_disfluency_corpus(corpus_input, num_files=496, num_folds=10): """Returns num_folds fold division of the input swbd PTB disfluency corpus in num_folds strings of the configuration of the division and the folds themselves. Keyword ...
dsg-bielefeld/deep_disfluency
deep_disfluency/corpus/create_folds.py
Python
mit
4,213
#!/usr/bin/env python """\ Helios.py: Solve two-electron atoms using Pekeris techniques Copyright 1999, 2000 Richard P. Muller, David R. Kent IV, and William A. Goddard, III Special thanks to Edward Montgomery, Michael Barnett, and Robert Forrey, without whom this work would have been impossible. Test v...
Konjkov/pyquante2
pyquante2/hylleraas/helios.py
Python
bsd-3-clause
8,997
# Events.py # Copyright (C) 2010 Daniel Callander # # 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 pr...
arif25169/deebot
Events.py
Python
gpl-3.0
2,172
""" REST API users model resource. .. moduleauthor:: Martijn Vermaat <martijn@vermaat.name> .. Licensed under the MIT license, see the LICENSE file. """ from flask import abort, g from ...models import User, USER_ROLES from ..errors import ValidationError from ..security import is_user, has_role, require_basic_aut...
sndrtj/varda
varda/api/resources/users.py
Python
mit
5,644
# -*- coding: utf-8 -*- """ Created on Wed Dec 18 08:17:35 2013 Exploratory Data Analysis for Kiva Data @author: Matthew Crowson """ import pymongo from utils import mongodb_proxy import logging import pandas as pd import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr, f_oneway import...
mcrowson/predict-kiva
EDA.py
Python
apache-2.0
10,674
""" Example sentences to test spaCy and its language models. >>> from spacy.lang.gu.examples import sentences >>> docs = nlp.pipe(sentences) """ sentences = [ "લોકશાહી એ સરકારનું એક એવું તંત્ર છે જ્યાં નાગરિકો મત દ્વારા સત્તાનો ઉપયોગ કરે છે.", "તે ગુજરાત રાજ્યના ધરમપુર શહેરમાં આવેલું હતું", "કર્ણદેવ પહેલ...
spacy-io/spaCy
spacy/lang/gu/examples.py
Python
mit
1,215
#!/usr/bin/env python ''' Using Netmiko enter into configuration mode on a network device. Verify that you are currently in configuration mode. ''' from getpass import getpass from netmiko import ConnectHandler from test_devices import pynet1, pynet2, juniper_srx def main(): ''' Using Netmiko enter into conf...
nonemaw/pynet
pyth_ans_ecourse/class4/ex5_netmiko.py
Python
gpl-2.0
965
# -*- encoding: utf-8 -*- # # Copyright © 2016 Red Hat, Inc. # Copyright © 2014-2015 eNovance # # 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...
leandroreox/gnocchi
gnocchi/indexer/sqlalchemy_base.py
Python
apache-2.0
16,758
# Copyright 2016 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 applicable ...
jiaphuan/models
research/slim/nets/inception_v4_test.py
Python
apache-2.0
11,999
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "brewmaster.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
hacktobacillus/fermenter
manage.py
Python
mit
253
# This file is part of Boomer Core. # # Boomer Core 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. # # Boomer Core is distributed in t...
clusterfudge/boomer
boomer/client/speech/mic.py
Python
gpl-3.0
10,725
#/usr/bin/env python import os from optparse import OptionParser from xml.dom.minidom import parse import mediauto.module STANDARD_CONFIG_FILE_LOCATIONS = [ '/etc/mediauto.conf', os.path.join(os.getenv('HOME'), '.mediauto/mediauto.conf'), ] parser = OptionParser() parser.add_option( '-c', '--c...
dfletcher/Mediauto
site-packages/mediauto/config.py
Python
gpl-2.0
3,995
from ete3 import PhyloTree, PhylomeDBConnector, SeqGroup p = PhylomeDBConnector() w,x, t = p.get_best_tree("Hsa0000001", 1) a, l = p.get_clean_alg("Hsa0000001", 1) A = SeqGroup(a, "iphylip") for s in A.id2seq: A.id2seq[s]=A.id2seq[s][:30] t.link_to_alignment(A) print t.get_species() print t t.set_outgroup(t&"Ddi0...
karrtikr/ete
sdoc/old_tutorial/alignment_visualization.py
Python
gpl-3.0
527
#!/usr/bin/env python # coding: utf-8 """ @Author: Well @Date: 2015 - 07 - 12 """ import urllib # url encode print urllib.quote('激战2') print urllib.unquote("%E6%BF%80%E6%88%982")
neiltest/neil_learn_python
src/learn_python/python_other/neil_30_urlencode.py
Python
mit
189
# =============================================================================== # Copyright 2017 ross # # 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/LICE...
USGSDenverPychron/pychron
pychron/pipeline/plot/panels/regression_series_panel.py
Python
apache-2.0
1,208
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from PyQt4.QtCore import * from PyQt4.QtGui import * from froi.algorithm import imtool from froi.io.csv import get_cord_from_file import numpy as np import os class RegularROIFromCSVFileDialog(QDialog):...
liuzhaoguo/FreeROI-1
froi/gui/component/regularroifromcsvfiledialog.py
Python
bsd-3-clause
4,533
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2021 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
leandrotoledo/python-telegram-bot
tests/test_telegramobject.py
Python
lgpl-3.0
4,625
../../../../share/pyshared/chardet/test.py
2ndy/RaspIM
usr/lib/python2.7/dist-packages/chardet/test.py
Python
gpl-2.0
42
PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033[0m' def bold(msg): return BOLD + BLUE + msg + END def warning(msg): return YELLOW + msg + END def fail(): return "[" + RE...
jamesblunt/chorus
packaging/setup/color.py
Python
apache-2.0
444
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
aricchen/openHR
openerp/addons/analytic/__openerp__.py
Python
agpl-3.0
1,877
"""distutils.command.install Implements the Distutils 'install' command.""" from distutils import log # This module should be kept compatible with Python 2.1. __revision__ = "$Id: install.py 62788 2008-05-06 22:41:46Z christian.heimes $" import sys, os, string from types import * from distutils.core import Command...
leighpauls/k2cro4
third_party/python_26/Lib/distutils/command/install.py
Python
bsd-3-clause
26,777
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
lmazuel/azure-sdk-for-python
azure-mgmt-compute/setup.py
Python
mit
2,784
import time import os import glog from daisy import executeCmds def start_benchmark(algo, num_of_chains, mbps, chain_index=None, isIperf=False): """ Allocate E2 style chains. """ # list of commands to execute one-by-one cmds = [] if isIperf: glog.info('Launching iperf instead of tcpreplay...'...
knodir/son-emu
scenarios/experiments/bench.py
Python
apache-2.0
4,445
## __BEGIN_LICENSE__ ## Copyright (C) 2006-2010 United States Government as represented by ## the Administrator of the National Aeronautics and Space Administration ## All Rights Reserved. ## __END_LICENSE__ import layermanager_client as lmc import inspect _cms_client = None def get_default_client(): from config ...
deleted/kml-layer-manager
client/layers.py
Python
apache-2.0
7,490
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-06 22:11 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0006_auto_20170302_2255'), ] operations = [ migrations.AlterField( ...
rastrexando-eu/rastrexando-eu
core/migrations/0007_auto_20170306_2211.py
Python
gpl-3.0
598
# 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 Li...
karan/warehouse
tests/unit/i18n/test_filters.py
Python
apache-2.0
2,338
#!/usr/bin/env python import math import sys from numpy import float32, putmask, shape, zeros # This is the average of all species in the alignment outside of exons # > mean(r) # A T C G # 0.2863776 0.2878264 0.2129560 0.2128400 # > sd(r) # A T ...
bxlab/bx-python
lib/bx/pwm/position_weight_matrix.py
Python
mit
30,674
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('web', '0016_auto_20150304_0113'), ] operations = [ migrations.AddField( model_name='comentario', nam...
palichis/elmolino
web/migrations/0017_comentario_responder.py
Python
gpl-2.0
468
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Li...
tomhunter-gh/Lean
Algorithm.Python/QCUWeatherBasedRebalancing.py
Python
apache-2.0
3,595
from twython import Twython from config import APP_KEY, APP_SECRET def obtain_auth_url(): """Used to app to tweet to my account NOT CALLED ANYWHERE""" twitter = Twython(APP_KEY, APP_SECRET) auth = twitter.get_authentication_tokens() oauth_token = auth['oauth_token'] oauth_token_secret = auth[...
BWeatherMaine/WXGIF
twitter.py
Python
apache-2.0
885
#!/usr/bin/env python # encoding: utf-8 """ permissions.py Created by Frédéric LASNIER / Christophe VAN FRACKEM on 2014/02/02/. Copyright (c) 2014 Où & Quand. All rights reserved. Mecanicadom permission. """ __author__ = 'Frédéric LASNIER <fred@ouetquand.biz> / Christophe VAN FRACKEM <contact@tisspage.fr>' __versio...
tisspage/ucar
api-server/api_v0/permissions.py
Python
mit
6,262
# Copyright (c) 2017, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("core", "doctype", "sms_parameter") sms_sender_name = frappe.db.get_single_value("SMS Settings", "sms_sender_name") if sms_s...
vjFaLk/frappe
frappe/patches/v9_1/add_sms_sender_name_as_parameters.py
Python
mit
651
#This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. import os import sys import imp import gettext _ = gettext.gettext PLUGINS_PATH = os.path.dirname(__file__) if not os.path.isdir(PLUGINS_PATH): # try for py2exe PLUGINS...
sunny414/tryton-client
tryton/plugins/__init__.py
Python
gpl-3.0
932
import sys; import os sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('.')) from flask import Flask, render_template, request, redirect import subprocess from Utils import subprocess_helpers from Utils.DataSource import * app = Flask(__name__) dataSource = DataSource() def launch_prepr...
beallej/event-detection
WebApp/EventDetectionWeb.py
Python
mit
2,619
import re, logging, random, time from autotest.client.shared import error from virttest import qemu_monitor, utils_test, utils_misc @error.context_aware def run_balloon_check(test, params, env): """ Check Memory ballooning, use M when compare memory in this script: 1) Boot a guest with balloon enabled/dis...
sathnaga/virt-test
qemu/tests/balloon_check.py
Python
gpl-2.0
9,450
import argparse import json import pprint import sys import urllib import urllib2 import oauth2 API_HOST = 'api.yelp.com' DEFAULT_TERM = 'dinner' DEFAULT_LOCATION = 'San Francisco, CA' SEARCH_LIMIT = 3 SEARCH_PATH = '/v2/search/' BUSINESS_PATH = '/v2/business/' # OAuth credential placeholders that must be filled in ...
tosfan4ever/hacktheplanet
api/utils/yelp.py
Python
bsd-3-clause
3,892
# encoding: utf-8 # module gio._gio # from /usr/lib/python2.7/dist-packages/gtk-2.0/gio/_gio.so # by generator 1.135 # no doc # imports import gio as __gio import glib as __glib import gobject as __gobject import gobject._gobject as __gobject__gobject class FileMonitorEvent(__gobject.GEnum): # no doc def __i...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gio/_gio/FileMonitorEvent.py
Python
gpl-2.0
785
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class GmDashConfig(AppConfig): name = 'gm_dash'
Gamification-Dashboard/gamification-dashboard
dashboard/gm_dash/apps.py
Python
gpl-3.0
153
# Copyright (c) 2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
FreescaleSemiconductor/quantum
quantum/db/models_v2.py
Python
apache-2.0
6,432
# The MIT License (MIT) # # Copyright (c) 2013 Marek Mikuliszyn # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, ...
yezooz/fserver
writer/urls.py
Python
mit
1,551
""" ================ Sequential Usage ================ By default, *auto-sklearn* fits the machine learning models and build their ensembles in parallel. However, it is also possible to run the two processes sequentially. The example below shows how to first fit the models and build the ensembles afterwards. """ from ...
automl/auto-sklearn
examples/60_search/example_sequential.py
Python
bsd-3-clause
2,132
from queue import PriorityQueue import sys from itertools import count def pentagonal(n): return int(n*(3*n-1)/2) numbers = [] def is_pentagonal(p): while True: if p<numbers[-1]: break numbers.append(pentagonal(len(numbers)+1)) return p in numbers for s in (pentagonal(n) for n in count(1...
davidxmoody/kata
project-euler/completed/euler44.py
Python
mit
524
""" DowntimeCommand module will look into GOC DB to find announced downtimes for RSS-managed sites and resources. If found, downtimes are added to the internal RSS cache using ResourceManagementClient. GOCDB downtimes that are modified or deleted are also synced. """ from __future__ import absolute_import from...
yujikato/DIRAC
src/DIRAC/ResourceStatusSystem/Command/DowntimeCommand.py
Python
gpl-3.0
13,876
'''Tests about locks''' import redis from common import TestQless class TestLocks(TestQless): '''Locks tests''' def test_malformed(self): '''Enumerate malformed inputs into heartbeat''' self.assertMalformed(self.lua, [ ('heartbeat', 0), ('heartbeat', 0, 'jid'), ...
backupify/qless-core
test/test_locks.py
Python
mit
17,210
# Copyright 2014 Rackspace Inc. # # Author: Tim Simmons <tim.simmons@rackspace.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
kiall/designate-py3
designate/backend/agent.py
Python
apache-2.0
6,245
# # x86db.py # # Copyright (C) 2009 Gil Dabah, http://ragestorm.net/disops/ # from x86header import * # The mandatory prefix bytes list: _MandatoryPrefixesList = [0x9b, 0x66, 0xf3, 0xf2] # Map the mandatory prefix to its corresponding entry number in the PREFIXED table. # Note that no-prefix is first entry. _Mandator...
LiamKarlMitchell/InfiniteSky
TSX_Client/diStorm/disOps/x86db.py
Python
gpl-3.0
16,671
# -*- coding: utf-8 -*- # File : unittest.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 27/01/2018 # # This file is part of Synchronized-BatchNorm-PyTorch. # https://github.com/vacancy/Synchronized-BatchNorm-PyTorch # Distributed under MIT License. import unittest import numpy as np from torc...
aditiiyer/CERR
CERR_core/ModelImplementationLibrary/SegmentationModels/ModelDependencies/CT_Ventricles_DeepLab/modeling/sync_batchnorm/unittest.py
Python
lgpl-2.1
834
#!/usr/bin/env python3 # OpenCL built-in library: type conversion functions # # Copyright (c) 2013 Victor Oliveira <victormatheus@gmail.com> # Copyright (c) 2013 Jesse Towner <jessetowner@lavabit.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated doc...
NatTuck/pocl
lib/kernel/convert_type.py
Python
mit
13,471
# Copyright (C) 2015 Will Bond, Mjumbe Wawatu Ukweli, 2011 by Yehuda Katz # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
isaacdd/pybars3
tests/test_acceptance.py
Python
lgpl-3.0
62,261
import numpy as np from sklearn.datasets import load_iris import metric_learn CLASSES = { 'Covariance': metric_learn.Covariance(), 'ITML_Supervised': metric_learn.ITML_Supervised(num_constraints=200), 'LFDA': metric_learn.LFDA(k=2, dim=2), 'LMNN': metric_learn.LMNN(k=5, learn_rate=1e-6, verbose=False)...
terrytangyuan/metric-learn
bench/benchmarks/iris.py
Python
mit
1,245
# coding=utf-8 from __future__ import unicode_literals c_lang_config = { "name": "c", "compile": { "group_memory": True, "src_name": "main.c", "exe_name": "main", "max_cpu_time": 5.0, "max_real_time": 10.0, "max_memory": 512 * 1024, # 512M compile memory ...
joeyac/JudgeServer
client/languages.py
Python
mit
2,209
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('dbmail', '0004_auto_20150321_2214'), ] operations = [ migrations.CreateModel( name='MailBaseTemplate', ...
LPgenerator/django-db-mailer
dbmail/migrations/0005_auto_20150506_2201.py
Python
gpl-2.0
1,511
''' rrsig_ttls_match - Record test: RrsigTtlsMatch .. Copyright (c) 2015 Neustar, Inc. All rights reserved. .. See COPYRIGHT.txt for full notice. See LICENSE.txt for terms and conditions. ''' import dns_sprockets_lib.validators as validators class RrsigTtlsMatch(validators.RecTest): # pylint: disable=too-few-...
ultradns/dns_sprockets
dns_sprockets_lib/validators/rrsig_ttls_match.py
Python
apache-2.0
1,026
import sublime from sublime_plugin import WindowCommand from ..git_command import GitCommand from ...common import util from ..ui_mixins.quick_panel import show_remote_panel from ..ui_mixins.input_panel import show_single_line_input_panel class GsRemoteAddCommand(WindowCommand, GitCommand): """ Add remotes ...
divmain/GitSavvy
core/commands/remote.py
Python
mit
2,065
from __future__ import print_function import os import logging from pdb import pm from miasm.loader import pe from miasm.analysis.sandbox import Sandbox_Win_x86_32 from miasm.os_dep.common import get_win_str_a # User defined methods def kernel32_GetProcAddress(jitter): """Hook on GetProcAddress to note where UPX...
commial/miasm
example/jitter/unpack_upx.py
Python
gpl-2.0
3,555
import unittest from test import test_support import gc import weakref import operator import copy import pickle from random import randrange, shuffle import sys import collections class PassThru(Exception): pass def check_pass_thru(): raise PassThru yield 1 class BadCmp: def __hash__(self): ...
HiSPARC/station-software
user/python/Lib/test/test_set.py
Python
gpl-3.0
62,794
#common sets up the conduit environment from common import * import conduit.dataproviders.File as FileDataProvider import conduit.datatypes.File as File import conduit.utils as Utils import conduit.vfs as Vfs GROUP_NAME = "Cheese" NESTED_DIR_NAME = "A Directory" DIFFERENT_GROUP_NAME = "Steak" def create_file(inDirUR...
GNOME/conduit
test/python-tests/TestDataProviderFolder.py
Python
gpl-2.0
3,301
# -*- coding: utf-8 -*- # Copyright (C) 2016 Fabio Falcinelli, Maximilian Hils # # This program 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) an...
ffalcinelli/pydivert
pydivert/windivert.py
Python
lgpl-3.0
9,345
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
halfwit/qutebrowser
qutebrowser/config/websettings.py
Python
gpl-3.0
8,561
from __future__ import print_function, division from collections import MutableMapping, defaultdict from sympy.core import (Add, Mul, Pow, Integer, Number, NumberSymbol,) from sympy.core.numbers import ImaginaryUnit from sympy.core.sympify import _sympify from sympy.core.rules import Transform from sympy.core.logic i...
NikNitro/Python-iBeacon-Scan
sympy/assumptions/sathandlers.py
Python
gpl-3.0
13,472
import unittest import mox from layers import * #### # Test Data #### TEST_LAYER_PROPERTIES = dict((str(k), v) for k, v in {u'division_lod_min': None, u'compressed': True, u'busy': None, u'description': None, u'dynamic_balloons': False, u'auto_managed': False, u'division_lod_min_fade': None, u'division_lod_max_fade':...
deleted/kml-layer-manager
client/layers_test.py
Python
apache-2.0
4,670
import atexit import logging import logging.handlers from threading import Lock import inspect import sys from django.db.models import Model from types import ModuleType logger_cache = {} logger_cache_lock = Lock() logging.getLogger("requests").setLevel(logging.WARNING) logging.getLogger("urllib3").setLevel(logging....
nachandr/cfme_tests
sprout/sprout/log.py
Python
gpl-2.0
3,154
""" Tests for StaticContentServer """ import copy import datetime import ddt import logging import unittest from uuid import uuid4 from django.conf import settings from django.test import RequestFactory from django.test.client import Client from django.test.utils import override_settings from mock import patch from ...
shabab12/edx-platform
common/djangoapps/contentserver/test/test_contentserver.py
Python
agpl-3.0
16,959
# Source and destination file names. test_source = "data/math.txt" test_destination = "math_output_latex.html" # Keyword parameters passed to publish_file. reader_name = "standalone" parser_name = "rst" writer_name = "html" # Settings settings_overrides['math_output'] = 'latex' # local copy of default stylesheet: set...
waseem18/oh-mainline
vendor/packages/docutils/test/functional/tests/math_output_latex.py
Python
agpl-3.0
405
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from page_sets import page_cycler_story from telemetry.page import cache_temperature as cache_temperature_module from telemetry.page import shared_page_state...
scheib/chromium
tools/perf/page_sets/intl_ar_fa_he.py
Python
bsd-3-clause
1,849
from flask import request from werkzeug.exceptions import NotFound from rdr_service.api.base_api import BaseApi from rdr_service.api_util import PTC_AND_HEALTHPRO from rdr_service.app_util import auth_required from rdr_service.dao.hpo_dao import HPODao from rdr_service.model.site_enums import ObsoleteStatus class Aw...
all-of-us/raw-data-repository
rdr_service/api/awardee_api.py
Python
bsd-3-clause
1,765
#!/usr/bin/env python from paddle.trainer_config_helpers import * height = 224 width = 224 num_class = 1000 batch_size = get_config_arg('batch_size', int, 64) layer_num = get_config_arg('layer_num', int, 19) is_infer = get_config_arg("is_infer", bool, False) num_samples = get_config_arg('num_samples', int, 2560) args...
reyoung/Paddle
benchmark/paddle/image/vgg.py
Python
apache-2.0
2,910
''' Created on 6 jan. 2013 @author: sander ''' from abc import ABCMeta, abstractmethod from bitstring import ConstBitStream, Bits from pylisp.packet.ip.protocol import ProtocolElement class ControlMessage(ProtocolElement): ''' This is the abstract base class for all LISP control packets ''' __metacl...
steffann/pylisp
pylisp/packet/lisp/control/base.py
Python
bsd-3-clause
1,763