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 |
|---|---|---|---|---|---|
makaaso/aws-lambda-tools | autoscaling-adjust-size/docutils/transforms/writer_aux.py | 116 | 2609 | # $Id: writer_aux.py 7320 2012-01-19 22:33:02Z milde $
# Author: Lea Wiemann <LeWiemann@gmail.com>
# Copyright: This module has been placed in the public domain.
"""
Auxiliary transforms mainly to be used by Writer components.
This module is called "writer_aux" because otherwise there would be
conflicting imports lik... | mit |
Justin-Yuan/Image2Music-Generator | library/jython2.5.3/Lib/distutils/dir_util.py | 7 | 8084 | """distutils.dir_util
Utility functions for manipulating directories and directory trees."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import os, sys
from types import *
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache fo... | gpl-2.0 |
4talesa/rethinkdb | external/v8_3.30.33.16/build/gyp/test/additional-targets/gyptest-additional.py | 139 | 1530 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple actions when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('all.g... | agpl-3.0 |
broxtronix/distributed | distributed/diagnostics/progress.py | 1 | 9766 | from __future__ import print_function, division, absolute_import
from collections import defaultdict
import logging
import sys
import threading
import time
from timeit import default_timer
import dask
from toolz import valmap, groupby, concat
from tornado.ioloop import PeriodicCallback, IOLoop
from tornado import gen... | bsd-3-clause |
woodshop/chainer | tests/functions_tests/test_sigmoid_cross_entropy.py | 7 | 2636 | import math
import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
if cuda.available:
cuda.init()
class TestSigmoidCrossE... | mit |
ar7z1/ansible | lib/ansible/module_utils/facts/virtual/netbsd.py | 197 | 1833 | # 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 in the hope that ... | gpl-3.0 |
chrisidefix/devide | snippets/rotateCameraIncreaseIsovalue.py | 7 | 1655 | # this snippet will rotate the camera in the slice3dVWR that you have
# selected whilst slowly increasing the isovalue of the marchingCubes that
# you have selected and dump every frame as a PNG to the temporary directory
# this is ideal for making movies of propagating surfaces in distance fields
# 1. right click on ... | bsd-3-clause |
codrut3/tensorflow | tensorflow/python/ops/distributions/bijector_impl.py | 19 | 29676 | # 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 |
iojancode/botija | plug.livolo.py | 1 | 1887 | import time
import sys
import RPi.GPIO as GPIO
off = '1242424352424342424242424242425342524342'
b0 = '12424243524243424242424242424242424242424242'
b1 = '124242435242434242424242424242534242424242'
b2 = '1242424352424342424242424242425353424242'
b3 = '124242435242434242424242424242424253424242'
b4 = '12424243524243424... | gpl-3.0 |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/test/test_copyreg.py | 12 | 4135 | import copyreg
import unittest
from test.pickletester import ExtensionSaver
class C:
pass
class WithoutSlots(object):
pass
class WithWeakref(object):
__slots__ = ('__weakref__',)
class WithPrivate(object):
__slots__ = ('__spam',)
class WithSingleString(object):
__slots__ = 'spam'
class WithI... | apache-2.0 |
dawnpower/nova | nova/tests/unit/objects/test_floating_ip.py | 65 | 11358 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
chintak/scikit-image | skimage/segmentation/_clear_border.py | 22 | 2072 | import numpy as np
from scipy.ndimage import label
def clear_border(image, buffer_size=0, bgval=0):
"""Clear objects connected to image border.
The changes will be applied to the input image.
Parameters
----------
image : (N, M) array
Binary image.
buffer_size : int, optional
... | bsd-3-clause |
KunihikoKido/sublime-elasticsearch-client | lib/requests/cookies.py | 413 | 17191 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
# grr, pyflakes... | mit |
flipdazed/SoftwareDevelopment | common.py | 1 | 10121 | #!/usr/bin/env python
# encoding: utf-8
# contains the common actions
import random
from logs import *
class Card(object):
"""Creates the card objects used in game"""
def __init__(self, name, attack, money, cost, name_padding=15, num_padding=2):
self.name = name
self.cost = cost
self.... | gpl-3.0 |
DirectXMan12/nova-hacking | nova/weights.py | 22 | 2385 | # Copyright (c) 2011-2012 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
#
# Un... | apache-2.0 |
tnagorra/nspell | lib/misc.py | 1 | 2396 | # cython: language_level=3
import re
class Mreplace:
def __init__(self, mydict):
self._mydict = mydict
self._rx = re.compile('|'.join(map(re.escape, self._mydict)))
def replace(self, text):
return self._rx.sub(lambda x: self._mydict[x.group(0)], text)
class Mmatch:
def __init__(s... | gpl-3.0 |
simonwydooghe/ansible | lib/ansible/modules/network/fortios/fortios_wireless_controller_bonjour_profile.py | 7 | 12583 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... | gpl-3.0 |
ChristinaZografou/sympy | sympy/parsing/sympy_parser.py | 29 | 32979 | """Transform a string with Python-like source code into SymPy expression. """
from __future__ import print_function, division
from .sympy_tokenize import \
generate_tokens, untokenize, TokenError, \
NUMBER, STRING, NAME, OP, ENDMARKER
from keyword import iskeyword
import ast
import re
import unicodedata
im... | bsd-3-clause |
diegoguimaraes/django | tests/admin_widgets/tests.py | 8 | 53006 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime, timedelta
import gettext
from importlib import import_module
import os
from unittest import TestCase, skipIf
try:
import pytz
except ImportError:
pytz = None
from django import forms
from django.conf import setting... | bsd-3-clause |
MartinHjelmare/home-assistant | homeassistant/components/tellstick/sensor.py | 7 | 4038 | """Support for Tellstick sensors."""
import logging
from collections import namedtuple
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import TEMP_CELSIUS, CONF_ID, CONF_NAME
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.conf... | apache-2.0 |
Dave667/service | script.video.F4mProxy/lib/utils/openssl_tripledes.py | 202 | 1788 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""OpenSSL/M2Crypto 3DES implementation."""
from .cryptomath import *
from .tripledes import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_TripleDES(key, mode, IV)
class OpenSSL_TripleDES(... | gpl-2.0 |
bordeltabernacle/python_koans | python2/libs/mock.py | 249 | 8036 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2009 Michael Foord
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 0.6.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts maintained at h... | mit |
controlzee/three.js | utils/exporters/blender/addons/io_three/exporter/api/animation.py | 177 | 16103 | """
Module for handling the parsing of skeletal animation data.
"""
import math
import mathutils
from bpy import data, context
from .. import constants, logger
def pose_animation(armature, options):
"""Query armature animation using pose bones
:param armature:
:param options:
:returns: list dictiona... | mit |
dkkline/CanSat14-15 | feeder/feeder.py | 1 | 3082 | """
Contains a tornado-based WebSocket server in charge of supplying
connected clients with live or replay data.
"""
import tornado.ioloop
import tornado.web
import tornado.websocket
from collections import deque
from pprint import pprint
import json
from .config import CACHE_SIZE, PORT, FREQUENCY
from groundstat... | mit |
panthorstudios/Gold-Rush | oldgame.py | 1 | 10225 | from random import random
from random import randint
import pygame
from pygame.locals import *
from miner import Miner
from explosion import Explosion
class Game(object):
TITLE = "Gold Rush!"
BOARD_LEFT = 20
BOARD_TOP = 130
SQUARE_SIZE = 32
BLACK = (0,0,0)
GREEN=(128,255,128)
YELLOW=(255,2... | mit |
cwilson1031/omaha | site_scons/site_tools/wix.py | 63 | 5679 | """SCons.Tool.wix
Tool-specific initialization for wix, the Windows Installer XML Tool.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 T... | apache-2.0 |
mpatacchiola/dissecting-reinforcement-learning | src/6/multi-armed-bandit/boltzman_agent_bandit.py | 1 | 4551 | #!/usr/bin/env python
# MIT License
# Copyright (c) 2017 Massimiliano Patacchiola
# https://mpatacchiola.github.io/blog/
#
# 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... | mit |
BehavioralInsightsTeam/edx-platform | openedx/core/djangoapps/site_configuration/tests/test_middleware.py | 22 | 5267 | # -*- coding: utf-8 -*-
"""
Test site_configuration middleware.
"""
import ddt
from mock import patch
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from student.tests.factories import UserFactory
from microsite_c... | agpl-3.0 |
oesteban/phantomas | phantomas/utils/shm.py | 1 | 6453 | """
This module contains an implementation of the real, antipodally symmetric
Spherical Harmonics basis as defined in [1]_.
References
----------
.. [1] Descoteaux, Maxime, Elaine Angelino, Shaun Fitzgibbons, and Rachid
Deriche. "Regularized, fast, and robust analytical Q-ball imaging"
Magnetic Resonance in Med... | bsd-3-clause |
ropik/chromium | chrome/test/functional/chromeos_ephemeral.py | 6 | 9687 | # 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 logging
import os
import sys
import pyauto_functional # Must come before pyauto (and thus, policy_base).
import policy_base
sys.path.append('/u... | bsd-3-clause |
ojengwa/oh-mainline | vendor/packages/python-social-auth/social/backends/xing.py | 83 | 1519 | """
XING OAuth1 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/xing.html
"""
from social.backends.oauth import BaseOAuth1
class XingOAuth(BaseOAuth1):
"""Xing OAuth authentication backend"""
name = 'xing'
AUTHORIZATION_URL = 'https://api.xing.com/v1/authorize'
REQUEST_TOKEN_URL = 'ht... | agpl-3.0 |
sinisterrook/arduinojavatomaven | arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/poolmanager.py | 168 | 6142 | # urllib3/poolmanager.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 logging
from ._collections import RecentlyUsedContainer
from .connectionpool import... | gpl-2.0 |
richo/rust | src/etc/snapshot.py | 4 | 7922 | # Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or ht... | apache-2.0 |
sassoftware/mint | mint/db/mirror.py | 1 | 5677 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 |
epic-math/sfvue3 | registration-should-be-restored/tests/urls.py | 138 | 4645 | """
URLs used in the unit tests for django-registration.
You should not attempt to use these URLs in any sort of real or
development environment; instead, use
``registration/backends/default/urls.py``. This URLconf includes those
URLs, and also adds several additional URLs which serve no purpose
other than to test tha... | mit |
gechong/XlsxWriter | xlsxwriter/test/comparison/test_table07.py | 8 | 1123 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
Jerry-X-Meng/AlphaBoxPlus | u-boot/tools/patman/get_maintainer.py | 57 | 1238 | # Copyright (c) 2012 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import command
import gitutil
import os
def FindGetMaintainer():
"""Look for the get_maintainer.pl script.
Returns:
If the script is found we'll return a path to it; else None.
"""
try_list = [
os.pa... | gpl-3.0 |
Lujeni/ansible | lib/ansible/modules/cloud/memset/memset_dns_reload.py | 44 | 5850 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
# 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... | gpl-3.0 |
romain-dartigues/ansible | lib/ansible/module_utils/network/voss/voss.py | 63 | 7726 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
kouaw/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/clipfish.py | 17 | 1626 | from __future__ import unicode_literals
import re
import time
import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_duration,
)
class ClipfishIE(InfoExtractor):
IE_NAME = 'clipfish'
_VALID_URL = r'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id... | gpl-3.0 |
xtmhm2000/scrapy-0.22 | scrapy/contrib/pipeline/files.py | 4 | 11536 | """
Files Pipeline
"""
import hashlib
import os
import os.path
import rfc822
import time
import urlparse
from collections import defaultdict
from cStringIO import StringIO
from twisted.internet import defer, threads
from scrapy import log
from scrapy.contrib.pipeline.media import MediaPipeline
from scrapy.exceptions... | bsd-3-clause |
ikben/troposphere | examples/Route53_RoundRobin.py | 1 | 1994 | # Converted from Route53_RoundRobin.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
from troposphere import Join
from troposphere import Parameter, Ref, Template
from troposphere.route53 import RecordSet, RecordSetGroup
t = Template()
t.set_description(
"AWS CloudFormat... | bsd-2-clause |
cloudtools/troposphere | troposphere/applicationautoscaling.py | 1 | 3322 | from . import AWSObject, AWSProperty
from .validators import boolean, double, integer, positive_integer
class ScalableTargetAction(AWSProperty):
props = {
"MaxCapacity": (integer, False),
"MinCapacity": (integer, False),
}
class ScheduledAction(AWSProperty):
props = {
"EndTime": ... | bsd-2-clause |
eayunstack/neutron | neutron/tests/functional/agent/linux/test_keepalived.py | 3 | 4049 | # Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
ShassAro/ShassAro | Bl_project/blVirtualEnv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 319 | 1348 | from socket import error as SocketError
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dr... | gpl-2.0 |
wanghao-xznu/uboot-imx | tools/patman/checkpatch.py | 31 | 6898 | # Copyright (c) 2011 The Chromium OS Authors.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# 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
# t... | gpl-2.0 |
Teagan42/home-assistant | homeassistant/components/demo/lock.py | 3 | 1862 | """Demo lock platform that has two fake locks."""
from homeassistant.components.lock import SUPPORT_OPEN, LockDevice
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Demo lock platform."""
async_ad... | apache-2.0 |
SUSE-Cloud/nova | plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py | 14 | 14138 | # Copyright (c) 2012 OpenStack Foundation
#
# 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 |
jorsea/odoo-addons | sale_add_products_wizard/wizard/sale_order_wizard.py | 3 | 1526 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
class sa... | agpl-3.0 |
eddiejessup/nex | tests/test_lexer.py | 1 | 4285 | from nex.constants.codes import CatCode
from nex.accessors import Codes
from nex.lexer import Lexer
class DummyCatCodeGetter:
def __init__(self):
self.char_to_cat = Codes.default_initial_cat_codes()
def get(self, char):
return self.char_to_cat[char]
def lex_string_to_tokens(s):
cat_cod... | mit |
Shaun-duplessis79/mongoose | bindings/python/mongoose.py | 106 | 5281 | # Copyright (c) 2004-2009 Sergey Lyubka
#
# 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, modify, merge, publ... | mit |
sysbot/CouchPotatoServer | libs/tornado/platform/asyncio.py | 10 | 4943 | """Bridges between the `asyncio` module and Tornado IOLoop.
This is a work in progress and interfaces are subject to change.
To test:
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOMainLoop
(the tests log a f... | gpl-3.0 |
sportorg/pysport | sportorg/modules/winorient/winorient_server.py | 1 | 2292 | import datetime
from socket import *
from sportorg.utils.time import time_to_hhmmss
"""
Format of WDB data package
- length is 1772 bytes
1) 36b text block at the beginning
2 4132500 0 0 3974600\n
bib - finish_time - disqual_status - 0 - start_time
2) binary part
bytes 128-131 - card number
by... | gpl-3.0 |
agiliq/django | django/template/loaders/app_directories.py | 89 | 2231 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.apps import apps
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
f... | bsd-3-clause |
kontais/EFI-MIPS | ToolKit/cmds/python/Lib/Queue.py | 13 | 5880 | """A multi-producer, multi-consumer queue."""
from time import time as _time
from collections import deque
__all__ = ['Empty', 'Full', 'Queue']
class Empty(Exception):
"Exception raised by Queue.get(block=0)/get_nowait()."
pass
class Full(Exception):
"Exception raised by Queue.put(block=0)/put_nowait().... | bsd-3-clause |
hobarrera/django | tests/view_tests/tests/test_i18n_deprecated.py | 33 | 10468 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import gettext
import json
from os import path
from django.conf import settings
from django.test import (
SimpleTestCase, ignore_warnings, modify_settings, override_settings,
)
from django.test.selenium import SeleniumTestCase
from django.utils import... | bsd-3-clause |
pawelld/webias | webias/gnosis/xml/pickle/test/test_bltin.py | 3 | 2268 |
#
# basic test using only builtins --fpm
#
# (good diagnostic when I break things :-)
#
from types import *
import gnosis.xml.pickle as xml_pickle
from gnosis.xml.pickle.util import setInBody
import funcs
funcs.set_parser()
class foo_class:
def __init__(self):
pass
def checkfoo(o1,o2):
"Check tha... | agpl-3.0 |
nvoron23/scikit-learn | sklearn/svm/classes.py | 126 | 40114 | import warnings
import numpy as np
from .base import _fit_liblinear, BaseSVC, BaseLibSVM
from ..base import BaseEstimator, RegressorMixin
from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \
LinearModel
from ..feature_selection.from_model import _LearntSelectorMixin
from ..utils import check_X... | bsd-3-clause |
alonsebastian/SocialID | urls.py | 1 | 1921 | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^accounts/login/$', 'accounts.views.customLogin'),
(r'^accounts/logou... | gpl-2.0 |
copelco/Durham-Open-Data-Catalog | fabfile.py | 1 | 9452 | import ConfigParser
import os
import re
import yaml
from argyle import rabbitmq, postgres, nginx, system
from argyle.base import upload_template
from argyle.postgres import create_db_user, create_db
from argyle.supervisor import supervisor_command, upload_supervisor_app_conf
from argyle.system import service_command, ... | mit |
Endika/server-tools | auth_from_http_remote_user/__openerp__.py | 23 | 1396 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Laurent Mignon
# Copyright 2014 'ACSONE SA/NV'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
jpcy/bgfx | 3rdparty/spirv-headers/include/spirv/1.0/spirv.py | 54 | 27578 | # Copyright (c) 2014-2018 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and/or associated documentation files (the "Materials"),
# to deal in the Materials without restriction, including without limitation
# the rights to use, copy, modify, m... | bsd-2-clause |
BeATz-UnKNoWN/python-for-android | python-build/python-libs/gdata/src/gdata/urlfetch.py | 276 | 9330 | #!/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 |
windedge/odoomrp-wip | mrp_production_project_estimated_cost/models/product.py | 19 | 1154 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | agpl-3.0 |
thaim/ansible | lib/ansible/modules/network/fortios/fortios_system_replacemsg_spam.py | 13 | 10063 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... | mit |
googleapis/python-compute | google/cloud/compute_v1/services/target_pools/pagers.py | 1 | 5656 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
keyme/visual-diff | gui.py | 1 | 4290 | #!/usr/bin/python3
from functools import partial
from math import ceil
import tkinter as tk
from zoom_map import ZoomMap
class _Context(tk.Text):
CONTEXT_COUNT = 3 # Lines to display before/after the current one
# TODO: What about files with over 99,999 lines?
LINE_NUMBER_WIDTH = 5 # Number of charact... | gpl-3.0 |
salexkidd/restframework-definable-serializer | definable_serializer/tests/for_test/migrations/0001_initial.py | 1 | 1872 | # Generated by Django 2.0 on 2017-12-04 00:09
import definable_serializer.models.compat
import definable_serializer.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [... | mit |
kmee/stock-logistics-warehouse | stock_available_sale/models/product_product.py | 5 | 4972 | # -*- coding: utf-8 -*-
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from collections import Counter
from openerp import models, api, fields
import openerp.addons.decimal_precision as dp
class ProductProduct(models.Model):
"""Add the computation for the stock a... | agpl-3.0 |
iamjy/beaglebone-kernel | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
DucQuang1/youtube-dl | youtube_dl/extractor/nosvideo.py | 128 | 2519 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
urlencode_postdata,
xpath_text,
xpath_with_ns,
)
_x = lambda p: xpath_with_ns(p, {'xspf': 'http://xspf.org/ns/0... | unlicense |
losalamos/PowerParser | docs/breathe-3.2.0/breathe/parser/doxygen/compoundsuper.py | 2 | 237779 | #!/usr/bin/env python
#
# Generated Thu Jun 11 18:44:25 2009 by generateDS.py.
#
import sys
import getopt
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following cl... | apache-2.0 |
PlushBeaver/FanFicFare | included_dependencies/six.py | 320 | 27344 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... | gpl-3.0 |
cobalys/django | django/utils/daemonize.py | 13 | 1911 | import os
import sys
if os.name == 'posix':
def become_daemon(our_home_dir='.', out_log='/dev/null',
err_log='/dev/null', umask=022):
"Robustly turn into a UNIX daemon, running in our_home_dir."
# First fork
try:
if os.fork() > 0:
sys.exit(0... | bsd-3-clause |
jamesblunt/sympy | sympy/assumptions/handlers/sets.py | 14 | 20791 | """
Handlers for predicates related to set membership: integer, rational, etc.
"""
from __future__ import print_function, division
from sympy.assumptions import Q, ask
from sympy.assumptions.handlers import CommonHandler, test_closed_group
from sympy.core.logic import fuzzy_not
from sympy.core.numbers import pi
from s... | bsd-3-clause |
bobrock/eden | modules/s3db/workflow.py | 13 | 3277 | # -*- coding: utf-8 -*-
"""
S3 Workflow Engine Data Model
@copyright: 2012-2015 (c) Sahana Software Foundation
@license: MIT
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 wit... | mit |
sorenk/ansible | lib/ansible/module_utils/facts/default_collectors.py | 55 | 7579 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
alajara/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_request.py | 109 | 2919 | import unittest
import wptserve
from .base import TestUsingServer
class TestInputFile(TestUsingServer):
def test_seek(self):
@wptserve.handlers.handler
def handler(request, response):
rv = []
f = request.raw_input
f.seek(5)
rv.append(f.read(2))
... | mpl-2.0 |
kamar42/merdeka-backend | merdeka/apps/mdk/views.py | 1 | 2179 | from django.shortcuts import render
from merdeka.apps.utils.func import find_model, make_response, json_response, jsonify, set_data, set_status, set_message, set_child
from .models import GoodsChilds
def api_view(request, **kwargs):
resp = make_response()
m = kwargs.get('model', None)
# drop if model is e... | mit |
shinglyu/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake_hybi00.py | 466 | 17345 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
ryfeus/lambda-packs | Lxml_requests/source/wheel/signatures/__init__.py | 565 | 3779 | """
Create and verify jws-js format Ed25519 signatures.
"""
__all__ = [ 'sign', 'verify' ]
import json
from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary
ed25519ll = None
ALG = "Ed25519"
def get_ed25519ll():
"""Lazy import-and-test of ed25519 module"""
global ed25519ll
if not ... | mit |
ryfeus/lambda-packs | Lxml_requests/source/google/protobuf/internal/import_test_package/__init__.py | 165 | 1768 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | mit |
ccomb/OpenUpgrade | addons/hr_expense/report/__init__.py | 380 | 1071 | # -*- 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 |
GeoCat/QGIS | python/plugins/processing/algs/grass7/ext/i_in_spotvgt.py | 15 | 1336 | # -*- coding: utf-8 -*-
"""
***************************************************************************
i_in_spotvgt.py
---------------
Date : April 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
*******************************... | gpl-2.0 |
apanju/odoo | addons/point_of_sale/report/pos_lines.py | 230 | 2464 | # -*- 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 |
emedinaa/contentbox | third_party/django_summernote/tests.py | 5 | 6465 | # -*- coding: utf-8 -*-
from django.contrib.admin.sites import AdminSite
from django.core.urlresolvers import reverse
from django.test import TestCase
from django_summernote.settings import summernote_config
from imp import reload
class DjangoSummernoteTest(TestCase):
def setUp(self):
self.site = AdminSit... | apache-2.0 |
pastephens/pysal | pysal/cg/tests/test_geoJSON.py | 6 | 1829 | import pysal
from pysal.cg.shapes import Point, Chain
import doctest
import unittest
class test_MultiPloygon(unittest.TestCase):
def test___init__1(self):
"""
Tests conversion of polygons with multiple shells to
geoJSON multipolygons. and back.
"""
shp = pysal.open(pysal.... | bsd-3-clause |
keichan100yen/ode-ext | boost/libs/python/test/numpy/ndarray.py | 5 | 2942 | #!/usr/bin/env python
# Copyright Jim Bosch & Ankit Daftery 2010-2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import ndarray_ext
import unittest
import numpy
class TestNdarray(unittest.TestCa... | mit |
idlead/scikit-learn | sklearn/externals/joblib/__init__.py | 23 | 4764 | """ Joblib is a set of tools to provide **lightweight pipelining in
Python**. In particular, joblib offers:
1. transparent disk-caching of the output values and lazy re-evaluation
(memoize pattern)
2. easy simple parallel computing
3. logging and tracing of the execution
Joblib is optimized to be **fast*... | bsd-3-clause |
Slim80/Fulgor_Kernel_Lollipop | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
DigitalCampus/django-oppia | tests/profile/models/test_models.py | 1 | 9519 | from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from oppia.test import OppiaTestCase
from profile.models import UserProfile, CustomField, UserProfileCustomField
class ProfileCustomFieldsTest(OppiaTestCase):
fixtures = ['tests/test_user.json',
'tests/t... | gpl-3.0 |
Jollyplum/cassandra | pylib/cqlshlib/cqlhandling.py | 46 | 13013 | # 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 |
ehudmagal/robotqcapp | boto/vpc/vpc.py | 25 | 1944 | # Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.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 Software without restriction, including
# without limitation the rights to use, copy, modi... | bsd-3-clause |
belmiromoreira/nova | nova/tests/unit/api/openstack/compute/contrib/test_extended_server_attributes.py | 26 | 9040 | # 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 |
ingydotnet/crockford-py | package/info.py | 1 | 1307 | def get():
info = {}
info.update(
{ 'author': 'Ingy dot Net',
'author_email': 'ingy@ingy.net',
'classifiers': [ 'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Intended Audience :: De... | bsd-2-clause |
Zouyiran/ryu | ryu/ofproto/ofproto_common.py | 36 | 1225 | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# h... | apache-2.0 |
xbmc/xbmc-antiquated | xbmc/lib/libPython/Python/Lib/test/test_charmapcodec.py | 24 | 1593 | """ Python character mapping codec test
This uses the test codec in testcodec.py and thus also tests the
encodings package lookup scheme.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright 2000 Guido van Rossum.
"""#"
import test.test_support, unittest
# test codec's full path name (see test/testcodec... | gpl-2.0 |
nhicher/ansible | test/units/modules/network/f5/test_bigip_vcmp_guest.py | 4 | 5825 | # -*- 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
import os
import json
import pytest
import sys
from nose.plugins.skip imp... | gpl-3.0 |
harshaneelhg/scikit-learn | sklearn/utils/tests/test_murmurhash.py | 261 | 2836 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from nose.tools import assert_equa... | bsd-3-clause |
40223202/test2 | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/__init__.py | 693 | 4380 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.