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 |
|---|---|---|---|---|---|
superchilli/webapp | venv/lib/python2.7/site-packages/requests/packages/charade/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versio... | mit |
mmuellner/vigra | docsrc/post.py | 11 | 5960 | #!/usr/bin/env python
import re
import glob
import sys
if len(sys.argv) != 3:
print 'usage: python post.py directory versionNumber'
sys.exit(1)
path = str(sys.argv[1])
insertVersion = re.compile(r'VERSION_VERSION_VERSION')
insertSTLLink = re.compile(r'WWW_STL_DOCU')
# tested with doxygen 1.7.5.1
hasAnchorD... | mit |
Supermem/ibis | ibis/compat.py | 6 | 1557 | # Copyright 2015 Cloudera 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 writing, so... | apache-2.0 |
40223209/test1 | static/Brython3.1.3-20150514-095342/Lib/_weakrefset.py | 766 | 5570 | # Access WeakSet through the weakref module.
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.
from _weakref import ref
__all__ = ['WeakSet']
class _IterationGuard:
# This context manager registers itself in the current iterators of the
# weak container, such ... | agpl-3.0 |
schuza/odin-master | src/main/python/compileall.py | 251 | 5283 | """Module/script to "compile" all .py files to .pyc (or .pyo) file.
When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.
Without arguments, if compiles all modules on sys.path, without
recursing into subdirecto... | apache-2.0 |
teobaluta/qr-linux-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
zvolsky/hemtrans | languages/zh.py | 152 | 10080 | # coding: utf8
{
'!langcode!': 'zh-tw',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%s %%{row} deleted': '已刪除 %s 筆',
'%s %%{row} updated': '已更新 %s 筆',
'%s s... | agpl-3.0 |
rlutz/xorn | src/gaf/netlist/slib.py | 1 | 1934 | # gaf.netlist - gEDA Netlist Extraction and Generation
# Copyright (C) 1998-2010 Ales Hvezda
# Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details)
# Copyright (C) 2013-2019 Roland Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-2.0 |
arnoutaertgeerts/zerorpc-python | zerorpc/channel.py | 55 | 9259 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
speef/linux | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
sarantapichos/faircoop-market | openerp/addons/base/tests/test_orm.py | 149 | 18110 | from collections import defaultdict
from openerp.tools import mute_logger
from openerp.tests import common
UID = common.ADMIN_USER_ID
class TestORM(common.TransactionCase):
""" test special behaviors of ORM CRUD functions
TODO: use real Exceptions types instead of Exception """
def setUp(self):... | agpl-3.0 |
tboyce021/home-assistant | tests/components/rfxtrx/conftest.py | 5 | 2291 | """Common test tools."""
from datetime import timedelta
import pytest
from homeassistant.components import rfxtrx
from homeassistant.components.rfxtrx import DOMAIN
from homeassistant.util.dt import utcnow
from tests.async_mock import patch
from tests.common import MockConfigEntry, async_fire_time_changed
from tests... | apache-2.0 |
nextgis-extra/tests | lib_gdal/utilities/test_gdal_grid.py | 1 | 36399 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: test_gdal_grid.py 32170 2015-12-13 19:59:59Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: gdal_grid testing
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
#
... | gpl-2.0 |
gunicorn/gunicorn | examples/websocket/websocket.py | 7 | 15711 |
import collections
import errno
import re
from hashlib import md5, sha1
import base64
from base64 import b64encode, b64decode
import socket
import struct
import logging
from socket import error as SocketError
import eventlet
from gunicorn.workers.async import ALREADY_HANDLED
from eventlet import pools
logger = loggi... | mit |
phaller0513/aima-python | submissions/aardvark/puzzles.py | 20 | 1982 | import search
from math import(cos, pi)
# A sample map problem
sumner_map = search.UndirectedGraph(dict(
# Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18),
# Cottontown=dict(Portland=18),
# Fairfield=dict(Mitchellville=21, Portland=17),
# Mitchellville=dict(Portland=7, Fairfield=21),
# A=d... | mit |
credativUK/OCB | addons/membership/__init__.py | 441 | 1101 | # -*- 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... | agpl-3.0 |
pubudu538/mesos-artifacts | common/scripts/get-host-ip.py | 3 | 1422 | #!/usr/bin/python
# ------------------------------------------------------------------------
#
# Copyright 2016 WSO2, Inc. (http://wso2.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
#
... | apache-2.0 |
chaffra/sympy | sympy/physics/quantum/tests/test_grover.py | 45 | 3563 | from sympy import sqrt, Matrix
from sympy.physics.quantum.represent import represent
from sympy.physics.quantum.qapply import qapply
from sympy.physics.quantum.qubit import IntQubit
from sympy.physics.quantum.grover import (apply_grover, superposition_basis,
OracleGate, grover_iteration, WGate)
def return_one... | bsd-3-clause |
smalls257/VRvisu | Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/test/test_select.py | 39 | 1851 | from test import test_support
import unittest
import select
import os
import sys
@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
... | gpl-3.0 |
mdietrichc2c/stock-logistics-workflow | __unported__/stock_picking_show_returns/__openerp__.py | 5 | 1540 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# $Id$
#
# This program is... | agpl-3.0 |
luyishisi/tensorflow | 4.Object_Detection/object_detection/utils/metrics.py | 17 | 5390 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | bsd-2-clause |
ericlink/adms-server | playframework-dist/1.1-src/python/Lib/idlelib/configSectionNameDialog.py | 9 | 3817 | """
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
"""
from Tkinter import *
import tkMessageBox
class GetCfgSectionNameDialog(Toplevel):
def __init__(self,parent,title,message,usedNames):
"""
message - string, ... | mit |
kingmotley/SickRage | sickrage/providers/nzb/NZBProvider.py | 11 | 1677 | # coding=utf-8
# This file is part of SickRage.
#
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage 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... | gpl-3.0 |
rephorm/libnotify-mozilla | indicator.py | 1 | 3854 | #!/usr/bin/env python
import gtk, glib, sys, fcntl, os
import gobject
import indicate
class MessagingServer:
def __init__(self, subtype, desktop):
self.indicators = {}
self.actions = {}
self.user_cb = None
self.server_cb = None
self.desktop = desktop
self.srv = indicate.indicate_server_ref_... | gpl-3.0 |
ppanczyk/ansible | lib/ansible/module_utils/junos.py | 8 | 13183 | #
# (c) 2017 Red Hat, Inc.
#
# 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 ... | gpl-3.0 |
jimcunderwood/MissionPlanner | Lib/site-packages/numpy/f2py/tests/test_return_complex.py | 59 | 4480 | from numpy.testing import *
from numpy import array
import util
class TestReturnComplex(util.F2PyTest):
def check_function(self, t):
tname = t.__doc__.split()[0]
if tname in ['t0','t8','s0','s8']:
err = 1e-5
else:
err = 0.0
assert abs(t(234j)-234.0j)<=err
... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pywin32-219/com/win32com/makegw/makegwenum.py | 46 | 9750 | """Utility file for generating PyIEnum support.
This is almost a 'template' file. It simplay contains almost full
C++ source code for PyIEnum* support, and the Python code simply
substitutes the appropriate interface name.
This module is notmally not used directly - the @makegw@ module
automatically calls this.
"""
... | mit |
YongMan/Xen-4.3.1 | tools/xm-test/tests/restore/01_restore_basic_pos.py | 42 | 2022 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
# Save a domain and attempt to restore it
#
# Since we don't want to depend on the fact that save/01_basic_pos.py
# ran successfully, we try to save the domain here again
import time
from XmTestLib i... | gpl-2.0 |
thomasrstorey/recipesfordisaster | actions/reheat.py | 2 | 4903 | '''
add.py
Takes a list of input ingredient names. Imports each if not already present.
If already present, duplicates and rotates the ingredient.
Thomas Storey
2016
'''
import sys
import argparse
import bpy
import numpy as np
import os
import bmesh
from math import *
from mathutils import *
import random
def getO... | mit |
hxxft/lynx-native | Core/third_party/jsoncpp/scons-tools/substinfile.py | 3 | 3511 | # Copyright 2010 The JsonCpp Authors
# Distributed under MIT license, or public domain if desired and
# recognized in your jurisdiction.
# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
import re
from SCons.Script import * # the usual scons stuff you get in a SConscript
import collectio... | mit |
luhanhan/horizon | horizon/test/customization/cust_test1.py | 67 | 1146 | # 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 |
shawnwanderson/cmput404-project | venv/lib/python2.7/site-packages/django/core/checks/security/sessions.py | 477 | 2595 | from django.conf import settings
from .. import Tags, Warning, register
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
)
W010 = Warning(
add_session_cookie_... | gpl-3.0 |
joelthompson/ansible-modules-core | network/openswitch/ops_command.py | 16 | 4786 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
maxdeliso/elevatorSim | Lib/test/test_traceback.py | 34 | 13164 | """Test cases for traceback module"""
from _testcapi import traceback_print, exception_print
from io import StringIO
import sys
import unittest
import re
from test.support import run_unittest, Error, captured_output
from test.support import TESTFN, unlink
import traceback
class SyntaxTracebackCases(unittest.TestCas... | bsd-2-clause |
dliessi/frescobaldi | frescobaldi_app/viewers/documents.py | 1 | 4042 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 |
jar349/silverviewmc | XLS Perm Parser/PermParser/xlrd/formula.py | 77 | 94301 | # -*- coding: cp1252 -*-
##
# Module for parsing/evaluating Microsoft Excel formulas.
#
# <p>Copyright © 2005-2012 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under
# a BSD-style licence.</p>
##
# No part of the content of this file was derived from the work... | apache-2.0 |
40223247/2015cdb_0622 | static/Brython3.1.1-20150328-091302/Lib/threading.py | 730 | 45641 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import sleep as _sleep
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# No... | gpl-3.0 |
gunchleoc/django | tests/introspection/tests.py | 108 | 8561 | from __future__ import unicode_literals
from unittest import skipUnless
from django.db import connection
from django.db.utils import DatabaseError
from django.test import TransactionTestCase, mock, skipUnlessDBFeature
from .models import Article, Reporter
class IntrospectionTests(TransactionTestCase):
availab... | bsd-3-clause |
praneethkumarpidugu/matchmaking | lib/python2.7/site-packages/django/utils/lru_cache.py | 270 | 7647 | try:
from functools import lru_cache
except ImportError:
# backport of Python's 3.3 lru_cache, written by Raymond Hettinger and
# licensed under MIT license, from:
# <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/>
# Should be removed when Django only sup... | mit |
superdesk/Live-Blog | documentor/libraries/docutils-0.9.1-py3.2/docutils/io.py | 2 | 17894 | # $Id: io.py 7440 2012-06-13 14:14:12Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
I/O classes provide a uniform API for low-level input and output. Subclasses
will exist for a variety of input/output mechanisms.
"""
__docformat__ = 'reStruc... | agpl-3.0 |
jshiv/turntable | test/lib/python2.7/site-packages/setuptools/command/alias.py | 467 | 2381 | from distutils.errors import DistutilsOptionError
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
return repr(arg)
if arg.split() != [arg... | mit |
pytroll/mpop | mpop/saturn/two_line_elements.py | 2 | 14593 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, 2013.
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.se>
# This file is part of mpop.
# mpop 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
# F... | gpl-3.0 |
evidation-health/bokeh | bokeh/util/testing.py | 9 | 5179 | """ Functions to help with testing Bokeh and reporting issues.
"""
from __future__ import absolute_import, print_function
import mock
import threading
import time
import uuid
import unittest
import requests
from requests.exceptions import ConnectionError
from bokeh.server import start, configure
from bokeh.server.app... | bsd-3-clause |
gmatteo/pymatgen | pymatgen/transformations/standard_transformations.py | 4 | 35611 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module defines standard transformations which transforms a structure into
another structure. Standard transformations operate in a structure-wide manner,
rather than site-specific manner.
All transform... | mit |
crobinso/pkgdb2 | tests/test_flask_ui_collections.py | 7 | 8467 | # -*- coding: utf-8 -*-
#
# Copyright © 2013-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2, or (at your option) any later
# version. This program is distributed... | gpl-2.0 |
michaelgugino/turbo-lister | sqlalchemy/dialects/postgresql/zxjdbc.py | 18 | 1395 | # postgresql/zxjdbc.py
# Copyright (C) 2005-2013 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
"""
.. dialect:: postgresql+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdb... | gpl-3.0 |
hhkaos/awesome-arcgis | node_modules/gitbook/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | gpl-3.0 |
SCSSG/Odoo-SCS | addons/mail/report/__init__.py | 438 | 1057 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-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 |
mrnamingo/vix4-34-enigma2-bcm | lib/python/Plugins/SystemPlugins/SABnzbdSetup/plugin.py | 82 | 7222 | from boxbranding import getMachineBrand, getMachineName
import time
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.Console import Console
from Components.Label import Label
from Components.Sources.StaticText import StaticText
from Components.ActionMap import ActionMap
from ... | gpl-2.0 |
jonathanlurie/timelapseComposer | lib/python/gooey/_tmp/responding_to_error.py | 9 | 1594 | '''
Created on Dec 21, 2013
@author: Chris
'''
import sys
import hashlib
from time import time as _time
from time import sleep as _sleep
from gooey import Gooey
from gooey import GooeyParser
def main():
desc = "Example application to show Gooey's various widgets"
my_cool_parser = GooeyParser(des... | mit |
tcstewar/telluride2014 | tank/tankudp.py | 1 | 2078 | import time
import socket
import nengo
class TankUDP(nengo.Node):
def __init__(self, address, port=8889, period=0.1):
self.target = (address, port)
self.period = period
self.data = [0,0,0,0]
self.last_time = None
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)... | gpl-3.0 |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/answers/browser/tests/test_question.py | 1 | 6315 | # Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for the question module."""
__metaclass__ = type
__all__ = []
from zope.security.proxy import removeSecurityProxy
from lp.answers.browser.question import QuestionTarge... | agpl-3.0 |
eykd/syml | syml/parser.py | 1 | 3207 | from parsimonious import NodeVisitor, Grammar, VisitationError
from . import grammars
from . import nodes
from .exceptions import OutOfContextNodeError
class TextOnlySymlParser(NodeVisitor):
grammar = Grammar(grammars.text_only_syml_grammar)
def reduce_children(self, children):
children = [c for c i... | mit |
remenska/rootpy | rootpy/plotting/contrib/plot_corrcoef_matrix.py | 5 | 12192 | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
from ...extern.six.moves import range
from ...extern.six import string_types
__all__ = [
'plot_corrcoef_matrix',
'corrcoef',
'cov',
]
def plot_corrcoef_matrix(mat... | gpl-3.0 |
wangsix/vmo | vmo/plot.py | 1 | 5141 | """
plot.py
drawing routines for vmo
Copyright (C) 8.20.2014 Cheng-i Wang
This file is part of vmo.
vmo 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 l... | gpl-3.0 |
yashLadha/coala | tests/bearlib/aspects/ModuleTest.py | 10 | 1967 | from types import ModuleType
import coalib.bearlib.aspects
import pytest
class aspectsModuleTest:
def test_module(self):
# check that module is correctly wrapped
assert isinstance(coalib.bearlib.aspects, ModuleType)
assert type(coalib.bearlib.aspects) is not ModuleType
assert (t... | agpl-3.0 |
an7oine/WinVHS | Cygwin/lib/python2.7/subprocess.py | 4 | 59046 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... | gpl-3.0 |
dude56987/DoThis | speakthis.py | 1 | 7865 | #! /usr/bin/python
########################################################################
# SpeakThis speaks the currently highlighted text using espeak.
# Copyright (C) 2013 Carl J Smith
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | gpl-3.0 |
pshen/ansible | lib/ansible/modules/network/panos/panos_pg.py | 78 | 6521 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
RPGOne/scikit-learn | sklearn/datasets/kddcup99.py | 14 | 13152 | """KDDCUP 99 dataset.
A classic dataset for anomaly detection.
The dataset page is available from UCI Machine Learning Repository
https://archive.ics.uci.edu/ml/machine-learning-databases/kddcup99-mld/kddcup.data.gz
"""
import sys
import errno
from gzip import GzipFile
from io import BytesIO
import logging
import ... | bsd-3-clause |
longman694/youtube-dl | youtube_dl/extractor/tvplay.py | 26 | 15914 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urlparse,
)
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
parse_iso8601,
qualities,
try_get,
updat... | unlicense |
Windy-Ground/TextBlob | run_tests.py | 11 | 1778 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
The main test runner script.
Usage: ::
python run_tests.py
Skip slow tests
python run_tests.py fast
When there's no Internet
python run_tests.py no-internet
'''
from __future__ import unicode_literals
import nose
import sys
from textblob.compat import PY2
... | mit |
mancoast/CPythonPyc_test | crash/242_pystone.py | 35 | 7254 | #! /usr/bin/env python
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... | gpl-3.0 |
xrmx/django | tests/template_tests/filter_tests/test_truncatewords.py | 215 | 1705 | from django.template.defaultfilters import truncatewords
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class TruncatewordsTests(SimpleTestCase):
@setup({'truncatewords01':
'{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:"... | bsd-3-clause |
mabelcalim/tide-app | kivy/test8/.buildozer/android/app/python-for-android/tools/check_headers.py | 27 | 1267 | #!/usr/bin/env python2
import sys
from os import unlink
from os.path import exists
HEADERS = ('Content-Disposition', 'Content-Length', 'Content-Type',
'ETag', 'Last-Modified')
def is_sig_header(header):
header = header.lower()
for s in HEADERS:
if header.startswith(s.lower()):
... | gpl-3.0 |
shaolinfry/litecoin | contrib/devtools/clang-format-diff.py | 90 | 6192 | #!/usr/bin/env python
#
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License.
#
# ===========================================================... | mit |
sriprasanna/django-1.3.1 | django/contrib/auth/tests/forms.py | 58 | 9283 | from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm
from django.test import TestCase
class UserCreationFormTest(TestCase):
fixtures = ['authtestdata.json']
def test_use... | bsd-3-clause |
croot/blacksmith-2 | expansions/config/insc.py | 3 | 1347 | # coding: utf-8
if DefLANG in ("RU", "UA"):
AnsBase_temp = tuple([line.decode("utf-8") for line in (
"Изменённые пункты: %s", # 0
"Очевидно параметры неверны.", # 1
"Настройки:\n", # 2
"Конфиг пуст.", # 3
"Вниание! Текущий jid сейчас удаляется, сейчас я зайду с нового.", # 4
"смена jid'а", # 5
"Теперь '... | apache-2.0 |
Zord13appdesa/python-for-android | python3-alpha/extra_modules/pyxmpp2/ext/legacyauth.py | 46 | 18162 | #
# (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
gbaty/shiboken2 | tests/samplebinding/copy_test.py | 6 | 2212 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the term... | gpl-2.0 |
akintoey/django | tests/gis_tests/utils.py | 327 | 1377 | from unittest import skip
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
def no_backend(test_func, backend):
"Use this decorator to disable test on specified backend."
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend:
@skip("This test is skipped on... | bsd-3-clause |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/estimator/estimator_test.py | 9 | 58131 | # 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 |
davidzchen/tensorflow | tensorflow/lite/tutorials/mnist_tflite.py | 18 | 2871 | # 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 |
shtouff/django | django/core/cache/backends/memcached.py | 25 | 6889 | "Memcached cache backend"
import pickle
import time
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils import six
from django.utils.encoding import force_str
from django.utils.functional import cached_property
class BaseMemcachedCache(BaseCache):
def __init__(self, server, ... | bsd-3-clause |
andyh616/mne-python | mne/gui/_fiducials_gui.py | 14 | 16327 | """Mayavi/traits GUI for setting MRI fiducials"""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
from glob import glob
import os
from ..externals.six.moves import map
# allow import without traits
try:
from mayavi.core.ui.mayavi_scene import MayaviScene
from mayavi.tool... | bsd-3-clause |
bollu/vispy | codegen/headerparser.py | 18 | 11567 | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
""" Code to parse a header file and create a list of constants,
functions (with arguments). This information can then be used to
autogenerate our OpenGL API.
"""
import os
im... | bsd-3-clause |
mdboom/pytest | extra/get_issues.py | 195 | 2286 | import json
import py
import textwrap
issues_url = "http://bitbucket.org/api/1.0/repositories/pytest-dev/pytest/issues"
import requests
def get_issues():
chunksize = 50
start = 0
issues = []
while 1:
post_data = {"accountname": "pytest-dev",
"repo_slug": "pytest",
... | mit |
gioman/QGIS | tests/src/python/test_qgscolorscheme.py | 20 | 4650 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsColorScheme.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__... | gpl-2.0 |
Dunkas12/BeepBoopBot | lib/youtube_dl/extractor/beeg.py | 15 | 4365 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_chr,
compat_ord,
compat_urllib_parse_unquote,
)
from ..utils import (
int_or_none,
parse_iso8601,
)
class BeegIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?beeg\.com/(?P<id>\d+)'
... | gpl-3.0 |
murfz/Sick-Beard | lib/requests/packages/chardet2/euctwfreq.py | 323 | 34864 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/numpy/distutils/command/build.py | 187 | 1618 | from __future__ import division, absolute_import, print_function
import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', ... | mit |
tijeco/Fuster | Simulations/makeSeed.py | 2 | 1189 | import sys
import random
import os
def makeCodon():
codon = ""
AA = "ATCG"
# print(len(AA),print(AA[0],AA[19]))
# print( random.randint(0,len(AA)))
codon += AA[random.randint(0,len(AA)-1)]
codon += AA[random.randint(0,len(AA)-1)]
codon += AA[random.randint(0,len(AA)-1)]
return codon
# pr... | gpl-3.0 |
geometalab/osmaxx | tests/selenium_tests/test_new_excerpt.py | 2 | 1561 | from urllib.parse import urljoin
import pytest
import requests
from selenium.webdriver.common.keys import Keys
from tests.selenium_tests.conftest import skip_selenium_tests, first_panel_on_excerpts_export_overview_xpath
from tests.selenium_tests.new_excerpt import new_excerpt
@skip_selenium_tests
@pytest.mark.param... | mit |
mspublic/openair4G-mirror | targets/TEST/OAI/case01.py | 1 | 11144 | #******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by ... | gpl-3.0 |
wellesleywatson/INFO3180-lab4-old | lib/flask/testsuite/views.py | 561 | 5068 | # -*- coding: utf-8 -*-
"""
flask.testsuite.views
~~~~~~~~~~~~~~~~~~~~~
Pluggable views.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import flask.views
import unittest
from flask.testsuite import FlaskTestCase
from werkzeug.http import par... | apache-2.0 |
andyseubert/doorbell | doorBellListener.py | 1 | 1322 | #!/usr/bin/python
from time import sleep
import os
import sys
import subprocess
from subprocess import Popen
import RPi.GPIO as GPIO
# global variables for commands and status
global alertcmd
alertcmd = "/opt/doorbell/ringer.py"
bellButtonPin=26
# board pin numbers are easier for me. If I move to another RPI versio... | unlicense |
BruceDLong/CodeDog | Docs/source/conf.py | 1 | 5796 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CodeDog documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 1 11:27:30 2020.
#
# 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
# au... | gpl-2.0 |
mitya57/debian-buildbot | buildbot/status/web/hooks/base.py | 3 | 3038 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
rdkit/rdkit-orig | rdkit/Chem/SATIS.py | 2 | 3432 | # $Id$
#
# Copyright (C) 2001-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" Functionality for ... | bsd-3-clause |
caveman-dick/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_organization.py | 34 | 3051 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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_version': '1.1... | gpl-3.0 |
grischa/django-tastypie | tests/basic/tests/resources.py | 20 | 6352 | from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
from tastypie.bundle import Bundle
from tastypie.fields import ToOneField, ToManyField
from tastypie.resources import ModelResource
from basic.api.resources import SlugBasedNoteResource
from basic.models imp... | bsd-3-clause |
daniel-fanjul-alcuten/ice | lib/gmock-1.6.0/gtest/test/gtest_break_on_failure_unittest.py | 1050 | 7214 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
nathanshartmann/portuguese_word_embeddings | sentence_similarity.py | 1 | 3369 |
"""
This script evaluates a embedding model in a semantic similarity perspective.
It uses the dataset of ASSIN sentence similarity shared task and the method
of Hartmann which achieved the best results in the competition.
ASSIN shared-task website:
http://propor2016.di.fc.ul.pt/?page_id=381
Paper of Hartmann can be ... | gpl-3.0 |
pawaranand/phr-frappe | frappe/app.py | 30 | 4041 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import sys, os
import json
import logging
from werkzeug.wrappers import Request, Response
from werkzeug.local import LocalManager
from werkzeug.exceptions import HTTPException, NotFound
from werkzeug.contrib.profile... | mit |
sankhesh/VTK | Examples/Annotation/Python/annotatePick.py | 9 | 2637 | #!/usr/bin/env python
# This example demonstrates cell picking using vtkCellPicker. It
# displays the results of picking using a vtkTextMapper.
from __future__ import print_function
import vtk
# create a sphere source, mapper, and actor
sphere = vtk.vtkSphereSource()
sphereMapper = vtk.vtkPolyDataMapper()
sphereMap... | bsd-3-clause |
aholkner/bacon | bacon/resource.py | 1 | 1151 | import os
import sys
from bacon import native
#: Path to resources. Set to the script directory by default during development, and the executable
#: directory for frozen applications.
resource_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
if native._mock_native:
resource_dir = ''
# Or use frozen executab... | mit |
kmonsoor/fabric | fabric/main.py | 27 | 25730 | """
This module contains Fab's `main` method plus related subroutines.
`main` is executed as the command line ``fab`` program and takes care of
parsing options and commands, loading the user settings file, loading a
fabfile, and executing the commands given.
The other callables defined in this module are internal onl... | bsd-2-clause |
pradiptad/zulip | zerver/lib/debug.py | 122 | 1113 | from __future__ import absolute_import
import code
import traceback
import signal
# Interactive debugging code from
# http://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application
# (that link also points to code for an interactive remote debugger
# setup, which we might want if ... | apache-2.0 |
CallaJun/hackprince | indico/skimage/viewer/widgets/history.py | 37 | 3338 | from textwrap import dedent
from ..qt import QtGui, QtCore
import numpy as np
import skimage
from ... import io, img_as_ubyte
from .core import BaseWidget
from ..utils import dialogs
__all__ = ['OKCancelButtons', 'SaveButtons']
class OKCancelButtons(BaseWidget):
"""Buttons that close the parent plugin.
O... | lgpl-3.0 |
meabsence/python-for-android | python-modules/twisted/twisted/protocols/ident.py | 56 | 7774 | # -*- test-case-name: twisted.test.test_ident -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Ident protocol implementation.
@author: Jean-Paul Calderone
"""
from __future__ import generators
import struct
from twisted.internet import defer
from twisted.protocols import ba... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.