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 |
|---|---|---|---|---|---|
mjschultz/ansible-modules-extras | notification/typetalk.py | 18 | 3693 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
Yannig/ansible | lib/ansible/module_utils/api.py | 103 | 4446 | # 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 the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Titulacion-Sistemas/PythonTitulacion-EV | Lib/site-packages/django/contrib/formtools/tests/wizard/wizardtests/tests.py | 116 | 16304 | from __future__ import unicode_literals
import os
from django import forms
from django.test import TestCase
from django.test.client import RequestFactory
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.formto... | mit |
olivierdalang/QGIS | scripts/process_function_template.py | 26 | 4716 | # -*- coding: utf-8 -*-
import sys
import os
import json
import glob
sys.path.append(
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'../python/ext-libs'))
cpp = open(sys.argv[1], "w", encoding="utf-8")
cpp.write(
"#include \"qgsexpression.h\"\n"
"#include \"qgsexpression_p.h\... | gpl-2.0 |
muzena/deluge | deluge/ui/console/modes/torrent_actions.py | 5 | 14567 | # torrent_actions.py
#
# Copyright (C) 2011 Nick Lanham <nick@afternight.org>
#
# Deluge is free software.
#
# You may 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 ve... | gpl-3.0 |
hazelnusse/robot.bicycle | design/derivative_filter.py | 1 | 1131 | """
Given a continuous time first order transfer function of the form:
n1 * s + n0
-----------
s + d0
Compute the Tustin approximation and return a state space realization of this
discrete time transfer function.
"""
from sympy import symbols, Poly, ccode, S, sqrt
def discrete_realization_tustin(n0, n1... | bsd-2-clause |
undoware/neutron-drive | google_appengine/lib/django_1_3/tests/regressiontests/dispatch/tests/test_saferef.py | 51 | 2107 | from django.dispatch.saferef import *
from django.utils import unittest
class Test1(object):
def x(self):
pass
def test2(obj):
pass
class Test2(object):
def __call__(self, obj):
pass
class Tester(unittest.TestCase):
def setUp(self):
ts = []
ss = []
for x in x... | bsd-3-clause |
openhatch/oh-mainline | vendor/packages/Django/django/contrib/auth/__init__.py | 70 | 5196 | import re
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.middleware.csrf import rotate_token
from django.contrib.auth.signals import user_logged_in, user_logged_out, user_login_failed
SESSION_KEY = '_auth_user_id'
BACKEND_SESSION_KEY = '_auth_user_... | agpl-3.0 |
0asa/scikit-learn | examples/neighbors/plot_digits_kde_sampling.py | 251 | 2022 | """
=========================
Kernel Density Estimation
=========================
This example shows how kernel density estimation (KDE), a powerful
non-parametric density estimation technique, can be used to learn
a generative model for a dataset. With this generative model in place,
new samples can be drawn. These... | bsd-3-clause |
ToontownUprising/src | toontown/pets/PetBrain.py | 3 | 20591 | from pandac.PandaModules import *
from direct.showbase.PythonUtil import weightedChoice, randFloat, Functor
from direct.showbase.PythonUtil import list2dict
from direct.showbase import DirectObject
from direct.distributed import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
from direct.task imp... | mit |
bitcraft/matrix | matrix.py | 1 | 6431 | """ Matrix Screen Effect
(c) 2016, Leif Theden, leif.theden@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 3 of the License, or
(at your option) any lat... | gpl-3.0 |
thomashaw/SecGen | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/_LWPCookieJar.py | 109 | 6555 | """Load / save to libwww-perl (LWP) format files.
Actually, the format is slightly extended from that used by LWP's
(libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information
not recorded by LWP.
It uses the version string "2.0", though really there isn't an LWP Cookies
2.0 format. This indicates that ... | gpl-3.0 |
bingerZhang/libyuv | setup_links.py | 140 | 16181 | #!/usr/bin/env python
# Copyright 2014 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contri... | bsd-3-clause |
dstufft/warehouse | warehouse/accounts/models.py | 1 | 4012 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 |
madmachinations/discordbot | plugins/msglog/__init__.py | 2 | 11208 | #!/usr/bin/python
import __main__
import json
#===================================================================================================================
#PLUGIN CALLS
async def help_menu():
help_info = {}
help_info['title'] = 'Message log'
help_info['description'] = 'Search logged messages.'
... | gpl-3.0 |
zhangg/docker | vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py | 1232 | 3478 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... | apache-2.0 |
chaosmaster/christian | commands/postboxfunctions.py | 2 | 1419 | from utils import Filehandler
from ConfigParser import SafeConfigParser
import re
class PostboxFunctions(object):
def __init__(self):
self.fhandler = Filehandler()
def help(self, channel, callback, msg=None, nck=None, hq=None, keys=None, **kwargs):
helpmsg = "!tell <user> - Store message in <... | gpl-3.0 |
HalcyonChimera/osf.io | api_tests/logs/serializers/test_serializers.py | 17 | 1820 | import pytest
from framework.auth import Auth
from osf.models import NodeLog
from api.logs.serializers import NodeLogSerializer
from osf_tests.factories import ProjectFactory, UserFactory
from tests.utils import make_drf_request_with_version
pytestmark = pytest.mark.django_db
class TestNodeLogSerializer:
# Regr... | apache-2.0 |
dvdmgl/django-pg-fts | testapp/models.py | 2 | 1209 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from pg_fts.fields import TSVectorField
from django.db import models
@python_2_unicode_compatible
class TSQueryModel(models.Model):
title = models.CharField(max_length=50)
body = mode... | bsd-2-clause |
wkennington/rethinkdb | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-large-pdb.py | 218 | 2332 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure msvs_large_pdb works correctly.
"""
import TestGyp
import struct
import sys
CHDIR = 'large-pdb'
def CheckImageAndPdb(tes... | agpl-3.0 |
vsergeev/python-periphery | tests/test_spi.py | 1 | 5681 | import os
import sys
import periphery
from .test import ptest, pokay, passert, AssertRaises
if sys.version_info[0] == 3:
raw_input = input
spi_device = None
def test_arguments():
ptest()
# Invalid mode
with AssertRaises("invalid mode", ValueError):
periphery.SPI("/dev/spidev0.0", 4, int(1... | mit |
tomkrus007/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | lgpl-2.1 |
amith01994/intellij-community | python/lib/Lib/site-packages/django/db/models/fields/__init__.py | 119 | 43384 | import datetime
import decimal
import re
import time
import math
from itertools import tee
import django.utils.copycompat as copy
from django.db import connection
from django.db.models.fields.subclassing import LegacyConnection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
fro... | apache-2.0 |
MaheshIBM/keystone | keystone/trust/core.py | 2 | 9426 | # Copyright 2012 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 law or agreed to in... | apache-2.0 |
nlholdem/icodoom | .venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py | 360 | 2852 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager imp... | gpl-3.0 |
deKupini/erp | addons/account/account.py | 3 | 190066 | # -*- 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 |
barnone/EigenD | tools/packages/SCons/Tool/c++.py | 2 | 3374 | """SCons.Tool.c++
Tool-specific initialization for generic Posix C++ compilers.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons... | gpl-3.0 |
synmnstr/flexx | flexx/app/pair.py | 20 | 14935 | """
Base class for objects that live in both Python and JS.
This basically implements the syncing of signals.
"""
import sys
import json
import weakref
import hashlib
from .. import react
from ..react.hassignals import HasSignalsMeta, with_metaclass
from ..react.pyscript import create_js_signals_class, HasSignalsJS
... | bsd-2-clause |
github-account-because-they-want-it/django | django/core/management/commands/startapp.py | 513 | 1040 | from importlib import import_module
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
class Command(TemplateCommand):
help = ("Creates a Django app directory structure for the given app "
"name in the current directory or optionally in t... | bsd-3-clause |
janisz/Diamond-1 | src/diamond/handler/rrdtool.py | 13 | 7698 | # coding=utf-8
"""
Save stats in RRD files using rrdtool.
"""
import os
import re
import subprocess
import Queue
from Handler import Handler
#
# Constants for RRD file creation.
#
# NOTE: We default to the collectd RRD directory
# simply as a compatibility tool. Users that have
# tools that look in that location a... | mit |
wfarner/aurora | src/main/python/apache/aurora/tools/java/organize_imports.py | 11 | 4397 | #!/bin/env 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
# ... | apache-2.0 |
Yadnyawalkya/integration_tests | cfme/configure/documentation.py | 3 | 3224 | from widgetastic.widget import Image
from widgetastic.widget import Text
from widgetastic.widget import View
class LinksView(View):
"""
Widgets for all of the links on the documentation page
Each doc link is an anchor with a child image element, then an anchor with text
Both the image and the text anc... | gpl-2.0 |
jbzdak/edx-platform | common/lib/capa/capa/tests/__init__.py | 129 | 2700 | """Tools for helping with testing capa."""
import gettext
import os
import os.path
import fs.osfs
from capa.capa_problem import LoncapaProblem, LoncapaSystem
from capa.inputtypes import Status
from mock import Mock, MagicMock
import xml.sax.saxutils as saxutils
TEST_DIR = os.path.dirname(os.path.realpath(__file__)... | agpl-3.0 |
fredkingham/blog-of-fred | markdown/extensions/def_list.py | 46 | 3699 | """
Definition List Extension for Python-Markdown
=============================================
Added parsing of Definition Lists to Python-Markdown.
A simple example:
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
: An american computer company.
Orange
... | bsd-3-clause |
minichate/heroku-buildpack-ldap | src/virtualenv-1.7/virtualenv.py | 77 | 90881 | #!/usr/bin/env python
"""Create a "virtual" Python installation
"""
# If you change the version here, change it in setup.py
# and docs/conf.py as well.
virtualenv_version = "1.7"
import base64
import sys
import os
import optparse
import re
import shutil
import logging
import tempfile
import zlib
import errno
import d... | mit |
maurofaccenda/ansible | lib/ansible/utils/module_docs_fragments/postgres.py | 143 | 2774 | # 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 |
oikarinen/plugin.audio.spotlight | server_addon.py | 1 | 1074 | #
# Copyright (c) Dariusz Biskup
#
# This file is part of Spotlight
#
# Spotlight 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 ve... | gpl-3.0 |
parag2489/Image-Quality | train_imageQuality_regressMOS_smallNetwork.py | 1 | 14262 | import pdb
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape
from keras.layers.convolutional import Convolution1D, Convolution2D, MaxPooling2D
# from keras.layers.normalization import BatchNormalization
# from keras.layers.advanced_activations import LeakyReL... | mit |
gasongjian/ttpy | tt/eigb/eigb.py | 1 | 2316 | import numpy as np
import tt_eigb
from tt import tensor
def eigb(A, y0, eps, rmax = 150, nswp = 20, max_full_size = 1000, verb = 1):
""" Approximate computation of minimal eigenvalues in tensor train format
This function uses alternating least-squares algorithm for the computation of several
minimal eigenva... | mit |
mbareta/edx-platform-ft | lms/djangoapps/teams/tests/test_views.py | 16 | 63213 | # -*- coding: utf-8 -*-
"""Tests for the teams API at the HTTP request level."""
import json
from datetime import datetime
import pytz
from dateutil import parser
import ddt
from elasticsearch.exceptions import ConnectionError
from mock import patch
from search.search_engine_base import SearchEngine
from django.core.u... | agpl-3.0 |
pu239ppy/graphite-web | webapp/graphite/render/datalib.py | 3 | 5118 | """Copyright 2008 Orbitz WorldWide
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... | apache-2.0 |
scrollback/kuma | vendor/packages/ipython/IPython/testing/parametric.py | 7 | 1796 | """Parametric testing on top of twisted.trial.unittest.
"""
__all__ = ['parametric','Parametric']
from twisted.trial.unittest import TestCase
def partial(f, *partial_args, **partial_kwargs):
"""Generate a partial class method.
"""
def partial_func(self, *args, **kwargs):
dikt = dict(kwargs)
... | mpl-2.0 |
BenevolentAI/guacamol | tests/utils/test_chemistry.py | 1 | 2868 | from guacamol.utils.chemistry import canonicalize, canonicalize_list, is_valid, \
calculate_internal_pairwise_similarities, calculate_pairwise_similarities, parse_molecular_formula
def test_validity_empty_molecule():
smiles = ''
assert not is_valid(smiles)
def test_validity_incorrect_syntax():
smile... | mit |
pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/wsgiref/simple_server.py | 177 | 4743 | """BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
howev... | agpl-3.0 |
pinterb/st2 | st2actions/setup.py | 3 | 1301 | # -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') 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 "Licen... | apache-2.0 |
Karosuo/Linux_tools | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/pip/_vendor/chardet/gb2312prober.py | 289 | 1754 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
Blake-R/pylijm | setup.py | 1 | 1112 | from __future__ import absolute_import, division, print_function, unicode_literals
from os import path
from setuptools import setup, find_packages
with open(path.join(path.dirname(__file__), 'README.md'), 'r') as fp:
long_description = fp.read()
setup(
name='pylijm',
version='1.1b2',
description='Py... | gpl-3.0 |
david-zwicker/py-utils | utils/data_structures/parameter_mixin.py | 1 | 1714 | '''
Created on Oct 31, 2016
@author: David Zwicker <dzwicker@seas.harvard.edu>
'''
import copy
class ParameterMixin(object):
""" a mixin which manages a dictionary of parameters assigned to classes
"""
parameters_default = {}
def __init__(self, parameters=None, check_validity=True):
... | mit |
witgo/spark | external/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py | 23 | 3611 | #
# 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 |
chrsrds/scikit-learn | examples/neighbors/plot_nca_illustration.py | 1 | 2974 | """
=============================================
Neighborhood Components Analysis Illustration
=============================================
An example illustrating the goal of learning a distance metric that maximizes
the nearest neighbors classification accuracy. The example is solely for
illustration purposes. Ple... | bsd-3-clause |
gannetson/django | tests/view_tests/urls.py | 82 | 3317 | # -*- coding: utf-8 -*-
from functools import partial
from os import path
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.utils._os import upath
from django.utils.translation import ugettext_lazy as _
from django.views import defaults, i18n, static
from . import v... | bsd-3-clause |
shivaenigma/electrum | gui/qt/__init__.py | 2 | 8471 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | gpl-3.0 |
Eficent/odoomrp-wip | procurement_orderpoint_no_confirm/wizard/orderpoint_procurement.py | 26 | 1434 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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 Foundation, either version 3 of the
#... | agpl-3.0 |
jonasschnelli/bitcoin | test/functional/test_framework/util.py | 3 | 19892 | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import unhexlif... | mit |
maelnor/nova | nova/api/openstack/__init__.py | 14 | 16979 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
mythmon/airmozilla | airmozilla/popcorn/renderer.py | 2 | 4098 | import datetime
import os
import tempfile
import time
from uuid import uuid4
import boto
from boto.s3.key import Key
from funfactory.urlresolvers import reverse
from popcoder.popcoder import process_json
from django.db import transaction
from django.conf import settings
from django.utils import timezone
from airmozi... | bsd-3-clause |
adrian-soto/QEdark_repo | tools/bandsndos/bandsndos_Ge.py | 4 | 20068 | #
# Adrian Soto
# 22-12-2014
# Stony Brook University
#
################################################
# Plot band structure and DOS from the
# output of the bands.x program in the
# Quantum Espresso package.
#
# Features:
# 1) Allows for scissor correction (band shift)
# 2)
#
###################################... | gpl-2.0 |
YongseopKim/crosswalk-test-suite | webapi/tct-wgtapi02-w3c-tests/inst.apk.py | 903 | 3180 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
jean/apx | apx/sprites.py | 1 | 13169 | # - coding: utf-8 -
# Copyright (C) 2013-2014 Toms Bauģis <toms.baugis at gmail.com>
import math
import random
from gi.repository import GObject as gobject
from lib import graphics
from lib.pytweener import Easing
from lib import game_utils
from lib import layout
import colors
class Label(layout.Label):
def _... | mit |
mdmintz/seleniumspot | seleniumbase/core/s3_manager.py | 2 | 3083 | """
Manager for dealing with uploading/managing files on Amazon S3
"""
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from seleniumbase.config import settings
already_uploaded_files = []
class S3LoggingBucket(object):
"""
A class to upload log files from tests to Amazon S3.
Those... | mit |
rodrigob/keras | tests/manual/check_autoencoder.py | 56 | 5533 | from __future__ import absolute_import
from __future__ import print_function
from keras.datasets import mnist
from keras.models import Sequential, model_from_config
from keras.layers.core import AutoEncoder, Dense, Activation, TimeDistributedDense, Flatten
from keras.layers.recurrent import LSTM
from keras.layers.embed... | mit |
ModioAB/caramel | tests/__init__.py | 1 | 1242 | #! /usr/bin/env python
# vim: expandtab shiftwidth=4 softtabstop=4 tabstop=17 filetype=python :
import unittest
from itertools import zip_longest
import transaction
from caramel.models import (
init_session,
DBSession,
)
from . import fixtures
class ModelTestCase(unittest.TestCase):
@classmethod
de... | agpl-3.0 |
sofianehaddad/ot-svn | python/test/t_NumericalMathFunction_analytical.py | 2 | 4116 | #! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
elementaryFunctions = Description(0)
elementaryFunctions.add("sin")
elementaryFunctions.add("cos")
elementaryFunctions.add("tan")
elementaryFunctions.add("asin")
elementaryFunction... | mit |
pchmieli/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_DEPRECATED_cv_carsGBM.py | 1 | 6869 | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import random
import inspect
def cv_carsGBM():
# read in the dataset and construct training set (and validation set)
cars = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_20mpg.csv"))
# choose the type... | apache-2.0 |
SoftwareDefinedBuildings/smap | python/smap/drivers/noaaforecast.py | 6 | 4847 | """
Copyright (c) 2011, 2012, Regents of the University of California
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 l... | bsd-2-clause |
tinkerthaler/odoo | addons/account_asset/wizard/account_asset_change_duration.py | 84 | 6005 | # -*- encoding: 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 t... | agpl-3.0 |
b0ttl3z/SickRage | lib/guessit/rules/properties/screen_size.py | 20 | 2893 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
screen_size property
"""
from rebulk.remodule import re
from rebulk import Rebulk, Rule, RemoveMatch
from ..common.validators import seps_surround
from ..common import dash
def screen_size():
"""
Builder for rebulk object.
:return: Created Rebulk object
... | gpl-3.0 |
gymnasium/edx-platform | lms/djangoapps/certificates/management/commands/gen_cert_report.py | 11 | 4330 | """
Generate a report of certificate statuses
"""
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from opaque_keys.edx.keys import CourseKey
from six import text_type
from lms.djangoapps.certificates.models import Generat... | agpl-3.0 |
and2egg/philharmonic | philharmonic/tests/test_explorer.py | 1 | 1636 | from mock import patch
from nose.tools import *
import pandas as pd
import philharmonic
@patch('philharmonic.simulator.simulator.run')
def test_explore_ga_weights(mock_run):
philharmonic._setup('philharmonic.settings.ga_explore')
from philharmonic import conf
conf.parameter_space = 'GAWeights'
from p... | gpl-3.0 |
keedio/hue | desktop/core/ext-py/Django-1.6.10/django/template/loader_tags.py | 105 | 10201 | from collections import defaultdict
from django.conf import settings
from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\
token_kwargs, Variable
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from django.utils import six
register = Library(... | apache-2.0 |
christabor/MoAL | MOAL/computer_organization/bcd.py | 1 | 2704 | # -*- coding: utf-8 -*-
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from MOAL.helpers.display import Section
from MOAL.helpers.display import divider
from MOAL.helpers.display import print_h4
from MOAL.... | apache-2.0 |
svebk/DeepSentiBank_memex | workflows/mark-precomp-sim/mark-precomp-sim.py | 1 | 1410 | import json
from pyspark import SparkContext, SparkConf
def prepare_mark_precomp(data):
key = str(data).rstrip()
#print("[prepare_mark_precomp] data: {}".format(data))
return [(key, [key, "info", "precomp_sim", "True"])]
def mark_precomp_sim(hbase_man_in, hbase_man_out):
in_rdd = hbase_man_in.read_h... | bsd-2-clause |
sberrevoets/scottberrevoets.com | pelicanconf.py | 1 | 1886 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# Site information
AUTHOR = 'Scott Berrevoets'
SITENAME = 'Scott Berrevoets'
SITEURL = 'https://scottberrevoets.com'
# Show line numbers in code snippets
MARKDOWN = {
'extension_configs': {
'markdown.extensions.codehilite': ... | mit |
woggle/mesos-old | third_party/boto-2.0b2/boto/ec2/regioninfo.py | 44 | 1524 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... | apache-2.0 |
tensorflow/privacy | research/pate_2017/input.py | 1 | 13234 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
salfab/CouchPotatoServer | libs/elixir/ext/encrypted.py | 30 | 4330 | '''
An encryption plugin for Elixir utilizing the excellent PyCrypto library, which
can be downloaded here: http://www.amk.ca/python/code/crypto
Values for columns that are specified to be encrypted will be transparently
encrypted and safely encoded for storage in a unicode column using the powerful
and secure Blowfis... | gpl-3.0 |
BrandonHe/sdl_core | src/3rd_party-static/jsoncpp/devtools/fixeol.py | 247 | 1941 | import os.path
def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ):
"""Makes sure that all sources have the specified eol sequence (default: unix)."""
if not os.path.isfile( path ):
raise ValueError( 'Path "%s" is not a file' % path )
try:
f = open(path, 'rb')
exce... | bsd-3-clause |
GGoussar/scikit-image | doc/examples/color_exposure/plot_adapt_rgb.py | 9 | 4535 | """
=========================================
Adapting gray-scale filters to RGB images
=========================================
There are many filters that are designed to work with gray-scale images but not
with color images. To simplify the process of creating functions that can adapt
to RGB images, scikit-image p... | bsd-3-clause |
BehavioralInsightsTeam/edx-platform | lms/djangoapps/experiments/utils.py | 9 | 2910 | from student.models import CourseEnrollment
from django_comment_common.models import Role
from courseware.access import has_staff_access_to_preview_mode
from course_modes.models import (
get_cosmetic_verified_display_price
)
from courseware.date_summary import (
verified_upgrade_deadline_link, verified_upgrade_... | agpl-3.0 |
lfalvarez/nouabook | elections/migrations/0012_auto__add_field_votainteligentemessage_author_ville.py | 1 | 12058 | # -*- 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 field 'VotaInteligenteMessage.author_ville'
db.add_column(u'elec... | gpl-3.0 |
sirchia/CouchPotatoServer | libs/migrate/versioning/template.py | 62 | 2874 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import sys
from pkg_resources import resource_filename
from migrate.versioning.config import *
from migrate.versioning import pathed
class Collection(pathed.Pathed):
"""A collection of templates of a specific type"""
_mask = None
de... | gpl-3.0 |
gdimitris/ChessPuzzlerBackend | Virtual_Environment/lib/python2.7/site-packages/werkzeug/testapp.py | 294 | 9398 | # -*- coding: utf-8 -*-
"""
werkzeug.testapp
~~~~~~~~~~~~~~~~
Provide a small test application that can be used to test a WSGI server
and check it for WSGI compliance.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
impo... | mit |
heladio/my-blog | pelica-env/lib/python2.7/site-packages/pip/req/req_install.py | 31 | 44179 | from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import warnings
import zipfile
from distutils.util import change_root
from distutils import sysconfig
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from pip._vendor.dist... | mit |
madjelan/scikit-learn | sklearn/linear_model/passive_aggressive.py | 106 | 9705 | # Authors: Rob Zinkov, Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from .stochastic_gradient import BaseSGDRegressor
from .stochastic_gradient import DEFAULT_EPSILON
class PassiveAggressiveClassifier(BaseSGDClassifier):
"""Passive Aggressive Classifier
Read mor... | bsd-3-clause |
Azure/azure-sdk-for-python | tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py | 1 | 10235 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
pascalguru/florincoin | qa/rpc-tests/invalidateblock.py | 123 | 3175 | #!/usr/bin/env python2
# Copyright (c) 2014 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 InvalidateBlock code
#
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy imp... | mit |
marcusramberg/dotfiles | bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/network/openvswitch_port.py | 49 | 4068 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
#
# This file is part of Ansible
#
# This module 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 ... | mit |
alexmerser/overholt | tests/api/product_tests.py | 10 | 1352 | # -*- coding: utf-8 -*-
"""
tests.api.product_tests
~~~~~~~~~~~~~~~~~~~~~~~
api product tests module
"""
from ..factories import CategoryFactory, ProductFactory
from . import OverholtApiTestCase
class ProductApiTestCase(OverholtApiTestCase):
def _create_fixtures(self):
super(ProductApiTestC... | mit |
stanbellcom/webapp_politik | sites/all/modules/annotator/lib/store-plugin/pyenv/lib/python2.7/site-packages/werkzeug/testsuite/multipart/collect.py | 78 | 1584 | #!/usr/bin/env python
"""
Hacky helper application to collect form data.
"""
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
def copy_stream(request):
from os import mkdir
from time import time
folder = 'request-%d' % time()
mkdir(folder)
environ = request.e... | gpl-2.0 |
hickey/amforth | tools/amforth-shell.py | 2 | 56764 | #!/usr/bin/python
#
# pySerial based upload & interpreter interaction module for amforth.
#
# Copyright 2011 Keith Amidon (camalot@picncipark.org)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software... | gpl-2.0 |
Benoss/django-elasticsearch-debug-toolbar | elastic_panel/test/test_toolbar.py | 1 | 1590 | # -*- coding: utf-8 -*-
import unittest
from django.conf import settings
settings.configure()
from debug_toolbar.toolbar import DebugToolbar
from django.http import HttpResponse
from django.test import RequestFactory
from elasticsearch.connection import Connection
from elastic_panel import panel
class ImportTest(u... | mit |
dr-venkman/TizenRT | os/drivers/sercomm/loadwriter.py | 13 | 1050 | #!/usr/bin/python
###########################################################################
#
# Copyright 2016 Samsung Electronics 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 ... | apache-2.0 |
asmeurer/urllib3 | test/test_retry.py | 1 | 5845 | import unittest
from urllib3.packages.six.moves import xrange
from urllib3.util.retry import Retry
from urllib3.exceptions import (
ConnectTimeoutError,
ReadTimeoutError,
MaxRetryError
)
class RetryTest(unittest.TestCase):
def test_string(self):
""" Retry string representation looks the way ... | mit |
MiroK/dolfin | test/unit/python/fem/test_solving.py | 3 | 2436 | #!/usr/bin/env py.test
"""Unit tests for the solve function"""
# Copyright (C) 2011 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN 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 versi... | gpl-3.0 |
sarahgrogan/scikit-learn | sklearn/feature_selection/base.py | 70 | 4221 | # -*- coding: utf-8 -*-
"""Generic feature selection mixin"""
# Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
from warnings import warn
import numpy as np
from scipy.sparse import issparse, csc_matrix
from ..base import TransformerMixin
f... | bsd-3-clause |
chauhanhardik/populo_2 | lms/djangoapps/verify_student/migrations/0009_auto__change_softwaresecurephotoverification_window_id_default_none.py | 84 | 9796 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self):
# Changing field 'SoftwareSecurePhotoVerification.window'. Setting its default value to None
if db.backend_name == 'mysql':
db.execute('ALTER TAB... | agpl-3.0 |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/learn/python/learn/utils/__init__.py | 112 | 1300 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
hansey/youtube-dl | youtube_dl/downloader/common.py | 95 | 13848 | from __future__ import division, unicode_literals
import os
import re
import sys
import time
from ..compat import compat_str
from ..utils import (
encodeFilename,
decodeArgument,
format_bytes,
timeconvert,
)
class FileDownloader(object):
"""File Downloader class.
File downloader objects are... | unlicense |
pombredanne/AnotherPyGraphvizAgain | AnotherPyGraphvizAgain/tests/Framework.py | 1 | 1641 | # -*- coding: utf-8 -*-
# Copyright 2013 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of AnotherPyGraphvizAgain. http://jacquev6.github.com/AnotherPyGraphvizAgain
# AnotherPyGraphvizAgain is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General ... | gpl-3.0 |
iRGBit/QGIS | python/plugins/db_manager/sqledit.py | 18 | 6399 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptEdit.py
---------------------
Date : February 2014
Copyright : (C) 2014 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.