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
16275938769c16c79b89349612e8e7b2891de815
Add migration for user manager
kolibri/auth/migrations/0008_auto_20180222_1244.py
kolibri/auth/migrations/0008_auto_20180222_1244.py
Python
0.000001
@@ -0,0 +1,519 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.13 on 2018-02-22 20:44%0Afrom __future__ import unicode_literals%0A%0Aimport kolibri.auth.models%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('kolibriauth', '0007_auto_20171...
74450edae5d327659ec618f7e160bc5dd37bd512
添加在Python2DWrapper中使用的Python文件
PluginSDK/BasicRecon/Python/Py2C.py
PluginSDK/BasicRecon/Python/Py2C.py
Python
0
@@ -0,0 +1,1048 @@ +from PIL import Image%0Aimport numpy as np%0A%0A%0Aimport matplotlib%0A%0A%22%22%22%0AThis is Module Py2C for c++%0A%22%22%22%0A%0Aclass A: pass%0A%0Aclass B: pass%0A%0Adef ShowImage(image, width, height):%0A img = %5B%5B%5D%5D * width%0A for x in range(width):%0A for y ...
883aac8a282d4525e82d3eb151ea293c5577424c
Add data migration to create gesinv
core/migrations/0002_auto_20141008_0853.py
core/migrations/0002_auto_20141008_0853.py
Python
0
@@ -0,0 +1,790 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Adef create_extra_users(apps, schema_editor):%0A user = apps.get_model(%22auth.User%22).objects.create(username='GesInv-ULL')%0A apps.get_model(%22core%22, %22UserProfile%22).o...
eceffd58e62378287aacab29f4849d0a6e983e49
Factor out the timestamp-related functionality to a class that outputs json strings
src/Timestamp.py
src/Timestamp.py
Python
0.999997
@@ -0,0 +1,1093 @@ +#!/usr/bin/python%0Aimport time%0A%0Aclass Timestamp:%0A hour = -1%0A minute = -1%0A%0A def __init__(self, date):%0A%09self.year = int(date%5B0:4%5D)%0A %09self.month = int(self.month_name_to_num(date%5B5:8%5D))%0A %09self.day = int(date%5B9:11%5D)%0A%09try:%0A%09 self.hour = int(d...
e6181c5d7c95af23ee6d51d125642104782f5cf1
Add solution for 136_Single Number with XOR operation.
Python/136_SingleNumber.py
Python/136_SingleNumber.py
Python
0
@@ -0,0 +1,555 @@ +class Solution(object):%0A def singleNumber(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: int%0A %22%22%22%0A%0A #Using XOR to find the single number.%0A #Because every number appears twice, while N%5EN=0, 0%5EN=N,%0A #XOR is cum...
83ebfe1ff774f8d5fb5ae610590ca8fca1c87100
add migration for on_delete changes
app/backend/wells/migrations/0034_auto_20181127_0230.py
app/backend/wells/migrations/0034_auto_20181127_0230.py
Python
0
@@ -0,0 +1,2132 @@ +# Generated by Django 2.1.3 on 2018-11-27 02:30%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('wells', '0033_auto_20181119_1857'),%0A %5D%0A%0A operations = %5B%0A mi...
59c62bb0f13be7910bf2280126a0909ffbe716f0
Create simple_trie.py
simple_trie.py
simple_trie.py
Python
0.000002
@@ -0,0 +1,1055 @@ +class Trie:%0A def __init__(self):%0A self.node = %7B%7D%0A self.word = None%0A %0A def add(self,string):%0A node = self.node%0A currentNode = None%0A for char in string:%0A currentNode = node.get(char, None)%0A if not currentNode...
983f041b25b0de77f3720378e12b22e7d8f2e040
Create same_first_last.py
Python/CodingBat/same_first_last.py
Python/CodingBat/same_first_last.py
Python
0.00113
@@ -0,0 +1,116 @@ +# http://codingbat.com/prob/p179078%0A%0Adef same_first_last(nums):%0A return ( len(nums) %3E= 1 and nums%5B0%5D == nums%5B-1%5D )%0A
ae6c6f3aa0863b919e0f00543cab737ae9e94129
Add bubblesort as a placeholder for a refactored implementation
bubblesort.py
bubblesort.py
Python
0
@@ -0,0 +1,1182 @@ +#!/usr/bin/env python%0A%0A# TBD: Sort animation could take a pattern that it assumed to be %22final%22,%0A# shuffle it, then take a sort generator that produced a step in the sort%0A# algorithm at every call. It would be sorting shuffled indices that the%0A# animation would use to construct each fr...
3852ae6fcf6271ef19a182e5dfb199e4539536a1
Create 6kyu_spelling_bee.py
Solutions/6kyu/6kyu_spelling_bee.py
Solutions/6kyu/6kyu_spelling_bee.py
Python
0.000103
@@ -0,0 +1,268 @@ +from itertools import zip_longest as zlo%0A%0Adef how_many_bees(hive):%0A return sum(''.join(x).count('bee') + ''.join(x).count('eeb') for x in hive) + %5C%0A sum(''.join(y).count('bee') + ''.join(y).count('eeb') for y in zlo(*hive, fillvalue = '')) if hive else 0%0A
ddb58206a52ef46f5194bf6f5c11ac68b16ab9a8
Create minimum-window-subsequence.py
Python/minimum-window-subsequence.py
Python/minimum-window-subsequence.py
Python
0.00046
@@ -0,0 +1,871 @@ +# Time: O(S * T)%0A# Space: O(S)%0A%0Aclass Solution(object):%0A def minWindow(self, S, T):%0A %22%22%22%0A :type S: str%0A :type T: str%0A :rtype: str%0A %22%22%22%0A dp = %5B%5BNone for _ in xrange(len(S))%5D for _ in xrange(2)%5D%0A for i, c in ...
077d4b8954918ed51c43429efd74b4911083c4f4
Add instance_id field.
kolibri/content/migrations/0002_auto_20160630_1959.py
kolibri/content/migrations/0002_auto_20160630_1959.py
Python
0
@@ -0,0 +1,1602 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.1 on 2016-06-30 19:59%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport kolibri.content.models%0Aimport uuid%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('conte...
48172fa94043fb004dfaf564afac42e632be2bc0
add test for DataManager
mpf/tests/test_DataManager.py
mpf/tests/test_DataManager.py
Python
0
@@ -0,0 +1,1460 @@ +%22%22%22Test the bonus mode.%22%22%22%0Aimport time%0Afrom unittest.mock import mock_open, patch%0A%0Afrom mpf.file_interfaces.yaml_interface import YamlInterface%0Afrom mpf.core.data_manager import DataManager%0Afrom mpf.tests.MpfTestCase import MpfTestCase%0A%0A%0Aclass TestDataManager(MpfTestCas...
3dcfc2f7e9a2ed696a2b4a006e4d8a233a494f2f
move sitemap to core
djangobb_forum/sitemap.py
djangobb_forum/sitemap.py
Python
0
@@ -0,0 +1,304 @@ +from django.contrib.sitemaps import Sitemap%0Afrom djangobb_forum.models import Forum, Topic%0A%0A%0Aclass SitemapForum(Sitemap):%0A priority = 0.5%0A%0A def items(self):%0A return Forum.objects.all()%0A%0A%0Aclass SitemapTopic(Sitemap):%0A priority = 0.5%0A%0A def items(self):%0A ...
a6f26893189376f64b6be5121e840acc4cfeebae
ADD utils.py : model_to_json / expand_user_database methods
packages/syft/src/syft/core/node/common/tables/utils.py
packages/syft/src/syft/core/node/common/tables/utils.py
Python
0.000004
@@ -0,0 +1,2401 @@ +# grid relative%0Afrom .groups import Group%0Afrom .usergroup import UserGroup%0Afrom .roles import Role%0A%0A%0Adef model_to_json(model):%0A %22%22%22Returns a JSON representation of an SQLAlchemy-backed object.%22%22%22%0A json = %7B%7D%0A for col in model.__mapper__.attrs.keys():%0A ...
d7d0af678a52b357ecf479660ccee1eab43c443f
Add gender choices model
accelerator/models/gender_choices.py
accelerator/models/gender_choices.py
Python
0.000534
@@ -0,0 +1,364 @@ +# MIT License%0A# Copyright (c) 2017 MassChallenge, Inc.%0A%0Afrom __future__ import unicode_literals%0A%0Aimport swapper%0A%0Afrom accelerator_abstract.models import BaseGenderChoices%0A%0A%0A%0Aclass GenderChoices(BaseGenderChoices):%0A class Meta(BaseGenderChoices.Meta):%0A swappable = s...
95edeaa711e8c33e1b431f792e0f2638126ed461
Add test case for dynamic ast
pymtl/tools/translation/dynamic_ast_test.py
pymtl/tools/translation/dynamic_ast_test.py
Python
0.000002
@@ -0,0 +1,2581 @@ +#=======================================================================%0A# verilog_from_ast_test.py%0A#=======================================================================%0A# This is the test case that verifies the dynamic AST support of PyMTL.%0A# This test is contributed by Zhuanhao Wu throu...
49cab51aa8697a56c7cf74e45b77d9a20ad1a178
add topk/gen.py
topk/gen.py
topk/gen.py
Python
0
@@ -0,0 +1,449 @@ +#!/usr/bin/python%0A%0Aimport random%0A%0Aword_len = 5%0Aalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-'%0A%0Aoutput = open('word_count', 'w')%0Awords = set()%0AN = 1000*1000%0Afor x in xrange(N):%0A arr = %5Brandom.choice(alphabet) for i in range(word_len)%5D%0A w...
c5da52c38d280873066288977f021621cb9653d0
Apply orphaned migration
project/apps/api/migrations/0010_remove_chart_song.py
project/apps/api/migrations/0010_remove_chart_song.py
Python
0
@@ -0,0 +1,345 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('api', '0009_auto_20150722_1041'),%0A %5D%0A%0A operations = %5B%0A migrations.RemoveField...
ab5d1fd5728b9c2f27d74c2896e05a94b061f3f9
add config.py
config.py
config.py
Python
0.000002
@@ -0,0 +1,49 @@ +# twilio account details%0Aaccount = %22%22%0Atoken = %22%22%0A
42cc2864f03480e29e55bb0ef0b30e823c11eb2f
complete check online window
check_online_window.py
check_online_window.py
Python
0
@@ -0,0 +1,1229 @@ +import tkinter as tk%0Aimport tkinter.messagebox as tkmb%0Afrom online_check import CheckSomeoneOnline%0A%0Aclass open_check_online_window():%0A def __init__(self, x, y):%0A self.co = tk.Tk()%0A self.co.title('enter ip to check')%0A self.co.resizable(False, False)%0A s...
956da3bc7ff7971b9b6cc76495fcb5b2e4145d6e
Handle smtplib.SMTPRecipientsRefused and defer the message properly.
mailerdev/mailer/engine.py
mailerdev/mailer/engine.py
import time from lockfile import FileLock from socket import error as socket_error from models import Message, DontSendEntry, MessageLog from django.core.mail import send_mail as core_send_mail ## configuration settings # @@@ eventually move to settings.py # when queue is empty, how long to wait (in seconds) before...
Python
0.000377
@@ -5,16 +5,31 @@ rt time%0A +import smtplib%0A from loc @@ -2466,16 +2466,17 @@ except +( socket_e @@ -2480,16 +2480,48 @@ t_error, + smtplib.SMTPRecipientsRefused), err:%0A
05b9859fb7d4577dfa95ec9edd3a6f16bf0fd86e
Create __init__.py
fade/fade/__init__.py
fade/fade/__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
49a1cfa758f3b704bacebfcf48d45679fe2658e1
fix #3043
gratipay/utils/history.py
gratipay/utils/history.py
from datetime import datetime from decimal import Decimal from psycopg2 import IntegrityError def get_end_of_year_balance(db, participant, year, current_year): if year == current_year: return participant.balance if year < participant.claimed_time.year: return Decimal('0.00') balance = db...
Python
0.000001
@@ -2967,32 +2967,59 @@ er'%5D == username + and t%5B'context'%5D != 'take' ),%0A r
1b6fecb5819fbead0aadcc1a8669e915542c5ea0
Add script for gameifying testing
other/testing-game.py
other/testing-game.py
Python
0
@@ -0,0 +1,1654 @@ +#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0Aimport argparse%0Aimport os%0Aimport subprocess%0Aimport re%0A%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument('-d', '--directory', help='The directory to search for files in', required=False, default=os.getcwd())%0Aargs = parser.parse_args...
908013aa5e64589b6c1c6495812a13109244a69a
add dottests testconfig, but leave it deactivted yet. lots of import failures, since no imports are declared explicitly
src/icalendar/tests/XXX_test_doctests.py
src/icalendar/tests/XXX_test_doctests.py
Python
0
@@ -0,0 +1,967 @@ +from interlude import interact%0A%0Aimport doctest%0Aimport os.path%0Aimport unittest%0A%0A%0AOPTIONFLAGS = doctest.NORMALIZE_WHITESPACE %7C doctest.ELLIPSIS%0ADOCFILES = %5B%0A 'example.txt',%0A 'groupscheduled.txt',%0A 'multiple.txt',%0A 'recurrence.txt',%0A 'small.txt'%0A%5D%0ADOCMO...
4a99dcd629a830ad1ec0c658f312a4793dec240b
add basic file for parser
RedBlue/Parser3.py
RedBlue/Parser3.py
Python
0.000001
@@ -0,0 +1,85 @@ +%0Aclass Parser(object):%0A%0A @classmethod%0A def read_html(cls, html):%0A pass%0A%0A
0648ca26ba195e4d5ce55d801975a161907e655f
Add test for translation
aldryn_faq/tests/test_aldryn_faq.py
aldryn_faq/tests/test_aldryn_faq.py
Python
0.000001
@@ -0,0 +1,2926 @@ +# -*- coding: utf-8 -*-%0A%0Afrom __future__ import unicode_literals%0A%0Afrom django.test import TestCase # , TransactionTestCase%0A# from django.utils import translation%0Afrom hvad.test_utils.context_managers import LanguageOverride%0A%0Afrom aldryn_faq.models import Category, Question%0A%0AEN_C...
d1f71e1c6468799247d07d810a6db7d0ad5f89b0
add support for jinja2 template engine
alaocl/jinja2.py
alaocl/jinja2.py
Python
0
@@ -0,0 +1,1857 @@ +from alaocl import *%0A%0A#__all__ = (%0A# 'addOCLtoEnvironment',%0A#)%0A_FILTERS = %7B%0A 'asSet': asSet,%0A 'asBag': asBag,%0A 'asSeq': asSeq,%0A%7D%0A%0A_GLOBALS = %7B%0A 'floor': floor,%0A 'isUndefined': isUndefined,%0A 'oclIsUndefined': oclIsUndefined,%0A 'oclIsKindOf': ...
7cb62f554fa293a2ba4d0456ed8d04e8f277d2c1
Add migrations/0146_clean_lexeme_romanised_3.py
ielex/lexicon/migrations/0146_clean_lexeme_romanised_3.py
ielex/lexicon/migrations/0146_clean_lexeme_romanised_3.py
Python
0
@@ -0,0 +1,753 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals, print_function%0Afrom django.db import migrations%0A%0A%0Adef forwards_func(apps, schema_editor):%0A Lexeme = apps.get_model(%22lexicon%22, %22Lexeme%22)%0A replaceMap = %7B%0A '%CE%BB': '%CA%8E',%0A '%CF%86': '%C9...
8f1b1ef01e74782f57da9c9489a3a7f6555bbee6
Add tests for reports views.
annotran/reports/test/views_test.py
annotran/reports/test/views_test.py
Python
0
@@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*-%0Aimport mock%0Aimport pytest%0Afrom pyramid import httpexceptions%0A%0A%0Afrom annotran.reports import views%0A%0A%0A%0A_SENTINEL = object()
691ae15cb0f46400762c27305fb74f57fa1ffccf
Implement account.py
src/account.py
src/account.py
Python
0.000009
@@ -0,0 +1,2801 @@ +from datetime import datetime%0Afrom hashlib import md5%0Afrom re import match, search, DOTALL%0Afrom requests.sessions import Session%0Afrom bs4 import BeautifulSoup%0A%0ABASE_URL = 'https://usereg.tsinghua.edu.cn'%0ALOGIN_PAGE = BASE_URL + '/do.php'%0AINFO_PAGE = BASE_URL + '/user_info.php'%0A%0Ac...
940299a7bfd967653899b176ce76e6f1cf02ca83
Add script to generate pairs of LIWC categories
liwcpairs2es.py
liwcpairs2es.py
Python
0
@@ -0,0 +1,2003 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Afrom elasticsearch import Elasticsearch, helpers%0Afrom collections import Counter%0Afrom datetime import datetime%0A%0A%0Adef find_pairs(list1, list2):%0A pairs = %5B%5D%0A if list1 and list2:%0A for item1 in list1:%0A for it...
73292532767d736a77ec8b122cfd4ff19b7d991b
Create Account dashboard backend
UI/account_dash.py
UI/account_dash.py
Python
0.000001
@@ -0,0 +1,2847 @@ +# -*- coding: utf-8 -*-%0Aimport threading%0Afrom PyQt4 import QtCore, QtGui%0Afrom qt_interfaces.account_dash_ui import Ui_AccountDash%0Afrom engine import StorjEngine%0Afrom utilities.tools import Tools%0A%0A%0A# Synchronization menu section #%0Aclass AccountDashUI(QtGui.QMainWindow):%0A%0A def...
53258a9ffd869dd958fd818874b2c8406acca143
add pytest for util.store
pytests/util/test_store.py
pytests/util/test_store.py
Python
0
@@ -0,0 +1,909 @@ +import pytest%0A%0Aimport util.store%0A%0A%0A@pytest.fixture%0Adef emptyStore():%0A return util.store.Store()%0A%0A%0A@pytest.fixture%0Adef store():%0A return util.store.Store()%0A%0A%0Adef test_get_of_unset_key(emptyStore):%0A assert emptyStore.get(%22any-key%22) == None%0A assert emptyS...
5bde5b5904abc30506e56865cd58fd88a97942aa
Add `deprecated` decorator
linux/keyman-config/keyman_config/deprecated_decorator.py
linux/keyman-config/keyman_config/deprecated_decorator.py
Python
0.000001
@@ -0,0 +1,858 @@ +#!/usr/bin/python3%0A# based on https://stackoverflow.com/a/40301488%0Aimport logging%0A%0A%0Astring_types = (type(b''), type(u''))%0A%0A%0Adef deprecated(reason):%0A if isinstance(reason, string_types):%0A # The @deprecated is used with a 'reason'.%0A def decorator(func1):%0A ...
f6519493dd75d7f5a8b65a952b5d7048bd101ec4
Create locationanalysis.py
locationanalysis.py
locationanalysis.py
Python
0.000001
@@ -0,0 +1,155 @@ +import json%0A%0Aprint 'test'%0A%0Af = open('location.json', 'r')%0Ajsoncontent = f.read()%0Aprint jsoncontent%0A%0Alocation = json.loads(jsoncontent)%0Aprint len(location)%0A
f6d417e69efa4554008bc441a5c82a5b9f93a082
Add sql.conventions.objects.Items
garage/sql/conventions/objects.py
garage/sql/conventions/objects.py
Python
0.003446
@@ -0,0 +1,798 @@ +__all__ = %5B%0A 'Items',%0A%5D%0A%0Afrom garage.functools import nondata_property%0Afrom garage.sql.utils import insert_or_ignore, make_select_by%0A%0A%0Aclass Items:%0A %22%22%22A thin layer on top of tables of two columns: (id, value)%22%22%22%0A%0A def __init__(self, table, id_name, valu...
313f5c8c54002a736a323410c5d9ec96fcc2f50b
Create RespostaVer.py
backend/Models/Predio/RespostaVer.py
backend/Models/Predio/RespostaVer.py
Python
0
@@ -0,0 +1,189 @@ +from Framework.Resposta import Resposta%0Afrom Models.Campus.Campus import Campus as ModelCampus%0A%0Aclass RespostaVer(Resposta):%0A%0A%09def __init__(self,campus):%0A%09%09self.corpo = ModelCampus(campus)%0A
95f5b7cd2325a61f537bffb783e950b30c97da5f
Add a demo about learning the shape parameter of gamma dist
bayespy/demos/gamma_shape.py
bayespy/demos/gamma_shape.py
Python
0
@@ -0,0 +1,484 @@ +%0A%0Afrom bayespy import nodes%0Afrom bayespy.inference import VB%0A%0A%0Adef run():%0A%0A a = nodes.GammaShape(name='a')%0A b = nodes.Gamma(1e-5, 1e-5, name='b')%0A%0A tau = nodes.Gamma(a, b, plates=(1000,), name='tau')%0A tau.observe(nodes.Gamma(10, 20, plates=(1000,)).random())%0A%0A ...
538417b8522f5805d3a9cd59c0cdc71073c122ac
Remove admin requirement for shared network actions
openstack_dashboard/dashboards/project/networks/tables.py
openstack_dashboard/dashboards/project/networks/tables.py
# Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Python
0.000001
@@ -1130,400 +1130,47 @@ ass -CheckNetworkEditable(object):%0A %22%22%22Mixin class to determine the specified network is editable.%22%22%22%0A%0A def allowed(self, request, datum=None):%0A # Only administrator is allowed to create and manage shared networks.%0A if datum and datum.shared:%0A ...
d90bab60bf5f5423a7fee57ece8cd44acba113c1
setup the environment and print the 'Hello World'
Base/D_00_HelloWorld.py
Base/D_00_HelloWorld.py
Python
0.999999
@@ -0,0 +1,243 @@ +__author__ = 'James.Hongnian.Zhang'%0A# This is my first Python program.%0A# This means I have setup the environment for Python.%0A# Download it from https://www.python.org and install it.%0A# Then add it to your PATH%0A# That's it.%0Aprint 'Hello World'%0A
3c618e8424e64a62168c2a2c683748d2496ef7cb
Add Urban Dictionary module.
modules/urbandictionary.py
modules/urbandictionary.py
Python
0
@@ -0,0 +1,1128 @@ +%22%22%22Looks up a term from urban dictionary%0A@package ppbot%0A%0A@syntax ud %3Cword%3E%0A%0A%22%22%22%0Aimport requests%0Aimport json%0A%0Afrom modules import *%0A%0Aclass Urbandictionary(Module):%0A%0A def __init__(self, *args, **kwargs):%0A %22%22%22Constructor%22%22%22%0A Mod...
d8fff759f2bff24f20cdbe98370ede9e5f3b7b13
Add 2D helmholtz convergence test
convergence_tests/2D_helmholtz.py
convergence_tests/2D_helmholtz.py
Python
0
@@ -0,0 +1,1639 @@ +from __future__ import absolute_import, division%0Afrom firedrake import *%0Aimport numpy as np%0A%0A%0Adef helmholtz_mixed(x, V1, V2):%0A # Create mesh and define function space%0A mesh = UnitSquareMesh(2**x, 2**x)%0A V1 = FunctionSpace(mesh, *V1, name=%22V%22)%0A V2 = FunctionSpace(mes...
478995eb7ab80d8c2c11998d871f395cbc61cb3f
make data column header objects iterable
corehq/apps/reports/datatables.py
corehq/apps/reports/datatables.py
class DTSortType: NUMERIC = "title-numeric" class DTSortDirection: ASC = "asc" DSC = "desc" class DataTablesColumn(object): rowspan = 1 def __init__(self, name, span=0, sort_type=None, sort_direction=None, help_text=None, sortable=True): self.html = name self.css_span = span ...
Python
0.000003
@@ -5470,14 +5470,95 @@ olumns%0A%0A -%0A%0A + def __iter__(self):%0A for column in self.header:%0A yield column %0A%0A%0A%0A
c98109af519241a28c40217e8378a19903d4db0b
fix broken logic for fluff calcs using indicator_calculator
corehq/fluff/calculators/xform.py
corehq/fluff/calculators/xform.py
from datetime import timedelta from corehq.fluff.calculators.logic import ANDCalculator, ORCalculator import fluff def default_date(form): return form.received_on # operators EQUAL = lambda input, reference: input == reference NOT_EQUAL = lambda input, reference: input != reference IN = lambda input, reference_li...
Python
0.000001
@@ -2097,24 +2097,28 @@ %0A if +not self.indicat
5206a15d59bc8881629c48bb4136bb1a9cb7b4d0
Create ms_old_identifiers.py
identifiers/ms_old_identifiers.py
identifiers/ms_old_identifiers.py
Python
0.000111
@@ -0,0 +1,743 @@ +from identifier import *%0Aimport collections %0A %0ACFBInfo = collections.namedtuple('CFBInfo', %5B'name', 'descripion', 'pattern'%5D) %0A%0AOFFICE_PATTERNS = %5B%0A 'D0 CF 11 E0 A1 B1 1A E1'%0A%5D%0A%0AFILE_PATTERNS = %5B%0A CFBInfo('DOC', 'Microsoft Word 97-2003', bytes.fromhex('EC A5 C1 20'...
835a7b9bea1b006b5a096665d706b64b778d45ab
fix default param
python/federatedml/ensemble/test/hack_encrypter.py
python/federatedml/ensemble/test/hack_encrypter.py
Python
0.000002
@@ -0,0 +1,118 @@ +class HackDecrypter():%0A%0A def encrypt(self, val):%0A return val%0A%0A def decrypt(self, val):%0A return val
aeb671484bc8e68a8aba3eaa80523ae153b8e9c9
Add files via upload
youtube_list.py
youtube_list.py
Python
0
@@ -0,0 +1,1367 @@ +from apiclient.discovery import build%0Afrom apiclient.errors import HttpError%0Afrom oauth2client.tools import argparser%0Aimport pafy%0A%0ADEVELOPER_KEY = %22AIzaSyCsrKjMf7_mHYrT6rIJ-oaA6KL5IYg389A%22%0AYOUTUBE_API_SERVICE_NAME = %22youtube%22%0AYOUTUBE_API_VERSION = %22v3%22%0A%0A%0Adef youtube_s...
0770fab7c4985704e2793ab98150c9f1a2729e01
Create easy_17_ArrayAdditionI.py
easy_17_ArrayAdditionI.py
easy_17_ArrayAdditionI.py
Python
0.000034
@@ -0,0 +1,659 @@ +import itertools%0A%0A#################################################%0A# This function will see if there is any #%0A# possible combination of the numbers in #%0A# the array that will give the largest number #%0A#################################################%0Adef ArrayAdditionI(...
1cc15f3ae9a0b7fa5b2dae4bcdd9f0f3c061ce4d
Fix relate_name on Bug model
reclama/sprints/migrations/0002_auto_20150130_1751.py
reclama/sprints/migrations/0002_auto_20150130_1751.py
Python
0
@@ -0,0 +1,454 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('sprints', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ...
de65724abf0a01660e413189d1738a72d5afd297
add simple test for create_wininst.
bento/commands/tests/test_wininst.py
bento/commands/tests/test_wininst.py
Python
0
@@ -0,0 +1,1539 @@ +import os%0Aimport shutil%0Aimport tempfile%0Aimport zipfile%0A%0Aimport os.path as op%0A%0Aimport mock%0A%0Aimport bento.commands.build_wininst%0A%0Afrom bento.commands.build_wininst %5C%0A import %5C%0A create_wininst%0Afrom bento.compat.api.moves %5C%0A import %5C%0A unittest%...
edfd6ddf8e7af41a8b5ed228360b92377bfc8964
add 167. First 200 problems have been finished!
vol4/167.py
vol4/167.py
Python
0
@@ -0,0 +1,1081 @@ +import time%0A%0Adef ulam(a, b):%0A%09yield a%0A%09yield b%0A%09u = %5Ba, b%5D%0A%09even_element = 0%0A%09while even_element == 0 or u%5B-1%5D %3C 2 * even_element:%0A%09%09sums = %7B%7D%0A%09%09for i in range(len(u)):%0A%09%09%09for j in range(i + 1, len(u)):%0A%09%09%09%09sums%5Bu%5Bi%5D + u%5Bj%5...
a7db805db727fbe1c6e9f37152e6c3c2f94d406d
add require internet
i3pystatus/external_ip.py
i3pystatus/external_ip.py
from i3pystatus import IntervalModule, formatp import GeoIP import urllib.request class ExternalIP(IntervalModule): """ Shows the external IP with the country code/name. Requires the PyPI package `GeoIP`. .. rubric:: Available formatters * {country_name} the full name of the country from the I...
Python
0.000013
@@ -39,16 +39,67 @@ formatp +%0Afrom i3pystatus.core.util import internet, require %0A%0Aimport @@ -489,16 +489,34 @@ %0A %22%22%22 +%0A interval = 15 %0A%0A se @@ -1041,34 +1041,16 @@ %0A )%0A%0A - interval = 15%0A form @@ -1357,15 +1357,50 @@ -def run +@require(internet)%0A def get_...
e4d222c4e1b05f8d34b2236d05269827c345b0c7
Handle also running rebot
src/robot/jarrunner.py
src/robot/jarrunner.py
# Copyright 2008-2010 Nokia Siemens Networks Oyj # # 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...
Python
0
@@ -680,16 +680,39 @@ from_cli +, rebot, rebot_from_cli %0A%0A%0Aclass @@ -848,13 +848,207 @@ -try:%0A +print rebot, rebot.__file__%0A try:%0A if args and args%5B0%5D == 'rebot':%0A print rebot.__doc__%0A rebot_from_cli(args%5B1:%5D, rebot.__doc__)%0A e...
76399574b7fb914d1baa2719a0e493d4b22bb730
Create PedidoEditar.py
backend/Models/Grau/PedidoEditar.py
backend/Models/Grau/PedidoEditar.py
Python
0
@@ -0,0 +1,342 @@ +from Framework.Pedido import Pedido%0Afrom Framework.ErroNoHTTP import ErroNoHTTP%0A%0Aclass PedidoEditar(Pedido):%0A%0A%09def __init__(self,variaveis_do_ambiente):%0A%09%09super(PedidoEditar, self).__init__(variaveis_do_ambiente)%0A%09%09try:%0A%09%09%09self.nome = self.corpo%5B'nome'%5D%0A%09%09%09...
df146818d004e65102cc6647373b0fddb0d383fd
add basic integration tests
integration-tests/test_builder.py
integration-tests/test_builder.py
Python
0
@@ -0,0 +1,2437 @@ +import os%0Aimport subprocess%0Aimport tempfile%0A%0Afrom vdist.builder import Builder%0Afrom vdist.source import git, git_directory, directory%0A%0A%0Adef test_generate_deb_from_git():%0A builder = Builder()%0A builder.add_build(%0A app='vdist-test-generate-deb-from-git',%0A ver...
dc0ecffd6c4115019cfcbcc13b17a20511888c9b
Add ut for fused ops
python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py
python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py
Python
0
@@ -0,0 +1,1776 @@ +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.%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/LI...
a852de81afdf8426cb243115a87856e2767a8d40
Add construct test for known bad inplace string operations.
tests/benchmarks/constructs/InplaceOperationStringAdd.py
tests/benchmarks/constructs/InplaceOperationStringAdd.py
Python
0.000001
@@ -0,0 +1,1341 @@ +# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com%0A#%0A# Python test originally created or extracted from other peoples work. The%0A# parts from me are licensed as below. It is at least Free Softwar where%0A# it's copied from other people. In these cases, that will normally be...
28df83848a04e45059f4c672fde53f4f84dbd28d
Add module module_pubivisat.py
module_pubivisat.py
module_pubivisat.py
Python
0.000003
@@ -0,0 +1,622 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Aimport urllib2%0Afrom bs4 import BeautifulSoup%0A%0Adef command_pubivisat(bot, user, channel, args):%0A%09%22%22%22Fetches todays pub quizzes for Tampere from pubivisat.fi%22%22%22%0A%09url = %22http://pubivisat.fi/tampere%22%0A%0A%09f = urllib2.urlop...
e5736370568adab1334f653c44dd060c06093fae
add basic twisted soap server.
src/rpclib/test/interop/server/soap_http_basic_twisted.py
src/rpclib/test/interop/server/soap_http_basic_twisted.py
Python
0
@@ -0,0 +1,1684 @@ +#!/usr/bin/env python%0A#%0A# rpclib - Copyright (C) Rpclib contributors.%0A#%0A# This library is free software; you can redistribute it and/or%0A# modify it under the terms of the GNU Lesser General Public%0A# License as published by the Free Software Foundation; either%0A# version 2.1 of the Licen...
e83edea432f16ed6a2c9edcaa6da70c928d75eb5
Create module containing constants
export_layers/pygimplib/constants.py
export_layers/pygimplib/constants.py
Python
0
@@ -0,0 +1,1132 @@ +#%0A# This file is part of pygimplib.%0A#%0A# Copyright (C) 2014, 2015 khalim19 %3Ckhalim19@gmail.com%3E%0A#%0A# pygimplib is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation, either version...
78fe96841a72731f76e52a0cf7acc6375b008942
handle 'certificate-authority-data' when talking to eg. GKE
kubernetes/K8sConfig.py
kubernetes/K8sConfig.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # import re from os.path import expanduser, isfile import yaml from yaml import YAMLError DEFAULT_KUBECONFIG = "{0}/.kube/config".format(expand...
Python
0.000004
@@ -2384,32 +2384,69 @@ .ca_cert = None%0A + self.ca_cert_data = None%0A self @@ -3037,32 +3037,91 @@ urrent_context:%0A + if 'server' in cluster%5B'cluster'%5D:%0A @@ -3193,64 +3193,306 @@ -self.ca_cert = cluster%5B'cluster'%5D%5B'certificate-aut...
0421adb2eb391c57d02dfa0b1b14e3c620c53dfc
Create tarea7.py
tareas/tarea7.py
tareas/tarea7.py
Python
0.000001
@@ -0,0 +1,3209 @@ +#josue de leon%0A# Tarea 7%0A#8-876-2357%0A'''1.Crear una aplicacion en Kivy que maneje un registro de asistencia. Basicamente la aplicacion debe contener una %0A etiqueta que diga %22Nombre: %22, un campo para ingresar cadenas de texto, un boton que diga %22Guardar%22 y otro botin %0A que diga %22E...
b260040bc3ca48b4e76d73c6efe60b964fa5c108
Add test of removing unreachable terminals
tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py
tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py
Python
0.000001
@@ -0,0 +1,2167 @@ +#!/usr/bin/env python%0A%22%22%22%0A:Author Patrik Valkovic%0A:Created 17.08.2017 14:23%0A:Licence GNUv3%0APart of grammpy-transforms%0A%0A%22%22%22%0A%0A%0Afrom unittest import main, TestCase%0Afrom grammpy import *%0Afrom grammpy_transforms import *%0A%0A%0Aclass A(Nonterminal): pass%0Aclass B(Non...
c82473efdeb7b1713f44370de761ec9022d02b5e
Add management command to fill and clear cache
akvo/rsr/management/commands/populate_project_directory_cache.py
akvo/rsr/management/commands/populate_project_directory_cache.py
Python
0
@@ -0,0 +1,1218 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Akvo Reporting is covered by the GNU Affero General Public License.%0A# See more details in the license.txt file located at the root folder of the Akvo RSR module.%0A# For additional details on the GNU license please see %3C http://www.gnu.org/...
4e6f2ede0a8a9291befe262cbec77d3e7cd873b0
add new package (#26514)
var/spack/repos/builtin/packages/py-rsatoolbox/package.py
var/spack/repos/builtin/packages/py-rsatoolbox/package.py
Python
0
@@ -0,0 +1,1227 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass PyRsatoolbox(PythonPackage):%0A %22%22%22Representation...
0ac0c81a3427f35447f52c1643229f5dbe607002
Add a merge migration and bring up to date
osf/migrations/0099_merge_20180426_0930.py
osf/migrations/0099_merge_20180426_0930.py
Python
0
@@ -0,0 +1,339 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.11 on 2018-04-26 14:30%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('osf', '0098_merge_20180416_1807'),%0A ('osf', '0096...
2731aba68f86c0adcb26f4105c7418ffa35e3d09
add first auto-test
test/run_test.py
test/run_test.py
Python
0.000382
@@ -0,0 +1,1905 @@ +#!/usr/bin/env python%0Aimport sys%0Aimport os%0Afrom subprocess import Popen, PIPE%0Aimport re%0A%0Aclass TestFailure(Exception):%0A pass%0A%0Adef do_bgrep(pattern, paths, options=%5B%5D, retcode=0):%0A bgrep_path = '../bgrep'%0A%0A args = %5Bbgrep_path%5D%0A args += list(options)%0A ...
d6315d28ed55b76f3caa3fff26141815f7da7dec
add migration
accelerator/migrations/0027_modify_video_url_help_text.py
accelerator/migrations/0027_modify_video_url_help_text.py
Python
0.000001
@@ -0,0 +1,1252 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.14 on 2018-12-05 16:27%0Afrom __future__ import unicode_literals%0A%0Afrom django.conf import settings%0Afrom django.db import migrations, models%0Aimport embed_video.fields%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5...
d573d33cc37ad666d3a4f47a5ac9dfec5a9b5fc5
add app config
app/appconfig.py
app/appconfig.py
Python
0.000002
@@ -0,0 +1,123 @@ +# -*- coding:utf8 -*-%0A# Author: shizhenyu96@gamil.com%0A# github: https://github.com/imndszy%0AHOST = %22https://www.njuszy.cn/%22%0A
ffc32773953da2cf9e1d6e84aed1b53debc2c7c7
Create __init__.py
cltk/stem/middle_english/__init__.py
cltk/stem/middle_english/__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
c7529927174b1626a0dc34f635b1d5939f565add
Add problem77.py
euler_python/problem77.py
euler_python/problem77.py
Python
0.000164
@@ -0,0 +1,1085 @@ +%22%22%22%0Aproblem77.py%0A%0AIt is possible to write ten as the sum of primes in exactly five different ways:%0A%0A 7 + 3%0A 5 + 5%0A 5 + 3 + 2%0A 3 + 3 + 2 + 2%0A 2 + 2 + 2 + 2 + 2%0A%0AWhat is the first value which can be written as the sum of primes in over five%0Athousand differe...
f93a79aedde8883241b247244b4d15311ed2967a
Add explanation of url encoding
elasticsearch/connection/http_urllib3.py
elasticsearch/connection/http_urllib3.py
import time import urllib3 from .base import Connection from ..exceptions import ConnectionError from ..compat import urlencode class Urllib3HttpConnection(Connection): """ Default connection class using the `urllib3` library and the http protocol. :arg http_auth: optional http auth information as either...
Python
0.000007
@@ -1514,16 +1514,180 @@ timeout +%0A%0A # in python2 we need to make sure the url is not unicode. Otherwise%0A # the body will be decoded into unicode too and that will fail (#133). %0A @@ -1754,32 +1754,33 @@ encode('utf-8')%0A +%0A resp
11cbc92e292a54b219f8b5ec64ae8ab58577362d
add standalone davidson test w/ near-degeneracies
tests/test021.py
tests/test021.py
Python
0.000001
@@ -0,0 +1,424 @@ +import numpy as np%0Afrom mmd.utils.davidson import davidson %0A%0Adef test_davidson():%0A%0A np.random.seed(0)%0A dim = 1000%0A A = np.diag(np.arange(dim,dtype=np.float64))%0A A%5B1:3,1:3%5D = 0%0A M = np.random.randn(dim,dim)%0A M += M.T%0A A += 1e-4*M%0A%0A roots = 5%0A ...
781d43e48e83f00e4cd18e805efed7558b570adf
introduce btc select command
btc/btc_select.py
btc/btc_select.py
Python
0.000002
@@ -0,0 +1,1385 @@ +import argparse%0Aimport fnmatch%0Aimport sys%0Aimport os%0Aimport re%0Afrom .btc import encoder, decoder, error, ordered_dict%0A%0A_description = 'select some values'%0A%0Adef main():%0A parser = argparse.ArgumentParser()%0A parser.add_argument('keys', metavar='KEY', nargs='+', default=None,%...
f947e6766c77f58a6cc1bd0d97758e43d6750c7f
add barycentric coordinates
src/compas/geometry/interpolation/barycentric.py
src/compas/geometry/interpolation/barycentric.py
Python
0.000011
@@ -0,0 +1,1224 @@ +from __future__ import print_function%0Afrom __future__ import absolute_import%0Afrom __future__ import division%0A%0Afrom compas.geometry import subtract_vectors%0Afrom compas.geometry import dot_vectors%0A%0A%0A__all__ = %5B%0A 'barycentric_coordinates'%0A%5D%0A%0A%0Adef barycentric_coordinates...
ab946575b1050e67e2e6b4fdda237faa2dc342f5
add conversion script for BDDMPipeline
scripts/conversion_bddm.py
scripts/conversion_bddm.py
Python
0
@@ -0,0 +1,1266 @@ +%0Aimport argparse%0Aimport torch%0A%0Afrom diffusers.pipelines.bddm import DiffWave, BDDMPipeline%0Afrom diffusers import DDPMScheduler%0A%0A%0Adef convert_bddm_orginal(checkpoint_path, noise_scheduler_checkpoint_path, output_path):%0A sd = torch.load(checkpoint_path, map_location=%22cpu%22)%5B%...
271b042c4dfa2d599e1e5b6920fb996798eac631
Fix port picking logic in Python tests
src/python/grpcio_tests/tests/unit/_reconnect_test.py
src/python/grpcio_tests/tests/unit/_reconnect_test.py
# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
Python
0.00001
@@ -976,329 +976,297 @@ E%0A%0A%0A -class ReconnectTest(unittest.TestCase +def _get_reuse_socket_option( ):%0A -%0A -def test_reconnect(self):%0A server_pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY)%0A handler = grpc.method_handlers_generic_handler('test', %7B%0A 'UnaryUna...
67d409b6be5f90c33e73ddf73ba2966d8f2c44f4
Find max function in python
Maths/FindMax.py
Maths/FindMax.py
Python
0.999997
@@ -0,0 +1,123 @@ +# NguyenU%0A%0Aimport math%0A%0Adef find_max(nums):%0A max = 0%0A for x in nums:%0A if x %3E max:%0A max = x%0A print max%0A
922513b2e0e26432fd4e4addfe83e2b84d631d4f
Create change_function_signature.py
change_function_signature.py
change_function_signature.py
Python
0.000006
@@ -0,0 +1,121 @@ +def foo(a):%0A print(a)%0A%0Adef bar(a, b):%0A print(a, b)%0A%0A%0Afunc = foo%0Afunc(10)%0Afunc.__code__ = bar.__code__%0Afunc(10, 20)%0A
a3b31137ac96bf3480aaecadd5faf3ca051fc4b0
Add bare ConnectionState
litecord/gateway/state.py
litecord/gateway/state.py
Python
0.000002
@@ -0,0 +1,491 @@ +%0Aclass ConnectionState:%0A %22%22%22State of a connection to the gateway over websockets%0A %0A Attributes%0A ----------%0A session_id: str%0A Session ID this state refers to.%0A%0A events: %60collections.deque%60%5Bdict%5D%0A Deque of sent events to the connection. ...
83f2e11d63168e022d99075d2f35c6c813c4d37d
add a simple linear regression model
gnt_model.py
gnt_model.py
Python
0.055082
@@ -0,0 +1,1511 @@ +import tensorflow as tf%0Afrom utils.gnt_record import read_and_decode, BATCH_SIZE%0A%0A%0Awith open('label_keys.list') as f:%0A labels = f.readlines()%0A%0Atfrecords_filename = %22hwdb1.1.tfrecords%22%0Afilename_queue = tf.train.string_input_producer(%0A %5Btfrecords_filename%5D, num_epochs=1...
15970841d53e14d3739d8f512f815e8e3c19bf02
Create Opcao.py
backend/Database/Models/Opcao.py
backend/Database/Models/Opcao.py
Python
0
@@ -0,0 +1,585 @@ +from Database.Controllers.Curso import Curso%0A%0Aclass Opcao(object):%0A%0A%09def __init__(self,dados=None):%0A%09%09if dados is not None:%0A%09%09%09self.id = dados %5B'id'%5D%0A%09%09%09self.nome = dados %5B'nome'%5D%0A%09%09%09self.id_curso = dados %5B'id_curso'%5D%0A%09%09%09%0A%09def getId(self...
3f50dcf6d91192253af320aaf72fcb13d307e137
add new package
var/spack/repos/builtin/packages/memsurfer/package.py
var/spack/repos/builtin/packages/memsurfer/package.py
Python
0.000001
@@ -0,0 +1,1875 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0A%0Afrom spack import *%0A%0A%0Aclass Memsurfer(PythonPackage):%0A %22%22%22MemSurfer is a...
5be5d2eb2ddef625963dd1f11984d1838fac5e7f
Fix /help command crash if a command doesn't have docstrings
botogram/defaults.py
botogram/defaults.py
""" botogram.defaults Default commands definition Copyright (c) 2015 Pietro Albini <pietro@pietroalbini.io> Released under the MIT license """ import html from . import syntaxes from . import components from . import decorators class DefaultComponent(components.Component): """This component con...
Python
0.000214
@@ -5365,24 +5365,97 @@ ocstring%22%22%22%0A + # You can't escape None, right?%0A if text is None:%0A return%0A%0A # The do
b5db8d8b0620491169d54eaf05bb57e5a61903e1
add bash8 tool (like pep8, but way hackier)
bash8.py
bash8.py
Python
0.000002
@@ -0,0 +1,2376 @@ +#!/usr/bin/env python%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 required by applicab...
db4ba2ca4e0ea96c9bc3f7e9d3eb61e7c7c3bc23
Create softmax
softmax.py
softmax.py
Python
0.000001
@@ -0,0 +1,688 @@ +#! /usr/bin/env python%0A%22%22%22%0AAuthor: Umut Eser%0AProgram: softmax.py%0ADate: Friday, September 30 2016%0ADescription: Softmax applied over rows of a matrix%0A%22%22%22%0A%0Aimport numpy as np%0A%0A%0Adef softmax(X):%0A %22%22%22%0A Calculates softmax of the rows of a matrix X.%0A%0A ...
28696b671a5f80f781c67f35ae5abb30efd6379c
Solve Time Conversion in python
solutions/uri/1019/1019.py
solutions/uri/1019/1019.py
Python
0.999882
@@ -0,0 +1,231 @@ +import sys%0A%0Ah = 0%0Am = 0%0A%0Afor t in sys.stdin:%0A t = int(t)%0A%0A if t %3E= 60 * 60:%0A h = t // (60 * 60)%0A t %25= 60 * 60%0A%0A if t %3E= 60:%0A m = t // 60%0A t %25= 60%0A%0A print(f%22%7Bh%7D:%7Bm%7D:%7Bt%7D%22)%0A%0A h = 0%0A m = 0%0A
9876f372100bbc4c272378fe9a06f7d7ddd90308
Add twitter daily backup script
twitter/daily.py
twitter/daily.py
Python
0.000001
@@ -0,0 +1,2589 @@ +#!/usr/bin/env python3%0A%0Aimport json%0Afrom datetime import datetime%0A%0Aimport pymysql%0Afrom requests_oauthlib import OAuth1Session%0A%0A%0Aclass Twitter():%0A def __init__(self):%0A self.session = OAuth1Session(%0A client_key=%22%7Bconsumer_key%7D%22,%0A client...
69005d995aa0e6d291216101253197c6b2d8260a
Add module for command-line interface
husc/main.py
husc/main.py
Python
0.000001
@@ -0,0 +1,1016 @@ +import argparse%0A%0Aparser = argparse.ArgumentParser(description=%22Run the HUSC functions.%22)%0Asubpar = parser.add_subparsers()%0A%0Astitch = subpar.add_parser('stitch', %0A help=%22Stitch four quadrants into one image.%22)%0Astitch.add_argument('quadrant_image', nargs...
10440cbcde68ecf16c8b8b326ec96d1d7f8c6d6d
add basic PID for sial position
src/boat_pid_control/src/boat_pid_control/sailPID.py
src/boat_pid_control/src/boat_pid_control/sailPID.py
Python
0
@@ -0,0 +1,576 @@ +%22%22%22%0APID control for the sailing robot%0Acontroling sail position%0Abased on goal sail direction%0A%0AInputs: %0A- current heading%0A- goal heading%0A%0AOutput:%0A- Change in motor position/motor position%0A%0ATODO:%0Aconsider tack and jibe%0A%22%22%22%0A%0Aimport rospy%0A%0A%0APROPORTIONAL_GA...
ea0087970b0c0adfd8942123899ff0ec231afa03
Handle stealable element with utils
test/selenium/src/lib/page/extended_info.py
test/selenium/src/lib/page/extended_info.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
Python
0
@@ -424,16 +424,53 @@ locator%0A +from lib.utils import selenium_utils%0A %0A%0Aclass @@ -587,24 +587,27 @@ ed%22%22%22%0A -_ locator +_cls = locat @@ -700,16 +700,42 @@ driver)%0A + self.is_mapped = None%0A self @@ -757,88 +757,36 @@ one%0A -%0A def _reload_contents(self):%0A self.button_map = b...
1f47c575cfd310fd4bee18673f7cbb69eb622959
Create block_params.py
block_params.py
block_params.py
Python
0.000004
@@ -0,0 +1,639 @@ +# block_params.py%0A# Demonstration of a blockchain 2 of 3 components%0A%0AGENESIS_INDEX = 0%0AGENESIS_PREVIOUS_HASH = '0'%0AGENESIS_TIMESTAMP = 1495851743%0AGENESIS_DATA = 'first block'%0A%0A%0Aclass BlockParams():%0A%0A def __init__(self, index, previous_hash, timestamp, data):%0A self.in...
65dc2f12d8540d3aa494447033e022fe3995701b
correct language mistake
btc_download.py
btc_download.py
#! /usr/bin/env python import argparse import sys import os from btc import encoder, decoder, error, warning, list_to_dict, dict_to_list, client _description = 'download torrent file locally' def main(): parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', default='.') parser.add_a...
Python
0.999994
@@ -1069,17 +1069,17 @@ kipping -u +i ncomplet
7922b24882894cbc83bd4247c11d8c4a66b4b218
Add utility script for database setup
_setup_database.py
_setup_database.py
Python
0
@@ -0,0 +1,353 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Afrom setup.create_teams import migrate_teams%0Afrom setup.create_divisions import create_divisions%0A%0A%0Aif __name__ == '__main__':%0A # migrating teams from json file to database%0A migrate_teams(simulation=True)%0A # creating divisions...
af436dd269a959324b495885b9406610f3737a7a
Create addtoindex.py
udacity/webcrawler/addtoindex.py
udacity/webcrawler/addtoindex.py
Python
0.000001
@@ -0,0 +1,809 @@ +# Define a procedure, add_to_index,%0A# that takes 3 inputs:%0A%0A# - an index: %5B%5B%3Ckeyword%3E,%5B%3Curl%3E,...%5D%5D,...%5D%0A# - a keyword: String%0A# - a url: String%0A%0A# If the keyword is already%0A# in the index, add the url%0A# to the list of urls associated%0A# with that keyword.%0A%0A#...
01c4554123cbf1d37fe73fdb51ccacdedf870635
1. Two Sum. Brute-force
p001_brute_force.py
p001_brute_force.py
Python
0.999581
@@ -0,0 +1,735 @@ +import unittest%0A%0A%0Aclass Solution(object):%0A def twoSum(self, nums, target):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :type target: int%0A :rtype: List%5Bint%5D%0A %22%22%22%0A for i, a in enumerate(nums):%0A for j, b in enumerate(nums...
93621f9441af4df77c8364050d7cc3dc2b1b43b2
Add tests for `check` command
tests/functional/registration/test_check.py
tests/functional/registration/test_check.py
Python
0.000003
@@ -0,0 +1,1312 @@ +%22%22%22%0ATest check/validation command.%0A%22%22%22%0Aimport os%0Aimport subprocess%0A%0Athis_folder = os.path.abspath(os.path.dirname(__file__))%0A%0A%0Adef test_check_metamodel():%0A %22%22%22%0A Meta-model is also a model%0A %22%22%22%0A%0A metamodel_file = os.path.join(this_folder...
720e288aba61ecc2214c8074e33d181c0d4584f5
Add do_datasets module
carto/do_datasets.py
carto/do_datasets.py
Python
0.000001
@@ -0,0 +1,1021 @@ +%22%22%22%0AModule for working with Data Observatory Datasets%0A%0A.. module:: carto.do_datasets%0A :platform: Unix, Windows%0A :synopsis: Module for working with Data Observatory Datasets%0A%0A.. moduleauthor:: Jes%C3%BAs Arroyo %3Cjarroyo@carto.com%3E%0A%0A%0A%22%22%22%0A%0Afrom pyrestcli.fiel...