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 |
|---|---|---|---|---|---|---|---|
5e7f29a66e440e440b1f7a4848d17bb7ae01139b | Update from template. | ci/bootstrap.py | ci/bootstrap.py | Python | 0 | @@ -0,0 +1,2189 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, print_function, unicode_literals%0A%0Aimport os%0Aimport sys%0Afrom os.path import exists%0Afrom os.path import join%0A%0A%0Aif __name__ == %22__main__%22:%0A base_path = join(%22.tox%22, %22configure%22)%0A... | |
db76495b4f41021e2613d79b6f5cb30c96fb4290 | Add PriorityStore and PriorityItem | desmod/prioritystore.py | desmod/prioritystore.py | Python | 0 | @@ -0,0 +1,517 @@
+from collections import namedtuple%0Afrom heapq import heappush, heappop%0A%0Afrom simpy import Store%0A%0A%0Aclass PriorityItem(namedtuple('PriorityItem', 'priority item')):%0A def __lt__(self, other):%0A return self.priority %3C other.priority%0A%0A%0Aclass PriorityStore(Store):%0A def... | |
c74170968b3a200f17af083f027fe3b657cf6041 | Add giveup function (#12) | singer/requests.py | singer/requests.py | Python | 0 | @@ -0,0 +1,210 @@
+def giveup_on_http_4xx_except_429(error):%0A response = error.response%0A if response is None:%0A return False%0A return not (response.status_code == 429 or%0A response.status_code %3E= 500)%0A
| |
b59745e72a3c0a98da517f00e95fbafcff0cee3d | Remove unnecessary import. | tests/test_charts_snep_input.py | tests/test_charts_snep_input.py | Python | 0 | @@ -0,0 +1,421 @@
+from __future__ import unicode_literals, division, absolute_import%0A%0Afrom tests import FlexGetBase, use_vcr%0A%0Aclass TestChartsSnepInput(FlexGetBase):%0A __yaml__ = %22%22%22%0A tasks:%0A test:%0A charts_snep_input: radio%0A %22%22%22%0A%0A @use_vcr%0A def ... | |
ce01cc61ea62c717503d991826e6b9915b23900b | Fix usage print | check-bugs.py | check-bugs.py | #!/usr/bin/python
import sys
import re
import pprint
import collections
Head = collections.namedtuple("Head", "file line")
def parse(pn):
ans = collections.defaultdict(str)
head = None
for l in open(pn):
# ignore comments
if l.startswith("#"):
continue
# found a head... | Python | 0.000255 | @@ -1120,17 +1120,18 @@
gs.txt%5D%22
-,
+ %25
sys.arg
|
c1695c6ddfb6889b193b1d076e839488549e671b | Add note option to tack on personal notes to top of emails. typically Sorry... | dj/scripts/email_ab.py | dj/scripts/email_ab.py | #!/usr/bin/python
# email_ab.py
# abstract email class
from django.core.mail import get_connection, EmailMessage
from django.template import Context, Template
from process import process
from django.conf import settings
import random
class email_ab(process):
subject_template = "stub testing:{{ep.name}}"
... | Python | 0 | @@ -222,23 +222,8 @@
gs%0A%0A
-import random%0A%0A
clas
@@ -1326,38 +1326,112 @@
elf.
-body_header + self.body_body +
+options.note + %5C%0A self.body_header + %5C%0A self.body_body + %5C%0A
sel
@@ -3389,40 +3389,8 @@
ted%0A
- print(1, reply_tos)%0A
@@... |
d6fa7713556582bab54efc3ba53d27b411d8e23c | update import statements | tamil/__init__.py | tamil/__init__.py | # -*- coding: utf-8 -*-
#
# (C) 2013 Muthiah Annamalai <ezhillang@gmail.com>
# Library provides various encoding services for Tamil libraries
#
from . import utf8
from . import tscii
from . import txt2unicode
from . import txt2ipa
def printchar( letters ):
for c in letters:
print(c, u"\\u%04x"%ord(c))
... | Python | 0 | @@ -140,23 +140,16 @@
ies%0A# %0A%0A
-from .
import u
@@ -152,23 +152,16 @@
rt utf8%0A
-from .
import t
@@ -165,23 +165,16 @@
t tscii%0A
-from .
import t
@@ -188,15 +188,8 @@
ode%0A
-from .
impo
|
97a8c8c2baffdeaf6b710cf875d2f8641b999338 | Create adapter_16mers.py | select_random_subset/adapter_16mers.py | select_random_subset/adapter_16mers.py | Python | 0.000001 | @@ -0,0 +1,1493 @@
+%0A%0A#!/usr/bin/env python2%0A# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Sat Oct 21 14:15:18 2017%0A%0A@author: nikka.keivanfar%0A%22%22%22%0A%0A#see also: adapters.fa%0A%0AP5 = 'AATGATACGGCGACCACCGA'%0AP7 = 'CAAGCAGAAGACGGCATACGAGAT'%0Aread1 = 'GATCTACACTCTTTCCCTACACGACGCTC'%0Aread2 = 'GTGAC... | |
8a4931dd810079c1f78858c5058df74b0e696f72 | Correct IrFilters_eval_domain when the third item starts with 'object.' | smile_action_rule/models/ir_filters.py | smile_action_rule/models/ir_filters.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Smile (<http://www.smile.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | Python | 0 | @@ -1020,16 +1020,101 @@
, fields
+%0Afrom openerp.tools import ustr%0Afrom openerp.tools.safe_eval import safe_eval as eval
%0A%0Afrom .
@@ -1452,25 +1452,8 @@
main
-.replace(' ', '')
, lo
@@ -1490,16 +1490,17 @@
ule = ',
+
object.'
@@ -1499,24 +1499,29 @@
object.' in
+repr(
eval_domain%0A
@@ -1519,16 +1519,... |
ca043c2d3fe5fbdd37f372e8a3ad8bfd1b501c89 | Correct Workitem._execute monkeypatch | smile_action_rule/workflow/workitem.py | smile_action_rule/workflow/workitem.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Smile (<http://www.smile.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | Python | 0.000004 | @@ -1131,16 +1131,139 @@
tack):%0A%0A
+ if not registry(self.session.cr.dbname).get('base.action.rule'):%0A return native_execute(self, activity, stack)%0A%0A
cr,
|
107e33ab3982f3f7fb56a1a2ac2b0eec0b67091b | Use universal newlines in gyp_helper. | build/gyp_helper.py | build/gyp_helper.py | # Copyright (c) 2012 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.
# This file helps gyp_chromium and landmines correctly set up the gyp
# environment from chromium.gyp_env on disk
import os
SCRIPT_DIR = os.path.dirnam... | Python | 0.000007 | @@ -578,16 +578,22 @@
ile_path
+, 'rU'
) as f:%0A
|
fbbaa3fc5b99eed88e039c232f129aaeab0a6f54 | Bring table test coverage to 100% | tests/test_table.py | tests/test_table.py | Python | 0 | @@ -0,0 +1,2604 @@
+#!/usr/bin/env python3%0A%0Aimport nose.tools as nose%0Afrom table import Table%0A%0A%0Adef test_init_default():%0A %22%22%22should initialize table with required parameters and default values%22%22%22%0A table = Table(num_cols=5, width=78)%0A nose.assert_equal(table.num_cols, 5)%0A nose... | |
f392a90ae12a5f9aab04b22e82d493d0f93db9fd | Add first test | tests/test_utils.py | tests/test_utils.py | Python | 0.000029 | @@ -0,0 +1,31 @@
+def test_ok():%0A assert True%0A
| |
e56a9781f4e7e8042c29c9e54966659c87c5c05c | Add a test for our more general views. | tests/test_views.py | tests/test_views.py | Python | 0 | @@ -0,0 +1,268 @@
+import pytest%0A%0Afrom django.core.urlresolvers import reverse%0A%0A%0Adef test_site_view(client):%0A response = client.get(reverse('site-home'))%0A assert response.status_code == 200%0A assert 'landings/home_site.html' in %5Btemplate.name for template in response.templates%5D%0A
| |
675b7fc917b5f99120ca4d6dcb79b3e821dbe72a | add Olin specific script | downloadOlin.py | downloadOlin.py | Python | 0 | @@ -0,0 +1,502 @@
+import os%0Afrom downloadMailmanArchives import main%0Aclass Struct:%0A def __init__(self, **entries): %0A self.__dict__.update(entries)%0A%0Aif __name__ == '__main__':%0A args = %7B%0A 'archive_root_url': %5B'https://lists.olin.edu/mailman/private/carpediem/', 'https://lists.olin.edu... | |
a46f0a709747dbe90f0495e7e6b12c7b511baa7f | Delete duplicate wapp images | dupe_deleter.py | dupe_deleter.py | Python | 0.000001 | @@ -0,0 +1,1045 @@
+%22%22%22%0A# Install QPython3 for android%0A# https://github.com/qpython-android/qpython3/releases%0A%0A# Execute the below script in QPython3%0A%22%22%22%0A%0Aimport os, hashlib%0Afrom operator import itemgetter%0Afrom itertools import groupby%0Aimage_list = %5B%5D%0Afolder_list = %5Br'/storage/em... | |
9f4452983e38d002e141ed0d2a9c865656a553ce | add todo stuff | main.py | main.py | Python | 0 | @@ -0,0 +1,146 @@
+%EF%BB%BF#!/usr/bin/env python%0A# __author__ = 'Dmitry Shihaleev'%0A# __version__= '0.2'%0A# __email__ = 'padavankun@gmail.com'%0A# __license__ = 'MIT License'%0A%0A
| |
ab7c0d05a6bcf8be83409ccd96f2ed4a6fe65a73 | Create main.py | main.py | main.py | Python | 0 | @@ -0,0 +1,1684 @@
+#!/usr/bin/env python3%0A%0Aimport sys%0Aimport socket%0Aimport string%0A%0AHOST = %22chat.freenode.net%22 # You can change this to whatever you want%0APORT = 6667%0A%0ANICK = %22Your Nick Name%22%0AIDENT = %22Your Identity%22%0AREALNAME = %22Your REAL Name%22%0AMASTER = %22The Master of this partic... | |
12490fa92e54becca77c70d124d807b19d71afa1 | Create main.py | main.py | main.py | Python | 0.000001 | @@ -0,0 +1,3018 @@
+# waypointviewer.py Waypoint Viewer Google Maps/Google AppEngine application%0A# Copyright (C) 2011 Tom Payne%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published by%0A# the Free Sof... | |
4f118c457c738a1f65001e7c8d02349923545634 | put units in brackets | web/Regulatory.py | web/Regulatory.py | # -*- coding: iso-8859-1 -*-
"""
Regulatory Database
@copyright: 2008 Johannes Berg
@license: GNU GPL, see COPYING for details.
"""
import codecs, math
from dbparse import DBParser, flag_definitions
Dependencies = ["time"]
def _country(macro, countries, code):
result = []
f = macro.formatter
... | Python | 0.000011 | @@ -921,21 +921,21 @@
t('Band
-(MHz)
+%5BMHz%5D
'),%0A
@@ -1041,13 +1041,13 @@
BW
-(MHz)
+%5BMHz%5D
'),%0A
@@ -1276,13 +1276,13 @@
ain
-(dBi)
+%5BdBi%5D
'),%0A
@@ -1388,17 +1388,17 @@
'Max IR
-(
+%5B
dBm'),%0A
@@ -1437,33 +1437,33 @@
f.text('(mW)
-)
+%5D
'),%0A f.
@@ -1559,17 +1559,17 @... |
34847fbe0e04a2da8957a0ba5de92856ca73c8cc | Add missing migration | osf/migrations/0054_auto_20170823_1555.py | osf/migrations/0054_auto_20170823_1555.py | Python | 0.0002 | @@ -0,0 +1,611 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.4 on 2017-08-23 20:55%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('osf', '0053_add_quickfiles'),%0A %5D%0A%0A op... | |
4102ab8fc24265aaee1ecbf673bec260b3b3e5df | add max sub arr impl | bioinformatics/dynamic_programming/max_sum_sub_arr1.py | bioinformatics/dynamic_programming/max_sum_sub_arr1.py | Python | 0.000001 | @@ -0,0 +1,647 @@
+def max_sum_sub_arr(arr):%0A score_vector = %5B0 for _ in range(len(arr))%5D%0A%0A def max_sum_sub_arr_detail(beg_idx):%0A if beg_idx %3E= len(arr):%0A return 0%0A elif arr%5Bbeg_idx%5D %3E= 0:%0A score_vector%5Bbeg_idx%5D = arr%5Bbeg_idx%5D + max_sum_sub_arr... | |
1043acdfe324e02bc2a8629ef8a47d6ae9befd7c | Add python script to get ECC608 Public Key | src/aiy/_drivers/_ecc608_pubkey.py | src/aiy/_drivers/_ecc608_pubkey.py | Python | 0.000001 | @@ -0,0 +1,2142 @@
+#!/usr/bin/env python3%0Aimport base64%0Aimport ctypes%0Aimport sys%0A%0ACRYPTO_ADDRESS_DICT = %7B%0A 'Vision Bonnet': 0x60,%0A 'Voice Bonnet': 0x62,%0A%7D%0A%0A%0Aclass AtcaIfaceCfgLong(ctypes.Structure):%0A _fields_ = (%0A ('iface_type', ctypes.c_ulong),%0A ('devtype', ctype... | |
b04503bddfa3b0d737308ac8ecb7f06ac866e6eb | Create __init__.py | __init__.py | __init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
0b891e401bf0e671d3bc6f0347a456f1cc5b07b3 | add __init__.py for root package | __init__.py | __init__.py | Python | 0.000018 | @@ -0,0 +1,14 @@
+import sysdic%0A
| |
14f175c294ec6b5dcd75887a031386c1c9d7060d | add __main__ | __main__.py | __main__.py | Python | 0.000247 | @@ -0,0 +1,606 @@
+from . import parser%0Aimport sys%0A%0Aif len(sys.argv) == 1:%0A print(%22compile yarh to html%22)%0A print(%22usage: yarh %5BYARH_FILE%5D...%22)%0A print(%22 yarh -- %5BYARH_STRING%5D%22)%0A print(%22 yarh %5BYARH_FILE%5D... -- %5BYARH_STRING%5D%22)%0A sys.exit(1)%0A%0Afro... | |
e8bd9c6867e5eb5f8c244b5190411ef3c613962b | Add TinyMCE to EventForm. | events/forms.py | events/forms.py | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Events module forms
"""
from django import forms
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from treeio.events.models import Event
from treeio.core.mo... | Python | 0 | @@ -2411,16 +2411,93 @@
etails%22)
+%0A self.fields%5B'details'%5D.widget.attrs.update(%7B'class': 'full-editor'%7D)
%0A%0A
|
e29c8e2d55464ac765db60a5cc213bb943b60742 | add [[Portal:Beer]] and [[Portal:Wine]] tagging request script | trunk/portalbeer.py | trunk/portalbeer.py | Python | 0.000001 | @@ -0,0 +1,1137 @@
+#!usr/bin/python%0Aimport sys, os, re%0Asys.path.append(os.environ%5B'HOME'%5D + '/stuffs/pywiki/pywikipedia')%0A%0Aimport wikipedia as wiki%0A%0A%0Asite = wiki.getSite()%0Apage = 'Portal:Beer/Selected picture/'%0A%0A#get page list%0Apages = %5B%5D%0Anum = 0%0Acontent = %22%22%22%5C%0A%7B%7BSelected... | |
525a6d214d3f6f9731c16bbf10ed150d1fa24021 | Create betweenness.py | src/betweenness.py | src/betweenness.py | Python | 0.000139 | @@ -0,0 +1,667 @@
+'''%0ACreated on Feb 20, 2019%0A%0A@author: Victor%0A'''%0A%0Afrom neo4j.v1 import GraphDatabase, basic_auth%0Adriver = GraphDatabase.driver(%22bolt://localhost%22)%0Asession = driver.session()%0A%0Aquery = '''CALL algo.betweenness.sampled.stream(null, null,%0A %7Bstrategy:'random', probability:1.0,... | |
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
class WebRTC(benchmark.Benchmark):
"""Obtains WebRTC metrics for a real-... | Python | 0.000005 | @@ -239,16 +239,67 @@
hmark%0A%0A%0A
+@benchmark.Disabled('android') # crbug.com/390233%0A
class We
|
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:
... | Python | 0.99958 | @@ -1359,15 +1359,19 @@
lta(
-years=1
+days=365.25
)):%0A
|
d9e11e2c5f14cee0ead87ced9afe85bdd299ab35 | Add python script to extract | extract_text.py | extract_text.py | Python | 0.000002 | @@ -0,0 +1,203 @@
+import json%0Af=open('raw.json')%0Ag=open('extracted1','a')%0Ai=1%0Afor s in f:%0A j=json.loads(s)%0A j=j%5B'text'%5D%0A h=json.dumps(j)%0A number=str(i) + ':' + ' '%0A g.write(h)%0A g.write('%5Cn%5Cn')%0A i=i+1%0A
| |
370d3a122fa0bfc4c6f57a5cd6e518968205611a | add another linechart example showing new features | examples/lineChartXY.py | examples/lineChartXY.py | Python | 0 | @@ -0,0 +1,894 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0AExamples for Python-nvd3 is a Python wrapper for NVD3 graph library.%0ANVD3 is an attempt to build re-usable charts and chart components%0Afor d3.js without taking away the power that d3.js gives you.%0A%0AProject location : https://github.... | |
aa4a3011775c12c19d690bbca91a07df4e033b1f | add urls for admin, zinnia, and serving static files | src/phyton/urls.py | src/phyton/urls.py | Python | 0 | @@ -0,0 +1,541 @@
+from django.conf.urls import patterns, include, url%0Afrom django.contrib import admin%0Afrom django.conf import settings%0Afrom django.conf.urls.static import static%0Aadmin.autodiscover()%0A%0Aurlpatterns = patterns('',%0A%0A # Admin URLs%0A url(r'%5Eadmin/doc/', include('django.contrib.admin... | |
b31def01a04a6ddb90e780985e43e8ad8e57e457 | Create uber.py | modules/uber.py | modules/uber.py | Python | 0.000036 | @@ -0,0 +1,43 @@
+def uber(self):%0A self.send_chan(%22Moi%22)%0A %0A
| |
27ab8b0436d784f44220512a91e699006b735d82 | test mpi | tests/test_mpi.py | tests/test_mpi.py | Python | 0.000001 | @@ -0,0 +1,291 @@
+# coding: utf-8%0A%0Aierr = mpi_init()%0Acomm = mpi_comm_world%0Aprint(%22mpi_comm = %22, comm)%0A%0Asize, ierr = mpi_comm_size(comm)%0Aprint(%22mpi_size = %22, size)%0A%0Arank, ierr = mpi_comm_rank(comm)%0Aprint(%22mpi_rank = %22, rank)%0A%0A#abort, ierr = mpi_abort(comm)%0A#print(%22mpi_abort = %22... | |
2ad40dc0e7f61e37ab768bedd53572959a088bb0 | Make app package | app/__init__.py | app/__init__.py | Python | 0 | @@ -0,0 +1,64 @@
+from flask import Flask%0A%0A%0Adef create_app(config_name):%0A pass%0A
| |
4981a1fa0d94020e20a8e7714af62a075f7d7874 | delete customers | delete_customers.py | delete_customers.py | Python | 0 | @@ -0,0 +1,264 @@
+@app.route('/customers/%3Cint:id%3E', methods=%5B'DELETE'%5D)%0Adef delete_customers(id):%0A index = %5Bi for i, customer in enumerate(customers) if customer%5B'id'%5D == id%5D%0A if len(index) %3E 0:%0A del customers%5Bindex%5B0%5D%5D%0A return make_response('', HTTP_204_NO_CONTENT)
| |
bc34aa231a3838ad7686541ed4bce58374a40b19 | Create __init__.py | physt/__init__.py | physt/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
e93bbc1b5091f9b6d583437aea05aa59c8233d2d | add audiotsmcli | examples/audiotsmcli.py | examples/audiotsmcli.py | Python | 0.000001 | @@ -0,0 +1,2638 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0Aaudiotsmcli%0A~~~~~~~~~~~%0A%0AChange the speed of an audio file without changing its pitch.%0A%22%22%22%0A%0Aimport argparse%0Aimport os%0A%0Afrom audiotsm.ola import ola%0Afrom audiotsm.io.wav import WavReader, WavWriter%0A%0A%0Adef... | |
6dd52499de049d76a1bea5914f47dc5b6aae23d7 | Add gspread example | xl.py | xl.py | Python | 0.000001 | @@ -0,0 +1,2005 @@
+#!/usr/bin/python%0A%0A#csv upload to gsheet%0A%0Aimport logging%0Aimport json%0Aimport gspread%0Aimport time%0Aimport re%0Afrom oauth2client.client import SignedJwtAssertionCredentials%0Afrom Naked.toolshed.shell import muterun_rb%0A%0Alogging.basicConfig(filename='/var/log/gspread.log',format='%25... | |
3e10a9fcb15e06699aa90016917b4ec5ec857faa | Solve task #506 | 506.py | 506.py | Python | 0.999999 | @@ -0,0 +1,622 @@
+class Solution(object):%0A def findRelativeRanks(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: List%5Bstr%5D%0A %22%22%22%0A def reverse_numeric(x, y):%0A return y - x%0A kek = sorted(nums, cmp=reverse_numeric)%0A l = ... | |
6c3867275693d4a771b9ff8df55aab18818344cd | add first app | app.py | app.py | Python | 0.000001 | @@ -0,0 +1,346 @@
+import tornado.ioloop%0Aimport tornado.web%0A%0Aclass MainHandler(tornado.web.RequestHandler):%0A def get(self):%0A self.write(%22Hello, world%22)%0A%0Adef make_app():%0A return tornado.web.Application(%5B%0A (r%22/%22, MainHandler),%0A %5D)%0A%0Aif __name__ == %22__main__%22:%... | |
8080153c65f4aa1d875a495caeee290fb1945081 | Add migration | media_management_api/media_auth/migrations/0005_delete_token.py | media_management_api/media_auth/migrations/0005_delete_token.py | Python | 0.000002 | @@ -0,0 +1,297 @@
+# Generated by Django 3.2.7 on 2021-09-15 20:00%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('media_auth', '0004_auto_20160209_1902'),%0A %5D%0A%0A operations = %5B%0A migrations.DeleteModel(%0A nam... | |
40b0f1cd33a053be5ab528b4a50bda404f0756dc | Add managment command Add_images_to_sections | gem/management/commands/Add_images_to_sections.py | gem/management/commands/Add_images_to_sections.py | Python | 0.000003 | @@ -0,0 +1,3341 @@
+from __future__ import absolute_import, unicode_literals%0A%0Aimport csv%0Afrom babel import Locale%0Afrom django.core.management.base import BaseCommand%0Afrom wagtail.wagtailimages.tests.utils import Image%0Afrom molo.core.models import Languages, SectionPage, Main, SectionIndexPage%0A%0A%0Aclass ... | |
69b900580e614ce494b9d1be0bee61464470cef7 | Create 6kyu_digital_root.py | Solutions/6kyu_digital_root.py | Solutions/6kyu_digital_root.py | Python | 0.000013 | @@ -0,0 +1,142 @@
+from functools import reduce%0A%0Adef digital_root(n):%0A while n%3E10:%0A n = reduce(lambda x,y: x+y, %5Bint(d) for d in str(n)%5D)%0A return n%0A
| |
6c08f3d3441cf660de910b0f3c49c3385f4469f4 | Add "Secret" channel/emoji example | examples/secret.py | examples/secret.py | Python | 0.000003 | @@ -0,0 +1,3240 @@
+import typing%0A%0Aimport discord%0Afrom discord.ext import commands%0A%0Abot = commands.Bot(command_prefix=commands.when_mentioned, description=%22Nothing to see here!%22)%0A%0A# the %60hidden%60 keyword argument hides it from the help command. %0A@bot.group(hidden=True)%0Aasync def secret(ctx: com... | |
e0338d39f611b2ca3f202151c49fc6a4b35bd580 | Add WallBuilder | exercise/WallBuilder.py | exercise/WallBuilder.py | Python | 0.000001 | @@ -0,0 +1,881 @@
+#!/usr/bin/env python3%0D%0A%0D%0A%0D%0Aclass Block(object):%0D%0A def __init__(self, width, height, **attr):%0D%0A self.__width = width%0D%0A self.__height = height%0D%0A%0D%0A def __eq__(self, another):%0D%0A return (self.__width == another.__width) and %5C%0D%0A ... | |
8a30bcc511647ed0c994cb2103dd5bed8d4671a8 | Create B_Temperature.py | Cas_4/Temperature/B_Temperature.py | Cas_4/Temperature/B_Temperature.py | Python | 0.998596 | @@ -0,0 +1,1156 @@
+import numpy as np %0Aimport matplotlib.pyplot as plt%0Aimport matplotlib.colors as colors%0Aimport cartopy.crs as ccrs%0A%0Afrom xmitgcm import open_mdsdataset %0Afrom cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER%0Aplt.ion()%0A%0Adir0 = '/homedata/bderembl/runmit/test_sout... | |
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 | Python | 0 | @@ -0,0 +1,636 @@
+from sqlalchemy import *%0Afrom migrate import *%0Afrom raggregate.guid_recipe import GUID%0A%0Adef upgrade(migrate_engine):%0A meta = MetaData(bind=migrate_engine)%0A comments = Table('comments', meta, autoload=True)%0A unreadc = Column('unread', Boolean, default=True)%0A in_reply_toc = ... | |
88d480f2c97bf7779afea34798c6c082f127f3a6 | Add missing client.py (#703) | client/client.py | client/client.py | Python | 0 | @@ -0,0 +1,325 @@
+import webapp2%0Aimport re%0A%0Aclass RedirectResource(webapp2.RequestHandler):%0A def get(self, path):%0A path = re.sub(r'/$', '', path)%0A self.redirect('/community/%25s' %25 path, permanent=True)%0A%0A# pylint: disable=invalid-name%0Aapp = webapp2.WSGIApplication(%5B%0A webapp2.Route(r'/... | |
38cf2a9f0c964c69df084d80ded6cf161ba7eb16 | Add elf read elf file. | elf.py | elf.py | Python | 0 | @@ -0,0 +1,814 @@
+import sys%0Afrom elftools.elf.elffile import ELFFile%0Afrom elftools.common.exceptions import ELFError%0Afrom elftools.elf.segments import NoteSegment%0A%0Aclass ReadELF(object):%0A%0A def __init__(self, file):%0A self.elffile = ELFFile(file)%0A%0A def get_build(self):%0A for seg... | |
d2f13fb17d3f9998af1a175dfd4e2bea4544fb3d | add example to just serialize matrix | examples/undocumented/python_modular/serialization_matrix_modular.py | examples/undocumented/python_modular/serialization_matrix_modular.py | Python | 0 | @@ -0,0 +1,535 @@
+from modshogun import *%0Afrom numpy import array%0A%0Aparameter_list=%5B%5B%5B%5B1.0,2,3%5D,%5B4,5,6%5D%5D%5D%5D%0A%0Adef serialization_matrix_modular(m):%0A%09feats=RealFeatures(array(m))%0A%09#feats.io.set_loglevel(0)%0A%09fstream = SerializableAsciiFile(%22foo.asc%22, %22w%22)%0A%09feats.save_ser... | |
e7f1439cae37facaedce9c33244b58584e219869 | Initialize P01_sendingEmail | books/AutomateTheBoringStuffWithPython/Chapter16/P01_sendingEmail.py | books/AutomateTheBoringStuffWithPython/Chapter16/P01_sendingEmail.py | Python | 0.000286 | @@ -0,0 +1,309 @@
+# This program uses the smtplib module to send emails%0A%0A# Connecting to an SMTP Server%0Aimport smtplib%0A%0Awith open('smtp_info') as config:%0A # smtp_cfg = %5Bemail, password, smtp server, port%5D%0A smtp_cfg = config.read().splitlines()%0A%0Asmtp_obj = smtplib.SMTP_SSL(smtp_cfg%5B2%5D, s... | |
e86047546693290556494bf00b493aa4ae770482 | add binding.gyp for node-gyp | binding.gyp | binding.gyp | Python | 0.000001 | @@ -0,0 +1,638 @@
+%7B%0A %22targets%22: %5B%0A %7B%0A %22target_name%22: %22rawhash%22,%0A %22sources%22: %5B%0A %22src/rawhash.cpp%22,%0A %22src/MurmurHash3.h%22,%0A %22src/MurmurHash3.cpp%22%0A %5D,%0A 'cflags': %5B '%3C!@(pkg-config --cflags libsparsehash)' %5D,%0A ... | |
888b27db4d91ebba91eb935532f961943453b7c8 | add update command to new certificate data model | paralapraca/management/commands/update_certificate_templates.py | paralapraca/management/commands/update_certificate_templates.py | Python | 0.000001 | @@ -0,0 +1,2094 @@
+# -*- coding: utf-8 -*-%0Afrom django.core.management.base import BaseCommand%0Afrom django.core.files import File%0A%0Afrom core.models import CertificateTemplate%0Afrom timtec.settings import STATIC_ROOT%0Afrom paralapraca.models import CertificateData, Contract%0A%0Aimport os%0A%0Aclass Command(B... | |
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 | Python | 0.000001 | @@ -0,0 +1,2016 @@
+from django.core.management.base import BaseCommand%0Afrom django.db.models import Q%0A%0Afrom corehq.apps.users.audit.change_messages import UserChangeMessage%0Afrom corehq.apps.users.models import UserHistory%0A%0A%0Aclass Command(BaseCommand):%0A help = %22Add locations removed change messages... | |
2a55c12d5f4e0bddd5fcb3ba7cc5ddf9bbd17764 | Update forward compatibility horizon to 2021-01-27 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1449,9 +1449,9 @@
1, 2
-6
+7
)%0A_F
|
a35e7746844af3443f3fa6c19bd32e3f3c64da82 | Update compat.py | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -4855,32 +4855,36 @@
bility%5D(https://
+www.
tensorflow.org/g
@@ -4899,32 +4899,9 @@
sion
-_compat#backward_forward
+s
).%0A%0A
|
545fa4ec537ba9615fb2a14fd1de24f4348f0d6c | Update forward compatibility horizon to 2020-04-21 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1383,17 +1383,17 @@
20, 4, 2
-0
+1
)%0A_FORWA
|
22b5de61e0ea458ae8a786886a5bdff4545b2f76 | Update forward compatibility horizon to 2018-11-19 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1139,17 +1139,17 @@
8, 11, 1
-8
+9
)%0A%0A%0A@tf_
|
942e71215ffb5baf5f23d6dd532f99832b161d0f | Update forward compatibility horizon to 2020-11-02 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1445,17 +1445,17 @@
20, 11,
-1
+2
)%0A_FORWA
|
da9706d518adf45b5d2dff480d80e78be12575ca | Update forward compatibility horizon to 2020-08-25 | tensorflow/python/compat/compat.py | tensorflow/python/compat/compat.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -1449,9 +1449,9 @@
8, 2
-4
+5
)%0A_F
|
fb133e260722fd02cb6f14ede15dbdb1fdf91af7 | Add gtk dependencies tests | test/test_dependencies.py | test/test_dependencies.py | Python | 0 | @@ -0,0 +1,1725 @@
+%22%22%22%0ACopyright (c) 2017, Michael Sonntag (sonntag@bio.lmu.de)%0A%0AAll rights reserved.%0A%0ARedistribution and use in source and binary forms, with or without%0Amodification, are permitted under the terms of the BSD License. See%0ALICENSE file in the root of the project.%0A%22%22%22%0A%0Aimp... | |
c09356487360ec373c98ec50800a450a3966a60f | define prompt function | lib.py | lib.py | Python | 0.000196 | @@ -0,0 +1,221 @@
+# weather-app%0A# lib.py%0A# Classes and functions for weather-app.%0A%0A%0A# Function definitions.%0A# ---------------------%0A%0A# Prompt for user input. Accepts a prompt message we want to show.%0Adef prompt(msg):%0A return input(msg)%0A
| |
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
... | Python | 0.999988 | @@ -321,24 +321,48 @@
def code():%0A
+ ret = self.slt(2,4)%0A
return(-
@@ -360,18 +360,19 @@
return(
--1
+ret
)%0A%0Adef s
@@ -545,16 +545,17 @@
- 3)))%0A%0A
+%0A
def flip
@@ -833,16 +833,16 @@
(n, x):%0A
-
retu
@@ -853,8 +853,301 @@
* 2%5Ex)%0A
+%0A%0Adef test():%0A b1 = 0x0100000081cd02ab7e56... |
e6bd5bbb3a46413b1ad164e0ef6ab66e89d9c95f | Add buildbot.py | buildbot.py | buildbot.py | Python | 0.000001 | @@ -0,0 +1,240 @@
+%EF%BB%BF#!/usr/bin/env python%0A# encoding: utf-8%0A%0Aproject_name = 'stub'%0A%0Adef configure(options):%0A pass%0A%0Adef build(options):%0A pass%0A%0Adef run_tests(options):%0A pass%0A%0Adef coverage_settings(options):%0A options%5B'required_line_coverage'%5D = 80.0%0A
| |
399cd799ae993412a6ad2455b8e11f4019aa9509 | Add models admin | td_biblio/admin.py | td_biblio/admin.py | Python | 0 | @@ -0,0 +1,946 @@
+# -*- coding: utf-8 -*-%0Afrom django.contrib import admin%0A%0Afrom .models import Author, Editor, Journal, Publisher, Entry, Collection%0A%0A%0Aclass AbstractHumanAdmin(admin.ModelAdmin):%0A list_display = ('last_name', 'first_name')%0A%0A%0Aclass AuthorAdmin(AbstractHumanAdmin):%0A pass%0A%0... | |
6d3f6951d846c50fcc1ff011f9129a4e1e3f7de1 | Add unit tests for BMI version of storm | testing/test_storm_bmi.py | testing/test_storm_bmi.py | Python | 0 | @@ -0,0 +1,1589 @@
+#! /usr/bin/env python%0A#%0A# Tests for the BMI version of %60storm%60.%0A#%0A# Call with:%0A# $ nosetests -sv%0A#%0A# Mark Piper (mark.piper@colorado.edu)%0A%0Afrom nose.tools import *%0Aimport os%0Aimport shutil%0Afrom subprocess import call%0A%0A# Global variables%0Astart_dir = os.getcwd()%0Ad... | |
9ef0e5e6dc50af7d5ccc27cc4d41abce72b51456 | Create runcount.py | bin/runcount.py | bin/runcount.py | Python | 0.000002 | @@ -0,0 +1,18 @@
+#!/usr/bin/python%0A
| |
c3a281c9271163ed1b68da52c6c43af50c18d4e8 | fix mempool_persist.py dump issue, missing sync with validation interface. | test/functional/mempool_persist.py | test/functional/mempool_persist.py | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on st... | Python | 0 | @@ -3252,17 +3252,16 @@
-#
self.nod
|
5c5bf274c72ef67a3a2a2e5d6713df910026dcdb | Add hash plugin | plugins/hash.py | plugins/hash.py | Python | 0.000001 | @@ -0,0 +1,524 @@
+import hashlib%0Aimport sys%0A%0A%0Aclass Plugin:%0A def on_command(self, bot, msg):%0A if len(sys.argv) %3E= 2:%0A algorithm = sys.argv%5B1%5D%0A contents = %22 %22.join(sys.argv%5B2:%5D)%0A if not contents:%0A contents = sys.stdin.read().str... | |
086371f56748da9fb68acc4aaa10094b6cf24fcb | Revert "Remove pgjsonb returner unit tests" | tests/unit/returners/test_pgjsonb.py | tests/unit/returners/test_pgjsonb.py | Python | 0 | @@ -0,0 +1,1706 @@
+# -*- coding: utf-8 -*-%0A'''%0Atests.unit.returners.pgjsonb_test%0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%0AUnit tests for the PGJsonb returner (pgjsonb).%0A'''%0A%0A# Import Python libs%0Afrom __future__ import absolute_import, print_function, unicode_literals%0Aimport logging%0A%0A# Import Salt... | |
077607b1b7fe705992c9f59f7dc94f2386aef4bb | add memcached | testutils/servers/memcache_server.py | testutils/servers/memcache_server.py | Python | 0.000001 | @@ -0,0 +1,1342 @@
+#%0A# Copyright (c) SAS Institute 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-2.0%0A#%0A# Unless re... | |
d95f24d43f3925a91176429cca1aaac30a0c55aa | Create java module main | genes/java/main.py | genes/java/main.py | Python | 0.000001 | @@ -0,0 +1,861 @@
+from genes import apt, debconf%0Aimport platform%0A%0Aclass Config:%0A OS = platform.system()%0A (DIST, _, CODE) = platform.linux_distribution()%0A REPO = DIST.lower() + '-' + CODE%0A%0Adef main():%0A if Config.OS == 'Linux':%0A if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian'... | |
6d87badb68f2e20a3907f670b9190956ebd127e8 | Create AddBinaryNumbers.py | math/AddBinaryNumbers/Python/AddBinaryNumbers.py | math/AddBinaryNumbers/Python/AddBinaryNumbers.py | Python | 0.000004 | @@ -0,0 +1,177 @@
+number1 = input(%22Enter the first number: %22)%0Anumber2 = input(%22Enter the second number: %22)%0A%0Aresult = (int(number1, 2) + int(number2, 2))%0A%0Aresult = bin(result)%0A%0Aprint(result%5B2:%5D)%0A%0A
| |
c71a43dae259299952cec082d33f003ecaeb9eab | Add marky test. | tests/py/test_markdown.py | tests/py/test_markdown.py | Python | 0 | @@ -0,0 +1,362 @@
+from gratipay.testing import Harness%0Afrom gratipay.utils import markdown%0A%0Afrom HTMLParser import HTMLParser%0A%0Aclass TestMarkdown(Harness):%0A%0A def test_marky_works(self):%0A md = %22**Hello World!**%22%0A actual = HTMLParser().unescape(markdown.marky(md)).strip()%0A ... | |
722b1d55c771e628ba82bbd5b8f8f5de047112af | Add a hex dump utility class. | tests/hexdumper.py | tests/hexdumper.py | Python | 0 | @@ -0,0 +1,553 @@
+# This hack by: Raymond Hettinger%0Aclass hexdumper:%0A %22%22%22Given a byte array, turn it into a string. hex bytes to stdout.%22%22%22%0A def __init__(self):%0A%09self.FILTER=''.join(%5B(len(repr(chr(x)))==3) and chr(x) or '.' %5C%0A%09%09%09%09%09%09 for x in range(256)%5D)%0A%0A def ... | |
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 = "191a16a25cc901e12535893b94aca169916d378c"
TFRT_SHA256 = "11b5d8d41bc4a6c1c6c7f9c6958c... | Python | 0 | @@ -228,48 +228,48 @@
= %22
-191a16a25cc901e12535893b94aca169916d378c
+4464fe2aad5cccfd7935b0f1767901eb08e99784
%22%0A
@@ -289,72 +289,72 @@
= %22
-11b5d8d41bc4a6c1c6c7f9c6958c834aef832162ca75806f799bb51c9119b93d
+cc3b5b95a2da47710ade8b2d3c0046cd05750f94db5f3feb58a224ae7163db2f
%22%0A%0A
|
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 = "6ca793b5d862ef6c50f242d77a811f06cce9b60a"
TFRT_SHA256 = "720b059a6b1d5757a76e56cf4a3a... | Python | 0 | @@ -228,132 +228,132 @@
= %22
-6ca793b5d862ef6c50f242d77a811f06cce9b60a%22%0A TFRT_SHA256 = %22720b059a6b1d5757a76e56cf4a3a791b58e5d020858f6b67b077839963bffe8
+83d3045fb5476bed115ae438871a228c1c682af1%22%0A TFRT_SHA256 = %22bdde8691c6a17c803de04423271b3534a421fd323627dc607b1fddf2f454e52
c%22%0A%0A
|
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 = "553df8c12e9ba5930b9b8065f1d012ea07c6044c"
TFRT_SHA256 = "477d0374b044c60cd018fdb17e7c... | Python | 0.000001 | @@ -228,133 +228,133 @@
= %22
-553df8c12e9ba5930b9b8065f1d012ea07c6044c%22%0A TFRT_SHA256 = %22477d0374b044c60cd018fdb17e7c6054e190e59e36e1a442eb5d1628efb2341d
+9dac1ed1ebc2350ada97b16093174a1a0bbd56d0%22%0A TFRT_SHA256 = %2289eea9ff0c9dfca61037c4da051a6ddf4d4598614f7ca08a240355d1635f8786
%22%0A%0A
|
2e53ae34ec03485302d5d7e6e5dd05707bbd1cf6 | Add camera tests | tests/test_camera.py | tests/test_camera.py | Python | 0 | @@ -0,0 +1,1695 @@
+import os%0A%0Aimport pygame%0A%0Afrom ..sappho import Camera%0Afrom .common import compare_pygame_surfaces%0A%0Aclass TestCamera(object):%0A def test_scroll(self):%0A # Create surface to render to%0A output_surface = pygame.surface.Surface((1, 1))%0A%0A # Create fixtures%0A ... | |
349918610081c8c02dc75fdafd47f647814dd63c | add converter of string to format maya understands for changing setting of fps | mindbender/maya/pythonpath/mayafpsconverter.py | mindbender/maya/pythonpath/mayafpsconverter.py | Python | 0 | @@ -0,0 +1,953 @@
+def mayafpsconverter(Sfps):%0A condition = 0%0A if Sfps == %22%22:%0A condition = 1%0A return Sfps%0A if Sfps == %2215%22:%0A condition = 1%0A return %22game%22%0A if Sfps == %2224%22:%0A condition = 1%0A return %22film%22%0A if Sfps == %2225%2... | |
3eafac9d71f7f885f66a63218557194291c649f7 | add config test | tests/test_config.py | tests/test_config.py | Python | 0.000001 | @@ -0,0 +1,762 @@
+import pytest%0A%0Afrom pytest_girder.assertions import assertStatusOk, assertStatus%0Afrom slicer_cli_web.config import PluginSettings%0A%0A%0A@pytest.mark.plugin('slicer_cli_web')%0Adef test_default_task_folder(server, admin, folder):%0A # Test the setting%0A resp = server.request('/system/se... | |
cfc89a542ebb9b1745bb8a7ce30f79dad12a16b7 | add mslib tool to build static C libraries. | yaku/tools/mslib.py | yaku/tools/mslib.py | Python | 0 | @@ -0,0 +1,795 @@
+import yaku.utils%0Aimport yaku.task%0A%0Adef setup(ctx):%0A env = ctx.env%0A%0A ctx.env%5B%22STLINK%22%5D = %5B%22lib.exe%22%5D%0A ctx.env%5B%22STLINK_TGT_F%22%5D = %5B%22/OUT:%22%5D%0A ctx.env%5B%22STLINK_SRC_F%22%5D = %5B%5D%0A ctx.env%5B%22STLINKFLAGS%22%5D = %5B%22/nologo%22%5D%0A... | |
367a7cdcb02d2d8c15e9a2375c5304b2ad9c89ac | Add the basic tools as functions to facilitate basic operations | ytranslate/tools.py | ytranslate/tools.py | Python | 0.000071 | @@ -0,0 +1,3800 @@
+%EF%BB%BF# Copyright (c) 2015, LE GOFF Vincent%0A# All rights reserved.%0A%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions are met:%0A%0A# * Redistributions of source code must retain the above copyright no... | |
8660c7fda8cc7290fadeed7a39f06218087d9401 | Add draft test module for linter | tests/test_linter.py | tests/test_linter.py | Python | 0 | @@ -0,0 +1,455 @@
+import logging%0Aimport pytest%0Afrom mappyfile.validator import Validator%0A%0A%0Adef validate(d):%0A v = Validator()%0A return v.validate(d)%0A%0A%0Adef get_from_dict(d, keys):%0A for k in keys:%0A if isinstance(k, int):%0A d = d%5B0%5D%0A else:%0A d = d... | |
ad7f9f785f9a4a4494127a9b2196e1fc64c9f3de | Add basic first tests for new report driven by "events" | tests/test_report.py | tests/test_report.py | Python | 0 | @@ -0,0 +1,1023 @@
+from django.test import TestCase%0A%0Afrom deep_collector.core import RelatedObjectsCollector%0A%0Afrom .factories import BaseModelFactory%0A%0A%0Aclass TestLogReportGeneration(TestCase):%0A def test_report_with_no_debug_mode(self):%0A obj = BaseModelFactory.create()%0A%0A collector... | |
272371f28369cca514d90f355e7771c133d11dcf | Create __openerp__.py | project_surgery/__openerp__.py | project_surgery/__openerp__.py | Python | 0.005291 | @@ -0,0 +1,1489 @@
+# -*- coding: utf-8 -*-%0A##############################################################################%0A#%0A# Author: Gideoni Silva (Omnes)%0A# Copyright 2013-2014 Omnes Tecnologia%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of t... | |
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 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 | @@ -110,16 +110,69 @@
port V1%0A
+from casexml.apps.phone.restore import RestoreConfig%0A
from cor
@@ -347,67 +347,8 @@
e):%0A
- from corehq.apps.ota.views import get_restore_response%0A
@@ -722,63 +722,313 @@
-get_restore_response(%0A couch_user.domain
+project = couch_user.project%0A ... |
e1a0029488d4cbf0581c21ceb1bd5db3c19bf3eb | add readme | algorithms/CommonFun.py | algorithms/CommonFun.py | Python | 0.000001 | @@ -0,0 +1,960 @@
+#!user/bin/env python%0A# coding:utf-8%0A%0Aimport sys%0Aimport random%0A%0Areload(sys)%0Asys.setdefaultencoding('utf-8')%0A%0Adef QuickSort(left, right, array):%0A%09l = left%0A%09r = right%0A%09while l %3C r:%0A%09%09base = array%5Br%5D%0A%09%09while (array%5Bl%5D %3C= base and l %3C r):%0A%09%09%0... | |
e0a7824253ae412cf7cc27348ee98c919d382cf2 | verify stderr for a failing clone into a non-empty dir | test/test_clone.py | test/test_clone.py | Python | 0.000001 | @@ -0,0 +1,1115 @@
+# -*- coding: utf-8 -*-%0A# This module is part of GitPython and is released under%0A# the BSD License: http://www.opensource.org/licenses/bsd-license.php%0A%0Afrom pathlib import Path%0Aimport re%0A%0Aimport git%0A%0Afrom .lib import (%0A TestBase,%0A with_rw_directory,%0A)%0A%0Aclass TestClo... | |
4683fc67d5171d8bb0391ac45f587fbc3e3c97fc | Add dependency installer for linux and mac osx | install_dependencies.py | install_dependencies.py | Python | 0 | @@ -0,0 +1,1928 @@
+import platform%0Aimport subprocess%0A%0A%22%22%22%0AThis is a standalone script that installs the required dependencies to run. It%0A*should* be platform independent, and should work regardless of what platform%0Ayou are running it on.%0A%0ATo install dependencies, download the DevAssist source and... | |
0fd7cdee45b54551bcfc901cece2e5cc9dec4555 | Add new test setup required for py.test/django test setup | test/test_setup.py | test/test_setup.py | Python | 0 | @@ -0,0 +1,292 @@
+import os%0Aimport django%0A%0Aos.environ%5B'DJANGO_SETTINGS_MODULE'%5D = 'testsettings'%0A%0A# run django setup if we are on a version of django that has it%0Aif hasattr(django, 'setup'):%0A # setup doesn't like being run more than once%0A try:%0A django.setup()%0A except RuntimeErro... | |
2014a7e3e785c9826575846a38b4703ef19946f4 | fix path stuff | test/test_tiles.py | test/test_tiles.py | 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 | @@ -1,12 +1,173 @@
+# This code is so you can run the samples without installing the package%0Aimport sys%0Aimport os%0Asys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))%0A%0A
import math%0A
|
dbfa14401c0b50eb1a3cac413652cb975ee9d41f | Add valid directory cleaner helper test | ocw-ui/backend/tests/test_directory_helpers.py | ocw-ui/backend/tests/test_directory_helpers.py | Python | 0.000003 | @@ -0,0 +1,598 @@
+import os%0Aimport unittest%0Afrom webtest import TestApp%0A%0Afrom ..run_webservices import app%0Afrom ..directory_helpers import _get_clean_directory_path%0A%0Atest_app = TestApp(app)%0A%0Aclass TestDirectoryPathCleaner(unittest.TestCase):%0A PATH_LEADER = '/tmp/foo'%0A VALID_CLEAN_DIR = '/tm... | |
5ee4f6fd50da0a7115f8ca0ab29c4388eaef13a6 | add probabitity function decomposition | src/probability.py | src/probability.py | Python | 0.003014 | @@ -0,0 +1,978 @@
+from __future__ import division%0A%0Afrom math import log%0Afrom scipy.special import binom%0Aimport numpy as np%0A%0Adef C(p, p0):%0A p1 = 1 - p0%0A return -p0*log(p0, 2) + p0*p*log(p0*p, 2) - (p1+p0*p)*log(p1+p0*p, 2)%0A%0Adef P(c, p0, eps=0.00001):%0A left = 0%0A right = 1%0A while ... | |
8e8a1a33d8bedcb597020f9723c03d0f6af57522 | Add python script | send.py | send.py | Python | 0.000302 | @@ -0,0 +1,777 @@
+import sys%0Aimport os%0A%0Atry:%0A sys.path.append(os.path.join(os.environ%5B'ANDROID_VIEW_CLIENT_HOME'%5D, 'src'))%0Aexcept:%0A pass%0A%0Afrom com.dtmilano.android.viewclient import ViewClient%0A%0Anumber = sys.argv%5B2%5D%0Atext = sys.argv%5B3%5D%0A%0Aprint(%22Sending WhatsApp...%22)%0Aprint... | |
61f806ffc68c41dfbb926ea6825292eabed46966 | Add sorting code | sort.py | sort.py | Python | 0.000007 | @@ -0,0 +1,322 @@
+#!/usr/bin/env python%0A%0Aimport re%0Aimport sys%0A%0Asort = %7B%7D%0Aregex = re.compile(r'TBX_API %5Cw* %5C*?(%5Cw*)%5C(.*')%0Afor line in sys.stdin.readlines():%0A result = regex.match(line)%0A if not result:%0A sort%5Bline%5D = line%0A else:%0A sort%5Bresult.group(1)%5D = l... | |
3e885137d23e7618b78f207ecd6b2f6118a4a0dc | add a test file | test.py | test.py | Python | 0.000001 | @@ -0,0 +1,41 @@
+#!/usr/bin/python%0Aimport cgi%0Acgi.test()%0A%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.