repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
namecoin/namecore | test/functional/wallet_implicitsegwit.py | 48 | 2424 | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet implicit segwit feature."""
import test_framework.address as address
from test_framework.te... | mit |
humberos/android_kernel_samsung_smdk4412 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
jalavik/harvesting-kit | harvestingkit/scripts/fix_marc_record.py | 3 | 9033 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##
## This file is part of Harvesting Kit.
## Copyright (C) 2014 CERN.
##
## Harvesting Kit 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 |
mfherbst/spack | var/spack/repos/builtin/packages/r-gridextra/package.py | 5 | 1825 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Yuriy-Leonov/nova | nova/virt/vmwareapi/vmware_images.py | 8 | 8147 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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
# ... | apache-2.0 |
exercism/xpython | exercises/rest-api/example.py | 3 | 3151 | import json
class RestAPI:
def __init__(self, database=None):
self.database = database or {'users': []}
def update(self):
for user in self.database['users']:
owed_by = user['owed_by']
owes = user['owes']
for debtor in list(owed_by.keys()):
i... | mit |
rec/DMXIS | Macros/Python/pickletools.py | 5 | 76619 | '''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None,... | artistic-2.0 |
TurboTurtle/sos | sos/report/plugins/snmp.py | 5 | 1026 | # Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public Li... | gpl-2.0 |
Paul-Ezell/cinder-1 | cinder/tests/unit/test_volume_utils.py | 9 | 40038 | # 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 |
xrg/openerp-server | bin/pychart/zap.py | 15 | 2380 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey 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, or (at your option) any
# later vers... | agpl-3.0 |
kirca/odoo | addons/stock/procurement.py | 16 | 21333 | # -*- 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 |
balthamos/plover | plover/gui/util.py | 7 | 1868 | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
import sys
if sys.platform.startswith('win32'):
import win32gui
GetForegroundWindow = win32gui.GetForegroundWindow
SetForegroundWindow = win32gui.SetForegroundWindow
def SetTopApp():
# Nothing else is necessary for windows.
... | gpl-2.0 |
duoduo369/leaning-frontend | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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 common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
pjenvey/hellanzb | Hellanzb/Daemon.py | 2 | 28607 | """
Daemon (aka Ziplick) - Filesystem queue daemon functions. They're all called from inside
the twisted reactor loop, except for initialization functions
(c) Copyright 2005 Ben Bangert, Philip Jenvey
[See end of file]
"""
import os, re, sys, time, Hellanzb, PostProcessor, PostProcessorUtil
from shutil import copy, m... | bsd-3-clause |
havatv/QGIS | python/plugins/MetaSearch/dialogs/xmldialog.py | 30 | 1350 | # -*- coding: utf-8 -*-
###############################################################################
#
# CSW Client
# ---------------------------------------------------------
# QGIS Catalog Service client.
#
# Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com)
#
# This source is free software; you can redistri... | gpl-2.0 |
sysalexis/kbengine | kbe/src/lib/python/Lib/idlelib/tabbedpages.py | 86 | 18418 | """An implementation of tabbed pages using only standard Tkinter.
Originally developed for use in IDLE. Based on tabpage.py.
Classes exported:
TabbedPageSet -- A Tkinter implementation of a tabbed-page widget.
TabSet -- A widget containing tabs (buttons) in one or more rows.
"""
from tkinter import *
class InvalidN... | lgpl-3.0 |
arunkgupta/gramps | gramps/gen/filters/rules/person/_hasalternatename.py | 1 | 1794 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Gramps
#
# 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 late... | gpl-2.0 |
pfalcon/ScratchABlock | xform_inter.py | 1 | 2708 | # ScratchABlock - Program analysis and decompilation framework
#
# Copyright (c) 2015-2018 Paul Sokolovsky
#
# 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
#... | gpl-3.0 |
Parsl/parsl | parsl/tests/configs/comet.py | 1 | 1124 | from parsl.config import Config
from parsl.launchers import SrunLauncher
from parsl.providers import SlurmProvider
from parsl.executors import HighThroughputExecutor
from .user_opts import user_opts
def fresh_config():
return Config(
executors=[
HighThroughputExecutor(
label='C... | apache-2.0 |
visdesignlab/TulipPaths | tulippaths/connectivityMatrix.py | 2 | 8648 | from . import utils
from .path import *
from .pathFinder import *
import copy
class ConnectivityMatrix:
def __init__(self, graph):
self._graph = graph
self._paths = []
self._nodes = []
self._initialMatrix = []
self._matrix = []
self._rowLabels = []
self._... | mit |
jeremiahmarks/sl4a | python-build/python-libs/gdata/src/gdata/alt/app_engine.py | 136 | 3386 | #!/usr/bin/python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
tianzhidao28/pyspider | tests/test_fetcher.py | 63 | 12804 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-15 22:10:35
import os
import json
import copy
import time
import umsgpack
import subprocess
import unittest2 as unittest
from multiprocessing impor... | apache-2.0 |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/namedict.py | 248 | 2107 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation 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 PROVIDED ... | gpl-3.0 |
nan86150/ImageFusion | lib/python2.7/site-packages/matplotlib/tests/__init__.py | 17 | 2578 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import difflib
import os
from matplotlib import rcParams, rcdefaults, use
_multiprocess_can_split_ = True
# Check that the test directories exist
if not os.path.exists(os.path.join(
os.... | mit |
rnder/data-science-from-scratch | code/ch15_multiple_regression.py | 60 | 8590 | from __future__ import division
from collections import Counter
from functools import partial
from linear_algebra import dot, vector_add
from statistics import median, standard_deviation
from probability import normal_cdf
from gradient_descent import minimize_stochastic
from simple_linear_regression import total_sum_of... | unlicense |
destijl/grr | grr/lib/flows/general/windows_vsc_test.py | 2 | 3543 | #!/usr/bin/env python
"""Tests for Windows Volume Shadow Copy flow."""
import stat
from grr.lib import aff4
from grr.lib import flags
from grr.lib import test_lib
# needed for ListVolumeShadowCopies pylint: disable=unused-import
from grr.lib.flows.general import windows_vsc
# pylint: enable=unused-import
from grr.lib.... | apache-2.0 |
XiaodunServerGroup/xiaodun-platform | i18n/execute.py | 6 | 1552 | import os, subprocess, logging
from i18n.config import BASE_DIR
LOG = logging.getLogger(__name__)
def execute(command, working_directory=BASE_DIR):
"""
Executes shell command in a given working_directory.
Command is a string to pass to the shell.
Output is ignored.
"""
LOG.info("Executing in ... | agpl-3.0 |
artscoop/django-extensions | django_extensions/management/commands/dumpscript.py | 24 | 29506 | # -*- coding: UTF-8 -*-
"""
Title: Dumpscript management command
Project: Hardytools (queryset-refactor version)
Author: Will Hardy (http://willhardy.com.au)
Date: June 2008
Usage: python manage.py dumpscript appname > scripts/scriptname.py
$Revision: 217 $
Description:
Generates a Py... | mit |
david-lassonde-adsk/pymel | pymel/util/namedtuple.py | 8 | 5952 | """ Cookbook recipe 500261, Raymond Hettinger, planned for inclusion in 2.6 :
http://docs.python.org/dev/library/collections.html#collections.namedtuple """
from operator import itemgetter as _itemgetter
from keyword import iskeyword as _iskeyword
import sys as _sys
__all__ = ['namedtuple']
def namedtuple(typenam... | bsd-3-clause |
onceuponatimeforever/oh-mainline | vendor/packages/kombu/examples/complete_send.py | 31 | 1152 | """
Example producer that sends a single message and exits.
You can use `complete_receive.py` to receive the message sent.
"""
from kombu import Connection, Producer, Exchange, Queue
#: By default messages sent to exchanges are persistent (delivery_mode=2),
#: and queues and exchanges are durable.
exchange = Exchan... | agpl-3.0 |
ahua/pythondotorg | pages/management/commands/fix_success_story_images.py | 14 | 2607 | import re
import os
import requests
from urllib.parse import urlparse
from django.core.management.base import BaseCommand
from django.conf import settings
from django.core.files import File
from ...models import Page, Image, page_image_path
class Command(BaseCommand):
""" Fix success story page images """
... | apache-2.0 |
andreugrimalt/Theano-Tutorials | 5_convolutional_net.py | 1 | 3899 | import theano
from theano import tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import numpy as np
from load import mnist
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 imp... | mit |
prechelt/pyth | pyth/encodings/symbol.py | 1 | 4338 | """
Maps Symbol typeface to Unicode, extracted from http://en.wikipedia.org/wiki/Symbol_(typeface)
"""
from __future__ import absolute_import
import codecs
import six
from six.moves import map
decodeTable = {
32: 32,
33: 33, 34: 8704, 35: 35, 36: 8707, 37: 37, 38: 38, 39: 8717, 40: 40, 41: 41, 42: 42, 43: 43... | mit |
hobarrera/django | tests/template_tests/syntax_tests/test_numpy.py | 353 | 1429 | import warnings
from unittest import skipIf
from django.test import SimpleTestCase
from ..utils import setup
try:
import numpy
except ImportError:
numpy = False
@skipIf(numpy is False, "Numpy must be installed to run these tests.")
class NumpyTests(SimpleTestCase):
# Ignore numpy deprecation warnings (... | bsd-3-clause |
hronoses/vispy | vispy/app/inputhook.py | 21 | 2446 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Support for interactive mode to allow VisPy's event loop to be run alongside
a console terminal, without using threads. This code relies on inputhooks
built-in to the Pyth... | bsd-3-clause |
mbauskar/tele-frappe | frappe/model/docfield.py | 61 | 1451 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""docfield utililtes"""
import frappe
def rename(doctype, fieldname, newname):
"""rename docfield"""
df = frappe.db.sql("""select * from tabDocField where parent=%s and field... | mit |
BellScurry/gem5-fault-injection | configs/ruby/MESI_Three_Level.py | 18 | 12369 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009,2015 Advanced Micro Devices, Inc.
# Copyright (c) 2013 Mark D. Hill and David A. Wood
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | bsd-3-clause |
sparsebase/stromx | opencv/methodgenerator.py | 1 | 61358 | # -*- coding: utf-8 -*-
import document
import interface
import package
import rulegenerator
import testgenerator
class ArgumentVisitorBase(interface.ArgumentVisitor):
def visitReturnValue(self, retValue):
self.visitAllocation(retValue)
class SingleArgumentVisitor(ArgumentVisitorBase):
"""
V... | apache-2.0 |
nmercier/linux-cross-gcc | linux/lib/python2.7/rlcompleter.py | 21 | 5991 | """Word completion for GNU readline.
The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.
It's very cool to do "import sys" type "sys.", hit the com... | bsd-3-clause |
kxliugang/edx-platform | lms/lib/courseware_search/lms_filter_generator.py | 58 | 5634 | """
This file contains implementation override of SearchFilterGenerator which will allow
* Filter by all courses in which the user is enrolled in
"""
from microsite_configuration import microsite
from student.models import CourseEnrollment
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import Co... | agpl-3.0 |
foobert/ansible-modules-core | cloud/amazon/ec2_ami_find.py | 77 | 9793 | #!/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 |
aleisalem/Aion | data_generation/stimulation/Garfield.py | 1 | 20528 | #!/usr/bin/python
# Python modules
import sys, os, shutil, glob, io
# Aion modules
from Aion.utils.graphics import *
from Aion.utils.data import *
from Aion.shared.constants import *
# Third-party libraries
from androguard.session import Session
from androguard.misc import AXMLPrinter
class Garfield():
""" Gar... | gpl-3.0 |
tkruse/rosinstall | src/rosinstall/simple_checkout.py | 1 | 2400 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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... | bsd-3-clause |
dnet/suds | suds/sax/__init__.py | 200 | 3253 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 in the hope that it will ... | lgpl-3.0 |
Stavitsky/nova | nova/servicegroup/drivers/db.py | 23 | 3982 | # Copyright 2012 IBM Corp.
#
# 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, sof... | apache-2.0 |
youdonghai/intellij-community | python/helpers/pycharm/noserunner.py | 30 | 2391 | import sys
import os
helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
if sys.path[0] != helpers_dir:
sys.path.insert(0, helpers_dir)
from nose_utils import TeamcityPlugin
from pycharm_run_utils import debug, import_system_module
from pycharm_run_utils import adjust_sys_path
adjust_sys_path(False)
sh... | apache-2.0 |
leesavide/pythonista-docs | Documentation/matplotlib/mpl_examples/pylab_examples/contourf_log.py | 9 | 1350 | '''
Demonstrate use of a log color scale in contourf
'''
from matplotlib import pyplot as P
import numpy as np
from numpy import ma
from matplotlib import colors, ticker, cm
from matplotlib.mlab import bivariate_normal
N = 100
x = np.linspace(-3.0, 3.0, N)
y = np.linspace(-2.0, 2.0, N)
X, Y = np.meshgrid(x, y)
# A ... | apache-2.0 |
jhjguxin/PyCDC | obp.lovelykarrigell/module/Karrigell_QuickForm.py | 2 | 18595 | #@ignore
#@language python
#@ignore
#@language python
"""
Package: Karrigell_QuickForm-1.0.1-alpha
Requirements: Karrigell HTTP Server - http://karrigell.sourceforge.net
Description: - A simple class that generates html forms with some basic javascript validations.
- It is similar to HTML_QuickForm... | gpl-3.0 |
arnaud-morvan/QGIS | scripts/pyuic-wrapper.py | 32 | 1138 | # -*- coding: utf-8 -*-
"""
***************************************************************************
pyuic-wrapper.py
---------------------
Date : March 2016
Copyright : (C) 2016 by Juergen E. Fischer
Email : jef at norbit dot de
************************... | gpl-2.0 |
favll/pogom | pogom/pgoapi/protos/POGOProtos/Networking/Responses/CheckAwardedBadgesResponse_pb2.py | 16 | 3622 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/CheckAwardedBadgesResponse.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _messa... | mit |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/matplotlib/tests/test_patheffects.py | 10 | 5445 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from matplotlib.testing.decorators import image_comparison, cleanup
import matplotlib.pyplot as plt
import matplotlib.patheffects as path_effects
try:
# mock in python 3.3+
... | mit |
flamusdiu/oauthlib | tests/oauth2/rfc6749/clients/test_base.py | 15 | 8489 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from ....unittest import TestCase
import datetime
from oauthlib import common
from oauthlib.oauth2.rfc6749 import utils
from oauthlib.oauth2 import Client
from oauthlib.oauth2 import InsecureTransportError
from oauthlib.oauth2.rfc6749.cli... | bsd-3-clause |
martin31242/rccar | draft7/main.py | 1 | 6464 | import web
from web import form
import socket
import RPi.GPIO as GPIO
import time
from threading import Thread
from threading import Lock
localhost = "http://" + socket.gethostbyname(socket.gethostname()) + ":8080"
print(localhost)
global infrared, ultrasonic, servomotor, motor_L1, motor_L2, motor_R1, motor_R2... | mit |
ronakkhunt/kuma | vendor/packages/translate/lang/el.py | 24 | 2066 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007-2009,2011 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 vers... | mpl-2.0 |
miing/mci_migo | identityprovider/tests/test_models_person.py | 1 | 2438 | # Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
from random import randint
from identityprovider.models.account import Account, LPOpenIdIdentifier
from identityprovider.models.const import (
AccountCreationRationale,
Acc... | agpl-3.0 |
biocore/qiime | tests/test_estimate_observation_richness.py | 15 | 26872 | #!/usr/bin/env python
from __future__ import division
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2013, The QIIME Project"
__credits__ = ["Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jai Ram Rideout"
__email__ = "jai.rideout@gmail.com"
"""Test suite for the estimate... | gpl-2.0 |
mattjvincent/file2db | file2db/compat.py | 1 | 2099 | # -*- coding: utf-8 -*-
# taken from requests library: https://github.com/kennethreitz/requests
"""
pythoncompat
"""
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and... | bsd-3-clause |
CydarLtd/ansible | test/units/modules/network/nxos/test_nxos_bgp_af.py | 9 | 3510 | # (c) 2016 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 dis... | gpl-3.0 |
EverlyWell/redash | redash/handlers/embed.py | 4 | 3617 | import logging
import time
import pystache
from flask import request
from authentication import current_org
from flask_login import current_user, login_required
from flask_restful import abort
from redash import models, utils
from redash.handlers import routes
from redash.handlers.base import (get_object_or_404, org_... | bsd-2-clause |
vitaly4uk/django | tests/template_tests/tests.py | 183 | 4760 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.contrib.auth.models import Group
from django.core import urlresolvers
from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import UNKNOWN_SOURCE
from django.test import SimpleTestCase, override... | bsd-3-clause |
Vagab0nd/SiCKRAGE | lib3/unidecode/x05c.py | 252 | 4612 | data = (
'Po ', # 0x00
'Feng ', # 0x01
'Zhuan ', # 0x02
'Fu ', # 0x03
'She ', # 0x04
'Ke ', # 0x05
'Jiang ', # 0x06
'Jiang ', # 0x07
'Zhuan ', # 0x08
'Wei ', # 0x09
'Zun ', # 0x0a
'Xun ', # 0x0b
'Shu ', # 0x0c
'Dui ', # 0x0d
'Dao ', # 0x0e
'Xiao ', # 0x0f
'Ji ', # 0x10... | gpl-3.0 |
chaluemwut/fbserver | venv/lib/python2.7/site-packages/sklearn/feature_extraction/text.py | 1 | 49725 | # -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gma... | apache-2.0 |
michael-dev2rights/ansible | test/units/modules/network/nxos/test_nxos_ospf.py | 47 | 1964 | # (c) 2016 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 dis... | gpl-3.0 |
polimediaupv/edx-platform | common/djangoapps/student/tests/test_reset_password.py | 54 | 10790 | """
Test the various password reset flows
"""
import json
import re
import unittest
from django.core.cache import cache
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.contrib.auth.hashers import UNU... | agpl-3.0 |
pjdelport/django | django/contrib/messages/tests/cookie.py | 9 | 5435 | import json
from django.contrib.messages import constants
from django.contrib.messages.tests.base import BaseTest
from django.contrib.messages.storage.cookie import (CookieStorage,
MessageEncoder, MessageDecoder)
from django.contrib.messages.storage.base import Message
from django.test.utils import override_settin... | bsd-3-clause |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/end_to_end_ml/solutions/serving/application/lib/werkzeug/routing.py | 9 | 73410 | # -*- coding: utf-8 -*-
"""
werkzeug.routing
~~~~~~~~~~~~~~~~
When it comes to combining multiple controller or view functions (however
you want to call them) you need a dispatcher. A simple way would be
applying regular expression tests on the ``PATH_INFO`` and calling
registered callback fun... | apache-2.0 |
Eric-Zhong/odoo | addons/l10n_gt/__init__.py | 411 | 1113 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Soluciones Tecnologócias Prisma S.A. All Rights Reserved.
# José Rodrigo Fernández Menegazzo, Soluciones Tecnologócias Prisma S.A.
# (http://www.solucionesprisma.com)
#
# This prog... | agpl-3.0 |
aonotas/chainer | tests/chainer_tests/links_tests/connection_tests/test_highway.py | 9 | 2427 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
class TestHighway(unittest.TestCase):
in_out_size = 3
def setUp(self):
... | mit |
SofiaReis/django-cms | cms/test_utils/project/sampleapp/south_migrations/0001_initial.py | 46 | 3361 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table(u'sampleapp_category', (
... | bsd-3-clause |
ojengwa/talk | venv/lib/python2.7/site-packages/setuptools/site-patch.py | 720 | 2389 | def __boot():
import sys
import os
PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH):
PYTHONPATH = []
else:
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys,'path_importer_cache',{})
stdpath = sys.path[le... | mit |
fiete201/qutebrowser | tests/unit/utils/test_urlmatch.py | 2 | 23551 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
abhiQmar/servo | tests/wpt/harness/wptrunner/wptmanifest/tests/test_serializer.py | 59 | 4791 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import unittest
from cStringIO import StringIO
import pytest
from .. import parser, serializer
class Tok... | mpl-2.0 |
incaser/odoo-odoo | addons/portal/__init__.py | 382 | 1140 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
zetaops/ulakbus | tests/test_ders_ve_sinav_programi_hazirla.py | 1 | 9633 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
from pyoko.db.adapter.db_riak import BlockSave
from ulakbus.models import User, DersEtkinligi, SinavEtkinligi, Donem, Room
from zengine.lib.test_utils imp... | gpl-3.0 |
plone/plone.server | src/plone.server/plone/server/api/content.py | 1 | 14057 | # -*- coding: utf-8 -*-
from aiohttp.web_exceptions import HTTPMethodNotAllowed
from aiohttp.web_exceptions import HTTPNotFound
from aiohttp.web_exceptions import HTTPUnauthorized
from dateutil.tz import tzlocal
from plone.server import app_settings
from plone.server import configure
from plone.server import _
from plo... | bsd-2-clause |
Zhaoyanzhang/-myflasky | venv/lib/python2.7/site-packages/flask_pagedown/widgets.py | 8 | 1872 | from wtforms.widgets import HTMLString, TextArea
pagedown_pre_html = '<div class="flask-pagedown">'
pagedown_post_html = '</div>'
preview_html = '''
<div class="flask-pagedown-preview" id="flask-pagedown-%(field)s-preview"></div>
<script type="text/javascript">
f = function() {
if (typeof flask_pagedown_converter ... | mit |
LaoZhongGu/kbengine | kbe/res/scripts/common/Lib/test/test_pow.py | 177 | 4593 | import test.support, unittest
class PowTest(unittest.TestCase):
def powtest(self, type):
if type != float:
for i in range(-1000, 1000):
self.assertEqual(pow(type(i), 0), 1)
self.assertEqual(pow(type(i), 1), type(i))
self.assertEqual(pow(type(0), ... | lgpl-3.0 |
raghavrv/scikit-learn | sklearn/neighbors/tests/test_approximate.py | 12 | 20126 | """
Testing for the approximate neighbor search using
Locality Sensitive Hashing Forest module
(sklearn.neighbors.LSHForest).
"""
# Author: Maheshakya Wijewardena, Joel Nothman
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
wongkwunkit/jinja2 | tests/test_utils.py | 22 | 1969 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~
Tests utilities jinja uses.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import gc
import pytest
import pickle
from jinja2.utils import LRUCache, escape, object_type_repr
@pyt... | bsd-3-clause |
stopstalk/stopstalk-deployment | private/scripts/populate-institute-to-country.py | 1 | 2063 | """
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
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
... | mit |
ambikeshwar1991/gnuradio | gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py | 18 | 1854 | #!/usr/bin/env python
#
# Copyright 2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
laiqiqi886/kbengine | kbe/res/scripts/common/Lib/tkinter/_fix.py | 76 | 2897 | import sys, os
# Delay import _tkinter until we have set TCL_LIBRARY,
# so that Tcl_FindExecutable has a chance to locate its
# encoding directory.
# Unfortunately, we cannot know the TCL_LIBRARY directory
# if we don't know the tcl version, which we cannot find out
# without import Tcl. Fortunately, Tcl will itself ... | lgpl-3.0 |
frederick-masterton/django | django/views/i18n.py | 68 | 11000 | import importlib
import json
import os
import gettext as gettext_module
from django import http
from django.apps import apps
from django.conf import settings
from django.template import Context, Template
from django.utils.translation import check_for_language, to_locale, get_language, LANGUAGE_SESSION_KEY
from django.... | bsd-3-clause |
talishte/ctigre | env/lib/python2.7/site-packages/django/core/files/uploadedfile.py | 223 | 4156 | """
Classes representing uploaded files.
"""
import os
from io import BytesIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',... | bsd-2-clause |
futurulus/scipy | scipy/io/harwell_boeing/_fortran_format_parser.py | 127 | 9092 | """
Preliminary module to handle fortran formats for IO. Does not use this outside
scipy.sparse io for now, until the API is deemed reasonable.
The *Format classes handle conversion between fortran and python format, and
FortranFormatParser can create *Format instances from raw fortran format
strings (e.g. '(3I4)', '(... | bsd-3-clause |
neilLasrado/erpnext | erpnext/assets/doctype/asset_category/asset_category.py | 1 | 4214 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint, get_link_to_form
from frappe.model.document import Document
class Ass... | gpl-3.0 |
sunil07t/e-mission-server | emission/core/wrapper/client.py | 1 | 2709 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
#
# In the current iteration, there is a client object that can be loaded from
# the filesystem into the database and its settings loaded from the database.
# There are no... | bsd-3-clause |
ktnyt/chainer | chainerx/math/misc.py | 2 | 1549 | import chainerx
# TODO(sonots): Implement in C++
def square(x):
"""Returns the element-wise square of the input.
Args:
x (~chainerx.ndarray or scalar): Input data
Returns:
~chainerx.ndarray: Returned array: :math:`y = x * x`.
A scalar is returned if ``x`` is a scalar.
Note:
... | mit |
femmerling/DirMaker | box/lib/python2.7/site-packages/migrate/tests/versioning/test_version.py | 32 | 5951 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from migrate.exceptions import *
from migrate.versioning.version import *
from migrate.tests import fixture
class TestVerNum(fixture.Base):
def test_invalid(self):
"""Disallow invalid version numbers"""
versions = ('-1', -1, 'Thirteen', '')
f... | mit |
yodalee/servo | tests/wpt/web-platform-tests/tools/wptserve/docs/conf.py | 467 | 7855 | # -*- coding: utf-8 -*-
#
# wptserve documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 14 17:23:24 2013.
#
# 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.
#
# Al... | mpl-2.0 |
0-wiz-0/audacity | lib-src/libsndfile/src/create_symbols_file.py | 39 | 5490 | #!/usr/bin/python
# Copyright (C) 2003-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# 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 ... | gpl-2.0 |
calfonso/ansible | lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py | 23 | 8816 | #!/usr/bin/python
# (c) 2017, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
parrt/lolviz | prince_dtree.py | 1 | 12296 | import IPython, graphviz, re
from io import StringIO
from IPython.display import Image
import numpy as np
import pandas as pd
import math
from sklearn import tree
from sklearn.datasets import load_boston, load_iris
from collections import defaultdict
import string
import re
YELLOW = "#fefecd" # "#fbfbd0" # "#FBFEB0"
B... | bsd-3-clause |
gilhooley/python_koans | python3/libs/colorama/win32.py | 451 | 4833 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
from ctypes import wintypes
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Str... | mit |
SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/menus/base.py | 13 | 1838 | # -*- coding: utf-8 -*-
from django.utils.encoding import smart_str
class Menu(object):
namespace = None
def __init__(self):
if not self.namespace:
self.namespace = self.__class__.__name__
def get_nodes(self, request):
"""
should return a list of NavigationNode in... | mit |
RahulMahalingam/raft | tabs/CrawlerTab.py | 11 | 10084 | #
# crawler tab implementation
#
#
# Author: Gregory Fleischer (gfleischer@gmail.com)
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 |
cboyce93/epitome-xl | src/library_manager.py | 1 | 74166 | #!/usr/bin/env python
import pygtk
import gtk
import dill
import pango
import os
import subprocess
import time
pygtk.require('2.0')
from os.path import expanduser
from lib.Project import Project
from pipeline_editor import PipelineEditor
from lib.Module import Module
from dialog import Dialog
from util.library import... | gpl-3.0 |
stackforge/tricircle | tricircle/api/app.py | 1 | 2566 | # Copyright (c) 2015 Huawei, Tech. Co,. Ltd.
# 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
#
# Unle... | apache-2.0 |
ravindrapanda/tensorflow | tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler_test.py | 15 | 47753 | # 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... | apache-2.0 |
TsubameDono/codecombat | scripts/analytics/parseStripePayments.py | 97 | 10435 | # Parse Stripe payment info via exported payments.csv files
import sys
from datetime import tzinfo, timedelta, datetime
# TODO: use stripe_customers.csv to match payments to our db data
# Stripe file format
# id,Description,Created (UTC),Amount,Amount Refunded,Currency,Converted Amount,Converted Amount Refunded,Fee,... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.