repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
googlearchive/cloud-playground | __pg/fixit.py | 2 | 1835 | """Module migrating/fixing schemas."""
import webapp2
from mimic.__mimic import common
from google.appengine.api import taskqueue
from google.appengine.datastore.datastore_query import Cursor
from . import model
from . import secret
from . import settings
from . import shared
# number of entities to fix at a time... | apache-2.0 |
cg31/tensorflow | tensorflow/python/util/net_lib.py | 21 | 1028 | # 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 |
Jionglun/-w16b_test | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/pool.py | 694 | 23263 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing ... | agpl-3.0 |
veger/ansible | lib/ansible/modules/network/nxos/nxos_ntp_auth.py | 61 | 9574 | #!/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 |
IronLanguages/ironpython3 | Src/Scripts/generate_alltypes.py | 1 | 18881 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
from generate import generate
import operator
import clr
from System import *
long = type(1 << 63) # https://gi... | apache-2.0 |
huangkuan/hack | lib/pyasn1_modules/rfc2315.py | 127 | 8894 | #
# PKCS#7 message syntax
#
# ASN.1 source from:
# http://www.trl.ibm.com/projects/xml/xss4j/data/asn1/grammars/pkcs7.asn
#
# Sample captures from:
# openssl crl2pkcs7 -nocrl -certfile cert1.cer -out outfile.p7b
#
from pyasn1.type import tag,namedtype,namedval,univ,constraint,char,useful
from pyasn1_modules.rfc2459 imp... | apache-2.0 |
chriskuehl/pre-commit | pre_commit/clientlib/validate_manifest.py | 2 | 2857 | from __future__ import unicode_literals
from pre_commit.clientlib.validate_base import get_run_function
from pre_commit.clientlib.validate_base import get_validator
from pre_commit.clientlib.validate_base import is_regex_valid
from pre_commit.languages.all import all_languages
class InvalidManifestError(ValueError):... | mit |
jawed123/flask | tests/test_user_error_handler.py | 150 | 3483 | # -*- coding: utf-8 -*-
from werkzeug.exceptions import Forbidden, InternalServerError
import flask
def test_error_handler_no_match():
app = flask.Flask(__name__)
class CustomException(Exception):
pass
@app.errorhandler(CustomException)
def custom_exception_handler(e):
assert isinsta... | bsd-3-clause |
janezhango/BigDataMachineLearning | py/jprobe.py | 1 | 18802 | #!/usr/bin/python
import random, jenkinsapi, getpass, re, os, argparse, shutil, json, logging, sys
import string
from jenkinsapi.jenkins import Jenkins
# only used when we wanted to see what objects were available (below)
from see import see
DO_LAST_GOOD = False
# using the env variables to force jenkinsapi to use p... | apache-2.0 |
mmagnus/rna-pdb-tools | rna_tools/tools/rna_alignment/utils/rna_alignment_process_id.py | 2 | 1932 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import print_function
import argparse
def get_parser():
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("-v", "--verbose",
ac... | gpl-3.0 |
alexlee188/ghpsdr3-alex | trunk/src/sdr1000/test/src/cygwin/sdr1khw.py | 12 | 5048 | # This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _sdr1khw
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
... | gpl-3.0 |
damdam-s/OCB | addons/account/wizard/account_report_common_journal.py | 385 | 2942 | # -*- 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 |
EzyInsights/Diamond | src/collectors/userscripts/userscripts.py | 51 | 3524 | # coding=utf-8
"""
Runs third party scripts and collects their output.
Scripts need to be +x and should output metrics in the form of
```
metric.path.a 1
metric.path.b 2
metric.path.c 3
```
They are not passed any arguments and if they return an error code,
no metrics are collected.
#### Dependencies
* [subproce... | mit |
meabsence/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/blogger/service_test.py | 128 | 3578 | #!/usr/bin/python
#
# Copyright (C) 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
OpenUpgrade/OpenUpgrade | openerp/addons/base/res/res_font.py | 322 | 7559 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
aviciimaxwell/odoo | addons/project/res_config.py | 232 | 4551 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
yannickcr/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/lynda.py | 19 | 8369 | from __future__ import unicode_literals
import re
import json
from .subtitles import SubtitlesInfoExtractor
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
compat_urllib_request,
ExtractorError,
int_or_none,
compat_str,
)
class LyndaIE(SubtitlesInfoExtractor):
IE... | gpl-3.0 |
quinox/weblate | weblate/accounts/migrations/0010_auto_20150819_1457.py | 9 | 1462 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0009_auto_20150630_1213'),
]
operations = [
migrations.AlterField(
model_name='profile',
... | gpl-3.0 |
abhishekgahlot/or-tools | examples/python/ski_assignment.py | 34 | 3787 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 |
takis/django | tests/redirects_tests/tests.py | 336 | 3396 | from django import http
from django.conf import settings
from django.contrib.redirects.middleware import RedirectFallbackMiddleware
from django.contrib.redirects.models import Redirect
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, ... | bsd-3-clause |
jjs0sbw/CSPLN | scripts/create_web_apps_win.py | 1 | 6147 | '''
<license>
CSPLN_MaryKeelerEdition; Manages images to which notes can be added.
Copyright (C) 2015, Thomas Kercheval
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... | gpl-3.0 |
tipabu/swift | test/unit/container/test_reconciler.py | 2 | 80935 | # 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
# distributed under the... | apache-2.0 |
harisibrahimkv/django | tests/file_uploads/tests.py | 45 | 23742 | import base64
import hashlib
import os
import shutil
import sys
import tempfile as sys_tempfile
import unittest
from io import BytesIO, StringIO
from urllib.parse import quote
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.multipartparser i... | bsd-3-clause |
Endika/edx-platform | common/djangoapps/xmodule_django/models.py | 46 | 6250 | """
Useful django models for implementing XBlock infrastructure in django.
"""
import warnings
from django.db import models
from django.core.exceptions import ValidationError
from opaque_keys.edx.keys import CourseKey, UsageKey, BlockTypeKey
class NoneToEmptyManager(models.Manager):
"""
A :class:`django.db.m... | agpl-3.0 |
FreekingDean/home-assistant | homeassistant/components/cover/__init__.py | 5 | 7553 | """
Support for Cover devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover/
"""
import os
import logging
import voluptuous as vol
from homeassistant.config import load_yaml_config_file
from homeassistant.helpers.entity_component import EntityC... | mit |
betoesquivel/CIE | flask/lib/python2.7/site-packages/werkzeug/security.py | 146 | 8483 | # -*- coding: utf-8 -*-
"""
werkzeug.security
~~~~~~~~~~~~~~~~~
Security related helpers such as secure password hashing tools.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import hmac
import hashlib
import posi... | mit |
axbaretto/beam | sdks/python/apache_beam/transforms/combiners.py | 5 | 29015 | #
# 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 |
oy-vey/algorithms-and-data-structures | 2-DataStructures/Week3/make_heap/build_heap.py | 1 | 1729 | # python3
class HeapBuilder:
def __init__(self):
self._swaps = []
self._data = []
def ReadData(self):
n = int(input())
self._data = [int(s) for s in input().split()]
assert n == len(self._data)
def WriteResponse(self):
print(len(self._swaps))
for sw... | mit |
sameetb-cuelogic/edx-platform-test | common/djangoapps/student/management/commands/assigngroups.py | 170 | 3059 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from student.models import UserTestGroup
import random
import sys
import datetime
from textwrap import dedent
import json
from pytz import UTC
def group_from_value(groups, v):
''' Given group: (('a',0.3),('b',0.4),(... | agpl-3.0 |
markoshorro/gem5 | src/arch/x86/isa/insts/general_purpose/rotate_and_shift/shift.py | 91 | 6764 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
schenkd/webdev-project | app/main/forms.py | 1 | 2869 | # ~*~ encoding: utf-8 ~*~
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField, IntegerField, SelectField
from wtforms.validators import DataRequired, Email, ValidationError
from datetime import datetime
from app.models import Drug
# Generiert ein Liste von Tupeln aus einem inte... | mit |
ovnicraft/openerp-restaurant | purchase/edi/purchase_order.py | 439 | 9703 | # -*- 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 |
leandrotoledo/python-telegram-bot | tests/test_filters.py | 2 | 87928 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | lgpl-3.0 |
emmuchira/kps_erp | erpnext/patches/v6_4/fix_expense_included_in_valuation.py | 29 | 3199 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.utils import cstr
def execute():
for company in frappe.db.sql("select name, expenses_included_in_valuation f... | gpl-3.0 |
bolkedebruin/airflow | airflow/providers/ftp/hooks/ftp.py | 2 | 10380 | # -*- 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 |
nugget/home-assistant | homeassistant/components/device_tracker/xiaomi.py | 18 | 5820 | """
Support for Xiaomi Mi routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.xiaomi/
"""
import logging
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.devi... | apache-2.0 |
jscn/django | tests/aggregation/tests.py | 31 | 45900 | from __future__ import unicode_literals
import datetime
import re
from decimal import Decimal
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
Avg, Count, DecimalField, DurationField, F, FloatField, Func, IntegerField,
Max, Min, Sum, Value,
)
from d... | bsd-3-clause |
yadavsaroj/avro | lang/py3/avro/tests/av_bench.py | 21 | 3194 | #!/usr/bin/env python3
# -*- mode: python -*-
# -*- 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... | apache-2.0 |
SatoshiNXSimudrone/sl4a-damon-clone | python/src/Lib/test/test_timeout.py | 55 | 6714 | """Unit tests for socket timeout feature."""
import unittest
from test import test_support
# This requires the 'network' resource as given on the regrtest command line.
skip_expected = not test_support.is_resource_enabled('network')
import time
import socket
class CreationTestCase(unittest.TestCase):
"""Test c... | apache-2.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/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 |
trast/git | contrib/hg-to-git/hg-to-git.py | 47 | 7867 | #!/usr/bin/env python
""" hg-to-git.py - A Mercurial to GIT converter
Copyright (C)2007 Stelian Pop <stelian@popies.net>
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 versi... | gpl-2.0 |
tragiclifestories/django | tests/known_related_objects/tests.py | 363 | 6425 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Organiser, Pool, PoolStyle, Tournament
class ExistingRelatedInstancesTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.t1 = Tournament.objects.create(name='Tourney 1')
cls.t2 = Tournament.ob... | bsd-3-clause |
johnkit/vtk-dev | Filters/Core/Testing/Python/TestContourCases.py | 11 | 4312 | # This test requires Numpy.
import sys
import vtk
from vtk.test import Testing
try:
import numpy as np
except ImportError:
print "WARNING: This test requires Numeric Python: http://numpy.sf.net"
sys.exit(0)
def GenerateCell(cellType, points):
cell = vtk.vtkUnstructuredGrid()
pts = vtk.vtkPoints()
... | bsd-3-clause |
BMJHayward/django | django/core/management/commands/shell.py | 492 | 3951 | import os
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available."
requires_system_checks = False
shells = ['ipython', 'bpython']
def add_arguments(self, parser):
... | bsd-3-clause |
KosiehBarter/anaconda | widgets/python/AnacondaWidgets.py | 19 | 3138 | #
# Copyright (C) 2011-2013 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distrib... | gpl-2.0 |
kevinlondon/flexx | flexx/app/tests/test_serializer.py | 21 | 1468 |
from pytest import raises
from flexx.util.testing import run_tests_if_main
from flexx.pyscript import py2js, evaljs
from flexx.app.serialize import Serializer, serializer
class Foo:
def __init__(self, val):
self.val = val
def __json__(self):
return {'__type__': 'Foo', 'val': self.val}
d... | bsd-2-clause |
Abjad/abjad | abjad/attach.py | 1 | 40809 | import copy
import importlib
import typing
from . import _inspect, exceptions
from . import tag as _tag
from .duration import Multiplier, Offset
from .score import AfterGraceContainer, BeforeGraceContainer, Component, Container, Leaf
from .storage import FormatSpecification, StorageFormatManager, storage
class Wrapp... | gpl-3.0 |
ihsanudin/odoo | openerp/report/render/rml2pdf/color.py | 443 | 1720 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
rven/odoo | addons/mail/tests/common.py | 1 | 43892 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import email
import email.policy
import time
from collections import defaultdict
from contextlib import contextmanager
from functools import partial
from lxml import html
from unittest.mock import patch
from smtplib imp... | agpl-3.0 |
silentfuzzle/calibre | src/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | gpl-3.0 |
Big-B702/python-for-android | python-build/python-libs/gdata/src/gdata/alt/appengine.py | 133 | 10734 | #!/usr/bin/python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
gholms/euca2ools | euca2ools/commands/ec2/terminateinstances.py | 6 | 1993 | # Copyright 2009-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... | bsd-2-clause |
Teagan42/home-assistant | homeassistant/components/mobile_app/config_flow.py | 2 | 1877 | """Config flow for Mobile App."""
import uuid
from homeassistant import config_entries
from homeassistant.components import person
from homeassistant.helpers import entity_registry
from .const import ATTR_APP_ID, ATTR_DEVICE_ID, ATTR_DEVICE_NAME, CONF_USER_ID, DOMAIN
@config_entries.HANDLERS.register(DOMAIN)
class ... | apache-2.0 |
rahul003/mxnet | python/mxnet/rnn/io.py | 8 | 7829 | # 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 |
tmetsch/graph_stitcher | tests/stitcher_evolutionary_test.py | 1 | 16745 | """
Unittest for the evolutionary module.
"""
import itertools
import json
import logging
import unittest
import networkx as nx
from networkx.readwrite import json_graph
from stitcher import evolutionary
FORMAT = "%(asctime)s - %(filename)s - %(lineno)s - " \
"%(levelname)s - %(message)s"
logging.basicConf... | mit |
nanophotonics/nplab | nplab/analysis/background_removal/Moving_Gradient_BG_Removal.py | 1 | 4342 | from builtins import range
import numpy as np
"""
Author: jpg66
Module for removing SERS background in cases where Adaptive Polynomial produces too many artifacts. This may include cases with negative curvature and a low SNR.
This should be used in cases where the peaks are sparse.
Run using Run(Signal,Window=50,Ma... | gpl-3.0 |
Ditmar/plugin.video.pelisalacarta | core/pyload_client.py | 21 | 2037 | # -*- coding: utf-8 -*-
import urllib
import scrapertools
import config
import logger
import urlparse
def login(username,password):
logger.info("pyload_client.login")
#url = config.get_setting("pyload")+"/api/login"
api_url = urlparse.urljoin(config.get_setting("pyload"),"/api/login")
logger.info("py... | gpl-3.0 |
gugahoi/maraschino | lib/sqlalchemy/dialects/postgresql/base.py | 14 | 61721 | # postgresql/base.py
# Copyright (C) 2005-2011 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
"""Support for the PostgreSQL database.
For information on connecting using specif... | mit |
kaday/rose | lib/python/rose/config_editor/upgrade_controller.py | 1 | 13138 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-6 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | gpl-3.0 |
kamyu104/django | tests/transactions/tests.py | 239 | 19163 | from __future__ import unicode_literals
import sys
import threading
import time
from unittest import skipIf, skipUnless
from django.db import (
DatabaseError, Error, IntegrityError, OperationalError, connection,
transaction,
)
from django.test import (
TransactionTestCase, skipIfDBFeature, skipUnlessDBFea... | bsd-3-clause |
valkjsaaa/sl4a | python/src/Lib/test/test_collections.py | 48 | 18805 | import unittest, doctest
from test import test_support
from collections import namedtuple
import pickle, cPickle, copy
from collections import Hashable, Iterable, Iterator
from collections import Sized, Container, Callable
from collections import Set, MutableSet
from collections import Mapping, MutableMapping
from coll... | apache-2.0 |
IONISx/edx-platform | common/djangoapps/util/tests/test_disable_rate_limit.py | 148 | 1832 | """Tests for disabling rate limiting. """
import unittest
from django.test import TestCase
from django.core.cache import cache
from django.conf import settings
import mock
from rest_framework.views import APIView
from rest_framework.throttling import BaseThrottle
from rest_framework.exceptions import Throttled
from u... | agpl-3.0 |
sencha/chromium-spacewalk | native_client_sdk/src/build_tools/tests/sdktools_commands_test.py | 76 | 18779 | #!/usr/bin/env 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.
import os
import sys
import re
import tarfile
import tempfile
import unittest
from sdktools_test import SdkToolsTestCase
SCRIPT_DI... | bsd-3-clause |
eranchetz/nupic | nupic/regions/PictureSensorExplorers/rotate_block.py | 17 | 3076 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
kapilt/cloud-custodian | tools/c7n_gcp/c7n_gcp/resources/resource_map.py | 1 | 5770 | ResourceMap = {
"gcp.app-engine": "c7n_gcp.resources.appengine.AppEngineApp",
"gcp.app-engine-certificate": "c7n_gcp.resources.appengine.AppEngineCertificate",
"gcp.app-engine-domain": "c7n_gcp.resources.appengine.AppEngineDomain",
"gcp.app-engine-domain-mapping": "c7n_gcp.resources.appengine.AppEngineD... | apache-2.0 |
sbesson/snoopycrimecop | test/integration/Sandbox.py | 2 | 5211 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 University of Dundee & Open Microscopy Environment
# All Rights Reserved.
#
# 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 Foundat... | gpl-2.0 |
koushikcgit/xen | tools/python/xen/xend/server/SrvDmesg.py | 51 | 1767 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
isra17/DIE | DIE/UI/ValueViewEx.py | 8 | 9711 |
from PySide import QtGui, QtCore
import idaapi
import idautils
import idc
from idaapi import PluginForm
import DIE.Lib.DIEDb
import DIE.UI.FunctionViewEx
class ValueView(PluginForm):
"""
DIE Value View
"""
def __init__(self):
super(ValueView, self).__init__()
... | mit |
javachengwc/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/extension/algsupport.py | 35 | 4007 | #!/usr/bin/env python
#
# Generated Sat Mar 8 16:15:12 2014 by parse_xsd.py version 0.5.
#
import saml2
from saml2 import SamlBase
NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:algsupport'
class DigestMethodType_(SamlBase):
"""The urn:oasis:names:tc:SAML:metadata:algsupport:DigestMethodType
element """
... | apache-2.0 |
dimagi/rapidsms-core | lib/pygsm/errors.py | 65 | 3781 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import serial
class GsmError(serial.SerialException):
pass
class GsmIOError(GsmError):
pass
class GsmWriteError(GsmIOError):
pass
class GsmReadError(GsmIOError):
pass
class GsmReadTimeoutError(GsmReadError):
def __init__(self, pending_da... | lgpl-3.0 |
dgiunchi/googletest | test/gtest_color_test.py | 3259 | 4911 | #!/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... | bsd-3-clause |
ojengwa/odoo | addons/point_of_sale/account_bank_statement.py | 313 | 2159 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free... | agpl-3.0 |
odoomrp/odoomrp-wip | mrp_operations_rejected_quantity/models/operation_time_line.py | 8 | 1038 | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class OperationTimeLine(models.Model):
_inherit = 'operation.time.line'
@api.depends('accepted_amount', 'rejected_amount')
@api.multi... | agpl-3.0 |
coreynicholson/youtube-dl | youtube_dl/extractor/tube8.py | 48 | 2892 | from __future__ import unicode_literals
import re
from ..utils import (
int_or_none,
str_to_int,
)
from .keezmovies import KeezMoviesIE
class Tube8IE(KeezMoviesIE):
_VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.tube8... | unlicense |
andersonsilvade/python_C | Python32/Tools/pynche/ListViewer.py | 116 | 6648 | """ListViewer class.
This class implements an input/output view on the color model. It lists every
unique color (e.g. unique r/g/b value) found in the color database. Each
color is shown by small swatch and primary color name. Some colors have
aliases -- more than one name for the same r/g/b value. These aliases a... | mit |
pjgaudre/2016-IPSW-500px | Def500.py | 1 | 3315 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 17 10:26:55 2016
@author: davidc
"""
#!/usr/bin/python
import numpy as np
import pylab #image showing, an apendix to matplotlib
from PIL import Image, ImageChops
import pandas as pd #data package like read csv
import os
#import matplotlib.pyplot as plt #image showing... | mit |
dylan-reeves/home_backup | backupclient-env/Lib/hmac.py | 142 | 5063 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from _operator import _compare_digest as compare_digest
import hashlib as _hashlib
trans_5C = bytes((x ^ 0x5C) for x in range(256))
trans_36 = bytes((x ^ 0x36) fo... | gpl-3.0 |
andreparrish/python-for-android | python-build/python-libs/gdata/build/lib/gdata/data.py | 133 | 35748 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
matthaywardwebdesign/rethinkdb | external/v8_3.30.33.16/build/gyp/test/subdirectory/gyptest-SYMROOT-default.py | 399 | 1260 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... | agpl-3.0 |
cpadavis/SpaceWarps | analysis/swap/shannon.py | 3 | 5216 | #============================================================================
"""
NAME
shannon.py
PURPOSE
Methods for calculating various information gains during binary
classification.
COMMENTS
Copied from informationgain.py at
https://github.com/CitizenScienceInAstronomyWorkshop/Bureaucracy
... | mit |
mverzett/rootpy | examples/stats/plot_quantiles.py | 7 | 1986 | #!/usr/bin/env python
"""
=================================================
Draw a Quantile-Quantile Plot and Confidence Band
=================================================
This is an example of drawing a quantile-quantile plot with a confidence level
(CL) band.
"""
print(__doc__)
import ROOT
from rootpy.interactiv... | gpl-3.0 |
xujun10110/golismero | thirdparty_libs/django/utils/formats.py | 104 | 7799 | import decimal
import datetime
from django.conf import settings
from django.utils import dateformat, numberformat, datetime_safe
from django.utils.importlib import import_module
from django.utils.encoding import force_str
from django.utils.functional import lazy
from django.utils.safestring import mark_safe
from djang... | gpl-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/mutex.py | 21 | 1878 | """Mutual exclusion -- for use with module sched
A mutex has two pieces of state -- a 'locked' bit and a queue.
When the mutex is not locked, the queue is empty.
Otherwise, the queue contains 0 or more (function, argument) pairs
representing functions (or methods) waiting to acquire the lock.
When the mutex is unlocke... | gpl-3.0 |
ravibhure/ansible | lib/ansible/modules/windows/win_iis_virtualdirectory.py | 47 | 2485 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# 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 t... | gpl-3.0 |
cleinias/Homeo | src/VREP/vrep.py | 1 | 52447 | # This file is part of the REMOTE API
#
# Copyright 2006-2014 Dr. Marc Andreas Freese. All rights reserved.
# marc@coppeliarobotics.com
# www.coppeliarobotics.com
#
# The REMOTE API is licensed under the terms of GNU GPL:
#
# -------------------------------------------------------------------
# The REMOTE ... | gpl-3.0 |
probcomp/cgpm | src/uncorrelated/linear.py | 1 | 1827 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | apache-2.0 |
Permutatrix/servo | etc/ci/performance/download_buildbot_timings.py | 20 | 6836 | #!/usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import csv
from datetime import datetime, date
import json
from math import floo... | mpl-2.0 |
strauzen/haxe-sublime-bundle | tests/test.py | 2 | 2341 | import sublime, os, time
from functools import partial
from unittest import TestCase
version = sublime.version()
if version >= "3000":
from UnitTesting.unittesting import DeferrableTestCase
else:
from unittesting import DeferrableTestCase
# path to the Haxe package folder
root_path = os.path.dirname(os.path.... | apache-2.0 |
TensorVision/MediSeg | AP3/basic_local_classifier.py | 1 | 14922 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A basic classifier which uses only local features."""
import os.path
from PIL import Image
import scipy.misc
import scipy.ndimage
import logging
import sys
import time
import numpy as np
import json
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
... | mit |
anushbmx/kitsune | kitsune/questions/management/commands/update_weekly_votes.py | 1 | 1135 | from datetime import datetime, timedelta
from django.core.management.base import BaseCommand
from kitsune.questions.models import Question, QuestionVote
from kitsune.questions.tasks import update_question_vote_chunk
from kitsune.sumo.utils import chunked
class Command(BaseCommand):
help = "Keep the num_votes_pa... | bsd-3-clause |
digistam/recon-ng | libs/mechanize/_msiecookiejar.py | 134 | 14694 | """Microsoft Internet Explorer cookie loading on Windows.
Copyright 2002-2003 Johnny Lee <typo_pl@hotmail.com> (MSIE Perl code)
Copyright 2002-2006 John J Lee <jjl@pobox.com> (The Python port)
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the ... | gpl-3.0 |
TheCapleGuy/GoogleTest | test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/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... | bsd-3-clause |
Bysmyyr/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent_unittest.py | 2 | 10817 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import platform
import stat
import unittest
from telemetry import decorators
from telemetry.internal.platform.tracing_agent import chrome_tracing_a... | bsd-3-clause |
pernici/sympy | sympy/functions/special/bessel.py | 2 | 4464 | from math import pi
from sympy.core import sympify
from sympy.functions.elementary.trigonometric import sin, cos
def fn(n, z):
"""
Coefficients for the spherical Bessel functions.
Those are only needed in the jn() function.
The coefficients are calculated from:
fn(0, z) = 1/z
fn(1, z) = 1/z... | bsd-3-clause |
ghowland/gomh | _backups/gomh_002.py | 1 | 1296 | #!/usr/bin/env python
import pygame
import sys
sprite_size = [85/2, 112/2]
pygame.init()
size = (640, 480)
screen = pygame.display.set_mode(size)
pygame.display.set_caption('Get Off My Head')
#pygame.mouse.set_visible(0)
image = pygame.image.load('sf_sprites.png')
image = pygame.transform.scale(image, (image.get_w... | mit |
andre-senna/opencog | opencog/python/blending/src/decider/decide_best_sti.py | 22 | 3079 | from blending.src.decider.base_decider import BaseDecider
from blending.util.blending_config import BlendConfig
from blending.util.blending_error import blending_status
__author__ = 'DongMin Kim'
class DecideBestSTI(BaseDecider):
"""Blending decider that deciding to blend or not by checking the existence
of ... | agpl-3.0 |
GustavoHennig/ansible | test/units/modules/cloud/amazon/test_lambda.py | 47 | 11588 | #
# (c) 2017 Michael De La Rue
#
# 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... | gpl-3.0 |
SamYaple/ansible-modules-extras | cloud/cloudstack/cs_iso.py | 33 | 10741 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.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 Lice... | gpl-3.0 |
chaen/DIRAC | ResourceStatusSystem/Command/VOBOXAvailabilityCommand.py | 6 | 1936 | ''' VOBOXAvailabilityCommand module
'''
# FIXME: NOT Usable ATM
# missing doNew, doCache, doMaster
import urlparse
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.ResourceStatusSystem.Command.Command import Command
class VOBOXAvailabilityCommand(Command):
'''
Given... | gpl-3.0 |
Deepakpatle/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py | 118 | 7503 | # Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com>
#
# 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 t... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.