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
ae0ebcc4da3425539e067d4d6a611554327357ad
Add web-scraping
hackathonupdate-webscraping.py
hackathonupdate-webscraping.py
Python
0.000001
@@ -0,0 +1,226 @@ +from lxml import html%0Aimport requests%0A%0A%0Apage=requests.get('https://mlh.io/seasons/s2015/events.html')%0Atree=html.fromstring(page.text)%0A%0A%0Atitles=tree.xpath('//*%5Bname()=%22h3%22%5D/text()')%0A#add dates and locations later%0A%0Aprint(titles)
a3706e1c743ef7ec7f38375b116538a71ccb8455
Add utilities to convert from python2 to python3.
rasterfairy/utils.py
rasterfairy/utils.py
Python
0
@@ -0,0 +1,1114 @@ +def cmp_to_key(mycmp):%0A %22%22%22%0A Convert %60sorted%60 function from python2 to python3.%0A%0A This function is used to convert %60cmp%60 parameter of python2 sorted%0A function into %60key%60 parameter of python3 sorted function.%0A%0A This code is taken from here:%0A https:/...
c0b53a195974173942b73d320248febd19b6788c
Add exercise 9
exercise/9.py
exercise/9.py
Python
0.000002
@@ -0,0 +1,855 @@ +import random%0A%0Ai = random.randint(1, 9)%0A%0Adef ask_for_input():%0A while True:%0A s = input('Please guess what I got (an integer between 1 and 9) in hand?: ' )%0A ii = int(s)%0A if 1 %3C= ii %3C= 9:%0A return ii%0A else:%0A print('Wrong input...
141bb79f45053e7bc5bfc4aa06e98d6e2788fc2c
Implement type reranker
type_reranker.py
type_reranker.py
Python
0.000001
@@ -0,0 +1,1594 @@ +from dbpediaEnquirerPy import *%0Afrom KafNafParserPy import *%0Aimport os%0Adef get_entity_sent(filename, parser, entity):%0A terms=%5B%5D%0A for ref in entity.get_references():%0A termbs=ref.get_span().get_span_ids()%0A%09if len(termbs)==0:%0A%09%09w.write(filename + %22%5Ct%22 + enti...
37e3380cbbef86f35f963ebfa3bdb07eb3d3ae3d
Add condor test
libsubmit/tests/test_integration/test_ssh/test_ssh_condor_earth.py
libsubmit/tests/test_integration/test_ssh/test_ssh_condor_earth.py
Python
0
@@ -0,0 +1,1682 @@ +import os%0Aimport libsubmit%0Afrom libsubmit import SshChannel, Condor%0Aimport time%0A%0A%0Adef test_1():%0A config = %7B%0A %22site%22: %22T3_US_NotreDame%22,%0A %22execution%22: %7B%0A %22scriptDir%22: %22.scripts%22,%0A %22environment%22: %7B%0A ...
ed31ebcd8c8058b3cc92a9fd4411577e9227605b
Add models.py with sqla settings and player, game classes
models.py
models.py
Python
0
@@ -0,0 +1,1246 @@ +from sqlalchemy import *%0Afrom sqlalchemy.orm import *%0Afrom sqlalchemy.ext.declarative import declarative_base%0Aimport json%0A%0Aengine = create_engine('sqlite:///db.sqlite', echo=True)%0ABase = declarative_base()%0A%0Aclass Player(Base):%0A __tablename__ = 'players'%0A id = Column(Integer...
546e9441b7dc6eb1575aab3c534f414aed0f0c3c
Create GC_content.py
sequence_manipulation/GC_content.py
sequence_manipulation/GC_content.py
Python
0.000001
@@ -0,0 +1,866 @@ +'''%0AWritten by Cham K.%0AJune 16th 2015%0A'''%0A%0Afrom sequence_manipulation import nucleotide_count%0A%0Adef GC_content(sequence, percent=True):%0A ''' (str, bool) -%3E (float)%0A Returns the GC-content as a non-rounded percentage (or ratio if percent=False) of a DNA sequence.%0A Can pro...
150b1c07a55d2f3ce429cc0108fdaf653b9b7132
Create models.py
models.py
models.py
Python
0.000001
@@ -0,0 +1,170 @@ +from django.db import models%0A%0Aclass Mode(models.Model):%0A name = models.CharField(max_length=50)%0A%0Aclass State(models.Model):%0A name = models.CharField(max_length=50)%0A
d26034963c0332346ea1b6b50b9ad3d637da7e36
Add script to try and push stripe payment of unpaid invoices
spiff/payment/management/commands/attempt_payment.py
spiff/payment/management/commands/attempt_payment.py
Python
0
@@ -0,0 +1,491 @@ +from django.core.management import BaseCommand%0Afrom spiff.payment.models import Invoice%0Aimport stripe%0A%0Aclass Command(BaseCommand):%0A help = 'Attempts to process an invoice via stripe'%0A%0A def handle(self, *args, **options):%0A for invoice in Invoice.objects.unpaid().all():%0A pri...
c5ed01ce81b1c0e459d93bf26bf96cdeb80a0344
Use specific notifications when possible.
Lib/defconAppKit/representationFactories/__init__.py
Lib/defconAppKit/representationFactories/__init__.py
from defcon import Glyph, Image, registerRepresentationFactory from defconAppKit.representationFactories.nsBezierPathFactory import NSBezierPathFactory from defconAppKit.representationFactories.glyphCellFactory import GlyphCellFactory from defconAppKit.representationFactories.glyphCellDetailFactory import GlyphCellDeta...
Python
0
@@ -658,16 +658,17 @@ Path%22 : +( NSBezier @@ -671,32 +671,39 @@ zierPathFactory, + None), %0A %22defconAppK @@ -733,16 +733,17 @@ Path%22 : +( NoCompon @@ -758,32 +758,39 @@ zierPathFactory, + None), %0A %22defconAppK @@ -822,16 +822,17 @@ Path%22 : +( OnlyComp @@ -849,32 +849,39 @@ zierPathFactor...
31d26cefd8f3d246437511c2b0852051d68cb2c8
modify wod2vec
exampleWtoV.py
exampleWtoV.py
Python
0.000011
@@ -0,0 +1,1081 @@ +#/datastore/zhenyang/bin/python%0A%0Aimport gensim, logging%0Aimport sys%0Aimport os%0Afrom xml.etree import ElementTree%0A%0Adef get_parentmap(tree):%0A parent_map = %7B%7D%0A for p in tree.iter():%0A for c in p:%0A if c in parent_map:%0A parent_map%5Bc%5D.app...
b68244965b4f69711f0c4d9d42f24e6b3f5742f4
Add script to update images in the js code
update-images.py
update-images.py
Python
0
@@ -0,0 +1,873 @@ +#!/usr/bin/env python%0A%0Aimport urllib%0A%0Adef img2base64(img):%0A return open(img, %22rb%22).read().encode(%22base64%22).replace('%5Cn', '')%0A%0Adisabled_base64 = img2base64(%22assets/no-js.png%22)%0Aenabled_base64 = img2base64(%22assets/jsenabled.png%22)%0A%0A%0Adata = open('bootstrap.js')%0...
ef526fe30b0bfcf82319195e76e4da01ab613ca3
add initial spline
epistasis/models/nonlinear/spline.py
epistasis/models/nonlinear/spline.py
Python
0.000001
@@ -0,0 +1,1875 @@ +import numpy as np%0A%0Afrom .minimizer import Minimizer%0Afrom .ordinary import EpistasisNonlinearRegression%0Afrom epistasis.models import EpistasisLinearRegression%0Afrom epistasis.models.utils import (arghandler, FittingError)%0Afrom scipy.interpolate import UnivariateSpline%0A%0A# -------------...
49cb9138a10e3fc9324f6c2e655cc4b8bd34276c
Add transliteration tool
extranslit.py
extranslit.py
Python
0.000004
@@ -0,0 +1,1403 @@ +#!/usr/bin/env python%0A# -*- coding: utf8 -*-%0A%22%22%22%0AUsage:%0Atranslit_location.py INCOLUMN %5B--lang LANG%5D %5B--reverse%5D %5B--minlen MINLEN%5D INFILE...%0A%0AOptions:%0AINCOLUMN The number of the INCOLUMN to use, 1 based (A=1).%0AOUTCOLUMN The number of the OUTCOLUM...
0c50fc3838cd87f09e767727c41ee6c0771b396d
Create type.py
code/neominim/type.py
code/neominim/type.py
Python
0.000001
@@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*-%0A__author__ = %22joshhartigan%22%0A%0Aclass NeoMinimError(Exception):%0A %22%22%22 general purpose neominim error %22%22%22%0A pass%0A
9ede4e498bdf41f576c266f2fdedb96f277bc548
provide a kcli bmc
extras/kbmc.py
extras/kbmc.py
Python
0.999999
@@ -0,0 +1,2349 @@ +import argparse%0Aimport sys%0A%0Afrom kvirt.config import Kconfig%0Afrom kvirt.common import pprint%0Aimport pyghmi.ipmi.bmc as bmc%0A%0A%0Aclass KBmc(bmc.Bmc):%0A def __init__(self, authdata, port, name):%0A super(KBmc, self).__init__(authdata, port)%0A self.bootdevice = 'default'...
b0c6bddfac0931de679972a4d8674269889e5cd2
Correct set_node_options argument list
zuul/openstack_functions.py
zuul/openstack_functions.py
# Copyright 2013 OpenStack Foundation # # 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...
Python
0.000204
@@ -1387,17 +1387,8 @@ rams -, default ):%0A
02d5370f09956077623ea76340e51d1cf6d10f93
Add boolean primitive type support.
source/harmony/ui/widget/boolean.py
source/harmony/ui/widget/boolean.py
Python
0
@@ -0,0 +1,743 @@ +# :coding: utf-8%0A# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips%0A# :license: See LICENSE.txt.%0A%0Afrom PySide import QtGui%0A%0Afrom .simple import Simple%0A%0A%0Aclass Boolean(Simple):%0A '''Boolean control.'''%0A%0A def _constructControl(self, **kw):%0A '''Return the con...
e3900a167b0f9bba731353bd8175b8a5ede9491b
add loggeduser migration
activitydb/migrations/0024_loggeduser.py
activitydb/migrations/0024_loggeduser.py
Python
0.000001
@@ -0,0 +1,670 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.4 on 2016-08-23 21:22%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('activitydb', '0023_tolasites_tola_report_url'),%0A ...
c168efd883bcc1fc5ed8fe3c80de95db905bb468
Add file for nontermianl adding when grammar is create
tests/grammar_creation_test/NonterminalAddingTest.py
tests/grammar_creation_test/NonterminalAddingTest.py
Python
0
@@ -0,0 +1,261 @@ +#!/usr/bin/env python%0A%22%22%22%0A:Author Patrik Valkovic%0A:Created 23.06.2017 16:39%0A:Licence GNUv3%0APart of grammpy%0A%0A%22%22%22%0A%0Afrom unittest import TestCase, main%0Afrom grammpy import *%0A%0A%0Aclass NonterminalAddingTest(TestCase):%0A pass%0A%0A%0Aif __name__ == '__main__':%0A ...
307e4fda61f92e344bfd90c1a43f5a9076e7b832
Add files for rule's invalid syntax validation
tests/rules_tests/isValid_tests/InvalidSyntaxTest.py
tests/rules_tests/isValid_tests/InvalidSyntaxTest.py
Python
0.000001
@@ -0,0 +1,259 @@ +#!/usr/bin/env python%0A%22%22%22%0A:Author Patrik Valkovic%0A:Created 23.06.2017 16:39%0A:Licence GNUv3%0APart of grammpy%0A%0A%22%22%22%0A%0Afrom unittest import main, TestCase%0Afrom grammpy import Rule%0A%0A%0Aclass InvalidSyntaxTest(TestCase):%0A pass%0A%0A%0Aif __name__ == '__main__':%0A ...
bb9a796abc1a1535c5113c260ac5a703c4cefb53
Add Python source code
primes.py
primes.py
Python
0.016778
@@ -0,0 +1,204 @@ +#!/usr/bin/env python%0A%0Aimport sys%0A%0Anumber = int(sys.argv%5B1%5D)%0Acandidate = 2%0A%0Awhile (number %3E 1):%0A while (number %25 candidate == 0):%0A print candidate%0A number /= candidate%0A candidate += 1%0A
3a21119fce232727aae104f7912c05dc94ffdd5e
Fix python 3 test failure due to string vs byte (b'')
tensorflow/python/ops/sparse_ops_test.py
tensorflow/python/ops/sparse_ops_test.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.000522
@@ -5384,31 +5384,37 @@ = %5B%5B +b 'a', +b '', +b ''%5D, %5B +b '', +b '', +b 'b'%5D
7b9c4cd88e6559171442d382088aa45e2d1a7455
Add tensorflow{,_core} to zip_these_files in copy_binary.py for py33 and py34 packages.
tensorflow/tools/ci_build/copy_binary.py
tensorflow/tools/ci_build/copy_binary.py
#!/usr/bin/python # Copyright 2017 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 r...
Python
0.000001
@@ -2735,24 +2735,73 @@ , version),%0A + %22tensorflow%22,%0A %22tensorflow_core%22,%0A %5D%0A fo
83470a90d8f765438ec77a61527e4d3d8963890f
add test for the fastq_count script
test/scripts/test_sequana_fastq_count.py
test/scripts/test_sequana_fastq_count.py
Python
0
@@ -0,0 +1,530 @@ +from sequana.scripts import fastq_count%0Afrom nose.plugins.attrib import attr%0Afrom sequana import sequana_data%0A%0A%0A#@attr(%22skip%22)%0Aclass TestPipeline(object):%0A%0A @classmethod%0A def setup_class(klass):%0A %22%22%22This method is run once for each class before any tests are...
7101a601edbff6626350e4d1c7434692881072f6
Fix : remove a dangerous print of utf8 char for hudson.
test/test_strange_characters_commands.py
test/test_strange_characters_commands.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #Copyright (C) 2009-2010 : # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # #This file is part of Shinken. # #Shinken is free software: you can redistribute it and/or modify #it under the terms of the GNU Affero General Public License as...
Python
0
@@ -2833,51 +2833,8 @@ (c)%0A - print svc.output, type(svc.output)%0A
1e15f0953076810c1ccd2d04c258d3fb0eba71e1
Create sample.py
sample.py
sample.py
Python
0
@@ -0,0 +1 @@ +%0A
2900f014bf7d8bdf5b7f4fe10d844cd516d0372a
Add basic views tests
web/web/tests.py
web/web/tests.py
Python
0
@@ -0,0 +1,1586 @@ +from django.test import Client, TestCase%0Afrom django.core.urlresolvers import reverse%0A%0A%0A# Create your tests here.%0Aclass BasicViewsTestCase(TestCase):%0A fixtures = %5B%5D%0A%0A def setUp(self):%0A self.public_views = %5B('login', dict()), ('logout', dict())%5D%0A self.p...
81c4f9300e0cef204aaf2a0205ebf21be23f9414
add strings to return ehllo world as output
hellomarly.py
hellomarly.py
Python
0.999907
@@ -0,0 +1,50 @@ +#This is my hello marly.....%0A%0Aprint 'Hello Marly'%0A
b3962e17bbc0328faa928d1eaed57de40cc28ee0
add heroku_api.py
heroku_api.py
heroku_api.py
Python
0.000002
@@ -0,0 +1,2181 @@ +import heroku%0Aimport argparse%0Aimport os%0Aimport requests%0Afrom requests.packages.urllib3.exceptions import InsecureRequestWarning, SNIMissingWarning, InsecurePlatformWarning%0A%0Arequests.packages.urllib3.disable_warnings(InsecureRequestWarning)%0Arequests.packages.urllib3.disable_warnings(SNI...
257d0c9e8e6a8b571bfc896b2197f303251173df
Create p.py
webscraping/p.py
webscraping/p.py
Python
0.000004
@@ -0,0 +1,228 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport urllib2%0A%0At = urllib2.urlopen('http://www.gmasson.com.br/').read()%0A%0A# TAG%0Atags = t.split('%3Cp')%5B1:%5D%0Atags = %5B tag.split('%3C/p%3E')%5B0%5D for tag in tags %5D%0A%0Afor i in tags:%0A print i%0A
01710f18efbe29dc5cf187726d5c686beec7e6e7
Add helper script for getting plaso timeline in to timesketch
utils/add_plaso_timeline.py
utils/add_plaso_timeline.py
Python
0
@@ -0,0 +1,1481 @@ +# Copyright 2014 Google Inc. 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/LICENSE-2.0%0A#%0A...
2c0fc3387a6dbd54bbcd4c47952ce8739d0b2152
Add super-simple deduplication filter that uses a dictionary
dedup_worker.py
dedup_worker.py
Python
0.000006
@@ -0,0 +1,706 @@ +# Pull URL%0A# Strip query string%0A# Query exists%0A# IFN save to sqlite%0A# IFN push to queue%0A# IFY do nothing%0A%0Aseen = %7B%7D%0A%0Aif __name__ == '__main__':%0A from helpers import client%0A ingest = client.queue('ingest')%0A scrape = client.queue('scrape')%0A%0A while True:%0A ...
d62ffdce6df8cf848c1b1b198fc65d4dc0d70a1e
Add MergeSort.py
Sorting/MergeSort.py
Sorting/MergeSort.py
Python
0
@@ -0,0 +1,1752 @@ +# @auther Besir Kurtulmus%0A'''%0AThe MIT License (MIT)%0A%0ACopyright (c) 2014 Ahmet Besir Kurtulmus%0A%0APermission is hereby granted, free of charge, to any person obtaining a copy of%0Athis software and associated documentation files (the %22Software%22), to deal in%0Athe Software without restri...
c8da605c3eef2cc205a47851e9c3e5b7c2a60f00
Create nltk13.py
nltk13.py
nltk13.py
Python
0.000001
@@ -0,0 +1,2596 @@ +from __future__ import division%0Aimport sqlite3%0Aimport time%0A%0Aconn = sqlite3.connect('knowledgeBase.db')%0Aconn.text_factory = str%0Ac = conn.cursor()%0A%0AnegativeWords = %5B%5D%0ApositiveWords = %5B%5D%0A%0A%0Asql = %22SELECT * FROM wordVals WHERE value = ?%22%0A%0A%0Adef loadWordArrays():%0...
4ec6852368a79d272da145cdb3aa34620cbf0573
Create a.py
abc006/a.py
abc006/a.py
Python
0.000489
@@ -0,0 +1,89 @@ +n = int(input())%0A%0Aif n %25 3 == 0 or '3' in str(n):%0A print('YES')%0Aelse:%0A print('NO')%0A
51c6335718e5aca75d1c8e7e1fa08e396aa8a557
Create Valid_Parentheses.py
Array/Valid_Parentheses.py
Array/Valid_Parentheses.py
Python
0
@@ -0,0 +1,1426 @@ +Given a string containing just the characters '(', ')', '%7B', '%7D', '%5B' and '%5D', determine if the input string is valid.%0AThe brackets must close in the correct order, %22()%22 and %22()%5B%5D%7B%7D%22 are all valid but %22(%5D%22 and %22(%5B)%5D%22 are not.%0A%0Aclass Solution:%0A # @retu...
dbba2e9b541af2b95cbc3f9f306b3062be81460e
Create AnimationBase.py
AnimationBase.py
AnimationBase.py
Python
0.000001
@@ -0,0 +1,2294 @@ +# -*- coding: utf_8 -*-%0A%22%22%22%0ACreated on 13.07.2014%0A%0A@author: gitoni%0A%22%22%22%0A%0Aimport subprocess as sp%0Aimport os%0Aimport webbrowser as wb%0A%0A%0A%0Aclass Animation(object):%0A %22%22%22%0A A class for creating animations with ImageMagick. %0A Paths need to be adapted ...
83632d537a033deb017dbfeab02ba4e1073e309a
add export filters
couchforms/filters.py
couchforms/filters.py
Python
0.000001
@@ -0,0 +1,462 @@ +'''%0AOut of the box filters you can use to filter your exports%0A'''%0A%0Adef instances(doc):%0A %22%22%22%0A Only return XFormInstances, not duplicates or errors%0A %22%22%22%0A return doc%5B%22doc_type%22%5D == %22XFormInstance%22%0A%0Adef duplicates(doc):%0A %22%22%22%0A Only re...
7e8ff3971c21335468a683edcb9efb260c49bd61
Add packet class
packet.py
packet.py
Python
0.000001
@@ -0,0 +1,1691 @@ +class Packet:%0A PACKET_LENGTH = 4%0A%0A def decode(b):%0A %22%22%22Retuns a Packet object for the given string, or None if it isn't valid.%22%22%22%0A if len(b) != Packet.PACKET_LENGTH:%0A return None%0A%0A if b%5B0%5D %5E b%5B1%5D %5E b%5B2%5D != b%5B3%5D or (...
38aaf30aa1d148bfa31e7856b399a735ba818c6b
Add test for accessing module docstring.
tests/basics/module_docstring.py
tests/basics/module_docstring.py
Python
0.000008
@@ -0,0 +1,110 @@ +%22%22%22%0Adoc%0A%0Astring%22%22%22%0A%0Atry:%0A __doc__%0Aexcept NameError:%0A print(%22SKIP%22)%0A raise SystemExit%0A%0Aprint(__doc__)%0A
a91e1dad57331e4e944c1bd7168d61ec1ebc0fdf
fix #69 feincms_render_content templatetag error
feincms/templatetags/feincms_tags.py
feincms/templatetags/feincms_tags.py
from django import template from django.template.loader import render_to_string from feincms import settings as feincms_settings from feincms import utils register = template.Library() def _render_content(content, **kwargs): # Track current render level and abort if we nest too deep. Avoids # crashing in r...
Python
0
@@ -2226,36 +2226,37 @@ equest = self.re -gion +quest .resolve(context @@ -2692,38 +2692,23 @@ entNode( -feincms_object, region +content , reques
bbd8b248fb804349682e7c7a7e62c90aefaed536
the most common letters is [space][e][a][t]
51_100/Problem#59.py
51_100/Problem#59.py
Python
0.999999
@@ -0,0 +1,1165 @@ +import operator%0Adef most_common(lst):%0A return max(set(lst), key=lst.count)%0A%0Aif __name__ == %22__main__%22:%0A with open(%22cipher1.txt%22) as f:%0A for line in f:%0A numbers = %5Bint(x) for x in line.split()%5D%0A f.close()%0A list1 = %5Bnumbers%5Bi%5D for i...
3a2bec63eff4a2657250e46a523b5f98b9d27aea
Add tests for validate models.
coda/coda_validate/tests/test_models.py
coda/coda_validate/tests/test_models.py
Python
0
@@ -0,0 +1,185 @@ +from .. import factories%0A%0A%0Aclass TestValidate:%0A%0A def test_unicode(self):%0A validate = factories.ValidateFactory.build()%0A assert unicode(validate) == validate.identifier%0A
e44447501fb3fd1034f004947ae587f8f640882f
Add jsonp
imago/views.py
imago/views.py
from opencivicdata.models import (Jurisdiction, Organization, Person, Bill, VoteEvent, Event) from restless.modelviews import ListEndpoint, DetailEndpoint, Endpoint from django.core.paginator import Paginator, EmptyPage from restless.models import serialize from restless.http import H...
Python
0.000011
@@ -321,16 +321,25 @@ ttpError +, Http200 %0A%0A%0Adef s @@ -2735,16 +2735,120 @@ t(%22,%22)%0A%0A + callback = None%0A if 'callback' in params:%0A callback = params.pop('callback')%0A%0A @@ -2891,32 +2891,32 @@ args, **kwargs)%0A - data = s @@ -3214,21 +3214,33 @@ ...
9d30c51aac7ca00b4f191270a82f24372687163c
Add Pandoc filter to convert SVG illustrations to PDF
svg2pdf.py
svg2pdf.py
Python
0
@@ -0,0 +1,1416 @@ +#!/usr/bin/env python%0A%22%22%22%0APandoc filter to convert svg files to pdf as suggested at:%0Ahttps://github.com/jgm/pandoc/issues/265#issuecomment-27317316%0A%22%22%22%0A%0A__author__ = %22Jerome Robert%22%0A%0Aimport mimetypes%0Aimport subprocess%0Aimport os%0Aimport sys%0Afrom pandocfilters im...
6892e38e328508e05a349b0c4bc9a154dd854f4f
Create Maximal-Square.py
Array/Maximal-Square.py
Array/Maximal-Square.py
Python
0.000001
@@ -0,0 +1,2045 @@ +'''%0AGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.%0A%0AFor example, given the following matrix:%0A%0A1 0 1 0 0%0A1 0 1 1 1%0A1 1 1 1 1%0A1 0 0 1 0%0AReturn 4.%0A'''%0A%0A# Method 1: use the 2D array DP, the details showed in the f...
d9b03bf39a83a473f76aec045b3b182f25d1d7f5
Teste de JSON
backend/test/curso_tests/rest_tests.py
backend/test/curso_tests/rest_tests.py
Python
0.000001
@@ -0,0 +1,388 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, unicode_literals%0Afrom base import GAETestCase%0Afrom course_app.course_model import Course%0Afrom mommygae import mommy%0Afrom routes.courses import rest%0A%0A%0Aclass ListarTests(GAETestCase):%0A def test_sucesso(self):%0A ...
3ffe8dd8ed59cb5c03087844534a94b11bb73a8d
Add longest increasing subsequence
algo/lis.py
algo/lis.py
Python
0.999999
@@ -0,0 +1,242 @@ +arr = %5B1, 6, 3, 5, 9, 7%5D%0A%0Aans = %5B1%5D%0A%0Afor i in range(1, len(arr)):%0A t = %5B%5D%0A for j in range(i):%0A if arr%5Bi%5D %3E arr%5Bj%5D:%0A t.append(ans%5Bj%5D+1)%0A else:%0A t.append(ans%5Bj%5D)%0A%0A ans.append(max(t))%0A%0Aprint max(ans)%0...
b7c6b5115ce5aec129af64d6b85c672901a435d3
Add a multiprocessor for particle learning.
gpmcc/experiments/particle_engine.py
gpmcc/experiments/particle_engine.py
Python
0
@@ -0,0 +1,1752 @@ +# -*- coding: utf-8 -*-%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...
86acea4fde3f85d2edc9a52a6d6b2063d51ba935
fix for stats, better text formatting
gloss/views.py
gloss/views.py
from flask import abort, current_app, request from . import gloss as app from . import db from models import Definition, Interaction from sqlalchemy import func from re import sub from requests import post import json ''' values posted by Slack: token: the authenticaton token from Slack; available in the integrati...
Python
0.000001
@@ -2151,24 +2151,25 @@ like this: +* /gloss set E @@ -2190,16 +2190,17 @@ y Worker +* ', 200%0A%0A @@ -2508,16 +2508,20 @@ ned +* %7B%7D +* as +* %7B%7D +* '.fo @@ -3259,16 +3259,17 @@ e this: +* /gloss d @@ -3276,16 +3276,17 @@ elete EW +* ', 200%0A%0A @@ -3535,18 +3535,20 @@ ion for +* %7B%7D +...
61324ef30839bdcf99e20e0de2a4bb029e189166
Fix byte/str typing error
compose/cli/utils.py
compose/cli/utils.py
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import os import platform import ssl import subprocess import sys import docker import compose # WindowsError is not defined on non-win32 platforms. Avoid runtime errors by # defining it as OSError (its pa...
Python
0.000005
@@ -1218,17 +1218,16 @@ .rstrip( -b '%5Cn')%0A%0A%0A
ac58f25c47c9954a694a98008f8c658ae3a0f840
add a way to merge cut files together
add-cuts.py
add-cuts.py
Python
0.000001
@@ -0,0 +1,1471 @@ +import os%0Aimport csv%0Aimport json%0A%0Adef add_cuts(cuts_left, cuts_right):%0A output_dict = %7B%7D%0A for h in cuts_left.keys():%0A output_dict%5Bh%5D = dict((k, cuts_left%5Bh%5D%5Bk%5D+cuts_right%5Bh%5D%5Bk%5D) for k in %5B%22raw%22, %22scaled%22, %22weighted%22%5D)%0A return output_dict%...
db4d640bb4ec5cc3d6e7a21334b3ba35ca6a9268
Create obmplib.py
obmplib.py
obmplib.py
Python
0.000002
@@ -0,0 +1,2111 @@ +def read4bint(f, o):%0A ret = f%5Bo+3%5D%0A ret *= 256%0A ret += f%5Bo+2%5D%0A ret *= 256%0A ret += f%5Bo+1%5D%0A ret *= 256%0A ret += f%5Bo%5D%0A return ret%0A%0Adef read2bint(f, o):%0A ret = f%5Bo+1%5D%0A ret *= 256%0A ret += f%5Bo%5D%0A return ret%0A%0Adef load...
12a53e27471e4a647b2cb858b4abe5396c4f4a64
Fix DoorBird push notifications for installations with an API password (#12020)
homeassistant/components/doorbird.py
homeassistant/components/doorbird.py
""" Support for DoorBird device. For more details about this component, please refer to the documentation at https://home-assistant.io/components/doorbird/ """ import asyncio import logging import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD from homeassistant.components....
Python
0
@@ -2182,16 +2182,42 @@ ll.%22%22%22%0A%0A + requires_auth = False%0A url
98b52d35308a7661ac0a36254d9524fd9a9d5c56
Fix model filtering in create_all
iktomi/unstable/db/sqla/factories.py
iktomi/unstable/db/sqla/factories.py
from iktomi.utils import cached_property from iktomi.utils.deprecation import deprecated from iktomi.unstable.utils.functools import return_locals class ModelFactories(object): def __init__(self): self.models = [] self.i18n_models = [] def get_constructor(self, func): return return_l...
Python
0
@@ -1515,36 +1515,40 @@ -pass +continue %0A if @@ -1608,36 +1608,40 @@ -pass +continue %0A cls
e5a0647862c179fb0840454fd6b827c46a05ecbc
Add check_scattering_factor.py to see atomic scattering factors for X-ray and electrons Commit 41956836
cctbx_progs/check_scattering_factor.py
cctbx_progs/check_scattering_factor.py
Python
0
@@ -0,0 +1,1123 @@ +import numpy%0Aimport cctbx.eltbx.xray_scattering%0Aimport cctbx.eltbx.e_scattering%0A%0Adef fetch_equation(table):%0A return %22+%22.join(%5B%22%25f*exp(-%25f*s**2)%22 %25(a,b) for a,b in zip(table.array_of_a(), table.array_of_b())%5D) + %22+%25f%22 %25 table.c()%0A%0Adef run(elements, smin=0, s...
3a9807fd14257c49490ec429d7365c902209508c
Add beginnings of a Python driver. Currently just prints out input file.
gumbo_stats.py
gumbo_stats.py
Python
0
@@ -0,0 +1,307 @@ +import ctypes%0Aimport sys%0A%0Adef parse_warc(filename):%0A pass%0A%0Adef parse_file(filename):%0A with open(filename) as infile:%0A text = infile.read()%0A print(text)%0A%0Aif __name__ == '__main__':%0A filename = sys.argv%5B1%5D%0A if filename.endswith('.warc.gz'):%0A parse_warc(filen...
36d7bc4719490b046d8782465ddeba6e8240233e
Split images into bf and bc bears. Defaults to images.
tools/xml_split_images_locale.py
tools/xml_split_images_locale.py
Python
0
@@ -0,0 +1,984 @@ +#! /usr/bin/python3%0A%0Aimport sys%0Aimport argparse%0Aimport xml_utils as u%0Aimport datetime%0Afrom argparse import RawTextHelpFormatter%0Afrom collections import defaultdict%0A%0A##------------------------------------------------------------%0A## can be called with:%0A##%09 %0A## write bc an...
1077d1df94b207606a15a233182a6f6aa07c9625
create module to support vendoring
vendor.py
vendor.py
Python
0
@@ -0,0 +1,2617 @@ +import subprocess%0Aimport os%0Afrom os import path%0Aimport traceback%0Aimport sys%0Aimport shutil%0A%0A%0Aerror_msg = %22%22%22%0AThis library depends on sources fetched when packaging that failed to be%0Aretrieved.%0A%0AThis means that it will *not* work as expected. Errors encountered:%0A%22%22%...
35ce1ebb65e7a151e368d189f7a5c9a31d2b5624
Fix doctest failing by last bug fixing.
scikits/learn/pipeline.py
scikits/learn/pipeline.py
""" Pipeline: chain transforms and estimators to build a composite estimator. """ # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Licence: BSD from .base import BaseEstimator class Pipeline(BaseEstimator): """ Pipeline of transforms with a final estimator Sequentialy appl...
Python
0
@@ -2901,17 +2901,16 @@ amma=0.0 -1 ))%5D)%0A%0A
62ed9524bc1c7ec5aafb44e3e1aea0c313083d64
add script to retrieve catalog statistics
add-ons/tools/get_info.py
add-ons/tools/get_info.py
Python
0
@@ -0,0 +1,1004 @@ +#!/usr/bin/env python%0A%0Aimport sys%0Aimport cvmfs%0A%0Adef usage():%0A print sys.argv%5B0%5D + %22 %3Clocal repo name %7C remote repo url%3E %5Broot catalog%5D%22%0A print %22This script looks in the given root_catalog (or the repository HEAD) and%22%0A print %22retrieves the contained s...
34e7a8d904b332a91a615043a629725100367d6f
Add ast.GlyphDefinition
Lib/fontTools/voltLib/ast.py
Lib/fontTools/voltLib/ast.py
Python
0.000001
@@ -0,0 +1,542 @@ +from __future__ import print_function, division, absolute_import%0Afrom __future__ import unicode_literals%0Aimport fontTools.feaLib.ast as ast%0A%0A%0Aclass VoltFile(ast.Block):%0A def __init__(self):%0A ast.Block.__init__(self, location=None)%0A%0Aclass GlyphDefinition(ast.Statement):%0A ...
d51699474a9221a71daff29d7f834bedf618acad
week1-Exercise:varA varB
varAvarB.py
varAvarB.py
Python
0.972752
@@ -0,0 +1,563 @@ +'''%0AAssume that two variables, varA and varB, are assigned values, either numbers or strings.%0A%0AWrite a piece of Python code that evaluates varA and varB, and then prints out one of the following messages:%0A%0A%22string involved%22 if either varA or varB are strings%0A%0A%22bigger%22 if varA is...
52c0006c7d26e821eeba6e4ad07949f8f59b9e86
add wrapper
letmecreate/click/alcohol.py
letmecreate/click/alcohol.py
Python
0
@@ -0,0 +1,606 @@ +#!/usr/bin/env python3%0A%22%22%22Python binding of Alcohol Click wrapper of LetMeCreate library.%22%22%22%0Aimport ctypes%0A%0A_LIB = ctypes.CDLL('libletmecreate_click.so')%0A%0A%0Adef get_measure(mikrobus_index):%0A %22%22%22Returns a 16-bit integer from the Accel Click.%0A%0A mikrobus_index:...
a0d5c9aaf0f573ff11beacb6a30a91f90312dd08
Create BitonicSort.py (#386)
sorts/BitonicSort.py
sorts/BitonicSort.py
Python
0
@@ -0,0 +1,1624 @@ +# Python program for Bitonic Sort. Note that this program %0A# works only when size of input is a power of 2. %0A%0A# The parameter dir indicates the sorting direction, ASCENDING %0A# or DESCENDING; if (a%5Bi%5D %3E a%5Bj%5D) agrees with the direction, %0A# then a%5Bi%5D and a%5Bj%5D are interchange...
7457275762214bef85ad53282eb0bb8bc9d6ddba
Create DetachReAttach.py
DetachReAttach.py
DetachReAttach.py
Python
0
@@ -0,0 +1,1495 @@ +import csv%0Aimport arcpy%0Aimport os%0Aimport sys%0A%0Ainput = r%22Database Connections%5Cyour.sde%5Cpictures featureclass%22%0AinputField = %22NAME%22%0AmatchTable = r%22C:%5CUsers%5C%3Cuser%3E%5CDesktop%5Cmatchtable.csv%22%0AmatchField = %22NAME%22%0ApathField = r%22picture Location%22 %0Arootdir...
76d2d97183d4e57f9f59f654fc1302bf99740c0b
add failing test
molo/core/tests/test_models.py
molo/core/tests/test_models.py
Python
0.00005
@@ -0,0 +1,885 @@ +import pytest%0Afrom datetime import datetime, timedelta%0Afrom django.test import TestCase%0A%0Afrom molo.core.models import ArticlePage%0A%0A%0A@pytest.mark.django_db%0Aclass TestModels(TestCase):%0A fixtures = %5B'molo/core/tests/fixtures/test.json'%5D%0A%0A def test_article_order(self):%0A ...
1dbfcfd6558a3148ea2726898d65e1e8ef9115fc
Add a management command that imports bug data from YAML files
mysite/customs/management/commands/import_bugimporter_data.py
mysite/customs/management/commands/import_bugimporter_data.py
Python
0.000002
@@ -0,0 +1,1281 @@ +# This file is part of OpenHatch.%0A# Copyright (C) 2012 OpenHatch, Inc.%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 Software Foundation, either version 3 of the License, or%...
1314da3ffbaa42aca4a917aef8a230478a22be68
Add a script that uses the JSON metadata to create ordered symlinks.
scripts/order-symlinks.py
scripts/order-symlinks.py
Python
0
@@ -0,0 +1,1885 @@ +#!/usr/bin/env python%0A# Copyright (C) 2013 Tobias Gruetzmacher%0A%22%22%22%0AThis script takes the JSON file created by 'dosage -o json' and uses the%0Ametadata to build a symlink farm in the deduced order of the comic. It created%0Athose in a subdirectory called 'inorder'.%0A%22%22%22%0Afrom __fu...
a756edd9da035b027e2538228da349592031412e
Create ASCII_Art.py
Easy/ASCII_Art.py
Easy/ASCII_Art.py
Python
0.002622
@@ -0,0 +1,550 @@ +l = int(input())%0Ah = int(input())%0At = input()%0A%0Arow=%5B%5D%0Afor i in range(h):%0A row.append(input())%0A%0Aalpha=%5B%22a%22,%22b%22,%22c%22,%22d%22,%22e%22,%22f%22,%22g%22,%22h%22,%22i%22,%22j%22,%22k%22,%22l%22,%22m%22,%22n%22,%22o%22,%22p%22,%22q%22,%22r%22,%22s%22,%22t%22,%22u%22,%22v%2...
3cf77344df5993428cab38f646303e6735ecefd3
Implement shorthand type constructors for users
numba/typesystem/shorthands.py
numba/typesystem/shorthands.py
Python
0.000001
@@ -0,0 +1,2875 @@ +%22%22%22%0AShorthands for type constructing, promotions, etc.%0A%22%22%22%0A%0Afrom numba.typesystem import *%0Afrom numba.minivect import minitypes%0A%0A#------------------------------------------------------------------------%0A# Utilities%0A#------------------------------------------------------...
66591bd481a8c78f9563ef001f0d799a38130869
add version file
autofocus/version.py
autofocus/version.py
Python
0.000001
@@ -0,0 +1,22 @@ +__version__ = %221.2.0%22%0A
8d1d0719b2d43e49f9e3403d147201b34b526a81
Add SubscriptionInfo class
cartoframes/data/observatory/subscription_info.py
cartoframes/data/observatory/subscription_info.py
Python
0
@@ -0,0 +1,826 @@ +%0Aclass SubscriptionInfo(object):%0A%0A def __init__(self, raw_data):%0A self._raw_data = raw_data%0A%0A @property%0A def id(self):%0A return self._raw_data.get('id')%0A%0A @property%0A def estimated_delivery_days(self):%0A return self._raw_data.get('estimated_del...
92e26495da9dad9359fcef426e37b5f510f30d8e
Disable the DLNA component discovery (#16006)
homeassistant/components/discovery.py
homeassistant/components/discovery.py
""" Starts a service to scan in intervals for new devices. Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are loaded before the EVENT_PLATFORM_DISCOVERED is fired. """ import json from datetime import timedelta import lo...
Python
0
@@ -2995,54 +2995,8 @@ '),%0A - 'dlna_dmr': ('media_player', 'dlna_dmr'),%0A %7D%0A%0AO @@ -3075,16 +3075,62 @@ None),%0A + 'dlna_dmr': ('media_player', 'dlna_dmr'),%0A %7D%0A%0ACONF_
15b6bbac7bce15f6f7d72618f51877455f3e0ee5
improve tag resolution handling
git/refs/tag.py
git/refs/tag.py
from .reference import Reference __all__ = ["TagReference", "Tag"] class TagReference(Reference): """Class representing a lightweight tag reference which either points to a commit ,a tag object or any other object. In the latter case additional information, like the signature or the tag-creator, is avai...
Python
0.000009
@@ -745,16 +745,88 @@ oints to +%0A %0A :raise ValueError: if the tag points to a tree or blob %22%22%22%0A @@ -1107,78 +1107,172 @@ ror( -%22Tag %25s points to a Blob or Tree - have never seen that before%22 +(%22Cannot resolve commit as tag %25s points to a %25s object - %22%0A ...
8180c84a98bec11308afca884a4d7fed4738403b
Add tests for new Levenshtein alignment
spacy/tests/test_align.py
spacy/tests/test_align.py
Python
0
@@ -0,0 +1,1128 @@ +import pytest%0Afrom .._align import align%0A%0A%0A@pytest.mark.parametrize('string1,string2,cost', %5B%0A (b'hello', b'hell', 1),%0A (b'rat', b'cat', 1),%0A (b'rat', b'rat', 0),%0A (b'rat', b'catsie', 4),%0A (b't', b'catsie', 5),%0A%5D)%0Adef test_align_costs(string1, string2, cost):...
dc9c9cfd45726e4f3458fcc0f02c29c61482c0bc
Create gzip_identifier.py
identifiers/gzip_identifier.py
identifiers/gzip_identifier.py
Python
0.000015
@@ -0,0 +1,201 @@ +from identifier import Result%0A%09%0AGZ_PATTERNS = %5B%0A%09'1F 8B 08 08'%0A%5D%0A%09%0Aclass GzResolver:%0A%09def identify(self, stream):%0A%09%09return Result('GZ')%0A%09%0Adef load(hound):%0A%09hound.add_matches(GZ_PATTERNS, GzResolver())%0A
ffe76ac5d3cd5485dd288415a5845c2d5a247633
add shipping
components/shipping_reckoner/shipping_reckoner.py
components/shipping_reckoner/shipping_reckoner.py
Python
0
@@ -0,0 +1,1101 @@ +#! /usr/bin/env python%0A%0Afrom json import loads, dumps%0Afrom pika import BlockingConnection, ConnectionParameters%0A%0ARABBIT_MQ_HOST = '54.76.183.35'%0ARABBIT_MQ_PORT = 5672%0A%0Adef shipping(ch, method, properties, body):%0A product = loads(body)%0A sku, price = product%5B'sku'%5D, produ...
8c85761d37625393cdb70664af33853cbe105a9d
Create binarytree_intree.py
binarytree_intree.py
binarytree_intree.py
Python
0.000905
@@ -0,0 +1,73 @@ +%22%22%22%22%0Afind if a is a subset of b,%0Awhere both a and b are binary trees%0A%22%22%22%0A
cbef1510b8bf0e7d0d9a3bb5a678d2d118822979
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/d33e1ade02f55fd63e04ccf6e6188d009c9d3b69.
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 = "272fc1c72b798def2a9e2a384c478a6ee4b357c9" TFRT_SHA256 = "a6173ac76fc7d2361729f6c268b3...
Python
0
@@ -228,133 +228,133 @@ = %22 -272fc1c72b798def2a9e2a384c478a6ee4b357c9%22%0A TFRT_SHA256 = %22a6173ac76fc7d2361729f6c268b3cf3b39d40c82930b13f69f9f7b8d9a0fbf93 +d33e1ade02f55fd63e04ccf6e6188d009c9d3b69%22%0A TFRT_SHA256 = %22ac62839411fe0f0cde68daa8f50a3563dccda1b1623e7c7131d71218ae514bc8 %22%0A%0A
aeafc18cee3e8d833160d3bc2df6a971878022fe
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/90ada7c89c5d812ae3fe09d7c2cbd9a77e7273b8.
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 = "e66a3653ca77861cb3d9c34eb6bbe05d4f67dfae" TFRT_SHA256 = "edabb53b75f8fef59d308310d2bf...
Python
0.000001
@@ -228,133 +228,133 @@ = %22 -e66a3653ca77861cb3d9c34eb6bbe05d4f67dfae%22%0A TFRT_SHA256 = %22edabb53b75f8fef59d308310d2bf01d50d6ed783d49da8bd1514aca108b968e8 +90ada7c89c5d812ae3fe09d7c2cbd9a77e7273b8%22%0A TFRT_SHA256 = %228f2aab5b834112dd815bac9b04168019914e307826db523c13c3aebfdc127eca %22%0A%0A
941f89dfb8f4c8bf0a8445d3c57ff9e652ad85d1
Create server.py
lab1/server.py
lab1/server.py
Python
0.000001
@@ -0,0 +1,3 @@ +ok%0A
bc46efa788a0e3d0aacab724e16b8da01a671331
Add p1.
p1.py
p1.py
Python
0.000006
@@ -0,0 +1,543 @@ +def p1_for(input_list):%0A %22%22%22Compute some of numbers in list with for loop.%22%22%22%0A out = 0%0A for i in input_list:%0A out += i%0A return out%0A%0A%0Adef p1_while(input_list):%0A %22%22%22Compute some of numbers in list with while loop.%22%22%22%0A out = 0%0A co...
1a6818d4829c3da42750f6d0f042df203434595c
Add a little to models
Carkinos/probes/migrations/0002_auto_20160106_2307.py
Carkinos/probes/migrations/0002_auto_20160106_2307.py
Python
0
@@ -0,0 +1,843 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9 on 2016-01-06 15:07%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('probes', '0001_initial'),%0A %5D%0A%0A operation...
2a6d8bc208463a0f903a2b62021abb913ab510c5
Add TestSuiteHandler.
app/handlers/test_suite.py
app/handlers/test_suite.py
Python
0
@@ -0,0 +1,3165 @@ +# 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%0A# published by the Free Software Foundation, either version 3 of the%0A# License, or (at your option) any later version.%0A#%0A# This program is distributed in ...
d1ce76f33bdf93ee631f3ee38b565e79a1f38343
add a demo of building a custom python wrapper using libgvc
dot.demo/gv_test.py
dot.demo/gv_test.py
Python
0
@@ -0,0 +1,177 @@ +#!/usr/bin/python%0A%0Aimport gv%0A%0Ag = gv.digraph(%22G%22)%0An = gv.node(g,%22hello%22)%0Am = gv.node(g,%22world%22)%0Ae = gv.edge(n,m)%0Agv.layout(g, %22dot%22)%0Agv.render(g, %22png%22, %22gv_test.png%22)%0Agv.rm(g)%0A
d9b4607819d985dee086ff4f435972d304e3a45e
update Site admin
plstackapi/core/models/site.py
plstackapi/core/models/site.py
import os from django.db import models from plstackapi.core.models import PlCoreBase from plstackapi.core.models import DeploymentNetwork from plstackapi.openstack.driver import OpenStackDriver # Create your models here. class Site(PlCoreBase): tenant_id = models.CharField(max_length=200, help_text="Keystone t...
Python
0
@@ -131,17 +131,16 @@ Network%0A -%0A from pls @@ -321,16 +321,28 @@ nant id%22 +, blank=True )%0A na @@ -1094,24 +1094,24 @@ e='sites')%0A%0A - def __un @@ -1154,16 +1154,902 @@ .name)%0A%0A + def save(self, *args, **kwds):%0A driver = OpenStackDriver()%0A if not self.tenant_id:%0A ...
42192dad06079a654945a9a53dcdc548aa7085c4
Create __init__.py
modules/datasave/__init__.py
modules/datasave/__init__.py
Python
0.000429
@@ -0,0 +1,2 @@ + %0A
ad72e7cdc02d746ec56dfd85ed5a46de59e57684
add the pocket pla machine laerning algorithm
machine_learning/python/pocket_pla.py
machine_learning/python/pocket_pla.py
Python
0.000001
@@ -0,0 +1,1081 @@ +import random%0Aimport numpy as np%0AFEATURE = 5%0Adef sign(num):%0A if np.sign(num) %3C= 0:%0A return -1.0%0A return 1.0%0Adef pla(X,y,m):%0A ''' improved (pocket) perceptron learning algorithm%0A%0A Arguments:%0A X %7Blist or numpy array%7D%0A y %7Blist or numpy ar...
4fe62ac1211e68f1d9c656453bdf71d6849c3daf
Add organisation values for the Enterprise Europe Network.
migrations/versions/0101_een_logo.py
migrations/versions/0101_een_logo.py
Python
0
@@ -0,0 +1,634 @@ +%22%22%22empty message%0A%0ARevision ID: 0101_een_logo%0ARevises: 0100_notification_created_by%0ACreate Date: 2017-06-26 11:43:30.374723%0A%0A%22%22%22%0A%0Afrom alembic import op%0A%0Arevision = '0101_een_logo'%0Adown_revision = '0100_notification_created_by'%0A%0A%0AENTERPRISE_EUROPE_NETWORK_ID = '...
eff52ac7e0177cdf79b4fe4f076bf411a4b2b54b
Add migration file
migrations/versions/bf1347acdee2_.py
migrations/versions/bf1347acdee2_.py
Python
0.000001
@@ -0,0 +1,1000 @@ +%22%22%22empty message%0A%0ARevision ID: bf1347acdee2%0ARevises: b4dd0add5f79%0ACreate Date: 2018-03-23 17:08:11.289953%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A%0A# revision identifiers, used by Alembic.%0Arevision = 'bf1347acdee2'%0Adown_revision = 'b4dd0add5f79'%0Abr...
845615f2a34c5680ed22a2f4eafa5febe7cd7246
Add date updated to Owner
alembic/versions/20087beff9ea_added_date_updated_t.py
alembic/versions/20087beff9ea_added_date_updated_t.py
Python
0
@@ -0,0 +1,614 @@ +%22%22%22Added date updated to Owner%0A%0ARevision ID: 20087beff9ea%0ARevises: 2dc72d16c188%0ACreate Date: 2014-03-09 01:43:00.648013%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '20087beff9ea'%0Adown_revision = '2dc72d16c188'%0A%0Afrom alembic import op%0Aimport sqlalche...
b0480b55ea19bc661091924fb21b1b9b95b54200
Create NoDuplicateLetters-Hard.py
Edabit/NoDuplicateLetters-Hard.py
Edabit/NoDuplicateLetters-Hard.py
Python
0
@@ -0,0 +1,535 @@ +#!/usr/bin/env python3%0A'''%0AGiven a common phrase, return False if any individual word in the phrase contains duplicate letters. %0AReturn True otherwise.%0A'''%0Adef no_duplicate_letters(phrase):%0A%09val = %5Bphrase%5D%0A%09nlst = ' '.join(val).split()%0A%09st = %5Blen(i) for i in nlst%5D%0A%09e...
679fbe2825a1c2a6312cd1d13974cbe9feb30be9
user prompts: python3
user_prompts/python3/user_prompts.py
user_prompts/python3/user_prompts.py
Python
0.999993
@@ -0,0 +1,305 @@ +#!/usr/bin/python3%0A%0Aname = input(%22Name: %22)%0Aage = input(%22Age: %22)%0Ausername = input(%22Username: %22)%0A%0Aif username.find(%22u/%22) == 0:%0A%09username = %22/%22+username%0A%0Aif username.find(%22/u/%22) == -1:%0A%09username = %22/u/%22+username%0A%0Aprint(%22Your name is %22+name+%22,...
4745a6e80b978d6310ab59c8ac3f0ce562dd7aa8
Add module to compile with nuitka
n_utils/nitor-dt-load-project-env.py
n_utils/nitor-dt-load-project-env.py
Python
0
@@ -0,0 +1,69 @@ +from n_utils.project_util import load_project_env%0A%0Aload_project_env()
36af34a1537bbfc30a8e124bfc82c4650a31c8d3
Fix wrong unit test about config option enabled_apis
nova/tests/unit/cmd/test_nova_api.py
nova/tests/unit/cmd/test_nova_api.py
# Copyright 2015 HPE, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
Python
0.000241
@@ -974,781 +974,8 @@ ):%0A%0A - @mock.patch('nova.service.process_launcher')%0A def test_with_ec2(self, launcher, version_cache):%0A %22%22%22Ensure that we don't explode if enabled_apis is wrong.%0A%0A If the end user hasn't updated their config, an ec2 entry%0A might accidentally kill the...
68b865c120e49c8a64cdeb010893ca6e6c0de32f
Create webapp.py
webapp.py
webapp.py
Python
0.000044
@@ -0,0 +1,310 @@ +from flask import Flask%0A%0Aapp = Flask(__name__) #__name__ = %22__main__%22 if this is the file that was run. Otherwise, it is the name of the file (ex. webapp)%0A%0A@app.route(%22/%22)%0Adef render_main():%0A return url_for('static', filename='home.html')%0A %0Aif __name__==%22__main__%22:%...
a2386d80fbbff2cd3ab3814cd850a8471280dde8
Check if user.token attribute exists
openstack_dashboard/views.py
openstack_dashboard/views.py
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
Python
0.000006
@@ -896,251 +896,111 @@ -dashboard = None%0A if user.is_superuser:%0A try:%0A dashboard = horizon.get_dashboard('admin')%0A except base.NotRegistered:%0A pass%0A%0A if dashboard is None:%0A dashboard = horizon.get_default_dashboar +try:%0A token = user.token...
256bd96aabbb4b12972e070e11bfbd95248c3f29
add new recipe
recipes/sdl2_mixer/__init__.py
recipes/sdl2_mixer/__init__.py
Python
0.000001
@@ -0,0 +1,783 @@ +from toolchain import Recipe, shprint%0Aimport sh%0A%0A%0Aclass LibSDL2MixerRecipe(Recipe):%0A version = %222.0.0%22%0A url = %22http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-%7Bversion%7D.tar.gz%22%0A library = %22Xcode-iOS/build/Release-%7Barch.sdk%7D/libSDL2_mixer.a%22%0A ...