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
56ff187a56d7831325bf88fc68124f7b9bca2564
fix #33, reload on tsconfig.json save, fixfix
lib/tsconfiglint/tsconfigglobexpand.py
lib/tsconfiglint/tsconfigglobexpand.py
# coding=utf8 import os import glob import json from subprocess import Popen, PIPE, TimeoutExpired from .TsconfigLinter import check_tsconfig # from pathlib import Path # not avalilable in python 3.3 (only 3.4) from ..utils.debug import Debug from ..utils.pathutils import get_expandglob_path, default_node_path from ....
Python
0
@@ -1961,28 +1961,72 @@ return -Fals +True # Should reopen project, so return True her e%0A%0A # Exp
c09f4567d220517ff4f55475d153580885402f95
Parse thousands correctly in the statements. Closes #1984
modules/citibank/parser.py
modules/citibank/parser.py
# -*- coding: utf-8 -*- # Copyright(C) 2014 Oleg Plakhotniuk # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
Python
0.999997
@@ -2445,16 +2445,25 @@ (-?%5C$%5Cd+ +(,%5Cd%7B3%7D)* %5C.%5Cd%7B2%7D) @@ -6497,16 +6497,64 @@ t', pos, +%0A lambda xs: AmTr.de @@ -6565,16 +6565,23 @@ l_amount +(xs%5B0%5D) )%0A%0A d
164262400dbb265a3363eb9f1415284b391c079c
Remove duplicate call
fc.py
fc.py
#!/usr/bin/python3 #Fork compiler toolchain script import argparse import re, os from sys import exit def main(): #Parse arguments parser = argparse.ArgumentParser(description='Fork toolchain command line parser...') parser.add_argument('-v',action='store_true',help='Use valgrind') parser.add_argument('-c',act...
Python
0.000004
@@ -1325,62 +1325,8 @@ 20%5D%0A - os.system(%22./parser %7B0%7D%22.format(file,basename))%0A
1e14d68c86e0cacb9bedc51884081ef0a1cfdcdc
Fix for trevis
isitdown/config.py
isitdown/config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config(object): DEBUG = False TESTING = False DATABASE_URI = os.environ["ISITDOWN_DATABASE_URI"] or 'sqlite:///' + os.path.join(basedir, 'app.db') SECRET_KEY = os.environ['ISITDOWN_SECRET_KEY'] or 'you-will-never-guess' SQLALCHEM...
Python
0
@@ -147,17 +147,21 @@ .environ -%5B +.get( %22ISITDOW @@ -175,20 +175,17 @@ ASE_URI%22 -%5D or +, 'sqlite @@ -223,16 +223,17 @@ app.db') +) %0A SEC @@ -256,9 +256,13 @@ iron -%5B +.get( 'ISI @@ -282,12 +282,9 @@ KEY' -%5D or +, 'yo @@ -302,16 +302,17 @@ r-guess' +) %0A SQL
16d87a91bcd6eb5cdb23d6aeb45e48ca7baf181a
remove unnecessary import
createdb.py
createdb.py
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask('app') app.config.from_object('config') db = SQLAlchemy(app) from app import models db.create_all()
Python
0.000037
@@ -138,34 +138,8 @@ p)%0A%0A -%0Afrom app import models%0A%0A%0A db.c
ee1b02d7327eeeeb65115c705a0df1ffd7c82034
Make random election view a bit more random
democracy_club/apps/everyelection/views.py
democracy_club/apps/everyelection/views.py
from django.db.models import Count from django.shortcuts import get_object_or_404 from django.views.generic import RedirectView, UpdateView from django.core.urlresolvers import reverse from braces.views import LoginRequiredMixin from .models import AuthorityElection, AuthorityElectionPosition from .forms import Autho...
Python
0.00002
@@ -1,20 +1,35 @@ +import random%0A%0A from django.db.model @@ -192,16 +192,54 @@ reverse +%0Afrom django.shortcuts import redirect %0A%0Afrom b @@ -378,16 +378,46 @@ AreaForm +, AuthorityElectionSkippedForm %0A%0A%0Aclass @@ -546,19 +546,25 @@ election +s = +list( Authorit @@ -694,15 +694,167 @@ t'). -firs...
2549a66b6785d5a0ed0658a4f375a21c486792df
Raise explicit exception on no type match
sifr/util.py
sifr/util.py
import datetime from dateutil import parser import six def normalize_time(t): try: if isinstance(t, datetime.datetime): return t elif isinstance(t, datetime.date): return datetime.datetime(t.year, t.month, t.day) elif isinstance(t, (int, float)): return ...
Python
0.000006
@@ -460,16 +460,26 @@ raise + TypeError %0A exc
62ede23b0e13ab907b3eab620193921de29e162b
Bump version to 4.3.2b1
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0.000001
@@ -627,10 +627,10 @@ , %222 -a4 +b1 %22)%0A_
d4af985eb8786f6531e319e837fcc8d7b3e33ece
Bump version to 4.0.0a5
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0
@@ -624,17 +624,17 @@ , 0, %220a -4 +5 %22)%0A__ver
454cd8d7847074988bf967f6240d59f25bdf310e
Bump version to 5.0.2rc1
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0
@@ -639,10 +639,11 @@ , %222 -b5 +rc1 %22)%0A_
dc14bd73623f453d8ef272a9cd46df3733fcfad9
Bump version to 6.1.5rc1
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0
@@ -639,10 +639,11 @@ , %225 -a4 +rc1 %22)%0A_
3329728b0e21fb384c9e2cd7c6a5ac7254bc58bb
Check modified time before deleting
cax/tasks/clear.py
cax/tasks/clear.py
"""Logic for pruning data The requirement to prune data can occur in a few cases. Time outs on transfers or failed checksums are an obvious case. We also use this section for clearing the DAQ buffer copy. """ import datetime import os import shutil from cax import config from cax.task import Task from cax.tasks im...
Python
0
@@ -1181,34 +1181,16 @@ _mod - = datetime.fromtimestamp( +ified = os.s @@ -1223,16 +1223,86 @@ st_mtime +%0A time_modified = datetime.datetime.fromtimestamp(time_modified )%0A @@ -1403,16 +1403,21 @@ time_mod +ified ,%0A
1800e98f0570bfd1029d9df881fb144fdd943e72
Remove leftover debug print from Melnor (#78870)
tests/components/melnor/test_number.py
tests/components/melnor/test_number.py
"""Test the Melnor sensors.""" from __future__ import annotations from .conftest import ( mock_config_entry, patch_async_ble_device_from_address, patch_async_register_callback, patch_melnor_device, ) async def test_manual_watering_minutes(hass): """Test the manual watering switch.""" entry ...
Python
0
@@ -688,30 +688,8 @@ %22)%0A%0A - print(number)%0A
9379504dbdb57c5754fbc984bcf72cc032a9d626
support loading configs by filename
simulator.py
simulator.py
#!/bin/bash - # If you have PyPy 1.6+ in a directory called pypy alongside pox.py, we # use it. # Otherwise, we try to use a Python interpreter called python2.7, which # is a good idea if you're using Python from MacPorts, for example. # We fall back to just "python" and hope that works. ''''echo -n export OPT="-O" e...
Python
0
@@ -1614,16 +1614,100 @@ _args()%0A +if args.config.endswith('.py'):%0A args.config = args.config%5B:-3%5D.replace(%22/%22, %22.%22)%0A%0A config =
b813ace93206ae39e2b0f2e3bba990297bf1909d
fix bug when area is unknown
modules/leboncoin/pages.py
modules/leboncoin/pages.py
# -*- coding: utf-8 -*- # Copyright(C) 2014 Bezleputh # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
Python
0
@@ -1096,16 +1096,66 @@ ngPhoto%0A +from weboob.capabilities.base import NotAvailable%0A from dat @@ -4654,24 +4654,72 @@ ls = dict()%0A + self.env%5B'location'%5D = NotAvailable%0A @@ -5012,32 +5012,76 @@ xt('./td')(tr)%0A%0A + self.env%5B'area'%5D = NotAvailable%0A ...
ae6025a4be24637e57c0545aa860d96a0447aa89
Raise any exceptions from ended listeners in workers
channels/worker.py
channels/worker.py
import asyncio from asgiref.server import StatelessServer class Worker(StatelessServer): """ ASGI protocol server that surfaces events sent to specific channels on the channel layer into a single application instance. """ def __init__(self, application, channels, channel_layer, max_applications=...
Python
0
@@ -977,16 +977,148 @@ steners) +%0A # See if any of the listeners had an error (e.g. channel layer error)%0A %5Blistener.result() for listener in listeners%5D %0A%0A as
38c2e06b676aced578722e82a0668eda53f668d8
Implement Action Runner * Resolving merge conflicts
st2actionrunnercontroller/st2actionrunnercontroller/controllers/liveactions.py
st2actionrunnercontroller/st2actionrunnercontroller/controllers/liveactions.py
import httplib from pecan import (abort, expose, request, response) from pecan.rest import RestController import uuid from wsme import types as wstypes import wsmeext.pecan as wsme_pecan from st2common import log as logging from st2common.exceptions.db import StackStormDBObjectNotFoundError from st2common.models.api...
Python
0
@@ -2341,283 +2341,8 @@ ')%0A%0A -# liveaction_apis = self._liveaction_apis%0A%0A# liveaction_api = LiveActionAPI()%0A# liveaction_api.id = str(uuid.uuid4())%0A# liveaction_api.action_name = u'test/echo'%0A%0A# self._liveaction_apis.append(self.create_liveaction('test/echo', %7B%7D, ...
6149cef01900d6710efa322ef934965c5f1379f8
Fix pylint
xapi/utils.py
xapi/utils.py
from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.modulestore.django import modulestore from django.contrib.auth.models import User from django.test.client import RequestFactory from openedx.core.djangoapps.conte...
Python
0.000099
@@ -366,82 +366,8 @@ iew%0A -from courseware.courses import get_course_by_id, get_course_about_section%0A from
0b707c2e3a4d00aef5dad683c535498cb8bc1e21
use the default date formatter for logging
xutils/log.py
xutils/log.py
# -*- coding: utf-8 -*- import os import os.path import logging from logging.handlers import RotatingFileHandler def init(logger=None, level="INFO", file=None, handler_cls=None, process=False, max_count=30, propagate=True, file_config=None, dict_config=None): root = logging.getLogger() if not logge...
Python
0
@@ -570,46 +570,8 @@ s%22)%0A - datefmt = %22%25Y-%25m-%25d %25H:%25M:%25S%22%0A @@ -615,25 +615,8 @@ =fmt -, datefmt=datefmt )%0A%0A
7d8380a65523e7d6ef77d39eaf125823e3e10812
Bump version to 5.0.0dev0
chardet/version.py
chardet/version.py
""" This module exists only to simplify retrieving the version number of chardet from within setup.py and from chardet subpackages. :author: Dan Blanchard (dan.blanchard@gmail.com) """ __version__ = "4.0.0" VERSION = __version__.split('.')
Python
0
@@ -199,13 +199,17 @@ = %22 -4 +5 .0.0 +dev0 %22%0AVE
4cb36450aa4ddabe0a6fa48300dc37edc053dd13
fix bug in isOpen for reports
modules/queue/ModReport.py
modules/queue/ModReport.py
"""Queue item for basic analysis by irwin""" from collections import namedtuple from datetime import datetime, timedelta import pymongo class ModReport(namedtuple('ModReport', ['id', 'processed', 'created'])): @staticmethod def new(userId): return ModReport( id=userId, processed...
Python
0.000014
@@ -1363,20 +1363,19 @@ essed = -Fals +Tru e%0A @@ -1472,16 +1472,20 @@ return +not processe
6326cfa9ad5cb203eeade0c5875a005e06bbe932
fix isort test
tests/test_core_base_multi_executor.py
tests/test_core_base_multi_executor.py
import pytest from datetime import timedelta @pytest.fixture def config_yaml(unused_port): return """ e: cls: aioworkers.core.base.MultiExecutorEntity executors: get: 1 put: 1 none: none x: null """ async def test_multiexecutor(context): assert...
Python
0
@@ -1,18 +1,4 @@ -import pytest%0A from @@ -25,16 +25,31 @@ edelta%0A%0A +import pytest%0A%0A %0A@pytest
a07ec2940d5fb4121e9c570dc74e38d67ab4bb00
fix test
tests/test_ec2/test_security_groups.py
tests/test_ec2/test_security_groups.py
import boto from boto.exception import EC2ResponseError from sure import expect from moto import mock_ec2 @mock_ec2 def test_create_and_describe_security_group(): conn = boto.connect_ec2('the_key', 'the_secret') security_group = conn.create_security_group('test security group', 'this is a test security group...
Python
0.000002
@@ -346,14 +346,14 @@ roup -) .name +) .sho
94260ec953de44ae9a4108b964a9a607b0457148
fix new search index
muckrock/news/search_indexes.py
muckrock/news/search_indexes.py
""" Search Index for the news application """ from haystack.indexes import SearchIndex, CharField, DateTimeField from haystack import site from muckrock.news.models import Article class ArticleIndex(SearchIndex): """Search index for news articles""" text = CharField(document=True, use_template=True) auth...
Python
0.000075
@@ -315,16 +315,17 @@ author +s = CharF @@ -347,16 +347,17 @@ ='author +s ')%0A p @@ -491,24 +491,56 @@ updated.%22%22%22%0A + # pylint: disable=R0201%0A retu
b0b6080a17fa170c822463098fbed94823b26ec1
Remove unsupported sort key "user"
senlinclient/v1/event.py
senlinclient/v1/event.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 # distributed unde...
Python
0.000003
@@ -2280,16 +2280,8 @@ me', - 'user', 'ac
2bafdb04dc4e04c5a2cf9136135dfa130ac6e78b
read full buffer, not byte by byte
serialSniffer/sniffer.py
serialSniffer/sniffer.py
from serial import Serial from concurrent.futures import ThreadPoolExecutor class Sniffer(object): """ TODO: write docstring """ def __init__(self, virtual_comm='COM7', physical_comm='COM1'): self.virtual_comm = Serial(virtual_comm) self.physical_comm = Serial(physical_comm) ...
Python
0.000058
@@ -607,22 +607,88 @@ -p_byte +n = self.physical_comm.inWaiting()%0A if n:%0A msg = self. @@ -712,32 +712,36 @@ d()%0A + + self.virtual_com @@ -748,22 +748,19 @@ m.write( -p_byte +msg )%0A @@ -757,32 +757,36 @@ sg)%0A + + self.p_bytes.app...
acc6efa7c375a5f423dc6ba0a511f354b9474e1e
revert forcing for awdio
timeside/tools/waveform_batch_awdio.py
timeside/tools/waveform_batch_awdio.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2009-2010 Guillaume Pellerin <yomguy@parisson.com> # This file is part of TimeSide. # TimeSide 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, eith...
Python
0
@@ -1726,21 +1726,14 @@ e = -True%0A +False%0A %0A%0Acl
dc63540318b1bfa055762b0c70990e4954fa9057
Make -t (--timestamp-results) a boolean flag
simulator.py
simulator.py
#!/usr/bin/env python2.7 # # Copyright 2011-2013 Colin Scott # Copyright 2011-2013 Andreas Wundsam # Copyright 2012-2013 Sam Whitlock # Copyright 2012-2012 Kyriakos Zarifis # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
Python
0.015864
@@ -2248,21 +2248,13 @@ ult= -None, nargs=1 +False , ac @@ -2268,117 +2268,14 @@ tore -%22,%0A type=lambda s: s.lower() in ('y', 'yes', 'on', 't', 'true', '1', 'yeay', 'ja', 'jepp') +_true%22 ,%0A
a21d2408dc9ed1696cea17e3cff3adc6dcdea815
Add ability to punish XP farm users.
joku/cogs/debug.py
joku/cogs/debug.py
""" Debug cog. """ import inspect import pprint import traceback import discord from discord.ext import commands from discord.ext.commands import Context from joku.bot import Jokusoramame from joku.checks import is_owner class Debug(object): def __init__(self, bot: Jokusoramame): self.bot = bot @co...
Python
0
@@ -1567,24 +1567,390 @@ t(module))%0A%0A + @debug.command(pass_context=True)%0A async def punish(self, ctx: Context, user: discord.User):%0A %22%22%22%0A Punishes a user.%0A%0A Sets their EXP to a very large negative number.%0A %22%22%22%0A await ctx.bot.rethinkdb.update_user_...
0334ef016eae57934e3e1497f655d76aaa51c632
Remove now unnecessary apiUrl placeholder.
server/guiserver/apps.py
server/guiserver/apps.py
# This file is part of the Juju GUI, which lets users view and manage Juju # environments within a graphical interface (https://launchpad.net/juju-gui). # Copyright (C) 2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public Lice...
Python
0
@@ -3487,94 +3487,8 @@ %7D%0A - if options.sandbox:%0A apiUrl = ''%0A else:%0A apiUrl = options.apiurl%0A @@ -3681,12 +3681,20 @@ s': +options. api -U +u rl,%0A
f996f81b09e328cfe3533ed92c1c3efca8c12a2c
Remove autocomplete endpoint since nominatim does not autocomplete
server/rest/twofishes.py
server/rest/twofishes.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of ...
Python
0.001396
@@ -1395,72 +1395,8 @@ er'%0A - self.route('GET', ('autocomplete',), self.autocomplete)%0A @@ -3345,643 +3345,8 @@ le%0A%0A - @access.public%0A def autocomplete(self, params):%0A r = requests.get(params%5B'twofishes'%5D,%0A params=%7B'autocomplete': True,%0A ...
cf60bcf1a06998bc2980cf793a6b7ffe086b9369
Factor out test cases into common function
server/test-querylang.py
server/test-querylang.py
"""Test Python utilities related to query language processing.""" import itertools import json import unittest import querylang as ql data = [ {'age': 19}, {'age': 21}, {'age': 23} ] class TestQueryLanguage(unittest.TestCase): """Test suite.""" def test_operator_expressions(self): """T...
Python
0.999999
@@ -259,25 +259,24 @@ ite.%22%22%22%0A -%0A def test_ope @@ -271,21 +271,11 @@ def -test_operator +run _exp @@ -291,46 +291,113 @@ self -):%0A %22%22%22Test operator expression +, ast_file, data, baseline):%0A %22%22%22Test several ASTs on a sequence of data against a set of baseline s.%22%22...
eac867faba8d4653fa580ee0c2bd708ff83b13ee
Remove test workaround
server/tests/test_api.py
server/tests/test_api.py
import json from server.tests.base import BaseTestCase from server.models import db, Lecturer, Course, Lecture, Comment class GetCommentsApiTest(BaseTestCase): def setUp(self): super(GetCommentsApiTest, self).setUp() simon = Lecturer('Simon', 'McCallum') db.session.add(simon) imt...
Python
0
@@ -724,157 +724,8 @@ def -test_all(self):%0A self._test_success()%0A self._test_lecture_not_found()%0A self._test_list()%0A self._test_content()%0A%0A def _ test @@ -732,32 +732,32 @@ _success(self):%0A + rv = sel @@ -838,25 +838,24 @@ 00%0A%0A def -_ test_lecture @@ -...
4e1653e1d00c1f4001e37de3cc650dc11d4b6ca5
fix stack inspection in render_to_response to work on windows
lib/rapidsms/utils/render_to_response.py
lib/rapidsms/utils/render_to_response.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import os import sys import inspect def render_to_response(req, template_name, dictionary=None, **kwargs): """ Wrap django.shortcuts.render_to_response, to avoid having to include the same stuff in every view. TODO: moar. """ # delay imports un...
Python
0
@@ -2506,16 +2506,33 @@ if +os.path.normcase( os.path. @@ -2556,16 +2556,35 @@ )%5B0%5D +) == +os.path.normcase( root +) :%0A
ff1a07783b0d284871a1f6195579768aab1c806b
Handle multiple results with cached geolocation better
molly/geolocation/utils.py
molly/geolocation/utils.py
from functools import wraps from django.conf import settings from django.contrib.gis.geos import Point from molly.conf import get_app from models import Geocode __all__ = ['geocode', 'reverse_geocode'] def _cached(getargsfunc): def g(f): @wraps(f) def h(*args, **kwargs): args = geta...
Python
0
@@ -1714,16 +1714,37 @@ esults%0A%0A + try:%0A @@ -1819,16 +1819,314 @@ l_name,%0A + **args)%0A except Geocode.MultipleObjectsReturned:%0A Geocode.objects.filter(local_name = app.local_name, **args).delete()%...
c4f73ea6b3598f3b2e9d8326a6f5d69b73178aa2
Change default node log level to 'info'
ocradmin/lib/nodetree/node.py
ocradmin/lib/nodetree/node.py
""" Base class for OCR nodes. """ import logging FORMAT = '%(levelname)-5s %(module)s: %(message)s' logging.basicConfig(format=FORMAT) LOGGER = logging.getLogger("Node") LOGGER.setLevel(logging.DEBUG) import cache class NodeError(Exception): def __init__(self, node, msg): super(NodeError, self).__init__(m...
Python
0
@@ -191,13 +191,12 @@ ing. -DEBUG +INFO )%0A%0Ai
cf8cba155edb7f1d27fce7b20aaafce044415a22
Update 35b556aef8ef_add_news_flash_table.py
alembic/versions/35b556aef8ef_add_news_flash_table.py
alembic/versions/35b556aef8ef_add_news_flash_table.py
"""add new table Revision ID: 35b556aef8ef Revises: 3c8ad66233c0 Create Date: 2018-12-10 11:31:29.518909 """ # revision identifiers, used by Alembic. revision = '35b556aef8ef' down_revision = '423a7ea74c0a' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): ##...
Python
0
@@ -50,20 +50,20 @@ es: -3c8ad66233 +423a7ea74 c0 +a %0ACre
5f12bac216f5380e55dc65ccfcd16e369c575dac
Use redis on localhost
app.py
app.py
from flask import Flask from redis import Redis import os app = Flask(__name__) redis = Redis(host= "redis", port=6379) @app.route('/') def hello(): redis.incr('hits') return 'This page has been seen {0} times' . format (redis.get( 'hits' )) if __name__ == "__main__": app.run(host= "0.0.0.0", debug=True)
Python
0.000001
@@ -95,21 +95,25 @@ (host= %22 -redis +localhost %22, port=
6bce13a7c0896c9f19b1a9187460467464d80a4c
enable cross domain origin
app.py
app.py
#!/usr/bin/env python import urllib import requests import json import os from datetime import date, timedelta from flask import Flask from flask import request, Response from flask import make_response from geopy.geocoders import Nominatim geolocator = Nominatim() # Flask app should start in global layout app = Fla...
Python
0
@@ -369,16 +369,41 @@ POST'%5D)%0A +@crossdomain(origin='*')%0A def webh @@ -627,16 +627,16 @@ turn r%0A%0A + def proc @@ -664,442 +664,8 @@ q):%0A -%0A # username = '31c54b1e5bb56c1e8c4a49e22df3254d20eaed3f:'%0A # password = None%0A # clientID = %22b7cfb75957a179cc624695699ce5a136a01a9196%22%0A # yest...
a1c558027cd17eec69a2babb786e35b147ffae6b
add start.html
app.py
app.py
#!flask/bin/python from flask import request, render_template, Flask import os, sys, json import requests app = Flask(__name__) from random import randint from telesign.messaging import MessagingClient from telesign.voice import VoiceClient from flask import request @app.route('/') def index(): return render_te...
Python
0.000002
@@ -338,48 +338,9 @@ l')%0A -%0A@app.route('/profile')%0Adef index():%0A%09%0A%0A +%09 %0A@ap
3b8c55fd13b314dd737b9d50ab0cce8a9d178bb9
save os_driver
occinet/api/openstack_driver.py
occinet/api/openstack_driver.py
# -*- coding: utf-8 -*- # Copyright 2015 Spanish National Research Council # # 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 requ...
Python
0.000003
@@ -832,11 +832,14 @@ he n -ova +eutron API @@ -888,24 +888,216 @@ m_req(req):%0A + %22%22%22Return the tenant id%0A This method retrieve a list of network to which the tenant has access.%0A :param req: the original request%0A :returns: tenant Id%0A %22%22%22%0A try: @@ -...
be3fc40d021ee9a43ca524bcafdcdad7896de9a5
Add remaining completed locales to prod settings.
mrburns/settings/server.py
mrburns/settings/server.py
import os import socket from django.utils.translation import ugettext_lazy as _ from .base import * # noqa SERVER_ENV = os.getenv('DJANGO_SERVER_ENV') SECRET_KEY = os.getenv('SECRET_KEY') DEBUG = TEMPLATE_DEBUG = False ALLOWED_HOSTS = [ # the server's IP (for monitors) socket.gethostbyname(socket.gethostna...
Python
0
@@ -561,16 +561,44 @@ GES = (%0A + ('cs', _('Czech')),%0A @@ -760,32 +760,65 @@ ('Hungarian')),%0A + ('id', _('Indonesian')),%0A ('it', _ @@ -905,67 +905,312 @@ (' -nl', _('Dutch')),%0A ('pt-br', _('Brazilian Portuguese +lt', _('Lithuanian')),%0A ('nl', _('Dutch')),%0...
9320c7dfcc7d890f9a5ad805d9b4d38f6c0795e5
Add SPL filter for Floating IPs
src/nodeconductor_openstack/filters.py
src/nodeconductor_openstack/filters.py
import django_filters from nodeconductor.core import filters as core_filters from nodeconductor.structure import filters as structure_filters from . import models class OpenStackServiceProjectLinkFilter(structure_filters.BaseServiceProjectLinkFilter): service = core_filters.URLFilter(view_name='openstack-detail...
Python
0
@@ -2459,32 +2459,199 @@ ce__uuid',%0A ) +%0A service_project_link = core_filters.URLFilter(%0A view_name='openstack-spl-detail',%0A name='service_project_link__pk',%0A lookup_field='pk',%0A ) %0A%0A class Meta @@ -2777,24 +2777,60 @@ 'status',%0A + 'service_project_link...
6dcc92797e8aa8661adfb67fc1f0aaa00de99709
fix cancellation context
drivers/azure_shell/driver.py
drivers/azure_shell/driver.py
import jsonpickle from cloudshell.cp.azure.azure_shell import AzureShell from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface class AzureShellDriver(ResourceDriverInterface): def __init__(self): """ ctor must be without arguments, it is created with reflection at run ...
Python
0.000001
@@ -612,24 +612,25 @@ None, cancel +l ation_contex @@ -922,16 +922,17 @@ t,cancel +l ation_co
74c15f510e30645212848da128b88e55c5c011c4
remove redundant duplicate tests from node_network_limited
test/functional/node_network_limited.py
test/functional/node_network_limited.py
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.messages import CInv, msg_getdata from test_framework.mininode import NODE_BLOOM, NODE_NETW...
Python
0.000014
@@ -2053,230 +2053,326 @@ # -Now mine some blocks over the NODE_NETWORK_LIMITED + 2(racy buffer ext.) target%0A firstblock = self.nodes%5B0%5D.generate(1)%5B0%5D%0A blocks = self.nodes%5B0%5D.generate(292)%0A block_within_limited_range = blocks%5B-1%5D +Test the RPC service flags%0A asse...
abdb2743ed214ea3b6a72b4163be2d09a8354bd0
Remove aliases of rpc backend for messaging
smaug/rpc.py
smaug/rpc.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.000001
@@ -793,33 +793,8 @@ r',%0A - 'TRANSPORT_ALIASES',%0A %5D%0A%0Af @@ -1066,32 +1066,8 @@ %5B%5D%0A%0A -TRANSPORT_ALIASES = %7B%7D%0A%0A %0Adef @@ -1228,16 +1228,16 @@ t(conf,%0A + @@ -1300,75 +1300,8 @@ mods -,%0A aliases=TRANSPORT_ALIASES )%0A%0A
782c5a1b747e77f0c751a690af01694ea553c272
Reorder imports
nasman/snapshots/models.py
nasman/snapshots/models.py
from datetime import datetime from pathlib import Path from django.db import models from django.utils.timezone import get_default_timezone_name from djorm_pgfulltext.fields import VectorField from djorm_pgfulltext.models import SearchManager import magic import pytz from sitetree.models import TreeItemBase, TreeBase ...
Python
0
@@ -236,16 +236,57 @@ Manager%0A +from fontawesome.fields import IconField%0A import m @@ -358,49 +358,8 @@ se%0A%0A -from fontawesome.fields import IconField%0A %0A%0Acl
6e3395f78a67a58a75d9e95923e5442ee8193d52
Change path to production
newsman/config/settings.py
newsman/config/settings.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ config.py contains most CONSTANTS in the project """ # @author chengdujin # @contact chengdujin@gmail.com # @created Jan 17, 2013 import sys reload(sys) sys.setdefaultencoding('UTF-8') # SERVICES import logging # mongodb client from pymongo.connection import Connection...
Python
0
@@ -1124,17 +1124,16 @@ S tokyo%0A -# LOCAL = @@ -1272,16 +1272,17 @@ prefix%0A +# LOCAL =
01dcc7c3a973e5c363b4789bda86f871d5b10b59
Add opaque context argument to merge() to pass to merge callbacks
edgedb/lang/common/algos/topological.py
edgedb/lang/common/algos/topological.py
## # Copyright (c) 2008-2010 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## from collections import defaultdict, OrderedDict from semantix.utils.datastructures import OrderedSet class UnresolvedReferenceError(Exception): pass class CycleError(Exception): pass def sort(graph, return...
Python
0
@@ -1927,16 +1927,30 @@ , merger +, context=None ):%0A m @@ -1970,16 +1970,88 @@ edDict() +%0A merger_kwargs = %7B'context': context%7D if context is not None else %7B%7D %0A%0A fo @@ -2225,16 +2225,33 @@ erged%5Bm%5D +, **merger_kwargs )%0A%0A
aa097dcacb33fc77a5c9471b65b0f914f0484276
Fix lambda definition so it works in all versions of Python
lingvo/tasks/lm/tools/download_lm1b.py
lingvo/tasks/lm/tools/download_lm1b.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.999985
@@ -2069,14 +2069,12 @@ bda -( k, v -) : (-
736d25a3363dd3abcd06df10f97ebee5f49026fc
make bulk deletion work
localtv/subsite/admin/sources_views.py
localtv/subsite/admin/sources_views.py
import re from django.contrib.auth.models import User from django.core.paginator import Paginator, InvalidPage from django.db.models import Q from django.http import Http404, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template.context import RequestContext from...
Python
0.000001
@@ -4057,16 +4057,46 @@ ts%5Bkey%5D%0A + to_delete = set()%0A @@ -4609,36 +4609,36 @@ -form.fields%5B'DELETE'%5D = True +to_delete.add(form.instance) %0A @@ -4891,16 +4891,89 @@ .save()%0A + for instance in to_delete:%0A instance.delete()%0A
0045135f8de8994ae260922dd5c02164f431f382
Add possibility to remove input
atlas/prodjob/views.py
atlas/prodjob/views.py
import json import requests import logging # import os import re from django.http import HttpResponse from django.shortcuts import render from django.conf import settings import atlas.deftcore.api.client as deft _logger = logging.getLogger('prodtaskwebui') _deft_client = deft.Client(settings.DEFT_AUTH_USER, setting...
Python
0.000001
@@ -2175,16 +2175,33 @@ s(data)%0A + del resp%0A exce
48ea534cdd8cd818255715028a414661c044af15
handle empty build queue case — thanks paltman for the report
manoria_project/apps/manoria/models.py
manoria_project/apps/manoria/models.py
import datetime import random from django.db import models from django.contrib.auth.models import User class Player(models.Model): user = models.ForeignKey(User, related_name="players") name = models.CharField(max_length=20, unique=True) # @@@ points def __unicode__(self): ret...
Python
0
@@ -4150,32 +4150,49 @@ , commit=True):%0A + try:%0A oldest = @@ -4235,16 +4235,69 @@ se()%5B0%5D%0A + except IndexError:%0A oldest = None%0A @@ -4345,16 +4345,39 @@ d times%0A + if oldest:%0A @@ -4426,16 +4426,92 @@ ion_end%0A + else:%0A ...
f4f8b4cba1fbba9f814092af41ed601598743aad
use the mesh generator
CasingSimulations/Run.py
CasingSimulations/Run.py
import time import numpy as np import scipy.sparse as sp import os import json from scipy.constants import mu_0 import discretize import properties from discretize import utils from pymatsolver import Pardiso from SimPEG.EM import FDEM from SimPEG import Utils, Maps from .Model import PhysicalProperties, CasingParame...
Python
0.000001
@@ -320,24 +320,28 @@ eters%0Afrom . +Mesh import Mesh @@ -340,16 +340,25 @@ ort Mesh +Generator %0Afrom . @@ -1844,16 +1844,25 @@ h = Mesh +Generator .deseria
6b652761794a47c35dfa30f035279f2090cb84a9
Update at 2017-07-23 19-24-55
data.py
data.py
import json import random from pathlib import Path import numpy as np import scipy.misc from moviepy.editor import VideoFileClip from tqdm import tqdm class ImageNpzCreator(object): '''Create `image_train.npz`, `image_val.npz` at target_dir from image extracted from video_dirs ''' def __init__(self, n_tr...
Python
0
@@ -3726,32 +3726,143 @@ ys%5Bi%5D = y%0A%0A + n_1 = np.count_nonzero(ys)%0A print('%7B%7D: %7B%7D / %7B%7D = %7B%7D'.format(name, n_1, len(ys), n_1 / len(ys)))%0A npz_path
890ddb3507c89177d561eb20afb86c922bf52bf8
Correct import in demo
demo.py
demo.py
#!/usr/bin/env python3 from flask import Flask, redirect, request from resumable import rebuild, split app = Flask(__name__) def form(action, contents): return ''' <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <form action="{}" method=post> {} <but...
Python
0.000002
@@ -96,13 +96,13 @@ ld, -split +value %0A%0Aap
8a365e7b50350c66650c623dfc9b0d37c170ee90
fix for no reply-to header
ForgeDiscussion/forgediscussion/model/forum.py
ForgeDiscussion/forgediscussion/model/forum.py
import urllib import re from itertools import chain from ming import schema from ming.utils import LazyProperty from ming.orm.mapped_class import MappedClass from ming.orm.property import FieldProperty, RelationProperty, ForeignIdProperty from allura import model as M from allura.lib import utils config = utils.Conf...
Python
0
@@ -1453,24 +1453,16 @@ ).all()%0A - %0A @pr @@ -2492,16 +2492,17 @@ nt_id = +( data.get @@ -2519,17 +2519,18 @@ _to' -, +) or %5B - None - %5D)%5B0 @@ -5448,17 +5448,16 @@ text='', - %0A
9a1cb05ffea340423ffd46eda018655f75e8b878
Fix test_basic_wiring_operations
src/wirecloud/platform/wiring/tests.py
src/wirecloud/platform/wiring/tests.py
# -*- coding: utf-8 -*- # Copyright 2012 Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
Python
0.000017
@@ -4798,24 +4798,33 @@ hup('Test', +new_name= 'Test (1)')%0A @@ -4861,24 +4861,33 @@ hup('Test', +new_name= 'Test (2)')%0A @@ -4928,16 +4928,25 @@ 'Test', +new_name= 'Test (3
b5a583267cd2fe623575a35fa0e12138f8730804
Add comment for adjust_settings_php() function and how it should be reverting databases after a failed build.
drupal/AdjustConfiguration.py
drupal/AdjustConfiguration.py
from fabric.api import * from fabric.contrib.files import * import Revert # Adjust settings.php. Copy the relevant file based on the branch, delete the rest. @task @roles('app_all') def adjust_settings_php(repo, branch, build, buildtype, alias, site): # In some cases it seems jenkins loses write permissions to the...
Python
0
@@ -153,16 +153,358 @@ e rest.%0A +# Failures here should be reverting the build entirely. If it fails to find settings.inc, or symlink in the file, the build will fail and the site being deployed and all sites that have been deployed will remain offline. All sites that have been deployed should have their databases r...
2f789441eefbca50bf9c47dc5beb0d00cd8ce6e4
Update support server invite
help.py
help.py
from typing import Mapping, Optional from discord.ext.commands import Cog, Command, MinimalHelpCommand class BHelp(MinimalHelpCommand): async def send_bot_help(self, mapping: Mapping[Optional[Cog], list[Command]]): await super().send_bot_help(mapping) if ctx := self.context: await ctx...
Python
0
@@ -391,18 +391,18 @@ .gg/ -a3kHCRs9Q8 +HKmAadu5sP %22%0A
5f6a890e678014cdb5f3d7e08098007b517ac816
Remove check command output.
start_jupyter_cm/tests/test_command.py
start_jupyter_cm/tests/test_command.py
import subprocess import os import sys import pytest from subprocess import PIPE from start_jupyter_cm.utils import get_environment_label from start_jupyter_cm.gnome import SPATH def isadmin(): try: # only windows users with admin privileges can read the C:\windows\temp os.listdir(os.path.join([o...
Python
0.000001
@@ -1293,699 +1293,8 @@ xist -%0A output_string_list = output.stdout.decode().splitlines()%0A print(output_string_list)%0A # If running from a conda environment, it should have the name of the%0A # environemnt in brackend if not running from base environment%0A out = %22created%22 if...
f90d96d94257f6da24ed47e86d585a93541ca812
Add haplotypes entrypoint
avedata/api/genomes.py
avedata/api/genomes.py
from ..db import get_db from ..sequence import get_chrominfo from ..sequence import get_reference from ..features import get_genes from ..features import get_annotations from ..features import get_featuretypes from ..variants import get_accessions_list def get(genome_id): genome_info = { 'genome_id': geno...
Python
0.000046
@@ -769,16 +769,17 @@ retu +r n %5B%7B'chr @@ -794,10 +794,10 @@ leng -h t +h %7D,%5D%0A @@ -3801,42 +3801,569 @@ tion -):%0A raise NotImplementedError() +, accessions):%0A %22%22%22%0A Calculate haplotypes for chosen region and set of accessions.%0A %22%22%22%0A db = get_db()%0A query = %22...
af642b214fa63a6e8f0dfe7633b5f19bb6b6d028
Set environment in cache manager instance
novaimagebuilder/BaseOS.py
novaimagebuilder/BaseOS.py
# encoding: utf-8 # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000001
@@ -1214,24 +1214,58 @@ heManager()%0A + self.cache.env = self.env%0A self
8a704533abcf277906cdf57c8cdca55effd542e1
Add positive test case for cloudtrail deadman
tests/alerts/test_cloudtrail_deadman.py
tests/alerts/test_cloudtrail_deadman.py
from positive_alert_test_case import PositiveAlertTestCase from negative_alert_test_case import NegativeAlertTestCase from alert_test_suite import AlertTestSuite class TestAlertCloudtrailDeadman(AlertTestSuite): alert_filename = "cloudtrail_deadman" # This event is the default positive event that will cause...
Python
0.00005
@@ -1122,18 +1122,16 @@ %0A - # Positiv @@ -1146,38 +1146,36 @@ stCase(%0A -# - description=%22Pos @@ -1166,33 +1166,32 @@ description=%22Pos -i tive test case w @@ -1198,44 +1198,22 @@ ith -an +bad event -with somewhat old timestamp +type %22,%0A @@ -1210,34 +1210,32 @@ t type%22,%...
44d14b0ab6bc4f37a266e8dfc9eae77d706014af
Allow creation of actors through a sponsor
rt.py
rt.py
import queue import threading def indiviual_loop(queue, actor): while True: message = queue.get() actor.behavior(message) def global_loop(queue): while True: actor, message = queue.get() actor.behavior(message) class EventLoop(object): loop = None def __init__...
Python
0
@@ -1006,19 +1006,181 @@ s, *args +, **kwargs ):%0A + sponsor = kwargs.pop('sponsor', None)%0A if sponsor is not None:%0A return sponsor.create(cls, *args, **kwargs)%0A else:%0A @@ -1194,24 +1194,28 @@ cls(*args)%0A + acto @@ -1231,16 +1231,20 @@ _loop()%0...
ad22bd13bfc8b9263b08d7e7188da45d945a685d
improve function
Dijkstra-algorithm/DA.py
Dijkstra-algorithm/DA.py
class PathGraph(): pointSet = [] pathLen = {} # {point:{shortMark:Bool,val:{p1:length,p2:length...},...}} def __init__(self, points): self.pointSet = points for p in self.pointSet: self.pathLen[p] = {"shortMark": False, "val": {p: 0}} def add_path(self, start, to, length):...
Python
0.000196
@@ -431,34 +431,105 @@ (self, start, to -): +=None):%0A if not to:%0A return self.pathLen%5Bstart%5D%5B%22val%22%5D%0A %0A try:%0A @@ -1217,33 +1217,23 @@ d(a.path -Len%5B +( start -%5D%5B%22val%22%5D +) .items() @@ -1370,20 +1370,17 @@ n g.path -Len%5B +( thisPoin @@ -1380,24 +1380,17...
6933340547a91f1e51a3405ebf42d91e8be78c92
add test + remove typo
examples/decoding/plot_ems_filtering.py
examples/decoding/plot_ems_filtering.py
""" ============================================== Compute effect-matched-spatial filtering (EMS) ============================================== This example computes the EMS to reconstruct the time course of the experimental effect as described in: Aaron Schurger, Sebastien Marti, and Stanislas Dehaene, "Reducing mu...
Python
0
@@ -3417,98 +3417,335 @@ ms%0A%0A -iter_comparisons = %5B%0A (surrogates, spatial_filter),%0A compute_ems(data, conditions +surrogates_py, spatial_filter_py = compute_ems(data, conditions)%0A%0Aiter_comparisons = %5B%0A (surrogates, spatial_filter),%0A (surrogates_py, spatial_filter_py)%0A%5D%0A%0Afrom num...
759c1083ae63c854ba2ff8e7834ffbe19b5f6da7
Version bump.
sphinx_me.py
sphinx_me.py
#!/usr/bin/env python from __future__ import with_statement from datetime import datetime from os.path import abspath, dirname, exists, join, isdir, splitext from os import chdir, getcwd, listdir, mkdir, sep from subprocess import Popen, PIPE import sys __version__ = "0.1" def install(): """ Main entry poi...
Python
0
@@ -268,16 +268,18 @@ _ = %220.1 +.1 %22%0A%0A%0Adef
2571031f95987ff1aa1ccb79acf2258cf6022804
Read class added
object_detector/file_io.py
object_detector/file_io.py
#-*- coding: utf-8 -*- import glob import os import commentjson as json # Todo : doctest have to be added def read_json(filename): """load json file as dict object Parameters ---------- filename : str filename of json file Returns ---------- conf : dict ...
Python
0
@@ -19,16 +19,28 @@ -*-%0D%0A%0D%0A +import abc%0D%0A import g @@ -87,53 +87,252 @@ on%0D%0A -%0D%0A# Todo : doctest have to be added%0D%0A +from scipy import io%0D%0A%0D%0Aclass ReadFile(object):%0D%0A __metaclass__ = abc.ABCMeta%0D%0A %0D%0A def __init__(self):%0D%0A pass%0D%0A %0D%0A @abc.a...
1667b7450a79f5014770dfb04a0c7544e45d8519
Create indices on the timeseries database
emission/core/get_database.py
emission/core/get_database.py
from pymongo import MongoClient import os import json def get_mode_db(): current_db = MongoClient().Stage_database Modes=current_db.Stage_Modes return Modes def get_moves_db(): current_db = MongoClient('localhost').Stage_database MovesAuth=current_db.Stage_user_moves_access return ...
Python
0
@@ -26,16 +26,32 @@ Client%0D%0A +import pymongo%0D%0A import o @@ -4196,24 +4196,706 @@ timeseries%0D%0A + TimeSeries.create_index(%5B(%22user_id%22, pymongo.HASHED)%5D)%0D%0A TimeSeries.create_index(%5B(%22metadata.key%22, pymongo.HASHED)%5D)%0D%0A TimeSeries.create_index(%5B(%22metadata.write_ts%22, pymo...
a906f16490c916db6d1db182f0b477fa8c3bb03c
remove commented code
onadata/libs/data/query.py
onadata/libs/data/query.py
from django.conf import settings from django.db import connection from django.utils.translation import ugettext as _ from onadata.libs.utils.common_tags import SUBMISSION_TIME def _count_group(field, name, xform): if using_postgres: result = _postgres_count_group(field, name, xform) else: rai...
Python
0
@@ -3014,171 +3014,8 @@ ld)) -%0A #elif len(result) %3E 0 and result%5B0%5D%5Bname%5D is None:%0A # # strip out the first result if it has a count of 0 and value of None%0A # result = result%5B1:%5D %0A%0A
912ac42445c6b040346bd255f5628ce1713cf03b
Add board view
openacademy/__openerp__.py
openacademy/__openerp__.py
# -*- coding: utf-8 -*- { 'name': "Open Academy", 'summary': """Manage trainings""", 'author': "Vauxoo", 'website': "http://www.vauxoo.com", # Categories can be used to filter modules in modules listing # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xm...
Python
0
@@ -466,16 +466,24 @@ %5B'base' +,'board' %5D,%0A%0A @@ -805,24 +805,69 @@ eport.xml',%0A + 'view/openacademy_session_board.xml'%0A %5D,%0A #
d14c446c7a4a2729045e59a07892a4391796dfae
Exclude metadata and events when requesting execution info
valohai_cli/commands/execution/info.py
valohai_cli/commands/execution/info.py
import click from valohai_cli.ctx import get_project from valohai_cli.messages import print_table from valohai_cli.utils import humanize_identifier ignored_keys = { 'commit', 'counter', 'ctime', 'events', 'id', 'inputs', 'metadata', 'outputs', 'parameters', 'project', 'url'...
Python
0
@@ -202,16 +202,35 @@ ctime',%0A + 'environment',%0A 'eve @@ -231,24 +231,24 @@ 'events',%0A - 'id',%0A @@ -319,24 +319,36 @@ 'project',%0A + 'tags',%0A 'url',%0A @@ -358,35 +358,16 @@ 'urls',%0A - 'environment',%0A %7D%0A%0A%0A@cli @@ -535,16 +535,25 @@ counter( +%0A counte...
a6d6628552f94fd2ecd7413345fb8e4cc7bbf888
Declare static url in example settings
valuenetwork/local_settings_example.py
valuenetwork/local_settings_example.py
""" You want a local_settings.py file in the same directory as settings.py. settings.py will import it, if it exists and local_settings will override settings for the setting with the same name. You also want your localsettings.py to be different on a development machine and a server, ...
Python
0.00001
@@ -1211,16 +1211,41 @@ %7D%0A%7D%0A%0A +STATIC_URL = %22/static/%22%0A%0A # valuea
0986de86f00e932fc9f58ae4ab253a5e12e55454
Change default verbose
vd.py
vd.py
#!/usr/bin/env python # Copyright (C) 2012 Nathan Charles # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pro...
Python
0.000001
@@ -1069,12 +1069,11 @@ e = -Fals +Tru e):%0A
e10b0e89ae8e4a74ee6159214668a5e8761ff767
Add timestamps.
loadkit/core/manifest.py
loadkit/core/manifest.py
import json import collections from loadkit.util import json_default, json_hook class Manifest(dict): """ A manifest has metadata on a package. """ def __init__(self, key): self.key = key self.reload() def reload(self): if self.key.exists(): self.update(json.load(se...
Python
0.000064
@@ -24,16 +24,46 @@ ections%0A +from datetime import datetime%0A %0A%0Afrom l @@ -389,16 +389,67 @@ else:%0A + self%5B'created_at'%5D = datetime.utcnow()%0A @@ -496,32 +496,79 @@ def save(self):%0A + self%5B'updated_at'%5D = datetime.utcnow()%0A content @@ -1264,17 +1264,203 ...
bdc77257df8e050db968537006ddc36f1853c60a
Fix CMSSW dataset for ntuplizing.
lobster/cmssw/dataset.py
lobster/cmssw/dataset.py
import logging import math import os import pickle import re import requests from retrying import retry import xdg.BaseDirectory from lobster.core.dataset import DatasetInfo from lobster.util import Configurable from dbs.apis.dbsClient import DbsApi from WMCore.Credential.Proxy import Proxy from WMCore.DataStructs.Lu...
Python
0
@@ -3141,19 +3141,24 @@ elf.dbs_ -url +instance = 'http @@ -3980,35 +3980,40 @@ rapper(self.dbs_ -url +instance , ca_info=cred.g @@ -5046,19 +5046,24 @@ elf.dbs_ -url +instance , ca_inf
ef9e6743f5639b982af8b16cee01c1bb22c6dd59
Fix bugzilla + tw2.
fedoracommunity/widgets/package/bugs.py
fedoracommunity/widgets/package/bugs.py
import tw2.core as twc import datetime from fedoracommunity.widgets.grid import Grid from fedoracommunity.connectors.api import get_connector class BugStatsWidget(twc.Widget): template = "mako:fedoracommunity.widgets.package.templates.bugs_stats_widget" id = twc.Param(default='bugs_widget') kwds = twc.Pa...
Python
0
@@ -464,46 +464,8 @@ 6')%0A - package = twc.Param(default=None)%0A @@ -1950,34 +1950,8 @@ m()%0A - package = twc.Param()%0A @@ -3131,34 +3131,8 @@ m()%0A - package = twc.Param()%0A
618a27676476b90c650b1ed875b489775fa82068
Accept time strings for new keyword
src/SnmpLibrary/traps.py
src/SnmpLibrary/traps.py
# Copyright 2015 Kontron Europe GmbH # # 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 w...
Python
0.999913
@@ -3612,16 +3612,17 @@ r_name)%0A +%0A @@ -3671,16 +3671,65 @@ er_name%5D +%0A timeout = utils.timestr_to_secs(timeout) %0A%0A
493e9314e5c37a2198c583e50c8d313015b2e8a5
Update failing line in tests
vinaigrette/tests/test_makemessages.py
vinaigrette/tests/test_makemessages.py
import polib import os from django.core import management from django.test import TestCase from django.utils import translation class TestVinaigretteMakemessages(TestCase): def setUp(self): self.popath = 'locale/fr/LC_MESSAGES/django.po' self.mopath = 'locale/fr/LC_MESSAGES/django.mo' sel...
Python
0
@@ -2296,16 +2296,26 @@ catalog. +_catalogs. clear()%0A
78285953627e4e70e2abc28aa4897bade1d4babf
Update __init__.py
loggerloader/__init__.py
loggerloader/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import os try: from loggerloader.loader import * except ImportError: from .loggerloader import * __version__ = '0.4.3' __author__ = 'Paul Inkenbrandt' __name__ = 'loggerloader' __all__ = ['new_trans_imp...
Python
0.000072
@@ -184,22 +184,16 @@ from . -logger loader i
83f99100bc0227ba5fc91efb7b1d797ce1735491
use ismlmux for smooth-streaming
flumotion/component/muxers/fmp4/fmp4.py
flumotion/component/muxers/fmp4/fmp4.py
# -*- Mode: Python; test-case-name: flumotion.muxers.mpegts.mpegts -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2009,2010 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # flumotion-fragmented-streaming - Flumotion Advanced fragmented streaming # Licensees having purc...
Python
0.000001
@@ -1131,19 +1131,20 @@ exists(' -mp4 +isml mux')%0A @@ -1345,21 +1345,23 @@ ' -mp4 +isml mux', ' -mp4 +isml mux' @@ -2183,11 +2183,12 @@ = ' -mp4 +isml mux
66d1bce2cb497954749b211a26fd00ae4db6f7e7
Remove random bit of code
foodsaving/conversations/serializers.py
foodsaving/conversations/serializers.py
from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from rest_framework.exceptions import PermissionDenied from foodsaving.conversations.models import Conversation, ConversationMessage class ConversationSerializer(serializers.ModelSerializer): class Meta: model ...
Python
0
@@ -433,174 +433,8 @@ %5D%0A%0A - def retrieve(self, validated_data):%0A user = self.context%5B'request'%5D.user%0A return ConversationMessage.objects.create(author=user, **validated_data)%0A%0A %0Acla
efa61b2948703eaee4ae86910f75276a1cc39ccc
update to MVP
MVP.py
MVP.py
import json
Python
0
@@ -6,8 +6,849 @@ rt json%0A +import requests%0Aimport time%0Aimport urrlib2%0A%0A%0A%0A%0A%0Adef getTemp(int turbine):%0A string url ='https://turbine-farm.run.aws-usw02-pr.ice.predix.io/api/turbines/' + turbine + '/sensors/temperature'%0A float temperature = urrlib2.urlopen(url).read()%0A return voltage%0A%...
4854ca20caa50204d847630c8bf95a0bba399bdb
Fix typo introduced in commit:86a6174
web/blueprints/dormitories/__init__.py
web/blueprints/dormitories/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2014 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. """ web.blueprints.dormitories ~~~~~~~~~~~~~~ This module defines view func...
Python
0.000005
@@ -4763,9 +4763,8 @@ %22%7B: -%25 02d%7D
23f68acc3856178da682b09c401ee81436b84ee9
Fix datasetname
src/auspex/filters/io.py
src/auspex/filters/io.py
# Copyright 2016 Raytheon BBN Technologies # # 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 __all__ = ['WriteToFile', 'DataBuffer'] import o...
Python
0.000942
@@ -1452,16 +1452,60 @@ ='main') +%0A datasetname = Parameter(default='data') %0A%0A de @@ -1564,22 +1564,20 @@ setname= -'data' +None , **kwar @@ -1817,16 +1817,22 @@ asetname +.value = datas @@ -2105,16 +2105,22 @@ asetname +.value , %22Datas @@ -2450,16 +2450,22 @@ asetname +.value , self.d
111c30f5530c7b5abd785b7640e1790e12f36439
Print config file name along with config errors
git-keeper-server/gkeepserver/gkeepd.py
git-keeper-server/gkeepserver/gkeepd.py
# Copyright 2016, 2017 Nathan Sommer and Ben Coleman # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program ...
Python
0
@@ -4214,24 +4214,88 @@ Error as e:%0A + error = 'Error in %7B%7D%5Cn%7B%7D'.format(config.config_path, e)%0A sys. @@ -4300,16 +4300,20 @@ s.exit(e +rror )%0A%0A #
7437f6275b3da51281269defe01877484ed505c9
remove hardcoded test string
main/tests/test_index.py
main/tests/test_index.py
from django.test import TestCase from django.urls import reverse from django.utils.translation import activate class IndexViewsTest(TestCase): def test_index(self): """ The index view. """ activate('en') url = reverse('main:index') response = self.client.get(url) ...
Python
0.999978
@@ -588,60 +588,8 @@ ss') -%0A self.assertContains(response, '%CE%A4%CE%B9 %CE%BA%CE%AC%CE%BD%CE%BF%CF%85%CE%BC%CE%B5') %0A%0A
a99a8ea2b1e7d3a0d9274f451aeb79c03bdbb0b9
Update version.py
manager_utils/version.py
manager_utils/version.py
__version__ = '0.7.0'
Python
0.000001
@@ -12,11 +12,11 @@ = '0.7. -0 +1 '%0A
b298c28fbdcfc680ff105255158961f930a60d9e
Change name of test file
api.py
api.py
#!/usr/bin/env python ''' Flask app that provides a RESTful API to the multiscanner. Proposed supported operations: GET / ---> Test functionality. {'Message': 'True'} GET /api/v1/tasks/list ---> Receive list of tasks in multiscanner GET /api/v1/tasks/<task_id> ---> receive report in JSON format GET /api/v1/tasks/dele...
Python
0.000001
@@ -715,13 +715,8 @@ opt/ -qtip/ grep
22e65c38ec3e0995e8b07436ef05493ac1347b1f
Check ping on api backend
api.py
api.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests from bottle import route, run, response, request def jsonp(request, dictionary): if request.query.callback: return "%s(%s)" % (request.query.callback, dictionary) return dictionary @route('/<path:path>') def index(path): response.set...
Python
0.000001
@@ -54,16 +54,28 @@ requests +%0Aimport json %0A%0Afrom b @@ -608,21 +608,36 @@ j))%0A +%0A -print re%0A +d = json.dumps(re.text) %0A @@ -721,24 +721,25 @@ script%22%0A +%0A d = re.t @@ -734,19 +734,140 @@ -d = re.text +if path == 'ping' and re.text == %22OK%22:%0A d = %7B%22pi...
b01cdae6ed0e41934d95cd3191e6cd5046d52fdb
fix for migration where no favorites exist
wooey/migrations/0019_userfile_data.py
wooey/migrations/0019_userfile_data.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.apps import apps from django.contrib.contenttypes.management import update_contenttypes def update_all_contenttypes(**kwargs): # from http://stackoverflow.com/questions/29550102/importerror-cannot-import-...
Python
0
@@ -1213,16 +1213,28 @@ %0A + favorites = Favorit @@ -1287,16 +1287,69 @@ =obj.id) +%0A if favorites.count():%0A favorites .update(
919e141a367ce7dc05d55958f3a5f7eda5f4232a
sort languages by code
mediasnakebooks/views.py
mediasnakebooks/views.py
import os import re import time import json from django.conf import settings from django.http import HttpResponse, Http404, HttpResponseForbidden, StreamingHttpResponse from django.core.cache import cache from django.views.decorators.cache import cache_page from django.views.decorators.cache import cache_control from ...
Python
0.999933
@@ -1434,16 +1434,33 @@ objects. +order_by('code'). all()%5D%0A%0A
0f181735205fde964af301a19805879b134e1bba
Fix typo
main.py
main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from urllib2 import Request, urlopen, HTTPError, URLError from csv_converter import CsvConverter from stock_updater import StockUpdater import sqlite3 import mysql.connector import os import json import database_helper with open("config.json") as f: config = json...
Python
0.999999
@@ -291,20 +291,16 @@ %22) as f: - %0A con @@ -1046,24 +1046,35 @@ config%5B%22 -password +database_connection %22%5D%5B%22pass
8ed53f96a6a780bcf6fa4b8da9f8fba16f9fec17
Remove redundant imports
main.py
main.py
#!/usr/bin/env python #encoding:utf-8 #author:dbr/Ben #project:tvnamer #repository:http://github.com/dbr/tvnamer #license:Creative Commons GNU GPL v2 # http://creativecommons.org/licenses/GPL/2.0/ """tvnamer - Automagical TV episode renamer Uses data from www.thetvdb.com (via tvdb_api) to rename TV episode files from...
Python
0.867839
@@ -653,27 +653,16 @@ erAbort, - UserAbort, Invalid @@ -666,17 +666,17 @@ lidPath, -%0A + NoValidF @@ -690,17 +690,17 @@ ndError, - +%0A InvalidF @@ -727,25 +727,25 @@ sFoundError, -%0A + InvalidConfi @@ -769,17 +769,17 @@ figFile, - +%0A NoValidF @@ -794,25 +794,34 @@ dError, -UserAb +DataRetrievalErr...
345c886dec98bc6d104a975c7fdb871d19543e06
Add unique ID and device info to Nest camera (#16846)
homeassistant/components/camera/nest.py
homeassistant/components/camera/nest.py
""" Support for Nest Cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.nest/ """ import logging from datetime import timedelta import requests from homeassistant.components import nest from homeassistant.components.camera import (PLATFORM_...
Python
0
@@ -1790,16 +1790,465 @@ ._name%0A%0A + @property%0A def unique_id(self):%0A %22%22%22Return the serial number.%22%22%22%0A return self.device.device_id%0A%0A @property%0A def device_info(self):%0A %22%22%22Return information about the device.%22%22%22%0A return %7B%0A ...
ba754c507a6d172053fb75d062a7035e73e79779
Add --dbdir flag to wrapupdater
mesonwrap/wrapupdater.py
mesonwrap/wrapupdater.py
#!/usr/bin/env python # Copyright 2015 The Meson development 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 # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by appli...
Python
0
@@ -1146,16 +1146,64 @@ r(prog)%0A + parser.add_argument('--dbdir', default='.')%0A pars @@ -1354,16 +1354,32 @@ Updater( +dbdir=args.dbdir )%0A m.
7e066e11ad54da5fba99dcf503dd0d82d536587b
Remove left-over
homeassistant/components/sensor/rest.py
homeassistant/components/sensor/rest.py
""" homeassistant.components.sensor.rest ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The rest sensor will consume JSON responses sent by an exposed REST API. Configuration: To use the rest sensor you will need to add something like the following to your configuration.yaml file. sensor: platform: arest name: REST sens...
Python
0.000001
@@ -1863,21 +1863,8 @@ e)%0A%0A - dev = %5B%5D%0A @@ -2061,29 +2061,8 @@ )%5D)%0A - add_devices(dev)%0A %0A%0Acl
281fbe1dfac1f7a93f51622578b55075977a9fa5
Update wilight for new fan entity model (#45869)
homeassistant/components/wilight/fan.py
homeassistant/components/wilight/fan.py
"""Support for WiLight Fan.""" from pywilight.const import ( DOMAIN, FAN_V1, ITEM_FAN, WL_DIRECTION_FORWARD, WL_DIRECTION_OFF, WL_DIRECTION_REVERSE, WL_SPEED_HIGH, WL_SPEED_LOW, WL_SPEED_MEDIUM, ) from homeassistant.components.fan import ( DIRECTION_FORWARD, SPEED_HIGH, ...
Python
0
@@ -298,57 +298,8 @@ RD,%0A - SPEED_HIGH,%0A SPEED_LOW,%0A SPEED_MEDIUM,%0A @@ -454,16 +454,136 @@ ssistant +%0Afrom homeassistant.util.percentage import (%0A ordered_list_item_to_percentage,%0A percentage_to_ordered_list_item,%0A) %0A%0Afrom . @@ -605,25 +605,33 @@ Device%0A%0A -SUPPORTED +ORD...
7e15cbb885a5d959df34fc24fcabea5b5ee8433a
Fix pep8 fail (lines too long)
mezzanine/pages/views.py
mezzanine/pages/views.py
from django.contrib.admin.views.decorators import staff_member_required from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 from mezzanine.conf import settings from mezzanine.pages import page_processors from mezzanine.pa...
Python
0
@@ -962,23 +962,16 @@ %0A - for i, old_sib @@ -978,85 +978,151 @@ ling - in enumerate(Page.objects.filter(parent_id=old_parent_id).order_by('_order') +s = Page.objects.order_by('_order').filter(%0A parent_id=old_parent_id,%0A )%0A for i, old_sibling in enumerate(old_siblings ):%0A