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 |
|---|---|---|---|---|---|
M3nin0/supreme-broccoli | Web/Flask/site_/lib/python3.5/site-packages/sqlalchemy/dialects/mssql/pyodbc.py | 17 | 10416 | # mssql/pyodbc.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mssql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstrin... | apache-2.0 |
myriadrf/pyLMS7002M | pyLMS7002M/LimeSDRMini.py | 1 | 11270 | #***************************************************************
#* Name: LimeSDRMini.py
#* Purpose: Class implementing LimeSDRMini functions
#* Author: Lime Microsystems ()
#* Created: 2018-04-16
#* Copyright: Lime Microsystems (limemicro.com)
#* License:
#**************************************************... | apache-2.0 |
JackKelly/neuralnilm_prototype | scripts/e115.py | 2 | 3654 | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import c... | mit |
kpavel/docker-py | tests/integration/network_test.py | 2 | 3590 | import random
import docker
import pytest
from .. import helpers
from ..base import requires_api_version
@requires_api_version('1.21')
class TestNetworks(helpers.BaseTestCase):
def create_network(self, *args, **kwargs):
net_name = u'dockerpy{}'.format(random.getrandbits(24))[:14]
net_id = self.c... | apache-2.0 |
rgblabs/rgbTools | rgbTools/utils/filesystem.py | 1 | 2692 | import maya.cmds as cmds
def which (program):
'''
If application is found, returns path.
This works with both full application paths, and applications available
within the OS's defined PATH
'''
import os
def is_exe (fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
... | mit |
RannyeriDev/Solfege | test.py | 2 | 3251 | #!/usr/bin/python
# Solfege - free ear training software
# Copyright (C) 2007, 2008, 2011 Tom Cato Amundsen
# License is GPL, see file COPYING
from __future__ import absolute_import
import unittest
import sys
import os
import shutil
import atexit
# we need this hack because doctest messes with _
def f(s):
if type... | gpl-3.0 |
akosel/incubator-airflow | airflow/ti_deps/deps/base_ti_dep.py | 15 | 5920 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
shabbir005/learntosolveit | languages/python/design_caseinsensitivedict.py | 7 | 1319 | #!/usr/bin/python
# $Id$
"""
Case Insenstive Dictionary Lookup. Dictionary keys are case sensitive. However
you might want some facilities to do a case-insenstive dictiionary lookup at
times. This provides the facility for the same.
"""
class CaseInsensitiveDict(dict):
def __init__(self, *args, **kwargs):
... | bsd-3-clause |
freeworldxbmc/pluging.video.Jurassic.World.Media | resources/lib/sources/dizibox_tv.py | 7 | 6433 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-3.0 |
BarrelfishOS/barrelfish | tools/harness/tests/irqtest.py | 1 | 2241 | ##########################################################################
# Copyright (c) 2011, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Universitaetstrasse 6, CH... | mit |
nkhuyu/SFrame | oss_src/unity/python/sframe/__init__.py | 8 | 3331 | """
@package graphlab
...
GraphLab Create is a machine learning platform that enables data scientists and
app developers to easily create intelligent applications at scale. Building an
intelligent, predictive application involves iterating over multiple steps:
cleaning the data, developing features, training a model, a... | bsd-3-clause |
dhalleine/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/uniform_test.py | 3 | 7911 | # 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 |
edvisees/sciDP | nn_passage_tagger.py | 1 | 15369 | import warnings
import sys
import codecs
import numpy
import argparse
import theano
import json
import pickle
from rep_reader import RepReader
from util import read_passages, evaluate, make_folds
from keras.models import Sequential, Graph, model_from_json
from keras.layers.core import TimeDistributedDense, Dropout
fr... | apache-2.0 |
etos/django | tests/model_regress/test_pickle.py | 31 | 1705 | import pickle
from django.db import DJANGO_VERSION_PICKLE_KEY, models
from django.test import TestCase
from django.utils.version import get_version
class ModelPickleTestCase(TestCase):
def test_missing_django_version_unpickling(self):
"""
#21430 -- Verifies a warning is raised for models that are... | bsd-3-clause |
keto/askbot-devel | askbot/utils/forms.py | 7 | 11252 | import re
from django import forms
from django.contrib.auth.models import User
from django.conf import settings
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from askbot.conf import set... | gpl-3.0 |
sevagas/macro_pack | src/vbLib/Base64ToText.py | 1 | 1559 | VBA = \
r"""
Function Base64ToText(ByVal vCode)
Dim oXML, oNode
Dim tempString As String
tempString = "Msxm"
tempString = tempString & "l2.DO"
tempString = tempString & "MDoc"
tempString = tempString & "ument.3.0"
Set oXML = CreateObject(tempString)
Set oNode = oXML.CreateElement("base6... | apache-2.0 |
dimfeld/gsutil | gslib/util.py | 2 | 40860 | # -*- coding: utf-8 -*-
# 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 require... | apache-2.0 |
Kilhog/odoo | addons/event_sale/__openerp__.py | 306 | 2163 | # -*- 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 |
xeoron/namebench | tools/check_nameserver_popularity.py | 174 | 2456 | #!/usr/bin/env python
import os
import re
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedi... | apache-2.0 |
qskycolor/viewfinder | backend/www/test/unshare_test.py | 13 | 17575 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Test photo unsharing.
"""
__author__ = 'andy@emailscrubbed.com (Andy Kimball)'
import mock
import time
from copy import deepcopy
from viewfinder.backend.base import util
from viewfinder.backend.db.activity import Activity
from viewfinder.backend.db.db_client ... | apache-2.0 |
Weicong-Lin/pymo-global | android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_macpath.py | 100 | 2000 | import macpath
from test import test_support, test_genericpath
import unittest
class MacPathTestCase(unittest.TestCase):
def test_abspath(self):
self.assertEqual(macpath.abspath("xx:yy"), "xx:yy")
def test_isabs(self):
isabs = macpath.isabs
self.assertTrue(isabs("xx:yy"))
sel... | mit |
CUCWD/edx-platform | lms/djangoapps/debug/management/commands/dump_xml_courses.py | 17 | 2416 | """
Export all xml courses in a diffable format.
This command loads all of the xml courses in the configured DATA_DIR.
For each of the courses, it loops through all of the modules, and dumps
each as a separate output file containing the json representation
of each of its fields (including those fields that are set as ... | agpl-3.0 |
pivonroll/Qt_Creator | tests/system/suite_editors/tst_modify_readonly/test.py | 3 | 7572 | ############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... | gpl-3.0 |
mesocentrefc/easybuild-framework | easybuild/framework/__init__.py | 3 | 1440 | ##
# Copyright 2009-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
wevoice/wesub | apps/socialauth/views.py | 1 | 12656 | from django.shortcuts import render_to_response, redirect
from django.contrib import messages
from django.template import RequestContext
from django.contrib.auth import authenticate, login
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.conf import set... | agpl-3.0 |
kisna72/django | tests/check_framework/test_model_field_deprecation.py | 322 | 2584 | from django.core import checks
from django.db import models
from django.test import SimpleTestCase
from .tests import IsolateModelsMixin
class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase):
def test_default_details(self):
class MyField(models.Field):
system_check_deprecated_details ... | bsd-3-clause |
itu-oss-project-team/oss-github-analysis-project | github_analysis_tool/analyzer/tf-idf.py | 1 | 3362 | import os.path
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from math import log10
import yaml
from github_analysis_tool.services.database_service import DatabaseService
class Tfidf:
def __init__(self, secret_config):
# Generate a github_reques... | mit |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/music21/ext/nbconvert/preprocessors/coalescestreams.py | 5 | 2253 | """Preprocessor for merging consecutive stream outputs for easier handling."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import re
from IPython.utils.log import get_logger
def cell_preprocessor(function):
"""
Wrap a function to be executed on all cel... | mit |
daegun/mitro | emailer/auth/models2.py | 25 | 1594 | #!/usr/bin/env python
# import datetime
import json
# import logging
# import sqlalchemy
# import sqlalchemy.exc
import sqlalchemy.ext.declarative
# import sqlalchemy.orm
# from sqlalchemy.pool import StaticPool
# from sqlalchemy.pool import NullPool
# import tornado.options
# from auth import email_queue
# from au... | gpl-3.0 |
Cuuuurzel/KiPyCalc | sympy/mpmath/tests/test_levin.py | 20 | 5076 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from sympy.mpmath import mp
from sympy.mpmath import libmp
xrange = libmp.backend.xrange
# Attention:
# These tests run with 15-20 decimal digits precision. For higher precision the
# working precision must be raised.
def test_levin_0():
mp.dps = 17
eps = mp.mpf... | mit |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7.2/Lib/distutils/tests/test_register.py | 14 | 7609 | """Tests for distutils.command.register."""
# -*- encoding: utf8 -*-
import sys
import os
import unittest
import getpass
import urllib2
import warnings
from test.test_support import check_warnings, run_unittest
from distutils.command import register as register_module
from distutils.command.register import register
f... | mit |
pschmitt/home-assistant | tests/components/dexcom/test_sensor.py | 5 | 3940 | """The sensor tests for the griddy platform."""
from pydexcom import SessionError
from homeassistant.components.dexcom.const import MMOL_L
from homeassistant.const import (
CONF_UNIT_OF_MEASUREMENT,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
)
from tests.async_mock import patch
from tests.components.dexcom import... | apache-2.0 |
alexgorban/models | research/object_detection/dataset_tools/oid_tfrecord_creation.py | 3 | 4887 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
isohybrid/dotfile | vim/bundle/git:--github.com-klen-python-mode/pylibs/logilab/common/ureports/text_writer.py | 42 | 5106 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | bsd-2-clause |
sinhrks/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 176 | 2027 | """
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | bsd-3-clause |
hirokihamasaki/irma | frontend/frontend/api/v1_1/controllers/files.py | 1 | 7314 | # Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http://... | apache-2.0 |
elkingtoncode/People-Networks | secret/topsecret.se.py | 4 | 7316 | data clust[](cluster_tree[](vec[], id, distance, vectorLen))
data lenCluster
data i
data j
data numEvents
data distances[][]
data cluster_elements[]
data elementsLen
data extracted_clusters[]
data extractionLen
# root is 0
# left child is 2i+1
# right child is 2i+2
# -1 == none
def sqrt(n):
approx = n/2
... | gpl-3.0 |
pmazurek/ansible-modules-extras | packaging/os/pkgin.py | 13 | 7314 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com>
# Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to>
#
# Written by Shaun Zinck
# Based on pacman module written by Afterburn <http://github.com/afterburn>
# that was based on apt module written by Matthew Wi... | gpl-3.0 |
dmccloskey/SBaaS_quantification | template_scripts/import_MQResultsTable.py | 1 | 3766 | import sys
sys.path.append('C:/Users/dmccloskey-sbrg/Google Drive/SBaaS_base')
from SBaaS_base.postgresql_settings import postgresql_settings
from SBaaS_base.postgresql_orm import postgresql_orm
# read in the settings file
filename = 'C:/Users/dmccloskey-sbrg/Google Drive/SBaaS_base/settings.ini';
pg_settings = postgr... | mit |
jhunufernandes/ArduWatchRaspSerial | virtualenv/lib/python3.4/site-packages/setuptools/command/bdist_rpm.py | 1049 | 1508 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | mit |
piffey/ansible | test/integration/targets/connection/plugin/dummy.py | 56 | 1089 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
author:
- John Doe
connection: dummy
short_description: defective connection plugin
description:
- defective connection plugin
version_added: "2.0"
options: {}
"""
import ... | gpl-3.0 |
qisanstudio/qsapp-suibe | src/suibe/models/channel.py | 1 | 3718 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from jinja2 import Markup
from flask import url_for
from studio.core.engines import db
from sqlalchemy.ext.hybrid import hybrid_property
from suibe.models.article import ArticleModel
__all__ = [
'NaviChannelModel',
'ChannelModel',
'ChannelSu... | mit |
greenb8/romcollectionbrowser | resources/lib/dialogcontextmenu.py | 10 | 10158 |
import xbmc, xbmcgui, xbmcaddon
import util, nfowriter, wizardconfigxml, helper
import dialogeditromcollection, dialogeditscraper, dialogdeleteromcollection, config
from nfowriter import *
from gamedatabase import *
from util import *
from config import *
ACTION_CANCEL_DIALOG = (9,10,51,92,110)
CONTROL_BU... | gpl-2.0 |
martinohanlon/pgzero-pong | pong.py | 1 | 3151 | from math import sin, cos, radians
from time import sleep
#setup the constants
WIDTH = 500
HEIGHT = 300
BALLSPEED = 10
PADDLESPEED = 5
MAXBOUNCEANGLE = 75
def reset_game(angle):
#setup ball properties
ball.pos = WIDTH / 2, HEIGHT / 2
ball.x_float = float(ball.x)
ball.y_float = float(ball.y)
ball.... | mit |
Pymatteo/QtNMR | build/exe.win32-3.4/scipy/cluster/tests/test_hierarchy.py | 7 | 34863 | #! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# 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 copy... | gpl-3.0 |
Jenselme/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/common.py | 489 | 9947 | # Copyright 2012, 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 f... | mpl-2.0 |
vjmac15/Lyilis | lib/urllib3/response.py | 94 | 22903 | from __future__ import absolute_import
from contextlib import contextmanager
import zlib
import io
import logging
from socket import timeout as SocketTimeout
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
BodyNotHttplibCompatible, ProtocolError, DecodeErr... | gpl-3.0 |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Lib/test/test_base64.py | 6 | 11712 | import unittest
from test import support
import base64
import binascii
import os
import sys
import subprocess
class LegacyBase64TestCase(unittest.TestCase):
def test_encodebytes(self):
eq = self.assertEqual
eq(base64.encodebytes(b"www.python.org"), b"d3d3LnB5dGhvbi5vcmc=\n")
eq(base64.enc... | lgpl-3.0 |
map222/spark | examples/src/main/python/mllib/random_forest_classification_example.py | 106 | 2572 | #
# 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 |
shaistaansari/django | django/core/management/commands/createcachetable.py | 342 | 4389 | from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import (
DEFAULT_DB_ALIAS, connections, models, router, transaction,
)
from django.db.utils import Databa... | bsd-3-clause |
tamsky/cloud-init | cloudinit/sources/DataSourceEc2.py | 5 | 7270 | # vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Hafliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yahoo-... | gpl-3.0 |
prune998/ansible | lib/ansible/modules/network/f5/bigip_sys_global.py | 19 | 13687 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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
# ... | gpl-3.0 |
bussiere/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py | 73 | 25045 | """Suite Standard Suite: Common terms for most applications
Level 1, version 1
Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'core'
from _builtinSuites.builtin_Suite import *
class Standard_Suite_Events(b... | mit |
hernandito/SickRage | lib/github/GithubException.py | 74 | 4433 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
lbishal/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 234 | 12267 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
xingyepei/edx-platform | lms/djangoapps/courseware/features/word_cloud.py | 94 | 1516 | # pylint: disable=missing-docstring
from lettuce import world, step
from common import i_am_registered_for_the_course, section_location, visit_scenario_item
@step('I view the word cloud and it has rendered')
def word_cloud_is_rendered(_step):
assert world.is_css_present('.word_cloud')
@step('the course has a W... | agpl-3.0 |
tensorflow/gan | tensorflow_gan/examples/mnist_estimator/train_test.py | 1 | 1617 | # coding=utf-8
# Copyright 2020 The TensorFlow GAN 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 applicabl... | apache-2.0 |
yhpeng-git/mxnet | tests/python/common/get_data.py | 15 | 1377 | # pylint: skip-file
import os, gzip
import pickle as pickle
import sys
# download mnist.pkl.gz
def GetMNIST_pkl():
if not os.path.isdir("data/"):
os.system("mkdir data/")
if not os.path.exists('data/mnist.pkl.gz'):
os.system("wget -q http://deeplearning.net/data/mnist/mnist.pkl.gz -P data/")
#... | apache-2.0 |
saga-survey/erik | utils.py | 2 | 13862 | """
Various utility functions that have no other obvious place to live.
"""
from __future__ import division, print_function
import numpy as np
try:
import six
except ImportErrir:
from astropy.extern import six
def int_to_roman(input):
"""
Convert an integer to Roman numerals.
From http://code.ac... | gpl-2.0 |
siosio/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/pgen2/driver.py | 212 | 5164 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | apache-2.0 |
zqqf16/SYM | SYM/Models/models.py | 1 | 1880 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import re
import sys
import json
import requests
def get_raw(url):
r = requests.get(url)
if r.status_code != 200:
return None
return r.text
def parse_models(regex, text):
result = []
lastModel = ""
model_regex = re.compile(r'.*\d,\d')
... | mit |
xq262144/hue | desktop/libs/libsaml/src/libsaml/metrics.py | 15 | 1159 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
iamsteadman/bambu-api | bambu_api/__init__.py | 1 | 1314 | """
Quickly expose your models to a JSON or XML API, authenticated via HTTP or
OAuth.
"""
__version__ = '2.0.1'
from bambu_api.options import *
from bambu_api.sites import APISite
from bambu_api.exceptions import APIException
from bambu_api.decorators import argument, returns, named
from django.conf import settings
f... | apache-2.0 |
xbianonpi/Sick-Beard-TPB | lib/requests/structures.py | 67 | 3576 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import os
import collections
from itertools import islice
class IteratorProxy(object):
"""docstring for IteratorProxy"""
def __init__(self, i):
self.i = i
# self.i = chain.from_iter... | gpl-3.0 |
setjet/spark | examples/src/main/python/mllib/svd_example.py | 128 | 1773 | #
# 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 |
andris210296/andris-projeto | backend/venv/lib/python2.7/site-packages/pip/_vendor/distlib/resources.py | 164 | 10570 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import types... | mit |
Jamagas/CMake | libs/gtest-1.7.0/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | mit |
numpy/numpy | numpy/core/_ufunc_config.py | 7 | 13387 | """
Functions for changing global ufunc configuration
This provides helpers which wrap `umath.geterrobj` and `umath.seterrobj`
"""
import collections.abc
import contextlib
from .overrides import set_module
from .umath import (
UFUNC_BUFSIZE_DEFAULT,
ERR_IGNORE, ERR_WARN, ERR_RAISE, ERR_CALL, ERR_PRINT, ERR_LO... | bsd-3-clause |
gpfei/python-acsmx2 | acsmx2/test.py | 1 | 3625 | import unittest
from acsmx2.search import Matcher, MatchedWord
class MatchTestCase(unittest.TestCase):
def setUp(self):
self.matcher = Matcher(1024)
def test_abc(self):
for i, pattern in enumerate([
b'hello',
b'world',
b'ld',
]):
... | gpl-2.0 |
mattilyra/gensim | gensim/test/test_ldavowpalwabbit_wrapper.py | 3 | 7796 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Tests for Vowpal Wabbit LDA wrapper.
Will not be run unless the environment variable 'VOWPAL_WABBIT_PATH' is set
and points to the ... | lgpl-2.1 |
fangxingli/hue | desktop/core/ext-py/Paste-2.0.1/paste/debug/profile.py | 50 | 7607 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Middleware that profiles the request and displays profiling
information at the bottom of each page.
"""
import sys
import os
import hotshot
impor... | apache-2.0 |
cypod/arsenalsuite | python/pythondotnet/pythonnet/src/tests/test_event.py | 10 | 20362 | # ===========================================================================
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE D... | gpl-2.0 |
criccomini/airflow | airflow/migrations/versions/13eb55f81627_for_compatibility.py | 17 | 1160 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
rob356/SickRage | lib/rtorrent/compat.py | 180 | 1258 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# 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, modify, ... | gpl-3.0 |
SujaySKumar/bedrock | lib/l10n_utils/gettext.py | 23 | 11853 | # coding=utf-8
# 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 __future__ import with_statement
import codecs
import os
import re
from os.path import join
from t... | mpl-2.0 |
FusionSP/android_external_chromium_org | tools/valgrind/gdb_helper.py | 201 | 2826 | # Copyright (c) 2011 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.
''' A bunch of helper functions for querying gdb.'''
import logging
import os
import re
import tempfile
GDB_LINE_RE = re.compile(r'Line ([0-9]*) of "([... | bsd-3-clause |
ibazzi/rk3288-kernel | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
danieljaouen/ansible | lib/ansible/modules/network/avi/avi_clusterclouddetails.py | 20 | 3609 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
muravjov/ansible | lib/ansible/runner/connection_plugins/local.py | 110 | 5581 | # (c) 2012, 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) any lat... | gpl-3.0 |
azumimuo/family-xbmc-addon | plugin.video.bubbles/resources/lib/sources/german/hoster/open/moviesever.py | 1 | 5229 | # -*- coding: utf-8 -*-
"""
Bubbles Addon
Copyright (C) 2016 Viper2k4
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... | gpl-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pillow-2.9.0/Tests/test_imagecolor.py | 12 | 2976 | from helper import unittest, PillowTestCase
from PIL import Image
from PIL import ImageColor
class TestImageColor(PillowTestCase):
def test_sanity(self):
self.assertEqual((255, 0, 0), ImageColor.getrgb("#f00"))
self.assertEqual((255, 0, 0), ImageColor.getrgb("#ff0000"))
self.assertEqual(... | mit |
michael-dev2rights/ansible | lib/ansible/modules/windows/win_rabbitmq_plugin.py | 47 | 1412 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
modul... | gpl-3.0 |
longmazhanfeng/automationlibrary | MobileLibrary/setup.py | 1 | 2204 | #!/usr/bin/env python
import sys
from os.path import join, dirname
sys.path.append(join(dirname(__file__), 'src'))
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
execfile(join(dirname(__file__), 'src', 'AppiumLibrary', 'version.py'))
setup(name = 'robotframework-mobilelibr... | mit |
ShashaQin/frappe | frappe/email/bulk.py | 1 | 11335 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import HTMLParser
import smtplib
from frappe import msgprint, throw, _
from frappe.email.smtp import SMTPServer, get_outgoing_email_account
from frappe.email.email_b... | mit |
a10networks/a10sdk-python | a10sdk/core/aam/aam_authentication_global_stats.py | 2 | 4285 | from a10sdk.common.A10BaseClass import A10BaseClass
class Stats(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param Ocsp_Stapling_Requests_to_a10authd: {"description": "Total OCSP Stapling Request", "format": "counter", "type": "number", "oid": "4", "optional": true, ... | apache-2.0 |
tseaver/google-cloud-python | grafeas/grafeas/grafeas_v1/proto/attestation_pb2.py | 2 | 9103 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: grafeas_v1/proto/attestation.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 _mess... | apache-2.0 |
wasit7/tutorials | arduino_python/libraries/arduino_792253/RPi/pyRF24Network/examples/helloworld_tx.py | 3 | 1623 | #!/usr/bin/env python
#
# Simplest possible example of using RF24Network,
#
# TRANSMITTER NODE
# Sends messages from to receiver.
#
import time
from struct import *
from RF24 import *
from RF24Network import *
# CE Pin, CSN Pin, SPI Speed
# Setup for GPIO 22 CE and GPIO 25 CSN with SPI Speed @ 1Mhz
#radio = radio... | mit |
Laurawly/tvm-1 | tests/python/unittest/test_ir_container.py | 4 | 2553 | # 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 u... | apache-2.0 |
saurvs/servo | tests/wpt/web-platform-tests/tools/py/setup.py | 161 | 1425 | import os, sys
from setuptools import setup
def main():
setup(
name='py',
description='library with cross-python path, ini-parsing, io, code, log facilities',
long_description = open('README.txt').read(),
version='1.4.31',
url='http://pylib.readthedocs.org/',
licens... | mpl-2.0 |
fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractMaddertranslatesCom.py | 1 | 1779 | def extractMaddertranslatesCom(item):
'''
Parser for 'maddertranslates.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Form A Slaves Only Harem Guild', 'An ... | bsd-3-clause |
frumiousbandersnatch/supybot-code | src/utils/gen.py | 6 | 10408 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2008, James McCoy
# 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 copyr... | bsd-3-clause |
chincisan/google-python-exercises | basic/string1.py | 1 | 3560 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | apache-2.0 |
WillianPaiva/1flow | oneflow/base/templatetags/base_utils.py | 1 | 6677 | # -*- coding: utf-8 -*-
"""
Copyright 2012-2014 Olivier Cortès <oc@1flow.io>
This file is part of the 1flow project.
1flow 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 versio... | agpl-3.0 |
asajeffrey/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_code/assertion.py | 60 | 3174 | import sys
import py
BuiltinAssertionError = py.builtin.builtins.AssertionError
_reprcompare = None # if set, will be called by assert reinterp for comparison ops
def _format_explanation(explanation):
"""This formats an explanation
Normally all embedded newlines are escaped, however there are
three exce... | mpl-2.0 |
fedorpatlin/ansible | test/units/playbook/test_play_context.py | 26 | 14343 | # (c) 2012-2014, 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 |
SiCKRAGETV/SickRage | sickrage/libs/trakt/mapper/sync.py | 3 | 7480 | from __future__ import absolute_import, division, print_function
import logging
from trakt.mapper.core.base import Mapper
log = logging.getLogger(__name__)
class SyncMapper(Mapper):
@classmethod
def process(cls, client, store, items, media=None, flat=False, **kwargs):
if flat:
# Return ... | gpl-3.0 |
sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/translate/ibm1.py | 17 | 9022 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: IBM Model 1
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Chin Yee Lee <c.lee32@student.unimelb.edu.au>
# Hengfeng Li <hengfeng12345@gmail.com>
# Ruxin Hou <r.hou@student.unimelb.edu.au>
# Calvin Tanujaya Lim <c.tanujayalim@gmail.com>
# Ba... | mit |
nicolasnoble/grpc | examples/python/helloworld/async_greeter_client_with_options.py | 8 | 1652 | # Copyright 2020 The gRPC 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 applicable law or agreed to in writ... | apache-2.0 |
ltilve/ChromiumGStreamerBackend | third_party/typ/typ/tests/main_test.py | 33 | 26960 | # Copyright 2014 Dirk Pranke. 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 applicable law or a... | bsd-3-clause |
dongjoon-hyun/tensorflow | tensorflow/python/kernel_tests/sparse_serialization_ops_test.py | 5 | 20468 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.