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
vmax-feihu/hue
desktop/core/ext-py/Django-1.6.10/django/utils/termcolors.py
117
6948
""" termcolors.py """ from django.utils import six color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white') foreground = dict([(color_names[x], '3%s' % x) for x in range(8)]) background = dict([(color_names[x], '4%s' % x) for x in range(8)]) RESET = '0' opt_dict = {'bold': '1', 'undersco...
apache-2.0
kaplun/invenio
modules/miscutil/lib/dateutils.py
11
18834
# -*- coding: utf-8 -*- ## ## Some functions about dates ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 Fr...
gpl-2.0
quantifiedcode-bot/blitzdb
blitzdb/tests/test_querying.py
2
10823
from __future__ import absolute_import from .fixtures import * from blitzdb.tests.helpers.movie_data import Actor, Director, Movie import blitzdb def test_basic_delete(backend, small_test_data): backend.filter(Actor, {}).delete() backend.commit() assert len(backend.filter(Actor, {})) == 0 def test_b...
mit
google/objax
objax/jaxboard.py
1
4637
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
jviada/QuantEcon.py
quantecon/tests/tests_models/test_optgrowth.py
7
2959
""" tests for quantecon.models.optgrowth @author : Spencer Lyon @date : 2014-08-05 10:20:53 TODO: I'd really like to see why the solutions only match analytical counter part up to 1e-2. Seems like we should be able to do better than that. """ from __future__ import division from math import log import num...
bsd-3-clause
haiyangd/Gelatin
src/Gelatin/util.py
2
3376
import generator from parser import Parser from compiler import SyntaxCompiler def compile_string(syntax): """ Builds a converter from the given syntax and returns it. @type syntax: str @param syntax: A Gelatin syntax. @rtype: compiler.Context @return: The compiled converter. """ r...
gpl-2.0
yglazko/socorro
socorro/unittest/lib/test_search_common.py
4
16114
# 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 datetime from nose.tools import eq_, ok_, assert_raises from configman import ConfigurationManager, Namespace f...
mpl-2.0
tod31/pyload
module/plugins/accounts/RPNetBiz.py
5
2680
# -*- coding: utf-8 -*- from module.plugins.internal.MultiAccount import MultiAccount from module.plugins.internal.misc import json class RPNetBiz(MultiAccount): __name__ = "RPNetBiz" __type__ = "account" __version__ = "0.19" __status__ = "testing" __config__ = [("mh_mode" , "all;liste...
gpl-3.0
GdZ/scriptfile
software/googleAppEngine/lib/django_1_2/django/contrib/gis/db/backends/oracle/creation.py
620
2283
from django.db.backends.oracle.creation import DatabaseCreation from django.db.backends.util import truncate_name class OracleCreation(DatabaseCreation): def sql_indexes_for_field(self, model, f, style): "Return any spatial index creation SQL for the field." from django.contrib.gis.db.models.field...
mit
mwaskom/seaborn
doc/tools/generate_logos.py
2
6982
import numpy as np import seaborn as sns from matplotlib import patches import matplotlib.pyplot as plt from scipy.signal import gaussian from scipy.spatial import distance XY_CACHE = {} STATIC_DIR = "_static" plt.rcParams["savefig.dpi"] = 300 def poisson_disc_sample(array_radius, pad_radius, candidates=100, d=2, ...
bsd-3-clause
omnirom/android_kernel_htc_flounder
scripts/tracing/dma-api/plotting.py
96
4043
"""Ugly graph drawing tools""" import matplotlib.pyplot as plt import matplotlib.cm as cmap #import numpy as np from matplotlib import cbook # http://stackoverflow.com/questions/4652439/is-there-a-matplotlib-equivalent-of-matlabs-datacursormode class DataCursor(object): """A simple data cursor widget that displays...
gpl-2.0
bjackman/workload-automation
wlauto/workloads/rt_app/__init__.py
2
11959
# Copyright 2015 ARM Limited # # 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 writin...
apache-2.0
manderson23/NewsBlur
apps/rss_feeds/icon_importer.py
2
14448
import urllib2 import lxml.html import numpy import scipy import scipy.misc import scipy.cluster import urlparse import struct import operator import gzip import datetime import requests import httplib from PIL import BmpImagePlugin, PngImagePlugin, Image from socket import error as SocketError from boto.s3.key import ...
mit
tcheehow/MissionPlanner
Lib/dircache.py
67
1167
"""Read and cache directory listings. The listdir() routine returns a sorted list of the files in a directory, using a cache to avoid reading the directory more often than necessary. The annotate() routine appends slashes to directories.""" from warnings import warnpy3k warnpy3k("the dircache module has been rem...
gpl-3.0
alizamus/pox_controller
pox/lib/recoco/recoco.py
38
24045
# Copyright 2011-2013 James McCauley # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
cchurch/ansible
test/units/modules/network/f5/test_bigip_profile_fastl4.py
16
5811
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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 import json import pytest import sys if sys.version_info < (2...
gpl-3.0
Groestlcoin/electrumx-grs
tests/server/test_compaction.py
4
4366
# Test of compaction code in server/db.py import array from collections import defaultdict from os import environ, urandom from struct import pack import random from lib.hash import hash_to_str from server.env import Env from server.db import DB def create_histories(db, hashX_count=100): '''Creates a bunch of r...
mit
ujjwalwahi/odoo
addons/l10n_in_hr_payroll/report/__init__.py
424
1262
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
Didou09/tofu
tofu/mag/regression_test.py
2
11158
# -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Also if needed: retab ''' Regression test ''' from __future__ import (unicode_literals, absolute_import, \ print_function, division) import argparse import matplotlib.pyplot as plt import numpy as np import os i...
mit
40223104/test_lego
static/Brython3.1.1-20150328-091302/Lib/stat.py
765
4304
"""Constants/functions for interpreting results of os.stat() and os.lstat(). Suggested usage: from stat import * """ # Indices for stat struct members in the tuple returned by os.stat() ST_MODE = 0 ST_INO = 1 ST_DEV = 2 ST_NLINK = 3 ST_UID = 4 ST_GID = 5 ST_SIZE = 6 ST_ATIME = 7 ST_MTIME = 8 ST_CTIME = 9 ...
gpl-3.0
lanfker/vPRKS
examples/realtime/realtime-udp-echo.py
195
3526
# # * 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; # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the implied w...
gpl-2.0
camptocamp/ngo-addons-backport
addons/document_page/wizard/wiki_wiki_page_open.py
46
2658
# -*- 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
mcfiredrill/libcaca-old
python/caca/display.py
1
9283
# -*- coding: utf-8 -*- # # libcaca Colour ASCII-Art library # Python language bindings # Copyright (c) 2010 Alex Foulon <alxf@lavabit.com> # All Rights Reserved # # This library is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redis...
lgpl-2.1
sopac/pacgeo
geonode/base/tests.py
3
4298
from django.test import TestCase from geonode.base.models import ResourceBase from geonode.utils import OGC_Servers_Handler class ThumbnailTests(TestCase): def setUp(self): self.rb = ResourceBase.objects.create() def tearDown(self): t = self.rb.thumbnail if t: t.delete() ...
gpl-3.0
truetone/AutobahnPython
examples/wamp/pubsub/simple/example2/server.py
27
1919
############################################################################### ## ## Copyright 2011,2012 Tavendo GmbH ## ## 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:...
apache-2.0
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/tests/test_kernel_approximation.py
78
7586
import numpy as np from scipy.sparse import csr_matrix from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true from sklearn.utils.testing import assert_not_equal from sklearn.utils.testing import assert_array_almost_equal, assert_raises from sklearn.utils.testing import assert_less_equal from ...
mit
rcbops/nova-buildpackage
contrib/boto_v6/ec2/connection.py
17
5286
''' Created on 2010/12/20 @author: Nachi Ueno <ueno.nachi@lab.ntt.co.jp> ''' import boto import base64 import boto.ec2 from boto_v6.ec2.instance import ReservationV6 from boto.ec2.securitygroup import SecurityGroup class EC2ConnectionV6(boto.ec2.EC2Connection): ''' EC2Connection for OpenStack IPV6 mode ...
apache-2.0
hsum/sqlalchemy
lib/sqlalchemy/orm/scoping.py
80
6101
# orm/scoping.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .. import exc as sa_exc from ..util import ScopedRegistry, ThreadLocalRegistry, ...
mit
BeZazz/lamebench
nb_third_party/dns/rdtypes/ANY/GPOS.py
248
5304
# Copyright (C) 2003-2007, 2009, 2010 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 ...
apache-2.0
mesheven/pyOCD
pyocd/rtos/common.py
1
2964
""" mbed CMSIS-DAP debugger Copyright (c) 2016 ARM Limited 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
rwl/muntjac
muntjac/demo/sampler/features/dragndrop/DragDropRearrangeComponentsExample.py
1
5450
from muntjac.api import VerticalLayout, Label, Embedded, Button, Alignment from muntjac.terminal.theme_resource import ThemeResource from muntjac.ui.css_layout import CssLayout from muntjac.ui.button import IClickListener from muntjac.ui.custom_component import CustomComponent from muntjac.ui.horizontal_layout import ...
apache-2.0
emccode/HeliosBurn
heliosburn/django/hbproject/api/views/testplan_rule.py
1
5048
from bson import ObjectId import json import logging from bson.errors import InvalidId from django.http import JsonResponse, HttpResponseNotFound, HttpResponseBadRequest, HttpResponse from django.views.decorators.csrf import csrf_exempt from api.models import db_model from api.models.auth import RequireLogin from api...
mit
mark-ignacio/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/watchlist/amountchangedpattern_unittest.py
124
3350
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
Alexsaphir/TP_EDP_Python
TP2_error.py
1
1912
# -*- coding: utf-8 -*- from numpy import * # importation du module numpy from numpy.linalg import * # importation du module numpy.linalg from numpy.random import * from matplotlib.pyplot import * from mpl_toolkits.mplot3d import Axes3D #Calcul l'erreur en faisant varier Ns def Ud(x): y = sin(2*pi*x)*sinh(2*pi) ...
lgpl-3.0
rancherio/validation-tests
tests/v2_validation/cattlevalidationtest/core/test_network_policy.py
3
33957
from common_fixtures import * # NOQA test_network_policy = os.environ.get( 'TEST_NETWORK_POLICY', "False") np_reason = \ 'Intended to not execute this network policy test' if_network_policy = pytest.mark.skipif(test_network_policy != "ALL", reason=np_reason) if_network_...
apache-2.0
equitania/myodoo-addons-v10
eq_report_pattern/models/account_invoice.py
1
4656
# -*- coding: utf-8 -*- ############################################################################## # # Odoo Addon, Open Source Management Solution # Copyright (C) 2014-now Equitania Software GmbH(<http://www.equitania.de>). # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
aoakeson/home-assistant
homeassistant/components/device_tracker/unifi.py
4
2555
""" Support for Unifi WAP controllers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.unifi/ """ import logging import urllib from homeassistant.components.device_tracker import DOMAIN from homeassistant.const import CONF_HOST, CONF_USERN...
mit
android-ia/hardware_intel_parameter-framework
tools/xmlGenerator/domainGenerator.py
6
12409
#! /usr/bin/python # # Copyright (c) 2011-2014, Intel Corporation # 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...
bsd-3-clause
SEL-Columbia/commcare-hq
corehq/apps/app_manager/tests/__init__.py
1
1477
from __future__ import absolute_import try: from corehq.apps.app_manager.tests.test_app_manager import * from corehq.apps.app_manager.tests.test_xml_parsing import * from corehq.apps.app_manager.tests.test_xform_parsing import * from corehq.apps.app_manager.tests.test_form_versioning import * from ...
bsd-3-clause
davidegurgone/pyang
pyang/syntax.py
8
11241
"""Description of YANG & YIN syntax.""" import re ### Regular expressions - constraints on arguments # keywords and identifiers identifier = r"[_A-Za-z][._\-A-Za-z0-9]*" prefix = identifier keyword = '((' + prefix + '):)?(' + identifier + ')' comment = '(/\*([^*]|[\r\n\s]|(\*+([^*/]|[\r\n\s])))*\*+/)|(//.*)|(/\*.*)'...
isc
Maccimo/intellij-community
plugins/hg4idea/testData/bin/hgext/convert/convcmd.py
90
17238
# convcmd - convert extension commands definition # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from common import NoRepo, MissingTool, SKIPREV, mapfile from cvs import conv...
apache-2.0
Centreon-Community/centreon-discovery
modPython/setuptools-0.6c11/setuptools/command/easy_install.py
32
63580
#!python """\ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ http://peak.telecommunity.com/DevCenter/EasyInstall """ import sys, os.path, ...
gpl-2.0
mathslinux/ceilometer
ceilometer/event/storage/pymongo_base.py
9
5978
# # 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...
apache-2.0
SRLFoundry/HookedGL
HookedGL/Communication.py
1
3837
import socket import sys import math def bytes_needed(n): if type(n) is str: return len(n) elif type(n) is list: if type(n[0]) is int: return 4 * len(n) if n == 0: return 1 return int(math.log(n, 256)) + 1 class Communication: def __init__(self, address, port):...
gpl-2.0
santidediego/LearningDjango
lib/python3.5/site-packages/django/conf/locale/de_CH/formats.py
115
1445
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATE...
mit
youprofit/servo
tests/wpt/css-tests/tools/pywebsocket/src/setup.py
434
2863
#!/usr/bin/env python # # Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mpl-2.0
cgvarela/graphite-web
webapp/graphite/events/models.py
33
1383
import os from django.db import models from tagging.managers import ModelTaggedItemManager from tagging.models import Tag if os.environ.get('READTHEDOCS'): TagField = lambda *args, **kwargs: None else: from tagging.fields import TagField class Event(models.Model): when = models.DateTimeField() what =...
apache-2.0
rkmaddox/mne-python
mne/gui/_backend.py
11
1500
"""Deal with pyface backend issues.""" # Author: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os import sys from ..utils import warn, _check_pyqt5_version def _get_pyface_backend(): """Check the currently selected Pyface backend. Returns ------- backend : str ...
bsd-3-clause
seem-sky/kbengine
kbe/res/scripts/common/Lib/ctypes/test/test_struct_fields.py
264
1503
import unittest from ctypes import * class StructFieldsTestCase(unittest.TestCase): # Structure/Union classes must get 'finalized' sooner or # later, when one of these things happen: # # 1. _fields_ is set. # 2. An instance is created. # 3. The type is used as field of another Structure/Union. ...
lgpl-3.0
mahak/neutron
neutron/plugins/ml2/extensions/qos.py
5
2024
# Copyright (c) 2015 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...
apache-2.0
matthaywardwebdesign/rethinkdb
test/rql_test/connections/http_support/werkzeug/testsuite/security.py
145
4264
# -*- coding: utf-8 -*- """ werkzeug.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the security helpers. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.securit...
agpl-3.0
rbalda/neural_ocr
env/lib/python2.7/site-packages/scipy/ndimage/tests/test_regression.py
123
1429
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_array_almost_equal, run_module_suite import scipy.ndimage as ndimage def test_byte_order_median(): """Regression test for #413: median_filter does not handle bytes orders.""" a = np.arange(9,...
mit
vortex-ape/scikit-learn
examples/model_selection/plot_nested_cross_validation_iris.py
9
4415
""" ========================================= Nested versus non-nested cross-validation ========================================= This example compares non-nested and nested cross-validation strategies on a classifier of the iris data set. Nested cross-validation (CV) is often used to train a model in which hyperparam...
bsd-3-clause
BaconPancakes/valor
lib/pip/_vendor/requests/packages/urllib3/util/request.py
780
2128
from __future__ import absolute_import from base64 import b64encode from ..packages.six import b ACCEPT_ENCODING = 'gzip,deflate' def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): """ Shortcuts for generatin...
gpl-3.0
AMObox/teammaniac
plugin.video.PsychoTV/resources/lib/resolvers/filehoot.py
23
1140
# -*- 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
kevinpt/ripyl
ripyl/protocol/iso_k_line.py
1
20293
#!/usr/bin/python # -*- coding: utf-8 -*- '''ISO K-line protocol decoder Decodes ISO9141 and ISO14230 automotive data bus protocols ''' # Copyright © 2013 Kevin Thibedeau # This file is part of Ripyl. # Ripyl is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General ...
lgpl-3.0
xzYue/odoo
addons/account/wizard/account_report_common.py
342
10353
# -*- 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
V155/qutebrowser
qutebrowser/config/configexc.py
1
5311
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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
RainDogSoftware/pingpung
pingpung/pingpung.py
1
22103
#!/usr/bin/env python3 import sys import time import os from collections import OrderedDict from itertools import count from gettext import gettext as _ from PyQt4 import QtCore, QtGui, uic from pingpung import pplib from pingpung.pplib import pping from pingpung.pplib import audio __date__ = "$Date: 2015/03/17 $" _...
gpl-2.0
whummer/moto
moto/config/responses.py
1
2064
import json from moto.core.responses import BaseResponse from .models import config_backends class ConfigResponse(BaseResponse): @property def config_backend(self): return config_backends[self.region] def put_configuration_recorder(self): self.config_backend.put_configuration_recorder(se...
apache-2.0
Lambdanaut/crits
crits/screenshots/forms.py
21
2748
from django import forms from django.forms.widgets import HiddenInput from crits.core import form_consts from crits.core.handlers import get_source_names from crits.core.user_tools import get_user_organization class AddScreenshotForm(forms.Form): """ Django form for adding an Object. """ error_css_cla...
mit
chrisfranko/MIM-MM
qa/rpc-tests/skeleton.py
148
2426
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Skeleton for python-based regression tests using # JSON-RPC # Add python-bitcoinrpc to module search pa...
mit
tiborsimko/invenio-utils
invenio_utils/hash.py
5
1142
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2015 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) any...
gpl-2.0
adam111316/SickGear
sickbeard/providers/torrentleech.py
3
5655
# coding=utf-8 # # This file is part of SickGear. # # SickGear 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. # # SickGear is distribu...
gpl-3.0
makdharma/grpc
src/python/grpcio/grpc/framework/interfaces/base/base.py
19
13144
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
mwmuni/LIGGGHTS_GUI
OpenGL/raw/GL/ARB/map_buffer_range.py
9
1118
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
gpl-3.0
jlublin/landpatterngen
gen_library.py
1
2880
#!/usr/bin/env python3 import re import importlib import sqlite3 import sys def parse_tollens(part): keys = list(part.keys()); for key in keys: if(key[-2:] == '_l' and key[:-2] + '_h' in part): part[key[:-2]] = TolLen(float(part[key[:-2] + '_l']), float(part[key[:-2] + '_h'])) part.pop(key[:-2] + '_l')...
gpl-3.0
flagxor/swtoolkit
test/directx_9_0_c_test.py
9
2384
#!/usr/bin/python2.4 # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
bsd-3-clause
seraphlnWu/in_trip
in_trip/in_trip/lib/arbiter.py
1
16076
#coding=utf-8 # This module implement prefork model, used for spawn and manage child process import os import sys import time import errno import signal import random import select import traceback from in_trip.lib.pidfile import Pidfile from in_trip.lib.config import Config from in_trip.lib.errors import HaltServer...
mit
renegelinas/mi-instrument
mi/dataset/parser/test/test_auv_eng_auv.py
7
22058
#!/usr/bin/env python """ @package mi.dataset.parser.test @fid marine-integrations/mi/dataset/parser/test/test_auv_eng_auv.py @author Jeff Roy @brief Test code for a auv_eng_auv data parser NOTE: there have been several other parsers built on auv_common tested already all negative paths through the code are not again...
bsd-2-clause
abergeron/pylearn2
pylearn2/utils/image.py
39
18841
""" Utility functions for working with images. """ import logging import numpy as np plt = None axes = None from theano.compat.six.moves import xrange from theano.compat.six import string_types import warnings try: import matplotlib.pyplot as plt import matplotlib.axes except (RuntimeError, ImportError, TypeErr...
bsd-3-clause
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/PyAMF-0.6.1/pyamf/remoting/__init__.py
27
19278
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ AMF Remoting support. A Remoting request from the client consists of a short preamble, headers, and bodies. The preamble contains basic information about the nature of the request. Headers can be used to request debugging information, send authenti...
bsd-3-clause
robmagee/django-cms
cms/signals/permissions.py
58
2695
# -*- coding: utf-8 -*- from cms.cache.permissions import clear_user_permission_cache from cms.models import PageUser, PageUserGroup from menus.menu_pool import menu_pool def post_save_user(instance, raw, created, **kwargs): """Signal called when new user is created, required only when CMS_PERMISSION. Assign...
bsd-3-clause
ramadhane/odoo
addons/project/__openerp__.py
259
2562
# -*- 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
zhsso/ubunto-one
src/backends/filesync/utilities/keyword_script.py
6
4521
#!/usr/bin/env python # Copyright 2008-2015 Canonical # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This...
agpl-3.0
steedos/odoo
addons/account/edi/invoice.py
342
13984
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
DolphinDream/sverchok
utils/curve/knotvector.py
1
8165
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE # # Adopted from Geomdl library: ht...
gpl-3.0
jmp0xf/raven-python
raven/transport/base.py
19
1335
""" raven.transport.base ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import class Transport(object): """ All transport implementations need to subclass this class You mus...
bsd-3-clause
cwisecarver/osf.io
api/users/urls.py
12
1402
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.UserList.as_view(), name=views.UserList.view_name), url(r'^(?P<user_id>\w+)/$', views.UserDetail.as_view(), name=views.UserDetail.view_name), url(r'^(?P<user_id>\w+)/addons/$', views.UserAddonList.as_view(), name=views.U...
apache-2.0
Mellthas/quodlibet
quodlibet/quodlibet/qltk/menubutton.py
2
1425
# Copyright 2011, 2014 Christoph Reiter # # 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. from gi.repository import Gtk...
gpl-2.0
whn09/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/wishart_test.py
38
14437
# 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
ADM91/PowerSystem-RL
system/line_connection_cases/within_energized.py
1
3779
import numpy as np from system.take_snapshot import take_snapshot from copy import deepcopy def within_energized(ps, island_1, bus_ids, spad_lim): # Take preliminary snapshot of the system state_list, island_list = take_snapshot(ps, 'Preliminary state', [], []) # Set opf constraint to SPA diff # Mak...
gpl-3.0
spinellic/Mission-Planner
Lib/getpass.py
62
5742
"""Utilities to get a password and/or the current user name. getpass(prompt[, stream]) - Prompt for a password, with echo turned off. getuser() - Get the user name from the environment or password database. GetPassWarning - This UserWarning is issued when getpass() cannot prevent echoing of the...
gpl-3.0
s3nk4s/flaskTutorials
FlaskApp/FlaskApp/venv/local/lib/python2.7/sre_compile.py
156
16427
# # Secret Labs' Regular Expression Engine # # convert template to internal format # # Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" import _sre, sys import sre_parse from sre_constants impo...
mit
ismailsunni/inasafe
safe_extras/raven/conf/remote.py
6
4164
from __future__ import absolute_import import logging import os import warnings from raven.utils.compat import PY2, text_type from raven.exceptions import InvalidDsn from raven.utils.encoding import to_string from raven.utils.urlparse import parse_qsl, urlparse ERR_UNKNOWN_SCHEME = 'Unsupported Sentry DSN scheme: {0...
gpl-3.0
ericgriffin/fflock
web2py/gluon/contrib/login_methods/motp_auth.py
44
4592
#!/usr/bin/env python import time from hashlib import md5 from gluon.dal import DAL def motp_auth(db=DAL('sqlite://storage.sqlite'), time_offset=60): """ motp allows you to login with a one time password(OTP) generated on a motp client, motp clients are available for practically all platfo...
apache-2.0
guorendong/iridium-browser-ubuntu
tools/telemetry/telemetry/core/backends/chrome/desktop_browser_finder_unittest.py
8
8800
# Copyright 2013 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 unittest from telemetry.core.backends.chrome import desktop_browser_finder from telemetry.core import browser_options from telemetry.core.platform imp...
bsd-3-clause
miyakz1192/neutron
neutron/plugins/sriovnicagent/sriov_nic_agent.py
15
14528
# Copyright 2014 Mellanox Technologies, Ltd # # 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 t...
apache-2.0
Oliver2213/NVDAYoutube-dl
addon/globalPlugins/nvdaYoutubeDL/youtube_dl/extractor/soundgasm.py
149
2041
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class SoundgasmIE(InfoExtractor): IE_NAME = 'soundgasm' _VALID_URL = r'https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_\-]+)/(?P<title>[0-9a-zA-Z_\-]+)' _TEST = { 'url': 'http://soundgasm....
gpl-2.0
hasgeek/coaster
coaster/views/misc.py
1
6508
""" Miscellaneous view helpers -------------------------- Helper functions for view handlers. All items in this module can be imported directly from :mod:`coaster.views`. """ from urllib.parse import urlsplit import re from flask import Response, current_app, json, request from flask import session as request_sessi...
bsd-2-clause
yavalvas/yav_com
build/matplotlib/doc/mpl_examples/axes_grid/demo_edge_colorbar.py
11
2597
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import AxesGrid def get_demo_image(): import numpy as np from matplotlib.cbook import get_sample_data f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False) z = np.load(f) # z is a numpy array of 15x15 return z, (-3,4,...
mit
ramaganapathy1/AMuDA-Ir-back-end
vEnv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/version.py
1151
11556
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import collections import itertools import re from ._structures import In...
mit
Nirvedh/CoarseCoherence
src/arch/x86/isa/insts/__init__.py
91
2409
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
mozilla/django-badger
badger/templatetags/badger_tags.py
3
2006
# django import django from django import template from django.conf import settings from django.shortcuts import get_object_or_404 from badger.models import Award, Badge from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse import hashlib import urllib from django.utils....
bsd-3-clause
curiosityio/taiga-docker
taiga-back/taiga-back/taiga/projects/attachments/api.py
3
3874
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can redistribute it and/or mo...
mit
kalebhartje/schoolboost
cms/envs/acceptance_static.py
3
2314
""" This config file extends the test environment configuration so that we can run the lettuce acceptance tests. This is used in the django-admin call as acceptance.py contains random seeding, causing django-admin to create a random collection """ # We intentionally define lots of variables that aren't used, and # wan...
agpl-3.0
egoid/baytree
lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/generation.py
68
4298
""" This module contains functions that generate ctypes prototypes for the GDAL routines. """ from ctypes import c_char_p, c_double, c_int, c_int64, c_void_p from functools import partial from django.contrib.gis.gdal.prototypes.errcheck import ( check_arg_errcode, check_const_string, check_errcode, check_geom, ...
mit
digibyte/digibyte
contrib/gitian-build.py
1
12593
#!/usr/bin/env python3 import argparse import os import subprocess import sys def setup(): global args, workdir programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget'] if args.kvm: programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils'] elif args.docker: dockers = ['docker.io',...
mit
asterix135/infonex_crm
home/views.py
1
9135
import datetime from calendar import monthrange, month_name from pprint import pprint from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.db.models import Count, Sum from django.http import HttpResponse from django.views.generic import TemplateView from d...
mit
supriyasingh01/github_basics
Internetworking Distributed Project/finalProject/ovs/pox-master/pox/openflow/nicira_ext.py
32
3980
# Copyright 2011 Andreas Wundsam # # This file is part of POX. # # POX 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. # # POX is distr...
cc0-1.0