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 |
|---|---|---|---|---|---|---|---|
22e8cc6200cafd5cec386c35142cd742d4a2a735 | add problem 34 | problem_034.py | problem_034.py | Python | 0.00477 | @@ -0,0 +1,595 @@
+#!/usr/bin/env python%0A#-*-coding:utf-8-*-%0A%0A'''%0A145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.%0A%0AFind the sum of all numbers which are equal to%0Athe sum of the factorial of their digits.%0A%0ANote: as 1! = 1 and 2! = 2 are not sums they are not included.%0A'''%0A%0Aimport m... | |
f64068b7b6e50f9280b51831715df8cb4c586daa | Update merge person tool | project/apps/api/management/commands/merge_persons.py | project/apps/api/management/commands/merge_persons.py | Python | 0.000001 | @@ -0,0 +1,2331 @@
+from optparse import make_option%0A%0Afrom django.core.management.base import (%0A BaseCommand,%0A CommandError,%0A)%0A%0Afrom apps.api.models import (%0A Person,%0A Singer,%0A Director,%0A Arranger,%0A)%0A%0A%0Aclass Command(BaseCommand):%0A help = %22Merge selected singers by ... | |
12bca37026ef4db41bd452dcb8cdc9022cdcf8c9 | Create pythonhelloworld.py | pythonhelloworld.py | pythonhelloworld.py | Python | 0.999993 | @@ -0,0 +1,19 @@
+print %22hello word%22%0A
| |
8e4240cd9bc2c06264ef23fddfc93ccf76e5ff9b | Create progressbar.py | progressbar.py | progressbar.py | Python | 0.000001 | @@ -0,0 +1,3968 @@
+################################################################################%0A# Example usage:%0A# $ python%0A# %3E%3E%3E import Progress%0A# %3E%3E%3E total = 100%0A# %3E%3E%3E message = 'Doing this task '%0A# %3E%3E%3E with Progress.Bar(total, message) as bar:%0A# ... for n in range(total... | |
465c2c92da5db91bcc1f9149fbfa5722d30e10f9 | add some tests for the Basic Auth filter | test/test_basic_auth.py | test/test_basic_auth.py | Python | 0 | @@ -0,0 +1,1182 @@
+import unittest%0A%0Afrom libsaas import http%0Afrom libsaas.filters import auth%0A%0A%0Aclass BasicAuthTestCase(unittest.TestCase):%0A%0A def test_simple(self):%0A auth_filter = auth.BasicAuth('user', 'pass')%0A req = http.Request('GET', 'http://example.net/')%0A auth_filter... | |
f6ea68d6a900eb33c2004aa65805b157b99c9ff8 | Remove beta. from hostname. | fabfile.py | fabfile.py | from fabric.api import *
from fabric.contrib.files import *
from fabric.colors import red
def deploy(branch='master'):
"Deploy the specified branch to the remote host."
root_dir = '/home/www-data'
code_dir = '%s/django_app' % root_dir
virtualenv_name = 'django_venv'
virtualenv_dir = '%s/%s' % (ro... | Python | 0.000007 | @@ -354,12 +354,11 @@
= '
-beta
+www
.cen
|
4cac86aeb2d24a916fc5ae9ca98e3898f4729e1c | add protocol.py module | plumbca/protocol.py | plumbca/protocol.py | Python | 0.000001 | @@ -0,0 +1,1060 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0A plumbca.protocol%0A ~~~~~~~~~~~~~~~~%0A%0A Implements the protocol support for Plumbca.%0A%0A :copyright: (c) 2015 by Jason Lai.%0A :license: BSD, see LICENSE for more details.%0A%22%22%22%0A%0Aimport logging%0Aimport asyncio%0A%0Afrom .message i... | |
545af0493cf08cb15d262f3a5333df6d1fce6848 | Add util convenience functions for accessing data without decorators | brake/utils.py | brake/utils.py | Python | 0 | @@ -0,0 +1,555 @@
+from decorators import _backend%0A%0A%22%22%22Access limits and increment counts without using a decorator.%22%22%22%0A%0Adef get_limits(request, label, field, periods):%0A limits = %5B%5D%0A count = 10%0A for period in periods:%0A limits.extend(_backend.limit(%0A label,%0A... | |
e0c3a46d1c3c13b5c956bf3cc6f30ad495f87ccd | put the logger config in a separate file for cleanliness | voglogger.py | voglogger.py | Python | 0 | @@ -0,0 +1,603 @@
+#!/usr/bin/python%0A%0A%22%22%22%0A%0A%09logger management for VOGLbot%0A%0A%09writes out to both the console and a file 'voglbot.log'%0A%0A%22%22%22%0A%0Aimport sys%0Aimport logging%0Aimport time%0A%0Alogging.basicConfig(%0A%09filename = 'voglbot.log',%0A%09filemode = 'w',%0A%09level=logging.DEBUG,%... | |
a984120bdb6c67a3dc2ca89ce9ae5498230015ea | Add initial runner | hug/run.py | hug/run.py | Python | 0.000003 | @@ -0,0 +1,729 @@
+%22%22%22hug/run.py%0A%0AContains logic to enable execution of hug APIS from the command line%0A%22%22%22%0Afrom wsgiref.simple_server import make_server%0A%0Aimport falcon%0Aimport sys%0Aimport importlib%0A%0A%0Adef server(module):%0A api = falcon.API()%0A for url, method_handlers in module.HU... | |
1578e1a129d91605148cf48f8793ac098ad0de7e | add command group | ibu/cli.py | ibu/cli.py | Python | 0.000004 | @@ -0,0 +1,258 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import print_function%0A%0Aimport click%0A%0A%0ACONTEXT_SETTINGS = dict(help_option_names=%5B'-h', '--help'%5D)%0A%0A%0A@click.group()%0Adef ibu():%0A pass%0A%0A%0A@click.command(context_settings=CONTEXT_SETTINGS)%0Adef test():%0A print(%22hello%22)%0A
| |
33dc091a43d3868324631fdb420721ab35d1f6ce | Create dis_q.py | dis_q.py | dis_q.py | Python | 0.000139 | @@ -0,0 +1,2226 @@
+#!/usr/bin/python%0A%0Aimport pymqi%0A%0Aqueue_manager = %22MQSD.TEST%22%0Achannel = %22SYSTEM.DEF.SVRCONN%22%0Ahost = %2210.21.218.15%22%0Aport = %2214123%22%0Aconn_info = %22%25s(%25s)%22 %25 (host, port)%0A%0Aprefix = %22*%22%0Aqueue_type = pymqi.CMQC.MQQT_ALL%0A# queue_type = pymqi.CMQC.MQQT_LOC... | |
b7541c063b6fc10fdd622cbd680ea4418c679f6b | Add NodeList iterator | d1_libclient_python/src/d1_client/iter/node.py | d1_libclient_python/src/d1_client/iter/node.py | Python | 0.000001 | @@ -0,0 +1,1937 @@
+# -*- coding: utf-8 -*-%0A%0A# This work was created by participants in the DataONE project, and is%0A# jointly copyrighted by participating institutions in DataONE. For%0A# more information on DataONE, see our web site at http://dataone.org.%0A#%0A# Copyright 2009-2016 DataONE%0A#%0A# Licensed un... | |
2c900f8bddc9efb40d900bf28f8c6b3188add71e | Disable trix parser tests with Jython | test/test_trix_parse.py | test/test_trix_parse.py | #!/usr/bin/env python
from rdflib.graph import ConjunctiveGraph
import unittest
class TestTrixParse(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testAperture(self):
g=ConjunctiveGraph()
g.parse("test/trix/aperture.trix",format="trix")
... | Python | 0 | @@ -711,17 +711,367 @@
%0A
-%0A
+ def testNG4j(self): %0A%0A g=ConjunctiveGraph()%0A %0A g.parse(%22test/trix/ng4jtest.trix%22,format=%22trix%22)%0A %0A #print %22Parsed %25d triples%22%25len(g)%0A%0Aimport platform%0Aif platform.system() == 'Java':%0A from nose import S... |
0cb6474b8c02f2cb7af54f8321f82a53175e8345 | check for globals in the lib that are not prefixed with toku. addresses #74 | src/tokuglobals.py | src/tokuglobals.py | Python | 0.00001 | @@ -0,0 +1,1252 @@
+#!/usr/bin/python%0A%0Aimport sys%0Aimport os%0Aimport re%0A%0Adef checkglobals(libname, exceptsymbols, verbose):%0A badglobals = 0%0A nmcmd = %22nm -g %22 + libname%0A f = os.popen(nmcmd)%0A b = f.readline()%0A while b != %22%22:%0A match = re.match(%22%5E(%5B0-9a-f%5D+)%5Cs(.... | |
24b8437003269ebd10c46d0fbdaa3e432d7535d6 | Add VCF -> non-reference likelihood table script. | genotype-likelihoods.py | genotype-likelihoods.py | Python | 0 | @@ -0,0 +1,1052 @@
+from __future__ import print_function%0Aimport sys%0Aimport cyvcf%0Afrom argparse import ArgumentParser, FileType%0Aimport toolz as tz%0A%0Adescription = (%22Create a table of probability of a non reference call for each %22%0A %22genotype for each sample. This is PL%5B0%5D. -1 is outp... | |
6a9ddbf5d775df14c994c9af9e89195ca05a58f9 | Add pyjokes CLI test | tests/test_cli_error.py | tests/test_cli_error.py | Python | 0 | @@ -0,0 +1,451 @@
+%0A%0Aimport pytest%0Aimport subprocess%0Afrom subprocess import Popen, PIPE%0A%0Adef test_pyjokes_call_exception():%0A pytest.raises(subprocess.CalledProcessError, %22subprocess.check_call('pyjokes')%22)%0A%0A%0Adef test_pyjokes_call_output():%0A try:%0A p = subprocess.Popen('pyjokes'... | |
83a4c9bfa64543ecda65ed4c916fad8ad0a9233d | Create markov.py | markov.py | markov.py | Python | 0.000001 | @@ -0,0 +1,1437 @@
+# -*- coding: utf-8 -*-%0Aimport random%0A%0Angram = lambda text, n: %5Btext%5Bi:i+n%5D for i in xrange(len(text) - n + 1)%5D%0A%0Aflatten2D = lambda data: %5Bflattened for inner in data for flattened in inner%5D%0A%0Arandelement = lambda x: x%5Brandom.randint(0, len(x) - 1)%5D%0A%0Aclass Markov:%0A... | |
0970115f9bc1bab019c23ab46e64b26d5e754313 | Implement function for displaying tuning guidance on a DIY 8-segment LEDs display | led_display.py | led_display.py | Python | 0 | @@ -0,0 +1,968 @@
+import math%0Afrom gpiozero import LED%0Afrom time import sleep%0A%0A%0Ag0 = LED(12)%0Af0 = LED(16)%0Aa0 = LED(20)%0Ab0 = LED(21)%0Ae0 = LED(17)%0Ad0 = LED(27)%0Ac0 = LED(22)%0A%0Ag1 = LED(25)%0Af1 = LED(24)%0Aa1 = LED(23)%0Ab1 = LED(18)%0Ae1 = LED(5)%0Ad1 = LED(6)%0Ac1 = LED(13)%0A%0APITCHES = %7B%0... | |
550d8bcd49e5ec591286f3f42de7dd54ef853bb8 | Add a utility script to print duplicates | find_dupes.py | find_dupes.py | Python | 0.000003 | @@ -0,0 +1,719 @@
+#!/usr/bin/env python3%0A%0Aimport json%0Aimport os%0Aimport random%0A%0Ascriptpath = os.path.dirname(__file__)%0Adata_dir = os.path.join(scriptpath, 'data')%0Aall_json = %5Bf for f in os.listdir(data_dir) if os.path.isfile(os.path.join(data_dir, f))%5D%0Aquotes = %5B%5D%0Afor f in all_json:%0A%09fil... | |
a02b2866a3bf6067a2ee7f6d194c52c0a4d4500e | Create welcome_email_daemon.py | welcome_email_daemon.py | welcome_email_daemon.py | Python | 0.000122 | @@ -0,0 +1,1839 @@
+#send new members a welcome email%0Afrom smtplib import SMTP as smtp%0Afrom time import sleep%0A%0A%0Adef welcome_bot():%0A fp = open('busters','r')%0A np = open('welcomed','a')%0A for eachline in fp:%0A if not is_in(eachline.strip()):%0A send_welcome(eachline.strip())%0A np.write(e... | |
a892a389cfc94ebf72579ed6888c02463cdf7e6d | add moviepy - text_erscheinen_lassen_rechts2links.py | moviepy/text_erscheinen_lassen_rechts2links.py | moviepy/text_erscheinen_lassen_rechts2links.py | Python | 0.000006 | @@ -0,0 +1,1871 @@
+#!/usr/bin/env python%0A%0A# Video mit Text erzeugen, Text von rechts nach links erscheinen lassen%0A%0A# Einstellungen%0Atext = 'Text' # Text%0Atextgroesse = 150 # Textgroesse in Pixel%0Atextfarbe_r = 0 # Textfarbe R%0Atextfarbe_g = 0 # Textfarbe G%0A... | |
5db0ef459f4b0f0d3903578ae89bef7d0de7bf98 | add terminal test file | termtest.py | termtest.py | Python | 0.000001 | @@ -0,0 +1,391 @@
+#!/usr/bin/python3%0A%0Aimport termbox%0A%0At = termbox.Termbox()%0A%0At.clear()%0A%0Awidth = t.width()%0Aheight = t.height()%0Acell_count = width * height%0Achar = ord('a')%0Afor c in range(1):%0A for i in range(26):%0A for y in range(height):%0A for x in range(width):%0A ... | |
3d8667d2bfd75fe076b15b171e5c942a2a358508 | add basic is_unitary tests | test_gate.py | test_gate.py | Python | 0.000017 | @@ -0,0 +1,394 @@
+import numpy as np%0Aimport unittest%0Aimport gate%0A%0Aclass TestGate(unittest.TestCase):%0A%09def test_is_unitary(self):%0A%09%09qg = gate.QuantumGate(np.matrix('0 1; 1 0', np.complex_))%0A%09%09self.assertTrue(qg.is_unitary())%0A%0A%09def test_is_not_unitary(self):%0A%09%09matrix = np.matrix('1 1;... | |
bf0a4ee5023cddd4072330e9a3e5a530aeea956e | test unit added | test_unit.py | test_unit.py | Python | 0 | @@ -0,0 +1,163 @@
+class test_output:%0A def run(self, queue):%0A while True:%0A item = queue.get()%0A print(item)%0A%0A%0Adef mod_init():%0A return test_output()%0A
| |
6764d0286f2386bef8ab5f627d061f45047956e9 | add logger | logger.py | logger.py | Python | 0.000026 | @@ -0,0 +1,1011 @@
+#!/usr/bin/env python%0A%0Aimport logging%0Aimport os%0Afrom termcolor import colored%0A %0A %0Aclass ColorLog(object):%0A %0A colormap = dict(%0A debug=dict(color='grey', attrs=%5B'bold'%5D),%0A info=dict(color='green'),%0A warn=dict(color='yellow', attrs=%5B'bold'%5D),%0A ... | |
9cd3e1183b78f561751a638cf4e863703ec080d6 | add load ini file config | load_config.py | load_config.py | Python | 0.000001 | @@ -0,0 +1,735 @@
+#!/usr/bin/env python%0A%22%22%22%0Aconf file example%0A%0A%5Belk-server%5D%0Aip = elk.server.ip%0Akibana = check_http%0Aelasticsearch = check_http!-p 9200%0Alogstash-3333 = check_tcp!3333%0Alogstash-3334 = check_tcp!3334%0Aload = check_nrpe!check_load%0A%22%22%22%0A%0Aimport os, sys%0Atry:%0A fro... | |
e559a0458d1e4b0ec578eb9bcfdcc992d439a35d | Add test cases for the backwards compatibility in #24 | tests/test_backwards.py | tests/test_backwards.py | Python | 0 | @@ -0,0 +1,1771 @@
+%22%22%22 Test backwards-compatible behavior %22%22%22%0Aimport json%0A%0Afrom flywheel import Field, Model%0Afrom flywheel.fields.types import TypeDefinition, DictType, STRING%0Afrom flywheel.tests import DynamoSystemTest%0A%0A%0Aclass JsonType(TypeDefinition):%0A%0A %22%22%22 Simple type that s... | |
501c38ac9e8b9fbb35b64321e103a0dfe064e718 | Add a sequence module for optimizing gating | QGL/BasicSequences/BlankingSweeps.py | QGL/BasicSequences/BlankingSweeps.py | Python | 0 | @@ -0,0 +1,1016 @@
+%22%22%22%0ASequences for optimizing gating timing.%0A%22%22%22%0Afrom ..PulsePrimitives import *%0Afrom ..Compiler import compile_to_hardware%0A%0Adef sweep_gateDelay(qubit, sweepPts):%0A %22%22%22%0A Sweep the gate delay associated with a qubit channel using a simple Id, Id, X90, X90%0A s... | |
213d1e65ebd6d2f9249d26c7ac3690d6bc6cde24 | fix encoding | manage.py | manage.py | Python | 0.274682 | @@ -0,0 +1,258 @@
+#!/usr/bin/env python%0Aimport os%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22geode_geocoding.settings%22)%0A%0A from django.core.management import execute_from_command_line%0A%0A execute_from_command_line(sys.argv)%0A
| |
6e6c1428d61137b2a86f26e72aa97c510debd9eb | Update visualize.py | script/visualize.py | script/visualize.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import BoundaryNorm
from matplotlib.ticker import MaxNLocator
#plt.style.use('ggplot')
import numpy as np
from decimal import Decimal
from timeit import default_timer as timer
import a... | Python | 0 | @@ -10,16 +10,17 @@
n/python
+3
%0A# -*- c
@@ -36,16 +36,34 @@
-8 -*-%0A%0A
+import __future__%0A
import s
@@ -2531,40 +2531,8 @@
em.%0A
-########## rho ################%0A
fig
@@ -2562,16 +2562,49 @@
=(9, 6))
+%0A%0A########## rho ################
%0Aax0 = f
@@ -2989,17 +2989,16 @@
exact%22)%0A
-%0A
ax1.set... |
6107d7fe1db571367a20143fa38fc6bec3056d36 | Fix port for activity script | scripts/activity.py | scripts/activity.py | #!/usr/bin/env python
import argparse
import collections
import itertools
import os
import random
import sys
import time
from contextlib import contextmanager
import logbook
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))
from flask_app import app
from flask_app.smtp import smtpd_co... | Python | 0 | @@ -521,17 +521,17 @@
fault=80
-8
+0
0)%0A%0A%0Acla
|
6c94617d8ea2b66bba6c33fdc9aa81c5161a53f8 | add yaml | marcov.py | marcov.py | Python | 0.000067 | @@ -0,0 +1,2004 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A#twitterBot.py%0Aimport sys%0Areload(sys)%0Asys.setdefaultencoding('utf-8')%0A#use python-twitter%0Aimport twitter%0Aimport MeCab%0Aimport random%0Aimport re%0Aimport yaml%0A%0A_var = open(%22../API.yaml%22).read()%0A_yaml = yaml.load(_var)%0Aapi = t... | |
9dcc635d0d5239928415ecab7a5ddb5387f98dea | add mail.py | globe/mail.py | globe/mail.py | Python | 0.000002 | @@ -0,0 +1,264 @@
+from flask_mail import Message%0Afrom globe import app, mail%0A%0Adef send_email(subject, sender, recipients, text_body, html_body):%0A msg = Message(subject, sender=sender%5B0%5D, recipients=recipients)%0A msg.body = text_body%0A msg.html = html_body%0A mail.send(msg)%0A
| |
56ad587d21abe5251be5ce5fced8e42f1d89c2f4 | Create tutorial1.py | tutorial1.py | tutorial1.py | Python | 0 | @@ -0,0 +1,48 @@
+from ggame import App%0Amyapp = App()%0Amyapp.run()%0A
| |
ef8ad297634d2153d5a1675d7bb60b963f8c6abd | Add wrapper | cfn_wrapper.py | cfn_wrapper.py | Python | 0.000004 | @@ -0,0 +1,2982 @@
+# MIT Licensed, Copyright (c) 2015 Ryan Scott Brown %3Csb@ryansb.com%3E%0A%0Aimport json%0Aimport logging%0Aimport urllib2%0A%0Alogger = logging.getLogger()%0Alogger.setLevel(logging.INFO)%0A%0A%22%22%22%0AEvent example%0A%7B%0A %22Status%22: SUCCESS %7C FAILED,%0A %22Reason: mandatory on fail... | |
e62a705d464df21098123ada89d38c3e3fe8ca73 | Define a channel interface | zerorpc/channel_base.py | zerorpc/channel_base.py | Python | 0.015718 | @@ -0,0 +1,1967 @@
+# -*- coding: utf-8 -*-%0A# Open Source Initiative OSI - The MIT License (MIT):Licensing%0A#%0A# The MIT License (MIT)%0A# Copyright (c) 2014 Fran%C3%A7ois-Xavier Bourlet (bombela@gmail.com)%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a copy of%0A# this software and... | |
c19120e0123b76236d11f3523e2ebd64c00b9feb | Check import | homeassistant/components/thermostat/radiotherm.py | homeassistant/components/thermostat/radiotherm.py | """
homeassistant.components.thermostat.radiotherm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds support for Radio Thermostat wifi-enabled home thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/thermostat.radiotherm.html
"""
import loggin... | Python | 0 | @@ -785,24 +785,37 @@
mostat. %22%22%22%0A
+ try:%0A
import r
@@ -823,16 +823,199 @@
diotherm
+%0A except ImportError:%0A _LOGGER.exception(%0A %22Unable to import radiotherm. %22%0A %22Did you maybe not install the 'radiotherm' package?%22)%0A return False
%0A%0A ... |
10f7e5c8c1a2cdc84f706ccad041755b83c4953b | Create htmlsearch.py | htmlsearch.py | htmlsearch.py | Python | 0.00002 | @@ -0,0 +1,317 @@
+import glob%0Aprint glob.glob(%22*.html%22)%0Aarr = glob.glob(%22*.html%22)%0Ai=0%0Ak=%5B%5D%0Aray =%5B%5D%0Awhile i %3C len(arr):%0A file = open(arr%5Bi%5D, %22r%22)%0A #print file.read()%0A k.append(file.read())%0A i = i+1%0Aprint k%0A'''%0AOutputs:%0Aprint print glob.glob(%22*.html%22)... | |
46eb1c2d10316eae4d85b3d689307e32ed763d07 | add 6-17.py | chapter6/6-17.py | chapter6/6-17.py | Python | 0.998825 | @@ -0,0 +1,620 @@
+#!/usr/bin/env python%0A%0Adef myPop(myList):%0A if len(myList) == 0:%0A print %22no more element to pop%22%0A exit(1)%0A else:%0A result = myList%5Blen(myList)-1%5D%0A myList.remove(result)%0A return result%0A%0Adef myPush(myList,element):%0A myList.a... | |
a3fc49840ca098cea4e874353272f69baf6e229f | fix bugs | tornadocnauth/Douban.py | tornadocnauth/Douban.py | # -*- coding: utf-8 -*-
from tornado import gen
from tornado import httpclient
from tornado import escape
from tornado.httputil import url_concat
from tornado.concurrent import Future
from tornado.auth import OAuth2Mixin, _auth_return_future, AuthError
try:
import urlparse
except ImportError:
import urllib.pa... | Python | 0.000001 | @@ -3283,16 +3283,17 @@
xpires'%5D
+%7D
)%0A%0A
|
19d4d2b8322ee34d07f711c4f2928c76f3366243 | Fix for Pagination | flaskext/mongoengine/__init__.py | flaskext/mongoengine/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import math
import mongoengine
from mongoengine.queryset import MultipleObjectsReturned, DoesNotExist
from mongoengine.queryset import QuerySet as BaseQuerySet
from mongoengine import ValidationError
from flask import abort
def _include_mongoengine(ob... | Python | 0.000001 | @@ -1912,24 +1912,57 @@
page = page%0A
+ self.per_page = per_page%0A
self
|
7faff0ae9ea4b8d72b42d1af992bb4c72cc745ff | test program to immediately connect and disconnect | test/client_immediate_disconnect.py | test/client_immediate_disconnect.py | Python | 0 | @@ -0,0 +1,223 @@
+#!/usr/bin/env python%0A%0Aimport socket%0A%0A%0Ahost = socket.gethostname() # Get local machine name%0Aport = 55555 # Reserve a port for your service.%0A%0A%0A%0As = socket.socket()%0As.connect((host, port))%0As.send(%22x%22)%0As.close%0A%0A
| |
5b6667de8b91232facec27bc11305513bb2ec3b3 | add demo tests for parameterization | test_parameters.py | test_parameters.py | Python | 0 | @@ -0,0 +1,1477 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Aimport pytest%0Aimport time%0A%0Afrom selenium import webdriver%0A%0A%0Abrowser = webdriver.Firefox()%0Aemail_addresses = %5B%22invalid_email%22, %22another_invalid_email@%22, %22not_another_invalid_email@blah%22%5D%0Apasswords = %5B%22weak_password%... | |
30708957d3a75bd84aa5d26e309d6bae4121c10b | Add --clear-backlog option | flexget/plugins/input/backlog.py | flexget/plugins/input/backlog.py | from __future__ import unicode_literals, division, absolute_import
import logging
import pickle
from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime, PickleType, Index
from flexget import db_schema
from flexget.entry import Entry
from flexget.manager import Session
from flexget.plugi... | Python | 0.000007 | @@ -259,16 +259,48 @@
t Entry%0A
+from flexget.event import event%0A
from fle
@@ -370,16 +370,40 @@
_plugin,
+ register_parser_option,
priorit
@@ -562,16 +562,25 @@
imedelta
+, console
%0A%0Alog =
@@ -5669,70 +5669,479 @@
es%0A%0A
-register_plugin(InputBacklog, 'backlog', builtin=True, api_ver=2
+%0A@event('ma... |
4aecc9be1e2e8074a20606e65db3f9e6283eb8d3 | add utils | uhura/exchange/utils.py | uhura/exchange/utils.py | Python | 0.000004 | @@ -0,0 +1,183 @@
+%22%22%22%0AUtilities and helper functions%0A%22%22%22%0A%0Adef get_object_or_none(model, **kwargs):%0A try:%0A return model.objects.get(**kwargs)%0A except model.DoesNotExist:%0A return None
| |
071aa9f5465847fdda517d1a78c37f1dbfe69f9f | test mock | tests/mock_bank.py | tests/mock_bank.py | Python | 0.000002 | @@ -0,0 +1,203 @@
+#!/usr/bin/python%0A# -*- encoding: utf-8 -*-%0A%0Aimport sys%0Aimport os.path%0Asys.path.append(os.path.join(os.path.dirname(__file__),'..'))%0Afrom src.bank import Bank%0Afrom mock import MagicMock%0A%0A%0Athing = Bank()%0A
| |
f3182c9651509d2e1009040601c23a78ed3e9b7c | Create laynger.py | laynger.py | laynger.py | Python | 0.000001 | @@ -0,0 +1,488 @@
+#import sublime%0Aimport sublime_plugin%0A%0A%0Aclass laynger(sublime_plugin.TextCommand):%0A def run(self, edit, opt='center'):%0A window = self.view.window()%0A%0A layout = window.get_layout()%0A%0A if len(layout%5B'cols'%5D) %3E 3:%0A return%0A%0A if opt =... | |
7a64fb0c3093fd23eeed84799c1590a72f59a96c | Create boafiSettings.py | webGUI/boafiSettings.py | webGUI/boafiSettings.py | Python | 0.000001 | @@ -0,0 +1,1774 @@
+#!/usr/bin/python%0A%0Aimport os,time,argparse%0A%0A%0A%0Aparser = argparse.ArgumentParser()%0A%0A%0Aparser.add_argument('-intf', action='store', dest='intf',default=%22none%22,%0A help='Select interface')%0A%0Aparser.add_argument('-ip', action='store', dest='ip',default=%22none%2... | |
fdd2a50445d2f2cb92480f8f42c463b312411361 | Add a simple command to print all areas in all generations | mapit/management/commands/mapit_print_areas.py | mapit/management/commands/mapit_print_areas.py | Python | 0.000003 | @@ -0,0 +1,763 @@
+# For each generation, show every area, grouped by type%0A%0Afrom django.core.management.base import NoArgsCommand%0Afrom mapit.models import Area, Generation, Type, NameType, Country, CodeType%0A%0Aclass Command(NoArgsCommand):%0A help = 'Show all areas by generation and area type'%0A def hand... | |
9dee7d8d253847758d3252401c01215f972a22b1 | Add synthtool scripts (#3765) | google-cloud-monitoring/synth.py | google-cloud-monitoring/synth.py | Python | 0.000001 | @@ -0,0 +1,1234 @@
+# Copyright 2018 Google LLC%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 a... | |
92ccb08f72828ba6454bbc3ff162ec73534ceea2 | Interview question: find exact sum of two numbers | python/interviewquestions/find_exact_sum.py | python/interviewquestions/find_exact_sum.py | Python | 0.99999 | @@ -0,0 +1,2497 @@
+%22%22%22%0AYou've built an in-flight entertainment system with on-demand movie streaming.%0AUsers on longer flights like to start a second movie right when their first one%0Aends, but they complain that the plane usually lands before they can see the%0Aending. So you're building a feature for choos... | |
92f799d0584b598f368df44201446531dffd7d13 | Copy paste artist from filename1 to filename2 | python/utilities/transform_mp3_filenames.py | python/utilities/transform_mp3_filenames.py | Python | 0 | @@ -0,0 +1,1581 @@
+# Extract the artist name from songs with filenames in this format:%0D%0A# (number) - (artist) - (title).mp3%0D%0A# and add the artists name to songs with filenames in this format:%0D%0A# (number)..(title).mp3%0D%0A# to make filenames in this format:%0D%0A# (number)..(artist)..(title).mp3%0... | |
ec0ee6ffc7b72ba50846bac60ec63e1188bf0481 | test parser | parser.py | parser.py | Python | 0.000028 | @@ -0,0 +1,870 @@
+#!/usr/bin/python3%0Aimport requests%0Aimport sys%0Afrom bs4 import BeautifulSoup%0A%0A#filters through text from soup and strips text of whitespace%0Adef filterText(text):%0A if text.parent.name in %5B'style', 'script', '%5Bdocument%5D', 'head', 'title'%5D:%0A return False%0A if text in... | |
58e0ea4b555cf89ace4f5d97c579dbba905e7eeb | Add script to list objects | jsk_arc2017_common/scripts/list_objects.py | jsk_arc2017_common/scripts/list_objects.py | Python | 0.000001 | @@ -0,0 +1,376 @@
+#!/usr/bin/env python%0A%0Aimport os.path as osp%0A%0Aimport rospkg%0A%0A%0APKG_PATH = rospkg.RosPack().get_path('jsk_arc2017_common')%0A%0Aobject_names = %5B'__background__'%5D%0Awith open(osp.join(PKG_PATH, 'data/names/objects.txt')) as f:%0A object_names += %5Bx.strip() for x in f%5D%0Aobject_n... | |
04feafc2b3a13b394d5b510e9bc48e542d4880c5 | Create pfkill.py | pfkill.py | pfkill.py | Python | 0.000001 | @@ -0,0 +1,609 @@
+%22%22%22%0Ahow to it use:%0A$ python pfkill %3Cport number%3E%0A%0Awhat doing:%0A1. read %3Cport number%3E.pid file%0A2. send signal to running app%0A3. delete %3Cport number%3E.rule%0A4. delete %3Cport number%3E.pid%0A%22%22%22%0A%0Aimport os%0Aimport sys%0Aimport signal%0A# import logging%0A%0Apor... | |
e988a10ea18b644b9bc319286d75cb2a15079c59 | add case owners endpoint | corehq/apps/reports/v2/endpoints/case_owner.py | corehq/apps/reports/v2/endpoints/case_owner.py | Python | 0 | @@ -0,0 +1,824 @@
+from __future__ import absolute_import%0Afrom __future__ import unicode_literals%0A%0Afrom corehq.apps.reports.filters.controllers import (%0A CaseListFilterOptionsController,%0A)%0Afrom corehq.apps.reports.v2.models import BaseOptionsEndpoint%0A%0A%0Aclass CaseOwnerEndpoint(BaseOptionsEndpoint):%... | |
458091fe923038fe8537bf3b9efbff6157a7e57a | add tests for riakcached.clients.ThreadedRiakClient | riakcached/tests/test_threadedriakclient.py | riakcached/tests/test_threadedriakclient.py | Python | 0 | @@ -0,0 +1,2503 @@
+import mock%0Aimport unittest2%0A%0Afrom riakcached.clients import ThreadedRiakClient%0Aimport riakcached.pools%0A%0A%0Aclass TestThreadedRiakClient(unittest2.TestCase):%0A def test_get_many(self):%0A pool = mock.Mock(spec=riakcached.pools.Pool)%0A pool.request.return_value = 200, %... | |
a91a942c45921b64fe0d740d81604dba921c214e | Create folder for QC and CNV cutoff codes | bin/cutoffs/__init__.py | bin/cutoffs/__init__.py | Python | 0 | @@ -0,0 +1 @@
+%0A
| |
e40b92966762dfadff53355e9e38636a4769543f | Add intermediate tower 2 | pythonwarrior/towers/intermediate/level_002.py | pythonwarrior/towers/intermediate/level_002.py | Python | 0.999719 | @@ -0,0 +1,939 @@
+# ----%0A# %7C@s %7C%0A# %7C sS%3E%7C%0A# ----%0A%0Alevel.description(%22Another large room, but with several enemies %22%0A %22blocking your way to the stairs.%22)%0Alevel.tip(%22Just like walking, you can attack_ and feel in multiple %22%0A %22directions ('forward', 'le... | |
71d66fb3bdbcb38d29accb6bdfbf4ac8b2996e89 | Add intermediate tower 3 | pythonwarrior/towers/intermediate/level_003.py | pythonwarrior/towers/intermediate/level_003.py | Python | 0.999787 | @@ -0,0 +1,721 @@
+# ---%0A# %7C%3Es %7C%0A# %7Cs@s%7C%0A# %7C C %7C%0A# ---%0A%0Alevel.description(%22You feel slime on all sides, you're surrounded!%22)%0Alevel.tip(%22Call warrior.bind_(direction) to bind an enemy to keep him %22%0A %22from attacking. Bound enemies look like captives.%22)%0Alevel.clue(%22... | |
260cb76132bfe618b58cf34ad8dd61f59e847f90 | create table | zaifbot/models/nonce.py | zaifbot/models/nonce.py | Python | 0.00008 | @@ -0,0 +1,493 @@
+from sqlalchemy import Column, Integer, String, DateTime%0Afrom datetime import datetime%0Afrom zaifbot.models import Base%0A%0A%0Aclass Nonce(Base):%0A __tablename__ = 'nonces'%0A id = Column(Integer, primary_key=True)%0A key = Column(String, nullable=False)%0A secret = Column(String, nu... | |
a72567202e9b4024758706c00f016153ec04a53d | Create render.py | render.py | render.py | Python | 0.000001 | @@ -0,0 +1,566 @@
+#! /usr/bin/python3%0Afrom random import random%0A %0Aimport pyglet%0Afrom pyglet.window import key, Window%0Afrom pyglet.gl import *%0Afrom pyglet.gl.glu import *%0A%0A%0Awindow = Window()%0A%0A%0A@window.event%0Adef on_draw():%0A pass # TODO: implement!%0A%0A@window.event%0Adef on_resize(width, ... | |
77dca533f2d2fe94b233bd48561e1ed887928265 | add sample.py | sample.py | sample.py | Python | 0.000001 | @@ -0,0 +1,477 @@
+#-*- coding: UTF-8 -*-%0A# https://github.com/carpedm20/LINE%0A%0Afrom line import LineClient, LineGroup, LineContact%0A%0Af = open(%22credentials%22)%0AID = f.readline().strip()%0APASSWD = f.readline().strip()%0Af.close()%0A%0Aclient = LineClient(ID, PASSWD, com_name=%22line_api_demo%22)%0Afriends =... | |
cf3ed974c97d6eaa7983b249a65b4e6df4309c28 | Rename owners to instances | nycodex/db.py | nycodex/db.py | from enum import Enum
import os
import typing
import sqlalchemy
from sqlalchemy.dialects import postgresql
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
engine = sqlalchemy.create_engine(os.environ["DATABASE_URI"])
Session = sqlalchemy.orm.sessionmaker(bind=engine)
class DomainC... | Python | 0.000082 | @@ -183,16 +183,37 @@
e_base()
+ # type: typing.Any
%0A%0Aengine
@@ -738,16 +738,49 @@
ixin():%0A
+ __table__: sqlalchemy.Table%0A%0A
@cla
@@ -864,21 +864,24 @@
-owner
+instance
s: typin
@@ -892,21 +892,23 @@
erable%5B%22
-Owner
+DbMixin
%22%5D) -%3E N
@@ -966,22 +966,28 @@
for
-owner in own... |
db195957288ef7b6c5c9de6551689d4d06db28c1 | Create add_digits.py | lintcode/naive/add_digits/py/add_digits.py | lintcode/naive/add_digits/py/add_digits.py | Python | 0.000094 | @@ -0,0 +1,238 @@
+class Solution:%0A # @param %7Bint%7D num a non-negative integer%0A # @return %7Bint%7D one digit%0A def addDigits(self, num):%0A %0A while len(str(num)) %3E 1:%0A num = sum(map(int, str(num)))%0A %0A return num%0A
| |
836845abde53ee55bca93f098ece78880ab6b5c6 | Use same variable names as testing environment | examples/events/create_massive_dummy_events.py | examples/events/create_massive_dummy_events.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pymisp import PyMISP
from keys import misp_url, misp_key, misp_verifycert
import argparse
import tools
def init(url, key):
return PyMISP(url, key, misp_verifycert, 'json')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Create a give... | Python | 0.000016 | @@ -87,146 +87,46 @@
ort
-misp_url, misp_key, misp_verifycert%0Aimport argparse%0Aimport tools%0A%0Adef init(url, key):%0A return PyMISP(url, key, misp_verifycert, 'json')
+url, key%0Aimport argparse%0Aimport tools%0A
%0A%0Aif
@@ -534,31 +534,37 @@
p =
-init(misp_url, misp_key
+PyMISP(url, key, True, 'json'
)%... |
2d12c640e42e83580ee27933f0ad9bed2ebcc169 | add allauth and make owner of audio required | satsound/migrations/0007_auto_20170115_0331.py | satsound/migrations/0007_auto_20170115_0331.py | Python | 0 | @@ -0,0 +1,583 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.4 on 2017-01-15 03:31%0Afrom __future__ import unicode_literals%0A%0Aimport django.db.models.deletion%0Afrom django.conf import settings%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A dependencies = ... | |
a635a8d58e46cf4ef1bc225f8824d73984971fee | Add the answer to the sixth question of Assignment 3 | countVowels.py | countVowels.py | Python | 0.999999 | @@ -0,0 +1,1443 @@
+%22%22%22 Q6- Write a program that counts up the number of vowels contained in the string s. Valid vowels are: 'a', 'e', 'i',%0A'o', and 'u'. For example, if s = 'azcbobobegghakl', your program should print: Number of vowels: 5%0A%22%22%22%0A%0A# Using the isVowel function from isVowel.py module (An... | |
58fabd7929a4c712f5e87a39aaf8c34bae8759b8 | Add photos to the admin | quickphotos/admin.py | quickphotos/admin.py | Python | 0 | @@ -0,0 +1,512 @@
+from django.contrib import admin%0A%0Afrom .models import Photo%0A%0A%0A@admin.register(Photo)%0Aclass PhotoAdmin(admin.ModelAdmin):%0A list_display = ('user', 'caption', 'created')%0A list_filter = ('created',)%0A date_hierarchy = 'created'%0A readonly_fields = (%0A 'photo_id', 'u... | |
f7035a6c328bb237dd3c9be5d9da805606e059ae | Create adjust_xml_impath.py | object_detection/adjust_xml_impath.py | object_detection/adjust_xml_impath.py | Python | 0.000004 | @@ -0,0 +1,990 @@
+import os%0Aimport glob%0Aimport re%0Aimport argparse%0A%0Aap = argparse.ArgumentParser()%0Aap.add_argument('-i', '--input_xml_dir', type=str, default='./annot', help='path to root dir of xmls')%0Aap.add_argument('-s', '--subfolder', type=str, default='images', help='name of image subfolder')%0Aargs ... | |
0266a6cec641f244a8788f50f80ac3f11f87e1e4 | Add back fix_root script | scripts/fix_root.py | scripts/fix_root.py | Python | 0.000001 | @@ -0,0 +1,845 @@
+import sys%0Aimport logging%0Afrom website.app import setup_django%0Asetup_django()%0Afrom scripts import utils as script_utils%0Afrom osf.models import AbstractNode%0Afrom framework.database import paginated%0A%0Alogger = logging.getLogger(__name__)%0A%0Adef main(dry=True):%0A count = 0%0A for... | |
8578320e023dc3424da055c4a506931ec44b19ce | Save user's name to db when verifying AGA id | web/app/verify/views.py | web/app/verify/views.py | from . import verify
from .aga_membership import get_aga_info
from flask import abort, redirect, url_for, render_template, current_app
from flask.ext.security import login_required
from flask.ext.login import current_user
from flask.ext.wtf import Form
from flask.ext.mail import Message
from sqlalchemy.sql import and_... | Python | 0 | @@ -1087,24 +1087,238 @@
abort(404)%0A%0A
+ aga_info = get_aga_info(aga_id)%0A if aga_info is None:%0A current_app.logger.warn(%22Could not fetch AGA info for aga_id %25s%22 %25 aga_id)%0A abort(404)%0A user_realname = aga_info.get('full_name', '')%0A%0A
# TODO:
@@ -1485,24 +1485,54 @@
id... |
ac3a3b583b028e53d80749eaaee58b4eb80d1c6a | Implement stack functionality | stack/stack.py | stack/stack.py | Python | 0.000002 | @@ -0,0 +1,732 @@
+%0Aclass Node(object):%0A def __init__(self, value=None, next_node=None):%0A self.value = value%0A self.next_node = next_node%0A%0A%0Aclass Stack(object):%0A def __init__(self, head=None):%0A self.head = head%0A%0A def push(self, data):%0A self.head = Node(data, s... | |
a6137714c55ada55571759b851e1e4afa7818f29 | Add cli tool to delete documents. | app/utils/scripts/delete-docs.py | app/utils/scripts/delete-docs.py | Python | 0.000013 | @@ -0,0 +1,2837 @@
+#!/usr/bin/python%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%0A# published by the Free Software Foundation, either version 3 of the%0A# License, or (at your option) any later version.%0A#%0A# This pr... | |
c71a3f1adbf310c63ce9ab7611cf0e198ffe69da | Add load test | metakernel/magics/tests/test_load_magic.py | metakernel/magics/tests/test_load_magic.py | Python | 0.000001 | @@ -0,0 +1,212 @@
+%0Afrom metakernel.tests.utils import get_kernel%0A%0A%0Adef test_load_magic():%0A kernel = get_kernel()%0A ret = kernel.do_execute(%22%25%25load %25s%22 %25 __file__)%0A assert 'def test_load_magic' in ret%5B'payload'%5D%5B0%5D%5B'text'%5D%0A
| |
e575f343f55fd54994fdb1f4d02fe6e2e52ba056 | add phonetizer.py - really | phonetizer.py | phonetizer.py | Python | 0 | @@ -0,0 +1,2726 @@
+import re%0A%0Aclass Phonetizer():%0A%0A # Define shorthands for phonological classes%0A ph_classes = %7B%0A 'C' : 'p%7Ct%7Ck%7Cb%7Cd%7Cg',%0A 'V' : 'a%7Ce%7Ci%7Co%7Cu%7Cy'%0A %7D%0A%0A def __init__(self, mappings_filename):%0A with open(mappings_filename) as mfile:%0A ... | |
163da52a48eb0d84cde47f7cfe99e1188350db47 | Add MOBIB Basic reader script | mobib_basic.py | mobib_basic.py | Python | 0 | @@ -0,0 +1,1615 @@
+#!/bin/env python3%0A%0Aimport sys%0A%0Afrom smartcard.System import readers%0A%0ACALYPSO_CLA = %5B0x94%5D%0ASELECT_INS = %5B0xA4%5D%0AREAD_RECORD_INS = %5B0xB2%5D%0AGET_RESPONSE_INS = %5B0xC0%5D%0ATICKETING_COUNTERS_FILE_ID = %5B0x20, 0x69%5D%0A%0Adef main():%0A local_readers = readers()%0A%0A ... | |
97531bdb1501748c7039d194e98408245dc5d2b2 | Make graphflow loading script | load-tx-to-graphflow.py | load-tx-to-graphflow.py | Python | 0.000002 | @@ -0,0 +1,1691 @@
+from constants import *%0Aimport csv%0A%0AwalletsMap=%7B%7D #address -%3E number OR transaction_id-%3Enumber%0AlastNumber = 0%0A%0Awith open(IN_TRANSACTION_CSV_LOCATION, 'rb') as tx_in_file:%0A in_reader = csv.reader(tx_in_file, delimiter=%22,%22)%0A for row in in_reader:%0A tx_hash = r... | |
7f6aab7dc177dc1178eca30e0ba40874b217e7cf | Create *variable.py | *variable.py | *variable.py | Python | 0.000001 | @@ -0,0 +1,510 @@
+def num(*nums): // One * takes in any number of single data type, in this case : Int%0A sum = 0%0A for x in nums:%0A sum += x%0A return sum%0A %0Asum(22,33,44,55,66) // You can type as many numbers as you wish%0A%0A%0Adef whatever(**kwargs): // Double ** tak... | |
70da5f3657ee847f315b0d0dfbe5adb393c55ca6 | add system_info.py | system_info.py | system_info.py | Python | 0.000002 | @@ -0,0 +1,1254 @@
+# -*- coding: utf-8 -*-%0A%22%22%22System info%22%22%22%0A%0Aimport platform%0Aimport subprocess%0Aimport sys%0A%0Aimport numpy%0A%0A%0Aclass SystemInfo:%0A %22%22%22Collect system info.%22%22%22%0A%0A @property%0A def platform(self):%0A %22%22%22Info on the underlying platform.%22%2... | |
a2b462abb41724d92db7222087b017e5781e4191 | add incident fields | content_creator.py | content_creator.py | import os
import sys
import yaml
import glob
import shutil
CONTENT_DIRS = ['Integrations', 'Misc', 'Playbooks', 'Reports', 'Dashboards', 'Widgets', 'Scripts',
'Classifiers', 'Layouts']
# temp folder names
BUNDLE_PRE = 'bundle_pre'
BUNDLE_POST = 'bundle_post'
# zip files names (the extension will be add... | Python | 0 | @@ -193,16 +193,34 @@
Layouts'
+, 'IncidentFields'
%5D%0A# temp
|
2910f54c75e3f7cc9d7be08886547060a7e69b69 | Implement basic CLI control | pusher.py | pusher.py | Python | 0.000001 | @@ -0,0 +1,2033 @@
+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 stackable.stackable import StackableError%0Afrom runn... | |
e10ed243f6cae2e020d468bbd13a619e45ed0c5d | Add a forgotten migration | sponsors/migrations/0011_auto_20170629_1208.py | sponsors/migrations/0011_auto_20170629_1208.py | Python | 0.000029 | @@ -0,0 +1,754 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.2 on 2017-06-29 10:08%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('sponsors', '0010_auto_20170627_2001'),%0A %5D%0A... | |
ca5d47f3749c188d0858e996ba0253077260cd6c | Create GetUserGraphInstagram.py | GetUserGraphInstagram.py | GetUserGraphInstagram.py | Python | 0 | @@ -0,0 +1,296 @@
+#! /bin/bash%0A%0Afor (( i=1; i %3C= 5; i++ ))%0Ado%0A%0A userid=$i%0A%0A curl https://api.instagram.com/v1/users/$userid/follows?access_token=XXXXXX %3E followers/$userid.followers%0A curl https://api.instagram.com/v1/users/$userid/followed-by?access_token=XXXXXX %3E followedby/$userid.... | |
a8f4f0aa06e1469e758d5775bfea4176c7561e9f | Create stop_playlist.py | HA/syno/stop_playlist.py | HA/syno/stop_playlist.py | Python | 0.000008 | @@ -0,0 +1,1466 @@
+#!/usr/bin/python%0Aimport sys%0Aimport http.cookiejar, urllib.request, urllib.error, urllib.parse%0Aimport json%0Aimport codecs%0A%0Acj = http.cookiejar.CookieJar()%0Aopener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))%0A%0AIP_syno = %22IP_OF_YOUR_NAS%22%0ALOGIN = %22******... | |
b6daa366a38f224132c8f276d3fbc212964900c2 | add currency | zametki/currency.py | zametki/currency.py | Python | 0.999995 | @@ -0,0 +1,204 @@
+import requests as req%0A%0Adef getUSD_RUB():%0A currency_url = 'http://api.fixer.io/latest?symbols=RUB&base=USD'%0A res = req.get(currency_url).json()%0A return res%5B'rates'%5D%5B'RUB'%5D%0A%0A#print(getUSD_RUB())%0A%0A
| |
16883c227549707ef2a66d7e6020809fe9ecd909 | Add visitor base class | tater/visit.py | tater/visit.py | Python | 0 | @@ -0,0 +1,910 @@
+from tater.utils import CachedAttr%0A%0A%0Aclass _MethodDict(dict):%0A 'Dict for caching visitor methods.'%0A def __init__(self, visitor):%0A self.visitor = visitor%0A%0A def __missing__(self, node):%0A name = node.__class__.__name__%0A method = getattr(self.visitor, 'vi... | |
7dd4919809c626d83cfc17447396aff98e636cfe | Add problem 13 | problem_13.py | problem_13.py | Python | 0.000001 | @@ -0,0 +1,2055 @@
+from collections import OrderedDict%0Afrom crypto_library import ecb_aes_encrypt, ecb_aes_decrypt%0Afrom problem_12 import find_blocksize%0Afrom crypto_library import apply_pkcs_7_padding%0A%0AENCRYPTION_KEY = ',y!3%3CCWn@1?wwF%5D%5Cx0b'%0A%0A%0Adef oracle(adversary_input):%0A profile = profile_f... | |
253ad82c316bd6d11dcf798e626b7eaf638867bd | add simple font comparison tool in examples | examples/font_comparison.py | examples/font_comparison.py | Python | 0 | @@ -0,0 +1,3054 @@
+#!/usr/bin/env python%0A# ----------------------------------------------------------------------------%0A# pyglet%0A# Copyright (c) 2006-2008 Alex Holkner%0A# All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that... | |
3ac3c5fef523e8c643adc8479b82958cfe150b79 | change contributors (#17656) | Utils/github_workflow_scripts/handle_external_pr.py | Utils/github_workflow_scripts/handle_external_pr.py | #!/usr/bin/env python3
import json
from typing import List
import urllib3
from blessings import Terminal
from github import Github
from github.Repository import Repository
from utils import get_env_var, timestamped_print
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print = timestamped_print
... | Python | 0 | @@ -331,22 +331,36 @@
= %5B'
-yuvalbenshalom
+bziser', 'GuyAfik', 'yucohen
'%5D%0AM
|
a1ba3031171992e4c07bef13b6edcdb1b80e32e6 | Create psyko-ddos.py | psyko-ddos.py | psyko-ddos.py | Python | 0.000013 | @@ -0,0 +1,1436 @@
+%22%22%22%0ATitle: Psyko DDoS%0AType: Hacking Tool%0AVersion: 1.0%0AAuthor: Brandon Hammond%0ASummary: Psyko DDoS is a Python DDoS%0A tool that uses TCP packets%0A to conduct a layer 4 DDoS%0A attack on the target IP%0A address at the given port.%0A It uses mu... | |
dd36aef29cd1e45ec447260f9ac8848a86a430dc | Create ptb_reader.py | ptb_reader.py | ptb_reader.py | Python | 0.000004 | @@ -0,0 +1,1274 @@
+from __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0A%0Aimport collections%0Aimport os%0Aimport sys%0A%0Aimport tensorflow as tf%0A%0A%0Adef _read_words(filename):%0A%09with open(filename, %22r%22) as f:%0A%09%09if sys.version_info%5B0%5D... | |
532fdfa4a0fa4f0f5f441a572eef739f081e6522 | Create hello.py | hello.py | hello.py | Python | 0.999503 | @@ -0,0 +1,43 @@
+#!/usr/bin/env python%0A%0Aprint 'hello world'%0A
| |
98d956b6a249caeaee76732a0679c2dd3384cda7 | Create pytemplate.py | pytemplate.py | pytemplate.py | Python | 0.000004 | @@ -0,0 +1,2378 @@
+import os,sys,string%0A%0Afile_name = %22%22%0Aif sys.argv%5B1%5D == %22%22:%0A file_name = %22template.tf%22%0Aelse:%0A file_name = sys.argv%5B1%5D%0A%0Apath = %5B%5D%0A%0Adef build_path():%0A s_path = %22%22%0A for i in path:%0A s_path += i + %22%5C%5C%22%0A return s_path%0A... | |
f4d70c81c55e744ef6ff4dd9fded2ca6e771fe30 | add missing profiles migration | profiles/migrations/0003_auto_20210225_1754.py | profiles/migrations/0003_auto_20210225_1754.py | Python | 0.000001 | @@ -0,0 +1,804 @@
+# Generated by Django 2.2.16 on 2021-02-25 17:54%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A (%22profiles%22, %220002_auto_20200903_1942%22),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ... | |
79acf77b7d711c88ea0ca8a733721ce5285f9a00 | Create Randomkick.py | Randomkick.py | Randomkick.py | Python | 0 | @@ -0,0 +1,694 @@
+__module_name__ = 'Random Kick Reason'%0A__module_version__ = '0.1'%0A__module_description__ = 'Kicks the designated player with a random kick reason.'%0A__module_author__ = 'Jake0720'%0A%0Arkickhelp = '%5Cx02USAGE: /rk %3Cnick%3E'%0A%0Aimport xchat%0Aimport random%0A%0Adef rk(word, word_eol, userda... | |
d021c05e483f556122d0f3251c2a299e0c47792c | add language detection code (even if it's not used) | src/detect_language.py | src/detect_language.py | Python | 0 | @@ -0,0 +1,531 @@
+def determine_language(item):%0A import langid%0A%0A # latin my ass%0A def classify(s):%0A rank = langid.rank(s)%0A if rank%5B0%5D%5B0%5D == 'la':%0A return rank%5B1%5D%5B0%5D%0A return rank%5B0%5D%5B0%5D%0A%0A # extract text%0A soup = boil_soup(item)%0A... | |
f0392ebda49fa0222a3b317f50002d7e03659f47 | Test we can approve Flutterwave bank accounts | bluebottle/funding_flutterwave/tests/test_states.py | bluebottle/funding_flutterwave/tests/test_states.py | Python | 0 | @@ -0,0 +1,1412 @@
+from bluebottle.files.tests.factories import PrivateDocumentFactory%0Afrom bluebottle.funding.tests.factories import FundingFactory, PlainPayoutAccountFactory, %5C%0A BudgetLineFactory%0Afrom bluebottle.funding_flutterwave.tests.factories import FlutterwaveBankAccountFactory%0Afrom bluebottle.tes... | |
c1fc0121b02656de7bc99c587743485b5e45e416 | Create angelbambi.py | angelbambi.py | angelbambi.py | Python | 0.002066 | @@ -0,0 +1,1723 @@
+#the following lines will allow you to use buttons and leds%0Aimport btnlib as btn%0Aimport ledlib as led%0Aimport time%0A%0A#the led.startup() function cycles through the leds%0Aled.startup()%0Atime.sleep(1)%0A%0Aprint(%22All on and off%22)%0A#to turn on all leds, use the led.turn_on_all(2) functio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.