commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
2e467774d83e14baf6fb2fec1fa4e0f6c1f8f88d
Disable webrtc benchmark on Android
tools/perf/benchmarks/webrtc.py
tools/perf/benchmarks/webrtc.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from measurements import webrtc import page_sets from telemetry import benchmark @benchmark.Disabled('android') # crbug.com/390233 class WebRTC(benchmark....
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from measurements import webrtc import page_sets from telemetry import benchmark class WebRTC(benchmark.Benchmark): """Obtains WebRTC metrics for a real-...
Python
0.000005
d171d316eb45bdd6ce9d3a80c2ca91ae8b3cf1b2
Clarify how long a year is
tapiriik/auth/__init__.py
tapiriik/auth/__init__.py
from .payment import * from .totp import * from tapiriik.database import db from tapiriik.sync import Sync from datetime import datetime, timedelta from bson.objectid import ObjectId class User: def Get(id): return db.users.find_one({"_id": ObjectId(id)}) def Ensure(req): if req.user == None: ...
from .payment import * from .totp import * from tapiriik.database import db from tapiriik.sync import Sync from datetime import datetime, timedelta from bson.objectid import ObjectId class User: def Get(id): return db.users.find_one({"_id": ObjectId(id)}) def Ensure(req): if req.user == None: ...
Python
0.99958
d9e11e2c5f14cee0ead87ced9afe85bdd299ab35
Add python script to extract
extract_text.py
extract_text.py
import json f=open('raw.json') g=open('extracted1','a') i=1 for s in f: j=json.loads(s) j=j['text'] h=json.dumps(j) number=str(i) + ':' + ' ' g.write(h) g.write('\n\n') i=i+1
Python
0.000002
370d3a122fa0bfc4c6f57a5cd6e518968205611a
add another linechart example showing new features
examples/lineChartXY.py
examples/lineChartXY.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Examples for Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from nvd3 imp...
Python
0
170829465e30c69c13f2c5903e85ea4d79e8ae08
Add a drawing pad for testing. Need to further adding the message transmission
drawing_pad.py
drawing_pad.py
from PyQt4.QtCore import * from PyQt4.QtGui import * from PIL import Image import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar f...
Python
0
aa4a3011775c12c19d690bbca91a07df4e033b1f
add urls for admin, zinnia, and serving static files
src/phyton/urls.py
src/phyton/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static admin.autodiscover() urlpatterns = patterns('', # Admin URLs url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', inclu...
Python
0
b31def01a04a6ddb90e780985e43e8ad8e57e457
Create uber.py
modules/uber.py
modules/uber.py
def uber(self): self.send_chan("Moi")
Python
0.000036
27ab8b0436d784f44220512a91e699006b735d82
test mpi
tests/test_mpi.py
tests/test_mpi.py
# coding: utf-8 ierr = mpi_init() comm = mpi_comm_world print("mpi_comm = ", comm) size, ierr = mpi_comm_size(comm) print("mpi_size = ", size) rank, ierr = mpi_comm_rank(comm) print("mpi_rank = ", rank) #abort, ierr = mpi_abort(comm) #print("mpi_abort = ", abort) ierr = mpi_finalize()
Python
0.000001
2ad40dc0e7f61e37ab768bedd53572959a088bb0
Make app package
app/__init__.py
app/__init__.py
from flask import Flask def create_app(config_name): pass
Python
0
4981a1fa0d94020e20a8e7714af62a075f7d7874
delete customers
delete_customers.py
delete_customers.py
@app.route('/customers/<int:id>', methods=['DELETE']) def delete_customers(id): index = [i for i, customer in enumerate(customers) if customer['id'] == id] if len(index) > 0: del customers[index[0]] return make_response('', HTTP_204_NO_CONTENT)
Python
0
bc34aa231a3838ad7686541ed4bce58374a40b19
Create __init__.py
physt/__init__.py
physt/__init__.py
Python
0.000429
2b6c13f883a8e914a3f719447b508430c2d51e5a
Add Tower Label module (#21485)
lib/ansible/modules/web_infrastructure/ansible_tower/tower_label.py
lib/ansible/modules/web_infrastructure/ansible_tower/tower_label.py
#!/usr/bin/python #coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
Python
0
e93bbc1b5091f9b6d583437aea05aa59c8233d2d
add audiotsmcli
examples/audiotsmcli.py
examples/audiotsmcli.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ audiotsmcli ~~~~~~~~~~~ Change the speed of an audio file without changing its pitch. """ import argparse import os from audiotsm.ola import ola from audiotsm.io.wav import WavReader, WavWriter def main(): """Change the speed of an audio file without changing...
Python
0.000001
2b1dc56193f3a81e5aba237f3ad59aa9113dcb6e
Create ui.py
ui.py
ui.py
from visual import * from visual.controls import * import wx import scatterplot import ui_functions debug = True L = 320 Hgraph = 400 # Create a window. Note that w.win is the wxPython "Frame" (the window). # window.dwidth and window.dheight are the extra width and height of the window # compared to the display regio...
Python
0.000001
6dd52499de049d76a1bea5914f47dc5b6aae23d7
Add gspread example
xl.py
xl.py
#!/usr/bin/python #csv upload to gsheet import logging import json import gspread import time import re from oauth2client.client import SignedJwtAssertionCredentials from Naked.toolshed.shell import muterun_rb logging.basicConfig(filename='/var/log/gspread.log',format='%(asctime)s %(levelname)s:%(message)s',level=lo...
Python
0.000001
3e10a9fcb15e06699aa90016917b4ec5ec857faa
Solve task #506
506.py
506.py
class Solution(object): def findRelativeRanks(self, nums): """ :type nums: List[int] :rtype: List[str] """ def reverse_numeric(x, y): return y - x kek = sorted(nums, cmp=reverse_numeric) l = len(nums) if l > 0: nums[nums.index(k...
Python
0.999999
0040a9e9417ab8becac64701b3c4fc6d94410a21
Create Mc3.py
Mc3.py
Mc3.py
# -*- coding: utf-8 -*- """Mc3 module.""" import cmd2 from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, SourceUser, SourceGroup, SourceRoom, TemplateSendMessage, ConfirmTemplate, MessageTemplateAction, ButtonsTemplate, URITemplateAction, PostbackTemplateAction, CarouselTemp...
Python
0.000001
6c3867275693d4a771b9ff8df55aab18818344cd
add first app
app.py
app.py
import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloo...
Python
0.000001
8080153c65f4aa1d875a495caeee290fb1945081
Add migration
media_management_api/media_auth/migrations/0005_delete_token.py
media_management_api/media_auth/migrations/0005_delete_token.py
# Generated by Django 3.2.7 on 2021-09-15 20:00 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('media_auth', '0004_auto_20160209_1902'), ] operations = [ migrations.DeleteModel( name='Token', ), ]
Python
0.000002
40b0f1cd33a053be5ab528b4a50bda404f0756dc
Add managment command Add_images_to_sections
gem/management/commands/Add_images_to_sections.py
gem/management/commands/Add_images_to_sections.py
from __future__ import absolute_import, unicode_literals import csv from babel import Locale from django.core.management.base import BaseCommand from wagtail.wagtailimages.tests.utils import Image from molo.core.models import Languages, SectionPage, Main, SectionIndexPage class Command(BaseCommand): def add_argu...
Python
0.000003
69b900580e614ce494b9d1be0bee61464470cef7
Create 6kyu_digital_root.py
Solutions/6kyu_digital_root.py
Solutions/6kyu_digital_root.py
from functools import reduce def digital_root(n): while n>10: n = reduce(lambda x,y: x+y, [int(d) for d in str(n)]) return n
Python
0.000013
8a06b469642f02f7cf7a946e971f594bac1f02cd
Add testing initial gui file.
python2.7libs/CacheManager/temp_gui.py
python2.7libs/CacheManager/temp_gui.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- ## Description """ This file is not for releasing, just for testing. """ #------------------------------------------------------------------------------- import hou from PySide import QtCore from PySide import QtG...
Python
0
6c08f3d3441cf660de910b0f3c49c3385f4469f4
Add "Secret" channel/emoji example
examples/secret.py
examples/secret.py
import typing import discord from discord.ext import commands bot = commands.Bot(command_prefix=commands.when_mentioned, description="Nothing to see here!") # the `hidden` keyword argument hides it from the help command. @bot.group(hidden=True) async def secret(ctx: commands.Context): """What is this "secret" y...
Python
0.000003
e0338d39f611b2ca3f202151c49fc6a4b35bd580
Add WallBuilder
exercise/WallBuilder.py
exercise/WallBuilder.py
#!/usr/bin/env python3 class Block(object): def __init__(self, width, height, **attr): self.__width = width self.__height = height def __eq__(self, another): return (self.__width == another.__width) and \ (self.__height == another.__height) class Brick(Bl...
Python
0.000001
998b0b77b8d2ba247f92df74d24a7efdf5077e89
add expect_column_values_to_be_valid_ky_zip (#4730)
contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_kentucky_zip.py
contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_kentucky_zip.py
import json from typing import Optional import zipcodes from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.exceptions import InvalidExpectationConfigurationError from great_expectations.execution_engine import ( PandasExecutionEngine, SparkD...
Python
0
8a30bcc511647ed0c994cb2103dd5bed8d4671a8
Create B_Temperature.py
Cas_4/Temperature/B_Temperature.py
Cas_4/Temperature/B_Temperature.py
import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors import cartopy.crs as ccrs from xmitgcm import open_mdsdataset from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER plt.ion() dir0 = '/homedata/bderembl/runmit/test_southatlgyre3' ds0 = open_mdsdataset(dir0...
Python
0.998596
a70490e52bde05d2afc6ea59416a50e11119d060
Add migration for Comment schema upgrade. ...
raggregate/rg_migrations/versions/002_Add_metadata_to_Comment_to_allow_it_to_masquerade_as_epistle.py
raggregate/rg_migrations/versions/002_Add_metadata_to_Comment_to_allow_it_to_masquerade_as_epistle.py
from sqlalchemy import * from migrate import * from raggregate.guid_recipe import GUID def upgrade(migrate_engine): meta = MetaData(bind=migrate_engine) comments = Table('comments', meta, autoload=True) unreadc = Column('unread', Boolean, default=True) in_reply_toc = Column('in_reply_to', GUID, nullabl...
Python
0
88d480f2c97bf7779afea34798c6c082f127f3a6
Add missing client.py (#703)
client/client.py
client/client.py
import webapp2 import re class RedirectResource(webapp2.RequestHandler): def get(self, path): path = re.sub(r'/$', '', path) self.redirect('/community/%s' % path, permanent=True) # pylint: disable=invalid-name app = webapp2.WSGIApplication([ webapp2.Route(r'/<:.*>', handler=RedirectResource), ], debug=T...
Python
0
38cf2a9f0c964c69df084d80ded6cf161ba7eb16
Add elf read elf file.
elf.py
elf.py
import sys from elftools.elf.elffile import ELFFile from elftools.common.exceptions import ELFError from elftools.elf.segments import NoteSegment class ReadELF(object): def __init__(self, file): self.elffile = ELFFile(file) def get_build(self): for segment in self.elffile.iter_segments(): ...
Python
0
d2f13fb17d3f9998af1a175dfd4e2bea4544fb3d
add example to just serialize matrix
examples/undocumented/python_modular/serialization_matrix_modular.py
examples/undocumented/python_modular/serialization_matrix_modular.py
from modshogun import * from numpy import array parameter_list=[[[[1.0,2,3],[4,5,6]]]] def serialization_matrix_modular(m): feats=RealFeatures(array(m)) #feats.io.set_loglevel(0) fstream = SerializableAsciiFile("foo.asc", "w") feats.save_serializable(fstream) l=Labels(array([1.0,2,3])) fstream = SerializableAs...
Python
0
e7f1439cae37facaedce9c33244b58584e219869
Initialize P01_sendingEmail
books/AutomateTheBoringStuffWithPython/Chapter16/P01_sendingEmail.py
books/AutomateTheBoringStuffWithPython/Chapter16/P01_sendingEmail.py
# This program uses the smtplib module to send emails # Connecting to an SMTP Server import smtplib with open('smtp_info') as config: # smtp_cfg = [email, password, smtp server, port] smtp_cfg = config.read().splitlines() smtp_obj = smtplib.SMTP_SSL(smtp_cfg[2], smtp_cfg[3]) print(type(smtp_obj))
Python
0.000286
e86047546693290556494bf00b493aa4ae770482
add binding.gyp for node-gyp
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "rawhash", "sources": [ "src/rawhash.cpp", "src/MurmurHash3.h", "src/MurmurHash3.cpp" ], 'cflags': [ '<!@(pkg-config --cflags libsparsehash)' ], 'conditions': [ [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="so...
Python
0.000001
888b27db4d91ebba91eb935532f961943453b7c8
add update command to new certificate data model
paralapraca/management/commands/update_certificate_templates.py
paralapraca/management/commands/update_certificate_templates.py
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from django.core.files import File from core.models import CertificateTemplate from timtec.settings import STATIC_ROOT from paralapraca.models import CertificateData, Contract import os class Command(BaseCommand): help = 'Create certific...
Python
0.000001
0ac4b8f55703a1cde7474c6ad8db9c3b6005f0f0
convert markdown tables into rst before building (#4125)
docs/sphinx_util.py
docs/sphinx_util.py
# -*- coding: utf-8 -*- """Helper utilty function for customization.""" import sys import os import docutils import subprocess def run_build_mxnet(folder): """Run the doxygen make command in the designated folder.""" try: subprocess.call('cd %s; cp make/readthedocs.mk config.mk' % folder, shell = True)...
# -*- coding: utf-8 -*- """Helper utilty function for customization.""" import sys import os import docutils import subprocess def run_build_mxnet(folder): """Run the doxygen make command in the designated folder.""" try: subprocess.call('cd %s; cp make/readthedocs.mk config.mk' % folder, shell = True)...
Python
0
a0d3ae80a2f4f9ae76aaa4d672be460ce3a657d4
add command to populate change messages
corehq/apps/users/management/commands/add_location_change_message.py
corehq/apps/users/management/commands/add_location_change_message.py
from django.core.management.base import BaseCommand from django.db.models import Q from corehq.apps.users.audit.change_messages import UserChangeMessage from corehq.apps.users.models import UserHistory class Command(BaseCommand): help = "Add locations removed change messages on commcare user's User History recor...
Python
0.000001
b42596ff4175d12504272323e3a9ac0b8b4b7e0b
Add get_package.py for new packaging system
get_package.py
get_package.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2018 The ungoogled-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. """ Simple package script generator. """ import argparse import configparser import re import s...
Python
0.000001
fb133e260722fd02cb6f14ede15dbdb1fdf91af7
Add gtk dependencies tests
test/test_dependencies.py
test/test_dependencies.py
""" Copyright (c) 2017, Michael Sonntag (sonntag@bio.lmu.de) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted under the terms of the BSD License. See LICENSE file in the root of the project. """ import unittest class DependencyTest(unittest.TestCas...
Python
0
c09356487360ec373c98ec50800a450a3966a60f
define prompt function
lib.py
lib.py
# weather-app # lib.py # Classes and functions for weather-app. # Function definitions. # --------------------- # Prompt for user input. Accepts a prompt message we want to show. def prompt(msg): return input(msg)
Python
0.000196
e51185a5538ab20250d94c4fe5e71bcfcfed0e1e
trying to get the hash 1dbd981fe6985776b644b173a4d0385ddc1aa2a829688d1e0000000000000000
btcrelay.py
btcrelay.py
# Stored variables: # # Last known block # 10: version # 11: hashPrevBlock # 12: hashMerkleRoot # 13: time # 14: bits # 15: nonce # 16: blockHash / lastKnownBlock # 17: score # def shared(): TWO_POW_24 = 2 ^ 24 def init(): self.storage[16] = 0x00000000000000000cfdd50d917943949fa708829ab70108c98cdb9f7d62339d ...
# Stored variables: # # Last known block # 10: version # 11: hashPrevBlock # 12: hashMerkleRoot # 13: time # 14: bits # 15: nonce # 16: blockHash / lastKnownBlock # 17: score # def shared(): TWO_POW_24 = 2 ^ 24 def init(): self.storage[16] = 0x00000000000000000cfdd50d917943949fa708829ab70108c98cdb9f7d62339d ...
Python
0.999988
e6bd5bbb3a46413b1ad164e0ef6ab66e89d9c95f
Add buildbot.py
buildbot.py
buildbot.py
#!/usr/bin/env python # encoding: utf-8 project_name = 'stub' def configure(options): pass def build(options): pass def run_tests(options): pass def coverage_settings(options): options['required_line_coverage'] = 80.0
Python
0.000001
97ea4f9019dcd5d4c01b4d5715297f25bc6aaf91
Create bytesize.py
bytesize.py
bytesize.py
# -*- coding: utf-8 -*- """ @author: stk """ import sys import itertools from collections import defaultdict _ver = sys.version_info #: Python 2.x? _is_py2 = (_ver[0] == 2) #: Python 3.x? _is_py3 = (_ver[0] == 3) if _is_py2: builtin_str = str bytes = str str = unicode basestring = basestring num...
Python
0.00001
399cd799ae993412a6ad2455b8e11f4019aa9509
Add models admin
td_biblio/admin.py
td_biblio/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Author, Editor, Journal, Publisher, Entry, Collection class AbstractHumanAdmin(admin.ModelAdmin): list_display = ('last_name', 'first_name') class AuthorAdmin(AbstractHumanAdmin): pass class EditorAdmin(AbstractHumanAdmin): ...
Python
0
6d3f6951d846c50fcc1ff011f9129a4e1e3f7de1
Add unit tests for BMI version of storm
testing/test_storm_bmi.py
testing/test_storm_bmi.py
#! /usr/bin/env python # # Tests for the BMI version of `storm`. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import * import os import shutil from subprocess import call # Global variables start_dir = os.getcwd() data_dir = os.path.join(start_dir, 'testing', 'data') inp...
Python
0
9ef0e5e6dc50af7d5ccc27cc4d41abce72b51456
Create runcount.py
bin/runcount.py
bin/runcount.py
#!/usr/bin/python
Python
0.000002
671a5abc1f04930c749745c2ec0a59000d6e69a8
Add profile_rec script. (transplanted from ab55d87908f16cf7e2fac0a1938b280204a612bf)
tests/test_functional/profile_rec.py
tests/test_functional/profile_rec.py
import profile import pstats import tempfile import os import time from routes import Mapper def bench_rec(n): m = Mapper() m.connect('', controller='articles', action='index') m.connect('admin', controller='admin/general', action='index') m.connect('admin/comments/article/:article_id/:action/:id', ...
Python
0.000001
5c5bf274c72ef67a3a2a2e5d6713df910026dcdb
Add hash plugin
plugins/hash.py
plugins/hash.py
import hashlib import sys class Plugin: def on_command(self, bot, msg): if len(sys.argv) >= 2: algorithm = sys.argv[1] contents = " ".join(sys.argv[2:]) if not contents: contents = sys.stdin.read().strip() h = hashlib.new(algorithm) ...
Python
0.000001
086371f56748da9fb68acc4aaa10094b6cf24fcb
Revert "Remove pgjsonb returner unit tests"
tests/unit/returners/test_pgjsonb.py
tests/unit/returners/test_pgjsonb.py
# -*- coding: utf-8 -*- ''' tests.unit.returners.pgjsonb_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unit tests for the PGJsonb returner (pgjsonb). ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import Salt Testing libs from tests.support.mixins impo...
Python
0
077607b1b7fe705992c9f59f7dc94f2386aef4bb
add memcached
testutils/servers/memcache_server.py
testutils/servers/memcache_server.py
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
Python
0.000001
d95f24d43f3925a91176429cca1aaac30a0c55aa
Create java module main
genes/java/main.py
genes/java/main.py
from genes import apt, debconf import platform class Config: OS = platform.system() (DIST, _, CODE) = platform.linux_distribution() REPO = DIST.lower() + '-' + CODE def main(): if Config.OS == 'Linux': if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian': #FIXME: debian needs ppa ...
Python
0.000001
6d87badb68f2e20a3907f670b9190956ebd127e8
Create AddBinaryNumbers.py
math/AddBinaryNumbers/Python/AddBinaryNumbers.py
math/AddBinaryNumbers/Python/AddBinaryNumbers.py
number1 = input("Enter the first number: ") number2 = input("Enter the second number: ") result = (int(number1, 2) + int(number2, 2)) result = bin(result) print(result[2:])
Python
0.000004
c71a43dae259299952cec082d33f003ecaeb9eab
Add marky test.
tests/py/test_markdown.py
tests/py/test_markdown.py
from gratipay.testing import Harness from gratipay.utils import markdown from HTMLParser import HTMLParser class TestMarkdown(Harness): def test_marky_works(self): md = "**Hello World!**" actual = HTMLParser().unescape(markdown.marky(md)).strip() expected = '<p><strong>Hello World!</stron...
Python
0
e26e2ed264175d86fb22c651486e1c97dc1f3a1a
Create break_xhill3.py
break_xhill3.py
break_xhill3.py
from itertools import product from ngram_score import ngram_score L2I = dict(zip("ABCDEFGHIJKLMNOPQRSTUVWXYZ",range(26))) I2L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" import sys ctext = 'hwduyfsfqdxnx nx ymj fwy tk gwjfpnsl htijx fsi hnumjwx. bmjs fyyjruynsl yt hwfhp f mnqq hnumjw, kwjvzjshd fsfqdxnx bnqq gj uwfhynhfqqd zxjqjxx'...
Python
0.00015
722b1d55c771e628ba82bbd5b8f8f5de047112af
Add a hex dump utility class.
tests/hexdumper.py
tests/hexdumper.py
# This hack by: Raymond Hettinger class hexdumper: """Given a byte array, turn it into a string. hex bytes to stdout.""" def __init__(self): self.FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' \ for x in range(256)]) def dump(self, src, length=8): result=[] for i in xrange(0, len(src...
Python
0
f7a8c0b6e361ce3e5f0980b539b843b33fea258d
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/4464fe2aad5cccfd7935b0f1767901eb08e99784.
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 = "4464fe2aad5cccfd7935b0f1767901eb08e99784" TFRT_SHA256 = "cc3b5b95a2da47710ade8b2d3c00...
"""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 = "191a16a25cc901e12535893b94aca169916d378c" TFRT_SHA256 = "11b5d8d41bc4a6c1c6c7f9c6958c...
Python
0
c5b0c56f53dee5577641a668019f40f9468017ea
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/83d3045fb5476bed115ae438871a228c1c682af1.
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 = "83d3045fb5476bed115ae438871a228c1c682af1" TFRT_SHA256 = "bdde8691c6a17c803de04423271b...
"""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 = "6ca793b5d862ef6c50f242d77a811f06cce9b60a" TFRT_SHA256 = "720b059a6b1d5757a76e56cf4a3a...
Python
0
a3a9d4d6538b025d0c6c821a72076e084a5b597b
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/9dac1ed1ebc2350ada97b16093174a1a0bbd56d0.
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 = "9dac1ed1ebc2350ada97b16093174a1a0bbd56d0" TFRT_SHA256 = "89eea9ff0c9dfca61037c4da051a...
"""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 = "553df8c12e9ba5930b9b8065f1d012ea07c6044c" TFRT_SHA256 = "477d0374b044c60cd018fdb17e7c...
Python
0.000001
2e53ae34ec03485302d5d7e6e5dd05707bbd1cf6
Add camera tests
tests/test_camera.py
tests/test_camera.py
import os import pygame from ..sappho import Camera from .common import compare_pygame_surfaces class TestCamera(object): def test_scroll(self): # Create surface to render to output_surface = pygame.surface.Surface((1, 1)) # Create fixtures red_surface = pygame.surface.Surface((1...
Python
0
349918610081c8c02dc75fdafd47f647814dd63c
add converter of string to format maya understands for changing setting of fps
mindbender/maya/pythonpath/mayafpsconverter.py
mindbender/maya/pythonpath/mayafpsconverter.py
def mayafpsconverter(Sfps): condition = 0 if Sfps == "": condition = 1 return Sfps if Sfps == "15": condition = 1 return "game" if Sfps == "24": condition = 1 return "film" if Sfps == "25": condition = 1 return "pal" if Sfps == "30"...
Python
0
3eafac9d71f7f885f66a63218557194291c649f7
add config test
tests/test_config.py
tests/test_config.py
import pytest from pytest_girder.assertions import assertStatusOk, assertStatus from slicer_cli_web.config import PluginSettings @pytest.mark.plugin('slicer_cli_web') def test_default_task_folder(server, admin, folder): # Test the setting resp = server.request('/system/setting', method='PUT', params={ ...
Python
0.000001
cfc89a542ebb9b1745bb8a7ce30f79dad12a16b7
add mslib tool to build static C libraries.
yaku/tools/mslib.py
yaku/tools/mslib.py
import yaku.utils import yaku.task def setup(ctx): env = ctx.env ctx.env["STLINK"] = ["lib.exe"] ctx.env["STLINK_TGT_F"] = ["/OUT:"] ctx.env["STLINK_SRC_F"] = [] ctx.env["STLINKFLAGS"] = ["/nologo"] ctx.env["STATICLIB_FMT"] = "%s.lib" # XXX: hack saved = yaku.task.Task.exec_command ...
Python
0
367a7cdcb02d2d8c15e9a2375c5304b2ad9c89ac
Add the basic tools as functions to facilitate basic operations
ytranslate/tools.py
ytranslate/tools.py
# Copyright (c) 2015, LE GOFF Vincent # 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 and th...
Python
0.000071
8660c7fda8cc7290fadeed7a39f06218087d9401
Add draft test module for linter
tests/test_linter.py
tests/test_linter.py
import logging import pytest from mappyfile.validator import Validator def validate(d): v = Validator() return v.validate(d) def get_from_dict(d, keys): for k in keys: if isinstance(k, int): d = d[0] else: d = d[k] return d def run_tests(): pytest.main([...
Python
0
f73eaa3d1ba8c6f21fe64a4793aea7ba6b6835ca
Create tensorBoard-example.py
rocksetta-examples/tensorBoard-example.py
rocksetta-examples/tensorBoard-example.py
''' Loss Visualization with TensorFlow. This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/) Author: Aymeric Damien Project: https://github.com/aymericdamien/TensorFlow-Examples/ ''' import tensorflow as tf import numpy # Import MINST data import input_data mnist = input...
Python
0
ad7f9f785f9a4a4494127a9b2196e1fc64c9f3de
Add basic first tests for new report driven by "events"
tests/test_report.py
tests/test_report.py
from django.test import TestCase from deep_collector.core import RelatedObjectsCollector from .factories import BaseModelFactory class TestLogReportGeneration(TestCase): def test_report_with_no_debug_mode(self): obj = BaseModelFactory.create() collector = RelatedObjectsCollector() colle...
Python
0
272371f28369cca514d90f355e7771c133d11dcf
Create __openerp__.py
project_surgery/__openerp__.py
project_surgery/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Gideoni Silva (Omnes) # Copyright 2013-2014 Omnes Tecnologia # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
Python
0.005291
a08452c4ed3338cf43bf2647bcc17a7d66ba4d23
call restore config directly
corehq/apps/ota/tasks.py
corehq/apps/ota/tasks.py
from celery.task import task from couchdbkit.exceptions import ResourceNotFound from casexml.apps.case.xml import V1 from casexml.apps.phone.restore import RestoreConfig from corehq.apps.users.models import CommCareUser from soil import DownloadBase @task def prime_restore(usernames_or_ids, version=V1, cache_timeout=...
from celery.task import task from couchdbkit.exceptions import ResourceNotFound from casexml.apps.case.xml import V1 from corehq.apps.users.models import CommCareUser from soil import DownloadBase @task def prime_restore(usernames_or_ids, version=V1, cache_timeout=None, overwrite_cache=False): from corehq.apps.ot...
Python
0
e1a0029488d4cbf0581c21ceb1bd5db3c19bf3eb
add readme
algorithms/CommonFun.py
algorithms/CommonFun.py
#!user/bin/env python # coding:utf-8 import sys import random reload(sys) sys.setdefaultencoding('utf-8') def QuickSort(left, right, array): l = left r = right while l < r: base = array[r] while (array[l] <= base and l < r): l = l + 1 if(l < r): array[r] = array[l] while (array[l] <= array[r] and l...
Python
0.000001
e0a7824253ae412cf7cc27348ee98c919d382cf2
verify stderr for a failing clone into a non-empty dir
test/test_clone.py
test/test_clone.py
# -*- coding: utf-8 -*- # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from pathlib import Path import re import git from .lib import ( TestBase, with_rw_directory, ) class TestClone(TestBase): @with_rw_directory def tes...
Python
0.000001
b20f694b57813397bf0c4a1537a2d404ef5adb24
Add tests for client_kwargs_from_config
tests/test_util.py
tests/test_util.py
import docker import pytest from dockci.util import client_kwargs_from_config class TestClientKwargsFromConfig(object): """ Tests for ``dockci.util.client_kwargs_from_config`` """ @pytest.mark.parametrize('host_str,expected,expected_tls_dict', ( ('https://localhost', {'base_url': 'https://localhost'}...
Python
0.000001
4683fc67d5171d8bb0391ac45f587fbc3e3c97fc
Add dependency installer for linux and mac osx
install_dependencies.py
install_dependencies.py
import platform import subprocess """ This is a standalone script that installs the required dependencies to run. It *should* be platform independent, and should work regardless of what platform you are running it on. To install dependencies, download the DevAssist source and run this script by running "python instal...
Python
0
0fd7cdee45b54551bcfc901cece2e5cc9dec4555
Add new test setup required for py.test/django test setup
test/test_setup.py
test/test_setup.py
import os import django os.environ['DJANGO_SETTINGS_MODULE'] = 'testsettings' # run django setup if we are on a version of django that has it if hasattr(django, 'setup'): # setup doesn't like being run more than once try: django.setup() except RuntimeError: pass
Python
0
2014a7e3e785c9826575846a38b4703ef19946f4
fix path stuff
test/test_tiles.py
test/test_tiles.py
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import math import pyglet from pyglet.window import key import cocos from cocos import tiles class CarSprite(cocos.actions.ActionSprite): speed = 0 ...
import math import pyglet from pyglet.window import key import cocos from cocos import tiles class CarSprite(cocos.actions.ActionSprite): speed = 0 def update(self, dt): # handle input and move the car self.rotation += (keyboard[key.RIGHT] - keyboard[key.LEFT]) * 150 * dt speed = self...
Python
0.000001
dbfa14401c0b50eb1a3cac413652cb975ee9d41f
Add valid directory cleaner helper test
ocw-ui/backend/tests/test_directory_helpers.py
ocw-ui/backend/tests/test_directory_helpers.py
import os import unittest from webtest import TestApp from ..run_webservices import app from ..directory_helpers import _get_clean_directory_path test_app = TestApp(app) class TestDirectoryPathCleaner(unittest.TestCase): PATH_LEADER = '/tmp/foo' VALID_CLEAN_DIR = '/tmp/foo/bar' if not os.path.exists(PAT...
Python
0.000003
53eaf6de12b282ff359d4d4b9518b10ebeeee6ba
Add imdb parser
imdb-parser.py
imdb-parser.py
#!/usr/bin/python import threading, urllib2, urllib import sys import time import codecs import re import os import MySQLdb from pprint import pprint from bs4 import BeautifulSoup, NavigableString from optparse import OptionParser use = "Usage: %prog -u url -l limit\n This script parses justeat site and outputs csv f...
Python
0.000008
ce924c72795d342605bb4409d5217fe99c807ace
Add test cases for moments functions
skimage/measure/tests/test_moments.py
skimage/measure/tests/test_moments.py
from numpy.testing import assert_equal, assert_almost_equal import numpy as np from skimage.measure import (moments, moments_central, moments_normalized, moments_hu) def test_moments(): image = np.zeros((20, 20), dtype=np.double) image[14, 14] = 1 image[15, 15] = 1 image[...
Python
0
5ee4f6fd50da0a7115f8ca0ab29c4388eaef13a6
add probabitity function decomposition
src/probability.py
src/probability.py
from __future__ import division from math import log from scipy.special import binom import numpy as np def C(p, p0): p1 = 1 - p0 return -p0*log(p0, 2) + p0*p*log(p0*p, 2) - (p1+p0*p)*log(p1+p0*p, 2) def P(c, p0, eps=0.00001): left = 0 right = 1 while right - left > eps: p = (left + right...
Python
0.003014
ad5b1459bf514f7be5b39b90d0fdf627edf65f62
Add helper table module to generate common test tables [skip ci]
astropy/table/table_helpers.py
astropy/table/table_helpers.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Helper functions for table development, mostly creating useful tables for testing. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from itertools import cycle import string import nump...
Python
0
572508fb78014e9e1b228d738b6ebb89c9bdcb9e
Create rpc.py
rpc.py
rpc.py
### Reverse Polish Calculator import math ### CLASSES ### class Stack: """ Object to realize&handle stack Access to stack only through its methods """ def __init__(self): """ Init stack as list """ self.clear_stack() def clear_stack(self): """ Clears stack """ se...
Python
0.000001
8e8a1a33d8bedcb597020f9723c03d0f6af57522
Add python script
send.py
send.py
import sys import os try: sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src')) except: pass from com.dtmilano.android.viewclient import ViewClient number = sys.argv[2] text = sys.argv[3] print("Sending WhatsApp...") print("Number: " + number) print("Text: " + text) package = 'com.an...
Python
0.000302
cec1ec8367c83e540b9a9cfbfeac2a576cdf357b
add send.py
send.py
send.py
""" Example: switch type A: sudo python send.py -c off -t A -s 11111,11111 -p 0 switch type B: sudo python send.py -c off -t B -s 1,3 -p 0 switch type C: sudo python send.py -c off -t C -s a,1,1 -p 0 switch type D: sudo python send.py -c off -t D -s A,1 -p 0 """ import argparse imp...
Python
0.000001
61f806ffc68c41dfbb926ea6825292eabed46966
Add sorting code
sort.py
sort.py
#!/usr/bin/env python import re import sys sort = {} regex = re.compile(r'TBX_API \w* \*?(\w*)\(.*') for line in sys.stdin.readlines(): result = regex.match(line) if not result: sort[line] = line else: sort[result.group(1)] = line for k in sorted(sort.keys()): sys.stdout.write(sort[k]...
Python
0.000007
3e885137d23e7618b78f207ecd6b2f6118a4a0dc
add a test file
test.py
test.py
#!/usr/bin/python import cgi cgi.test()
Python
0.000001
b6a55999cd0f6ff6a7d69b7eb59e859d415b275f
Add test.py with old-formatting test
test.py
test.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 Martine Lenders <mail@martine-lenders.eu> # # Distributed under terms of the MIT license. "%s" % "test" "%d" % 2 "%.4f" % 2.0
Python
0.000003
f4d26567afc9185e0f9370eda43d30084437ade5
Solve Code Fights make array consecutive 2 problem
CodeFights/makeArrayConsecutive2.py
CodeFights/makeArrayConsecutive2.py
#!/usr/local/bin/python # Code Fights Make Array Consecutive 2 Problem def makeArrayConsecutive2(statues): return (len(range(min(statues), max(statues) + 1)) - len(statues)) def main(): tests = [ [[6, 2, 3, 8], 3], [[0, 3], 2], [[5, 4, 6], 0], [[6, 3], 2], [[1], 0] ...
Python
0.998889
06d8f4290cf433a538cef4851acefd6e42c8341d
Add simple example
examples/client.py
examples/client.py
#!/usr/bin/env python import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) from accepton import Client API_KEY = 'skey_be064297e7b2db4b6ce5928e8dcad582' accepton = Client(api_key=API_KEY, environment='development') token = accepton.create_token(amount=1099, application_fee=99, cur...
Python
0.000375
96dd9b2968039be3fa87a30e8a16ed1c77be10bb
solve 94
94_BinaryTreeInorderTraversal.py
94_BinaryTreeInorderTraversal.py
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {TreeNode} root # @return {integer[]} def inorderTraversal(self, root): if not root: return [] ...
Python
0.999999
e8c0b17bb28f1212b302959144086d72c205bf4c
store toc list in optional file to make merging easier
publisher/conf.py
publisher/conf.py
import glob import os work_dir = os.path.dirname(__file__) papers_dir = os.path.join(work_dir,'../papers') output_dir = os.path.join(work_dir,'../output') template_dir = os.path.join(work_dir,'_templates') static_dir = os.path.join(work_dir,'_static') css_file = os.path.join(static_dir,'scipy-proc....
import glob import os work_dir = os.path.dirname(__file__) papers_dir = os.path.join(work_dir,'../papers') output_dir = os.path.join(work_dir,'../output') template_dir = os.path.join(work_dir,'_templates') static_dir = os.path.join(work_dir,'_static') css_file = os.path.join(static_dir,'scipy-proc....
Python
0
f046bd8982f08a31448bb5e4e10ded2a14ea95b0
Create __init__.py
iotqatools/__init__.py
iotqatools/__init__.py
Python
0.000429
e4a33badd98c4c927c4128e22fd839f54711cfd6
Create PedidoCadastrar.py
backend/Models/Predio/PedidoCadastrar.py
backend/Models/Predio/PedidoCadastrar.py
from Framework.Pedido import Pedido from Framework.ErroNoHTTP import ErroNoHTTP class PedidoCadastrar(Pedido): def __init__(self,variaveis_do_ambiente): super(PedidoCadastrar, self).__init__(variaveis_do_ambiente) try: self.id = self.corpo['id'] self.nome = self.corpo['nome'] except: raise ErroNoHTTP(...
Python
0
8a911b877c5ae196ce6e4cc7e6c284b742645bc8
Update headers strategy to mimic internal bytes representation.
test/test_invalid_headers.py
test/test_invalid_headers.py
# -*- coding: utf-8 -*- """ test_invalid_headers.py ~~~~~~~~~~~~~~~~~~~~~~~ This module contains tests that use invalid header blocks, and validates that they fail appropriately. """ import pytest import h2.connection import h2.errors import h2.events import h2.exceptions import h2.utilities from hypothesis import g...
# -*- coding: utf-8 -*- """ test_invalid_headers.py ~~~~~~~~~~~~~~~~~~~~~~~ This module contains tests that use invalid header blocks, and validates that they fail appropriately. """ import pytest import h2.connection import h2.errors import h2.events import h2.exceptions import h2.utilities from hypothesis import g...
Python
0
82152af00c54ea94a4e8cd90d3cd5f45ef28ee86
add missing unit test file
test/test_utils.py
test/test_utils.py
# coding=utf-8 from __future__ import unicode_literals import os import codecs from nose.tools import eq_ from pyecharts.utils import ( freeze_js, write_utf8_html_file, get_resource_dir ) def test_get_resource_dir(): path = get_resource_dir('templates') expected = os.path.join(os.getcwd(), '..'...
Python
0
9c52dae7f5de64865fff51a24680c43e041376ea
Add random_subtree script
random_subtree.py
random_subtree.py
#!/usr/bin/env python2 # Use either ete2 or ete3 try: import ete3 as ete except ImportError: import ete2 as ete import numpy as np CLI = """ USAGE: random_subtree <tree> <n> Subsamples <n> taxa from the Newick tree in <tree>, preserving the branch lengths of subsampled taxa. """ def main(treefile, n): ...
Python
0.000001
3c1e61b4b47ec244e4cadd4bf34e0a21cf1ff7e1
Create w3_1.py
w3_1.py
w3_1.py
print("第三週")
Python
0.000482
8bb9d6cbe161654126bb3aa3adecdb99ee0d9987
Create sct4.py
sct4.py
sct4.py
from mpi4py import MPI comm = MPI.COMM_WORLD rank=comm.rank size=comm.size print 'Rank:',rank print 'Node Count:',size print 9**(rank+3)
Python
0.000003
aafd823069176075b4810496ee98cea3203b5652
Make a command to make subsets. Subsets are useful for testing during development.
build_time/src/make_subset.py
build_time/src/make_subset.py
""" Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
Python
0
01f4aedac1df6f2e55c76d60c52d1e0c5ccfd9f2
Revert "Delete test file"
tests/mock_vws/test_query.py
tests/mock_vws/test_query.py
""" Tests for the mock of the query endpoint. https://library.vuforia.com/articles/Solution/How-To-Perform-an-Image-Recognition-Query. """ import io from typing import Any, Dict from urllib.parse import urljoin import pytest import requests from requests import codes from requests_mock import POST from tests.utils ...
Python
0
bf577257f4d34ac15642cb92efba00d750e9cb66
test added
tests/heisenbug.py
tests/heisenbug.py
import os import sys import time import logging import uuid import saga import pilot import traceback #------------------------------------------------------------------------------ # Redis password and eThread secret key details aquired from the environment COORD = os.environ.get('COORDINATION_URL') ACCESS_KEY_ID =...
Python
0
793344ae359f028db950a364d48578ae97cb7028
Add tests for jenkins_job_linter.test_jjb_subcommand
tests/test_jjb_subcommand.py
tests/test_jjb_subcommand.py
from jenkins_job_linter.jjb_subcommand import LintSubCommand class TestParseArgs(object): def test_parser_named_lint(self, mocker): subcommand = LintSubCommand() subparser_mock = mocker.Mock() subcommand.parse_args(subparser_mock) assert 1 == subparser_mock.add_parser.call_count ...
Python
0.000001
5a546b2b4c4c8ccf7f44a75bd07c32888fc5bdf5
add perftests script
tests/perftests.py
tests/perftests.py
#!/usr/bin/env python # # Author: Vincenzo Maffione <v.maffione@gmail.com> # import multiprocessing import subprocess import argparse import re import os import pickle def stats_init(x): x['kpps'] = [] x['mbps'] = [] x['packets'] = [] x['transactions'] = [] x['latency'] = [] description = "Py...
Python
0.000002
2e330d5cd2ad033c675d5888a2f43e0f846a4df1
Add CodeDeploy
troposphere/codedeploy.py
troposphere/codedeploy.py
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty from .validators import positive_integer KEY_ONLY = "KEY_ONLY" VALUE_ONLY = "VALUE_ONLY" KEY_AND_VALUE = "KEY_AND_VALUE" class GitHubLocation(AWSProperty): props = ...
Python
0.000001