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 |
|---|---|---|---|---|---|
Changaco/oh-mainline | vendor/packages/whoosh/src/whoosh/reading.py | 17 | 26747 | # Copyright 2007 Matt Chaput. 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 conditions and the... | agpl-3.0 |
tarasane/h2o-3 | h2o-py/tests/testdir_algos/deeplearning/pyunit_tweedie_offsetDeeplearning.py | 5 | 3190 | import sys
sys.path.insert(1, "../../../")
import h2o, tests
def tweedie_offset():
insurance = h2o.import_file(h2o.locate("smalldata/glm_test/insurance.csv"))
insurance["offset"] = insurance["Holders"].log()
insurance["Group"] = insurance["Group"].asfactor()
insurance["Age"] = insurance["Age"].asfacto... | apache-2.0 |
hvasbath/beat | test/test_sources.py | 1 | 3871 | import logging
import unittest
from beat.sources import MTQTSource
from pyrocko import util
import pyrocko.moment_tensor as mtm
import numpy as num
from numpy.testing import assert_allclose
pi = num.pi
logger = logging.getLogger('test_sources')
class TestSources(unittest.TestCase):
def __init__(self, *args, ... | gpl-3.0 |
geowurster/Pydar | pydar/drivers/las14.py | 2 | 10138 | # This document is part of Pydar
# https://github.com/geowurster/Pydar
# =================================================================================== #
#
# New BSD License
#
# Copyright (c) 2014, Kevin D. Wurster
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
... | bsd-3-clause |
mjholgate/librabbitmq | funtests/config.py | 2 | 1520 | import os
BROKER_HOST = os.environ.get('BROKER_HOST', 'localhost')
BROKER_PORT = int(os.environ.get('BROKER_PORT', 5672))
BROKER_VHOST = os.environ.get('BROKER_VHOST', '/')
BROKER_USER = os.environ.get('BROKER_USER', 'guest')
BROKER_PASSWORD = os.environ.get('BROKER_PASSWORD', 'guest')
from functools import partial
f... | gpl-2.0 |
alexanderjfink/miner | library/miner/map.py | 1 | 8780 | """
The basic form of a Map...
Should be general enough that it can fit all maps (unless there seems good reason to ignore this)
Should be specific enough that it does a lot of the heavy lifting for Maps
"""
# Python standard
import re, os, shutil
# External libraries
from messy2sql.core import Messy2SQL
from messyta... | gpl-2.0 |
dbertha/odoo | addons/l10n_do/__openerp__.py | 309 | 2992 | # -*- coding: utf-8 -*-
# #############################################################################
#
# First author: Jose Ernesto Mendez <tecnologia@obsdr.com> (Open Business Solutions SRL.)
# Copyright (c) 2012 -TODAY Open Business Solutions, SRL. (http://obsdr.com). All rights reserved.
#
# This is a fork to upg... | agpl-3.0 |
brittanystoroz/kitsune | kitsune/sumo/tests/test_middleware.py | 3 | 5110 | from django.http import HttpResponsePermanentRedirect
from django.test.client import RequestFactory
import mobility
from nose.tools import eq_
from kitsune.sumo.middleware import PlusToSpaceMiddleware, DetectMobileMiddleware
from kitsune.sumo.tests import TestCase, PyQuery as pq
class TrailingSlashMiddlewareTestCas... | bsd-3-clause |
flyher/pymo | symbian/PythonForS60/module-repo/standard-modules/posixpath.py | 34 | 13777 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | mit |
alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/raw/GLES1/NV/fence.py | 8 | 1213 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES1 import _types as _cs
# End users want this...
from OpenGL.raw.GLES1._types import *
from OpenGL.raw.GLES1 import _errors
from OpenGL.constant import Constant as _C
import... | mit |
ihsanudin/odoo | addons/share/wizard/__init__.py | 448 | 1067 | # -*- 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 |
michalliu/chromium-depot_tools | third_party/boto/plugin.py | 111 | 2695 | # Copyright 2010 Google Inc.
#
# 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, merge, publish, dis-
# trib... | bsd-3-clause |
sysadminmatmoz/odoo-clearcorp | partner_payment_average/__init__.py | 3 | 1100 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
diana-hep/femtocode | ldrdio/tests/test_mediated.py | 1 | 2500 | #!/usr/bin/env python
# Copyright 2016 DIANA-HEP
#
# 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 o... | apache-2.0 |
BaconPancakes/valor | lib/youtube_dl/extractor/urort.py | 64 | 2249 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
from ..utils import (
unified_strdate,
)
class UrortIE(InfoExtractor):
IE_DESC = 'NRK P3 Urørt'
_VALID_URL = r'https?://(?:www\.)?urort\.p3\.no/#!/Band/(?P<id>[^/]+)... | gpl-3.0 |
leppa/home-assistant | homeassistant/components/tradfri/light.py | 3 | 9287 | """Support for IKEA Tradfri lights."""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_TRANSITION,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
Light,
)
import homeassistant.util.color as color_util
from .base_... | apache-2.0 |
endolith/numpy | numpy/conftest.py | 3 | 3009 | """
Pytest configuration and fixtures for the Numpy test suite.
"""
import os
import hypothesis
import pytest
import numpy
from numpy.core._multiarray_tests import get_fpu_mode
_old_fpu_mode = None
_collect_results = {}
# See https://hypothesis.readthedocs.io/en/latest/settings.html
hypothesis.settings.register_pr... | bsd-3-clause |
jbedorf/tensorflow | tensorflow/examples/speech_commands/input_data.py | 4 | 30206 | # 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 |
deepmind/dqn_zoo | dqn_zoo/networks.py | 1 | 11677 | # Copyright 2019 DeepMind Technologies Limited. 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 ... | apache-2.0 |
Lvl4Sword/Sloth | sloth/tests/test_store.py | 2 | 6859 | # Copyright 2015, 2016 Scott King
#
# This file is part of Sloth.
#
# Sloth is free software: you can redistribute it and/or modify
# it under the terms of the Affero GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | agpl-3.0 |
Urinx/Machine_Learning | SVM/svm.py | 1 | 8600 | #! /usr/bin/env python
# coding:utf-8
#########################################
# SVM #
#########################################
from numpy import *
import numpy as np
from random import random
from matplotlib.pyplot import *
from pylab import *
from scipy.optimize import fmin_bfgs
f... | gpl-2.0 |
wildjan/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/html5lib/trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | apache-2.0 |
GitHublong/hue | tools/ace-editor/static.py | 106 | 11363 | #!/usr/bin/env python
"""static - A stupidly simple WSGI way to serve static (or mixed) content.
(See the docstrings of the various functions and classes.)
Copyright (C) 2006-2009 Luke Arno - http://lukearno.com/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesse... | apache-2.0 |
BeATz-UnKNoWN/python-for-android | python3-alpha/python3-src/Lib/distutils/command/register.py | 53 | 11689 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
import os, string, getpass
import io
import urllib.parse, urllib.request
from warnings import warn
from distutils.core import PyPIRCCommand
from distutils.errors import *... | apache-2.0 |
mildass/tlsfuzzer | scripts/test-record-size-limit.py | 1 | 73811 | # Author: Hubert Kario, (c) 2015-2018
# Released under Gnu GPL v2.0, see LICENSE file for details
from __future__ import print_function
import traceback
import sys
import getopt
from itertools import chain, islice
from tlsfuzzer.runner import Runner
from tlsfuzzer.messages import Connect, ClientHelloGenerator, \
... | gpl-2.0 |
hzy/raven-python | raven/contrib/tornado/__init__.py | 6 | 8165 | """
raven.contrib.tornado
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details
:license: BSD, see LICENSE for more details
"""
from __future__ import absolute_import
from tornado.httpclient import AsyncHTTPClient, HTTPError
from raven.base import Client
class AsyncSentryClien... | bsd-3-clause |
ant9000/RIOT | tests/sys_atomic_utils/tests/01-run.py | 8 | 1040 | #!/usr/bin/env python3
# Copyright (C) 2020 Otto-von-Guericke-Universität Magdeburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
# @author Marian Buschsieweke <marian.buschsieweke@ovgu.de... | lgpl-2.1 |
dhermes/google-cloud-python | error_reporting/tests/unit/gapic/v1beta1/test_error_group_service_client_v1beta1.py | 2 | 4871 | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
masamichi/bite-project | deps/gdata-python-client/src/gdata/service.py | 78 | 69609 | #!/usr/bin/python
#
# Copyright (C) 2006,2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
pymedusa/Medusa | ext/github/GitTag.py | 2 | 5026 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
johndamen/pyeasyplot | easyplot/gui/basewidgets.py | 1 | 13141 | from PyQt4 import QtGui, QtCore
from collections import OrderedDict
import numpy as np
import re
from matplotlib import colors, cm
class InvalidColorError(Exception): pass
class SettingWidget(QtGui.QWidget):
value_changed = QtCore.pyqtSignal(object)
def __init__(self, val=None, parent=None, **kwargs):
... | gpl-3.0 |
wjwwood/catkin_tools | docs/conf.py | 8 | 8654 | # -*- coding: utf-8 -*-
#
# catkin_tools documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 24 18:03:21 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | apache-2.0 |
robbrockbank/calico-docker | calico_containers/tests/st/bgp/test_single_route_reflector.py | 12 | 3344 | # Copyright 2015 Metaswitch Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 |
salceson/PJN | lab3/correct.py | 1 | 2743 | # coding=utf-8
from heapq import nlargest
from operator import itemgetter
from time import time
from metric import levenshtein_metric
from utils import corpus_stats, error_stats, get_corrections, get_stopwords
__author__ = "Michał Ciołczyk"
CORPUS = [
"data/dramat.iso.utf8",
"data/popul.iso.utf8",
"data... | mit |
newswangerd/ansible | test/units/module_utils/urls/test_prepare_multipart.py | 19 | 3087 | # -*- coding: utf-8 -*-
# (c) 2020 Matt Martz <matt@sivel.net>
# 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
import os
from io import StringIO
from email.message import Message
impor... | gpl-3.0 |
mindbender-studio/core | avalon/tools/projectmanager/lib.py | 2 | 2009 | """Utility script for updating database with configuration files
Until assets are created entirely in the database, this script
provides a bridge between the file-based project inventory and configuration.
- Migrating an old project:
$ python -m avalon.inventory --extract --silo-parent=f02_prod
$ python -m av... | mit |
don-github/edx-platform | lms/djangoapps/shoppingcart/migrations/0025_update_invoice_models.py | 102 | 25309 | # -*- 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 'InvoiceTransaction'
db.create_table('shoppingcart_invoicetransaction', (
('id', ... | agpl-3.0 |
lnielsen/invenio | invenio/modules/scheduler/tasklets/bst_create_related_formats.py | 3 | 4040 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio 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) a... | gpl-2.0 |
Aravinthu/odoo | addons/crm/tests/test_crm_lead.py | 30 | 10323 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from .common import TestCrmCases
from odoo.modules.module import get_module_resource
class TestCRMLead(TestCrmCases):
def test_crm_lead_cancel(self):
# I set a new sales team giving access rights of salesm... | agpl-3.0 |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/pip/_vendor/webencodings/mklabels.py | 512 | 1305 | """
webencodings.mklabels
~~~~~~~~~~~~~~~~~~~~~
Regenarate the webencodings.labels module.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
import json
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
def asser... | gpl-3.0 |
plaidml/plaidml | networks/keras/examples/mnist_swwae.py | 1 | 7875 | '''Trains a stacked what-where autoencoder built on residual blocks on the
MNIST dataset. It exemplifies two influential methods that have been developed
in the past few years.
The first is the idea of properly 'unpooling.' During any max pool, the
exact location (the 'where') of the maximal value in a pooled recepti... | apache-2.0 |
kemalakyol48/python-for-android | python3-alpha/extra_modules/pyxmpp2/stanzaprocessor.py | 46 | 20266 | #
# (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
ntvis/tushare | tushare/datayes/IV.py | 10 | 3423 | # -*- coding:utf-8 -*-
"""
通联数据
Created on 2015/10/12
@author: Jimmy Liu
@group : waditu
@contact: jimmysoa@sina.cn
"""
from pandas.compat import StringIO
import pandas as pd
from tushare.util import vars as vs
from tushare.util.common import Client
from tushare.util import upass as up
class IV():
def __ini... | bsd-3-clause |
Sorsly/subtle | google-cloud-sdk/platform/gsutil/gslib/tests/test_rsync.py | 3 | 109169 | # -*- coding: utf-8 -*-
# Copyright 2014 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... | mit |
Scarygami/gae-gcs-push2deploy-secrets | lib/flask/flask/testsuite/helpers.py | 405 | 21973 | # -*- coding: utf-8 -*-
"""
flask.testsuite.helpers
~~~~~~~~~~~~~~~~~~~~~~~
Various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import flask
import unittest
from logging import StreamHandler
from flask.testsuite import FlaskTestCase,... | apache-2.0 |
vagonbar/GNUnetwork | gwn/blocks/libio/gnuradio/new/.grc_gnuradio/hier_tx_ch_rx.py | 1 | 7645 | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Hier Tx Ch Rx
# Generated: Sat Oct 4 09:50:38 2014
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import channels
from gnuradio impor... | gpl-3.0 |
DarkPhoenix6/My_Libraries | Python/Ciphers/WordPatterns.py | 1 | 1365 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import open
from builtins import str
from builtins import range
from builtins import object
from builtins import int
from builtins import bytes
from builtins... | gpl-3.0 |
Zord13appdesa/python-for-android | python3-alpha/python3-src/Lib/tkinter/dnd.py | 151 | 11488 | """Drag-and-drop support for Tkinter.
This is very preliminary. I currently only support dnd *within* one
application, between different windows (or within the same window).
I an trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc. I also hope that
this wi... | apache-2.0 |
XiaosongWei/chromium-crosswalk | tools/telemetry/catapult_base/refactor/snippet.py | 16 | 6718 | # Copyright 2015 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.
import parser
import symbol
import sys
import token
import tokenize
from catapult_base.refactor import offset_token
class Snippet(object):
"""A node in ... | bsd-3-clause |
saketkc/statsmodels | statsmodels/datasets/utils.py | 25 | 10983 | from statsmodels.compat.python import (range, StringIO, urlopen,
HTTPError, URLError, lrange,
cPickle, urljoin, BytesIO)
import sys
import shutil
from os import environ
from os import makedirs
from os.path import expanduser
from os.path impor... | bsd-3-clause |
arenadata/ambari | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/setup_ranger_hive_interactive.py | 4 | 4496 | #!/usr/bin/env python
"""
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");... | apache-2.0 |
ylow/SFrame | oss_src/unity/python/sframe/data_structures/sframe_builder.py | 5 | 6496 | """
An interface for creating an SFrame over time.
"""
'''
Copyright (C) 2016 Turi
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the TURI-PYTHON-LICENSE file for details.
'''
from ..connect import main as glconnect
from ..cython.cy_sframe_builder import Un... | bsd-3-clause |
krash86/android_kernel_google_pixel | scripts/rt-tester/rt-tester.py | 1106 | 5305 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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 Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
ForkedReposBak/mxnet | tests/python/tensorrt/test_cvnets.py | 2 | 6760 | # 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 |
varunnaganathan/django | tests/template_tests/filter_tests/test_truncatewords_html.py | 386 | 1607 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import truncatewords_html
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_truncate_zero(self):
self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>... | bsd-3-clause |
kamal-gade/rockstor-core | src/rockstor/system/users.py | 1 | 3226 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any la... | gpl-3.0 |
Samuel789/MediPi | MedManagementWeb/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | apache-2.0 |
wraiden/spacewalk | client/rhel/rhn-client-tools/test/rhnPackageInfo.py | 11 | 1708 | #!/usr/bin/python
import settestpath
import unittest
from up2date_client import rhnPackageInfo
class TestPprint_pkglist(unittest.TestCase):
def setUp(self):
self.pkgList1 = [["foo", "1.0", "1", "", "i386", "234234234", "some-channel"],
["bar", "2.0", "2", "9", "i686", "34234234... | gpl-2.0 |
KaiWeiChang/vowpal_wabbit | setup.py | 18 | 2188 | import os
import shutil
import subprocess
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
from distutils.command.clean import clean as _clean
VERSION = None
with open("configure.ac") as f:
for line in f:
line = line.strip()
if 'AC_INIT(' in l... | bsd-3-clause |
bopjesvla/BCI | BIOFEEDBACK/FieldTripPy3.py | 1 | 22012 | """
FieldTrip buffer (V1) client in pure Python
(C) 2010 S. Klanke
"""
# We need socket, struct, and numpy
import socket
import struct
VERSION = 1
PUT_HDR = 0x101
PUT_DAT = 0x102
PUT_EVT = 0x103
PUT_OK = 0x104
PUT_ERR = 0x105
GET_HDR = 0x201
GET_DAT = 0x202
GET_EVT = 0x203
GET_OK = 0x204
GET_ERR = 0x205
FLUSH_HDR... | gpl-3.0 |
ampersand8/pulp_manager | pulp_manager/settings.py | 2 | 2954 | """
Django settings for pulp_manager project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build... | apache-2.0 |
mwbond/utdf | src/utdf/definition.py | 1 | 6962 | TABLES = {'Network': [['f_name', 'TEXT'],
['scenariodate', 'TEXT'],
['stopthresholdspeed', 'TEXT'],
['growth', 'TEXT'],
['defwidth', 'TEXT'],
['pedspeed', 'TEXT'],
['phf', 'TEXT'],
... | isc |
thaim/ansible | lib/ansible/modules/system/xfconf.py | 26 | 7103 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Joseph Benden <joe@benden.us>
#
# 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',
... | mit |
Xavierwei/porsche_lemans | web/api/performance/run.py | 2 | 4350 | #!/usr/bin/env python
#
# Copyright (c) 2007-2009 Corey Goldberg (corey@goldb.org)
# License: GNU GPLv3
#
# This file is part of Pylot.
#
# 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 F... | mit |
CFDEMproject/LPP | src/animate.py | 5 | 6497 | # Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html
# Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
#
# Copyright (2005) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
# certain rights in this software. This software is... | gpl-2.0 |
robertgraleigh/supreme-journey | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
treverhines/PyGeoNS | pygeons/clean/clean.py | 1 | 4945 | '''
Defines cleaning functions which are called by the PyGeoNS executable.
'''
from __future__ import division
import numpy as np
import logging
import matplotlib.pyplot as plt
from pygeons.io.convert import dict_from_hdf5,hdf5_from_dict
from pygeons.mjd import mjd,mjd_inv
from pygeons.basemap import make_basemap
from... | mit |
RPGOne/Skynet | scikit-learn-0.18.1/sklearn/tests/test_discriminant_analysis.py | 7 | 13097 | import sys
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing im... | bsd-3-clause |
foxish/test-infra | triage/berghelroach.py | 7 | 16198 | # Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
MakeHer/edx-platform | openedx/core/djangoapps/credit/tasks.py | 60 | 7836 | """
This file contains celery tasks for credit course views.
"""
from celery import task
from celery.utils.log import get_task_logger
from django.conf import settings
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
from openedx.core.djangoapps.credit.api import set_credit_... | agpl-3.0 |
kambysese/mne-python | mne/inverse_sparse/mxne_inverse.py | 6 | 26013 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Daniel Strohmeier <daniel.strohmeier@gmail.com>
#
# License: Simplified BSD
import numpy as np
from ..source_estimate import SourceEstimate, _BaseSourceEstimate, _make_stc
from ..minimum_norm.inverse import (combine_xyz, _prepare_forward,
... | bsd-3-clause |
shawncaojob/LC | LINTCODE/60_search_insert_position.py | 1 | 2418 | # 60. Search Insert Position
# Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
#
# You may assume NO duplicates in the array.
#
# Have you met this question in a real interview? Yes
# Example
# [1,3,5,6], 5 → 2... | gpl-3.0 |
darKoram/torpedo | demos/facebook/facebook.py | 1 | 4588 | #!/usr/bin/env python
#
# Copyright 2009 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... | mit |
robk5uj/invenio | modules/websearch/lib/websearchadminlib.py | 1 | 163719 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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... | gpl-2.0 |
Reddcraft/reddblockd | lib/events.py | 4 | 8758 | import os
import re
import logging
import datetime
import time
import copy
import decimal
import json
import urllib
import StringIO
import pymongo
import gevent
from PIL import Image
from lib import config, util, blockchain
from lib.components import assets, assets_trading, betting
D = decimal.Decimal
COMPILE_MARKET... | mit |
SamYaple/neutron | neutron/tests/unit/tests/test_post_mortem_debug.py | 30 | 4032 | # Copyright 2013 Red Hat, 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 by applicable law... | apache-2.0 |
pilou-/ansible | lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py | 25 | 9312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Darren Worrall <darren@iweb.co.uk>
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'sta... | gpl-3.0 |
nicholasserra/sentry | src/sentry/migrations/0117_auto__add_rule.py | 36 | 22953 | # -*- 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 'Rule'
db.create_table('sentry_rule', (
('id', self.gf('sentry.db.models.fields.b... | bsd-3-clause |
mgit-at/ansible | lib/ansible/modules/cloud/amazon/ecs_service_facts.py | 43 | 8729 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
apporc/nova | nova/tests/functional/api_sample_tests/test_hide_server_addresses.py | 32 | 1928 | # 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 |
butala/pyrsss | pyrsss/mag/intermagnet_level0.py | 1 | 9246 | from __future__ import division
from datetime import datetime
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import sys
import logging
import os
import math
import numpy as NP
from netCDF4 import Dataset, date2num
from repository import get_root, TEMPLATE_MAP, PATH_MAP
from iaga2002 import parse
... | mit |
Garrett-R/scikit-learn | examples/applications/face_recognition.py | 42 | 5390 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... | bsd-3-clause |
sbuss/TigerShark | web/claims_837/models.py | 2 | 111142 | #!/usr/bin/env python
"""Generated by make837.py on 2008-02-12 14:41:11.161000"""
import web.claims.models
class Factory( web.claims.models.Factory ):
"""Factory for a generated application."""
@staticmethod
def makeSegment( segmentToken, compositeSep, segmentType=None ):
"""Create a Segmen... | bsd-3-clause |
ocaisa/easybuild-framework | easybuild/toolchains/cgoolf.py | 5 | 1734 | ##
# Copyright 2013-2015 Ghent University
#
# This file is triple-licensed under GPLv2 (see below), MIT, and
# BSD three-clause licenses.
#
# 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... | gpl-2.0 |
onshape-public/onshape-clients | python/onshape_client/oas/models/bt_revision_approver_info.py | 1 | 4841 | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | mit |
edxzw/edx-platform | common/test/data/capa/prog2.py | 270 | 109956 | # prog2
# Make this file long, since that seems to affect how uploaded files are
# handled in webob or cgi.FieldStorage.
moby_dick_ten_chapters = """
CHAPTER 1. Loomings.
Call me Ishmael. Some years ago--never mind how long precisely--having
little or no money in my purse, and nothing particular to interest me on
s... | agpl-3.0 |
zstackorg/zstack-woodpecker | integrationtest/vm/simulator/ha/test_change_ha_global_config.py | 2 | 4295 | '''
New Test For set HA global config test
@author: Quarkonics
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.operations.volume_operation... | apache-2.0 |
dneg/cortex | test/IECore/ImageSequenceCompositeOpTest.py | 12 | 3495 | ##########################################################################
#
# Copyright (c) 2008-2009, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
RadioFreeAsia/RDacity | lib-src/lv2/lv2/waflib/Tools/python.py | 177 | 13335 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib import Utils,Options,Errors,Logs
from waflib.TaskGen import extension,before_method,after_method,feature
from waflib.Configure import conf
FRAG='''
#... | gpl-2.0 |
broadinstitute/PyGithub | github/tests/Hook.py | 39 | 3790 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
Bogh/django-oscar | src/oscar/apps/analytics/abstract_models.py | 15 | 3578 | from decimal import Decimal
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from oscar.core.compat import AUTH_USER_MODEL
@python_2_unicode_compatible
class AbstractProductRecord(models.Model):
"""
A record of... | bsd-3-clause |
stuart-knock/bokeh | examples/glyphs/line.py | 43 | 1120 | from __future__ import print_function
from numpy import pi, sin, cos
import numpy as np
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Line
from bokeh.models import (
Plot, DataRange1d, LinearAxis, ColumnDataSource,
PanTo... | bsd-3-clause |
maas/maas | src/maasserver/utils/interfaces.py | 1 | 1783 | # Copyright 2014-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Utilities related to network and cluster interfaces."""
__all__ = [
"get_name_and_vlan_from_cluster_interface",
"make_name_from_interface",
]
from random import r... | agpl-3.0 |
ArcherSys/ArcherSys | Lib/test/test_future.py | 1 | 12575 | <<<<<<< HEAD
<<<<<<< HEAD
# Test various flavors of legal and illegal future statements
import unittest
from test import support
import re
rx = re.compile('\((\S+).py, line (\d+)')
def get_error_location(msg):
mo = rx.search(str(msg))
return mo.group(1, 2)
class FutureTest(unittest.TestCase):
def test_... | mit |
abessifi/pyatta | vyos_session/utils.py | 1 | 2974 | import ConfigParser
import subprocess
import os
import logging
# In production environment CONFIG_DIR should be /etc/pyatta/
CONFIG_DIR = "/home/vyos/vyos-api/project"
CONFIG_FILE_NAME = "pyatta.conf"
AVAILABLE_LOG_LEVELS = ['DEBUG','INFO','WARN','ERROR','CRITICAL']
DEFAULT_LOG_LEVEL = 'INFO'
logger = logging.getLogg... | gpl-3.0 |
timokoola/finnkinotxt | docutils/utils/__init__.py | 113 | 27412 | # coding: utf-8
# $Id: __init__.py 7668 2013-06-04 12:46:30Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Miscellaneous utilities for the documentation utilities.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import os.path
impo... | apache-2.0 |
Smerity/keras | examples/kaggle_otto_nn.py | 7 | 3642 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import pandas as pd
np.random.seed(1337) # for reproducibility
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.normalization import BatchNormalization
from ke... | mit |
disqus/django-old | django/contrib/formtools/tests/__init__.py | 78 | 16958 | import os
import re
import warnings
from django import http
from django.conf import settings
from django.contrib.formtools import preview, utils
from django.contrib.formtools.wizard import FormWizard
from django.test import TestCase
from django.test.utils import get_warnings_state, restore_warnings_state
from django.u... | bsd-3-clause |
midma101/AndIWasJustGoingToBed | .venv/lib/python2.7/site-packages/selenium/webdriver/support/expected_conditions.py | 39 | 9607 | #
# Copyright 2012 WebDriver committers
# Copyright 2012 Software Freedom Conservancy.
#
# 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
#
# ... | mit |
utzig/mcuboot | scripts/imgtool/version.py | 6 | 1773 | # Copyright 2017 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.