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
Mafarricos/Mafarricos-modded-xbmc-addons
plugin.video.xbmctorrentV2/resources/site-packages/xbmcswift2/storage.py
32
6201
''' xbmcswift2.storage ~~~~~~~~~~~~~~~~~~ This module contains persistent storage classes. :copyright: (c) 2012 by Jonathan Beluch :license: GPLv3, see LICENSE for more details. ''' import os import csv import json import time try: import cPickle as pickle except ImportError: import pickle...
gpl-2.0
2015fallproject/2015fallcase2
static/Brython3.2.2-20150927-180218/Lib/encodings/cp1125.py
34
35295
""" Python Character Mapping Codec for CP1125 """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): return codecs.charmap_decode(inp...
agpl-3.0
griphus812/p2pool
nattraverso/pynupnp/__init__.py
288
1088
""" This package offers ways to retreive ip addresses of the machine, and map ports through UPnP devices. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" from nattraverso.pynupnp.upnp import search...
gpl-3.0
wwj718/ANALYSE
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
8
13776
""" Methods for exporting course data to XML """ import logging import lxml.etree from xblock.fields import Scope, Reference, ReferenceList, ReferenceValueDict from xmodule.contentstore.content import StaticContent from xmodule.exceptions import NotFoundError from xmodule.modulestore import EdxJSONEncoder, ModuleStore...
agpl-3.0
yuanagain/seniorthesis
venv/lib/python2.7/site-packages/numpy/doc/basics.py
51
7870
""" ============ Array basics ============ Array types and conversions between types ========================================= Numpy supports a much greater variety of numerical types than Python does. This section shows which are available, and how to modify an array's data-type. ========== =======================...
mit
robertwb/incubator-beam
sdks/python/apache_beam/examples/snippets/transforms/elementwise/values.py
5
1296
# coding=utf-8 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License");...
apache-2.0
apark263/tensorflow
tensorflow/python/compat/v2_compat.py
7
2664
# Copyright 2018 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
PeterDaveHello/eden
languages/en-gb.py
5
15095
# -*- coding: utf-8 -*- { "A volunteer is defined as active if they've participated in an average of 8 or more hours of Program work or Trainings per month in the last year": "A volunteer is defined as active if they've participated in an average of 8 or more hours of Programme work or Trainings per month in the last y...
mit
MinFu/youtube-dl
youtube_dl/extractor/mofosex.py
87
1686
from __future__ import unicode_literals import os import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urllib_parse_urlparse, compat_urllib_request, ) class MofosexIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?P<url>mofosex\.com/videos/(?P<i...
unlicense
supermanue/distributedController
gridController/TaskLoader.py
1
2546
''' Created on Aug 20, 2012 @author: Manuel Rodriguez Pascual, <manuel.rodriguez.pascual@gmail.com> This file is part of gridwayController. gridwayController 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 ...
gpl-2.0
ddd332/presto
presto-docs/target/sphinx/reportlab/pdfbase/_fontdata_widths_timesitalic.py
56
3665
widths = {'A': 611, 'AE': 889, 'Aacute': 611, 'Acircumflex': 611, 'Adieresis': 611, 'Agrave': 611, 'Aring': 611, 'Atilde': 611, 'B': 611, 'C': 667, 'Ccedilla': 667, 'D': 722, 'E': 611, 'Eacute': 611, 'Ecircumflex': 611, 'Edieresis': 611, 'Egrave': 611, 'Eth': 722, 'Euro': 500, 'F': 611, 'G': 722, '...
apache-2.0
ujuo/opencv
opencv-3.2.0/samples/python/mosse.py
4
6435
#!/usr/bin/env python ''' MOSSE tracking sample This sample implements correlation-based tracking approach, described in [1]. Usage: mosse.py [--pause] [<video source>] --pause - Start with playback paused at the first video frame. Useful for tracking target selection. Draw rectangles around ...
gpl-3.0
CospanDesign/nysa-tx1-pcie-platform
tx1_pcie/demo/tx1_pcie/site_scons/site_tools/coregen.py
4
3362
#Distributed under the MIT licesnse. #Copyright (c) 2013 Cospan Design (dave.mccoy@cospandesign.com) #Permission is hereby granted, free of charge, to any person obtaining a copy of #this software and associated documentation files (the "Software"), to deal in #the Software without restriction, including without limit...
mit
tschuy/doc8
doc8/checks.py
1
10087
# Copyright (C) 2014 Ivan Melnikov <iv at altlinux dot org> # # Author: Joshua Harlow <harlowja@yahoo-inc.com> # # 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/l...
apache-2.0
luo66/scikit-learn
sklearn/feature_selection/rfe.py
64
17509
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import warnings import numpy as np from ..utils import check_X_y, safe_sqr fro...
bsd-3-clause
bobcyw/django
tests/utils_tests/test_decorators.py
319
4870
from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, SimpleTestCase from django.utils.decorators import classproperty, decorator_from_middleware class ProcessViewMiddleware(object): def process_view(s...
bsd-3-clause
Hawaii-Smart-Energy-Project/Maui-Smart-Grid
test/test_msg_db_exporter.py
1
20632
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Daniel Zhang (張道博)' __copyright__ = 'Copyright (c) 2014, University of Hawaii Smart Energy Project' __license__ = 'https://raw.github' \ '.com/Hawaii-Smart-Energy-Project/Maui-Smart-Grid/master/BSD' \ '-LICENSE.txt' import unittes...
bsd-3-clause
jessekl/flixr
venv/lib/python2.7/site-packages/pip/utils/build.py
899
1312
from __future__ import absolute_import import os.path import tempfile from pip.utils import rmtree class BuildDirectory(object): def __init__(self, name=None, delete=None): # If we were not given an explicit directory, and we were not given an # explicit delete option, then we'll default to del...
mit
py4n6/pyflag
src/plugins/NetworkForensics/ViewFile.py
5
6946
""" This plugin provides reports for viewing of files in special ways. For example we are able to display properly sanitised html with matched images etc. """ # Michael Cohen <scudette@users.sourceforge.net> # # ****************************************************** # Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 1...
gpl-2.0
jtyr/ansible-modules-core
network/nxos/nxos_vrf_af.py
27
13481
#!/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
garym/dotfiles
qtile/.config/qtile/config.py
1
9145
import os import subprocess from typing import List from libqtile.config import Click, Drag, EzKey, Group, Key, Screen from libqtile.command import lazy from libqtile import bar, extension, hook, layout, widget def executable(p): return os.path.isfile(p) and os.access(p, os.X_OK) def which(command): filepa...
apache-2.0
leilihh/cinder
cinder/tests/unit/test_misc.py
35
2241
# Copyright 2010 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
OpusVL/odoo
addons/auth_signup/controllers/main.py
8
5956
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
d3trax/asuswrt-merlin
release/src/router/samba36/source4/scripting/python/samba/idmap.py
19
3269
#!/usr/bin/env python # Unix SMB/CIFS implementation. # Copyright (C) 2008 Kai Blin <kai@samba.org> # # # 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...
gpl-2.0
oliviermartin/pyOCD
pyOCD/pyDAPAccess/dap_access_api.py
1
5018
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 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 ...
apache-2.0
Gaia3D/QGIS
python/console/console_output.py
10
12420
# -*- coding:utf-8 -*- """ /*************************************************************************** Python Console for QGIS ------------------- begin : 2012-09-10 copyright : (C) 2012 by Salvatore Larosa email : lrssvtml (at) gmail (dot) com ***...
gpl-2.0
saez0pub/ansible-modules-extras
system/capabilities.py
79
6980
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Nate Coraor <nate@bx.psu.edu> # # 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...
gpl-3.0
mahinthjoe/bedrock
bedrock/mozorg/tests/__init__.py
19
1045
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from contextlib import contextmanager from django.test import TestCase from django.utils.translation import get_languag...
mpl-2.0
tuxlifan/moneyguru
qt/support/item_delegate.py
4
6412
# -*- coding: utf-8 -*- # Created By: Virgil Dupras # Created On: 2010-01-07 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://w...
gpl-3.0
jhaydel/051616PoC
10Leaf_PoC/helper_scripts/apply_udev.py
3
9405
#!/usr/bin/env python import os import re import time import argparse import subprocess parser = argparse.ArgumentParser(description='UDEV Remap Script -- Rename interfaces using UDEV Rules') parser.add_argument('-v','--verbose', action='store_true', help='enables verbose logging mode') parser.add...
mit
reviewboard/reviewboard
reviewboard/site/context_processors.py
10
2052
from __future__ import unicode_literals from django.contrib.auth.context_processors import PermLookupDict, PermWrapper from django.utils import six from reviewboard.site.models import LocalSite class AllPermsLookupDict(PermLookupDict): def __init__(self, user, app_label, perms_wrapper): super(AllPermsLo...
mit
audaciouscode/Books-Mac-OS-X
Versions/Books_3.0b4/Library of Congress.plugin/Contents/Resources/PyZ3950/z3950_2001.py
30
159770
#!/usr/bin/env python # Auto-generated from ../compiler/tests/z3950-2001.txt at Wed, 02 Jun 2004 15:30:47 +0000 from PyZ3950 import asn1 #module Module None KnownProximityUnit=asn1.INTEGER_class ([('character',1),('word',2),('sentence',3),('paragraph',4),('section',5),('chapter',6),('document',7),('element',8),('subele...
mit
GeekTrainer/Flask
Work/Trivia - Module 5/env/Lib/site-packages/jinja2/debug.py
620
10980
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
apache-2.0
garbled1/ansible
lib/ansible/modules/network/nxos/nxos_evpn_vni.py
23
10578
#!/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
chris-chris/tensorflow
tensorflow/contrib/learn/python/learn/learn_runner_test.py
3
15201
# 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
PoornimaNayak/autotest-client-tests
linux-tools/tog_pegasus/tog_pegasus.py
4
1230
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class tog_pegasus(test.test): """ Autotest module for testing basic functionality of tog_pegasus @author CSDL James He <hejianj@cn.ibm.com> """ version = 1 nfail ...
gpl-2.0
chipx86/reviewboard
reviewboard/admin/management/commands/dumpdb.py
2
1838
"""Management command to dump data from the database.""" from __future__ import unicode_literals import sys import textwrap from djblets.util.compat.django.core.management.base import BaseCommand class Command(BaseCommand): """Management command to dump data from the database.""" help = ( "[No lon...
mit
sriks/titanium_mobile
support/common/markdown/etree_loader.py
136
1287
from markdown import message, CRITICAL import sys ## Import def importETree(): """Import the best implementation of ElementTree, return a module object.""" etree_in_c = None try: # Is it Python 2.5+ with C implemenation of ElementTree installed? import xml.etree.cElementTree as etree_in_c exce...
apache-2.0
ckolumbus/ReTextWiki.donotuse
ReTextWiki/whooshif.py
1
1369
__author__ = 'CKolumbus' import shutil from multiprocessing import Process import codecs from whoosh.index import create_in, open_dir from whoosh.qparser import QueryParser, RegexPlugin from PyQt4.QtCore import (QDir) class Whoosh(): def __init__(self, indexDir, schema): self.indexDir = indexDir ...
gpl-3.0
dsolimando/Hot
hot-jython-modules/src/main/resources/test/bugs/pr192.py
31
1816
# PR#192, dir(func) and dir(method) returning [] def test1(): 'Test function 1' pass def test2(a, b=2, c=3): pass attrs = dir(test1)[:] for attr in ['__doc__', '__name__', 'func_code', 'func_defaults', 'func_doc', 'func_globals', 'func_name']: attrs.remove(attr) assert not attrs assert ...
gpl-3.0
siliconsmiley/QGIS
python/ext-libs/pytz/reference.py
839
3649
''' Reference tzinfo implementations from the Python docs. Used for testing against as they are only correct for the years 1987 to 2006. Do not use these for real code. ''' from datetime import tzinfo, timedelta, datetime from pytz import utc, UTC, HOUR, ZERO # A class building tzinfo objects for fixed-offset time zo...
gpl-2.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/jinja2-2.6/examples/bench.py
75
10922
"""\ This benchmark compares some python templating engines with Jinja 2 so that we get a picture of how fast Jinja 2 is for a semi real world template. If a template engine is not installed the test is skipped.\ """ import sys import cgi from timeit import Timer from jinja2 import Environment as JinjaEnvi...
bsd-3-clause
Byron/bit
src/python/zfs/sql/reports/reserve.py
1
7654
#-*-coding:utf-8-*- """ @package zfs.sql.reports.reserve @brief A report to compute zfs reserve configuration for configured filesystems @author Sebastian Thiel @copyright [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl.html) """ __all__ = ['ZReserveReportGenerator'] from datetime import (dateti...
lgpl-3.0
chengdh/openerp-ktv
openerp/pychart/afm/Palatino_Roman.py
15
1511
# -*- coding: utf-8 -*- # AFM font Palatino-Roman (path: /usr/share/fonts/afms/adobe/pplr8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. import dir dir.afm["Palatino-Roman"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, ...
agpl-3.0
szopu/django
tests/proxy_models/tests.py
24
15759
from __future__ import unicode_literals from django.apps import apps from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django.core import management from django.core import checks from django.db import models, DEFAULT_DB_ALIAS from django.db.models import signals from dja...
bsd-3-clause
pilou-/ansible
lib/ansible/modules/network/cnos/cnos_l3_interface.py
38
15642
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2019 Lenovo, Inc. # (c) 2019, Ansible by Red Hat, inc # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the term...
gpl-3.0
vsergeev/python-periphery
periphery/__init__.py
1
1030
import time __version__ = "2.3.0" "Module version string." version = (2, 3, 0) "Module version tuple." def sleep(seconds): """Sleep for the specified number of seconds. Args: seconds (int, long, float): duration in seconds. """ time.sleep(seconds) def sleep_ms(milliseconds): """Sleep...
mit
mapgears/scribeui
scribeui_pyramid/modules/webui/fields.py
1
1181
# -*- coding: utf-8 -*- import datetime from wtforms import ( IntegerField, FloatField, DateTimeField ) class IntegerFieldFr(IntegerField): def process_formdata(self, valuelist): if valuelist: try: self.data = int(valuelist[0]) except ValueError: ...
mit
midhunsudhakar/test
demo/bower_components/bootstrap/test-infra/s3_cache.py
1700
3523
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
timdiels/zeroinstall
tests/testrun.py
1
3130
#!/usr/bin/env python from basetest import BaseTest import os, sys, subprocess import unittest from StringIO import StringIO sys.path.insert(0, '..') from zeroinstall.injector import policy, run from zeroinstall import SafeException mydir = os.path.abspath(os.path.dirname(__file__)) local_0launch = os.path.join(os.p...
lgpl-2.1
guschmue/tensorflow
tensorflow/contrib/distributions/python/ops/vector_sinh_arcsinh_diag.py
10
11264
# 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
tornadozou/tensorflow
tensorflow/contrib/seq2seq/python/kernel_tests/beam_search_ops_test.py
15
5583
# 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
codervince/flashingredlight
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
375
5760
from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. """ s...
mit
fubecka/f5-dashboard
flask/lib/python2.6/site-packages/openid/yadis/xri.py
167
4383
# -*- test-case-name: openid.test.test_xri -*- """Utility functions for handling XRIs. @see: XRI Syntax v2.0 at the U{OASIS XRI Technical Committee<http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xri>} """ import re XRI_AUTHORITIES = ['!', '=', '@', '+', '$', '('] try: unichr(0x10000) except ValueErr...
apache-2.0
nicholasmalaya/arcanus
uq/ps2/prior.py
2
1252
#!/usr/bin/env python # import numpy as np from settings_infer import * def prior_a(a): """ Log Prior for alpha """ mymean = 0.5 myvar = 1 return logGaussian(mymean, myvar**2, a) def prior_S(s): """ Log Prior for sigma """ smin = 0.0 smax = 2.0 if (s >= smin) a...
mit
brianjgeiger/osf.io
api_tests/crossref/views/test_crossref_email_response.py
7
9310
import mock import pytest import hmac import hashlib import lxml.etree from django.utils import timezone from osf_tests import factories from website import settings @pytest.mark.django_db class TestCrossRefEmailResponse: def make_mailgun_payload(self, crossref_response): mailgun_payload = { ...
apache-2.0
swdream/neutron
neutron/tests/unit/extensions/test_external_net.py
24
7777
# 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
Letractively/rdflib
examples/swap_primer.py
3
3262
# http://www.w3.org/2000/10/swap/Primer # This is a simple primer using some of the # example stuff in the above Primer on N3 # get RDFLib at http://rdflib.net/ # Load up RDFLib from rdflib import * from rdflib.graph import ConjunctiveGraph from rdflib.namespace import Namespace from rdflib.term import URIRef fro...
bsd-3-clause
jendap/tensorflow
tensorflow/contrib/slim/python/slim/nets/resnet_v2.py
39
14547
# 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
kazcw/bitcoin
test/util/rpcauth-test.py
32
1748
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test share/rpcauth/rpcauth.py """ import base64 import configparser import hmac import importlib import...
mit
ajaali/django
tests/flatpages_tests/test_sitemaps.py
380
1326
from __future__ import unicode_literals from django.apps import apps from django.contrib.sites.models import Site from django.test import TestCase from django.test.utils import modify_settings, override_settings @override_settings( ROOT_URLCONF='flatpages_tests.urls', SITE_ID=1, ) @modify_settings( INSTA...
bsd-3-clause
ylatuya/cerbero
cerbero/tools/libtool.py
21
4532
#!/usr/bin/env python # cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free So...
lgpl-2.1
pkuyym/Paddle
tools/continuous_integration/bisect.py
12
4828
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
PlayUAV/MissionPlanner
Lib/site-packages/numpy/core/_internal.py
53
18020
#A place for code to be called from C-code # that implements more complicated stuff. import re import sys import warnings from numpy.compat import asbytes, bytes if (sys.byteorder == 'little'): _nbo = asbytes('<') else: _nbo = asbytes('>') def _makenames_list(adict): from numpy.core import dtype al...
gpl-3.0
c4goldsw/shogun
examples/undocumented/python_modular/features_director_dot_modular.py
26
3074
#!/usr/bin/env python import numpy from tools.load import LoadMatrix lm=LoadMatrix() traindat = lm.load_numbers('../data/fm_train_real.dat') testdat = lm.load_numbers('../data/fm_test_real.dat') label_traindat = lm.load_labels('../data/label_train_twoclass.dat') parameter_list = [[traindat,testdat,label_traindat,0.9,...
gpl-3.0
ted-gould/nova
nova/objects/instance_numa_topology.py
15
7900
# Copyright 2014 Red Hat 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 ag...
apache-2.0
HuaweiSwitch/ansible
lib/ansible/modules/cloud/amazon/lightsail.py
68
16237
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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
MusculoskeletalAtlasProject/mapclient
tests/test_resources/updater_test/mayaviviewerstep-master/mapclientplugins/mayaviviewerstep/viewerobjects/mayaviviewergiasscan.py
2
3580
""" MAP Client, a program to generate detailed musculoskeletal models for OpenSim. Copyright (C) 2012 University of Auckland This file is part of MAP Client. (http://launchpad.net/mapclient) MAP Client is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
gpl-3.0
HaebinShin/tensorflow
tensorflow/g3doc/how_tos/adding_an_op/zero_out_op_3.py
190
1053
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
DD-L/deel.boost.python
revise/libs/python/pyste/tests/virtual2UT.py
13
1241
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest from _virtual2 import * class Virtual2Test(unittest.TestCase): ...
mit
pombredanne/http-repo.gem5.org-gem5-
src/dev/virtio/VirtIOConsole.py
50
2518
# -*- mode:python -*- # Copyright (c) 2014 ARM Limited # 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 implementatio...
bsd-3-clause
dcherian/pyroms
pyroms_toolbox/pyroms_toolbox/seawater/__init__.py
2
2277
# --- encoding: iso-8859-1 --- """ Seawater -- Python functions for properties of sea water Bjørn Ådlandsvik <bjorn@imr.no>, Institute of Marine Research, Version 1.1, 13 November 2002 Public functions: Density related dens(S,T,P) Density of sea water kg/m**3 delta(S,T,P) ...
bsd-3-clause
yourcelf/btb
scanblog/moderation/views.py
2
28270
# -*- coding: utf-8 -*- import json import re from collections import defaultdict from difflib import SequenceMatcher from datetime import datetime, timedelta #from moderation.diff_match_patch import * from django.shortcuts import render, redirect from django.contrib.auth.decorators import permission_required, login_...
agpl-3.0
hongguangguo/shogun
examples/undocumented/python_modular/graphical/converter_jedi_bss.py
26
1108
""" Blind Source Separation using the JediSep Algorithm with Shogun Based on the example from scikit-learn http://scikit-learn.org/ Kevin Hughes 2013 """ import numpy as np import pylab as pl from modshogun import RealFeatures from modshogun import JediSep # Generate sample data np.random.seed(0) n_samples = 200...
gpl-3.0
zedr/django
django/http/response.py
3
16685
from __future__ import unicode_literals import datetime import json import sys import time from email.header import Header try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from django.conf import settings from django.core import signals from django.core import signing f...
bsd-3-clause
shinpeimuraoka/ryu
ryu/services/protocols/bgp/operator/command.py
9
9401
from collections import namedtuple import json import logging import pprint import re import six (STATUS_OK, STATUS_ERROR) = range(2) CommandsResponse = namedtuple('CommandsResponse', ['status', 'value']) LOG = logging.getLogger('bgpspeaker.operator.command') def default_help_formatter(quick_helps): """Apply d...
apache-2.0
chrisfranzen/django
tests/modeltests/custom_methods/tests.py
150
1196
from __future__ import absolute_import from datetime import date from django.test import TestCase from .models import Article class MethodsTests(TestCase): def test_custom_methods(self): a = Article.objects.create( headline="Area man programs in Python", pub_date=date(2005, 7, 27) )...
bsd-3-clause
zhanghenry/stocks
django/middleware/csrf.py
86
8801
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ from __future__ import unicode_literals import logging import re from django.conf import settings from django.core.urlresolvers import get_callable from django.utils...
bsd-3-clause
FiloSottile/youtube-dl
youtube_dl/downloader/hls.py
29
3706
from __future__ import unicode_literals import os import re import subprocess from ..postprocessor.ffmpeg import FFmpegPostProcessor from .common import FileDownloader from ..compat import ( compat_urlparse, compat_urllib_request, ) from ..utils import ( encodeArgument, encodeFilename, ) class HlsFD...
unlicense
40223247/2015_w11
static/Brython3.1.0-20150301-090019/Lib/unittest/signals.py
1016
2403
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.original_handler = default_handler if isinstance(default_handler, int): if default_handler == signal.SIG_D...
gpl-3.0
2014cdbg4/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/unittest/suite.py
748
9715
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(se...
gpl-2.0
chrsrds/scikit-learn
sklearn/ensemble/iforest.py
2
18270
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numbers import numpy as np from scipy.sparse import issparse from warnings import warn from ..tree import ExtraTreeRegressor from ..utils import ( che...
bsd-3-clause
mbrubeck/servo
tests/wpt/web-platform-tests/tools/third_party/attrs/src/attr/__init__.py
12
1165
from __future__ import absolute_import, division, print_function from functools import partial from . import converters, exceptions, filters, validators from ._config import get_run_validators, set_run_validators from ._funcs import asdict, assoc, astuple, evolve, has from ._make import ( NOTHING, Attribute, Fact...
mpl-2.0
analurandis/Tur
backend/venv/Lib/encodings/cp860.py
593
34937
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
mit
dmitriy0611/django
django/contrib/gis/db/models/functions.py
209
15213
from decimal import Decimal from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import AreaField from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.measure import ( Area as AreaMeasure, Distance as DistanceMeasure, ) from django.core.ex...
bsd-3-clause
micadeyeye/Blongo
django/views/csrf.py
289
3834
from django.http import HttpResponseForbidden from django.template import Context, Template from django.conf import settings # We include the template inline since we need to be able to reliably display # this error message, especially for the sake of developers, and there isn't any # other way of making it available ...
bsd-3-clause
gymnasium/edx-platform
openedx/core/djangoapps/embargo/api.py
23
6954
""" The Python API layer of the country access settings. Essentially the middle tier of the project, responsible for all business logic that is not directly tied to the data itself. This API is exposed via the middleware(emabargo/middileware.py) layer but may be used directly in-process. """ import logging from djan...
agpl-3.0
gautamMalu/rootfs_xen_arndale
usr/lib/python2.7/xml/sax/saxutils.py
55
11556
"""\ A library of useful helper classes to the SAX classes, for the convenience of application and driver writers. """ import os, urlparse, urllib, types import io import sys import handler import xmlreader try: _StringTypes = [types.StringType, types.UnicodeType] except AttributeError: _StringTypes = [types....
gpl-2.0
fluentstream/asterisk-p2p
res/pjproject/tests/cdash/cfg_symbian.py
107
2807
# # cfg_symbian.py - Symbian target configurator # # Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) # # 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, ...
gpl-2.0
tomchristie/django
tests/expressions_case/tests.py
7
51443
import unittest from datetime import date, datetime, time, timedelta from decimal import Decimal from operator import attrgetter, itemgetter from uuid import UUID from django.core.exceptions import FieldError from django.db import connection, models from django.db.models import F, Max, Min, Q, Sum, Value from django.d...
bsd-3-clause
Iwan-Zotow/Fiducial
import_Ocup.py
1
13104
# coding: utf-8 import sys import logging import math from functools import partial import OCC.TopoDS import OCC.Display.SimpleGui import aocutils.display.topology import aocutils.display.backends import aocxchange.step import aocxchange.utils from XcMath import utils from point2d import point2d fro...
mit
vFense/vFenseAgent-nix
agent/deps/rpm-32/Python-2.7.5/lib/python2.7/lib2to3/fixes/fix_filter.py
326
2107
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This...
lgpl-3.0
aethaniel/CMSIS-DAP
tools/paths.py
20
1672
""" CMSIS-DAP Interface Firmware Copyright (c) 2009-2013 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 la...
apache-2.0
erikdejonge/newsrivr
daemons/python2/d_utils.py
1
4788
from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import str import os import re import cgi import sys import inspect import calendar import string import time import copy import Image import datetime import urllib.parse import urllib.request, url...
gpl-2.0
kustodian/ansible
lib/ansible/modules/network/aci/mso_schema_template_anp_epg.py
13
10590
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, 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
jeroen-corteville/izegem
node_modules/deflate-js/test/deflate.py
177
2329
import os from colorama import Fore from helpers import deflate, inflate, run_cmd outDirDefault = 'test-outs' testDirDefault = 'test-files' """ Run a single test @param tFile- required; the full path to the file to run @param level- optional (default: all); the compression level [1-9] @param delete- optional (defaul...
mit
boyuegame/kbengine
kbe/res/scripts/common/Lib/encodings/iso8859_8.py
272
11036
""" Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
lgpl-3.0
glucoseinc/naumanni-server
naumanni/cli/cli_main.py
2
1996
# -*- coding: utf-8 -*- """CLI Main.""" from itertools import groupby import logging import os import re import sys # community module import click from click.core import Context import naumanni from naumanni.core import NaumanniApp import naumanni.web.server # project module logger = logging.getLogger(__name__) ...
agpl-3.0
sbalde/edx-platform
lms/djangoapps/instructor/tests/test_spoc_gradebook.py
45
6129
""" Tests of the instructor dashboard spoc gradebook """ from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from student.tests.factories import UserFactory, CourseEnrollmentFactory, AdminFactory from xmodule.modul...
agpl-3.0
dan-cristian/haiot
apps/esp8266_pwm_load/main.py
1
1104
import wifi import mqtt import pwm import time import machine from credentials import ssid, password, mqtt_pass, mqtt_user import esp import webrepl mqtt_server = "192.168.0.12" def restart_and_reconnect(): print('Restarting ESP...') time.sleep(5) machine.reset() def main(): esp.osdebug(None) p...
gpl-2.0