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
bigzz/autotest
client/local_host_unittest.py
4
4392
#!/usr/bin/python import os import unittest try: import autotest.common as common except ImportError: import common from autotest.client.shared.test_utils import mock from autotest.client.shared import autotemp from autotest.client import local_host class test_local_host_class(unittest.TestCase): def ...
gpl-2.0
huggingface/transformers
tests/test_modeling_auto.py
2
11888
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 requir...
apache-2.0
dbaxa/django
tests/middleware/tests.py
132
34932
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import random import re from io import BytesIO from unittest import skipIf from django.conf import settings from django.core import mail from django.core.exceptions import PermissionDenied from django.http import ( FileResponse, HttpReque...
bsd-3-clause
CanalTP/navitia
source/jormungandr/jormungandr/scenarios/utils.py
1
16235
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
mattrobenolt/warehouse
warehouse/helpers.py
1
2146
# Copyright 2013 Donald Stufft # # 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, so...
apache-2.0
GheRivero/ansible
lib/ansible/modules/network/f5/bigip_device_group_member.py
8
7464
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
webrtc/apprtc
src/third_party/httplib2/iri2uri.py
706
3828
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The character...
bsd-3-clause
alaski/nova
nova/virt/driver.py
3
64220
# Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
marissazhou/django
tests/apps/tests.py
54
16296
from __future__ import unicode_literals import os import warnings from unittest import skipUnless from django.apps import AppConfig, apps from django.apps.registry import Apps from django.contrib.admin.models import LogEntry from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.db i...
bsd-3-clause
shriker/sublime
Packages/pygments/all/pygments/lexers/eiffel.py
47
2482
# -*- coding: utf-8 -*- """ pygments.lexers.eiffel ~~~~~~~~~~~~~~~~~~~~~~ Lexer for the Eiffel language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, words from pygments.token import ...
mit
Vishluck/sympy
sympy/core/tests/test_count_ops.py
40
4575
from sympy import symbols, sin, exp, cos, Derivative, Integral, Basic, \ count_ops, S, And, I, pi, Eq, Or, Not, Xor, Nand, Nor, Implies, \ Equivalent, MatrixSymbol, Symbol, ITE from sympy.core.containers import Tuple x, y, z = symbols('x,y,z') a, b, c = symbols('a,b,c') def test_count_ops_non_visual(): de...
bsd-3-clause
junbochen/pylearn2
pylearn2/cross_validation/__init__.py
19
7665
""" Cross validation module. Each fold of cross validation is a separate experiment, so we create a separate Train object for each model and save all of the models together. pylearn2/scripts/print_monitor_average.py can be used to analyze average monitor channel values for the collection of saved models. """ __autho...
bsd-3-clause
fuentesdt/InsightToolkit-dev
Wrapping/Generators/SwigInterface/pygccxml-1.0.0/pygccxml/declarations/decl_factory.py
14
3424
# Copyright 2004-2008 Roman Yakovenko. # Distributed under 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) """ defines default declarations factory class """ from calldef import member_function_t from calldef import constructor_t fro...
apache-2.0
ghchinoy/tensorflow
tensorflow/python/framework/random_seed.py
3
9636
# 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
VishvajitP/Django-facebook
docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/vcs/bazaar.py
33
4494
import os import tempfile import re from pip import call_subprocess from pip.log import logger from pip.util import rmtree, display_path from pip.vcs import vcs, VersionControl from pip.download import path_to_url2 class Bazaar(VersionControl): name = 'bzr' dirname = '.bzr' repo_name = 'branch' bundle...
bsd-3-clause
anryko/ansible
lib/ansible/modules/network/fortios/fortios_wireless_controller_wtp_group.py
7
12780
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
vitmod/enigma2-test
lib/python/Components/Renderer/FrontpanelLed.py
51
1163
from Components.Element import Element from os import path # this is not a GUI renderer. class FrontpanelLed(Element): def __init__(self, which=0, patterns=None, boolean=True): if not patterns: patterns = [(20, 0, 0xffffffff), (20, 0x55555555, 0x84fc8c04)] self.which = which self.boolean = boolean self.pattern...
gpl-2.0
svr93/node-gyp
gyp/pylib/gyp/MSVSProject.py
2736
6387
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
mit
ppmt/Crust
flask/lib/python2.7/site-packages/werkzeug/contrib/sessions.py
295
12450
# -*- coding: utf-8 -*- r""" werkzeug.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains some helper classes that help one to add session support to a python WSGI application. For full client-side session storage see :mod:`~werkzeug.contrib.securecookie` which implements a secure,...
gpl-2.0
bmanojlovic/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py
25
5243
#!/usr/bin/python # # 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 distributed in the hope that i...
gpl-3.0
songmonit/CTTMSONLINE_V8
openerp/addons/base/module/module.py
83
37402
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
TShapinsky/ardupilot
Tools/autotest/param_metadata/xmlemit.py
238
2717
#!/usr/bin/env python from xml.sax.saxutils import escape, quoteattr from param import * from emit import Emit # Emit APM documentation in an machine readable XML format class XmlEmit(Emit): def __init__(self): wiki_fname = 'apm.pdef.xml' self.f = open(wiki_fname, mode='w') preamble ...
gpl-3.0
othieno/geotagx-tool-validator
setup.py
1
1832
#!/usr/bin/env python # # This setup script is inspired by code from the Pip setup.py found # here: https://github.com/pypa/pip/blob/develop/setup.py import os, re, codecs from setuptools import setup, find_packages cwd = os.path.abspath(os.path.dirname(__file__)) def read(*parts): # intentionally *not* adding a...
mit
mtrbean/scipy
scipy/sparse/linalg/isolve/utils.py
108
3840
from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = [] from warnings import warn from numpy import asanyarray, asarray, asmatrix, array, matrix, zeros from scipy.sparse.linalg.interface import aslinearoperator, LinearOperator, \ IdentityOperator _c...
bsd-3-clause
SUSE/swift
swift/account/server.py
3
15898
# Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
shepdelacreme/ansible
lib/ansible/module_utils/facts/network/sunos.py
170
4805
# 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 in the hope that ...
gpl-3.0
applicationdevm/XlsxWriter
xlsxwriter/test/comparison/test_cond_format06.py
8
1590
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
kvar/ansible
lib/ansible/modules/cloud/amazon/aws_caller_info.py
12
3793
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: aws_caller_info short_des...
gpl-3.0
cparawhore/ProyectoSubastas
site-packages/django/db/backends/__init__.py
48
57758
import datetime import time import warnings try: from django.utils.six.moves import _thread as thread except ImportError: from django.utils.six.moves import _dummy_thread as thread from collections import namedtuple from contextlib import contextmanager from importlib import import_module from django.conf imp...
mit
mattilyra/scikit-learn
doc/datasets/mldata_fixture.py
367
1183
"""Fixture module to skip the datasets loading when offline Mock urllib2 access to mldata.org and create a temporary data folder. """ from os import makedirs from os.path import join import numpy as np import tempfile import shutil from sklearn import datasets from sklearn.utils.testing import install_mldata_mock fr...
bsd-3-clause
opencloudinfra/orchestrator
venv/Lib/site-packages/setuptools/package_index.py
95
39490
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib import itertools from functools import wraps try: from urllib.parse import splituser except ImportError: from urllib2 import splituser from setuptools.extern import six from setupt...
gpl-3.0
greguu/linux-4.4-cxx00
scripts/gdb/linux/dmesg.py
630
1991
# # gdb helper commands and functions for Linux kernel debugging # # kernel log buffer dump # # Copyright (c) Siemens AG, 2011, 2012 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import utils class LxDmesg(gdb.Command...
gpl-2.0
tomasreimers/tensorflow-emscripten
tensorflow/contrib/learn/python/learn/learn_io/__init__.py
37
2375
# 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
pfederl/CARTAvis
carta/html5/common/skel/source/class/skel/simulation/tView.py
2
2691
import unittest import Util import time import selectBrowser from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions as EC from s...
gpl-2.0
jacquesd/indico
indico_zodbimport/modules/event_managers.py
2
8350
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
ramcn/demo3
venv/lib/python3.4/site-packages/django/core/checks/security/sessions.py
477
2595
from django.conf import settings from .. import Tags, Warning, register def add_session_cookie_message(message): return message + ( " Using a secure-only session cookie makes it more difficult for " "network traffic sniffers to hijack user sessions." ) W010 = Warning( add_session_cookie_...
mit
morissette/devopsdays-hackathon-2016
venv/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/_collections.py
484
10454
from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): pass try: # Python 2.7+ from ...
gpl-3.0
uw-it-aca/django-panopto-scheduler
scheduler/test/api/test_space.py
1
1024
from django.test import TestCase from django.test.client import RequestFactory from django.urls import reverse_lazy from scheduler.views.api.space import Space import json import logging # silence suds debugging telemetry logging.getLogger('suds').setLevel(logging.ERROR) class TestAPISpace(TestCase): def test_g...
apache-2.0
invisiblek/python-for-android
python-build/python-libs/gdata/src/gdata/oauth/rsa.py
225
4528
#!/usr/bin/python """ requires tlslite - http://trevp.net/tlslite/ """ import binascii from gdata.tlslite.utils import keyfactory from gdata.tlslite.utils import cryptomath # XXX andy: ugly local import due to module name, oauth.oauth import gdata.oauth as oauth class OAuthSignatureMethod_RSA_SHA1(oauth.OAuthSign...
apache-2.0
torchingloom/edx-platform
common/test/acceptance/pages/lms/open_response.py
165
4579
""" Open-ended response in the courseware. """ from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from .rubric import RubricPage class OpenResponsePage(PageObject): """ Open-ended response in the courseware. """ url = None def is_browser_on_page(self): ...
agpl-3.0
wkew/FTMSVisualization
1-FormulaAssignment.py
1
20514
# -*- coding: utf-8 -*- """ Created on Sat Sep 12 14:58:25 2015 @author: Will Kew will.kew@gmail.com Copyright Will Kew, 2016 This file is part of FTMS Visualisation (also known as i-van Krevelen). FTMS Visualisation is free software: you can redistribute it and/or modify it under the terms of the G...
gpl-3.0
duyetdev/openerp-6.1.1
openerp/addons/l10n_th/__init__.py
893
1045
# -*- 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
SAM-IT-SA/odoo
addons/purchase_requisition/purchase_requisition.py
43
23545
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
ericzolf/ansible
lib/ansible/plugins/netconf/__init__.py
16
16999
# # (c) 2017 Red Hat Inc. # # 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 d...
gpl-3.0
ppwwyyxx/tensorflow
tensorflow/python/ops/metrics_impl.py
3
165835
# 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 applicabl...
apache-2.0
harayz/raspberry_pwn
src/pentest/metagoofil/hachoir_parser/audio/mod.py
9
5015
""" Parser of FastTrackerII Extended Module (XM) version 1.4 Documents: - Modplug source code (file modplug/soundlib/Load_mod.cpp) http://sourceforge.net/projects/modplug - Dumb source code (files include/dumb.h and src/it/readmod.c http://dumb.sf.net/ - Documents on "MOD" format on Wotsit http://www.wotsit.org ...
gpl-3.0
nickgentoo/scikit-learn-graph
skgraph/feature_extraction/graph/ODDSTVectorizerListESN.py
1
1953
# -*- coding: utf-8 -*- """ Created on Fri Mar 20 17:40:07 2015 Copyright 2015 Nicolo' Navarin This file is part of scikit-learn-graph. scikit-learn-graph 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 ...
gpl-3.0
tukutela/heroku-buildpack-python
vendor/setuptools-2.1/setuptools/__init__.py
219
3317
"""Extensions to the 'distutils' for large or complex distributions""" import os import sys import distutils.core import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path import setuptools.version from setuptools.extension import Extension from setuptools.dist i...
mit
karllessard/tensorflow
tensorflow/lite/examples/python/label_image.py
8
3106
# 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
jfrey-xx/OpenBCI_Python
plugins/csv_collect.py
5
1546
import csv import timeit import datetime import plugin_interface as plugintypes class PluginCSVCollect(plugintypes.IPluginExtended): def __init__(self, file_name="collect.csv", delim = ",", verbose=False): now = datetime.datetime.now() self.time_stamp = '%d-%d-%d_%d-%d-%d'%(now.year,now.month,now.day,now.hour,no...
mit
koobs/Cactus
cactus/compat/page.py
9
1279
#coding:utf-8 import os import logging from cactus.utils.url import path_to_url logger = logging.getLogger(__name__) class PageContextCompatibilityPlugin(object): """ This plugin ensures that the page context stays backwards compatible, but adds deprecation warnings. """ def preBuildPage(self, ...
bsd-3-clause
mschenck/aurora
src/main/python/apache/aurora/config/port_resolver.py
14
1868
# # 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
OliverWalter/amdtk
amdtk/models/hpyp.py
1
12666
"""(Hierarchical) Pitman-Yor Process (HPYP) based language model.""" import numpy as np from numpy.random import multinomial, gamma, beta, uniform import random EMPTY_CONTEXT = tuple([-1]) SEQ_END_LABEL, SEQ_END = "</s>", 1 VOCAB_START = 2 class PitmanYorProcess(object): """Pitmay-Yor Process (PYP) based langu...
bsd-2-clause
MojieBuddhist/linux-1
scripts/rt-tester/rt-tester.py
1106
5305
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
auDeep/auDeep
audeep/backend/training/time_autoencoder.py
1
3871
# Copyright (C) 2017-2018 Michael Freitag, Shahin Amiriparian, Sergey Pugachevskiy, Nicholas Cummins, Björn Schuller # # This file is part of auDeep. # # auDeep 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,...
gpl-3.0
jingzhehu/udacity_mlnd
P4_Training_a_Smartcab_to_Drive/smartcab/pygame/examples/sound.py
32
1359
#!/usr/bin/env python """extremely simple demonstration playing a soundfile and waiting for it to finish. you'll need the pygame.mixer module for this to work. Note how in this simple example we don't even bother loading all of the pygame package. Just pick the mixer for sound and time for the delay function. Optiona...
mit
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/interpolate/tests/test_gil.py
1
2097
from __future__ import division, print_function, absolute_import import itertools import threading import time import numpy as np import scipy.interpolate from numpy.testing import TestCase, assert_equal, run_module_suite from numpy.testing.decorators import slow from scipy._lib._testutils import knownfailure_overrid...
mit
imeteora/cocos2d-x-3.x-Qt
tools/cocos2d-console/bin/install.py
25
2409
# # cocos console installation script. # # Script idea based on Homebrew installation script. # by Luis Parravicini. # import os import sys import urllib from tarfile import TarFile import shutil COCOS2D_PREFIX = os.path.expanduser('~/.cocos2d') # TODO copied from cocos.py, refactor. class Logging: # TODO mayb...
gpl-2.0
clever-crow-consulting/otm-core
opentreemap/geocode/tests.py
9
2287
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from treemap.tests.base import OTMTestCase from geocode.views import geocode from django.test.client import RequestFactory from django.http import HttpResponse from json import loads class MockGeocodeReque...
agpl-3.0
JavML/django
tests/forms_tests/widget_tests/test_datetimeinput.py
247
2367
from datetime import datetime from django.forms import DateTimeInput from django.test import override_settings from django.utils import translation from .base import WidgetTest class DateTimeInputTest(WidgetTest): widget = DateTimeInput() def test_render_none(self): self.check_html(self.widget, 'da...
bsd-3-clause
hirolovesbeer/sekiwake
syslog-forwarder/simple-syslog-server.py
1
1447
#!/usr/bin/env python ## Tiny Syslog Server in Python. ## ## This is a tiny syslog server that is able to receive UDP based syslog ## entries on a specified port and save them to a file. ## That's it... it does nothing else... ## There are a few configuration parameters. LOG_FILE = '/var/tmp/test.log' HOST, PORT = "0...
mit
VanirAOSP/kernel_oppo_n1
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
jat255/hyperspy
hyperspy/tests/learn/test_whitening.py
3
1476
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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-3.0
back-to/streamlink
src/streamlink/plugin/api/validate.py
5
12856
"""This module provides an API to validate and to some extent manipulate data structures, such as JSON and XML parsing results. Example usage: >>> validate(int, 5) 5 >>> validate({text: int}, {'foo': '1'}) ValueError: Type of '1' should be 'int' but is 'str' >>> validate({'foo': transform(int)...
bsd-2-clause
pennello/go_rebnf
tools/unicats.py
2
2267
# -*_ coding: utf-8 -*- # chris 073015 from HTMLParser import HTMLParser from argparse import ArgumentParser from contextlib import closing from os.path import commonprefix from urllib2 import urlopen base = 'http://www.fileformat.info/info/unicode/category' htmlunescape = HTMLParser().unescape # Get characters. d...
mit
sherjilozair/rnn_ctc
reccurent.py
4
1602
import theano import theano.tensor as tt from weights import init_wts, share class RecurrentLayer(): def __init__(self, inpt, nin, nunits, conv_sz=1, learn_init_state=True): # inpt is transposed a priori tablet_wd, _ = inpt.shape if conv_sz > 1: inpt_clipped = ...
apache-2.0
NeverNotKilza/MiscPythonCode
hint.py
1
2256
table = [ ["0xF", "0x7", "0x6", "0x4", "0x5", "0x1", "0x0", "0x2", "0x3", "0xB", "0xA", "0x8", "0x9", "0xD", "0xC", "0xE"], ["0x2", "0x3", "0xB", "0xA", "0x8", "0x9", "0xD", "0xC", "0xE", "0xF", "0x7", "0x6", "0x4", "0x5", "0x1", "0x0"], ["0x6", "0x4", "0x5", "0x1", "0x0", "0x2", "0x3", "0xB", "0xA", "0x8", ...
mit
adalke/rdkit
rdkit/Chem/Draw/aggCanvas.py
4
5894
# $Id$ # # Copyright (C) 2008 Greg Landrum # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # from aggdraw import Brush, Pen #@UnresolvedImport #py...
bsd-3-clause
cjh1/cumulus
cumulus/__init__.py
1
2069
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2015 Kitware 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 cop...
apache-2.0
TansyArron/pants
src/python/pants/backend/android/tasks/aapt_builder.py
14
4130
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
apache-2.0
tvnweb/grandprix
node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
mit
vfrc2/Flexget
flexget/plugins/parsers/plugin_parsing.py
15
3354
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event log = logging.getLogger('parsing') PARSER_TYPES = ['movie', 'series'] # Mapping of parser type to (mapping of parser name to plugin instance) parsers = {} # Mapping from parser...
mit
yotamfr/prot2vec
src/python/motifnet1.py
1
12175
import os # os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # os.environ["CUDA_VISIBLE_DEVICES"] = "1" from src.python.consts import * from src.python.preprocess import * from src.python.geneontology import * from src.python.baselines import * from pymongo import MongoClient from tqdm import tqdm import tensorflo...
mit
wakatime/komodo-wakatime
components/wakatime/packages/pygments/styles/manni.py
31
2374
# -*- coding: utf-8 -*- """ pygments.styles.manni ~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. This is a port of the style used in the `php port`_ of pygments by Manni. The style is called 'default' there. :copyright: Copyright 2006-2017 by the Pygments...
bsd-3-clause
cluck/freeipa
ipatests/test_integration/test_kerberos_flags.py
7
7154
# Authors: # Ana Krivokapic <akrivoka@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # 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...
gpl-3.0
pombredanne/spaCy
spacy/tests/serialize/test_huffman.py
4
3256
from __future__ import unicode_literals from __future__ import division import pytest from spacy.serialize.huffman import HuffmanCodec from spacy.serialize.bits import BitArray import numpy import math from heapq import heappush, heappop, heapify from collections import defaultdict def py_encode(symb2freq): ""...
mit
Wafflespeanut/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/__init__.py
658
4406
# Copyright 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 f...
mpl-2.0
cjhak/b2share
invenio/modules/upgrader/upgrades/invenio_2013_03_21_idxINDEX_stopwords.py
15
1812
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
tlakshman26/cinder-https-changes
cinder/volume/drivers/san/hp/hp_3par_fc.py
3
19991
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Copyright 2012 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...
apache-2.0
longaccess/longaccess-client
lacli/upload_simple.py
1
1686
import sys import os from lacore.async import block from twisted.internet import defer from lacore.adf.elements import Archive, Meta, Cipher from lacore.adf.persist import make_adf from lacore.api import RequestsFactory, UploadOperation from lacore.storage.s3 import S3Connection from lacore.dumper.s3 import S3Dumper ...
apache-2.0
ajayuranakar/django-blog
bin/activate_this.py
669
1129
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
gpl-3.0
MRigal/django
django/contrib/auth/context_processors.py
514
1938
# PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict(object): def __init__(self, user, app_label): self.user, self.app_label = user, app_label def __repr__(self): return str(self.user.get_all_permissions()) ...
bsd-3-clause
2014c2g19/2014c2g19
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/base64.py
733
13975
#! /usr/bin/env python3 """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support # Modified 22-May-2007 by Guido van Rossum to use bytes everywhere import re import struct import binascii _...
gpl-2.0
liuji21/libvirt
src/hyperv/hyperv_wmi_generator.py
46
9395
#!/usr/bin/env python # # hyperv_wmi_generator.py: generates most of the WMI type mapping code # # Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com> # # 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 t...
gpl-2.0
wy65701436/harbor
make/photon/prepare/commands/migrate.py
1
2040
import os, sys, importlib, shutil, glob from packaging import version import click from utils.misc import get_realpath from utils.migration import read_conf, search from migrations import accept_versions @click.command() @click.option('-i', '--input', 'input_', required=True, help="The path of original config file")...
apache-2.0
Atom-machinerule/Atoms_qbo_apps
qbo_ball_tracker/nodes/test_vision_node.py
1
1676
#!/usr/bin/env python import roslib roslib.load_manifest('qbo_ball_tracker') import sys import rospy import cv from std_msgs.msg import String from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError class test_vision_node: def __init__(self): rospy.init_node('test_vision_node') ...
lgpl-2.1
Rapportus/ansible-modules-extras
cloud/amazon/ec2_vpc_subnet.py
16
8526
#!/usr/bin/python # # 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 distributed in the hope that i...
gpl-3.0
osalivan/po-go-go
pogom/utils.py
18
6471
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import getpass import argparse import re import uuid import os import json from datetime import datetime, timedelta import ConfigParser from . import config from exceptions import APIKeyException def parse_unicode(bytestring): decoded_string = bytestring.deco...
agpl-3.0
Jgarcia-IAS/SAT
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/__init__.py
384
1414
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
nikhilraog/boto
boto/emr/connection.py
34
28620
# Copyright (c) 2010 Spotify AB # Copyright (c) 2010-2011 Yelp # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, m...
mit
mattgruter/picture_clerk
picture_clerk/test/test_connector.py
1
5700
""" @author: Matthias Grueter <matthias@grueter.name> @copyright: Copyright (c) 2012 Matthias Grueter @license: GPL """ import unittest import mock from urlparse import urlparse from connector import Connector from connector import NotConnectedError class TestConnector(Connector): _connect = None _disconne...
gpl-3.0
opennetworkinglab/spring-open-cli
cli/desc/version200/forwarding.py
1
4091
#!/usr/bin/env python # # Copyright (c) 2013 Big Switch Networks, Inc. # # Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html # # Unless re...
epl-1.0
beav/pulp
server/pulp/server/content/sources/container.py
10
18977
from collections import namedtuple from logging import getLogger from threading import Thread, RLock from Queue import Queue, Empty, Full from nectar.listener import DownloadEventListener from nectar.report import DownloadReport as NectarDownloadReport from nectar.request import DownloadRequest from pulp.server.conte...
gpl-2.0
rapidpro/tracpro
tracpro/contacts/models.py
1
17159
from __future__ import absolute_import, unicode_literals import datetime import traceback from decimal import Decimal, InvalidOperation import logging from uuid import uuid4 from enum import Enum from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.d...
bsd-3-clause
eckucukoglu/arm-linux-gnueabihf
arm-linux-gnueabihf/libc/usr/lib/python2.7/unittest/test/test_skipping.py
70
5731
import unittest from .support import LoggingResult class Test_TestSkipping(unittest.TestCase): def test_skipping(self): class Foo(unittest.TestCase): def test_skip_me(self): self.skipTest("skip") events = [] result = LoggingResult(events) test = Foo("t...
gpl-2.0
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/distutils/ccompiler.py
80
47383
"""distutils.ccompiler Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.""" import sys, os, re from distutils.errors import * from distutils.spawn import spawn from distutils.file_util import move_file from distutils.dir_util import mkpath from distuti...
lgpl-3.0
felixmatt/shyft
shyft/orchestration/configuration/config_interfaces.py
1
3104
from abc import ABCMeta, abstractmethod class RegionConfigError(Exception): pass class RegionConfig(object): __metaclass__ = ABCMeta """ Provides region model catchment level parameters and domain bounding box """ @abstractmethod def parameter_overrides(self): """ TODO: Co...
lgpl-3.0
htwenhe/DJOA
env/Lib/site-packages/odf/opendocument.py
2
38173
# -*- coding: utf-8 -*- # Copyright (C) 2006-2010 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
mit
andrewtholt/My-amforth-6.1
avr8/devices/atmega644a/device.py
5
7375
# Partname: ATmega644A # generated automatically, do not edit MCUREGS = { 'ADCSRB': '&123', 'ADCSRB_ACME': '$40', 'ACSR': '&80', 'ACSR_ACD': '$80', 'ACSR_ACBG': '$40', 'ACSR_ACO': '$20', 'ACSR_ACI': '$10', 'ACSR_ACIE': '$08', 'ACSR_ACIC': '$04', 'ACSR_ACIS': '$03', 'DIDR1': '&127', 'DIDR1...
gpl-3.0
felliott/osf.io
website/project/views/node.py
5
51323
# -*- coding: utf-8 -*- import os import logging from rest_framework import status as http_status import math from collections import defaultdict from flask import request from django.apps import apps from django.utils import timezone from django.core.exceptions import ValidationError from django.db.models import Q, O...
apache-2.0