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 |
|---|---|---|---|---|---|
jrg365/gpytorch | gpytorch/utils/pivoted_cholesky.py | 1 | 3313 | #!/usr/bin/env python3
import torch
from .. import settings
def pivoted_cholesky(matrix, max_iter, error_tol=None):
from ..lazy import lazify, LazyTensor
batch_shape = matrix.shape[:-2]
matrix_shape = matrix.shape[-2:]
if error_tol is None:
error_tol = settings.preconditioner_tolerance.val... | mit |
raildo/nova | nova/api/openstack/compute/versionsV21.py | 40 | 1903 | # Copyright 2013 IBM Corp.
# 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 |
snapcore/snapcraft | tests/unit/sources/test_checksum.py | 1 | 2784 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
seocam/django | django/middleware/common.py | 10 | 7225 | import hashlib
import logging
import re
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core.mail import mail_managers
from django.utils import six
from django.utils.encoding import force_text
from django.utils.http import urlquote
logger = logging.getLogger('... | bsd-3-clause |
val2k/linux | Documentation/sphinx/load_config.py | 456 | 1333 | # -*- coding: utf-8; mode: python -*-
# pylint: disable=R0903, C0330, R0914, R0912, E0401
import os
import sys
from sphinx.util.pycompat import execfile_
# ------------------------------------------------------------------------------
def loadConfig(namespace):
# ------------------------------------------------------... | gpl-2.0 |
joariasl/odoo | addons/hw_scanner/controllers/main.py | 158 | 7486 | # -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
from os.path import join
from threading import Thread, Lock
from select import select
from Queue import Queue, Empty
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
from openerp import http
from openerp.http ... | agpl-3.0 |
Stanford-Online/edx-platform | lms/djangoapps/course_api/blocks/transformers/tests/test_student_view.py | 13 | 2550 | """
Tests for StudentViewTransformer.
"""
import ddt
# pylint: disable=protected-access
from openedx.core.djangoapps.content.block_structure.factory import BlockStructureFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import ToyCourseFactory
from... | agpl-3.0 |
simonluijk/django-localeurl | setup.py | 5 | 1568 | #!/usr/bin/env python
#
# Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
from setuptools import setup
import metadata
app_name = metadata.name
version = metadata.version
long_description = open('docs/index.rst').read().split('split here', 1)[0] + """
See the `full do... | mit |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/IPython/utils/codeutil.py | 5 | 1045 | # encoding: utf-8
"""Utilities to enable code objects to be pickled.
Any process that import this module will be able to pickle code objects. This
includes the func_code attribute of any function. Once unpickled, new
functions can be built using new.function(code, globals()). Eventually
we need to automate all of ... | bsd-3-clause |
inovtec-solutions/OpenERP | openerp/addons/account_cancel/__openerp__.py | 124 | 1653 | # -*- 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 |
riteshshrv/django | tests/view_tests/models.py | 281 | 1329 | """
Regression tests for Django built-in views.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolute_ur... | bsd-3-clause |
nomad-mystic/nomadmystic | fileSystem/school-projects/development/softwaredesignandcomputerlogiccis122/cis122lab2/python/Lab2.py | 1 | 2465 | # file = Lab2.py
# programmer = Keith Murphy
# date created = 1-15-2014
# last mod = 1-25-2014
#
# input_list:
# width_1, length_1, width_2, length_2
# output_list:
# rectangle_1_area, rectangle_2_area, average_area_of_rectangles
#
# Variables
# Declare real width_1
# Declare real length... | mit |
nox/servo | etc/ci/performance/test_runner.py | 66 | 14394 | #!/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 runner
import pytest
def test_log_parser():
mock_url = "http://localhost:8000/page_... | mpl-2.0 |
janusnic/python_koans | python3/koans/about_multiple_inheritance.py | 96 | 3944 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Slightly based on AboutModules in the Ruby Koans
#
from runner.koan import *
class AboutMultipleInheritance(Koan):
class Nameable:
def __init__(self):
self._name = None
def set_name(self, new_name):
self._name = new_name
... | mit |
jellysheep/pyload | tests/test_json.py | 41 | 1273 | # -*- coding: utf-8 -*-
from urllib import urlencode
from urllib2 import urlopen, HTTPError
from json import loads
from logging import log
url = "http://localhost:8001/api/%s"
class TestJson:
def call(self, name, post=None):
if not post: post = {}
post["session"] = self.key
u = urlopen(... | gpl-3.0 |
UManPychron/pychron | sandbox/revisual.py | 2 | 1179 | import hglib
from pylab import *
p = '/Users/ross/Programming/mercurial/pychron_dev/'
repo = hglib.open(p)
x, y = [], []
for l in repo.log():
i, rev, _, br, name, note, t = l
x.append(time.mktime(t.timetuple()))
y.append(float(i))
##plot(x[:200], y[:200])
x = array(x)
#y=array(y[::-1])
#
x -= x[-1]
##x=x[... | apache-2.0 |
insqur/fbpush | tests/test_main.py | 3 | 9393 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import mock
import os
import re
import time
import unittest
from fbpush import main, config
# Uncomment if you don't want to see the print messages
# in main.py printed ... | bsd-3-clause |
Timurdov/bionic | bionic/Lib/site-packages/django/contrib/comments/views/utils.py | 176 | 1980 | """
A few bits of helper functions for comment views.
"""
import textwrap
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, resolve_url
from django.template import RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.contrib import comments
from ... | apache-2.0 |
MSakamaki/compose | tests/unit/container_test.py | 52 | 5334 | from __future__ import unicode_literals
from .. import unittest
import mock
import docker
from compose.container import Container
from compose.container import get_container_name
class ContainerTest(unittest.TestCase):
def setUp(self):
self.container_dict = {
"Id": "abc",
"Image... | apache-2.0 |
mixman/djangodev | django/contrib/gis/gdal/tests/test_envelope.py | 332 | 3742 | from django.contrib.gis.gdal import Envelope, OGRException
from django.utils import unittest
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
... | bsd-3-clause |
gitaarik/django | tests/middleware/test_security.py | 23 | 7742 | from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase
from django.test.utils import override_settings
class SecurityMiddlewareTest(SimpleTestCase):
@property
def middleware(self):
from django.middleware.security import SecurityMiddleware
return SecurityMid... | bsd-3-clause |
chrisy/vpp | test/test_qos.py | 3 | 19807 | #!/usr/bin/env python3
import unittest
from framework import VppTestCase, VppTestRunner
from vpp_sub_interface import VppDot1QSubint
from vpp_ip import DpoProto
from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsRoute, \
VppMplsLabel, VppMplsTable, FibPathProto
import scapy.compat
from scapy.packet import... | apache-2.0 |
dongjoon-hyun/tensorflow | tensorflow/python/kernel_tests/string_split_op_test.py | 10 | 10285 | # 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 |
zploskey/servo | components/script/dom/bindings/codegen/parser/WebIDL.py | 50 | 268831 | # 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/.
""" A WebIDL parser. """
from ply import lex, yacc
import re
import os
import traceback
import math
import string
from ... | mpl-2.0 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/chrome/test/nacl_test_injection/buildbot_nacl_integration.py | 61 | 2538 | #!/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 subprocess
import sys
def Main(args):
pwd = os.environ.get('PWD', '')
is_integration_bot = 'nacl-chrome' in ... | apache-2.0 |
guorendong/iridium-browser-ubuntu | tools/vim/ninja_output.py | 39 | 2240 | # 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 os.path
import re
def GetNinjaOutputDirectory(chrome_root, configuration=None):
"""Returns <chrome_root>/<output_dir>/(Release|Debug).
... | bsd-3-clause |
iconoeugen/rb-xmpp-notification | rbxmppnotification/admin_urls.py | 1 | 1484 | #
# admin_urls.py
#
# Copyright (c) 2013 Horatiu Eugen Vlad
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, mod... | mit |
Lh4cKg/brython | www/src/Lib/test/unittests/encoded_modules/__init__.py | 179 | 1274 | # -*- encoding: utf-8 -*-
# This is a package that contains a number of modules that are used to
# test import from the source files that have different encodings.
# This file (the __init__ module of the package), is encoded in utf-8
# and contains a list of strings from various unicode planes that are
# encoded diffe... | bsd-3-clause |
dongjoon-hyun/tensorflow | tensorflow/python/keras/regularizers_test.py | 11 | 2941 | # 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 |
ThirdProject/android_external_chromium_org | third_party/tlslite/tlslite/utils/jython_compat.py | 358 | 5270 | """Miscellaneous functions to mask Python/Jython differences."""
import os
import sha
if os.name != "java":
BaseException = Exception
from sets import Set
import array
import math
def createByteArraySequence(seq):
return array.array('B', seq)
def createByteArrayZeros(howMany):
... | bsd-3-clause |
mkapolka/beautifulsoup4 | bs4/builder/_htmlparser.py | 412 | 8839 | """Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from HTMLParser import (
HTMLParser,
HTMLParseError,
)
import sys
import warnings
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to s... | mit |
renyi533/tensorflow | tensorflow/lite/python/optimize/calibrator_test.py | 3 | 7200 | # Lint as: python2, python3
# 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
#
... | apache-2.0 |
code-sauce/tensorflow | tensorflow/contrib/factorization/python/kernel_tests/wals_solver_ops_test.py | 14 | 3464 | # 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 applic... | apache-2.0 |
adobecs5/urp2015 | lib/python3.4/site-packages/pip/_vendor/lockfile/__init__.py | 475 | 9162 | """
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = LockFile('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'somefile', 'is locked already... | apache-2.0 |
illicitonion/givabit | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/django/conf/__init__.py | 146 | 6707 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import os
import re
import time # Needed for Windows
import... | apache-2.0 |
rubgombar1/sharing-cars | sharingcars/announcements/views.py | 1 | 9234 | from django.views.generic.edit import CreateView
from django.core.urlresolvers import reverse_lazy, reverse
from django.views.generic.list import ListView
from django.views.generic import DeleteView
from django.db.models import Q
from django.shortcuts import redirect
from django.views.generic.detail import DetailView
f... | gpl-3.0 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Stripe/Coupons/ListAllCoupons.py | 5 | 3528 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListAllCoupons
# Retrieves a a list of your coupons.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | gpl-2.0 |
appersonlabs/react-native | JSCLegacyProfiler/trace_data.py | 375 | 8013 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import unittest
"""
# _-----=> irqs-off
# / _----=> need-resched
# | / _---... | bsd-3-clause |
jazkarta/edx-platform-for-isc | common/djangoapps/external_auth/views.py | 8 | 38150 | import functools
import json
import logging
import random
import re
import string # pylint: disable=deprecated-module
import fnmatch
import unicodedata
import urllib
from textwrap import dedent
from external_auth.models import ExternalAuthMap
from external_auth.djangostore import DjangoOpenIDStore
from django.c... | agpl-3.0 |
wd5/jangr | south/exceptions.py | 21 | 4520 | from traceback import format_exception
class SouthError(RuntimeError):
pass
class BrokenMigration(SouthError):
def __init__(self, migration, exc_info):
self.migration = migration
self.exc_info = exc_info
if self.exc_info:
self.traceback = ''.join(format_exception(*self.exc... | bsd-3-clause |
rnder/data-science-from-scratch | code-python3/logistic_regression.py | 12 | 6055 | from collections import Counter
from functools import partial, reduce
from linear_algebra import dot, vector_add
from gradient_descent import maximize_stochastic, maximize_batch
from working_with_data import rescale
from machine_learning import train_test_split
from multiple_regression import estimate_beta, predict
imp... | unlicense |
katstalk/android_external_chromium_org | chrome/common/extensions/docs/server2/intro_data_source_test.py | 25 | 1163 | #!/usr/bin/env python
# Copyright 2013 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 intro_data_source import IntroDataSource
from server_instance import ServerInstance
from servlet import Request
from test_data.can... | bsd-3-clause |
ATIX-AG/ansible | lib/ansible/module_utils/k8s/raw.py | 30 | 8686 | #
# Copyright 2018 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | gpl-3.0 |
sarvex/django | django/contrib/gis/gdal/prototypes/geom.py | 450 | 4735 | from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.errcheck import check_envelope
from django.contrib.gis.gdal.prototypes.generation import (
const_string_... | bsd-3-clause |
badock/nova | nova/tests/monkey_patch_example/__init__.py | 120 | 1111 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
MSeifert04/numpy | numpy/distutils/msvc9compiler.py | 52 | 2258 | from __future__ import division, absolute_import, print_function
import os
from distutils.msvc9compiler import MSVCCompiler as _MSVCCompiler
from .system_info import platform_bits
def _merge(old, new):
"""Concatenate two environment paths avoiding repeats.
Here `old` is the environment string before the ba... | bsd-3-clause |
philcleveland/grpc | examples/python/multiplex/helloworld_pb2.py | 85 | 8146 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: helloworld.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 _message
from google.protobuf import reflection as _re... | bsd-3-clause |
scienceguyrob/KnownSourceMatcher | KnownSourceMatcher/src/Match/InputProcessor.py | 2 | 17679 | """
This file is part of the KnownSourceMatcher.
KnownSourceMatcher 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.
KnownSourceMatcher is d... | gpl-2.0 |
medspx/QGIS | python/plugins/processing/algs/grass7/ext/i_evapo_mh.py | 5 | 1555 | # -*- coding: utf-8 -*-
"""
***************************************************************************
i_evapo_mh.py
-------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************************... | gpl-2.0 |
maartenq/ansible | lib/ansible/plugins/action/synchronize.py | 16 | 19829 | # -*- coding: utf-8 -*-
# (c) 2012-2013, Timothy Appnel <tim@appnel.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
IllusionRom-deprecated/android_platform_tools_idea | python/lib/Lib/compiler/misc.py | 100 | 1806 |
def flatten(tup):
elts = []
for elt in tup:
if isinstance(elt, tuple):
elts = elts + flatten(elt)
else:
elts.append(elt)
return elts
class Set:
def __init__(self):
self.elts = {}
def __len__(self):
return len(self.elts)
def __contains__(s... | apache-2.0 |
goodwinnk/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/backends/oracle/creation.py | 620 | 2283 | from django.db.backends.oracle.creation import DatabaseCreation
from django.db.backends.util import truncate_name
class OracleCreation(DatabaseCreation):
def sql_indexes_for_field(self, model, f, style):
"Return any spatial index creation SQL for the field."
from django.contrib.gis.db.models.field... | apache-2.0 |
noblisnsp/volatility | volatility/plugins/overlays/mac/mac.py | 44 | 33471 | # Volatility
# Copyright (C) 2010 Brendan Dolan-Gavitt
# Copyright (c) 2011 Michael Cohen <scudette@gmail.com>
#
# This file is part of Volatility.
#
# Volatility 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... | gpl-2.0 |
enovance/edeploy | src/health_protocol.py | 3 | 3872 | #
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# Author: Erwan Velu <erwan.velu@enovance.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/li... | apache-2.0 |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/mfc/docview.py | 21 | 3765 | # document and view classes for MFC.
import win32ui
import win32con
import object
import window
class View(window.Wnd):
def __init__(self, initobj):
window.Wnd.__init__(self, initobj)
def OnInitialUpdate(self):
pass
# Simple control based views.
class CtrlView(View):
def __init__(self, doc, wndclass, style=0):... | apache-2.0 |
toomoresuch/pysonengine | parts/google_appengine/lib/django/django/middleware/common.py | 32 | 4505 | from django.conf import settings
from django import http
from django.core.mail import mail_managers
import md5
import re
class CommonMiddleware(object):
"""
"Common" middleware for taking care of some basic operations:
- Forbids access to User-Agents in settings.DISALLOWED_USER_AGENTS
- URL r... | mit |
jendap/tensorflow | tensorflow/contrib/tensorrt/custom_plugin_examples/__init__.py | 37 | 1081 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
seecr/seecr-test | seecr/test/calltrace.py | 1 | 6216 | ## begin license ##
#
# "Seecr Test" provides test tools.
#
# Copyright (C) 2005-2009 Seek You Too (CQ2) http://www.cq2.nl
# Copyright (C) 2012, 2019-2021 Seecr (Seek You Too B.V.) https://seecr.nl
#
# This file is part of "Seecr Test"
#
# "Seecr Test" is free software; you can redistribute it and/or modify
# it under ... | gpl-2.0 |
bluerover/6lbr | examples/6lbr/test/RouterLlsec.py | 1 | 1672 | #!/usr/bin/python2.7
import unittest
import config
from time import sleep
class RouterLlsec(config.scenarios, unittest.TestCase):
def modeSetUp(self):
config.security_layer=1
self.support.backbone.prefix=config.eth_prefix
self.support.wsn.prefix=config.wsn_prefix
self.br = self.sup... | bsd-3-clause |
efortuna/AndroidSDKClone | ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_htmlparser.py | 50 | 24838 | """Tests for HTMLParser.py."""
import HTMLParser
import pprint
import unittest
from test import test_support
class EventCollector(HTMLParser.HTMLParser):
def __init__(self):
self.events = []
self.append = self.events.append
HTMLParser.HTMLParser.__init__(self)
def get_events(self):
... | apache-2.0 |
Prashant-Surya/addons-server | src/olympia/translations/hold.py | 52 | 1401 | from threading import local
from django.core.signals import request_finished
_to_save = local()
def add_translation(key, translation):
"""
Queue a translation that needs to be saved for a particular object. To
generate the key, call make_key.
"""
if not hasattr(_to_save, 'translations'):
... | bsd-3-clause |
hojel/calibre | src/calibre/ebooks/metadata/library_thing.py | 24 | 5539 | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
'''
Fetch cover from LibraryThing.com based on ISBN number.
'''
import sys, re
from lxml import html
import mechanize
from calibre import browser, prints, random_user_agent
from calibre.utils.config import OptionParser
from calibr... | gpl-3.0 |
OpenUpgrade-dev/OpenUpgrade | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py | 381 | 5849 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
sepehr125/pybrain | examples/rl/environments/ode/acrobot_pgpe.py | 30 | 2788 | #!/usr/bin/env python
#########################################################################
# Reinforcement Learning with PGPE on the Acrobot Environment
#
# The Acrobot Environment is a 1 DoF system.
# The goal is to swing up the pole and balance it.
# The motor is underpowered so that the pole can not go directl... | bsd-3-clause |
h4ck3rm1k3/gcc-python-plugin-1 | tests/plugin/types/script.py | 3 | 1982 | # Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This 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) a... | gpl-3.0 |
swarna-k/MyDiary | flask/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_results.py | 155 | 6685 | from .. import fixtures, config
from ..config import requirements
from .. import exclusions
from ..assertions import eq_
from .. import engines
from sqlalchemy import Integer, String, select, util, sql, DateTime
import datetime
from ..schema import Table, Column
class RowFetchTest(fixtures.TablesTest):
__backend... | bsd-3-clause |
vivek8943/python | python-twisted/examples/revoke.py | 3 | 1029 | ## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
import sys
from pubnub import PubnubTwisted as Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'pam'
subscrib... | mit |
kmoocdev/edx-platform | pavelib/utils/test/suites/acceptance_suite.py | 8 | 5161 | """
Acceptance test suite
"""
from paver.easy import sh, call_task
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites import TestSuite
from pavelib.utils.envs import Env
__test__ = False # do not collect
class AcceptanceTest(TestSuite):
"""
A class for running lettuce acceptan... | agpl-3.0 |
labordoc/labordoc-next | modules/miscutil/lib/pep8.py | 48 | 29248 | #!/usr/bin/python
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
#
# 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... | gpl-2.0 |
sam-m888/gprime | gprime/datehandler/test/dateparser_test.py | 1 | 4932 | # -*- coding: utf-8 -*-
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2013 Vassilii Khachaturov
#
# 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 Lic... | gpl-2.0 |
mpare002/HackTech_2017 | env/Lib/site-packages/flask/sessions.py | 428 | 13107 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... | mit |
catmiao/trading-with-python | cookbook/ib_logQuotes.py | 77 | 4901 | '''
Created on May 5, 2013
Copyright: Jev Kuznetsov
License: BSD
Program to log tick events to a file
example usage:
> python ib_logQuotes.py SPY,VXX,XLE
start with -v option to show all incoming events
'''
import argparse # command line argument parser
import datetime as dt # dat... | bsd-3-clause |
sstone/bitcoin | test/functional/wallet_orphanedreward.py | 10 | 2453 | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test orphaned block rewards in the wallet."""
from test_framework.test_framework import BitcoinTestFra... | mit |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Tools/scripts/findlinksto.py | 100 | 1070 | #! /usr/bin/env python
# findlinksto
#
# find symbolic links to a path matching a regular expression
import os
import sys
import re
import getopt
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], '')
if len(args) < 2:
raise getopt.GetoptError('not enough arguments', None)
... | mit |
edulramirez/nova | nova/service.py | 17 | 16199 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
Jollytown/Garuda | server/garuda/lib/python2.7/site-packages/pip/_vendor/progress/bar.py | 404 | 2707 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | mit |
gokamoto/personal-website | lib/werkzeug/posixemulation.py | 319 | 3543 | # -*- coding: utf-8 -*-
r"""
werkzeug.posixemulation
~~~~~~~~~~~~~~~~~~~~~~~
Provides a POSIX emulation for some features that are relevant to
web applications. The main purpose is to simplify support for
systems such as Windows NT that are not 100% POSIX compatible.
Currently this only imple... | apache-2.0 |
brainelectronics/towerdefense | _build/lib/pyglet/libs/win32/constants.py | 40 | 119970 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
mic4ael/indico | indico/migrations/versions/20181025_1148_ec410be271df_make_room_attributes_global.py | 3 | 3603 | """Make room attributes global
Revision ID: ec410be271df
Revises: 27c45c384d65
Create Date: 2018-10-25 11:48:39.958768
"""
import sqlalchemy as sa
from alembic import context, op
# revision identifiers, used by Alembic.
revision = 'ec410be271df'
down_revision = '27c45c384d65'
branch_labels = None
depends_on = None
... | mit |
AnderEnder/ansible-modules-extras | system/ohai.py | 77 | 1693 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, 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... | gpl-3.0 |
iesugrace/tree | view.py | 1 | 17773 | """
Author: Joshua Chen
Date: 2015-12-30
Location: Shenzhen
Desc: Application that makes use of the acl library
to maintain a View database.
"""
from lib import *
from acl import *
import re
import sys
class View:
""" Represents a view entry in the view database.
When we process the view config, only the view... | gpl-2.0 |
bcdev/beam | beam-python/src/main/resources/beampy-tests/beampy_product_test.py | 2 | 3175 | import unittest
import array
import sys
import numpy as np
import beampy
JAI = beampy.jpy.get_type('javax.media.jai.JAI')
JAI.getDefaultInstance().getTileCache().setMemoryCapacity(128 * 1000 * 1000)
test_product_file = './MER_RR__1P.N1'
class TestBeamIO(unittest.TestCase):
def setUp(self):
self.produc... | gpl-3.0 |
SuperCowPowers/workbench | workbench/server/workbench_server.py | 2 | 34220 |
"""Workbench: Open Source Security Framework """
# Okay this monkey patch call needs to be first
# Note: The thread=False parameters appears to be needed
# for MongoDB, if you know a better way please do PR :)
from gevent import monkey; monkey.patch_all(thread=False) # Monkey!
from gevent import signal as geven... | mit |
redhat-openstack/cinder | cinder/tests/test_hp_msa.py | 4 | 25083 | # (c) Copyright 2014 Objectif Libre
#
# 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 |
synconics/odoo | addons/base_gengo/res_company.py | 321 | 1890 | # -*- 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 |
cloudnull/ansible | lib/ansible/playbook/role/metadata.py | 31 | 3358 | # (c) 2014 Michael DeHaan, <michael@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 option) any later ve... | gpl-3.0 |
MaYaSeVeN/Reverse-IP-Bing-API | reverseIP.py | 1 | 8382 | # -*- coding: utf-8 -*-
__author__ = 'Nop Phoomthaisong (aka @MaYaSeVeN)'
__version__ = 'reverseIP version 1.0 ( http://mayaseven.com )'
import urllib
import urllib2
import json
import re
import sys
import optparse
import socket
def main():
print "\n" + __version__
usage = "Usage: python " + sys.argv[
... | gpl-2.0 |
mpenning/exscript | src/TkExscript/QueueWidget.py | 6 | 5168 | # Copyright (C) 2007-2010 Samuel Abels.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | gpl-2.0 |
bokeh/bokeh | tests/unit/bokeh/core/test_templates.py | 1 | 3107 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
gbtian/mptcp | 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 |
chmanchester/firefox-ui-tests | firefox_puppeteer/ui/toolbars.py | 1 | 13343 | # 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/.
from marionette import Wait, By
from ..api.keys import Keys
from ..api.l10n import L10n
from ..base import BaseLib
from... | mpl-2.0 |
OSSESAC/odoopubarquiluz | openerp/osv/expression.py | 17 | 57080 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
msabramo/node-gyp | legacy/tools/gyp/pylib/gyp/generator/gypd.py | 912 | 3325 | # 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | mit |
cogeorg/BlackRhino | examples/Georg2012/production/networkx/algorithms/operators/tests/test_unary.py | 10 | 1163 | from nose.tools import *
import networkx as nx
from networkx import *
def test_complement():
null=null_graph()
empty1=empty_graph(1)
empty10=empty_graph(10)
K3=complete_graph(3)
K5=complete_graph(5)
K10=complete_graph(10)
P2=path_graph(2)
P3=path_graph(3)
P5=path_graph(5)
P10=p... | gpl-3.0 |
andymckay/addons-server | src/olympia/stats/db.py | 22 | 1506 | from django.db import models
import phpserialize as php
import json
class StatsDictField(models.TextField):
description = 'A dictionary of counts stored as serialized php or json.'
__metaclass__ = models.SubfieldBase
def db_type(self, connection):
return 'text'
def to_python(self, value):
... | bsd-3-clause |
Branlala/docker-sickbeardfr | sickbeard/sickbeard/clients/requests/packages/urllib3/response.py | 227 | 7410 | # urllib3/response.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import gzip
import logging
import zlib
from io import BytesIO
from .exceptions import Decode... | mit |
wdmchaft/taskcoach | taskcoachlib/gui/dialog/preferences.py | 1 | 19285 | # -*- coding: UTF-8 -*-
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org>
Copyright (C) 2008 Rob McMullen <rob.mcmullen@gmail.com>
Task Coach is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License ... | gpl-3.0 |
Technocaveman/There-is-no-Third-Step | node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/bw.py | 364 | 1355 | # -*- coding: utf-8 -*-
"""
pygments.styles.bw
~~~~~~~~~~~~~~~~~~
Simple black/white only style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, Strin... | mit |
ProjectSWGCore/NGECore2 | scripts/mobiles/generic/faction/imperial/nova_trooper_medic.py | 2 | 1888 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from resources.datatables import FactionStatus
from java.util import Vector
def addTemplate(co... | lgpl-3.0 |
FireBladeNooT/Medusa_1_6 | lib/sqlalchemy/orm/dependency.py | 55 | 46192 | # orm/dependency.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Relationship dependencies.
"""
from .. import sql, util, exc as sa_exc
from .... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.