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) 2012 - 2014 the GPy Austhors (see AUTHORS.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from ..core import GP from .. import likelihoods from .. import kern from .. import util class GPCoregionalizedRegression(GP): """ Gaussian Process model for heterosced...
SheffieldML/GPy
GPy/models/gp_coregionalized_regression.py
Python
bsd-3-clause
1,940
# -*- coding: utf-8 -*- # Copyright: 2011, Grigoriy Petukhov # Author: Grigoriy Petukhov (http://lorien.name) # License: BSD """ The core of grab package: the Grab class. """ import logging import os from random import randint from copy import copy, deepcopy import threading import itertools import collections import e...
istinspring/grab
grab/base.py
Python
mit
26,168
import RPi.GPIO as GPIO from modules.xbmcjson import XBMC import subprocess from modules.py532lib.NFC import NFC as NFC from datetime import datetime import time import os import os.path import urllib.request import threading # set max volume # admin tag : enable usb,start samba?? # check internet connection on # con...
belese/luciphone
Luciphone/luciphone.py
Python
gpl-2.0
14,528
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('costos', '0011_auto_20151219_1102'), ] operations = [ migrations.AlterUniqueTogether( name='servicioprestadoun',...
infoINGenieria/Zweb
z_web/costos/migrations/0012_auto_20151219_1103.py
Python
gpl-2.0
394
# 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 License, or # (at your option) any later version. # # This program is distributed in the hope that it will be usefu...
scylladb/scylla-cluster-tests
jepsen_test.py
Python
agpl-3.0
4,644
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
skuda/client-python
kubernetes/client/models/v1_container_status.py
Python
apache-2.0
9,402
# coding: utf-8 class Item(object): def __init__(self, name, price, description, image_url, major, minor, priority): self.name = name self.price = price self.description = description self.image_url = image_url self.minor = minor self.major = major self.prior...
hanks/First_Hackson_Demo
GoodsGetterServer/app-server/models.py
Python
mit
1,065
from vmodel import * '''moduleNamesToNiceNames = {"v": "V", "vdebug": "VDebug", "vglobals": "VGlobals", "vmodelexport": "VModelExport"} for name, niceName in enumerate(moduleNamesToNiceNames): exec(niceName + " = " + name)''' moduleNiceNames = ["V", "VDebug", "VClassExtensions", "VGlobals", "VModel", "VModelExport...
Venryx/VModel
Blender Exporter/vglobals.py
Python
gpl-2.0
7,100
""" Test the student dashboard view. """ import datetime import itertools import json import unittest import ddt import pytz from django.conf import settings from django.core.urlresolvers import reverse from django.test import RequestFactory, TestCase from edx_oauth2_provider.constants import AUTHORIZED_CLIENTS_SESSIO...
Lektorium-LLC/edx-platform
common/djangoapps/student/tests/test_views.py
Python
agpl-3.0
13,684
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either ve...
Polarcraft/KbveBot
commands/mode.py
Python
gpl-2.0
2,081
# # Univention OpenVPN integration -- openvpn-master.py # # Copyright (c) 2014-2017, bytemine GmbH # All rights reserved. # # Redistribution and use in source and binary forms, with # or without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code mu...
bytemine/univention-openvpn
univention-openvpn/openvpn4ucs.py
Python
bsd-2-clause
31,034
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'about.ui' # # Created: Sat Mar 18 12:08:47 2017 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_Dialog(object): def setupUi(self, D...
zinka/arraytool_gui
about.py
Python
bsd-3-clause
15,297
# stdlib imports import logging logger = logging.getLogger(__name__) class StandardDeployment(object): """StandardDeployment implements Marathon's basic deployment workflow and uses the primitives provided by the Marathon API to perform a standard rolling deploy according to application settings. T...
shopkeep/shpkpr
shpkpr/deployment/standard.py
Python
mit
1,338
""" Runs Airtime liquidsoap """ import argparse import os import generate_liquidsoap_cfg PYPO_HOME = '/var/tmp/airtime/pypo/' def run(): '''Entry-point for this application''' print "Airtime Liquidsoap" parser = argparse.ArgumentParser() parser.add_argument("-d", "--debug", help="run in debug mode", ...
sourcefabric/airtime
python_apps/pypo/liquidsoap/__main__.py
Python
agpl-3.0
765
"""Test node transformation for distributing ANDs.""" from tt.definitions import ( BINARY_OPERATORS, TT_AND_OP, TT_OR_OP) from ._helpers import ExpressionTreeAndNodeTestCase class TestNodeDistributeOrs(ExpressionTreeAndNodeTestCase): def test_single_operand(self): """Test that no change occ...
welchbj/tt
tt/tests/unit/trees/test_node_distribute_ands.py
Python
mit
6,119
"""Add autoincrement Revision ID: 73b63ad41d3 Revises: 331f2c45f5a Create Date: 2017-07-25 17:09:55.204538 """ # revision identifiers, used by Alembic. revision = '73b63ad41d3' down_revision = '331f2c45f5a' from alembic import op from sqlalchemy import Integer import sqlalchemy as sa def upgrade(): op.alter_c...
porduna/appcomposer
alembic/versions/73b63ad41d3_add_autoincrement.py
Python
bsd-2-clause
446
tutorial_tests = """ Let's try a simple generator: >>> def f(): ... yield 1 ... yield 2 >>> for i in f(): ... print(i) 1 2 >>> g = f() >>> next(g) 1 >>> next(g) 2 "Falling off the end" stops the generator: >>> next(g) Traceback (most recent call last...
cnsoft/kbengine-cocos2dx
kbe/src/lib/python/Lib/test/test_generators.py
Python
lgpl-3.0
50,722
# coding: utf-8 from __future__ import absolute_import, division, unicode_literals, print_function import logging from . import path from . import news_feed from . import evemail from . import wallet_update from vmbot.helpers.logging import setup_logging from vmbot.helpers import database as db from vmbot.helpers.s...
Hijacker/vmbot
tools/cron/__main__.py
Python
gpl-3.0
1,020
# -*- coding: utf-8 -*- print "gõ tiếng việt xem thế nào" print 'Dong thu 2' print "Dong thu '3'" print '''Dong dau =================xuong Dong ===========================dong tiep theo''' moto = 100 passenger = 500 car = 50 Tota_passenger = car * passenger hight = 170 weight = 60 age = 26 myname = 'cuong' print "T...
pythonvietnam/pbc082015
vumanhcuong/Day3/linhtinh.py
Python
gpl-2.0
555
import numpy as np from nlpaug.model.audio import Audio class Normalization(Audio): def manipulate(self, data, method, start_pos, end_pos): aug_data = data.copy() if method == 'minmax': new_data = self._min_max(aug_data[start_pos:end_pos]) elif method == 'max': new_data = self._max(aug_data[start_pos:en...
makcedward/nlpaug
nlpaug/model/audio/normalization.py
Python
mit
804
n = 40 N = range(n) M = [(i,j) for i in N for j in N if i<j] from random import Random rand = Random() D = [rand.randint(1,10) for i in N] R = [rand.randint(1,10) for i in N] tt = sum(D) L = [rand.randint(1,tt) for i in N] U = [L[i]+D[i]+rand.randint(10,40) for i in N] M = [(i,j) for i,j in M if L[i]<U[j] an...
langit/pymprog
models/+revman_jobs.py
Python
gpl-3.0
1,949
from __future__ import (absolute_import, division, print_function) from odm2api.ODM2.models import CVElevationDatum, setSchema from odm2api.ODMconnection import SessionFactory import pytest __author__ = 'valentine' dbs_readonly = [ ['mysql:ODM@Localhost/', 'mysql', 'mysql+pymysql://ODM:odm@localhost/'], ['...
emiliom/ODM2PythonAPI
tests/test_SessionFactory.py
Python
bsd-3-clause
1,689
# Filename: calib.py # pylint: disable=locally-disabled """ Calibration. """ import awkward as ak import numba as nb import numpy as np import km3db import km3io from thepipe import Module from km3pipe.hardware import Detector from km3pipe.dataclasses import Table from km3pipe.tools import istype from km3pipe.logger...
tamasgal/km3pipe
km3pipe/calib.py
Python
mit
18,783
import sys from distutils.core import setup if 'py2exe' in sys.argv: import os import re from distutils import log from distutils.errors import DistutilsError from distutils.command.build_py import build_py as _build_py from py2exe.build_exe import py2exe as _py2exe # Extending the build_py command (internal...
snoack/blogger-update-metatags
setup.py
Python
gpl-3.0
4,106
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
abusse/cinder
cinder/tests/targets/test_tgt_driver.py
Python
apache-2.0
17,939
# Copyright (C) 2013 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 2 of the License, or # (at your option) any later version. # # This program is distributed i...
obnam-mirror/cliapp
example4.py
Python
gpl-2.0
1,615
def axesfontsize(ax, fontsize): """ Change the font size for the title, x and y labels, and x and y tick labels for axis *ax* to *fontsize*. """ items = ([ax.title, ax.xaxis.label, ax.yaxis.label] + ax.get_xticklabels() + ax.get_yticklabels()) for item in items: item.set_fontsize(fontsize)
joelfrederico/SciSalt
scisalt/matplotlib/axesfontsize.py
Python
mit
319
import ctypes import os.path import xml.dom.minidom from contextlib import contextmanager import windows import windows.generated_def as gdef from windows import winproxy from windows.pycompat import int_types, basestring # Helpers @contextmanager def ClosingEvtHandle(handle): try: yield handle fin...
hakril/PythonForWindows
windows/winobject/event_log.py
Python
bsd-3-clause
40,867
''' 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 https://mozilla.org/MPL/2.0/. ''' # How to authenticate and process drone images using WebODM import requests, sys, os, glob, json, time import stat...
pierotofy/WebODM
slate/examples/process_images.py
Python
mpl-2.0
3,645
# This file is part of MyPaint. # -*- encoding: utf-8 -*- # Copyright (C) 2017 by the MyPaint Development Team. # # 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 2 of the License,...
odysseywestra/mypaint
gui/mvp.py
Python
gpl-2.0
11,690
import json from google.appengine.ext import ndb class Sitevar(ndb.Model): """ Sitevars represent site configuration parameters that should be adjustable without requiring a code push. They may be used to store secret information such as API keys and secrets since only app admins can read them. ...
fangeugene/the-blue-alliance
models/sitevar.py
Python
mit
1,396
#!/usr/bin/env python import sys, os, argparse, subprocess, platform def main(): parser = argparse.ArgumentParser() parser.add_argument('number', help='number of AVDs you want to create', type=int) parser.add_argument('path', help='path to your Android SDK') parser.add_argument('-a', '--arch', help='the...
ramanpreet1990/CSE_586_Simplified_Amazon_Dynamo
Scripts/create_avd.py
Python
apache-2.0
2,713
import datetime import time from django.contrib.gis.db import models from django.contrib.gis.geos import Point, LineString from django_extensions.db.fields import CreationDateTimeField, ModificationDateTimeField class Stop(models.Model): """ A single bus stop (e.g. ROCKVILLE STATION & BAY F - WEST). One or ...
hackmontgomery/thegreatmontgomeryhackathon
busstops/busstops/stops/models.py
Python
cc0-1.0
7,392
from ._M3TrussVel import *
ahoarau/m3meka
ros/shm_pwr_state_omnibase/src/shm_omnibase_controller/msg/__init__.py
Python
mit
27
import xbmc,xbmcplugin,xbmcaddon,xbmcgui import re,os from BeautifulSoup import BeautifulSoup, Tag, NavigableString class Settings(): def __init__(self, ids=[]): self.default = 'plugin.video.theroyalwe' self._bin = {} if not xbmcaddon.Addon(id=self.default).getSetting('machine-id'): import time, hashlib ...
jolid/script.module.donnie
lib/donnie/settings.py
Python
gpl-2.0
2,269
# encoding=utf-8 import functools import io import warnings import wpull.testing.async from wpull.errors import NetworkError from wpull.network.connection import Connection from wpull.network.pool import ConnectionPool from wpull.protocol.abstract.client import DurationTimeout from wpull.protocol.http.client import Cl...
chfoo/wpull
wpull/protocol/http/client_test.py
Python
gpl-3.0
3,817
import os, curses s = curses.initscr() curses.cbreak() curses.noecho() s.keypad(1) s.addstr(0, 0, '~~:q to quit') s.refresh() # FIX: Add End, Home recognized as ~ map = { 339: 'Prior', 338: 'Next', 331: 'Insert', 330: 'Delete', 276: 'F12', 275: 'F11', 274: 'F10', 273: 'F9', 272: 'F...
wvffle/tablet-scripts
input.py
Python
mit
1,618
from django.conf.urls import url from formly.views import design, results, run app_name = "formly" urlpatterns = [ url(r"^design/$", design.survey_list, name="survey_list"), url(r"^design/surveys/(?P<pk>\d+)/$", design.survey_detail, name="survey_detail"), url(r"^design/surveys/create/$", design.survey_...
eldarion/formly
formly/urls.py
Python
bsd-3-clause
2,966
# Copyright 2017 Huawei Technologies Co.,LTD. # # 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 agre...
phenoxim/nova
nova/tests/functional/compute/test_host_api.py
Python
apache-2.0
5,625
from random import randint from numbers import Number width = int(input("Enter the width: ")) height = int(input("Enter the height: ")) telecount = int(input("Enter the telecount: ")) filename = str(input("Enter File name: ")) def makeMatrix(): grid = [] for i in range(0, height): line = [] fo...
jregistr/Academia
CSC455-Game-Programming/Pathfinder/android/assets/gen.py
Python
mit
1,888
model_search = "http://api.nytimes.com/svc/search/v2/" + \ "articlesearch.response-format?" + \ "[q=search term&" + \ "fq=filter-field:(filter-term)&additional-params=values]" + \ "&api-key=9key" """http://api.nytimes.com/svc/search/v2/articlesearch.json?q=terrorism+OR+t...
polypmer/scrape
new-york-times/nytimes-scrape.py
Python
mit
1,833
""" Signal handler for setting default course mode expiration dates """ import logging from crum import get_current_user from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_save from django.dispatch.dispatcher import receiver from xmodule....
eduNEXT/edx-platform
common/djangoapps/course_modes/signals.py
Python
agpl-3.0
3,525
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015 Leonardo Kewitz Copyright (c) 2015 Marcelo Vanti 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, includin...
kewitz/FEMstudies
poisson.py
Python
mit
3,204
import six import sys from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfpage import PDFPage from pdfminer.pdfpage import PDFTextExtractionNotAllowed from pdfminer.pdfinterp import PDFResourceManager from pdfminer.pdfinterp import PDFPageInterpreter from pdfminer.pdf...
mosen/profiledocs
myna/myna.py
Python
mit
2,860
from __future__ import unicode_literals from django.utils.six import with_metaclass from django.forms.models import ( BaseModelFormSet, modelformset_factory, ModelForm, _get_foreign_key, ModelFormMetaclass, ModelFormOptions ) from django.db.models.fields.related import ForeignObjectRel from modelcluster.mo...
theju/django-modelcluster
modelcluster/forms.py
Python
bsd-3-clause
9,443
from __future__ import print_function import re from pprint import pprint import time from streamlink import PluginError from streamlink.cache import Cache from streamlink.plugin import Plugin, PluginOptions from streamlink.plugin.api import http from streamlink.plugin.api import useragents from streamlink.plugin.api...
mmetak/streamlink
src/streamlink/plugins/wwenetwork.py
Python
bsd-2-clause
6,316
#!/usr/bin/python # -*- coding: iso-8859-15 -*- # motion_compress_j2k.py import os import sys from subprocess import check_call from subprocess import CalledProcessError from MCTF_parser import MCTF_parser COMPONENTS = 4 BYTES_PER_COMPONENT = 2 BITS_PER_COMPONENT = BYTES_PER_COMPONENT * 8 file = "...
vicente-gonzalez-ruiz/QSVC
trunk/src/old_py/motion_compress_j2k_sincomponents.py
Python
gpl-2.0
3,143
class OAuthToolkitError(Exception): """ Base class for exceptions """ def __init__(self, error=None, redirect_uri=None, *args, **kwargs): super(OAuthToolkitError, self).__init__(*args, **kwargs) self.oauthlib_error = error if redirect_uri: self.oauthlib_error.redirec...
ramcn/demo3
venv/lib/python3.4/site-packages/oauth2_provider/exceptions.py
Python
mit
441
""" Created on Dec 04, 2016 @author: john papa Copyright 2016 John Papa. All rights reserved. This work is licensed under the MIT License. """ from abc import ABCMeta, abstractproperty class Card(metaclass=ABCMeta): """ This is an Abstract Base Class for Card objects. Cards from this class should work for...
johnpapa2/twenty-one
cards/card.py
Python
mit
1,104
from courselib.auth import requires_role from django.shortcuts import render, get_object_or_404, HttpResponseRedirect, reverse from django.contrib import messages from grad.models import GradRequirement from log.models import LogEntry @requires_role("GRAD", get_only=["GRPD"]) def requirements(request): requirement...
sfu-fas/coursys
grad/views/requirements.py
Python
gpl-3.0
1,354
# -*- coding: utf-8 -* from flask import jsonify def jsonifyReturn(success=True, status_code=201, code=1000, message='Success', data=None): res = jsonify({'success': success, 'code': code, 'message': message, 'data': data}) res.status_code = status_code return res
qitianchan/LightLights
lightlights/utils/__init__.py
Python
apache-2.0
279
#/usr/bin/env python # SPDX-License-Identifier: MIT # Copyright (c) 2017 Martin Miller, Nick Zatkovich # https://stackoverflow.com/questions/12251896/colorize-image-while-preserving-transparency-with-pil from PIL import Image, ImageColor, ImageOps def image_tint(image, tint=None): if tint is None: return image i...
CWolfRU/freedoom
graphics/text/tint.py
Python
bsd-3-clause
1,905
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_envcheckr ---------------------------------- Tests for `envcheckr` module. """ import pytest from envcheckr import envcheckr def test_parse_lines(): lines_a = envcheckr.parse_lines('tests/env') assert len(lines_a) == 3 lines_b = envcheckr.parse_li...
adamjace/envcheckr
tests/test_envcheckr.py
Python
mit
983
######################################################################## # $HeadURL$ # File : CloudStackImage.py # Author : Victor Mendez ( vmendez.tic@gmail.com ) ######################################################################## # DIRAC from DIRAC import gLogger, gConfig, S_OK, S_ERROR # VMDIRAC from VMDIRA...
myco/VMDIRAC
WorkloadManagementSystem/Client/CloudStackImage.py
Python
gpl-3.0
9,694
import logging import time from functools import partial from collections import OrderedDict from .ophydobj import OphydObject from .status import (MoveStatus, wait as status_wait) from .utils.epics_pvs import (data_type, data_shape) logger = logging.getLogger(__name__) class PositionerBase(OphydObject): '''The...
dchabot/ophyd
ophyd/positioner.py
Python
bsd-3-clause
9,729
import numpy as np import numexpr as ne import time as timeTools import matplotlib.pyplot as plt from ..doublyPeriodic import doublyPeriodicModel from numpy import pi class model(doublyPeriodicModel): def __init__(self, name = None, # Grid parameters nx = 128, ny = None, Lx = 2.0*pi, Ly ...
glwagner/py2Periodic
py2Periodic/physics/twoDimTurbulence_fftbuildEx.py
Python
mit
8,847
# 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 from frappe.utils import cint, flt, cstr, comma_or from erpnext.setup.utils import get_company_currency from frappe import _, throw from e...
bhupennewalkar1337/erpnext
erpnext/controllers/selling_controller.py
Python
gpl-3.0
12,444
# 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 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
michel-slm/bodhi
bodhi/services/builds.py
Python
gpl-2.0
3,278
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
samuelfd/harpia
harpia/bpGUI/stereoCorr.py
Python
gpl-2.0
7,801
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ Helper functions for reports testing. Please /do not/ import this file by default, but only explicitly call it through the code of yaml tests. """ import odoo import odoo.report import odoo.tools as tools i...
kosgroup/odoo
odoo/tools/test_reports.py
Python
gpl-3.0
12,452
#!venv/bin/python3 from pxeat import app, views views.chk_args() app.debug = True app.run(host='127.0.0.1')
wnereiz/pxeat
run.py
Python
gpl-3.0
112
#!/usr/bin/env python import sys import argparse import pkg_resources import vcf from vcf.parser import _Filter parser = argparse.ArgumentParser(description='Filter a VCF file', formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('input', metavar='input', type=str, nargs=1, ...
chapmanb/cyvcf
scripts/vcf_filter.py
Python
mit
2,234
class Size(object): def __init__(self, client_id="", api_key=""): self.client_id = client_id self.api_key = api_key self.name = None self.id = None self.memory = None self.cpu = None self.disk = None self.cost_per_hour = None self.cost_per_mon...
lertech/extra-addons
network/model/digitalocean/Size.py
Python
gpl-3.0
330
#!env/python3 # coding: utf-8 import os from core.framework.common import * from core.framework.postgresql import * def sample_init(self, loading_depth=0): """ Init properties of a sample : - id : int : the unique id of the sample in...
REGOVAR/Regovar
regovar/core/model/sample.py
Python
agpl-3.0
7,379
from distutils.core import setup, Extension, Command from distutils.command.build import build from distutils.command.build_ext import build_ext from distutils.command.config import config from distutils.msvccompiler import MSVCCompiler from distutils import sysconfig import string import sys mkobjs = ['column', 'cust...
electric-cloud/metakit
python/setup.py
Python
mit
7,317
import gargparse FLAGS = gargparse.ARGS _FLAG_NAMES = set() def add_flag(name, *args, **kwargs): """Add a flag. Added flags can be accessed by `FLAGS` module variable. (e.g. `FLAGS.my_flag_name`) - Args - `name`: Flag name. Real flag name will be `"--{}".format(name)`. - `*args`, `...
raviqqe/tensorflow-qnd
qnd/flag.py
Python
unlicense
1,829
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def update_vote_statuses(apps, schema_editor): Vote = apps.get_model("ideas", "Vote") for vote in Vote.objects.all(): if vote.vote: vote.status = 1 else: vote.statu...
CivilHub/CivilHub
ideas/migrations/0006_auto_20150609_1350.py
Python
gpl-3.0
532
from math import log2 n, l, r = map(int, input().split()) a = list(map(int, list(bin(n)[2:]))) ans = 0 for i in range(l, r + 1): ans += a[int(log2(i & -i))] print(ans)
xehoth/OnlineJudgeCodes
codeforces/Divide by Zero 2017 and Codeforces Round #399 (Div. 1 + Div. 2, combined) 768/B-Code For 1.py
Python
apache-2.0
177
from .. import NextGenInstanceResource, NextGenListResource class CredentialList(NextGenInstanceResource): """ A Credential List Resource. See the `SIP Trunking API reference <https://www.twilio.com/docs/sip-trunking/rest/credential-lists>_` for more information. .. attribute:: sid T...
kramwens/order_bot
venv/lib/python2.7/site-packages/twilio/rest/resources/trunking/credential_lists.py
Python
mit
1,709
from SubChoosers.ISubStagesChooser import ISubStagesChooser from SubRankers.ByPropertiesSubStagesRanker import ByPropertiesSubStagesRanker from Utils import WriteDebug class UncertainSubStagesChooser(ISubStagesChooser): """ Implementation of ISubStagesChooser. This chooser returns the first SubStage...
yosi-dediashvili/SubiT
src/SubChoosers/UncertainSubStagesChooser.py
Python
gpl-3.0
2,800
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
nathanbjenx/cairis
cairis/gui/BasePanel.py
Python
apache-2.0
7,016
# python3 # pylint: disable=g-bad-file-header # Copyright 2019 DeepMind Technologies Limited. 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...
deepmind/bsuite
bsuite/experiments/umbrella_distract/analysis.py
Python
apache-2.0
2,148
n = int(input()) for x in range(1, 11): print("{} x {} = {}".format(n, x, n*x))
clemus90/competitive-programming
hackerRank/30DaysOfCode/day_5_loops.py
Python
mit
84
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/dotcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
zombo/dotcoin-src
share/qt/extract_strings_qt.py
Python
mit
1,784
from typing import List import typepy from ._python import PythonCodeTableWriter class NumpyTableWriter(PythonCodeTableWriter): """ A table writer class for ``NumPy`` source code format. :Example: :ref:`example-numpy-table-writer` .. py:method:: write_table |write_table| w...
thombashi/pytablewriter
pytablewriter/writer/text/sourcecode/_numpy.py
Python
mit
1,960
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # """ This submodule is used to parse metadata from XML_ (``.xml``) files. .. _XML: https://en.wikipedia.org/wiki/XML Format schema:: <root> <item key="key">value</item> </root> Example of valid data:: <root> ...
edeposit/edeposit.amqp.ftp
src/edeposit/amqp/ftp/decoders/parser_xml.py
Python
gpl-2.0
2,247
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
odoousers2014/odoo
addons/hr_holidays/tests/test_holidays_flow.py
Python
agpl-3.0
10,541
#!/usr/bin/python # -*- coding: utf-8 -*-. from utils.linuxOsUtils import LinuxOsUtils class generic(): '''class for generic pytnon functions''' def __init__(self): pass def reply_YN(self,message): '''Wrapper to check that y or n is replied''' reply = None while True: ...
lradaelli85/linuxPyUtils
utils/Generic.py
Python
gpl-3.0
1,273
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
mrcslws/nupic.research
projects/archive/dynamic_sparse/runs/run_cnn.py
Python
agpl-3.0
2,467
#!/bin/env python3 import unittest from collections import deque infinity = float("inf") class bdeque(deque): def front(self): return self[0] def front_pop(self): return self.popleft() def back(self): return self[-1] def back_pop(self): return self.pop() def back_push(self, x): retu...
mithro/scheduler-simulator
scheduler.py
Python
apache-2.0
29,531
# 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...
scenarios/tensorflow
tensorflow/python/training/queue_runner_impl.py
Python
apache-2.0
16,836
#!/usr/bin/env python3 """Various set implementations.""" __all__ = [ # Mutable versions; Immutable versions; Ordered; Duplicates "Set", "FrozenSet", # [ ] [ ] "MultiSet", "FrozenMultiSet", # [ ] [X] "OrderedSet", "Froz...
Vgr255/logging
logger/sets.py
Python
bsd-2-clause
25,310
#!/usr/bin/env python import pygtk pygtk.require("2.0") import gtk import gtk.glade #import gtk.gtkgl import pickle # to store and load dicts to file import os, sys, inspect import ocad_viewer import gtkviewer import gobject from layer import layer from ocad_primitives import * from pygtkgl_area import GtkGlDrawing...
Victor-Haefner/ontocad
src/ocad_gui.py
Python
gpl-3.0
11,120
import subprocess import os, sys from secretsdump import retrieve_hash from config.header import Header from config.write_output import print_debug from ctypes import * import logging from config.moduleInfo import ModuleInfo class Secrets(ModuleInfo): def __init__(self): options = {'command': '-s', 'acti...
theoneandonly-vector/LaZagne
Windows/src/LaZagne/softwares/windows/secrets.py
Python
lgpl-3.0
1,980
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class SortedTests(TranspileTestCase): pass class BuiltinSortedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["sorted"] not_implemented = [ 'test_bool', 'test_bytearray', 'test_bytes', ...
glasnt/voc
tests/builtins/test_sorted.py
Python
bsd-3-clause
590
__author__ = 'yalnazov' try: import unittest2 as unittest except ImportError: import unittest from paymill.paymill_context import PaymillContext from paymill.models.payment import Payment from . import test_config class TestPaymentService(unittest.TestCase): def setUp(self): self.p = PaymillCont...
paymill/paymill-python
tests/test_payment_service.py
Python
mit
1,077
from corehq.apps.app_manager.models import SavedAppBuild, Application from django.core.management.base import BaseCommand class Command(BaseCommand): """ Goes through all builds and checks whether they have forms with version numbers higher than the build version. (This has been found to cause auto-u...
gmimano/commcaretest
corehq/apps/cleanup/management/commands/check_form_versions.py
Python
bsd-3-clause
1,001
#!/usr/bin/env python # -*- coding:utf-8 -*- #__author__="hechao" #__date__ ="$2012-3-8 10:12:56$" import os import gtk import time import gobject from threading import Thread from globals import * from syscall import xz_file from widgets import BaseFucn from devices import Device from dbuscall import init_dbus impo...
wubomichael/devicemanage
src/lib/ydevicemanager/libdevice.py
Python
gpl-2.0
9,755
from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base import simplejson import requests # How many revisions are returned by each API call # Keep this at 1 due to https://bugzilla.wikimedia.org/show_bug.cgi?id=29223 rvlimit=1 pageids = {\ 28486453: 'http://en.wi...
tothebeat/wikipedia-revisions
revdiffs.py
Python
mit
4,373
import copy import json import operator import re from functools import partial, reduce, update_wrapper from urllib.parse import quote as urlquote from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, widgets from django.contrib.admin.ch...
wkschwartz/django
django/contrib/admin/options.py
Python
bsd-3-clause
92,875
#!/usr/bin/env python3 # Copyright (c) 2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test node eviction logic When the number of peers has reached the limit of maximum connections, the next ...
ElementsProject/elements
test/functional/p2p_eviction.py
Python
mit
5,754
# -*- coding: utf8 -*- import functools @functools.lru_cache(maxsize=None) def get_stopwords() -> tuple: # 上記のc2に該当 ''' ストップワードリストを返す ''' from time import sleep # キャッシュ確認用のデバックスリープ! sleep(3) import urllib.request url = 'http://svn.sourceforge.jp/svnroot/slothlib/CSharp/Version1/SlothLib/NLP/Filter/S...
umyuu/Sample
src/Python3/Q112677/exsample.py
Python
mit
803
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Dedi Sinaga (<http://dedisinaga.blogspot.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
sumihai-tekindo/account_sicepat
product_duration/__openerp__.py
Python
gpl-3.0
1,518
########################################## # UTILS.py # Helper functions for calculating & more # For use in main and other programs ########################################## from hunter import hunter from gather import gather from killer import buy, sell def loop_gather(stock): count = 1 while True: ...
fordham-css/ptp
utils.py
Python
mit
3,998
from django.contrib.staticfiles import storage # Configure the permissions used by ./manage.py collectstatic # See https://docs.djangoproject.com/en/1.10/ref/contrib/staticfiles/ class TTStaticFilesStorage(storage.StaticFilesStorage): def __init__(self, *args, **kwargs): kwargs['file_permissions_mode'] = 0...
Goodly/TextThresher
thresher_backend/storage.py
Python
apache-2.0
446
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
DirectXMan12/nova-hacking
nova/tests/api/openstack/compute/test_server_metadata.py
Python
apache-2.0
21,958
"""Module for package-wide used helper functions.""" from __future__ import division from sympy import log def entropy(p): """Return the entropy of a Bernoulli random variable with success probability p.""" if (p == 0) or (p == 1): return 0 return -p * log(p)
goujou/LAPM
src/LAPM/helpers.py
Python
mit
282
#/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2014, Nigel Small # # 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 ...
pombreda/py2neo
test/schema_test.py
Python
apache-2.0
5,408
#!/usr/bin/env python # # Copyright (c) 2012 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. """Utility script to install APKs from the command line quickly.""" import multiprocessing import optparse import os import sys ...
hugegreenbug/libgestures
include/build/android/adb_install_apk.py
Python
bsd-3-clause
2,722
#!/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...
wubr2000/googleads-python-lib
examples/dfp/v201411/placement_service/get_placements_by_statement.py
Python
apache-2.0
1,866