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 |
|---|---|---|---|---|---|
vnsofthe/odoo-dev | addons/payment_alipay-master/controllers/main.py | 1 | 2966 | # -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
import logging
import pprint
import urllib2
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class AlipayController(http.Controller):
_noti... | agpl-3.0 |
Yannig/ansible-modules-core | commands/command.py | 37 | 9569 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
#
# 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 ... | gpl-3.0 |
cmelange/ansible | lib/ansible/modules/system/locale_gen.py | 69 | 7922 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
nevil-brownlee/python-libtrace | test/v2-test-cases/test-u32.py | 1 | 1751 | #!/usr/bin/env python
# Thu, 13 Mar 14 (PDT)
# ip6.py: Demonstrate IPv6 objects
# Copyright (C) 2017, Nevil Brownlee, U Auckland | WAND
import plt
import natkit as nk
from plt_testing import *
#ba = bytearray(b"\x10\x02\x20\x04\x30\x05\x40\x06")
ba = bytearray.fromhex(u"1002 2004 3005 4006")
test_print('', get_tag(... | gpl-3.0 |
Royal-Society-of-New-Zealand/NZ-ORCID-Hub | orcid_api_v3/models/item_v30_rc2.py | 1 | 5948 | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | mit |
if1live/googletest-svn | test/gtest_list_tests_unittest.py | 1898 | 6515 | #!/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 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/scipy/io/matlab/tests/test_pathological.py | 17 | 1104 | """ Test reading of files not conforming to matlab specification
We try and read any file that matlab reads, these files included
"""
from __future__ import division, print_function, absolute_import
from os.path import dirname, join as pjoin
import sys
if sys.version_info[0] >= 3:
from io import BytesIO
cStr... | agpl-3.0 |
LapoFrati/GeneticAlgorithms | Bedau/Agent.py | 1 | 3245 | import copy
import numpy as np
class Agent():
def __init__(self, world_size=None, behaviours=None, mutation_parameters=None, world=None, random_source=None, log=None, orig=None):
if orig is None:
# current location: x
self.position = world.random_location()
self.resour... | mit |
moylop260/odoo-dev | openerp/report/render/html2html/html2html.py | 443 | 4238 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
sestrella/ansible | lib/ansible/module_utils/network/vyos/facts/lag_interfaces/lag_interfaces.py | 21 | 5081 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos lag_interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based o... | gpl-3.0 |
nthiep/global-ssh-server | lib/python2.7/site-packages/django/core/context_processors.py | 232 | 2269 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from __future__ i... | agpl-3.0 |
jakobworldpeace/scikit-learn | examples/model_selection/plot_learning_curve.py | 76 | 4509 | """
========================
Plotting Learning Curves
========================
On the left side the learning curve of a naive Bayes classifier is shown for
the digits dataset. Note that the training score and the cross-validation score
are both not very good at the end. However, the shape of the curve can be found
in ... | bsd-3-clause |
EDUlib/eTracesX | Translation_software/edx_to_MOOCdb_piping/import.openedx.apipe/json_to_relation/test/test_edxTrackLogJSONParser.py | 1 | 93922 | '''
Created on Oct 3, 2013
@author: paepcke
'''
import StringIO
from collections import OrderedDict
import json
import os
import re
import shutil
import sys
import tempfile
import unittest
from json_to_relation.edxTrackLogJSONParser import EdXTrackLogJSONParser
from json_to_relation.input_source import InURI
from jso... | agpl-3.0 |
sestrella/ansible | lib/ansible/modules/network/fortios/fortios_system_session_ttl.py | 13 | 10017 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
marctc/django | tests/forms_tests/models.py | 261 | 3805 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import tempfile
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
callable_default_counter = itertools.count()
def callab... | bsd-3-clause |
Khan/pygments | pygments/formatters/bbcode.py | 26 | 3314 | # -*- coding: utf-8 -*-
"""
pygments.formatters.bbcode
~~~~~~~~~~~~~~~~~~~~~~~~~~
BBcode formatter.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt
__al... | bsd-2-clause |
drobilla/pugl | waflib/TaskGen.py | 2 | 26686 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2018 (ita)
"""
Task generators
The class :py:class:`waflib.TaskGen.task_gen` encapsulates the creation of task objects (low-level code)
The instances can have various parameters, but the creation of task nodes (Task.py)
is deferred. To achieve this, various ... | isc |
hamiltont/CouchPotatoServer | couchpotato/core/downloaders/nzbget/__init__.py | 4 | 2858 | from .main import NZBGet
def start():
return NZBGet()
config = [{
'name': 'nzbget',
'groups': [
{
'tab': 'downloaders',
'list': 'download_providers',
'name': 'nzbget',
'label': 'NZBGet',
'description': 'Use <a href="http://nzbget.sourcefo... | gpl-3.0 |
DamienIrving/ocean-analysis | modules/kde.py | 1 | 11449 | """
Code for kernel density estimation.
- Source: http://nbviewer.jupyter.org/gist/tillahoffmann/f844bce2ec264c1c8cb5
"""
import numpy as np
from scipy.spatial.distance import cdist
class gaussian_kde(object):
"""Representation of a kernel-density estimate using Gaussian kernels.
Kernel density estimation i... | mit |
mitar/django | tests/regressiontests/wsgi/tests.py | 8 | 3220 | from django.core.exceptions import ImproperlyConfigured
from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.wsgi import get_wsgi_application
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.util... | bsd-3-clause |
sencha/chromium-spacewalk | chrome/browser/policy/test/asn1der.py | 101 | 1562 | # Copyright (c) 2011 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.
"""Helper module for ASN.1/DER encoding."""
import binascii
import struct
# Tags as defined by ASN.1.
INTEGER = 2
BIT_STRING = 3
NULL = 5
OBJECT_IDENTI... | bsd-3-clause |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/urbansim/gridcell/developable_maximum_commercial_sqft.py | 2 | 1422 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from variable_functions import my_attribute_label
from numpy import zeros
class developable_maximum_commercial_sqft(Variable):
"""How man... | gpl-2.0 |
fabiencastan/TuttleOFX | 3rdParty/init.py | 1 | 12378 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import errno
import sys
import urllib
import subprocess
import tarfile
import zipfile
from shutil import move, copystat, Error, rmtree
osname = os.name.lower()
sysplatform = sys.platform.lower()
windows = osname == "nt" and sysplatform.startswith("win")
macos = ... | gpl-3.0 |
creasyw/IMTAphy | documentation/toolchain/Pygments-0.11.1-py2.5.egg/pygments/style.py | 26 | 3722 | # -*- coding: utf-8 -*-
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: 2006-2007 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
from pygments.token import Token, STANDARD_TYPES
class StyleMeta(type):
def __new__(mcs, name, bases, dct):
obj = ty... | gpl-2.0 |
poiesisconsulting/openerp-restaurant | l10n_bo/__openerp__.py | 5 | 1778 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
jamesblunt/edx-platform | common/djangoapps/student/tests/test_microsite.py | 47 | 3772 | """
Test for User Creation from Micro-Sites
"""
from django.test import TestCase
from student.models import UserSignupSource
import mock
import json
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
FAKE_MICROSITE = {
"SITE_NAME": "openedx.localhost",
"university": "fakeu... | agpl-3.0 |
jss-emr/openerp-7-src | openerp/addons/resource/faces/observer.py | 15 | 2325 | #@+leo-ver=4
#@+node:@file observer.py
#@@language python
#@<< Copyright >>
#@+node:<< Copyright >>
############################################################################
# Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
# ... | agpl-3.0 |
archf/ansible | test/units/modules/network/nxos/test_nxos_switchport.py | 43 | 3129 | # (c) 2016 Red Hat 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 version.
#
# Ansible is dis... | gpl-3.0 |
icucinema/madcow | madcow/include/chardet/euckrprober.py | 236 | 1672 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
Crevil/grpc | tools/flakes/detect_flakes.py | 10 | 3654 | #!/usr/bin/env python
# Copyright 2015 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 |
Kryz/sentry | src/sentry/migrations/0004_auto__add_filtervalue__add_unique_filtervalue_key_value.py | 36 | 4706 | # 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 'FilterValue'
db.create_table('sentry_filtervalue', (
('id', self.gf('sentry.db.models.... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_configuration.py | 4 | 2028 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
bitchute-kodi/bitchute-kodi | bs4/tests/test_lxml.py | 41 | 2379 | """Tests to ensure that the lxml tree builder generates good trees."""
import re
import warnings
try:
import lxml.etree
LXML_PRESENT = True
LXML_VERSION = lxml.etree.LXML_VERSION
except ImportError as e:
LXML_PRESENT = False
LXML_VERSION = (0,)
if LXML_PRESENT:
from bs4.builder import LXMLTre... | mit |
mortonjt/scipy | scipy/stats/tests/test_contingency.py | 126 | 5959 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (run_module_suite, assert_equal, assert_array_equal,
assert_array_almost_equal, assert_approx_equal, assert_raises,
assert_allclose)
from scipy.special import xlogy
from scipy.stats.contingen... | bsd-3-clause |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/pygments/lexers/javascript.py | 19 | 60134 | # -*- coding: utf-8 -*-
"""
pygments.lexers.javascript
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for JavaScript and related languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, ... | gpl-3.0 |
ack8006/Python-mode-klen | pymode/libs3/rope/refactor/multiproject.py | 91 | 2639 | """This module can be used for performing cross-project refactorings
See the "cross-project refactorings" section of ``docs/library.txt``
file.
"""
from rope.base import resources, project, libutils
class MultiProjectRefactoring(object):
def __init__(self, refactoring, projects, addpath=True):
"""Crea... | lgpl-3.0 |
peterhinch/micropython-async | v3/primitives/tests/asyntest.py | 1 | 13661 | # asyntest.py Test/demo of the 'micro' Event, Barrier and Semaphore classes
# Test/demo of official asyncio library and official Lock class
# Copyright (c) 2017-2020 Peter Hinch
# Released under the MIT License (MIT) - see LICENSE file
# CPython 3.8 compatibility
# (ignore RuntimeWarning: coroutine '_g' was never awa... | mit |
GoogleCloudPlatform/solutions-cloud-orchestrate | api/orchestrateapi/commands/projects/deregister.py | 1 | 4568 | # python3
# Copyright 2020 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
amarant/servo | tests/wpt/update.py | 144 | 1048 | # 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/.
import os
import sys
from wptrunner import wptcommandline
here = os.path.split(__file__)[0]
def wpt_path(*args):
... | mpl-2.0 |
ryantierney513/capirca | tests/lib/ciscoasa_test.py | 1 | 4164 | # Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or a... | apache-2.0 |
eleftherioszisis/NeuroM | neurom/check/structural_checks.py | 5 | 4889 | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | bsd-3-clause |
vfasky/BlogCatke | virtualenv.bundle/requests/packages/chardet/euckrprober.py | 236 | 1672 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | apache-2.0 |
yashsharan/sympy | sympy/physics/vector/tests/test_functions.py | 36 | 18751 | from sympy import S, Integral, sin, cos, pi, sqrt, symbols
from sympy.physics.vector import Dyadic, Point, ReferenceFrame, Vector
from sympy.physics.vector.functions import (cross, dot, express,
time_derivative,
kinematic_equations,... | bsd-3-clause |
e-q/scipy | tools/gh_lists.py | 6 | 7231 | #!/usr/bin/env python3
# -*- encoding:utf-8 -*-
"""
gh_lists.py MILESTONE
Functions for Github API requests.
"""
import os
import re
import sys
import json
import collections
import argparse
import datetime
import time
from urllib.request import urlopen, Request, HTTPError
Issue = collections.namedtuple('Issue', ('... | bsd-3-clause |
tsdl2013/shadowsocks | shadowsocks/asyncdns.py | 8 | 16614 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | mit |
asser/django | django/db/backends/oracle/creation.py | 160 | 17256 | import sys
import time
from django.conf import settings
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.utils import DatabaseError
from django.utils.functional import cached_property
from django.utils.six.moves import input
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
... | bsd-3-clause |
analyseuc3m/ANALYSE-v1 | common/djangoapps/edxmako/shortcuts.py | 7 | 5575 | # Copyright (c) 2008 Mikeal Rogers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | agpl-3.0 |
epequeno/project-euler | id13.py | 1 | 5721 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 21 07:46:44 2011
@author: steven
"""
# project euler problem ID 13
# Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
#
# 37107287533902102798797998220837590246510135740250
# 46376937677490009712648124896970078050417018260538
# 7432... | gpl-3.0 |
Tesora-Release/tesora-trove | trove/tests/unittests/conductor/test_conf.py | 5 | 2524 | # Copyright 2014 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
wiltonlazary/arangodb | 3rdParty/V8/V8-5.0.71.39/build/gyp/test/make_global_settings/ld/gyptest-make_global_settings_ld.py | 88 | 4140 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Verifies 'LD' in make_global_settings.
"""
import os
import sys
import TestGyp
def resolve_path(test, path):
if path is None:
re... | apache-2.0 |
monikagrabowska/osf.io | website/oauth/views.py | 6 | 1708 | # -*- coding: utf-8 -*-
import httplib as http
from flask import redirect
from framework.auth.decorators import must_be_logged_in
from framework.exceptions import HTTPError
from website.oauth.models import ExternalAccount
from website.oauth.utils import get_service
from website.oauth.signals import oauth_complete
@... | apache-2.0 |
nirmeshk/oh-mainline | vendor/packages/python-dateutil/dateutil/zoneinfo/__init__.py | 265 | 2575 | """
Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
from dateutil.tz import tzfile
from tarfile import TarFile
import os
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
__all__ = ["setca... | agpl-3.0 |
OpenBfS/dokpool-plone | Plone/src/docpool.rei/setup.py | 1 | 1278 | # -*- coding: utf-8 -*-
from setuptools import find_packages
from setuptools import setup
version = '0.0.1'
setup(
name='docpool.rei',
version=version,
description="",
long_description="""\
""",
# Get more strings from
# http://www.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
... | gpl-3.0 |
kangkot/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_csv.py | 55 | 38941 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2001,2002 Python Software Foundation
# csv package unit tests
import sys
import os
import unittest
from StringIO import StringIO
import tempfile
import csv
import gc
from test import test_support
class Test_Csv(unittest.TestCase):
"""
Test the underlying C csv pars... | apache-2.0 |
gpapakyriakopoulos/PyFlask | pyflask/lib/python2.7/site-packages/flask/_compat.py | 783 | 2164 | # -*- coding: utf-8 -*-
"""
flask._compat
~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY... | gpl-3.0 |
sorenk/ansible | lib/ansible/modules/cloud/amazon/aws_direct_connect_link_aggregation_group.py | 52 | 18121 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
module... | gpl-3.0 |
wummel/linkchecker | linkcheck/better_exchook2.py | 9 | 8082 | # -*- coding: iso-8859-1 -*-
#
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# file created 2011-04-15
# 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 m... | gpl-2.0 |
AltSchool/django | django/db/models/sql/constants.py | 633 | 1039 | """
Constants specific to the SQL storage portion of the ORM.
"""
import re
# Valid query types (a set is used for speedy lookups). These are (currently)
# considered SQL-specific; other storage systems may choose to use different
# lookup types.
QUERY_TERMS = {
'exact', 'iexact', 'contains', 'icontains', 'gt', '... | bsd-3-clause |
fossoult/odoo | addons/account_budget/wizard/account_budget_crossovered_report.py | 375 | 2089 | # -*- 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 |
dantebarba/docker-media-server | plex/Sub-Zero.bundle/Contents/Libraries/Shared/plex/objects/setting.py | 3 | 1400 | from plex.objects.core.base import Descriptor, Property
class Setting(Descriptor):
id = Property
label = Property
summary = Property
type = Property
group = Property
value = Property(resolver=lambda: Setting.parse_value)
default = Property(resolver=lambda: Setting.parse_default)
opt... | gpl-3.0 |
Nepherhotep/django | tests/multiple_database/tests.py | 45 | 95448 | from __future__ import unicode_literals
import datetime
import pickle
import warnings
from operator import attrgetter
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.db import DEFAULT_DB_ALIAS, connections, router, t... | bsd-3-clause |
JonasWechsler/Website | public/plugins/three.js/utils/build/build.py | 53 | 3356 | #!/usr/bin/env python
import sys
if sys.version_info < (2, 7):
print("This script requires at least Python 2.7.")
print("Please, update to a newer version: http://www.python.org/download/releases/")
# exit()
import argparse
import json
import os
import shutil
import tempfile
from io import open
def main(argv=Non... | mit |
microsoft/DiscoFaceGAN | training/networks_id.py | 1 | 1231 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# Face recognition network proposed by Schroff et al. 15,
# https://arxiv.org/abs/1503.03832,
# https://github.com/davidsandberg/facenet
import tensorflow as tf
from training.inception_resnet_v1 import inception_resnet_v1
slim = tf.contrib.slim... | mit |
neumerance/deploy | .venv/lib/python2.7/site-packages/sphinx/ext/ifconfig.py | 5 | 2273 | # -*- coding: utf-8 -*-
"""
sphinx.ext.ifconfig
~~~~~~~~~~~~~~~~~~~
Provides the ``ifconfig`` directive that allows to write documentation
that is included depending on configuration variables.
Usage::
.. ifconfig:: releaselevel in ('alpha', 'beta', 'rc')
This stuff is only in... | apache-2.0 |
google-research/lottery-ticket-hypothesis | foundations/model_base.py | 1 | 4734 | # Copyright (C) 2018 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 or agreed to in writing, ... | apache-2.0 |
tcheehow/MissionPlanner | Lib/distutils/command/register.py | 50 | 11884 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
__revision__ = "$Id$"
import urllib2
import getpass
import urlparse
import StringIO
from warnings import warn
from distutils.core import PyPIRCCommand
fr... | gpl-3.0 |
barma1309/Kalista | .virtualenvs/Kalista/lib/python3.4/site-packages/pip/utils/hashes.py | 517 | 2866 | from __future__ import absolute_import
import hashlib
from pip.exceptions import HashMismatch, HashMissing, InstallationError
from pip.utils import read_chunks
from pip._vendor.six import iteritems, iterkeys, itervalues
# The recommended hash algo of the moment. Change this whenever the state of
# the art changes; ... | gpl-3.0 |
saeschdivara/ArangoPy | arangodb/api.py | 1 | 13834 | # -*- coding: utf-8 -*-
import slumber
SYSTEM_DATABASE = '_system'
class Client(object):
class_instance = None
def __init__(self, hostname, auth=None, protocol='http', port=8529, database=SYSTEM_DATABASE):
"""
This should be done only once and sets the instance
"""
Cli... | mit |
gdestuynder/MozDef | tests/alerts/alert_test_suite.py | 2 | 10976 | #!/usr/bin/env python
# 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/.
# Copyright (c) 2017 Mozilla Corporation
import os.path
import sys
import logging
sys.path.appen... | mpl-2.0 |
shermanng10/superathletebuilder | env/lib/python2.7/site-packages/django/utils/regex_helper.py | 97 | 12721 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
... | mit |
bosstb/HaberPush | youtube_dl/extractor/lynda.py | 29 | 11662 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
urlencode_postdata,
)
class LyndaBaseIE(InfoExtractor):
_SIGNIN_URL = 'https://ww... | mit |
Taranys/Sick-Beard | sickbeard/db.py | 35 | 9649 | # Author: Nic Wolfe <nic@wolfeden.ca>
# 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 the Lice... | gpl-3.0 |
mbauskar/phrerp | erpnext/stock/doctype/delivery_note/delivery_note.py | 13 | 12684 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cint
from frappe import msgprint, _
import frappe.defaults
from frappe.model.mapper import get_mapped_d... | agpl-3.0 |
sfoolish/linux_3.2.0-39.62_ubuntu12.04 | 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 |
invisiblek/python-for-android | python-modules/twisted/twisted/runner/test/test_procmontap.py | 49 | 2532 | # Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.runner.procmontap}.
"""
from twisted.python.usage import UsageError
from twisted.trial import unittest
from twisted.runner.procmon import ProcessMonitor
from twisted.runner import procmontap as tap
class ProcessMoni... | apache-2.0 |
skbkontur/Diamond | src/collectors/beanstalkd/beanstalkd.py | 57 | 2524 | # coding=utf-8
"""
Collects the following from beanstalkd:
- Server statistics via the 'stats' command
- Per tube statistics via the 'stats-tube' command
#### Dependencies
* beanstalkc
"""
import re
import diamond.collector
try:
import beanstalkc
except ImportError:
beanstalkc = None
class Bean... | mit |
liuliwork/django | django/db/models/fields/__init__.py | 38 | 93335 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import math
import uuid
import warnings
from base64 import b64decode, b64encode
from functools import total_ordering
from django import forms
from django.apps import apps
from django.conf impo... | bsd-3-clause |
varunarya10/tempest | tempest/api/identity/base.py | 9 | 10985 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
ity/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_zinc_compile_integration.py | 3 | 8817 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | apache-2.0 |
CentralLabFacilities/m3meka | python/scripts/demo/m3_demo_arm_a2r1.py | 2 | 13253 | #! /usr/bin/python
#Copyright 2008, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI... | mit |
Leila20/django | tests/serializers/test_yaml.py | 50 | 5754 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import importlib
import unittest
from django.core import management, serializers
from django.core.serializers.base import DeserializationError
from django.test import SimpleTestCase, TestCase, TransactionTestCase
from django.utils import six
from django.... | bsd-3-clause |
hazrpg/calibre | setup/installer/linux/freeze2.py | 3 | 18231 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
Setup ins... | gpl-3.0 |
Gravecorp/Gap | packages/IronPython.StdLib.2.7.3/content/Lib/os2emxpath.py | 192 | 4603 | # Module 'os2emxpath' -- common operations on OS/2 pathnames
"""Common pathname manipulations, OS/2 EMX version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
from genericpath import *
from ntpath import (expanduser, expandvars, isabs, islink, spli... | mpl-2.0 |
CanonicalLtd/subiquity | subiquity/common/types.py | 1 | 5252 | # Copyright 2020 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 |
was4444/chromium.src | third_party/tlslite/tlslite/verifierdb.py | 113 | 3405 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Class for storing SRP password verifiers."""
from .utils.cryptomath import *
from .utils.compat import *
from tlslite import mathtls
from .basedb import BaseDB
class VerifierDB(BaseDB):
"""This class represent an ... | bsd-3-clause |
MikeWinter/bio-data-repository | bdr/formats/simple/forms.py | 1 | 8092 | """
This module defines forms and formsets used to interact with formats of the
simple type.
"""
from django.core.exceptions import ValidationError
from django.forms import Form, ModelForm, CharField, BooleanField, HiddenInput
from django.forms.formsets import BaseFormSet, TOTAL_FORM_COUNT
from ...forms import ComboT... | gpl-2.0 |
hoangt/tpzsimul.gem5 | ext/ply/example/BASIC/basinterp.py | 166 | 17284 | # This file provides the runtime support for running a basic program
# Assumes the program has been parsed using basparse.py
import sys
import math
import random
class BasicInterpreter:
# Initialize the interpreter. prog is a dictionary
# containing (line,statement) mappings
def __init__(self,prog):
... | bsd-3-clause |
hakhundov/sppyqt | sppyqt.py | 5 | 5966 | #!/usr/bin/env python
# Copyright (C) 2011 by Eka A. Kurniawan
# eka.a.kurniawan(ta)gmail(tod)com
#
# 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 of the License.
#
# This... | gpl-2.0 |
kristianeschenburg/parcellearning | parcellearning/gcn/gcn.py | 1 | 2709 | import dgl
from dgl.data import DGLDataset
from dgl import data
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import dgl.function as fn
from dgl.nn.pytorch import edge_softmax, GraphConv
gcn_msg = fn.copy_src(src='h', out='m')
gcn_reduce = fn.sum(msg='m', out='h')
c... | mit |
hasgeek/funnel | tests/unit/models/test_auth_client_AuthClientUserPermissions.py | 1 | 4227 | import funnel.models as models
from .test_db import TestDatabaseFixture
class TestUserClientPermissions(TestDatabaseFixture):
def test_userclientpermissions(self):
"""Test for verifying creation of UserClientPermissions instance."""
gustav = models.User(username='gustav')
auth_client = se... | agpl-3.0 |
cysnake4713/odoo | addons/account_analytic_analysis/__init__.py | 425 | 1107 | # -*- 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... | agpl-3.0 |
DecipherOne/Troglodyte | Trog Build Dependencies/Python26/Lib/aifc.py | 2 | 33188 | """Stuff to parse AIFF-C and AIFF files.
Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.
An AIFF-C file has the following structure.
+-----------------+
| FORM |
+-----------------+
| <size> |
+----+------------+
| | AIFC ... | mit |
ricardosasilva/pagseguro-python | pagseguro/api/v2/payment.py | 1 | 14023 | # -*- coding: utf-8 -*-
from pagseguro.api.base_payment import BasePaymentRequest
from pagseguro.api.v2 import settings, settings_sandbox
from pagseguro.api.v2.schemas import item_schema, client_schema, shipping_schema
from pagseguro.exceptions import PagSeguroApiException, \
PagSeguroPaymentException
from pagsegur... | apache-2.0 |
edgarli/proj8 | env/lib/python3.4/site-packages/simplejson/tests/test_namedtuple.py | 147 | 4004 | from __future__ import absolute_import
import unittest
import simplejson as json
from simplejson.compat import StringIO
try:
from collections import namedtuple
except ImportError:
class Value(tuple):
def __new__(cls, *args):
return tuple.__new__(cls, args)
def _asdict(self):
... | artistic-2.0 |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/staging/models/rough/nmt/utils/misc_utils.py | 13 | 4215 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
jean/sentry | src/sentry/web/frontend/debug/debug_mfa_added_email.py | 5 | 1031 | from __future__ import absolute_import, print_function
import datetime
from django.views.generic import View
from sentry.models import Authenticator
from sentry.security.emails import generate_security_email
from .mail import MailPreview
class DebugMfaAddedEmailView(View):
def get(self, request):
auth... | bsd-3-clause |
tbutter/zulip | zerver/management/commands/create_stream.py | 115 | 1107 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_create_stream
from zerver.models import Realm, get_realm
import sys
class Command(BaseCommand):
help = """Create a stream, and subscribe all active users (excluding bots).
This should be... | apache-2.0 |
TwigWorld/django-crispy-forms | crispy_forms/bootstrap.py | 17 | 13324 | from random import randint
from django.template import Context, Template
from django.template.loader import render_to_string
from django.template.defaultfilters import slugify
from .compatibility import text_type
from .layout import LayoutObject, Field, Div
from .utils import render_field, flatatt, TEMPLATE_PACK
c... | mit |
Eaglemania/ASS | pyglet/image/codecs/s3tc.py | 33 | 14101 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | gpl-2.0 |
sdaftuar/bitcoin | qa/rpc-tests/walletbackup.py | 85 | 7304 | #!/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.
"""
Exercise the wallet backup code. Ported from walletbackup.sh.
Test case is:
4 nodes. 1 2 and 3 send... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.