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
# coding=utf-8 # Copyright 2018 The Google AI Team Authors. # # 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 applicabl...
google-research/albert
run_squad_v2.py
Python
apache-2.0
19,512
# Copyright (c) 2019 PaddlePaddle 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 appli...
PaddlePaddle/Paddle
python/paddle/fluid/dygraph/container.py
Python
apache-2.0
11,510
import os import json import pytest import shutil import logging import datetime from ndnp_iiif import load_batch from os.path import dirname, isdir, join, relpath test_data = join(dirname(__file__), 'test-data') test_iiif= join(test_data, 'iiif') kale = join(test_data, 'batch_mdu_kale') logging.basicConfig(filename...
umd-mith/ndnp_iiif
test.py
Python
mit
3,522
#!/usr/bin/python # encoding: utf-8 # filename: baixaLattes.py # # scriptLattes V8 # Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr. # http://scriptlattes.sourceforge.net/ # # Este programa é um software livre; você pode redistribui-lo e/ou # modifica-lo dentro dos termos da Licença Pública Geral...
magsilva/scriptLattes
scriptLattes/baixaLattes.py
Python
gpl-2.0
2,771
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Household' db.create_table('people_household', ( ('id', self.gf('django.db.mod...
pizzapanther/Church-Source
churchsource/people/migrations/0001_initial.py
Python
gpl-3.0
6,849
from typing import List class Solution: def wordBreak(self, s: str, wordDict: List[str]) -> bool: memo = [None] * (len(s)+1) def bfs(start): if start == len(s): return True substr = s[start:] for word in wordDict: if substr.starts...
daicang/Leetcode-solutions
139-word-break.py
Python
mit
1,041
# -*- coding: utf-8 -*- from TM1py.Objects.TM1Object import TM1Object class ChoreFrequency(TM1Object): """ Utility class to handle time representation fore Chore Frequency """ def __init__(self, days, hours, minutes, seconds): self._days = str(days).zfill(2) self._hours = str(hours)....
MariusWirtz/TM1py
TM1py/Objects/ChoreFrequency.py
Python
mit
1,785
# Copyright (c) 2013-2015 Centre for Advanced Internet Architectures, # Swinburne University of Technology. All rights reserved. # # Author: Sebastian Zander ([email protected]) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
knneth/teacup
runbg.py
Python
bsd-2-clause
5,429
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from future.utils import bytes_to_native_str from hypothesis import given import hypothesis.strategies as st import unittest from caffe2.proto import caffe2_pb2 from caf...
ryfeus/lambda-packs
pytorch/source/caffe2/python/core_gradients_test.py
Python
mit
34,478
#!/usr/bin/python ## Author: akshat ## Date: Dec, 3,2016 # trains the model from keras.models import model_from_json import load_data import numpy import matplotlib.pyplot as plt import time # load json model json_file = open('model.json', 'r') loaded_model = json_file.read() json_file.close() model = model_from_json...
sumanth-nirmal/self-driving-car-predict-steering
model/scripts/train_left.py
Python
mit
1,982
import numpy as np import sys import os import importlib import tensorflow.keras as keras from tensorflow.keras.models import Model from tensorflow.keras.models import load_model from tensorflow.keras.callbacks import CSVLogger import tensorflow as tf import pickle labels_train = None data_train = None netmodule = Non...
PatrikAAberg/dmce
netshooter/src/dmce/netshooter.py
Python
mit
22,008
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-15 01:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('games', '0008_auto_20160612_0449'), ] operations = [ migrations.AddField( ...
Turupawn/website
games/migrations/0009_installer_rating.py
Python
agpl-3.0
805
import unittest from ctypes import * import _ctypes_test lib = CDLL(_ctypes_test.__file__) class LibTest(unittest.TestCase): def test_sqrt(self): lib.my_sqrt.argtypes = c_double, lib.my_sqrt.restype = c_double self.failUnlessEqual(lib.my_sqrt(4.0), 2.0) import math self.fa...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/ctypes/test/test_libc.py
Python
mit
894
# Copyright 2017 FUJITSU 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 in writ...
stackforge/monasca-api
monasca_api/version.py
Python
apache-2.0
699
import uuid from flask import Module, flash, request, g, current_app, \ abort, redirect, url_for, session, jsonify from flaskext.mail import Message from flaskext.babel import gettext as _ from flaskext.principal import identity_changed, Identity, AnonymousIdentity from newsmeme.forms import ChangePasswordForm, ...
danjac/newsmeme
newsmeme/views/account.py
Python
bsd-3-clause
6,556
import bibtexparser import formatter.apalike from bibtexparser.bparser import BibTexParser from bibtexparser.customization import * # logging configuration for bibtexparser to stderr import logging import logging.config logger = logging.getLogger(__name__) logging.config.dictConfig({ 'version': 1, 'disable_e...
msprev/unite-bibtex
pythonx/core/bibtex.py
Python
bsd-3-clause
2,647
__author__ = 'robert' LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' def main(): myMessage = "Yhwvtroi, 28 Yudq 2016 - Pse bjatw pt foxgf zwjzql bgio qcwelwlar, blsg rmprochek ewrv nsoyr uvs ndcljebv rk pkium hy bef; sjr wutm vljg aybefl ds ydx mchf asx bojw lwfxx, aph fjsbntzaju kkwixit hvbduyzkik wme ylpzs gdrdv. wbu w...
RobertEviston/CollegeWork
4th Year Security Labs/Lab 2/Lab2Question4.py
Python
mit
2,285
""" Mock classes for use in aws_federation_proxy_tests """ from __future__ import print_function, absolute_import, unicode_literals, division from aws_federation_proxy.aws_federation_proxy import AWSFederationProxy class MockAWSFederationProxyForInitTest(AWSFederationProxy): def _setup_provider(self): pa...
ImmobilienScout24/afp-core
src/unittest/python/aws_federation_proxy_mocks.py
Python
apache-2.0
323
# -*- coding: utf-8 -*- # ProjectEuler/src/python/problem395.py # # Pythagorean tree # ================ # Published on Saturday, 22nd September 2012, 11:00 pm # # The Pythagorean tree is a fractal generated by the following procedure: # Start with a unit square. Then, calling one of the sides its base (in the # animat...
olduvaihand/ProjectEuler
src/python/problem395.py
Python
mit
1,312
#!/usr/bin/env python import os import sys import subprocess def packer_args(option): args = [ "packer", "build", option, "packer.json" ] return args branch = os.getenv('TRAVIS_BRANCH', '') if branch == 'master': os.environ['RELEASE_VER'] = "latest" args = packer...
jobscore/ruby-image
builder.py
Python
mit
831
# 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...
Akasurde/bodhi
bodhi/captcha.py
Python
gpl-2.0
4,366
#!/usr/bin/env python from shutil import copyfile import os import datetime from dateutil.parser import parse import ConfigParser from modules.bropy_logs import * from modules.bropy_rules import * from modules.bropy_conparse import * from modules.bropy_menus import * from modules.bropy_install import * #Use bropy.cfg...
hashtagcyber/bropy
bropy.py
Python
mit
5,281
'''This module provides a DBUS API for emesene''' # -*- coding: utf-8 -*- # This file is part of emesene. # # emesene 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...
emesene/emesene
emesene/e3/common/externalapi/ExternalApiDBus.py
Python
gpl-3.0
4,154
# -*- coding: utf-8 -*- from .box import FullBox from .box import indent from .box import read_box from .box import read_int from .box import read_string class ItemInformationBox(FullBox): box_type = 'iinf' is_mandatory = False def __init__(self, size, version, flags): super().__init...
m-hiki/isobmff
isobmff/iinf.py
Python
mit
3,600
# 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, # but...
cnewcome/sos
sos/plugins/powerpc.py
Python
gpl-2.0
3,015
''' Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. ''' class Solution(object): def minPathSum(self, grid): """ :type gr...
gavinfish/leetcode-share
python/064 Minimum Path Sum.py
Python
mit
880
# Copyright (c) 2006-2016 LOGILAB S.A. (Paris, FRANCE) <[email protected]> # Copyright (c) 2010 Daniel Harding <[email protected]> # Copyright (c) 2012-2014 Google, Inc. # Copyright (c) 2013-2020 Claudiu Popa <[email protected]> # Copyright (c) 2014 Brett Cannon <[email protected]> # Copyright (c) 2014 Arun Persau...
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/pylint/pylint/checkers/base.py
Python
mit
100,473
# -*- coding: utf-8 -*- """ *************************************************************************** OutputSelectionPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************...
sebastic/QGIS
python/plugins/processing/gui/OutputSelectionPanel.py
Python
gpl-2.0
9,178
from flask_restplus import Api, fields from server import app ###################################################################### # Configure Swagger before initializing it ###################################################################### api = Api(app, version='1.0.0', title='Recommendation...
devopsdelta/recommendations
app/swagger.py
Python
apache-2.0
2,740
# -*- coding: utf-8 -*- # Copyright 2017-2018 Quartile Limited # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from collections import defaultdict from datetime import datetime from openerp.modules.registry import RegistryManager from openerp.osv import osv from openerp import SUPERUSER_ID from opener...
rfhk/awo-custom
partner_statement_report/report/partner_statement_report.py
Python
lgpl-3.0
16,377
"""Fetch from conda database all available versions of the xarray dependencies and their publication date. Compare it against requirements/py37-min-all-deps.yml to verify the policy on obsolete dependencies is being followed. Print a pretty report :) """ import itertools import sys from datetime import datetime from ty...
pydata/xarray
ci/min_deps_check.py
Python
apache-2.0
6,406
#-*- coding: utf-8 -*- from logpot.ext import db from logpot.models import TimestampMixin from passlib.hash import pbkdf2_sha256 class User(db.Model, TimestampMixin): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String, unique=True, nullable=False) email =...
moremorefor/Logpot
logpot/auth/models.py
Python
mit
953
import pickle from base64 import b64encode from pulsar.utils.html import UnicodeMixin class FieldError(RuntimeError): pass def get_field_type(field): return getattr(field, 'repr_type', 'text') class Field(UnicodeMixin): '''Base class of all :mod:`.odm` Fields. Each field is specified as a :class...
Ghost-script/dyno-chat
kickchat/apps/pulsar/apps/data/odm/fields.py
Python
gpl-2.0
12,075
# Copyright (C) 2010 Javier Palacios # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY...
javiplx/ameba-C3
client/__init__.py
Python
gpl-2.0
505
''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class HotelFixbookingRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.booking_id = None self.cou_code = None self.hn_code = None self.rev_count = None...
CooperLuan/devops.notes
taobao/top/api/rest/HotelFixbookingRequest.py
Python
mit
384
# Copyright (C) 2001-2010 Python Software Foundation # Author: Barry Warsaw # Contact: [email protected] """Classes to generate plain text from a message object tree.""" __all__ = ['Generator', 'DecodedGenerator', 'BytesGenerator'] import re import sys import time import random from copy import deepcopy from io ...
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/email/generator.py
Python
gpl-3.0
19,988
#!/usr/bin/python ###################################################################### # Autor: Andrés Herrera Poyatos # Date: June, 2015 # Interval Tree Implementation ####################################################################### #----------------- INTERVAL TREE IMPLEMENTATION -----------------# class I...
andreshp/Algorithms
DataStructures/IntervalTree/IntervalTree.py
Python
gpl-2.0
2,559
# Grid Search for Algorithm Tuning import numpy as np import pandas as pd from sklearn import datasets from sklearn.linear_model import Ridge from sklearn.grid_search import GridSearchCV ### Plotting function ### from matplotlib import pyplot as plt from sklearn.metrics import r2_score def plot_r2(y, y_pred, titl...
WesleyyC/Restaurant-Revenue-Prediction
Ari/needs_work/GridSearch.py
Python
mit
1,295
import datetime import re import time import urllib from urllib import robotparser from urllib.request import urlparse from downloader import Downloader DEFAULT_DELAY = 5 DEFAULT_DEPTH = -1 DEFAULT_URL = -1 DEFAULT_AGENT = 'wswp' DEFAULT_RETRY = 1 DEFAULT_TIMEOUT = 60 DEFAULT_IGNORE_ROBOTS = False def link_crawler...
Stevearzh/greedy-spider
link_crawler.py
Python
mit
3,151
from django.conf.urls.defaults import * from indivo.views import * from indivo.lib.utils import MethodDispatcher urlpatterns = patterns('', (r'^$', MethodDispatcher({ 'DELETE' : carenet_delete})), (r'^/rename$', MethodDispatcher({ 'POST' : carenet_rename})), (r'^/record$', ...
sayan801/indivo_server
indivo/urls/carenet.py
Python
gpl-3.0
1,997
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: [email protected] Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from telestream_cloud_qc.configuration import Configuration class...
Telestream/telestream-cloud-python-sdk
telestream_cloud_qc_sdk/telestream_cloud_qc/models/field_order_test.py
Python
mit
7,399
from django.conf.urls import * from django.contrib.auth import views as auth_views from userena import views as userena_views from userena import settings as userena_settings from userena.compat import auth_views_compat_quirks, password_reset_uid_kwarg #arq=open('userena_logg.txt','w') #arq.write('ok\n') #arq.close ...
sanderlacerda/django-userena
userena/urls.py
Python
bsd-3-clause
4,532
#-*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocols...
dasbruns/netzob
src/netzob/Common/Models/Vocabulary/Functions/EncodingFunctions/DomainEncodingFunction.py
Python
gpl-3.0
5,376
#! /usr/bin/env python # -*- coding: utf-8 -*- """ 附双色球彩票规则: 双色球由红球和蓝球两部份组成,从33个红球号码(01~33)中选择6个,再从16个蓝球号码(01~16)中选择1个。开奖时,在红色球中随机\ 摇出六个红号,在蓝色球中随机摇出一个蓝号。 要求: 生成一组或多组彩票号码 附加题1:模拟开奖结果,用你自己手选的号码,去计算中奖的概率 附加题2:加入购买费用(2元一注)和奖金返还,算算看你玩一百年彩票能赚(kui)多少钱 """ import random class DoubleColorBalls(object): RED_BALLS_COUNT ...
PeytonXu/learn-python
cases/double_color_balls/double_color_balls.py
Python
mit
1,762
# (C) Copyright 2005 Nuxeo SAS <http://nuxeo.com> # Author: [email protected] # Contributors: Tom Lazar # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as published # by the Free Software Foundation. # # This program is distribut...
goshippo/FunkLoad
src/funkload/PatchWebunit.py
Python
gpl-2.0
20,004
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Huegely Docs build configuration file, created by # sphinx-quickstart on Sat Dec 19 01:44:06 2015. # # 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 # autogenerat...
kirberich/huegely
docs/source/conf.py
Python
mit
9,356
"""Bridges between the `asyncio` module and Tornado IOLoop. This is a work in progress and interfaces are subject to change. To test: python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOMainLoop (the tests log a f...
bdh1011/wau
venv/lib/python2.7/site-packages/tornado/platform/asyncio.py
Python
mit
5,800
#!/usr/bin/python # -*- coding: utf-8 -*- # Checks MAME artwork # # Copyright (c) 2016-2017 Wintermute0110 <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2...
Wintermute0110/plugin.program.advanced.MAME.launcher
dev-misc/check_MAME_assets.py
Python
gpl-2.0
7,847
import unittest from nanomongo.field import Field from nanomongo.document import Nanomongo class NanomongoTestCase(unittest.TestCase): def test_nanomongo_inits(self): self.assertRaises(TypeError, Nanomongo, *(1,)) self.assertRaises(TypeError, Nanomongo, **{'foo': 'bar'}) self.assertRaises...
eguven/nanomongo
test/test_nanomongo.py
Python
apache-2.0
807
# Copyright 2011 the Melange authors. # # 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...
rhyolight/nupic.son
tests/app/soc/modules/gsoc/views/test_admin.py
Python
apache-2.0
5,893
#!/usr/bin/env python ######################################################################################### # # Perform operations on images # # --------------------------------------------------------------------------------------- # Copyright (c) 2015 Polytechnique Montreal <www.neuro.polymtl.ca> # Authors: Julie...
3324fr/spinalcordtoolbox
scripts/sct_image.py
Python
mit
26,505
# Author: Nic Wolfe <[email protected]> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
lexyan/SickBeard
sickbeard/searchBacklog.py
Python
gpl-3.0
7,628
import unittest import io import os import tempfile from genericWrapper4AC.domain_specific.satwrapper import SatWrapper from genericWrapper4AC.argparser.parse import parse class TestChecker(unittest.TestCase): def setUp(self): self.runsolver = os.path.join( os.path.dirname(os.path.dirname(__f...
mlindauer/GenericWrapper4AC
test/test_calls/test_checker.py
Python
bsd-2-clause
6,029
import collections from supriya import CalculationRate from supriya.ugens.UGen import UGen class Phasor(UGen): """ A resettable linear ramp between two levels. :: >>> trigger = supriya.ugens.Impulse.kr(0.5) >>> phasor = supriya.ugens.Phasor.ar( ... rate=1, ... re...
Pulgama/supriya
supriya/ugens/Phasor.py
Python
mit
788
#! /usr/bin/python from __future__ import print_function from time import time from math import sqrt # Project Euler # 44 def is_pentagonal(x): if x < 1: return False n = (sqrt(24 * x + 1) + 1) / 6 if n.is_integer(): return n else: return False def pentagonal(n): return n...
henry808/euler
044/eul044.py
Python
mit
764
from saml2 import BINDING_SOAP, BINDING_HTTP_REDIRECT, BINDING_HTTP_POST from saml2.saml import NAMEID_FORMAT_PERSISTENT from saml2.saml import NAME_FORMAT_URI try: from saml2.sigver import get_xmlsec_binary xmlsec_path = get_xmlsec_binary(["/opt/local/bin"]) except ImportError: xmlsec_path = '/usr/bin/xml...
natebeacham/saml2
tests/idp_conf.py
Python
bsd-2-clause
2,146
# -*- coding: utf-8 -*- """ *************************************************************************** SpatialJoin.py --------------------- Date : September 2017 Copyright : (C) 2017 by Nyall Dawson Email : nyall dot dawson at gmail dot com ***************...
spaceof7/QGIS
python/plugins/processing/algs/qgis/SpatialJoinSummary.py
Python
gpl-2.0
15,138
from cs231n.layers import * from cs231n.fast_layers import * def affine_relu_forward(x, w, b): """ Convenience layer that perorms an affine transform followed by a ReLU Inputs: - x: Input to the affine layer - w, b: Weights for the affine layer Returns a tuple of: - out: Output from the ReLU - cache...
zlpure/CS231n
assignment2/cs231n/layer_utils.py
Python
mit
4,237
################################################################################ # Copyright (c) 2006-2017 Franz Inc. # All rights reserved. This program and the accompanying materials are # made available under the terms of the MIT License which accompanies # this distribution, and is available at http://opensource....
franzinc/agraph-python
src/franz/openrdf/tests/conftest.py
Python
mit
15,883
''' Created on 29.05.2016 @author: Fabian Gieseke ''' from .data import get_folds, get_train_test_indices, shuffle_all from .io import ensure_dir, store_results, save_execution_file, save_data, makedirs from .plot import plot_image, assess_performance from .process import start_via_single_process, perform_task_in_par...
Caseyftw/astronet
astronet/util/__init__.py
Python
gpl-2.0
388
""" This script allows you to example whoami output and also some intermediate representations. Takes sentence and optionally synonyms of the subject from stdin and prints: - The input sentence and the synonyms. This is just to verify that the script reads the input properly - The definition list - The...
infolab-csail/whoami
scripts/run.py
Python
mit
2,049
from django import template from django.utils import simplejson as json from django.utils.safestring import mark_safe from jsonfield.utils import TZAwareJSONEncoder register = template.Library() @register.filter def jsonify(value): if getattr(value, 'all', False): value = list(value) return mark_safe(...
rosscdh/django-jsonfield
jsonfield/templatetags/jsonify.py
Python
bsd-3-clause
363
# coding: utf-8 # Copyright 2014-2015 Álvaro Justen <https://github.com/turicas/rows/> # # 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 yo...
tilacog/rows
rows/plugins/xls.py
Python
gpl-3.0
4,840
# # 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 ...
rosmo/aurora
src/main/python/apache/aurora/client/hooks/hooked_api.py
Python
apache-2.0
7,468
#!/usr/bin/env python """ This utility creates Virtual Private Clouds in Amazon Web Services from a simple configuration file. Copyright 2013 Jon M. Skelton <[email protected]> """ __author__ = 'Jon M. Skelton' __version__ = '0.1' import sys import time import yaml import ipcalc import argparse import bot...
adelinedigital/vpcctl
bin/vpcctl.py
Python
mit
52,180
#!/usr/bin/env python class BaseCodec(object): """ Base audio/video codec class. """ encoder_options = {} codec_name = None ffmpeg_codec_name = None def parse_options(self, opt): if 'codec' not in opt or opt['codec'] != self.codec_name: raise ValueError('invalid codec...
phtagn/sickbeard_mp4_automator
converter/avcodecs.py
Python
mit
29,019
# -*- coding: utf-8 -*- # (c) 2018, Jordan Borean <[email protected]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest import sys from io i...
ansible/ansible
test/units/plugins/connection/test_psrp.py
Python
gpl-3.0
8,317
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
mapennell/ansible
lib/ansible/module_utils/a10.py
Python
gpl-3.0
4,532
# -*- coding: utf-8 -*- import os from subprocess import PIPE from subprocess import Popen import jinja2 DIST_PATH = "..\\build\\exe.win32-3.6" # Get list of files and directory to install/uninstall INSTALL_FILES = [] INSTALL_DIRS = [] os.chdir(os.path.join(os.path.dirname(__file__), DIST_PATH)) for root, dirs, fil...
bsmr-Bitcraze/crazyflie-clients-python
win32install/generate_nsis.py
Python
gpl-2.0
1,303
# -*- coding: utf-8 -*- from datetime import datetime from flask_admin.contrib.sqla import ModelView from app import db from .category import movie_categories from .mixins import AuthMixin from .review import Review class Movie(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.St...
Depado/we-rate
app/models/movie.py
Python
gpl-2.0
2,263
# coding: utf-8 import logging from flask.ext import wtf import flask import config import util app = flask.Flask(__name__) app.config.from_object(config) app.jinja_env.line_statement_prefix = '#' app.jinja_env.line_comment_prefix = '##' app.jinja_env.globals.update(slugify=util.slugify) app.jinja_env.globals.updat...
lipis/guestbook
main/main.py
Python
mit
5,827
#!/usr/bin/env python # # 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 # "L...
soumith/fbthrift
thrift/test/py/TestFrameSize.py
Python
apache-2.0
2,787
#coding:utf8 """ threadPool.py ~~~~~~~~~~~~~ 该模块包含工作线程与线程池的实现。 """ import traceback from threading import Thread, Lock from Queue import Queue,Empty import logging log = logging.getLogger('spider.threadpool') class Worker(Thread): def __init__(self, threadPool): Thread.__init__(self) self.thr...
zhkzyth/a-super-fast-crawler
threadPool.py
Python
mit
2,886
#!/usr/bin/env python3 import os import sys sys.path.insert(1, os.path.join(sys.path[0], '..')) from SetupTools.SetupConfig import SetupConfig from Interface.Interface import Interface import importlib import logging class Previewer: def __init__(self): logging.basicConfig(filename='ArchSetup.preview.log',...
mame98/ArchSetup
scripts/debug-preview.py
Python
gpl-3.0
1,383
# encoding: utf-8 """ bash.py -- Functions relating to bash scripting and output Created by Joe Monaco on 2007-11-14. Copyright (c) 2007 Columbia University. All rights reserved. This software is provided AS IS under the terms of the Open Source MIT License. See http://www.opensource.org/licenses/mit-license.php. ""...
jdmonaco/vmo-feedback-model
src/tools/bash.py
Python
mit
4,594
from textwrap import dedent import collections import json from gluon import current from constants import PUBLISH_FREEZE from helpers import hEsc, iEncode, formatVersion class QUERYTREE: def __init__(self): pass def get(self): """Get the metadata of all queries and deliver it as json. ...
ETCBC/shebanq
modules/querytree.py
Python
mit
15,001
import importlib from datetime import datetime from typing import Any, Callable, Dict, Mapping, List, Optional, Union # noqa: F401,E501 import bot from bot import data, utils # noqa: F401 from bot.coroutine import connection as connectionM # noqa: F401 from bot.twitchmessage import IrcMessage, IrcMessageTagsReadOn...
MeGotsThis/BotGotsThis
lib/ircmessage.py
Python
gpl-3.0
9,114
# cython: auto_cpdef=True, infer_types=True # # Pyrex Parser # # This should be done automatically import cython cython.declare(Nodes=object, ExprNodes=object, EncodedString=object) import os import re import sys from Cython.Compiler.Scanning import PyrexScanner, FileSourceDescriptor import Nodes import ExprNodes ...
bhy/cython-haoyu
Cython/Compiler/Parsing.py
Python
apache-2.0
94,093
from __future__ import print_function, division, absolute_import import numpy as np import tensorflow as tf from tensorflow.contrib import slim from data import load_data, draw_sky import edward as ed from edward.models import (Categorical, InverseGamma, Mixture, MultivariateNormalDiag, Normal, Uniform) # =====...
trungnt13/BAY2-uef17
ex4_mixture_network.py
Python
gpl-3.0
4,459
# Copyright (C) 2019 Criteo # # 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, ...
enovance/hardware
hardware/bios_hp.py
Python
apache-2.0
1,742
from .clean_up_message import clean_up_message from .datetime_from_utc_milliseconds import datetime_from_utc_milliseconds from .dump_threads import dump_threads from .extend_version_with_git_data import extend_version_with_git_data, extend_version_if_possible from .find import find from .get_class_that_defined_method i...
pajlada/pajbot
pajbot/utils/__init__.py
Python
mit
1,167
# Yith Library Server is a password storage server. # Copyright (C) 2012-2013 Yaco Sistemas # Copyright (C) 2012-2013 Alejandro Blanco Escudero <[email protected]> # Copyright (C) 2012-2013 Lorenzo Gil Sanchez <[email protected]> # # This file is part of Yith Library Server. # # Yith Library Server is...
Yaco-Sistemas/yith-library-server
yithlibraryserver/__init__.py
Python
agpl-3.0
6,544
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* Copyright (c) Schrodinger, LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* -------...
gratefulfrog/lib
python/pymol/povray.py
Python
gpl-2.0
1,452
#!/usr/bin/env python # Command line processor for Systems Management Ultra Thin Layer # # Copyright 2017 IBM Corp. # # 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:/...
mfcloud/python-zvm-sdk
smtLayer/smtCmd.py
Python
apache-2.0
2,094
# for localized messages from . import _ from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.ChoiceBox import ChoiceBox from Components.config import config, configfile, ConfigYesNo, ConfigSubsection from Components.ActionMap import ActionMap from Components.Label import Label from...
Ophiuchus1312/enigma2-master
lib/python/Plugins/Extensions/Infopanel/SwapManager.py
Python
gpl-2.0
12,563
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages import sphinxdoc name = sphinxdoc.__name__ description = sphinxdoc.__description__ version = sphinxdoc.__version__ author = sphinxdoc.__author__ author_email = sphinxdoc.__author_email__ copyright = sphinxdoc.__copyright__ licen...
ElMijo/sphinx-auto-doc-py
setup.py
Python
mit
1,854
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from socorro.external import MissingArgumentError from socorro.external.postgresql.base import PostgreSQLBase from socor...
bsmedberg/socorro
socorro/external/postgresql/error.py
Python
mpl-2.0
1,846
from os import path from json import dumps from flask import Flask, redirect, request from flask_selfdoc import Autodoc app = Flask(__name__) app.debug = True auto = Autodoc(app) users = [] posts = [] class User(object): def __init__(self, username): self.username = username users.append(self...
jwg4/flask-autodoc
examples/custom/blog.py
Python
mit
2,556
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 S. Daniel Francis <[email protected]> # # 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, ...
sdanielf/dictate
i18nhelpers/buildmo.py
Python
gpl-3.0
1,728
## Author: Christopher Bull. ## Affiliation: Climate Change Research Centre and ARC Centre of Excellence for Climate System Science. ## Level 4, Mathews Building ## University of New South Wales ## Sydney, NSW, Australia, 2052 ## Contact: [email protected] ...
chrisb13/mkpaper
__init__.py
Python
gpl-2.0
619
import json import os from django.conf import settings from django.core.management.base import BaseCommand from django.db import transaction from reversion import revisions as reversion from webpack_loader.utils import get_loader from normandy.recipes.models import Action class Command(BaseCommand): help = 'Up...
Osmose/normandy
recipe-server/normandy/recipes/management/commands/update_actions.py
Python
mpl-2.0
2,420
# vim: set et sw=4 ts=4 ai: import unittest import utils from testbin import TestBin class TestBinCoprovision(TestBin, unittest.TestCase): def setUp(self): self.bin = 'co-provision' self.do_not_test_running = True def tearDown(self): pass
ow2-mirrors/compatibleone
testsuite/basic/coprovision.py
Python
apache-2.0
275
from openerp.osv import fields,osv import math class beacon_proximity(osv.osv_memory): _name = 'beacon.proximity.bounds' _columns = { 'test': fields.many2one('beacon.test', 'Test', select=1, ondelete="cascade"), #'proximity': fields.integer('Proximity'), ...
jmesteve/saas3
openerp/addons_extra/ibeacon/proximity.py
Python
agpl-3.0
19,336
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # 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; eithe...
debugger06/MiroX
windows/plat/screensaver.py
Python
gpl-2.0
3,851
from __future__ import unicode_literals import base64 import datetime import hashlib import json import netrc import os import re import socket import sys import time import xml.etree.ElementTree from ..compat import ( compat_cookiejar, compat_HTTPError, compat_http_client, compat_urllib_error, co...
HyShai/youtube-dl
youtube_dl/extractor/common.py
Python
unlicense
42,324
# Challenge Level: Beginner # NOTE: Please don't use anyone's *real* contact information during these exercises, especially if you're putting it up on Github! # Background: You have a dictionary with people's contact information. You want to display that information as an HTML table. contacts = { 'Shannon': {'p...
scarothers/shannons-python-lessons
sara-playtime/lesson03_contacts.py
Python
mit
1,417
from time import time import nose.core from noseprogressive.result import ProgressiveResult class ProgressiveRunner(nose.core.TextTestRunner): """Test runner that makes a lot less noise than TextTestRunner""" def __init__(self, cwd, totalTests, stream, **kwargs): super(ProgressiveRunner, self).__in...
mozilla/popcorn_maker
vendor-local/lib/python/noseprogressive/runner.py
Python
bsd-3-clause
1,981
# Explains/tests Issues: # https://github.com/ray-project/ray/issues/6928 # https://github.com/ray-project/ray/issues/6732 import argparse from gym.spaces import Discrete, Box import numpy as np from ray.rllib.agents.ppo import PPOTrainer from ray.rllib.examples.env.random_env import RandomEnv from ray.rllib.examples...
robertnishihara/ray
rllib/examples/mobilenet_v2_with_lstm.py
Python
apache-2.0
1,849
#!/usr/bin/env python3 # Set up imports and paths bufferpath = "../../dataAcq/buffer/python" sigProcPath = "../signalProc" import pygame, sys from pygame.locals import * from time import sleep, time import os sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),bufferpath)) import numpy import FieldT...
jadref/buffer_bci
tutorial/lect3-helloworld/echoServer_soln.py
Python
gpl-3.0
1,980
# # Copyright (C) 2004 SIPfoundry Inc. # Licensed by SIPfoundry under the GPL license. # # Copyright (C) 2004 SIP Forum # Licensed to SIPfoundry under a Contributor Agreement. # # # This file is part of SIP Forum Test Framework. # # SIP Forum Test Framework is free software; you can redistribute it # and/or modify it ...
ezigman/sftf
HFH/Remotepartyid.py
Python
gpl-2.0
2,740