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 |
|---|---|---|---|---|---|
PtrMan/wusstrace | pywuss/visitor/htmlify.py | 4 | 3918 | # Copyright notice
# ================
#
# Copyright (C) 2010
# Lorenzo Martignoni <martignlo@gmail.com>
# Roberto Paleari <roberto.paleari@gmail.com>
#
# 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... | gpl-3.0 |
CINPLA/expipe-dev | phy/phy/cluster/views/trace.py | 2 | 16379 | # -*- coding: utf-8 -*-
"""Trace view."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import logging
import numpy as np
from phy.plot.transform import NDC, Range
from vispy.util.event impor... | gpl-3.0 |
havard024/prego | crm/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | mit |
MDAnalysis/mdanalysis | package/MDAnalysis/analysis/encore/dimensionality_reduction/reduce_dimensionality.py | 1 | 9928 | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | gpl-2.0 |
CiscoSystems/neutron | neutron/tests/unit/test_hacking.py | 5 | 5110 | # 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
# d... | apache-2.0 |
alianmohammad/pd-gem5 | src/mem/slicc/generate/dot.py | 92 | 2077 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
GabrielNicolasAvellaneda/dd-agent | tests/checks/mock/test_mesos_slave.py | 45 | 1565 | # stdlib
import json
# 3p
from mock import patch
from nose.plugins.attrib import attr
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest, Fixtures, get_check_class
def _mocked_get_state(*args, **kwargs):
state = json.loads(Fixtures.read_file('state.json'))
return state
de... | bsd-3-clause |
piquadrat/django | tests/conditional_processing/tests.py | 86 | 12853 | from datetime import datetime
from django.test import SimpleTestCase, override_settings
FULL_RESPONSE = 'Test conditional get response'
LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47)
LAST_MODIFIED_STR = 'Sun, 21 Oct 2007 23:21:47 GMT'
LAST_MODIFIED_NEWER_STR = 'Mon, 18 Oct 2010 16:56:23 GMT'
LAST_MODIFIED_INVALID... | bsd-3-clause |
petertodd/replace-by-fee-tools | doublespend.py | 1 | 7977 | #!/usr/bin/python3
# Copyright (C) 2014 Peter Todd <pete@petertodd.org>
#
# This file is subject to the license terms in the LICENSE file found in the
# top-level directory of this distribution.
import argparse
import binascii
import bitcoin
import bitcoin.rpc
import logging
import math
import time
from bitcoin.core ... | gpl-3.0 |
shiquanwang/pylearn2 | pylearn2/cross_validation/tests/test_train_cv_extensions.py | 49 | 1681 | """
Tests for TrainCV extensions.
"""
import os
import tempfile
from pylearn2.config import yaml_parse
from pylearn2.testing.skip import skip_if_no_sklearn
def test_monitor_based_save_best_cv():
"""Test MonitorBasedSaveBestCV."""
handle, filename = tempfile.mkstemp()
skip_if_no_sklearn()
trainer = ya... | bsd-3-clause |
edx-solutions/edx-platform | openedx/core/djangoapps/catalog/management/commands/cache_programs.py | 4 | 11186 | """"Management command to add program information to the cache."""
import logging
import sys
from collections import defaultdict
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.management import BaseCommand
from six impo... | agpl-3.0 |
Echelon9/vulk | vulk/tests/math/bak_vector.py | 2 | 1975 | from vulk.math.vector import Vector2
from vulk.math.vector import Vector3
def test_init():
assert len(Vector2(0, 0)) == 2
assert len(Vector3(0, 0, 0)) == 3
def test_equals():
assert Vector3(1, 2, 3) == Vector3(1, 2, 3)
assert Vector2(4, 5) == Vector2(4, 5)
def test_iter():
vector = Vector3(1, ... | apache-2.0 |
adrienbrault/home-assistant | tests/components/group/common.py | 15 | 1784 | """Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from homeassistant.components.group import (
ATTR_ADD_ENTITIES,
ATTR_ENTITIES,
ATTR_OBJECT_ID,
DOMAIN,
SERVICE_REMOVE,
SERVICE_SET,
)
from... | mit |
NICTA/dora | dora/active_sampling/delaunay_sampler.py | 1 | 4870 | """
Delaunay Sampler Module.
Provides the Delaunay Sampler Class which contains the strategies for
active sampling a spatial field
"""
from dora.active_sampling.base_sampler import Sampler, grid_sample
import numpy as np
from scipy.spatial import Delaunay as ScipyDelaunay
class Delaunay(Sampler):
"""
Delau... | apache-2.0 |
miptliot/edx-platform | openedx/core/djangoapps/safe_sessions/tests/test_middleware.py | 15 | 12716 | # pylint: disable=no-member
# pylint: disable=protected-access
"""
Unit tests for SafeSessionMiddleware
"""
import ddt
from django.conf import settings
from django.contrib.auth import SESSION_KEY
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse, HttpResponseRedirect, SimpleCooki... | agpl-3.0 |
jzitelli/three.js | utils/exporters/blender/addons/io_three/logger.py | 121 | 1589 | import os
import logging
import tempfile
from . import constants
LOG_FILE = None
LOGGER = None
LEVELS = {
constants.DEBUG: logging.DEBUG,
constants.INFO: logging.INFO,
constants.WARNING: logging.WARNING,
constants.ERROR: logging.ERROR,
constants.CRITICAL: logging.CRITICAL
}
def init(filename, l... | mit |
snamstorm/rockstor-core | src/rockstor/storageadmin/models/__init__.py | 2 | 2046 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
pipehappy1/super-engine | mlbase/binary.py | 1 | 6426 | import numpy as np
import theano
import theano.tensor as T
import mlbase.networkhelper as N
import h5py
from theano.scalar.basic import UnaryScalarOp, same_out_nocomplex
from theano.tensor.elemwise import Elemwise
class BinaryOp(UnaryScalarOp):
def c_code(self, node, name, x1, z1, sub):
x = x1[0]
... | bsd-3-clause |
mmalorni/server-tools | __unported__/base_external_dbsource/base_external_dbsource.py | 6 | 6672 | # -*- coding: utf-8 -*-
##############################################################################
#
# Daniel Reis
# 2011
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundati... | agpl-3.0 |
gogobook/Spirit | example/project/settings/prod.py | 5 | 1898 | # -*- coding: utf-8 -*-
# MINIMAL CONFIGURATION FOR PRODUCTION ENV
# Create your own prod_local.py
# import * this module there and use it like this:
# python manage.py runserver --settings=project.settings.prod_local
from __future__ import unicode_literals
from .base import *
DEBUG = False
# https://docs.django... | mit |
redhat-openstack/trove | trove/tests/api/user_access.py | 7 | 21716 | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
100star/h2o | py/testdir_single_jvm/test_GLM2_covtype_train.py | 9 | 4476 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_exec, h2o_glm, h2o_gbm, h2o_exec as h2e
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(jav... | apache-2.0 |
zieckey/sdhash | sdhash-ui/cherrypy/tutorial/tut03_get_and_post.py | 36 | 1733 | """
Tutorial - Passing variables
This tutorial shows you how to pass GET/POST variables to methods.
"""
import cherrypy
class WelcomePage:
def index(self):
# Ask for the user's name.
return '''
<form action="greetUser" method="GET">
What is your name?
<input ... | apache-2.0 |
Tudorvr/metagoofil | hachoir_parser/file_system/iso9660.py | 85 | 4954 | """
ISO 9660 (cdrom) file system parser.
Documents:
- Standard ECMA-119 (december 1987)
http://www.nondot.org/sabre/os/files/FileSystems/iso9660.pdf
Author: Victor Stinner
Creation: 11 july 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt32, UInt64, ... | gpl-2.0 |
Alexoner/shadowsocks | shadowsocks/eventloop.py | 949 | 7288 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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 requi... | apache-2.0 |
RackSec/ansible | lib/ansible/modules/net_tools/cloudflare_dns.py | 16 | 25457 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
#
# 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... | gpl-3.0 |
DLR-SC/DataFinder | src/datafinder/gui/admin/datastore_configuration_wizard/offline/storage_option_controller.py | 1 | 3268 | # $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
#
... | bsd-3-clause |
pixyj/feel | django-server/feel/quiz/models.py | 1 | 5024 | import uuid
from django.db import models
from django.contrib.auth.models import User
#from taggit.managers import TaggableManager
from core.models import TimestampedModel, UUIDModel
QUIZ_TYPES = (
(1, 'SHORT_ANSWER'),
(2, 'MCQ'),
)
class Quiz(TimestampedModel, UUIDModel):
question_input = models.Text... | mit |
sonaht/ansible | lib/ansible/module_utils/facts/system/service_mgr.py | 59 | 5946 | # Collect facts related to system service manager and init.
#
# 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) a... | gpl-3.0 |
devinbalkind/eden | modules/tests/staff/staff_import.py | 21 | 4228 | # -*- coding: utf-8 -*-
""" Sahana Eden Staff Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to de... | mit |
abrarshivani/kubernetes | cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py | 137 | 5613 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
windelbouwman/ppci-mirror | ppci/codegen/peephole.py | 1 | 1950 | """ Peephole optimization using the pipe-filter approach.
We face a certain stream of instructions. We take a look
at a very specific window and check if we can apply the
optimization. It's like scrolling over a sequence of
instructions and checking for possible optimizations.
"""
import logging
from ..binutils.outs... | bsd-2-clause |
renatofb/weblate | weblate/trans/machine/weblatetm.py | 11 | 2721 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
jackkiej/SickRage | lib/unidecode/x0bf.py | 253 | 5010 | data = (
'bbess', # 0x00
'bbeng', # 0x01
'bbej', # 0x02
'bbec', # 0x03
'bbek', # 0x04
'bbet', # 0x05
'bbep', # 0x06
'bbeh', # 0x07
'bbyeo', # 0x08
'bbyeog', # 0x09
'bbyeogg', # 0x0a
'bbyeogs', # 0x0b
'bbyeon', # 0x0c
'bbyeonj', # 0x0d
'bbyeonh', # 0x0e
'bbyeod', # 0x0f
'b... | gpl-3.0 |
johankaito/fufuka | microblog/old-flask/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | apache-2.0 |
drvinceknight/Nashpy | tests/unit/test_game.py | 1 | 20748 | """
Tests for the game class
"""
import unittest
import warnings
import numpy as np
from hypothesis import given
from hypothesis.extra.numpy import arrays
from hypothesis.strategies import integers
import pytest
import nashpy as nash
import nashpy.learning
class TestGame(unittest.TestCase):
"""
Tests for t... | mit |
RPGOne/Skynet | scikit-learn-0.18.1/sklearn/utils/class_weight.py | 29 | 7411 | # Authors: Andreas Mueller
# Manoj Kumar
# License: BSD 3 clause
import warnings
import numpy as np
from ..externals import six
from ..utils.fixes import in1d
from .fixes import bincount
def compute_class_weight(class_weight, classes, y):
"""Estimate class weights for unbalanced datasets.
Paramete... | bsd-3-clause |
pombredanne/SmartNotes | appengine_django/db/base.py | 58 | 5010 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | gpl-3.0 |
zenhacklab/OpenBazaar | ecdsa/util.py | 14 | 9864 | from __future__ import division
import os
import math
import binascii
from hashlib import sha256
from . import der
from .curves import orderlen
from .six import PY3, int2byte, b, next
# RFC5480:
# The "unrestricted" algorithm identifier is:
# id-ecPublicKey OBJECT IDENTIFIER ::= {
# iso(1) member-body(2) ... | agpl-3.0 |
ksmit799/Toontown-Source | toontown/minigame/DistributedVineGameAI.py | 1 | 12010 | from DistributedMinigameAI import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
import VineGameGlobals
class DistributedVineGameAI(DistributedMinigameAI):
def __init__(self, air, minigameId):
try:
self.DistributedVineGameAI_initialized
except:
self... | mit |
bdarnell/tornado | maint/benchmark/chunk_benchmark.py | 10 | 1622 | #!/usr/bin/env python
#
# Downloads a large file in chunked encoding with both curl and simple clients
import logging
from tornado.curl_httpclient import CurlAsyncHTTPClient
from tornado.simple_httpclient import SimpleAsyncHTTPClient
from tornado.ioloop import IOLoop
from tornado.options import define, options, parse_... | apache-2.0 |
claudep/translate | translate/convert/test_po2mozlang.py | 1 | 2512 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.convert import po2mozlang, test_convert
from translate.misc import wStringIO
from translate.storage import po
class TestPO2Lang:
def po2lang(self, posource):
"""helper that converts po source to .lang source without requiring files"""
... | gpl-2.0 |
onceuponatimeforever/oh-mainline | vendor/packages/scrapy/scrapy/http/response/dammit.py | 16 | 11593 | """
This module contains a fork of the UnicodeDammit class from BeautifulSoup, that
expliclty disabled any usage of chardet library.
The UnicodeDammit class is used as a last resource for detecting the encoding
of a response.
"""
import re
import codecs
chardet = None # we don't want to use chardet since it's very s... | agpl-3.0 |
camptocamp/ngo-addons-backport | addons/account/account_financial_report.py | 52 | 7727 | # -*- 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 |
bealdav/OpenUpgrade | addons/account_followup/account_followup.py | 32 | 28544 | # -*- 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 |
sexroute/commandergenius | project/jni/python/src/Lib/idlelib/tabbedpages.py | 142 | 18188 | """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-2.1 |
Jobava/csvkit | tests/test_utilities/test_csvjson.py | 20 | 4672 | #!/usr/bin/env python
import json
import six
try:
import unittest2 as unittest
except ImportError:
import unittest
from csvkit.exceptions import NonUniqueKeyColumnException
from csvkit.utilities.csvjson import CSVJSON
class TestCSVJSON(unittest.TestCase):
def test_simple(self):
args = ['example... | mit |
burkesquires/pyeq2 | ExtendedVersionHandlers/ExtendedVersionHandler_Inverse.py | 3 | 1956 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
# pyeq2 is a collection of equations expressed as Python classes
#
# Copyright (C) 2013 James R. Phillips
# 2548 Vera Cruz Drive
# Birmingham, AL 35235 USA
#
# email: zunzun@zunzun.com
#
... | bsd-2-clause |
xNovax/SickRage | lib/feedcache/test_cache.py | 28 | 10024 | #!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and tha... | gpl-3.0 |
pakoito/DT3 | DT3Core/3rdParty/freetype-2.4.7/src/tools/glnames.py | 360 | 105239 | #!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LI... | mit |
Lyleo/nupic | nupic/regions/ImageSensorExplorers/BaseExplorer.py | 18 | 10420 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
jaharkes/home-assistant | homeassistant/components/sensor/rfxtrx.py | 4 | 4743 | """
Support for RFXtrx sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.rfxtrx/
"""
import logging
import voluptuous as vol
import homeassistant.components.rfxtrx as rfxtrx
import homeassistant.helpers.config_validation as cv
from homeassi... | mit |
quentinsf/ansible | test/units/plugins/cache/test_cache.py | 98 | 3150 | # (c) 2012-2015, 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) an... | gpl-3.0 |
tinixx/linux | scripts/gdb/linux/lists.py | 630 | 2897 | #
# gdb helper commands and functions for Linux kernel debugging
#
# list tools
#
# Copyright (c) Thiebaud Weksteen, 2015
#
# Authors:
# Thiebaud Weksteen <thiebaud@weksteen.fr>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
list_head = utils.CachedType("st... | gpl-2.0 |
toby82/paramiko | tests/test_client.py | 23 | 12573 | # Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 version 2.1 of the License, or (a... | lgpl-2.1 |
ayesandarmoe/microblog_flask_tutorial | flask/lib/python2.7/site-packages/pytz/lazy.py | 514 | 5263 | from threading import RLock
try:
from UserDict import DictMixin
except ImportError:
from collections import Mapping as DictMixin
# With lazy loading, we might end up with multiple threads triggering
# it at the same time. We need a lock.
_fill_lock = RLock()
class LazyDict(DictMixin):
"""Dictionary popu... | gpl-2.0 |
cactusbin/nyt | matplotlib/examples/user_interfaces/embedding_in_tk.py | 9 | 1419 | #!/usr/bin/env python
import matplotlib
matplotlib.use('TkAgg')
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
# implement the default mpl key bindings
from matplotlib.backend_bases import key_press_handler
from matplotlib.figure import Fig... | unlicense |
lehmannro/pootle | pootle/scripts/hooks.py | 5 | 1422 | #!/usr/bin/python
import sys
import os
import os.path
import subprocess
import logging
def hook(project, hooktype, file, *args, **kwargs):
"""
project should be the projectcode of any project.
hooktype should be precommit, postcommit, preupdate or postupdate.
file should be the absolute path of the fi... | gpl-2.0 |
XXMrHyde/android_external_chromium_org | third_party/pymock/mock.py | 424 | 75527 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 1.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts m... | bsd-3-clause |
Workday/OpenFrame | third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/protocol-test_wsh.py | 108 | 1907 | # Copyright (C) 2009 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 of conditions and the ... | bsd-3-clause |
ns950/calibre | src/calibre/ebooks/conversion/plugins/pml_output.py | 24 | 3047 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os, cStringIO
from calibre.customize.conversion import (OutputFormatPlugin,
OptionRecommendation)
from calibre.ptempfile import TemporaryDirectory
class PML... | gpl-3.0 |
wgapl/moose | framework/contrib/nsiqcppstyle/rules/RULE_4_5_A_indent_blocks_inside_of_function.py | 43 | 2715 | """
Indent blocks inside of function.
== Violation ==
void A() {
for (;;) <== Violation
{
}
}
void K()
{ <== Don't care. It's not the block inside of the function.
if (true)
{
if (KK) {
AA; <== Violation
}
}
swi... | lgpl-2.1 |
apache/airflow | airflow/migrations/versions/a13f7613ad25_resource_based_permissions_for_default_.py | 2 | 6614 | #
# 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 |
Jonathan727/javarosa | util/scripts/rmsdump.py | 6 | 7565 | # Copyright (C) 2009 JavaRosa
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 |
chrishan/django-project-template | dataapp/blogpost_serializers.py | 1 | 1521 | from rest_framework import generics, permissions
from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Post, Photo
class UserSerializer(serializers.ModelSerializer):
posts = serializers.HyperlinkedIdentityField('posts', view_name='userpost-list', lookup_field='user... | mit |
galaxy001/libtorrent | BitTornado-0.3.18/BitTornado/RawServer.py | 12 | 6531 | # Written by Bram Cohen
# see LICENSE.txt for license information
from bisect import insort
from SocketHandler import SocketHandler, UPnP_ERROR
import socket
from cStringIO import StringIO
from traceback import print_exc
from select import error
from threading import Thread, Event
from time import sleep
from clock imp... | mit |
Piratenfraktion-Berlin/OwnTube | videoportal/BitTornadoABC/BitTornado/BT1/btformats.py | 2 | 3917 | # Written by Bram Cohen
# see LICENSE.txt for license information
from types import StringType, LongType, IntType, ListType, DictType
import re
reg = re.compile(r'^[^/\\.~][^/\\]*$')
ints = (LongType, IntType)
def check_info(info):
if type(info) != DictType:
raise ValueError, 'bad metainfo -... | bsd-2-clause |
TobiasNils/python-seabreeze | seabreeze/backends.py | 1 | 1377 | import warnings
__SEABREEZE_BACKEND = 'cseabreeze'
def use(backend):
if not backend in ['cseabreeze', 'pyseabreeze']:
raise Exception('Choose backend from "cseabreeze", "pyseabreeze"')
else:
global __SEABREEZE_BACKEND
__SEABREEZE_BACKEND = backend
def get_backend():
global __SEABR... | mit |
Mikescher/Project-Euler_Befunge | compiled/Python2/Euler_Problem-074.py | 1 | 14739 | #!/usr/bin/env python2
# transpiled with BefunCompile v1.3.0 (c) 2017
import sys
import zlib, base64
_g = ("Ah+LCAAAAAAABADtmVc4nG/378eM3vuI3oIUDBmjRY/eJaL3SHRGLzEE0UWCJKJEjQhiCBGd0aJGDZMYwahRRtTBGLZf+R+8Z/vk3de1r73vk/u71vo833U/1zpcfCmU"
+ "gL8OKWAbM59ivxbUuxvlKvhD3K3C+tanWiVKJkibLzKHRuD1K34xKraiw5eZHW1CNz5pT5yFjsp7... | mit |
qwertyjune/BethSaidaBible | venv/lib/python2.7/site-packages/django/contrib/messages/tests/base.py | 63 | 14509 | from unittest import skipUnless
from django import http
from django.apps import apps
from django.conf import global_settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
fro... | gpl-3.0 |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/tensorflow/contrib/layers/__init__.py | 9 | 4048 | # Copyright 2015 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 |
mogeiwang/nest | pynest/examples/brette-gerstner-fig-2c.py | 6 | 1732 | # -*- coding: utf-8 -*-
#
# brette-gerstner-fig-2c.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ... | gpl-2.0 |
vegarwe/luma | luma/plugins/template/__init__.py | 3 | 1392 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2011
# Simen Natvig, <simen.natvig@gmail.com>
#
# 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 optio... | gpl-2.0 |
Belgabor/django | django/db/models/sql/expressions.py | 36 | 3255 | from django.core.exceptions import FieldError
from django.db.models.fields import FieldDoesNotExist
from django.db.models.sql.constants import LOOKUP_SEP
class SQLEvaluator(object):
def __init__(self, expression, query, allow_joins=True):
self.expression = expression
self.opts = query.get_meta()
... | bsd-3-clause |
umayrh/sketchy-polytopes | python/evolvingdag/src/evolvingdag/random_dag.py | 1 | 8463 | from networkx import DiGraph
from networkx.algorithms.dag import descendants
class LongitudinalRandomDag:
"""This class represents a hierarchical time series of RandomDag objects.
Each node in the hierarchy represents a time rollup. The top level is
'year', the second-lowest level 'hour', and each event ... | gpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/Django/django/contrib/sitemaps/tests/https.py | 219 | 2550 | from __future__ import unicode_literals
from datetime import date
from django.test.utils import override_settings
from .base import SitemapTestsBase
class HTTPSSitemapTests(SitemapTestsBase):
protocol = 'https'
urls = 'django.contrib.sitemaps.tests.urls.https'
def test_secure_sitemap_index(self):
... | agpl-3.0 |
arcivanov/pybuilder | src/integrationtest/python/should_not_load_remote_classes_in_unittest_tests.py | 3 | 1847 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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/l... | apache-2.0 |
paregorios/awibmanager | awibmanager/tests/test_awibimages.py | 1 | 1724 |
import unittest
from awibmanager.awibimages import AI
from os import remove
from os.path import join
TESTAWIBID = 'isawi-201102172235161'
TESTPATH = 'awibmanager/tests/data/pont-du-gard-france'
BADPATH = './boguspath'
EMPTYPATH = 'awibmanager/tests/data/empty'
BADID = 'jenny-867-5309'
class AIInitCase(unittest.TestC... | bsd-3-clause |
jcftang/ansible | lib/ansible/modules/database/misc/mongodb_parameter.py | 5 | 7290 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
(c) 2016, Loic Blot <loic.blot@unix-experience.fr>
Sponsored by Infopro Digital. http://www.infopro-digital.com/
Sponsored by E.T.A.I. http://www.etai.fr/
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of t... | gpl-3.0 |
games-useaible/Useaible-machine-learning-challenge | PythonCode/Lunarlander.py | 1 | 15973 | import numpy as np
import tempfile
import tensorflow as tf
import math
import json
import random
import puka
import pika
import thread
import time
from simulator import LanderSimulator
from mazeGame import mazeSimulator
credentials = pika.PlainCredentials('test', 'test')
parameters = pika.ConnectionPar... | gpl-3.0 |
artoonie/RedStatesBlueStates | redblue/viewsenators/initialization.py | 1 | 6633 | import os
import requests
import viewsenators.cityToFbCode as cityToFbCode
import viewsenators.stateToFbCode as stateToFbCode
from .models import Party, City, State, Senator, Congressmember, ContactList
from .getPopulations import getCityStatePopulations
def populateParties(partyModel, partyObjects):
""" Takes in ... | gpl-3.0 |
chinmaygarde/mojo | sky/engine/bindings/scripts/v8_globals.py | 73 | 1645 | # Copyright (C) 2013 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 of conditions and the ... | bsd-3-clause |
twz915/django | tests/cache/tests.py | 1 | 91820 | # Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
import copy
import io
import os
import pickle
import re
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from unittest import mock
from django.conf import settings
from django.core... | bsd-3-clause |
hxa7241/minilight-python | spatialindex.py | 1 | 5023 | # MiniLight Python : minimal global illumination renderer
#
# Harrison Ainsworth / HXA7241 and Juraj Sukop : 2007-2008, 2013.
# http://www.hxa.name/minilight
from triangle import Triangle, TOLERANCE
from vector3f import Vector3f, MAX
MAX_LEVELS = 44
MAX_ITEMS = 8
class SpatialIndex(object):
def __init__(s... | cc0-1.0 |
playm2mboy/edx-platform | openedx/core/djangoapps/content/course_overviews/migrations/0004_default_lowest_passing_grade_to_None.py | 62 | 3157 | # -*- 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):
# Changing field 'CourseOverview.lowest_passing_grade'
db.alter_column('... | agpl-3.0 |
g3-3k/libreant | presets/test/test_preset_paths.py | 1 | 2747 | '''
Collection of tests to verify preset paths loading
'''
from nose.tools import raises, eq_
from tempfile import NamedTemporaryFile, mkdtemp
from shutil import rmtree
from presets.presetManager import PresetException
import json
import os
from presets.presetManager import PresetManager
minimalBody = { "id": "id_te... | agpl-3.0 |
Spredzy/dci-ansible | modules/dci_new_job.py | 1 | 3559 | #!/usr/bin/python
# 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
# dist... | apache-2.0 |
kapt/django-oscar | oscar/apps/catalogue/south_migrations/0008_auto__add_unique_option_code.py | 18 | 13043 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'Option', fields ['code']
db.create_unique('catalogue_option', ['code'])
... | bsd-3-clause |
abircse06/youtube-dl | youtube_dl/extractor/yourupload.py | 142 | 1537 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class YourUploadIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:yourupload\.com/watch|
embed\.yourupload\.com|
embed\.yucache\.net
)/(?P<id>[A-Za-z0-9]+)
'''
... | unlicense |
oinopion/django | tests/gis_tests/geos_tests/test_io.py | 282 | 3918 | from __future__ import unicode_literals
import binascii
import unittest
from unittest import skipUnless
from django.contrib.gis.geos import (
HAS_GEOS, GEOSGeometry, WKBReader, WKBWriter, WKTReader, WKTWriter,
)
from django.utils.six import memoryview
@skipUnless(HAS_GEOS, "Geos is required.")
class GEOSIOTest(... | bsd-3-clause |
cherifyass/android_kernel_lge_hammerhead | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
ducksboard/libsaas | test/test_pingdom.py | 4 | 8990 | import unittest
from libsaas import port
from libsaas.executors import test_executor
from libsaas.services import base, pingdom
class PingdomTestCase(unittest.TestCase):
def setUp(self):
self.executor = test_executor.use()
self.executor.set_response(b'{}', 200, {})
self.service = pingdo... | mit |
hurricup/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/pgen2/token.py | 353 | 1244 | #! /usr/bin/env python
"""Token constants (from "token.h")."""
# Taken from Python (r53757) and modified to include some tokens
# originally monkeypatched in by pgen2.tokenize
#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
C... | apache-2.0 |
varunarya10/python-novaclient | novaclient/v1_1/volumes.py | 5 | 5646 | # Copyright 2011 Denali Systems, 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 requ... | apache-2.0 |
ddico/odoo | addons/account/tests/test_account_incoming_supplier_invoice.py | 1 | 6351 | import json
from odoo.addons.account.tests.common import AccountTestCommon
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestAccountIncomingSupplierInvoice(AccountTestCommon):
def setUp(self):
super(TestAccountIncomingSupplierInvoice, self).setUp()
self.env['ir.conf... | agpl-3.0 |
ccsplit/spiderfoot | modules/sfp_junkfiles.py | 7 | 6240 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_junkfiles
# Purpose: From Spidering, identifies backup and temporary files.
#
# Author: Steve Micallef <steve@binarypool.com>
#
# Created: 23/08/2014
# Copyright: (c) Ste... | gpl-2.0 |
dmitriy0611/django | tests/forms_tests/tests/test_media.py | 169 | 45896 | # -*- coding: utf-8 -*-
from django.forms import CharField, Form, Media, MultiWidget, TextInput
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.utils.encoding import force_text
@override_settings(
STATIC_URL=None,
MEDIA_URL='http://media.exam... | bsd-3-clause |
bryk/kubernetes | hack/lookup_pull.py | 246 | 1299 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
dongguangming/pexpect | pexpect/fdpexpect.py | 5 | 3371 | '''This is like pexpect, but it will work with any file descriptor that you
pass it. You are reponsible for opening and close the file descriptor.
This allows you to use Pexpect with sockets and named pipes (FIFOs).
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://open... | isc |
dnozay/lettuce | tests/integration/lib/Django-1.2.5/django/template/loader_tags.py | 44 | 8017 | from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable
from django.template import Library, Node, TextNode
from django.template.loader import get_template
from django.conf import settings
from django.utils.safestring import mark_safe
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
c... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.