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 |
|---|---|---|---|---|---|
zhukaixy/kbengine | kbe/res/scripts/common/Lib/distutils/tests/test_build_ext.py | 71 | 18085 | import sys
import os
from io import StringIO
import textwrap
from distutils.core import Distribution
from distutils.command.build_ext import build_ext
from distutils import sysconfig
from distutils.tests.support import (TempdirManager, LoggingSilencer,
copy_xxmodule_c, fixup_build_... | lgpl-3.0 |
AMICI-developer/AMICI | tests/generateTestConfig/example_calvetti.py | 3 | 1029 | #!/usr/bin/env python3
import sys
import numpy as np
from example import AmiciExample
class ExampleCalvetti(AmiciExample):
def __init__(self):
AmiciExample.__init__( self )
self.numX = 6
self.numP = 0
self.numK = 6
self.modelOptions['theta'] = []
self.modelOption... | bsd-2-clause |
m000/cliutils | dotfiles/j2_tests.py | 1 | 1327 | # -*- coding: utf-8 -*-
import os
assert sys.version_info >= (2,5), "Need at least Python 2.5."
if sys.version_info < (3,0):
from shutilwhich import which
else:
from shutil import which
### Tests ###########################################################
def exists(p):
''' Returns true if path p exists.
... | mit |
varunkamra/kuma | vendor/packages/pygments/formatters/img.py | 78 | 18002 | # -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Formatter
from pygments.util import ge... | mpl-2.0 |
xulesc/algos | knn/scripts/exp3.py | 1 | 6922 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 23 12:12:31 2014
@author: anuj
"""
print(__doc__)
from time import time
import numpy as np
import pylab as pl
from sklearn import metrics
from sklearn.cluster import KMeans
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.prep... | gpl-3.0 |
w3nd1go/android_external_skia | tools/skp/page_sets/skia_theverge_desktop.py | 26 | 1224 | # Copyright 2014 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.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | bsd-3-clause |
bewest/openxshareble | openxshareble/app.py | 1 | 5980 |
import Adafruit_BluefruitLE
from Adafruit_BluefruitLE.services import UART as OriginalUART
# from ble import uart
from ble.uart import UART
from ble.readdata import Device
import time
import atexit
import logging
log = logging.getLogger(__name__)
class App (object):
""" A high level application object.
Any appli... | mit |
imankulov/sentry | src/sentry/rules/base.py | 15 | 3204 | """
sentry.rules.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
Rules apply either before an event gets stored, or immediately after.
Basic actions:
- I want to get notified when [X]
- I want to group events when [X]
- ... | bsd-3-clause |
will-cromar/needy | ProofOfConcept/toyNetwork.py | 1 | 1982 | class Neuron:
'Represents a neuron'
currentVal = 0
threshold = 1
connections = []
identity = 0
def displayVal(self):
print(self.identity,":",self.currentVal)
for c in self.connections:
print(self.identity," connected to ",c.end.identity)
def addSynapse(self,desti... | mit |
mantidproject/mantid | Framework/PythonInterface/test/python/plugins/functions/PrimStretchedExpFTTest.py | 3 | 1898 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
aduric/crossfit | nonrel/django/contrib/gis/gdal/tests/test_envelope.py | 332 | 3742 | from django.contrib.gis.gdal import Envelope, OGRException
from django.utils import unittest
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
... | bsd-3-clause |
Drooids/odoo | addons/mail/tests/test_mail_features.py | 172 | 59265 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
ofanoyi/sumatrapdf | scripts/gen_settings_html.py | 1 | 9699 | #!/usr/bin/env python
import os, util2, gen_settingsstructs, trans_langs
"""
TODO:
* for gen_langs_html, show languages that don't have enough translations
in a separate table
"""
g_version = util2.get_sumatrapdf_version()
html_tmpl = """\
<!doctype html>
<html>
<head>
<meta http-equiv="Conten... | gpl-3.0 |
CodeScaleInc/log4django | log4django/templatetags/log4django.py | 1 | 1853 | import json
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from django.utils.text import normalize_newlines
from ..models import LogRecord
from ..settings import EXTRA_DATA_INDENT, PAGINATOR_RANGE
register = template.Library()
@reg... | bsd-3-clause |
youdonghai/intellij-community | python/lib/Lib/site-packages/django/test/testcases.py | 71 | 24716 | import re
import sys
from urlparse import urlsplit, urlunsplit
from xml.dom.minidom import parseString, Node
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import clear_url_caches
from django.db import transaction, connection,... | apache-2.0 |
rnehra01/tanner | tanner/reporting/log_mongodb.py | 1 | 1148 | import json
try:
import pymongo
MONGO = True
except ImportError:
MONGO = False
from bson.objectid import ObjectId
from gridfs import GridFS
from tanner import config
class Reporting():
def __init__(self):
if MONGO:
# Create the connection
mongo_uri = config.TannerConfi... | gpl-3.0 |
dewtx29/python_ann | project/cg/opengl/cos4102/rectMoveTheta.py | 1 | 2744 | from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
window = 0
width, height = 500, 400
theta = [0.0]
sign = [1.0]
xMin = [-10.0]
xMax = [10.0]
yMin = [-10.0]
yMax= [10.0]
def initialization():
glClearColor(0.0,0.0,0.0,0.0)
glMatrixMode(GL_... | gpl-3.0 |
otherness-space/myProject | my_project_001/lib/python2.7/site-packages/django/db/models/fields/__init__.py | 13 | 47949 | from __future__ import unicode_literals
import copy
import datetime
import decimal
import math
import warnings
from itertools import tee
from django.db import connection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
from django import forms
from django.core import exceptions, ... | mit |
zaabjuda/django-vkontakte-groups-statistic | vkontakte_groups_statistic/migrations/0003_auto__add_field_groupstat_traffic_search_systems__add_field_groupstat_.py | 1 | 27133 | # -*- 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 field 'GroupStat.traffic_search_systems'
db.add_column('vkontakte_groups_groupstat', 'traffic_searc... | bsd-3-clause |
ice9js/servo | tests/wpt/css-tests/css-fonts-3_dev/html/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
tusharmakkar08/Diamond | src/diamond/handler/mysql.py | 3 | 2933 | # coding=utf-8
"""
Insert the collected values into a mysql table
"""
from Handler import Handler
import MySQLdb
class MySQLHandler(Handler):
"""
Implements the abstract Handler class, sending data to a mysql table
"""
conn = None
def __init__(self, config=None):
"""
Create a ne... | mit |
timpalpant/calibre | src/calibre/gui2/actions/show_quickview.py | 14 | 3875 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import QAction
from calibre.gui2.actions import InterfaceAction
from calibre.gui2.dialogs.quickview import... | gpl-3.0 |
amyvmiwei/kbengine | kbe/src/lib/python/Lib/test/test_decorators.py | 182 | 9828 | import unittest
from test import support
def funcattrs(**kwds):
def decorate(func):
func.__dict__.update(kwds)
return func
return decorate
class MiscDecorators (object):
@staticmethod
def author(name):
def decorate(func):
func.__dict__['author'] = name
r... | lgpl-3.0 |
trdean/grEME | grc/python/expr_utils.py | 7 | 5486 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
cryptobanana/ansible | lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py | 22 | 24179 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
vipulroxx/sympy | sympy/liealgebras/type_e.py | 4 | 9860 | from sympy.core import Rational
from sympy.core.compatibility import range
from .cartan_type import Standard_Cartan
from sympy.matrices import eye
class TypeE(Standard_Cartan):
def __new__(cls, n):
if n < 6 or n > 8:
raise ValueError("Invalid value of n")
return Standard_Cartan.__new_... | bsd-3-clause |
TinyOS-Camp/DDEA-DEV | Archive/[14_10_11] Dr_Jung_Update/shared_constants.py | 1 | 3460 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 14 02:04:12 2014
@author: deokwoo
* Description
- This file defines constant values shared among python modules.
- Should be included all python modules first.
"""
###############################################################################
# Constant global variab... | gpl-2.0 |
Denisolt/IEEE-NYIT-MA | local/lib/python2.7/site-packages/django/db/models/sql/aggregates.py | 77 | 4846 | """
Classes to represent the default SQL aggregate functions
"""
import copy
import warnings
from django.db.models.fields import FloatField, IntegerField
from django.db.models.query_utils import RegisterLookupMixin
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cache... | gpl-3.0 |
TRESCLOUD/odoo | openerp/addons/base/ir/ir_ui_menu.py | 58 | 17374 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can ... | agpl-3.0 |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/offline_user_data_job_service/transports/grpc.py | 1 | 16240 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
aurarad/auroracoin | test/functional/feature_dersig.py | 1 | 6371 | #!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP66 (DER SIG).
Test that the DERSIG soft... | mit |
bbangert/velruse | velruse/providers/yahoo.py | 3 | 3776 | from __future__ import absolute_import
from openid.extensions import ax
import requests
from requests_oauthlib import OAuth1
from pyramid.security import NO_PERMISSION_REQUIRED
from ..api import register_provider
from ..compat import parse_qsl
from .oid_extensions import OAuthRequest
from .openid import (
Open... | mit |
tow/dnspython | dns/namedict.py | 99 | 2106 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | isc |
ninuxorg/netengine | netengine/backends/ssh/airos.py | 1 | 5763 | from cached_property import cached_property
from netengine.backends.ssh import SSH
__all__ = ['AirOS']
class AirOS(SSH):
"""
Ubiquiti AirOS SSH backend
Version 5.5.8
"""
def __str__(self):
""" print a human readable object description """
return u"<SSH (Ubiquity AirOS): %s@%s>"... | mit |
jiumx60rus/grishyGhost | node_modules/nodegit/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 388 | 47235 | # Copyright (c) 2012 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
alexston/calibre-webserver | src/odf/meta.py | 98 | 2136 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | gpl-3.0 |
ecederstrand/django | tests/template_tests/syntax_tests/test_if.py | 73 | 23743 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import TestObj, setup
class IfTagTests(SimpleTestCase):
@setup({'if-tag01': '{% if foo %}yes{% else %}no{% endif %}'})
def test_if_tag01(self):
output = self.engine.render_to_string('if-tag01', {'foo'... | bsd-3-clause |
RenqinCai/python_dataset | LR/shuffle_v8.py | 2 | 13109 | ###new function:shuffling the reviewing time and debug the program
###R is set to a constant value
import simplejson as json
import datetime
import time
import numpy as np
import math
from multiprocessing import Pool
from multiprocessing.dummy import Pool as ThreadPool
from dateutil.relativedelta import *
from sklearn... | gpl-2.0 |
kohnle-lernmodule/exeLearningPlus1_04 | twisted/internet/posixbase.py | 14 | 15431 | # -*- test-case-name: twisted.test.test_internet -*-
# $Id: default.py,v 1.90 2004/01/06 22:35:22 warner Exp $
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Posix reactor base class
API Stability: stable
Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>}
"""
... | gpl-2.0 |
adazey/Muzez | libs/youtube_dl/extractor/cracked.py | 170 | 3213 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
str_to_int,
)
class CrackedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cracked\.com/video_(?P<id>\d+)_[\da-z-]+\.html'
_TESTS = [{
'url': 'http://www.cracked.com/... | gpl-3.0 |
aadebuger/docker-apprtc | src/third_party/oauth2client/anyjson.py | 302 | 1044 | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | bsd-3-clause |
Fedik/gramps | gramps/gen/filters/rules/repository/_hasreferencecountof.py | 5 | 1737 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 Stephane Charette
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your optio... | gpl-2.0 |
gtko/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/brightcove.py | 4 | 10498 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
find_xpath_attr,
fix_xml_ampersands,
compat_urlparse,
compat_str,
compat_urllib_request,
compat_parse_qs... | gpl-3.0 |
ilyashrn/ilyashrn.github.io | node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/dotnet.py | 197 | 26727 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ... | mit |
ZubairLK/CI20_linux | tools/perf/scripts/python/sched-migration.py | 1910 | 11965 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
flumotion-mirror/flumotion | flumotion/test/test_flavors.py | 3 | 15234 | # -*- Mode: Python; test-case-name: flumotion.test.test_flavors -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified un... | lgpl-2.1 |
narurien/ganeti-ceph | lib/__init__.py | 8 | 1196 | #
#
# Copyright (C) 2006, 2007, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is ... | gpl-2.0 |
herilalaina/scikit-learn | sklearn/learning_curve.py | 27 | 15421 | """Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | bsd-3-clause |
mateusz-holenko/gf | utils.py | 1 | 1321 | #!/usr/bin/python3
import codecs
##########################################################################################################
# #
# Based on: ... | mit |
f-enye/Lister | Lister/forms.py | 1 | 1160 | from flask.ext.wtf import Form
from wtforms import TextField, PasswordField, BooleanField, IntegerField
from wtforms.validators import Required, Email, EqualTo
class LoginForm(Form):
user_name = TextField('user_name', validators = [Required(), Email(message=u'Invalid email address')])
#Not an encrypted password
pas... | mit |
akosthekiss/fuzzinator | tests/resources/mock_tool.py | 2 | 1955 | #!/usr/bin/env python3
# Copyright (c) 2016 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import argparse
import os
import signal
import ... | bsd-3-clause |
lgscofield/odoo | addons/l10n_bo/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
oesteban/tract_querier | tract_querier/tractography/trackvis.py | 1 | 3309 | from itertools import izip
from warnings import warn
import numpy
from tractography import Tractography
from nibabel import trackvis
def tractography_to_trackvis_file(filename, tractography, affine=None, image_dimensions=None):
trk_header = trackvis.empty_header()
if affine is not None:
pass
e... | bsd-3-clause |
gangadharkadam/verveerp | erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py | 6 | 1220 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, ... | agpl-3.0 |
crdx/face | module.py | 1 | 2271 | import traceback
import imp
class Module():
def __init__(self, module_filename):
# the filename e.g. mod_list.py
self.filename = module_filename
# the filename without extension
self.name = module_filename[:-3]
# start marked as unloaded, so this will hold true if anything... | mit |
kuangtu/OpenMAMA | mama/c_cpp/src/regression/c_cpp/scripts/regression.py | 11 | 1631 | #!/usr/bin/python
import unittest
import optparse
from common import check_env
from regressionc import TestOpenmamac
from regressioncpp import TestOpenmamacpp
import globals
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option("--tport", dest="transport",nargs=2,help='Name of pub and... | lgpl-2.1 |
sio2project/sioworkers | sio/workers/util.py | 1 | 8159 | from __future__ import absolute_import
from contextlib import contextmanager
import pkg_resources
import time
import logging
import stat
import os
import json
import tempfile
import shutil
import threading
import six
logger = logging.getLogger(__name__)
def first_entry_point(group, name=None):
for ep in pkg_reso... | gpl-3.0 |
guorendong/iridium-browser-ubuntu | tools/perf/page_sets/mse_cases.py | 11 | 2033 | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class MseCasesPage(page_module.Page):
def __init__(... | bsd-3-clause |
quom/google-cloud-python | speech/unit_tests/test_operation.py | 3 | 4075 | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
andrewjrobinson/FreeCAD_sf_master | src/Mod/Web/Init.py | 3 | 2471 | # FreeCAD init script of the Web module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This f... | lgpl-2.1 |
wcybxzj/django_xadmin17 | demo_app/polls/models.py | 1 | 1814 | import datetime
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self): # __unicode__ on Pytho... | bsd-3-clause |
redhat-openstack/manila | manila/api/auth.py | 4 | 1414 | # Copyright (c) 2013 OpenStack, LLC.
#
# 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 req... | apache-2.0 |
joone/chromium-crosswalk | tools/metrics/histograms/print_style.py | 25 | 1809 | # Copyright 2014 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.
"""Holds the constants for pretty printing histograms.xml."""
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))... | bsd-3-clause |
citrix-openstack-build/nova | nova/api/openstack/compute/contrib/volumes.py | 11 | 24507 | # Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
aetilley/scikit-learn | sklearn/datasets/samples_generator.py | 45 | 56433 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import warnings
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing impo... | bsd-3-clause |
timsnyder/bokeh | tests/integration/tools/test_poly_draw_tool.py | 5 | 9020 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
selpp/TidmarshCWD | src/web/website/settings.py | 1 | 3708 | """
Django settings for website project.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... | gpl-3.0 |
leilihh/nova | nova/db/sqlalchemy/migrate_repo/versions/228_add_metrics_in_compute_nodes.py | 47 | 1583 | # Copyright 2013 Intel Corporation
#
# 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 ... | apache-2.0 |
addgene/research | toolkit/utils.py | 1 | 1283 | import argparse
import logging
import os
import sys
from Bio import SeqIO
from setuptools import glob
L = logging.getLogger(__name__)
def read_fastq_file(file_name):
# type: (str) -> List[str]
reads = []
with open(file_name, "rU") as handle:
for record in SeqIO.parse(handle, "fastq"):
... | gpl-3.0 |
tom31203120/POSTMan-Chrome-Extension | tests/selenium/pmtests/postman_tests_layout.py | 104 | 1075 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import inspect
... | apache-2.0 |
jmetzen/scikit-learn | examples/linear_model/plot_logistic.py | 312 | 1426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... | bsd-3-clause |
hoxmark/TDT4501-Specialization-Project | vse/data.py | 1 | 13775 | import torch
import torch.utils.data as data
import torchvision.transforms as transforms
import os
import nltk
from PIL import Image
# from pycocotools.coco import COCO
import numpy as np
import json as jsonmod
def get_paths(path, name='coco', use_restval=False):
"""
Returns paths to images and annotations fo... | mit |
olivierdalang/stdm | data/importexport/writer.py | 1 | 5017 | #begin: 26th March 2012
#copyright: (c) 2012 by John Gitau
#email: gkahiu@gmail.com
#about: Wrapper class for writing PostgreSQL/PostGIS tables to user-defined OGR formats
import sys, logging
from PyQt4.QtCore import *
from PyQt4.QtGui import *
try:
from osgeo i... | gpl-2.0 |
docprofsky/gr-rds | python/rdspanel.py | 2 | 7742 | # -*- coding: UTF-8 -*-
import wx
import pmt
from gnuradio import gr, blocks
wxDATA_EVENT = wx.NewEventType()
def EVT_DATA_EVENT(win, func):
win.Connect(-1, -1, wxDATA_EVENT, func)
class DataEvent(wx.PyEvent):
def __init__(self, data):
wx.PyEvent.__init__(self)
self.SetEventType (wxDATA_EVENT)
self.data = da... | gpl-2.0 |
terasaur/seedbank | src/seedbank/cli/create_command.py | 1 | 3141 | #
# Copyright 2012 ibiblio
#
# 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.txt
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
museumvictoria/nodel-recipes | Group/script.py | 2 | 14096 | '''A node that groups members for control propagation and status monitoring - see script.py for notes'''
# For disappearing member support:
# (see readme, requires at least Nodel Host rev. 322 or later)
#
# - remote "Disappearing" signals should be wired to the actual signals
# - the usual remote signals shou... | mit |
NoahFlowa/glowing-spoon | venv/lib/python2.7/site-packages/pip/commands/hash.py | 514 | 1597 | from __future__ import absolute_import
import hashlib
import logging
import sys
from pip.basecommand import Command
from pip.status_codes import ERROR
from pip.utils import read_chunks
from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES
logger = logging.getLogger(__name__)
class HashCommand(Command):
""... | apache-2.0 |
colloquium/spacewalk | client/tools/rhncfg/config_management/rhncfg-manager.py | 1 | 1362 | #!/usr/bin/python
#
# Copyright (c) 2008 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have ... | gpl-2.0 |
rpspringuel/cluster | stats.py | 1 | 24321 | """Cluster _support which are method independant.
Routines which calculate _support for data and clustering results.
_support in this package do not care what the particluar clustering
methodology is.
A complete version history and licence and copyright information are located
in the source code.
"""
import numpy
fr... | bsd-3-clause |
googleapis/python-dialogflow | google/cloud/dialogflow_v2beta1/types/document.py | 1 | 16280 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
emonty/ansible | test/units/playbook/test_playbook.py | 58 | 2089 | # (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 |
home-assistant/home-assistant | homeassistant/components/shelly/logbook.py | 8 | 1069 | """Describe Shelly logbook events."""
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import callback
from .const import (
ATTR_CHANNEL,
ATTR_CLICK_TYPE,
ATTR_DEVICE,
DOMAIN,
EVENT_SHELLY_CLICK,
)
from .utils import get_device_name, get_device_wrapper
@callback
def async_d... | apache-2.0 |
alexsmx/djangoAppengineSrcTemplate | django/contrib/messages/storage/session.py | 456 | 1213 | from django.contrib.messages.storage.base import BaseStorage
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session_key = '_messages'
def __init__(self, request, *args, **kwargs):
assert hasattr(request, 'session'), "The sessi... | bsd-3-clause |
onecloud/neutron | neutron/plugins/ml2/db.py | 13 | 5143 | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | apache-2.0 |
i-DAT-Qualia/Qualia-AC | qualia/tools/api.py | 3 | 1406 | from tastypie.serializers import Serializer
from tastypie.authentication import Authentication
from tastypie.http import HttpUnauthorized
from django.utils.timezone import is_naive
class ISOSerializer(Serializer):
"""
Our own serializer to format datetimes in ISO 8601 but with timezone
offset.
"""
... | gpl-3.0 |
andreaso/ansible | lib/ansible/utils/module_docs_fragments/aws.py | 135 | 3168 | # (c) 2014, Will Thames <will@thames.id.au>
#
# 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 |
tenvick/hugula | Client/tools/site-packages/PIL/BufrStubImagePlugin.py | 14 | 1548 | #
# The Python Imaging Library
# $Id: BufrStubImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $
#
# BUFR stub adapter
#
# Copyright (c) 1996-2003 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
import Image, ImageFile
_handler = None
##
# Install application-specific BUFR ima... | mit |
ray-zhong/github_trend_spider | ENV/Lib/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... | mit |
mulkieran/justbytes | src/justbytes/_constants.py | 1 | 4224 | # Copyright (C) 2015 - 2019 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library is distributed in t... | gpl-2.0 |
akaminsky/ghost_blog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_lassobuiltins.py | 293 | 130675 | # -*- coding: utf-8 -*-
"""
pygments.lexers._lassobuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Built-in Lasso types, traits, methods, and members.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
BUILTINS = {
'Types': [
'null',
... | mit |
sbuss/voteswap | lib/django/templatetags/l10n.py | 337 | 1735 | from django.template import Library, Node, TemplateSyntaxError
from django.utils import formats
from django.utils.encoding import force_text
register = Library()
@register.filter(is_safe=False)
def localize(value):
"""
Forces a value to be rendered as a localized value,
regardless of the value of ``setti... | mit |
PyBorg/PyBorg | pyborg-msnp.py | 3 | 4812 | #! /usr/bin/env python
#
# PyBorg MSN module
#
# Copyright (c) 2006 Sebastien Dailly
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) an... | gpl-2.0 |
zhangxiaolins/python_base | tests/test_notifier.py | 2 | 12210 | # Copyright 2011 OpenStack Foundation.
# 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 req... | apache-2.0 |
molobrakos/home-assistant | homeassistant/components/zwave/cover.py | 8 | 6283 | """Support for Z-Wave covers."""
import logging
from homeassistant.core import callback
from homeassistant.components.cover import (
DOMAIN, SUPPORT_OPEN, SUPPORT_CLOSE, ATTR_POSITION)
from homeassistant.components.cover import CoverDevice
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .... | apache-2.0 |
ThinkingBridge/platform_external_chromium_org | media/tools/bug_hunter/bug_hunter_unittest.py | 47 | 6473 | # Copyright (c) 2012 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.
"""Unit Tests for bug hunter."""
import logging
from optparse import Values
import smtplib
import sys
import unittest
from bug_hunter import BugHunter
... | bsd-3-clause |
wanghongjuan/crosswalk-test-suite | webapi/webapi-iap-xwalk-tests/inst.apk.py | 1996 | 3186 | #!/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 |
filterfoundry/django-mailer | django_mailer/management/commands/retry_deferred.py | 31 | 1131 | from django.core.management.base import NoArgsCommand
from django_mailer import models
from django_mailer.management.commands import create_handler
from optparse import make_option
import logging
class Command(NoArgsCommand):
help = 'Place deferred messages back in the queue.'
option_list = NoArgsCommand.opti... | mit |
Reagankm/KnockKnock | venv/lib/python3.4/site-packages/mpl_toolkits/mplot3d/art3d.py | 8 | 23462 | #!/usr/bin/python
# art3d.py, original mplot3d version by John Porter
# Parts rewritten by Reinier Heeres <reinier@heeres.eu>
# Minor additions by Ben Axelrod <baxelrod@coroware.com>
'''
Module containing 3D artist code and functions to convert 2D
artists into 3D versions which can be added to an Axes3D.
'''
from __fu... | gpl-2.0 |
flotre/Sick-Beard | sickbeard/providers/xthor.py | 8 | 9852 | # -*- coding: latin-1 -*-
# Author: Raver2046 <raver2046@gmail.com>
# based on tpi.py
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 S... | gpl-3.0 |
mgedmin/cloneall | ghcloneall.py | 1 | 36053 | #!/usr/bin/python3
"""
Clone all Git repositories for a GitHub user or organisation.
"""
from __future__ import print_function
import argparse
import fnmatch
import os
import subprocess
import sys
import threading
from concurrent import futures
from operator import attrgetter
try:
# Python 2
from ConfigPars... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.