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
51e368584d59ad2f308f1c9229fbbbf40c504749
Create list.py
list.py
list.py
Python
0.000003
@@ -0,0 +1,1009 @@ +import argparse%0Aimport boto.ec2%0A%0Aaccess_key = ''%0Asecret_key = ''%0A%0Adef get_ec2_instances(region):%0A ec2_conn = boto.ec2.connect_to_region(region,%0A aws_access_key_id=access_key,%0A aws_secret_access_key=secret_key)%0A reservations = ec2_conn.get_all_r...
c0bca49a19e4f97663b9f282bb11768457aec89e
Add example of tycho2 usage
example.py
example.py
Python
0
@@ -0,0 +1,1096 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Sat Oct 21 00:17:33 2017%0A%0A@author: lauri.kangas%0A%22%22%22%0A%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0A%0Afrom tycho2 import tycho2%0Afrom projections import stereographic, unity%0Aimport coordinate_transformations as coord%0A ...
6dc4d2d1e9ef998ff310c14c54586ca694572801
Add extract plugin
extract.py
extract.py
Python
0.000001
@@ -0,0 +1,979 @@ +%22%22%22This plugin extracts the main content of a webpage%22%22%22%0A%22%22%22e.g. extracting the article of a url of bbc.co.uk%22%22%22%0A%0Afrom utils import add_cmd, add_handler%0Aimport utils%0Aimport requests%0Afrom bs4 import BeautifulSoup%0A%0Aname = %22extract%22%0Acmds = %5B%22extract%22%5...
8c71a177c16762ab50dafe2528d24fab4ccf0925
Add py solution for 462. Minimum Moves to Equal Array Elements II
py/minimum-moves-to-equal-array-elements-ii.py
py/minimum-moves-to-equal-array-elements-ii.py
Python
0.000163
@@ -0,0 +1,236 @@ +class Solution(object):%0A def minMoves2(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: int%0A %22%22%22%0A nums.sort()%0A median = nums%5Blen(nums) / 2%5D%0A return sum(abs(x - median) for x in nums)%0A
9cd494f526fa49e04bbdbb31dc6d32f444bbbba8
add a tool to print the content of SEG frames
util/dumpSEGPixelData.py
util/dumpSEGPixelData.py
Python
0
@@ -0,0 +1,1653 @@ +import pydicom, sys%0Afrom colorama import Fore, Style, init%0A%0A# colorama%0Ainit()%0A%0Ad = pydicom.read_file(sys.argv%5B1%5D)%0Aif len(sys.argv)%3E2:%0A frame = int(sys.argv%5B2%5D)-1%0A print(%22Dumping frame %22+str(frame))%0Aelse:%0A frame = None%0Aprint(d.Rows)%0Aprint(d.Columns)%0Aprint(...
ec3ef6e8770b9a36f20a05216d8e0964107a8689
Add a new snippet (Python GTK+3).
python/pygtk/python_gtk3_pygobject/combobox.py
python/pygtk/python_gtk3_pygobject/combobox.py
Python
0.000002
@@ -0,0 +1,2840 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2015 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%0A%0A%22%22%22%0AThis is the simplest Python GTK+3 snippet.%0A%0ASee: http://python-gtk-3-tutorial.readthedocs.org/en/latest/combobox.html%0A%0A%22For a simple list of textual ch...
5c3589b295c9b9156a6bbfdcecc81754a76f9e0d
Create url-logger.py
url-logger.py
url-logger.py
Python
0.000017
@@ -0,0 +1,2097 @@ +from datetime import datetime%0Aimport hexchat%0Aimport os%0Aimport re%0A%0A__module_name__ = %22URL Logger%22%0A__module_author__ = %22Poorchop%22%0A__module_version__ = %220.1%22%0A__module_description__ = %22Log URLs from specific channels and PMs to disk%22%0A%0A# channels ...
2206ec50a5645f3dbcb905f0eae90e9f4b1e5262
Change compare condition
platformio/builder/scripts/ststm32.py
platformio/builder/scripts/ststm32.py
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ Builder for ST STM32 Series ARM microcontrollers. """ import platform from os.path import isfile, join from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, DefaultEnvironment, Exit, SConscript...
Python
0.000001
@@ -424,17 +424,8 @@ %0Aif -%22gdb%22 in env%5B @@ -442,16 +442,25 @@ OTOCOL'%5D + == %22gdb%22 :%0A if
3c4c06607eb14920cf4b9d0e4fb6d29f37d1d0ec
Add db_add.py, adding a post from a file, with tags from the filename.
db_add.py
db_add.py
Python
0
@@ -0,0 +1,1485 @@ +#!/usr/bin/env python%0A# -*- coding: iso-8859-1 -*-%0A%0Afrom sys import argv, exit%0Afrom dbclient import dbclient%0Afrom hashlib import md5%0Aimport Image%0Afrom cStringIO import StringIO%0Afrom pyexiv2 import Image as ExivImage%0Afrom os.path import basename%0A%0Aif len(argv) %3C 2:%0A%09print %...
7570e757e79c29974afffeee036f056328a06fe9
Create pull.py
pull.py
pull.py
Python
0.000001
@@ -0,0 +1,43 @@ +It's a file to try my first pull derective%0A
5d38ab06fd014241cba7e8cdcfed9887a92460b9
Add smoke tests aperiodic
neurodsp/tests/test_aperiodic_dfa.py
neurodsp/tests/test_aperiodic_dfa.py
Python
0.000013
@@ -0,0 +1,618 @@ +%22%22%22Tests for fractal analysis using fluctuation measures.%22%22%22%0A%0Afrom neurodsp.tests.settings import FS%0A%0Afrom neurodsp.aperiodic.dfa import *%0A%0A###################################################################################################%0A###################################...
3628c21841eea385dbc13e0065ab41138cf102a6
Add users to the admin
djangae/contrib/auth/admin.py
djangae/contrib/auth/admin.py
Python
0
@@ -0,0 +1,105 @@ +from django.contrib import admin%0A%0Afrom djangae.contrib.auth.models import User%0A%0Aadmin.site.register(User)
e506a059369b089cb4c163669a04fbb9d05e9884
add minimal FBO example
examples/minimalframebufferexample.py
examples/minimalframebufferexample.py
Python
0.000001
@@ -0,0 +1,1564 @@ +from scipy.misc import imsave%0A%0Afrom glitter import ShaderProgram, RectangleTexture, Framebuffer, VertexArray%0Afrom glitter.contexts.glut import GlutWindow, main_loop%0A%0Avertex_shader = %22%22%22%0A#version 400 core%0A%0Alayout(location=0) in vec4 in_position;%0A%0Avoid main() %7B%0A gl_Pos...
066c48effb2f2c1534e43687d031e01f823f098f
add common mixins
emgapi/viewsets.py
emgapi/viewsets.py
Python
0.000073
@@ -0,0 +1,1375 @@ +# -*- coding: utf-8 -*-%0A%0A# Copyright 2017 EMBL - European Bioinformatics Institute%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# http://www.apache.or...
59ccbc17e7e7f4f75b8f95bb1287b676466068db
Create snake1.py
snake1.py
snake1.py
Python
0.000569
@@ -0,0 +1 @@ +%0A
cf496298c839e63a786bc8b4a934df09beef93ac
Add script to better log time
bin/log.py
bin/log.py
Python
0.000001
@@ -0,0 +1,1132 @@ +#!/usr/bin/env python%0A%0Afrom datetime import date, datetime%0Afrom pathlib import Path%0Aimport csv%0Aimport os%0Aimport sys%0A%0Aif len(sys.argv) != 2:%0A print(%22Usage: %7B%7D 'job to be logged'%22.format(sys.argv%5B0%5D))%0A exit(1)%0A%0Alog_dir = %22%7B%7D/time_logs%22.format(Path.home...
432ddd2d1885b76704ff6b2d78fe6e83a57ca5a0
remove jedi linter for now, as too unstable
build.py
build.py
#!/usr/bin/env python # # -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2014 PyBuilder Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
Python
0
@@ -1341,41 +1341,8 @@ d%22)%0A -use_plugin(%22python.jedi_linter%22)%0A %0A%0Aif
addb7f342e5c2bc0f1df19bd6d00d50be23a52da
Add Year
year.py
year.py
Python
0
@@ -0,0 +1,422 @@ +months=%5B'January','February','March','April','May','June','July','August','September','October','November','December'%5D%0Aendings=%5B'st','nd','rd'%5D+17*%5B'th'%5D+%5B'st','nd','rd'%5D+7*%5B'th'%5D+%5B'st'%5D%0Ayear=raw_input('Year:')%0Amonth=raw_input('Month(1--12):')%0Aday=raw_input('day(1--31)...
dac398518bac49c6c51d04166c021323cdba9235
Add unit tests.
fdp-api/python/tests/test_metadata.py
fdp-api/python/tests/test_metadata.py
Python
0
@@ -0,0 +1,1672 @@ +from nose import with_setup%0Afrom nose.tools import assert_equals, assert_in, assert_true, assert_false%0Afrom metadata import FAIRConfigReader, FAIRGraph, FDPath%0Afrom urllib2 import urlparse%0A%0A%0Areader = FAIRConfigReader()%0A%0Adef test_paths():%0A id = 'abc'%0A for resource in %5B'fdp',...
19c94f3bf71c07763dfddd72b867502d765d01db
Add https://gist.github.com/2349756
sqlite.py
sqlite.py
Python
0.000461
@@ -0,0 +1,1135 @@ +import scraperwiki%0Afrom dumptruck import DumpTruck%0A%0Adt = DumpTruck()%0A%0Adef execute(sqlquery, data=None, verbose=1):%0A %22%22%22 Should return list of lists, but returns list of dicts %22%22%22%0A return dt.execute(sqlquery, *data, commit=False)%0A # other way %5B dict(zip(result%5...
07e074e662b33713a266777300354e8953ce3b78
ADD connection class to Azure
plugin/connection.py
plugin/connection.py
Python
0.000001
@@ -0,0 +1,910 @@ +from plugin import utils%0Afrom azure import servicemanagement%0A%0Aclass AzureConnectionClient():%0A %22%22%22Provides functions for getting the Azure Service Management Service%0A %22%22%22%0A%0A def __init__(self):%0A self.connection = None%0A%0A def client(self):%0A %22%...
9ceb4f394c19a74d8cd28698eeb9116cf8099117
add anno
annot_to_densitymap.py
annot_to_densitymap.py
Python
0.999998
@@ -0,0 +1,746 @@ +import xml.etree.ElementTree as ET%0Aimport numpy as np%0Aimport xmltodict%0Aimport matplotlib.pyplot as plt%0A#import cv2%0A%0Axml_data = 'data/Cam253/%5BCam253%5D-2016_4_21_15h_150f/000150.xml'%0A%0Awith open(xml_data) as xml_d:%0A%09doc = xmltodict.parse(xml_d.read())%0A%0Aimg = np.zeros((352, 240...
0b0150ad73c52ea5b23def899edb819bd3318eb1
fix uncaught analytics exception
lbrynet/analytics/api.py
lbrynet/analytics/api.py
import functools import json import logging from requests import auth from requests_futures import sessions from lbrynet.conf import settings from lbrynet.analytics import utils log = logging.getLogger(__name__) def log_response(fn): def _log(future): if future.cancelled(): log.warning('Re...
Python
0.000009
@@ -348,16 +348,98 @@ elled')%0A + elif future.exception():%0A log.warning(future.exception_info())%0A
8088d7061c24ca78df0c92be6e36edb7deca1dac
Remove print
gargoyle/client/operators/__init__.py
gargoyle/client/operators/__init__.py
import inspect class GetInitArguments(object): def __get__(self, obj, obj_type): print obj_type args = inspect.getargspec(obj_type.__init__).args return tuple(args[1:]) class Base(object): def __init__(self): pass arguments = GetInitArguments()
Python
0.000016
@@ -89,35 +89,8 @@ e):%0A - print obj_type%0A
8238d7ad6793f6deef520a46f85d40b0d75d221f
Add placeholder for the parsing code
gpmf/parse.py
gpmf/parse.py
Python
0.000002
@@ -0,0 +1,112 @@ +# TODO: Implement GPMF parsing%0A# see https://github.com/gopro/gpmf-parser#gmfp-deeper-dive for format details%0A
d7553fd42e3ac0bcdf0ab70468ad314253b64871
Create parse.py
zoom/parse.py
zoom/parse.py
Python
0
@@ -0,0 +1,1433 @@ +parse(geo, df) :%0A latDict, lonDict = dict(), dict()%0A%0A # identify extreme most latitude and longitude coordinate pairs in each state%0A # save coordinate pair of most extreme points for autozoom%0A for count in range(0,len(usStates%5B'features'%5D)) :%0A if geo%5B'key'%5D in ...
0f7d6f039930324d77dc23315ed3c9bd10c1f0de
Add missing file
util.py
util.py
Python
0.000006
@@ -0,0 +1,1530 @@ +#%0A# Copyright 2016 Anil Thomas%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# Unl...
37dabf1c98407602edda25dbb9c24c17bd84f19a
Add timer to builders
dev/scripts/coolprop_builder_timer.py
dev/scripts/coolprop_builder_timer.py
Python
0
@@ -0,0 +1,502 @@ +from __future__ import print_function%0A%0Aimport urllib, json%0Afilehandle = urllib.urlopen('http://www.coolprop.dreamhosters.com:8010/json/builders')%0Ajj = json.loads(filehandle.read())%0A%0Atimes = %5B%5D%0Afor key in jj.keys():%0A filehandle = urllib.urlopen('http://www.coolprop.dreamhosters....
b37eae02a69759352652514635616b9bb504b21b
rewritten as a function
ex33-1.py
ex33-1.py
Python
0.999441
@@ -0,0 +1,727 @@ +def append_wrapper(n):%0A%09'''Append the natural numbers up to n to a list and print the last element at the beginning and%0A%09end of each iteration. Then print the list%0A%09n -- the upper bound%0A%09'''%0A%09i=0%0A%09numbers = %5B%5D%0A%0A%09while i%3Cn:%0A%09%09#where we are at the beginning of ...
45aacb9d0f5f24600d4796cc5194dfbde1c65222
Add map/dist/filter demo
learning-python/ch05/MapExamples.py
learning-python/ch05/MapExamples.py
Python
0
@@ -0,0 +1,919 @@ +lst = range(10)%0A%0Aret = map(lambda *i: i, lst, %22abcdefg%22)%0A%0Afor item in ret:%0A print(item)%0A%0Astudents = %5B%0A dict(id=0, credits=dict(math=9, physics=6, history=7)),%0A dict(id=1, credits=dict(math=6, physics=7, latin=10)),%0A dict(id=2, credits=dict(history=8, physics=9, c...
efcc5260a8566d41880cddcc54d4f86c8f722153
Add unit test
test/unit_test/test_utility_stats/test_utility_stats.py
test/unit_test/test_utility_stats/test_utility_stats.py
Python
0.000001
@@ -0,0 +1,436 @@ +from lexos.processors.analyze import information%0A%0Aword_lists = %5B%7B%22abundant%22: 40, %22actually%22: 20, %22advanced%22: 15, %22alter%22: 5%7D,%0A %7B%22hunger%22: 1, %22hunt%22: 2, %22ignore%22: 3, %22illustration%22: 4,%0A %22ink%22: 5%7D%5D%0A%0Afile_list = %5B%2...
7dc489b393ba293db5cc72c2f9b2bd65d6fe1166
add command to migrate sheet.
upload/management/commands/import_transaction.py
upload/management/commands/import_transaction.py
Python
0
@@ -0,0 +1,928 @@ +import csv%0Afrom django.contrib.auth.models import User%0Afrom opencivicdata.models import Jurisdiction, Division%0Afrom upload.backend.parser import import_stream, people_to_pupa%0Afrom upload.backend.importer import do_import%0Afrom upload.models import SpreadsheetUpload%0A%0Afrom django.core.mana...
35a0832ab372b9519ed7391e166ef8c25456a005
Bump minor version
pygerduty/version.py
pygerduty/version.py
version_info = (0, 28, 1) __version__ = '.'.join(str(v) for v in version_info)
Python
0
@@ -20,9 +20,9 @@ 28, -1 +2 )%0A__
b9245a8acf0bed7e19f709490c4ba3788028da93
Fix error in PoolStatusEntry model
server/ec2spotmanager/migrations/0003_auto_20150504_1440.py
server/ec2spotmanager/migrations/0003_auto_20150504_1440.py
Python
0.000001
@@ -0,0 +1,612 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('ec2spotmanager', '0002_instancestatusentry_poolstatusentry'),%0A %5D%0A%0A operations = %5B%0A ...
d05bdc1a3a343184a02ec12b734a110140e94829
add persistent decorator of class
server/Mars/ServerUtils/PersistentDecorator.py
server/Mars/ServerUtils/PersistentDecorator.py
Python
0.000001
@@ -0,0 +1,1460 @@ +#!/usr/bin/env python%0A# -*- encoding: utf-8 -*-%0A#%0A# Copyright (c) 2016 ASMlover. All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A#%0A# * Redistributions of sou...
ee21691294e6bf9aacf0dd8591991c33d30c5159
raise KeyboardInterrupt for backward compatibility
pysnmp/carrier/asyncore/dispatch.py
pysnmp/carrier/asyncore/dispatch.py
# Implements I/O over asynchronous sockets from time import time from sys import exc_info from asyncore import socket_map from asyncore import loop from pysnmp.carrier.base import AbstractTransportDispatcher from pysnmp.error import PySnmpError class AsynsockDispatcher(AbstractTransportDispatcher): def __init__(se...
Python
0.000001
@@ -1344,16 +1344,76 @@ ount=1)%0A + except KeyboardInterrupt:%0A raise%0A
98bd10cdf2c380b17c16a47a8f962dc384b3a18d
Solve py set discard remove pop
python/py-set-discard-remove-pop.py
python/py-set-discard-remove-pop.py
Python
0.999979
@@ -0,0 +1,288 @@ +num_elements = int(input())%0As = set(map(int, input().split()))%0Anum_operations = int(input())%0Afor _ in range(num_operations):%0A operation = input().split(%22 %22)%0A if(operation%5B0%5D == %22pop%22):%0A s.pop()%0A else:%0A op, val = operation%0A s.discard(int(val)...
a8db812c5a9822f6ea72bf44134ed2219a2c5c74
Remove print statement.
app/main/views/dashboard.py
app/main/views/dashboard.py
from flask import (abort, render_template, session) from flask_login import login_required from app.main import main from app.main.dao.services_dao import get_service_by_id from app.main.dao import templates_dao from notifications_python_client.errors import HTTPError from app import job_api_client from app.utils impo...
Python
0.000046
@@ -817,45 +817,8 @@ e'%5D%0A - print(service%5B'data'%5D%5B'id'%5D)%0A
f3130bde2704008017e1438bf7d6cb1c0bbf3d61
Create jsonSender.py
jsonSender.py
jsonSender.py
Python
0.000048
@@ -0,0 +1,706 @@ +import socket%0Aimport json%0Aimport time%0Afrom distancemeter import get_distance,cleanup%0A%0A# Logstash TCP/JSON Host%0AJSON_PORT = 5959%0AJSON_HOST = '127.0.0.1'%0A%0Aif __name__ == '__main__':%0A try:%0A s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)%0A s.connect((JSON_HO...
482c79850a943f77034d376c0d8e8682142b705d
Add init
project_management/pmtools/__init__.py
project_management/pmtools/__init__.py
Python
0.085164
@@ -0,0 +1,736 @@ +%22%22%22%0APipeline Management Tools%0A%0AUsage: pm command %5Boptions%5D%0A%22%22%22%0A%0Afrom cement.core import foundation, controller, handler%0A%0A## Abstract base controller -- for sharing arguments%0Aclass AbstractBaseController(controller.CementBaseController):%0A class Meta:%0A ar...
d853fba90a8fc784cdb248923cede6166fe91a8f
remove some field that duplicate
netforce_mfg/netforce_mfg/models/stock_barcode.py
netforce_mfg/netforce_mfg/models/stock_barcode.py
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
Python
0.000004
@@ -1206,182 +1206,24 @@ de%22%0A - _transient = True%0A _fields = %7B%0A %22type%22: fields.Selection(%5B%5B%22in%22, %22Goods Receipt%22%5D, %5B%22internal%22, %22Goods Transfer%22%5D, %5B%22out%22, %22Goods Issue%22%5D%5D, %22Transaction Type%22), +%0A _fields = %7B %0A
f1e2ae06784d759b0f6dbfae1424a2de70353ea9
add a module used to call platon (software assigning space groups) on a structure in pymatgen
pymatgen/command_line/platon_caller.py
pymatgen/command_line/platon_caller.py
Python
0
@@ -0,0 +1,1589 @@ +'''%0AInterface with command line platon%0Ahttp://aflowlib.org/%0AOnly tested on Linux%0Ainspired by Shyue's qhull_caller%0AWARNING: you need to have a platon in your path for this to work%0A'''%0A%0A__author__=%22Geoffroy Hautier%22%0A__copyright__ = %22Copyright 2012, The Materials Project%22%0A__...
6cad2d60857e9d8714f679f68ae4887e58092a57
Add caffe-compute-image-mean.
python2.7/caffe-compute-image-mean.py
python2.7/caffe-compute-image-mean.py
Python
0.000002
@@ -0,0 +1,1795 @@ +#!/usr/bin/env python2%0A%0Aimport sys%0Asys.path.append(%22/home/bamos/repos/caffe-local/python%22)%0A%0Aimport argparse%0Aimport numpy as np%0Aimport os%0Aimport time%0A%0Afrom caffe.proto import caffe_pb2%0Afrom caffe.io import array_to_blobproto%0Afrom collections import defaultdict%0Afrom skima...
8e94da2cf788115a1562db253c96b1932b495ef3
Add script for generating chords, used to make some of the sounds.
make_chord.py
make_chord.py
Python
0
@@ -0,0 +1,986 @@ +from collections import OrderedDict%0Afrom itertools import cycle%0Aimport sys%0A%0A# build the pitch table%0Anote_names = %5B'A', 'A#/Bb', 'B', 'C', 'C#/Db', 'D', 'D#/Eb', 'E', 'F', 'F#/Gb', 'G', 'G#/Ab'%5D%0Anote_cycle = cycle(note_names)%0A%0Apiano = %5B%5D%0Aonumber = 0%0Afor i in range(1, 89):%0...
56bfc977ea1e7b415e699a82459c917c71fe36df
add app.utils module
app/utils.py
app/utils.py
Python
0.000002
@@ -0,0 +1,113 @@ +%0A%0Adef get_city_by_coordinates(lon, lat):%0A # TODO: determinate city (reverse geocoding...)%0A return %22MyCity%22%0A
2b1500419e97b75c7b5bda9d8e226ed8340edb50
add experimental python proxy
lotwreport.py
lotwreport.py
Python
0.000001
@@ -0,0 +1,3223 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22%0Alotwreport.py: proxy for ARRL LoTW lotwreport.adi web service, which does not%0Asupport CORS headers and thus cannot be called from a script that is loaded%0Afrom any other server. This CGI must be served from the same host name as%0Aany...
e43ffdc6ce35438b188f84ec34855ac3ff5a4722
Create immhook.py
immhook.py
immhook.py
Python
0.000001
@@ -0,0 +1,1040 @@ +#-------------------------------------------------------------------------------%0A# Name: Immunity debugger Exception Hook%0A# Purpose: The script throws out values of EIP,ESP when a crash exception occours%0A#%0A# Author: darklord%0A#%0A# Created: 19/10/2014%0A# Copyright: (...
9fa0ae7c14bfa0d352bedd5ab7ea92be7736a485
Create classes.py
classes.py
classes.py
Python
0.000001
@@ -0,0 +1,593 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport notelib%0A%0Aclass Student(object):%0A%0A PassedTests = %5B%5D%0A score = 0%0A%0A def __init__(self,name):%0A self.name=name%0A%0A def take_test(self,subject,level):%0A mo = (subject,level)%0A tfiles = %5B%22...
837e4d87e7f01ea50e9b25e5a8a70149ad521361
Save task only if it differs from TW representation
autoload/vimwiki_pytasks.py
autoload/vimwiki_pytasks.py
import vim import re from tasklib.task import TaskWarrior, Task # Unnamed building blocks UUID_UNNAMED = r'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}' SPACE_UNNAMED = r'\s*' NONEMPTY_SPACE_UNNAMED = r'\s+' FINAL_SEGMENT_SEPARATOR_UNNAMED = r'(\s+|$)' # Building blocks BRACKET_OPENING...
Python
0.000031
@@ -3866,24 +3866,132 @@ the Task -%0A + only if the Vimwiki representation%0A # somehow differs%0A # TODO: Check more than description%0A if self.ta @@ -4008,16 +4008,17 @@ ption'%5D +! = self.t @@ -4020,17 +4020,214 @@ elf.text -%0A +:%0A self.task%5B'description'%5D = se...
466edb19fbf6fcfc51e671a80d45320bd8e1717c
add linode_api
linode_api/View_Network_Transfer.py
linode_api/View_Network_Transfer.py
Python
0.000037
@@ -0,0 +1,958 @@ +#!/usr/bin/env python3%0A# -*- coding: UTF-8 -*-%0A%0Aimport json%0Aimport math%0Aimport sys%0Afrom urllib import parse,request%0A %0A%0ALINODE_ID = ''%0ALINODE_TOKEN_RO = ''%0A %0A%0Adef getTransfer(linode_id, argv):%0A url = 'https://api.linode.com/v4/linode/instances/' + linode_id + '/transfer'...
c84e3394ed4829ff9a66167864a11a4ef6a2b62c
Add script to get certificate expiration date
scripts/get_saml_cert_expiration.py
scripts/get_saml_cert_expiration.py
Python
0
@@ -0,0 +1,785 @@ +from cryptography import x509%0Afrom cryptography.hazmat.backends import default_backend%0A%0Afrom bluebottle.clients import properties%0Afrom bluebottle.clients.models import Client%0Afrom bluebottle.clients.utils import LocalTenant%0A%0A%0Adef run(*args):%0A for client in Client.objects.all():%0...
87d3a68e426650ca9cfd0b8d024eaf065d5934b5
Version 0.1.4
background_task/__init__.py
background_task/__init__.py
VERSION = (0, 1, 3) __version__ = '.'.join(map(str, VERSION)) def background(*arg, **kw): from tasks import tasks return tasks.background(*arg, **kw)
Python
0.000001
@@ -14,9 +14,9 @@ 1, -3 +4 )%0A__
3f685e3873c18e1eb28b7a4121c552bbb697e0a4
Add script for generate events.
scripts/generator.py
scripts/generator.py
Python
0
@@ -0,0 +1,1260 @@ +#!/usr/bin/python3%0A%0Afrom random import randint%0A%0Aoutput = %22%22%0Afilename = %22data%22%0A%0A%0Aclass Generator:%0A%0A def gen_date(self):%0A return str(randint(2013, 2015)) + %22-%22 %5C%0A + str(randint(1, 12)) + %22-%22 %5C%0A + str(randint(1, 31))%0A%0A ...
8be49481990096c7a4735807cc3d9611b4ce0780
add migration script
scripts/update_metatable_columns.py
scripts/update_metatable_columns.py
Python
0.000001
@@ -0,0 +1,1241 @@ +from plenario.settings import DATABASE_CONN%0Afrom plenario.database import Base%0Afrom plenario.models import MetaTable%0Afrom sqlalchemy import create_engine, Table%0Afrom sqlalchemy.orm import sessionmaker%0Afrom sqlalchemy.exc import NoSuchTableError%0A%0A%0Adef main():%0A%0A # establish conn...
f5284cc7da9166a43e3cfbd901205f4446295f7a
Add Consumer Product Safety Commission.
inspectors/cpsc.py
inspectors/cpsc.py
Python
0
@@ -0,0 +1,1917 @@ +#!/usr/bin/env python%0A%0Aimport datetime%0Aimport logging%0Aimport os%0Afrom urllib.parse import urljoin%0A%0Afrom bs4 import BeautifulSoup%0Afrom utils import utils, inspector%0A%0A# https://www.cpsc.gov/en/about-cpsc/inspector-general/%0A# Oldest report: 2003%0A%0A# options:%0A# standard since...
79a81b2d1936cd44caabf5f4e38abdee88a8821a
add missing proxy for kiva.agg.plat_support
enthought/kiva/agg/plat_support.py
enthought/kiva/agg/plat_support.py
Python
0
@@ -0,0 +1,51 @@ +# proxy module%0Afrom kiva.agg.plat_support import *%0A
f25a1484892d7b60fb9ffaba033cfb467e1b34f5
Update random-point-in-non-overlapping-rectangles.py
Python/random-point-in-non-overlapping-rectangles.py
Python/random-point-in-non-overlapping-rectangles.py
# Time: O(logn) # Space: O(n) # Given a list of non-overlapping axis-aligned rectangles rects, # write a function pick which randomly and uniformily picks # an integer point in the space covered by the rectangles. # # Note: # - An integer point is a point that has integer coordinates. # - A point on the perimeter of...
Python
0.000007
@@ -1,16 +1,42 @@ # Time: + ctor: O(n)%0A# pick: O(logn)
eb8eabd44764dc26fdbd08ef35b3ea8fc0dd7c54
Add mutt display script
bin/mutt-display.py
bin/mutt-display.py
Python
0
@@ -0,0 +1,862 @@ +#!/usr/bin/env python2%0A%22%22%22%0A Copyright 2011 by Brian C. Lane%0A%22%22%22%0Aimport sys%0Aimport email%0A%0Araw_msg = sys.stdin.read()%0Amsg = email.message_from_string(raw_msg)%0Adate = msg.get('Date', None)%0Aif date:%0A from email.utils import mktime_tz, parsedate_tz, formatdate%0A%0A...
7e8584f9ed3285f16954bc515ecd154c41c5cf08
Update --movie-queue clear to work with last change.
flexget/plugins/cli/movie_queue.py
flexget/plugins/cli/movie_queue.py
import logging from optparse import OptionValueError from sqlalchemy.exc import OperationalError from flexget.utils import qualities from flexget.utils.tools import console, str_to_boolean from flexget.plugin import DependencyError, register_plugin, register_parser_option try: from flexget.plugins.filter.m...
Python
0.000012
@@ -569,16 +569,22 @@ wnloaded +%7Cclear ) %5BNAME%7C @@ -5560,24 +5560,16 @@ eue_del( -imdb_id= item.imd
2957a0331654a22c6f62544b6ec1ca4a4ee86be9
Tweak metainfo_series series name detection.
flexget/plugins/metainfo_series.py
flexget/plugins/metainfo_series.py
import logging from flexget.plugin import * from flexget.utils.titles import SeriesParser import re log = logging.getLogger('metanfo_series') class MetainfoSeries(object): """ Check if entry appears to be a series, and populate series info if so. """ def validator(self): from flexget imp...
Python
0.000012
@@ -1165,46 +1165,8 @@ ta)%0A - data = ' '.join(data.split())%0A @@ -1686,16 +1686,62 @@ , name)%0A + name = ' '.join(name.split())%0A
622405bd6a9b9d175fbd8a2e93d6cfadb7d7940b
Fix typo.
mkdocs/cli.py
mkdocs/cli.py
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals import logging import click import socket from mkdocs import __version__ from mkdocs import build from mkdocs import gh_deploy from mkdocs import new from mkdocs import serve from mkdocs import utils from mkdocs import exceptions from mkdoc...
Python
0.000001
@@ -5332,16 +5332,17 @@ is depr +e cated an
00cc43b3e7a848c17272928f6469beb128e278b4
add linear_regression
projects/NLR_MEG/linear_regression.py
projects/NLR_MEG/linear_regression.py
Python
0.999885
@@ -0,0 +1,809 @@ +#!/usr/bin/env python2%0A# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Tue Jun 26 12:08:31 2018%0A%0A@author: sjjoo%0A%22%22%22%0A#%25%25%0Aimport numpy as np%0Afrom sklearn import linear_model as lm%0Aimport statsmodels.api as sm%0A%0Aimport statsmodels.formula.api as smf%0Aimport pandas as pd%0A...
f20aef828bb7e3a7206cd239ff95c3234391c11c
Add Example 5.1.
Kane1985/Chapter5/Example5.1.py
Kane1985/Chapter5/Example5.1.py
Python
0
@@ -0,0 +1,2087 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22Example 5.1 from Kane 1985.%22%22%22%0A%0Afrom __future__ import division%0Afrom sympy import Dummy, Matrix%0Afrom sympy import expand, solve, symbols, trigsimp%0Afrom sympy.physics.mechanics import ReferenceFrame, Point, dot, dynamicsymbols...
bc691d415d32836f8354582294c6ae11413b0a6a
change version to .dev
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
Python
0.000001
@@ -438,10 +438,14 @@ = '2.0.0 +.dev '%0A
9012cb2aa34d6df32e780555b74581b29cd309b8
add forgotten new module
flexx/ui/_iframe.py
flexx/ui/_iframe.py
Python
0
@@ -0,0 +1,800 @@ +from .. import react%0Afrom . import Widget%0A%0A %0Aclass IFrame(Widget):%0A %22%22%22 An iframe element, i.e. a container to show web-content. Note%0A that some websites do not allow themselves to be rendered in a%0A cross-source iframe.%0A %22%22%22%0A %0A CSS = '.flx-iframe %7Bb...
76c7add3a57810d42e6584ddf22acc027f641a0a
Create classes.py
classes.py
classes.py
Python
0.000001
@@ -0,0 +1,551 @@ +from tkinter import *%0A%0Aclass myClass:%0A%0A def hello(self):%0A self.label.config(text='HelloO!')%0A%0A def __init__(self,master): # this function is always called when object is instantiated%0A frame=Frame(master)%0A frame.pack()%0A%0A self.printBtn = Button(fra...
2ccefe090305e815633f92a6f3d13155e46e7711
Update migrations
app/timetables/migrations/0002_auto_20171005_2209.py
app/timetables/migrations/0002_auto_20171005_2209.py
Python
0.000001
@@ -0,0 +1,2082 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.11 on 2017-10-05 22:09%0Afrom __future__ import unicode_literals%0A%0Aimport django.core.validators%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('timetables', '0001_i...
7f2f0dca532ce3cbcf33720e56a639f78b82e771
add console utility
multivac/console.py
multivac/console.py
Python
0.000001
@@ -0,0 +1,2341 @@ +import sys%0Afrom termcolor import colored%0A%0Afrom multivac.version import version%0Afrom multivac.models import JobsDB%0Afrom multivac.util import format_time%0A%0Aclass Console(object):%0A def __init__(self):%0A self.prompt = colored('multivac%3E ','cyan',attrs=%5B'bold'%5D) %0A ...
f4202292570eb51e52629ad09280175b42598d52
Add Divider class
murasame/divider.py
murasame/divider.py
Python
0.000001
@@ -0,0 +1,1127 @@ +import os%0A%0Aimport pandas as pd%0A%0Afrom . import CONFIG%0A%0Aconf = CONFIG%5B%22divider%22%5D%0A%0A%0Aclass Divider(object):%0A def __init__(self, df, files, base):%0A self.data = df%0A self.files = files%0A self.base = base%0A self.writers = %7B%7D%0A%0A def _...
d03a412e5be455a85ad0a4b624c71bbc30fb1ffb
add a sleep to the autoreload loop since we dont need too high cpu load
pelican/__init__.py
pelican/__init__.py
import argparse import os from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, PdfGenerator) from pelican.settings import read_settings from pelican.utils import clean_output_dir, files_changed from pelican.writers import Writer from pelican import log VERSION = "2.6.0" class ...
Python
0
@@ -18,16 +18,28 @@ mport os +%0Aimport time %0A%0Afrom p @@ -5713,16 +5713,74 @@ break%0A + time.sleep(.5) # sleep to avoid cpu load%0A
7d987220474d76286c49b5378861854a09798a16
create project folder
PowerOutagePredictor/Tree/_init_.py
PowerOutagePredictor/Tree/_init_.py
Python
0.000001
@@ -0,0 +1 @@ +%0A
43d9582172cb268f9c2f38f3cd211bbca06b0741
Create php_webshell.py
php/php_webshell.py
php/php_webshell.py
Python
0
@@ -0,0 +1,1082 @@ +import random%0A%0A#author: pureqh%0A#github: https://github.com/pureqh/webshell%0A%0A%0Ashell = '''%3C?php %0Aclass %7B0%7D%7B3%7D%0A public $%7B1%7D = null;%0A public $%7B2%7D = null;%0A public $%7B6%7D = null;%0A function __construct()%7B3%7D%0A $this-%3E%7B1%7D...
87b597fd5363ca14a8e491ba84bedb4486c6676b
Test __bytes__ special method
python3/jute/test/test_jute_bytes.py
python3/jute/test/test_jute_bytes.py
Python
0.000469
@@ -0,0 +1,2307 @@ +import unittest%0A%0Afrom jute import Interface, Dynamic%0A%0A%0Aclass BytesLike(Interface):%0A%0A def __iter__(self):%0A %22%22%22bytes-like object must be iterable.%22%22%22%0A%0A def __bytes__(self):%0A %22%22%22Return bytes representation.%22%22%22%0A%0A%0Aclass BytesTestMixi...
0b20df518e66e3763a05ca796880c96d8e1d291d
compute covariance of multiple objects
cov_obs.py
cov_obs.py
Python
0.99999
@@ -0,0 +1,2103 @@ +import numpy as np%0Aimport matplotlib.pyplot as plt%0A%0Afrom astropy import constants as c, units as u, table as t%0Afrom astropy.io import fits%0Afrom astropy import coordinates as coords%0A%0Aimport os%0A%0Aimport spec_tools%0Aimport ssp_lib%0Aimport manga_tools as m%0A%0Afrom itertools import i...
5e398ae0d8074a3caf11997884d9f719ef047b15
Define exception for incorrect arguments
soccer/exceptions.py
soccer/exceptions.py
Python
0.005016
@@ -0,0 +1,52 @@ +class IncorrectParametersException(Exception):%0A%09pass
d7020ccb328747922942c56872bcfbec47d451ae
Add cli command class for delete
quilt/cli/delete.py
quilt/cli/delete.py
Python
0
@@ -0,0 +1,2828 @@ +# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:%0A%0A# python-quilt - A Python implementation of the quilt patch system%0A#%0A# Copyright (C) 2012 Bj%C3%B6rn Ricks %3Cbjoern.ricks@googlemail.com%3E%0A#%0A# This library is free software; you can redistribute it and/or%0A# modify it under the terms of ...
8dfd59a639bcf540ea4c5a52e91c5f8a7a198554
Initialize affineKeyTest
books/CrackingCodesWithPython/Chapter14/affineKeyTest.py
books/CrackingCodesWithPython/Chapter14/affineKeyTest.py
Python
0.000001
@@ -0,0 +1,400 @@ +# This program proves that the keyspace of the affine cipher is limited%0A# to less than len(SYMBOLS) %5E 2.%0A%0Aimport affineCipher, cryptomath%0A%0Amessage = 'Make things as simple as possible, but not simpler.'%0Afor keyA in range(2, 80):%0A key = keyA * len(affineCipher.SYMBOLS) + 1%0A%0A ...
b8e36b1a6f8563645413595f8f51aae8c0a91a69
Switch PrefetchWithSlackTest to use TF combinations
tensorflow/python/data/experimental/kernel_tests/prefetch_with_slack_test.py
tensorflow/python/data/experimental/kernel_tests/prefetch_with_slack_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -1140,16 +1140,69 @@ import +combinations%0Afrom tensorflow.python.framework import errors%0Af @@ -1247,58 +1247,8 @@ ops -%0Afrom tensorflow.python.framework import test_util %0Afro @@ -1294,52 +1294,8 @@ t%0A%0A%0A -@test_util.run_all_in_graph_and_eager_modes%0A clas @@ -1377,44 +1377,125 @@ %0A%0A -@...
77094bb723d35fd23d909e0c59b712eeb7612495
Add fibonacci HW
training/level-1-the-zen-of-python/dragon-warrior/Fibonacci/stapp_Fibtest.py
training/level-1-the-zen-of-python/dragon-warrior/Fibonacci/stapp_Fibtest.py
Python
0.999987
@@ -0,0 +1,466 @@ +%22%22%22%0ACompute Fibonacci sequence and learn python.%0ASteve Tapp%0A%22%22%22%0Aimport sys%0Aimport timeit%0A%0Afib_seq = %5B0, 1%5D%0Afib_even_sum = 0%0A%0Afor fibnum in range (2, 50):%0A fib_seq.append(fib_seq%5B-2%5D + fib_seq%5B-1%5D)%0A print (fibnum, fib_seq%5Bfibnum%5D)%0A if fib_...
b1a851d6f5dd47790459564a55405627d9b7a9e4
Add news date and title scrapper from ist's news page.
scripts/webscraping/ist_news_titles.py
scripts/webscraping/ist_news_titles.py
Python
0
@@ -0,0 +1,517 @@ +from urllib.request import urlopen%0Afrom bs4 import BeautifulSoup%0Aimport sys, io%0A%0Asys.stdout = io.TextIOWrapper(sys.stdout.buffer,'cp437','backslashreplace')%0A%0Ahtml = urlopen(%22http://tecnico.ulisboa.pt/pt/noticias/%22)%0AbsObj = BeautifulSoup(html, %22html.parser%22)%0A%0A%0Afor news_wrap...
bd9496bf726aff0472a52d6c5e2a0db96f2af8e2
Add allow_skipped_files option to DJANGO_DEFAULTS
djangae/core/management/__init__.py
djangae/core/management/__init__.py
import os import sys import argparse import djangae.sandbox as sandbox from djangae.utils import find_project_root # Set some Django-y defaults DJANGO_DEFAULTS = { "storage_path": os.path.join(find_project_root(), ".storage"), "port": 8000, "admin_port": 8001, "api_port": 8002, "automatic_restart"...
Python
0.000003
@@ -322,16 +322,52 @@ %22False%22 +,%0A %22allow_skipped_files%22: %22True%22, %0A%7D%0A%0A%0Adef
6317a43baed719bddd84863b750018a6ef1287b0
add new test
test/test_canvas.py
test/test_canvas.py
Python
0.000001
@@ -0,0 +1,226 @@ +import sequana.resources.canvas.bar as bar%0A%0A%0A%0Adef test_bar():%0A%0A data = %5B%0A %7B%22name%22:%22A%22, %22data%22:%7B%22R1%22:10, %22R2%22:90%7D%7D,%0A %7B%22name%22:%22B%22, %22data%22:%7B%22R1%22:90, %22R2%22:10%7D%7D%5D%0A bar.stacked_bar(%22title%22, %22ACGT%22, data...
2d9712f5b1fecb8a1f6c989ed835a9476b5cdab5
Create MeshTextureCoordinates.py
MeshTextureCoordinates.py
MeshTextureCoordinates.py
Python
0.000001
@@ -0,0 +1,1091 @@ +#***********************************************************************************************************#%0A#********* Get normalized 2-D texture coordinates of a mesh object *****************************************#%0A#********* by Djordje Spasic ***********************************************...
09fb916697f28c423c85dad5f77eebaac3c93199
Correct _get_origin_method
smile_action_rule/models/action_rule_decorator.py
smile_action_rule/models/action_rule_decorator.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
Python
0.000261
@@ -2741,22 +2741,22 @@ hasattr( -origin +method , '_orig @@ -2774,22 +2774,22 @@ return -origin +method ._orig%0A @@ -2804,22 +2804,22 @@ hasattr( -origin +method , 'origi @@ -2838,22 +2838,22 @@ return -origin +method .origin%0A
0301a96b8c9592c58fe41eded24a39d503f4fcb2
Create ExtendedJsonRpcApi.py
neo/api/JSONRPC/ExtendedJsonRpcApi.py
neo/api/JSONRPC/ExtendedJsonRpcApi.py
Python
0
@@ -0,0 +1,1802 @@ +from neo.Core.Blockchain import Blockchain%0Afrom neo.api.JSONRPC.JsonRpcApi import JsonRpcApi, JsonRpcError%0Afrom neo.Implementations.Wallets.peewee.UserWallet import UserWallet%0Afrom neocore.UInt256 import UInt256%0Aimport datetime%0A%0A%0Aclass ExtendedJsonRpcApi:%0A %22%22%22%0A Extended...
04e7a43c9516fc9834727c3087863c6282da2dbf
Add tests.py to app skeleton.
lib/rapidsms/skeleton/app/tests.py
lib/rapidsms/skeleton/app/tests.py
Python
0
@@ -0,0 +1,543 @@ +from rapidsms.tests.scripted import TestScript%0Afrom app import App%0A%0Aclass TestApp (TestScript):%0A apps = (App,)%0A%0A # define your test scripts here.%0A # e.g.:%0A #%0A # testRegister = %22%22%22%0A # 8005551212 %3E register as someuser%0A # 8005551212 %3C Registered ...
d358bf3f103069c2f5a85da15331f808df746064
Bump version
oi/version.py
oi/version.py
VERSION = '0.2.1'
Python
0
@@ -10,9 +10,9 @@ '0. -2.1 +3.0 '%0A
19beca7e8166cbab42937ccbd8e9c705ca4913dd
Bump version
oi/version.py
oi/version.py
VERSION = '0.0.1'
Python
0
@@ -10,9 +10,9 @@ '0. -0.1 +1.0 '%0A
6f2a9cbf9e571855074e898d22480d61277a3eda
Add experimental polling DB backend.
django_lightweight_queue/backends/db.py
django_lightweight_queue/backends/db.py
Python
0
@@ -0,0 +1,2272 @@ +import time%0Aimport datetime%0A%0Afrom django.db import connection, models, ProgrammingError%0A%0Afrom ..job import Job%0A%0Aclass DatabaseBackend(object):%0A TABLE = 'django_lightweight_queue'%0A%0A FIELDS = (%0A models.AutoField(name='id', primary_key=True),%0A models.CharFiel...
2498e40294cf56f40fb869d30844c3a8223267a0
Create initdb command
initdb.py
initdb.py
Python
0.000001
@@ -0,0 +1,57 @@ +#!/usr/bin/env python%0Afrom app import db%0Adb.create_all()%0A
3c8eb0563f3997fc068d039b18452eaa98da3122
Add a script useful for downloading large avatar images from Atom feeds
download_avatars.py
download_avatars.py
Python
0
@@ -0,0 +1,1462 @@ +#!/usr/bin/env python3%0Aimport PIL.Image%0Aimport io%0Aimport json%0Aimport requests%0A%0Aimport post_list%0Aimport web_cache%0A%0A%0A# Split this file into two modules, because we need to move web_cache out of%0A# the way between the two steps. (We want to isolate the avatar HTTP requests)%0A# in...
7e1ea3516aa6b4d41748a9ae63464a32ff16e018
Test variable module
extenteten/variable_test.py
extenteten/variable_test.py
Python
0.000001
@@ -0,0 +1,259 @@ +from .util import static_shape, static_rank%0Afrom .variable import variable%0A%0A%0Adef test_variable():%0A shape = %5B123, 456%5D%0A assert static_shape(variable(shape)) == shape%0A%0A initial = %5Bfloat(n) for n in shape%5D%0A assert static_rank(variable(initial)) == 1%0A
58f85213c72b194fe44da36972436c4e7bbdd681
add sina http util
server/crawler/sinawb/SinaHttpUtil.py
server/crawler/sinawb/SinaHttpUtil.py
Python
0.000002
@@ -0,0 +1,2334 @@ +# -*- coding:utf-8 -*-%0A%22%22%22%0AAuthor: AsherYang%0AEmail : ouyangfan1991@gmail.com%0ADate : 2017/11/22%0ADesc : Sina Http Util %E5%8F%82%E8%80%83 Shserver %E5%BE%AE%E5%BA%97 OpenRequest.py%0A%22%22%22%0A%0Atry:%0A from cStringIO import StringIO%0Aexcept ImportError:%0A from StringIO im...
54285887dc96e3d5d98ca4c02df2a04d49ac69f7
Add TeamPermission tests
tests/sentry/api/bases/test_team.py
tests/sentry/api/bases/test_team.py
Python
0
@@ -0,0 +1,2643 @@ +from __future__ import absolute_import%0A%0Afrom mock import Mock%0A%0Afrom sentry.api.bases.team import TeamPermission%0Afrom sentry.models import ApiKey, OrganizationMemberType, ProjectKey%0Afrom sentry.testutils import TestCase%0A%0A%0Aclass TeamPermissionBase(TestCase):%0A def setUp(self):%0A...
aeabc254a09047a58ea5b5c16fb2c5e7e9008691
Test generator expressions
tests/samples/generator_expression.py
tests/samples/generator_expression.py
Python
0.000001
@@ -0,0 +1,1503 @@ +import snoop%0A%0A%0A@snoop(depth=2)%0Adef main():%0A return list(x * 2 for x in %5B1, 2%5D)%0A%0A%0Aif __name__ == '__main__':%0A main()%0A%0Aexpected_output = %22%22%22%0A12:34:56.78 %3E%3E%3E Call to main in File %22/path/to_file.py%22, line 5%0A12:34:56.78 5 %7C def main():%0A12:34:56.7...
8e049c956045b3d5cc37db0041e71b637f556408
add DB migration
migrations/versions/2316c9808a5_.py
migrations/versions/2316c9808a5_.py
Python
0
@@ -0,0 +1,1103 @@ +%22%22%22empty message%0A%0ARevision ID: 2316c9808a5%0ARevises: 26fbbffb991%0ACreate Date: 2015-04-16 13:46:41.849087%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '2316c9808a5'%0Adown_revision = '26fbbffb991'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A%0A...
0ca24ff03f6382c23995f662b678e457a8394140
Add script to bump symbol versions
debian/bump-symbols.py
debian/bump-symbols.py
Python
0
@@ -0,0 +1,1090 @@ +#!/usr/bin/python%0A#%0A# Bump symbol versions of libvirt0%0A%0A# Usage: ./bump-symbol-versions 1.2.16~rc2%0A%0Aimport os%0Aimport re%0Aimport sys%0Aimport shutil%0Aimport subprocess%0A%0A#import gbp.git.GitRepository%0A%0Asymbols_file = 'debian/libvirt0.symbols'%0Asymbols_new_file = symbols_file + ...
4435eb504b10855088f006456dfface89a4a8798
create first easy mixin
easy/admin/mixin.py
easy/admin/mixin.py
Python
0
@@ -0,0 +1,1668 @@ +# coding: utf-8%0Afrom django.conf.urls import url%0Afrom django.contrib import messages%0Afrom django.core.urlresolvers import reverse%0Afrom django.http.response import HttpResponseRedirect%0A%0A%0Aclass MixinEasyViews(object):%0A%0A def get_urls(self):%0A urls = super(MixinEasyViews, se...
a5950853ae7cfe9ac4fce7f297722231feae2f44
switch if/else per David's review comments
plaid/http.py
plaid/http.py
############################################################################## # Helper module that encapsulates the HTTPS request so that it can be used # with multiple runtimes. PK Mar. 14 ############################################################################## import os import urllib # Command line def _reque...
Python
0
@@ -1588,12 +1588,8 @@ if -not _is_ @@ -1615,24 +1615,24 @@ return _ -requests +urlfetch _http_re @@ -1678,32 +1678,32 @@ return _ -urlfetch +requests _http_reques @@ -1716,16 +1716,26 @@ method, data)%0A%0A + %0A%0A
8bf370724f92aef0783cb1d15f1c2a39ca9986c4
define a MEDIA_STREAM_TYPE_AUDIO constant
tests/twisted/jingle/payload-types.py
tests/twisted/jingle/payload-types.py
""" Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=18918 """ from gabbletest import exec_test, make_result_iq, sync_stream, \ send_error_reply from servicetest import make_channel_proxy, unwrap, tp_path_prefix, \ call_async, EventPattern from twisted.words.xish import domish import ji...
Python
0.000017
@@ -365,16 +365,44 @@ t time%0A%0A +MEDIA_STREAM_TYPE_AUDIO = 0%0A %0Adef tes @@ -2376,19 +2376,8 @@ e, %5B -0%5D) # 0 == MEDI @@ -2395,16 +2395,18 @@ PE_AUDIO +%5D) %0A%0A #