repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
yongtang/tensorflow | tensorflow/python/training/monitored_session.py | 7 | 58340 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
mattsanf/legallydistinctpocketmonsters | node_modules/utf8/tests/generate-test-data.py | 1788 | 1435 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | gpl-3.0 |
marcuskelly/recover | Lib/site-packages/passlib/utils/decor.py | 5 | 7651 | """
passlib.utils.decor -- helper decorators & properties
"""
#=============================================================================
# imports
#=============================================================================
# core
from __future__ import absolute_import, division, print_function
import logging
log... | bsd-2-clause |
bendikro/deluge-yarss-plugin | yarss2/lib/requests/packages/urllib3/util/url.py | 553 | 5836 | from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value for
:func:`parse_url`.
"""
s... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/263_test_codecencodings_cn.py | 64 | 2054 | #!/usr/bin/env python
#
# test_codecencodings_cn.py
# Codec encoding tests for PRC encodings.
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'gb2312'
tstring = test_multibytec... | gpl-3.0 |
qskycolor/viewfinder | backend/logs/itunes_trends.py | 13 | 11557 | # Copyright 2012 Viewfinder Inc. All Rights Reserved
"""Interface to the iTunes Connect sales and trend.
Fetches daily download stats from iTunes Connect and saves them to the metrics table.
Specify the apple user to log in with (eg: --user=marc to use marc@emailscrubbed.com). We get the user's
apple password from the... | apache-2.0 |
sonnyhu/scikit-learn | examples/svm/plot_separating_hyperplane_unbalanced.py | 329 | 1850 | """
=================================================
SVM: Separating hyperplane for unbalanced classes
=================================================
Find the optimal separating hyperplane using an SVC for classes that
are unbalanced.
We first find the separating plane with a plain SVC and then plot
(dashed) the ... | bsd-3-clause |
fhaoquan/kbengine | kbe/res/scripts/common/Lib/test/test_json/test_dump.py | 109 | 1626 | from io import StringIO
from test.test_json import PyTest, CTest
from test.support import bigmemtest, _1G
class TestDump:
def test_dump(self):
sio = StringIO()
self.json.dump({}, sio)
self.assertEqual(sio.getvalue(), '{}')
def test_dumps(self):
self.assertEqual(self.dumps({}),... | lgpl-3.0 |
maloL/nao-fsm | tracking_and_storing.py | 1 | 11706 | # object tracking algorithm with trajectory points plotting on
# video stream window
# after taking 20 points it stores them in txt files
from naoqi import ALProxy, ALBroker, ALModule
import time
from vision_definitions import kVGA, kBGRColorSpace
import cv2 as opencv
import numpy as np
import random
from ghmm import ... | lgpl-3.0 |
ChanderG/scipy | doc/source/conf.py | 40 | 10928 | # -*- coding: utf-8 -*-
import sys, os, re
# Check Sphinx version
import sphinx
if sphinx.__version__ < "1.1":
raise RuntimeError("Sphinx 1.1 or newer required")
needs_sphinx = '1.1'
# -----------------------------------------------------------------------------
# General configuration
# -----------------------... | bsd-3-clause |
vperron/sentry | src/sentry/migrations/0006_auto.py | 36 | 3873 | # 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):
pass
def backwards(self, orm):
pass
models = {
'sentry.filtervalue': {
'Meta': {'uniq... | bsd-3-clause |
isazi/Transpose | analysis/manage.py | 1 | 2009 | #!/usr/bin/env python
# Copyright 2014 Alessio Sclocco <a.sclocco@vu.nl>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
defionscode/ansible-modules-core | commands/raw.py | 49 | 3161 | # this is a virtual module that is entirely implemented server side
# 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 op... | gpl-3.0 |
ojengwa/oh-mainline | vendor/packages/html5lib/html5lib/filters/formfiller.py | 135 | 5839 | #
# The goal is to finally have a form filler where you pass data for
# each form, using the algorithm for "Seeding a form with initial values"
# See http://www.whatwg.org/specs/web-forms/current-work/#seeding
#
import _base
from html5lib.constants import spaceCharacters
spaceCharacters = u"".join(spaceCharacters)
c... | agpl-3.0 |
Asuka52/jubatus | unittest_gtest.py | 3 | 175890 | #!/usr/bin/env python
# encoding: ISO8859-1
"""
Copyright (c)2011, Hideyuki Tanaka
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
... | lgpl-2.1 |
dpac-vlsi/SynchroTrace | src/python/m5/SimObject.py | 7 | 42060 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
sgzsh269/django | tests/auth_tests/test_auth_backends.py | 8 | 27450 | from __future__ import unicode_literals
from datetime import date
from django.contrib.auth import (
BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user, signals,
)
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import MD5PasswordHasher
from django.contrib.auth.models i... | bsd-3-clause |
abhishek-ch/hue | desktop/core/ext-py/lxml/src/lxml/html/_diffcommand.py | 36 | 2082 | import optparse
import sys
import re
import os
from lxml.html.diff import htmldiff
description = """\
"""
parser = optparse.OptionParser(
usage="%prog [OPTIONS] FILE1 FILE2\n"
"%prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...",
description=description,
)
parser.add_option(
'-o', '--output',... | apache-2.0 |
yushiro/svg-edit | extras/tojson.py | 48 | 1598 | import sys, json, codecs
infile = codecs.open(sys.argv[1], "r", "utf-8")
outfile = codecs.open(sys.argv[1][:-3], "w", "utf-8")
indata = infile.readlines()
look = False
out = "[\n"
js = []
jss = ""
def readfrompos(pos):
global out
global js
if (indata[pos].startswith("#, -x-svg-edit-title")) or (indata... | mit |
Emergen/zivios-agent | modules/ntp.py | 1 | 2447 | """
* Copyright (c) 2008 Zivios, LLC.
*
* This file is part of Zivios.
*
* Zivios 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 versio... | gpl-3.0 |
ancafarcas/superdesk-core | superdesk/datalayer.py | 1 | 4241 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import super... | agpl-3.0 |
chrisVdd/Time2web | vendor/sonata-project/exporter/docs/conf.py | 63 | 7898 | # -*- coding: utf-8 -*-
#
# IoC documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 29 01:43:00 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.
#
# All con... | mit |
SravanthiSinha/edx-platform | lms/djangoapps/support/tests/test_views.py | 70 | 3760 | """
Tests for support views.
"""
import ddt
from django.test import TestCase
from django.core.urlresolvers import reverse
from student.roles import GlobalStaff, SupportStaffRole
from student.tests.factories import UserFactory
class SupportViewTestCase(TestCase):
"""
Base class for support view tests.
""... | agpl-3.0 |
artdent/mingus-python3 | unittest/test_Note.py | 3 | 4184 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path += ['../']
from mingus.containers.Note import Note
import unittest
from mingus.containers.mt_exceptions import NoteFormatError
class test_Note(unittest.TestCase):
def setUp(self):
self.c = Note('C', 5)
self.c1 = Note('C')
self.... | gpl-3.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/json/tests/test_encode_basestring_ascii.py | 143 | 2004 | from collections import OrderedDict
from json.tests import PyTest, CTest
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uab... | gpl-2.0 |
dxwu/BinderFilter | resources/android-toolchain-16/lib/python2.7/wsgiref/util.py | 247 | 5576 | """Miscellaneous WSGI-related Utilities"""
import posixpath
__all__ = [
'FileWrapper', 'guess_scheme', 'application_uri', 'request_uri',
'shift_path_info', 'setup_testing_defaults',
]
class FileWrapper:
"""Wrapper to convert file-like objects to iterables"""
def __init__(self, filelike, blksize=819... | mit |
gatkin/declxml | tests/test_hooks_validation.py | 1 | 14857 | """Tests using hooks for validation"""
from collections import namedtuple
import pytest
import declxml as xml
from .helpers import strip_xml
_UserTuple = namedtuple('_UserTuple', [
'name',
'age',
])
class _UserClass(object):
def __init__(self, name=None, age=None):
self.name = name
se... | mit |
openaid-IATI/OIPA | OIPA/iati_synchroniser/tests/test_create_publisher_organisation.py | 1 | 1867 | import unittest
from django.test import TestCase
from iati.factory import iati_factory
from iati_organisation.models import Organisation
from iati_synchroniser.create_publisher_organisation import (
create_publisher_organisation
)
from iati_synchroniser.factory import synchroniser_factory
class CreatePublisherO... | agpl-3.0 |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/proxy_model_inheritance/tests.py | 50 | 1253 | """
XX. Proxy model inheritance
Proxy model inheritance across apps can result in syncdb not creating the table
for the proxied model (as described in #12286). This test creates two dummy
apps and calls syncdb, then verifies that the table has been created.
"""
import os
import sys
from django.conf import settings,... | gpl-3.0 |
ErykB2000/home-assistant | homeassistant/components/notify/pushover.py | 8 | 3132 | """
homeassistant.components.notify.pushover
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pushover platform for notify component.
Configuration:
To use the Pushover notifier you will need to add something like the following
to your config/configuration.yaml
notify:
platform: pushover
api_key: ABCDEFGHJKLMNOPQRS... | mit |
sergiocorato/account-invoicing | account_invoice_merge_payment/__openerp__.py | 12 | 1535 | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of account_invoice_merge_payment,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# account_invoice_merge_payment is free software:
# you can redi... | agpl-3.0 |
40223119/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/colordict.py | 621 | 24077 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | agpl-3.0 |
andykimpe/chromium-test-npapi | android_webview/tools/webview_licenses.py | 17 | 13334 | #!/usr/bin/python
# Copyright (c) 2012 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.
"""Checks third-party licenses for the purposes of the Android WebView build.
The Android tree includes a snapshot of Chromium in orde... | bsd-3-clause |
AusTac/parma | b3/parsers/et.py | 1 | 7934 | # BigBrotherBot(B3) (www.bigbrotherbot.net)
# Copyright (C) 2005 Michael "ThorN" Thornton
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option... | gpl-2.0 |
symoro/symoro | symoroutils/filemgr.py | 3 | 2549 | # -*- coding: utf-8 -*-
# This file is part of the OpenSYMORO project. Please see
# https://github.com/symoro/symoro/blob/master/LICENCE for the licence.
"""Perform file management operations for the SYMORO package."""
import os
SYMORO_ROBOTS_FOLDER = "symoro-robots"
def get_base_path(base_folder=SYMORO_ROBOT... | mit |
sarvex/tensorflow | tensorflow/lite/python/convert_phase.py | 6 | 7967 | # Lint as: python2, python3
# Copyright 2021 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
#
... | apache-2.0 |
seanli9jan/tensorflow | tensorflow/contrib/learn/python/learn/estimators/state_saving_rnn_estimator_test.py | 19 | 24449 | # 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 |
basicthinker/ThyNVM | src/arch/sparc/SparcSystem.py | 69 | 3713 | # Copyright (c) 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 list ... | bsd-3-clause |
skakri/django-unstructured | wiki/core/permissions.py | 1 | 3004 | from wiki.conf import settings
###############################
# TARGET PERMISSION HANDLING #
###############################
#
# All functions are:
# can_something(target, user)
# => True/False
#
# All functions can be replaced by pointing their relevant
# settings variable in wiki.conf.settings to a callable(... | gpl-3.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/pygments/styles/autumn.py | 364 | 2144 | # -*- coding: utf-8 -*-
"""
pygments.styles.autumn
~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.to... | gpl-3.0 |
ansible/ansible-modules-extras | cloud/amazon/s3_logging.py | 48 | 5856 | #!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
Yannig/ansible | lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py | 25 | 13992 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
vipul-sharma20/oh-mainline | vendor/packages/twisted/twisted/conch/checkers.py | 18 | 9828 | # -*- test-case-name: twisted.conch.test.test_checkers -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Provide L{ICredentialsChecker} implementations to be used in Conch protocols.
"""
import os, base64, binascii, errno
try:
import pwd
except ImportError:
pwd = None
else:
i... | agpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/setuptools/depends.py | 462 | 6370 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... | mit |
Allow2CEO/browser-ios | brave/node_modules/ad-block/vendor/depot_tools/win_toolchain/package_from_installed.py | 9 | 12502 | # 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.
"""
From a system-installed copy of the toolchain, packages all the required bits
into a .zip file.
It assumes default install locations for tools, in parti... | mpl-2.0 |
andreaso/ansible | lib/ansible/modules/packaging/language/cpanm.py | 70 | 7024 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Franck Cuny <franck@lumberjaph.net>
#
# 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 L... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/compiler/ast.py | 206 | 37508 | """Python abstract syntax node definitions
This file is automatically generated by Tools/compiler/astgen.py
"""
from compiler.consts import CO_VARARGS, CO_VARKEYWORDS
def flatten(seq):
l = []
for elt in seq:
t = type(elt)
if t is tuple or t is list:
for elt2 in flatten(elt):
... | gpl-3.0 |
jamesyli/solum | solum/objects/sqlalchemy/migration/alembic_migrations/env.py | 7 | 2194 | # 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
# d... | apache-2.0 |
procangroup/edx-platform | common/test/acceptance/tests/video/test_studio_video_module.py | 11 | 12257 | # -*- coding: utf-8 -*-
"""
Acceptance tests for CMS Video Module.
"""
import os
from unittest import skipIf
from mock import patch
from nose.plugins.attrib import attr
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
from common.test.acceptance.pages.common.auto_auth import AutoAu... | agpl-3.0 |
geopython/QGIS | python/plugins/processing/algs/grass7/ext/r_li_padsd_ascii.py | 12 | 1538 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_padsd_ascii.py
-------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************... | gpl-2.0 |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/scipy/cluster/setup.py | 71 | 1216 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import sys
if sys.version_info[0] >= 3:
DEFINE_MACROS = [("SCIPY_PY3K", None)]
else:
DEFINE_MACROS = []
def configuration(parent_package='', top_path=None):
from numpy.distutils.system_info import get_info
from nu... | mit |
kustodian/ansible | test/units/parsing/test_metadata.py | 32 | 9992 | # coding: utf-8
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
wrouesnel/ansible | lib/ansible/module_utils/crypto.py | 70 | 4764 | # -*- coding: utf-8 -*-
#
# (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
#
# 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 |
topxiaoke/myedx | cms/djangoapps/models/settings/course_grading.py | 6 | 7865 | from datetime import timedelta
from xmodule.modulestore.django import modulestore
from xblock.fields import Scope
class CourseGradingModel(object):
"""
Basically a DAO and Model combo for CRUD operations pertaining to grading policy.
"""
# Within this class, allow access to protected members of client... | agpl-3.0 |
davekennewell/geonode | geonode/layers/views.py | 5 | 22258 | # -*- 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 |
h2educ/scikit-learn | sklearn/feature_extraction/image.py | 263 | 17600 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... | bsd-3-clause |
mobify/iterstuff | iterstuff/recipes.py | 1 | 4131 | from __future__ import absolute_import
from iterstuff.lookahead import Lookahead
def repeatable_takewhile(predicate, iterable):
"""
Return successive entries from an iterable as long as the
predicate evaluates to true for each entry.
Like itertools.takewhile, but does not consume the first
elemen... | mit |
mvpoland/django-smsgateway | smsgateway/views.py | 1 | 1834 | from django import forms
from django.http import Http404
from django.conf import settings
from django.shortcuts import render
from django.contrib.admin.views.decorators import staff_member_required
from smsgateway import send, __version__
from smsgateway.backends import get_backend
accounts = getattr(settings, 'SMSGA... | bsd-3-clause |
tarzan0820/odoo | addons/l10n_in_hr_payroll/__openerp__.py | 374 | 2622 | # -*- 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 the G... | agpl-3.0 |
wldcordeiro/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/set_sys_path.py | 496 | 1815 | # Copyright 2009, 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 of conditions and the f... | mpl-2.0 |
wcota/dynSIS-py | dynamics.py | 1 | 8344 | #!/usr/bin/env python
# ! ## File: dynamics.py
# ! ## See README.md for more information and use
# !-----------------------------------------------------------------------------
# ! SIS epidemic model algorithm based on the article
# ! Computer Physics Communications 219C (2017) pp. 303-312
# ! "Opt... | gpl-3.0 |
drewtalati/talaticoin | qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py | 305 | 5784 |
"""
Copyright 2011 Jeff Garzik
AuthServiceProxy has the following improvements over python-jsonrpc's
ServiceProxy class:
- HTTP connections persist for the life of the AuthServiceProxy object
(if server supports HTTP/1.1)
- sends protocol 'version', per JSON-RPC 1.1
- sends proper, incrementing 'id'
... | mit |
NMTHydro/Recharge | utils/TAW_optimization_subroutine/create_geo_info_file.py | 1 | 2526 | # ===============================================================================
# Copyright 2018 gabe-parrish
#
# 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/licen... | apache-2.0 |
odoocn/odoomrp-wip | product_secondary_unit/__openerp__.py | 27 | 1577 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
demoforwork/public | SelfServiceProvisioning/lib/oauth2client/contrib/keyring_storage.py | 39 | 3091 | # Copyright 2014 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 ... | apache-2.0 |
Gillingham/evething | thing/models/blueprintcomponent.py | 2 | 2118 | # ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# 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... | bsd-2-clause |
qwertyjune/BethSaidaBible | venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py | 33 | 23719 | """
MySQL database backend for Django.
Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/
MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Datab... | gpl-3.0 |
chiefspace/udemy-rest-api | udemy_rest_api_section5/code/env/lib/python3.4/site-packages/jinja2/_compat.py | 214 | 2596 | # -*- coding: utf-8 -*-
"""
jinja2._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: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | gpl-2.0 |
andriibekker/biddingsbase | django/contrib/flatpages/views.py | 295 | 2613 | from django.contrib.flatpages.models import FlatPage
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from django.utils.safestri... | bsd-3-clause |
gurneyalex/odoo | addons/mrp/wizard/mrp_product_produce.py | 3 | 8943 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_compare
class MrpProductProduce(models.TransientModel):
_name = "mrp.product... | agpl-3.0 |
puttarajubr/commcare-hq | corehq/apps/reports/tests/test_pillows_xforms.py | 2 | 15578 | import copy
from django.test import TestCase
from django.conf import settings
from corehq.apps.api.es import report_term_filter
from corehq.pillows.base import restore_property_dict, VALUE_TAG
from corehq.pillows.mappings.reportxform_mapping import REPORT_XFORM_MAPPING
from corehq.pillows.reportxform import ReportXFor... | bsd-3-clause |
acbodine/koding | go/src/vendor/github.com/caglar10ur/lxc/src/python-lxc/setup.py | 15 | 2493 | #!/usr/bin/env python3
#
# python-lxc: Python bindings for LXC
#
# (C) Copyright Canonical Ltd. 2012
#
# Authors:
# Stéphane Graber <stgraber@ubuntu.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Soft... | agpl-3.0 |
watspidererik/testenv | flask/lib/python2.7/site-packages/coverage/collector.py | 209 | 13412 | """Raw data collector for Coverage."""
import os, sys, threading
try:
# Use the C extension code when we can, for speed.
from coverage.tracer import CTracer # pylint: disable=F0401,E0611
except ImportError:
# Couldn't import the C extension, maybe it isn't built.
if os.getenv('COVERAGE_TEST_TR... | mit |
makinacorpus/reportlab-ecomobile | src/reportlab/graphics/charts/doughnut.py | 1 | 13260 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/doughnut.py
# doughnut chart
__version__=''' $Id$ '''
__doc__="""Doughnut chart
Produces a circular chart like the doughnut charts pr... | bsd-3-clause |
sarvex/django | django/views/i18n.py | 264 | 12156 | import gettext as gettext_module
import importlib
import json
import os
from django import http
from django.apps import apps
from django.conf import settings
from django.core.urlresolvers import translate_url
from django.template import Context, Engine
from django.utils import six
from django.utils._os import upath
fr... | bsd-3-clause |
jsomara/tuskar-ui-sat6 | doc/source/conf.py | 3 | 7947 | # -*- coding: utf-8 -*-
#
# Tuskar UI documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 24 09:19:32 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... | apache-2.0 |
AkizukiRyoko/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/cpp_message.py | 259 | 21288 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | gpl-3.0 |
hakabane/p2pool-altcoins | p2pool/util/fixargparse.py | 283 | 1630 | from __future__ import absolute_import
import argparse
import sys
class FixedArgumentParser(argparse.ArgumentParser):
'''
fixes argparse's handling of empty string arguments
and changes @filename behaviour to accept multiple arguments on each line
'''
def _read_args_from_files(self, arg_strings)... | gpl-3.0 |
roadmapper/ansible | test/units/modules/network/onyx/test_onyx_ospf.py | 68 | 4494 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx impor... | gpl-3.0 |
goldeneye-source/ges-python | lib/subprocess.py | 67 | 63971 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... | gpl-3.0 |
sve-odoo/odoo | addons/account_check_writing/wizard/__init__.py | 437 | 1082 | # -*- 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 |
annarev/tensorflow | tensorflow/python/compiler/tensorrt/test/testdata/gen_tftrt_model.py | 12 | 4892 | # Copyright 2019 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 |
PsychoTV/PsychoTeam.repository | plugin.video.SportsDevil/lib/utils/beta/t0mm0/common/addon.py | 17 | 26782 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... | gpl-2.0 |
zentralopensource/zentral | zentral/utils/rison.py | 1 | 2938 | # from https://github.com/pifantastic/python-rison
# encode a json payload in rison
# used in kibana urls
import re
IDCHAR_PUNCTUATION = '_-./~'
NOT_IDCHAR = ''.join([c for c in (chr(i) for i in range(127))
if not (c.isalnum() or c in IDCHAR_PUNCTUATION)])
# Additionally, we need to distinguis... | apache-2.0 |
CUFCTL/DLBD | face-detection-code/object_detection/models/ssd_feature_extractor_test.py | 2 | 4864 | # 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... | mit |
YYWen0o0/python-frame-django | django/contrib/gis/geos/tests/test_io.py | 43 | 3920 | from __future__ import unicode_literals
import binascii
import unittest
from unittest import skipUnless
from django.utils.six import memoryview
from ..import HAS_GEOS
if HAS_GEOS:
from .. import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter
@skipUnless(HAS_GEOS, "Geos is required.")
class GEOSIOTes... | bsd-3-clause |
stuntman723/rap-analyzer | rap_analyzer/lib/python2.7/site-packages/django/contrib/sessions/models.py | 82 | 2229 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
use_in_migrations = True
def encode(self, session_dict):
"""
Return... | mit |
quodlibetor/dedupe | setup.py | 1 | 1174 | from __future__ import with_statement
import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup
import os
with open(os.path.join(os.path.dirname(__file__),"README.rst"), 'r') as fh:
long_desc = fh.read()
VERSION = "0.1.2"
setup(name="dedupe",
version=VERSION,
descriptio... | gpl-3.0 |
RITct/Rita | app/secret_sauce/seqtoseq_model.py | 1 | 11243 | import random
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
import pickle as pk
use_cuda = torch.cuda.is_available()
SOS_token = 0
EOS_token = 1
MAX_LENGTH = 80
class Dataset:
def __init__(self, name):
self.name = name
... | bsd-3-clause |
joergdietrich/astropy | astropy/stats/lombscargle/tests/test_lombscargle.py | 2 | 16929 | import numpy as np
from numpy.testing import assert_allclose
from .... import units
from ....tests.helper import pytest, assert_quantity_allclose
from .. import LombScargle
ALL_METHODS = LombScargle.available_methods
ALL_METHODS_NO_AUTO = [method for method in ALL_METHODS if method != 'auto']
FAST_METHODS = [method ... | bsd-3-clause |
nonZero/demos-python | src/examples/short/object_oriented/static_method_6.py | 1 | 1045 | #!/usr/bin/python2
'''
An example for using class methods to keep per class properties.
Once set, subclass properties shadows properties on the base class.
'''
from __future__ import print_function
class Book(object):
num = 0
def __init__(self, title):
self.title = title
self.id = self.incr... | gpl-3.0 |
stevekuznetsov/ansible | lib/ansible/utils/display.py | 66 | 11938 | # (c) 2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
hubert-he/hyde | hydeengine/processor.py | 47 | 6246 | import sys
import logging
import fnmatch
from media_processors import TemplateProcessor
def load_processor(name):
(module_name, _ , processor) = name.rpartition(".")
__import__(module_name)
module = sys.modules[module_name]
return getattr(module, processor)
class Processor(object):
def __init__(se... | mit |
YtvwlD/yarfi | etc/yarfi/services/console_setup.py | 1 | 1300 | # YARFI - Yet Another Replacement For Init
# Copyright (C) 2014 Niklas Sombert
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | gpl-3.0 |
suyashphadtare/test | erpnext/stock/doctype/item/test_item.py | 5 | 1803 | # 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 unittest
import frappe
from frappe.test_runner import make_test_records
test_ignore = ["BOM"]
test_dependencies = ["Warehouse"]
class TestI... | agpl-3.0 |
TEAM-Gummy/platform_external_chromium_org | chrome/common/extensions/docs/server2/github_file_system.py | 23 | 7628 | # Copyright (c) 2012 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 json
import logging
from StringIO import StringIO
import appengine_blobstore as blobstore
from appengine_url_fetcher import AppEngineUrlFetcher
f... | bsd-3-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/sphinx/websupport/storage/differ.py | 7 | 2603 | # -*- coding: utf-8 -*-
"""
sphinx.websupport.storage.differ
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A differ for creating an HTML representations of proposal diffs
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from difflib import ... | gpl-3.0 |
tersmitten/ansible | lib/ansible/modules/network/f5/bigip_gtm_topology_record.py | 25 | 32848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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',
... | gpl-3.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/networkx/algorithms/shortest_paths/weighted.py | 10 | 32872 | # -*- coding: utf-8 -*-
"""
Shortest path algorithms for weighed graphs.
"""
__author__ = """\n""".join(['Aric Hagberg <hagberg@lanl.gov>',
'Loïc Séguin-C. <loicseguin@gmail.com>',
'Dan Schult <dschult@colgate.edu>'])
# Copyright (C) 2004-2015 by
# Aric Hagb... | mit |
asm-products/cloudroutes-service | src/actions/actions/execute-shell-command/__init__.py | 2 | 1386 | """Email notification reaction."""
from fabric.api import env, run, hide
from ..utils import ShouldRun
def __action(**kwargs):
redata = kwargs['redata']
jdata = kwargs['jdata']
if ShouldRun(redata, jdata):
env.gateway = redata['data']['gateway']
env.host_string = redata['data']['host_strin... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.