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 |
|---|---|---|---|---|---|
uselessfire/altaire | libs/xmpp/commands.py | 2 | 14199 | ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $
## Ad-Hoc Command manager
## Mike Albon (c) 5th January 2005
## 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 versio... | apache-2.0 |
egbertbouman/tribler-g | Tribler/Main/Build/Win32/setuptribler.py | 1 | 1721 | # Written by ABC authors and Arno Bakker
# see LICENSE.txt for license information
import sys
import os
try:
import py2exe.mf as modulefinder
import win32com
for p in win32com.__path__[1:]:
modulefinder.AddPackagePath("win32com", p)
for extra in ["win32com.shell"]:
__import__... | lgpl-2.1 |
BenMotz/cubetoolkit | toolkit/diary/templatetags/noprefix_url.py | 1 | 1089 | import logging
import urllib
from django import template
from django.template.defaulttags import url, URLNode
from django.urls import get_script_prefix
register = template.Library()
logger = logging.getLogger(__name__)
class NoPrefixURLNode(URLNode):
def __init__(self, url_node):
super(NoPrefixURLNode, ... | agpl-3.0 |
mozilla/captain | vendor/lib/python/django/core/servers/fastcgi.py | 241 | 6638 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... | mpl-2.0 |
rileymcdowell/genomic-neuralnet | genomic_neuralnet/methods/generic_keras_net.py | 1 | 6998 | from __future__ import print_function
import os
import time
import json
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Lambda
from keras.optimizers import Nadam as Trainer
#from keras.optimizers import Adam as Trainer
from keras.regularizers import WeightRe... | mit |
eliksir/mailmojo-python-sdk | mailmojo_sdk/models/category.py | 1 | 2937 | # coding: utf-8
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: hjelp@mailmojo.no
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Category(object):
"""NOTE: This class i... | apache-2.0 |
Mozhuowen/brython | www/src/Lib/test/test_quopri.py | 171 | 7715 | from test import support
import unittest
import sys, os, io, subprocess
import quopri
ENCSAMPLE = b"""\
Here's a bunch of special=20
=A1=A2=A3=A4=A5=A6=A7=A8=A9
=AA=AB=AC=AD=AE=AF=B0=B1=B2=B3
=B4=B5=B6=B7=B8=B9=BA=BB=BC=BD=BE
=BF=C0=C1=C2=C3=C4=C5=C6
=C7=C8=C9=CA=CB=CC=CD=CE=CF
=D0=D1=D2=D3=D4=D5=D6=D7
=D8=D9=DA=D... | bsd-3-clause |
linuxdeepin/deepin-media-player | src/widget/window.py | 1 | 5101 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Deepin, Inc.
# 2013 Hailong Qiu
#
# Author: Hailong Qiu <356752238@qq.com>
# Maintainer: Hailong Qiu <356752238@qq.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... | gpl-3.0 |
grenade/password-store-fork | contrib/importers/kwallet2pass.py | 37 | 3626 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Juhamatti Niemelä <iiska@iki.fi>. All Rights Reserved.
# Copyright (C) 2014 Diggory Hardy <diggory.hardy@gmail.com>. All Rights Reserved.
# This file is licensed under the GPLv2+. Please see COPYING for more information.
import sys
import re
from su... | gpl-2.0 |
Pistachitos/Sick-Beard | lib/hachoir_parser/image/gif.py | 90 | 8192 | """
GIF picture parser.
Author: Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
Enum, UInt8, UInt16,
Bit, Bits, NullBytes,
String, PascalString8, Character,
NullBits, RawBytes)
from lib.hachoir_parser.image.common import PaletteRGB
fr... | gpl-3.0 |
floydhub/dockerfiles | dl/tensorflow/tests/1.5.0/mnist_eager.py | 1 | 9530 | # 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 |
vefimova/rally | tests/unit/plugins/openstack/scenarios/nova/test_utils.py | 1 | 41162 | # Copyright 2013: Mirantis 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 b... | apache-2.0 |
vitaliykomarov/NEUCOGAR | nest/noradrenaline/nest-2.10.0/examples/nest/music/msgtest.py | 13 | 1200 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# msgtest.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ... | gpl-2.0 |
seaotterman/tensorflow | tensorflow/python/saved_model/signature_def_utils.py | 89 | 1583 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
kevin8909/xjerp | openerp/addons/account/project/wizard/__init__.py | 427 | 1337 | # -*- 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 |
Cube777/dotgit | tests/test_plugins_plain.py | 1 | 2081 | import os
from dotgit.plugins.plain import PlainPlugin
class TestPlainPlugin:
def test_apply(self, tmp_path):
plugin = PlainPlugin(str(tmp_path / 'data'))
data = 'test data'
with open(tmp_path / 'file', 'w') as f:
f.write(data)
plugin.apply(tmp_path / 'file', tmp_pa... | gpl-2.0 |
hal0x2328/neo-python | neo/Core/Utils.py | 1 | 1665 | import base58
from neo.Settings import settings
from neo.Core.Fixed8 import Fixed8
from typing import Tuple
def isValidPublicAddress(address: str) -> bool:
"""Check if address is a valid NEO address"""
valid = False
if len(address) == 34 and address[0] == 'A':
try:
base58.b58decode_ch... | mit |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | lgpl-3.0 |
BubuLK/sfepy | examples/linear_elasticity/shell10x_cantilever.py | 5 | 3878 | r"""
Bending of a long thin cantilever beam computed using the
:class:`dw_shell10x <sfepy.terms.terms_shells.Shell10XTerm>` term.
Find displacements of the central plane :math:`\ul{u}`, and rotations
:math:`\ul{\alpha}` such that:
.. math::
\int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}, \ul{\beta})
e_{kl}(\ul{u}, \ul... | bsd-3-clause |
Zhongqilong/mykbengineer | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | lgpl-3.0 |
DDelon/youtube-dl | youtube_dl/extractor/blinkx.py | 199 | 3217 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
remove_start,
int_or_none,
)
class BlinkxIE(InfoExtractor):
_VALID_URL = r'(?:https?://(?:www\.)blinkx\.com/#?ce/|blinkx:)(?P<id>[^?]+)'
IE_NAME = 'blinkx'
_TEST = {
'url': 'http:... | unlicense |
kfeiWang/pythonUtils | estimator.py | 1 | 1971 | # -*- coding:utf8 -*-
from __future__ import print_function
import codecs
def caluPAndRAndF1(file1, file2):
'''
计算准确率p和召回率r,f1值
file1: 参考文件
file2: 处理后文件
'''
with codecs.open(file1, 'r', 'utf8') as fin1:
with codecs.open(file2, 'r', 'utf8') as fin2:
line1 = fin1.readline()
... | mit |
radicalbit/ambari | ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/params_linux.py | 2 | 22595 | #!/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 |
hacksterio/pygments.rb | vendor/pygments-main/pygments/lexers/r.py | 47 | 23755 | # -*- coding: utf-8 -*-
"""
pygments.lexers.r
~~~~~~~~~~~~~~~~~
Lexers for the R/S languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, words, do_insertions
from ... | mit |
danakj/chromium | tools/perf/page_sets/tough_layout_cases.py | 5 | 1694 | # 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 cache_temperature as cache_temperature_module
from telemetry.page import page as page_module
from telemetry.page import shared_page... | bsd-3-clause |
victorzhao/miniblink49 | v8_5_1/tools/testrunner/local/pool_unittest.py | 27 | 1252 | #!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from pool import Pool
def Run(x):
if x == 10:
raise Exception("Expected exception triggered by test.")
retu... | gpl-3.0 |
stevenmizuno/QGIS | tests/src/python/test_layer_dependencies.py | 22 | 11160 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSnappingUtils (complement to C++-based tests)
.. note:: 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 ... | gpl-2.0 |
sunze/py_flask | venv/lib/python3.4/site-packages/celery/concurrency/asynpool.py | 6 | 46754 | # -*- coding: utf-8 -*-
"""
celery.concurrency.asynpool
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. note::
This module will be moved soon, so don't use it directly.
Non-blocking version of :class:`multiprocessing.Pool`.
This code deals with three major challenges:
1) Starting up child proces... | mit |
JieweiWei/googletest | test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | bsd-3-clause |
vmturbo/nova | nova/tests/functional/regressions/test_bug_1522536.py | 4 | 2538 | # Copyright 2016 HPE, 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, s... | apache-2.0 |
akretion/odoo | addons/website_hr_recruitment/models/hr_recruitment.py | 10 | 2093 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug import urls
from odoo import api, fields, models
from odoo.tools.translate import html_translate
class RecruitmentSource(models.Model):
_inherit = 'hr.recruitment.source'
url = fields.Char(compu... | agpl-3.0 |
gregbuehler/ansible-modules-extras | packaging/pacman.py | 22 | 7083 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.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 publish... | gpl-3.0 |
JazzeYoung/VeryDeepAutoEncoder | pylearn2/train_extensions/window_flip.py | 41 | 7218 | """ TrainExtensions for doing random spatial windowing and flipping of an
image dataset on every epoch. TODO: fill out properly."""
import warnings
import numpy
from . import TrainExtension
from pylearn2.datasets.preprocessing import CentralWindow
from pylearn2.utils.exc import reraise_as
from pylearn2.utils.rng i... | bsd-3-clause |
s7v7nislands/flask | tests/test_instance_config.py | 157 | 4365 | # -*- coding: utf-8 -*-
"""
tests.test_instance
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Flask Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pytest
import flask
from flask._compat import PY2
def test_explicit_instance_paths(mo... | bsd-3-clause |
canwe/NewsBlur | apps/feed_import/views.py | 5 | 12057 | import datetime
import pickle
import base64
import httplib2
from utils import log as logging
from oauth2client.client import OAuth2WebServerFlow, FlowExchangeError
from bson.errors import InvalidStringData
import uuid
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
# from django... | mit |
kzvyahin/cfme_tests | utils/units.py | 1 | 3393 | # -*- coding: utf-8 -*-
import math
import re
# TODO: Split the 1000 and 1024 factor out. Now it is not an issue as it is used FOR COMPARISON ONLY
FACTOR = 1024
PREFIXES = ['', 'K', 'M', 'G', 'T', 'P']
FACTORS = {prefix: int(math.pow(FACTOR, i)) for i, prefix in enumerate(PREFIXES)}
UNITS = ['Byte', 'Bytes', 'B', 'b'... | gpl-2.0 |
ptitjes/quodlibet | quodlibet/ext/editing/resub.py | 2 | 1625 | # 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.
import re
from gi.repository import Gtk, GObject
from quodlibet impor... | gpl-2.0 |
pku9104038/edx-platform | common/djangoapps/student/migrations/0020_add_test_center_user.py | 188 | 15924 | # -*- 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 'TestCenterUser'
db.create_table('student_testcenteruser', (
('id', self.gf('djan... | agpl-3.0 |
rickmendes/ansible-modules-extras | cloud/amazon/sns_topic.py | 33 | 13805 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This is a 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.
#
# This Ansible library is distri... | gpl-3.0 |
georchestra/cadastrapp | addons/cadastrapp/js/external/openlayers2/openlayers/tools/jsmin.py | 513 | 7471 | #!/usr/bin/python
# This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
# /* jsmin.c
# 2007-01-08
#
# Copyright (c) 2002 Douglas Crockford (www.crockford.com)
#
# Permission is hereby granted, free of ch... | gpl-3.0 |
Venturi/cms | env/lib/python2.7/site-packages/django/contrib/postgres/fields/array.py | 1 | 8579 | import json
from django.contrib.postgres import lookups
from django.contrib.postgres.forms import SimpleArrayField
from django.contrib.postgres.validators import ArrayMaxLengthValidator
from django.core import checks, exceptions
from django.db.models import Field, IntegerField, Transform
from django.db.models.lookups ... | gpl-2.0 |
lord63-forks/flask | examples/persona/persona.py | 159 | 1442 | from flask import Flask, render_template, session, request, abort, g
import requests
app = Flask(__name__)
app.config.update(
DEBUG=True,
SECRET_KEY='my development key',
PERSONA_JS='https://login.persona.org/include.js',
PERSONA_VERIFIER='https://verifier.login.persona.org/verify',
)
app.config.from... | bsd-3-clause |
yaroslavvb/tensorflow | tensorflow/contrib/slim/python/slim/nets/inception_v1_test.py | 112 | 8960 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Garmelon/itbot | script.py | 1 | 20301 | # Rewrite of the original script; it worked, but not well enough...
# still ugly tho
CONFIGFILE = "config.txt"
import re
import json
import time
import requests
import datetime
import configparser
import imgurpython
# overwrite print() to only print ascii
import builtins
def asciify(text):
return ''.join([i if ord... | mit |
amitsela/incubator-beam | sdks/python/apache_beam/pipeline.py | 3 | 21582 | #
# 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 |
aarchiba/numpy | numpy/ma/tests/test_extras.py | 41 | 44785 | # pylint: disable-msg=W0611, W0612, W0511
"""Tests suite for MaskedArray.
Adapted from the original test_ma by Pierre Gerard-Marchant
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $
"""
from __future__ import division, absolute... | bsd-3-clause |
frankiecjunle/yunblog | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py | 515 | 2165 | from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check vi... | mit |
cloudendpoints/endpoints-management-python | test/test_timestamp.py | 3 | 4311 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
oppo-source/Find7-5.1-kernel-source | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/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 |
ville-k/tensorflow | tensorflow/compiler/tests/pooling_ops_3d_test.py | 85 | 12646 | # 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 |
teamtuga4/teamtuga4ever.repository | plugin.video.traquinas/resources/lib/resolvers/v_vids.py | 23 | 1385 | # -*- coding: utf-8 -*-
'''
Specto 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 l... | gpl-2.0 |
uzh/vm-mad | vmmad/provider/libcloud.py | 1 | 9309 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Interfaces to cloud providers, using `Apache LibCloud <http://libcloud.apache.org>`
"""
# Copyright (C) 2011, 2012 ETH Zurich and University of Zurich. All rights reserved.
#
# Authors:
# Riccardo Murri <riccardo.murri@gmail.com>
#
# Licensed under the Apache License... | apache-2.0 |
ehashman/oh-mainline | vendor/packages/Django/tests/regressiontests/signals_regress/tests.py | 102 | 3907 | from __future__ import absolute_import
from django.db import models
from django.test import TestCase
from .models import Author, Book
class SignalsRegressTests(TestCase):
"""
Testing signals before/after saving and deleting.
"""
def get_signal_output(self, fn, *args, **kwargs):
# Flush any ... | agpl-3.0 |
tntnatbry/tensorflow | tensorflow/examples/learn/iris_custom_model.py | 50 | 2613 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
ClearCorp/odoo-clearcorp | TODO-9.0/base_currency_symbol/__terp__.py | 4 | 2547 | # -*- encoding: utf-8 -*-
##############################################################################
#
# __terp__.py
# base_currency_symbol
# First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights rese... | agpl-3.0 |
matplotlib/viscm | tests.py | 1 | 4429 | from viscm.gui import *
from viscm.bezierbuilder import *
import numpy as np
import matplotlib as mpl
from matplotlib.backends.qt_compat import QtGui, QtCore
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
cms = {"viscm/examples/sample_linear.jscm",
"viscm/examples/sample_dive... | mit |
glizer/nw.js | test/remoting/testcfg.py | 68 | 2628 | import test
import os
from os.path import join, dirname, exists, basename, isdir
import re
import utils
class RemotingTestCase(test.TestCase):
def __init__(self, path, file, arch, mode, nwdir, context, config, additional=[]):
super(RemotingTestCase, self).__init__(context, path, arch, mode, nwdir)
self.file... | mit |
etingof/pysnmp | pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py | 1 | 27607 | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pysnmp/license.html
#
# ASN.1 source http://mibs.snmplabs.com:80/asn1/TRANSPORT-ADDRESS-MIB
# Produced by pysmi-0.4.0 at Sun Feb 17 08:56:38 2019
#
# Parts of otherwise autogenerated MI... | bsd-2-clause |
jantman/pelican-plugins | pelican_comment_system/avatars.py | 25 | 2732 | # -*- coding: utf-8 -*-
"""
Author: Bernhard Scheirle
"""
from __future__ import unicode_literals
import logging
import os
import hashlib
logger = logging.getLogger(__name__)
_log = "pelican_comment_system: avatars: "
try:
from . identicon import identicon
_identiconImported = True
except ImportError as e:... | agpl-3.0 |
Potato42/primitivepyg | primitivepyg/convertcolors.py | 1 | 1734 | """
convertcolors.py provides functions for converting various color formats to (red, green, blue, alpha)
"""
RED_MASK = 0xff000000
GREEN_MASK = 0x00ff0000
BLUE_MASK = 0x0000ff00
ALPHA_MASK = 0x000000ff
def color_from_hex(hex_color:int)->(int,int,int,int):
"""
Takes a hex value in either of the form 0xRRGG... | mit |
jostschmithals/three.js | utils/exporters/blender/addons/io_three/exporter/texture.py | 173 | 1407 | from .. import constants, logger
from . import base_classes, image, api
class Texture(base_classes.BaseNode):
"""Class that wraps a texture node"""
def __init__(self, node, parent):
logger.debug("Texture().__init__(%s)", node)
base_classes.BaseNode.__init__(self, node, parent, constants.TEXTUR... | mit |
ricotabor/opendrop | opendrop/__main__.py | 2 | 1861 | # Copyright © 2020, Joseph Berry, Rico Tabor (opendrop.dev@gmail.com)
# OpenDrop is released under the GNU GPL License. You are free to
# modify and distribute the code, but always under the same license
# (i.e. you cannot make commercial derivatives).
#
# If you use this software in your research, please cite the foll... | gpl-2.0 |
rx2130/Leetcode | python/37 Sudoku Solver.py | 1 | 1671 | class Solution(object):
def solveSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: void Do not return anything, modify board in-place instead.
"""
if board is None or len(board) != 9 or len(board[0]) != 9:
return
for row in range(9):
... | apache-2.0 |
ericdwang/django-analytical | analytical/tests/test_tag_spring_metrics.py | 4 | 2549 | """
Tests for the Spring Metrics template tags and filters.
"""
import re
from django.contrib.auth.models import User, AnonymousUser
from django.http import HttpRequest
from django.template import Context
from django.test.utils import override_settings
from analytical.templatetags.spring_metrics import SpringMetrics... | mit |
ceph/autotest | frontend/settings.py | 2 | 4228 | # Django settings for frontend project.
import os
import common
from autotest_lib.client.common_lib import global_config
DEBUG = True
TEMPLATE_DEBUG = DEBUG
FULL_ADMIN = False
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'post... | gpl-2.0 |
40223236/40223236-50 | static/Brython3.1.1-20150328-091302/Lib/unittest/main.py | 739 | 10385 | """Unittest main program"""
import sys
import optparse
import os
from . import loader, runner
from .signals import installHandler
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = " -c, --catch Catch control-C and display results\n"
BUFFEROUTPUT = " -b, --buffer ... | gpl-3.0 |
drcapulet/sentry | src/sentry/migrations/0120_auto__add_grouprulestatus.py | 36 | 23983 | # -*- 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 'GroupRuleStatus'
db.create_table('sentry_grouprulestatus', (
('id', self.gf('sen... | bsd-3-clause |
tony0924/itriqemu | scripts/tracetool/backend/stderr.py | 94 | 1162 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Stderr built-in backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__em... | gpl-2.0 |
eldipa/athena | athenaproj/athena/models.py | 1 | 7528 | from django.db import models
import json, string
from django.core.exceptions import ValidationError
class Objective(models.Model):
name = models.CharField(max_length=200)
description = models.CharField(max_length=240, blank=True)
def __unicode__(self):
return self.name
class How(models.Model):
n... | gpl-2.0 |
brianlsharp/MissionPlanner | Lib/encodings/unicode_escape.py | 103 | 1229 | """ Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to method... | gpl-3.0 |
varunkamra/kuma | vendor/packages/pygments/lexers/algebra.py | 72 | 6167 | # -*- coding: utf-8 -*-
"""
pygments.lexers.algebra
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for computer algebra systems.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from py... | mpl-2.0 |
dtroyer/python-openstacksdk | openstack/tests/functional/cloud/test_groups.py | 1 | 4031 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
SophieTh/und_Sophie_2016 | pySRU/tests/SimulationTest.py | 1 | 5980 | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | mit |
sanja7s/SR_Twitter | src_SR/articles_in_CVs.py | 1 | 3380 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Join article names for the popular concepts found in each community
"""
from collections import defaultdict
import glob, os
IN_DIR = "../../../DATA/CV"
#########################################################
# SR
###################################################... | mit |
nextgis-extra/tests | lib_gdal/gdrivers/isis2.py | 1 | 3417 | #!/usr/bin/env python
###############################################################################
# $Id: isis2.py 32163 2015-12-13 17:44:50Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read functionality for ISIS2 driver.
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
#
#########... | gpl-2.0 |
selwin/Django-facebook | open_facebook/api.py | 1 | 32830 | # -*- coding: utf-8 -*-
'''
Open Facebook allows you to use Facebook's open graph API with simple python code
**Features**
* Supported and maintained
* Tested so people can contribute
* Facebook exceptions are mapped
* Logging
**Basic examples**::
facebook = OpenFacebook(access_token)
# G... | bsd-3-clause |
Kromey/roglick | roglick/dungeon/maps/conway_dungeon.py | 1 | 6436 | from roglick.dungeon.base import Map,Room,Tile
from roglick.dungeon import tiles
from roglick.lib import libtcod
class Cave(object):
def __init__(self):
self.cells = []
@property
def center(self):
if 0 >= self.size:
return None
sum_x = 0
sum_y = 0
for ... | mit |
tumbl3w33d/ansible | lib/ansible/modules/network/aci/aci_rest.py | 13 | 14126 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# 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_ve... | gpl-3.0 |
hengqujushi/shadowsocks | shadowsocks/asyncdns.py | 655 | 17416 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# 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 r... | apache-2.0 |
sanjayankur31/nest-simulator | pynest/examples/balancedneuron.py | 8 | 7344 | # -*- coding: utf-8 -*-
#
# balancedneuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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,... | gpl-2.0 |
memkeytm/p2pool | p2pool/test/test_node.py | 198 | 10503 | from __future__ import division
import base64
import random
import tempfile
from twisted.internet import defer, reactor
from twisted.python import failure
from twisted.trial import unittest
from twisted.web import client, resource, server
from p2pool import data, node, work
from p2pool.bitcoin import data as bitcoin... | gpl-3.0 |
dulems/hue | desktop/core/src/desktop/lib/view_util.py | 38 | 2507 | #!/usr/bin/env python
# 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 ma... | apache-2.0 |
malayaleecoder/servo | tests/wpt/harness/wptrunner/metadata.py | 78 | 12836 | # 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/.
import os
import shutil
import sys
import tempfile
import types
import uuid
from collections import defaultdict
from mo... | mpl-2.0 |
40223246/w16b_test | static/Brython3.1.3-20150514-095342/Lib/pydoc.py | 637 | 102017 | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation ... | agpl-3.0 |
ProjectSWGCore/NGECore2 | scripts/mobiles/talus/lost_aqualish_scout.py | 2 | 1650 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
djgagne/scikit-learn | sklearn/covariance/__init__.py | 389 | 1157 | """
The :mod:`sklearn.covariance` module includes methods and algorithms to
robustly estimate the covariance of features given a set of points. The
precision matrix defined as the inverse of the covariance is also estimated.
Covariance estimation is closely related to the theory of Gaussian Graphical
Models.
"""
from ... | bsd-3-clause |
xbot/alfred-pushbullet | lib/websocket/_logging.py | 49 | 1865 | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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, ... | mit |
crystalhaohua0408/principles-of-computing | homework7.py | 5 | 6428 | # Homework 7 for Principles of Computing class, by k., 08/01/2014
# class Puzzle from program template at http://www.codeskulptor.org/#poc_fifteen_template.py
'''
Loyd's Fifteen puzzle - solver and visualizer
Note that solved configuration has the blank (zero) tile in upper left
Use the arrows key to swap this tile w... | mit |
jindongh/boto | boto/ec2/elb/listener.py | 152 | 3377 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software wi... | mit |
dago/ansible-modules-core | cloud/amazon/cloudformation.py | 17 | 10939 | #!/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 distributed... | gpl-3.0 |
cbandera/hometop_HT3 | HT3/sw/HT3_Logger.py | 1 | 1502 | #! /usr/bin/python3
#
#################################################################
## Copyright (c) 2013 Norbert S. <junky-zs@gmx.de>
#
# 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, eithe... | gpl-3.0 |
brave/browser-ios | Client/Assets/scrape_plugins.py | 3 | 1503 | #!/usr/bin/env python
from lxml import html
import os
import requests
import shutil
import urllib
def main():
if not os.path.exists("SearchPlugins"):
os.makedirs("SearchPlugins")
locales = getLocaleList()
for locale in locales:
files = getFileList(locale)
if files == None:
... | mpl-2.0 |
jpaalasm/pyglet | pyglet/media/drivers/openal/lib_openal.py | 45 | 27846 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
sirex/Misago | misago/threads/views/generic/threads/actions.py | 8 | 1141 | from django.contrib import messages
from django.core.paginator import Paginator
from django.shortcuts import redirect
from django.utils.translation import ungettext, ugettext_lazy, ugettext as _
from misago.threads import moderation
from misago.threads.views.generic.actions import ActionsBase, ReloadAfterDelete
__al... | gpl-2.0 |
TheBoegl/letsencrypt | letsencrypt-apache/letsencrypt_apache/augeas_configurator.py | 6 | 7387 | """Class of Augeas Configurators."""
import logging
import augeas
from letsencrypt import errors
from letsencrypt import reverter
from letsencrypt.plugins import common
from letsencrypt_apache import constants
logger = logging.getLogger(__name__)
class AugeasConfigurator(common.Plugin):
"""Base Augeas Configu... | apache-2.0 |
cedricporter/everlost | frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/enumerations.py | 307 | 1077 | #===- enumerations.py - Python Enumerations ------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | apache-2.0 |
sebastic/QGIS | python/plugins/processing/algs/qgis/ZonalStatistics.py | 2 | 10813 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ZonalStatistics.py
---------------------
Date : August 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
**********... | gpl-2.0 |
cognitiveclass/edx-platform | common/djangoapps/config_models/models.py | 38 | 7489 | """
Django Model baseclass for database-backed configuration.
"""
from django.db import connection, models
from django.contrib.auth.models import User
from django.core.cache import caches, InvalidCacheBackendError
from django.utils.translation import ugettext_lazy as _
try:
cache = caches['configuration'] # pylin... | agpl-3.0 |
telefonicaid/selenium | py/test/selenium/webdriver/common/window_tests.py | 15 | 1750 | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 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 requir... | apache-2.0 |
gavin-feng/odoo | addons/contacts/__openerp__.py | 260 | 1594 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.