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 |
|---|---|---|---|---|---|
iYgnohZ/crack-geetest | geetest/geetest.py | 1 | 4035 | # -*- coding: utf-8 -*-
import time
import uuid
import StringIO
from PIL import Image
from selenium.webdriver.common.action_chains import ActionChains
class BaseGeetestCrack(object):
"""验证码破解基础类"""
def __init__(self, driver):
self.driver = driver
self.driver.maximize_window()
def inpu... | mit |
scztt/supercollider | editors/sced/scedwin/py/__init__.py | 44 | 1659 | # sced (SuperCollider mode for gedit)
#
# Copyright 2012 Jakob Leben
# Copyright 2009 Artem Popov and other contributors (see AUTHORS)
#
# sced 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, ei... | gpl-3.0 |
purpleidea/macaronic-net | django/forms/models.py | 152 | 42947 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from django.utils.encoding import smart_unicode, force_unicode
from django.utils.datastructures import SortedDict
from django.utils.text import get_text_list, capfirst
from django.utils.translation import ugettext_lazy as... | agpl-3.0 |
jordanemedlock/psychtruths | temboo/core/Library/Utilities/HTTP/Get.py | 4 | 4767 | # -*- coding: utf-8 -*-
###############################################################################
#
# Get
# Generates a HTTP GET request.
#
# 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 file except in com... | apache-2.0 |
sitsbeyou/Misago | misago/threads/migrations/0001_initial.py | 8 | 11910 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import models, migrations
import django.db.models.deletion
import django.utils.timezone
from misago.core.pgutils import CreatePartialIndex, CreatePartialCompositeIndex
class Migration(migrations.Migration... | gpl-2.0 |
rcarrillocruz/ansible | lib/ansible/modules/commands/command.py | 4 | 7952 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | gpl-3.0 |
drnextgis/QGIS | python/ext-libs/requests/packages/urllib3/__init__.py | 152 | 2854 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager imp... | gpl-2.0 |
cgstudiomap/cgstudiomap | main/parts/odoo/addons/l10n_be/wizard/__init__.py | 438 | 1145 | # -*- 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 |
40223201/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 |
eamuntz/Django-Tut | env/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py | 109 | 14746 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com
# All rights reserved.
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import six
from django.utils import unit... | mit |
heeraj123/oh-mainline | vendor/packages/twisted/twisted/words/test/test_jabbererror.py | 17 | 11918 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.protocols.jabber.error}.
"""
from twisted.trial import unittest
from twisted.words.protocols.jabber import error
from twisted.words.xish import domish
NS_XML = 'http://www.w3.org/XML/1998/namespace'
NS_STREAMS = 'h... | agpl-3.0 |
v-legoff/pa-poc3 | src/router/__init__.py | 2 | 1612 | # Copyright (c) 2012 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and ... | bsd-3-clause |
bchareyre/ratchet | scripts/default-test.py | 6 | 3838 | #!/usr/local/bin/yade-trunk
# coding=UTF-8
# this must be run inside yade
#
# pass 'mail:sender@somewhere.org,recipient@elsewhere.com' as an argument so that the crash report is e-mailed
# using the default SMTP settings (sendmail?) on your system
#
import os,time,sys
from yade import *
import yade.runtime,yade.system... | gpl-2.0 |
jmartinm/inspire-next | inspire/modules/audit/receivers.py | 3 | 1131 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
fitermay/intellij-community | python/testData/inspections/PyCompatibilityInspection/argumentsUnpackingGeneralizations.py | 33 | 1128 | def foo(*args, **kwargs):
print(args, kwargs)
foo(0,
*[1],
<warning descr="Python versions < 3.5 do not allow positional arguments after *expression">2</warning>,
<warning descr="Python versions < 3.5 do not allow duplicate *expressions">*[3]</warning>,
<warning descr="Python versions < 3.5 do not... | apache-2.0 |
Immortalin/python-for-android | python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/flash.py | 130 | 4641 | """
Copyright (c) 2008, appengine-utilities project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and ... | apache-2.0 |
SOKP/external_chromium_org | tools/site_compare/operators/equals_with_mask.py | 189 | 1589 | # Copyright (c) 2011 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.
"""Compare two images for equality, subject to a mask."""
from PIL import Image
from PIL import ImageChops
import os.path
def Compare(file1, file2, *... | bsd-3-clause |
golismero/golismero-devel | plugins/testing/recon/punkspider.py | 2 | 5681 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute it and/or
modify it under the terms of... | gpl-2.0 |
j5shi/Thruster | pylibs/idlelib/IdleHistory.py | 1 | 4239 | "Implement Idle Shell history mechanism with History class"
from idlelib.configHandler import idleConf
class History:
''' Implement Idle Shell history mechanism.
store - Store source statement (called from PyShell.resetoutput).
fetch - Fetch stored statement matching prefix already entered.
... | gpl-2.0 |
Youwotma/splash | splash/kernel/kernel.py | 1 | 9476 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import six
import sys
import lupa
from ipykernel.kernelapp import IPKernelApp
from ipykernel.eventloops import loop_qt5
from jupyter_client.kernelspec import install_kernel_spec
from twisted.internet import defer
import splash
from splash.lua im... | bsd-3-clause |
thfield/sf-base-election-data | venv/lib/python3.4/site-packages/pip/_vendor/progress/spinner.py | 404 | 1341 | # -*- 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... | bsd-3-clause |
TzarIvan/profitpy | profit/workbench/sessionreplay.py | 18 | 4671 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase
# Distributed under the terms of the GNU General Public License v2
# Author: Troy Melhase <troy@gci.net>
##
# This module defines the SessionReplay dialog class.
#
# SessionReplay dialogs offer the user widgets to control the replay
# of a se... | gpl-2.0 |
nicksergeant/emilyapp | emilyapp/monitor.py | 9 | 2933 | import os
import sys
import time
import signal
import threading
import atexit
import Queue
_interval = 1.0
_times = {}
_files = []
_running = False
_queue = Queue.Queue()
_lock = threading.Lock()
def _restart(path):
_queue.put(True)
prefix = 'monitor (pid=%d):' % os.getpid()
print >> sys.stderr, '%s Chan... | mit |
web2py/pydal | pydal/adapters/db2.py | 2 | 2000 | from .._compat import integer_types, long
from .base import SQLAdapter
from . import adapters, with_connection_or_raise
class DB2(SQLAdapter):
dbengine = "db2"
def _initialize_(self):
super(DB2, self)._initialize_()
self.ruri = self.uri.split("://", 1)[1]
@with_connection_or_raise
de... | bsd-3-clause |
mwiencek/picard | picard/ui/util.py | 2 | 1556 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2007 Lukáš Lalinský
#
# 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... | gpl-2.0 |
shaileshgoogler/pyglet | pyglet/input/directinput.py | 35 | 6896 | #!/usr/bin/python
# $Id:$
import ctypes
import pyglet
from pyglet.input import base
from pyglet.libs import win32
from pyglet.libs.win32 import dinput
from pyglet.libs.win32 import _kernel32
# These instance names are not defined anywhere, obtained by experiment. The
# GUID names (which seem to be ideal... | bsd-3-clause |
nickhdamico/py | lib/unidecode/x07b.py | 252 | 4669 | data = (
'Mang ', # 0x00
'Zhu ', # 0x01
'Utsubo ', # 0x02
'Du ', # 0x03
'Ji ', # 0x04
'Xiao ', # 0x05
'Ba ', # 0x06
'Suan ', # 0x07
'Ji ', # 0x08
'Zhen ', # 0x09
'Zhao ', # 0x0a
'Sun ', # 0x0b
'Ya ', # 0x0c
'Zhui ', # 0x0d
'Yuan ', # 0x0e
'Hu ', # 0x0f
'Gang ', # 0x10
... | gpl-3.0 |
konsP/synnefo | snf-cyclades-app/synnefo/helpdesk/templatetags/helpdesk_tags.py | 10 | 3434 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 |
grlee77/nipype | nipype/interfaces/ants/tests/test_auto_GenWarpFields.py | 9 | 1793 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.ants.legacy import GenWarpFields
def test_GenWarpFields_inputs():
input_map = dict(args=dict(argstr='%s',
),
bias_field_correction=dict(argstr='-n 1',
),
dimension=dict(argstr='-d %d... | bsd-3-clause |
MotorolaMobilityLLC/external-chromium_org | third_party/jinja2/exceptions.py | 398 | 4530 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
class TemplateError(Exception):
"""Baseclass for all template errors."""
def __init__(self, message=None):
i... | bsd-3-clause |
cmclaughlin/cabot | setup.py | 1 | 1818 | #!/usr/bin/env python
from setuptools import setup, find_packages
from os import environ as env
# pull in active plugins
plugins = env['CABOT_PLUGINS_ENABLED'].split(',') if 'CABOT_PLUGINS_ENABLED' in env else ["cabot_alert_hipchat", "cabot_alert_twilio", "cabot_alert_email"]
setup(
name='cabot',
version='0.0... | mit |
thnee/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_map.py | 2 | 32525 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017-2018, Antony Alekseyev <antony.alekseyev@gmail.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
DOCUMENTATION = '''
---
module: z... | gpl-3.0 |
urbaniak/gunicorn | gunicorn/pidfile.py | 7 | 2273 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
from __future__ import with_statement
import errno
import os
import tempfile
class Pidfile(object):
"""\
Manage a PID file. If a specific name is provided
it and '"%s.oldpid" % ... | mit |
bureau14/qdb-benchmark | thirdparty/boost/libs/python/pyste/tests/SmartFileUT.py | 54 | 2479 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to 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 sys
sys.path.append('../src')
from SmartFile import *
import unittest
import tempf... | bsd-2-clause |
foresterre/wren | util/libuv.py | 3 | 4582 | #!/usr/bin/env python
# Downloads and compiles libuv.
from __future__ import print_function
import os
import os.path
import platform
import shutil
import subprocess
import sys
LIB_UV_VERSION = "v1.10.0"
LIB_UV_DIR = "deps/libuv"
def python2_binary():
"""Tries to find a python 2 executable."""
# Using [0] inst... | mit |
Chouser/compose | compose/cli/docopt_command.py | 9 | 1601 | from __future__ import unicode_literals
from __future__ import absolute_import
import sys
from inspect import getdoc
from docopt import docopt, DocoptExit
def docopt_full_help(docstring, *args, **kwargs):
try:
return docopt(docstring, *args, **kwargs)
except DocoptExit:
raise SystemExit(docst... | apache-2.0 |
philoniare/horizon | openstack_dashboard/dashboards/admin/volumes/tests.py | 27 | 4466 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
smARTLab-liv/smartlabatwork-release | slaw_smach/src/slaw_smach/slaw_smach.py | 1 | 11996 | #!/usr/bin/env python
import rospy
from ArmStates import *
from MoveStates import *
from ObjectDetectState import *
from DecisionStates import *
from std_srvs.srv import Empty, EmptyResponse
from std_msgs.msg import Bool
## TODO after Eindhoven: Add failsafe if hole not detected
## add states if object too far or too... | mit |
jantman/GitPython | setup.py | 3 | 2972 | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from distutils.command.build_py import build_py as _build_py
from setuptools.command.sdist import sdist as _sdist
i... | bsd-3-clause |
webmasterraj/GaSiProMo | flask/lib/python2.7/site-packages/docutils/readers/__init__.py | 170 | 3465 | # $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $
# Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer
# Copyright: This module has been placed in the public domain.
"""
This package contains Docutils Reader modules.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import utils, parsers,... | gpl-2.0 |
axinging/chromium-crosswalk | tools/perf/page_sets/tough_energy_cases.py | 35 | 4626 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry import story
class ToughEnergyCasesPage(page_module.Page):
def __init__(self, url, page_set... | bsd-3-clause |
Pexego/sale_commission | __unported__/production_costs/wizard/product_percent_struct_costs.py | 3 | 3498 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
mtrdesign/pylogwatch | pylogwatch/logwlib.py | 1 | 5917 | # Python 2.5 compatibility
from __future__ import with_statement
# Python version
import sys
if sys.version_info < (2, 5):
raise "Required python 2.5 or greater"
import os, sqlite3, itertools, time
from datetime import datetime
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
proj_path = lambda x: os.pat... | gpl-3.0 |
dkao-cb/perfrunner | perfSanity/scripts/query_benchmark_beta.py | 2 | 16516 | import requests
import json
import re
import fileinput
from optparse import OptionParser
import subprocess
import os
import sys
import time
from perfrunner.settings import ClusterSpec
from perfrunner.utils.install import CouchbaseInstaller
from perfrunner.utils.cluster import TestConfig, ClusterManager
from logger i... | apache-2.0 |
UManPychron/pychron | pychron/hardware/watlow/headless_ezzone.py | 2 | 1248 | # ===============================================================================
# Copyright 2016 ross
#
# 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/LICE... | apache-2.0 |
sekikn/incubator-airflow | tests/providers/google/cloud/operators/test_datastore_system.py | 10 | 1815 | #
# 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... | apache-2.0 |
markwal/OctoPrint | src/octoprint/slicing/__init__.py | 6 | 22876 | # coding=utf-8
"""
In this module the slicing support of OctoPrint is encapsulated.
.. autoclass:: SlicingProfile
:members:
.. autoclass:: TemporaryProfile
:members:
.. autoclass:: SlicingManager
:members:
"""
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ =... | agpl-3.0 |
wzod/fsf | fsf-server/conf/disposition.py | 3 | 3787 | #!/usr/bin/env python
#
# This is the Python 'module' that contains the
# disposition criteria for Yara and jq filters the scanner framework
# will work on. Each member is the name of a
# high fidelity detection.
#
# default - Modules that are always run on a returned buffer value
# triggers - List of tuples that are... | apache-2.0 |
dongguangming/django-oscar | src/oscar/apps/dashboard/vouchers/app.py | 49 | 1247 | from django.conf.urls import url
from oscar.core.application import Application
from oscar.core.loading import get_class
class VoucherDashboardApplication(Application):
name = None
default_permissions = ['is_staff', ]
list_view = get_class('dashboard.vouchers.views', 'VoucherListView')
create_view =... | bsd-3-clause |
googlemaps/google-maps-services-python | googlemaps/convert.py | 1 | 10197 | #
# Copyright 2014 Google Inc. All rights reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
eleonrk/SickRage | lib/sqlalchemy/dialects/postgresql/ext.py | 8 | 6860 | # postgresql/ext.py
# Copyright (C) 2005-2018 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
from ...sql import expression
from ...sql import elements
from ...sql import funct... | gpl-3.0 |
mo-ki/pypgpwords | pypgpwords.py | 1 | 13257 | #!/usr/bin/python3
"""Define a PGPWords object inherited from bytearray.
Adding initialization via hex-, or pgp-word-string,
adding .hex() method and
overriding __str__
Mainline code:
Convert pgp words to hex strings and vice versa.
Example:
$ pypgpwords.py DEAD 1337
tactics perceptive Aztec consensus
or
$ ... | mit |
ESSICS/cs-studio | applications/scan/scan-plugins/org.csstudio.scan/jython/scan_client.py | 3 | 10449 | """
Scan Client Tools
DEPRECATED.
This API is based on the Java org.csstudio.scan.client.ScanClient
and thus limited to Jython.
For a Python scan client library that can be used by
both Jython and C-Python,
see https://github.com/PythonScanClient/PyScanClient#pyscanclient
@author: Kay Kasemir
"""
import sys, os, gl... | epl-1.0 |
thnee/ansible | test/units/modules/net_tools/nios/test_nios_zone.py | 68 | 10787 | # 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 |
ChronoMonochrome/android_external_chromium_org | tools/perf/metrics/statistics.py | 23 | 7779 | # 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.
"""A collection of statistical utility functions to be used by metrics."""
import bisect
import math
def Clamp(value, low=0.0, high=1.0):
"""Clamp a val... | bsd-3-clause |
oldstylejoe/pychess-timed | lib/pychess/Players/PyChess.py | 2 | 7735 | #!/usr/bin/pypy -u
from __future__ import print_function
#if __name__ == "__main__":
# print("feature done=0")
import os
import random
import sys
from time import time
this_dir = os.path.dirname(os.path.abspath(__file__))
if os.path.join(this_dir, "../..") not in sys.path:
sys.path = [os.path.join(this_dir, "... | gpl-3.0 |
frank10704/DF_GCS_W | MissionPlanner-master/Lib/site-packages/scipy/optimize/info.py | 55 | 2661 | """
Optimization Tools
==================
General-purpose Optimization Routines
-------------------------------------
.. autosummary::
:toctree: generated/
fmin - Nelder-Mead Simplex algorithm
fmin_powell - Powell's (modified) level set method
fmin_cg - Non-linear (Polak-Ribiere) conjugate gradient algor... | gpl-3.0 |
benfinkelcbt/CPD200 | CPD200-Lab10-Python/simplejson/encoder.py | 43 | 26764 | """Implementation of JSONEncoder
"""
from __future__ import absolute_import
import re
from operator import itemgetter
# Do not import Decimal directly to avoid reload issues
import decimal
from .compat import u, unichr, binary_type, string_types, integer_types, PY3
def _import_speedups():
try:
from . import... | gpl-3.0 |
danrouse/cvimage | test.py | 2 | 1323 | import unittest
import numpy as np
import cv2
from cvimage import CvImage
def gen_sample(dims = (512, 512, 3)):
return np.uint8(np.random.rand(*dims))
class TestCvMethods(unittest.TestCase):
def test_filter_chain(self):
sample = gen_sample()
b_kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))
b... | mit |
adw0rd/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/update/tests.py | 89 | 4252 | from django.test import TestCase
from models import A, B, C, D, DataPoint, RelatedPoint
class SimpleTest(TestCase):
def setUp(self):
self.a1 = A.objects.create()
self.a2 = A.objects.create()
for x in range(20):
B.objects.create(a=self.a1)
D.objects.create(a=self.a1... | gpl-3.0 |
chauhanhardik/populo | common/djangoapps/track/views/tests/test_segmentio.py | 74 | 21978 | """Ensure we can parse events sent to us from the segment.io webhook integration"""
from datetime import datetime
import json
from ddt import ddt, data, unpack
from mock import sentinel
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.test.utils import override_se... | agpl-3.0 |
chauhanhardik/populo | common/static/js/vendor/mathjax-MathJax-c9db6ac/docs/source/conf.py | 104 | 6453 | # -*- coding: utf-8 -*-
#
# MathJax documentation build configuration file, created by
# sphinx-quickstart on Sun May 16 23:18:19 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | agpl-3.0 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/setuptools/archive_util.py | 520 | 6609 | """Utilities for extracting common archive formats"""
__all__ = [
"unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter",
"UnrecognizedFormat", "extraction_drivers", "unpack_directory",
]
import zipfile
import tarfile
import os
import shutil
import posixpath
import contextlib
from pkg_resourc... | mit |
ahhda/sympy | sympy/printing/preview.py | 29 | 12243 | from __future__ import print_function, division
from os.path import join
from itertools import chain
import tempfile
import shutil
import sys
import io
from io import BytesIO
try:
from subprocess import STDOUT, CalledProcessError
from sympy.core.compatibility import check_output
except ImportError:
pass
... | bsd-3-clause |
mpasternak/pyglet-fix-issue-552 | pyglet/app/__init__.py | 14 | 5406 | # ----------------------------------------------------------------------------
# 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 |
petezybrick/iote2e | iote2e-pyclient/src/iote2epyclient/test/testhatsensors.py | 1 | 3137 | # Copyright 2016, 2017 Peter Zybrick and others.
#
# 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 ag... | apache-2.0 |
Elico-Corp/odoo_OCB | addons/point_of_sale/report/pos_report.py | 44 | 5423 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
from openerp import tools
class report_transaction_pos(osv.osv):
_name = "report.transaction.pos"
_description = "transaction for the pos"
_auto = False
_columns = {
... | agpl-3.0 |
tensorflow/ngraph-bridge | test/python/test_fusedConv2D.py | 1 | 5531 | # ==============================================================================
# Copyright 2018-2020 Intel Corporation
#
# 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://ww... | apache-2.0 |
rackerlabs/blueflood | ops/rackspace-agent-plugins/bf-rollups-delay.py | 6 | 7501 | #!/usr/bin/env python
'''Blueflood Rollup Delay'''
'''For each rollup level, lists the number of slots which need to processed by blueflood. For the 5m range, one day is 288 slots.'''
# Licensed to Rackspace under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for addit... | apache-2.0 |
tvalacarta/tvalacarta | python/main-classic/lib/youtube_dl/extractor/historicfilms.py | 64 | 1581 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import parse_duration
class HistoricFilmsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?historicfilms\.com/(?:tapes/|play)(?P<id>\d+)'
_TEST = {
'url': 'http://www.historicfilms.com/tapes/4728',
'md5'... | gpl-3.0 |
kuiche/chromium | tools/grit/grit/gather/regexp.py | 3 | 7474 | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 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.
'''A baseclass for simple gatherers based on regular expressions.
'''
import re
import types
from grit.gather import interfac... | bsd-3-clause |
kkxue/Py2ChainMap | setup.py | 2 | 1030 | """
Py2ChainMap
==================
A backport of ChainMap from Python 3 to Python .
Get source from https://github.com/justanr/Py2ChainMap
"""
from setuptools import setup
setup(
name='Py2ChainMap',
version='0.1.0',
author='kkxue',
author_email='xueguanwen@gmail.com',
description='A backport of Ch... | bsd-3-clause |
andrejb/cloudant_bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/f77.py | 61 | 2056 | """engine.SCons.Tool.f77
Tool-specific initialization for the generic Posix f77 Fortran compiler.
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, 2... | apache-2.0 |
liorvh/Empire | lib/stagers/hop_php.py | 22 | 2123 | from lib.common import helpers
class Stager:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Launcher',
'Author': ['@harmj0y'],
'Description': ('Generates a hop.php redirector for an Empire listener.'),
'Comments': [
''
... | bsd-3-clause |
RealTimeWeb/Blockpy-Server | static/blockly-games/storage.py | 3 | 2721 | """Blockly Games: Storage
Copyright 2012 Google Inc.
https://github.com/google/blockly-games
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 re... | mit |
SirkkaNiittyllae/FaPraCSCW20172018 | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | 1446 | 65937 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | mit |
jarodsun/wesnoth1.12.6 | data/tools/wesnoth/libgithub.py | 33 | 24064 | # vim: tabstop=4: shiftwidth=4: expandtab: softtabstop=4: autoindent:
"""
This library provides an interface to github, the interface is build upon
the command line git tool.
"""
import logging
import os
try:
# Externally distributed, usually more up-to-date
import simplejson as json
except ImportError:
#... | gpl-2.0 |
xamfoo/thumbor-docker | setup/thumbor/thumbor/optimizers/__init__.py | 13 | 1083 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import os
from tempfile import NamedTemporaryFile
class BaseOptim... | mit |
Goyatuzo/Challenges | HackerRank/Algorithms/Sorting/Insertion Sort Part 1/insertion_sort_p1.py | 1 | 1113 | def insertion_sort(lst):
"""Instead of just inserting the value where it should be at,
it shifts the entire array until the location is found. It prints
out all the intermediate steps, but the final step is actually just
returned, so the output must be manually printed.
:param lst: The list of value... | mit |
cshallue/models | research/gan/stargan/ops_test.py | 2 | 3109 | # 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 |
x1957/thrift | lib/py/src/TSerialization.py | 111 | 1389 | #
# 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 |
Loisel/tmr3 | tmr.py | 1 | 15096 | #!/usr/bin/python
"""
A module to calculate the current, the conductance and the TMR from
a set of rate arrays.
The rate arrays are supposed to be stored in a h5 file in the job directory.
The result is stored in a h5 file. The name of the dataset contains all
parameters. They are also stored as attributes in the datas... | gpl-3.0 |
ryfeus/lambda-packs | Keras_tensorflow/source/tensorflow/contrib/integrate/python/ops/odes.py | 69 | 20508 | # 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... | mit |
werthen/django-rest-framework | rest_framework/mixins.py | 93 | 2745 | """
Basic building blocks for generic class based views.
We don't bind behaviour to http method handlers yet,
which allows mixin classes to be composed in interesting ways.
"""
from __future__ import unicode_literals
from rest_framework import status
from rest_framework.response import Response
from rest_framework.se... | bsd-2-clause |
mahmutf/dupeguru | core/pe/cache_shelve.py | 3 | 4189 | # Copyright 2016 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import os
import os.path as op
import shelve
import tempfile
from collectio... | gpl-3.0 |
robk5uj/invenio | modules/webcomment/lib/webcomment_templates.py | 2 | 113838 | # -*- coding: utf-8 -*-
## Comments and reviews for records.
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 Softwar... | gpl-2.0 |
danieljaouen/ansible | test/runner/lib/changes.py | 18 | 5945 | """Detect changes in Ansible code."""
from __future__ import absolute_import, print_function
import re
import os
from lib.util import (
ApplicationError,
SubprocessError,
MissingEnvironmentVariable,
CommonConfig,
display,
)
from lib.http import (
HttpClient,
urlencode,
)
from lib.git im... | gpl-3.0 |
xiangel/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Util/asn1.py | 122 | 12727 | # -*- coding: ascii -*-
#
# Util/asn1.py : Minimal support for ASN.1 DER binary encoding.
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted... | apache-2.0 |
xyx119/TeamTalk | win-client/3rdParty/src/json/scons-tools/globtool.py | 256 | 1667 | import fnmatch
import os
def generate( env ):
def Glob( env, includes = None, excludes = None, dir = '.' ):
"""Adds Glob( includes = Split( '*' ), excludes = None, dir = '.')
helper function to environment.
Glob both the file-system files.
includes: list of file name pattern included i... | apache-2.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/urlparse.py | 60 | 15164 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | bsd-3-clause |
mahendra-r/home-assistant | homeassistant/components/notify/nma.py | 9 | 2684 | """
homeassistant.components.notify.nma
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NMA (Notify My Android) notification service.
Configuration:
To use the NMA notifier you will need to add something like the following
to your configuration.yaml file.
notify:
platform: nma
api_key: YOUR_API_KEY
Variables:
api_key
*Req... | mit |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/theano/tensor/shared_randomstreams.py | 6 | 4882 | """
Define RandomStreams, providing random number variables for Theano
graphs.
"""
import copy
import numpy
from theano.compile.sharedvalue import (SharedVariable, shared_constructor,
shared)
from theano.tensor import raw_random
__docformat__ = "restructuredtext en"
class R... | mit |
zouyapeng/horizon_change | openstack_dashboard/dashboards/project/data_processing/cluster_templates/tests.py | 7 | 3621 | # 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 t... | apache-2.0 |
matthappens/taskqueue | taskqueue/venv_tq/lib/python2.7/site-packages/boto/ec2/volume.py | 13 | 10262 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files ... | mit |
ossdemura/django-miniblog | src/Lib/site-packages/django/contrib/gis/db/models/fields.py | 45 | 17598 | from collections import defaultdict
from django.contrib.gis import forms, gdal
from django.contrib.gis.db.models.lookups import (
RasterBandTransform, gis_lookups,
)
from django.contrib.gis.db.models.proxy import SpatialProxy
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.geometry.... | mit |
bobcyw/django | tests/admin_docs/tests.py | 114 | 20476 | import datetime
import sys
import unittest
from django.conf import settings
from django.contrib.admindocs import utils
from django.contrib.admindocs.views import get_return_data_type
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
fr... | bsd-3-clause |
axilleas/ansible | v1/ansible/runner/connection_plugins/accelerate.py | 109 | 15527 | # (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 the License, or
# (at your option) any lat... | gpl-3.0 |
inspyration/odoo | addons/website_blog/__openerp__.py | 10 | 1768 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
apache/beam | sdks/python/apache_beam/io/gcp/datastore/v1new/datastore_write_it_test.py | 5 | 2578 | #
# 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 |
ict-felix/stack | vt_manager_kvm/src/python/vt_manager_kvm/controller/dispatchers/ui/GUIdispatcher.py | 1 | 17272 | from django.core.urlresolvers import reverse
from django.forms.models import modelformset_factory
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic import simple
from django.views.generic import list_detail, simple
from django.views.gener... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.