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 |
|---|---|---|---|---|---|
40223145c2g18/40223145 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_break.py | 785 | 8138 | import gc
import io
import os
import sys
import signal
import weakref
import unittest
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
"if threa... | gpl-3.0 |
inspirehep/beard-server | beard_server/__init__.py | 2 | 1214 | # -*- coding: utf-8 -*-
#
# This file is part of Inspire.
# Copyright (C) 2016 CERN.
#
# Inspire 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... | gpl-2.0 |
sakset/getyourdata | getyourdata/feedback/tests.py | 1 | 3152 | #coding:utf-8
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from getyourdata.test import isDjangoTest, isSeleniumTest
from getyourdata.testcase import LiveServerTestCase
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui impo... | mit |
AlexStarov/Shop | applications/delivery2/migrations/0003_auto_20161126_1937.py | 1 | 2814 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('delivery2', '0002_auto_20161124_2123'),
]
operations = [
migrations.CreateModel(
name='EmailUrlT... | apache-2.0 |
CompassionCH/compassion-switzerland | child_sync_wp/models/child_compassion.py | 3 | 6983 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <david@coninckx.com>
#
# The licence is in the file __manifest__.p... | agpl-3.0 |
jamestwebber/scipy | scipy/sparse/linalg/isolve/tests/demo_lgmres.py | 16 | 1680 | from __future__ import division, print_function, absolute_import
import scipy.sparse.linalg as la
import scipy.sparse as sp
import scipy.io as io
import numpy as np
import sys
#problem = "SPARSKIT/drivcav/e05r0100"
problem = "SPARSKIT/drivcav/e05r0200"
#problem = "Harwell-Boeing/sherman/sherman1"
#problem = "misc/ham... | bsd-3-clause |
stuart-stanley/RackHD | test/tests/api/fit-staging/v2_0/pollers_tests.py | 14 | 7096 | from config.api2_0_config import *
from modules.logger import Log
from on_http_api2_0 import ApiApi as Api
from on_http_api2_0.rest import ApiException
from proboscis.asserts import *
from proboscis import SkipTest
from proboscis import test
from json import dumps, loads
LOG = Log(__name__)
@test(groups=['pollers_api... | apache-2.0 |
Communities-Communications/cc-odoo | addons/account/wizard/account_move_bank_reconcile.py | 385 | 2684 | # -*- 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 |
Jaiz909/youtube-dl | youtube_dl/extractor/eroprofile.py | 50 | 3288 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
ExtractorError,
unescapeHTML
)
class EroProfileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
_LOGIN_U... | unlicense |
auferack08/edx-platform | lms/envs/aws.py | 4 | 18828 | """
This is the default template for our main set of AWS servers. This does NOT
cover the content machines, which use content.py
Common traits:
* Use memcached, and cache-backed sessions
* Use a MySQL 5.1 database
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables fro... | agpl-3.0 |
UrbanRiskSlumRedevelopment/Maya | node_modules/npm/node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | mit |
pombredanne/pants | src/python/pants/base/build_file.py | 16 | 6966 | # coding=utf-8
# Copyright 2014 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 logging
impor... | apache-2.0 |
acshi/osf.io | osf/db/backends/postgresql/base.py | 4 | 2162 | import uuid
import psycopg2
from django.conf import settings
from django.db.backends.postgresql.base import \
DatabaseWrapper as PostgresqlDatabaseWrapper
from django.db.backends.postgresql.base import utc_tzinfo_factory
class server_side_cursors(object):
"""
With block helper that enables and disables s... | apache-2.0 |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py | 1777 | 19348 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
yepengxj/nmt | nmt/trans_enhi.py | 3 | 2544 | """
Data iterator for text datasets that are used for translation model.
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"Caglar Gulcehre "
"KyungHyun Cho ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import os, gc
import tables
import copy
i... | bsd-3-clause |
AOSPU/external_chromium_org_tools_gyp | tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | bsd-3-clause |
rpiotti/Flask-AppBuilder | flask_appbuilder/security/mongoengine/models.py | 3 | 2949 | import datetime
from flask import g
from ..._compat import as_unicode
from mongoengine import Document
from mongoengine import DateTimeField, StringField, ReferenceField, ListField, BooleanField, IntField
def get_user_id():
try:
return g.user.id
except Exception as e:
return No... | bsd-3-clause |
sultanxda/android_kernel_asus_grouper-old | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
BlueFern/DBiharMesher | util/CentrelineGenerator.py | 1 | 11052 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This scipt builds a centreline tree from a nested list representing the tree topology.
# The fist item in each list is the current domain, followed by the left
# and right branches if any.
#
# Parameters to control the generated tree points are to be set in this file.
#... | gpl-2.0 |
ininex/geofire-python | resource/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | 327 | 26955 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Access to Python's configuration information."""
import codecs
import os
import re
import sys
from os.path import pardir, realpath
try:
import configparser
except ImportError:
import Conf... | mit |
pymedusa/SickRage | medusa/browser.py | 2 | 3666 | # coding=utf-8
"""Browser module."""
from __future__ import unicode_literals
import logging
import os
import string
from builtins import str
log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())
# adapted from http://stackoverflow.com/questions/827371/is-there-a-way-to-list-all-the-available-driv... | gpl-3.0 |
cselis86/edx-platform | lms/djangoapps/courseware/entrance_exams.py | 18 | 6493 | """
This file contains all entrance exam related utils/logic.
"""
from django.conf import settings
from courseware.access import has_access
from courseware.model_data import FieldDataCache
from courseware.models import StudentModule
from opaque_keys.edx.keys import UsageKey
from student.models import EntranceExamConfi... | agpl-3.0 |
arpith20/linux | Documentation/target/tcm_mod_builder.py | 337 | 24391 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
scallemang/rhineland-shopify-theme | node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | mit |
chengduoZH/Paddle | python/paddle/fluid/tests/unittests/test_math_op_patch.py | 2 | 7265 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
tic-ull/defensatfc-proto | tfc_webapps/packages/suds-timestamp/suds/bindings/binding.py | 1 | 16943 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | agpl-3.0 |
lepistone/odoo | addons/account_analytic_default/account_analytic_default.py | 30 | 6880 | # -*- 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 GN... | agpl-3.0 |
bzennn/blog_flask | python/lib/python3.5/site-packages/sqlparse/__init__.py | 10 | 2224 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
"""Parse SQL statements."""
# Setup namespace
from sqlparse import sql
from sqlparse import cli
from sq... | gpl-3.0 |
nanditav/15712-TensorFlow | tensorflow/contrib/learn/python/learn/ops/ops_test.py | 14 | 3396 | # 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 |
gidden/cyclopts | cyclopts/exchange_family.py | 1 | 17294 | """This module defines a ProblemFamily subclass for Cyclus Resource Exchanges.
:author: Matthew Gidden <matthew.gidden _at_ gmail.com>
"""
import numpy as np
from collections import Iterable
from cyclopts.problems import ProblemFamily
import cyclopts.cyclopts_io as cycio
import cyclopts.io_tools as io_tools
import cy... | bsd-3-clause |
misterdanb/micropython | tests/basics/async_for2.py | 49 | 1024 | # test waiting within "async for" aiter/anext functions
import sys
if sys.implementation.name == 'micropython':
# uPy allows normal generators to be awaitables
coroutine = lambda f: f
else:
import types
coroutine = types.coroutine
@coroutine
def f(x):
print('f start:', x)
yield x + 1
yield... | mit |
m-sanders/wagtail | wagtail/wagtailcore/management/commands/fixtree.py | 22 | 5041 | import operator
import functools
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models import Q
from django.utils import six
from wagtail.wagtailcore.models import Page
class Comma... | bsd-3-clause |
bblacey/FreeCAD-MacOS-CI | src/Mod/Start/StartPage/LoadPartDesignExample.py | 32 | 1932 | #***************************************************************************
#* *
#* Copyright (c) 2012 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 |
hrnr/offlineimap-daemon | offlineimap-daemon.py | 2 | 2106 | #!/usr/bin/env python3
import subprocess
import signal
import threading
import sys
import dbus
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
class OfflineimapCtl(object):
def __init__(self):
self.daemon_proc = None
self.run_ev = threading.Event()
self.run_daemon = False
def ru... | mit |
rob356/SickRage | lib/sqlalchemy/testing/suite/test_reflection.py | 76 | 19615 |
import sqlalchemy as sa
from sqlalchemy import exc as sa_exc
from sqlalchemy import types as sql_types
from sqlalchemy import inspect
from sqlalchemy import MetaData, Integer, String
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.testing import engines, fixtures
from sqlalchemy.testing.schema impo... | gpl-3.0 |
robinro/ansible-modules-core | network/ios/_ios_template.py | 19 | 5935 | #!/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 |
magfest/bands | alembic/versions/f619fbd56912_rename_band_tables_to_guest_tables.py | 1 | 4926 | """Rename band tables to guest tables.
Revision ID: f619fbd56912
Revises: adf30f2f47d5
Create Date: 2017-09-18 07:45:24.077355
"""
# revision identifiers, used by Alembic.
revision = 'f619fbd56912'
down_revision = 'adf30f2f47d5'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | agpl-3.0 |
thor-project/dashboard | thor/modules/dashboard/models.py | 1 | 3325 | #
# This file is part of the THOR Dashboard Project.
# Copyright (C) 2016 CERN.
#
# The THOR dashboard 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... | gpl-2.0 |
subodhchhabra/airflow | airflow/hooks/webhdfs_hook.py | 16 | 4335 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
mstriemer/addons-server | src/olympia/reviews/tests/test_serializers.py | 4 | 6667 | # -*- coding: utf-8 -*-
from mock import Mock
from rest_framework.test import APIRequestFactory
from olympia.amo.helpers import absolutify
from olympia.amo.tests import addon_factory, TestCase, user_factory
from olympia.reviews.models import Review
from olympia.reviews.serializers import ReviewSerializer
class TestB... | bsd-3-clause |
ahmetabdi/SickRage | lib/lockfile/symlinklockfile.py | 487 | 2613 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# s... | gpl-3.0 |
gebenedeit/sccpy | sccpy/Ui/Views/Home/ViewHome.py | 1 | 1210 | from PyQt4.QtGui import QWidget, QGridLayout
from Ui.Views.Home.Personal.Personal import Personal
from Ui.Views.Home.FavoriteRooms.FavoriteRooms import FavoriteRooms
from Ui.Views.Home.Friends.Friends import Friends
from Ui.Views.Home.News.News import News
from Ui.Helper import SetWidgetBackgroundColor
from Ui.Colors i... | gpl-2.0 |
agentmilindu/stratos | components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/subscriber/eventsubscriber.py | 2 | 4151 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
maljac/odoomrp-wip | warning_log/__openerp__.py | 27 | 1505 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
#
# 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 S... | agpl-3.0 |
birdonwheels5/p2pool-dgbsha | p2pool/test/test_data.py | 276 | 1605 | import random
import unittest
from p2pool import data
from p2pool.bitcoin import data as bitcoin_data
from p2pool.test.util import test_forest
from p2pool.util import forest
def random_bytes(length):
return ''.join(chr(random.randrange(2**8)) for i in xrange(length))
class Test(unittest.TestCase):
def test_h... | gpl-3.0 |
oskar456/youtube-dl | youtube_dl/extractor/streamable.py | 53 | 3891 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
)
class StreamableIE(InfoExtractor):
_VALID_URL = r'https?://streamable\.com/(?:[es]/)?(?P<id>\w+)'
_TESTS = [
{
... | unlicense |
indevgr/django | tests/gis_tests/geo3d/models.py | 18 | 1259 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
Designist/audacity | lib-src/lv2/lv2/waflib/Build.py | 265 | 20971 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,re,shutil
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,Context,Er... | gpl-2.0 |
arvinsingla/CouchPotatoServer | libs/pyutil/increasing_timer.py | 106 | 6607 | # Copyright (c) 2001 Autonomous Zone Industries
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
This module was invented when it was discovered that time.time() can return
decreasing answers, which was causing scheduled tasks to get executed out ... | gpl-3.0 |
acsone/odoo | addons/edi/models/res_partner.py | 437 | 4243 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
skywin/p2pool | p2pool/test/bitcoin/test_sha256.py | 275 | 1213 | from __future__ import division
import unittest
import hashlib
import random
from p2pool.bitcoin import sha256
class Test(unittest.TestCase):
def test_all(self):
for test in ['', 'a', 'b', 'abc', 'abc'*50, 'hello world']:
#print test
#print sha256.sha256(test).hexdigest()
... | gpl-3.0 |
ralphbean/func-ralphbean-devel | func/minion/modules/func_module.py | 3 | 7097 | ##
## Copyright 2007, Red Hat, Inc
## see AUTHORS
##
## This software may be freely redistributed under the terms of the GNU
## general public license.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave... | gpl-2.0 |
JTarball/docker-django-polymer | docker/app/app/backend/apps/_archive/accounts_maybe_good?/registration/models.py | 8 | 10232 | import datetime
import re
import hashlib
import random
from django.db import models, transaction
from django.utils.timezone import now as datetime_now
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
from django.contrib import auth
from django.conf import se... | gpl-2.0 |
Jumpscale/jumpscale6_core | lib/JumpScale/grid/tornado/TornadoFactory.py | 1 | 1592 | from JumpScale import j
class TornadoFactory():
def getServer(self, port, sslorg=None, ssluser=None, sslkeyvaluestor=None):
"""
HOW TO USE:
daemon=j.servers.tornado.getServer(port=4444)
class MyCommands():
def __init__(self,daemon):
self.daemon=daemon
... | bsd-2-clause |
thiagopena/PySIGNFe | pysignfe/nfe/manual_300/cancnfe_107.py | 1 | 7187 | # -*- coding: utf-8 -*-
from pysignfe.xml_sped import *
from pysignfe.nfe.manual_300 import ESQUEMA_ATUAL
import os
DIRNAME = os.path.dirname(__file__)
class InfCancEnviado(XMLNFe):
def __init__(self):
super(InfCancEnviado, self).__init__()
self.Id = TagCaracter(nome=u'infCanc', codigo=u'CP03'... | lgpl-2.1 |
SaschaMester/delicium | tools/telemetry/telemetry/internal/results/base_test_results_unittest.py | 35 | 1520 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import unittest
from telemetry.core import exceptions
class BaseTestResultsUnittest(unittest.TestCase):
def CreateException(self):
try:
... | bsd-3-clause |
leighpauls/k2cro4 | third_party/python_26/Lib/test/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... | bsd-3-clause |
knightkill3r/FalcoKernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
AndrewPeelMV/Blender2.78c | 2.78/scripts/addons/io_import_dxf/dxfgrabber/dxfobjects.py | 5 | 2969 | # encoding: utf-8
# Purpose: objects classes
# Created: 17.04.2016
# Copyright (C) 2016, Manfred Moitzi
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"
from datetime import datetime
from .juliandate import calendar_date
class DXFObject(object):
def __init__(se... | gpl-2.0 |
hassanabidpk/django | tests/forms_tests/tests/test_validators.py | 261 | 1540 | from __future__ import unicode_literals
import re
from unittest import TestCase
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
class UserForm(forms.Form):
full_name = forms.CharField(
max_length=50,
validators=[
validato... | bsd-3-clause |
Viktor-Evst/luigi | test/test_sigpipe.py | 95 | 2848 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
Shaswat27/scipy | scipy/ndimage/fourier.py | 113 | 9779 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | bsd-3-clause |
comepradz/pybrain | examples/rl/environments/shipsteer/shipbench_pgpe.py | 30 | 2475 | #!/usr/bin/env python
#########################################################################
# Reinforcement Learning with PGPE on the ShipSteering Environment
#
# Requirements: pylab (for plotting only). If not available, comment the
# last 3 lines out
# Author: Frank Sehnke, sehnke@in.tum.de
######################... | bsd-3-clause |
nkgilley/home-assistant | homeassistant/components/nexia/entity.py | 6 | 3620 | """The nexia integration base entity."""
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .const import (
ATTRIBUTION,
DOMAIN,
MANUFACTURER,
SIGNAL_THERMOSTAT_UPDATE,
SIGNAL_Z... | apache-2.0 |
mkrupcale/ansible | lib/ansible/modules/cloud/amazon/ec2_win_password.py | 23 | 5690 | #!/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 |
noahc3/PokemonGoTeamManager | libs/py/pogoapi/POGOProtos/Networking/Requests/Messages/AddFortModifierMessage_pb2.py | 15 | 4125 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/AddFortModifierMessage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _m... | mit |
pszemus/grpc | examples/python/route_guide/route_guide_client.py | 5 | 4130 | # 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 or agreed to in writing... | apache-2.0 |
miptliot/edx-platform | lms/djangoapps/courseware/tests/test_split_module.py | 6 | 11001 | """
Test for split test XModule
"""
from django.core.urlresolvers import reverse
from mock import MagicMock
from nose.plugins.attrib import attr
from courseware.model_data import FieldDataCache
from courseware.module_render import get_module_for_descriptor
from openedx.core.djangoapps.user_api.tests.factories import U... | agpl-3.0 |
denizs/swampdragon | swampdragon/__init__.py | 4 | 1373 | VERSION = (0, 4, 2, 2)
def discover_routes():
from swampdragon import route_handler
"""
Discover, borrowed from django admin.
Returns urls for each route handler
"""
from django.conf import settings
try:
from importlib import import_module
except ImportError:
from djang... | bsd-3-clause |
RyanSkraba/beam | sdks/python/apache_beam/internal/util_test.py | 2 | 2307 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
NunoEdgarGub1/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
seanli9jan/tensorflow | tensorflow/python/ops/bitwise_ops.py | 61 | 1314 | # 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 |
lowitty/alarmfiles | lib/pysnmp/proto/secmod/rfc3414/service.py | 4 | 49005 | # SNMP v3 USM model services
import time, sys
from pysnmp.proto.secmod.base import AbstractSecurityModel
from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha, noauth
from pysnmp.proto.secmod.rfc3414.priv import des, nopriv
from pysnmp.proto.secmod.rfc3826.priv import aes
from pysnmp.proto.secmod.eso.priv impor... | mit |
ecosoft-odoo/odoo | addons/l10n_fr_hr_payroll/report/__init__.py | 424 | 1091 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
glouppe/scikit-learn | sklearn/externals/joblib/hashing.py | 43 | 8978 | """
Fast cryptographic hash of Python objects, with a special case for fast
hashing of numpy arrays.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import warnings
import pickle
import hashlib
import sys
import types
import ... | bsd-3-clause |
jonyroda97/redbot-amigosprovaveis | lib/youtube_dl/extractor/sina.py | 24 | 4321 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
HEADRequest,
ExtractorError,
int_or_none,
update_url_query,
qualities,
get_element_by_attribute,
clean_html,
)
class SinaIE(InfoExtractor):
_VALID_URL = r'''(?x)h... | gpl-3.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/encodings/iso8859_9.py | 593 | 13412 | """ Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | gpl-2.0 |
polaris-gslb/polaris-core | polaris_health/monitors/__init__.py | 2 | 1763 | # -*- coding: utf-8 -*-
import logging
from polaris_health import Error
__all__ = [ 'BaseMonitor', 'registered' ]
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())
# allowed ranges
MIN_INTERVAL = 1
MAX_INTERVAL = 3600
MIN_TIMEOUT = 0.1
MAX_TIMEOUT = 10
MIN_RETRIES = 0
MAX_RETRIES = 5
class... | bsd-3-clause |
benagricola/exabgp | lib/exabgp/bgp/message/update/nlri/labelled.py | 1 | 2722 | # encoding: utf-8
"""
path.py
Created by Thomas Mangin on 2014-06-27.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from exabgp.protocol.family import AFI
from exabgp.protocol.family import SAFI
from exabgp.bgp.message.update.nlri.nlri import NLRI
from exabgp.bgp.message.update.nlri.inet import INET
... | bsd-3-clause |
CrazyGamerGR/CrazySuperKernel-CM14.1-G5 | scripts/check-config.py | 137 | 5471 | #! /usr/bin/env python
# Copyright (c) 2015, The Linux Foundation. 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
# not... | gpl-2.0 |
ak2703/edx-platform | common/lib/xmodule/xmodule/tests/test_poll.py | 227 | 1133 | # -*- coding: utf-8 -*-
"""Test for Poll Xmodule functional logic."""
from xmodule.poll_module import PollDescriptor
from . import LogicTest
class PollModuleTest(LogicTest):
"""Logic tests for Poll Xmodule."""
descriptor_class = PollDescriptor
raw_field_data = {
'poll_answers': {'Yes': 1, 'Dont_kn... | agpl-3.0 |
JaneliaSciComp/osgpyplusplus | examples/rough_translated1/osgpointsprite.py | 1 | 3976 | #!/bin/env python
# Automatically translated python version of
# OpenSceneGraph example program "osgpointsprite"
# !!! This program will need manual tuning before it will work. !!!
import sys
from osgpypp import osg
from osgpypp import osgDB
from osgpypp import osgViewer
# Translated from file 'osgpointsprite.cpp... | bsd-3-clause |
JimRuss/kernel_huawei_u8860 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
yanchen036/tensorflow | tensorflow/contrib/cluster_resolver/python/training/gce_cluster_resolver_test.py | 64 | 8588 | # 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 applicable ... | apache-2.0 |
wenjun1055/phptrace | tests/gtest-1.7.0/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
rasilab/htseq | doc/add_counter.py | 6 | 1036 | import glob
counter_code = '''
<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=5680199;
var sc_invisible=1;
var sc_partition=63;
var sc_click_stat=1;
var sc_security="6e579550";
</script>
<script type="text/javascript"
src="http://www.statcounter.com/counter/counter.js"></script... | gpl-3.0 |
Nitaco/ansible | lib/ansible/modules/cloud/google/gcp_dns_managed_zone.py | 16 | 9006 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
LarsFronius/ansible | lib/ansible/modules/cloud/rackspace/rax_meta.py | 66 | 5315 | #!/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 distributed... | gpl-3.0 |
diagramsoftware/odoo | openerp/addons/base/ir/ir_logging.py | 326 | 1882 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | agpl-3.0 |
manuvarkey/cmbautomiser | cmbautomiser/openpyxl/styles/differential.py | 1 | 2288 | from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
from openpyxl.descriptors import (
Integer,
String,
Typed,
Sequence,
Alias,
)
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.styles import (
Font,
Fill,
GradientFill,
PatternFill,
... | gpl-3.0 |
seecr/meresco-components | meresco/components/cqlsuggester.py | 1 | 1918 | ## begin license ##
#
# "Meresco Components" are components to build searchengines, repositories
# and archives, based on "Meresco Core".
#
# Copyright (C) 2007-2008 SURF Foundation. http://www.surf.nl
# Copyright (C) 2007-2010 Seek You Too (CQ2) http://www.cq2.nl
# Copyright (C) 2007-2009 Stichting Kennisnet Ict op sc... | gpl-2.0 |
vredchenko/jenkins-job-builder | tests/builder/test_builder.py | 11 | 1549 | # vim: set fileencoding=utf-8 :
#
# - Copyright 2014 Guido Günther <agx@sigxcpu.org>
#
# 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... | apache-2.0 |
jaredo/gwas | lmem.py | 1 | 5016 | import sys,time, csv,numpy as np,argparse,string,os,math,logging
import numpy as np
import iolib
import lmem_func
import multiprocessing as mp
parser = argparse.ArgumentParser(description='Linear mixed effect models for quantitative traits')
parser.add_argument('-genfile', metavar='genfile',default="", type=str, help=... | mit |
Tarliton/tcclousa | controle/main.py | 1 | 4793 | #Copyright (C) 2014, 2015 Tarliton Godoy
#
#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) any later version.
#
#This program is distri... | gpl-2.0 |
abergeron/pylearn2 | pylearn2/training_algorithms/default.py | 44 | 6791 | """
A generic training algorithm that implements no real training code of its
own but just calls the model.train_batch method on minibatches of data.
"""
import functools
from theano.compat.six.moves import xrange
from pylearn2.monitor import Monitor
from pylearn2.training_algorithms.training_algorithm import TrainingA... | bsd-3-clause |
Nick-OpusVL/odoo | openerp/api.py | 88 | 32744 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
pgmillon/ansible | lib/ansible/modules/network/f5/bigip_profile_tcp.py | 5 | 21521 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, 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 |
kelvinhammond/beets | test/testall.py | 2 | 1521 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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... | mit |
JorgeCoock/django | tests/forms_tests/widget_tests/test_datetimeinput.py | 247 | 2367 | from datetime import datetime
from django.forms import DateTimeInput
from django.test import override_settings
from django.utils import translation
from .base import WidgetTest
class DateTimeInputTest(WidgetTest):
widget = DateTimeInput()
def test_render_none(self):
self.check_html(self.widget, 'da... | bsd-3-clause |
LTD-Beget/redis-py | setup.py | 26 | 1814 | #!/usr/bin/env python
import os
import sys
from redis import __version__
try:
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.