repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
nattee/cafe-grader-web
lib/assets/Lib/heapq.py
9
18542
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. ...
mit
LiquidSmokeX64/URKernel
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
gundalow/ansible-modules-extras
notification/sendgrid.py
23
9082
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Makai <matthew.makai@gmail.com> # # This file is part of Ansible # # Ansible 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 ...
gpl-3.0
scwhitehouse/rose
lib/python/rose/apps/comparisons/prohibited.py
2
1903
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2012-7 Met Office. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-3.0
unsiloai/syntaxnet-ops-hack
tensorflow/python/kernel_tests/dynamic_partition_op_test.py
97
6138
# 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...
apache-2.0
amwelch/a10sdk-python
a10sdk/core/cgnv6/cgnv6_lsn_port_overloading_global.py
2
1691
from a10sdk.common.A10BaseClass import A10BaseClass class Global(A10BaseClass): """Class Description:: Configure Port-Overloading Behavior. Class global supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param unique: {"de...
apache-2.0
t3dev/odoo
addons/l10n_it_edi/models/ir_mail_server.py
1
17163
# -*- coding:utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import zipfile import io import re import logging import email import dateutil import pytz import base64 try: from xmlrpc import client as xmlrpclib except ImportError: import xmlrpclib from lxml import etree fr...
gpl-3.0
halberom/ansible
lib/ansible/plugins/connection/libvirt_lxc.py
46
7316
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute i...
gpl-3.0
jmenglund/pandas-validation
test_pandasvalidation.py
1
9809
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import warnings import pytest import numpy import pandas from pandas.util.testing import assert_series_equal, assert_frame_equal from pandasvalidation import ( ValidationWarning, _datetime_to_string, _numeric_to_string, _get_return_object...
mit
zhouyao1994/incubator-superset
superset/migrations/versions/4fa88fe24e94_owners_many_to_many.py
5
1940
# 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 not u...
apache-2.0
heeraj123/oh-mainline
vendor/packages/Django/django/core/management/sql.py
104
7942
from __future__ import unicode_literals import codecs import os import re from django.conf import settings from django.core.management.base import CommandError from django.db import models from django.db.models import get_models from django.utils._os import upath def sql_create(app, style, connection): "Returns...
agpl-3.0
rafiqsaleh/VERCE
verce-hpc-pe/src/networkx/algorithms/operators/all.py
20
4210
"""Operations on many graphs. """ # Copyright (C) 2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. try: from itertools import izip_longest as zip_longest except ImportError: # Python3 has zip_longest ...
mit
cloudbase/nova
doc/ext/support_matrix.py
6
18921
# Copyright (C) 2014 Red Hat, 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 writi...
apache-2.0
photoninger/ansible
lib/ansible/plugins/connection/local.py
73
6815
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2015, 2017 Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible 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...
gpl-3.0
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/test/test_grammar.py
72
32702
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. from test.test_support import run_unittest, check_syntax_error, \ check_py3k_warnings import unittest import sys # testing import * from sys import * class TokenTests(unittest.TestCase): de...
gpl-3.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/scons-2.3.1/SCons/Tool/sgic++.py
8
2066
"""SCons.Tool.sgic++ Tool-specific initialization for MIPSpro C++ on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2...
gpl-2.0
Ssawa/Diamond
src/collectors/elasticsearch/test/testelasticsearch.py
9
11625
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from elasticsearch import...
mit
Crestington/flappycoin-master
contrib/testgen/gen_base58_test_vectors.py
1064
4344
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
mit
dana-i2cat/felix
modules/resource/orchestrator/src/server/flask/flaskserver.py
1
9273
from flask import Flask, g, request, request_started, request_finished #from flask.ext.pymongo import PyMongo from core.config import FullConfParser from core import log logger=log.getLogger("flaskserver") from db.db_manager import db_sync_manager from server.flask.views import ro_flask_views from werkzeug import ser...
apache-2.0
upliftaero/MissionPlanner
Lib/decimal.py
42
225869
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module is currently Py2.3 ...
gpl-3.0
marckuz/django
tests/utils_tests/test_lazyobject.py
268
8629
from __future__ import unicode_literals import copy import pickle import sys from unittest import TestCase from django.utils import six from django.utils.functional import LazyObject, SimpleLazyObject, empty class Foo(object): """ A simple class with just one attribute. """ foo = 'bar' def __eq...
bsd-3-clause
twood02/adv-net-samples
sdn/pox/pox/openflow/libopenflow_01.py
34
130464
# Copyright 2011,2012 James McCauley # # 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 ...
mit
MarkTseng/django-farmersale
farmersale-env/lib/python2.7/site-packages/django/utils/deprecation.py
53
2585
import inspect import warnings class RemovedInDjango19Warning(PendingDeprecationWarning): pass class RemovedInDjango18Warning(DeprecationWarning): pass RemovedInNextVersionWarning = RemovedInDjango18Warning class warn_about_renamed_method(object): def __init__(self, class_name, old_method_name, new_...
mit
rwillmer/django
tests/template_tests/test_logging.py
210
2286
from __future__ import unicode_literals import logging from django.template import Engine, Variable, VariableDoesNotExist from django.test import SimpleTestCase class TestHandler(logging.Handler): def __init__(self): super(TestHandler, self).__init__() self.log_record = None def emit(self, ...
bsd-3-clause
brunotougeiro/python
backup-restore/backup-full (2).py
2
4023
#!/usr/bin/python # -*- coding: utf-8 -*- import subprocess import time #Essa função gera um banner com a hora inicial do Backup def inicio(horaInicio): inicio = ''' =========================================================================== || ____ _____ _ ___ _ _____ ______ _ _ _ _...
gpl-2.0
LarsMichelsen/pmatic
ccu_pkg/python/lib/python2.7/encodings/euc_jis_2004.py
816
1051
# # euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
gpl-2.0
guewen/OpenUpgrade
addons/payment_ogone/controllers/main.py
389
1179
# -*- coding: utf-8 -*- import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class OgoneController(http.Controller): _accept_url = '/payment/ogone/test/accept' _decline_url = '/payment/ogone/test/decline' ...
agpl-3.0
ajdawson/iris
lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_auxiliary_coordinate.py
11
7457
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
daizhengy/RDS
trove/instance/models.py
1
51364
# Copyright 2010-2011 OpenStack Foundation # Copyright 2013-2014 Rackspace Hosting # 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://...
apache-2.0
stevenewey/docker-py
docker/tls.py
56
3028
import os from . import errors from .ssladapter import ssladapter class TLSConfig(object): cert = None verify = None ssl_version = None def __init__(self, client_cert=None, ca_cert=None, verify=None, ssl_version=None, assert_hostname=None, assert_fingerprint=None): ...
apache-2.0
mstriemer/addons-server
src/olympia/discovery/data.py
3
2498
# -*- coding: utf-8 -*- from django.utils.translation import string_concat, ugettext_lazy as _ class DiscoItem(object): def __init__(self, *args, **kwargs): self.addon_id = kwargs.get('addon_id') self.addon_name = kwargs.get('addon_name') self.heading = kwargs.get('heading') self.d...
bsd-3-clause
appleseedhq/gaffer
python/GafferCortex/__init__.py
3
2335
########################################################################## # # Copyright (c) 2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
bsd-3-clause
ahmetcemturan/SFACT
fabmetheus_utilities/intercircle.py
8
30760
""" Intercircle is a collection of utilities for intersecting circles, used to get smooth loops around a collection of points and inset & outset loops. """ from __future__ import absolute_import try: import psyco psyco.full() except: pass #Init has to be imported first because it has code to workaround the python ...
agpl-3.0
imthomasking/LeetCode-Solutions
LeetCode Weekly Contest/Mar.18.2017/538_Convert_BST_to_Greater_Tree.py
2
1878
#!/usr/bin/python3 # -*- coding: utf-8 -*- # 538. Convert BST to Greater Tree __author__ = 'Libao Jin' __date__ = '03/18/2017' import time # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(ob...
mit
perryjrandall/arsenalsuite
cpp/lib/PyQt4/examples/mainwindows/mdi/mdi.py
14
16495
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
CopyChat/Plotting
Python/ssr.Cordex.OBS.CMIP5.RegCM.py
1
6817
#!/usr/bin/env python ######################################## #Globale Karte fuer tests # from Rabea Amther ######################################## # http://gfesuite.noaa.gov/developer/netCDFPythonInterface.html import netCDF4 import pylab as pl import numpy as np import matplotlib as mpl import datetime from netCD...
gpl-3.0
themutt/plastex
build/lib.linux-x86_64-2.7/plasTeX/Base/LaTeX/FontSelection.py
7
1577
#!/usr/bin/env python """ C.15 Font Selection (p225) """ from plasTeX import Command, Environment, sourceArguments from plasTeX.Logging import getLogger log = getLogger() # # C.15.1 Changing the Type Style # class TextDeclaration(Environment): pass class mdseries(TextDeclaration): pass class bfseries(TextDe...
mit
akretion/odoo
addons/product/tests/test_pricelist.py
23
5017
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests.common import TransactionCase class TestPricelist(TransactionCase): def setUp(self): super(TestPricelist, self).setUp() self.datacard = self.env.ref('product.product_delivery_02') ...
agpl-3.0
joshfinnie/Babel
babel/dates.py
4
39603
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists...
bsd-3-clause
cctags/pelican-plugins
liquid_tags/giphy.py
273
2433
""" Giphy Tag --------- This implements a Liquid-style Giphy tag for Pelican. IMPORTANT: You have to request a production API key from giphy `here <https://api.giphy.com/submit>`. For the first runs you could also use the public beta key you can get `here <https://github.com/giphy/GiphyAPI>`. Syntax ------ {% giphy ...
agpl-3.0
bruderstein/PythonScript
PythonLib/full/ctypes/test/test_cfuncs.py
102
7680
# A lot of failures in these tests on Mac OS X. # Byte order related? import unittest from ctypes import * from ctypes.test import need_symbol import _ctypes_test class CFunctions(unittest.TestCase): _dll = CDLL(_ctypes_test.__file__) def S(self): return c_longlong.in_dll(self._dll, "last_tf_arg_s")...
gpl-2.0
oTnTh/openwrt
target/linux/x86/image/mkimg_bifferboard.py
561
1265
#!/usr/bin/env python """ Create firmware for 4/8MB Bifferboards, suitable for uploading using either bb_upload8.py or bb_eth_upload8.py """ import struct, sys # Increase the kmax value if the script gives errors about the kernel being # too large. You need to set the Biffboot kmax value to the same value yo...
gpl-2.0
tupolev/plugin.video.mitele
lib/youtube_dl/extractor/sportdeutschland.py
35
3776
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_iso8601, sanitized_Request, ) class SportDeutschlandIE(InfoExtractor): _VALID_URL = r'https?://sportdeutschland\.tv/(?P<sport>[^/?#]+)/(?P<id>[^?#/]+)(?:$|[?#])' _TESTS = [...
gpl-3.0
sahiljain/catapult
third_party/gsutil/third_party/protorpc/demos/tunes_db/server/services.py
20
1253
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
scarrico/BayAreaFresh
utilities/nyseTradingDays.py
1
3287
# Thanks to https://gist.github.com/jckantor/d100a028027c5a6b8340 for the # beginings of this code. from dateutil import rrule import datetime # Generate ruleset for holiday observances on the NYSE def NYSE_holidays(a=datetime.date.today(), b=datetime.date.today()+datetime.timedelta(days=365)): rs = rrule.rrule...
apache-2.0
mancoast/CPythonPyc_test
cpython/223_test_profilehooks.py
8
10846
from __future__ import generators from test_support import TestFailed import pprint import sys import unittest import test_support class HookWatcher: def __init__(self): self.frames = [] self.events = [] def callback(self, frame, event, arg): self.add_event(event, frame) def a...
gpl-3.0
Icenowy/MissionPlanner
Lib/site-packages/numpy/lib/tests/test_shape_base.py
84
9945
from numpy.testing import * from numpy.lib import * from numpy.core import * from numpy import matrix, asmatrix class TestApplyAlongAxis(TestCase): def test_simple(self): a = ones((20,10),'d') assert_array_equal(apply_along_axis(len,0,a),len(a)*ones(shape(a)[1])) def test_simple101(self,level=...
gpl-3.0
astropy/astropy
astropy/samp/tests/test_hub_proxy.py
12
1202
from astropy.samp.hub_proxy import SAMPHubProxy from astropy.samp.hub import SAMPHubServer from astropy.samp import conf def setup_module(module): conf.use_internet = False class TestHubProxy: def setup_method(self, method): self.hub = SAMPHubServer(web_profile=False, mode='multiple', pool_size=1...
bsd-3-clause
crazyyoung01/vv
vn.trader/sgitGateway/sgitDataType.py
27
257893
# encoding: UTF-8 defineDict = {} typedefDict = {} #////////////////////////////////////////////////////////////////////// #@system #@company #@file SgitFtdcUserApiDataType.h #@brief 定义了客户端接口使用的业务数据类型 #@history #20150810 #////////////////////////////////////////////////////////////////////// #///////////////////...
mit
tangkun75/docker-registry
tests/test_s3.py
30
6105
# -*- coding: utf-8 -*- import StringIO import sys import time from nose import tools from docker_registry.core import exceptions import docker_registry.testing as testing from docker_registry.testing import mock_boto # noqa from . import mock_s3 # noqa class StringIOWithError(StringIO.StringIO): '''Throw...
apache-2.0
hamaxx/tcphealthcheck
statsd.py
1
5942
''' StatsD client ( https://github.com/etsy/statsd ) Usage ~~~~~ 1.a. init default client on the top of the module statsc = statsd.get() 1.b. init named client on the top of the module (recommended) statsc = statsd.get(__name__) 2.a. configure all clients at runtime if __name__ == "__main__": statsd.config(...
bsd-3-clause
sometallgit/AutoUploader
Python27/Lib/ctypes/test/__init__.py
35
7329
import os, sys, unittest, getopt, time use_resources = [] import ctypes ctypes_symbols = dir(ctypes) def need_symbol(name): return unittest.skipUnless(name in ctypes_symbols, '{!r} is required'.format(name)) class ResourceDenied(unittest.SkipTest): """Test skipped because it ...
mit
louietsai/python-for-android
python3-alpha/python3-src/Lib/test/test_platform.py
54
9918
import sys import os import unittest import platform import subprocess from test import support class PlatformTest(unittest.TestCase): def test_architecture(self): res = platform.architecture() @support.skip_unless_symlink def test_architecture_via_symlink(self): # issue3762 # On Windows,...
apache-2.0
wolverineav/neutron
neutron/tests/unit/plugins/ml2/test_managers.py
4
1414
# Copyright (c) 2016 IBM Corp. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
alonisser/Open-Knesset
suggestions/migrations/0004_auto__add_field_suggestion_reason.py
14
6391
# -*- coding: 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 field 'Suggestion.reason' db.add_column('suggestions_suggestion', 'reason', s...
bsd-3-clause
ahmedbodi/temp_vert
qa/rpc-tests/nulldummy.py
62
6534
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_fra...
mit
JVillella/tensorflow
tensorflow/contrib/keras/python/keras/applications/vgg19.py
25
8854
# 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...
apache-2.0
shakamunyi/tensorflow
tensorflow/contrib/training/python/training/bucket_ops.py
31
18392
# 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 applica...
apache-2.0
adelton/django
tests/validation/test_picklable.py
576
2010
import pickle from unittest import TestCase from django.core.exceptions import ValidationError class PickableValidationErrorTestCase(TestCase): def test_validationerror_is_picklable(self): original = ValidationError('a', code='something') unpickled = pickle.loads(pickle.dumps(original)) ...
bsd-3-clause
webknjaz/promua-chat
src/tests/test_api.py
1
1968
try: import unittest2 as unittest except ImportError: import unittest from datetime import date, datetime from sqlalchemy import * from sqlalchemy.exc import * from promua_chat import api from promua_chat.model import User from tests.helper import DBTestFixture, orm_session, Session class APITest(DBTestFi...
mit
xujb/odoo
addons/event/report/__init__.py
435
1079
# -*- 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...
agpl-3.0
nicoTrombon/DjangoPolls
env/Lib/site-packages/django/contrib/auth/admin.py
83
8318
from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.admin.utils import unquote from django.contrib.auth import update_session_auth_hash from django.contrib.auth.forms import ( AdminPass...
bsd-3-clause
Crevil/grpc
tools/run_tests/run_build_statistics.py
10
10106
#!/usr/bin/env python # Copyright 2016 gRPC 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 o...
apache-2.0
erikabarros/naguil
backend/apps/formacao_app/formacao_commands.py
2
1059
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand from gaeforms.ndb.form import ModelForm from gaegraph.business_base import UpdateNode, NodeSearch, DeleteNode from formacao_app.formacao_model import Formacao class Formaca...
mit
comeanother/ownCA
certs/views.py
1
4024
import zipfile from django.shortcuts import get_object_or_404, render, redirect from django.http import StreamingHttpResponse, HttpResponseRedirect from django.urls import reverse from django.core.urlresolvers import reverse_lazy from django.views import generic from django.views.generic.edit import CreateView, FormVi...
apache-2.0
vrtt/tulliportti
search/views.py
36
1025
from __future__ import absolute_import, unicode_literals from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.shortcuts import render from wagtail.wagtailcore.models import Page from wagtail.wagtailsearch.models import Query def search(request): search_query = request.GET.get('qu...
gpl-3.0
frankvdp/django
tests/template_tests/syntax_tests/test_template_tag.py
521
2594
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class TemplateTagTests(SimpleTestCase): @setup({'templatetag01': '{% templatetag openblock %}'}) def test_templatetag01(self): output = self.engine.render_to_string('templatetag01') ...
bsd-3-clause
vrenaville/bank-payment
account_banking_mandate/models/res_partner_bank.py
13
1533
# -*- encoding: utf-8 -*- ############################################################################## # # Mandate module for openERP # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # @author: Cyril Sester <csester@compassion.ch>, # Alexis de Lattre <alexis.delattre@akretion.c...
agpl-3.0
chand3040/cloud_that
common/djangoapps/track/tests/test_shim.py
111
4737
"""Ensure emitted events contain the fields legacy processors expect to find.""" from mock import sentinel from django.test.utils import override_settings from openedx.core.lib.tests.assertions.events import assert_events_equal from track.tests import EventTrackingTestCase, FROZEN_TIME LEGACY_SHIM_PROCESSOR = [ ...
agpl-3.0
zaw9c1/p2pool
p2pool/bitcoin/p2p.py
118
6133
''' Implementation of Bitcoin's p2p protocol ''' import random import sys import time from twisted.internet import protocol import p2pool from . import data as bitcoin_data from p2pool.util import deferral, p2protocol, pack, variable class Protocol(p2protocol.Protocol): def __init__(self, net): p2protoc...
gpl-3.0
EmreAtes/spack
var/spack/repos/builtin/packages/uuid/package.py
5
1733
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
bamos/block
block/block.py
1
9757
import numpy as np import scipy.sparse.linalg as sla import scipy.sparse as sp try: import torch from torch.autograd import Variable except: pass import re from abc import ABCMeta, abstractmethod def block(rows, dtype=None, arrtype=None): if (not _is_list_or_tup(rows)) or len(rows) == 0 or \ ...
apache-2.0
deepesch/scikit-learn
examples/plot_multilabel.py
236
4157
# Authors: Vlad Niculae, Mathieu Blondel # License: BSD 3 clause """ ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ...
bsd-3-clause
wfxiang08/livegrep
src/vendor/gtest/test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-2-clause
btxgit/gazee
setup.py
1
1650
#!/usr/bin/env python3 import os import re, sys from setuptools import setup, find_packages from setuptools import Command from shutil import rmtree def build_config(**kw): bcfg = {} for k in kw: bcfg[k] = kw[k] return bcfg class CleanCommand(Command): user_options = [] def initialize_o...
gpl-3.0
taw/python_koans
python3/runner/sensei.py
59
9937
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import sys import os import glob from . import helper from .mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResu...
mit
matthewshim-ms/Recognizers-Text
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/chinese/datetime_extractor_config.py
1
2377
from typing import Pattern import regex from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime from ..extractors import DateTimeExtractor from ..base_datetime import DateTimeExtractorConfiguration from .date_extractor import ChineseDateExtractor from .time_extractor impo...
mit
lxdiyun/gis
gis/urls.py
1
1054
from django.conf.urls import patterns, include, url from dajaxice.core import dajaxice_autodiscover, dajaxice_config from django.conf import settings from django.conf.urls.static import static #import guppy #from guppy.heapy import Remote #Remote.on() dajaxice_autodiscover() from django.contrib import admin admin.au...
gpl-3.0
wagnerf42/ws-simulator
src/wssim/task.py
1
23008
""" the task module provides a Task class holding work of task and list of its children for the simulation. """ from copy import deepcopy import json import wssim from math import ceil, floor, log2, sqrt class Task: """ class represent Task with its work, list of children. work : work of tasks, task is vi...
gpl-3.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/sympy/core/tests/test_complex.py
69
21313
from sympy import (S, Symbol, sqrt, I, Integer, Rational, cos, sin, im, re, Abs, exp, sinh, cosh, tan, tanh, conjugate, sign, cot, coth, pi, symbols, expand_complex) def test_complex(): a = Symbol("a", real=True) b = Symbol("b", real=True) e = (a + I*b)*(a - I*b) assert e.expand() == a...
mit
masterdon/Veil-Evasion
modules/payloads/cs/meterpreter/rev_http.py
12
6698
""" Custom-written pure c# meterpreter/reverse_http stager. Uses basic variable renaming obfuscation. Module built by @harmj0y """ from modules.common import helpers from modules.common import encryption import random class Payload: def __init__(self): # required options self.description = "pu...
gpl-3.0
olgabrani/synnefo
snf-astakos-app/astakos/im/views/util.py
7
12280
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
macks22/fastFM
fastFM/sgd.py
1
5433
# Author: Immanuel Bayer # License: BSD 3 clause import numpy as np from sklearn.base import RegressorMixin import ffm from utils import check_array, check_consistent_length from base import FactorizationMachine, BaseFMClassifier, _validate_class_labels class FMRegression(FactorizationMachine, RegressorMixin): ...
bsd-3-clause
mosbasik/buzhug
javasrc/lib/Jython/Lib/encodings/iso8859_14.py
593
13908
""" Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
bsd-3-clause
oddui/selenium
py/test/selenium/webdriver/common/page_loader.py
44
1402
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
pubsubsql/notification-services
mysql/mysql-5.6.17/libevent/event_rpcgen.py
159
45222
#!/usr/bin/env python # # Copyright (c) 2005 Niels Provos <provos@citi.umich.edu> # All rights reserved. # # Generates marshaling code based on libevent. import sys import re # _NAME = "event_rpcgen.py" _VERSION = "0.1" _STRUCT_RE = '[a-z][a-z_0-9]*' # Globals line_count = 0 white = re.compile(r'^\s+') cppcomment =...
gpl-3.0
matti-kariluoma/python-http_control
http_control.py
1
16158
#!/usr/bin/env python # coding: utf-8 ''' http_control allows an existing application to .register() state variables to be exposed to clients over HTTP + HTML. The HTML is automatically generated from the number and type of registered state variables. After .start() is called, an http server is started in a thread....
mit
KenMutemi/saleor
saleor/product/migrations/0019_auto_20161212_0230.py
10
1257
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-12 08:30 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('product', '0018_auto_20161207_0844'), ] operations...
bsd-3-clause
openstack-packages/DLRN
dlrn/drivers/rdoinfo.py
1
10929
# 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 t...
apache-2.0
1844144/django-blog-zinnia
zinnia/tests/test_metaweblog.py
1
15671
"""Test cases for Zinnia's MetaWeblog API""" try: from xmlrpc.client import Binary from xmlrpc.client import Fault from xmlrpc.client import ServerProxy except ImportError: # Python 2 from xmlrpclib import Binary from xmlrpclib import Fault from xmlrpclib import ServerProxy from tempfile import...
bsd-3-clause
MinoochX/i9500-mxk
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
mozilla/mozilla-ignite
vendor-local/lib/python/fudge/tests/test_patcher.py
6
9122
from __future__ import with_statement import inspect import unittest from nose.exc import SkipTest from nose.tools import eq_, raises import fudge class Freddie(object): pass def test_patch_obj(): class holder: exc = Exception() patched = fudge.patch_object(holder, "exc", Freddie(...
bsd-3-clause
Nitaco/ansible
lib/ansible/modules/network/cloudengine/ce_info_center_global.py
43
69972
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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. # # Ansible is distribut...
gpl-3.0
tic-ull/gedea
src/miprimeraplicacion_django/accounts/forms.py
1
1432
from django import forms from django.contrib.auth.models import User class RegistroUserForm(forms.Form): username = forms.CharField(widget=forms.TextInput(attrs={'placehoder': 'username'})) email = forms.EmailField(widget=forms.TextInput(attrs={'placehoder': 'email'})) password = forms.CharField(widget=f...
gpl-3.0
sugarlabs/sugar-toolkit-gtk3
src/sugar3/env.py
1
1934
"""Calculates file-paths for the Sugar working environment""" # Copyright (C) 2006-2007 Red Hat, Inc. # # This library 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 2 of the License, ...
lgpl-2.1
bhdouglass/remindor-common
remindor_common/helpers.py
1
31675
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2013 Brian Douglass bhdouglass@gmail.com # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Softwa...
gpl-3.0
qwerdy/slidewall
slidewall_engine/liveengine.py
1
4984
import os import logging from shutil import copytree from shutil import rmtree from gi.repository import Gtk,GdkPixbuf,GObject logger = logging.getLogger('slidewall_lib') class LiveEngine(): def __init__(self,parent = None): self.parent = parent if(not os.path.isdir(self.parent.config_engine.slide...
gpl-3.0
FreekingDean/home-assistant
homeassistant/components/binary_sensor/vera.py
17
1193
""" Support for Vera binary sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.vera/ """ import logging from homeassistant.components.binary_sensor import ( BinarySensorDevice) from homeassistant.components.vera import ( VeraD...
mit
CiscoSystems/tempest
tempest/scenario/test_swift_basic_ops.py
4
2966
# Copyright 2013 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
apache-2.0
prisis/sublime-text-packages
Packages/Anaconda/commands/doc.py
5
3415
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org> # This program is Free Software see LICENSE file for details from functools import partial import sublime import sublime_plugin from ..anaconda_lib.worker import Worker from ..anaconda_lib.tooltips import Tooltip from ..anaconda_lib.callback import C...
mit