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
hsaputra/tensorflow
tensorflow/contrib/resampler/python/ops/resampler_ops_test.py
52
10476
# pylint: disable=g-bad-file-header # Copyright 2017 The Sonnet 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...
apache-2.0
vFense/vFense
tp/src/plugins/vuln/cve/downloader.py
1
4460
"CVE DOWNLOADER FOR TOPPATCH, NVD/CVE XML VERSION 1.2" import gzip import os import requests import logging import logging.config from vFense import VFENSE_LOGGING_CONFIG from vFense.plugins.vuln.cve._constants import CVEDataDir, CVEStrings from vFense.plugins.vuln._constants import DateValues logging.config.fileConfi...
lgpl-3.0
yqm/sl4a
python/src/Lib/poplib.py
223
12388
"""A POP3 client class. Based on the J. Myers POP3 draft, Jan. 96 """ # Author: David Ascher <david_ascher@brown.edu> # [heavily stealing from nntplib.py] # Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97] # String method conversion and test jig improvements by ESR, February 2001. # Added the POP3_SSL clas...
apache-2.0
Chilledheart/chromium
chrome/browser/web_dev_style/html_checker.py
22
3762
# 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. """ Presubmit for Chromium HTML resources. See chrome/browser/PRESUBMIT.py. """ import regex_check class HtmlChecker(object): def __init__(self, input_a...
bsd-3-clause
1stvamp/gunicorn
gunicorn/app/wsgiapp.py
96
2156
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import sys from gunicorn.errors import ConfigError from gunicorn.app.base import Application from gunicorn import util class WSGIApplication(Application): def init(self, parse...
mit
vladmm/intellij-community
python/lib/Lib/site-packages/django/contrib/messages/tests/cookie.py
159
4272
from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.cookie import CookieStorage, \ MessageEncoder, MessageDecoder from django.contrib.messages.storage.base import Message from django.utils ...
apache-2.0
nav/presence
presence/apps/whiteboard/consumers.py
1
1436
import json import random import hashlib from django.core.cache import cache from django.http.request import QueryDict from django.contrib.auth import get_user_model from django_comments.models import Comment from channels import Group from channels.auth import http_session_user, channel_session_user, channel_session_u...
mit
aveshagarwal/openshift-ansible
roles/lib_openshift/src/class/oc_adm_csr.py
18
8783
# pylint: skip-file # flake8: noqa class OCcsr(OpenShiftCLI): ''' Class to wrap the oc adm certificate command line''' kind = 'csr' # pylint: disable=too-many-arguments def __init__(self, nodes=None, approve_all=False, service_account=None, ...
apache-2.0
kaushik94/sympy
sympy/functions/special/tests/test_hyper.py
2
15009
from sympy import (hyper, meijerg, S, Tuple, pi, I, exp, log, Rational, cos, sqrt, symbols, oo, Derivative, gamma, O, appellf1) from sympy.abc import x, z, k from sympy.series.limits import limit from sympy.utilities.pytest import raises, slow from sympy.utilities.randtest import ( random_complex...
bsd-3-clause
KyleAMoore/KanjiNani
Android/.buildozer/android/platform/build/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a/kivy/kivy/uix/camera.py
52
3461
''' Camera ====== The :class:`Camera` widget is used to capture and display video from a camera. Once the widget is created, the texture inside the widget will be automatically updated. Our :class:`~kivy.core.camera.CameraBase` implementation is used under the hood:: cam = Camera() By default, the first camera f...
gpl-3.0
danieljaouen/ansible
lib/ansible/module_utils/network/ftd/common.py
18
5468
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
philsch/ansible
lib/ansible/plugins/callback/skippy.py
44
1318
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
civisanalytics/ansible
lib/ansible/modules/cloud/cloudstack/cs_user.py
48
13139
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
pschmitt/home-assistant
homeassistant/components/oru/sensor.py
18
2355
"""Platform for sensor integration.""" from datetime import timedelta import logging from oru import Meter, MeterError import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ENERGY_KILO_WATT_HOUR import homeassistant.helpers.config_validation as cv from ho...
apache-2.0
Red680812/android_44_KitKat_kernel_htc_dlxpul-1
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
jayflo/scikit-learn
sklearn/decomposition/pca.py
192
23117
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Michael Eickenberg <michael.eickenberg@inria.fr> # # Lice...
bsd-3-clause
marwoodandrew/superdesk-core
tests/delete_archived_doc_tests.py
7
7353
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import io im...
agpl-3.0
garvenshen/zeda-swift
swift/common/ring/builder.py
1
39288
# Copyright (c) 2010-2012 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
bman12three4/kahoot-hack
lib/requests/packages/chardet/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
ted-gould/nova
nova/tests/unit/api/openstack/compute/test_hypervisors.py
26
22739
# Copyright (c) 2012 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
bugobliterator/ardupilot-chibios
libraries/AP_HAL_ChibiOS/hwdef/scripts/addfunc_parse.py
52
1909
#!/usr/bin/env python ''' create additional functions ADC table, used for mapping analog pins to ADC channel numbers Currently only extracts ADC1 channels This assumes a csv file extracted from the datasheet using tablula: https://github.com/tabulapdf/tabula ''' import sys, csv, os def is_pin(str): '''see if ...
gpl-3.0
mmauroy/SickRage
autoProcessTV/lib/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
gpl-3.0
bspink/django
tests/m2m_through_regress/models.py
273
2771
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible # Forward declared intermediate model @python_2_unicode_compatible class Membership(models.Model): person = models.ForeignKey('Person', mo...
bsd-3-clause
lyw07/kolibri
kolibri/utils/tests/test_version.py
4
15776
""" Tests for `kolibri` module. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import unittest import mock import kolibri from kolibri.utils import version #: Because we don't want to call the original (decorated function), it uses #: caching...
mit
undoware/neutron-drive
google_appengine/lib/antlr3/antlr3/dottreegen.py
105
6980
""" @package antlr3.dottreegenerator @brief ANTLR3 runtime package, tree module This module contains all support classes for AST construction and tree parsers. """ # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # All rights reserved. # # Redistribution and use in source and binary fo...
bsd-3-clause
fidomason/kbengine
kbe/src/lib/python/Lib/json/__init__.py
83
13246
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally m...
lgpl-3.0
dushu1203/chromium.src
tools/swig/swig.py
133
1304
#!/usr/bin/env 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. """Wrapper around swig. Sets the SWIG_LIB environment var to point to Lib dir and defers control to the platform-specific swig bin...
bsd-3-clause
fedorpatlin/ansible
lib/ansible/modules/storage/netapp/netapp_e_snapshot_images.py
27
9095
#!/usr/bin/python # (c) 2016, NetApp, 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....
gpl-3.0
akdiem/VaMpy
vampy/vamplot.py
2
2039
# -*- coding: utf-8 -*- from __future__ import division import numpy as np import matplotlib.pylab as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from scipy import interpolate plt.rcParams['axes.labelsize'] = 9 plt.rcParams['xtick.labelsize'] = 9 plt.rcParams['ytick.labelsize'] = 9 plt.rc...
bsd-3-clause
kpkhxlgy0/SublimeText3
Packages/SublimeCodeIntel/libs/codeintel2/lang_xul.py
10
3067
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozil...
mit
adrian-the-git/mezzanine
mezzanine/generic/migrations/0001_initial.py
39
3731
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('django...
bsd-2-clause
VM12/kernel_moto_shamu
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
OCA/social
mail_activity_team/tests/test_mail_activity_team.py
1
7502
# Copyright 2018 Eficent Business and IT Consulting Services, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.tests.common import SavepointCase from odoo.exceptions import ValidationError from odoo.fields import Datetime from datetime import timedelta class TestMailActivityTeam(Sa...
agpl-3.0
kchodorow/tensorflow
tensorflow/contrib/graph_editor/tests/reroute_test.py
17
3826
# 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
kiyukuta/chainer
chainer/optimizers/sgd.py
3
1526
from chainer import cuda from chainer import optimizer _default_hyperparam = optimizer.Hyperparameter() _default_hyperparam.lr = 0.01 class SGDRule(optimizer.UpdateRule): """Update rule of vanilla stochastic gradient descent. See :class:`~chainer.optimizers.SGD` for the default values of the hyperpara...
mit
provaleks/o8
addons/account_anglo_saxon/invoice.py
41
13486
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) # 2004-2010 Tiny SPRL (<http://tiny.be>). # 2009-2010 Veritos (http://veritos.nl). # All Rights Reserved # # This program is free software: you can redistri...
agpl-3.0
campbe13/openhatch
vendor/packages/twisted/twisted/runner/test/test_procmontap.py
17
2527
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.runner.procmontap}. """ from twisted.python.usage import UsageError from twisted.trial import unittest from twisted.runner.procmon import ProcessMonitor from twisted.runner import procmontap as tap class ProcessMonitorTa...
agpl-3.0
openstack/training-labs
labs/stacktrain/core/download.py
1
2470
# Force Python 2 to use float division even for ints from __future__ import division from __future__ import print_function import httplib import logging import os import urllib2 import stacktrain.core.helpers as hf logger = logging.getLogger(__name__) class Downloader(object): def __init__(self): self...
apache-2.0
alshedivat/tensorflow
tensorflow/python/autograph/pyct/testing/codegen.py
47
6645
# 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
afloren/nipype
nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py
9
1492
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.mipav.developer import JistBrainMp2rageDuraEstimation def test_JistBrainMp2rageDuraEstimation_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=Tr...
bsd-3-clause
sadatay/beets
test/testall.py
25
1497
#!/usr/bin/env python # This file is part of beets. # Copyright 2015, Adrian Sampson. # # 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 th...
mit
shoheietzel/proj5-maps
env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py
2755
9226
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
dorotan/pythontraining
env/Lib/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py
2919
2652
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
apache-2.0
js0701/chromium-crosswalk
build/toolchain/win/setup_toolchain.py
7
6593
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Copies the given "win tool" (which the toolchain uses to wrap compiler # invocations) and the environment blocks for the 32-bit and 64-bit builds on #...
bsd-3-clause
mm112287/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/xml/sax/handler.py
925
13922
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id$ """ version ...
gpl-3.0
lucidmotifs/auto-aoc
.venv/lib/python3.5/site-packages/pylint/test/test_self.py
1
18276
# -*- coding: utf-8 -*- # Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2014-2017 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014 Vlad Temian <vladtemian@gmail.com> # Copyright (c) 2014 Google, Inc. # Copyright (c) 2014 Arun Persaud <arun@nubati.net> # Copyright (c)...
mit
mshafiq9/django
django/contrib/admin/checks.py
186
38800
# -*- coding: utf-8 -*- from __future__ import unicode_literals from itertools import chain from django.contrib.admin.utils import ( NotRelationField, flatten, get_fields_from_path, ) from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models from django.forms...
bsd-3-clause
Serag8/Bachelor
google_appengine/lib/django-1.2/django/contrib/localflavor/us/forms.py
83
4219
""" USA-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits...
mit
XXLRay/libreshot
libreshot/uploads/youtube/atom/__init__.py
112
49318
#!/usr/bin/python # # Copyright (C) 2006 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 ...
gpl-3.0
pattern3/pattern
test/test_db.py
4
48809
# -*- coding: utf-8 -*- from __future__ import print_function from util import * from pattern import db # To test MySQL, you need MySQLdb and a username + password with rights to # create a database. HOST, PORT, USERNAME, PASSWORD = "localhost", 3306, "root", "" def create_db_mysql(): global DB_MYSQL glob...
bsd-3-clause
katsumio/test
rs_base_labo3.py
1
5216
# -*- coding: utf-8 -*- # 検体検査結果データ(患者ごと)の読み込みと検体検査結果データ(検査項目ごと)の出力 # └→RS_Base_laboファイル # # 入力ファイル # └→患者マスターファイル   :name.csv # └→検体検査結果データファイル:患者ID.txt(例:101.txt,102.txt,103.txt・・・) # # Create 2017/07/09 : Update 2017/07/10 # Auther Katsumi.Oshiro import csv # csvモジュールの読み込み(CSVファイルの読み書き) import glob...
mit
Noviat/odoo
addons/website_forum/controllers/main.py
38
36919
# -*- coding: utf-8 -*- import werkzeug.exceptions import werkzeug.urls import werkzeug.wrappers import simplejson from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.controllers.main import login_redirect from openerp.addons.web.http import request f...
agpl-3.0
eLBati/odoo
addons/hr_timesheet/hr_timesheet.py
39
10037
# -*- 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
4doemaster/enigma2
lib/python/Components/MenuList.py
142
1788
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from enigma import eListboxPythonStringContent, eListbox class MenuList(HTMLComponent, GUIComponent): def __init__(self, list, enableWrapAround=True, content=eListboxPythonStringContent): GUIComponent.__init__(self) self.list = list ...
gpl-2.0
Jroque/MITMf
core/poisoners/ARP.py
18
11193
# Copyright (c) 2014-2016 Marcello Salvati # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
Fanris/PySchedUI
PySchedGUI/PySchedUI/Network/SSHTunnel.py
1
5589
# -*- coding: utf-8 -*- ''' Created on 2013-02-13 13:02 @summary: Builds an ssh tunnel to the server. @author: Martin Predki ''' import select import SocketServer import logging import thread import paramiko import random import socket SSH_PORT = 22 class SSHTunnel(object): ''' @summary: Main class of the t...
lgpl-3.0
soukingang/robotframework-selenium2library
src/ez_setup.py
276
10240
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
apache-2.0
ayyucedemirbas/Minix-Source-Code
minix-master/external/bsd/llvm/dist/llvm/test/CodeGen/SystemZ/Large/spill-01.py
23
1245
# Test cases where MVC is used for spill slots that end up being out of range. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # There are 8 usable call-saved GPRs, two of which are needed for the base # registers. The first 160 bytes of the frame are needed for the ABI # call frame, and a further 8 by...
apache-2.0
nikhilm/muzicast
muzicast/web/main.py
1
1717
from flask import Module, url_for, redirect, session, escape, request, make_response from sqlobject.main import SQLObjectNotFound from sqlobject import DESC from muzicast.web.util import is_first_run, make_pls_playlist, render_master_page from muzicast.meta import Track, TrackStatistics from muzicast.web.playlist imp...
mit
michael-dev2rights/ansible
lib/ansible/modules/network/f5/bigip_provision.py
16
9742
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 F5 Networks 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 # ...
gpl-3.0
matmutant/sl4a
python/src/Lib/test/fork_wait.py
58
2215
"""This test case provides support for checking forking and wait behavior. To test different wait behavior, overrise the wait_impl method. We want fork1() semantics -- only the forking thread survives in the child after a fork(). On some systems (e.g. Solaris without posix threads) we find that all active threads su...
apache-2.0
elmadjian/hand_drawn_line_detector
prog/circles_with_loops.py
1
6361
import sys, cv2, pq, skimage, seed_reader import numpy as np from skimage import exposure #global parameters #~~~~~~~~~~~~~~~~~ alpha = 3.3 #power associated with intensity cost beta = 3500000 #factor associated with curvature cost radius = 38 #radius of the circle bfactor = 25 #how much predecesso...
mit
qrkourier/ansible
lib/ansible/modules/network/nxos/nxos_install_os.py
6
7413
#!/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
crmccreary/openerp_server
openerp/report/pyPdf/utils.py
31
3986
# vim: sw=4:expandtab:foldmethod=marker # # Copyright (c) 2006, Mathieu Fenniak # 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 abov...
agpl-3.0
glennyonemitsu/MarkupHiveSDK
markdown/extensions/footnotes.py
46
11143
""" ========================= FOOTNOTES ================================= This section adds footnote handling to markdown. It can be used as an example for extending python-markdown with relatively complex functionality. While in this case the extension is included inside the module itself, it could just as easily b...
mit
gustaebel/python-mpv
example.py
1
2716
# # usage: python example.py <path> # # For lists of commands, events and properties consult the mpv reference: # # http://mpv.io/manual/stable/#list-of-input-commands # http://mpv.io/manual/stable/#list-of-events # http://mpv.io/manual/stable/#property-list # import sys import time import threading from mpv im...
mit
eduNEXT/edx-platform
lms/djangoapps/instructor_analytics/tests/test_csvs.py
5
4580
""" Tests for analytics.csvs """ import pytest from django.test import TestCase from lms.djangoapps.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
pgleeson/TempRepo3
lib/jython/Lib/profile.py
95
23513
#! /usr/bin/env python # # Class for profiling python code. rev 1.0 6/2/94 # # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum """Class for profiling Python code.""" # Copyright 1994, by InfoSeek Corporation, all rights reserved. # Written by James Roskind # # ...
gpl-2.0
voipir/python-sii-utils
src/sii/bin/cmd_verify.py
1
1301
""" Verification/Validation """ from lxml import etree from sii.lib import validation as validate from .helpers import read_xml def handle(args, config): if args['signature']: validate_signature(args, config) if args['schema']: validate_schema(args, config) if args['caf']: valida...
gpl-3.0
cisco-openstack/neutron
neutron/tests/unit/extensions/extendedattribute.py
39
1618
# Copyright 2013 VMware, 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 a...
apache-2.0
giovaneliberato/dossiebr
src/settings.py
3
1398
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaecookie.middleware import CSRFMiddleware, CSRFInputToDependency from tekton.gae.middleware.json_middleware import JsonResponseMiddleware from config.template_middleware import TemplateMiddleware, TemplateWriteMiddleware from tekton....
gpl-3.0
misterdanb/micropython
tests/wipy/os.py
29
2921
''' os module test for the CC3200 based boards ''' from machine import SD import os mch = os.uname().machine if 'LaunchPad' in mch: sd_pins = ('GP16', 'GP17', 'GP15') elif 'WiPy' in mch: sd_pins = ('GP10', 'GP11', 'GP15') else: raise Exception('Board not supported!') sd = SD(pins=sd_pins) os.mount(sd, '...
mit
phylotastic-legacy/PhyloGeoTastic
js/node_modules/grunt/node_modules/js-yaml/support/pyyaml-src/serializer.py
293
4165
__all__ = ['Serializer', 'SerializerError'] from .error import YAMLError from .events import * from .nodes import * class SerializerError(YAMLError): pass class Serializer: ANCHOR_TEMPLATE = 'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=None, ta...
mit
jn0/fb2utils
unidecode/xb5.py
253
4919
data = ( 'dyil', # 0x00 'dyilg', # 0x01 'dyilm', # 0x02 'dyilb', # 0x03 'dyils', # 0x04 'dyilt', # 0x05 'dyilp', # 0x06 'dyilh', # 0x07 'dyim', # 0x08 'dyib', # 0x09 'dyibs', # 0x0a 'dyis', # 0x0b 'dyiss', # 0x0c 'dying', # 0x0d 'dyij', # 0x0e 'dyic', # 0x0f 'dyik', # ...
gpl-3.0
mikemurr/libforensics
code/lf/apps/msoffice/word/metadata.py
13
6146
# Copyright 2009 Michael Murr # # This file is part of LibForensics. # # LibForensics 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 3 of the License, or # (at your option) any later ver...
gpl-3.0
udacity/ud032
Lesson_4_Working_with_MongoDB/10-Finding_Porsche/find_porsche.py
9
1066
#!/usr/bin/env python """ Your task is to complete the 'porsche_query' function and in particular the query to find all autos where the manufacturer field matches "Porsche". Please modify only 'porsche_query' function, as only that will be taken into account. Your code will be run against a MongoDB instance that we ha...
agpl-3.0
tony5856/repository.tonysrepo
plugin.program.xmlerator/unidecode/x090.py
251
4631
data = ( 'Tui ', # 0x00 'Song ', # 0x01 'Gua ', # 0x02 'Tao ', # 0x03 'Pang ', # 0x04 'Hou ', # 0x05 'Ni ', # 0x06 'Dun ', # 0x07 'Jiong ', # 0x08 'Xuan ', # 0x09 'Xun ', # 0x0a 'Bu ', # 0x0b 'You ', # 0x0c 'Xiao ', # 0x0d 'Qiu ', # 0x0e 'Tou ', # 0x0f 'Zhu ', # 0x10 '...
gpl-3.0
jhg/django
tests/generic_relations/tests.py
62
26688
from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db.models import Q from django.test import SimpleTestCase, Te...
bsd-3-clause
dims/neutron
neutron/tests/unit/notifiers/test_batch_notifier.py
56
2032
# Copyright (c) 2014 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
bigdig/vnpy
vnpy/app/algo_trading/algos/stop_algo.py
4
3202
from vnpy.trader.constant import Offset, Direction from vnpy.trader.object import TradeData, OrderData, TickData from vnpy.trader.engine import BaseEngine from vnpy.app.algo_trading import AlgoTemplate class StopAlgo(AlgoTemplate): """""" display_name = "Stop 条件委托" default_setting = { "vt_symbo...
mit
kangkot/arangodb
3rdParty/V8-4.3.61/buildtools/checkdeps/graphdeps.py
54
16055
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Dumps a graph of allowed and disallowed inter-module dependencies described by the DEPS files in the source tree. Supports DOT and P...
apache-2.0
freezmeinster/avagata-site
django/contrib/flatpages/admin.py
250
1089
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text = _("Example: ...
bsd-3-clause
SampleLiao/lantern
src/code.google.com/p/winsvc/codereview.py
139
111664
# coding=utf-8 # (The line above is necessary so that I can use 世界 in the # *comment* below without Python getting all bent out of shape.) # Copyright 2007-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
apache-2.0
woonsangcho/a3c
worker.py
1
4333
import numpy as np from auditor import Auditor from time import time import brain from helper import PartialRollout from helper import process_rollout from helper import set_random_seed class WorkerFactory(object): def create_worker(**kwargs): algo_name = kwargs['algo_name'] if (algo_name == 'a3c...
mit
mluo613/osf.io
osf/utils/order_apps.py
19
4520
import itertools from collections import OrderedDict from django.apps import apps def sort_dependencies(app_list): """Sort a list of (app_label, models) pairs into a single list of models. The single list of models is sorted so that any model with a natural key is serialized before a normal model, and a...
apache-2.0
jank3/django
django/contrib/sessions/backends/signed_cookies.py
383
2895
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase from django.core import signing class SessionStore(SessionBase): def load(self): """ We load the data from the key itself instead of fetching from some external data store. Opposite of _get_sess...
bsd-3-clause
calvinfarias/IC2015-2
BOOST/boost_1_61_0/tools/build/test/libjpeg.py
32
3729
#!/usr/bin/python # Copyright (C) 2013 Steven Watanabe # 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) import BoostBuild import MockToolset t = BoostBuild.Tester(arguments=['toolset=mock', '--ignore-site-config',...
mit
kkdai/WinObjC
deps/3rdparty/iculegacy/source/tools/icu-svnprops-check.py
388
9251
#! /usr/bin/python # Copyright (C) 2009-2011, International Business Machines Corporation, Google and Others. # All rights reserved. # # Script to check and fix svn property settings for ICU source files. # Also check for the correct line endings on files with svn:eol-style = native # # THIS SCRIPT DOES NOT WORK O...
mit
ambitioninc/django-issue
issue/tests/model_tests.py
1
25200
from datetime import datetime, timedelta import json from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django_dynamic_fixture import G, N from freezegun import freeze_time from mock import patch from issue.models import ( Assertion, ExtendedEnum, Issue, IssueAction, ...
mit
allenway/PIS-kernel
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
mrunalp/docker
docs/sources/conf.py
2
8501
# -*- coding: utf-8 -*- # # Docker documentation build configuration file, created by # sphinx-quickstart on Tue Mar 19 12:34:07 2013. # # 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. # # All ...
apache-2.0
chaosdefinition/util-linux
libmount/python/test_mount_tab_update.py
42
1254
import os import sys import stat import errno # use "import libmount" for in a standard way installed python binding import pylibmount as mnt def usage(tss): print("\nUsage:\n\t{:s} <test> [testoptions]\nTests:\n".format(sys.argv[0])) for i in tss: print("\t{15:-s}".format(i[0])) if i[2] != "": print(" {:s}\...
gpl-2.0
slohse/ansible
lib/ansible/modules/web_infrastructure/rundeck_project.py
99
6314
#!/usr/bin/python # -*- coding: utf-8 -*- # Ansible module to manage rundeck projects # (c) 2017, Loic Blot <loic.blot@unix-experience.fr> # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org...
gpl-3.0
jehutymax/aqsis
tools/integration/BtoR/BtoRAdapterClasses.py
4
125137
import os import btor from btor import BtoRGUIClasses as ui from btor.BtoRTypes import * import cgkit import cgkit.rmshader import cgkit.cgtypes import cgkit.quadrics from cgkit import ri as ri from cgkit import ribexport as export import Blender import xml.dom.minidom import new import math from sets import Set import...
gpl-2.0
BRCDcomm/pynos
pynos/versions/ver_7/ver_7_1_0/yang/brocade_ipv6_access_list.py
10
86599
#!/usr/bin/env python import xml.etree.ElementTree as ET class brocade_ipv6_access_list(object): """Auto generated class. """ def __init__(self, **kwargs): self._callback = kwargs.pop('callback') def ipv6_acl_ipv6_access_list_standard_name(self, **kwargs): """Auto Generat...
apache-2.0
Debian/dak
daklib/ls.py
1
5310
"""List packages according to various criteria @copyright: 2014, Ansgar Burchardt <ansgar@debian.org> @license: GPL-2+ """ # 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 t...
gpl-2.0
elfnor/sverchok
nodes/layout/wifi_out.py
3
4974
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
SteffenBauer/Katas
Exercism.io/python/hexadecimal/hexadecimal_test.py
1
1044
# To avoid trivial solutions, try to solve this problem without the # function int(s, base=16) import unittest from hexadecimal import hexa class HexadecimalTest(unittest.TestCase): def test_valid_hexa1(self): self.assertEqual(1, hexa('1')) def test_valid_hexa2(self): self.assertEqual(12, ...
mit
rimbalinux/LMD3
django/utils/simplejson/__init__.py
13
14655
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained versi...
bsd-3-clause
placrosse/ImpalaToGo
tests/comparison/discrepancy_searcher.py
2
26504
#!/usr/bin/env python # Copyright (c) 2014 Cloudera, 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 requi...
apache-2.0