repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
aoanla/RDWC2018
refs/heads/master
ranking.py
1
import random import math import statsmodels.api as sm import numpy as np #team dict # # strength = "some numerical measure of the (true) team strength # # #upperbound log 2 def ceillog2(x): return math.ceil(math.log(x)/math.log(2)) #a safe approx to ratio def saferatio(x,y): if x==0: x = 0.5 if y==0: y = 0.5 ...
joone/chromium-crosswalk
refs/heads/2016.04.css-round-display-edtior-draft-1
build/android/pylib/utils/logging_utils.py
23
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import contextlib import logging import os from pylib.constants import host_paths _COLORAMA_PATH = os.path.join( host_paths.DIR_SOURCE_ROOT, 'third_par...
MSOpenTech/edx-platform
refs/heads/master
common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py
114
# -*- 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): # Adding model 'CourseAccessRole' db.create_table('student_courseaccessrole', ( ('id', self.gf('...
stutivarshney/Bal-Aveksha
refs/heads/master
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/rest_framework/metadata.py
32
""" The metadata API is used to allow customization of how `OPTIONS` requests are handled. We currently provide a single default implementation that returns some fairly ad-hoc information about the view. Future implementations might use JSON schema or other definitions in order to return this information in a more sta...
roncanepa/edx-downloader
refs/heads/master
edx_dl/utils.py
13
#!/usr/bin/env python # -*- coding: utf-8 -*- # This module contains generic functions, ideally useful to any other module from six.moves.urllib.request import urlopen, Request from six.moves import html_parser import errno import json import logging import os import string import subprocess def get_filename_from_p...
sloria/osf.io
refs/heads/develop
api_tests/users/views/test_user_actions.py
1
import mock import pytest from api.base.settings.defaults import API_BASE from api.providers.permissions import GroupHelper from osf_tests.factories import ( PreprintFactory, AuthUserFactory, PreprintProviderFactory, ) from osf.utils import permissions as osf_permissions from api_tests.reviews.mixins.filt...
RevelSystems/django
refs/heads/master
tests/admin_scripts/app_raising_messages/models.py
391
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core import checks from django.db import models class ModelRaisingMessages(models.Model): @classmethod def check(self, **kwargs): return [ checks.Warning( 'First warning', hint='Hin...
drufat/sympy
refs/heads/master
sympy/functions/special/tests/test_bessel.py
36
from itertools import product from sympy import (jn, yn, symbols, Symbol, sin, cos, pi, S, jn_zeros, besselj, bessely, besseli, besselk, hankel1, hankel2, hn1, hn2, expand_func, sqrt, sinh, cosh, diff, series, gamma, hyper, Abs, I, O, oo, conjugate) from sympy.f...
armando-migliaccio/neutron
refs/heads/master
neutron/tests/unit/openvswitch/test_ovs_tunnel.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nicira Networks, 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.apach...
Lujeni/ansible
refs/heads/devel
lib/ansible/plugins/cliconf/onyx.py
31
# # (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
ruxkor/tvauction
refs/heads/master
tvauction/__init__.py
2
# version
DemocracyClub/UK-Polling-Stations
refs/heads/master
polling_stations/apps/data_importers/management/commands/import_bromley.py
1
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "BRY" addresses_name = ( "2021-04-13T11:41:45.130802/Bromley Democracy_Club__06May2021 (1).CSV" ) stations_name = ( "2021-04-13T11:41:45.130...
dagwieers/ansible
refs/heads/devel
lib/ansible/modules/storage/netapp/na_ontap_aggregate.py
43
#!/usr/bin/python # (c) 2018-2019, NetApp, 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', 'status': ['preview'], ...
codervince/flashingredlight
refs/heads/master
env/lib/python2.7/site-packages/pip/req/__init__.py
122
from __future__ import absolute_import from .req_install import InstallRequirement from .req_set import RequirementSet, Requirements from .req_file import parse_requirements __all__ = [ RequirementSet, Requirements, InstallRequirement, parse_requirements, ]
khaleeque-ansari/Online-Coding-
refs/heads/master
CodeChef/Python Codes/INTEST.py
1
import sys n,k = map(int,sys.stdin.readline().split(" ")) array=map(int,sys.stdin.readlines()) count = 0 for i in array: if i%k == 0 : count += 1 print count
shaileshgoogler/pyglet
refs/heads/master
tests/__init__.py
12133432
LIMXTEC/Europecoin-V3
refs/heads/master
qa/rpc-tests/test_framework/__init__.py
12133432
RJ722/coala
refs/heads/master
tests/parsing/GlobTestDir/SubDir1/File12.py
12133432
decodio/l10n_hr
refs/heads/8.3-dev
l10n_hr_opz_stat/report/__init__.py
12133432
tuanavu/python-cookbook-3rd
refs/heads/master
src/15/defining_and_exporting_c_apis_from_extension_modules/example.py
5
import sample import ptexample p1 = sample.Point(2,3) ptexample.print_point(p1)
bibekluitel/ntu-dsi-dcn
refs/heads/master
src/click/bindings/modulegen__gcc_LP64.py
124
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
SmartElect/SmartElect
refs/heads/develop
bulk_sms/sending.py
1
import logging import os import time import signal import multiprocessing from django.conf import settings from django.core.cache import cache from django.db import connections as django_db_connections from django.db.models import F from rapidsms.errors import MessageSendingError from rapidsms.router import get_route...
caio2k/RIDE
refs/heads/master
utest/resources/mocks.py
1
from robotide.preferences.settings import Settings from robotide.preferences.excludes import Excludes from robotide.publish import PUBLISHER class MessageRecordingLoadObserver(object): def __init__(self): self._log = '' self.finished = False self.notified = False def notify(self): ...
adamkh/micropython
refs/heads/master
tests/basics/object1.py
110
# test builtin object() # creation object() # printing print(repr(object())[:7])
larsoner/mne-python
refs/heads/master
examples/datasets/plot_opm_data.py
12
""" .. _ex-opm-somatosensory: Optically pumped magnetometer (OPM) data ======================================== In this dataset, electrical median nerve stimulation was delivered to the left wrist of the subject. Somatosensory evoked fields were measured using nine QuSpin SERF OPMs placed over the right-hand side som...
edgewood/borg
refs/heads/master
src/borg/testsuite/hashindex.py
2
import base64 import hashlib import io import os import tempfile import zlib from ..hashindex import NSIndex, ChunkIndex, ChunkIndexEntry from .. import hashindex from ..crypto.file_integrity import IntegrityCheckedFile, FileIntegrityError from . import BaseTestCase # Note: these tests are part of the self test, do n...
frdb194/django
refs/heads/master
django/contrib/postgres/forms/__init__.py
1015
from .array import * # NOQA from .hstore import * # NOQA from .jsonb import * # NOQA from .ranges import * # NOQA
robocoreio/edison-kernel
refs/heads/edison
scripts/rt-tester/rt-tester.py
11005
#!/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...
EIT-ICT-RICH/ns-3-dev-TSCH
refs/heads/master
src/internet/bindings/callbacks_list.py
67
callback_classes = [ ['void', 'ns3::Ipv6Address', 'unsigned char', 'unsigned char', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ipv4Address', 'unsigned char', 'unsigned char', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', ...
Suninus/NewsBlur
refs/heads/master
vendor/zebra/conf/options.py
23
""" Default settings for zebra """ import datetime import os from django.conf import settings as _settings if hasattr(_settings, 'STRIPE_PUBLISHABLE'): STRIPE_PUBLISHABLE = getattr(_settings, 'STRIPE_PUBLISHABLE') else: try: STRIPE_PUBLISHABLE = os.environ['STRIPE_PUBLISHABLE'] except KeyError: ...
kaplun/ops
refs/heads/prod
modules/bibedit/lib/ticket_templates/__init__.py
12133432
quinot/ansible
refs/heads/devel
lib/ansible/module_utils/network/nxos/__init__.py
12133432
mdsafwan/Deal-My-Stuff
refs/heads/master
Lib/site-packages/django/conf/locale/ca/__init__.py
12133432
Lucky7Studio/tokudb-engine
refs/heads/master
mysql-test/suite/tokudb/t/change_column_blob.py
54
import sys def main(): print "# this test is generated by change_blob.py" print "# generate hot blob expansion test cases" print "--disable_warnings" print "DROP TABLE IF EXISTS t;" print "--enable_warnings" print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";" print "SET SESSION TOKUDB_DIS...
wi-fi-analyzer/scapy-fakeap
refs/heads/master
fakeap/__init__.py
3
from .fakeap import FakeAccessPoint from .callbacks import Callbacks from .constants import AP_WLAN_TYPE_OPEN, AP_WLAN_TYPE_WPA, AP_WLAN_TYPE_WPA2, \ AP_WLAN_TYPE_WPA_WPA2
VictoriaRoux/oppia
refs/heads/master
scripts/deploy.py
8
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
alexlo03/ansible
refs/heads/devel
test/units/modules/network/vyos/test_vyos_command.py
45
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
geekaia/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_delay_between_attempts.py
68
""" Tests the logic of problems with a delay between attempt submissions. Note that this test file is based off of test_capa_module.py and as such, uses the same CapaFactory problem setup to test the functionality of the check_problem method of a capa module when the "delay between quiz submissions" setting is set to ...
Weihonghao/ECM
refs/heads/master
Vpy34/lib/python3.5/site-packages/google/protobuf/field_mask_pb2.py
8
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/field_mask.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 import r...
Mapleroid/cm-server
refs/heads/master
server-5.11.0.src/com/cloudera/cmf/service/config/hadoop/topology.py
2
#!/usr/bin/env python # # Copyright (c) 2016 Cloudera, Inc. All rights reserved. # ''' This script is provided by CMF for hadoop to determine network/rack topology. It is automatically generated and could be replaced at any time. Any changes made to it will be lost when this happens. ''' import os import sys import x...
krzychb/rtd-test-bed
refs/heads/master
tools/tiny-test-fw/Env.py
1
# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD # # 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 ...
AkademieOlympia/sympy
refs/heads/master
sympy/assumptions/handlers/sets.py
37
""" Handlers for predicates related to set membership: integer, rational, etc. """ from __future__ import print_function, division from sympy.assumptions import Q, ask from sympy.assumptions.handlers import CommonHandler, test_closed_group from sympy.core.numbers import pi from sympy.logic.boolalg import conjuncts fro...
Dino0631/RedRain-Bot
refs/heads/develop
lib/youtube_dl/extractor/shared.py
41
from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, urlencode_postdata, ) class SharedBaseIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) webpage, urlh = self._down...
Jai-Chaudhary/vislab
refs/heads/master
matlab/hedging-1.0/third-party/liblinear-1.8/python/liblinearutil.py
11
#!/usr/bin/env python from liblinear import * def svm_read_problem(data_file_name): """ svm_read_problem(data_file_name) -> [y, x] Read LIBSVM-format data from data_file_name and return labels y and data instances x. """ prob_y = [] prob_x = [] for line in open(data_file_name): line = line.split(None, 1) ...
ddasilva/numpy
refs/heads/master
numpy/compat/py3k.py
73
""" Python 3 compatibility tools. """ from __future__ import division, absolute_import, print_function __all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested', 'asstr', 'open_latin1', 'long', 'basestring', 'sixu', ...
joshuajan/odoo
refs/heads/master
addons/stock_picking_wave/wizard/__init__.py
428
import picking_to_wave
mssalvador/RegnSkabData
refs/heads/master
DownloadData.py
1
''' Created on Jun 17, 2016 @author: svanhmic ''' import urllib import os import json import sys import re import requests from datetime import date, timedelta, datetime from elasticsearch import Elasticsearch from fileinput import filename from multiprocessing import Pool regn = "http://regnskaber.virk.dk/10275523/...
OmarIthawi/edx-platform
refs/heads/master
lms/djangoapps/instructor_task/tests/test_integration.py
6
""" Integration Tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ import csv import logging import json from mock import patch import textwrap from celery.states import SUCCESS, FAILURE from django.contrib.auth.models import U...
Temelio/ovh_api_tasks
refs/heads/develop
ovh_api_tasks/api_wrappers/__init__.py
12133432
PLyczkowski/Sticky-Keymap
refs/heads/master
2.74/scripts/modules/console/__init__.py
9
# Copyright (c) 2009 www.stani.be (GPL license) # ##### 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...
sthalik/pachi
refs/heads/master
tools/sgflib/__init__.py
8
from sgflib import *
ChameleonOS/android_external_skia
refs/heads/kitkat
tools/test_pictures.py
67
''' Compares the rendererings of serialized SkPictures to expected images. Launch with --help to see more information. Copyright 2012 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' # common Python modules import os import optparse import sys import ...
SUSE/kiwi
refs/heads/master
kiwi/iso_tools/cdrtools.py
1
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
eharney/cinder
refs/heads/master
cinder/tests/unit/test_coordination.py
1
# Copyright 2015 Intel # 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...
geopm/geopm
refs/heads/dev
integration/experiment/energy_efficiency/gen_plot_profile_comparison.py
1
#!/usr/bin/env python3 # # Copyright (c) 2015 - 2021, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, th...
mdaniel/intellij-community
refs/heads/master
python/testData/paramInfo/InitializingAttrs.py
18
import attr @attr.s class A1: x = attr.ib() y = attr.ib() z = attr.ib(default=0) A1(<arg1>) @attr.s class A2: x = attr.ib() y = attr.ib(init=True) z = attr.ib(default=0) A2(<arg2>) @attr.s class A3: x = attr.ib() y = attr.ib(init=False) z = attr.ib(default=0) A3(<arg3>) @at...
shakamunyi/tensorflow
refs/heads/master
tensorflow/python/debug/local_cli.py
3
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
recifeorganico/MITMf
refs/heads/master
core/sslstrip/StrippingProxy.py
31
# Copyright (c) 2014-2016 Moxie Marlinspike, 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...
piffey/ansible
refs/heads/devel
lib/ansible/modules/source_control/__init__.py
12133432
python-fedex-devs/python-fedex
refs/heads/master
tests/__init__.py
12133432
SoftwareMaven/django
refs/heads/master
django/contrib/admin/templatetags/__init__.py
12133432
timotheosh/python_koans
refs/heads/master
python2/runner/sensei.py
51
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import sys import os import glob import helper from mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResult): ...
rdeheele/odoo
refs/heads/master
addons/l10n_no/__init__.py
55
# -*- encoding: utf-8 -*- ############################################################################## # # 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 ...
scrollback/kuma
refs/heads/master
vendor/packages/pylint/test/input/func_dict_keys.py
6
"""Check multiple key definition""" #pylint: disable-msg=C0103 __revision__ = 5 correct_dict = { 'tea': 'for two', 'two': 'for tea', } wrong_dict = { 'tea': 'for two', 'two': 'for tea', 'tea': 'time', }
dongguangming/python-phonenumbers
refs/heads/dev
python/phonenumbers/data/region_AO.py
11
"""Auto-generated file, do not edit by hand. AO metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_AO = PhoneMetadata(id='AO', country_code=244, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[29]\\d{8}', possible_number_pattern='\\...
AshyIsMe/PyTrade
refs/heads/master
pytrade/calculateIndicators.py
1
#!/usr/bin/python from pandas import * import sys import os import re if len(sys.argv) != 2: print 'Usage: calculateIndicators.py NCM.AX.csv' #exit(1) #AA find all files in current directory matching XXX.AX.csv files = os.walk(os.path.join(os.getcwd(), 'data')).next()[2] asxfilepattern = re.compile("\D\D\D\....
js0701/chromium-crosswalk
refs/heads/master
third_party/WebKit/Source/build/scripts/rjsmin.py
100
#!/usr/bin/env python # # Copyright 2011 - 2013 # Andr\xe9 Malo or his licensors, as applicable # # 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-...
TimBuckley/effective_django
refs/heads/master
django/contrib/gis/gdal/tests/__init__.py
12133432
tacitia/ThoughtFlow
refs/heads/master
project/project/__init__.py
12133432
pcm17/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/atrous_convolution_test.py
58
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Kernel-Saram/CLUSTER_Kernel_VR
refs/heads/master
Documentation/target/tcm_mod_builder.py
3119
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
vmturbo/nova
refs/heads/master
nova/db/sqlalchemy/api_migrations/migrate_repo/versions/010_placeholder.py
705
# 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 # ...
roadmapper/ansible
refs/heads/devel
test/integration/targets/module_utils/other_mu_dir/a/b/c/d/e/__init__.py
12133432
digifant/eMonitor
refs/heads/master
emonitor/modules/textmod/content_admin.py
1
import os import random import codecs from xhtml2pdf import pisa from StringIO import StringIO from flask import request, render_template, current_app from emonitor.extensions import db from emonitor.modules.settings.settings import Settings from emonitor.modules.textmod.ocr import Ocr from emonitor.modules.textmod.re...
caseymacphee/green_quote
refs/heads/master
greenquote.py
1
import os from flask import Flask from flask import g from flask import jsonify import psycopg2 import json from json import load from flask import render_template app = Flask(__name__) app.config['DATABASE'] = os.environ.get( 'DATABASE_URL', '' ) app.config['SECRET_KEY'] = os.environ.get( 'FLASK_SECRET_KEY', '892...
mzdaniel/oh-mainline
refs/heads/master
vendor/packages/django-celery/djcelery/management/commands/celerymon.py
33
""" Start the celery clock service from the Django management command. """ from __future__ import absolute_import import sys from djcelery.app import app from djcelery.management.base import CeleryCommand try: from celerymon.bin.celerymon import MonitorCommand mon = MonitorCommand(app=app) except ImportErr...
kaichogami/sympy
refs/heads/master
sympy/utilities/tests/test_pytest.py
105
from sympy.utilities.pytest import raises, USE_PYTEST if USE_PYTEST: import py.test pytestmark = py.test.mark.skipif(USE_PYTEST, reason=("using py.test")) # Test callables def test_expected_exception_is_silent_callable(): def f(): raise ValueError() raise...
haocs/autorest
refs/heads/master
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/models/sku.py
8
# 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 ...
andresriancho/kombu
refs/heads/master
examples/simple_task_queue/tasks.py
29
def hello_task(who="world"): print("Hello %s" % (who, ))
yuanyelele/solfege
refs/heads/master
solfege/mpd/const.py
4
# GNU Solfege - free ear training software # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2011 Tom Cato Amundsen # # 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...
ZenDevelopmentSystems/GroundHog
refs/heads/master
groundhog/__init__.py
386048
Priyansh2/test
refs/heads/master
ltrc/extractor/clustering/lyrics_mod.py
1
# -*- coding: utf-8 -*- import sys import os import re import csv import io import codecs reload(sys) sys.setdefaultencoding('utf8') main_path='/home/priyansh/Downloads/ltrc/extractor/clustering/four_class_devanagari/' path1=main_path+"A/" path2=main_path+"C/" path3=main_path+"D/" path4=main_path+"E/" delim = "…","?","...
salaria/odoo
refs/heads/8.0
addons/edi/controllers/main.py
374
import werkzeug.urls import openerp import openerp.addons.web.controllers.main as webmain class EDI(openerp.http.Controller): @openerp.http.route('/edi/import_url', type='http', auth='none') def import_url(self, url): # http://hostname:8069/edi/import_url?url=URIEncodedURL req = openerp.http....
etherkit/OpenBeacon2
refs/heads/master
client/win/venv/Lib/site-packages/PyInstaller/utils/hooks/__init__.py
2
#----------------------------------------------------------------------------- # Copyright (c) 2005-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this s...
colinligertwood/odoo
refs/heads/master
addons/payment_paypal/tests/__init__.py
125
# -*- coding: utf-8 -*- # from . import test_paypal checks = [ # test_paypal, ]
semonte/intellij-community
refs/heads/master
python/testData/refactoring/move/globalStatementWithTwoNames/after/src/a.py
79
import b FOO = 'spam' def func(): global FOO b.VAR += 1
Akrog/cinder
refs/heads/master
cinder/api/contrib/used_limits.py
16
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
tchellomello/home-assistant
refs/heads/dev
homeassistant/components/pi_hole/switch.py
16
"""Support for turning on and off Pi-hole system.""" import logging from hole.exceptions import HoleError import voluptuous as vol from homeassistant.components.switch import SwitchEntity from homeassistant.const import CONF_NAME from homeassistant.helpers import config_validation as cv, entity_platform from . impor...
derricw/pyqtgraph
refs/heads/develop
pyqtgraph/parametertree/ParameterItem.py
43
from ..Qt import QtGui, QtCore from ..python2_3 import asUnicode import os, weakref, re class ParameterItem(QtGui.QTreeWidgetItem): """ Abstract ParameterTree item. Used to represent the state of a Parameter from within a ParameterTree. - Sets first column of item to name - generates context ...
simphony/simphony-aviz
refs/heads/master
setup.py
1
import os from setuptools import setup, find_packages with open('README.rst', 'r') as readme: README_TEXT = readme.read() VERSION = '0.4.0.dev0' def write_version_py(filename=None): if filename is None: filename = os.path.join( os.path.dirname(__file__), 'simphony_aviz', 'version.py') ...
GiovanniConserva/TestDeploy
refs/heads/master
venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py
196
from __future__ import absolute_import import errno import warnings import hmac from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning SSLContext = None HAS_SNI = False create_default_context = None # Maps the leng...
rexzhang/rpress
refs/heads/master
rpress/config/develop.py
1
#!/usr/bin/env python # coding=utf-8 from .base import ConfigBase class Config(ConfigBase): # Deploy DEBUG = True TEMPLATES_AUTO_RELOAD = True ConfigBase.SQLALCHEMY_DATABASE['NAME'] = 'rpress_develop'
teltek/edx-platform
refs/heads/master
openedx/features/course_bookmarks/tests/test_course_bookmarks.py
2
""" Unit tests for the course bookmarks feature. """ import ddt from django.test import RequestFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import CourseUserType, SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/words/test/test_msn.py
8
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.words.protocols.msn}. """ import StringIO from hashlib import md5 from twisted.internet.defer import Deferred from twisted.protocols import loopback from twisted.python.reflect import requireModule from twisted.test....
epinaa/weevely3
refs/heads/master
core/vectorlist.py
14
""" The module `core.vectorlist` defines a `VectorList` object, normally used to store the module vectors. Module class executes `_register_vectors()` at init to initialize the `VectorList` object as `self.vectors` module attribute. The methods exposed by VectorList can be used to get the result of a given vector exe...
trachelr/mne-python
refs/heads/master
mne/io/pick.py
2
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # # License: BSD (3-clause) from copy import deepcopy import re import numpy as np from .constants import FIFF from ..utils import logge...
pcu4dros/pandora-core
refs/heads/master
workspace/lib/python3.5/site-packages/coverage/plugin.py
40
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Plugin interfaces for coverage.py""" from coverage import files from coverage.misc import contract, _needs_to_implement class CoveragePlugin(object): """B...
hexcap/dpkt
refs/heads/master
dpkt/qq.py
6
# $Id: qq.py 48 2008-05-27 17:31:15Z yardley $ # -*- coding: utf-8 -*- from dpkt import Packet # header_type QQ_HEADER_BASIC_FAMILY = 0x02 QQ_HEADER_P2P_FAMILY = 0x00 QQ_HEADER_03_FAMILY = 0x03 QQ_HEADER_04_FAMILY = 0x04 QQ_HEADER_05_FAMILY = 0x05 header_type_str = [ "QQ_HEADER_P2P_FAMILY", "Unknown Type", ...
NYU-NEWS/janus
refs/heads/master
run.py
1
#!/usr/bin/env python2 # python system modules import os import sys import time import shutil import logging import subprocess import multiprocessing import argparse import traceback import itertools import random import math import signal from threading import Thread from argparse import ArgumentParser from multiproc...
JorgeCoock/django
refs/heads/master
tests/migration_test_data_persistence/tests.py
368
from django.test import TestCase, TransactionTestCase from .models import Book class MigrationDataPersistenceTestCase(TransactionTestCase): """ Tests that data loaded in migrations is available if we set serialized_rollback = True on TransactionTestCase """ available_apps = ["migration_test_data...