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
SebasSBM/django
tests/test_client/views.py
109
10961
from xml.dom.minidom import parseString from django.contrib.auth.decorators import login_required, permission_required from django.core import mail from django.forms import fields from django.forms.forms import Form, ValidationError from django.forms.formsets import BaseFormSet, formset_factory from django.http import...
bsd-3-clause
vigilv/scikit-learn
examples/neighbors/plot_kde_1d.py
347
5100
""" =================================== Simple 1D Kernel Density Estimation =================================== This example uses the :class:`sklearn.neighbors.KernelDensity` class to demonstrate the principles of Kernel Density Estimation in one dimension. The first plot shows one of the problems with using histogram...
bsd-3-clause
chaen/DIRAC
DataManagementSystem/DB/FileCatalogComponents/FileMetadata.py
2
20988
""" DIRAC FileCatalog plugin class to manage file metadata. This contains only non-indexed metadata for the moment. """ __RCSID__ = "$Id$" from DIRAC import S_OK, S_ERROR from DIRAC.Core.Utilities.Time import queryTime from DIRAC.Core.Utilities.List import intListToString from DIRAC.DataManagementSystem.Client.Me...
gpl-3.0
falau/pogom
pogom/pgoapi/protos/POGOProtos/Networking/Responses/GetHatchedEggsResponse_pb2.py
15
4314
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Responses/GetHatchedEggsResponse.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 _message f...
mit
bshaffer/google-api-php-client-services
generator/tests/api_exception_test.py
10
1039
#!/usr/bin/python2.7 # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
jgliss/pyplis
pyplis/inout.py
1
22643
# -*- coding: utf-8 -*- # # Pyplis is a Python library for the analysis of UV SO2 camera data # Copyright (C) 2017 Jonas Gliss (jonasgliss@gmail.com) # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License a # published by the Free Software Foundat...
gpl-3.0
shahar-stratoscale/nova
nova/tests/integrated/v3/test_services.py
20
3605
# Copyright 2012 Nebula, Inc. # Copyright 2013 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...
apache-2.0
ksmit799/Toontown-Source
toontown/minigame/DivingGameToonSD.py
6
3074
from direct.showbase.ShowBaseGlobal import * from toontown.toonbase.ToonBaseGlobal import * from direct.interval.IntervalGlobal import * from toontown.toonbase.ToontownGlobals import * from direct.directnotify import DirectNotifyGlobal from direct.fsm import StateData from direct.fsm import ClassicFSM from direct.fsm i...
mit
sahildua2305/eden
static/scripts/tools/dbstruct_mysql.py
59
6606
# # Recommended usage: fabfile.py # # - or manually: # # 0. Configure /root/.my.cnf to allow the root user to access MySQL as root without password # # 1. Create a new, empty MySQL database 'sahana' as-normal # mysqladmin create sahana # mysql # GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,INDEX,ALTER,DROP ON ...
mit
zzh8829/PythonCraft
exp/Test.py
1
24657
import pygame import OpenGL import numpy as np from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * class Tessellator: convertQuadsToTriangles = False tryVBO = False def __init__(self,bufsize = 2097152 ): self.bufferSize = bufsize self.byteBuffer = np.array(range(bufsize*4),dtype = 'b...
mit
solring/TWCompanyTree
TWCTenv/lib/python2.7/site-packages/setuptools/command/bdist_wininst.py
325
2283
from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst import os, sys class bdist_wininst(_bdist_wininst): _good_upload = _bad_upload = None def create_exe(self, arcname, fullname, bitmap=None): _bdist_wininst.create_exe(self, arcname, fullname, bitmap) installer_name = se...
unlicense
Sannoso/baxter_examples
src/baxter_examples/__init__.py
6
1590
# Copyright (c) 2013-2015, Rethink Robotics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditio...
bsd-3-clause
richardcs/ansible
lib/ansible/module_utils/lxd.py
79
6224
# -*- coding: utf-8 -*- # (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to th...
gpl-3.0
teichopsia-/take_brake
lib/python2.7/site-packages/wheel/signatures/__init__.py
565
3779
""" Create and verify jws-js format Ed25519 signatures. """ __all__ = [ 'sign', 'verify' ] import json from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary ed25519ll = None ALG = "Ed25519" def get_ed25519ll(): """Lazy import-and-test of ed25519 module""" global ed25519ll if not ...
mpl-2.0
SaschaWillems/vulkan_slim
external/vulkan/spirv.py
11
26312
# Copyright (c) 2014-2017 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and/or associated documentation files (the "Materials"), # to deal in the Materials without restriction, including without limitation # the rights to use, copy, modify, m...
mit
mapleoin/braintree_python
braintree/payment_method_gateway.py
4
4012
import braintree from braintree.apple_pay_card import ApplePayCard from braintree.credit_card import CreditCard from braintree.payment_method import PaymentMethod from braintree.paypal_account import PayPalAccount from braintree.europe_bank_account import EuropeBankAccount from braintree.coinbase_account import Coinbas...
mit
Krossom/python-for-android
python3-alpha/python3-src/Lib/test/test_bool.py
57
11719
# Test properties of bool promised by PEP 285 import unittest from test import support import os class BoolTest(unittest.TestCase): def test_subclass(self): try: class C(bool): pass except TypeError: pass else: self.fail("bool should no...
apache-2.0
Azure/azure-sdk-for-python
sdk/storage/azure-storage-queue/azure/storage/queue/_models.py
1
19037
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- # pylint: ...
mit
eviljeff/zamboni
mkt/webapps/utils.py
3
4596
# -*- coding: utf-8 -*- import json from django.core.cache import cache from django.core.files.storage import default_storage as storage import commonware.log import lib.iarc import mkt from mkt.site.utils import JSONEncoder from mkt.translations.utils import find_language log = commonware.log.getLogger('z.webapps...
bsd-3-clause
coding-happily/FlaskTest
venv/lib/python3.5/site-packages/werkzeug/contrib/fixers.py
259
10183
# -*- coding: utf-8 -*- """ werkzeug.contrib.fixers ~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module includes various helpers that fix bugs in web servers. They may be necessary for some versions of a buggy web server but not others. We try to stay updated with the status of the bug...
mit
runcom/flocker
flocker/provision/_common.py
1
1492
# Copyright Hybrid Logic Ltd. See LICENSE file for details. from characteristic import attributes, Attribute from twisted.python.constants import Values, ValueConstant @attributes([ Attribute('version', default_value=None), Attribute('os_version', default_value=None), Attribute('branch', default_value=N...
apache-2.0
zhanqxun/cv_fish
PIL/ImageCms.py
4
37120
# The Python Imaging Library. # $Id$ # Optional color management support, based on Kevin Cazabon's PyCMS # library. # History: # 2009-03-08 fl Added to PIL. # Copyright (C) 2002-2003 Kevin Cazabon # Copyright (c) 2009 by Fredrik Lundh # Copyright (c) 2013 by Eric Soroos # See the README file for information on u...
apache-2.0
4eek/edx-platform
common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py
35
20486
""" Segregation of pymongo functions from the data modeling mechanisms for split modulestore. """ import datetime import cPickle as pickle import math import zlib import pymongo import pytz import re from contextlib import contextmanager from time import time # Import this just to export it from pymongo.errors import ...
agpl-3.0
nan86150/ImageFusion
lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py
436
5992
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isinstance(s, text_type): ...
mit
erocarrera/pefile
peutils.py
2
18206
# -*- coding: Latin-1 -*- """peutils, Portable Executable utilities module Copyright (c) 2005-2020 Ero Carrera <ero.carrera@gmail.com> All rights reserved. """ from __future__ import division from future import standard_library standard_library.install_aliases() from builtins import range from builtins import object...
mit
zmilan/POSTMan-Chrome-Extension
proxy/proxy_server.py
102
3014
#!/usr/bin/python from twisted.internet import reactor from twisted.web import http from twisted.web.proxy import Proxy, ProxyRequest, ProxyClientFactory, ProxyClient from ImageFile import Parser from StringIO import StringIO class InterceptingProxyClient(ProxyClient): def __init__(self, *args, **kwargs): ...
apache-2.0
anubhabsen/NotesKeeper
languages/sk.py
161
6877
# coding: utf8 { '!langcode!': 'sk', '!langname!': 'Slovenský', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu', '%s %%{row} deleted': '%s zmazaných...
mit
ProjexSoftware/orb
orb/core/connection_types/sql/mysql/statements/alter.py
2
3350
from projex.lazymodule import lazy_import from ..mysqlconnection import MySQLStatement orb = lazy_import('orb') class ALTER(MySQLStatement): def __call__(self, model, add=None, remove=None, owner=''): """ Modifies the table to add and remove the given columns. :param model: <orb.Model> ...
lgpl-3.0
jakesyl/pychess
lib/pychess/Utils/GameModel.py
20
35722
from __future__ import absolute_import from collections import defaultdict from threading import RLock, Thread import traceback import datetime from gi.repository import GObject from pychess.compat import Queue, Empty, StringIO from pychess.Savers.ChessFile import LoadingError from pychess.Players.Player import Playe...
gpl-3.0
spotify/python-graphwalker
graphwalker/test/interactor.py
2
5356
# -*- coding: utf-8 -*- # Copyright (c) 2013 Spotify AB import fcntl import select import subprocess import sys import os class Dummy(object): def __getattr__(self, name): def f(*al, **kw): print ('\033[32m%s\033[0m' % name) f.__name__ = name return f def a(self): ...
apache-2.0
pombredanne/pyjs
pyjs/browser.py
6
26136
# Copyright (C) 2009, 2010, Luke Kenneth Casson Leighton <lkcl@lkcl.net> # Copyright (C) 2010, Sujan Shakya <suzan.shakya@gmail.com> import os import sys import time import shutil from pyjs import linker from pyjs import translator if translator.name == 'proto': required_modules = [ 'pyjslib', 'sys', 'imp...
apache-2.0
azoft-dev-team/imagrium
env/Lib/encodings/cp424.py
593
12311
""" Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
mit
SoftwareMaven/django
django/contrib/gis/gdal/error.py
535
1996
""" This module houses the GDAL & SRS Exception objects, and the check_err() routine which checks the status code returned by GDAL/OGR methods. """ # #### GDAL & SRS Exceptions #### class GDALException(Exception): pass # Legacy name OGRException = GDALException class SRSException(Exception): pass cla...
bsd-3-clause
snailbob/namebench
tools/check_dns_servers.py
174
3835
#!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
rhelmer/socorro
socorro/unittest/external/postgresql/test_connection_context.py
13
2666
# 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/. from nose.tools import eq_, ok_ import psycopg2 from socorro.external.postgresql.connection_context import ConnectionCo...
mpl-2.0
sander76/home-assistant
tests/components/mqtt/test_subscription.py
8
5399
"""The tests for the MQTT subscription component.""" from unittest.mock import ANY from homeassistant.components.mqtt.subscription import ( async_subscribe_topics, async_unsubscribe_topics, ) from homeassistant.core import callback from tests.common import async_fire_mqtt_message async def test_subscribe_to...
apache-2.0
staticsan/light-layers
requests/packages/chardet2/chardistribution.py
25
8695
######################## 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 R...
mit
Proggie02/TestRepo
django/conf/locale/sk/formats.py
108
1114
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'G:i:s' DAT...
bsd-3-clause
mrucci/moto
tests/test_s3/test_server.py
21
1908
from __future__ import unicode_literals import sure # noqa import moto.server as server ''' Test the different server responses ''' def test_s3_server_get(): backend = server.create_backend_app("s3") test_client = backend.test_client() res = test_client.get('/') res.data.should.contain(b'ListAllM...
apache-2.0
CodeMath/jinrockets
BluePrint/lib/werkzeug/testsuite/exceptions.py
61
3251
# -*- coding: utf-8 -*- """ werkzeug.testsuite.exceptions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The tests for the exception classes. TODO: - This is undertested. HTML is never checked :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest fro...
mit
michaelBenin/Django-facebook
facebook_example/member/migrations/0010_initial.py
27
14225
# -*- coding: 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 model 'CustomFacebookUser' db.create_table(u'member_customfacebookuser', ( (u'id', self...
bsd-3-clause
virtdb/drizzle
tests/qp_tests/randgen_basic/subquerySemijoinNested_test.py
4
1461
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
gpl-2.0
googleapis/google-resumable-media-python
google/_async_resumable_media/requests/download.py
1
18494
# Copyright 2017 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 agreed to in writing, ...
apache-2.0
jimi-c/ansible
test/units/modules/network/eos/test_eos_user.py
57
4179
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
ressu/SickGear
lib/unrar2/__init__.py
24
7125
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy...
gpl-3.0
rooi/CouchPotatoServer
libs/suds/metrics.py
211
2004
# 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 ...
gpl-3.0
jamesyli/solum
solum/tests/common/test_exception_base.py
3
2567
# -*- encoding: utf-8 -*- # # Copyright 2013 - Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
jcpowermac/ansible
test/utils/shippable/tools/download.py
124
10149
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # (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 yo...
gpl-3.0
JRock007/boxxy
dist/Boxxy.app/Contents/Resources/lib/python2.7/pygame/tests/gfxdraw_test.py
9
30078
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.path.inser...
mit
mushtaqak/edx-platform
lms/djangoapps/verify_student/tests/test_fake_software_secure.py
86
2709
""" Tests for the fake software secure response. """ from django.test import TestCase from mock import patch from student.tests.factories import UserFactory from util.testing import UrlResetMixin from verify_student.models import SoftwareSecurePhotoVerification class SoftwareSecureFakeViewTest(UrlResetMixin, TestCa...
agpl-3.0
shubhamchopra/spark
examples/src/main/python/ml/stopwords_remover_example.py
123
1434
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
sfu-fas/coursys
courselib/rest.py
1
9763
from oauth_provider.utils import get_oauth_request from oauth_provider.models import Token from rest_framework_oauth.authentication import OAuthAuthentication from api.models import ConsumerInfo from rest_framework import permissions, authentication, fields, relations from django.shortcuts import get_object_or_404 fro...
gpl-3.0
neighborhoodhacker/msm-3.4
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
krautradio/PyRfK
lib/rfk/site/admin/tags.py
4
1319
from flask import render_template, request from flask.ext.login import login_required, current_user from flask.json import jsonify import rfk.database from rfk.site.helper import permission_required, emit_error from rfk.database.show import Tag from rfk.helper.taglist import taglist from ..admin import admin @admi...
bsd-3-clause
40223101/w16b_test
static/Brython3.1.1-20150328-091302/Lib/unittest/util.py
794
4157
"""Various utility functions.""" from collections import namedtuple, OrderedDict __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result ...
agpl-3.0
webmull/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/comments.py
148
2030
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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
jkarnows/scikit-learn
sklearn/metrics/cluster/unsupervised.py
230
8281
""" Unsupervised evaluation metrics. """ # Authors: Robert Layton <robertlayton@gmail.com> # # License: BSD 3 clause import numpy as np from ...utils import check_random_state from ..pairwise import pairwise_distances def silhouette_score(X, labels, metric='euclidean', sample_size=None, random...
bsd-3-clause
mdsafwan/Deal-My-Stuff
Lib/site-packages/django/templatetags/i18n.py
82
17673
from __future__ import unicode_literals import re import sys from django.conf import settings from django.template import Library, Node, TemplateSyntaxError, Variable from django.template.base import ( TOKEN_TEXT, TOKEN_VAR, TokenParser, render_value_in_context, ) from django.template.defaulttags import token_kwa...
apache-2.0
kytvi2p/tahoe-lafs
src/allmydata/scripts/cli.py
1
23714
import os.path, re, fnmatch from twisted.python import usage from allmydata.scripts.common import get_aliases, get_default_nodedir, \ DEFAULT_ALIAS, BaseOptions from allmydata.util.encodingutil import argv_to_unicode, argv_to_abspath, quote_output NODEURL_RE=re.compile("http(s?)://([^:]*)(:([1-9][0-9]*))?") _def...
gpl-2.0
fastmonkeys/netvisor.py
tests/test_auth.py
1
5206
import uuid import pytest from flexmock import flexmock from freezegun import freeze_time def make_auth( sender='Testiclient', partner_id='xxx_yyy', partner_key='07f94228d149a96b2f25e3edad55096e', customer_id='Integraatiokayttajan tunnus', customer_key='7cd680e89e880553358bc07cd28b0ee2', orga...
mit
fergalbyrne/nupic
tests/swarming/nupic/swarming/experiments/simpleV2/description.py
32
15383
# ---------------------------------------------------------------------- # 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...
agpl-3.0
sejoruiz/weatherino
suncalc.py
1
9623
#!/usr/bin/env python from datetime import datetime, timedelta from pytz import timezone import pytz import math import logging class SunCalc: def __init__(self, latitude, longitude, date, formatting='%d %b %Y %H:%M:%S', tzone='Europe/Madrid'): self.latitude=latitude # The longitude is west in ...
mit
eg-zhang/scikit-learn
examples/applications/plot_stock_market.py
227
8284
""" ======================================= Visualizing the stock market structure ======================================= This example employs several unsupervised learning techniques to extract the stock market structure from variations in historical quotes. The quantity that we use is the daily variation in quote ...
bsd-3-clause
pieterdp/helptux
helptux/routes/auth.py
1
1444
from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, login_required, logout_user from helptux.modules.user.authentication import LoginForm from helptux.modules.api.user import UserApi from helptux.modules.error import DatabaseItemDoesNotExist from helptux import a...
gpl-2.0
EMBL-EBI-TSI/aap-client-python
aap_client/flask/decorators.py
1
3159
""" Contains flask decorators and some helper functions in order to integrate jwt tokens in flask in a natural way """ from functools import wraps from future.utils import raise_with_traceback from jwt import DecodeError, InvalidTokenError as JWTInvalidTokenError from flask import current_app, request try: from...
apache-2.0
klnrajareddy/PyGithub
github/tests/UserKey.py
39
3759
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
ovnicraft/edx-platform
lms/djangoapps/ccx/tests/test_overrides.py
22
6985
# coding=UTF-8 """ tests for overrides """ import datetime import mock import pytz from nose.plugins.attrib import attr from courseware.field_overrides import OverrideFieldData from django.test.utils import override_settings from lms.djangoapps.courseware.tests.test_field_overrides import inject_field_overrides from r...
agpl-3.0
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/unclosured/lib/python2.7/distutils/command/bdist_wininst.py
72
14917
"""distutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" __revision__ = "$Id$" import sys import os import string from sysconfig import get_python_version from distutils.core import Command from distutils.dir_util import remove_tree from distut...
apache-2.0
sachinkum/Bal-Aveksha
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/setuptools/command/upload_docs.py
68
7217
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import ...
gpl-3.0
xin3liang/platform_external_chromium_org_third_party_WebKit
Source/build/scripts/make_element_lookup_trie.py
19
5276
#!/usr/bin/env python # 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 ...
bsd-3-clause
RPi-Distro/python-gpiozero
tests/test_outputs.py
2
53540
# GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins # Copyright (c) 2018-2019 Ben Nuttall <ben@bennuttall.com> # Copyright (c) 2016-2019 Dave Jones <dave@waveform.org.uk> # Copyright (c) 2016 Andrew Scheller <github@loowis.durge.org> # # Redistribution and use in source and binary forms, with or without...
bsd-3-clause
staslev/incubator-beam
sdks/python/apache_beam/io/gcp/datastore/v1/datastoreio_test.py
8
12626
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
t0mm0/youtube-dl
youtube_dl/extractor/soundgasm.py
149
2041
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class SoundgasmIE(InfoExtractor): IE_NAME = 'soundgasm' _VALID_URL = r'https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_\-]+)/(?P<title>[0-9a-zA-Z_\-]+)' _TEST = { 'url': 'http://soundgasm....
unlicense
vijayendra/Social
api/serializers.py
1
1440
from rest_framework import serializers from django.contrib.auth.models import User from forum.models import Post, Comment class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('url', 'username', 'email', 'password') extra_kwargs = {'password': {'write_only':...
mit
mehmetkose/tornado
tornado/log.py
45
10920
#!/usr/bin/env python # # Copyright 2012 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
SamYaple/ansible-modules-extras
system/lvol.py
32
15209
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>, Alexander Bulimov <lazywolf0@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 So...
gpl-3.0
ningchi/scikit-learn
sklearn/utils/tests/test_random.py
38
7410
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
ggm/vm-for-transfer
src/vm/transferword.py
1
14796
#Copyright (C) 2011 Gabriel Gregori Manzano # #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. # #This program is distribute...
gpl-2.0
frida/glib
.gitlab-ci/meson-junit-report.py
1
3688
#!/usr/bin/env python3 # Turns a Meson testlog.json file into a JUnit XML report # # Copyright 2019 GNOME Foundation # # SPDX-License-Identifier: LGPL-2.1-or-later # # Original author: Emmanuele Bassi import argparse import datetime import json import sys import xml.etree.ElementTree as ET aparser = argparse.Argume...
lgpl-2.1
photoninger/ansible
lib/ansible/modules/network/f5/bigip_monitor_tcp_half_open.py
3
17834
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
ChengyuSong/xen-arm
tools/xm-test/tests/xapi/03_xapi-network_pos.py
38
4039
#!/usr/bin/python #============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distribu...
gpl-2.0
vauxoo-dev/autopep8
test/suite/utf-8.py
55
2557
# -*- coding: utf-8 -*- class Rectangle(Blob): def __init__(self, width, height, color='black', emphasis=None, highlight=0): if width == 0 and height == 0 and \ color == 'red' and emphasis == 'strong' or \ highlight > 100: ...
mit
xin3liang/platform_external_chromium_org
chrome/test/chromedriver/test/unittest_util.py
134
4320
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utilities for dealing with the python unittest module.""" import fnmatch import sys import unittest class _TextTestResult(unittest._TextTestResult): ...
bsd-3-clause
yati-sagade/pip
tests/functional/test_wheel.py
26
5129
"""'pip wheel' tests""" import os import pytest from os.path import exists from pip.locations import write_delete_marker_file from pip.status_codes import PREVIOUS_BUILD_DIR_ERROR from tests.lib import pyversion def test_pip_wheel_fails_without_wheel(script, data): """ Test 'pip wheel' fails without wheel ...
mit
zqzhang/crosswalk-test-suite
apptools/apptools-ios-tests/apptools/build_arguments.py
15
1710
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
dagwieers/ansible
test/sanity/code-smell/use-argspec-type-path.py
17
2237
#!/usr/bin/env python import re import sys def main(): skip = set([ # add legitimate uses of expanduser to the following list 'lib/ansible/modules/cloud/docker/docker_container.py', # uses colon-separated paths, can't use type=path 'lib/ansible/modules/cloud/lxc/lxc_container.py', ...
gpl-3.0
TanguyPatte/phantomjs-packaging
src/qt/qtwebkit/Source/WebInspectorUI/Scripts/jsmin.py
145
7659
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-05-22 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted, free of ch...
bsd-3-clause
obruns/gtest
test/gtest_break_on_failure_unittest.py
2140
7339
#!/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...
bsd-3-clause
synasius/django
django/db/migrations/migration.py
326
8023
from __future__ import unicode_literals from django.db.transaction import atomic from django.utils.encoding import python_2_unicode_compatible from .exceptions import IrreversibleError @python_2_unicode_compatible class Migration(object): """ The base class for all migrations. Migration files will impo...
bsd-3-clause
shikigit/python-phonenumbers
python/phonenumbers/data/region_HT.py
5
1618
"""Auto-generated file, do not edit by hand. HT metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_HT = PhoneMetadata(id='HT', country_code=509, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[2-489]\\d{7}', possible_number_pattern=...
apache-2.0
androidarmv6/android_external_chromium
testing/gtest/test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 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...
bsd-3-clause
findayu/picasso-graphic
tools/gyp/pylib/gyp/generator/gypsh.py
2779
1665
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
bsd-3-clause
precompiler/python-101
mastering-python/ch05/Decorator.py
1
1096
import functools def logParams(function): @functools.wraps(function) # use this to prevent loss of function attributes def wrapper(*args, **kwargs): print("function: {}, args: {}, kwargs: {}".format(function.__name__, args, kwargs)) return function(*args, **kwargs) return wrapper def add...
apache-2.0
jsteemann/arangodb
3rdParty/V8-4.3.61/tools/testrunner/objects/output.py
105
2443
# Copyright 2012 the V8 project authors. 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 conditi...
apache-2.0
stevenewey/wagtail
wagtail/wagtailsearch/migrations/0001_initial.py
37
2062
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0002_initial_data'), ] operations = [ migrations.CreateModel( name='EditorsPick', fie...
bsd-3-clause
follow99/django
tests/admin_checks/models.py
281
1836
""" Tests of ModelAdmin system checks logic. """ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharFie...
bsd-3-clause
proxysh/Safejumper-for-Mac
buildlinux/env64/lib/python2.7/site-packages/twisted/internet/gtk2reactor.py
23
3614
# -*- test-case-name: twisted.internet.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module provides support for Twisted to interact with the glib/gtk2 mainloop. In order to use this support, simply do the following:: from twisted.internet import gtk2reactor gtk2r...
gpl-2.0
gcodetogit/depot_tools
third_party/coverage/__init__.py
208
4505
"""Code coverage measurement for Python. Ned Batchelder http://nedbatchelder.com/code/coverage """ from coverage.version import __version__, __url__ from coverage.control import coverage, process_startup from coverage.data import CoverageData from coverage.cmdline import main, CoverageScript from coverage.misc impo...
bsd-3-clause
OnizukaLab/SimpleSeq2Seq
interpreter.py
1
7157
# -*- coding:utf-8 -*- import os os.environ["CHAINER_TYPE_CHECK"] = "0" import argparse import unicodedata import pickle import numpy as np import matplotlib.pyplot as plt from nltk import word_tokenize from chainer import serializers, cuda from util import ConvCorpus, JaConvCorpus from seq2seq import Seq2Seq # pat...
mit
EricMuller/mynotes-backend
requirements/twisted/Twisted-17.1.0/src/twisted/test/stdio_test_lastwrite.py
14
1206
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTests.test_lastWriteReceived -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTests.test_lastWriteReceived} to test that L{os.write} can...
mit