repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
MC911-MV-1s2016/lya-compiler-python | refs/heads/dev | ply-3.8/test/yacc_misplaced.py | 174 | # -----------------------------------------------------------------------------
# yacc_misplaced.py
#
# A misplaced | in grammar rules
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import... |
harisibrahimkv/django | refs/heads/master | tests/generic_inline_admin/models.py | 133 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Episode(models.Model):
name = models.CharField(max_length=100)
length = models.CharField(max_length=100, blank=True)
auth... |
autokey/autokey | refs/heads/master | lib/autokey/iomediator/__init__.py | 4 | # Copyright (C) 2018 Thomas Hess
#
# 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 distributed in th... |
Stranjyr/AntBot | refs/heads/master | src/Python/Fall2014/visionTest2.py | 1 | import cv2
import numpy as np
cap = cv2.VideoCapture(0)
##For setting up and testing webcams
##opens a window that filters color by HSV
while(1):
# Take each frame
_, frame = cap.read()
# Convert BGR to HSV
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# define range of blue color in HSV
lowe... |
sriprasanna/django-1.3.1 | refs/heads/master | django/dispatch/dispatcher.py | 315 | import weakref
import threading
from django.dispatch import saferef
WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
def _make_id(target):
if hasattr(target, 'im_func'):
return (id(target.im_self), id(target.im_func))
return id(target)
class Signal(object):
"""
Base class ... |
fitermay/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/transplant.py | 91 | # Patch transplanting extension for Mercurial
#
# Copyright 2006, 2007 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to transplant changesets from another branch
This extension allo... |
charris/numpy | refs/heads/dependabot/pip/mypy-0.910 | benchmarks/benchmarks/bench_io.py | 17 | from .common import Benchmark, get_squares
import numpy as np
from io import StringIO
class Copy(Benchmark):
params = ["int8", "int16", "float32", "float64",
"complex64", "complex128"]
param_names = ['type']
def setup(self, typename):
dtype = np.dtype(typename)
self.d = np.... |
google/skia | refs/heads/main | infra/bots/assets/android_ndk_darwin/create.py | 1 | #!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import glob
import os.path
import shutil
import subprocess
NDK_VER = "android-ndk-r21d"
NDK_URL = \
"https://dl.g... |
leb2dg/osf.io | refs/heads/develop | addons/bitbucket/tests/test_models.py | 9 | # -*- coding: utf-8 -*-
import mock
import pytest
import unittest
from nose.tools import * # noqa
from tests.base import OsfTestCase, get_default_metaschema
from osf_tests.factories import ExternalAccountFactory, ProjectFactory, UserFactory
from framework.auth import Auth
from addons.bitbucket.exceptions import No... |
WillisXChen/django-oscar | refs/heads/master | oscar/lib/python2.7/site-packages/unidecode/x09f.py | 252 | data = (
'Cu ', # 0x00
'Qu ', # 0x01
'Chao ', # 0x02
'Wa ', # 0x03
'Zhu ', # 0x04
'Zhi ', # 0x05
'Mang ', # 0x06
'Ao ', # 0x07
'Bie ', # 0x08
'Tuo ', # 0x09
'Bi ', # 0x0a
'Yuan ', # 0x0b
'Chao ', # 0x0c
'Tuo ', # 0x0d
'Ding ', # 0x0e
'Mi ', # 0x0f
'Nai ', # 0x10
'Ding ... |
axelpale/nudged-py | refs/heads/master | nudged/estimate.py | 1 | # -*- coding: utf-8 -*-
from .transform import Transform
def estimate(domainpoints, rangepoints):
'''
Parameters
domainpoints
list of [x, y] 2D lists
rangepoints
list of [x, y] 2D lists
'''
# Alias
X = domainpoints
Y = rangepoints
# Allow arrays of... |
tbeadle/selenium | refs/heads/master | py/test/selenium/webdriver/common/api_example_tests.py | 9 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
Allow2CEO/browser-ios | refs/heads/master | brave/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/oauth2client/appengine.py | 154 | # Copyright (C) 2010 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 writ... |
rajul/tvb-framework | refs/heads/master | tvb/tests/framework/core/entities/file/hdf5_storage_test.py | 1 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... |
losnikitos/googleads-python-lib | refs/heads/master | examples/adwords/authentication/create_adwords_client_without_yaml.py | 4 | #!/usr/bin/python
#
# 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 b... |
michaelBenin/django-oscar | refs/heads/master | oscar/apps/analytics/migrations/0001_initial.py | 1 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
('customer', '0001_initial'),
('catalogue', '0001_initial'),
)
def forwards(self, orm):
# Adding mod... |
howcouldyouforgetthisusername/aries-analyzer | refs/heads/master | build/main/setuptools-27.2.0-py2.7.egg/setuptools/command/bdist_wininst.py | 42 | import distutils.command.bdist_wininst as orig
class bdist_wininst(orig.bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
"""
Supplement reinitialize_command to work around
http://bugs.python.org/issue20819
"""
cmd = self.distribution.reinitial... |
google/usd_from_gltf | refs/heads/master | tools/ufgbatch/ufgvalidate.py | 1 | #!/usr/bin/python
#
# 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 ag... |
darkleons/BE | refs/heads/master | addons/website/models/__init__.py | 316 | # -*- coding: utf-8 -*-
# flake8:noqa
import ir_actions
import ir_ui_view
import website
import ir_qweb
import ir_http
import res_config
import update
import test_models
|
xen0l/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_network_offering.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, David Passante (@dpassante)
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': [... |
cherez/youtube-dl | refs/heads/master | youtube_dl/extractor/spike.py | 127 | from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class SpikeIE(MTVServicesInfoExtractor):
_VALID_URL = r'''(?x)https?://
(?:www\.spike\.com/(?:video-(?:clips|playlists)|(?:full-)?episodes)/.+|
m\.spike\.com/videos/video\.rbml\?id=(?P<id>[^&]+))
'''
_T... |
alsrgv/tensorflow | refs/heads/master | tensorflow/contrib/autograph/examples/benchmarks/cartpole_benchmark.py | 16 | # 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... |
kubaszostak/gdal-dragndrop | refs/heads/master | osgeo/apps/Python27/Lib/site-packages/numpy/ma/testutils.py | 29 | """Miscellaneous functions for testing masked arrays and subclasses
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id: testutils.py 3529 2007-11-13 08:01:14Z jarrod.millman $
"""
from __future__ import division, absolute_import, print_function
import operator
import numpy as np
from nu... |
elkingtonmcb/django | refs/heads/master | tests/files/tests.py | 277 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import os
import struct
import tempfile
import unittest
from io import BytesIO, StringIO
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.move import file_move_safe
from django.core.file... |
shreyas/lstree | refs/heads/master | docs/conf.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# lstree documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 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
# auto... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/protocols/basic.py | 18 | # -*- test-case-name: twisted.test.test_protocols -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Basic protocols, such as line-oriented, netstring, and int prefixed strings.
Maintainer: Itamar Shtull-Trauring
"""
# System imports
import re
import struct
import warnings
import cStrin... |
3dfxmadscientist/odoo_vi | refs/heads/master | addons/website_membership/models/__init__.py | 176 | import product
|
alhashash/odoo | refs/heads/master | addons/account/account_analytic_line.py | 7 | # -*- 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... |
nirvn/QGIS | refs/heads/master | tests/src/python/test_qgscolorscheme.py | 20 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsColorScheme.
.. note:: 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.
"""
__... |
marcwebbie/guessit | refs/heads/master | guessit/transfo/guess_video_rexps.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... |
cgourlay/tapiriik | refs/heads/master | tapiriik/services/Endomondo/__init__.py | 16 | from .endomondo import * |
longman694/youtube-dl | refs/heads/mod | youtube_dl/extractor/glide.py | 64 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class GlideIE(InfoExtractor):
IE_DESC = 'Glide mobile video messages (glide.me)'
_VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)'
_TEST = {
'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dC... |
lazywei/scikit-learn | refs/heads/master | sklearn/datasets/tests/test_20news.py | 280 | """Test the 20news downloader, if the data is available."""
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import SkipTest
from sklearn import datasets
def test_20news():
try:
data = dat... |
Sir-Henry-Curtis/Ironworks | refs/heads/master | lib/jinja2/compiler.py | 121 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from cStringIO import StringIO
from itertools import chain
from copy import deepcopy
from jinja2 import nodes
from j... |
facebook/mysql-5.6 | refs/heads/fb-mysql-5.6.35 | xtrabackup/test/python/testtools/tests/test_runtest.py | 42 | # Copyright (c) 2009-2010 testtools developers. See LICENSE for details.
"""Tests for the RunTest single test execution logic."""
from testtools import (
ExtendedToOriginalDecorator,
run_test_with,
RunTest,
TestCase,
TestResult,
)
from testtools.matchers import MatchesException, Is, Raises
fro... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/libfuturize/fixes/fix_remove_old__future__imports.py | 62 | """
Fixer for removing any of these lines:
from __future__ import with_statement
from __future__ import nested_scopes
from __future__ import generators
The reason is that __future__ imports like these are required to be the first
line of code (after docstrings) on Python 2.6+, which can get in the way.
T... |
pudo/aleph | refs/heads/master | aleph/migrate/versions/5615d592f571_cleanup.py | 1 | """Cleanup of various deprecated data elements.
Revision ID: 5615d592f571
Revises: 58f20ece0b91
Create Date: 2017-11-01 10:41:52.145075
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '5615d592f571'
down_revision = '58f... |
semonte/intellij-community | refs/heads/master | python/testData/inspections/AddClassFromFString_after.py | 22 | class MyClass(object):
pass
def f():
print(f'{MyClass()}') |
dzh123xt/pythonML | refs/heads/master | src/Cluster/base.py | 1 | __author__ = 'dengzhihong'
import numpy as np
class ClusterBase(object):
@staticmethod
def genRandMean(data, K):
D = data.shape[1]
RandMean = np.mat(np.zeros((K, D)))
for i in range(D):
LowValue = np.min(data[:,i])
RangeValue = float(np.max(data[:,i]) - LowValue... |
skarphed/modules | refs/heads/master | grindhold_plainhtml/__init__.py | 1 | #!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# © 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Skarphed.
#
# Skarphed is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as ... |
versatica/mediasoup | refs/heads/v3 | worker/deps/gyp/test/actions-subdir/src/subdir/make-subdir-file.py | 12 | #!/usr/bin/env python
# Copyright (c) 2009 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.
import sys
contents = 'Hello from make-subdir-file.py\n'
open(sys.argv[1], 'w').write(contents)
|
ARMmbed/yotta_osx_installer | refs/heads/master | workspace/lib/python2.7/site-packages/yotta/main.py | 3 | # Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
from .lib import lazyregex #pylint: disable=unused-import
# NOTE: argcomplete must be first!
# argcomplete, pip install argcomplete, tab-completion for argparse, Apache-2
import argcomplete
# standard... |
ssvsergeyev/ZenPacks.zenoss.AWS | refs/heads/develop | src/boto/tests/unit/vpc/test_networkacl.py | 113 | from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection
class TestDescribeNetworkAcls(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return b"""
<DescribeNetworkAclsResponse xmlns="http://ec2.ama... |
wolfier/incubator-airflow | refs/heads/master | airflow/contrib/operators/vertica_to_hive.py | 17 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
ClearCorp/server-tools | refs/heads/9.0 | subscription_action/tests/__init__.py | 1 | # -*- coding: utf-8 -*-
# © 2017 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_subscription_action
|
stanlee321/pysolper | refs/heads/master | latrop/urls.py | 2 | # -*- coding: utf-8 -*-
"""URL definitions."""
from tipfy.routing import Rule
rules = [
Rule('/', name='home', handler='home.HomeHandler'),
Rule('/action', handler='action.AddActionHandler'),
]
|
jmt4/Selenium2 | refs/heads/master | third_party/py/googlecode/googlecode_upload.py | 101 | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Taken from http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for... |
eirannejad/pyRevit | refs/heads/master | pyrevitlib/pyrevit/extensions/cacher_asc.py | 1 | """Base module to handle extension ASCII caching."""
import json
import codecs
from pyrevit import PyRevitException
from pyrevit.coreutils import appdata
from pyrevit.coreutils import get_all_subclasses
from pyrevit.coreutils.logger import get_logger
from pyrevit.extensions import components as comps
from pyrevit.exte... |
drbild/boto | refs/heads/develop | boto/regioninfo.py | 128 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... |
thorrak/fermentrack | refs/heads/master | external_push/migrations/0006_Grainfather_Support.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2019-12-23 13:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('gravity', '0004_BrewersFriend_Support'),
('externa... |
rizumu/django | refs/heads/master | tests/test_client_regress/models.py | 513 | from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.db import models
class CustomUser(AbstractBaseUser):
email = models.EmailField(verbose_name='email address', max_length=255, unique=True)
custom_objects = BaseUserManager()
USERNAME_FIELD = 'email'
class Meta:
... |
rikedyp/Dataland | refs/heads/master | GameEngine-Dev/R2D.py | 1 | """
Contains methods relating to 2D scenes in RikedyGame Engine
------------------------ TO DO -----------------------------------
2D pathfinding
Learn to use loggings
Collisions, walls, level map implementation and interactable objects an NPCs
Double check pygame.sprite is being used to its full usefulness
Is sprite... |
40423118/2017springcd_hw | refs/heads/gh-pages | plugin/liquid_tags/diag.py | 270 | """
Blockdiag Tag
---------
This tag implements a liquid style tag for blockdiag [1]. You can use different
diagram types like blockdiag, seqdiag, packetdiag etc. [1]
[1] http://blockdiag.com/en/blockdiag/
Syntax
------
{% blockdiag {
<diagramm type> {
<CODE>
}
}
%}
Examples
-------... |
agry/NGECore2 | refs/heads/master | scripts/object/draft_schematic/structure/city/cityhall_naboo.py | 85615 | import sys
def setup(core, object):
return |
TRUFIL/erpnext | refs/heads/develop | erpnext/patches/v7_1/update_component_type.py | 42 | import frappe
from frappe.utils import flt
def execute():
frappe.reload_doc('hr', 'doctype', 'salary_component')
sal_components = frappe.db.sql("""
select DISTINCT salary_component, parentfield from `tabSalary Detail`""", as_dict=True)
if sal_components:
for sal_component in sal_components:
if sal_component... |
phanikiran2/Extending-RED-qdisc-in-ns3-to-support--NLRED | refs/heads/master | bindings/python/my_extra_api_definitions.py | 218 | from pybindgen import Module, FileCodeSink, write_preamble, param, retval
def register_types(module):
module.add_class('MyClass')
def register_methods(root_module):
MyClass = root_module['MyClass']
MyClass.add_constructor([], visibility='public')
MyClass.add_constructor([param('double', 's'), para... |
kilojoule/yggdrashell | refs/heads/master | yggdrashell.py | 1 | #!/usr/bin/env python
import yaml, sys, random, re, time
import math
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("infile", metavar="INFILE", help="data file to read from")
parser.add_argument("outfile", metavar="OUTFILE", help="data file to write to", nargs="?")
parser.add_argument("-c", ... |
nophead/Skeinforge50plus | refs/heads/master | fabmetheus_utilities/geometry/creation/sponge_slice.py | 8 | """
Sponge slice.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.creation import lineation
from fabmetheus_utili... |
apel/rest | refs/heads/dev | apel_rest/__init__.py | 2 | """
Copyright (C) 2016 STFC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribu... |
alisaifee/AutobahnPython | refs/heads/master | examples/twisted/websocket/echo_endpoints/server.py | 18 | ###############################################################################
##
## Copyright (C) 2013 Tavendo GmbH
##
## 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:/... |
rwillmer/django | refs/heads/master | tests/urlpatterns_reverse/included_named_urls.py | 452 | from django.conf.urls import include, url
from .views import empty_view
urlpatterns = [
url(r'^$', empty_view, name="named-url3"),
url(r'^extra/(?P<extra>\w+)/$', empty_view, name="named-url4"),
url(r'^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$', empty_view),
url(r'^included/', include('urlpatterns_reverse.inc... |
kallewoof/bitcoin | refs/heads/master | test/functional/p2p_nobloomfilter_messages.py | 28 | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test invalid p2p messages for nodes with bloom filters disabled.
Test that, when bloom filters are not... |
koyuawsmbrtn/eclock | refs/heads/master | windows/Python27/Lib/unittest/runner.py | 136 | """Running tests"""
import sys
import time
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __getattr__(self, at... |
devgc/GcLinkParser | refs/heads/master | libglp/DbHandler.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
import logging
DB_LOGGER = logging.getLogger('DbHandler')
DB_LOGGER.setLevel(logging.DEBUG)
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
class DbConfig():
def __... |
DarkEnergyScienceCollaboration/ReprocessingTaskForce | refs/heads/master | config/w_2017_52/cfht/singleFrameDriverConfig_u.py | 18 | # Apply the brighter fatter correction
config.processCcd.isr.doBrighterFatter=False
config.processCcd.charImage.repair.cosmicray.nCrPixelMax=1000000
# Useul to get to avoid deblending of satellite tracks
config.processCcd.calibrate.deblend.maxFootprintSize=2000 # 2200
# Use psfex instead of pca
import lsst.meas.exte... |
kraziegent/mysql-5.6 | refs/heads/webscalesql-5.6.23.71 | xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_stats_test.py | 19 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... |
magicmonty/qmk_firmware | refs/heads/master | lib/lufa/Demos/Device/ClassDriver/GenericHID/HostTestApp/test_generic_hid_winusb.py | 92 | """
LUFA Library
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
"""
"""
LUFA Generic HID device demo host test script. This script will send a
continuous stream of generic reports to the device, to show a variable LED
pattern on the t... |
MounirMesselmeni/django | refs/heads/master | django/core/serializers/__init__.py | 347 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... |
open-synergy/opnsynid-hr | refs/heads/8.0 | hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api, _
from openerp.exceptions import Warning as UserError
class HrTimesheetAttendanceScheduleChange(models... |
apixandru/intellij-community | refs/heads/master | python/testData/editing/misplacedElse.after.py | 83 | def foo():
pass
else:
|
pavdmyt/yaspin | refs/heads/master | examples/timer_spinner.py | 1 | """
examples.timer_spinner
~~~~~~~~~~~~~~~~~~~~~~
Show elapsed time at the end of the line.
"""
import time
from yaspin import yaspin
def main():
with yaspin(text="elapsed time", timer=True) as sp:
# Floats are rounded into two decimal digits in timer output
time.sleep(3.1415)
sp.ok()
... |
annatisch/autorest | refs/heads/master | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/version.py | 1003 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
andrius-preimantas/odoo | refs/heads/master | addons/base_vat/res_company.py | 448 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
fengyuanjs/catawampus | refs/heads/master | dm/igd_time_test.py | 6 | #!/usr/bin/python
# Copyright 2012 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 appli... |
flyher/pymo | refs/heads/master | symbian/PythonForS60_1.9.6/module-repo/standard-modules/tty.py | 525 | """Terminal utilities."""
# Author: Steen Lumholt.
from termios import *
__all__ = ["setraw", "setcbreak"]
# Indexes for termios list.
IFLAG = 0
OFLAG = 1
CFLAG = 2
LFLAG = 3
ISPEED = 4
OSPEED = 5
CC = 6
def setraw(fd, when=TCSAFLUSH):
"""Put terminal into a raw mode."""
mode = tcgetattr(fd)
mode[IFLAG... |
aldeka/oppia | refs/heads/master | extensions/widgets/interactive/SetInput/SetInput.py | 1 | from core.domain import widget_domain
from extensions.value_generators.models import generators
class SetInput(widget_domain.BaseWidget):
"""Definition of a widget.
Do NOT make any changes to this widget definition while the Oppia app is
running, otherwise things will break.
This class represents a ... |
zimmermegan/smarda | refs/heads/master | nltk-3.0.3/nltk/inference/mace.py | 24 | # Natural Language Toolkit: Interface to the Mace4 Model Builder
#
# Author: Dan Garrette <dhgarrette@gmail.com>
# Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A model builder that makes use of the external 'Mace4' package.
"""
from __future__ import ... |
ingokegel/intellij-community | refs/heads/master | python/testData/paramInfo/NoArgs.py | 83 | def foo(a, b, c):
pass
foo(<arg1>)
|
JohnOrlando/gnuradio-bitshark | refs/heads/burx_support | gnuradio-examples/python/audio/audio_copy.py | 17 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007 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 you... |
wemanuel/smry | refs/heads/master | smry/server-auth/ls/google-cloud-sdk/.install/.backup/lib/argparse/__init__.py | 490 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The... |
visi0nary/mediatek | refs/heads/master | mt6732/kernel/arch/ia64/scripts/unwcheck.py | 13143 | #!/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... |
xwolf12/django | refs/heads/master | tests/gis_tests/rasterapp/test_rasterfield.py | 241 | import json
from unittest import skipIf
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.shortcuts import numpy
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from ..data.rasters.textrasters import JSON_RASTER
from... |
jeanqasaur/jeeves | refs/heads/master | demo/jeevesBug2/manage.py | 15 | #!/usr/bin/env python
import os
import sys
import macropy.activate
from macropy.core.exporters import SaveExporter
macropy.exporter = SaveExporter("exported", ".")
import JeevesLib
JeevesLib.init()
if __name__ == "__main__":
os.environ["DJANGO_SETTINGS_MODULE"] = "jelf.settings"
from django.core.management ... |
Metrink/metrink-fe | refs/heads/master | frontend/test/parser/MetrinkParserTest.py | 1 | import unittest
from antlr4 import InputStream, CommonTokenStream
from antlr4.error.ErrorListener import ErrorListener
from parser.MetrinkFrontendLexer import MetrinkFrontendLexer
from parser.MetrinkFrontendParser import MetrinkFrontendParser
class MyErrorListener(ErrorListener, unittest.TestCase):
def __init__... |
SPKian/Testing | refs/heads/master | erpnext/tasks.py | 56 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.celery_app import celery_task, task_logger
@celery_task()
def send_newsletter(site, newsletter, event):
# hack! pass event="bulk_long" to queue in long... |
salsoftware/sal | refs/heads/master | server/migrations/0019_auto__chg_field_machine_os_family.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Machine.os_family'
db.alter_column(u'server_machine', 'os_family', self.gf('django.db.mod... |
nextgis/peoplefinder | refs/heads/master | web/peoplefinder/uwsgiapp.py | 2 | # -*- coding: utf-8 -*-
import os
from paste.deploy import loadapp
if 'PASTE_CONFIG' in os.environ:
app = loadapp('config:' + os.environ['PASTE_CONFIG'])
def application(environ, start_response):
if os.environ.get('WSGI_FILE_WRAPPER', 'yes').lower() in ('no', 'false'):
environ.pop('wsgi.file_wrapper... |
dmitry-sobolev/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/apache2_module.py | 12 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013-2014, Christian Berendt <berendt@b1-systems.de>
#
# 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 o... |
vmindru/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_iapp_service.py | 17 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
mitodl/micromasters | refs/heads/master | cms/migrations/0022_add_categorized_faqs_page.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-11 21:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0028_merge'),
... |
rderradi/AliPhysics | refs/heads/master | PWGJE/EMCALJetTasks/Tracks/analysis/base/HepDataReader.py | 41 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... |
marinkaz/orange3 | refs/heads/master | Orange/misc/enum.py | 10 | ## Based on PEP-354, copied and adapted from
## http://stackoverflow.com/questions/36932/
_enum_registry = {}
def enum_value_unpickler(names, value):
enum_class = _enum_registry.get(names, None) or Enum(*names)
return enum_class[value]
def Enum(*names):
"""
Constructs a class with named constants. T... |
SeKwonLee/pmfs | 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. ... |
40223101/w16b_test | refs/heads/master | 2015cd_midterm-master/static/Brython3.1.1-20150328-091302/Lib/difflib.py | 737 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... |
DerekYu177/ExpenseManager | refs/heads/master | test/photo_analyzer/image_processor_test.py | 1 | import unittest
import pytest
from .. import test_helper
from ...modules.photo_analyzer import image_processor
from ...modules.image_data import ImageData
class TestMethods(unittest.TestCase, test_helper.TestHelper):
@classmethod
def setup_class(cls):
global its
text = """
caFE PA... |
JohnnyKing94/pootle | refs/heads/master | pootle/apps/pootle_app/__init__.py | 19 | default_app_config = "pootle_app.apps.PootleConfig"
|
thientu/scikit-learn | refs/heads/master | sklearn/feature_extraction/image.py | 263 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... |
zakuro9715/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/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.... |
gwu-libraries/sfm-ui | refs/heads/master | sfm/ui/test_models.py | 2 | from django.test import TestCase
from .models import User, CollectionSet, Credential, Collection, Seed, Group, Harvest, HarvestStat, Warc, \
default_uuid, Export
from .utils import collection_path as get_collection_path, collection_set_path as get_collection_set_path
import pytz
from datetime import datetime, dat... |
liulixiang1988/python-weixin | refs/heads/master | get_access_token.py | 3 | # -*- coding: utf-8 -*-
import sys
from weixin.client import WeixinAPI
from weixin.oauth2 import OAuth2AuthExchangeError
if len(sys.argv) > 1 and sys.argv[1] == 'local':
try:
from test_settings import *
WeixinAPI.host = test_host
WeixinAPI.base_path = test_base_path
WeixinAPI.acc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.