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 |
|---|---|---|---|---|---|
ice-stuff/ice | ice/registry/test/test_roundtrip.py | 1 | 5232 | import os
import unittest2
import random
import threading
from ice import entities
from ice.registry.client import RegistryClient, CfgRegistryClient
from ice.registry.server import RegistryServer
from ice.registry.server.domain.instances import InstancesDomain
from ice.registry.server.domain.sessions import SessionsDom... | mit |
alexbruy/QGIS | python/ext-libs/future/future/builtins/disabled.py | 83 | 2109 | """
This disables builtin functions (and one exception class) which are
removed from Python 3.3.
This module is designed to be used like this::
from future.builtins.disabled import *
This disables the following obsolete Py2 builtin functions::
apply, cmp, coerce, execfile, file, input, long,
raw_input, ... | gpl-2.0 |
frouty/odoogoeen | openerp/addons/base/tests/test_expression.py | 32 | 28987 | import unittest2
from openerp.osv.expression import get_unaccent_wrapper
from openerp.osv.orm import BaseModel
import openerp.tests.common as common
class test_expression(common.TransactionCase):
def _reinit_mock(self):
self.query_list = list()
def _mock_base_model_where_calc(self, model, *args, **... | agpl-3.0 |
carnotweat/cpupimp | libs/pyutil/test/current/test_time_format.py | 106 | 3967 | #!/usr/bin/env python
"""\
Test time_format.py
"""
import os, time, unittest
from pyutil import time_format, increasing_timer
class TimeUtilTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_iso8601_utc_time(self, timer=increasing_timer.timer):
... | gpl-3.0 |
futurice/django-history | djangohistory/fields.py | 1 | 1077 | import django
from django.conf import settings
from django.db import models
import json
import six
from djangohistory.helpers import to_json
if django.VERSION[:2]>=(1, 9) and (getattr(settings, 'USING_POSTGRES', False) or 'postgres' in settings.DATABASES['default']):
from django.contrib.postgres.fields import JSO... | bsd-3-clause |
kramwens/order_bot | venv/lib/python2.7/site-packages/tests/test_base_resource.py | 10 | 7603 | # -*- coding: utf-8 -*-
from datetime import datetime
import unittest
from mock import Mock, sentinel, patch, ANY
from nose.tools import assert_equal, assert_true
import pytz
from six import advance_iterator
from twilio.rest.resources.imports import json
from twilio.rest.resources import Resource, NextGenListResource... | mit |
pombreda/django-hotclub | libs/external_libs/gdata.py-1.0.13/tests/gdata_tests/base/service_test.py | 5 | 8597 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... | mit |
odejesush/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/kernel_tests/routing_function_op_test.py | 56 | 2428 | # 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 |
Faiz7412/or-tools | documentation/tutorials/python/chap2/cp_is_fun1.py | 37 | 2593 | # Copyright 2010-2011 Google
# 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, so... | apache-2.0 |
ferriman/SSandSP | pyxel-test/venv/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/_structures.py | 67 | 2022 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class InfinityType(object):
def __repr__(self):
# type: () ->... | gpl-3.0 |
chakrit/pjsip | doc/pjsip-book/conf.py | 61 | 8065 | # -*- coding: utf-8 -*-
#
# The PJSIP Book documentation build configuration file, created by
# sphinx-quickstart on Sat Nov 30 06:36:26 2013.
#
# 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
# autogenerated file.
... | gpl-2.0 |
Metrological/qtwebkit | Tools/Scripts/webkitpy/style/checkers/xml_unittest.py | 124 | 3716 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | lgpl-3.0 |
jalibras/coop | utils/UserUpload.py | 1 | 2356 |
import sys
import os
import django
import csv
path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),'coop')
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE']='coop.settings'
# this must be invoked in external scripts that
# want to access the django app classes
django.setup()
... | apache-2.0 |
qmagico/sampleappqm | src/django/utils/simplejson/encoder.py | 430 | 15620 | """Implementation of JSONEncoder
"""
import re
c_encode_basestring_ascii = None
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '\\f',
... | mit |
EduPepperPDTesting/pepper2013-testing | lms/djangoapps/courseware/features/problems_setup.py | 5 | 15656 | #pylint: disable=C0111
#pylint: disable=W0621
#EVERY PROBLEM TYPE MUST HAVE THE FOLLOWING:
# -Section in Dictionary containing:
# -factory
# -kwargs
# -(optional metadata)
# -Correct, Incorrect and Unanswered CSS selectors
# -A way to answer the problem correctly and incorrectly
# -A way to check the problem w... | agpl-3.0 |
whummer/moto | tests/test_organizations/test_organizations_boto3.py | 1 | 24559 | from __future__ import unicode_literals
import boto3
import json
import six
import sure # noqa
from botocore.exceptions import ClientError
from nose.tools import assert_raises
from moto import mock_organizations
from moto.organizations import utils
from .organizations_test_utils import (
validate_organization,
... | apache-2.0 |
eustislab/horton | horton/grid/test/test_cubic_spline.py | 1 | 12172 | # -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | gpl-3.0 |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Twitter/Users/__init__.py | 5 | 1034 | from temboo.Library.Twitter.Users.GetAccountSettings import GetAccountSettings, GetAccountSettingsInputSet, GetAccountSettingsResultSet, GetAccountSettingsChoreographyExecution
from temboo.Library.Twitter.Users.Lookup import Lookup, LookupInputSet, LookupResultSet, LookupChoreographyExecution
from temboo.Library.Twitte... | gpl-3.0 |
owlfish/pubtal | tests/Content/RawContent/RawContentTests.py | 1 | 3174 | """ Unit tests cases.
Copyright (c) 2003 Colin Stewart (http://www.owlfish.com/)
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 must retain the above copyright... | bsd-3-clause |
ddurst/zamboni | lib/video/utils.py | 44 | 1190 | import subprocess
def check_output(*popenargs, **kwargs):
# Tell thee, check_output was from Python 2.7 untimely ripp'd.
# check_output shall never vanquish'd be until
# Marketplace moves to Python 2.7.
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden... | bsd-3-clause |
cbrewster/servo | python/tidy/setup.py | 60 | 1748 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
julian-seward1/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/main.py | 171 | 26357 | """ core implementation of testing process: init, session, runtest loop. """
import imp
import os
import re
import sys
import _pytest
import _pytest._code
import py
import pytest
try:
from collections import MutableMapping as MappingMixin
except ImportError:
from UserDict import DictMixin as MappingMixin
from... | mpl-2.0 |
stonegithubs/micropython | tests/basics/equal.py | 118 | 1043 | # test equality
print(None == None)
print(False == None)
print(False == False)
print(False == True)
print(() == ())
print(() == [])
print([] == [])
print(() == {})
print({} == ())
print(() == None)
print(() == False)
print(() == print)
print([] == None)
print([] == False)
print([] == print)
print({} == None)
prin... | mit |
ynkjm/ryu | ryu/app/simple_switch_14.py | 20 | 3770 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
eLBati/odoo | addons/calendar/controllers/main.py | 36 | 3503 | import simplejson
import openerp
import openerp.addons.web.http as http
from openerp.addons.web.http import request
import openerp.addons.web.controllers.main as webmain
import json
class meeting_invitation(http.Controller):
@http.route('/calendar/meeting/accept', type='http', auth="calendar")
def accept(sel... | agpl-3.0 |
swdevbali/transifex-client | txclib/packages/urllib3/connectionpool.py | 39 | 27708 | # urllib3/connectionpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import errno
import logging
from socket import error as SocketError, timeout as SocketT... | gpl-2.0 |
pepeportela/edx-platform | common/djangoapps/django_comment_common/migrations/0005_coursediscussionsettings.py | 8 | 1147 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import openedx.core.djangoapps.xmodule_django.models
class Migration(migrations.Migration):
dependencies = [
('django_comment_common', '0004_auto_20161117_1209'),
]
operations = [
mi... | agpl-3.0 |
fhe-odoo/odoo | openerp/exceptions.py | 312 | 3157 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
arthurchan1111/EventPlanner | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
pulilab/s3stat | docs/conf.py | 3 | 8257 | # -*- coding: utf-8 -*-
#
# S3 Stat documentation build configuration file, created by
# sphinx-quickstart on Tue May 6 22:05:34 2014.
#
# 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
# autogenerated file.
#
# A... | mit |
alistairlow/tensorflow | tensorflow/python/ops/distributions/identity_bijector.py | 73 | 1840 | # 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 |
Akrog/cinder | cinder/tests/test_gpfs.py | 1 | 90635 |
# Copyright IBM Corp. 2013 All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
acerix/doge-millionaire | pycoin/key/bip32.py | 14 | 5602 | # -*- coding: utf-8 -*-
"""
A BIP0032-style hierarchical wallet.
Implement a BIP0032-style hierarchical wallet which can create public
or private wallet keys. Each key can create many child nodes. Each node
has a wallet key and a corresponding private & public key, which can
be used to generate Bitcoin addresses or WI... | mit |
JeroenDeDauw/mwclient | tests/test_page.py | 5 | 8441 | # encoding=utf-8
from __future__ import print_function
import unittest
import pytest
import logging
import requests
import responses
import mock
import mwclient
from mwclient.page import Page
try:
import json
except ImportError:
import simplejson as json
if __name__ == "__main__":
print()
print("Note... | mit |
hp-networking/baremetal-network-provisioning | baremetal_network_provisioning/managers.py | 2 | 2465 | # Copyright (c) 2016 OpenStack Foundation
#
# 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 ... | apache-2.0 |
joshrule/LOTlib | LOTlib/Projects/FormalLanguageTheory/Language/SimpleEnglish.py | 1 | 1051 | from FormalLanguage import FormalLanguage
from LOTlib.Grammar import Grammar
from pickle import load
class SimpleEnglish(FormalLanguage):
"""
A simple English language with a few kinds of recursion all at once
"""
def __init__(self):
self.grammar = Grammar(start='S')
self.grammar.add_ru... | gpl-3.0 |
UOMx/edx-platform | lms/djangoapps/courseware/features/conditional.py | 31 | 4647 | # pylint: disable=missing-docstring
from lettuce import world, steps
from nose.tools import assert_in, assert_true
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import add_problem_to_course, answer_problem
@steps
class ConditionalSteps(object):
COURSE_NUM = 'test_cou... | agpl-3.0 |
rabipanda/tensorflow | tensorflow/python/platform/benchmark.py | 9 | 11922 | # 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 |
Addepar/buck | third-party/py/pex/pex/http.py | 39 | 8296 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import contextlib
import hashlib
import os
import shutil
import uuid
from abc import abstractmethod
from email import message_from_string
from .common import safe_mkdtemp, safe_open
from ... | apache-2.0 |
adedayo/intellij-community | python/lib/Lib/site-packages/django/core/files/temp.py | 536 | 1819 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | apache-2.0 |
dparlevliet/zelenka-report-storage | server-local/twisted/conch/test/test_session.py | 27 | 40541 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the 'session' channel implementation in twisted.conch.ssh.session.
See also RFC 4254.
"""
import os, signal, sys, struct
from zope.interface import implements
from twisted.internet.address import IPv4Address
from twisted.internet... | lgpl-3.0 |
hbrunn/OCB | addons/account_asset/wizard/account_asset_change_duration.py | 258 | 5021 | # -*- encoding: 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 t... | agpl-3.0 |
HiSPARC/station-software | user/python/Lib/site-packages/pythonwin/pywin/idle/PyParse.py | 17 | 18344 | import string
import re
import sys
# Reason last stmt is continued (or C_NONE if it's not).
C_NONE, C_BACKSLASH, C_STRING, C_BRACKET = list(range(4))
if 0: # for throwaway debugging output
def dump(*stuff):
sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")
# Find what looks like the start of a pop... | gpl-3.0 |
jolevq/odoopub | addons/l10n_ve/__init__.py | 975 | 1058 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
jolevq/odoopub | addons/account/report/account_treasury_report.py | 385 | 3872 | # -*- 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 |
FilipeMaia/arrayfire-python | tests/simple/_util.py | 2 | 1340 | #######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
######################################################... | bsd-3-clause |
mishravikas/geonode-cas | geonode/maps/urls.py | 1 | 2224 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | gpl-3.0 |
raymondxyang/tensorflow | tensorflow/python/summary/writer/writer.py | 20 | 14765 | # 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 |
ddico/sale-workflow | sale_service_project/tests/test_sale_service_project.py | 9 | 5956 | # -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Sergio Teruel
# © 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.tests.common import TransactionCase
class TestSaleServiceProject(TransactionCase):
""" Use case : Prepare some data... | agpl-3.0 |
ptphp/PyLib | src/webpy1/src/post_/post_soufun.py | 4 | 4462 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2,urllib,sys,time
import cookielib,mechanize
import re
DEBUG =0
reload(sys)
sys.setdefaultencoding('utf8') #@UndefinedVariable
register_openers()
headers = {
... | apache-2.0 |
nimbis/django-cms | cms/tests/test_multilingual.py | 6 | 17297 | # -*- coding: utf-8 -*-
import copy
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from django.http import Http404, HttpResponseRedirect, QueryDict
from django.test.utils import override_settings
from cms.api import crea... | bsd-3-clause |
dnlm92/chokoretto | main/lib/flask_restful/utils/cors.py | 6 | 1807 | from datetime import timedelta
from flask import make_response, request, current_app
from functools import update_wrapper
def crossdomain(origin=None, methods=None, headers=None,
max_age=21600, attach_to_all=True,
automatic_options=True, credentials=False):
"""
http://flask.poc... | mit |
WholeGrainGoats/servo | python/servo/build_commands.py | 5 | 18426 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
ElectryDev/android_kernel_lenovo_msm8974_dv | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
kharts/LinguaLeoWordsAdder | languages/uk.py | 134 | 14390 | # coding: utf8
{
'!langcode!': 'uk',
'!langname!': 'Українська',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Оновити" це додатковий вираз, такий, як "field1=\'нове_значення\'". Ви не можете змінювати або вилучати дані об\'єднаних таблиць.',
'%d d... | gpl-2.0 |
dolda2000/ashd | python3/ashd/proto.py | 1 | 6496 | """Low-level protocol module for ashd(7)
This module provides primitive functions that speak the raw ashd(7)
protocol. Primarily, it implements the `req' class that is used to
represent ashd requests. The functions it provides can also be used to
create ashd handlers, but unless you require very precise control, the
a... | gpl-3.0 |
kevclarx/ansible | lib/ansible/modules/packaging/os/pkgin.py | 71 | 11775 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com>
# Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to>
# Copyright (c) 2016 Jasper Lievisse Adriaanse <j at jasper.la>
#
# Written by Shaun Zinck
# Based on pacman module written by Afterburn <http://github.com/... | gpl-3.0 |
Chilledheart/chromium | tools/telemetry/telemetry/internal/results/page_test_results_unittest.py | 13 | 16067 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import story
from telemetry.internal.results import base_test_results_unittest
from telemetry.internal.results impo... | bsd-3-clause |
ashawnbandy-te-tfb/FrameworkBenchmarks | toolset/benchmark/test_types/update_type.py | 22 | 1196 | from benchmark.test_types.framework_test_type import FrameworkTestType
from benchmark.test_types.verifications import verify_query_cases
class UpdateTestType(FrameworkTestType):
def __init__(self):
kwargs = {
'name': 'update',
'accept_header': self.accept('json'),
'req... | bsd-3-clause |
TabbedOut/django-guardian | docs/exts.py | 109 | 1178 |
def setup(app):
app.add_crossref_type(
directivename = "admin",
rolename = "admin",
indextemplate = "pair: %s; admin",
)
app.add_crossref_type(
directivename = "command",
rolename = "command",
indextemplate = "pair: %s; command",
)
app.add_c... | bsd-2-clause |
CodeMonkeyJan/hyperspy | hyperspy/_components/rc.py | 4 | 1192 | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
shravan-shandilya/web3.py | tests/managers/test_private_key_signing_manager.py | 1 | 2048 | import pytest
from web3.providers.manager import (
PrivateKeySigningManager,
)
from web3.utils.address import to_address
from web3.utils.currency import denoms
@pytest.fixture()
def account_private_key():
from eth_tester_client.utils import mk_random_privkey
return mk_random_privkey()
@pytest.fixture()... | mit |
helix-collective/s3ts | test/test_treestore.py | 1 | 23988 | import os, tempfile, unittest, shutil, subprocess, datetime, time
from s3ts.filestore import LocalFileStore
from s3ts.s3filestore import S3FileStore
from s3ts.config import TreeStoreConfig, readInstallProperties, S3TS_PROPERTIES
from s3ts.treestore import TreeStore
from s3ts.utils import datetimeFromIso
from s3ts.pack... | bsd-3-clause |
kogaki/pqkmeans | pqkmeans/encoder/pq_encoder.py | 2 | 3316 | import typing
import numpy
from scipy.cluster.vq import vq, kmeans2
from .encoder_base import EncoderBase
class PQEncoder(EncoderBase):
def __init__(self, iteration=20, num_subdim=4, Ks=256):
# type: (int, int, int) -> None
assert Ks <= 2 ** 32
self.iteration = iteration
self.M, se... | mit |
Titulacion-Sistemas/PythonTitulacion-EV | Lib/site-packages/xlwt/examples/wsprops.py | 43 | 3548 | props = \
[
'name',
'parent',
'rows',
'cols',
'merged_ranges',
'bmp_rec',
'show_formulas',
'show_grid',
'show_headers',
'panes_frozen',
'show_empty_as_zero',
'auto_colour_grid',
'cols_right_to_left',
'show_ou... | mit |
ConnorGBrewster/servo | tests/wpt/update/__init__.py | 9 | 1255 | # 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/.
#!/usr/bin/env python
import os
import subprocess
import sys
from mozlog.structured import structuredlog
here = os.pat... | mpl-2.0 |
kmonsoor/python-for-android | python-build/python-libs/gdata/src/gdata/Crypto/Protocol/AllOrNothing.py | 226 | 10952 | """This file implements all-or-nothing package transformations.
An all-or-nothing package transformation is one in which some text is
transformed into message blocks, such that all blocks must be obtained before
the reverse transformation can be applied. Thus, if any blocks are corrupted
or lost, the original message... | apache-2.0 |
tik0/inkscapeGrid | share/extensions/ffgeom.py | 10 | 4710 | #!/usr/bin/env python
"""
ffgeom.py
Copyright (C) 2005 Aaron Cyril Spike, aaron@ekips.org
This file is part of FretFind 2-D.
FretFind 2-D is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; e... | gpl-2.0 |
ChristinaZografou/sympy | sympy/tensor/array/tests/test_arrayop.py | 10 | 18991 | import random
import itertools
from sympy.combinatorics import Permutation
from sympy.combinatorics.permutations import _af_invert
from sympy.utilities.pytest import raises
from sympy import symbols, sin, exp, log, cos, transpose, adjoint, conjugate
from sympy.tensor.array import Array, NDimArray
from sympy.tensor.... | bsd-3-clause |
andrwng/kudu | src/kudu/scripts/get-job-stats-from-mysql.py | 5 | 2482 | #!/usr/bin/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
# "Lice... | apache-2.0 |
ooici/protobuf-2.3.0 | gtest/test/gtest_list_tests_unittest.py | 1068 | 5415 | #!/usr/bin/env python
#
# Copyright 2006, 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-3-clause |
jtyr/ansible-modules-extras | network/f5/bigip_node.py | 32 | 16217 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013, Matt Hite <mhite@hotmail.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 Licens... | gpl-3.0 |
mhugent/Quantum-GIS | python/plugins/processing/algs/grass/GrassAlgorithmProvider.py | 4 | 4271 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GrassAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************... | gpl-2.0 |
navrasio/mxnet | example/rcnn/rcnn/symbol/symbol_resnet.py | 16 | 13119 | # 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 |
SamYaple/neutron | neutron/pecan_wsgi/hooks/attribute_population.py | 10 | 3951 | # Copyright (c) 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
xupeilin/tera | src/sdk/http/http_sample.py | 12 | 3234 | #!/usr/bin/env python
# encoding: utf-8
"""
tera http sample
用grequests模块实现http POST读写tera
前置条件:
1. 已安装python-grequests模块
2. write_url/read_url指向自己的http地址
3. 已建表 "oops{lg0{cf0}}" && "oops2{lg0{cf0}}"
"""
import grequests
write_url = 'http://127.0.0.1:8657/tera.http.HttpProxy.Put'
read_url = 'http://127.0.0.1:8657... | bsd-3-clause |
ashray/VTK-EVM | Filters/General/Testing/Python/subPixelPositionMin.py | 20 | 1982 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Test sub pixel positioning (A round about way of getting an iso surface.)
# See cubed sphere for the surface before sub pixel poisitioning.
sphere = vtk.vtkSphere()
sphere.SetCenter... | bsd-3-clause |
hashar/git-gerritclone | doc/source/conf.py | 1 | 8239 | # -*- coding: utf-8 -*-
#
# git-gerritclone documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 22 21:43:04 2013.
#
# 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
# autogenerated file.
... | gpl-2.0 |
sergeii/swat-utils | fabfile/utils.py | 1 | 3347 | # -*- coding: utf-8 -*-
import uuid
from StringIO import StringIO
from collections import OrderedDict
from contextlib import contextmanager
from fabric.contrib.files import exists
from unipath import Path
from .settings import *
class IniFile(object):
def __init__(self, file=None):
super(IniFile, self)... | mit |
meighti/bitcoin | qa/rpc-tests/nodehandling.py | 34 | 3567 | #!/usr/bin/env python2
# Copyright (c) 2014 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 handling
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.u... | mit |
danking/hail | hail/python/hail/experimental/datasets.py | 1 | 5059 | import json
import os
from typing import Optional, Union
import hail as hl
import pkg_resources
def _read_dataset(path: str) -> Union[hl.Table, hl.MatrixTable, hl.linalg.BlockMatrix]:
if path.endswith('.ht'):
return hl.read_table(path)
elif path.endswith('.mt'):
return hl.read_matrix_table(pa... | mit |
nickw444/flask-ldap3-login | ldap_app.py | 1 | 3950 | from flask import Flask, redirect, render_template_string, url_for
from flask_login import LoginManager, UserMixin, current_user, login_user
from flask_ldap3_login import LDAP3LoginManager
from flask_ldap3_login.forms import LDAPLoginForm
app = Flask(__name__)
app.config["SECRET_KEY"] = "secret"
app.config["DEBUG"] =... | mit |
carsongee/edx-platform | cms/djangoapps/contentstore/management/commands/check_course.py | 11 | 2707 | from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.xml_importer import check_module_metadata_editability
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import Sla... | agpl-3.0 |
mattclay/ansible-modules-core | cloud/google/gce_net.py | 22 | 16928 | #!/usr/bin/python
# Copyright 2013 Google Inc.
#
# 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 vers... | gpl-3.0 |
TsinghuaX/edx-platform | cms/envs/acceptance.py | 1 | 4121 | """
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .test import *
from lms.envs.sauce import *... | agpl-3.0 |
endplay/omniplay | logdb/ipc.py | 2 | 4386 | import pydot
# our modules
import opinfo
class IPCGraph(object):
def __init__(self):
self.nodes = []
def add_node(self, group_id, pid, cmd=""):
node = IPCNode(group_id, pid, cmd=cmd)
assert(node)
self.nodes.append(node)
def has_node(self, group_id, pid):
for node in self... | bsd-2-clause |
bolkedebruin/airflow | tests/models/test_taskinstance.py | 1 | 58532 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
stevenbrichards/boto | boto/glacier/exceptions.py | 185 | 2195 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation th... | mit |
Notamaniac/yogstation | bot/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | agpl-3.0 |
alqfahad/odoo | addons/payment_authorize/controllers/main.py | 247 | 1261 | # -*- coding: utf-8 -*-
import pprint
import logging
import urlparse
from openerp import http
from openerp.http import request
_logger = logging.getLogger(__name__)
class AuthorizeController(http.Controller):
_return_url = '/payment/authorize/return/'
_cancel_url = '/payment/authorize/cancel/'
@http.ro... | agpl-3.0 |
tensor-tang/Paddle | python/paddle/fluid/tests/unittests/test_softmax_with_cross_entropy_op.py | 2 | 12856 | # Copyright (c) 2018 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 app... | apache-2.0 |
JohnTheodore/cloud-custodian | tests/test_cwe.py | 4 | 4134 | # Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 |
daliwangi/bitcoin | test/functional/merkle_blocks.py | 30 | 4403 | #!/usr/bin/env python3
# Copyright (c) 2014-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.
"""Test gettxoutproof and verifytxoutproof RPCs."""
from test_framework.test_framework import BitcoinTest... | mit |
xhair/TopOdoo_Addons | ToproERP_GLD/models/syt_oa_gld.py | 1 | 25918 | # -*- coding: utf-8 -*-
# © <2016> <ToproERP liujing>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from openerp import models, api, fields, exceptions
import time
_logger = logging.getLogger(__name__)
class syt_oa_gld(models.Model):
_name = "syt.oa.gld"
_description = ... | agpl-3.0 |
TangHao1987/intellij-community | python/lib/Lib/site-packages/django/template/defaulttags.py | 78 | 48027 | """Default tags used by the template system, available to all templates."""
import sys
import re
from itertools import groupby, cycle as itertools_cycle
from django.template.base import Node, NodeList, Template, Context, Variable
from django.template.base import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_ST... | apache-2.0 |
danielharbor/openerp | addons/mass_mailing/tests/__init__.py | 121 | 1072 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
jrha/aquilon | lib/python2.6/aquilon/worker/commands/add_domain.py | 2 | 4185 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | apache-2.0 |
lorentey/swift | utils/gyb_syntax_support/Child.py | 14 | 3261 | # flake8: noqa I201
from Classification import classification_by_name
from Token import SYNTAX_TOKEN_MAP
from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word
class Child(object):
"""
A child of a node, that may be declared optional or a token with a
restricted subset of acceptable kinds... | apache-2.0 |
aviaryan/open-event-orga-server | app/helpers/exporters/order_csv.py | 1 | 1495 | from app.helpers.ticketing import TicketingManager
class OrderCsv:
@staticmethod
def export(event_id):
orders = TicketingManager.get_orders(event_id)
headers = 'Order#,Order Date, Status, Payment Type, Total Amount, Quantity, Discount Code,' \
'First Name, Last Name, Email \n'
... | gpl-3.0 |
neteler/QGIS | python/plugins/processing/algs/gdal/slope.py | 3 | 3561 | # -*- coding: utf-8 -*-
"""
***************************************************************************
slope.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*******************... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.