repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
meabsence/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/distutils/tests/test_bdist_wininst.py
53
"""Tests for distutils.command.bdist_wininst.""" import unittest from test.support import run_unittest from distutils.command.bdist_wininst import bdist_wininst from distutils.tests import support class BuildWinInstTestCase(support.TempdirManager, support.LoggingSilencer, ...
roxyboy/bokeh
refs/heads/master
bokeh/charts/builder/line_builder.py
43
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Line class which lets you build your Line charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------------------...
teto/i3pystatus
refs/heads/master
i3pystatus/calendar/__init__.py
2
import inspect import re import threading from abc import abstractmethod from datetime import datetime, timedelta from i3pystatus import IntervalModule, formatp, SettingsBase from i3pystatus.core.color import ColorRangeModule from i3pystatus.core.desktop import DesktopNotification humanize_imported = False try: i...
amigcamel/taipei.py
refs/heads/master
templates/pages/gallery.html.py
1
BBBBBBB BBBBBBBBBBBBBBBBB BBBB BBBBBBBBBBBBBB BBBBBBBBBBB BBBBB BBBBBBBBBBBB BBBBBBBB BBBBB BBBB BBBBBBBB BBBBBBBBBBBBBBBBBBBB FFFFFFFFFFFFFFFFFFFF BBBBBBBBBBB XXXX XXXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXX BBBB BBBBBBBBBBBBBBBBBBBBBBB BB...
nvlsianpu/mbed
refs/heads/master
tools/get_config.py
23
#! /usr/bin/env python2 """ mbed SDK Copyright (c) 2011-2013 ARM Limited 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 applicabl...
yeukhon/homework
refs/heads/master
computer-security/elgamal-attack/getstuff.py
1
#!/usr/bin/python import numbthy def primes(n): # http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188 """ Returns a list of primes < n """ sieve = [True] * n for i in xrange(3,int(n**0.5)+1,2): if sieve[i]: sieve[i*i::2*i]=[Fa...
chronicle/api-samples-python
refs/heads/master
detect/v2/run_retrohunt_and_wait.py
1
#!/usr/bin/env python3 # Copyright 2021 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...
googleapis/googleapis-gen
refs/heads/master
google/cloud/bigquery/logging/v1/google-cloud-bigquery-logging-v1-py/tests/unit/gapic/__init__.py
951
# -*- coding: utf-8 -*- # Copyright 2020 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 o...
raycarnes/addons-yelizariev
refs/heads/8.0
delivery_special/models.py
16
from openerp.osv import osv, fields class delivery_grid(osv.osv): _inherit = "delivery.grid" def get_price(self, cr, uid, id, order, dt, context=None): total = 0 weight = 0 volume = 0 quantity = 0 special_delivery = 0 product_uom_obj = self.pool.get('product.uom...
rven/odoo
refs/heads/14.0-fix-partner-merge-mail-activity
addons/lunch/models/lunch_order.py
2
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.exceptions import ValidationError class LunchOrder(models.Model): _name = 'lunch.order' _description = 'Lunch Order' _order = 'id desc' _display_name = ...
adamnovak/client
refs/heads/develop
shell/bii.py
5
import sys import os import shlex import traceback from biicode.client.command.executor import ToolExecutor from biicode.client.command.tool_catalog import ToolCatalog from biicode.common.exception import BiiException from biicode.client.shell.userio import UserIO from biicode.common.utils.bii_logging import logger fro...
palaniyappanBala/rekall
refs/heads/master
rekall-core/rekall/plugins/windows/registry/registry.py
4
# Rekall Memory Forensics # Copyright (c) 2012 Michael Cohen <scudette@gmail.com> # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # Copyright 2013 Google Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publi...
ofayans/freeipa
refs/heads/master
ipaserver/plugins/certprofile.py
1
# # Copyright (C) 2015 FreeIPA Contributors see COPYING for license # import re from ipalib import api, Bool, Str from ipalib.plugable import Registry from .baseldap import ( LDAPObject, LDAPSearch, LDAPCreate, LDAPDelete, LDAPUpdate, LDAPRetrieve) from ipalib.request import context from ipalib import ngette...
akidhruv/Computational_Cauldron
refs/heads/master
FORTRAN/INS_PyF/plot.py
1
import matplotlib.pyplot as plt import numpy as np M=20+1 N=20+1 k = 2 d = 2 X=np.zeros((N*d,M*k),dtype=float) Y=np.zeros((N*d,M*k),dtype=float) U=np.zeros((N*d,M*k),dtype=float) V=np.zeros((N*d,M*k),dtype=float) P=np.zeros((N*d,M*k),dtype=float) T=np.zeros((N*d,M*k),dtype=float) for i in range(k*d): data=np.load...
jerome-nexedi/dream
refs/heads/master
dream/simulation/RoutingQueue.py
4
# =========================================================================== # Copyright 2013 University of Limerick # # This file is part of DREAM. # # DREAM is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Founda...
silly-wacky-3-town-toon/SOURCE-COD
refs/heads/master
toontown/racing/KartShopGlobals.py
6
from direct.showbase import PythonUtil class KartShopGlobals: EVENTDICT = {'guiDone': 'guiDone', 'returnKart': 'returnKart', 'buyKart': 'buyAKart', 'buyAccessory': 'buyAccessory'} KARTCLERK_TIMER = 180 MAX_KART_ACC = 16 class KartGlobals: ENTER_MOVIE = 1 EXIT_MOVIE = 2 COUNTDOW...
pballand/congress
refs/heads/master
thirdparty/antlr3-antlr-3.5/runtime/Python3/unittests/teststreams.py
5
from io import StringIO import os import unittest import antlr3 class TestStringStream(unittest.TestCase): """Test case for the StringStream class.""" def testSize(self): """StringStream.size()""" stream = antlr3.StringStream('foo') self.assertEqual(stream.size(), 3) def test...
google-code/android-scripting
refs/heads/master
python/src/Lib/filecmp.py
61
"""Utilities for comparing files and directories. Classes: dircmp Functions: cmp(f1, f2, shallow=1) -> int cmpfiles(a, b, common) -> ([], [], []) """ import os import stat from itertools import ifilter, ifilterfalse, imap, izip __all__ = ["cmp","dircmp","cmpfiles"] _cache = {} BUFSIZE=8*1024 def cmp(...
hill-a/stable-baselines
refs/heads/master
stable_baselines/sac/sac.py
1
import time import warnings import numpy as np import tensorflow as tf from stable_baselines.common import tf_util, OffPolicyRLModel, SetVerbosity, TensorboardWriter from stable_baselines.common.vec_env import VecEnv from stable_baselines.common.math_util import safe_mean, unscale_action, scale_action from stable_bas...
g19-hs/personfinder
refs/heads/master
app/pytz/zoneinfo/Europe/Andorra.py
9
'''tzinfo timezone information for Europe/Andorra.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Andorra(DstTzInfo): '''Europe/Andorra timezone definition. See datetime.tzinfo for details''' zone = 'Europe/Andorra' ...
dlorenc/runtimes-common
refs/heads/master
ftl/common/ftl_error.py
3
# Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
plotly/plotly.py
refs/heads/master
packages/python/plotly/plotly/graph_objs/scattergeo/unselected/_textfont.py
2
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scattergeo.unselected" _path_str = "scattergeo.unselected.textfont" _valid_props = {"color...
rajadhva/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/html5parser.py
423
from __future__ import absolute_import, division, unicode_literals from six import with_metaclass import types from . import inputstream from . import tokenizer from . import treebuilders from .treebuilders._base import Marker from . import utils from . import constants from .constants import spaceCharacters, ascii...
detiber/ansible
refs/heads/devel
lib/ansible/modules/network/panos/panos_commit.py
78
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
lyft/heroku-buildpack-python-data
refs/heads/master
vendor/pip-1.3.1/pip/basecommand.py
63
"""Base Command class, and related routines""" import os import socket import sys import tempfile import traceback import time import optparse from pip.log import logger from pip.download import urlopen from pip.exceptions import (BadCommand, InstallationError, UninstallationError, Command...
hayd/contracts
refs/heads/master
src/contracts/testing/library/separate_context_tc.py
4
from . import good, fail # dictionary of string -> tuple, with tuple of two elements with different type # In this case, each value should have the same two types good('dict(str:tuple(type(x),type(y))),x!=y', {'a': (2, 1.1)}) fail('dict(str:tuple(type(x),type(y))),x!=y', {'a': (2, 1)}) # This fails because we have x...
modulus-sa/pybbix
refs/heads/master
pybbix/api/__init__.py
1
"""Abstract API classes.""" import json JSON_RPC_VERSION = '2.0' class AbstractAPI: """Abstract interface of all children APIs. This is repsonsible for setting the right attributes that ``Request`` uses to build the request dict.""" def __init__(self): with open('params.json') as f: ...
mastizada/kuma
refs/heads/master
vendor/lib/python/debug_toolbar/panels/templates/panel.py
9
from __future__ import absolute_import, unicode_literals try: from collections import OrderedDict except ImportError: from django.utils.datastructures import SortedDict as OrderedDict from os.path import normpath from pprint import pformat import django from django import http from django.conf import settings...
jaymiejones86/jaymiejones.com
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatters/other.py
363
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments...
NicolasDichtel/linux
refs/heads/master
tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py
91
''' run the command under test, under valgrind and collect memory leak info as a separate test. ''' import os import re import signal from string import Template import subprocess import time from TdcPlugin import TdcPlugin from tdc_config import * def vp_extract_num_from_string(num_as_string_maybe_with_commas): ...
DavidMikeSimon/ansible
refs/heads/devel
lib/ansible/plugins/vars/__init__.py
7690
# (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...
ernstbaslerpartner/send2geoadmin
refs/heads/master
env/Lib/site-packages/pip-1.2.1-py2.7.egg/pip/commands/help.py
80
from pip.basecommand import (Command, command_dict, load_all_commands, SUCCESS, ERROR) from pip.exceptions import CommandError from pip.baseparser import parser class HelpCommand(Command): name = 'help' usage = '%prog' summary = 'Show available com...
jspraul/bite-project
refs/heads/master
deps/gdata-python-client/src/gdata/apps/groups/data.py
102
#!/usr/bin/python2.4 # # Copyright 2011 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 ...
klkuhlm/mpmath
refs/heads/master
mpmath/tests/test_compatibility.py
15
from mpmath import * from random import seed, randint, random import math # Test compatibility with Python floats, which are # IEEE doubles (53-bit) N = 5000 seed(1) # Choosing exponents between roughly -140, 140 ensures that # the Python floats don't overflow or underflow xs = [(random()-1) * 10**randint(-140, 140)...
saumishr/django
refs/heads/master
tests/regressiontests/urlpatterns_reverse/no_urls.py
155
#from django.conf.urls import patterns, url, include
nin042/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/cmake_unittest.py
121
# Copyright (C) 2012 Intel Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
yannrouillard/weboob
refs/heads/master
weboob/capabilities/torrent.py
5
# -*- coding: utf-8 -*- # Copyright(C) 2010-2012 Romain Bignon, Laurent Bachelier # # This file is part of weboob. # # weboob 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 Software Foundation, either version 3 of the Lic...
anthonynguyen/UrTSB
refs/heads/master
urtsb_src/ui/recenttab.py
3
# # Copyright (C) 2010 Sorcerer # # This file is part of UrTSB. # # UrTSB 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. # # UrTSB is...
Tomcuzz/OctaHomeAutomation
refs/heads/master
OctaHomeCore/management/commands/SetupWeather.py
1
from django.core.management.base import BaseCommand, CommandError from OctaHomeCore.models.weather import * from django.conf import settings class Command(BaseCommand): help = "Set Up Database Weather Locations" def handle(self, *args, **options): if settings.MET_OFFICE_API_KEY != "": print "Updating Weather L...
dennisguse/pjsip
refs/heads/master
tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py
42
# $Id$ import inc_sip as sip import inc_sdp as sdp sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=pjmedia c=IN IP7 127.0.0.1 t=0 0 m=audio 4000 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=sendrecv a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 """ pjsua_args = "--null-audio --auto-answer 200" extra_headers = "" include = [ "...
wunderlins/learning
refs/heads/master
python/zodb/lib/osx/ZODB/tests/speed.py
2
from __future__ import print_function ############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL sh...
jewettaij/moltemplate
refs/heads/master
examples/coarse_grained/DNA_models/dsDNA_only/2strands/3bp_2particles/simple_dna_example/measure_persistence_length/merge_lines_periodic.py
4
#!/usr/bin/env python import sys, math g_filename = __file__.split('/')[-1] g_module_name = g_filename g_program_name = g_filename if g_filename.rfind('.py') != -1: g_module_name = g_filename[:g_filename.rfind('.py')] g_date_str = '2020-1-19' g_version_str = '0.3.0' usage_example = g_program_name + """...
zhangda89/python-oauth2
refs/heads/master
oauth2/__init__.py
458
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
Automatiqa/data-entry-clerk
refs/heads/master
dec/config/__init__.py
1
""" Configuration package. The Data Entry Clerk's behavior can be customized through the configuration. For each environment, a separate configuration file can be created to overwrite settings just for that environment. This makes it easy to test changes before deploying them to production. """
alexandermerritt/tools
refs/heads/master
src/memory/likwid-tlb.py
1
#! /usr/bin/env python import os import sys import subprocess as sp if len(sys.argv) < 1: print("Error: specify command to monitor") sys.exit(1) # westmere #counters = 'DTLB_MISSES_WALK_CYCLES:PMC0' + \ # ',ITLB_MISSES_WALK_CYCLES:PMC1' + \ # ',UNCORE_CLOCKTICKS:UPMCFIX' # ivb-e counter...
Perferom/android_external_chromium_org
refs/heads/android-4.4
third_party/protobuf/python/google/protobuf/service.py
590
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
uzh/msregistry
refs/heads/master
app/api_1_0/admin.py
1
# Copyright (C) 2018 University of Zurich. All rights reserved. # """ Implementation of the 'admin' API for the MS-Registry backend. The 'admin' API allows limited modification of entities in the database. """ # # This file is part of MSRegistry Backend. # # MSRegistry Backend is free software: you can redistribute i...
jorsea/odoomrp-wip
refs/heads/8.0
delivery_multi_expense/models/delivery_carrier.py
25
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields class DeliveryCarrier(...
minhphung171093/GreenERP_V9
refs/heads/master
openerp/addons/event/report/__init__.py
69
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import report_event_registration
jonashaag/jedi
refs/heads/master
jedi/debug.py
34
from jedi._compatibility import encoding, is_py3, u import inspect import os import time try: if os.name == 'nt': # does not work on Windows, as pyreadline and colorama interfere raise ImportError else: # Use colorama for nicer console output. from colorama import Fore, init ...
nttks/jenkins-test
refs/heads/gacco/birch
cms/djangoapps/contentstore/features/component.py
1
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # Lettuce formats proposed definitions for unimplemented steps with the # argument name "step" instead of "_step" and pylint does not like that. # pylint: disable=unused-argument from lettuce import world, step from nose.tools import assert_tr...
britram/qof
refs/heads/master
pytools/qof_obsloss.py
1
import argparse import bz2 from sys import stdin, stdout, stderr import ipfix import qof import pandas as pd import numpy as np args = None def parse_args(): global args parser = argparse.ArgumentParser(description="Report on observation loss in a QoF-produced IPFIX file") parser.add_argument('--spec', '...
jlegendary/youtube-dl
refs/heads/master
youtube_dl/extractor/playvid.py
115
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urllib_parse_unquote_plus, ) from ..utils import ( clean_html, ExtractorError, ) class PlayvidIE(InfoExtractor): _VALID_URL = r'https?://www\.playvid\.co...
zyantific/remodel
refs/heads/master
testing/gtest-1.7.0/test/gtest_test_utils.py
1100
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
SakuradaJun/django-allauth
refs/heads/master
allauth/socialaccount/providers/foursquare/views.py
71
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import FoursquareProvider class FoursquareOAuth2Adapter(OAu...
mjudsp/Tsallis
refs/heads/master
sklearn/linear_model/tests/test_huber.py
25
# Authors: Manoj Kumar mks542@nyu.edu # License: BSD 3 clause import numpy as np from scipy import optimize, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_a...
lean-poker/poker-player-python
refs/heads/master
player.py
3
class Player: VERSION = "Default Python folding player" def betRequest(self, game_state): return 0 def showdown(self, game_state): pass
muntasirsyed/intellij-community
refs/heads/master
python/testData/resolve/ListAssignment.py
83
[foo, bar] = (1, 2) print(foo) # <ref>
abartlet/samba-old
refs/heads/master
buildtools/wafsamba/samba_third_party.py
26
# functions to support third party libraries from Configure import conf import sys, Logs, os from samba_bundled import * @conf def CHECK_FOR_THIRD_PARTY(conf): return os.path.exists(os.path.join(Utils.g_module.srcdir, 'third_party')) Build.BuildContext.CHECK_FOR_THIRD_PARTY = CHECK_FOR_THIRD_PARTY @conf def CHE...
KIT-XXI/babel
refs/heads/master
tests/messages/test_mofile.py
41
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists...
Brunni/conan-g3log
refs/heads/master
test_package/conanfile.py
1
from conans import ConanFile, CMake import os channel = os.getenv("CONAN_CHANNEL", "testing") username = os.getenv("CONAN_USERNAME", "Brunni") class G3logTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" requires = "g3log/master@%s/%s" % (username, channel) generators = "cmake" def configur...
nikste/tensorflow
refs/heads/master
tensorflow/contrib/rnn/python/kernel_tests/fused_rnn_cell_test.py
18
# 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...
bmazin/SDR
refs/heads/master
Projects/Dither/shard_many_telnet.py
1
#!/bin/python import subprocess import time def move(ra,dec): commandTemplate ='TELMOVE INSTRUMENT %.2f %.2f SEC_ARC NOWAIT' command = commandTemplate%(ra,dec) bashTemplate = '(sleep 1; echo \"%s\") | telnet shard.ucolick.org 2345'# 2> /dev/null > /dev/null' bashCommand = bashTemplate%command ti...
shenmidelin/pylibwyl
refs/heads/master
wanntb/tran.py
1
#!/usr/bin/env python import numpy as np def tran_op(op, tmat): """ transform quantum operator from representation A to another representation B Args: op: the matrix form of operator in representation A tmat: the unitary transform matrix """ return np.dot(np.dot(np.co...
soxfmr/Mint-X-icons-Convert
refs/heads/master
utils.py
1
#!/usr/bin/python2 def composepath(*dirs): return "/".join(dirs)
senadmd/coinmarketwatch
refs/heads/master
test/functional/proxy_test.py
19
#!/usr/bin/env python3 # Copyright (c) 2015-2016 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 bitcoind with different proxy configuration. Test plan: - Start bitcoind's with different proxy c...
SELO77/seloPython
refs/heads/master
MMTseminar/threading0.py
1
import threading import time import random def worker(number): sleep = random.randrange(1, 10) time.sleep(sleep) print("I am Worker {}, I slept for {} seconds".format(number, sleep)) for i in range(5): t = threading.Thread(target=worker, args=(i,)) t.start() print("All Threads are queued, let's...
daajoe/trellis
refs/heads/master
smac/genericWrapper.py
1
#!/usr/bin/env python2.7 # encoding: utf-8 ''' generaicWrapper -- template for an AClib target algorithm wrapper abstract methods for generation of callstring and parsing of solver output @author: Marius Lindauer, Chris Fawcett, Alex Fréchette, Frank Hutter @copyright: 2014 AClib. All rights reserved....
Edraak/edraak-platform
refs/heads/master
common/djangoapps/util/migrations/0002_data__default_rate_limit_config.py
24
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models # Converted from the original South migration 0002_default_rate_limit_config.py def forwards(apps, schema_editor): """Ensure that rate limiting is enabled by default. """ RateLimitConfiguration = apps....
Nitaco/ansible
refs/heads/devel
test/runner/lib/sanity/shellcheck.py
28
"""Sanity test using shellcheck.""" from __future__ import absolute_import, print_function import os from xml.etree.ElementTree import ( fromstring, Element, ) from lib.sanity import ( SanitySingleVersion, SanityMessage, SanityFailure, SanitySuccess, SanitySkipped, ) from lib.util import...
40223102/w17b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testhelpers.py
737
import unittest from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock ) from datetime import datetime class SomeClass(object): def one(self, a, b): pass def two(self): pass def three(self, a=None): pass class AnyT...
andrewebdev/django-ostinato
refs/heads/master
demo/blog/models.py
1
from django.db import models from ostinato.blog.models import BlogEntryBase from ostinato.pages.registry import page_content from taggit.managers import TaggableManager from website.models import SEOPage class Entry(BlogEntryBase): tags = TaggableManager() class Meta: verbose_name_plural = "Entries"...
sdh11/gnuradio
refs/heads/master
gr-analog/python/analog/qa_pll_freqdet.py
7
#!/usr/bin/env python # # Copyright 2004,2007,2010-2013 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 ...
gangadhar-kadam/sms-erpnext
refs/heads/master
buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py
483
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # 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 yo...
ActiveState/code
refs/heads/master
recipes/Python/474127_Simulating_concurrency/recipe-474127.py
1
import types class method_pseudo_threads(object): """ Implements pseudo threads for class methods. """ _result = None def __init__(self, caller, instance, *args, **kw): self.caller = caller self.this_function = self.func(instance, *args, **kw) def next(self): return self.t...
karwa/swift
refs/heads/master
test/Driver/Inputs/crash-after-generating-pch.py
28
#!/usr/bin/env python # crash.py - Sends SIGKILL to self. -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for ...
IOArmory/quarterbackpython
refs/heads/master
lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2942
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versio...
lukeiwanski/tensorflow
refs/heads/master
tensorflow/python/platform/app_test.py
201
# 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...
sujeet4github/MyLangUtils
refs/heads/master
LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/_trie/_base.py
354
from __future__ import absolute_import, division, unicode_literals from collections import Mapping class Trie(Mapping): """Abstract base class for tries""" def keys(self, prefix=None): # pylint:disable=arguments-differ keys = super(Trie, self).keys() if prefix is None: r...
sinperwolf/shadowsocks
refs/heads/master
shadowsocks/udprelay.py
924
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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...
joshloyal/scikit-learn
refs/heads/master
benchmarks/bench_rcv1_logreg_convergence.py
58
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import matplotlib.pyplot as plt import numpy as np import gc import time from sklearn.externals.joblib import Memory from sklearn.linear_model import (LogisticRegression, SGDClassifi...
lygaret/django-testshell
refs/heads/master
testshell/models.py
1
# In order to register the application, we need a model.py, # even if it's empty. Nothing to see here.
vveerava/Openstack
refs/heads/master
neutron/tests/functional/db/test_migrations.py
2
# Copyright 2014 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 ...
thesoftwarejedi/bitcoin
refs/heads/master
qa/rpc-tests/blockstore.py
98
# BlockStore: a helper class that keeps a map of blocks and implements # helper functions for responding to getheaders and getdata, # and for constructing a getheaders message # from mininode import * import dbm class BlockStore(object): def __init__(self, datadir): self.blockDB = ...
jiadaizhao/LeetCode
refs/heads/master
1101-1200/1171-Remove Zero Sum Consecutive Nodes from Linked List/1171-Remove Zero Sum Consecutive Nodes from Linked List.py
1
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def removeZeroSumSublists(self, head: ListNode) -> ListNode: dummy = ListNode(0) curr = dummy dummy.next = head s = 0 table = {} ...
vincepandolfo/django
refs/heads/master
tests/admin_custom_urls/urls.py
405
from django.conf.urls import url from .models import site urlpatterns = [ url(r'^admin/', site.urls), ]
fangxingli/hue
refs/heads/master
desktop/core/ext-py/simplejson/simplejson/tests/test_default.py
261
from unittest import TestCase import simplejson as json class TestDefault(TestCase): def test_default(self): self.assertEquals( json.dumps(type, default=repr), json.dumps(repr(type)))
lmurta/analogRead
refs/heads/master
get-pip.py
19
null
Mj258/weiboapi
refs/heads/master
srapyDemo/envs/Lib/site-packages/pyasn1_modules/rfc3447.py
127
# # PKCS#1 syntax # # ASN.1 source from: # ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.asn # # Sample captures could be obtained with "openssl genrsa" command # from pyasn1_modules.rfc2437 import * class OtherPrimeInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('prim...
gchp/django
refs/heads/master
tests/queryset_pickle/tests.py
51
from __future__ import unicode_literals import datetime import pickle import unittest from django.db import models from django.test import TestCase from django.utils import six from django.utils.version import get_version from .models import Container, Event, Group, Happening, M2MModel class PickleabilityTestCase(...
jbalogh/zamboni
refs/heads/master
apps/browse/tests.py
1
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from dateutil.parser import parse as parse_dt import re from urlparse import urlparse from django import http from django.conf import settings from django.core.cache import cache from django.utils import http as urllib from jingo.helpers import datetime...
daimajia/duktape
refs/heads/master
util/autofix_debuglog_calls.py
15
#!/usr/bin/python # # Automatically fix one-line broken debug log calls. Adds a missing # wrapper for such lines, e.g. changes: # # DUK_DPRINT(...); # # into: # # DUK_D(DUK_DPRINT(...)); # # Does not handle multiline log calls. # # Usage: # # $ python autofix_debuglog_calls.py src/*.c # # WARNING: works...
shakamunyi/sahara
refs/heads/master
sahara/api/middleware/log_exchange.py
5
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
lukauskas/means
refs/heads/master
src/means/util/decorators.py
2
from functools import wraps def cache(func): cache = {} @wraps(func) def wrap(*args): if args not in cache: cache[args] = func(*args) return cache[args] return wrap
zzxuanyuan/root-compressor-dummy
refs/heads/compressionbench
interpreter/llvm/src/utils/llvm-build/llvmbuild/main.py
50
from __future__ import absolute_import import filecmp import os import sys import llvmbuild.componentinfo as componentinfo import llvmbuild.configutil as configutil from llvmbuild.util import fatal, note ### def cmake_quote_string(value): """ cmake_quote_string(value) -> str Return a quoted form of the...
kaltsimon/youtube-dl
refs/heads/master
youtube_dl/extractor/malemotion.py
108
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class MalemotionIE(InfoExtractor): _VALID_URL = r'https?://malemotion\.com/video/(.+?)\.(?P<id>.+?)(#|$)' _TEST = { 'url': 'http://malemotion.com/video/bete-de-co...
hongbin/magnum
refs/heads/master
magnum/common/safe_utils.py
16
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
mheap/ansible
refs/heads/devel
lib/ansible/plugins/action/ce_config.py
29
# # Copyright 2015 Peter Sprygada <psprygada@ansible.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) any...
GoogleCloudPlatform/cloud-opensource-python
refs/heads/master
compatibility_lib/compatibility_lib/test_fake_compatibility_store.py
1
# Copyright 2018 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...
jandd/python-pkiutils
refs/heads/master
setup.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Setup for pkiutils. """ __author__ = 'Jan Dittberner' from setuptools import setup, find_packages with open('README.rst', 'r') as readme: DESCRIPTION = readme.read() DESCRIPTION += "\n" with open('LICENSE', 'r') as license: DESCRIPTION += license.read() ...