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
0df292fbb34a66ee66fce919ea63b68a5f9eff1a
Set up data structures for parsing projects
app/data.py
app/data.py
import json import os from typing import Dict, List from app.util import cached_function class Projects(): def __init__(self) -> None: self.data: Dict[str, Dict[str, Dict[str, str]]] = {} @staticmethod def load() -> 'Projects': current_directory = os.path.dirname(os.path.realpath(__file_...
Python
0.000003
@@ -152,55 +152,38 @@ elf. -data: Dict%5Bstr, Dict%5Bstr, Dict%5Bstr, str%5D%5D +languages: List%5BLanguage %5D = -%7B%7D +%5B%5D %0A%0A @@ -206,24 +206,34 @@ def load +_from_file () -%3E 'Proje @@ -434,24 +434,16 @@ -project_ data = h @@ -445,32 +445,371 @@ a = handle.read( +)%0A parsed_...
75a93ae0e55e240a5f8595c0d58d15b1d846948a
Add support for spectate after starting the game
chillin_server/gui/protocol.py
chillin_server/gui/protocol.py
# -*- coding: utf-8 -*- # python imports from threading import Thread, Lock, Event import sys if sys.version_info > (3,): from queue import Queue else: from Queue import Queue # project imports from ..config import Config from .network import Network from .parser import Parser from .messages import Auth cl...
Python
0
@@ -462,16 +462,53 @@ me_info%0A + self._all_messages_data = %5B%5D%0A @@ -770,16 +770,295 @@ e_info)%0A + i = 0%0A while i %3C len(self._all_messages_data):%0A if not self._send_data(sock, self._all_messages_data%5Bi%5D):%0A self._network.close(sock)%0A ...
880ed36c5014b1d59d51d128cac4b429db82f108
version 0.1.8
pyroomacoustics/version.py
pyroomacoustics/version.py
__version__ = '0.1.7'
Python
0.000001
@@ -16,7 +16,7 @@ 0.1. -7 +8 '%0A
0f598361651d19401d261cc6294bdfc7d6d240bb
Update (in place) when constraint annotations change.
src/puzzle/puzzlepedia/problem_widget.py
src/puzzle/puzzlepedia/problem_widget.py
from typing import ContextManager from ipywidgets import widgets from puzzle.problems import problem from puzzle.puzzlepedia import _bind, _common, annotation_widget, \ debug_data_widget, meta_problem, table_widget from puzzle.puzzlepedia._bind import widget_observable from puzzle.steps import step _MAX_RESULTS = ...
Python
0
@@ -60,16 +60,59 @@ idgets%0A%0A +from puzzle.constraints import constraints%0A from puz @@ -185,16 +185,34 @@ _common, + _widget_util, %5C%0A annotat @@ -2841,133 +2841,179 @@ -for key, value, annotation in group:%0A child_constraints.append(%0A annotation_widget.AnnotationWidget(%0A ...
912b1e33eff873a07ca089c69fef51bf05e79051
Add User and Group to admin custom site
ideas/admin.py
ideas/admin.py
from .models import Idea, Outstanding from django.contrib import admin from django.contrib.admin import AdminSite class MyAdminSite(AdminSite): site_header = "Hackatrix Backend" site_title = "Hackatrix Backend" index_title = "Administrator" class IdeaAdmin(admin.ModelAdmin): list_display = ('name', ...
Python
0
@@ -107,16 +107,67 @@ minSite%0A +from django.contrib.auth.models import User, Group%0A %0A%0Aclass @@ -890,16 +890,69 @@ admin')%0A +admin_site.register(User)%0Aadmin_site.register(Group)%0A admin_si
c0fc14f3f9f33e20650113803f8a0a81dd49f3ec
generate result.json
example_config.py
example_config.py
import os import logging from apscheduler.triggers.cron import CronTrigger if __name__ == "__main__": raise SystemExit("Not meant to be run directly!") def _rsync_cmd(dest): cmd = ("rsync --delete-delay --recursive --times --stats " "'{output}/' '{dest}'") return cmd.format(dest=dest, output="{...
Python
0.998579
@@ -1756,16 +1756,17 @@ mmand%22: +( 'tox -e @@ -1773,16 +1773,82 @@ pelican +--result-json %22%7Boutput%7D/result.json%22 '%0A ' --recrea @@ -1876,16 +1876,17 @@ utput%7D%22' +) ,%0A%0A
917c0c58a0aaa62639d9b98d4aad88b3b8d55d2a
mark as skip
.github/workflows/flexci_dispatcher.py
.github/workflows/flexci_dispatcher.py
#!/usr/bin/env python3 # # FlexCI Dispatcher: Trigger FlexCI based on webhooks. # import argparse import hmac import json import os import re import sys from typing import Any, Dict, Optional, Set import urllib.request import github def _log(msg: str) -> None: sys.stderr.write(msg) sys.stderr.write('\n') ...
Python
0.999995
@@ -5401,22 +5401,39 @@ re -turn 0 +quested_tags = %7B'skip'%7D %0A%0A
5efe24880fd6b3cd796c309c91569af53ac1386b
version 0.0.24
datary/version.py
datary/version.py
#!/usr/bin/env python __version__ = "0.0.23"
Python
0.000001
@@ -39,7 +39,7 @@ .0.2 -3 +4 %22%0A
1db8627731a2e23693cd9fe38a455956b783c0cd
Update NoticiasTecnologicas.py
03-RSSTelegram/NoticiasTecnologicas.py
03-RSSTelegram/NoticiasTecnologicas.py
#!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- """ Ejemplo: Leer Noticias RSS en Telegram (III) Libreria: pyTelegramBotAPI 1.4.2 [ok] Libreria: pyTelegramBotAPI 2.0 [ok] Python: 3.5.1 """ import telebot import sys import feedparser url = "http://blog.bricogeek.com/noticias/arduino/rss/" rss = feedparser.pa...
Python
0
@@ -91,17 +91,16 @@ gram (II -I )%0A%09Libre
f68a10fec5d4dbc743c5d84f8b26d122e81b26e4
Use standard urlencode() for encoding URLs
derpibooru/request.py
derpibooru/request.py
# Copyright (c) 2014, Joshua Stone # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the ...
Python
0.000006
@@ -1465,26 +1465,25 @@ import -quote_plus +urlencode %0Aelse:%0A @@ -1512,261 +1512,45 @@ ort -quote_plus%0A%0A%0Adef join_tags(tags):%0A q = quote_plus(%22,%22.join(tags))%0A%0A return q%0A%0Adef join_parameters(parameters):%0A p = %5B%22%7B%7D=%7B%7D%22.format(k, v) for k, v in parameters.items()%5D%0A%0A ...
8188008cf1bd41c1cbe0452ff635dd0319dfecd9
Add trailing slash to url
derrida/books/urls.py
derrida/books/urls.py
from django.conf.urls import url from django.contrib.admin.views.decorators import staff_member_required from derrida.books.views import ( PublisherAutocomplete, LanguageAutocomplete, InstanceDetailView, InstanceListView ) urlpatterns = [ # TODO: come up with cleaner url patterns/names for autocomplete v...
Python
0.000004
@@ -607,16 +607,17 @@ %3Cpk%3E%5Cd+) +/ $', Inst
60b2d812b71fd6e9ab0b464ee9b3f42a2ef16ed2
fix imports
.config/orcsome/rc.py
.config/orcsome/rc.py
import sys from orcsome import get_wm from orcsome.actions import spawn sys.modules.pop('rsi', None) import rsi TERMINAL = 'urxvtc -title terminal' wm = get_wm() wm.on_key('Shift+Mod+r').restart() wm.on_key('Shift+Mod+c').close() wm.on_key('Shift+Mod+e').spawn('external-monitor') wm.on_key('Ctrl+Alt+x').spawn(TERMI...
Python
0.000015
@@ -34,42 +34,8 @@ t_wm -%0Afrom orcsome.actions import spawn %0A%0Asy @@ -190,16 +190,23 @@ ').close +_window ()%0Awm.on @@ -2495,16 +2495,19 @@ +wm. spawn(TE
66568b681307835aa36da291581eea7e29d22d54
Fix BUG in backfill
backfill.py
backfill.py
import titanic import requests import json import time ''' Status new updated building running done ''' server = 'http://0.0.0.0:8314/' auth = None # auth = ('<username>@mozilla.com', '<password>') def updateJob(jobID, branch, buildername, revision, delta=7): revList, buildList = titanic.runA...
Python
0.000073
@@ -2175,22 +2175,16 @@ e'%5D, rev -, auth ):%0A
c4ea3ce306d4464ac0bc80286a60689972c7bc63
Test isolation.
agon/tests.py
agon/tests.py
from threading import Thread from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.contrib.auth.models import User from agon.models import award_points, points_awarded class PointsTestCase(TestCase): def setUp(self): self....
Python
0
@@ -452,24 +452,147 @@ %5D%0A %0A + def tearDown(self):%0A if hasattr(settings, %22AGON_POINT_VALUES%22):%0A del settings.AGON_POINT_VALUES%0A %0A def setu @@ -1435,32 +1435,97 @@ = self.users%5B0%5D%0A + self.setup_points(%7B%0A %22TEST_1%22: 10,%0A %7D)%...
4d4b497dcc6afeffcc9455ac6013a35c824bc876
Update docstring for new host argument
depot/io/awss3.py
depot/io/awss3.py
""" Provides FileStorage implementation for MongoDB GridFS. This is useful for storing files inside a mongodb database. """ from __future__ import absolute_import from datetime import datetime import uuid from boto.s3.connection import S3Connection from depot._compat import unicode_text from .interfaces import File...
Python
0
@@ -1666,18 +1666,27 @@ ucket%60%60 -t o +n %60%60host%60%60 which D @@ -1689,16 +1689,20 @@ ch Depot +%0A connect @@ -1702,20 +1702,16 @@ connects -%0A to usin @@ -1756,16 +1756,78 @@ s_key%60%60. + If %60%60host%60%60 is%0A omitted the Amazon AWS S3 storage is used. %0A%0A %22%22
ac084c574b58771bd240af3fa4b4a000fc742229
update to handle different kinds of files
projects/allan_cont/showlog_long.py
projects/allan_cont/showlog_long.py
import numpy as np import pylab as pl from ourgui import openFile def plotline(maxx, minx=0, value=0, style="k-", plotfunc=pl.plot): plotfunc([minx, maxx], [value, value], style) def quickplot(filename): data = np.loadtxt(filename, comments="#") maxdata, mindata, stddata, meandata = np.max(data),...
Python
0
@@ -215,16 +215,19 @@ ):%0D%0A +all data = n @@ -258,17 +258,199 @@ ents=%22#%22 -) +, delimiter=%22,%22)%0D%0A datashape = np.shape(alldata)%0D%0A try:%0D%0A col = np.shape(alldata)%5B1%5D%0D%0A data = alldata%5B:, col-1%5D%0D%0A except (IndexError):%0D%0A data = alldata%0D%0A %0D...
5dd73ca95ff06a7b53309def5fea3a4ec9692b3f
添加 company 邮箱验证测试数据
core/tests/test_core.py
core/tests/test_core.py
# -*- coding: utf-8 -*- from odoo.tests.common import TransactionCase from psycopg2 import IntegrityError from odoo.exceptions import UserError class TestCore(TransactionCase): def test_partner(self): ''' 测试删除已有客户的分类报错 ''' return # 测试已通过,但会在log里报ERROR,所以暂时去掉 with self.assertRaise...
Python
0
@@ -136,16 +136,32 @@ serError +,ValidationError %0A%0A%0Aclass @@ -3377,8 +3377,395 @@ %7D)%0A +%0A def test_check_email(self):%0A ''' test check email '''%0A company = self.env%5B'res.company'%5D.create(%7B%0A 'name': 'demo company',%0A 'partner_id': self.env.ref('core.z...
47854856322cc16bbfeb96a581208d41e6c4466e
return from dumps
mifkit/mif.py
mifkit/mif.py
import json import objects from mifkit.util.mif_encoder import MifEncoder from mifkit.util.case import keys_to_snake_case from mifkit.util.case import to_capitalized_camel_case def dump(mif_object, fp, **kwargs): """ Convert this object into a JSON-encoded string and save it in a file. :param mif_object:...
Python
0
@@ -596,32 +596,39 @@ ().%0A %22%22%22%0A +return json.dump(mif_ob @@ -960,16 +960,23 @@ %22%22%22%0A +return json.dum
c206936120519912762f30eb269f1733b5593bf8
fix window edges
contrib/spryte/balls.py
contrib/spryte/balls.py
import random from pyglet import window, clock, gl, event from pyglet.window import key import spryte win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) layer = spryte.Layer() balls = [] for i in range(200): balls.append(spryte.Sprite('ball.png', layer, win.width * random.ran...
Python
0.000001
@@ -283,32 +283,33 @@ layer,%0A +( win.width * rand @@ -293,32 +293,38 @@ (win.width + - 64) * random.random @@ -319,32 +319,33 @@ andom.random(), +( win.height * ran @@ -330,32 +330,38 @@ m(), (win.height + - 64) * random.random @@ -575,16 +575,29 @@ ball.x ++ ball.width %3E win.wi @@ -6...
b77cb1ac7524e76fd1f29ee6c8e214d12d04226f
Improve variable names.
scripts/gen_regex.py
scripts/gen_regex.py
import unicodedata from ftfy import chardata import pathlib from pkg_resources import resource_filename CATEGORIES = [unicodedata.category(chr(i)) for i in range(0x110000)] DATA_PATH = pathlib.Path(resource_filename('wordfreq', 'data')) def func_to_regex(func): """ Given a function that returns True or Fals...
Python
0.999999
@@ -248,24 +248,31 @@ nc_to_regex( +accept_ func):%0A %22 @@ -765,14 +765,27 @@ for -i, cat +codepoint, category in @@ -822,14 +822,29 @@ if -func(i +accept_func(codepoint ):%0A @@ -866,33 +866,41 @@ entative_end == -i +codepoint - 1:%0A @@ -921,17 +921,25 @@ 1%5D%5B1%5D = -i +codepoint ...
0d44fd6ae6f8a7d51cbb6933c9fddda1b2f61f8b
Remove debug statement
extract_scales.py
extract_scales.py
#!/usr/bin/env python import json from lxml import etree ZOOM = [ 559082264, 279541132, 139770566, 69885283, 34942642, 17471321, 8735660, 4367830, 2183915, 1091958, 545979, 272989, 136495, 68247, 34124, 17062, 8531, 4265, 2133, 1066, ...
Python
0.000021
@@ -6227,40 +6227,4 @@ le)%0A -%0A import pdb%0A pdb.set_trace()%0A
b9c7ea4613773d7414acca2e066b174447b0d75a
Fix conf_name handling in fabd.conf
fabdeploy/fabd.py
fabdeploy/fabd.py
import os import shutil import logging from fabric.api import env, run, sudo, puts, abort from . import users, ssh from .containers import conf as conf_dec from .task import Task __all__ = [ 'mkdirs', 'remove_src', 'debug', 'conf', 'default_conf', 'create_user', 'create_configs', ] log...
Python
0.00028
@@ -2041,16 +2041,17 @@ .conf')%0A +%0A @@ -2059,24 +2059,29 @@ f self.conf. +conf_ name == 'def
960618782d81035dd9671c973ad6d95c55ff6534
Use the firefox capabilities if wires exist
tests/functional_tests_gerrit.py
tests/functional_tests_gerrit.py
#!/bin/env python import unittest import os import yaml from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.desired_capabilities import DesiredCap...
Python
0.000001
@@ -1189,16 +1189,122 @@ refox')%0A + cls._browser = webdriver.Firefox(capabilities=firefox_capabilities)%0A else:%0A @@ -2200,12 +2200,13 @@ ser. -quit +close ()%0A%0A
439b977b14b12d42ee886a432f3a4af555d8de10
add storage stuctures
minMaxCalc.py
minMaxCalc.py
import pandas as pd # read in dataset xl = pd.ExcelFile("data/130N_Cycles_1-47.xlsx") df = xl.parse("Specimen_RawData_1") df """ This is what the dataset currently looks like - it has 170,101 rows and two columns. The dataset contains data from 47 cycles following an experiment. The output of these experiments form...
Python
0
@@ -2622,71 +2622,62 @@ %0A -df = pd.DataFrame(data, columns=%5B'Time', 'Load', 'Max', 'Min'%5D)%0Adf%0A +# create db model%0Adb = %5B%5D%0A%0A# create cache store%0Acache = %5B%5D
642cd34041a579fa37ea3790143d79842c7141f3
add implementation for all makers
ismrmrdpy/backend/acquisition.py
ismrmrdpy/backend/acquisition.py
# -*- coding: utf-8 -*- # # Copyright (c) 2014-2015, Ghislain Antony Vaillant # All rights reserved. # # This file is distributed under the BSD License, see the LICENSE file or # checkout the license terms at http://opensource.org/licenses/BSD-2-Clause). from __future__ import absolute_import, division, print_function...
Python
0
@@ -371,167 +371,1248 @@ gs, -acquisition_header_dtype%0A%0A%0Adef make_header(*args, **kwargs):%0A pass%0A%0Adef make_dtype(header):%0A pass%0A%0Adef make_array(header=None, *args, **kwargs):%0A pass +DataTypes%0Afrom .constants import acquisition_header_dtype, ismrmrd_to_numpy_dtypes%0Aimport numpy%0A%0A%0...
72067069138ce9568c06140d23bd07cc6741a30e
Test case can't throw away windows, it needs shared context space to continue. XXX fix this in pyglet, ideally.
tests/resource/RES_LOAD_IMAGE.py
tests/resource/RES_LOAD_IMAGE.py
#!/usr/bin/python # $Id:$ import os import sys import unittest from pyglet.gl import * from pyglet import image from pyglet import resource from pyglet import window __noninteractive = True # Test image is laid out # M R # B G # In this test the image is sampled at four points from top-right cloc...
Python
0.000001
@@ -613,24 +613,25 @@ ):%0D%0A +# self.w.close @@ -633,16 +633,30 @@ close()%0D +%0A pass%0D %0A%0D%0A d
a80e063a4afb65018a8b137f1909956839f42767
Test default search context
tests/sentry/interfaces/tests.py
tests/sentry/interfaces/tests.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import pickle from sentry.interfaces import Interface, Message, Query, Stacktrace from sentry.models import Event from sentry.testutils import TestCase, fixture class InterfaceBase(TestCase): @fixture def event(self): return Event( ...
Python
0.000001
@@ -874,16 +874,131 @@ == ''%0A%0A + def test_get_search_context_default(self):%0A assert self.interface.get_search_context(self.event) == %7B%7D%0A%0A %0Aclass M
59ba038f117744ca0c5fe8c24b97b64830f8e7ec
Put bulk data into db
court_bulk_collector.py
court_bulk_collector.py
from courtreader import readers from courtutils.logger import get_logger from datetime import datetime, timedelta import pymongo import os import sys import time # configure logging log = get_logger() log.info('Worker running') def get_db_connection(): return pymongo.MongoClient(os.environ['MONGO_DB'])['va_court_...
Python
0.000004
@@ -443,17 +443,24 @@ type = ' -R +criminal '%0Ayear = @@ -527,101 +527,38 @@ )%0A%0Ad -ate = datetime(year, 12, 31)%0Awhile date.year == year:%0A dateStr = date.strftime('%25m/%25d/%25Y') +ef get_cases_on_date(dateStr): %0A @@ -937,16 +937,56 @@ tcnow()%0A + case%5B'court_fips'%5D = court_fips%0A ...
6e61156b00759a05321d65c50bb223cfa46b97bc
add fuzzing test for ZstdCompressor.compressobj()
tests/test_compressor_fuzzing.py
tests/test_compressor_fuzzing.py
import io import os try: import unittest2 as unittest except ImportError: import unittest try: import hypothesis import hypothesis.strategies as strategies except ImportError: raise unittest.SkipTest('hypothesis not available') import zstd from . common import ( make_cffi, random_input_d...
Python
0
@@ -2082,32 +2082,1144 @@ ), ref_frame)%0A%0A%0A +@unittest.skipUnless('ZSTD_SLOW_TESTS' in os.environ, 'ZSTD_SLOW_TESTS not set')%0A@make_cffi%0Aclass TestCompressor_compressobj_fuzzing(unittest.TestCase):%0A @hypothesis.given(original=strategies.sampled_from(random_input_data()),%0A level=str...
fa6cecee83ce90b95b35dd96ebd9dced71189578
Simplify block and debug log true pid
instana/fsm.py
instana/fsm.py
import subprocess import os import psutil import socket import threading as t import fysom as f import instana.log as l import instana.agent_const as a class Discovery(object): pid = 0 name = None args = None fd = -1 inode = "" def __init__(self, **kwds): self.__dict__.update(kwds) ...
Python
0.000521
@@ -3738,36 +3738,32 @@ , d)%0A if -not b:%0A l @@ -3765,128 +3765,186 @@ -l.error(%22Cannot announce sensor. Scheduling retry.%22)%0A self.schedule_retry(self.announce_sensor, e, %22announce%22 +self.agent.set_from(b)%0A self.fsm.ready()%0A l.warn(%22Host ag...
8c0dc68c41137cd809d4403045834ab4f876294c
Add small test for parsing the Var datashape
tests/test_datashape_creation.py
tests/test_datashape_creation.py
import blaze from blaze import datashape import numpy as np import unittest class TestDatashapeCreation(unittest.TestCase): def test_raise_on_bad_input(self): # Make sure it raises exceptions on a few nonsense inputs self.assertRaises(TypeError, blaze.dshape, None) self.assertRaises(TypeEr...
Python
0.000001
@@ -2677,16 +2677,135 @@ 32 %7D')%0A%0A + def test_ragged_array(self):%0A self.assertTrue(isinstance(blaze.dshape('3, Var, int32')%5B1%5D, datashape.Var))%0A%0A if __nam
55bff70c3dabe5251ed23720c9f2491cc8bd1ed1
Add support for django 1.8+
favit/managers.py
favit/managers.py
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import get_model def _get_content_type_and_obj(obj, model=None): if isinstance(model, basestring): model = get_model(*model.split(".")) if isinstance(obj, (int, long))...
Python
0.000007
@@ -504,24 +504,151 @@ ects%0A %22%22%22 +%0A from django import VERSION%0A if VERSION %3E (1,8):%0A def get_query_set(self):%0A return self.get_queryset() %0A%0A def fo
e3a9db58f03eb73635a94ed6249e3c2a308f4ad0
Fix some typos found in staging.
fedmsg_genacls.py
fedmsg_genacls.py
# -*- coding: utf-8 -*- """ A fedmsg consumer that listens to pkgdb messages to update gitosis acls Authors: Janez Nemanič <janez.nemanic@gmail.com> Ralph Bean <rbean@redhat.com> """ import pprint import subprocess import os import fedmsg.consumers import moksha.hub.reactor class GenACLsConsumer(fed...
Python
0.000004
@@ -1604,17 +1604,17 @@ ing on %25 -r +s %22 %25 ppri @@ -1636,16 +1636,201 @@ ages))%0A%0A + # This script and the UID/GID are found in our puppet repo.%0A # The fedmsg user must be given passwordless sudo as the gen-acls user%0A # for this to work correctly.%0A @@ -1978,20 +1978,23 @...
a2475c22f15e565f1a64022fa6b7a1ba791b8ced
Test the empty case
tests/testapp/tests/test_page.py
tests/testapp/tests/test_page.py
from __future__ import absolute_import, unicode_literals from django.contrib.auth.models import User from django.test import TestCase # from django.utils import timezone try: from django.urls import reverse except ImportError: # pragma: no cover from django.core.urlresolvers import reverse from content_edit...
Python
1
@@ -3446,32 +3446,329 @@ ge%5D,%0A )%0A%0A + with self.assertNumQueries(2):%0A content = MPTTContentProxy(child, plugins=%5BPageText%5D)%0A self.assertEqual(%0A content.main,%0A %5B%5D,%0A )%0A self.assertEqual(%0A c...
d5e418e24990c2b7294f3fd6fd8ef94819ddfe66
Allow regular users to view any feedback issue that is public.
feedback/views.py
feedback/views.py
from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.views.generic import ListView, DetailView, CreateView, UpdateView from .forms import IssueForm, IssueUpdateStatusForm, CommentForm from .models import Issue, Discussion class LoginRequiredMixin(object):...
Python
0
@@ -173,16 +173,47 @@ dateView +%0Afrom django.db.models import Q %0A%0Afrom . @@ -987,16 +987,18 @@ .filter( +Q( user=sel @@ -1012,16 +1012,34 @@ st.user) + %7C Q(public=True)) %0A%0A%0Aclass
d6342967598ae7fa822592b42e0f85de2beaf916
use constants
tests/twisted/test-self-alias.py
tests/twisted/test-self-alias.py
# # Test alias setting for the self handle # from sofiatest import exec_test from servicetest import tp_name_prefix import dbus TEXT_TYPE = tp_name_prefix + '.Channel.Type.Text' ALIASING_INTERFACE = tp_name_prefix + '.Connection.Interface.Aliasing' CONTACTS_INTERFACE = tp_name_prefix + '.Connection.Interface.Contact...
Python
0.00001
@@ -75,252 +75,43 @@ est%0A -from servicetest import tp_name_prefix%0A%0Aimport dbus%0A%0ATEXT_TYPE = tp_name_prefix + '.Channel.Type.Text'%0AALIASING_INTERFACE = tp_name_prefix + '.Connection.Interface.Aliasing'%0ACONTACTS_INTERFACE = tp_name_prefix + '.Connection.Interface.Contacts' +import constants as cs%0A%0Aimpo...
16abb3720d9c41b130ea83a4b678ec99521567eb
Fix Grid unit test
tests/unit/analysis/test_grid.py
tests/unit/analysis/test_grid.py
# """Unit tests for cartoframes.analysis.grid""" import os import pytest import numpy as np from pandas import read_csv from geopandas import GeoDataFrame from shapely.geometry import box, shape from cartoframes.utils import decode_geometry from cartoframes.analysis.grid import QuadGrid from geopandas.testing impor...
Python
0
@@ -221,22 +221,19 @@ import -decode +set _geometr @@ -1832,21 +1832,16 @@ gdf -_test = GeoDa @@ -1856,23 +1856,36 @@ df, -geometry=decode +crs='epsg:4326')%0A set _geo @@ -1894,36 +1894,33 @@ try( +g df -%5B +, 'geom' -%5D), crs='epsg:4326' +, inplace=True )%0A @@ -1935,21 +1935,16 @@ tur...
2877e2722ba99aaa5ee41f9f063629efbfc75bf5
store radosgw_agent server/port
teuthology/task/radosgw-agent.py
teuthology/task/radosgw-agent.py
import contextlib import logging import argparse from ..orchestra import run from teuthology import misc as teuthology import teuthology.task_util.rgw as rgw_utils log = logging.getLogger(__name__) def run_radosgw_agent(ctx, config): """ Run a single radosgw-agent. See task() for config format. """ r...
Python
0.000003
@@ -4000,32 +4000,176 @@ client=client))%0A + # Stash the radosgw-agent server / port # for use by subsequent tasks %0A ctx.radosgw_agent.endpoint = (client, str(port))%0A else:%0A
42599f84c68821695b2d378f7261e4c74095272f
Should be logger.debug
thumbor/storages/file_storage.py
thumbor/storages/file_storage.py
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import os from shutil import move from json import dumps, loads from ...
Python
0.999486
@@ -1880,13 +1880,13 @@ ger. -error +debug ('St
ae896f3c8eaa7fa9863a862f0679065348a7b971
Remove obsolete argument from workflow cli
src/tmlib/tmaps/args.py
src/tmlib/tmaps/args.py
from ..args import Args class TmapsSubmitArgs(Args): def __init__(self, **kwargs): ''' Initialize an instance of class TmapsSubmitArgs. Parameters ---------- **kwargs: dict arguments as key-value pairs ''' self.stage = self._stage_params['defau...
Python
0.000003
@@ -2120,719 +2120,4 @@ %7D%0A -%0A @property%0A def backup(self):%0A '''%0A Returns%0A -------%0A bool%0A indicator that an existing session should be overwritten%0A (default: %60%60False%60%60)%0A '''%0A return self._backup%0A%0A @backup.sett...
82921fb53db2b6e7fdd731f23addd413a6f87673
Add function to sign SSH key
misc/sshca.py
misc/sshca.py
#!/usr/bin/python import confluent.collective.manager as collective import eventlet.green.subprocess as subprocess import glob import os def normalize_uid(): curruid = os.getuid() neededuid = os.stat('/etc/confluent').st_uid if curruid != neededuid: os.setuid(neededuid) if os.getuid() != n...
Python
0
@@ -130,16 +130,46 @@ mport os +%0Aimport shutil%0Aimport tempfile %0A%0Adef no @@ -1529,16 +1529,548 @@ e(ckh)%0A%0A +def sign_host_key(pubkey, nodename):%0A tmpdir = tempfile.mkdtemp()%0A try:%0A pkeyname = os.path.join(tmpdir, 'hostkey.pub')%0A with open(pkeyname, 'w') as pubfile:%0A ...
0a57bcc2faca88d0527bb1f14dae2b0b9b5168f2
bump filer version to 0.9pbs.54
filer/__init__.py
filer/__init__.py
#-*- coding: utf-8 -*- # version string following pep-0396 and pep-0386 __version__ = '0.9pbs.53' # pragma: nocover
Python
0
@@ -88,17 +88,17 @@ 0.9pbs.5 -3 +4 ' # pra
006cbb88f2a06cd1411f88126ccf4a43121aa858
Update app startup process with new servicemanager and websocket communication.
app/main.py
app/main.py
""" The main module for HomePiServer. Initializes SocketIO, ServiceManager, NavigationChannel, View Manager. """ import signal from threading import Thread from gevent import monkey from flask import Flask from flask_socketio import SocketIO from .controllers import CONTROLLERS from .core.socketchannel import Navig...
Python
0
@@ -291,103 +291,111 @@ ore. -socketchannel import NavigationChannel%0Afrom .core.logger import configure_logging +logger import configure_logging%0Afrom .core.websocket_manager import WebSocketManager %0Afrom +.core .service s im @@ -390,17 +390,23 @@ .service -s +manager import @@ -423,49 +423,39 @@ ager -,...
7202f65e2a59f913b70a09e5b8352f91a68e98c2
add pandas
Python/create_climatology/createclim_ts_template.py
Python/create_climatology/createclim_ts_template.py
""" Create SubX daily climatology. The file is filled in by generate_ts_clim.ksh. """ import os import xarray as xr import numpy as np # Inputs outPath = 'outdir' ft = 'ftype' mo = 'mod' ins = 'inst' va = 'var' pl = plev yv = lat.0 xv = lon.0 subsampletime = subsampleS starttime = 'startS' endtime = 'endS' ysave = ...
Python
0.999689
@@ -129,16 +129,36 @@ y as np%0A +import pandas as pd%0A %0A%0A# Inpu
19dbb6c960d299acf813e96a102a4e14ef7b3ef8
make N/A case references just blank [skip ci]
custom/enikshay/management/commands/base_data_dump.py
custom/enikshay/management/commands/base_data_dump.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import csv import tempfile from datetime import datetime from django.core.management.base import BaseCommand from django.urls import reverse from couchexport.models import Format from corehq.blobs import get_blob_db from corehq.form_processor.i...
Python
0.000001
@@ -3950,19 +3950,16 @@ ame%5D = %22 -N/A %22%0A
cbcc75a495851c1c8bacdeaf0ade5952fc19c3f3
enhance reference title
doc/source/conf.py
doc/source/conf.py
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
Python
0
@@ -1909,20 +1909,27 @@ title%22: -name +%22 %22.join(%5Bn .capital @@ -1933,16 +1933,91 @@ talize() +%0A for n in name.split(%22_%22)%5D) ,%0A
8d8dec3dba4db223fc0254d11d3a81d9c079a9d1
Change request var name
dockci/handlers.py
dockci/handlers.py
""" Handlers for Flask, and Flask plugins """ import json import logging import jwt import rollbar from flask import (abort, flash, got_request_exception, redirect, request, request_finished, Response, ...
Python
0.000002
@@ -2229,32 +2229,15 @@ (req -): # has request as arg +uest_): %0A @@ -2539,16 +2539,21 @@ (req +uest_ .remote_ @@ -3135,16 +3135,21 @@ hash(req +uest_ ))%0A%0A
a0a92e237ca91dc8f0318a27dfeec9b9c8e95de5
Add utility to guess livelock file for an owner
lib/utils/livelock.py
lib/utils/livelock.py
# # # Copyright (C) 2014 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
Python
0.000116
@@ -1034,16 +1034,55 @@ t time%0A%0A +from ganeti.utils.algo import NiceSort%0A from gan @@ -1758,12 +1758,491 @@ kfile.name)%0A +%0A%0Adef GuessLockfileFor(name):%0A %22%22%22For a given name, take the latest file matching.%0A%0A @return: the file with the latest name matching the given%0A prefix in LIVELOCK...
27b0b1cf34ea21b48cb2ae3669ee3d6c44b73bf6
Allow smoketest.py to load a different test list
scripts/smoketest.py
scripts/smoketest.py
#!/usr/bin/python import os import pbutil import progress import re import subprocess import sys import configtool import time import shutil from xml.dom.minidom import parse CHECK=True check_exclude=[ "convolution/Convolution", # Difference "multiply/strassen", # Difference, why?...
Python
0.000001
@@ -5424,16 +5424,177 @@ lt=None) +%0Aparser.add_option(%22--testlist%22, type=%22string%22, help=%22name of the file containing the list of tests to be run%22, default=%22./scripts/smoketest.tests%22) %0A%0A(optio @@ -5948,35 +5948,24 @@ rks( -%22./scripts/smoketest +options .test -s%22 +list , ar
ea97edc9937119c4a3c00123b0cd54e2cdb33fb6
Update document
chainer/functions/util/forget.py
chainer/functions/util/forget.py
import chainer from chainer import function from chainer import function_node from chainer import variable def _call_func(func, xs): outs = func(*xs) if isinstance(outs, tuple): for i, out in enumerate(outs): if isinstance(out, variable.Variable): continue n = ...
Python
0
@@ -4543,24 +4543,518 @@ opagation.%0A%0A + .. note::%0A%0A If you want to use %60%60F.forget%60%60 to a link which updates the link's%0A internal information every time the forward computation is called,%0A please ensure that the information is updated just once in a single%0A iteration...
f431f2408ca1e1a38479a9ac1224bd608df1c0d4
Test build.source rather than legacy attributes
changes/listeners/green_build.py
changes/listeners/green_build.py
import logging import requests from datetime import datetime from flask import current_app from changes.config import db from changes.constants import Result from changes.db.utils import create_or_update from changes.models import ( Build, Event, EventType, ProjectOption, RepositoryBackend ) from changes.utils.ht...
Python
0
@@ -1249,16 +1249,23 @@ f build. +source. patch_id @@ -1274,24 +1274,31 @@ r not build. +source. revision_sha
1bc98a6f8a2f4a77a465147fd0b9cf3c6ef9edba
Remove dead 'first' parameter.
api/common.py
api/common.py
#!/usr/bin/python # Copyright (C) 2012 Humbug, Inc. # # 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, merg...
Python
0
@@ -6477,47 +6477,8 @@ ne:%0A - options%5B%22first%22%5D = %220%22%0A
a281fd3c49b86012fd370ae82df19525af89ff1c
Disable swift test
parsl/tests/test_swift.py
parsl/tests/test_swift.py
import pytest import parsl from parsl import * parsl.set_stream_logger() from parsl.executors.swift_t import * def foo(x, y): return x * y def slow_foo(x, y): import time time.sleep(x) return x * y def bad_foo(x, y): time.sleep(x) return x * y @pytest.mark.local def test_simple(): ...
Python
0.000004
@@ -272,16 +272,58 @@ x * y%0A%0A%0A +@pytest.mark.skip('fails intermittently')%0A @pytest. @@ -325,32 +325,32 @@ test.mark.local%0A - def test_simple( @@ -558,32 +558,74 @@ test.mark.local%0A +@pytest.mark.skip('fails intermittently')%0A def test_slow(): @@ -855,24 +855,24 @@ at(total)%0A%0A%0A - @pytest.mark ...
e9980d7498c0889ecd795a4d2977c1893e0ad7e3
comment on md5 usage
app/util.py
app/util.py
import bcrypt import md5 def hash_pwd(password): return bcrypt.hashpw(password, bcrypt.gensalt()) def check_pwd(password, hashed): return bcrypt.hashpw(password, hashed) == hashed def validate_time(time): return True def gravatar_html(email): h = md5.md5(email.lower()).hexdigest() html = '<img...
Python
0
@@ -228,16 +228,57 @@ True %0A%0A +# XXX md5 module deprecated, use hashlib%0A def grav
1d443973e8db6265268dd2afe6b6ad7748526335
Add _read_test_file() function.
ipymd/utils.py
ipymd/utils.py
# -*- coding: utf-8 -*- """Utils""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os import os.path as op import difflib from .six import exec_ #--------------------------------------...
Python
0.000001
@@ -959,24 +959,177 @@ t', None)%0A%0A%0A +def _read_test_file(filename):%0A %22%22%22Read a test file.%22%22%22%0A path = _test_file_path(filename)%0A with open(path, 'r') as f:%0A return f.read()%0A%0A%0A def _diff_re
95ad2c65fb1b4aacea668c8d9474183b4f107d56
Test with multi args
paver/tests/test_shell.py
paver/tests/test_shell.py
import sys from paver.deps.six import b from mock import patch, Mock from paver import easy from subprocess import PIPE, STDOUT @patch('subprocess.Popen') def test_sh_raises_BuildFailure(popen): popen.return_value.returncode = 1 popen.return_value.communicate.return_value = [b('some stderr')] try: ...
Python
0
@@ -704,20 +704,21 @@ ('paver. -easy +shell .error') @@ -2242,28 +2242,302 @@ args%5B1%5D%5B'stderr'%5D == STDOUT%0A +%0A@patch('subprocess.Popen')%0Adef test_sh_with_multi_command(popen):%0A popen.return_value.returncode = 0%0A%0A easy.sh(%5B'foo', ' bar', 'fi%22zz'%5D)%0A%0A assert popen.called%0A asse...
d329787dc6f862e749ca6f490a155186b48553a7
Fix one more bug; interpreter still broken
bfinterp.py
bfinterp.py
import sys import collections import getch from parser import parse, optimize from parser import OUTPUT, INPUT, LOOPSTART, LOOPEND, MOVE from parser import ADD, SET, MULCOPY, SCAN BUFSIZE = 8192 def interp(code): tokens = parse(code) tokens = optimize(tokens) i = 0 loops = [] mem = bytearray(BUF...
Python
0
@@ -606,24 +606,43 @@ oop = False%0A + i += 1%0A
47cf1fd8990d6b791d0a6847500abcf14ab46064
Fix on_new_event
mods/email.py
mods/email.py
from django.conf.urls import url from django.http import HttpResponse, Http404 from django.core.urlresolvers import reverse from django.core.exceptions import PermissionDenied from django.template import Template, Context from mod import PatchewModule import smtplib import email import uuid import traceback from api.mo...
Python
0
@@ -2741,16 +2741,23 @@ nt(self, + event, name, p
fe785a6c7f9ea5232cfda964fa155c1ccdee3af0
remove unused import
samples/python/uff_ssd/utils/model.py
samples/python/uff_ssd/utils/model.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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
@@ -767,24 +767,8 @@ le%0A%0A -import requests%0A impo
7048bb1e378df0458b0a721ed056428d8688f067
add requirement and decoding
molprobity.py
molprobity.py
#!/usr/bin/env python # Copyright 2013, Joao Rodrigues """ Python script to assign histidine protonation states using Molprobity / Reduce. Joao Rodrigues @ 2013 Adapted from Sjoerd's WHATIF code syntax: molprobity.py <PDB-file> """ import io import os import sys import subprocess import tempfile def _chec...
Python
0
@@ -303,16 +303,90 @@ mpfile%0A%0A +if sys.version_info%5B0%5D %3C 3:%0A print(%22Python 3+ needed%22)%0A sys.exit()%0A%0A %0Adef _ch @@ -4961,16 +4961,23 @@ .decode( +'utf-8' )%0A
2d3c0f8072a90b9531d581ddf1b8c980310dd08c
Connect to s3 on every request.
moneypenny.py
moneypenny.py
#!/usr/bin/python """ A Flask app to post visitor information to reddit. Requirements: * Envoy account (https://signwithenvoy.com/) * reddit account (http://www.reddit.com/) * PRAW library (https://github.com/praw-dev/praw/) """ from babel.dates import format_datetime from ConfigParser import RawConfigPar...
Python
0
@@ -922,55 +922,8 @@ et%22) -%0As3 = boto.connect_s3(s3_key_id, s3_secret_key) %0A%0A# @@ -2752,16 +2752,71 @@ == 200:%0A + s3 = boto.connect_s3(s3_key_id, s3_secret_key)%0A
4cd44a177147569767a8f53aed67cbee0f759667
bump verion to 3.0.0-alpha
pyani/__init__.py
pyani/__init__.py
# python package version # should match r"^__version__ = '(?P<version>[^']+)'$" for setup.py """Module with main code for pyani application/package.""" __version__ = '0.3.0.dev'
Python
0.000001
@@ -169,10 +169,12 @@ .3.0 -.dev +-alpha '%0A
a176d3609e0b7f0523320322ce364544b64f8721
Update contribution team (#13472)
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,52 +331,63 @@ = %5B' -adi88d', 'Noy-Maimon', 'Bargenish', 'yaakovi +Itay4', 'yaakovpraisler', 'Shellyber', 'tomneeman151293 '%5D%0AW
35ab3d0e5a4a608339cd908ee4db1c9aefe3c5f4
Add find me service
pybotvac/robot.py
pybotvac/robot.py
import requests import hashlib import hmac import time import os.path # Disable warning due to SubjectAltNameWarning in certificate requests.packages.urllib3.disable_warnings() SUPPORTED_SERVICES = ['basic-1', 'minimal-2', 'basic-2', 'basic-3'] class UnsupportedDevice(Exception): pass class Robot: """Data...
Python
0.000003
@@ -4475,24 +4475,113 @@ tSchedule%22%7D) +%0A %0A def locate(self):%0A return self._message(%7B'reqId': %221%22, 'cmd': %22findMe%22%7D) %0A%0A @prope
3fda8faef7dccaefc29bb9c4a84fce4819141118
update some comments and names for readability
src/watchdog/observers/inotify_buffer.py
src/watchdog/observers/inotify_buffer.py
# -*- coding: utf-8 -*- # # Copyright 2014 Thomas Amland <thomas.amland@gmail.com> # # 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 # # Unles...
Python
0
@@ -769,16 +769,45 @@ notify%0A%0A +__all__ = %5B'InotifyBuffer'%5D%0A%0A STOP_EVE @@ -828,17 +828,16 @@ %0A%0Aclass -_ Worker(D @@ -920,15 +920,24 @@ to -%60queue%60 +an InotifyBuffer .%0A @@ -975,21 +975,22 @@ notify, -queue +buffer ):%0A @@ -1086,21 +1086,23 @@ lf._ -queue = queue +buffer = buffe...
f257aa683e9d7a1d9881434c03c6571391ef34af
fix a bug where django versions prior to 1.4 couldn't show headers
pennyblack/models/mail.py
pennyblack/models/mail.py
import hashlib import random from rfc822 import dump_address_pair from django.contrib import admin from django.contrib.contenttypes import generic from django.core import mail from django.core.validators import email_re from django.db import models from django.http import HttpRequest from django.template.loader import...
Python
0
@@ -531,18 +531,16 @@ time.now -() %0A%0A%0A#----
3066837091621720be0b0338d12ed66fd24a86b1
bump version
pyiso/__init__.py
pyiso/__init__.py
import imp import os.path __version__ = '0.2.6' BALANCING_AUTHORITIES = { 'BPA': {'module': 'bpa', 'class': 'BPAClient'}, 'CAISO': {'module': 'caiso', 'class': 'CAISOClient'}, 'ERCOT': {'module': 'ercot', 'class': 'ERCOTClient'}, 'ISONE': {'module': 'isone', 'class': 'ISONEClient'}, 'MISO': {'mo...
Python
0
@@ -44,9 +44,9 @@ 0.2. -6 +7 '%0A%0A%0A
7e41ab10d169b1a8e6533b3287d95d9b4c6c7203
Handle None in convert_tstamp()
djstripe/utils.py
djstripe/utils.py
# -*- coding: utf-8 -*- """ .. module:: djstripe.utils. :synopsis: dj-stripe - Utility functions related to the djstripe app. .. moduleauthor:: @kavdev, @pydanny, @wahuneke """ from __future__ import unicode_literals import datetime from django.conf import settings from django.contrib.auth import get_user_model ...
Python
0.000002
@@ -3616,24 +3616,123 @@ ime%0A %22%22%22%0A + if response is None:%0A # Allow passing None to convert_tstamp()%0A return response%0A%0A # Overri
76c8096b3aed79391614b32608ab446613c42034
Add LOG_LEVEL global set by DEBUG=True in environment
pyiso/__init__.py
pyiso/__init__.py
import imp import os.path __version__ = '0.2.11' BALANCING_AUTHORITIES = { 'AZPS': {'module': 'sveri', 'class': 'SVERIClient'}, 'BPA': {'module': 'bpa', 'class': 'BPAClient'}, 'CAISO': {'module': 'caiso', 'class': 'CAISOClient'}, 'DEAA': {'module': 'sveri', 'class': 'SVERIClient'}, 'ELE': {'modu...
Python
0.000064
@@ -23,33 +23,418 @@ ath%0A -%0A%0A__version__ = '0.2.11'%0A +from os import environ%0Afrom logging import DEBUG, INFO%0A%0A#########################################%0A# For Testing Purposes%0A# Add caching to unittesting%0A# Print every time the testing hits the cache successfully%0Aimport requests%0Aimport requests_...
42ea9fef4203d5acd73e732dbe0e4d8672e81d17
bump version for pypi
jax/version.py
jax/version.py
# Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -589,11 +589,11 @@ = %220.1.3 -3 +4 %22%0A
bcc8164f2e6ed4401dc5ecb74a28ebe8554f7b82
Add Windows support.
binding.gyp
binding.gyp
{ 'targets': [{ 'target_name': 'robotjs', 'include_dirs': [ '<!(node -e \'require("nan")\')' ], 'cflags': [ '-Wall', '-Wparentheses', '-Winline', '-Wbad-function-cast', '-Wdisabled-optimization' ], 'conditions': [ ['OS == "mac"', { ...
Python
0
@@ -76,38 +76,25 @@ ' -%3C!( node - -e %5C'require(%22nan%22)%5C') +_modules/nan/ '%0A @@ -1097,24 +1097,89 @@ %5D%0A + %7D%5D,%0A %5B%22OS=='win'%22, %7B%0A 'defines': %5B%0A 'IS_WINDOWS'%5D%0A %7D%5D%0A %5D @@ -1367,24 +1367,48 @@ eengrab.c',%0A + 'src/snprintf.c',%0A ...
c5da75e3acb4ba4c69204ff1ad3e7e89d6710001
Add whitespace in tests
client/tests/framework_test.py
client/tests/framework_test.py
#!/usr/bin/python3 import unittest import ok class TestProtocol(ok.Protocol): name = "test" def __init__(self, args, src_files): ok.Protocol.__init__(args, src_files) self.called_start = 0 self.called_interact = 0 def on_start(self, buf): self.called_start += 1 def o...
Python
0.999029
@@ -40,16 +40,17 @@ ort ok%0A%0A +%0A class Te @@ -372,16 +372,17 @@ t += 1%0A%0A +%0A class Ok
c552dc428b78fae168d59d3ff5af1818cf56f0e2
use DNSServiceGetAddrInfo(…) on Mac OS
binding.gyp
binding.gyp
{ 'targets': [ { 'target_name': 'dns_sd_bindings' , 'sources': [ 'src/dns_sd.cpp' , 'src/dns_service_browse.cpp' , 'src/dns_service_enumerate_domains.cpp' , 'src/dns_service_get_addr_info.cpp' , 'src/dns_service_process_result.cpp' ...
Python
0
@@ -1028,16 +1028,18 @@ + 'librari @@ -1065,24 +1065,116 @@ %0A %7D%5D%0A + , %5B 'OS==%22mac%22', %7B%0A 'defines': %5B 'HAVE_DNSSERVICEGETADDRINFO' %5D%0A %7D%5D%0A , %5B'OS @@ -1177,32 +1177,34 @@ %5B'OS==%22win%22', %7B%0A + 'inclu @@ -1325,19 +1325,1...
c7764ac8c1363701b4e7fab1d8ae0e3197853b48
Update __init__.py
pylsy/__init__.py
pylsy/__init__.py
#__init__.py from .pylsy import PylsyTable __version__="1.001"
Python
0.000072
@@ -53,11 +53,11 @@ __=%221.00 -1 +3 %22%0A
8eae324c0030221a93b202a419db3f7301ad486c
read config only if file exists
pymzn/__init__.py
pymzn/__init__.py
""" PyMzn is a Python library that wraps and enhances the MiniZinc tools for CSP modelling and solving. It is built on top of the libminizinc library (version 2.0) and provides a number of off-the-shelf functions to readily solve problems encoded in MiniZinc and parse the solutions into Python objects. """ import ast i...
Python
0.000001
@@ -1389,18 +1389,31 @@ )%0A%0A%0A -with open( +config = %7B%7D%0Acfg_file = os.p @@ -1473,16 +1473,68 @@ ml') +%0Aif os.path.isfile(cfg_file):%0A with open(cfg_file ) as f:%0A @@ -1529,16 +1529,20 @@ ) as f:%0A + conf @@ -1560,16 +1560,17 @@ oad(f)%0A%0A +%0A # Solver
45141fe7f34e0522b2270047af796644406213dc
Add user help text to error output of do_fish_indent
do_fish_indent.py
do_fish_indent.py
import sublime, sublime_plugin import os.path import subprocess # Only a TextCommand can use replace() class DoFishIndentCommand(sublime_plugin.TextCommand): def is_enabled(self): # We are very incompatible with ST1 and probably ST4 one day return 2 <= int(sublime.version()[0]) <= 3 def is_visible(self): ...
Python
0.000009
@@ -1635,16 +1635,172 @@ at(exe)%0A + if not pathToDir:%0A msg += %22. Specify a nonstandard install location in Preferences %3E Package Settings %3E friendly interactive shell %3E Settings%22%0A su
eaa17491581cbb52242fbe543dd09929f537a8bc
Add option to ignore static.
mysettings.py
mysettings.py
from src.markdown.makrdown import jinja_aware_markdown PREFERRED_URL_SCHEME = 'http' SERVER_NAME = 'localhost:5000' FLATPAGES_EXTENSION = '.md' FLATPAGES_HTML_RENDERER = jinja_aware_markdown FREEZER_IGNORE_404_NOT_FOUND = True FLATPAGES_AUTO_RELOAD = True GITHUB_URL = 'https://github.com/JetBrains/kotlin' TWITTER_URL ...
Python
0
@@ -250,16 +250,46 @@ = True%0A +FREEZER_STATIC_IGNORE = %5B%22*%22%5D%0A GITHUB_U
9a40bd0d82c5215a8978a7d1c95f2910ee8f7f09
add UserToken model
api/models.py
api/models.py
from django.db import models from django.db.models import Q from django.utils import timezone class MaintenanceRecord(models.Model): start_date = models.DateTimeField() end_date = models.DateTimeField(blank=True, null=True) title = models.CharField(max_length=256) message = models.TextField() disa...
Python
0
@@ -87,16 +87,60 @@ imezone%0A +from django.contrib.auth.models import User%0A %0A%0Aclass @@ -1185,20 +1185,249 @@ return disable_login +%0A%0A%0Aclass UserToken(models.Model):%0A token = models.CharField(max_length=128)%0A user = models.ForeignKey(User)%0A created_date = models.DateTimeField(auto_now_add...
44242e8c539c79793f4fe3a6ce716d3edbe79782
Fix follow board
pypin/__init__.py
pypin/__init__.py
""" Module doc string """ import json import requests import urllib.request class PyPin(object): """Python client consume Pinterest API""" TIMEOUT = 5 API_HOST = 'https://api.pinterest.com/' def __init__(self, accesstoken, version='v1'): self.accesstoken = accesstoken self.api_verson ...
Python
0.000191
@@ -3865,32 +3865,43 @@ est_url, 'post', + %7B 'board': board_id)%0A%0A @@ -3893,16 +3893,18 @@ board_id + %7D )%0A%0A d
379068d31623662c0b349f26d1cd610612963b82
add re module to be more reliable
joinstsfile.py
joinstsfile.py
#!/usr/bin/env python3 import os path='/home/ruan/git/stm/' #path为文件所在目录,windows下如‘D:\\data\\’,直接覆盖源文件,请注意保存原始数据 for file in os.listdir(path): os.rename(os.path.join(path,file),os.path.join(path,file.split('.')[2][2:])) filenu = len(os.listdir(path)) + 1 data=[] with open(os.path.join(path,'001'),'rb') as fo: f...
Python
0
@@ -29,14 +29,19 @@ t os +, re %0Apath= +r '/ho @@ -62,147 +62,127 @@ m/'%0A -#path%E4%B8%BA%E6%96%87%E4%BB%B6%E6%89%80%E5%9C%A8%E7%9B%AE%E5%BD%95%EF%BC%8Cwindows%E4%B8%8B%E5%A6%82%E2%80%98D:%5C%5Cdata%5C%5C%E2%80%99,%E7%9B%B4%E6%8E%A5%E8%A6%86%E7%9B%96%E6%BA%90%E6%96%87%E4%BB%B6%EF%BC%8C%E8%AF%B7%E6%B3%A8%E6%84%8F...
85d5712fa1dde952783cbc8d78f904e08cfc9b50
Remove duplicated dependency
server/setup.py
server/setup.py
from pathlib import Path from setuptools import Command, find_packages, setup class GenerateCommand(Command): description = "generates manticore_server server protobuf + grpc code from protobuf specification file" user_options = [] def initialize_options(self): pass def finalize_options(sel...
Python
0
@@ -1166,37 +1166,8 @@ s%22,%0A - %22mypy-protobuf%22,%0A
ba43de958266a2906f3ee4cad23b20361db2637a
Add arguments to job
scripts/submitJob.py
scripts/submitJob.py
#!/usr/bin/env python # SIM-CITY client # # Copyright 2015 Netherlands eScience Center # # 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 # # U...
Python
0.00008
@@ -907,16 +907,81 @@ a job%22)%0A + parser.add_argument('host', help=%22host to run pilot job on%22)%0A pars @@ -1059,45 +1059,49 @@ nt(' -host', help=%22host to run pilot job on +args', nargs='*', help=%22command arguments %22)%0A @@ -1507,16 +1507,29 @@ ties = %7B +%0A 'command @@ -1543,16 ...
8d56a45d0b01dff3e8cd041e7ba09c882d7cbb30
add logging to file and stdout
phabricator-proxy/main.py
phabricator-proxy/main.py
import flask import requests import os from urllib.parse import urlparse, parse_qs import json app = flask.Flask(__name__) app.config["DEBUG"] = False buildkite_api_token = os.getenv("BUILDKITE_API_TOKEN", "") @app.route('/', methods=['GET']) def home(): return "Hi LLVM!" @app.route('/build', methods=['POST', ...
Python
0
@@ -1,215 +1,932 @@ -import flask%0Aimport requests%0Aimport os%0Afrom urllib.parse import urlparse, parse_qs%0Aimport json%0A%0Aapp = flask.Flask(__name__)%0Aapp.config%5B%22DEBUG%22%5D = False%0Abuildkite_api_token = os.getenv(%22BUILDKITE_API_TOKEN%22, %22%22)%0A +from cmath import log%0Afrom flask.logging import de...
c90dbc5007b5627b264493c2d16af79cff9c2af0
Add better custom has_permission check.
joku/checks.py
joku/checks.py
""" Specific checks. """ from discord.ext.commands import CheckFailure def is_owner(ctx): if not ctx.bot.owner_id == ctx.message.author.id: raise CheckFailure(message="You are not the owner.") return True
Python
0
@@ -63,16 +63,23 @@ kFailure +, check %0A%0A%0Adef i @@ -223,8 +223,595 @@ rn True%0A +%0A%0Adef has_permissions(**perms):%0A def predicate(ctx):%0A if ctx.bot.owner_id == ctx.message.author.id:%0A return True%0A msg = ctx.message%0A ch = msg.channel%0A permissions = ch.perm...
f9a827b41ed925e22bf1e873e5989bdd327fabbf
Add RefugeeCamp name formatting
api/models.py
api/models.py
from django.db import models class RefugeeCamp(models.Model): # Location city = models.CharField(max_length=64) postcode = models.CharField(max_length=16) street = models.CharField(max_length=128) streetnumber = models.CharField(max_length=32) class ObjectCategory(models.Model): title = models...
Python
0.000001
@@ -259,16 +259,180 @@ th=32)%0A%0A + def __str__(self):%0A return %22%7B0%7D %7B1%7D: %7B2%7D %7B3%7D%22.format(self.postcode, self.city,%0A self.street, self.streetnumber)%0A%0A class Ob
c720f9c385a785b8905991465fb74c75fca42220
fix bug
cloudify_cloudinit/__init__.py
cloudify_cloudinit/__init__.py
# Copyright (c) 2017-2018 Cloudify Platform Ltd. 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 ...
Python
0.000001
@@ -1137,60 +1137,85 @@ -if ' content -' not in f:%0A continue%0A + = f.get('content')%0A if isinstance(content, dict):%0A @@ -1238,36 +1238,31 @@ urce_type = -f%5B' content -'%5D .get('resour @@ -1283,32 +1283,36 @@ + resource_name = @@ -13...
e94031c99f4ce0a07a2da86423839d963e70c224
Fix off-by-one typo
py/desisim/scripts/pixsim_nights.py
py/desisim/scripts/pixsim_nights.py
""" desisim.scripts.pixsim_nights ====================== Entry point for simulating multiple nights. """ from __future__ import absolute_import, division, print_function import sys import os import re import argparse import traceback import numpy as np from desispec.util import option_list from desispec.parallel i...
Python
0.999999
@@ -3794,22 +3794,26 @@ 2, size= +( maxexp ++1) )%0A se
ee1f958cb3611ecc3af0329deda7fde5d5281c32
remove obsolete model creation
core/models/__init__.py
core/models/__init__.py
from core.models.allocation_strategy import Allocation, AllocationStrategy from core.models.application import Application, ApplicationMembership,\ ApplicationScore, ApplicationBookmark from core.models.application_tag import ApplicationTag from core.models.application_version import ApplicationVersion, Application...
Python
0.000003
@@ -1,24 +1,92 @@ +# -*- coding: utf-8 -*-%0A# flake8: noqa%0A%22%22%22%0ACollection of models%0A%22%22%22%0A from core.models.allocat @@ -1888,16 +1888,16 @@ ereUser%0A + from cor @@ -1930,2165 +1930,4 @@ ume%0A -%0A%0Adef get_or_create(Model, *args, **kwargs):%0A return Model.objects.get_or_create(*args, **kwa...
6e17556192274ea64635be61af0ea363e0ba898e
Allow running as non-root, with a warning.
snapshot.py
snapshot.py
#!/usr/bin/env python from subprocess import Popen, PIPE from sh import whoami import sys import time from parsers.tail import read_tailed_files from db import Database from util import LOGGER def parse_args(): from argparse import ArgumentParser parser = ArgumentParser(description='Snapshot statistics from ...
Python
0
@@ -2909,88 +2909,206 @@ -if args.host == '':%0A LOGGER.info('Loading local procfs files')%0A if +# root can see all of /proc, another user is likely not going to be able%0A # to read all of it. This isn't a hard error, but won't give a full view%0A # of the system.%0A if (args.host == '' a...
3f5fc855369f61e39674c052a872fec4828bebf0
[Mails] typo
bin/Mail.py
bin/Mail.py
#!/usr/bin/env python3 # -*-coding:UTF-8 -* """ The Mail Module ====================== This module is consuming the Redis-list created by the Categ module. It apply mail regexes on paste content and warn if above a threshold. """ import os import re import sys import redis import time import datetime import dns.ex...
Python
0.999884
@@ -2250,16 +2250,23 @@ content( +item_id ))%0A
1c3e8def9f46ee0f21d1172287af0b4fadf67884
Add some more backwards compatibility: also add intent to outcome
src/wit_ros/wit_node.py
src/wit_ros/wit_node.py
#!/usr/bin/env python """ROS node for the Wit.ai API""" global APIKEY APIKEY = None import rospy import requests import json from wit import Wit from wit_ros.srv import Interpret, InterpretResponse, ListenAndInterpret, ListenAndInterpretResponse from wit_ros.msg import Outcome, Entity class WitRos(object): def ...
Python
0
@@ -923,24 +923,47 @@ ARNING%22%5D))%0A%0A + outcome = None%0A enti @@ -972,16 +972,17 @@ es = %5B%5D%0A +%0A @@ -1097,32 +1097,31 @@ -entities +outcome = response%5B @@ -1134,16 +1134,47 @@ mes%22%5D%5B0%5D +%0A entities = outcome %5B%22entiti @@ -2227,35 +2227,...
1b2f0be67a8372a652b786c8b183cd5edf1807cd
Swap back to Fuzzer, no monkey patching
config/fuzz_pox_mesh.py
config/fuzz_pox_mesh.py
from experiment_config_lib import ControllerConfig from sts.topology import MeshTopology from sts.control_flow import Fuzzer from sts.input_traces.input_logger import InputLogger from sts.invariant_checker import InvariantChecker from sts.simulation_state import SimulationConfig # Use POX as our controller command_lin...
Python
0
@@ -117,16 +117,29 @@ t Fuzzer +, Interactive %0Afrom st @@ -357,17 +357,28 @@ ose ---no-cli +openflow.debug ''' # sts. @@ -425,21 +425,8 @@ ''' -samples.topo forw @@ -461,16 +461,17 @@ +# '''sts.u @@ -555,26 +555,35 @@ ess= -../sts_socket_pipe +__address__ --port=__port__ ''') @@ -633,71 +633,18...
ffd14af829bd3f7bf52cb0af5306550b51ab8712
Remove mox from tests/unit/compute/test_compute_xen.py
nova/tests/unit/compute/test_compute_xen.py
nova/tests/unit/compute/test_compute_xen.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
Python
0.000002
@@ -630,16 +630,28 @@ er.%22%22%22%0A%0A +import mock%0A from osl @@ -1996,32 +1996,73 @@ -self.mox.StubOutWithMock +@mock.patch.object(vm_utils, 'lookup')%0A @mock.patch.object (obj @@ -2107,32 +2107,26 @@ -self.mox.StubOutWithMock +@mock.patch.object (sel @@ -2176,85 +2176,26 @@ -self.mox...
6eeadf2246c5aa09bbec6fd5b6bb0d9fde25d348
Remove dots from rendered maze
bin/maze.py
bin/maze.py
# Use case: A randomly generated maze won when the user reaches the end # Example: from vengeance.game import Direction from vengeance.game import Game from vengeance.game import Location import random width = 8 height = 8 north = Direction('north') south = Direction('south') north.opposite = south east = Direction('...
Python
0.000002
@@ -2049,17 +2049,17 @@ sult = ' -. + ' + widt @@ -2064,17 +2064,17 @@ dth * '_ -. + '%0A re @@ -2483,17 +2483,17 @@ ult += ' -. + '%0A%0A
d0ca9aa6cf39c4743e398f65e4c7f5bbc3c03d78
Clarify API sample
api_sample.py
api_sample.py
# Add ./lib to the path for importing nassl import os import sys sys.path.insert(1, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')) from sslyze.plugins_finder import PluginsFinder from sslyze.plugins_process_pool import PluginsProcessPool from sslyze.server_connectivity import ServerConnectivityInfo,...
Python
0.000003
@@ -1103,16 +1103,91 @@ commands +; the commands are same as what is described in the SSLyze CLI --help text. %0Aprint '
22feb7ac3e8a5d4ef7c0e371752cae24974445a8
fix dj21: removed CommandParser argument cmd
django_smoke_tests/management/commands/smoke_tests.py
django_smoke_tests/management/commands/smoke_tests.py
import argparse import os from django.core.management import BaseCommand, CommandParser from django.core.management.base import CommandError from ...generator import SmokeTestsGenerator class Command(BaseCommand): help = "Smoke tests for Django endpoints." def create_parser(self, prog_name, subcommand): ...
Python
0.000174
@@ -430,16 +430,53 @@ -parser = +def _create_parser(*args):%0A return Com @@ -499,21 +499,42 @@ -self, + *args,%0A prog=%22%25 @@ -596,16 +596,20 @@ + descript @@ -631,32 +631,198 @@ r None,%0A + )%0A try: # django 2.1+%0A ...
aace4c7449f964109e422e38a669f72ec62c7767
Make sure filter arguments evaluates to True before setting
pysnow/request.py
pysnow/request.py
# -*- coding: utf-8 -*- import json import requests from .response import Response from .query import Query from .report import Report from .exceptions import InvalidUsage class PreparedRequest(object): """Creates a new :class:`PreparedRequest` object. :param request_params: Request parameters to pass alo...
Python
0.000608
@@ -4739,24 +4739,47 @@ mit(limit)%0A%0A + if fields:%0A quer @@ -4802,24 +4802,48 @@ lds(fields)%0A +%0A if offset:%0A quer @@ -4870,16 +4870,42 @@ offset)%0A +%0A if order_by:%0A
e7dac5b5cc02f1692a00c39a82eeb62b620aeac4
normalize all paths (remove .., .)
bin/misc.py
bin/misc.py
#! /usr/bin/env python2.5 # -*- coding: utf-8 -*- # vim: set expandtab : from __future__ import with_statement __author__ = 'Alexandru Mosoi <brtzsnr@gmail.com>' import fcntl import os import socket import struct import ConfigParser DATE_FORMAT = '%Y.%m.%d %H:%M:%S' VMCHECKER_INI = 'vmchecker_storer.ini' _config...
Python
0.000223
@@ -1838,32 +1838,49 @@ %0A return +os.path.normpath( os.path.join(sel @@ -1896,16 +1896,17 @@ elative) +) %0A%0A @p
4ca8c46eaf35c726604c6da93c7503d5b24416a1
fix race condition in getting floating ip (flake8)
perfkitbenchmarker/openstack/os_virtual_machine.py
perfkitbenchmarker/openstack/os_virtual_machine.py
# Copyright 2015 Google Inc. 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 applicable law or agr...
Python
0
@@ -5240,16 +5240,33 @@ .format( +%0A self.flo
0e2548637d9726dc549b13abc3a6b38c51e300bd
not count , and . values in allele count
franklin/snv/readers.py
franklin/snv/readers.py
''' Created on 2011 aza 21 @author: peio ''' class VcfParser(object): 'A vcf reader' def __init__(self, fpath): 'Class initiator' self._fpath = fpath self.header = None self._get_header() self._index = None def _get_version(self): 'version of the vcf' ...
Python
0.999987
@@ -3016,16 +3016,27 @@ t(values +.split(',') %5Bindex%5D)