commit
stringlengths
40
40
subject
stringlengths
1
3.25k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
old_contents
stringlengths
0
26.3k
lang
stringclasses
3 values
proba
float64
0
1
diff
stringlengths
0
7.82k
8006d142a00a6dae70850b3c9d816f745f252260
create settings file with parent_separator setting
cms/settings.py
cms/settings.py
Python
0
@@ -0,0 +1,105 @@ +from django.conf import settings%0A%0A%0APARENT_SEPARATOR = getattr(settings, 'MINICMS_PARENT_SEPARATOR', '/')%0A
7c8d43b16d6b47555caeb00234590bc8d335ed71
test markup
tests/test_markup.py
tests/test_markup.py
Python
0.000001
@@ -0,0 +1,843 @@ +import pytest%0A%0Afrom rich.markup import MarkupError, _parse, render%0Afrom rich.text import Span%0A%0A%0Adef test_parse():%0A result = list(_parse(%22%5Bfoo%5Dhello%5B/foo%5D%5Bbar%5Dworld%5B/%5D%5B%5Bescaped%5D%5D%22))%0A expected = %5B%0A (None, %22%5Bfoo%5D%22),%0A (%22hello...
93b2972c41855511cddf57029ab8fce0dccd9265
add hashtable using open addressing
ds/hash.py
ds/hash.py
Python
0.000001
@@ -0,0 +1,1670 @@ +'''HashTable using open addressing'''%0A%0A%0Aclass HashTable(object):%0A def __init__(self):%0A self.size = 11%0A self.keys = %5BNone%5D * self.size%0A self.data = %5BNone%5D * self.size%0A%0A def hash(self, key):%0A return key %25 self.size%0A%0A def rehash(sel...
256e1bb8dd543051fe51b3b669ab4a10c0556f40
add back pytext
tests/test_pytext.py
tests/test_pytext.py
Python
0.000001
@@ -0,0 +1,468 @@ +import unittest%0A%0Afrom pytext.config.field_config import FeatureConfig%0Afrom pytext.data.featurizer import InputRecord, SimpleFeaturizer%0A%0Aclass TestPyText(unittest.TestCase):%0A%0A def test_tokenize(self):%0A featurizer = SimpleFeaturizer.from_config(%0A SimpleFeaturizer....
ea0b0e3b3ca2b3ad51ae9640f7f58d9f2737f64c
Split out runner
dox/runner.py
dox/runner.py
Python
0.015951
@@ -0,0 +1,913 @@ +# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE...
af75f727e5ec22020c8d91af6a0302ea0e4bda74
Support for http://docs.oasis-open.org/security/saml/Post2.0/sstc-request-initiation-cd-01.html in the metadata.
src/saml2/extension/reqinit.py
src/saml2/extension/reqinit.py
Python
0
@@ -0,0 +1,960 @@ +#!/usr/bin/env python%0A%0A#%0A# Generated Thu May 15 13:58:36 2014 by parse_xsd.py version 0.5.%0A#%0A%0Aimport saml2%0A%0Afrom saml2 import md%0A%0ANAMESPACE = 'urn:oasis:names:tc:SAML:profiles:SSO:request-init'%0A%0A%0Aclass RequestInitiator(md.EndpointType_):%0A %22%22%22The urn:oasis:names:tc...
cfa5b544c3d44a7440feca006c01bbd72ecc0286
Test arena constants
test/test_arena.py
test/test_arena.py
Python
0.000001
@@ -0,0 +1,451 @@ +from support import lib,ffi%0Afrom qcgc_test import QCGCTest%0A%0Aclass ArenaTestCase(QCGCTest):%0A def test_size_calculations(self):%0A exp = lib.QCGC_ARENA_SIZE_EXP%0A size = 2**exp%0A bitmap = size / 128%0A effective_cells = (size - 2 * bitmap) / 16%0A self.as...
12270bc14b44343b4babef3b6445074685b59bd7
Create histogram.py
python/histogram.py
python/histogram.py
Python
0.00286
@@ -0,0 +1,623 @@ +import sys%0A%0Ahistogram = dict()%0A%0Abin_width = 5%0Amax_index = 0%0A%0Afor line in sys.stdin:%0A if not line:%0A continue%0A%0A number = int(line)%0A bin_index = number / bin_width%0A if bin_index not in histogram:%0A histogram%5Bbin_index%5D = 0%0A histogram%5Bbin_in...
8b6b30997816bae1255c3e035851b8e6edb5e4c7
add a test
python/test/test.py
python/test/test.py
Python
0.000002
@@ -0,0 +1,897 @@ +import unittest%0Aimport os%0A%0Aimport couchapp.utils%0A%0Aclass CouchAppTest(unittest.TestCase):%0A%0A def testInCouchApp(self):%0A dir_, file_ = os.path.split(__file__)%0A if dir_:%0A os.chdir(dir_)%0A%0A startdir = os.getcwd()%0A try:%0A os.chd...
952438d97fc0c96afaf505469cc7b9cb0c9f287d
Add config file with the list of relays availables
relay_api/conf/config.py
relay_api/conf/config.py
Python
0
@@ -0,0 +1,191 @@ +# List of available relays%0Arelays = %5B%0A %7B%0A %22id%22: 1,%0A %22gpio%22: 20,%0A %22name%22: %22relay 1%22%0A %7D,%0A %7B%0A %22id%22: 2,%0A %22gpio%22: 21,%0A %22name%22: %22relay 2%22%0A %7D%0A%5D%0A
b5083af1cce5fb5b9c7bb764b18edce8640bd3a1
add utilLogger.py from toLearn/ and update to v0.4
utilLogger.py
utilLogger.py
Python
0
@@ -0,0 +1,1194 @@ +import os.path%0Aimport datetime%0A%0A'''%0Av0.4 2015/11/30%0A%09- comment out test run%0A%09- add from sentence to import CUtilLogger%0Av0.3 2015/11/30%0A%09- change array declaration to those using range()%0A%09- __init__() does not take saveto arg %0A%09- automatically get file name based on th...
99f5d264ab88573e0541c529eca905b8a1d16873
Bump to 0.5.3 dev.
rbtools/__init__.py
rbtools/__init__.py
# # __init__.py -- Basic version and package information # # Copyright (c) 2007-2009 Christian Hammond # Copyright (c) 2007-2009 David Trowbridge # # 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 So...
Python
0
@@ -1357,26 +1357,27 @@ 5, -2, 'final +3, 'alpha ', 0, -Tru +Fals e)%0A%0A
698d9868ccab154f5f945710a237d8aeca2090aa
Add some more tests
tests/main_test.py
tests/main_test.py
#!/usr/bin/env python3 """Test suite for stats.py Runs: doctests from the stats module tests from the examples text file (if any) unit tests in this module a limited test for uncollectable objects """ import doctest import gc import itertools import os import random import sys import unittest # Mod...
Python
0
@@ -609,69 +609,80 @@ -def testState(self):%0A %22%22%22Test the state of globals.%22%22%22 +%22%22%22Test the state and/or existence of globals.%22%22%22%0A def testSum(self): %0A @@ -3415,16 +3415,360 @@ cted)%0A%0A%0A +class SortedDataDecoratorTest(unittest.TestCase):%0A %22%22%22Test that th...
90948c62d1d01800c6a75dd5f15d7fef334dc66f
Add python unittests
noticeboard/test_noticeboard.py
noticeboard/test_noticeboard.py
Python
0.000003
@@ -0,0 +1,1846 @@ +import os%0Aimport json%0Aimport tempfile%0Aimport unittest%0A%0Afrom noticeboard import noticeboard%0A%0A%0Aclass TestNoticeboard(unittest.TestCase):%0A def setUp(self):%0A self.fd, noticeboard.app.config%5B%22DATABASE%22%5D = tempfile.mkstemp()%0A noticeboard.app.config%5B%22TESTI...
17fcdd9a01be24ad9562e5a558e2dd65a84d1a19
Add missing tests/queuemock.py
tests/queuemock.py
tests/queuemock.py
Python
0.000003
@@ -0,0 +1,2923 @@ +# -*- coding: utf-8 -*-%0A#%0A# 2019-01-07 Friedrich Weber %3Cfriedrich.weber@netknights.it%3E%0A# Implement queue mock%0A#%0A# License: AGPLv3%0A# contact: http://www.privacyidea.org%0A#%0A# This code is free software; you can redistribute it and/or%0A# modify it under the terms of...
6083124c110e0ce657b78f6178cd7464996a042b
add tests I want to pass
tests/test_geometries.py
tests/test_geometries.py
Python
0
@@ -0,0 +1,1958 @@ +%22%22%22This contains a set of tests for ParaTemp.geometries%22%22%22%0A%0A########################################################################%0A# #%0A# This script was written by Thomas Heavey in 2017. #%0...
8c9034e91d82487ae34c592b369a3283b577acc8
Add a new test for the latest RegexLexer change, multiple new states including '#pop'.
tests/test_regexlexer.py
tests/test_regexlexer.py
Python
0
@@ -0,0 +1,965 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0A Pygments regex lexer tests%0A ~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%0A :copyright: 2007 by Georg Brandl.%0A :license: BSD, see LICENSE for more details.%0A%22%22%22%0A%0Aimport unittest%0A%0Afrom pygments.token import Text%0Afrom pygments.lexer import RegexL...
09598f2635cf946be08ed8529ba6fec1938a5581
test jobq push/startjob flow
tests/test_jobq.py
tests/test_jobq.py
""" Test JobQ """ from hstestcase import HSTestCase class JobqTest(HSTestCase): def test_push(self): jobq = self.project.jobq qjob = jobq.push(self.spidername) self.assertTrue('key' in qjob, qjob) self.assertTrue('auth' in qjob, qjob) job = self.hsclient.get_job(qjob['key...
Python
0
@@ -1700,24 +1700,794 @@ 'running')%0A%0A + def test_startjob(self):%0A jobq = self.project.jobq%0A qj = jobq.push(self.spidername)%0A nj = jobq.start()%0A self.assertTrue(nj.pop('pending_time', None), nj)%0A self.assertEqual(nj, %7B%0A u'auth': qj%5B'auth'%5D,%0A ...
ac9b7e5a50f4748a8a536feb8e0a89edc6342866
fix pep8
libtree/tree.py
libtree/tree.py
from libtree.node import Node def print_tree(per, node=None, intend=0): if node is None: node = get_root_node(per) print('{} - {} {}'.format(' '*intend, node.id, node.type)) for child in list(get_children(per, node)): print_tree(per, child, intend=intend+2) def get_root_node(per): ...
Python
0.000001
@@ -185,16 +185,24 @@ e.type)) + # noqa %0A%0A fo
ba0c292753355e5ff7e8e131c61e8086f31b3b76
Create src/task_2_0.py
src/task_2_0.py
src/task_2_0.py
Python
0.000039
@@ -0,0 +1,394 @@ +# %D0%A0%D0%B0%D0%B7%D0%B4%D0%B5%D0%BB 1. %D0%97%D0%B0%D0%B4%D0%B0%D1%87%D0%B0 2. %D0%92%D0%B0%D1%80%D0%B8%D0%B0%D0%BD%D1%82 0.%0D%0A# %D0%9D%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D1%83, %D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F %D0%B1%D1%83%D0%B4...
6f00204ae2603063eafbd74a369e9da0864854ca
Create new monthly violence polls
poll/management/commands/create_new_violence_polls.py
poll/management/commands/create_new_violence_polls.py
Python
0.000002
@@ -0,0 +1,2371 @@ +#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0Afrom django.core.management.base import BaseCommand%0Aimport traceback%0A%0Afrom poll.models import Poll%0Afrom unregister.models import Blacklist%0Afrom django.conf import settings%0A%0Afrom optparse import make_option%0Afrom poll.forms import NewPollFo...
23c09555221b3f7500a4c658452c9c0cb223799c
Add evaluation using random forest
Train_SDAE/tools/evaluate_model.py
Train_SDAE/tools/evaluate_model.py
Python
0
@@ -0,0 +1,1146 @@ +import numpy as np%0A# import pandas as pd%0A# import sys%0Afrom scipy.special import expit%0Afrom sklearn import ensemble%0A%0Adef get_activations(exp_data, w, b):%0A exp_data = np.transpose(exp_data)%0A prod = exp_data.dot(w)%0A prod_with_bias = prod + b%0A return( expit(prod_with_bias...
009df3372804fa946b7e1bd4c0827e887b964b38
Convert blogger to simple xml
convert.py
convert.py
Python
0.999999
@@ -0,0 +1,1311 @@ +from bs4 import BeautifulSoup%0Aimport io%0Aimport markdown2%0Aimport time%0Aimport codecs%0A%0Afile = io.open(%22Import/blog-03-03-2013.xml%22)%0Afile_contents = file.read(-1)%0A%0A#lxml xpath doesn't seem to understand blogger export%0Asoup = BeautifulSoup(file_contents)%0A%0Aentries = soup(%22ent...
8348ce87a68592e7108c43687ebfdf12684a1914
Add elementTypes.py file
elementTypes.py
elementTypes.py
Python
0.000001
@@ -0,0 +1,1722 @@ +%0Aclass elementC3D10():%0A def __init__(self):%0A self.name = 'C3D10'%0A self.desc = 'Quadratic tetrahedral element'%0A self.numNodes = 10%0A self.numIntPnts = 4%0A self.N = array(self.numNodes)%0A self.setIpcs()%0A def setIpcs(...
e789fb7246e7b926841f2d2912896fd0a0d14518
Create login_portal.py
login_portal.py
login_portal.py
Python
0.000001
@@ -0,0 +1,335 @@ +from splinter import Browser%0A%0A%0Aprint 'Starting...'%0A%0Abrowser = Browser('firefox') # using firefox%0Abrowser.visit(%22http://portal.ku.edu.kw/sisapp/faces/login.jspx%22)%0Abrowser.fill('username','xxxxx') # enter student ID%0Abrowser.fill('password','yyyyy') # enter password%0A%0A...
82acd4827b2f3f426a6b97f474c54886758cfab7
add code to update fields
obztak/scratch/update-fields.py
obztak/scratch/update-fields.py
Python
0.000001
@@ -0,0 +1,1731 @@ +#!/usr/bin/env python%0A%22%22%22%0AUpdate survey fields%0A%22%22%22%0A__author__ = %22Alex Drlica-Wagner%22%0Aimport copy%0A%0Aimport fitsio%0Aimport numpy as np%0Aimport pylab as plt%0A%0Aimport skymap%0A%0Afrom obztak.utils import fileio%0Aimport obztak.delve%0Afrom obztak.delve import DelveField...
7d5dcaa0a72dbdd78e192f082bbdf261de1d8963
Delete occurrences of an element if it occurs more than n times
Codewars/DeleteOccurrencesOfElementOverNTimes.py
Codewars/DeleteOccurrencesOfElementOverNTimes.py
Python
0.000001
@@ -0,0 +1,646 @@ +# implemented with list comprehension with side-effects and a global variable%0A# there's a simpler way to do it with list appends that's probably no less efficient, since Python arrays are dynamic, but I wanted to try this out instead%0A%0Afrom collections import Counter%0A%0Ac = Counter()%0A%0A# fo...
c7c7281fc964ac25aea291f18bbf29013f3f3d58
question 7.1
crack_7_1.py
crack_7_1.py
Python
0.99996
@@ -0,0 +1,469 @@ +def fib_slow(number):%0A%09if number == 0: return 1%0A%09elif number == 1: return 1%0A%09else:%0A%09%09return fib_slow(number-1) + fib_slow(number-2)%0A%0Adef fib_fast(number):%0A%09if numbers%5Bnumber%5D == 0:%0A%09%09if number == 0 or number == 1:%0A%09%09%09numbers%5Bnumber%5D = 1%0A%09%09%09retur...
1c4adbe07892d95ca6254dcc2e48e11eb2141fa7
Create pixelconversor.py
Art-2D/pixelconversor.py
Art-2D/pixelconversor.py
Python
0.000003
@@ -0,0 +1,59 @@ +//This program rake a image an convert it in 2D pixel art.%0A
096c8165ec2beacbc4897285b8fed439765d3e01
Add test on update document title
test/integration/ggrc/models/test_document.py
test/integration/ggrc/models/test_document.py
Python
0
@@ -0,0 +1,886 @@ +# Copyright (C) 2017 Google Inc.%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A%0A%22%22%22Integration tests for Document%22%22%22%0A%0Afrom ggrc.models import all_models%0Afrom integration.ggrc import TestCase%0Afrom integration.ggrc.api_helper import Api%0Af...
6e0b02c660d20fe2beca96eeab8d3108fd4be2ea
add FIXME
crosscat/tests/test_log_likelihood.py
crosscat/tests/test_log_likelihood.py
import argparse import random from functools import partial # import numpy import pylab pylab.ion() pylab.show() # from crosscat.LocalEngine import LocalEngine import crosscat.utils.data_utils as du import crosscat.utils.geweke_utils as gu import crosscat.utils.timing_test_utils as ttu import crosscat.utils.convergence...
Python
0.000001
@@ -2680,24 +2680,53 @@ style='--')%0A + # FIXME: save the result%0A return%0A%0A
5172dcb5edd09afce992d237bd31700251fca4bd
Remove useless optional style argument to notify()
Bindings/python/Growl.py
Bindings/python/Growl.py
""" A Python module that enables posting notifications to the Growl daemon. See <http://sourceforge.net/projects/growl/> for more information. Requires PyObjC 1.1 <http://pyobjc.sourceforge.net/> and Python 2.3 <http://www.python.org/>. Copyright 2003 Mark Rowe <bdash@users.sourceforge.net> Released under the BSD l...
Python
0
@@ -2630,20 +2630,8 @@ one, - style=None, sti @@ -3534,225 +3534,41 @@ tion -Default': NSNumber.numberWithBool_(True),%0A 'NotificationIcon': icon.TIFFRepresentation()%7D%0A %0A if style is not None:%0A n%5B'NotificationDefault'%5D = NSNumber.numberWithBool_(False) +Icon':...
41752bfcbc0a1afdf7a0f3caa52285af08d131dd
Create get_var.py
get_var.py
get_var.py
Python
0.000002
@@ -0,0 +1,210 @@ +import parse_expr%0A%0Avariables = %7B%7D%0A%0Adef getVar(key):%0A if key%5B0%5D == '%25':%0A return variables%5Bkey%5B1:%5D%5D%0A elif key%5B-1%5D in ('+', '-', '/', '*'):%0A return parse_expr(key)%0A else:%0A return key%0A
e42142498f2ef2b3e78d1becb024441500902a79
add corruptor
test/corrupt.py
test/corrupt.py
Python
0.999262
@@ -0,0 +1,613 @@ +#!/usr/bin/env python%0A%0Afrom __future__ import print_function%0A%0Aimport os%0Aimport sys%0Aimport random%0A%0Aif len(sys.argv) != 3 and not sys.argv%5B2%5D:%0A print('''%0A Usage: corrupt.py filename magic_string%0A%0A magic_string is what you want to write to the file%0A it can not b...
d2f18cc0992d4d7217583cd2601bc90afaa93a04
add grain that detects SSDs
salt/grains/ssds.py
salt/grains/ssds.py
Python
0.000002
@@ -0,0 +1,1019 @@ +# -*- coding: utf-8 -*-%0A'''%0A Detect SSDs%0A'''%0Aimport os%0Aimport salt.utils%0Aimport logging%0A%0Alog = logging.getLogger(__name__)%0A%0Adef ssds():%0A '''%0A Return list of disk devices that are SSD (non-rotational)%0A '''%0A%0A SSDs = %5B%5D%0A for subdir, dirs, files in o...
936c2327d6be9da48dfbef47c17167510e9c2262
Create bzip2.py
wigs/bzip2.py
wigs/bzip2.py
Python
0.000007
@@ -0,0 +1,125 @@ +class bzip2(Wig):%0A%09tarball_uri = 'http://www.bzip.org/1.0.6/bzip2-$RELEASE_VERSION$.tar.gz'%0A%09last_release_version = 'v1.0.6'%0A
c2ca8328835d544440fd3b87813e2768ece58685
Add new package: audacious (#16121)
var/spack/repos/builtin/packages/audacious/package.py
var/spack/repos/builtin/packages/audacious/package.py
Python
0.00002
@@ -0,0 +1,1255 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass Audacious(AutotoolsPackage):%0A %22%22%22A lightweight ...
4287d2290c581b907b08efabc1e6bccea4019ac6
add new package (#15743)
var/spack/repos/builtin/packages/py-pyface/package.py
var/spack/repos/builtin/packages/py-pyface/package.py
Python
0
@@ -0,0 +1,1673 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0A%0Aclass PyPyface(PythonPackage):%0A %22%22%22The pyface project contains a toolkit-indep...
be0033ac91c28f3e45eff34c84b7da59d7fcefe2
add py-ranger package (#3258)
var/spack/repos/builtin/packages/py-ranger/package.py
var/spack/repos/builtin/packages/py-ranger/package.py
Python
0
@@ -0,0 +1,1535 @@ +##############################################################################%0A# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r...
7e4a62aa483fbadc7089144191e48948f419903b
add setup.py
py/setup.py
py/setup.py
Python
0
@@ -0,0 +1,332 @@ +#!/usr/bin/env python%0A# vim: set fileencoding=utf8 shiftwidth=4 tabstop=4 textwidth=80 foldmethod=marker :%0A# Copyright (c) 2010, Kou Man Tong. All rights reserved.%0A# For licensing, see LICENSE file included in the package.%0A%0Afrom distutils.core import setup%0A%0Asetup(name = %22vtdb%22,%0A%0...
a8f1529f6c077c0d70ccb326da6e63f3dd78ec76
move kernel sanitization to separate script
sanitize_kernels.py
sanitize_kernels.py
Python
0.000001
@@ -0,0 +1,450 @@ +import glob%0Aimport nbformat%0A%0A#sanitize kernelspec%0Anotebooks = glob.glob(%22notebooks/*.ipynb%22)%0Aold_envs = %7B%7D%0Afor nb in notebooks:%0A tmp = nbformat.read(nb,4)%0A old_envs%5Bnb%5D = tmp%5B'metadata'%5D%5B'kernelspec'%5D%5B'name'%5D%0A tmp%5B'metadata'%5D%5B'kernelspec'%5D%5B...
9b4f18dbf63a76bd2c0723677fb0d0215831324a
Create __init__.py
ext/__init__.py
ext/__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
52e282b8c51c71db61cb0163df02caf2dce63b45
add pretty function repr extension
extensions/pretty_func_repr.py
extensions/pretty_func_repr.py
Python
0.000001
@@ -0,0 +1,1143 @@ +%22%22%22%0ATrigger pinfo (??) to compute text reprs of functions, etc.%0A%0ARequested by @katyhuff%0A%22%22%22%0A%0Aimport types%0A%0Afrom IPython import get_ipython%0A%0A%0Adef pinfo_function(obj, p, cycle):%0A %22%22%22Call the same code as %60foo?%60 to compute reprs of functions%0A %0A ...
864bf2bb3bdb731d0725cc33891145f2a7da17d3
Add initialization functions for database connection
db/common.py
db/common.py
Python
0.000001
@@ -0,0 +1,835 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport os%0A%0Afrom contextlib import contextmanager%0A%0Afrom sqlalchemy import create_engine%0Afrom sqlalchemy.orm.session import sessionmaker%0Afrom sqlalchemy.schema import MetaData%0Afrom sqlalchemy.ext.declarative import declarative_base%0A%0...
ba0e1d90f5f33ed63c56c2788873624731a7a0b5
add file
regxtest.py
regxtest.py
Python
0.000001
@@ -0,0 +1,1980 @@ +'''%0A((abc)%7B4%7D)%0A%5B1-5%5D%7B5%7D%0A5+%0A5*%0A5?%0A'''%0AEQUL = 1%0ACOUNT = 2%0AANY = 3%0ATREE = 4%0A%0Aclass Node %0A def __init__(self, ntype, parent = None):%0A self.type = ntype %0A self.c = None%0A self.children = %5B%5D%0A self.parent = parent%0A ...
0100a3468dbada1e7ec3cbeaebda7ee11874ab8b
find similarly related words
relation.py
relation.py
Python
0.999999
@@ -0,0 +1,2328 @@ +#!/usr/bin/env python%0A%0A%22%22%22Given phrases p1 and p2, find nearest neighbors to both and rank%0Apairs of neighbors by similarity to vec(p2)-vec(p1) in given word%0Arepresentation.%0A%0AThe basic idea is a straightforward combination of nearest neighbors%0Aand analogy as in word2vec (https://c...
11380e7db081960757cbde2c4d2e69b695648782
Add routine to calculate density.
density.py
density.py
Python
0
@@ -0,0 +1,765 @@ +#!/usr/bin/env python%0A# -----------------------------------------------------------------------------%0A# GENHERNQUIST.DENSITY%0A# Laura L Watkins %5Blauralwatkins@gmail.com%5D%0A# -----------------------------------------------------------------------------%0A%0A%0Adef density(r, norm, rs, alpha, ...
3fb3662e58e35ccb283074c1078e1c9e7aaf88ed
Add live test for session
LendingClub/tests/live_session_test.py
LendingClub/tests/live_session_test.py
Python
0
@@ -0,0 +1,1160 @@ +#!/usr/bin/env python%0A%0Aimport sys%0Aimport unittest%0Aimport getpass%0Afrom logger import TestLogger%0A%0Asys.path.insert(0, '.')%0Asys.path.insert(0, '../')%0Asys.path.insert(0, '../../')%0A%0Afrom LendingClub import session%0A%0A%0Aclass LiveTestSession(unittest.TestCase):%0A http = None%0A...
9e4858e652fba57f767a9c6d921853a6487301bd
Add a test for the version string parsing code
epsilon/test/test_version.py
epsilon/test/test_version.py
Python
0.00002
@@ -0,0 +1,597 @@ +%22%22%22%0ATests for turning simple version strings into twisted.python.versions.Version%0Aobjects.%0A%0A%22%22%22%0Afrom epsilon import asTwistedVersion%0Afrom twisted.trial.unittest import SynchronousTestCase%0A%0A%0Aclass AsTwistedVersionTests(SynchronousTestCase):%0A def test_simple(self):%0A...
dff8d43edd0e831605f1b1c3b2d261fcf05dca9a
Add wordpress guid replace script
script/wordpress/guid.py
script/wordpress/guid.py
Python
0
@@ -0,0 +1,434 @@ +import MySQLdb%0Aimport urlparse%0A%0Apoe = %22https://wordpress.wordpress%22%0A%0Adb = MySQLdb.connect(db=%22wordpress%22,user=%22%22,passwd=%22%22) %0Ac = db.cursor() %0Asql = %22SELECT ID,guid from wp_posts;%22%0Ac.execute(sql)%0Arecords = c.fetchall()%0Afor record in records:%0A o = urlparse.ur...
c48ec87b3e1c672864fc8c5bfe1aa551c01846ee
add basic tcp server
Server.py
Server.py
Python
0.000001
@@ -0,0 +1,1670 @@ +%22%22%22%0AFile: Server.py%0AAuthor: Daniel Schauenberg %3Cschauend@informatik.uni-freiburg.de%3E%0ADescription: class for implementing a search engine web server%0A%22%22%22%0Aimport socket%0Afrom operator import itemgetter%0A%0Aclass Webserver:%0A %22%22%22 class for implementing a web server,...
94403aedd21947c30b5d8159fcd42288050afc3a
Create 6kyu_personalized_brand_list.py
Solutions/6kyu/6kyu_personalized_brand_list.py
Solutions/6kyu/6kyu_personalized_brand_list.py
Python
0
@@ -0,0 +1,251 @@ +from collections import OrderedDict%0A%0Adef sorted_brands(history):%0A poplr=OrderedDict()%0A for i in history:%0A try: poplr%5Bi%5B'brand'%5D%5D+=1%0A except: poplr%5Bi%5B'brand'%5D%5D=1%0A return sorted(poplr.keys(), key=lambda x: poplr%5Bx%5D, reverse=1)%0A
2f6720e5f31c6e1753e2595867a5ef690b79bda7
Fix snapdiff arg parsing.
scripts/snapdiff.py
scripts/snapdiff.py
#!/usr/bin/env python ########################################################################## # # Copyright 2008-2009 VMware, 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 # ...
Python
0
@@ -2962,26 +2962,22 @@ refix = -sys.argv%5B1 +args%5B0 %5D%0A sr @@ -2991,18 +2991,14 @@ x = -sys.argv%5B2 +args%5B1 %5D%0A%0A
48cac034e7b402e2d4b3cb52d2cae51b44928e0b
add Faster R-CNN
examples/faster_rcnn/eval.py
examples/faster_rcnn/eval.py
Python
0.000384
@@ -0,0 +1,1995 @@ +from __future__ import division%0A%0Aimport argparse%0Aimport sys%0Aimport time%0A%0Aimport chainer%0Afrom chainer import iterators%0A%0Afrom chainercv.datasets import voc_detection_label_names%0Afrom chainercv.datasets import VOCDetectionDataset%0Afrom chainercv.evaluations import eval_detection_vo...
b098f2ad30339c0efb9728741b796fe9f2db7f74
Make sure mopidy startup doesn't block
mycroft/skills/playback_control/mopidy_service.py
mycroft/skills/playback_control/mopidy_service.py
from mycroft.messagebus.message import Message from mycroft.util.log import getLogger from mycroft.skills.audioservice import AudioBackend from os.path import dirname, abspath, basename import sys import time logger = getLogger(abspath(__file__).split('/')[-2]) __author__ = 'forslund' sys.path.append(abspath(dirname(...
Python
0
@@ -439,80 +439,8 @@ e):%0A - logger.debug('Could not connect to server, will retry quietly')%0A @@ -1240,21 +1240,52 @@ elf. -_c +emitter.emit(Message('MopidyServiceC onnect -(None +') )%0A%0A
874e2c35bb0aea38a1161d96b8af484a69336ea6
Add htpasswd.py to the contrib tree as it may be useful more generally than just for the Testing branch
contrib/htpasswd.py
contrib/htpasswd.py
Python
0.000003
@@ -0,0 +1,2742 @@ +#!/usr/bin/python%0A%22%22%22Replacement for htpasswd%22%22%22%0A%0Aimport os%0Aimport random%0Atry:%0A import crypt%0Aexcept ImportError:%0A import fcrypt as crypt%0Afrom optparse import OptionParser%0A%0A%0Adef salt():%0A %22%22%22Returns a string of 2 randome letters%22%22%22%0A # FIX...
88eb8887bd71702fbf0c5095d8c2d637876de4b8
Add the upload_file_test
examples/upload_file_test.py
examples/upload_file_test.py
Python
0.000018
@@ -0,0 +1,809 @@ +from seleniumbase import BaseCase%0A%0A%0Aclass FileUploadButtonTests(BaseCase):%0A%0A %22%22%22 The main purpose of this is to test the self.choose_file() method. %22%22%22%0A%0A def test_file_upload_button(self):%0A self.open(%22https://www.w3schools.com/jsref/tryit.asp%22%0A ...
a98ba6efa109383ecc1dfeb07691dc0a4a4e2a5b
Update migrations
django_afip/migrations/0002_auto_20150909_1837.py
django_afip/migrations/0002_auto_20150909_1837.py
Python
0.000001
@@ -0,0 +1,627 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('afip', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ...
9668580633a1a8baaa59030e5a52d2478222cbd2
Add cost tracking file to openstack
nodeconductor/openstack/cost_tracking.py
nodeconductor/openstack/cost_tracking.py
Python
0
@@ -0,0 +1,300 @@ +from . import models%0Afrom nodeconductor.cost_tracking import CostTrackingBackend%0A%0A%0Aclass OpenStackCostTrackingBackend(CostTrackingBackend):%0A%0A @classmethod%0A def get_monthly_cost_estimate(cls, resource):%0A backend = resource.get_backend()%0A return backend.get_monthly...
2dfa68eb458cfc7d6166ede8a222b1d11b9577a0
Create grabscreen.py
grabscreen.py
grabscreen.py
Python
0
@@ -0,0 +1,1214 @@ +# Done by Frannecklp%0A%0Aimport cv2%0Aimport numpy as np%0Aimport win32gui, win32ui, win32con, win32api%0A%0Adef grab_screen(region=None):%0A%0A hwin = win32gui.GetDesktopWindow()%0A%0A if region:%0A left,top,x2,y2 = region%0A width = x2 - left + 1%0A height =...
0486e02bbaefea63a2dff9983be51623a184dc66
test python interpreter
test/test_interpreter_layer.py
test/test_interpreter_layer.py
Python
0.000062
@@ -0,0 +1,422 @@ +# This code is so you can run the samples without installing the package%0Aimport sys%0Aimport os%0Asys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))%0A#%0A%0A%0Aimport cocos%0Afrom cocos.director import director%0Aimport pyglet%0A %0A%0Aif __name__ == %22__main__%22:%0A dir...
76baf574ba5a4ff9e835412e27fd2ebc634a9992
add Cython register test
new_pymtl/translation_tools/verilator_sim_test.py
new_pymtl/translation_tools/verilator_sim_test.py
Python
0
@@ -0,0 +1,471 @@ +from verilator_sim import get_verilated%0Afrom new_pmlib.regs import Reg%0Afrom new_pymtl import SimulationTool%0A%0Adef test_reg():%0A model = Reg(16)%0A print %22BEGIN%22%0A vmodel = get_verilated( model )%0A print %22END%22%0A%0A vmodel.elaborate()%0A%0A sim = SimulationTool( vmodel )...
214aa96b5e816ad6386fc20fed684152ac8181d1
add migration for ip to generic ip field change
newsletters/migrations/0003_auto_20150701_1840.py
newsletters/migrations/0003_auto_20150701_1840.py
Python
0
@@ -0,0 +1,407 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('newsletters', '0002_auto_20150630_0009'),%0A %5D%0A%0A operations = %5B%0A migrations.Alt...
f90a9e585b5de36b3abc11cf454cde75a44a1a6b
Include Overlay Utils
evaluation/overlay_utils.py
evaluation/overlay_utils.py
Python
0
@@ -0,0 +1,1892 @@ +#!/usr/bin/env python%0A%0A%22%22%22Utility functions for segmentation tasks.%22%22%22%0A%0Afrom PIL import Image%0Aimport scipy.ndimage%0Aimport numpy as np%0A%0A%0Adef replace_colors(segmentation, color_changes):%0A %22%22%22%0A Replace the values in segmentation to the values defined in col...
a12dd320df30404df8c8ec196e21067376cc1e2c
Add tests of table and column pickling
astropy/table/tests/test_pickle.py
astropy/table/tests/test_pickle.py
Python
0
@@ -0,0 +1,2155 @@ +import cPickle as pickle%0A%0Aimport numpy as np%0Aimport pytest%0A%0Afrom ...table import Table, Column, MaskedColumn%0A%0A%0A@pytest.fixture(params=%5B0, 1, -1%5D)%0Adef protocol(request):%0A %22%22%22%0A Fixture to run all the tests for protocols 0 and 1, and -1 (most advanced).%0A %22%2...
fb5f6b5db2e2701692dd0a35dfad36d7b6dd4f2d
Create example file
example.py
example.py
Python
0.000001
@@ -0,0 +1,537 @@ +from blender_wrapper.api import Scene%0Afrom blender_wrapper.api import Camera%0Afrom blender_wrapper.api import SunLamp%0Afrom blender_wrapper.api import ORIGIN%0A%0A%0Adef main():%0A scene = Scene(1500, 1000, filepath=%22~/Desktop/%22)%0A scene.setup()%0A%0A camera = Camera((1, 0, 1), (90,...
68e16ca50bec3802184e098548aa2c2584c352b2
Add main example code
signal_decorator.py
signal_decorator.py
Python
0.000033
@@ -0,0 +1,791 @@ +#!/usr/bin/python%0A__author__ = 'Neil Parley'%0A%0Afrom functools import wraps%0Aimport signal%0Aimport sys%0A%0A%0Adef catch_sig(f):%0A %22%22%22%0A Adds the signal handling as a decorator, define the signals and functions that handle them. Then wrap the functions%0A with your decorator.%0...
b4eec76e7e0d4ff28cf6e2678c45bf63c5f22874
revert db settings
example_project/settings.py
example_project/settings.py
import os.path import sys # Django settings for example_project project. DEBUG = True TEMPLATE_DEBUG = True ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS PROJECT_ROOT = os.path.dirname(__file__) sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, '..'))) DATABASES = { ...
Python
0
@@ -482,14 +482,14 @@ ': ' -disqus +sentry ', @@ -574,13 +574,16 @@ ': ' -dzhou +postgres ',
e0f985b912acbd0c5d922c4c1c0f25cf9ef17200
raise an exception if fact table can not be determined
cubes/sql/mapper.py
cubes/sql/mapper.py
# -*- encoding: utf-8 -*- """Logical to Physical Mappers""" from __future__ import absolute_import from collections import namedtuple from ..logging import get_logger from ..errors import BackendError from ..mapper import Mapper from ..model import AttributeBase from .. import compat from .schema import to_column ...
Python
0.000001
@@ -196,16 +196,28 @@ endError +, ModelError %0Afrom .. @@ -3178,32 +3178,167 @@ _suffix%22) or %22%22%0A +%0A if not (fact_name or self.cube.fact or self.cube.basename):%0A raise ModelError(%22Can not determine cube fact name%22)%0A%0A self.fac
bec85af38596c2a4c38b8a53e3960a9ba375fe6f
remove sklearn.test()
sklearn/__init__.py
sklearn/__init__.py
""" Machine learning module for Python ================================== sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). It aims to provide simple and efficient solutions to learning problems that are acc...
Python
0
@@ -1064,355 +1064,231 @@ -try:%0A from numpy.testing import nosetester%0A%0A class _NoseTester(nosetester.NoseTester):%0A %22%22%22 Subclass numpy's NoseTester to add doctests by default%0A %22%22%22%0A%0A def test(self, label='fast', verbose=1, extra_argv=%5B'--exe...
950bdd0f528fc61175c39dc2ade6abb9d46d767a
Change plan on book
contacts/migrations/0027_auto_20170106_0627.py
contacts/migrations/0027_auto_20170106_0627.py
Python
0
@@ -0,0 +1,1229 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.11 on 2017-01-06 06:27%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('contacts', '0026_auto_20161231_2045'),%0A %5D%0...
97c87237de87c91d66a92c1cacc362a7b831b8ef
add script to install python modules with pip
install_py_modules.py
install_py_modules.py
Python
0
@@ -0,0 +1,689 @@ +# this will install most necessary packages for this project%0A# that you may not already have on your system%0A%0Aimport pip%0A%0Adef install(package):%0A pip.main(%5B'install', package%5D)%0A%0A# Example%0Aif __name__ == '__main__':%0A # for scraping akc.org for a list of breed names and pics...
98e822a78722e735b31817e74cc5e310fcb43c9a
add missed migration (HomeBanner verbose texts)
brasilcomvc/portal/migrations/0005_homebanner_verbose.py
brasilcomvc/portal/migrations/0005_homebanner_verbose.py
Python
0
@@ -0,0 +1,434 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('portal', '0004_homebanner_image_upload_to'),%0A %5D%0A%0A operations = %5B%0A migrations....
35310a8fa136b5b6e094401a8289f5eabeb28cbc
Create batterylevel.py
home/hairygael/batterylevel.py
home/hairygael/batterylevel.py
Python
0.000063
@@ -0,0 +1,194 @@ +def batterylevel():%0A power_now = subprocess.call (%22WMIC PATH Win32_Battery Get EstimatedChargeRemaining%22, %22r%22.readline())%0A ANSWER = float(power_now) * 100 , %22%25%22%0A i01.mouth.speak(str(ANSWER))%0A
c7851b61268848cf1b02d9e5c845a846ded4c2a7
Update __init__.py
tendrl/node_agent/objects/cluster_message/__init__.py
tendrl/node_agent/objects/cluster_message/__init__.py
from tendrl.commons import etcdobj from tendrl.commons.message import Message as message from tendrl.commons import objects class ClusterMessage(objects.BaseObject, message): internal = True def __init__(self, **cluster_message): self._defs = {} message.__init__(self, **cluster_message) ...
Python
0.000072
@@ -384,33 +384,33 @@ = 'clusters/%25s/ -M +m essages/%25s'%0A @@ -578,17 +578,17 @@ ters/%25s/ -M +m essages/
7fddacd1a751c095f70693bb703bb9959a706ae1
Add an example with end to end data
example.py
example.py
Python
0.00006
@@ -0,0 +1,2234 @@ +%22%22%22%0AExample script for getting events over a Zaqar queue.%0A%0ATo run:%0A$ export IDENTITY_API_VERSION=3%0A$ source ~/devstack/openrc%0A$ python example.py%0A%22%22%22%0Aimport json%0Aimport os%0Aimport uuid%0A%0Aimport requests%0Aimport websocket%0A%0Afrom keystoneauth1.identity import v3%0...
e1907624a143d0733cd89e5458d104ed0a4fee43
Add simple tasks
fabfile.py
fabfile.py
Python
0.999917
@@ -0,0 +1,100 @@ +# Simple Tasks%0A%0Adef hello():%0A print 'Hello ThaiPy!'%0A%0A%0Adef hi(name='Kan'):%0A print 'Hi ' + name%0A
50769229ce8ef4e84f345184b0aebf036bc0e179
add fabfile
fabfile.py
fabfile.py
Python
0.000002
@@ -0,0 +1,338 @@ +from fabric.api import local, put, run, cd, sudo%0A%0Adef status():%0A run(%22systemctl status web%22)%0A%0Adef restart():%0A sudo(%22systemctl restart web%22)%0A%0Adef deploy():%0A local('tar -czf cydev_web.tgz web static/')%0A put(%22cydev_web.tgz%22, %22~/cydev.ru%22)%0A with cd(%22~/...
fe0d8aa2e8293a14c9f2b0ac9fe9c51a99b75f16
Make gallery images a bit smaller.
docs/source/notebook_gen_sphinxext.py
docs/source/notebook_gen_sphinxext.py
# # Generation of RST from notebooks # import glob import os import os.path import warnings warnings.simplefilter('ignore') from nbconvert.exporters import rst def setup(app): setup.app = app setup.config = app.config setup.confdir = app.confdir app.connect('builder-inited', generate_rst) retu...
Python
0
@@ -3247,57 +3247,8 @@ e +%0A - '%5Cn :height: 300px'%0A @@ -3288,11 +3288,11 @@ th: -375 +220 px'%0A
2af8c695c1463c080ce8c4bff7e3d81662a49c81
implement generic decorator and register function
dispatk.py
dispatk.py
Python
0
@@ -0,0 +1,1678 @@ +%22%22%22%0AThis function is inspired by singledispatch of Python 3.4+ (PEP 443),%0Abut the dispatch happens on the key extracted fro the arguments values.%0A%0Afrom dispatk import dispatk%0A%0A@dispatk(lambda n: int(n))%0Adef fib(n):%0A return fib(n-1) + fib(n-2)%0A%0A@fib.register(0)%0Adef _(n)...
e823c55f62c8aa1d72ec3bf2b58288b3dd413561
Create radix_sort.py
sorts/radix_sort.py
sorts/radix_sort.py
Python
0.000003
@@ -0,0 +1,580 @@ +def radixsort(lst):%0A RADIX = 10%0A maxLength = False%0A tmp , placement = -1, 1%0A %0A while not maxLength:%0A maxLength = True%0A # declare and initialize buckets%0A buckets = %5Blist() for _ in range( RADIX )%5D%0A %0A # split lst between lists%0A for i in lst:%0A tmp = i...
2b810eb1900ca96c7fb2d8b63b70b7b0df8b9ed5
Create find_digits.py
algorithms/implementation/python3/find_digits.py
algorithms/implementation/python3/find_digits.py
Python
0.998631
@@ -0,0 +1,271 @@ +#!/bin/python3%0A%0Aimport sys%0A%0A%0At = int(input().strip())%0Afor a0 in range(t):%0A n = int(input().strip())%0A%0A count = 0%0A digits = str(n)%0A for digit in digits:%0A if int(digit) != 0:%0A if n %25 int(digit) == 0:%0A count += 1%0A print(count...
c723865ae8013020f6f0a28cd41592c3dc900968
add a second test for process_dc_env.
tests/process_dc_env_test_2.py
tests/process_dc_env_test_2.py
Python
0
@@ -0,0 +1,3216 @@ +#!/usr/bin/env python%0Aimport sys%0Aimport os%0Aimport argparse%0A# There is a PEP8 warning about this next line not being at the top of the file.%0A# The better answer is to append the $dcUTILS/scripts directory to the sys.path%0A# but I wanted to illustrate it here...so your mileage may vary how ...
51aefefc3cdcd131678e921a29b5acd5b9601b81
add a unit-tests that essentially import the the python python file in src/dynamic_graph/
tests/python/python_imports.py
tests/python/python_imports.py
Python
0
@@ -0,0 +1,2778 @@ +#!/usr/bin/env python%0A%0Aimport unittest%0A%0Aclass PythonImportTest(unittest.TestCase):%0A def test_math_small_entities(self):%0A try:%0A import dynamic_graph.sot.core.math_small_entities%0A except ImportError as ie:%0A self.fail(str(ie))%0A %0A def te...
f8067853546a9c25716aef6bc9f255591cb65626
Add migration to change the project results report URL
akvo/rsr/migrations/0125_auto_20180315_0829.py
akvo/rsr/migrations/0125_auto_20180315_0829.py
Python
0
@@ -0,0 +1,983 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0AORIGINAL_URL = '/en/reports/project_results/%7Bproject%7D?format=%7Bformat%7D&download=true'%0ANEW_URL = ORIGINAL_URL + '&p_StartDate=%7Bstart_date%7D&p_EndDate=%7Bend_date%7D'%0AREPORT_ID = 1...
2aa0990746b71086b4c31ee81ac8874436c63e32
Add a few tests (close #4)
tests/test_crosslinking_bot.py
tests/test_crosslinking_bot.py
Python
0.000001
@@ -0,0 +1,1474 @@ +from datetime import datetime%0Afrom datetime import date, timedelta%0A%0Aimport pytest%0A%0Afrom crosslinking_bot import crosslinking_bot as cb%0A%0A%0Aclass TestParseDate:%0A%0A def test_return_today(self):%0A today = datetime.today().date()%0A assert 'today' == cb.parse_date(toda...
2d1f8a160b01ff9f57167f248c560675c4dc77a9
Use the `@wraps` decorator with `@odin.local`.
distarray/odin.py
distarray/odin.py
""" ODIN: ODin Isn't Numpy """ from itertools import chain from IPython.parallel import Client from distarray.client import Context, DistArray # Set up a global Context on import _global_client = Client() _global_view = _global_client[:] _global_context = Context(_global_view) context = _global_context def flatte...
Python
0
@@ -52,16 +52,44 @@ rt chain +%0Afrom functools import wraps %0A%0Afrom I @@ -4355,16 +4355,31 @@ _key()%0A%0A + @wraps(fn)%0A def
3a178c100cbf64b8ab60954a9b9ea5a01640f842
Integrate LLVM at llvm/llvm-project@852d84e36ed7
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "0128f8016770655fe7a40d3657f00853e6badb93" LLVM_SHA256 = "f90705c878399b7dccca9cf9b28d695a4c6f8a0e12f2701f7762265470fa6c22" tf_http_archive( ...
Python
0.000001
@@ -160,133 +160,133 @@ = %22 -0128f8016770655fe7a40d3657f00853e6badb93%22%0A LLVM_SHA256 = %22f90705c878399b7dccca9cf9b28d695a4c6f8a0e12f2701f7762265470fa6c22 +852d84e36ed7a3db0ff4719f44a12b6bc09d35f3%22%0A LLVM_SHA256 = %223def20f54714c474910e5297b62639121116254e9e484ccee04eee6815b5d58c %22%0A%0A
52f49543dd7bf01a2a24db435d8461b7c8921789
Integrate LLVM at llvm/llvm-project@9a764ffeb6f0
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "72136d8ba266eea6ce30fbc0e521c7b01a13b378" LLVM_SHA256 = "54d179116e7a79eb1fdf7819aad62b4d76bc0e15e8567871cae9b675f7dec5c1" tf_http_archive( ...
Python
0.000001
@@ -160,133 +160,133 @@ = %22 -72136d8ba266eea6ce30fbc0e521c7b01a13b378%22%0A LLVM_SHA256 = %2254d179116e7a79eb1fdf7819aad62b4d76bc0e15e8567871cae9b675f7dec5c1 +9a764ffeb6f06a87c7ad482ae39f8a38b3160c5e%22%0A LLVM_SHA256 = %228f000d6541d64876de8ded39bc140176c90b74c3961b9ca755b1fed44423c56b %22%0A%0A
9365d95e8f739c8c13bf0520ac20ad07a3387a42
Avoid building blink_heap_unittests to unblock the Blink roll
public/all.gyp
public/all.gyp
# # Copyright (C) 2011 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 of conditions an...
Python
0.998657
@@ -1809,32 +1809,176 @@ +# FIXME: This test doesn't link properly. Commenting it out to%0A # unblock the Blink roll. See crbug.com/332220.%0A # '../Source/heap/
45254d35def51a5e8936fe649f8c3fc089cd4a6d
add `schemas.py`
todo/schemas.py
todo/schemas.py
Python
0.000001
@@ -0,0 +1,521 @@ +%22%22%22Request/Response Schemas are defined here%22%22%22%0A# pylint: disable=invalid-name%0A%0Afrom marshmallow import Schema, fields%0Afrom marshmallow_enum import EnumField%0A%0Afrom todo.enums import Status%0A%0A%0Aclass TaskSchema(Schema):%0A %22%22%22Schema for api.portal.models.Panel%22%2...
4f9660704445e6da62fc4e893d93fc84288303d4
Integrate LLVM at llvm/llvm-project@aec908f9b248
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "5dcd6afa20881490b38f3d88c4e59b0b4ff33551" LLVM_SHA256 = "86f64f78ba3b6c7e8400fe7f5559b3dd110b9a4fd9bfe9e5ea8a4d27301580e0" tf_http_archive( ...
Python
0.000001
@@ -160,133 +160,133 @@ = %22 -5dcd6afa20881490b38f3d88c4e59b0b4ff33551%22%0A LLVM_SHA256 = %2286f64f78ba3b6c7e8400fe7f5559b3dd110b9a4fd9bfe9e5ea8a4d27301580e0 +aec908f9b248b27cb44217081c54e2c00604dff7%22%0A LLVM_SHA256 = %22c88b75b4d60b960c7da65b7bacfdf8c5cf4c7846ab85a334f1ff18a8b50f2d98 %22%0A%0A
735dee2da41bf8df8519d516bd9b231ff440f5f9
Create globals.system module for Python & system related settings
source/globals/system.py
source/globals/system.py
Python
0
@@ -0,0 +1,273 @@ +# -*- coding: utf-8 -*-%0A%0A## %5Cpackage globals.system%0A%0A# MIT licensing%0A# See: LICENSE.txt%0A%0A%0Aimport sys%0A%0A%0APY_VER_MAJ = sys.version_info%5B0%5D%0APY_VER_MIN = sys.version_info%5B1%5D%0APY_VER_REL = sys.version_info%5B2%5D%0APY_VER_STRING = u'%7B%7D.%7B%7D.%7B%7D'.format(PY_VER_MAJ...
b83b09f937f91a870165d88730a36faaee8a5261
add a parser of metadata
retsmeta.py
retsmeta.py
Python
0.000118
@@ -0,0 +1,1826 @@ +# -*- coding: utf-8 -*-%0A%0Afrom xml.etree import ElementTree%0A%0Aclass MetaParser(object):%0A def GetResources(self):%0A pass%0A %0A def GetRetsClass(self, resource):%0A pass%0A %0A def GetTables(self, resource, rets_class):%0A pass%0A %0A def GetLookUp(s...
f2e5c56297a00ebf4b5029b702f8441adca83a8e
Update 'systemd' module from oslo-incubator
cinder/openstack/common/systemd.py
cinder/openstack/common/systemd.py
# Copyright 2012-2014 Red Hat, 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...
Python
0
@@ -682,18 +682,23 @@ ort -os +logging %0Aimport sock @@ -693,22 +693,18 @@ %0Aimport +o s -ocket %0Aimport @@ -708,62 +708,24 @@ rt s -ys%0A%0Afrom cinder.openstack.common import log as logging +ocket%0Aimport sys %0A%0A%0AL
bbb445b691f7370059c7bf9c94e2e9c6f4155273
update to latest
tasks/base.py
tasks/base.py
import os from invoke import run class BaseTest(object): def download_mspec(self): if not os.path.isdir("../mspec"): run("cd .. && git clone --depth=100 --quiet https://github.com/ruby/mspec") run("cd ../mspec && git checkout v1.6.0") def download_rubyspec(self): if n...
Python
0
@@ -216,62 +216,8 @@ ec%22) -%0A run(%22cd ../mspec && git checkout v1.6.0%22) %0A%0A
50843d6a2c93be4e05a0a2da338e4b0e0d99d294
Add tls proxy helper
jujuxaas/tls_proxy.py
jujuxaas/tls_proxy.py
Python
0
@@ -0,0 +1,2716 @@ +import copy%0Aimport select%0Aimport socket%0Aimport ssl%0Aimport sys%0Aimport threading%0A%0Aimport logging%0Alogger = logging.getLogger(__name__)%0A%0Aclass TlsProxyConnection(object):%0A def __init__(self, server, inbound_socket, inbound_address, outbound_address):%0A self.server = server%0A ...
7d7fd5b167528654b9fed5b0c971c2b8110d93ea
Create wrapper_exploit.py
wrapper_exploit.py
wrapper_exploit.py
Python
0
@@ -0,0 +1,520 @@ +# Author: Chris Duffy%0A# Date: May 2015%0A# Purpose: An sample exploit for testing UDP services%0Aimport sys, socket, strut, subprocess%0Aprogram_name = 'C:%5Cexploit_writing%5Cvulnerable.exe'%0Afill =%22A%22*####%0Aeip = struct.pack('%3CI',0x########)%0Aoffset = %22%5Cx90%22*##%0Aavailable_shellcod...
ef24797a12e8a8919ddb11c7b6763154c5c3aad1
transform DR script to observe exceptions
transform_DR.py
transform_DR.py
Python
0
@@ -0,0 +1,1158 @@ +__author__ = 'kuhn'%0A__author__ = 'kuhn'%0A%0Afrom batchxslt import processor%0Afrom batchxslt import cmdiresource%0Aimport codecs%0Aimport os%0A%0Adgd_corpus = %22/home/kuhn/Data/IDS/svn_rev1233/dgd2_data/metadata/corpora/extern%22%0Adgd_events = %22/home/kuhn/Data/IDS/svn_rev1233/dgd2_data/metada...
60b5228818c92f4d13b0a054956a5f834c7f7549
Implement remove.py
programs/genesis_util/remove.py
programs/genesis_util/remove.py
Python
0.0001
@@ -0,0 +1,2546 @@ +#!/usr/bin/env python3%0A%0Aimport argparse%0Aimport json%0Aimport sys%0A%0Adef dump_json(obj, out, pretty):%0A if pretty:%0A json.dump(obj, out, indent=2, sort_keys=True)%0A else:%0A json.dump(obj, out, separators=(%22,%22, %22:%22), sort_keys=True)%0A return%0A%0Adef main():...