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 |
|---|---|---|---|---|---|---|---|
2ecf595b29b3b45769ab0934be6d095a4f80ad56 | Add mmtl unit teset | tests/metal/mmtl/test_mmtl.py | tests/metal/mmtl/test_mmtl.py | Python | 0 | @@ -0,0 +1,894 @@
+import unittest%0A%0Afrom metal.mmtl.BERT_tasks import create_tasks%0Afrom metal.mmtl.metal_model import MetalModel%0Afrom metal.mmtl.trainer import MultitaskTrainer%0A%0A%0Aclass MMTLTest(unittest.TestCase):%0A @classmethod%0A def setUpClass(cls):%0A task_names = %5B%0A %22CO... | |
34b1eb53ffbca24a36c103f2017b8780405c48f4 | add prod wsgi to code | find.wsgi | find.wsgi | Python | 0 | @@ -0,0 +1,65 @@
+from openspending import core%0Aapplication = core.create_web_app()
| |
59de1a12d44245b69ade0d4703c98bf772681751 | Add tests for User admin_forms | user_management/models/tests/test_admin_forms.py | user_management/models/tests/test_admin_forms.py | Python | 0 | @@ -0,0 +1,1432 @@
+from django.core.exceptions import ValidationError%0Afrom django.test import TestCase%0A%0Afrom .. import admin_forms%0Afrom . factories import UserFactory%0A%0A%0Aclass UserCreationFormTest(TestCase):%0A def test_clean_email(self):%0A email = 'test@example.com'%0A%0A form = admin_f... | |
706e8a6318b50466ee00ae51f59ec7ab76f820d6 | Create forecast.py | forecast.py | forecast.py | Python | 0 | @@ -0,0 +1,1971 @@
+# -*- coding: utf-8 -*-%0A# Weather Twitter Bot - AJBBB - 7/8/2015 v2.*%0A %0Aimport urllib2%0Aimport json%0Afrom birdy.twitter import UserClient%0Aimport tweepy%0A %0A#Twitter Keys%0ACONSUMER_KEY = %22YOUR CONSUMER KEY HERE%22%0ACONSUMER_SECRET = %22YOUR CONSUMER SECRET HERE%22%0AACCESS_TOKEN = %22... | |
ae1aaaddb8adbbe4167e9b2a073493df90f6fd60 | Remove unused CACHE_VERSION | subliminal/cache.py | subliminal/cache.py | # -*- coding: utf-8 -*-
import datetime
from dogpile.cache import make_region
#: Subliminal's cache version
CACHE_VERSION = 1
#: Expiration time for show caching
SHOW_EXPIRATION_TIME = datetime.timedelta(weeks=3).total_seconds()
#: Expiration time for episode caching
EPISODE_EXPIRATION_TIME = datetime.timedelta(da... | Python | 0.000065 | @@ -77,58 +77,8 @@
on%0A%0A
-%0A#: Subliminal's cache version%0ACACHE_VERSION = 1%0A%0A
#: E
|
1d5227941c4839ff781fb944f425865b8afdc01f | Add lc0732_my_calendar_iii.py | lc0732_my_calendar_iii.py | lc0732_my_calendar_iii.py | Python | 0.000225 | @@ -0,0 +1,1939 @@
+%22%22%22Leetcode 732. My Calendar III%0AHard%0A%0AURL: https://leetcode.com/problems/my-calendar-iii/%0A%0AImplement a MyCalendarThree class to store your events. A new event can always be added.%0A%0AYour class will have one method, book(int start, int end). Formally, this represents a%0Abooking o... | |
5dc8e70bc081646fdeb37e9af1090a78e016d91b | add script inserting initial datas in selected database | insert_initial_datas.py | insert_initial_datas.py | Python | 0 | @@ -0,0 +1,1236 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport psycopg2%0Aimport sys%0Aimport argparse%0A%0APOSTGRESQL_connection = u%22host='localhost' port=5432 user='postgres' password='postgres'%22%0A%0Adef main():%0A parser = argparse.ArgumentParser(description=%22Script d'insertion des donn%C3... | |
2aa90b34951bde36696bbcb773940a6adc245f23 | Add Authenticater plugin | plugins/Authenticater.py | plugins/Authenticater.py | Python | 0 | @@ -0,0 +1,2405 @@
+from ts3observer.models import Plugin, Action%0A%0Aimport MySQLdb%0A%0A%0Aclass Meta:%0A author_name = 'Tim Fechner'%0A author_email = 'tim.b.f@gmx.de'%0A version = '1.0'%0A%0Aclass Config:%0A enable = False%0A interval = 5%0A yaml = %7B%0A 'general': %7B%0A 'serv... | |
571dbf74bfc9f893d25ad7d626de800b2b3d6c73 | move load document functionality to deserializer. prepare for post/put methods | jsonapi/deserializer.py | jsonapi/deserializer.py | Python | 0.000002 | @@ -0,0 +1,355 @@
+%22%22%22 Deserializer definition.%22%22%22%0A%0A%0Aclass DeserializerMeta(object):%0A pass%0A%0A%0Aclass Deserializer(object):%0A%0A Meta = DeserializerMeta%0A%0A @classmethod%0A def load_document(cls, document):%0A %22%22%22 Given document get model.%0A%0A :param dict docu... | |
6537dc8853bb7f8d9fb93b0fb2b1c0241bb08b6b | Create client.py | python-scripts/client.py | python-scripts/client.py | Python | 0 | @@ -0,0 +1,1361 @@
+import socket%0Afrom datetime import datetime, time%0A%0As=socket.socket(socket.AF_INET, socket.SOCK_STREAM) # create a client socket%0Aport=9999%0A%0A# get the current date-time%0Atime1=datetime.now()%0A%0As.connect((%2210.0.0.2%22, port)) # connect to server socket which is at address 10.0.0.2 and... | |
bae50495106ce5c9cb39143a58e0e73a4e823d29 | Implement DispatchLoader (metapath import hook) | loader.py | loader.py | Python | 0 | @@ -0,0 +1,1130 @@
+from __future__ import print_function, absolute_import, unicode_literals, division%0Afrom stackable.stack import Stack%0Afrom stackable.utils import StackablePickler%0Afrom stackable.network import StackableSocket, StackablePacketAssembler%0Afrom sys import modules%0Afrom types import ModuleType%0A%... | |
0f79cf1d15292476f2bead6d85d15e6f0db6ebbf | Revert "Remove manage.py in the root" | manage.py | manage.py | Python | 0 | @@ -0,0 +1,811 @@
+#!/usr/bin/env python%0Aimport os%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22tests.sandbox.settings%22)%0A try:%0A from django.core.management import execute_from_command_line%0A except ImportError:%0A # The above ... | |
540ab945736486ce78452750486ea73128b29d7b | Add parse_xml.py | parse_xml.py | parse_xml.py | Python | 0.000263 | @@ -0,0 +1,802 @@
+import sys%0Aimport os%0Afrom bs4 import BeautifulSoup%0Afrom zipfile import ZipFile%0A%0Adef main(argv):%0A root, ext = os.path.splitext(argv%5B1%5D)%0A with ZipFile(argv%5B1%5D) as myzip:%0A with myzip.open(%22content.xml%22) as f:%0A soup = BeautifulSoup(f.read(), %22lxml%2... | |
269b779fe560fb85ca527cdda2ebd4e5e9b3a89c | Add monkeyrunner script to common operations | monkey/common.py | monkey/common.py | Python | 0 | @@ -0,0 +1,1323 @@
+from com.android.monkeyrunner import MonkeyDevice as mkd%0Afrom com.android.monkeyrunner import MonkeyRunner as mkr%0A%0A_ddmm_pkg = 'br.ufpe.emilianofirmino.ddmm'%0A%0Adef open_dev():%0A %22%22%22Estabilish a MonkeyDevice connection to android%22%22%22%0A return mkr.waitForConnection(1000)%0A... | |
e0d075661677b4b02fa29d108472e80b9fbcad02 | Add quote fixture | SoftLayer/testing/fixtures/Billing_Order_Quote.py | SoftLayer/testing/fixtures/Billing_Order_Quote.py | Python | 0 | @@ -0,0 +1,347 @@
+getObject = %7B%0A 'accountId': 1234,%0A 'id': 1234,%0A 'name': 'TestQuote1234',%0A 'quoteKey': '1234test4321',%0A%7D%0A%0AgetRecalculatedOrderContainer = %7B%0A 'orderContainers': %5B%7B%0A 'presetId': '',%0A 'prices': %5B%7B%0A 'id': 1921%0A %7D%5D,%0A... | |
07b6e59a5c7f581bd3e67f6ce254a8388e8b97e1 | add test | minitds/test_minitds.py | minitds/test_minitds.py | Python | 0.000002 | @@ -0,0 +1,1907 @@
+#!/usr/bin/env python3%0A##############################################################################%0A# The MIT License (MIT)%0A#%0A# Copyright (c) 2016 Hajime Nakagami%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated docume... | |
a13ee62b02d3fe1958f2cbecd903c3e8b32562da | Add dummy test file #2 | tests/test_dummy.py | tests/test_dummy.py | Python | 0.000001 | @@ -0,0 +1,670 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A#%0A# Copyright 2017 Jun-ya HASEBA%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.a... | |
5d795253180ef11117ae27447fa597fa15b40734 | Add testing for graphing code | tests/test_graph.py | tests/test_graph.py | Python | 0 | @@ -0,0 +1,1304 @@
+import os%0A%0Afrom click.testing import CliRunner%0A%0Afrom cli.script import cli%0A%0A%0Adef get_graph_code():%0A return '''%0Afrom copy import deepcopy as dc%0A%0Aclass StringCopier(object):%0A def __init__(self):%0A self.copied_strings = set()%0A%0A def copy(self):%0A stri... | |
66989005b6e9443c65c082ea1c2e4386ffae1330 | Add a few basic pages tests ahead of #406 | tests/test_pages.py | tests/test_pages.py | Python | 0 | @@ -0,0 +1,994 @@
+from gittip.testing import serve_request, load, setup_tips%0A%0A%0Adef test_homepage():%0A actual = serve_request('/').body%0A expected = %22Gittip happens every Thursday.%22%0A assert expected in actual, actual%0A%0Adef test_profile():%0A with load(*setup_tips((%22cheese%22, %22puffs%22,... | |
7a5b46d5a9d0e45b928bcadfeb91a6285868d8f3 | Create medium_RunLength.py | medium_RunLength.py | medium_RunLength.py | Python | 0.000004 | @@ -0,0 +1,466 @@
+%22%22%22%0ADetermine the run length%0Aof a string%0Aex: aaabbrerr %3E 3a2b1r1e2r%0A%22%22%22%0Adef RunLength(string):%0A val = string%5B0%5D%0A count = 1%0A ret = %22%22%0A for char in string%5B1:%5D:%0A if char != val:%0A ret += str(count)%0A ret += val%0A val = char%0A c... | |
f3c8117755537ca96c3c8c72d5f54b8c244c260b | add top-level class | mwdust/DustMap3D.py | mwdust/DustMap3D.py | Python | 0.000566 | @@ -0,0 +1,943 @@
+###############################################################################%0A#%0A# DustMap3D: top-level class for a 3D dust map; all other dust maps inherit%0A# from this%0A#%0A###############################################################################%0Aclass DustMap3D:%0A ... | |
20cebf2b93a310dac4c491b5a59f1a2846f51073 | Add basic implementation | triegex/__init__.py | triegex/__init__.py | Python | 0.000002 | @@ -0,0 +1,1110 @@
+__all__ = ('Triegex',)%0A%0A%0Aclass TriegexNode:%0A%0A def __init__(self, char: str, childrens=()):%0A self.char = char%0A self.childrens = %7Bchildren.char: children for children in childrens%7D%0A%0A def render(self):%0A if not self.childrens:%0A return self.... | |
465956eb780ace1835e08ca2c87895d7ff1326cf | save a legacy script, may have to use again some year | util/wisc_ingest.py | util/wisc_ingest.py | Python | 0 | @@ -0,0 +1,681 @@
+import subprocess%0Aimport os%0Aimport glob%0Aimport mx.DateTime%0A%0Asts = mx.DateTime.DateTime(2011,12,1)%0Aets = mx.DateTime.DateTime(2012,1,1)%0A%0AWANT = %5B'EAST-CONUS','NHEM-COMP','SUPER-NATIONAL','NHEM-MULTICOMP','WEST-CONUS'%5D%0A%0Adef dodate(now, dir):%0A base = now.strftime(%22/mesonet... | |
099151db3a18384ebb4b7abc17c1a38567e5d2cb | add crash scan for reporting | utils/crash_scan.py | utils/crash_scan.py | Python | 0 | @@ -0,0 +1,1546 @@
+#!/usr/bin/python%0A%0Aimport subprocess%0Aimport re%0Aimport os%0A%0Ap = subprocess.Popen(%5B'adb', 'devices'%5D, stdout=subprocess.PIPE)%0Ares = p.communicate()%5B0%5D.split('%5Cn')%0Ares.pop(0)%0A%0Adevices = %5B%5D%0Afor li in res:%0A m = re.search('(%5Cw+)', li)%0A if(m is not None):%0A ... | |
2cb013d3d8f185cf92589dc2e927ef54057972ec | version bump for 0.88.3. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.88.2'
| Python | 0 | @@ -14,8 +14,8 @@
.88.
-2
+3
'%0A%0A
|
70b921cf951b65cc67fff48a3c853ecf45817a63 | version bump for 0.88.4. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.88.3'
| Python | 0 | @@ -14,8 +14,8 @@
.88.
-3
+4
'%0A%0A
|
13cf0fdc5ac54abbf746880306cdcacd158e81a2 | version bump for 0.83.8. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.83.7'
| Python | 0 | @@ -14,8 +14,8 @@
.83.
-7
+8
'%0A%0A
|
52cf673833196ef76158beee5ca877af356c76fc | version bump for 0.20.14.16. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.20.14.15'
| Python | 0 | @@ -18,8 +18,8 @@
14.1
-5
+6
'%0A%0A
|
49a173312f720042c8ca9778e6225b1de2b3dfd8 | version bump for 0.25.1.5. | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.25.1.4'
| Python | 0 | @@ -16,8 +16,8 @@
5.1.
-4
+5
'%0A%0A
|
9ddb89b4b652fb3026632ffd79dea9321f58cc31 | bump version in __init__.py | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.16.3.1'
| Python | 0.000023 | @@ -14,9 +14,7 @@
.16.
-3.1
+4
'%0A
|
9d994180a38976939e5da1757303ef8ed76f5e07 | bump version in __init__.py | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.19'
| Python | 0.000023 | @@ -9,10 +9,12 @@
= '0.19
+.1
'%0A
|
8a3273d9ef3612902671e4288be2462f0ba0696a | Use send_mass_mail instead of send_mail so only one connection needs to be opened to the mailserver for the whole lot | volunteers/admin.py | volunteers/admin.py | from django.contrib import admin
from django.core.mail import send_mail
from django.db import models
from django.forms import TextInput, Textarea, Form, CharField, MultipleHiddenInput
from django.http import HttpResponseRedirect
from django.shortcuts import render
from volunteers.models import Edition
from volunteers.... | Python | 0 | @@ -26,16 +26,49 @@
t admin%0A
+from django.conf import settings%0A
from dja
@@ -89,24 +89,29 @@
import send_
+mass_
mail%0Afrom dj
@@ -4538,16 +4538,53 @@
al = ''%0A
+ volunteer_mails = %5B%5D%0A
@@ -4618,16 +4618,16 @@
eryset:%0A
-
@@ -4742,64 +4742,168 @@
-send_mail(sub... |
aaca641f968bf12eb2177460f8cf809d62ea3bd4 | Add a strict version of itertools.groupby | bidb/utils/itertools.py | bidb/utils/itertools.py | Python | 0.000003 | @@ -0,0 +1,231 @@
+from __future__ import absolute_import%0A%0Aimport itertools%0A%0Adef groupby(iterable, keyfunc, sortfunc=lambda x: x):%0A return %5B%0A (x, list(sorted(y, key=sortfunc)))%0A for x, y in itertools.groupby(iterable, keyfunc)%0A %5D%0A
| |
d2c414576cfcf935ed36ffe2c5fb594911be0832 | work on sge module started | sge.py | sge.py | Python | 0 | @@ -0,0 +1,1731 @@
+from collections import OrderedDict%0A%0A__author__ = 'sfranky'%0Afrom lxml import etree%0A%0Afn = '/home/sfranky/PycharmProjects/results/gef_sge1/qstat.F.xml.stdout'%0Atree = etree.parse(fn)%0Aroot = tree.getroot()%0A%0A%0Adef extract_job_info(elem, elem_text):%0A %22%22%22%0A inside elem, it... | |
482a2639911b676bf68dcd529dcc1ffecaaf10ea | Create shortner.py | plugins/shortner.py | plugins/shortner.py | Python | 0.000002 | @@ -0,0 +1 @@
+%0A
| |
5ae58621bd766aeaa6f1838397b045039568887c | Add driver to find plate solutions | platesolve.py | platesolve.py | Python | 0 | @@ -0,0 +1,303 @@
+import babeldix%0A%0Aimport sys%0Aimport operator%0A%0A# Print solutions in order of increasing score%0A%0Afor plate in sys.argv%5B1:%5D:%0A solns = babeldix.Plates.get_solutions(plate)%0A for (soln,score) in sorted(solns.items(), key=operator.itemgetter(1)):%0A print '%7B0:s%7D %7B1:d%7... | |
c1bfe92878edc3f9598a6d97046775cb8d9b0aa0 | Make migration for item-visibility change | depot/migrations/0009_auto_20170330_1342.py | depot/migrations/0009_auto_20170330_1342.py | Python | 0.000006 | @@ -0,0 +1,513 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.6 on 2017-03-30 13:42%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('depot', '0008_auto_20170330_0855'),%0A %5D%0A%0A... | |
03ecddce6f34d04957ca5161eb7d776daf02ed47 | Add blobdb messages | protocol/blobdb.py | protocol/blobdb.py | Python | 0 | @@ -0,0 +1,618 @@
+__author__ = 'katharine'%0A%0Afrom base import PebblePacket%0Afrom base.types import *%0A%0A%0Aclass InsertCommand(PebblePacket):%0A key_size = Uint8()%0A key = BinaryArray(length=key_size)%0A value_size = Uint16()%0A value = BinaryArray(length=value_size)%0A%0A%0Aclass DeleteCommand(Pebb... | |
cf0310a7111bdb79b4bbe2a52095c8344778c80c | Add admin.py for protocols | protocols/admin.py | protocols/admin.py | Python | 0 | @@ -0,0 +1,92 @@
+from django.contrib import admin%0Afrom .models import Protocol%0A%0Aadmin.site.register(Protocol)
| |
98ed7f3f682bf1ba23bb0030aa81e8fff23e54ad | Add harvester | scrapi/harvesters/uow.py | scrapi/harvesters/uow.py | Python | 0.000012 | @@ -0,0 +1,541 @@
+'''%0AHarvester for the Research Online for the SHARE project%0A%0AExample API call: http://ro.uow.edu.au/do/oai/?verb=ListRecords&metadataPrefix=oai_dc%0A'''%0Afrom __future__ import unicode_literals%0A%0Afrom scrapi.base import OAIHarvester%0A%0A%0Aclass UowHarvester(OAIHarvester):%0A short_name... | |
1b4ca9e9afccfc1492aeea955f2cd3c783f1dc80 | Create file_parser.py | file_parser.py | file_parser.py | Python | 0 | @@ -0,0 +1,2979 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Thu Mar 19 17:03:35 2015%0A%0A@author: pedro.correia%0A%22%22%22%0A%0Afrom __future__ import division # Just making sure that correct integer division is working%0Aimport numpy as np # This is numpy,python numerical library%0Aimport xlr... | |
26d364765cdb0e4e4bf755286d92c305b8dabb0c | Add files via upload | find_qCodes.py | find_qCodes.py | Python | 0 | @@ -0,0 +1,786 @@
+__author__ = 'zoorobmj'%0D%0Aimport re%0D%0Aimport csv%0D%0Aimport os%0D%0A%0D%0A%0D%0Aif __name__ == '__main__':%0D%0A folder = %22C:%5CUsers%5Czoorobmj%5CPycharmProjects%5CQuestion_Matrix%22 # my directory%0D%0A files = %5Bf for f in os.listdir(folder) if f.endswith('.txt')%5D%0D%0A q_li... | |
5ae45bfbbd6559d344eb641853ef8e83b3ff1c90 | Add wowza blueprint | blues/wowza.py | blues/wowza.py | Python | 0 | @@ -0,0 +1,1394 @@
+%22%22%22%0AWowza Blueprint%0A===============%0A%0A**Fabric environment:**%0A%0A.. code-block:: yaml%0A%0A blueprints:%0A - blues.wowza%0A%0A%22%22%22%0Afrom fabric.decorators import task%0A%0Afrom refabric.api import run, info%0Afrom refabric.context_managers import sudo%0Afrom refabric.con... | |
0e53f398bf2cf885393865ec1f899308bb56625b | Add a low-level example for creating views. | examples/create_a_view_low_level.py | examples/create_a_view_low_level.py | Python | 0 | @@ -0,0 +1,490 @@
+%22%22%22%0AA low level example:%0AThis is how JenkinsAPI creates views%0A%22%22%22%0Aimport requests%0Aimport json%0A%0Aurl = 'http://localhost:8080/newView'%0Astr_view_name = %22ddsfddfd%22%0Aparams = %7B%7D# %7B'name': str_view_name%7D%0Aheaders = %7B'Content-Type': 'application/x-www-form-urlenco... | |
35f3cd96c6bd8c3a8772fc0f74c5e19d33d0a4ba | Revert "show how threading could work" | examples/csv_example/csv_example.py | examples/csv_example/csv_example.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This code demonstrates how to use dedupe with a comma separated values
(CSV) file. All operations are performed in memory, so will run very
quickly on datasets up to ~10,000 rows.
We start with a CSV file containing our messy data. In this example,
it is listings of early ... | Python | 0 | @@ -664,281 +664,22 @@
nan%0A
-import threading%0Aimport datetime%0A %0A%0Aimport dedupe%0A%0Aclass ThreadClass(threading.Thread):%0A deduper = None%0A%0A def run(self):%0A self.deduper.train()%0A%0A now = datetime.datetime.now()%0A print %22%25s says Hello World at time: %25s%22 %25 ... |
4c73cad398d5dac85b264187f709a860f356b311 | Add new file with mixin for mysql | smipyping/_mysqldbmixin.py | smipyping/_mysqldbmixin.py | Python | 0 | @@ -0,0 +1,2607 @@
+#!/usr/bin/env python%0A# (C) Copyright 2017 Inova Development Inc.%0A# 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://w... | |
206c99420101655d7495000d659d571ef729300b | Add areas spider | soccerway/spiders/areas.py | soccerway/spiders/areas.py | Python | 0.000002 | @@ -0,0 +1,1348 @@
+# -*- coding: utf-8 -*-%0Aimport scrapy%0Afrom soccerway.items import Match%0Afrom urllib.parse import urlencode%0A%0Aclass AreasSpider(scrapy.Spider):%0A name = %22areas%22%0A allowed_domains = %5B%22http://www.soccerway.mobi%22%5D%0A start_urls = %5B'http://www.soccerway.mobi/?'%5D%0A ... | |
e39bce6ba02ad4ed3c20768c234606afb48ac86a | Solve Largest Product | python/euler008.py | python/euler008.py | Python | 0.999999 | @@ -0,0 +1,926 @@
+#!/bin/python3%0A%0Aimport sys%0Afrom functools import reduce%0A%0Aclass LargestProduct:%0A%0A def __init__(self, num, num_consecutive_digits):%0A self.num = num%0A self.num_consecutive_digits = num_consecutive_digits%0A%0A def largest_product(self):%0A return max(map(Large... | |
dc4620b46cdca4084fe0b64e3f8e08025e511cea | fix sanitizer | intelmq/bots/experts/sanitizer/sanitizer.py | intelmq/bots/experts/sanitizer/sanitizer.py | from intelmq.lib.bot import Bot, sys
from intelmq.bots import utils
class SanitizerBot(Bot):
def process(self):
event = self.receive_message()
if event:
keys_pairs = [
(
"source_ip",
... | Python | 0.000001 | @@ -378,25 +378,71 @@
%22source_url%22
+,%0A %22source_asn%22
%0A
-
@@ -648,16 +648,67 @@
ion_url%22
+,%0A %22destination_asn%22
%0A
@@ -915,32 +915,123 @@
%0A
+ if %22asn%22 in key:%0A ... |
cd239be7ec84ccb000992841700effeb4bc6a508 | Add quickstart fabfile.py | streamparse/bootstrap/project/fabfile.py | streamparse/bootstrap/project/fabfile.py | Python | 0.000001 | @@ -0,0 +1,706 @@
+%22%22%22fab env:prod deploy:wordcount%22%22%22%0Aimport json%0A%0Afrom fabric.api import run, put, env as _env%0Afrom fabric.decorators import task%0A%0A%0A@task%0Adef env(e=None):%0A %22%22%22Activate a particular environment from the config.json file.%22%22%22%0A with open('config.json', 'r'... | |
348b10962f12e1c49ed5c4caf06a838b89b1e5af | Create plasma.py | plasma.py | plasma.py | Python | 0.000003 | @@ -0,0 +1,16 @@
+import geometry%0A
| |
bd05625c2e0a164f0b720c8c13fb06540d4fcdb9 | Create ica_demo.py (#496) | scripts/ica_demo.py | scripts/ica_demo.py | Python | 0 | @@ -0,0 +1,1715 @@
+# Blind source separation using FastICA and PCA%0A# Author : Aleyna Kara%0A# This file is based on https://github.com/probml/pmtk3/blob/master/demos/icaDemo.m%0A%0Afrom sklearn.decomposition import PCA, FastICA%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Aimport pyprobml_utils as pml%0A%... | |
a8add82f2f9092d07f9ef40420c4b303700c912d | add a 'uniq' function | lib/uniq.py | lib/uniq.py | Python | 0.999997 | @@ -0,0 +1,346 @@
+# from http://www.peterbe.com/plog/uniqifiers-benchmark%0A%0A%0Adef identity(x):%0A return x%0A%0A%0Adef uniq(seq, idfun=identity):%0A # order preserving%0A seen = %7B%7D%0A result = %5B%5D%0A for item in seq:%0A marker = idfun(item)%0A if marker in seen:%0A co... | |
c57c672aae98fb5b280f70b68ac27fc2d94a243f | Add test class to cover the RandomForestClassifier in Go | tests/estimator/classifier/RandomForestClassifier/RandomForestClassifierGoTest.py | tests/estimator/classifier/RandomForestClassifier/RandomForestClassifierGoTest.py | Python | 0 | @@ -0,0 +1,563 @@
+# -*- coding: utf-8 -*-%0A%0Afrom unittest import TestCase%0A%0Afrom sklearn.ensemble import RandomForestClassifier%0A%0Afrom tests.estimator.classifier.Classifier import Classifier%0Afrom tests.language.Go import Go%0A%0A%0Aclass RandomForestClassifierGoTest(Go, Classifier, TestCase):%0A%0A def s... | |
e045a7bd1c3d791de40412bafa62702bee59132e | Add Python solution for day 15. | day15/solution.py | day15/solution.py | Python | 0.000004 | @@ -0,0 +1,1389 @@
+%0Adata = open(%22data%22, %22r%22).read()%0A%0Aingredients = %5B%5D%0A%0Afor line in data.split(%22%5Cn%22):%0A%09name = line.split(%22: %22)%5B0%5D%0A%0A%09properties = line.split(%22: %22)%5B1%5D.split(%22, %22)%0A%0A%09props = %7B 'value': 0 %7D%0A%09for prop in properties:%0A%09%09props%5Bprop.... | |
df68e5aa8ab620f03c668ae886ed8a1beef3c697 | Add HKDF-SHA256 implementation. | hkdf-sha256.py | hkdf-sha256.py | Python | 0 | @@ -0,0 +1,1304 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0Afrom Crypto.Hash import HMAC%0Afrom Crypto.Hash import SHA256%0A%0Aimport obfsproxy.transports.base as base%0A%0Aimport math%0A%0A%0Aclass HKDF_SHA256( object ):%0A%09%22%22%22%0A%09Implements HKDF using SHA256: https://tools.ietf.org/html/rfc5869%0A%... | |
d4adf3e0e177e80ce7bc825f1cb4e461e5551b2f | Add basic configuration support to oonib | oonib/config.py | oonib/config.py | Python | 0 | @@ -0,0 +1,581 @@
+from ooni.utils import Storage%0Aimport os%0A%0A# XXX convert this to something that is a proper config file%0Amain = Storage()%0Amain.reporting_port = 8888%0Amain.http_port = 8080%0Amain.dns_udp_port = 5354%0Amain.dns_tcp_port = 8002%0Amain.daphn3_port = 9666%0Amain.server_version = %22Apache%22%0A#... | |
48e9887d92e08fb3f001957adb5e4f009699b864 | Fix key release in keyhandler | shell/view/keyhandler.py | shell/view/keyhandler.py | import dbus
import gobject
from sugar import env
from hardware import hardwaremanager
from model.ShellModel import ShellModel
from _sugar import KeyGrabber
import sugar
_actions_table = {
'F1' : 'zoom_mesh',
'F2' : 'zoom_friends',
'F3' : 'zoom_home',
'F4' : ... | Python | 0.000001 | @@ -4971,37 +4971,49 @@
self._
+shell.get_
frame
+()
.notify_key_rele
@@ -5064,21 +5064,33 @@
self._
+shell.get_
frame
+()
.notify_
|
2d76f1375ef1eb4d7ea1e8735d9ff55cfd12cea0 | introducing inline echo. print to stdout without the Fine newline | inline_echo.py | inline_echo.py | Python | 0.999926 | @@ -0,0 +1,267 @@
+#!/usr/bin/env python%0A%0Aimport sys%0Aimport os%0A%0Adef puaq(): # Print Usage And Quit%0A print(%22Usage: %25s string_content%22 %25 os.path.basename(__file__))%0A sys.exit(1)%0A%0Aif __name__ == %22__main__%22:%0A if len(sys.argv) %3C 2:%0A puaq()%0A sys.stdout.write(sys.argv%5... | |
58f05fe7736ce387bb8086128bc9de32b8cd6a59 | Add simplify.py | livesync/indico_livesync/simplify.py | livesync/indico_livesync/simplify.py | Python | 0.000725 | @@ -0,0 +1,1716 @@
+# This file is part of Indico.%0A# Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).%0A#%0A# Indico is free software; you can redistribute it and/or%0A# modify it under the terms of the GNU General Public License as%0A# published by the Free Software Foundation; either ver... | |
6a65d102bfcd667c382704ea3430d76faaa1b3d1 | Add tests | tests/test_salut.py | tests/test_salut.py | Python | 0.000001 | @@ -0,0 +1,3105 @@
+import unittest%0Afrom mock import MagicMock%0A%0Aimport socket%0Aimport gevent%0Aimport gevent.socket%0A%0Afrom otis.common.salut import Announcer, Browser%0A%0A%0Aclass TestSalut(unittest.TestCase):%0A def setUp(self):%0A pass%0A%0A def tearDown(self):%0A pass%0A%0A def test... | |
f65a6c12dd615d235a306b130ebd63358429e8c6 | Create boss.py | boss.py | boss.py | Python | 0.000002 | @@ -0,0 +1,1171 @@
+# -*- coding: utf-8 -*-%0A%0Aimport urllib%0Aimport urllib2%0Aimport re%0Afrom cookielib import CookieJar%0A%0Areg = re.compile(r'href=%22%5C.%5C/in%5B%5E%22%5C%5C%5D*(?:%5C%5C.%5B%5E%22%5C%5C%5D*)*%22')%0A%0Astager = re.compile(r'%3E.+100.')%0A%0Aanswers = %7B1: '/index.php?answer=42', 2: '/index.p... | |
df7235e13c14f13dd27ede6c098a9b5b80b4b297 | Add test_functions | neuralmonkey/tests/test_functions.py | neuralmonkey/tests/test_functions.py | Python | 0.000018 | @@ -0,0 +1,819 @@
+#!/usr/bin/env python3%0A%22%22%22Unit tests for functions.py.%22%22%22%0A# tests: mypy, lint%0A%0Aimport unittest%0Aimport tensorflow as tf%0A%0Afrom neuralmonkey.functions import piecewise_function%0A%0A%0Aclass TestPiecewiseFunction(unittest.TestCase):%0A%0A def test_piecewise_constant(self):%0... | |
b2acb7dfd7dc08afd64d80f25ab0a76469e5fff6 | add import script for North Lanarkshire | polling_stations/apps/data_collection/management/commands/import_north_lanarkshire.py | polling_stations/apps/data_collection/management/commands/import_north_lanarkshire.py | Python | 0 | @@ -0,0 +1,756 @@
+from data_collection.management.commands import BaseScotlandSpatialHubImporter%0A%0A%22%22%22%0ANote:%0AThis importer provides coverage for 173/174 districts%0Adue to incomplete/poor quality data%0A%22%22%22%0Aclass Command(BaseScotlandSpatialHubImporter):%0A council_id = 'S12000044'%0A council... | |
cc907c9b8f22bd08ed6460e5e99ebb4e8ce5a499 | add import script for Perth and Kinross | polling_stations/apps/data_collection/management/commands/import_perth_and_kinross.py | polling_stations/apps/data_collection/management/commands/import_perth_and_kinross.py | Python | 0 | @@ -0,0 +1,354 @@
+from data_collection.management.commands import BaseScotlandSpatialHubImporter%0A%0A%22%22%22%0ANote:%0AThis importer provides coverage for 104/107 districts%0Adue to incomplete/poor quality data%0A%22%22%22%0Aclass Command(BaseScotlandSpatialHubImporter):%0A council_id = 'S12000024'%0A council... | |
a9ed1a52a552d76246028d892cc6d01e5ac069cf | Move sidecar to api | api/events/monitors/sidecar.py | api/events/monitors/sidecar.py | Python | 0.000001 | @@ -0,0 +1,2487 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, division, print_function%0A%0Aimport logging%0Aimport os%0Aimport time%0A%0Afrom django.conf import settings%0A%0Afrom polyaxon_k8s.constants import PodLifeCycle%0Afrom polyaxon_k8s.manager import K8SManager%0A%0Afrom api.config_setti... | |
6b81d938ed99a943e8e81816b9a013b488d4dfd8 | Add util.py to decode wordpiece ids in Transformer | fluid/neural_machine_translation/transformer/util.py | fluid/neural_machine_translation/transformer/util.py | Python | 0.000002 | @@ -0,0 +1,2102 @@
+import sys%0Aimport re%0Aimport six%0Aimport unicodedata%0A%0A# Regular expression for unescaping token strings.%0A# '%5Cu' is converted to '_'%0A# '%5C%5C' is converted to '%5C'%0A# '%5C213;' is converted to unichr(213)%0A# Inverse of escaping.%0A_UNESCAPE_REGEX = re.compile(r%22%5C%5Cu%7C%5C%5C%5C... | |
e69da5fb3550703c466cd8ec0e084e131fb97150 | add first small and simple tests about the transcoder manager | coherence/test/test_transcoder.py | coherence/test/test_transcoder.py | Python | 0 | @@ -0,0 +1,1460 @@
+%0Afrom twisted.trial.unittest import TestCase%0A%0Afrom coherence.transcoder import TranscoderManager%0A%0Afrom coherence.transcoder import (PCMTranscoder, WAVTranscoder, MP3Transcoder,%0A MP4Transcoder, MP2TSTranscoder, ThumbTranscoder)%0A%0Aknown_transcoders = %5BPCMTranscoder, WAVTranscod... | |
9698e473615233819f886c5c51220d3a213b5545 | Add initial prototype | script.py | script.py | Python | 0.000002 | @@ -0,0 +1,786 @@
+#!/usr/bin/env python%0A%0Aimport sys%0Aimport subprocess as subp%0A%0A%0Acmd = '' if len(sys.argv) %3C= 1 else str(sys.argv%5B1%5D)%0A%0Aif cmd in %5B'prev', 'next'%5D:%0A%0A log = subp.check_output(%5B'git', 'rev-list', '--all'%5D).strip()%0A log = %5Bline.strip() for line in log.split('%5Cn'... | |
6500bc2682aeecb29c79a9ee9eff4e33439c2b49 | Add verifica_diff script | conjectura/teste/verifica_diff.py | conjectura/teste/verifica_diff.py | Python | 0.000001 | @@ -0,0 +1,462 @@
+from sh import cp, rm, diff%0Aimport sh%0Aimport os%0A%0ASURSA_VERIFICATA = 'conjectura-inturi.cpp'%0A%0Acp('../' + SURSA_VERIFICATA, '.')%0Aos.system('g++ ' + SURSA_VERIFICATA)%0A%0Afilename = 'grader_test'%0Afor i in range(1, 11):%0A print 'Testul ', i%0A cp(filename + str(i) + '.in', 'conjectura... | |
5d769d651947384e18e4e9c21a10f86762a3e950 | add more tests | test/test_api/test_api_announcement.py | test/test_api/test_api_announcement.py | Python | 0 | @@ -0,0 +1,1625 @@
+# -*- coding: utf8 -*-%0A# This file is part of PYBOSSA.%0A#%0A# Copyright (C) 2017 Scifabric LTD.%0A#%0A# PYBOSSA 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 ... | |
3a1f37ea0e46ea396c2ce407a938677e86dc6655 | Adding a test Hello World | hello_world.py | hello_world.py | Python | 0.999909 | @@ -0,0 +1,22 @@
+print %22Hello World !%22%0A
| |
a1f411be91a9db2193267de71eb52db2f334641b | add a file that prints hello lesley | hellolesley.py | hellolesley.py | Python | 0.000258 | @@ -0,0 +1,73 @@
+#This is my hello world program to say hi to Lesley%0Aprint 'Hello Lesley'%0A
| |
03b80665f6db39002e0887ddf56975f6d31cc767 | Create __init__.py | server/__init__.py | server/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
33581b5a2f9ca321819abfd7df94eb5078ab3e7c | Add domain.Box bw compatibility shim w/deprecation warning | lepton/domain.py | lepton/domain.py | #############################################################################
#
# Copyright (c) 2008 by Casey Duncan and contributors
# All Rights Reserved.
#
# This software is subject to the provisions of the MIT License
# A copy of the license should accompany this distribution.
# THE SOFTWARE IS PROVIDED "AS IS", W... | Python | 0 | @@ -1943,8 +1943,415 @@
dError%0A%0A
+%0Adef Box(*args, **kw):%0A%09%22%22%22Axis-aligned box domain (same as AABox for now)%0A%0A%09WARNING: Deprecated, use AABox instead. This domain will mean something different%0A%09in future versions of lepton%0A%09%22%22%22%0A%09import warnings%0A%09warnings.warn(%22lepton.domai... |
03fdc41437f96cb1d6ba636c3a5d8c5dc15430b1 | Create requirements.py | requirements.py | requirements.py | Python | 0 | @@ -0,0 +1 @@
+%0A
| |
ab99f855f708dec213c9eea1489643c01526e0b0 | Add unittests for bridgedb.parse.versions module. | lib/bridgedb/test/test_parse_versions.py | lib/bridgedb/test/test_parse_versions.py | Python | 0 | @@ -0,0 +1,1559 @@
+# -*- coding: utf-8 -*-%0A#_____________________________________________________________________________%0A#%0A# This file is part of BridgeDB, a Tor bridge distribution system.%0A#%0A# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 %3Cisis@torproject.org%3E%0A# please also see AUTHORS file%0... | |
caef0059d803fc885d268ccd66b9c70a0b2ab129 | Create Exercise4_VariablesAndNames.py | Exercise4_VariablesAndNames.py | Exercise4_VariablesAndNames.py | Python | 0 | @@ -0,0 +1,602 @@
+# Exercise 4 : Variables and Names%0A%0Acars = 100%0Aspace_in_a_car = 4.0%0Adrivers = 30%0Apassengers = 90%0Acars_not_driven = cars - drivers%0Acars_driven = drivers%0Acarpool_capacity = cars_driven * space_in_a_car%0Aaverage_passengers_per_cars = passengers / cars_driven%0A%0Aprint(%22There are%22, ... | |
1a4db50c848a3e7bb1323ae9e6b26c884187c575 | Add my fibonacci sequence homework. | training/level-1-the-zen-of-python/dragon-warrior/fibonacci/rwharris-nd_fibonacci.py | training/level-1-the-zen-of-python/dragon-warrior/fibonacci/rwharris-nd_fibonacci.py | Python | 0.000003 | @@ -0,0 +1,257 @@
+def even_fibonacci_sum(a:int,b:int,max:int) -%3E int:%0D%0A temp = 0%0D%0A sum = 0%0D%0A%0D%0A while (b %3C= max):%0D%0A if (b%252 == 0):%0D%0A sum += b%0D%0A temp = a + b%0D%0A a = b%0D%0A b = temp%0D%0A%0D%0A print(sum)%0D%0A%0D%0Aeven_fibonacci_su... | |
f14c483283984b793f1209255e059d7b9deb414c | Add in the db migration | migrations/versions/8081a5906af_.py | migrations/versions/8081a5906af_.py | Python | 0.000001 | @@ -0,0 +1,627 @@
+%22%22%22empty message%0A%0ARevision ID: 8081a5906af%0ARevises: 575d8824e34c%0ACreate Date: 2015-08-25 18:04:56.738898%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '8081a5906af'%0Adown_revision = '575d8824e34c'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A%0... | |
2dff474fe7723ebc7d7559fc77791924532d58db | reorder imports for pep8 | boltons/timeutils.py | boltons/timeutils.py | # -*- coding: utf-8 -*-
import datetime
from datetime import timedelta
from strutils import cardinalize
def total_seconds(td):
"""\
A pure-Python implementation of Python 2.7's timedelta.total_seconds().
Accepts a timedelta object, returns number of total seconds.
>>> td = datetime.timedelta(days=4... | Python | 0 | @@ -18,16 +18,30 @@
-8 -*-%0A%0A
+import bisect%0A
import d
@@ -558,23 +558,8 @@
i%0A%0A%0A
-import bisect%0A%0A
_BOU
|
c86835059c6fcc657290382e743922b14e7e7656 | add server | server.py | server.py | Python | 0.000001 | @@ -0,0 +1,189 @@
+from flask import Flask, request%0A%0Aapp = Flask(__name__)%0A%0A@app.route('/')%0Adef root():%0A print(request.json)%0A%0A return %22hi%22%0A%0Aif __name__ == '__main__':%0A app.run(debug=True, port=5000)%0A
| |
a4bc16a375dc30e37034993bd07d3014f3b936e1 | Fix corrupt abstract field data | migrations/versions/201610041721_8b5ab7da2d5_fix_corrupt_abstract_field_data.py | migrations/versions/201610041721_8b5ab7da2d5_fix_corrupt_abstract_field_data.py | Python | 0.000414 | @@ -0,0 +1,972 @@
+%22%22%22Fix corrupt abstract field data%0A%0ARevision ID: 8b5ab7da2d5%0ARevises: 52d970fb6a74%0ACreate Date: 2016-10-04 17:21:19.186125%0A%22%22%22%0A%0Aimport sqlalchemy as sa%0Afrom alembic import op%0A%0A%0A# revision identifiers, used by Alembic.%0Arevision = '8b5ab7da2d5'%0Adown_revision = '52d... | |
ef745ed086ebd8e77e158c89b577c77296630320 | Add solution for 118 pascals triangle | Python/118_Pascals_Triangle.py | Python/118_Pascals_Triangle.py | Python | 0.000864 | @@ -0,0 +1,584 @@
+class Solution(object):%0A def generate(self, numRows):%0A %22%22%22%0A :type numRows: int%0A :rtype: List%5BList%5Bint%5D%5D%0A %22%22%22%0A res = %5B%5B1%5D,%5B1,1%5D%5D%0A if numRows == 0:%0A %09return %5B%5D%0A elif numRows == 1:%0A ... | |
60841e5b5a5f7e89c986fa202633ccf1a0f35315 | Add main module | src/validator.py | src/validator.py | Python | 0.000001 | @@ -0,0 +1,2032 @@
+# -*- coding: utf-8 -*-%0A#%0A# This module is part of the GeoTag-X project validator tool.%0A#%0A# Author: Jeremy Othieno (j.othieno@gmail.com)%0A#%0A# Copyright (c) 2016 UNITAR/UNOSAT%0A#%0A# The MIT License (MIT)%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A#... | |
344ee4f5aafa19271a428d171f14b52d26a3f588 | Create solver.py | solver.py | solver.py | Python | 0 | @@ -0,0 +1,2331 @@
+from models import Table%0Afrom utils import sector_counter, clearscreen%0A%0A#start with blank screen%0Aclearscreen()%0A# building the blank sudoku table%0Asudoku = Table()%0A# Having the user enter the sudoku puzzle%0Asudoku.get_table()%0A%0Aprint(%22This is your sudoku puzzle:%22)%0Aprint(sudoku)... | |
8752c36c89e3b2a6b012761d1b24183391245fea | Create Node.py | service/Node.py | service/Node.py | Python | 0.000003 | @@ -0,0 +1,269 @@
+#########################################%0A# Node.py%0A# description: embedded node js%0A# categories: %5Bprogramming%5D%0A# possibly more info @: http://myrobotlab.org/service/Node%0A#########################################%0A# start the service%0Anode = Runtime.start(%22node%22,%22Node%22)%0A
| |
3874a618fa30787b48578430d8abcdc29549102d | solve problem no.1991 | 01xxx/1991/answer.py | 01xxx/1991/answer.py | Python | 0.017639 | @@ -0,0 +1,1403 @@
+from typing import Dict%0D%0A%0D%0Aclass Node:%0D%0A def __init__(self, value):%0D%0A self.value: str = value%0D%0A self.left: Node = None%0D%0A self.right: Node = None%0D%0A%0D%0A def preorder_traversal(self):%0D%0A print(self.value, end='')%0D%0A if self.le... | |
f77b45b06f88912d154a5fd5b04d69780618110b | Fix migration [WAL-616] | src/nodeconductor_openstack/openstack_tenant/migrations/0024_add_backup_size.py | src/nodeconductor_openstack/openstack_tenant/migrations/0024_add_backup_size.py | Python | 0 | @@ -0,0 +1,564 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0Afrom nodeconductor_openstack.openstack_tenant.models import Backup%0A%0A%0Adef add_backup_size_to_metadata(apps, schema_editor):%0A for backup in Backup.objects.iterator():%0A backup... | |
398a6d23266e52436e6b8efd9d7ab053f490eb45 | add a lib to support requests with retries | octopus/lib/requests_get_with_retries.py | octopus/lib/requests_get_with_retries.py | Python | 0 | @@ -0,0 +1,394 @@
+import requests%0Afrom time import sleep%0A%0Adef http_get_with_backoff_retries(url, max_retries=5, timeout=30):%0A if not url:%0A return%0A attempt = 0%0A r = None%0A%0A while attempt %3C= max_retries:%0A try:%0A r = requests.get(url, timeout=timeout)%0A ... | |
a8b524318d7f9d4406193d610b2bb3ef8e56e147 | Add frameless drag region example. | examples/frameless_drag_region.py | examples/frameless_drag_region.py | Python | 0 | @@ -0,0 +1,732 @@
+import webview%0A%0A'''%0AThis example demonstrates a user-provided %22drag region%22 to move a frameless window%0Aaround, whilst maintaining normal mouse down/move events elsewhere. This roughly%0Areplicates %60-webkit-drag-region%60.%0A'''%0A%0Ahtml = '''%0A%3Chead%3E%0A %3Cstyle type=%22text/cs... | |
6fde041c3a92f0d0a0b92da55b12c8e60ecc7196 | Create handle_file.py | handle_file.py | handle_file.py | Python | 0.000003 | @@ -0,0 +1,1018 @@
+import os,sys,subprocess%0Ag_dbg = '-dbg' in sys.argv or False%0A%0Adef handle_generic(fp,fn,fe):%0A%09print 'Unknown extension for %5B%7B%7D%5D'.format(fp)%0Adef handle_md(fp,fn,fe):%0A%09started = False; exec_cmd = %5B%5D;%0A%09with open(fp, %22r%22) as ifile:%0A%09%09lines = %5Bx.rstrip().strip()... | |
85a604a1991b5dc9a017514848645723921247a7 | add missing file | mcp/constants.py | mcp/constants.py | Python | 0.000003 | @@ -0,0 +1,80 @@
+#%0A# Copyright (c) 2007 rPath, Inc.%0A#%0A# All rights reserved%0A#%0A%0Aversion = '1.0.0'%0A
| |
8dd52b8163a98caaf2f076cfa4ac427ca330730c | Allow comments in JSON. | readconf.py | readconf.py | # Copyright(C) 2011 by John Tobey <John.Tobey@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This prog... | Python | 0 | @@ -4304,16 +4304,50 @@
and %22:%22.
+ Strip comments for good measure.
%0A ret
@@ -4389,19 +4389,111 @@
%5Ct%5Cr%5Cn,:
+#
':%0A
+ if c == '#':%0A while c not in ('', '%5Cn'):%0A c = fp.read(1)%0A
|
a857340a2d67a8055b9e3802327800dcdd652df4 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/037eb7657cb3f49c70c18f959421831e6cb9e4ad. | 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 = "d6884515d2b821161b35c1375d6ea25fe6811d62"
TFRT_SHA256 = "0771a906d327a92bdc46b02c8ac3... | Python | 0.000002 | @@ -228,133 +228,133 @@
= %22
-d6884515d2b821161b35c1375d6ea25fe6811d62%22%0A TFRT_SHA256 = %220771a906d327a92bdc46b02c8ac3ee1593542ceadc07220e53790aa8c7ea5702
+037eb7657cb3f49c70c18f959421831e6cb9e4ad%22%0A TFRT_SHA256 = %2280194df160fb8c91c7fcc84f34a60c16d69bd66f6b2f8e5404fae5e7d1221533
%22%0A%0A
|
c563f12bcb8b10daca64e19ade3c373c112cb659 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/8f7619fa042357fa754002104f575a8a72ee69ed. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "584ba7eab84bd45941fabc28fbe8fa43c74673d8"
TFRT_SHA256 = "e2f45638580ba52116f099d52b73c3edcf2ad81736a434... | Python | 0.000001 | @@ -210,133 +210,133 @@
= %22
-584ba7eab84bd45941fabc28fbe8fa43c74673d8%22%0A TFRT_SHA256 = %22e2f45638580ba52116f099d52b73c3edcf2ad81736a434fb639def38ae4cb225
+8f7619fa042357fa754002104f575a8a72ee69ed%22%0A TFRT_SHA256 = %222cb8410fb4655d71c099fb9f2d3721d0e485c8db518553347ce21ca09e0e1b43
%22%0A%0A
|
29e3d6b706a33780b1cb4863200ec7525ff035ce | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/cdf6d36e9a5c07770160ebac25b153481c37a247. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "6ca8a6dff0e5d4f3a17b0c0879aa5de622683680"
TFRT_SHA256 = "09779efe84cc84e859e206dd49ae6b993577d7dae41f90... | Python | 0.000002 | @@ -210,133 +210,133 @@
= %22
-6ca8a6dff0e5d4f3a17b0c0879aa5de622683680%22%0A TFRT_SHA256 = %2209779efe84cc84e859e206dd49ae6b993577d7dae41f90491e5b862d7a70ba51
+cdf6d36e9a5c07770160ebac25b153481c37a247%22%0A TFRT_SHA256 = %22c197f9b3584cae2d65fc765f999298ae8b70d9424ec0d4dd30dbdad506fb98bb
%22%0A%0A
|
6276cf142d233db377dc490a47c5ad56d2906c75 | Add version module | cards/version.py | cards/version.py | Python | 0 | @@ -0,0 +1,38 @@
+# coding=utf-8%0A%0A__version__ = '0.4.9'%0A
| |
6c7df140c6dccb4b56500ba25f6b66ab7ea3b605 | solve 1 problem | solutions/reverse-bits.py | solutions/reverse-bits.py | Python | 0.000027 | @@ -0,0 +1,616 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%0A%22%22%22%0Areverse-bits.py%0A %0ACreated by Shuailong on 2016-03-02.%0A%0Ahttps://leetcode.com/problems/reverse-bits/.%0A%0A%22%22%22%0A%0Aclass Solution(object):%0A def reverseBits(self, n):%0A %22%22%22%0A :type n: int%0A :rtyp... | |
793b273c3fdcef428ffb6aec5dbcbb768989f175 | Add 0004 file | Drake-Z/0004/0004.py | Drake-Z/0004/0004.py | Python | 0.000001 | @@ -0,0 +1,327 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A'%E7%AC%AC 0004 %E9%A2%98%EF%BC%9A%E4%BB%BB%E4%B8%80%E4%B8%AA%E8%8B%B1%E6%96%87%E7%9A%84%E7%BA%AF%E6%96%87%E6%9C%AC%E6%96%87%E4%BB%B6%EF%BC%8C%E7%BB%9F%E8%AE%A1%E5%85%B6%E4%B8%AD%E7%9A%84%E5%8D%95%E8%AF%8D%E5%87%BA%E7%8E%B0%E7%9A%84%E4%B8%AA%E6%95... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.