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
67d86229279e979d8ef5ac54e5ed8ca85c32ff2e
add another sample script (multiple.py).
demos/multiple.py
demos/multiple.py
Python
0
@@ -0,0 +1,632 @@ +#!/usr/bin/env python%0Afrom Exscript import Host%0Afrom Exscript.util.interact import read_login%0Afrom Exscript.util.template import eval_file%0Afrom Exscript.util.start import start%0A%0Adef one(conn):%0A conn.open()%0A conn.authenticate()%0A conn.autoinit()%0A conn.ex...
3704654e704c0595e933f4ab2832e945816afde8
Add setup.py file
TimeSeries/PublicApis/Python/setup.py
TimeSeries/PublicApis/Python/setup.py
Python
0.000001
@@ -0,0 +1,421 @@ +from setuptools import setup%0A%0Asetup(%0A name=%22aquarius-timeseries-client%22,%0A py_modules=%5B%22timeseries_client%22%5D,%0A version=%220.1%22,%0A description=%22Python client for Aquarius TimeSeries API%22,%0A long_description=open(%22README.md%22).read(),%0A long_description...
da22d8dffadbb4713e715aca7918942f445090c9
embed video form and model fields
embed_video/fields.py
embed_video/fields.py
Python
0
@@ -0,0 +1,715 @@ +from django.db import models%0Afrom django import forms%0Afrom django.utils.translation import ugettext_lazy as _%0A%0Afrom .base import detect_backend%0A%0A__all__ = ('EmbedVideoField', 'EmbedVideoFormField')%0A%0A%0Aclass EmbedVideoField(models.URLField):%0A def formfield(self, **kwargs):%0A ...
b81028067cf65b2ee3a155d081e7983a1de70d5f
Add mistakenly omitted migrations
opentreemap/treemap/migrations/0005_auto_20150729_1046.py
opentreemap/treemap/migrations/0005_auto_20150729_1046.py
Python
0
@@ -0,0 +1,784 @@ +# -*- 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 ('treemap', '0004_auto_20150720_1523'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterFi...
1fa74f6a6a5faeb9579c889df32e4bfe8d6908df
Add migration
fat/migrations/0059_event_extra_sponsored.py
fat/migrations/0059_event_extra_sponsored.py
Python
0.000002
@@ -0,0 +1,449 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.5 on 2016-08-08 10:16%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('fat', '0058_auto_20160808_1007'),%0A %5D%0A%0A ...
62c70b301ffc1e178c3bd54bd81291876b3883ea
Add simple linear interpolation filling.
analysis/03-fill-dropouts-linear.py
analysis/03-fill-dropouts-linear.py
Python
0
@@ -0,0 +1,1058 @@ +#!/usr/bin/env python%0A%0Afrom __future__ import division%0A%0Aimport climate%0Aimport lmj.cubes%0Aimport lmj.cubes.fill%0Aimport numpy as np%0Aimport pandas as pd%0A%0Alogging = climate.get_logger('fill')%0A%0Adef fill(dfs, window):%0A '''Complete missing marker data using linear interpolation....
7942254131bcf005d5a5f1bb33ca7d1ffff1b311
Create keyAllCtrls.py
af_scripts/blendshapes/keyAllCtrls.py
af_scripts/blendshapes/keyAllCtrls.py
Python
0.000002
@@ -0,0 +1,186 @@ +import maya.cmds as cmds%0Aimport maya.mel as mel%0Acmds.select(cmds.ls('*:*.faceCtrl', o=1))%0Amel.eval('doSetKeyframeArgList 6 %7B %224%22,%220%22,%220%22,%220%22,%221%22,%220%22,%220%22,%22animationList%22,%220%22,%221%22,%220%22 %7D;')%0A
f51c4abc95fda5504e7c7a5ad87355698798ddd1
create temporary streaming solution
temp_vidstream.py
temp_vidstream.py
Python
0
@@ -0,0 +1,190 @@ +import picamera%0A%0Awith picamera.PiCamera() as camera:%0A camera.resolution = (640, 480)%0A camera.start_recording('vidstream.mp4')%0A camera.wait_recording(60)%0A camera.stop_recording()%0A
89d27dd0a28f84c99930c0f1dad496e525f62272
migrate to namespace table
migrations/versions/28c0d6c2f887_add_namespaces.py
migrations/versions/28c0d6c2f887_add_namespaces.py
Python
0.000002
@@ -0,0 +1,2665 @@ +%22%22%22Add namespaces%0A%0ARevision ID: 28c0d6c2f887%0ARevises: 4323056c0b78%0ACreate Date: 2013-10-14 22:18:29.705865%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '28c0d6c2f887'%0Adown_revision = '4323056c0b78'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Af...
55f2325354724cfe8b90324038daf2c1acaa916a
Add unit tests for OpenStack config defaults
teuthology/openstack/test/test_config.py
teuthology/openstack/test/test_config.py
Python
0
@@ -0,0 +1,1092 @@ +from teuthology.config import config%0A%0A%0Aclass TestOpenStack(object):%0A%0A def setup(self):%0A self.openstack_config = config%5B'openstack'%5D%0A%0A def test_config_clone(self):%0A assert 'clone' in self.openstack_config%0A%0A def test_config_user_data(self):%0A os...
526d58fb917a4e098018f733b4c0b254417140b4
Add @log_route decorator
keeper/logutils.py
keeper/logutils.py
Python
0.00001
@@ -0,0 +1,1336 @@ +%22%22%22Logging helpers and utilities.%0A%22%22%22%0A%0A__all__ = %5B'log_route'%5D%0A%0Afrom functools import wraps%0Afrom timeit import default_timer as timer%0Aimport uuid%0A%0Afrom flask import request, make_response%0Aimport structlog%0A%0A%0Adef log_route():%0A %22%22%22Route decorator to ...
3f3115a0a9c7407820b3b10c06dcfa4f92ac6e57
Add owned book scaffold
goodreads_api_client/resources/owned_book.py
goodreads_api_client/resources/owned_book.py
Python
0
@@ -0,0 +1,658 @@ +# -*- coding: utf-8 -*-%0A%22%22%22Module containing owned book resource class.%22%22%22%0A%0Afrom goodreads_api_client.exceptions import OauthEndpointNotImplemented%0Afrom goodreads_api_client.resources.base import Resource%0A%0A%0Aclass OwnedBook(Resource):%0A def create(self):%0A raise O...
5d99b7c2dfbfbb776716f2258d560bab2602531f
Create main.py
main.py
main.py
Python
0.000001
@@ -0,0 +1,2657 @@ +# -*- coding: utf-8 -*-%0A#Backlog Manager%0A#programmed by Ian Hitterdal (otend)%0A#licensed under MIT license%0Aimport work%0Aimport random%0A%0A%0Adef addWork(medium):%0A#input: valid medium string%0A#user input: work title string%0A#output: none%0A#user output: none, really%0A global workDict...
f75d321b200217514cde901cc15cc2b798e3dcfe
Add new hipchat module
bumblebee/modules/hipchat.py
bumblebee/modules/hipchat.py
Python
0
@@ -0,0 +1,1801 @@ +%22%22%22Displays the unread messages count for an HipChat user%0A%0ARequires the following library:%0A * requests%0A%0AParameters:%0A * hipchat.token: HipChat user access token, the token needs to have the 'View Messages' scope.%0A * hipchat.interval: Refresh interval in minutes (defaults ...
786ed1d37ae5285bce1178d401d487233d4bd5b1
Add greater/less than tests
test/osa_tests.py
test/osa_tests.py
Python
0.000001
@@ -0,0 +1,1171 @@ +#!/usr/bin/env python%0A# Copyright 2016, Rackspace US, Inc.%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...
0a3488915938de418ab0675f4cc051769b470927
Fix tab switching test on reference builds.
tools/perf/measurements/tab_switching.py
tools/perf/measurements/tab_switching.py
# Copyright 2013 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. """The tab switching measurement. This measurement opens pages in different tabs. After all the tabs have opened, it cycles through each tab in sequence, an...
Python
0.998504
@@ -868,16 +868,96 @@ mation') +%0A options.AppendExtraBrowserArg('--reduce-security-for-dom-automation-tests') %0A%0A def
01d9134067852a1f9dfecf75f730f9fba14434e0
Add test_gradient_checker.py
python/paddle/v2/framework/tests/test_gradient_checker.py
python/paddle/v2/framework/tests/test_gradient_checker.py
Python
0.000005
@@ -0,0 +1,1469 @@ +import unittest%0Aimport numpy%0Afrom paddle.v2.framework.op import Operator%0Afrom gradient_checker import GradientChecker%0Afrom gradient_checker import get_numeric_gradient%0A%0A%0Aclass GetNumericGradientTest(unittest.TestCase):%0A def test_add_op(self):%0A add_op = Operator('add_two',...
9779fc585d8d8d87580a47139742eb25bc52facd
Add new decorators module, move deprecated from utils over here
kiwi/decorators.py
kiwi/decorators.py
Python
0
@@ -0,0 +1,1889 @@ +#%0A# Kiwi: a Framework and Enhanced Widgets for Python%0A#%0A# Copyright (C) 2005 Async Open Source%0A#%0A# This library is free software; you can redistribute it and/or%0A# modify it under the terms of the GNU Lesser General Public%0A# License as published by the Free Software Foundation; either%0...
9258451157de31f3ece7e18fcb8ae43c433239f4
add example to post files to Portals File System
portals_api/upload_files_to_portals_file_system.py
portals_api/upload_files_to_portals_file_system.py
Python
0
@@ -0,0 +1,1300 @@ +# Example that uploads a file to the Portals File System using Portals API%0A# Access Level- Portals Domain Administrator%0A# Note: Uses Python 'Requests' module for calling API%0A# APIs:%0A# - http://docs.exosite.com/portals/#update-file-content%0A%0A%0Aimport requests%0Aimport getpass%0A%0Adirecto...
425d8ef0f439e9580c85e0dc04e5fe0c93cffddf
add 16
p016.py
p016.py
Python
0.999998
@@ -0,0 +1,185 @@ +# 2**15 = 32768 and the sum of its digits is 3+2+7+6+8=26%0A# what is the sum of the digits of the number 2**1000?%0A%0Adef f(n):%0A return sum(%5B int(c) for c in str(2**n)%5D)%0A%0Aprint f(1000)%0A%0A
2b73467ccfbf6e29047223f1c1e3250916b6ffdb
add 23
p023.py
p023.py
Python
0.999986
@@ -0,0 +1,397 @@ +from itertools import combinations_with_replacement%0A%0A%0Adef divisors(n):%0A r = set()%0A for i in range(1, n / 2):%0A if n %25 i == 0:%0A r.add(i)%0A r.add(n / i)%0A r.discard(n)%0A return r%0A%0Aabundant = filter(lambda n: sum(divisors(n)) %3E n, range(2,...
351f2779549add63963d4103fbe1b058dde59d85
Add stupid test to make Jenkins happy.
zipline/test/test_sanity.py
zipline/test/test_sanity.py
Python
0.000006
@@ -0,0 +1,184 @@ +from unittest2 import TestCase%0A%0Aclass TestEnviroment(TestCase):%0A%0A def test_universe(self):%0A # first order logic is working today. Yay!%0A self.assertTrue(True != False)%0A
67f5e754a5f90903e09a6a876d858d002c513f8a
Add initial draft of posterior models
abcpy/posteriors.py
abcpy/posteriors.py
Python
0
@@ -0,0 +1,1860 @@ +import scipy as sp%0A%0Afrom .utils import stochastic_optimization%0A%0Aclass BolfiPosterior():%0A%0A def __init__(self, model, threshold, priors=None):%0A self.threshold = threshold%0A self.model = model%0A self.priors = %5BNone%5D * model.n_var%0A self.ML, ML_val = s...
8131bb276a467d7df00f7452616869d20d312eb7
add api_view test
apps/api/tests/tests_view.py
apps/api/tests/tests_view.py
Python
0
@@ -0,0 +1,1904 @@ +import datetime%0Afrom django.test import TestCase%0Afrom django.test.client import Client%0Afrom apps.pages.models import Page, Page_translation%0A%0A%0Aclass MySmileApiTestCase(TestCase):%0A def setUp(self):%0A some_page = Page.objects.create(id=1,%0A slug='index',...
6104fdc57931151f6cf3c8cd517f5efee17fe826
Update repost_stock_for_deleted_bins_for_merging_items.py
erpnext/patches/v7_1/repost_stock_for_deleted_bins_for_merging_items.py
erpnext/patches/v7_1/repost_stock_for_deleted_bins_for_merging_items.py
from __future__ import unicode_literals import frappe from erpnext.stock.stock_balance import repost_stock def execute(): frappe.reload_doc('manufacturing', 'doctype', 'production_order_item') modified_items = frappe.db.sql_list(""" select name from `tabItem` where is_stock_item=1 and modified >= '2016-10-31'...
Python
0
@@ -188,16 +188,83 @@ _item')%0A +%09frappe.reload_doc('manufacturing', 'doctype', 'production_order')%0A %09%0A%09modif
142ec5bdca99d11236f2d479cf4dafbc7e8962a3
test of the nis module
Lib/test/test_nis.py
Lib/test/test_nis.py
Python
0
@@ -0,0 +1,362 @@ +import nis%0A%0Averbose = 0%0Aif __name__ == '__main__':%0A verbose = 1%0A%0Amaps = nis.maps()%0Afor nismap in maps:%0A if verbose:%0A%09print nismap%0A mapping = nis.cat(nismap)%0A for k, v in mapping.items():%0A%09if verbose:%0A%09 print ' ', k, v%0A%09if not k:%0A%09 continue%...
a35a6b715670e985c0bd711a4cb55df2a267e018
Create downloader.py
3.下载缓存/downloader.py
3.下载缓存/downloader.py
Python
0.000001
@@ -0,0 +1,3230 @@ +import urlparse%0Aimport urllib2%0Aimport random%0Aimport time%0Afrom datetime import datetime, timedelta%0Aimport socket%0A%0A%0ADEFAULT_AGENT = 'wswp'%0ADEFAULT_DELAY = 5%0ADEFAULT_RETRIES = 1%0ADEFAULT_TIMEOUT = 60%0A%0A%0Aclass Downloader:%0A def __init__(self, delay=DEFAULT_DELAY, user_agent...
6bf4f7491bdfe8a5afd5eb8cdb4a8fcb2af78b36
Add commands/findCognateClassesCrossingMeanings.py
ielex/lexicon/management/commands/findCognateClassesCrossingMeanings.py
ielex/lexicon/management/commands/findCognateClassesCrossingMeanings.py
Python
0
@@ -0,0 +1,950 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals, print_function%0A%0Afrom collections import defaultdict%0A%0Afrom django.core.management import BaseCommand%0A%0Afrom ielex.lexicon.models import CognateJudgement, Lexeme%0A%0A%0Aclass Command(BaseCommand):%0A%0A help = %22Compiles...
d8eea29d2fd78f2f1e388de36f13cf6069fde974
switch ninupdates channel back to announcement since test works
addons/loop.py
addons/loop.py
import asyncio import copy import discord import feedparser import sys import time import datetime import traceback import os import json from discord.ext import commands from urllib.parse import urlparse, parse_qs class Loop: """ Loop events. """ def __init__(self, bot): self.bot = bot ...
Python
0
@@ -3690,36 +3690,45 @@ essage(self.bot. -meta +announcements _channel, '%E2%8F%AC Sys @@ -3961,36 +3961,45 @@ essage(self.bot. -meta +announcements _channel, '%E2%8F%AC Sys @@ -4558,12 +4558,21 @@ bot. -meta +announcements _cha
b7dd7f75f655f4fbcb34d8f9ec260a6f18e8f617
Add utility to create administrative users.
backend/scripts/adminuser.py
backend/scripts/adminuser.py
Python
0
@@ -0,0 +1,1632 @@ +#!/usr/bin/env python%0Aimport rethinkdb as r%0Afrom optparse import OptionParser%0Aimport sys%0A%0A%0Adef create_group(conn):%0A group = %7B%7D%0A group%5B'name'%5D = %22Admin Group%22%0A group%5B'description'%5D = %22Administration Group for Materials Commons%22%0A group%5B'id'%5D = 'a...
8d32947304d72a13ed8e27d41d35028a904072e9
Add libpq package
libpq/conanfile.py
libpq/conanfile.py
Python
0.000001
@@ -0,0 +1,1504 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools%0Aimport os%0A%0Aclass LibpqConn(ConanFile):%0A name = %22libpq%22%0A version = %229.6.3%22%0A license = %22PostgreSQL license https://www.postgresql.org/about/licence/%22%0A url = %22https://github.com/trigger-happy/conan-pa...
e59c03f0bad78c9cb1db86f2fb0ac29009c8474e
add rll
reverse-linked-list.py
reverse-linked-list.py
Python
0.000001
@@ -0,0 +1,483 @@ +# https://leetcode.com/problems/reverse-linked-list/%0A%0A# Definition for singly-linked list.%0Aclass ListNode:%0A def __init__(self, x):%0A self.val = x%0A self.next = None%0A%0Aclass Solution:%0A # @param %7BListNode%7D head%0A # @return %7BListNode%7D%0A def reverseLi...
0c17398f68597eae175ad6a37945cf37e95e1809
Reset invalid default quotas for CloudServiceProjectLink [WAL-814]
nodeconductor/structure/migrations/0050_reset_cloud_spl_quota_limits.py
nodeconductor/structure/migrations/0050_reset_cloud_spl_quota_limits.py
Python
0
@@ -0,0 +1,924 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.contrib.contenttypes import models as ct_models%0Afrom django.db import migrations, models%0A%0Afrom nodeconductor.quotas.models import Quota%0Afrom nodeconductor.structure.models import CloudServiceProjectLink%0A%0A%0...
63ae0b619ea50b1e234abc139becaeb84c703302
add player class
MellPlayer/player.py
MellPlayer/player.py
Python
0
@@ -0,0 +1,508 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A'''%0ANetease Music Player%0A%0ACreated on 2017-02-20%0A@author: Mellcap%0A'''%0A%0A%0Aclass Player(object):%0A%0A def __init__(self):%0A pass%0A%0A def start(self):%0A pass%0A%0A def pause(self):%0A pass%0A%0A def ...
602db58ff01ef7ea2718d713a5b2026377023b8d
Create context_processors.py
commons/context_processors.py
commons/context_processors.py
Python
0.000577
@@ -0,0 +1,303 @@ +from os import environ%0Afrom %7B%7B project_name %7D%7D import __version__%0Aimport uuid%0A%0A%0Adef metainfo(request):%0A metainfo = %7B %0A 'uuid': unicode(uuid.uuid4()),%0A 'version': __version__,%0A 'static_version': %22?v=%7B%7D%22.format(uuid),%0A 'branch': envir...
6ac6f936a12fcc1578db3fed629ec3a8bc471dcb
remove print
src/you_get/extractor/acfun.py
src/you_get/extractor/acfun.py
#!/usr/bin/env python __all__ = ['acfun_download'] from ..common import * from .qq import qq_download_by_id from .sina import sina_download_by_vid from .tudou import tudou_download_by_iid from .youku import youku_download_by_vid import json, re def get_srt_json(id): url = 'http://comment.acfun.com/%s.json' % i...
Python
0.000001
@@ -894,44 +894,8 @@ u':%0A - print(sourceId, danmakuId)#%0A
4152b6a10610aa364e901f062a8611b94f65b3de
Create e.py
at/abc126/e.py
at/abc126/e.py
Python
0.000001
@@ -0,0 +1,524 @@ +# %E5%B9%B6%E6%9F%A5%E9%9B%86%0Aread = input%0An, m = map(int, read().split())%0Af = %5B-1 for i in range(n + 1)%5D # 1 ~ n%0Adef find(x):%0A if f%5Bx%5D%3C0:%0A return x%0A else :%0A f%5Bx%5D = find(f%5Bx%5D)%0A return f%5Bx%5D%0Afor i in range(m):%0A x,y,z = map(int, r...
2057ebd9bae44b232b133ca0c0f76e11d4ca3b5f
Add missing file
conary/server/wsgi_adapter.py
conary/server/wsgi_adapter.py
Python
0.000006
@@ -0,0 +1,1793 @@ +#%0A# Copyright (c) rPath, Inc.%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation, either version 3 of the License, or%0A# (at your option) any later version.%0A#%0A# ...
aef33a2c8f34d164bba18741a3cf6e5b71a60a99
Add stub file for extract_csv.py
extract_csv.py
extract_csv.py
Python
0.000001
@@ -0,0 +1,153 @@ +def extract_csv(filename):%0A%09# TODO: connect to sqlite database and extract a csv of the rows.%0A%09pass%0A%0A%0Aif __name__ == '__main__':%0A%09extract_csv('data.csv')
f99eb9a2397f571f045f6a5f663a42878e94b3ea
Create Euler_003.py
Euler_003.py
Euler_003.py
Python
0.000169
@@ -0,0 +1,110 @@ +#%0Ax, num = 2, 600851475143%0Awhile num != x:%0A if num %25 x == 0: num = num / x; x = 2%0A else: x += 1%0Aprint x%0A
1072b8e28e75cf41a35302c9febd1ec22473e966
Add code/analyse_chain_growth.py
code/analyse_chain_growth.py
code/analyse_chain_growth.py
Python
0.000111
@@ -0,0 +1,1704 @@ +#!/usr/bin/env python%0A%0Aimport sys%0Aimport os%0Aimport os.path%0A%0Aimport argparse%0A%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument('dirs', type=str, nargs='+',%0A help='directories containing simulation files')%0Aparser.add_argument('--rate', type=float, default...
bd15388aa877f32ebc613511ad909b311ed3bcf0
Add tests
sympy/concrete/tests/test_dispersion.py
sympy/concrete/tests/test_dispersion.py
Python
0.000001
@@ -0,0 +1,1122 @@ +from sympy.core import Symbol, S, oo%0Afrom sympy.concrete.dispersion import *%0A%0A%0Adef test_dispersion():%0A x = Symbol(%22x%22)%0A%0A fp = S(0).as_poly(x)%0A assert sorted(dispersionset(fp)) == %5B0%5D%0A%0A fp = S(2).as_poly(x)%0A assert sorted(dispersionset(fp)) == %5B0%5D%0A%0...
6ed3b62efe24aa8aeaedd314bb4e472628713bac
Create deft_opportunist.py
tpdatasrc/tpgamefiles/scr/tpModifiers/deft_opportunist.py
tpdatasrc/tpgamefiles/scr/tpModifiers/deft_opportunist.py
Python
0.001698
@@ -0,0 +1,586 @@ +#Deft Opportunist: Complete Adventurer, p. 106%0A%0Afrom templeplus.pymod import PythonModifier%0Afrom toee import *%0Aimport tpdp%0A%0Aprint %22Registering Deft Opportunist%22%0A%0Adef DOAOO(attachee, args, evt_obj):%0A%0A%09if attachee.has_feat(%22Deft Opportunist%22) != 0:%0A%09%09#Check if it's ...
52f8daf63644fde1efd1c132d6b02ac6670ef0a4
Add migrations merge
temba/channels/migrations/0038_merge.py
temba/channels/migrations/0038_merge.py
Python
0.000001
@@ -0,0 +1,299 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('channels', '0037_auto_20160905_1537'),%0A ('channels', '0033_auto_20160623_1438'),%0A %5D%0A...
1b538aba890c8a81fc7bf66f2c35519608fbd6be
Create drivers.py
chips/analog/mock/drivers.py
chips/analog/mock/drivers.py
Python
0.000001
@@ -0,0 +1,107 @@ +# This code has to be added to the corresponding __init__.py%0A%0ADRIVERS%5B%22analogmock%22%5D = %5B%22ANALOG%22, %22PUUM%22%5D%0A
528de5a29d7beb743e5e80775a349f931e71262f
add test that triggers previous error
test/workflows/test_base.py
test/workflows/test_base.py
Python
0
@@ -0,0 +1,499 @@ +import json%0Aimport fmriprep.workflows.base as base%0Aimport re%0Aimport unittest%0Aimport mock%0A%0Aclass TestBase(unittest.TestCase):%0A%0A def test_fmri_preprocess_single(self):%0A ''' Tests that it runs without errors '''%0A # NOT a test for correctness%0A # SET UP INPUTS...
0e02a9de3599e726b5a4dffd17f92a0cd0d2aaee
add import script for Wyre
polling_stations/apps/data_collection/management/commands/import_wyre.py
polling_stations/apps/data_collection/management/commands/import_wyre.py
Python
0
@@ -0,0 +1,385 @@ +from data_collection.management.commands import BaseXpressWebLookupCsvImporter%0A%0Aclass Command(BaseXpressWebLookupCsvImporter):%0A council_id = 'E07000128'%0A addresses_name = 'WyrePropertyPostCodePollingStationWebLookup-2017-03-08 2.CSV'%0A stations_name = 'WyrePropertyPostCodePo...
4e9ecd13cedc069e53e6acc941f643ad0f8cf6b0
fix cleanup command
corehq/apps/callcenter/management/commands/remove_callcenter_form_data.py
corehq/apps/callcenter/management/commands/remove_callcenter_form_data.py
from __future__ import print_function from optparse import make_option from django.core.management.base import BaseCommand from sqlalchemy.engine import create_engine from sqlalchemy.orm.session import sessionmaker from corehq.apps.callcenter.utils import get_call_center_domains, get_or_create_mapping from ctable.model...
Python
0.000006
@@ -1100,17 +1100,17 @@ get('all -- +_ tables', @@ -1163,17 +1163,17 @@ get('all -- +_ mappings @@ -1376,16 +1376,57 @@ E_URL)%0A%0A + extractor = get_extractor('SQL')%0A @@ -1717,24 +1717,24 @@ table_name)%0A + @@ -1757,71 +1757,8 @@ un:%0A - extractor = get_ext...
b14fb988321076f4cf17cebec7635fd209e08465
Create video.py
client/video.py
client/video.py
Python
0.000001
@@ -0,0 +1,334 @@ +# Capture video with OpenCV%0A%0Aimport numpy as np%0Aimport cv2%0Aimport time %0A%0Acap = cv2.VideoCapture('serenity.mp4')%0A%0Awhile(cap.isOpened()):%0A%0A%09ret, frame = cap.read()%0A%0A%09# time.sleep(.25)%0A%0A%09cv2.rectangle(frame,(384,0),(510,128),(0,255,0),3)%0A%09%0A%09cv2.imshow('frame',fr...
18a356c9fa49f32627481f312b03aa34ff711456
Revert "Define the tests as grpc_cc_test to automatically test against all po…"
test/core/bad_client/generate_tests.bzl
test/core/bad_client/generate_tests.bzl
#!/usr/bin/env python2.7 # Copyright 2015 gRPC authors. # # 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 la...
Python
0
@@ -680,81 +680,8 @@ %22%22%0A%0A -load(%22//bazel:grpc_build_system.bzl%22, %22grpc_cc_test%22, %22grpc_cc_library%22)%0A %0Adef @@ -1194,21 +1194,23 @@ ts():%0A -grpc_ +native. cc_libra @@ -1464,21 +1464,23 @@ ():%0A -grpc_ +native. cc_test(
59ac83e45116a97cfbdd7522f967337e73d51766
add cargo deny test
tests/integration_tests/build/test_dependencies.py
tests/integration_tests/build/test_dependencies.py
Python
0
@@ -0,0 +1,649 @@ +# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A# SPDX-License-Identifier: Apache-2.0%0A%22%22%22Enforces controls over dependencies.%22%22%22%0A%0Aimport os%0Aimport framework.utils as utils%0A%0A%0Adef test_licenses():%0A %22%22%22Ensure license compatibility for Fire...
c3f01d8b365e6d367b1a565e5ce59cf04eb1bac3
fix build
get_version.py
get_version.py
Python
0.000001
@@ -0,0 +1,129 @@ +%22%22%22Return the short version string.%22%22%22%0Afrom mpfmonitor._version import __short_version__%0Aprint(%22%7B%7D.x%22.format(__short_version__))%0A
15d3692aee84432b6b7f8306505b3f59649fd6f9
Remove mimetype from the module_files table
cnxarchive/sql/migrations/20160128111115_mimetype_removal_from_module_files.py
cnxarchive/sql/migrations/20160128111115_mimetype_removal_from_module_files.py
Python
0.000001
@@ -0,0 +1,1578 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%5C%0A- Move the mimetype value from %60%60module_files%60%60 to %60%60files%60%60.%0A- Remove the %60%60mimetype%60%60 column from the %60%60module_files%60%60 table.%0A%0A%22%22%22%0Afrom __future__ import print_function%0Aimport sys%0A%0A%0Adef up(cursor):%0A ...
67b5cd3f00ca57c4251dab65c5a6e15ab2be8a42
Create result.py
aiorucaptcha/result.py
aiorucaptcha/result.py
Python
0.000002
@@ -0,0 +1,165 @@ +class ResultObject:%0A%0A def __init__(self, code, task_id):%0A self.code = code%0A self.task_id = task_id%0A%0A def __str__(self):%0A return self.code%0A
4a7a15359763cbd6956bd30bde7cd68b05b2b4a2
test _compare_and_pop_smallest
tests/test_huffman_codes.py
tests/test_huffman_codes.py
Python
0.00006
@@ -0,0 +1,1393 @@ +import sys%0Aimport os%0Asys.path.append(os.path.abspath(os.path.dirname(__file__) + '../..'))%0Aimport unittest%0Afrom huffman_codes import huffman_codes, Node, Queue, _compare_and_pop_smallest, %5C%0A _traverse_children_and_assign_codes%0A%0A%0Aclass TestHuffmanCodes(unitt...
57112cdb9f4e47bba11978dc0569d6dfb45f15eb
Update cybergis-script-burn-alpha.py
bin/cybergis-script-burn-alpha.py
bin/cybergis-script-burn-alpha.py
#!/usr/bin/python2.7 import sys import os import threading import time import Queue import struct import numpy import struct import gdal import osr import gdalnumeric from gdalconst import * class RenderThread(threading.Thread): def __init__(self, threadID, threadName, queue): threading.Thr...
Python
0
@@ -3008,16 +3008,20 @@ hread %22+ +str( threadID @@ -3021,16 +3021,17 @@ hreadID) +) , workQu
d20b03daaf1824ea4b032ac3ea5cb5f087016b49
Fix some styles
bluebottle/collect/serializers.py
bluebottle/collect/serializers.py
from rest_framework.serializers import ModelSerializer from rest_framework_json_api.relations import ( ResourceRelatedField, SerializerMethodResourceRelatedField ) from bluebottle.activities.utils import ( BaseActivitySerializer, BaseActivityListSerializer, BaseContributorSerializer ) from bluebottle.blueb...
Python
0.000429
@@ -950,16 +950,40 @@ bjects,%0A + required=False,%0A @@ -4943,24 +4943,25 @@ /contributor +s '%0A in @@ -5670,24 +5670,16 @@ collect/ -collect- contribu
3f84a3cb50e18ce9df96a9173d0be180633aad0d
Add polynomial learning example
Examples/polynomial_approximation.py
Examples/polynomial_approximation.py
Python
0.01065
@@ -0,0 +1,1226 @@ +%22%22%22%0AExample of neural network learning a polynomial equation. Test polynomial is f(x) = (6x%5E2 + 3x) %C3%B7 (3x)%0A%0ATraining is run on x values from 1.0 to 100.0%0A%22%22%22%0Afrom mazex import MazeX%0Aimport numpy as np%0Aimport random%0Aimport math%0Aimport matplotlib.pyplot as plt%0A%0...
abe40e3c82ef1f351275a59b2e537f43530caa0c
Clean up db script (remove articles older than two days).
app/cleanup_stories.py
app/cleanup_stories.py
Python
0
@@ -0,0 +1,629 @@ +from pymongo import MongoClient%0Afrom fetch_stories import get_mongo_client, close_mongo_client%0Afrom bson import ObjectId%0Afrom datetime import datetime, timedelta%0A%0Adef remove_old_stories():%0A client = get_mongo_client()%0A db = client.get_default_database()%0A article_collectio...
ba590d28810409fa57783e6d29a651790f865e5c
create base api exceptions module
apps/api/exceptions.py
apps/api/exceptions.py
Python
0
@@ -0,0 +1,697 @@ +import json%0A%0Afrom tastypie.exceptions import TastypieError%0Afrom tastypie.http import HttpResponse%0A%0A%0Aclass CustomBadRequest(TastypieError):%0A %22%22%22%0A This exception is used to interrupt the flow of processing to immediately%0A return a custom HttpResponse.%0A %22%22%22%0A...
b1a5764956e0f569b4955dbf43e5656873c903f6
Create new package. (#7649)
var/spack/repos/builtin/packages/soapdenovo-trans/package.py
var/spack/repos/builtin/packages/soapdenovo-trans/package.py
Python
0
@@ -0,0 +1,2237 @@ +##############################################################################%0A# Copyright (c) 2013-2018, 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...
402004b1a0612e5b4eeb703f3787dd1b7f3def30
make auto migration
yandex_kassa/migrations/0004_auto_20151209_0940.py
yandex_kassa/migrations/0004_auto_20151209_0940.py
Python
0.000001
@@ -0,0 +1,1036 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('yandex_kassa', '0003_auto_20151116_1530'),%0A %5D%0A%0A operations = %5B%0A migrations.A...
7ec4133b11ba91541e9ec9895e39a2c402c63087
define the AVB loss separately
avb/models/avb_loss.py
avb/models/avb_loss.py
Python
0
@@ -0,0 +1,1717 @@ +import keras.backend as ker%0Afrom keras.layers import Layer%0Afrom keras.losses import categorical_crossentropy%0A%0A%0Aclass AVBLossLayer(Layer):%0A def __init__(self, **kwargs):%0A self.is_placeholder = True%0A super(AVBLossLayer, self).__init__(**kwargs)%0A%0A @staticmethod%0...
0c3b3ff095af2ccf6c3891a99170c982b1639f4e
test pickle retention adapted.
test/test_module_pickle_retention.py
test/test_module_pickle_retention.py
#!/usr/bin/env python2.6 #Copyright (C) 2009-2010 : # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # #This file is part of Shinken. # #Shinken 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 Fr...
Python
0
@@ -900,16 +900,17 @@ port os%0A +%0A from shi @@ -928,16 +928,18 @@ mport *%0A +%0A%0A sys.path @@ -968,16 +968,55 @@ dules%22)%0A +import pickle_retention_file_scheduler%0A from pic @@ -1053,16 +1053,247 @@ mport *%0A +from module import Module%0A%0Amodconf = Module()%0Amodconf.module_name = %22PickleRetention...
fd54c28be8d9ffd7e5711035bf5b5e1b7fe332cc
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ab2e190c2bfe60b3b738c125ca9db1a2785cdcaa.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "285e48bc47db23a479637fd1e2767b9a35dc2c9b" TFRT_SHA256 = "6f0067d0cb7bb407caeef060603b6e33f1231cddf1ce4c...
Python
0.000003
@@ -210,133 +210,133 @@ = %22 -285e48bc47db23a479637fd1e2767b9a35dc2c9b%22%0A TFRT_SHA256 = %226f0067d0cb7bb407caeef060603b6e33f1231cddf1ce4ce2ebce027dc418764f +ab2e190c2bfe60b3b738c125ca9db1a2785cdcaa%22%0A TFRT_SHA256 = %22b097063dd10c010e827e58cc8e5a0e4008d99bcba1dcb20259c8ef890620b9b5 %22%0A%0A
c9c00a6a5ab267ab56dd147e6542cae6566061d8
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/dc109b725d8f36f8c7db7847f0c95a819c43f9e9.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "4bcf968d66a6bb2899b9d99917b916f6ec04c327" TFRT_SHA256 = "9bd2cc2e7003f73f767e138ae477...
Python
0.000001
@@ -228,133 +228,133 @@ = %22 -4bcf968d66a6bb2899b9d99917b916f6ec04c327%22%0A TFRT_SHA256 = %229bd2cc2e7003f73f767e138ae4776b43d15ca286f0f85ad374ec5f8aaeab1aa4 +dc109b725d8f36f8c7db7847f0c95a819c43f9e9%22%0A TFRT_SHA256 = %22e6a6359ecd731f7208f32402fac9bf874b26855497c0252fcddc44e5133320df %22%0A%0A
d81a2b0328c86165b09c2d41aa2a4684c75388cd
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/78537f15f4873bbed59258bed4442225303f462a.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "a2f5e07760d2a888370d0686546b757ee9628494" TFRT_SHA256 = "70653b94faa603befef83457482c...
Python
0
@@ -228,133 +228,133 @@ = %22 -a2f5e07760d2a888370d0686546b757ee9628494%22%0A TFRT_SHA256 = %2270653b94faa603befef83457482c8a1151fa529b3215124e18a0f97592d5ad05 +78537f15f4873bbed59258bed4442225303f462a%22%0A TFRT_SHA256 = %2287526ed2a287d7809b2cadf82f9db94994b0019635d431f2fc9c3db2bd4a31cc %22%0A%0A
8c1b20941c1216bb56fa55fe881962d2ea883366
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/c68238f982305e3618a2b5347e1e0a5663898c90.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "377c20166e8e1b5124493c1433b1df34ca62cf3f" TFRT_SHA256 = "f0c3c03e7d9ca2e10c3256f28bf9c0aa0aa26d9aa4da53...
Python
0.000002
@@ -210,133 +210,133 @@ = %22 -377c20166e8e1b5124493c1433b1df34ca62cf3f%22%0A TFRT_SHA256 = %22f0c3c03e7d9ca2e10c3256f28bf9c0aa0aa26d9aa4da539c00532ee5217ba7ba +c68238f982305e3618a2b5347e1e0a5663898c90%22%0A TFRT_SHA256 = %22b28ed95058c101a9d3203ddbaa271044de984f6b49c5609124e1cb4ae0b3e165 %22%0A%0A
5a8fde172f0fc7aff841e8059927ff126712b321
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/feffe7beb261f6dfe9af083e8f46dfea293ded54.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "509cf2f10beb666002ece6a7b968fe2c7c0c1e4b" TFRT_SHA256 = "14b22d39d3eebcf255e4dd8ee8630b4da3ecc786f5053a...
Python
0.000005
@@ -210,133 +210,133 @@ = %22 -509cf2f10beb666002ece6a7b968fe2c7c0c1e4b%22%0A TFRT_SHA256 = %2214b22d39d3eebcf255e4dd8ee8630b4da3ecc786f5053adf9c94a2e42362ee0c +feffe7beb261f6dfe9af083e8f46dfea293ded54%22%0A TFRT_SHA256 = %22830492c8a9884e5ca84b15a4da953491f74b2ffbd45656352d58b624e881b9b7 %22%0A%0A
e42862ce7bde45e90bec0980f3c35c5cef5c65b6
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/47a1de40f17e70f901238edfe99dc510a5db797a.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "033f079420053002701271e4173bdcaf21bd1b73" TFRT_SHA256 = "15c1c5a3617b91322d4ef96ce884676d27164cf94211f8...
Python
0.000002
@@ -210,133 +210,133 @@ = %22 -033f079420053002701271e4173bdcaf21bd1b73%22%0A TFRT_SHA256 = %2215c1c5a3617b91322d4ef96ce884676d27164cf94211f83bc1fcec50ab96aad4 +47a1de40f17e70f901238edfe99dc510a5db797a%22%0A TFRT_SHA256 = %2287631491c3fdd34b4d00b6999274468b89a98f23113aeafa15b53c3a7517fc36 %22%0A%0A
a6cc742a7272d1138031e26c61fd10617e6b0ac1
Initialize transpositionTest
books/CrackingCodesWithPython/Chapter09/transpositionTest.py
books/CrackingCodesWithPython/Chapter09/transpositionTest.py
Python
0.000001
@@ -0,0 +1,1442 @@ +# Transposition Cipher Test%0A# https://www.nostarch.com/crackingcodes/ (BSD Licensed)%0A%0Aimport random, sys, transpositionEncrypt, transpositionDecrypt%0A%0Adef main():%0A random.seed(42) # Set the random %22seed%22 to a static value.%0A%0A for i in range(20): # Run 20 tests.%0A #...
1c7daf0bd9801885d7740620b3e81faa03ce49d4
add sign/verify json tests
test/crypto/olm_device_test.py
test/crypto/olm_device_test.py
Python
0.000001
@@ -0,0 +1,2768 @@ +from copy import deepcopy%0A%0Afrom matrix_client.client import MatrixClient%0Afrom matrix_client.crypto.olm_device import OlmDevice%0A%0AHOSTNAME = 'http://example.com'%0A%0A%0Aclass TestOlmDevice:%0A cli = MatrixClient(HOSTNAME)%0A user_id = '@user:matrix.org'%0A device_id = 'QBUAZIFURK'%...
c4ffd77a56e09f3b418e6d13e8339fe693fffbdb
add fasd_cleanup script
misc/fasd_clean.py
misc/fasd_clean.py
Python
0
@@ -0,0 +1,1524 @@ +#/usr/bin/env python%0A# Copyright (C) 2015 Ratheesh S%3Cratheeshreddy@gmail.com%3E%0A%0A# This program is free software; you can redistribute it and/or%0A# modify it under the terms of the GNU General Public License%0A# as published by the Free Software Foundation; either version 2%0A# of the Lice...
2a45679c02e74ce7a63e259b1475d4190086084e
Add errors to zombase
zombase/errors.py
zombase/errors.py
Python
0.000001
@@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*-%0Aclass ZombaseRuntimeError(Exception):%0A pass%0A
629c9e330e6114680f22af125252d95fb6989201
update migrations for link manager
webquills/linkmgr/migrations/0002_alter_linkcategory_site.py
webquills/linkmgr/migrations/0002_alter_linkcategory_site.py
Python
0
@@ -0,0 +1,545 @@ +# Generated by Django 3.2 on 2021-06-07 11:11%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('wqsites', '0001_initial'),%0A ('linkmgr', '0001_initial'),%0A %5D%0A%0A op...
24e2ddfd49aa2c05879460baeb67ed6cc75ffa87
fix benchmark script
benchmark/benchmark.py
benchmark/benchmark.py
from pyqg import qg_model, model import time import cProfile import pstats import numpy as np tmax = 104000000 dtfac = (64 * 8000.) mynx = [32, 64, 128, 256] res = np.zeros((len(mynx), 5)) for j, nx in enumerate(mynx): dt = dtfac / nx for i, (use_fftw, nth) in enumerate([(False, 1), (True, 1), (Tr...
Python
0.000007
@@ -1,36 +1,15 @@ -from pyqg import qg_model, model +import pyqg %0Aimp @@ -78,14 +78,14 @@ x = -104 +8 000 +*1 000%0A @@ -93,17 +93,16 @@ dtfac = -( 64 * 800 @@ -103,17 +103,16 @@ * 8000. -) %0A%0Amynx = @@ -133,41 +133,120 @@ 256 -%5D%0Ares = np.zeros((len(mynx), 5))%0A +, 512, 1024, 2048%5D%0Amynth = %5...
2347ee253f04fa87b28206b0ec00fd2a3fffb49f
Create hello_market_maker.py
hello_market_maker.py
hello_market_maker.py
Python
0.999986
@@ -0,0 +1,1848 @@ +class hello_market_maker():%0A def __init__(self, anchor_price, tick_increment, max_pos):%0A self.anchor_price = anchor_price%0A self.tick_increment = tick_increment%0A self.position = 0%0A self.upper_bound = anchor_price + ((max_pos + 1) * tick_increment)%0A self.lower_bound = ancho...
372f4a988411e48a0c50cdc74fb2a7f4e5abf052
Add a server identity test
tests/server-identity.py
tests/server-identity.py
Python
0.000001
@@ -0,0 +1,233 @@ +import nose%0Aimport requests%0A%0Aimport fixture%0A%0A%0A@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)%0Adef test_server_identity():%0A response = requests.get(fixture.url(%22/%22))%0A assert response.headers%5B%22server%22%5D == %22Tangelo%22%0A
19db4647257617992e9b195828baf39907cc5db1
Add tests for exit codes
tests/test_exit_codes.py
tests/test_exit_codes.py
Python
0
@@ -0,0 +1,583 @@ +%22%22%22Check that the CLI returns the appropriate exit code.%22%22%22%0A%0Aimport subprocess%0A%0A%0Adef test_exit_code_demo():%0A %22%22%22Ensure that linting the demo returns an exit code of 1.%22%22%22%0A try:%0A subprocess.check_output(%22proselint --demo%22, shell=True)%0A%0A e...
787298889fd85dffb597dee6571dead42227c7d6
add test to validate generated stub constants.pyi
tests/test_type_stubs.py
tests/test_type_stubs.py
Python
0
@@ -0,0 +1,1810 @@ +%22%22%22Test type stubs for correctness where possible.%22%22%22%0A%0Aimport os%0Aimport sys%0A%0Aimport pytest%0A%0Aimport xmlsec%0A%0Ablack = pytest.importorskip('black')%0A%0A%0Aif sys.version_info %3E= (3, 4):%0A from pathlib import Path%0Aelse:%0A from _pytest.pathlib import Path%0A%0A%0...
f3c9284bf7b5d9ae4acc413fd7feb824fdb7aca0
create field to exclude recomputation of old invoices
l10n_it_fatturapa_in/migrations/12.0.1.18.3/pre-migration.py
l10n_it_fatturapa_in/migrations/12.0.1.18.3/pre-migration.py
Python
0
@@ -0,0 +1,304 @@ +from openupgradelib import openupgrade%0A%0A%0A@openupgrade.migrate()%0Adef migrate(env, version):%0A if not version:%0A return%0A openupgrade.logged_query(%0A env.cr,%0A %22%22%22%0A ALTER TABLE fatturapa_attachment_in%0A ADD COLUMN IF NOT EXISTS invoices_date ch...
60068d4deeba541b9518579d6d8473c4300e189d
Test killing onitu during a transfer
tests/functional/test_crash.py
tests/functional/test_crash.py
Python
0
@@ -0,0 +1,1556 @@ +import os.path%0Afrom os import unlink%0A%0Afrom utils.launcher import Launcher%0Afrom utils.entries import Entries%0Afrom utils.loop import CounterLoop, BooleanLoop%0Afrom utils.files import generate, checksum%0Afrom utils.tempdirs import TempDirs%0A%0Alauncher = None%0Adirs = TempDirs()%0Arep1, re...
e541d2c6c9c71647201ad39eb8a774eabe243139
Add gaussian smoothing example (#485)
examples/01-filter/gaussian-smoothing.py
examples/01-filter/gaussian-smoothing.py
Python
0.000001
@@ -0,0 +1,1902 @@ +%22%22%22%0AGaussian smoothing%0A~~~~~~~~~~~~~~~~~~%0A%0APerform a gaussian convolution.%0A%0A%22%22%22%0Aimport pyvista as pv%0Afrom pyvista import examples%0A%0A# Load dataset%0Adata = examples.download_gourds()%0A%0A# Define a good point of view%0Acp = %5B%0A (319.5, 239.5, 1053.7372980874645)...
59d435ab1d0e5347180f60633d316aa7f2a3abdb
add send_TWH_text module to package
timutils/send_TWH_txt.py
timutils/send_TWH_txt.py
Python
0
@@ -0,0 +1,2041 @@ +%22%22%22%0Ashort module to send a text message to Tim Hilton's phone using%0AVerizon's email-to-sms support and gmail's smtp mail server. I was%0Aunable to get UC Merced's outlook.com server to accept the outgoing%0Amessage.%0A%0ATimothy W. Hilton, UC Merced, 25 Feb 2014%0A%22%22%22%0A%0Aimport sm...
2b4c065b986ca1e05d0755b2b64502861b17364d
add import script for Oldham
polling_stations/apps/data_collection/management/commands/import_oldham.py
polling_stations/apps/data_collection/management/commands/import_oldham.py
Python
0
@@ -0,0 +1,400 @@ +from data_collection.management.commands import BaseXpressCsvImporter%0A%0Aclass Command(BaseXpressCsvImporter):%0A council_id = 'E08000004'%0A addresses_name = 'OldhamPropertyPostCodePollingStationWebLookup-2017-02-16.TSV'%0A stations_name = 'OldhamPropertyPostCodePollingStationWebL...
1064b7bc9e343f3ab9308172f6a3129745e7a548
add test.py
test.py
test.py
Python
0.000012
@@ -0,0 +1,2146 @@ +#!/usr/bin/python%0Aimport smc%0Afrom pprint import pprint%0Aimport time%0Aimport logging%0A%0Alogger = logging.getLogger(__name__)%0A%0Asmc.login('http://172.18.1.150:8082', 'EiGpKD4QxlLJ25dbBEp20001')%0A%0A%0A#Example of using a search filter %0A#Response is a json record with a reference link to ...
fa2fd9cdab29a5736ae6b69c5f754f92a33c7f74
add wsgi.py
wsgi.py
wsgi.py
Python
0.00001
@@ -0,0 +1,64 @@ +from server import app%0A%0Aif __name__ == %22__main__%22:%0A app.run()
f4e12493c000b6bb3051e9c201347d420c8dd687
add basis for netcomp class
camoco/NetComp.py
camoco/NetComp.py
Python
0
@@ -0,0 +1,521 @@ +from .COB import COB%0A%0Aclass NetComp(Camoco):%0A%0A def __init__(self,name,networks):%0A self.networks = set()%0A%0A # Add all the networks%0A for n in networks:%0A self.add_network(n)%0A%0A def add_network(self,net):%0A '''%0A Add a network ...
b5d2b975e0566b90e6f52b9b3a4bf1b2e1fef8da
constrain tabled_committee_report.committee_id NOT NULL
migrations/versions/8cbc3d8dd55_add_soundcloudtrack_model.py
migrations/versions/8cbc3d8dd55_add_soundcloudtrack_model.py
Python
0.999995
@@ -0,0 +1,1731 @@ +%22%22%22Add SoundcloudTrack model%0A%0ARevision ID: 8cbc3d8dd55%0ARevises: 17570e7e200b%0ACreate Date: 2016-08-31 10:19:49.128041%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '8cbc3d8dd55'%0Adown_revision = '17570e7e200b'%0A%0Afrom alembic import op%0Aimport sqlalchemy ...
2a3b89f42cde7088b304a3f224eaf52894f544ec
Add an python example for stream testing
misc/utils/LSL_Tests/RecieveAppStatistics.py
misc/utils/LSL_Tests/RecieveAppStatistics.py
Python
0.000005
@@ -0,0 +1,612 @@ +%22%22%22Example program to show how to read a multi-channel time series from LSL.%22%22%22%0A%0Afrom pylsl import StreamInlet, resolve_stream%0Aimport sys%0A# first resolve an EEG stream on the lab network%0Aprint(%22looking for an Unity3D.AppStatistics stream...%22)%0Astreams = resolve_stream('type...
cfba5e1d10d39757b7b3ad31d9c224ae4499736c
fix decimal
netforce_account/netforce_account/models/account_tax_rate.py
netforce_account/netforce_account/models/account_tax_rate.py
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
Python
1
@@ -2110,25 +2110,34 @@ rate = -0 +Decimal(0) %0A @@ -2148,17 +2148,26 @@ _rate = -0 +Decimal(0) %0A
52c7d6ba8f6dcb6c6f1bd02790ab9bb7fae8ebcd
add script
scripts/grabBAMrecs.py
scripts/grabBAMrecs.py
Python
0.000003
@@ -0,0 +1,2128 @@ +#!/usr/bin/env python%0A%0Aimport sys%0Aimport pysam%0Aimport os%0Aimport re%0A%0Afrom collections import defaultdict as dd%0A%0Aimport logging%0Alogger = logging.getLogger(__name__)%0AFORMAT = '%25(asctime)s %25(message)s'%0Alogging.basicConfig(format=FORMAT)%0Alogger.setLevel(logging.INFO)%0A%0A%0...
6ad72a0c624abdda0df8d5c49366bfc597a12340
Add tests for utils experiment module
cptm/tests/test_utils_experiment.py
cptm/tests/test_utils_experiment.py
Python
0
@@ -0,0 +1,2314 @@ +from nose.tools import assert_equal, assert_false%0A%0Afrom os import remove%0Afrom os.path import join%0Afrom json import dump%0A%0Afrom cptm.utils.experiment import load_config, add_parameter, thetaFileName, %5C%0A topicFileName, opinionFileName, tarFileName, experimentName%0A%0A%0Adef setup():...
f73800f8e4ccd76d858c08d8cc8a72a6f2274fb6
Validate settings a tad later
mopidy/__main__.py
mopidy/__main__.py
import logging import multiprocessing import optparse import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))) from mopidy import get_version, settings, SettingsError from mopidy.core import CoreProcess from mopidy.utils import get_class from mopidy.utils.log import...
Python
0
@@ -515,17 +515,16 @@ tions = -_ parse_op @@ -531,16 +531,16 @@ tions()%0A + setu @@ -592,32 +592,9 @@ mp)%0A - settings.validate() %0A + @@ -630,16 +630,17 @@ dy --')%0A +%0A get_ @@ -670,16 +670,41 @@ pidy/')%0A + settings.validate()%0A%0A core @@ -1013,16 +1013,17 @@ start()%0A +%...
69b715ab99522967a6b1bb8f4abfc4f2b1e60912
check most of the analyzer code by importing the analyzer itself
tests/windows/test_analyzer.py
tests/windows/test_analyzer.py
Python
0
@@ -0,0 +1,314 @@ +# Copyright (C) 2017 Cuckoo Foundation.%0A# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org%0A# See the file 'docs/LICENSE' for copying permission.%0A%0Adef test_analyzer():%0A %22%22%22Simply imports the analyzer module to at least load most of the code.%22%22%22%0A import a...
4853257696373d248884efd1532af8a81c34ee93
Add LiveComposite creation helper script
tools/create_live_composite.py
tools/create_live_composite.py
Python
0
@@ -0,0 +1,2621 @@ +%0A%22%22%22%0A Helper script for cropping images and creating a RenPy LiveComposite for them.%0A Quite specific and mostly useful for processing images exported from a%0A rendering program like Blender or from Photoshop layers.%0A%0A Requires Pillow Python image processing library to be...
425ca8da6cb8300481aa82f99d26dedd5baf1076
Fix parsing of the first race report for ThreadSanitizer We've introduced a mistake recently which results in hiding the first race report. The reason was the "main thread" line which doesn't contain "{{{" and doesn't have context printed. Please note that after submitting of this CL ThreadSanitizer bots can become red...
tools/valgrind/tsan_analyze.py
tools/valgrind/tsan_analyze.py
#!/usr/bin/python # Copyright (c) 2006-2008 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. # tsan_analyze.py ''' Given a ThreadSanitizer output file, parses errors and uniques them.''' import gdb_helper import logging ...
Python
0.998272
@@ -2591,16 +2591,55 @@ .line_%5D%0A + if re.search(%22%7B%7B%7B%22, self.line_):%0A whil @@ -2676,24 +2676,26 @@ ne_):%0A + self.ReadLin @@ -2690,32 +2690,34 @@ self.ReadLine()%0A + if self.st @@ -2741,32 +2741,34 @@ s None:%0A + result.append(se @@ -2779,30 +2779,34 @@ ine_...
e94192a4c549e46ae0a155dbfa634ebde992903a
Create netntlm2hashcat.py
netntlm2hashcat.py
netntlm2hashcat.py
Python
0
@@ -0,0 +1,1663 @@ +#!/usr/bin/env python%0A%0Aimport sys%0Aimport re%0Aimport argparse%0A%0A# Arg Input (Like a pirate)%0Ap = argparse.ArgumentParser(description='Convert NetNTLM John Hashes to Hashcat Format')%0Ap.add_argument('-i','--hash',action='store_true',help='Enter one-time hash input mode',required=False)%0Ap...
e6e5fbb671c2539f4f82c6eaca51fbf400133482
Write a silly Python script to compute some hard coded info from the generated ARM match table, which is substantially more efficient than dealing with tblgen.
utils/Target/ARM/analyze-match-table.py
utils/Target/ARM/analyze-match-table.py
Python
0.000138
@@ -0,0 +1,2129 @@ +#!/usr/bin/env python%0A%0Adef analyze_match_table(path):%0A # Extract the instruction table.%0A data = open(path).read()%0A start = data.index(%22static const MatchEntry MatchTable%22)%0A end = data.index(%22%5Cn%7D;%5Cn%22, start)%0A lines = data%5Bstart:end%5D.split(%22%5Cn%22)%5B1...
5b2c1650059f9e4b69b6bab1d8ce88177f449e02
Add basic test for import
foyer/tests/test_external_forcefields.py
foyer/tests/test_external_forcefields.py
Python
0.000001
@@ -0,0 +1,144 @@ +import pytest%0A%0A%0Adef test_basic_import():%0A import foyer%0A assert 'external_forcefields' in dir(foyer)%0A import foyer.external_forcefields%0A