repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
derricw/pyqtgraph
examples/optics/pyoptic.py
18
18439
# -*- coding: utf-8 -*- import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore import numpy as np import csv, gzip, os from pyqtgraph import Point class GlassDB: """ Database of dispersion coefficients for Schott glasses + Corning 7980 """ def __init__(self, fileName='schott_glasses.csv'): ...
mit
ktan2020/legacy-automation
win/Lib/bsddb/test/test_fileid.py
7
1891
"""TestCase for reseting File ID. """ import os import shutil import unittest from test_all import db, test_support, get_new_environment_path, get_new_database_path class FileidResetTestCase(unittest.TestCase): def setUp(self): self.db_path_1 = get_new_database_path() self.db_path_2 =...
mit
hrharkins/flask_pillow
flask_pillow.py
1
11312
import flask, json, sys try: from flask import _app_ctx_stack as stack except ImportError: from flask import _request_ctx_stack as stack class Pillow(object): factories = {} def __init__(self, app=None, *factories, **_kw): self.factory_filter = _kw.pop('factories', None) self.app = ap...
mit
alfa-jor/addon
plugin.video.alfa/servers/debriders/alldebrid.py
1
1695
# -*- coding: utf-8 -*- from core import httptools from core import scrapertools from platformcode import logger # Returns an array of possible video url's from the page_url def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info() page_url = correct_url(pag...
gpl-3.0
minhtuancn/odoo
addons/sale_crm/__openerp__.py
260
2036
# -*- 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
francisliu/hbase
dev-support/git-jira-release-audit/git_jira_release_audit.py
1
30172
#!/usr/bin/env python3 # # 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 # ...
apache-2.0
jrossyra/adaptivemd
docs/conf.py
2
7388
# -*- coding: utf-8 -*- # # AdaptiveMD documentation build configuration file, created by # sphinx-quickstart on Thu Mar 9 22:49:18 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
lgpl-2.1
RalphBariz/RalphsDotNet
Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/xml/etree/ElementTree.py
42
57821
# # ElementTree # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ # # light-weight XML support for Python 2.3 and later. # # history (since 1.2.6): # 2005-11-12 fl added tostringlist/fromstringlist helpers # 2006-07-05 fl merged in selected changes from the 1.3 sandbox # 2006-07-05 fl removed sup...
gpl-3.0
adamncasey/servo
tests/wpt/web-platform-tests/tools/manifest/sourcefile.py
25
18485
import hashlib import re import os from six import binary_type from six.moves.urllib.parse import urljoin from fnmatch import fnmatch try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree import ElementTree import html5lib from . import XMLParser from .item import Stub, Man...
mpl-2.0
ffu/DSA-3.2.2
gr-usrp2/src/qa_usrp2.py
5
1237
#!/usr/bin/env python # # Copyright 2005,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
gpl-3.0
QLGu/django-oscar
tests/functional/dashboard/order_tests.py
22
12420
from django.conf import settings from django.core.urlresolvers import reverse from django.utils.six.moves import http_client from oscar.core.loading import get_model from oscar.apps.order.models import ( Order, OrderNote, PaymentEvent, PaymentEventType) from oscar.test.factories import PartnerFactory, ShippingAddr...
bsd-3-clause
keithlee/shakeAppPyDev
django/views/generic/edit.py
159
7457
from django.forms import models as model_forms from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponseRedirect from django.views.generic.base import TemplateResponseMixin, View from django.views.generic.detail import (SingleObjectMixin, SingleObjectTemplateRe...
bsd-3-clause
hdinsight/hue
desktop/core/ext-py/boto-2.38.0/boto/file/simpleresultset.py
264
1321
# Copyright 2010 Google Inc. # # 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, modify, merge, publish, dis- # trib...
apache-2.0
mitodl/odl-video-service
odl_video/urls.py
1
1110
"""odl_video URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
bsd-3-clause
akazakov/ansible-modules-core
cloud/openstack/os_subnet.py
21
11273
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 ...
gpl-3.0
deuxpi/pytrainer
imports/file_gpxplus.py
1
3935
# -*- coding: iso-8859-1 -*- #Copyright (C) Fiz Vazquez vud1@sindominio.net # Modified by dgranda #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 opt...
gpl-2.0
maciejkula/scipy
scipy/sparse/linalg/tests/test_matfuncs.py
3
18818
#!/usr/bin/env python # # Created by: Pearu Peterson, March 2002 # """ Test functions for scipy.linalg.matfuncs module """ from __future__ import division, print_function, absolute_import import math import warnings import numpy as np from numpy import array, eye, exp, random from numpy.linalg import matrix_power f...
bsd-3-clause
Francis-Liu/animated-broccoli
nova/api/openstack/compute/schemas/volumes.py
17
2852
# Copyright 2014 IBM Corporation. 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
jvvto/fia-search
graphicsDisplay.py
42
28031
# graphicsDisplay.py # ------------------ # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.be...
mit
indashnet/InDashNet.Open.UN2000
lichee/linux-3.4/arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
apache-2.0
schroeji/i3pystatus
i3pystatus/taskwarrior.py
10
3751
from i3pystatus import IntervalModule from json import loads import subprocess class Taskwarrior(IntervalModule): """ Check Taskwarrior for pending tasks Requires `json` .. rubric:: Available formatters (uses :ref:`formatp`) * `{ready}` — contains number of tasks returned by `ready_filter` ...
mit
aleida/django
tests/regressiontests/localflavor/id/tests.py
13
7228
from __future__ import unicode_literals import warnings from django.contrib.localflavor.id.forms import (IDPhoneNumberField, IDPostCodeField, IDNationalIdentityNumberField, IDLicensePlateField, IDProvinceSelect, IDLicensePlatePrefixSelect) from django.test import SimpleTestCase class IDLocalFlavorTests(Sim...
bsd-3-clause
mat128/python-novaclient
novaclient/tests/unit/test_api_versions.py
3
14278
# Copyright 2016 Mirantis # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
ben1/Stronghold
src/actors.py
1
1368
''' Actor is the base class for central characters in the game. It contains some basic information as well as relationships to other characters (from their perspective). This module also contains a number of core characters. ''' class Actor(): nextId = 1 def __init__(self, name, firstName): s...
mit
kbidarkar/robottelo
robottelo/ui/computeresource.py
2
23459
# -*- encoding: utf-8 -*- from robottelo import ssh from robottelo.constants import FILTER, FOREMAN_PROVIDERS from nailgun import entities from robottelo.ui.base import Base, UINoSuchElementError, UIError from robottelo.helpers import ProvisioningCheckError from robottelo.ui.locators import common_locators, locators, t...
gpl-3.0
eemirtekin/edx-platform
lms/djangoapps/instructor_analytics/tests/test_csvs.py
175
4757
""" Tests for analytics.csvs """ from django.test import TestCase from nose.tools import raises from instructor_analytics.csvs import create_csv_response, format_dictlist, format_instances class TestAnalyticsCSVS(TestCase): """ Test analytics rendering of csv files.""" def test_create_csv_response_nodata(s...
agpl-3.0
abligh/xen4.2-minideb
tools/xm-test/tests/create/11_create_concurrent_pos.py
42
1787
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Authors: Dan Smith <danms@us.ibm.com> from XmTestLib import * import time import random if ENABLE_HVM_SUPPORT: MAX_DOMS = getMaxHVMDomains() if MAX_DOMS > 50: MAX_DOMS = 50 else: MAX_DOMS = 50 MIN_DOMS = 5 MEM_PE...
gpl-2.0
sql-sith/cdc2015
simple_calculator_01_hard.py
1
1354
''' Shows one way to implement a solution to Challenge Exercise 4 (simple calculator) @author: sql.sith ''' def calcThis(int1, op, int2): if op == "+": return int1 + int2 elif op == "-": return int1 - int2 elif op == "*": return int1 * int2 elif op == "/": return float(i...
gpl-3.0
ted-gould/nova
nova/tests/unit/cells/test_cells_state_manager.py
17
11725
# Copyright (c) 2013 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
JingJunYin/tensorflow
tensorflow/python/ops/sparse_ops.py
8
80714
# 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
lewislone/mStocks
packets-analysis/lib/XlsxWriter-0.7.3/examples/macros.py
9
1042
####################################################################### # # An example of adding macros to an XlsxWriter file using a VBA project # file extracted from an existing Excel xlsm file. # # The vba_extract.py utility supplied with XlsxWriter can be used to extract # the vbaProject.bin file. # # An embedded m...
mit
moble/sympy
sympy/parsing/ast_parser.py
122
2811
""" This module implements the functionality to take any Python expression as a string and fix all numbers and other things before evaluating it, thus 1/2 returns Integer(1)/Integer(2) We use the Python ast module for that, which is in python2.6 and later. It is well documented at docs.python.org. Some tips to und...
bsd-3-clause
csicar/blynk-library
tests/pseudo-server-dw-mt.py
20
5266
#!/usr/bin/python ''' This is a pseudo-server that sends predefined pattern to any connected client. It is used to test transport behaviour and throughput. If you want to use it with a sketch, connect your PC and Blynk-enabled device into the same network and configure Blynk to connect to this pseudo-server: I...
mit
enochd/RMG-Java
scripts/distGeomScriptMolLowestEnergyConf.py
9
1449
# gmagoon 7/22/09: writes the lowest energy conformation for mole file in # arg#1 to mole file in arg#2 (and corresponding crude mole file in arg#3), based on UFF energy of arg#4 embeddings # (optimized); should be reproducible due to use of consistent randomSeed #updated 8/12/09 for Q2 2009 version of RDKit (rdkit ...
mit
blokweb/androguard
tests/test_dex.py
37
2862
#!/usr/bin/env python import logging import datetime import sys PATH_INSTALL = "./" sys.path.append(PATH_INSTALL) from optparse import OptionParser from androguard.core.analysis import auto from androguard.core.androconf import set_debug option_0 = {'name': ('-d', '--directory'), 'help': 'directory input', 'nargs':...
apache-2.0
pbrod/scipy
scipy/linalg/tests/test_basic.py
2
61854
# # Created by: Pearu Peterson, March 2002 # """ Test functions for linalg.basic module """ from __future__ import division, print_function, absolute_import import warnings import itertools import numpy as np from numpy import (arange, array, dot, zeros, identity, conjugate, transpose, float32) imp...
bsd-3-clause
chiefspace/udemy-rest-api
udemy_rest_flask1/env/lib/python3.4/site-packages/setuptools/command/install_scripts.py
14
2067
from distutils.command.install_scripts import install_scripts \ as _install_scripts from pkg_resources import Distribution, PathMetadata, ensure_directory import os from distutils import log class install_scripts(_install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def ini...
gpl-2.0
linostar/timeline-clone
dependencies/timelinelib/pysvg-0.2.1/pysvg/text.py
7
6821
#!/usr/bin/python # -*- coding: iso-8859-1 -*- ''' (C) 2008, 2009 Kerim Mansour For licensing information please refer to license.txt ''' from attributes import * from core import BaseElement, PointAttrib, DeltaPointAttrib, RotateAttrib class altGlyphDef(BaseElement, CoreAttrib): """ Class representing the alt...
gpl-3.0
freeslugs/eventum
app/lib/text.py
1
2732
import re def truncate_html(text, truncate_len, truncate_text): """ Truncates HTML to a certain number of words (not counting tags and comments). Closes opened tags if they were correctly closed in the given HTML. If text is truncated, truncate_text will be appended to the result. Newlines in the HTML...
mit
mttr/django
tests/bash_completion/tests.py
327
3888
""" A series of tests to establish that the command-line bash completion works. """ import os import sys import unittest from django.apps import apps from django.core.management import ManagementUtility from django.test.utils import captured_stdout class BashCompletionTests(unittest.TestCase): """ Testing th...
bsd-3-clause
arunkgupta/gramps
gramps/plugins/gramplet/ageondategramplet.py
1
3792
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2007-2009 Douglas S. Blank <doug.blank@gmail.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 Lic...
gpl-2.0
nvoron23/arangodb
3rdParty/V8-4.3.61/tools/testrunner/server/__init__.py
651
1571
# Copyright 2012 the V8 project authors. 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 conditi...
apache-2.0
kristinriebe/uws-validator
features/steps/steps_http.py
1
5403
from utils import append_path, add_multi_path_segments, get_UwsName, get_XlinkName, get_dict_from_paramtable, get_joblink from lxml import etree as et import requests import uws from ensure import ensure, check from purl import URL # for parsing dates: from datetime import datetime import dateutil.parser import pytz ...
apache-2.0
ibobalo/python-for-android
test_builds/tests/test_apk.py
4
2423
from pythonforandroid.toolchain import main from pythonforandroid.recipe import Recipe from os import path import sys import pytest # Set these values manually before testing (for now) ndk_dir = '/home/asandy/android/crystax-ndk-10.3.2' ndk_version='crystax-ndk-10.3.2' cur_dir = path.dirname(path.abspath(__file__)...
mit
nan86150/ImageFusion
lib/python2.7/site-packages/setuptools/command/install.py
496
4685
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://bitbucket.org/pypa/setuptools/issue/199/ _install = orig....
mit
gauribhoite/personfinder
app/unidecode/x06f.py
252
4650
data = ( 'Qing ', # 0x00 'Yu ', # 0x01 'Piao ', # 0x02 'Ji ', # 0x03 'Ya ', # 0x04 'Jiao ', # 0x05 'Qi ', # 0x06 'Xi ', # 0x07 'Ji ', # 0x08 'Lu ', # 0x09 'Lu ', # 0x0a 'Long ', # 0x0b 'Jin ', # 0x0c 'Guo ', # 0x0d 'Cong ', # 0x0e 'Lou ', # 0x0f 'Zhi ', # 0x10 'Gai ', ...
apache-2.0
mahendra-r/edx-platform
cms/envs/test.py
15
9245
# -*- coding: utf-8 -*- """ This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We ...
agpl-3.0
adcomp/picota-html5-playground
pyqt5-webkit.py
1
2752
#!/usr/bin/python3 # -*- coding: utf-8 -*- # David Art [aka] ADcomp <david.madbox@gmail.com> import os import sys from PyQt5.QtWidgets import (QMainWindow, QApplication, QInputDialog, QLineEdit, QMessageBox) from PyQt5.QtCore import (QUrl, QObject, pyqtSlot, pyqtProperty) from PyQt5.QtWebKitWidgets import (QWebView,...
mit
gogobebe2/Replicating-DeepMind
libraries/cuda-convnet2/python_util/data.py
180
7803
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
gpl-3.0
PeterWangIntel/chromium-crosswalk
ppapi/native_client/tools/browser_tester/browsertester/rpclistener.py
170
2297
#!/usr/bin/python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import time class RPCListener(object): def __init__(self, shutdown_callback): self.shutdown_callback = shutdown_ca...
bsd-3-clause
qaenablers/python-behavetutorial
features/dict/steps/create.py
1
1333
# -*- coding: utf-8 -*- import behave from behave import step from hamcrest import assert_that, is_, equal_to, is_not, is_in import logging # Change the parameter matcher used in parsing step text: parse, cfparse, re # https://pythonhosted.org/behave/api.html#step-parameters behave.use_step_matcher("re") __logger__ ...
apache-2.0
bowen0701/algorithms_data_structures
lc0222_count_complete_tree_nodes.py
1
4019
"""Leetcode 222. Count Complete Tree Nodes Medium URL: https://leetcode.com/problems/count-complete-tree-nodes/ Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely filled, an...
bsd-2-clause
RO-ny9/python-for-android
python-modules/twisted/twisted/internet/iocpreactor/tcp.py
49
20271
# Copyright (c) 2008-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ TCP support for IOCP reactor """ import socket, operator, errno, struct from zope.interface import implements, directlyProvides from twisted.internet import interfaces, error, address, main, defer from twisted.internet.abstract im...
apache-2.0
dudanogueira/microerp
microerp/cadastro/management/commands/importar_clientes.py
1
7403
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from cadastro.models import Cliente, Cidade, Ramo, Bairro from optparse import make_option import os, csv, datetime from django.utils.encoding import smart_unicode, smart_str class Command(BaseCommand): help = ''' Sincroniza par...
lgpl-3.0
huntxu/neutron
neutron/auth.py
3
1694
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
jindongh/kombu
kombu/transport/pyro.py
40
2468
""" kombu.transport.pyro ====================== Pyro transport. Requires the :mod:`Pyro4` library to be installed. """ from __future__ import absolute_import import sys from kombu.five import reraise from kombu.utils import cached_property from . import virtual try: import Pyro4 as pyro from Pyro4.errors...
bsd-3-clause
taknira/certificate-transparency
python/utilities/log_list/print_log_list.py
3
4188
#!/usr/bin/env python """Parse and print the list of logs, after validating signature.""" import base64 import hashlib import json import os import sys import time import gflags import jsonschema import M2Crypto from cpp_generator import generate_cpp_header from java_generator import generate_java_source from openss...
apache-2.0
MikeAmy/django
tests/auth_tests/models/custom_permissions.py
33
1381
""" The CustomPermissionsUser users email as the identifier, but uses the normal Django permissions model. This allows us to check that the PermissionsMixin includes everything that is needed to interact with the ModelBackend. """ from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.con...
bsd-3-clause
sparkslabs/kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Apps/JMB/WSGI/__init__.py
6
7203
# -*- coding: utf-8 -*- # Needed to allow import # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache Lice...
apache-2.0
Tripwire/TARDIS
dependencies.py
6
1998
try: import subprocess except ImportError: print "No subprocess!" try: import json except ImportError: print "No json!" try: import os except ImportError: print "No os!" try: import re except ImportError: print "No re!" try: import sys except ImportError: print "No sys!" try: import datetime except ImportErr...
apache-2.0
StackStorm/st2
st2common/st2common/persistence/auth.py
3
3430
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
apache-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.5.0/Lib/test/test_list.py
7
4041
import sys from test import support, list_tests import pickle class ListTest(list_tests.CommonTest): type2test = list def test_basic(self): self.assertEqual(list([]), []) l0_3 = [0, 1, 2, 3] l0_3_bis = list(l0_3) self.assertEqual(l0_3, l0_3_bis) self.assertTrue(l0_3 is ...
mit
keiranFTW/sony-kernel-msm8660
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
destijl/forensicartifacts
frontend/thirdparty/networkx-1.9/networkx/algorithms/tests/test_simple_paths.py
42
2372
#!/usr/bin/env python from nose.tools import * import networkx as nx def test_all_simple_paths(): G = nx.path_graph(4) paths = nx.all_simple_paths(G,0,3) assert_equal(list(list(p) for p in paths),[[0,1,2,3]]) def test_all_simple_paths_cutoff(): G = nx.complete_graph(4) paths = nx.all_simple_paths(...
apache-2.0
ryfeus/lambda-packs
Selenium_PhantomJS/source/rsa/__init__.py
79
1476
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Un...
mit
chidea/GoPythonDLLWrapper
bin/lib/site-packages/pip/_vendor/distlib/util.py
54
51868
# # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import shutil import socket import...
mit
glancyea/wastepermitcontent
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py
2710
5094
# 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 user preferences file writer.""" import os import re import socket # for gethostname import gyp.common import gyp.easy_xml as easy_xml #------...
mit
thomasalrin/Ghost
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/other.py
197
170951
# -*- coding: utf-8 -*- """ pygments.lexers.other ~~~~~~~~~~~~~~~~~~~~~ Lexers for other languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, \ thi...
mit
SteveHNH/ansible
lib/ansible/modules/system/make.py
24
4295
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Linus Unnebäck <linus@folkdatorn.se> # 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
mydongistiny/external_chromium_org
tools/telemetry/telemetry/core/platform/tracing_category_filter.py
58
6027
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re def CreateNoOverheadFilter(): """Returns a filter with the least overhead possible. This contains no sub-traces of thread tasks, so it's onl...
bsd-3-clause
rolandgeider/OpenSlides
openslides/core/serializers.py
1
1801
from openslides.utils.rest_api import Field, ModelSerializer, ValidationError from .models import ChatMessage, CustomSlide, Projector, Tag class JSONSerializerField(Field): """ Serializer for projector's JSONField. """ def to_internal_value(self, data): """ Checks that data is a dicti...
mit
RockySteveJobs/python-for-android
python3-alpha/python3-src/Lib/test/test_thread.py
50
7616
import os import unittest import random from test import support thread = support.import_module('_thread') import time import sys import weakref from test import lock_tests NUMTASKS = 10 NUMTRIPS = 3 _print_mutex = thread.allocate_lock() def verbose_print(arg): """Helper function for printing out debugging outp...
apache-2.0
HIIT/elfi
elfi/methods/mcmc.py
1
16593
"""MCMC sampling methods.""" import logging import numpy as np logger = logging.getLogger(__name__) # TODO: combine ESS and Rhat?, consider transforming parameters to allowed # region to increase acceptance ratio def eff_sample_size(chains): """Calculate the effective sample size for 1 or more chains. Se...
bsd-3-clause
afloren/nipype
nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py
9
1642
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.slicer.registration.brainsresample import BRAINSResample def test_BRAINSResample_inputs(): input_map = dict(args=dict(argstr='%s', ), defaultValue=dict(argstr='--defaultValue %f', ), ...
bsd-3-clause
RobertWWong/WebDev
djangoApp/ENV/lib/python3.5/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py
59
3254
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.sqlite3.introspection import ( DatabaseIntrospection, FlexibleFieldLookupDict, ) from django.utils import six class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict): """ Sublcass that includes updates the `base_data_types_reverse` ...
mit
fangxingli/hue
desktop/core/ext-py/Paste-2.0.1/paste/exceptions/errormiddleware.py
50
17105
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Error handler middleware """ import sys import traceback import cgi from six.moves import cStringIO as StringIO from paste.exceptions import forma...
apache-2.0
GoogleCloudPlatform/practical-ml-vision-book
07_training/serverlessml/flowers/classifier/model.py
1
4420
#!/usr/bin/env python # Copyright 2020 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
apache-2.0
jamescallmebrent/dagny
example/users/resources.py
1
2201
# -*- coding: utf-8 -*- from dagny import Resource, action from django.contrib.auth import forms, models from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect import simplejson class User(Resource): template_path_prefix = 'auth/' @action def index(self): ...
unlicense
rreilink/grbl
doc/script/simple_stream.py
47
2395
#!/usr/bin/env python """\ Simple g-code streaming script for grbl Provided as an illustration of the basic communication interface for grbl. When grbl has finished parsing the g-code block, it will return an 'ok' or 'error' response. When the planner buffer is full, grbl will not send a response until the planner buf...
gpl-3.0
gautam1858/tensorflow
tensorflow/contrib/model_pruning/examples/cifar10/cifar10_train.py
60
5267
# 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
prasanna08/oppia
core/domain/interaction_jobs_one_off.py
1
7849
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
apache-2.0
sammyshj/gci
modules/s3/s3validators.py
2
119990
# -*- coding: utf-8 -*- """ Custom Validators @requires: U{B{I{gluon}} <http://web2py.com>} @copyright: (c) 2010-2013 Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the...
mit
Leila20/django
tests/field_deconstruction/tests.py
21
18360
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.test import SimpleTestCase, override_settings from django.test.utils import isolate_lru_cache from django.utils import six class FieldDeconstructionTests(SimpleTestCase): """ Tests the deconstruct() ...
bsd-3-clause
microcom/hr
hr_experience_analytic/hr_experience_analytic.py
21
1383
############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU A...
agpl-3.0
ollie314/kuma
kuma/search/tests/test_types.py
3
1840
from elasticsearch_dsl import query from kuma.core.tests import eq_, ok_ from kuma.wiki.models import Document from kuma.wiki.search import WikiDocumentType from . import ElasticTestCase class WikiDocumentTypeTests(ElasticTestCase): fixtures = ElasticTestCase.fixtures + ['wiki/documents.json'] def test_get...
mpl-2.0
splav/servo
tests/wpt/web-platform-tests/webdriver/tests/new_window/new_window.py
18
1429
from tests.support.asserts import assert_success from . import opener, window_name def new_window(session, type_hint=None): return session.transport.send( "POST", "session/{session_id}/window/new".format(**vars(session)), {"type": type_hint}) def test_type_with_window(session): original_han...
mpl-2.0
Intel-Corporation/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/softsign.py
35
3019
# 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
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/wsgiref/validate.py
114
14731
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php # Licensed to PSF under a Contributor Agreement """ Middlew...
apache-2.0
betoesquivel/fil2014
build/django/build/lib.linux-x86_64-2.7/django/contrib/admin/tests.py
104
4914
import os from django.test import LiveServerTestCase from django.utils.module_loading import import_by_path from django.utils.unittest import SkipTest from django.utils.translation import ugettext as _ class AdminSeleniumWebDriverTestCase(LiveServerTestCase): available_apps = [ 'django.contrib.admin', ...
mit
myd7349/Ongoing-Study
python/RegKey.py
2
3094
# -*- coding: utf-8 -*- # 2014-10-29T19:30+08:00 # By myd7349(myd7349@gmail.com) # TODO: documentation and unit test import os.path import winreg # These 2 functions below are part of the internal implementation, # and you should not call them directly. def _OpenKeyToEnum(key, sub_key): if sub_key != None and n...
lgpl-3.0
SphinxKnight/kuma
kuma/core/tests/test_pagination.py
1
1899
from __future__ import unicode_literals import pyquery from django.test import RequestFactory from ..templatetags.jinja_helpers import paginator from ..urlresolvers import reverse from ..utils import paginate, urlparams def test_paginated_url(): """Avoid duplicating page param in pagination.""" url = urlpar...
mpl-2.0
activityworkshop/Murmeli
murmeli/pages/messages.py
1
4728
'''Module for the messages pageset''' from murmeli.pages.base import PageSet from murmeli.pagetemplate import PageTemplate from murmeli import dbutils from murmeli.contactmgr import ContactManager from murmeli.messageutils import MessageTree from murmeli import inbox class MessagesPageSet(PageSet): '''Messages p...
gpl-2.0
Zyell/home-assistant
homeassistant/components/notify/smtp.py
12
3892
""" Mail (SMTP) notification service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.smtp/ """ import logging import smtplib from email.mime.text import MIMEText from homeassistant.components.notify import ( ATTR_TITLE, DOMAIN, BaseNotificati...
mit
InstaMineNuggetsCLASSB/InstaMineNuggetsCLASSB
contrib/spendfrom/spendfrom.py
792
10053
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mit
jiangzhuo/kbengine
kbe/res/scripts/common/Lib/idlelib/Bindings.py
61
3049
"""Define the menu contents, hotkeys, and event bindings. There is additional configuration information in the EditorWindow class (and subclasses): the menus are created there based on the menu_specs (class) variable, and menus not created are silently skipped in the code here. This makes it possible, for example, to...
lgpl-3.0
apixandru/intellij-community
python/helpers/py3only/docutils/languages/cs.py
52
1894
# $Id: cs.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Marek Blaha <mb@dat.cz> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each l...
apache-2.0
DJMuggs/ansible-modules-extras
network/a10/a10_server.py
5
10633
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage A10 Networks slb server objects (c) 2014, Mischa Peters <mpeters@a10networks.com> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by th...
gpl-3.0
Stavitsky/python-neutronclient
neutronclient/tests/unit/test_cli20_networkprofile.py
6
6186
# Copyright 2013 Cisco Systems 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 require...
apache-2.0
morpheby/levelup-by
common/djangoapps/track/middleware.py
3
2046
import json import re from django.conf import settings import views class TrackMiddleware(object): def process_request(self, request): try: if not self._should_process_request(request): return # Removes passwords from the tracking logs # WARNING: This...
agpl-3.0
GoSteven/Diary
django/test/utils.py
13
3771
import sys import time import os import warnings from django.conf import settings from django.core import mail from django.core.mail.backends import locmem from django.test import signals from django.template import Template from django.utils.translation import deactivate __all__ = ('Approximate', 'ContextL...
bsd-3-clause