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 |
|---|---|---|---|---|---|
davidharrigan/django | django/db/models/fields/related.py | 38 | 67398 | from __future__ import unicode_literals
import warnings
from functools import partial
from django import forms
from django.apps import apps
from django.core import checks, exceptions
from django.db import connection, router
from django.db.backends import utils
from django.db.models.deletion import CASCADE, SET_DEFAUL... | bsd-3-clause |
nijinashok/sos | sos/plugins/xfs.py | 1 | 1029 | # This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | gpl-2.0 |
tswast/google-cloud-python | spanner/tests/unit/test_transaction.py | 2 | 21837 | # Copyright 2016 Google LLC 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 |
openstack/tacker | tacker/vnfm/infra_drivers/kubernetes/k8s/translate_outputs.py | 1 | 32158 | # 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 agreed to ... | apache-2.0 |
ylong/rocksdb | coverage/parse_gcov_output.py | 101 | 4208 | import optparse
import re
import sys
from optparse import OptionParser
# the gcov report follows certain pattern. Each file will have two lines
# of report, from which we can extract the file name, total lines and coverage
# percentage.
def parse_gcov_report(gcov_input):
per_file_coverage = {}
total_coverage ... | bsd-3-clause |
janhui/test_engine | dev/plugins/rasterise_polygons/ui_rasterisepolygons.py | 2 | 8490 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_rasterisepolygons.ui'
#
# Created: Thu Aug 23 12:08:36 2012
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_RasterisePolygons(object):
def se... | lgpl-2.1 |
wiki05/youtube-dl | youtube_dl/extractor/dhm.py | 30 | 2467 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
xpath_text,
parse_duration,
)
class DHMIE(InfoExtractor):
IE_DESC = 'Filmarchiv - Deutsches Historisches Museum'
_VALID_URL = r'https?://(?:www\.)?dhm\.de/filmarchiv/(?:[^/]+/)+(?P<id>[^/]+)'
_TESTS =... | unlicense |
migueldiascosta/pymatgen | pymatgen/symmetry/groups.py | 1 | 15273 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Defines SymmetryGroup parent class and PointGroup and SpaceGroup classes.
Shyue Ping Ong thanks Marc De Graef for his generous sharing of his
SpaceGroup da... | mit |
drsounds/mingus | mingus/containers/composition.py | 10 | 3367 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# mingus - Music theory Python package, composition module.
# Copyright (C) 2008-2009, Bart Spaans
#
# 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... | gpl-3.0 |
htzy/bigfour | lms/djangoapps/verify_student/migrations/0005_auto__add_incoursereverificationconfiguration.py | 92 | 9300 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'InCourseReverificationConfiguration'
db.create_table('ver... | agpl-3.0 |
mclaughlin6464/pylearn2 | pylearn2/distributions/uniform_hypersphere.py | 49 | 2116 | """
.. todo::
WRITEME
"""
uthors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as N
import theano.tensor as T
from theano import config
... | bsd-3-clause |
archen/django | django/core/servers/basehttp.py | 30 | 5958 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... | bsd-3-clause |
bowlofstew/zulip | zerver/views/webhooks.py | 102 | 42964 | # Webhooks for external integrations.
from __future__ import absolute_import
from django.conf import settings
from zerver.models import UserProfile, get_client, get_user_profile_by_email
from zerver.lib.actions import check_send_message
from zerver.lib.notifications import convert_html_to_markdown
from zerver.lib.re... | apache-2.0 |
marcoarruda/MissionPlanner | Lib/uuid.py | 55 | 21655 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uu... | gpl-3.0 |
lz1988/django-web | build/lib/django/conf/project_template/project_name/settings.py | 39 | 5352 | # Django settings for {{ project_name }} project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '',... | apache-2.0 |
repotvsupertuga/tvsupertuga.repository | plugin.video.loganaddon/resources/lib/libraries/f4mproxy/flvlib/tags.py | 99 | 11473 | import os
import struct
import logging
from primitives import *
from constants import *
from astypes import MalformedFLV
from astypes import get_script_data_variable, make_script_data_variable
log = logging.getLogger('flvlib.tags')
STRICT_PARSING = False
def strict_parser():
return globals()['STRICT_PARSING']
... | gpl-2.0 |
manuvarkey/cmbautomiser | cmbautomiser/openpyxl/worksheet/pagebreak.py | 1 | 1664 | from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Integer,
Bool,
Sequence,
)
class Break(Serialisable):
tagname = "brk"
id = Integer(allow_none=True)
min = Integer(allow_non... | gpl-3.0 |
iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/amd64-linux/lib/python2.4/urllib.py | 6 | 50167 | """Open an arbitrary URL.
See the following document for more info on URLs:
"Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html
See also the HTTP spec (from which the error codes are derived):
"HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/Protocols... | gpl-2.0 |
zhouzhenghui/python-for-android | python-modules/twisted/twisted/news/database.py | 49 | 33743 | # -*- test-case-name: twisted.news.test -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
News server backend implementations.
"""
import getpass, pickle, time, socket
import os
import StringIO
from email.Message import Message
from email.Generator import Generator
from zope.in... | apache-2.0 |
richardcs/ansible | lib/ansible/modules/network/asa/asa_config.py | 20 | 11223 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],... | gpl-3.0 |
rahul67/hue | desktop/core/ext-py/ndg_httpsclient-0.4.0/ndg/httpsclient/urllib2_build_opener.py | 76 | 2689 | """urllib2 style build opener integrates with HTTPSConnection class from this
package.
"""
__author__ = "P J Kershaw"
__date__ = "21/12/10"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revis... | apache-2.0 |
chipaca/snapcraft | tests/unit/project/test_schema.py | 2 | 45979 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2021 Canonical Ltd
#
# 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 Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
kanagasabapathi/python-for-android | python-modules/zope/zope/interface/ro.py | 50 | 2171 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | apache-2.0 |
massimo-nocentini/competitive-programming | UVa/11173.py | 1 | 2448 |
# ../python-libs/inpututils.py:
import fileinput
from contextlib import contextmanager
@contextmanager
def line_bind(line, *ctors, splitter=lambda l: l.split(' '), do=None):
'''
Split `line` argument producing an iterable of mapped elements, in the sense of `ctors`.
Keyword argument `splitter` splits th... | mit |
mbauskar/omnitech-erpnext | erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py | 75 | 3544 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
def execute(filters=None):
columns = get_columns(filters)
consumed_details = get_cons... | agpl-3.0 |
PaulSec/SPIPScan | spipscan.py | 4 | 16919 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import sys
import requests
import re
from bs4 import BeautifulSoup
major_version = 0
intermediary_version = 0
minor_version = 0
folder_plugins = None
folder_themes = None
plugins = {}
# Detect the version of a SPIP install
# Version is in the header (f... | mit |
barbarubra/Don-t-know-What-i-m-doing. | python/src/Demo/threads/telnet.py | 47 | 3077 | # Minimal interface to the Internet telnet protocol.
#
# *** modified to use threads ***
#
# It refuses all telnet options and does not recognize any of the other
# telnet commands, but can still be used to connect in line-by-line mode.
# It's also useful to play with a number of other services,
# like time, finger, sm... | apache-2.0 |
rjschof/gem5 | tests/configs/memtest-filter.py | 15 | 3209 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
guewen/OpenUpgrade | addons/account/wizard/account_reconcile.py | 40 | 7536 | # -*- 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 |
pasiegel/SickGear | lib/unidecode/x08f.py | 252 | 4651 | data = (
'Er ', # 0x00
'Qiong ', # 0x01
'Ju ', # 0x02
'Jiao ', # 0x03
'Guang ', # 0x04
'Lu ', # 0x05
'Kai ', # 0x06
'Quan ', # 0x07
'Zhou ', # 0x08
'Zai ', # 0x09
'Zhi ', # 0x0a
'She ', # 0x0b
'Liang ', # 0x0c
'Yu ', # 0x0d
'Shao ', # 0x0e
'You ', # 0x0f
'Huan ', # 0x1... | gpl-3.0 |
alphafoobar/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/tests/test_measure.py | 94 | 8799 | """
Distance and Area objects to allow for sensible and convienient calculation
and conversions. Here are some tests.
"""
from django.contrib.gis.measure import Distance, Area, D, A
from django.utils import unittest
class DistanceTest(unittest.TestCase):
"Testing the Distance object"
def testInit(self):
... | apache-2.0 |
GRArmstrong/invenio-inspire-ops | modules/websubmit/lib/wsm_pyexiv2_plugin.py | 35 | 13329 | ## This file is part of Invenio.
## Copyright (C) 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
... | gpl-2.0 |
pavelchristof/gomoku-ai | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sinh_arcsinh_test.py | 16 | 7215 | # Copyright 2017 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 |
annacarol/Recursos-NFE-em-Python | nfe/pysped/nfe/manual_500/cancnfe_evento.py | 2 | 13095 | # -*- coding: utf-8 -*-
from nfe.pysped.xml_sped import *
from nfe.pysped.nfe.manual_500 import ESQUEMA_ATUAL
import os
DIRNAME = os.path.dirname(__file__)
class InfEventoEnviado(XMLNFe):
def __init__(self):
super(InfEventoEnviado, self).__init__()
self.Id = TagCaracter(nome=u'infEvento', co... | lgpl-2.1 |
freedomtan/tensorflow | tensorflow/python/estimator/canned/metric_keys.py | 41 | 1303 | # Copyright 2018 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 |
libos-nuse/net-next-nuse | scripts/gdb/linux/proc.py | 265 | 5905 | #
# gdb helper commands and functions for Linux kernel debugging
#
# Kernel proc information reader
#
# Copyright (c) 2016 Linaro Ltd
#
# Authors:
# Kieran Bingham <kieran.bingham@linaro.org>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import constants
from linux impor... | gpl-2.0 |
jorge2703/scikit-learn | examples/classification/plot_classification_probability.py | 242 | 2624 | """
===============================
Plot classification probability
===============================
Plot the classification probability for different classifiers. We use a 3
class dataset, and we classify it with a Support Vector classifier, L1
and L2 penalized logistic regression with either a One-Vs-Rest or multinom... | bsd-3-clause |
dongwoooo/project_flask | lib/werkzeug/debug/console.py | 314 | 5557 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import sys
import code
from types import CodeType
from werkzeug.utils import escape
from werkzeug.loca... | apache-2.0 |
alexbruy/QGIS | python/plugins/processing/algs/lidar/lastools/hugeFileClassify.py | 3 | 6598 | # -*- coding: utf-8 -*-
"""
***************************************************************************
hugeFileClassify.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
**************... | gpl-2.0 |
mstriemer/zamboni | lib/metrics/__init__.py | 18 | 1413 | import threading
from django.conf import settings
import commonware.log
from mkt.monolith.models import record_stat
log = commonware.log.getLogger('z.metrics')
def record_action(action, request, data=None):
"""Records the given action by sending it to the metrics servers.
Currently this is storing the d... | bsd-3-clause |
myles-archive/asgard-calendar | setup.py | 2 | 2155 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
from setuptools import setup, find_packages
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
def read(*path):
return open(os.path.join(os.path.abspath(os.path.dirname(__file__)), *path)).read()
... | bsd-3-clause |
yqm/sl4a | python/src/Lib/encodings/base64_codec.py | 528 | 2338 | """ Python 'base64_codec' Codec - base64 content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, base64
### Codec APIs
def base64_encode(i... | apache-2.0 |
protonyx/labtronyx | labtronyx/common/server.py | 1 | 5656 | """
Labtronyx Flask app factory
Call `create_server` to get a flask app
"""
__author__ = 'kkennedy'
import json
import logging
from flask import Flask, Blueprint, request, current_app, abort, Response
from .errors import *
from . import jsonrpc
api_blueprint = Blueprint('api', __name__)
rpc_blueprint = Blueprint(... | mit |
doismellburning/edx-platform | lms/djangoapps/mobile_api/video_outlines/serializers.py | 97 | 8891 | """
Serializer for video outline
"""
from rest_framework.reverse import reverse
from xmodule.modulestore.mongo.base import BLOCK_TYPES_WITH_CHILDREN
from xmodule.modulestore.django import modulestore
from courseware.access import has_access
from courseware.courses import get_course_by_id
from courseware.model_data imp... | agpl-3.0 |
harmy/kbengine | kbe/src/lib/python/Lib/importlib/test/source/test_source_encoding.py | 51 | 3917 | from importlib import _bootstrap
from . import util as source_util
import codecs
import re
import sys
# Because sys.path gets essentially blanked, need to have unicodedata already
# imported for the parser to use.
import unicodedata
import unittest
CODING_RE = re.compile(r'coding[:=]\s*([-\w.]+)')
class EncodingTe... | lgpl-3.0 |
tgsmith61591/pyramid | pmdarima/model_selection/_validation.py | 1 | 13410 | # -*- coding: utf-8 -*-
"""
Cross-validation for ARIMA and pipeline estimators.
See: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/model_selection/_validation.py
""" # noqa: E501
import numpy as np
import numbers
import warnings
import time
from traceback import format_exception_only
from sklearn ... | mit |
tinypony/ChargePlan | project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | gpl-2.0 |
80vs90/django-allauth | allauth/account/urls.py | 36 | 1362 | from django.conf.urls import patterns, url
from django.views.generic import RedirectView
from . import views
urlpatterns = patterns(
"",
url(r"^signup/$", views.signup, name="account_signup"),
url(r"^login/$", views.login, name="account_login"),
url(r"^logout/$", views.logout, name="account_logout"),
... | mit |
pheanex/xpython | exercises/alphametics/alphametics_test.py | 1 | 1848 | import unittest
from alphametics import solve
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
class TestAlphametics(unittest.TestCase):
def test_puzzle_with_03_letters(self):
self.assertEqual(solve("I + BB == ILL"), {"I": 1, "B": 9, "L": 0})
def test_invalid_solution_mus... | mit |
jayvdb/coala | tests/core/ProjectBearTest.py | 1 | 7234 | from concurrent.futures import ThreadPoolExecutor
from unittest.mock import ANY, patch
from coalib.core.ProjectBear import ProjectBear
from coalib.settings.Section import Section
from tests.core.CoreTestBase import CoreTestBase
class TestProjectBear(ProjectBear):
def analyze(self, files):
yield '\n'.jo... | agpl-3.0 |
dgyuri92/oauth_app | oauth_app/application/oauth2_utils.py | 1 | 7112 | """
oauth_app : An extendable REST API authorization connector for OAuth2 providers
oauth2_utils : OAuth2 utility library that encapsulates the 3-legged OAuth2 workflow
and implements OAuth2 provider factory for client applications
Copyright (C) Gyorgy Demarcsek, 2016
"""
import hmac
import hashlib
... | mit |
kokushozero/mifsaDBProject | web2py/applications/mifsa/models/db.py | 2 | 11233 | # -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################
... | gpl-2.0 |
babelsberg/babelsberg-r | tests/jit/test_array.py | 2 | 2452 | from .base import BaseJITTest
class TestArray(BaseJITTest):
def test_subscript_assign_simple(self, topaz, tmpdir):
traces = self.run(topaz, tmpdir, """
arr = [false]
10000.times { arr[0] = true }
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p2, p4, p5,... | bsd-3-clause |
maestrano/openerp | openerp/addons/base/ir/ir_values.py | 23 | 25172 | # -*- 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 GNU... | agpl-3.0 |
kartikm/yokadi | yokadi/yical/icalutils.py | 1 | 1272 | # coding:utf-8
"""
Ical utils functions
@author: Sébastien Renard <Sebastien.Renard@digitalfox.org>
@license: GPL v3 or later
"""
import icalendar
def convertIcalType(attr):
"""Convert data from icalendar types (vDates, vInt etc.) to python standard equivalent
@param attr: icalendar type
@return: python ... | gpl-3.0 |
hehongliang/tensorflow | tensorflow/python/client/session_list_devices_test.py | 34 | 3585 | # 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 |
Work4Labs/lettuce | tests/integration/lib/Django-1.3/django/db/models/manager.py | 306 | 7872 | from django.utils import copycompat as copy
from django.conf import settings
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, ... | gpl-3.0 |
noba3/KoTos | addons/plugin.video.mega/resources/lib/platform_libraries/Windows/64bit/Crypto/PublicKey/ElGamal.py | 228 | 3947 | #
# ElGamal.py : ElGamal encryption/decryption and signatures
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warrant... | gpl-2.0 |
ycool/apollo | modules/tools/create_map/convert_map_txt2bin.py | 3 | 1775 | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 ... | apache-2.0 |
Shekharrajak/pydy | examples/Kane1985/Chapter5/Ex9.3.py | 7 | 3584 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exercise 9.3 from Kane 1985."""
from __future__ import division
from sympy import cos, expand, pi, solve, symbols
from sympy.physics.mechanics import ReferenceFrame, Point
from sympy.physics.mechanics import dot, dynamicsymbols
from util import msprint, subs, partial_ve... | bsd-3-clause |
jjangsangy/neuralpoet | neuralpoet/textrank.py | 1 | 9330 | # -*- coding: utf8 -*-
from __future__ import print_function
import re
import eatiht
import requests
from breadability.readable import Article
from requests import Request, Session
from requests.adapters import HTTPAdapter
from six.moves import urllib
from sumy.models.dom import ObjectDocumentModel, Paragraph, Senten... | apache-2.0 |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.py | 56 | 26248 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from pip._vendor.six.moves import urllib_parse as urlparse
from . import base
from ..constants import namespaces, prefixes
__all__ = ["Filter"]
allowed_elements = frozenset((
(namespaces[... | apache-2.0 |
dhermes/gcloud-python | iot/google/cloud/iot_v1/gapic/transports/device_manager_grpc_transport.py | 2 | 13115 | # -*- coding: utf-8 -*-
#
# Copyright 2018 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... | apache-2.0 |
vlegoff/tsunami | src/primaires/perso/membre.py | 1 | 7207 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | bsd-3-clause |
molotof/infernal-twin | build/reportlab/build/lib.linux-i686-2.7/reportlab/lib/pdfencrypt.py | 29 | 23984 | #copyright ReportLab Europe Limited. 2000-2012
#see license.txt for license details
__version__=''' $Id$ '''
"""helpers for pdf encryption/decryption"""
import sys, os, tempfile
from reportlab.lib.utils import getBytesIO, md5, asBytes, int2Byte, char2int, rawUnicode, rawBytes, isPy3
from reportlab.pdfgen.canvas import... | gpl-3.0 |
hendradarwin/VTK | ThirdParty/Twisted/twisted/python/win32.py | 36 | 5436 | # -*- test-case-name: twisted.python.test.test_win32 -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Win32 utilities.
See also twisted.python.shortcut.
@var O_BINARY: the 'binary' mode flag on Windows, or 0 on other platforms, so it
may safely be OR'ed into a mask for os.open.
"""... | bsd-3-clause |
EDUlib/edx-ora2 | openassessment/assessment/errors/peer.py | 7 | 1113 | """
Errors for the peer assessment.
"""
class PeerAssessmentError(Exception):
"""Generic Peer Assessment Error
Raised when an error occurs while processing a request related to the
Peer Assessment Workflow.
"""
pass
class PeerAssessmentRequestError(PeerAssessmentError):
"""Error indicating... | agpl-3.0 |
adalke/rdkit | rdkit/Dbase/DbResultSet.py | 1 | 6090 | #
# Copyright (C) 2003 Greg Landrum and Rational Discovery LLC
#
""" defines class _DbResultSet_ for lazy interactions with Db query results
**Note**
this uses the Python iterator interface, so you'll need python 2.2 or above.
"""
from __future__ import print_function
import sys
from rdkit.Dbase import DbInfo
c... | bsd-3-clause |
android-ia/platform_tools_idea | plugins/hg4idea/resources/python/prompthooks.py | 5 | 7197 | #!/usr/bin/env python
#Mercurial extension to robustly integrate prompts with other processes
#Copyright (C) 2010-2011 Willem Verstraeten
#
#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 v... | apache-2.0 |
infobeisel/mbnwcModSys | ID_scenes.py | 1 | 2619 | scn_ow_scene_1 = 0
scn_ow_scene_2 = 1
scn_ow_scene_3 = 2
scn_ow_scene_4 = 3
scn_ow_multiplayer_scenes_end = 4
scn_random_scene = 5
scn_conversation_scene = 6
scn_water = 7
scn_random_scene_steppe = 8
scn_random_scene_plain = 9
scn_random_scene_snow = 10
scn_random_scene_desert = 11
scn_random_scene_steppe_forest = 12
s... | bsd-2-clause |
prakxys/flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py | 1730 | 2746 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... | apache-2.0 |
HyperBaton/ansible | lib/ansible/modules/network/voss/voss_facts.py | 38 | 16124 | #!/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 |
Clever/Diamond | src/collectors/puppetdashboard/test/testpuppetdashboard.py | 31 | 1952 | #!/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 puppetdashboard impor... | mit |
WillisXChen/django-oscar | src/oscar/apps/customer/utils.py | 18 | 4652 | import logging
from django.conf import settings
from django.contrib.auth.tokens import default_token_generator
from django.core.mail import EmailMessage, EmailMultiAlternatives
from django.core.urlresolvers import reverse
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode... | bsd-3-clause |
KillerByte/memoryminer | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
waheedahmed/edx-platform | lms/djangoapps/lti_provider/migrations/0001_initial.py | 50 | 3142 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import provider.utils
from django.conf import settings
import xmodule_django.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | agpl-3.0 |
kjung/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 50 | 2733 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | bsd-3-clause |
nugget/home-assistant | homeassistant/components/zwave/node_entity.py | 12 | 9057 | """Entity class that represents Z-Wave node."""
import logging
from homeassistant.core import callback
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_WAKEUP, ATTR_ENTITY_ID
from homeassistant.helpers.entity import Entity
from .const import (
ATTR_NODE_ID, COMMAND_CLASS_WAKE_UP, ATTR_SCENE_ID, ATTR_SCENE... | apache-2.0 |
coursemdetw/2014cdb | wsgi/static/Brython2.1.3-20140704-213726/Lib/external_import.py | 742 | 2985 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
self._module=... | gpl-2.0 |
pythononwheels/pow_clean | start/models/sql/basemodel.py | 1 | 12868 |
from sqlalchemy import Column, Integer, String, DateTime, Float
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.sql.expression import func
from {{appname}}.database.sqldblib import engine,session
from {{appname}}.powlib import pluralize
import datetime
from sqlalchemy import orm
import sqlalchemy... | mit |
WinterNis/sqlalchemy | lib/sqlalchemy/orm/dependency.py | 70 | 46073 | # orm/dependency.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Relationship dependencies.
"""
from .. import sql, util, exc as sa_exc
from .... | mit |
dkriegner/xrayutilities | lib/xrayutilities/analysis/__init__.py | 1 | 1499 | # This file is part of xrayutilities.
#
# xrayutilities is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed... | gpl-2.0 |
jruiperezv/ANALYSE | lms/djangoapps/certificates/migrations/0008_auto__del_revokedcertificate__del_field_generatedcertificate_name__add.py | 188 | 11649 | # -*- 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):
# Deleting model 'RevokedCertificate'
db.delete_table('certificates_revokedcertificate')
# Deleting... | agpl-3.0 |
ahu-odoo/odoo | openerp/addons/base/module/wizard/base_import_language.py | 337 | 2644 | # -*- 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 |
insidenothing/3D-Printing-Software | skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/meta_plugins/description.py | 12 | 1699 | """
This page is in the table of contents.
Description is a script to store a description of the profile.
==Settings==
===Description Text===
Default is 'Write your profile description here.'
The suggested format is a description, followed by a link to a profile post or web page.
==Example==
Example of using descrip... | gpl-2.0 |
aciddude/Feathercoin | qa/rpc-tests/skeleton.py | 148 | 2426 | #!/usr/bin/env python
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Skeleton for python-based regression tests using
# JSON-RPC
# Add python-bitcoinrpc to module search pa... | mit |
bwasti/caffe2 | caffe2/distributed/store_ops_test_util.py | 1 | 2098 | ## @package store_ops_test_util
# Module caffe2.distributed.store_ops_test_util
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from multiprocessing import Process, Queue
import numpy as np
from caffe2.python import ... | apache-2.0 |
CredoReference/edx-platform | common/test/acceptance/tests/studio/test_studio_textbooks.py | 9 | 3412 | """
Acceptance tests for Studio related to the textbooks.
"""
from nose.plugins.attrib import attr
from common.test.acceptance.pages.lms.textbook_view import TextbookViewPage
from common.test.acceptance.pages.studio.textbook_upload import TextbookUploadPage
from common.test.acceptance.tests.helpers import disable_anim... | agpl-3.0 |
salamer/django | django/test/client.py | 81 | 26687 | from __future__ import unicode_literals
import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import ... | bsd-3-clause |
tsufiev/horizon | horizon/base.py | 7 | 36709 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
quantumlib/OpenFermion-Cirq | openfermioncirq/variational/hamiltonian_objective_test.py | 1 | 3396 | # 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
# distribu... | apache-2.0 |
duqiao/django | django/template/loaders/cached.py | 313 | 5760 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
import hashlib
import warnings
from django.template import Origin, Template, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from django.... | bsd-3-clause |
zaxliu/scipy | scipy/ndimage/__init__.py | 81 | 4905 | """
=========================================================
Multi-dimensional image processing (:mod:`scipy.ndimage`)
=========================================================
.. currentmodule:: scipy.ndimage
This package contains various functions for multi-dimensional image
processing.
Filters
=======
.. autos... | bsd-3-clause |
hcarvalhoalves/duplicity | duplicity/statistics.py | 10 | 12578 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 |
balloob/home-assistant | homeassistant/components/ps4/config_flow.py | 5 | 6931 | """Config Flow for PlayStation 4."""
from collections import OrderedDict
from pyps4_2ndscreen.errors import CredentialTimeout
from pyps4_2ndscreen.helpers import Helper
from pyps4_2ndscreen.media_art import COUNTRIES
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
... | apache-2.0 |
fjorba/invenio | modules/bibindex/lib/bibindex_engine.py | 1 | 80458 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either ve... | gpl-2.0 |
jergosh/slr_pipeline | bin/calc_aln_dists.py | 1 | 6041 | import glob
import argparse
from os import path
from Bio import SeqIO
from Bio import AlignIO
import dendropy
import pandas
import numpy as np
np.set_printoptions(threshold=np.nan)
import bpp
from phylo_utils import likelihood
from phylo_utils import models
from phylo_utils import markov
from phylo_utils.seq_to_part... | gpl-2.0 |
project-ncl/pnc-cli | pnc_cli/swagger_client/models/build_config_set_record_rest.py | 1 | 11447 | # coding: utf-8
"""
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from datetime import datetime
from pprint import pformat
from six import iterit... | apache-2.0 |
LangmuirSim/langmuir | LangmuirPython/plot/plotRDF.py | 2 | 7329 | # -*- coding: utf-8 -*-
"""
@author: adam
"""
import matplotlib.pyplot as plt
import langmuir as lm
import numpy as np
import argparse
import os
desc = """
Plot output from rdf.py
"""
def get_arguments(args=None):
parser = argparse.ArgumentParser()
parser.description = desc
parser.add_argument(dest='ifil... | gpl-2.0 |
Daniel-CA/odoo | addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 34 | 14776 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Corrections & modifications by Noviat nv/sa, (http://www.noviat.be):
# - VAT listing based upon year... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.