repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
thepiper/standoff
refs/heads/master
vpy/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.py
475
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = LockFile('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked already...
saintpai/sos
refs/heads/master
sos/plugins/pam.py
5
# 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 distributed in the hope that it will be useful, # but...
chc4/urbit
refs/heads/master
outside/commonmark/bench/stats.py
38
#!/usr/bin/env python3 import sys import statistics def pairs(l, n): return zip(*[l[i::n] for i in range(n)]) # data comes in pairs: # n - time for running the program with no input # m - time for running it with the benchmark input # we measure (m - n) values = [ float(y) - float(x) for (x,y) in pair...
red-green/pahsv
refs/heads/master
analyzers/p0f.py
1
from scapy.all import * import sqlite3 import config import os from util import * load_module('p0f') ## for some reason you need p0f 2.x definitions for scapy's implementation DB = config.DATABASE conn = sqlite3.connect(DB) c = conn.cursor() try: c.execute("CREATE TABLE opsys (mac text, os text)") except sqlite3.Ope...
mcollins12321/anita
refs/heads/master
venv/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/pysqlcipher.py
80
# sqlite/pysqlcipher.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: sqlite+pysqlcipher :name: pysqlcipher :dbapi: pysqlci...
Noviat/odoo
refs/heads/8.0
addons/hr_expense/report/__init__.py
380
# -*- 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...
ninowalker/mapnik-trunk
refs/heads/master
scons/sconsign.py
13
#! /usr/bin/env python # # SCons - a Software Constructor # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # 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 Softwa...
pwong-mapr/private-hue
refs/heads/HUE-1096-abe
desktop/core/ext-py/Django-1.4.5/django/core/files/base.py
78
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.utils.encoding import smart_str, smart_unicode from django.core.files.utils import FileProxyMixin class File(FileProxyMixin): DEFAULT_CHUNK_SIZE = 64 * 2**10 def __init__(self, file, name=None)...
Julien-Blanc/djangocms-cascade
refs/heads/master
cmsplugin_cascade/bootstrap3/panel.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals try: from html.parser import HTMLParser # py3 except ImportError: from HTMLParser import HTMLParser # py2 from django.forms import widgets from django.forms.widgets import RadioFieldRenderer from django.utils.html import format_html, format_html_...
40223141/w12-2
refs/heads/master
wsgi/pybean.py
562
#coding: utf-8 import sqlite3 from pkg_resources import parse_version __version__ = "0.2.1" __author__ = "Mickael Desfrenes" __email__ = "desfrenes@gmail.com" # Yen 2013.04.08, 將 Python2 的 .next() 改為 next(), 以便在 Python 3 中使用 class SQLiteWriter(object): """ In frozen mode (the default), the writer will not a...
IronLanguages/ironpython3
refs/heads/master
Tests/interop/net/method/test_returnvalue.py
1
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ''' NOTES: - seems not a good test? ''' import unittest from iptest import IronPythonTestCase, run_test, skipUn...
quarkslab/irma
refs/heads/master
frontend/extras/migration/versions/960de2c5749e_FileKiosk.py
1
"""empty message Revision ID: 960de2c5749e Revises: 801a4e6b3262 Create Date: 2018-05-22 15:47:51.455514 """ # revision identifiers, used by Alembic. revision = '960de2c5749e' down_revision = '801a4e6b3262' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): # ...
datenbetrieb/odoo
refs/heads/8.0
addons/auth_ldap/__init__.py
442
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
aleida/django
refs/heads/master
django/db/models/fields/files.py
4
import datetime import os from django import forms from django.db.models.fields import Field from django.core.exceptions import ValidationError from django.core.files.base import File from django.core.files.storage import default_storage from django.core.files.images import ImageFile from django.db.models import signa...
UCSD-CCAL/simpli
refs/heads/master
jupyter_gui/manager.py
1
""" Defines Manager class which: 1) syncs the globals between Notebook and Simpli; 2) keeps track of tasks, which can be added from JSON or Notebook cell; 3) provides access to tasks; 4) converts task widgets into code cells; and 5) executes task widget. """ import ast # Don't remove importing sys ...
papouso/odoo
refs/heads/8.0
addons/account/wizard/account_report_general_journal.py
378
# -*- 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...
chris4795/u-boot-novena
refs/heads/master
tools/binman/etype/intel_fsp.py
7
# Copyright (c) 2016 Google, Inc # Written by Simon Glass <sjg@chromium.org> # # SPDX-License-Identifier: GPL-2.0+ # # Entry-type module for Intel Firmware Support Package binary blob # from entry import Entry from blob import Entry_blob class Entry_intel_fsp(Entry_blob): def __init__(self, image, etype, nod...
unparagoned/openhab_spotify-webconnect-api
refs/heads/master
myopenhab.py
2
import sys import json import requests import time import urlparse import sys def batteryLevel( level ): "This returns a string value for a battery level" l = 'empty' try: v = float(level) except: v = 0 if (v < 5): l = 'empty' elif (v < 20): l = 'low' el...
veger/ansible
refs/heads/devel
lib/ansible/utils/color.py
146
# (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...
JSteunou/comimoc-back
refs/heads/master
setup.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from pip.req import parse_requirements from setuptools import setup, find_packages setup(name='comimoc', version='1.0.0', description='Comimoc backend for Comimoc project', author='Jérôme Steunou', author_email='contact@jeromesteunou.net', p...
gfcapalbo/connector-woocommerce-1
refs/heads/8.0
connector_woocommerce/unit/mapper.py
3
# -*- coding: utf-8 -*- # # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free ...
cgore/pixie
refs/heads/master
pixie/vm/libs/pxic/__init__.py
84
__author__ = 'tim'
aldian/tensorflow
refs/heads/master
tensorflow/python/ops/split_benchmark.py
175
# 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...
rajul/Pydev
refs/heads/development
plugins/org.python.pydev.refactoring/tests/python/visitor/selectionextension/testSelectionExtensionControlTryPart.py
8
class A: def test(self): a = 1 ##|try: print a ##| print "foo" except: print b print "bar" else: print "hopefully" finally: print "it works" var = a * a print var ...
jmesteve/saas3
refs/heads/master
openerp/addons/google_account/__init__.py
143
# -*- 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...
shubhdev/edx-platform
refs/heads/master
lms/djangoapps/instructor/management/commands/openended_post.py
39
""" Command to manually re-post open ended submissions to the grader. """ from django.contrib.auth.models import User from django.core.management.base import BaseCommand from optparse import make_option from xmodule.modulestore.django import modulestore from opaque_keys.edx.locations import SlashSeparatedCourseKey fro...
tkem/cachetools
refs/heads/master
src/cachetools/__init__.py
1
"""Extensible memoizing collections and decorators.""" from .cache import Cache from .decorators import cached, cachedmethod from .fifo import FIFOCache from .lfu import LFUCache from .lru import LRUCache from .mru import MRUCache from .rr import RRCache from .ttl import TTLCache __all__ = ( "Cache", "FIFOCac...
PokeHunterProject/pogom-updated
refs/heads/master
pogom/pgoapi/protos/POGOProtos/Settings/GlobalSettings_pb2.py
6
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Settings/GlobalSettings.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf ...
jeyraof/python-social-auth
refs/heads/master
social/pipeline/mail.py
77
from social.exceptions import InvalidEmail from social.pipeline.partial import partial @partial def mail_validation(backend, details, is_new=False, *args, **kwargs): requires_validation = backend.REQUIRES_EMAIL_VALIDATION or \ backend.setting('FORCE_EMAIL_VALIDATION', False) send_val...
mmnelemane/nova
refs/heads/master
nova/tests/unit/compute/monitors/test_monitors.py
18
# Copyright 2013 Intel 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 require...
AmaanC/saxo
refs/heads/master
setup.py
3
# http://inamidst.com/saxo/ # Created by Sean B. Palmer # python3 setup.py sdist --formats=bztar # python3 setup.py bdist_wheel import os.path import sys def error(*messages): for message in messages: print(message, file=sys.stderr) sys.exit(1) try: from setuptools import setup except ImportError as...
ryancoleman/autodock-vina
refs/heads/master
boost_1_54_0/libs/python/pyste/src/Pyste/infos.py
54
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import os.path import copy import exporters from ClassExporter import ClassExporter fro...
ryfeus/lambda-packs
refs/heads/master
Tensorflow/source/tensorflow/python/ops/gen_functional_ops.py
2
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: functional_ops.cc """ import collections as _collections from tensorflow.python.eager import execute as _execute from tensorflow.python.eager import context as _context from tensorflow.python.eager import...
yewang15215/django
refs/heads/master
django/conf/locale/ta/formats.py
619
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F, Y' TIME_FORMAT = 'g:i A' # D...
roselleebarle04/django
refs/heads/master
tests/staticfiles_tests/settings.py
147
from __future__ import unicode_literals import os.path from django.utils._os import upath TEST_ROOT = os.path.dirname(upath(__file__)) TESTFILES_PATH = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test') TEST_SETTINGS = { 'DEBUG': True, 'MEDIA_URL': '/media/', 'STATIC_URL': '/static/', 'MEDIA...
GbalsaC/bitnamiP
refs/heads/master
venv/lib/python2.7/site-packages/sklearn/decomposition/nmf.py
5
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck <L.J.Buitinck@uva.nl> # Author: Chih-Jen Lin, National Taiwan University (original projected gradient # NMF implementation) # Author: Anthony Di Franco (original Python and NumPy port) # License: BSD from __future__ import di...
alanfgates/hive
refs/heads/master
testutils/ptest/Ssh.py
18
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
Dexhub/MTX
refs/heads/master
src/mem/slicc/ast/InfixOperatorExprAST.py
2
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
plotly/plotly.py
refs/heads/master
packages/python/plotly/plotly/validators/scattergl/marker/colorbar/_lenmode.py
1
import _plotly_utils.basevalidators class LenmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="lenmode", parent_name="scattergl.marker.colorbar", **kwargs ): super(LenmodeValidator, self).__init__( plotly_name=plotly_name, ...
rackerlabs/qonos
refs/heads/master
qonos/openstack/common/rpc/service.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...
ceefour/opencog
refs/heads/master
opencog/python/blending/src/connector/connector_finder.py
22
from blending.src.connector.connect_simple import ConnectSimple from blending.src.connector.connect_conflict_random import ConnectConflictRandom from blending.src.connector.connect_conflict_viable import \ ConnectConflictAllViable from blending.src.connector.connect_conflict_interaction_information import \ Con...
anishathalye/pyyaml
refs/heads/master
tests/lib/canonical.py
33
import yaml, yaml.composer, yaml.constructor, yaml.resolver class CanonicalError(yaml.YAMLError): pass class CanonicalScanner: def __init__(self, data): try: self.data = unicode(data, 'utf-8')+u'\0' except UnicodeDecodeError: raise CanonicalError("utf-8 stream is expe...
owtf/owtf
refs/heads/develop
tests/functional/cli/test_list_plugins.py
1
""" tests.functional.cli.test_list_plugins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from tests.owtftest import OWTFCliTestCase class OWTFCliListPluginsTest(OWTFCliTestCase): categories = ["cli"] def test_cli_list_plugins_aux(self): """Run OWTF to list the aux plugins.""" expected = [ ...
doloopwhile/PyExecJS
refs/heads/master
execjs/_exceptions.py
1
# Abstract base error classes class Error(Exception): pass # Abstract class that represents errors of runtime engine. # ex. Specified runtime engine is not installed, runtime engine aborted (by its bugs). # By the way "RuntimeError" is bad name because it is confusing with the standard exception. class RuntimeErro...
tensorflow/tfjs
refs/heads/master
tfjs-converter/python/tensorflowjs/converters/wizard_test.py
1
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
ptroja/spark2014
refs/heads/master
testsuite/gnatprove/tests/N709-001__contracts/test.py
184
from test_support import * prove_all()
pchaigno/grreat
refs/heads/master
lib/export_test.py
2
#!/usr/bin/env python """Tests for export converters.""" import json import os import socket # pylint: disable=unused-import,g-bad-import-order from grr.lib import server_plugins # pylint: enable=unused-import,g-bad-import-order from grr.client.client_actions import grr_rekall from grr.lib import action_mocks fro...
Soya93/Extract-Refactoring
refs/heads/master
python/lib/Lib/site-packages/django/utils/xmlutils.py
734
""" Utilities for XML generation/parsing. """ from xml.sax.saxutils import XMLGenerator class SimplerXMLGenerator(XMLGenerator): def addQuickElement(self, name, contents=None, attrs=None): "Convenience method for adding an element with no children" if attrs is None: attrs = {} self.startEl...
lulandco/SickRage
refs/heads/develop
lib/rebulk/test/test_processors.py
18
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=no-self-use, pointless-statement, missing-docstring, no-member from ..pattern import StringPattern, RePattern from ..processors import ConflictSolver from ..rules import execute_rule from ..match import Matches def test_conflict_1(): input_string = ...
barbarubra/Don-t-know-What-i-m-doing.
refs/heads/master
python-build/python-libs/gdata/tests/gdata_tests/youtube/service_test.py
89
#!/usr/bin/python # # Copyright (C) 2008 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 ...
wscullin/spack
refs/heads/qmcpack
var/spack/repos/builtin/packages/sspace-standard/package.py
3
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
carolFrohlich/nipype
refs/heads/master
nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py
12
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..maths import ChangeDataType def test_ChangeDataType_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(nohash=True, usedef...
mkvdv/au-linux-kernel-autumn-2017
refs/heads/master
linux/tools/power/pm-graph/analyze_suspend.py
58
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
Arcanemagus/SickRage
refs/heads/master
lib/hachoir_parser/container/action_script.py
84
""" SWF (Macromedia/Adobe Flash) file parser. Documentation: - Alexis' SWF Reference: http://www.m2osw.com/swf_alexref.html - Tamarin ABC format: http://www.m2osw.com/abc_format.html Authors: Sebastien Ponce, Robert Xiao Creation date: 26 April 2008 """ from hachoir_parser import Parser from hachoir_core.fi...
kaspar030/RIOT
refs/heads/master
tests/memarray/tests/01-run.py
7
#!/usr/bin/env python3 # Copyright (C) 2019 Inria # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys from testrunner import run def testfunc(child): child.expect(r'MAX_NUMBER_BLOCKS:...
holmberd/three.js
refs/heads/master
utils/exporters/blender/addons/io_three/exporter/image.py
203
import os from .. import constants, logger from . import base_classes, io, api class Image(base_classes.BaseNode): """Class the wraps an image node. This is the node that represent that actual file on disk. """ def __init__(self, node, parent): logger.debug("Image().__init__(%s)", node) ...
danbradham/shadeset
refs/heads/master
shadeset/packages/yaml/yaml3/parser.py
210
# The following YAML grammar is LL(1) and is parsed by a recursive descent # parser. # # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END # implicit_document ::= block_node DOCUMENT-END* # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* # block_node_or_inden...
MarkUsProject/Markus
refs/heads/master
lib/repo/git_hooks/client/pre-commit.d/02-block_change_top_level_master.py
2
#!/usr/bin/env python3 import os import os.path import subprocess import sys if __name__ == '__main__': print('[MarkUs] Checking whether top-level files/directories were created/modified...') exceptions = {'.gitignore'} # top-level exceptions against = 'HEAD' changed_files = subprocess.run(['git', '...
bwalks/pymemcache
refs/heads/master
docs/conf.py
2
# -*- coding: utf-8 -*- # # pymemcache documentation build configuration file, created by # sphinx-quickstart on Wed Aug 3 11:15:43 2016. # # 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. # ...
wjwwood/catkin_tools
refs/heads/master
catkin_tools/runner/run_unix.py
5
# Copyright 2014 Open Source Robotics Foundation, 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...
19kestier/taiga-back
refs/heads/master
tests/integration/resources_permissions/test_resolver_resources.py
20
from django.core.urlresolvers import reverse from taiga.permissions.permissions import MEMBERS_PERMISSIONS, ANON_PERMISSIONS, USER_PERMISSIONS from tests import factories as f from tests.utils import helper_test_http_method, disconnect_signals, reconnect_signals import pytest pytestmark = pytest.mark.django_db def...
leonardofoderaro/incubator-zeppelin
refs/heads/master
dev/merge_zeppelin_pr.py
60
#!/usr/bin/env python # # 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 "Li...
todorez/crops
refs/heads/master
tests/functional/test_ceed_commands.py
2
''' Test Basic ceed/codi api''' import unittest import re import subprocess import utils.ceedutil as ceedutil # This test set ASSUMES the initial scripts have been run and therefore we have # 1) 1 codi container named codi-test # 2) 4 toolchain containers named test-toolchain-test[0-3] class CeedCommandsTests(unit...
mpokwsths/mpokang_kernel
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
PierrotLC/pykalman
refs/heads/master
examples/unscented/plot_additive.py
5
''' ============================================ General vs. Additive Unscented Kalman Filter ============================================ This example shows the difference between the general Unscented Kalman Filter and the Additive Unscented Kalman Filter. The general Unscented Kalman Filter (UKF) places no limitat...
kerr-huang/SL4A
refs/heads/master
python/src/Lib/atexit.py
336
""" atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. """ __all__ = ["register"] import sys _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in rev...
LordSputnik/beets
refs/heads/master
beetsplug/thumbnails.py
2
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Bruno Cauet # # 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 r...
kikokubo/Sick-Beard-TPB
refs/heads/ThePirateBay
tests/all_tests.py
30
#!/usr/bin/env python # coding=UTF-8 # Author: Dennis Lutter <lad1337@gmail.com> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Softwa...
Laimiux/mydeatree
refs/heads/master
django/utils/synch.py
376
""" Synchronization primitives: - reader-writer lock (preference to writers) (Contributed to Django by eugene@lazutkin.com) """ try: import threading except ImportError: import dummy_threading as threading class RWLock: """ Classic implementation of reader-writer lock with preference to writers....
beedesk/django-pipeline
refs/heads/master
tests/tests/test_template.py
3
from jinja2 import Environment, PackageLoader from django.template import Template, Context from django.test import TestCase from pipeline.jinja2 import PipelineExtension from tests.utils import pipeline_settings class JinjaTest(TestCase): def setUp(self): self.env = Environment(extensions=[PipelineExt...
gVallverdu/pymatgen
refs/heads/master
pymatgen/ext/matproj.py
1
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides classes to interface with the Materials Project REST API v2 to enable the creation of data structures and pymatgen objects using Materials Project data. To make use of the Materials AP...
imiolek-ireneusz/eduActiv8
refs/heads/master
i18n/custom/a4a_py/en_GB.py
5
# -*- coding: utf-8 -*- d = dict() d["a4a_animals"] = ['cow', 'turkey', 'shrimp', 'wolf', 'panther', 'panda', 'magpie', 'clam', 'pony', 'mouse', 'pug', 'koala', 'frog', 'ladybug', 'gorilla', 'llama', 'vulture', 'hamster', 'bird', 'starfish', 'crow', 'parakeet', 'caterpillar', 'tiger', 'hummingbird', 'piranha', 'pig', ...
caleb531/cache-simulator
refs/heads/master
tests/test_simulator_display.py
1
#!/usr/bin/env python3 import contextlib import io import nose.tools as nose from cachesimulator.simulator import Simulator WORD_ADDRS = [43, 14, 253, 186] TABLE_WIDTH = 80 def apply_cache_statuses_to_refs(cache_statuses, refs): for cache_status, ref in zip(cache_statuses, refs): ref.cache_status = c...
habeanf/Open-Knesset
refs/heads/upmaster
committees/views.py
6
import datetime import json import re import colorsys import difflib import logging import tagging import auxiliary.tag_suggestions from actstream import action from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType from...
hainn8x/gnuradio
refs/heads/master
gnuradio-runtime/examples/network/audio_sink.py
58
#!/usr/bin/env python # # Copyright 2006,2007,2010 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 ...
alphafoobar/intellij-community
refs/heads/master
python/testData/inspections/DictComprehensionToCall_after.py
70
var = dict([(k, v) for k, v in zip('abc', range(3)) if k % 2])
zhangjunlei26/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/__init__.py
426
""" HTML parsing library based on the WHATWG "HTML5" specification. The parser is designed to be compatible with existing HTML found in the wild and implements well-defined error recovery that is largely compatible with modern desktop web browsers. Example usage: import html5lib f = open("my_document.html") tree = ht...
sloria/konch
refs/heads/master
example_rcfiles/konch_random.py
1
# vi: set ft=python : import random import konch banner = """ "Probability is not a mere computation of odds on the dice or more complicated variants; it is the acceptance of the lack of certainty in our knowledge and the development of methods for dealing with our ignorance." - Nassim Nickolas Taleb """ konch.conf...
MickaelBergem/django-allauth
refs/heads/master
allauth/socialaccount/providers/dropbox_oauth2/provider.py
61
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class DropboxOAuth2Account(ProviderAccount): pass class DropboxOAuth2Provider(OAuth2Provider): id = 'dropbox_oauth2' nam...
AwesomeTTS/awesometts-anki-addon
refs/heads/master
tools/service_azure_regionlist.py
1
#!/usr/bin/env python """ Retrieve Azure region list from web page """ import urllib import urllib.request from bs4 import BeautifulSoup def main(): url = 'https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/rest-text-to-speech' response = urllib.request.urlopen(url) content = r...
mauisabily/ubuntujobcredit
refs/heads/master
contrib/testgen/gen_base58_test_vectors.py
1064
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
nerandell/async_retrial
refs/heads/master
retrial/retrial/__init__.py
1
__all__ = ['retry', 'RetryHandler'] from .retry import RetryHandler, retry
github-account-because-they-want-it/django
refs/heads/master
tests/template_tests/templatetags/bad_tag.py
513
from django import template register = template.Library() @register.tag def badtag(parser, token): raise RuntimeError("I am a bad tag") @register.simple_tag def badsimpletag(): raise RuntimeError("I am a bad simpletag")
Big-B702/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_syntax.py
87
"""This module tests SyntaxErrors. Here's an example of the sort of thing that is tested. >>> def f(x): ... global x Traceback (most recent call last): SyntaxError: name 'x' is parameter and global The tests are all raise SyntaxErrors. They were created by checking each C call that raises SyntaxError. There ar...
ruuk/script.module.youtube.dl
refs/heads/master
lib/youtube_dl/extractor/meta.py
81
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from .pladform import PladformIE from ..utils import ( unescapeHTML, int_or_none, ExtractorError, ) class METAIE(InfoExtractor): _VALID_URL = r'https?://video\.meta\.ua/(?:iframe/)?(?P<id>[0-9]+)' _TESTS = [...
virtuald/git-source-track
refs/heads/master
git_source_track/git_log.py
1
from __future__ import print_function import os from six.moves import shlex_quote import tempfile import sh def _multi_output(commands): ''' Shows output of multiple git commands .. make sure the output is shell-safe ''' tname = None try: with tempfile.NamedTemporary...
leiferikb/bitpop
refs/heads/master
depot_tools/third_party/boto/ecs/__init__.py
89
# Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # 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, ...
Gaia3D/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/v_univar.py
20
# -*- coding: utf-8 -*- """ *************************************************************************** v_univar.py --------------------- Date : December 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************************...
nexusriot/cinder
refs/heads/master
cinder/volume/drivers/blockbridge.py
16
# Copyright 2013-2015 Blockbridge Networks, 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 appl...
dalegregory/odoo
refs/heads/8.0
openerp/tools/yaml_import.py
114
# -*- coding: utf-8 -*- import threading import types import time # used to eval time.strftime expressions from datetime import datetime, timedelta import logging import openerp import openerp.sql_db as sql_db import openerp.workflow import misc from config import config import yaml_tag import yaml import re from lxml...
andreas-h/pelican-plugins
refs/heads/master
multi_part/__init__.py
76
from .multi_part import *
lgt1001/eztest
refs/heads/master
examples/target_is_unittest/test_case.py
1
import unittest class UserTestOne(unittest.TestCase): def setUp(self): print('Setup function in one') @classmethod def setUpClass(cls): print('Setup class in one') def tearDown(self): print('Teardown function in one') @classmethod def tearDownClass(cls): prin...
csitarichie/boost_msm_bare_metal
refs/heads/master
boost/tools/build/v2/test/dependency_property.py
20
#!/usr/bin/python # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Regression test: virtual targets with different dependency properties were # considered different by 'virtual-target.registe...
iEngage/python-sdk
refs/heads/master
test/test_entity.py
1
# coding: utf-8 """ Stakeholder engagement API This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers. OpenAPI spec version: 1.0 Generated by: https://github.com/swagger...
hibooboo2/python-agent
refs/heads/non_docker_repos
cattle/plugins/console-agent/__init__.py
5
from cattle.type_manager import register_type, LIFECYCLE from .console_agent import ConsoleAgent register_type(LIFECYCLE, ConsoleAgent())
virtuald/greenado
refs/heads/master
greenado/__init__.py
1
from .concurrent import gcall, generator, gmoment, groutine, gsleep, gyield, TimeoutError from .version import __version__
gabrielfalcao/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/contrib/admin/forms.py
153
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy, ugettext as _ ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. " ...
Esquive/kafka
refs/heads/trunk
tests/kafkatest/tests/connect/connect_distributed_test.py
14
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
jbaayen/reinteract
refs/heads/sympy
lib/reinteract/rewrite.py
3
# Copyright 2007-2009 Owen Taylor # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import parser import re import token import symb...
CloudServer/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping_v1.py
25
# Copyright (c) 2014 IBM Corp. # 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...