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
bb4188cd080c5b089bc54c2ba7f5b0cdbd6ed32d
Convert True to string for image registry
sahara/utils/openstack/images.py
sahara/utils/openstack/images.py
# Copyright (c) 2013 Mirantis 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 applicable law or agreed to in writ...
Python
0.999999
@@ -3262,12 +3262,14 @@ ag: +' True +' for
bbfa9c3135ebdc5a99257d62556b691f8c87a26c
Update irrigate.py
device/src/irrigate.py
device/src/irrigate.py
#!/usr/bin/env python #In this project, I use a servo to simulate the water tap. #Roating to 90 angle suggest that the water tap is open, and 0 angle means close. #Pin connection: #deep red <--> GND #red <--> VCC #yellow <--> signal(X1) from pyb import Servo servo=Servo(1) # X1 def irrigate_start(): servo.angl...
Python
0.000001
@@ -236,16 +236,150 @@ gnal(X1) +%0A%0A#Update!!!!!%0A#Use real water pump(RS360) to irrigate the plants, need to use relay to drive the pump which is powered by 5V power.%0A# %0Afrom py
173d7ffefe10e8896055bd5b41272c2d0a1f8889
Update version to 0.1.6 for upcoming release
pdblp/_version.py
pdblp/_version.py
__version__ = "0.1.5"
Python
0
@@ -16,7 +16,7 @@ 0.1. -5 +6 %22%0A
f028a004adf955115cf87354a045350d7d147b3e
Fix the warnings unit test.
tests/unit/utils/warnings_test.py
tests/unit/utils/warnings_test.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details :license: Apache 2.0, see LICENSE for more details. tests.unit.utils.warnings_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Test ``salt.utils.warn_...
Python
0
@@ -2357,32 +2357,34 @@ r'%5C'0.17 +.0 %5C' is released. @@ -2408,34 +2408,29 @@ s now %5C'0.17 +.0 %5C'. - Please '%0A @@ -2430,32 +2430,39 @@ r' +Please remove the warni @@ -2868,32 +2868,34 @@ r'%5C'0.17 +.0 %5C' is released. @@ -2919,34 +2919,29 @@ s now %5C'0.17...
b87ebc9dbbc33928345a83ac8ea0ce71806ac024
simplify play down to wall and standard defense
soccer/gameplay/plays/Defend_Restart_Defensive/BasicDefendRestartDefensive.py
soccer/gameplay/plays/Defend_Restart_Defensive/BasicDefendRestartDefensive.py
import main import robocup import behavior import constants import enum import standard_play import tactics.positions.submissive_goalie as submissive_goalie import tactics.positions.submissive_defender as submissive_defender import evaluation.opponent as eval_opp import tactics.positions.wing_defender as wing_defender...
Python
0.000027
@@ -356,23 +356,28 @@ tactics. -defense +wall as wall %0Aimport @@ -412,114 +412,25 @@ %0A## -Play that uses submissive defenders to defend%0A# an attack close to our goal.%0A#%0A# By default, we will +Restart that use +s sta @@ -447,85 +447,57 @@ nse -(two submissive%0A# defenders, one goalie) and additi...
abae242bbcdc3eefcd0ab1ff29f660f89d47db1a
Add absolute URL for Surprises
mirigata/surprise/models.py
mirigata/surprise/models.py
from django.db import models class Surprise(models.Model): link = models.URLField(max_length=500) description = models.TextField(max_length=1000)
Python
0
@@ -1,8 +1,53 @@ +from django.core.urlresolvers import reverse%0A from dja @@ -190,12 +190,111 @@ ength=1000)%0A +%0A def get_absolute_url(self):%0A return reverse('surprise-detail', kwargs=%7B%22pk%22: self.id%7D)%0A
0aa23de3f1dc2b3bc477bb905fcc7054430bed26
Clarify test purpose
src/unix/tests/test_resetnetwork_hostname.py
src/unix/tests/test_resetnetwork_hostname.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2011 Openstack, LLC. # 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...
Python
0.000005
@@ -1795,24 +1795,32 @@ hostname to +Red Hat /etc/sysconf @@ -1825,32 +1825,32 @@ nfig/network%22%22%22%0A - infile = @@ -2179,24 +2179,32 @@ hostname in +Red Hat /etc/sysconf @@ -2583,24 +2583,31 @@ hostname in +Debian /etc/hostnam @@ -2782,16 +2782,27 @@ name to +Arch Linux /etc/rc. @@ -3221...
307ed9b27e17efb990e198c5f3e059636eedb8d2
Add event types for allowed address pairs update action [WAL-3481]
src/waldur_openstack/openstack_tenant/log.py
src/waldur_openstack/openstack_tenant/log.py
from waldur_core.logging.loggers import EventLogger, event_logger from waldur_core.structure import models as structure_models from . import models class ResourceActionEventLogger(EventLogger): resource = structure_models.NewResource action_details = dict class Meta: event_types = ( ...
Python
0
@@ -2212,32 +2212,218 @@ al_ips_failed',%0A + 'resource_update_allowed_address_pairs_scheduled',%0A 'resource_update_allowed_address_pairs_succeeded',%0A 'resource_update_allowed_address_pairs_failed',%0A 'res
c0fdbf78fcc6b74086cc40e8e0deb273dee6d03c
Update BUILD_OSS to 4666.
src/data/version/mozc_version_template.bzl
src/data/version/mozc_version_template.bzl
# Copyright 2010-2021, Google Inc. # 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 ...
Python
0
@@ -1606,17 +1606,17 @@ SS = 466 -0 +6 %0A%0A# Numb
c5225c00191595b6d1a824ee808465e0c488769b
Add missing arg which didn't make it because of the bad merge conflict resolution.
st2stream/st2stream/controllers/v1/stream.py
st2stream/st2stream/controllers/v1/stream.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
@@ -1454,16 +1454,32 @@ all(self +, requester_user ):%0A
1df3dc91f71bf2a02b059d414ea5b041a382f1ad
change CSS selectors
shot.py
shot.py
# -*- coding: utf-8 -*- import redis import urllib2 from bs4 import BeautifulSoup from datetime import datetime url = 'http://www.x-kom.pl' FORMAT_DATETIME = '%Y-%m-%d %H:%M:%S.%f' redis_server = redis.Redis(host='localhost', port=6379) def get_number(number): return float(number.strip().split()[0].replace(',',...
Python
0.000001
@@ -552,30 +552,21 @@ p, ' -div +p ', ' -killer- product- titl @@ -561,20 +561,19 @@ product- -titl +nam e')%0A%09pri @@ -607,14 +607,11 @@ ', ' -killer +new -pri @@ -660,16 +660,11 @@ ', ' -discount +old -pri
8b944f04ebf9b635029182a3137e9368edafe9d2
Handle exception for bad search strings
pgsearch/utils.py
pgsearch/utils.py
from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery import shlex import string def parseSearchString(search_string): search_strings = shlex.split(search_string) translator = str.maketrans({key: None for key in string.punctuation}) search_strings = [s.translate(translator) for ...
Python
0.000006
@@ -141,16 +141,29 @@ tring):%0A + try:%0A sear @@ -206,16 +206,20 @@ ng)%0A + + translat @@ -280,16 +280,20 @@ ation%7D)%0A + sear @@ -355,16 +355,56 @@ trings%5D%0A + except:%0A search_strings = %5B%5D%0A retu
6df0e3efd239f7be073057ede44033dc95064a23
Fix StringIO import
teuthology/task/tests/test_run.py
teuthology/task/tests/test_run.py
import logging import pytest from StringIO import StringIO from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) class TestRun(object): """ Tests to see if we can make remote procedure calls to the current cluster """ def test_command_failed_label(self, ctx, config...
Python
0.000001
@@ -28,24 +28,18 @@ t%0A%0Afrom -StringIO +io import
3c1a658195145ff1c0f20b677c50f5932e5ac66a
fix yield statement
dusty/compiler/compose/__init__.py
dusty/compiler/compose/__init__.py
import yaml import pprint from .. import get_assembled_specs from ...source import repo_path from ..port_spec import port_spec_document from ... import constants def write_compose_file(): compose_dict = get_compose_dict() print pprint.pformat(compose_dict) with open("{}/docker-compose.yml".format(constant...
Python
0.000001
@@ -445,32 +445,63 @@ n to %7B%7D%22.format( +%22%7B%7D/docker-compose.yml%22.format( constants.COMPOS @@ -506,16 +506,12 @@ OSE_ -YML_PATH +DIR) ).en
cc5c52084fedf172d11534a465e155b8948da9b7
Add support for command arguments
skal.py
skal.py
# Copyright 2012 Loop Lab # # 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, ...
Python
0.000113
@@ -574,301 +574,8 @@ .%0A%0A%0A -# TODO: Implement tests and remove sloppy test class and main%0A# TODO: Detect subcommands from another module%0A# TODO: Detect subcommands from each module in a package%0A# TODO: Don't crash app if a subcommand is broken, just don't add it%0A# TODO: Create decorators for each subcomm...
8e24d3139c11428cda1e07da62ff007be9c77424
Add convenience method.
abilian/testing/__init__.py
abilian/testing/__init__.py
"""Base stuff for testing. """ import os import subprocess import requests assert not 'twill' in subprocess.__file__ from flask.ext.testing import TestCase from abilian.application import Application __all__ = ['TestConfig', 'BaseTestCase'] class TestConfig(object): SQLALCHEMY_DATABASE_URI = "sqlite://" SQ...
Python
0
@@ -1084,16 +1084,89 @@ dpoint%0A%0A + def assert_302(self, response):%0A self.assert_status(response, 302)%0A%0A #%0A #
fa037d3ab37d49ac8c685ee0de4d78aa63b1a097
Fixing the object_name freezig
south/creator/freezer.py
south/creator/freezer.py
""" Handles freezing of models into FakeORMs. """ import sys from django.db import models from django.contrib.contenttypes.generic import GenericRelation from south.orm import FakeORM from south import modelsinspector def freeze_apps(apps): """ Takes a list of app labels, and returns a string of their froze...
Python
0.999984
@@ -2402,29 +2402,24 @@ ct_name'%5D = -repr( model._meta. @@ -2425,25 +2425,50 @@ .object_name -) + # Special: not eval'able. %0A fields%5B
405e40f73d8eb2464f49b90ed48d0a51591d8063
Fix import in example
examples/imdb_cnn.py
examples/imdb_cnn.py
# coding: utf8 from __future__ import unicode_literals import tqdm from thinc.i2v import StaticVectors, HashEmbed from thinc.v2v import Model, Maxout, Softmax from thinc.t2t import ExtractWindow from thinc.t2t import ParametricAttention from thinc.t2v import Pooling, sum_pool from thinc.misc import LayerNorm as LN fro...
Python
0.000002
@@ -547,35 +547,36 @@ item%0Afrom thinc. -api +misc import FeatureE
7292b2d276db056870993a108466fccc18debcae
Update count-different-palindromic-subsequences.py
Python/count-different-palindromic-subsequences.py
Python/count-different-palindromic-subsequences.py
# Time: O(n^2) # Space: O(n^2) class Solution(object): def countPalindromicSubsequences(self, S): """ :type S: str :rtype: int """ def dp(i, j, prv, nxt, lookup): if lookup[i][j] is not None: return lookup[i][j] result = 1 ...
Python
0.000001
@@ -26,16 +26,1008 @@ O(n%5E2)%0A%0A +# Given a string S, find the number of different non-empty palindromic subsequences in S,%0A# and return that number modulo 10%5E9 + 7.%0A#%0A# A subsequence of a string S is obtained by deleting 0 or more characters from S.%0A#%0A# A sequence is palindromic if it is equal to the ...
358de4c3ce20569e217b1caf5c25ce826b536bbc
Reformat datastructuretools
supriya/tools/datastructuretools/__init__.py
supriya/tools/datastructuretools/__init__.py
# -*- encoding: utf-8 -*- r''' Tools for working with generic datastructures. ''' from abjad.tools import systemtools systemtools.ImportManager.import_structured_package( __path__[0], globals(), )
Python
0.000001
@@ -21,19 +21,19 @@ 8 -*-%0A%0Ar -''' +%22%22%22 %0ATools f @@ -76,11 +76,11 @@ es.%0A -''' +%22%22%22 %0A%0Afr
0e2bc29486fc1e09b6d90ccdbe21095f73848d48
remove the event listener check
speakerbot/listenable.py
speakerbot/listenable.py
from dynamic_class import Singleton class NotEventException(Exception): pass class GlobalEventDispatcher(object): """not quite there yet""" __metaclass__ = Singleton def __init__(self): pass def event(method): """Must be called first in a decorator chain, otherwise we lose the correct n...
Python
0.000004
@@ -1473,24 +1473,80 @@ %0A +#Hell is interacting with other people's code.%0A # if not hasat @@ -1588,24 +1588,25 @@ ):%0A%0A +# raise No
79fd01202255e0b00ca2fe90834dbd4e15dd84bc
Print NVIDIA license notice only when actually downloading the CUDA headers repository.
third_party/cuda/dependencies.bzl
third_party/cuda/dependencies.bzl
"""CUDA headers repository.""" def _download_nvidia_headers(repository_ctx, output, url, sha256, strip_prefix): # Keep the mirror up-to-date manually (see b/154869892) with: # /google/bin/releases/tensorflow-devinfra-team/cli_tools/tf_mirror <url> repository_ctx.download_and_extract( url = [ ...
Python
0
@@ -575,32 +575,461 @@ epository_ctx):%0A + build_file = Label(%22//third_party/cuda:cuda_headers.BUILD%22)%0A%0A print(%22%5Cn%5C033%5B22;33mNOTICE:%5C033%5B0m The following command will download %22 +%0A %22NVIDIA proprietary software. By using the software you agree to %22 +%0A %22comply wit...
9098692bf431b4947da96dc054fe8e1559e27aa5
Update hexagon_nn_headers to v1.10.3.1.3 Changes Includes: * Support soc_id:371 * New method exposed that returns the version of hexagon_nn used in libhexagon_interface.so
third_party/hexagon/workspace.bzl
third_party/hexagon/workspace.bzl
"""Loads the Hexagon NN Header files library, used by TF Lite.""" load("//third_party:repo.bzl", "third_party_http_archive") def repo(): third_party_http_archive( name = "hexagon_nn", sha256 = "4cbf3c18834e24b1f64cc507f9c2f22b4fe576c6ff938d55faced5d8f1bddf62", urls = [ "https:/...
Python
0
@@ -213,72 +213,72 @@ = %22 -4cbf3c18834e24b1f64cc507f9c2f22b4fe576c6ff938d55faced5d8f1bddf62 +281d46b47f7191f03a8a4071c4c8d2af9409bb9d59573dc2e42f04c4fd61f1fd %22,%0A @@ -444,17 +444,17 @@ .10.3.1. -2 +3 .tgz%22,%0A
2a2224a2babaf20919c0091bcfd4b6109eadcecb
Fix issue with internal user and auditor
polyaxon/api/repos/views.py
polyaxon/api/repos/views.py
import logging import os from rest_framework.generics import RetrieveUpdateDestroyAPIView, get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.settings import api_settings from django.conf import settings from django.http import Htt...
Python
0.000004
@@ -1705,16 +1705,20 @@ if +not is_inter
86391ed76c49578321c026187f159c53c2cf4ed1
Fix slack welcome message display bug and add user handle
orchestra/slack.py
orchestra/slack.py
import base64 from uuid import uuid1 from django.conf import settings import slacker from orchestra.utils.settings import run_if class SlackService(object): """ Wrapper slack service to allow easy swapping and mocking out of API. """ def __init__(self, api_key): self._service = slacker.Slack...
Python
0
@@ -597,32 +597,31 @@ ry:%0A -response +user_id = slack.gro @@ -621,175 +621,119 @@ ack. -groups.invite(project.slack_group_id,%0A slack.users.get_user_id(%0A worker.slack_username) +users.get_user_id(worker.slack_username)%0A ...
e7b50269a6d83234b283f769265bf474666b6cd2
Update project model with property has_description
polyaxon/projects/models.py
polyaxon/projects/models.py
import uuid from django.conf import settings from django.core.validators import validate_slug from django.db import models from libs.blacklist import validate_blacklist_name from libs.models import DescribableModel, DiffModel class Project(DiffModel, DescribableModel): """A model that represents a set of experi...
Python
0
@@ -1126,24 +1126,108 @@ f, 'repo')%0A%0A + @property%0A def has_description(self):%0A return bool(self.description)%0A%0A @propert
76bf774f3af2fb4fc2518945944b9f64c413712a
Simplify "cursor" function in "misc" module
autoload/breeze/utils/misc.py
autoload/breeze/utils/misc.py
# -*- coding: utf-8 -*- """ breeze.utils.misc ~~~~~~~~~~~~~~~~~ This module defines various utility functions and some tiny wrappers around vim functions. """ import vim import breeze.utils.settings def echom(msg): """Gives a simple feedback to the user via the command line.""" vim.command('echom "[breeze] ...
Python
0.000291
@@ -528,18 +528,8 @@ None -, kj=False ):%0A @@ -554,415 +554,163 @@ rsor -.%0A%0A If the kj parameter is set to True, then the command behaves as following:%0A :help keepjumps -%3E Moving around in %7Bcommand%7D does not change the '', '.%0A and '%5E marks, the jumplist or the changelist...
0b311b67e1cf5831a6e1af317409fc6e854e8ce6
Remove debug artifacts
emission_events/scraper/scraper.py
emission_events/scraper/scraper.py
from datetime import datetime from bs4 import BeautifulSoup class Scraper(object): def __init__(self, html, tracking_number): self.html = html self.soup = BeautifulSoup(html) self.tracking_number = tracking_number def __call__(self): tds = self.soup.table.find_all('td') ...
Python
0.000001
@@ -1699,16 +1699,86 @@ ed_date) +,%0A 'dc_date': self.parse_date(self.get_dc_date_meta(metas)) %0A @@ -2584,283 +2584,75 @@ -print %22parsing %22 + cad%0A print datetime.strptime(cad, %22%25m/%25d/%25Y %25I:%25M%25p%22)%0A return datetime.strptime(cad, %22%25m/%2...
bd6eec33e59e3d46e5da931fbe9e1094bbb7c0bb
Add all primitives to known interactions.
enactiveagents/experiment/basic.py
enactiveagents/experiment/basic.py
""" Module to build experiments (worlds, agents, etc.). """ import model.interaction import model.agent import experiment class BasicExperiment(experiment.Experiment): world_representation = [ "wwwwwwwwwwwwwww", "w.............w", "w.wwwwwww.....w", "w.......wwwww.w", "w.ww...
Python
0
@@ -2546,16 +2546,83 @@ nd(feel) +%0A primitives.append(no_feel)%0A primitives.append(bump) %0A%0A
8da02c7c4ad382f4e7a2f7a017b32c0cff51547e
set limit of tw id over 5 letters
build_attendee.py
build_attendee.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from pyquery import PyQuery as pq import json if __name__ == "__main__": ## ref: pyquery # https://media.readthedocs.org/pdf/pyquery/latest/pyquery.pdf data = dict() file = ope...
Python
0.000011
@@ -724,17 +724,17 @@ name) %3E -3 +4 :%0A
dc54a12bfd2124e7203270940928e47198ed914e
bump version
bulbs/__init__.py
bulbs/__init__.py
__version__ = "0.6.23"
Python
0
@@ -17,7 +17,7 @@ .6.2 -3 +4 %22%0A
64383b6d8095f27af775d3c6030b22ee36055b29
Change summoner example function name, add params
examples/summoner.py
examples/summoner.py
import cassiopeia as cass from cassiopeia.core import Summoner def test_cass(): name = "Kalturi" me = Summoner(name=name) print("Name:", me.name) print("Id:", me.id) print("Account id:", me.account.id) print("Level:", me.level) print("Revision date:", me.revision_date) print("Profile i...
Python
0
@@ -61,53 +61,65 @@ er%0A%0A +%0A def -test_cass():%0A name = %22Kalturi%22%0A%0A me +print_summoner(name: str, region: str):%0A summoner = S @@ -131,24 +131,39 @@ er(name=name +, region=region )%0A print( @@ -171,18 +171,24 @@ Name:%22, -me +summoner .name)%0A @@ -198,23 +198,29 @@ print(%22I -...
5f167d7bc660bf85ffb92866333e2f2c90f69070
Update template for keyPressed callback.
examples/template.py
examples/template.py
#this import statement allows access to the karamba functions import karamba #this is called when your widget is initialized def initWidget(widget): pass #This is called when your widget is closed. You can use this to clean #up open files, etc. You don't need to delete text and images in your #theme. That is ...
Python
0.000007
@@ -5190,16 +5190,246 @@ pass +%0A%0A#This is called everytime there is a key press in any focused input field%0A# widget = reference to your widget%0A# meter = reference to an input box%0A# char = the key that was pressed%0Adef keyPressed(widget, meter, char):%0A pass %0A %0A#
69091ea58fcd67c61dae3837eb0b9261825d44b3
Use except as notation
examples/tor_info.py
examples/tor_info.py
#!/usr/bin/env python # Simple usage example of TorInfo. This class does some magic so that # once it's set up, all the attributes it has (or appears to) are # GETINFO ones, in a heirarchy. So where GETINFO specifies # "net/listeners/dns" TorInfo will have a "net" attribute that # contains at least "listeners", etcete...
Python
0.000023
@@ -1321,17 +1321,19 @@ xception -, + as e:%0A
b077df615eb4354f416877cc2857fb9848e158eb
Fix get_sort_by_toggle to work with QueryDicts with multiple values
saleor/core/templatetags/shop.py
saleor/core/templatetags/shop.py
from __future__ import unicode_literals try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from django.template import Library from django.utils.http import urlencode register = Library() @register.filter def slice(items, group_size=1): args = [...
Python
0
@@ -915,36 +915,36 @@ t = request.GET. -dict +copy ()%0A if field @@ -996,16 +996,17 @@ rt_by = +u '-%25s' %25 @@ -1159,34 +1159,24 @@ quest.path, -urlencode( request_get) @@ -1166,19 +1166,30 @@ ath, request_get +.urlencode( ))%0A
dab8e1af4091a18a6251668b9c2475ee6b1e8f66
Fix diffuse.explicit() for constant non-zero extrapolation
phi/physics/diffuse.py
phi/physics/diffuse.py
""" Functions to simulate diffusion processes on `phi.field.Field` objects. """ from phi import math from phi.field import Grid, Field, laplace, solve_linear, jit_compile_linear from phi.field._field import FieldType from phi.field._grid import GridType from phi.math import copy_with def explicit(field: FieldType, ...
Python
0.000012
@@ -1236,24 +1236,54 @@ t.at(field)%0A + ext = field.extrapolation%0A for i in @@ -1371,22 +1371,48 @@ olation( +ext)%0A field = field. +with_ extrapol @@ -1412,24 +1412,28 @@ xtrapolation +(ext )%0A return
3e62a39892c231419ac09310808d95cb42b4f69f
add python solution for valid_parentheses
python/valid_parentheses.py
python/valid_parentheses.py
Python
0.00115
@@ -0,0 +1,499 @@ +%0A# validate parentheses of string%0A%0Aimport sys%0A%0AinputChars = %5B x for x in sys.argv%5B1%5D %5D%0A%0AopenParens = ('(', '%5B', '%7B')%0AcloseParens = (')', '%5D', '%7D')%0AparenPairs = %7B%0A ')': '(',%0A '%5D': '%5B',%0A '%7D': '%7B'%0A%7D%0AparenHistory = %5B%5D%0A%0Afor c in inpu...
8ebe99ec5e944edaf7e0999222f1f1a54b07e5a4
Fix restart_needed
salt/states/win_servermanager.py
salt/states/win_servermanager.py
# -*- coding: utf-8 -*- ''' Manage Windows features via the ServerManager powershell module ''' # Import salt modules import salt.utils def __virtual__(): ''' Load only if win_servermanager is loaded ''' return 'win_servermanager' if 'win_servermanager.install' in __salt__ else False def installed(...
Python
0.000002
@@ -2336,35 +2336,24 @@ s%0A%0A ret%5B' -changes'%5D%5B' restart_need @@ -3975,27 +3975,16 @@ ret%5B' -changes'%5D%5B' restart_
1e36dee289585d046a29ba535e0ceaa5477c4aeb
Fix LEN type check
raco/expression/function.py
raco/expression/function.py
""" Functions (unary and binary) for use in Raco. """ import math from .expression import * class UnaryFunction(UnaryOperator): def __str__(self): return "%s(%s)" % (self.__class__.__name__, self.input) class BinaryFunction(BinaryOperator): def __str__(self): return "%s(%s, %s)" % (self.__...
Python
0
@@ -1435,323 +1435,8 @@ e%0A%0A%0A -class StringFunction(UnaryFunction):%0A def typeof(self, scheme, state_scheme):%0A input_type = self.input.typeof(scheme, state_scheme)%0A if input_type != %22STRING_TYPE%22:%0A raise TypeSafetyViolation(%22Must be a string for %25s%22 %25 (%0A ...
1cd9343efcbb8058d2c7483120af1047847787a9
Make constant uppercase
readthedocs/builds/tasks.py
readthedocs/builds/tasks.py
import logging from django.conf import settings from django.db.models import Avg from readthedocs.builds.models import Build, Version from readthedocs.projects.models import Feature log = logging.getLogger(__name__) class TaskRouter: """ Celery tasks router. It allows us to decide which queue is wher...
Python
1
@@ -822,24 +822,24 @@ %22%22%0A%0A -n_builds +N_BUILDS = 5%0A @@ -843,43 +843,43 @@ -n_last_builds = 15%0A time_average +N_LAST_BUILDS = 15%0A TIME_AVERAGE = 3 @@ -2277,21 +2277,21 @@ elf. -n_last_builds +N_LAST_BUILDS %5D%0A%0A @@ -2741,16 +2741,16 @@ elf. -n_builds +N_BUILDS :%0A @@ -31...
a78ea4b3ca869ce9603c48f53ff6229c3ff7b0bb
fix issue with timezone removed from new calendar objects
application/views/calendar_view.py
application/views/calendar_view.py
import urllib from application.views.custom_model_view import CustomModelView from application.models import Calendar, Location, User from application.helpers import encrypt_string, credentials, is_valid_credentials from application import app, db, authomatic from flask import flash, g from flask.ext.admin.actions imp...
Python
0
@@ -3610,16 +3610,38 @@ ummary'%5D +, calendar%5B'timeZone'%5D )%0A%09%09%09%09ne @@ -4401,8 +4401,9 @@ )).all() +%0A
3d62b79380669d14f8cff6a83d763679ac3924b5
Test that Bootstrap works by checking that authentication input boxes are centered
system_maintenance/tests/functional/tests.py
system_maintenance/tests/functional/tests.py
from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium import webdriver from selenium.webdriver.common.keys import Keys from system_maintenance.tests.utilities import populate_test_db class FunctionalTest(StaticLiveServerTestCase): def setUp(self): populate_test_db() ...
Python
0
@@ -5331,8 +5331,748 @@ )), 14)%0A +%0A def test_layout_and_styling(self):%0A # Go to the authentication page%0A self.browser.get(self.system_maintenance_url('authentication'))%0A window_width = 768%0A self.browser.set_window_size(window_width, window_width / 2)%0A%0A # Username a...
6ef7e5fd63992950c22172c9db0e80998a8ff053
Fix doc typo.
tools/pyblock/pyblock/blocking.py
tools/pyblock/pyblock/blocking.py
'''Tools for reblocking of data to remove serial correlation from data sets.''' import numpy import collections def reblock(data, rowvar=1, ddof=None): '''Blocking analysis of correlated data. Repeatedly average neighbouring data points in order to remove the effect of serial correlation on the estimate of the s...
Python
0
@@ -5068,16 +5068,17 @@ d%0A%60SE_%7B%5C +%5C text%7Btru
60f753e736827f61607e10d160b7e7bab75b77cc
update pyasn version for workers
pipeline/setup.py
pipeline/setup.py
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -749,10 +749,8 @@ 1.6. -0b 1'%5D,
33240ac6581188e363d2e4e21753a3071f57df86
fix default source
pipenv/project.py
pipenv/project.py
import os import toml from . import _pipfile as pipfile from .utils import format_toml, multi_split from .utils import convert_deps_from_pip, convert_deps_to_pip class Project(object): """docstring for Project""" def __init__(self): super(Project, self).__init__() @property def name(self): ...
Python
0.000001
@@ -1253,36 +1253,49 @@ u'https://pypi. -org/ +python.org/simple ', u'verify_ssl' @@ -1610,20 +1610,33 @@ ://pypi. -org/ +python.org/simple ', u'ver @@ -1656,34 +1656,16 @@ e%7D%5D%5B0%5D%0A%0A - @staticmethod%0A def @@ -1684,32 +1684,38 @@ ge_from_pipfile( +self, package_name, de @@ -1818,79 +1818,31...
8737ac6e9485393af27292371aebd84ac28b2a59
Fix to panel.
otter/bootstrap.py
otter/bootstrap.py
""" Implements a means of using the Bootstrap html and css toolkit to make the report. """ from itertools import cycle import markdown class HTMLElement(): def __init__(self, content=""): self.content = content def __iadd__(self, item): self.__add__(item) return self.content ...
Python
0
@@ -5028,16 +5028,48 @@ footer)%0A + output += self.panclose%0A
7842919b2af368c640363b4e4e05144049b111ba
Remove BaseMail dependency on User object
ovp_core/emails.py
ovp_core/emails.py
from django.core.mail import EmailMultiAlternatives from django.template import Context, Template from django.template.loader import get_template from django.conf import settings import threading class EmailThread(threading.Thread): def __init__(self, msg): self.msg = msg threading.Thread.__init__(sel...
Python
0
@@ -486,20 +486,29 @@ _(self, -user +email_address , async_ @@ -532,19 +532,37 @@ elf. -user = user +email_address = email_address %0A @@ -924,18 +924,21 @@ elf. -user. email +_address %5D)%0A
3c9de69112c8158877e4b0060ef0ab89c083f376
Build 1.14.0.1 package for Windows
packages/custom.py
packages/custom.py
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python from cerbero.packages import package from cerbero.enums import License class GStreamer: url = "http://gstreamer.freedesktop.org" version = '1.14.0' vendor = 'GStreamer Project' licenses = [License.LGPL] org = 'org.freedesktop.gstreamer...
Python
0
@@ -212,16 +212,18 @@ '1.14.0 +.1 '%0A ve
2250fdef5528bb59ca2c3218110d637484737659
fix pilutil.imresize test. Patch by Mark Wiebe.
scipy/misc/tests/test_pilutil.py
scipy/misc/tests/test_pilutil.py
import os.path import numpy as np from numpy.testing import assert_, assert_equal, \ dec, decorate_methods, TestCase, run_module_suite try: import PIL.Image except ImportError: _have_PIL = False else: _have_PIL = True import scipy.misc.pilutil as pilutil # Function / method decorator for skip...
Python
0
@@ -603,16 +603,79 @@ float%5D:%0A + # 1.1 rounds to below 1.1 for float16, 1.101 works%0A @@ -709,16 +709,18 @@ im,T(1.1 +01 ))%0A
b3573faeff22f220990ea2c97a7c9eae26429258
add parse for application/json
tornado-sqlalchemy-example/app.py
tornado-sqlalchemy-example/app.py
import os import tornado.web import tornado.options import tornado.ioloop from db import db from model import User class BaseHandler(tornado.web.RequestHandler): @property def db(self): return self.application.db class IndexHandler(BaseHandler): def get(self): data = self.db.query(User)...
Python
0.000001
@@ -1,12 +1,36 @@ +# -*- coding: utf-8 -*-%0A import os%0Aim @@ -133,16 +133,67 @@ rt User%0A +from tornado.escape import json_decode, to_unicode%0A %0A%0Aclass @@ -257,32 +257,32 @@ def db(self):%0A - return s @@ -301,16 +301,390 @@ ion.db%0A%0A + def get_json_argument(self, name, default=None):%0A...
3056cf737ae0b6717073a03a6e01addfb1415416
is_project is *not* a uuid
scrapi/processing/osf/hashing.py
scrapi/processing/osf/hashing.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unicodedata import string import hashlib def get_id(doc): return normalize_string(doc['id']['serviceID']) def get_source(doc): return normalize_string(doc['source']) def get_doi(doc): return normalize_string(doc['id']['doi'] + get_...
Python
0.999386
@@ -2323,18 +2323,6 @@ tors -, is_project %5D%0A
ba5e34c49370552b9779f90a77980dfa457aaa55
comment out figshare author biblio
totalimpact/providers/figshare.py
totalimpact/providers/figshare.py
from totalimpact.providers import provider from totalimpact.providers import crossref from totalimpact.providers.provider import Provider, ProviderContentMalformedError import re import logging logger = logging.getLogger('ti.providers.figshare') class Figshare(Provider): example_id = ("doi", "10.6084/m9.figsh...
Python
0
@@ -2841,16 +2841,17 @@ +# 'authors @@ -3805,24 +3805,87 @@ %0A%0A + # the authors data is messy, so just give up for now%0A # if %22authors @@ -3913,24 +3913,26 @@ ict:%0A + # surname @@ -4005,32 +4005,34 @@ teral%22%5D%5D%0A + # if surname_ @@ -4036,32 +4036,...
60c355182f5e2d6a049f763031ffd15c57539a18
add views as a figshare metric
totalimpact/providers/figshare.py
totalimpact/providers/figshare.py
from totalimpact.providers import provider from totalimpact.providers.provider import Provider, ProviderContentMalformedError import simplejson import logging logger = logging.getLogger('ti.providers.figshare') class Figshare(Provider): example_id = ("doi", "10.6084/m9.figshare.92393") url = "http://figs...
Python
0
@@ -1285,32 +1285,332 @@ g/favicon.png%22,%0A + %7D,%0A %22views%22: %7B%0A %22display_name%22: %22views%22,%0A %22provider%22: %22figshare%22,%0A %22provider_url%22: %22http://figshare.com%22,%0A %22description%22: %22The number of times this item has been...
a6e8fcc175dbd0c6220d0cf7c487cd02eef47d77
typo PEOPLE_DEFAULT_DIRECORY corrected
academic/people/models.py
academic/people/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.validators import RegexValidator from filebrowser.fields import FileBrowseField try: from south.modelsinspector import add_introspection_rules add_introspection_rules([], ["^filebrowser\.fields\.FileBrowseFiel...
Python
0.999742
@@ -4463,16 +4463,17 @@ LT_DIREC +T ORY,%0A
bf81484b7fd55e6383ae8e0f103e5e69ddea430e
Update utils.py
academictorrents/utils.py
academictorrents/utils.py
import hashlib import os import json import datetime import calendar import time def convert_bytes_to_decimal(headerBytes): size = 0 power = len(headerBytes) - 1 for ch in headerBytes: if isinstance(ch, int): size += ch * 256 ** power else: size += int(ord(ch)) * 25...
Python
0.000001
@@ -1334,27 +1334,41 @@ ime. -now().strftime(%22%25s%22 +timestamp(datetime.datetime.now() ))%0A
9ade3354c30833dbd9048f46e73531ad86caa86d
Ensure defined macro without a value is None
pkgconfig/pkgconfig.py
pkgconfig/pkgconfig.py
# -*- coding: utf-8 -*- # Copyright (c) 2013 Matthias Vogelgesang <matthias.vogelgesang@gmail.com> # 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 limi...
Python
0.999891
@@ -6927,18 +6927,20 @@ acro += -'' +None ,%0A%0A
2b5ac57fd02e5e20f738f9060456542f69eeff95
Bump version to 4.0.0a12
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
@@ -625,17 +625,17 @@ 0, %220a1 -1 +2 %22)%0A__ver
4e3cb4354c49101f29d64e4e5c59e347f95d98c9
Fix way to create login_url in dashboard test
tempest/scenario/test_dashboard_basic_ops.py
tempest/scenario/test_dashboard_basic_ops.py
# 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 agreed to in...
Python
0.000456
@@ -3025,16 +3025,30 @@ n_url = +parse.urljoin( CONF.das @@ -3071,10 +3071,9 @@ _url - + +, par @@ -3085,12 +3085,9 @@ ogin -%5B1:%5D +) %0A%0A
546d8fc8b41de424a76beb03c6530a7cf505a6a3
add orca EarthLocation
km3pipe/constants.py
km3pipe/constants.py
# coding=utf-8 # Filename: constants.py # pylint: disable=C0103 # pragma: no cover """ The constants used in KM3Pipe. """ from __future__ import division, absolute_import, print_function # TODO: this module should be refactored soon! import math __author__ = "Tamas Gal" __copyright__ = "Copyright 2016, Tamas Gal an...
Python
0.000037
@@ -1047,16 +1047,102 @@ w_h = +25 # ns%0A +%0Aorca_coords = (42 + (48/60), 6 + (2/60)) # (n, e) / degree%0Aorca_height = -2450 # m%0A
a325be315bab0f46862dfc0369de80d845887a7e
handle duplicates only when needed
km3pipe/io/pandas.py
km3pipe/io/pandas.py
# coding=utf-8 # Filename: pandas.py # pylint: disable=C0103,R0903 # vim:set ts=4 sts=4 sw=4 et: """ Pandas Helpers. """ from __future__ import division, absolute_import, print_function import os.path from six import string_types import numpy as np import pandas as pd import tables as tb from km3pipe.logger import l...
Python
0.000001
@@ -3747,16 +3747,29 @@ ids%5B0%5D%5D%0A + try:%0A log. @@ -3795,16 +3795,20 @@ pe)%0A + + if event @@ -3826,16 +3826,20 @@ 1%5D %3E 1:%0A + @@ -3869,24 +3869,28 @@ x%5B:, 0%5D%0A + + log.debug(ev @@ -3900,24 +3900,60 @@ _ids.shape)%0A + except IndexError:%0A p...
ce47d219076dc2ff36c58db1d91ba349b9968d61
Update test_bandits.py
bandits/tests/test_bandits.py
bandits/tests/test_bandits.py
from sklearn.utils.testing import assert_equal import numpy as np import pytest print("Hello tests!")
Python
0.000001
@@ -79,26 +79,128 @@ t%0A%0A%0A -print(%22Hello tests!%22 +@pytest.mark.fast_test%0Adef dummy_test():%0A %22%22%22%0A Quick test to build with Circle CI.%0A %22%22%22%0A x = 2 + 2%0A assert_equal(x, 4 )%0A
abfc76636e27bd3454e6b0188502831f7f70162c
Fix nonthermal.out file names
plotartisnonthermal.py
plotartisnonthermal.py
#!/usr/bin/env python3 import argparse # import math # import os import glob import matplotlib.pyplot as plt # import numpy as np import pandas as pd from astropy import constants as const import readartisfiles as af C = const.c.to('m/s').value DEFAULTSPECPATH = '../example_run/spec.out' def main(): """ ...
Python
0
@@ -1865,20 +1865,17 @@ malspec- -???? +* .out', r
0b7cbae1fcb68d6d090a083f103f4d83167dae71
add support for excluded paths
plogx/database.py
plogx/database.py
from pymongo.errors import DuplicateKeyError from datetime import datetime, timedelta def _aggregate_day_stats(db, log_day): start_date = log_day end_date = start_date + timedelta(days=1) page_impressions = db.log_items.aggregate([ # match and filter all documents for the specified day {"...
Python
0
@@ -190,16 +190,192 @@ (days=1) +%0A excluded_paths = %5B%0A %22/assets/css/style.min.css%22,%0A %22/assets/css/pygments.css%22,%0A %22/assets/js/jquery.min.js%22,%0A %22/assets/js/bootstrap.min.js%22%0A %5D %0A%0A pa @@ -585,33 +585,95 @@ %22$lt%22: end_date - +%7D,%0A ...
19b9451a1a18c3b9a5a115ab209c8137f794a937
Use update statement to marke Data objects as purged
resolwe/flow/utils/purge.py
resolwe/flow/utils/purge.py
""".. Ignore pydocstyle D400. ========== Data Purge ========== """ import logging import os import shutil from django.conf import settings from resolwe.flow.models import Data from resolwe.flow.utils import iterate_fields from resolwe.utils import BraceMessage as __ logger = logging.getLogger(__name__) # pylint: ...
Python
0
@@ -5660,96 +5660,83 @@ -for data in data_qs:%0A data.purged = True%0A data.save(update_fields=%5B' +# NOTE: This doesn't trigger Django's signals!%0A data_qs.update( purged -'%5D +=True )%0A
cbb5290e42f738025fb11f4745a35bda71968f1f
Add support for Lovelace dashboards (#342)
pychromecast/controllers/homeassistant.py
pychromecast/controllers/homeassistant.py
""" Controller to interface with Home Assistant """ from ..config import APP_HOME_ASSISTANT from . import BaseController APP_NAMESPACE = "urn:x-cast:com.nabucasa.hast" class HomeAssistantController(BaseController): """ Controller to interact with Home Assistant. """ def __init__( self, hass...
Python
0
@@ -2619,16 +2619,31 @@ ew_path, + url_path=None, callbac @@ -2795,16 +2795,37 @@ iew_path +, %22urlPath%22: url_path %7D,%0A
91b1aa0270951e02c861889ef66eb1c9c7e3874a
fix caching
base_changeset/models/base.py
base_changeset/models/base.py
# Copyright 2020 Onestein (<https://www.onestein.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from lxml import etree from odoo import _, api, fields, models from odoo.tools import config class Base(models.AbstractModel): _inherit = "base" changeset_ids = fields.One2many( com...
Python
0
@@ -205,16 +205,26 @@ t config +, ormcache %0A%0A%0Aclass @@ -2151,32 +2151,57 @@ %0A @api.model%0A + @ormcache(skiparg=1)%0A def models_t
1e247dace112ce6def2bedf2f3ab864835ed7e06
enforce that source.yaml files have to specify a version attribute
src/rosdistro/source_file.py
src/rosdistro/source_file.py
# Software License Agreement (BSD License) # # Copyright (c) 2013, Open Source Robotics Foundation, Inc. # 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 mus...
Python
0.000001
@@ -2491,16 +2491,132 @@ try:%0A + assert 'version' in repo_data, %22Repository '%25s' lacks required version information%22 %25 repo_name%0A
ab390fb8a445730a792c717d68d3e5b2d45b05a3
use UTC year for insert
scripts/ingestors/flux_ingest.py
scripts/ingestors/flux_ingest.py
""" Ingest files provided by NLAE containing flux information """ import pg import mx.DateTime import traceback other = pg.DB('other', 'iemdb') # Figure out max valid times maxts = {} rs = other.query("""SELECT station, max(valid) from flux%s GROUP by station""" % (mx.DateTime.now().year - 1, ) ).dictresult() for...
Python
0
@@ -3889,24 +3889,50 @@ on%5D.keys():%0A + gts = ts.gmtime()%0A try: @@ -3969,16 +3969,17 @@ x%25s%22 %25 ( +g ts.year,
462197a9982c944fcf6b786f94ee8012e5e0865f
improve verbosity.
build_package.py
build_package.py
#!/usr/bin/python """Script for building source and binary debain packages.""" from __future__ import print_function from argparse import ArgumentParser from collections import namedtuple import os import shutil import subprocess import sys SourceFile = namedtuple('SourceFile', ['sha256', 'size', 'name', 'path']) ...
Python
0.000002
@@ -3124,24 +3124,35 @@ pt%5D)%0A + out, err = proc.commun @@ -3159,16 +3159,16 @@ icate()%0A - @@ -3196,16 +3196,144 @@ urncode%0A + if verbose:%0A print(out)%0A if err:%0A print(%22FROM STDERR:%22)%0A print(err)%0A fina @@ -3470,24 ...
d1c7eb6bce52796af4ea757371a485b69348e189
Update execute_program_in_vm.py
samples/execute_program_in_vm.py
samples/execute_program_in_vm.py
""" Written by Timo Sugliani Github: https://github.com/tsugliani/ Code based on upload_file_to_vm snippet by Reubenur Rahman Github: https://github.com/rreubenur/ This code is released under the terms of the Apache 2 http://www.apache.org/licenses/LICENSE-2.0.html Example: python execute_program_in_vm.py -s <v...
Python
0.000004
@@ -5296,16 +5296,21 @@ break +%0A
92a269d95006f991aa65456d413776a6d6d0a93c
remove unused import
pyramid_oauth2_provider/authentication.py
pyramid_oauth2_provider/authentication.py
# # Copyright (c) Elliot Peele <elliot@bentlogic.net> # # This program is distributed under the terms of the MIT License as found # in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licenses/mit-license.php. # # This program is distributed in the hope that it...
Python
0.000001
@@ -494,22 +494,8 @@ %0A#%0A%0A -import base64%0A impo
f49d68db26dcde95ba80b6a0ff72f013f41306d9
Improve tests to try raw lines
pyromancer/test/test_command_decorator.py
pyromancer/test/test_command_decorator.py
import re import pytest from pyromancer.decorators import command from pyromancer.exceptions import CommandException from pyromancer.objects import Match, Line from pyromancer.test.decorators import mock_connection from pyromancer.test.mock_objects import MockObject MESSAGES = [ ('Hello world', 'Hello world'), ...
Python
0
@@ -3075,16 +3075,307 @@ s True%0A%0A + line = Line(':irc.example.net 376 A :End of MOTD command')%0A%0A instance = command(r'example', prefix=False)%0A assert bool(instance.matches(line, settings)) is False%0A%0A instance = command(r'example', raw=True, prefix=False)%0A assert bool(instance.matches(lin...
2652919c8d2e6fad8f7b3d47f5e82528b4b5214e
Write the last point for plot completeness
plots/monotone.py
plots/monotone.py
# MONOTONE # Produce a monotonically decreasing output plot from noisy data # Input: columns: t x # Output: columns: t_i x_i , sampled such that x_i <= x_j # for j > i. from string import * import sys # Set PYTHONPATH=$PWD from plottools import * if len(sys.argv) != 3: abort("usage:...
Python
0.999273
@@ -686,16 +686,162 @@ al_loss%0A + fp_o.write(%22%25s, %25f%5Cn%22 %25 (t, val_loss_min))%0A # Ensure the last data point is written for the plot:%0A if val_loss %3E= val_loss_min:%0A
820a958497383574c845c6a6a84e3a7b9e33196a
Handle error case better
butter/splice.py
butter/splice.py
#!/usr/bin/env python """splice: wrapper around the splice() syscall""" #from __future__ import print_function from select import select as _select from collections import namedtuple from cffi import FFI as _FFI import errno as _errno _ffi = _FFI() _ffi.cdef(""" #define SPLICE_F_MOVE ... /* This is a noop in mod...
Python
0.000002
@@ -4712,18 +4712,12 @@ ile -bytes != 0 +True :%0A @@ -4851,16 +4851,33 @@ break%0A + %0A @@ -4894,24 +4894,24 @@ 'Splicing')%0A - @@ -4978,16 +4978,82 @@ F_MOVE)%0A + if bytes == 0:%0A break%0A %0A
58ee8882fdbdef01f36859f0ed40afc346518690
Add test for double backward
tests/chainer_tests/functions_tests/array_tests/test_flip.py
tests/chainer_tests/functions_tests/array_tests/test_flip.py
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.utils import type_check @testing.parameterize(*testing.product_dict( [ {'shape': (1,), 'axis': 0...
Python
0.000007
@@ -777,33 +777,34 @@ .random.uniform( -0 +-1 , 1, self.shape) @@ -837,16 +837,17 @@ self.g +y = numpy @@ -862,17 +862,18 @@ uniform( -0 +-1 , 1, sel @@ -899,16 +899,284 @@ f.dtype) +%0A self.ggx = numpy.random.uniform(-1, 1, self.shape).astype(self.dtype)%0A%0A self.check_double_backward_option...
6482c485982fe5039574eab797b46d5f1b93bacc
Refactor populate script
finance/management/commands/populate.py
finance/management/commands/populate.py
import random from django.contrib.auth.models import User from django.core.management.base import BaseCommand from django.db import IntegrityError import factory from accounts.factories import UserFactory from books.factories import TransactionFactory class Command(BaseCommand): help = "Popoulates databse with...
Python
0
@@ -107,45 +107,8 @@ mand -%0Afrom django.db import IntegrityError %0A%0Aim @@ -330,16 +330,288 @@ tions):%0A + if not User.objects.filter(username='admin'):%0A self.create_admin()%0A else:%0A self.admin = User.objects.get(username='admin')%0A print(%22admin user alread...
c745f6abe699251a877245ec19ae7b417fd97718
Fix bug in kolibri arg passing
kolibri/utils/cli.py
kolibri/utils/cli.py
from __future__ import absolute_import, print_function, unicode_literals import importlib import logging import os import signal import sys import kolibri from docopt import docopt from logging import config as logging_config USAGE = """ Kolibri Supported by Foundation for Learning Equality www.learningequality.or...
Python
0.999965
@@ -5035,16 +5035,18 @@ gs%5Bpivot ++1 :%5D%0A e
2c8a1b121c7cc709ae24bb38605aab4c81dee899
Increase job timeout to 2h
src/scripts/schedule_jobs.py
src/scripts/schedule_jobs.py
#!/usr/bin/env python # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
0.000053
@@ -1677,16 +1677,25 @@ b = Job( +%0A app_engi @@ -1716,16 +1716,24 @@ =target, +%0A schedul @@ -1743,16 +1743,24 @@ chedule, +%0A time_zo @@ -1770,16 +1770,55 @@ timezone +,%0A attempt_deadline=%22120m%22,%0A )%0A%0A #
87405b65ca4f6848a3e7ec0a63369658d09cd0d5
print debug messages to stderr, not stdout
fasttsne/__init__.py
fasttsne/__init__.py
import scipy.linalg as la import numpy as np import time from fasttsne import _TSNE as TSNE def timed_reducer(f): def f2(data, d, mode, **kwargs): t = time.time() print "Reducing to %dd using %s..." % (d, f.__name__) if mode == 1: from sklearn.preprocessing import Normalizer ...
Python
0.998474
@@ -49,16 +49,27 @@ ort time +%0Aimport sys %0A%0Afrom f @@ -194,16 +194,31 @@ print + %3E%3E sys.stderr, %22Reduci @@ -441,16 +441,31 @@ print + %3E%3E sys.stderr, %22%25s -%3E @@ -2124,16 +2124,21 @@ ormalise +_mean :%0A @@ -2144,16 +2144,31 @@ print + %3E%3E sys.stderr, %22normal @@ -246...
17037f53d3b3a54456892a986e1a199d381b5074
Use absolute_import in markdown.py, to fix import problem.
pokedex/db/markdown.py
pokedex/db/markdown.py
# encoding: utf8 u"""Implements the markup used for description and effect text in the database. The language used is a variation of Markdown and Markdown Extra. There are docs for each at http://daringfireball.net/projects/markdown/ and http://michelf.com/projects/php-markdown/extra/ respectively. Pokédex links are...
Python
0
@@ -453,16 +453,55 @@ dex.%0A%22%22%22 +%0Afrom __future__ import absolute_import %0A%0Aimport
4b6d584f4fb3741fe3d3268c36b54b8469444f60
fix identifier error of 'dshape'
benchmark/fluid/models/vgg.py
benchmark/fluid/models/vgg.py
# Copyright (c) 2018 PaddlePaddle 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 app...
Python
0.000373
@@ -2839,24 +2839,37 @@ layers.data( +%0A name='data', @@ -2876,16 +2876,20 @@ shape=d +ata_ shape, d
2eb4f8bf1af29a161155835a841519a31b514fe3
Fix add/edit links in users module.
modules/installed/system/users.py
modules/installed/system/users.py
import os, cherrypy from gettext import gettext as _ from auth import require, add_user from plugin_mount import PagePlugin, FormPlugin import cfg from forms import Form from util import * from model import User class users(PagePlugin): order = 20 # order of running init in PagePlugins def __init__(self, *args...
Python
0
@@ -575,67 +575,8 @@ - return self.fill_template(title=%22Manage Users and Groups%22, sid @@ -589,12 +589,12 @@ ight -=%22%22%22 + = ' %3Cstr @@ -598,32 +598,50 @@ strong%3E%3Ca href=%22 +'+cfg.server_dir+' /sys/users/add%22%3E @@ -675,32 +675,50 @@ strong%3E%3Ca href=%22 +'+cfg.server_dir+' /sys/users/ed...
306c735f863d3fe6a0922a433a7cdd1d21bdd772
fix unit test
flumotion/test/test_feedcomponent010.py
flumotion/test/test_feedcomponent010.py
# -*- Mode: Python; test-case-name: flumotion.test.test_feedcomponent010 -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU Genera...
Python
0.000001
@@ -923,16 +923,29 @@ ntact.%0A%0A +import time%0A%0A from twi @@ -1837,20 +1837,27 @@ , None, -None +time.time() , 1))%0A @@ -2226,20 +2226,27 @@ , None, -None +time.time() , 2))%0A
3165635076f44d8dcf2de941eeb2f5f2239861d4
use pool of db_name parameter
bin/addons/base/ir/ir_cron.py
bin/addons/base/ir/ir_cron.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
Python
0
@@ -3288,28 +3288,140 @@ -if self.pool._init:%0A +try:%0A db, pool = pooler.get_db_and_pool(db_name)%0A if pool._init:%0A # retry in a few minutes%0A @@ -3493,16 +3493,95 @@ _name%5D)%0A + cr = db.cursor()%0A except:%0A return False%0A ...
1afce678dec65bf3c6445322ff7961c7aca05f56
add more error checking for couchbase python client removal
api/code/src/main/python/stratuslab/installator/CouchbaseClient.py
api/code/src/main/python/stratuslab/installator/CouchbaseClient.py
# # Copyright (c) 2013, Centre National de la Recherche Scientifique # # 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 ap...
Python
0
@@ -1731,32 +1731,49 @@ python client')%0A + try:%0A cmd = 'p @@ -1791,32 +1791,36 @@ l -y couchbase'%0A + rc, outp @@ -1879,32 +1879,36 @@ + withOutput=True, @@ -1934,32 +1934,36 @@ + + verboseLevel=sel @@ -1970,32 +1970,36 @@ f.verboseL...
4475cd927dda1d8ab685507895e0fc4bde6e3b4a
switch window index error
pages/base_page.py
pages/base_page.py
from .page import Page class BasePage(Page): def get_cookie_index_page(self, url, cookie): self.get_relative_path(url) self.maximize_window() self.selenium.add_cookie(cookie) self.selenium.refresh() def switch_to_second_window(self): handles = self.selenium....
Python
0.000001
@@ -329,16 +329,124 @@ andles%0D%0A + try:%0D%0A handle = handles%5B1%5D%0D%0A except IndexError:%0D%0A handle = handles%5B0%5D%0D%0A @@ -482,17 +482,13 @@ w(handle -s%5B1%5D )%0D%0A%0D%0A
439a09ce69b9ba66e2dc7c21b952ffc438fbe0f4
Add Abuse enum to outcomes. (#13833)
src/sentry/utils/outcomes.py
src/sentry/utils/outcomes.py
""" sentry.utils.outcomes.py ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from datetime import datetime from django.conf import settings from enum import IntEnum import random imp...
Python
0
@@ -710,16 +710,30 @@ LID = 3%0A + ABUSE = 4%0A %0A%0Aoutcom
e69efded329ebbcf5ccf74ef137dc1a80bd4b4a6
add 2.1.2, re-run cython if needed (#13102)
var/spack/repos/builtin/packages/py-line-profiler/package.py
var/spack/repos/builtin/packages/py-line-profiler/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyLineProfiler(PythonPackage): """Line-by-line profiler.""" homepage = "https://githu...
Python
0
@@ -191,16 +191,27 @@ R MIT)%0A%0A +import os%0A%0A from spa @@ -442,16 +442,112 @@ ar.gz%22%0A%0A + version('2.1.2', sha256='efa66e9e3045aa7cb1dd4bf0106e07dec9f80bc781a993fbaf8162a36c20af5c')%0A vers @@ -622,16 +622,39 @@ on@2.5:' +, type=('build', 'run') )%0A de @@ -739,32 +739,32 @@ type='build')%...
79fa33998e0f261a9633c72282446bb2615083ed
Update configure.py
ansible_plugin/configure.py
ansible_plugin/configure.py
######## # Copyright (c) 2014 GigaSpaces Technologies 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 #...
Python
0.000001
@@ -5872,31 +5872,51 @@ .error(' -error: %7B0%7D'.format(e +Unknown Exception in run_shell_command.' ))%0A
0bebe2078955d4b5b7b46448f0fcef2c74fdb3f1
Fix copy commands for swarm setup script.
scripts/tools/swarm_bot_setup.py
scripts/tools/swarm_bot_setup.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Setup a given bot to become a swarm bot by installing the required files and setting up any required scripts. The bot's OS must ...
Python
0.000006
@@ -870,25 +870,24 @@ rm_bootstrap -/ ',%0A 'mac': @@ -925,17 +925,16 @@ ootstrap -/ ',%0A 'wi @@ -975,18 +975,16 @@ ootstrap -%5C%5C ',%0A%7D%0A%0A# @@ -1122,16 +1122,22 @@ b%5C%5Cswarm +_slave %5C%5C',%0A%7D%0A%0A @@ -1792,20 +1792,24 @@ func = ' +x copy + /i '%0A else @@ -1829,16 +1829,19 @@ nc = 'c...
381adeeec0fd1d65372d7003183d4b1ec8f2cfbf
Increase V8JS Stack Limit (#584)
dmoj/executors/V8JS.py
dmoj/executors/V8JS.py
from dmoj.executors.script_executor import ScriptExecutor class Executor(ScriptExecutor): ext = 'js' name = 'V8JS' command = 'v8dmoj' test_program = 'print(gets());' address_grace = 786432 nproc = -1 @classmethod def get_version_flags(cls, command): return [('-e', 'print(versi...
Python
0
@@ -322,8 +322,131 @@ n())')%5D%0A + %0A def get_cmdline(self):%0A return %5Bself.get_command(), '--stack-size=131072', self._code%5D # 128MB Stack Limit%0A
7fba4a676622e93416f32ee69bfa295647979c7a
fix path on test file
taxcalc/tests/test_calculate.py
taxcalc/tests/test_calculate.py
import os import sys cur_path = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(cur_path, "../../")) sys.path.append(os.path.join(cur_path, "../")) import numpy as np import pandas as pd from numba import jit, vectorize, guvectorize from taxcalc import * def test_make_Calculator(): tax_dta...
Python
0.000001
@@ -328,16 +328,39 @@ ead_csv( +os.path.join(cur_path, %22../../p @@ -368,16 +368,17 @@ f2.csv%22) +) %0A cal
f4a460646f87b63781ad32b8ef6a0b9c0d8a6290
fix issue #357, which makes real problem more obvious (media file does not exist
moviepy/video/io/VideoFileClip.py
moviepy/video/io/VideoFileClip.py
import os from moviepy.video.VideoClip import VideoClip from moviepy.audio.io.AudioFileClip import AudioFileClip from moviepy.Clip import Clip from moviepy.video.io.ffmpeg_reader import FFMPEG_VideoReader class VideoFileClip(VideoClip): """ A video clip originating from a movie file. For instance: :: ...
Python
0
@@ -1635,16 +1635,110 @@ +self.reader = None #need this just in case FFMPEG has issues (__del__ complains)%0A self. reader = @@ -1788,37 +1788,8 @@ mt)%0A - self.reader = reader%0A
b419da087c762fe3fb18896aed3adbf489ac7036
add test_tag_values_correctly_localized for get_config_tag_json
roundwared/tests/test_db.py
roundwared/tests/test_db.py
from django.test import TestCase from model_mommy import mommy # from .common import * from roundware.rw.models import (MasterUI, Language, Session, UIMapping, Project, LocalizedString, Tag) from roundwared.db import get_config_tag_json class TestGetConfigTagJSON(TestCase): """...
Python
0.000003
@@ -5455,39 +5455,32 @@ rrect localized -header text for tag val @@ -5483,16 +5483,16 @@ values%0A + @@ -5557,29 +5557,182 @@ sh.%0A %22%22%22%0A -pass +config = get_config_tag_json(None, self.spanish_sess)%0A self.assertEquals('Uno', %0A config%5B'Listen'...
faf9638bc69dc79c7fdc9294cc309c40ca57d518
Fix process names in test_nailyd_alive
fuelweb_test/integration/test_nailyd.py
fuelweb_test/integration/test_nailyd.py
import logging import xmlrpclib from fuelweb_test.integration.base import Base from fuelweb_test.helpers import SSHClient class TestNailyd(Base): def __init__(self, *args, **kwargs): super(TestNailyd, self).__init__(*args, **kwargs) self.remote = SSHClient() def setUp(self): logging...
Python
0.000024
@@ -648,23 +648,270 @@ x: ' -/usr/bin/nailyd +naily master' in x, ps_output)%0A logging.debug(%22Found %25d naily master processes: %25s%22 %25%0A (len(naily_processes), naily_processes))%0A self.assertEqual(1, len(naily_processes))%0A naily_processes = filter(lambda x: 'naily...
13a64059b71fccb8315f552d8e96f130c513a540
Remove old code.
charity_server.py
charity_server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 30 01:14:12 2017 @author: colm """ from flask import Flask, jsonify from parse_likecharity import refresh_charities import threading from datetime import datetime app = Flask(__name__) refresh_rate = 24 * 60 * 60 #Seconds start_time = datetime.no...
Python
0.000045
@@ -185,25 +185,8 @@ ies%0A -import threading%0A from @@ -299,16 +299,36 @@ me.now() +%0Ainitialized = False %0A%0A# vari @@ -383,547 +383,8 @@ = %7B%7D -%0A# lock to control access to variable%0AdataLock = threading.Lock()%0A# thread handler%0AbackgroundThread = threading.Thread()%0A%0Adef update_charities():%0A ...
dce4866473c84dd84e47202812fede21869c03bc
remove commented stuff
teknologr/teknologr/settings.py
teknologr/teknologr/settings.py
""" Django settings for teknologr project. Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
Python
0
@@ -3394,126 +3394,8 @@ )))%0A - #%7B%0A # 'ENGINE': 'django.db.backends.sqlite3',%0A # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),%0A #%7D%0A %7D%0A%0A%0A
11e13c3412661e79f8a70374a1c14a2b03411b65
Remove reload, it's not usable
test.py
test.py
from zirc.test import TestCase import log as logging import utils import commands import config logging.setLevel(30) class botTest(TestCase): def __init__(self): self.config = {} self.config['nickname'] = 'zIRC-test' def on_privmsg(self, event, irc, arguments): if " ".join(arguments)....
Python
0.000004
@@ -2375,78 +2375,8 @@ ooo%0A -:wolfy1339!~wolfy1339@botters/wolfy1339 PRIVMSG #zirc :?reload config%0A :wol
c5c0b3f8b6d61a1534e74e4ceba8b6a7eedb106d
support multiple registration to the same event
dbus-tools/dbus-register.py
dbus-tools/dbus-register.py
############################################################################### # Copyright 2012 Intel Corporation. # # 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...
Python
0
@@ -1324,24 +1324,249 @@ .stdout)%0A%0A%0A%0A +###############################################################################%0Adef hashId(senderName, objectName, interfaceName, signalName):%0A%09return senderName + %22#%22 + objectName + %22#%22 + interfaceName + %22#%22 + signalName%0A%0A%0A%0A ############ @@ -17...
ddf4cbfc263b71ba3eee54b53d33e7ed31e5a8e5
remove args logging
swampdragon/models.py
swampdragon/models.py
from .pubsub_providers.base_provider import PUBACTIONS from .model_tools import get_property from .pubsub_providers.model_publisher import publish_model from .serializers.serializer_importer import get_serializer from django.db.models.signals import pre_delete, m2m_changed from django.dispatch.dispatcher import receive...
Python
0.000003
@@ -885,32 +885,33 @@ o(self)%0A +# logger.info(args @@ -912,32 +912,33 @@ o(args)%0A +# logger.info(kwar