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 |
|---|---|---|---|---|---|---|---|
350bb01c653ab640e586531bba6e4527f4feb622 | Fix the GzippedWhisperReader | graphite_api/finders/whisper.py | graphite_api/finders/whisper.py | from __future__ import absolute_import
import gzip
import os.path
import time
from structlog import get_logger
from ..carbonlink import CarbonLinkPool
from ..intervals import Interval, IntervalSet
from ..node import BranchNode, LeafNode
from .._vendor import whisper
from . import fs_to_metric, get_real_metric_path,... | Python | 0 | @@ -5245,24 +5245,34 @@
info =
+getattr(
whisper
-.
+, '
__readHe
@@ -5275,16 +5275,18 @@
adHeader
+')
(fh) #
|
ca7b3b5e91c881c9b435b6391da16177427865bb | Remove deprecated unused option in seed job script (#22223) | .test-infra/jenkins/committers_list_generator/main.py | .test-infra/jenkins/committers_list_generator/main.py | #
# Licensed to the Apache Software Foundation (ASF) 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 us... | Python | 0 | @@ -2189,71 +2189,8 @@
th)%0A
- ldap.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_DEMAND)%0A
|
480e55794c5f06129b8b2fb7ed02a787f70275e2 | add --silent option to update-toplist | mygpo/directory/management/commands/update-toplist.py | mygpo/directory/management/commands/update-toplist.py | from datetime import datetime
from django.core.management.base import BaseCommand
from mygpo.core.models import Podcast, SubscriberData
from mygpo.users.models import PodcastUserState
from mygpo.utils import progress
from mygpo.decorators import repeat_on_conflict
class Command(BaseCommand):
def handle(self, *... | Python | 0 | @@ -22,16 +22,49 @@
datetime
+%0Afrom optparse import make_option
%0A%0Afrom d
@@ -320,24 +320,199 @@
eCommand):%0A%0A
+ option_list = BaseCommand.option_list + (%0A make_option('--silent', action='store_true', dest='silent',%0A default=False, help=%22Don't show any output%22),%0A )%0A%0A
de... |
006e6b67af6cfb2cca214666ac48dc9fd2cc0339 | Update test values | scopus/tests/test_CitationOverview.py | scopus/tests/test_CitationOverview.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `CitationOverview` module."""
from collections import namedtuple
from nose.tools import assert_equal, assert_true
import scopus
co = scopus.CitationOverview("2-s2.0-84930616647", refresh=True,
start=2015, end=2017)
def test_a... | Python | 0.000001 | @@ -298,17 +298,17 @@
end=201
-7
+8
)%0A%0A%0Adef
@@ -719,16 +719,29 @@
17, '2')
+, (2018, '1')
%5D)%0A%0A%0Adef
@@ -1504,17 +1504,17 @@
Count, '
-6
+7
')%0A%0A%0Adef
@@ -1562,17 +1562,17 @@
Total, '
-6
+7
')%0A%0A%0Adef
|
ca8bbd03f57bf6e15abd406533dc7088d449e9ab | add published date to properties | scrapi/consumers/figshare/consumer.py | scrapi/consumers/figshare/consumer.py | """
Figshare harvester of public projects for the SHARE Notification Service
Example API query: http://api.figshare.com/v1/articles/search?search_for=*&from_date=2015-2-1&end_date=2015-2-1
"""
from __future__ import unicode_literals
import time
import json
import logging
from dateutil.parser import parse
from dateti... | Python | 0 | @@ -3510,24 +3510,75 @@
ecord%5B'DOI'%5D
+,%0A 'publishedDate': record%5B'published_date'%5D
%0A %7D%0A%0A%0Adef
|
4464b72eac2cc995a3276341f066bee30497d621 | Bump version to 1.1.0 for release | globus_sdk/version.py | globus_sdk/version.py | # single source of truth for package version,
# see https://packaging.python.org/en/latest/single_source_version/
__version__ = "1.0.0"
| Python | 0 | @@ -124,13 +124,13 @@
__ = %221.
-0
+1
.0%22%0A
|
bb9d1255548b46dc2ba7a85e26606b7dd4c926f3 | Update original "Hello, World!" parser to latest coding, plus runTests | examples/greeting.py | examples/greeting.py | # greeting.py
#
# Demonstration of the pyparsing module, on the prototypical "Hello, World!"
# example
#
# Copyright 2003, by Paul McGuire
#
from pyparsing import Word, alphas
# define grammar
greet = Word( alphas ) + "," + Word( alphas ) + "!"
# input string
hello = "Hello, World!"
# parse input stri... | Python | 0.000077 | @@ -6,20 +6,18 @@
eting.py
-%0D
%0A#
-%0D
%0A# Demon
@@ -85,17 +85,16 @@
World!%22
-%0D
%0A# examp
@@ -95,20 +95,18 @@
example
-%0D
%0A#
-%0D
%0A# Copyr
@@ -115,16 +115,21 @@
ht 2003,
+ 2019
by Paul
@@ -140,17 +140,17 @@
uire
-%0D
%0A#
-%0D%0Afrom
+%0Aimport
pyp
@@ -160,30 +160,14 @@
ing
-import Word... |
04d0bb1bf71ee3a17efbb4bb15bb808cc832f04b | Update examples.py | examples/examples.py | examples/examples.py | from py_fuzz import *
print random_language(language="russian")
print random_ascii(
seed="this is a test", randomization="byte_jitter",
mutation_rate=0.25
)
print random_regex(
length=20, regex="[a-zA-Z]"
)
print random_utf8(
min_length=10,
max_length=50
)
print random_bytes()
print random_utf8(... | Python | 0 | @@ -5,16 +5,26 @@
py_fuzz
+.generator
import
|
bc6c3834cd8383f7e1f9e109f0413bb6015a92bf | Remove unneeded datetime from view | go/scheduler/views.py | go/scheduler/views.py | import datetime
from django.views.generic import ListView
from go.scheduler.models import Task
class SchedulerListView(ListView):
paginate_by = 12
context_object_name = 'tasks'
template = 'scheduler/task_list.html'
def get_queryset(self):
now = datetime.datetime.utcnow()
return Task.... | Python | 0 | @@ -1,20 +1,4 @@
-import datetime%0A
from
@@ -240,49 +240,8 @@
f):%0A
- now = datetime.datetime.utcnow()%0A
|
654034d3a0c6ec4e023af6118d6e628336bc39dd | Upgrade to Python 3 | rpt2csv.py | rpt2csv.py | import sys
import csv
def convert(inputFile,outputFile):
"""
Convert a RPT file to a properly escaped CSV file
RPT files are usually sourced from old versions of Microsoft SQL Server Management Studio
RPT files are fixed width with column names on the first line, a second line with dashes and spaces,
and then o... | Python | 0.000672 | @@ -14,16 +14,30 @@
port csv
+%0Aimport codecs
%0A%0Adef co
@@ -986,28 +986,8 @@
val
-.decode('utf-8-sig')
%0A%09%09e
@@ -1541,16 +1541,37 @@
.argv%5B1%5D
+,encoding='utf-8-sig'
) as inp
@@ -1605,17 +1605,27 @@
gv%5B2%5D,'w
-b
+',newline='
') as ou
|
7571b4519e54e2e747a21f7f900e486ccee19aa0 | Update job_crud.py | examples/job_crud.py | examples/job_crud.py | # Copyright 2016 The Kubernetes Authors.
#
# 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 ... | Python | 0.000001 | @@ -1652,82 +1652,8 @@
t%22)%0A
- # Need to wait for a second for the job status to update%0A sleep(1)%0A
@@ -1750,32 +1750,91 @@
(api_instance):%0A
+ job_completed = False%0A while not job_completed:%0A
api_response
@@ -1877,32 +1877,36 @@
status(%0A
+
+
name=JOB_NAME,%0A
@@... |
23b9ef799eb0d322c7dcfe796b196cce3cea6435 | Add a ctx.log on finish | examples/har_dump.py | examples/har_dump.py | """
This inline script can be used to dump flows as HAR files.
"""
import pprint
import json
import sys
from datetime import datetime
import pytz
import mitmproxy
from netlib import version
from netlib.http import cookies
HAR = {}
def start():
"""
Called once on script startup before any other event... | Python | 0 | @@ -3893,16 +3893,63 @@
else:%0A
+ json_dump = json.dumps(HAR, indent=2)%0A%0A
@@ -4008,77 +4008,103 @@
json
-.
+_
dump
-s(HAR, indent=2))%0A%0A # TODO: Log results via mitmproxy.ctx.log
+)%0A%0A mitmproxy.ctx.log(%22HAR log finished (wrote %25s bytes to file)%22 %25 len(json_dump))
%0A... |
f0df0e081aba7e9eb7a39088613d29c7c1e8a596 | set integrationtime to 80% of sampling interval | examples/liveview.py | examples/liveview.py | #!/usr/bin/env python
""" File: example_liveview.py
Author: Andreas Poehlmann
Last change: 2013/02/27
Liveview example
"""
import oceanoptics
import time
import numpy as np
from gi.repository import Gtk, GLib
class mpl:
from matplotlib.figure import Figure
from matplotlib.ba... | Python | 0 | @@ -941,24 +941,110 @@
ctrometer()%0A
+ self.spectrometer.integration_time(time_us=(sample_interval * 0.8 * 1000000))%0A
self
|
739abd7de8d4f33557265481e1ceeff71f305dfb | Initialize TensorFlow. | runppo2.py | runppo2.py | #!/usr/bin/env python
import sys
import os.path as osp
import numpy as np
import argparse
import tensorflow as tf
from belief import BeliefDriveItEnv
from policy import DriveItPolicy
from car import Car
from autopilot import LaneFollowingPilot, ReflexPilot, SharpPilot
from PositionTracking import TruePosition
from util... | Python | 0.000001 | @@ -4216,39 +4216,477 @@
-with tf.Session() as sess:%0A
+import gym%0A import logging%0A import multiprocessing%0A%0A ncpu = multiprocessing.cpu_count()%0A if sys.platform == 'darwin': ncpu //= 2%0A config = tf.ConfigProto(allow_soft_placement=True,%0A intra_op_parall... |
3967aa7a472bff0c289ea07e5a0cdd033e1e4abc | Fix an #include in the benchmarks to use the correct filename for Boost 1.0.2. | extras/benchmark/boost_di_source_generator.py | extras/benchmark/boost_di_source_generator.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python | 0 | @@ -1762,16 +1762,22 @@
s/scoped
+_scope
.hpp%3E%0A#i
|
3eccd311883183457c7deafeeada8d5e270f2cff | Remove ipdb | scorecard/profiles.py | scorecard/profiles.py | import requests
import json
API_URL = 'https://data.municipalmoney.org.za/api/cubes/'
Q4 = [10, 11, 12]
current_month = 12
def get_quarter_results(results, amount_field='amount.sum'):
return sum([r[amount_field] for r in results['cells'] if r['financial_period.period'] in Q4 and r[amount_field]])
def amount_from... | Python | 0.000003 | @@ -4361,42 +4361,8 @@
)%0A%0A%0A
- import ipdb; ipdb.set_trace()%0A
|
4d5edd17d7382108b90d3f60f2f11317da228603 | Add kafka start/stop script | script/kafkaServer.py | script/kafkaServer.py | #!/bin/python
from __future__ import print_function
import subprocess
import sys
import json
from util import appendline, get_ip_address
if __name__ == "__main__":
# start server one by one
if len(sys.argv) < 2 or sys.argv[1] not in ['start', 'stop']:
sys.stderr.write("Usage: python %s start or stop\n" % (sys.arg... | Python | 0.000001 | @@ -554,18 +554,18 @@
start.sh
-
'
+%5D
)%0A%09%09else
@@ -699,12 +699,12 @@
-stop.sh
-
'
+%5D
)%0A
|
f66ad05b9b85dbb34f4922fb8ea0d606718fbd8a | Revert last commit | apts/equipment.py | apts/equipment.py | import igraph as ig
import pandas as pd
#import seaborn as sns
# TODO: make this global and configurable in all apts
#sns.set_style('whitegrid')
from .constants import NodeLabels
from .utils import Utils, Constants
from .models.optical import *
from .optics import *
class Equipment:
"""
This class represents all... | Python | 0 | @@ -33,17 +33,16 @@
s as pd%0A
-#
import s
@@ -109,17 +109,16 @@
ll apts%0A
-#
sns.set_
|
ba6d8b2da886762535186a54160795f6531cbf95 | fix mat_id type to int | script/mesh_to_vtk.py | script/mesh_to_vtk.py | #!/usr/bin/python
# 04.10.2005
# last revision: 03.09.2007
import sys
import os.path as op
if (len( sys.argv ) == 3):
filename_in = sys.argv[1];
filename_out = sys.argv[2];
else:
print 'Usage: ', sys.argv[0], 'file.mesh file.vtk'
sys.exit()
if (filename_in == '-'):
file_in = sys.stdin
else:
fi... | Python | 0.000005 | @@ -2751,20 +2751,18 @@
mat_id
-floa
+in
t 1%5Cn' )
|
ebfaf30fca157e83ea9e4bf33173221fc9525caf | Fix emplorrs demo salary db error | demo/examples/employees/forms.py | demo/examples/employees/forms.py | from datetime import date
from django import forms
from django.utils import timezone
from .models import Employee, DeptManager, Title, Salary
class ChangeManagerForm(forms.Form):
manager = forms.ModelChoiceField(queryset=Employee.objects.all()[:100])
def __init__(self, *args, **kwargs):
self.depart... | Python | 0.000001 | @@ -3,87 +3,26 @@
om d
-atetime import date%0A%0Afrom django import forms%0Afrom django.utils import timezone
+jango import forms
%0A%0Afr
@@ -1110,24 +1110,41 @@
ntegerField(
+max_value=1000000
)%0A%0A def _
|
1fa85588740a63696ab03e3b267281d2163495ea | Fix another misnamed variable | scriptorium/papers.py | scriptorium/papers.py | #!/usr/bin/env python
"""Paper oriented operations."""
import glob
import subprocess
import re
import os
import shutil
import scriptorium
def paper_root(dname):
"""Given a directory, finds the root document for the paper."""
root_doc = None
for fname in glob.glob(os.path.join(dname, '*.mmd')):
#... | Python | 0.00157 | @@ -3883,17 +3883,16 @@
TEMPLATE
-S
_DIR)%0A%0A
|
d82d43a32d770498e802b44089637e774c331c13 | test for post and terminals | busineme/core/tests/test_views.py | busineme/core/tests/test_views.py | from django.test import TestCase
from django.test import Client
from ..models import Busline
from ..models import Terminal
STATUS_OK = 200
STATUS_NOT_FOUND = 404
BUSLINE_NOT_FOUND_ID = 99999999
class TestSearchResultView(TestCase):
def setUp(self):
self.client = Client()
self.busline = Busline(... | Python | 0 | @@ -115,16 +115,89 @@
Terminal
+%0Afrom ..models import Post%0Afrom authentication.models import BusinemeUser
%0A%0ASTATUS
@@ -229,23 +229,23 @@
D = 404%0A
-BUSLINE
+GENERIC
_NOT_FOU
@@ -1223,15 +1223,15 @@
str(
-BUSLINE
+GENERIC
_NOT
@@ -1916,32 +1916,32 @@
nse.status_code%0A
-
self.ass
@@ -1947,28 +19... |
544c6190fee4ca9f2746862a12f54f01af37148f | Fix deprecation warning of scipy.median. | neuroimaging/fixes/scipy/stats/models/robust/scale.py | neuroimaging/fixes/scipy/stats/models/robust/scale.py | import numpy as np
from scipy.stats import norm, median
def unsqueeze(data, axis, oldshape):
"""
unsqueeze a collapsed array
>>> from numpy import mean
>>> from numpy.random import standard_normal
>>> x = standard_normal((3,4,5))
>>> m = mean(x, axis=1)
>>> m.shape
(3, 5)
>>> m = u... | Python | 0.000001 | @@ -40,17 +40,34 @@
ort norm
-,
+%0Afrom numpy import
median%0A
|
dd7a857c98975eac7930747e0aee34ebcb9f3178 | Update Evaluation.py | src/LiviaNet/Modules/General/Evaluation.py | src/LiviaNet/Modules/General/Evaluation.py | """
Copyright (c) 2016, Jose Dolz .All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the f... | Python | 0 | @@ -2270,24 +2270,17 @@
ed.%0A
-Returns
%0A
+
----
@@ -2291,28 +2291,22 @@
-dice : float%0A
+It returns the
Dic
@@ -2325,32 +2325,36 @@
t as a float on
+the
range %5B0,1%5D.%0A
@@ -2362,255 +2362,59 @@
-Maximum similarity = 1%0A No similarity = 0%0A Both are empty (s... |
87af22b507fd8d17f707b5659e2914709527d35e | Refactor client.py. Pass default value to getattr | gobiko/apns/client.py | gobiko/apns/client.py | import importlib
import json
import jwt
import time
import uuid
from collections import namedtuple
from contextlib import closing
from hyper import HTTP20Connection
from .exceptions import (
InternalException,
ImproperlyConfigured,
PayloadTooLarge,
BadDeviceToken,
PartialBulkMessage
)
from .utils... | Python | 0 | @@ -7343,232 +7343,113 @@
-try:%0A exception_class = getattr(exceptions_module, reason)%0A except AttributeError:%0A raise InternalException%0A else:%0A raise exception_class
+# get exception class by name%0A rai... |
06f78c21e6b7e3327244e89e90365169f4c32ea1 | Fix style issues raised by pep8. | calaccess_campaign_browser/api.py | calaccess_campaign_browser/api.py | from tastypie.resources import ModelResource, ALL
from .models import Filer, Filing
from .utils.serializer import CIRCustomSerializer
class FilerResource(ModelResource):
class Meta:
queryset = Filer.objects.all()
serializer = CIRCustomSerializer()
filtering = { 'filer_id_raw': ALL }
... | Python | 0 | @@ -280,25 +280,24 @@
iltering = %7B
-
'filer_id_ra
@@ -295,33 +295,32 @@
ler_id_raw': ALL
-
%7D%0A exclud
@@ -325,23 +325,22 @@
udes = %5B
-
'id'
-
%5D
+%0A
%0A%0Aclass
@@ -490,17 +490,16 @@
ring = %7B
-
'filing_
@@ -510,17 +510,16 @@
aw': ALL
-
%7D%0A
@@ -536,12 +536,10 @@
= %5B
-
... |
a473b2cb9af95c1296ecae4d2138142f2be397ee | Add variant extension in example script | examples/variants.py | examples/variants.py | #!/usr/bin/env python
# -*- coding: utf8 - *-
from __future__ import print_function, unicode_literals
from cihai.bootstrap import bootstrap_unihan
from cihai.core import Cihai
def variant_list(unihan, field):
for char in unihan.with_fields(field):
print("Character: {}".format(char.char))
for var... | Python | 0 | @@ -804,16 +804,97 @@
tstrap%0A%0A
+ c.unihan.add_extension('cihai.unihan.UnihanVariants', namespace='variants')%0A%0A
prin
|
485d33f07bfcc10b9fa460331e84b41ecfc89dc1 | change some plotting parameters and default to testing some of the more advanced fiteach features | examples/n2hp_cube_example.py | examples/n2hp_cube_example.py | import astropy
import pyspeckit
import os
import astropy.units as u
import warnings
from astropy import wcs
if not os.path.exists('n2hp_cube.fit'):
import astropy.utils.data as aud
from astropy.io import fits
try:
f = aud.download_file('ftp://cdsarc.u-strasbg.fr/pub/cats/J/A%2BA/472/519/fits/opha_... | Python | 0 | @@ -2608,16 +2608,89 @@
errmap,%0A
+ use_neighbor_as_guess=True,%0A multicore=4,%0A
@@ -3382,36 +3382,71 @@
an i
-ntegrated image%0Aspc.mapplot(
+mage of the fitted tex%0Aspc.mapplot(estimator=1, vmin=0, vmax=10
)%0A#
|
eeebe264c4d873369f3d24b2e7b676e004eb6671 | Fix path bug in update_source. | neuroimaging/externals/pynifti/utils/update_source.py | neuroimaging/externals/pynifti/utils/update_source.py | #!/usr/bin/env python
"""Copy source files from pynifti git directory into nipy source directory.
We only want to copy the files necessary to build pynifti and the nifticlibs,
and use them within nipy. We will not copy docs, tests, etc...
Pynifti should be build before this script is run so swig generates the
wrappe... | Python | 0 | @@ -436,16 +436,28 @@
, exists
+, expanduser
%0Afrom sh
@@ -619,16 +619,17 @@
fti%0A%22%22%22%0A
+%0A
src_dir
@@ -634,23 +634,25 @@
r =
-'../../../../..
+expanduser('~/src
/pyn
@@ -656,16 +656,17 @@
pynifti'
+)
%0A%0A# Dest
|
3444a24078f91461f8aed7dfec153bb370f0784c | version bump | ema_workbench/__init__.py | ema_workbench/__init__.py | from __future__ import (absolute_import)
from . import analysis
from . import em_framework
from .em_framework import (Model, RealParameter, CategoricalParameter,
IntegerParameter, perform_experiments, optimize,
ScalarOutcome, TimeSeriesOutcome, Constant,
... | Python | 0.000001 | @@ -554,6 +554,6 @@
0.9.
-5
+9
'
|
ccb6728111a3142830bd4b3fccb8a956002013f0 | Update example to remove upload, not relevant for plotly! | examples/plotly_datalogger.py | examples/plotly_datalogger.py | from pymoku import Moku, MokuException
from pymoku.instruments import *
import pymoku.plotly_support as pmp
import time, logging, traceback
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.DEBUG)
# Use Moku.get_by_serial() or get_by_name() if... | Python | 0 | @@ -263,13 +263,12 @@
ing.
-DEBUG
+INFO
)%0A%0A#
@@ -873,16 +873,17 @@
t(start=
+1
0, durat
@@ -892,10 +892,8 @@
n=60
-*1
0, f
@@ -1297,85 +1297,48 @@
%25 e%0A
-%0A%09i.datalogger_stop()%0A%09i.datalogger_upload()%0A%0Aexcept Exception as e:%0A%09print e
+except Exception:%0A%09traceback.print_exc()
%0Afin
|
09bd40bc8d29fab157630d6411aa8316148a10d6 | Fix indentation bug | src/backend.py | src/backend.py | import os
import logging
import imp
import translation
#from mpi4py import MPI
class Backend(object):
def __init__(self, config_file):
if(config_file is None):
# Try to load an example configuration file
config_file = os.path.abspath(os.path.dirname(__file__)+
... | Python | 0.000019 | @@ -516,36 +516,32 @@
))%0A %0A
-
self.backend_con
@@ -589,20 +589,16 @@
g_file)%0A
-
@@ -668,20 +668,16 @@
.state)%0A
-
|
04ca95ea717ca3ab1880797e041fb342e82ef26e | Use gpkg keywords to identify Guild packages | guild/commands/packages_impl.py | guild/commands/packages_impl.py | # Copyright 2017-2018 TensorHub, 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 | @@ -726,34 +726,8 @@
ace%0A
-from guild import package%0A
from
@@ -811,41 +811,8 @@
%22)%0A%0A
-INTERNAL_PACKAGES = %5B%22guildai%22%5D%0A%0A
def
@@ -877,30 +877,30 @@
d()%0A
-scope_filtered
+guild_packages
= %5Bpkg
@@ -924,38 +924,27 @@
led if _
-filter_scope(pkg, args
+is_gpkg(pkg
)%5D%0A f
@@ -987,... |
e7cab954d320d8ff97c1c422a0f875c924c7b2df | fix null-pointer exception | scripts/experiment.py | scripts/experiment.py | #!/usr/bin/python
# ------------------------------------------------------------------------------
#
# Run experiment
#
# Author: Stefan Heule <sheule@cs.stanford.edu>
#
# ------------------------------------------------------------------------------
import sys
import os
import time
import argparse
import json
import... | Python | 0.00006 | @@ -3518,16 +3518,45 @@
oat(n))%0A
+ if succ_count %3E 0:%0A
@@ -3638,16 +3638,18 @@
count))%0A
+
|
5c44ff83c32d95d4e60513a11ce25f29025599ed | Update test_rpi-daemon-gui.py | ci_scripts/test_rpi-daemon-gui.py | ci_scripts/test_rpi-daemon-gui.py | import os
import urllib2
import multiprocessing as mp
import neblio_ci_libs as nci
nci.setup_travis_or_gh_actions_env_vars()
working_dir = os.getcwd()
deploy_dir = os.path.join(os.environ['BUILD_DIR'],'deploy', '')
# If this is a Travis PR, bail out instead of just wasting 45 mins running
if (os.environ.get('TRAVIS_... | Python | 0.000001 | @@ -2014,16 +2014,102 @@
che dir%0A
+if (os.environ.get('TRAVIS_BUILD_DIR') is not None):%0A # move ccache dir for travis%0A
nci.call
@@ -2225,16 +2225,178 @@
e', ''))
+%0Aelse:%0A # move ccache for github actions%0A nci.call_with_err_code('mv ' + os.path.join(deploy_dir,'.ccache', '') + ' ' + os.path.join(work... |
a333ca8964132b3f1830c2ceda8cbb805df78999 | Fix locale initialization | product/runtime/src/main/python/java/android/__init__.py | product/runtime/src/main/python/java/android/__init__.py | """Copyright (c) 2018 Chaquo Ltd. All rights reserved."""
from importlib import reload
import os
from os.path import exists, join
import sys
import traceback
from . import stream, importer
def initialize(context, build_json, app_path):
stream.initialize()
importer.initialize(context, build_json, app_path)
... | Python | 0.009032 | @@ -416,16 +416,73 @@
t Common
+%0A%0A # These are ordered roughly from low to high level.
%0A ini
@@ -621,32 +621,63 @@
ctypes(context)%0A
+ initialize_locale(context)%0A
%0A%0Adef initialize
@@ -3317,8 +3317,352 @@
RARY%22%5D)%0A
+%0A%0Adef initialize_locale(context):%0A import locale%0A # Of the ... |
d06c8486c8353a0775259f7342f61964b738f341 | Add missing symbol. | sensibility/language/java/__init__.py | sensibility/language/java/__init__.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright 2017 Eddie Antonio Santos <easantos@ualberta.ca>
#
# 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/licens... | Python | 0.000017 | @@ -3677,16 +3677,21 @@
',', '.'
+, '@'
%0A%7D%0ACLOSE
|
038509c11d029dd1bd0adef2c29f472cad5f0ea6 | Fix a few problems. | scripts/find_error.py | scripts/find_error.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Lexing error finder
~~~~~~~~~~~~~~~~~~~
For the source files given on the command line, display
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:licens... | Python | 0.000145 | @@ -3831,21 +3831,22 @@
1')%0A
-ntext
+tokens
= %5B%5D%0A
@@ -3882,16 +3882,23 @@
oken(tok
+, state
):%0A
@@ -4088,12 +4088,8 @@
tate
-s%5Bi%5D
),%0A
@@ -4337,16 +4337,160 @@
) + ':'%0A
+ if showall:%0A for tok, state in zip(tokens, states):%0A show_token... |
b75f46549f0a8354772e923873946ec9b7d7be95 | Remove unneeded absolute pathnames from the arguments to open() | scraper.py | scraper.py | import requests
import os
from bs4 import BeautifulSoup
import sys
import json
def search_CL(bedrooms=None, minAsk=None, maxAsk=None, query=None):
u"""
Return content and encoding of a response to a query of CL.
Submits a request to http://seattle.craigslist.org/search/apa as
search paramaters and re... | Python | 0 | @@ -1980,36 +1980,16 @@
th open(
-os.getcwd() + '/' +
results,
@@ -2166,28 +2166,8 @@
pen(
-os.getcwd() + '/' +
resu
|
2e5f5fc689ee55f32556be69dcbf0672ea7fdbed | change deprecation warning | district42/json_schema/schema.py | district42/json_schema/schema.py | import warnings
from copy import deepcopy
from ..errors import DeclarationError
from .types import (Any, AnyOf, Array, ArrayOf, Boolean, Enum, Null, Number,
Object, OneOf, SchemaType, String, Timestamp, Undefined)
class Schema:
def ref(self, schema):
return deepcopy(schema)
def ... | Python | 0.000001 | @@ -1613,34 +1613,108 @@
-warnings.warn('deprecated'
+message = 'schema.array_of is deprecated, use schema.array.of instead'%0A warnings.warn(message
, De
|
51b67ad1df17df8a137f32f261a84c94b1b27189 | Replace hardcoded 'edx' with platform name. (#29657) | openedx/core/djangoapps/user_api/accounts/__init__.py | openedx/core/djangoapps/user_api/accounts/__init__.py | """
Account constants
"""
from django.conf import settings
from django.utils.text import format_lazy
from django.utils.translation import gettext_lazy as _
# The maximum length for the bio ("about me") account field
BIO_MAX_LENGTH = 300
# The minimum and maximum length for the name ("full name") account field
NAME_M... | Python | 0.000011 | @@ -2485,17 +2485,68 @@
MSG = _(
-%22
+ # pylint: disable=translation-of-non-string%0A f'
This ema
@@ -2603,19 +2603,40 @@
ous
-edX
+%7Bsettings.PLATFORM_NAME%7D
account
%22)%0AA
@@ -2631,17 +2631,17 @@
account
-%22
+'
)%0AAUTHN_
|
b759455bec4b9e231808b704f289f37eb198a895 | Add guest user account with admin privs | ditto/scripts/setup_test_data.py | ditto/scripts/setup_test_data.py | """Script to set up test data for a Ditto instance.
As before we tried to do this with migrations but ran into problems
early on with custom permissions not being created.
In any case, it's probably easier/better to have a single bootstrap
script instead of a bunch of data migrations.
"""
from django.conf import set... | Python | 0 | @@ -1158,16 +1158,17 @@
min_user
+s
()%0A s
@@ -2931,16 +2931,17 @@
min_user
+s
():%0A
@@ -2979,16 +2979,59 @@
N_ROLE)%0A
+ _create_user('guest', core.ADMIN_ROLE)%0A
%0A%0Adef se
|
732ac42475b30f51ff672ab43ae0c4789f57ef9c | use printinfo | scripts/lpod-style.py | scripts/lpod-style.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009-2010 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
# Romain Gauthier <romain@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and... | Python | 0.000001 | @@ -1229,16 +1229,8 @@
dout
-, stderr
%0A%0A#
@@ -2703,28 +2703,21 @@
print
- %3E%3E stderr,
+info(
%22master
@@ -2765,16 +2765,17 @@
y_name()
+)
%0A bod
@@ -4475,20 +4475,13 @@
rint
- %3E%3E stderr,
+info(
%22mer
@@ -4508,16 +4508,17 @@
yles...%22
+)
%0A
|
a0e1183d9da98dd9f79c496b055cab0bb2638532 | Update h_RNN | h_RNN/Mnist.py | h_RNN/Mnist.py | import time
import tflearn
import numpy as np
import tensorflow as tf
from h_RNN.RNN import RNNWrapper, Generator
from h_RNN.SpRNN import SparseRNN
from Util.Util import DataUtil
class MnistGenerator(Generator):
def __init__(self, im=None, om=None, one_hot=True):
super(MnistGenerator, self)._... | Python | 0.000001 | @@ -1,19 +1,17 @@
import
-time
+os
%0D%0Aimport
@@ -11,23 +11,133 @@
%0Aimport
-tflearn
+sys%0D%0Aroot_path = os.path.abspath(%22../%22)%0D%0Aif root_path not in sys.path:%0D%0A sys.path.append(root_path)%0D%0A%0D%0Aimport time
%0D%0Aimport
@@ -1755,687 +1755,4 @@
()%0D%0A
-%0D%0A print(%22=%22 * 60, %22%5... |
b9cc76d410ca034918c615402e3fbe82b226859e | Add public address validation test. | path_and_address/tests/test_validation.py | path_and_address/tests/test_validation.py | from itertools import product
from ..validation import valid_address, valid_hostname, valid_port
def _join(host_and_port):
return '%s:%s' % host_and_port
def _join_all(hostnames, ports):
return map(_join, product(hostnames, ports))
hostnames = [
'127.0.0.1',
'localhost',
'example.com',
'ex... | Python | 0 | @@ -249,24 +249,39 @@
stnames = %5B%0A
+ '0.0.0.0',%0A
'127.0.0
@@ -496,36 +496,15 @@
'
-localhost:0',%0A '127
+0
.0.0.
-1
+0
:0',
|
fd7454610f4cffcfc8c289539b3824f023fe973f | change cruise input dim | modules/tools/prediction/mlp_train/common/configure.py | modules/tools/prediction/mlp_train/common/configure.py | #!/usr/bin/env python
###############################################################################
# Copyright 2018 The Apollo 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 ... | Python | 0.99845 | @@ -1078,16 +1078,20 @@
t': 23 +
+ 8 +
180,%0A
|
f5aa5f3dae5f10288d67b7e4b51d04bcfb495fc3 | Use .run for standalone packages. | scripts/packageIfw.py | scripts/packageIfw.py | #!/usr/bin/env python
################################################################################
# Copyright (C) 2013 Digia Plc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redist... | Python | 0 | @@ -3709,18 +3709,18 @@
ame + '.
-bi
+ru
n'%0A%0A
|
8092efdd0bf5f5ca8d5498cf679b019920c00bfd | format with black | plugins/feeds/public/virustotal_apiv3.py | plugins/feeds/public/virustotal_apiv3.py | import logging
import re
import json
from datetime import timedelta, datetime
from core import Feed
from core.config.config import yeti_config
from core.observables import Hash, File
# Variable
VTAPI = yeti_config.get('vt', 'key')
headers = {"x-apikey": VTAPI}
limit = 10
params = {'limit': limit}
regex = "[A-Fa-f0-9]... | Python | 0.000001 | @@ -217,19 +217,19 @@
get(
-'vt', 'key'
+%22vt%22, %22key%22
)%0Ahe
@@ -281,15 +281,15 @@
= %7B
-'
+%22
limit
-'
+%22
: li
@@ -655,21 +655,17 @@
- '
+%22
vt_url_h
@@ -673,17 +673,17 @@
nting_v3
-'
+%22
: %7B%0A
@@ -694,17 +694,17 @@
-'
+%22
name
-': '
+%22: %22
VT U
@@ -716,17 +716,17 ... |
ddab6ff5760680cffd388fba96a8562baa2f28c8 | support -l and -s arguments | scripts/pub_script.py | scripts/pub_script.py | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
"""
hbmqtt_pub - MQTT 3.1.1 publisher
Usage:
hbmqtt_pub --version
hbmqtt_pub (-h | --help)
hbmqtt_pub --url BROKER_URL -t TOPIC (-f FILE | -l | -m MESSAGE | -n | -s) [-c CONFIG_FILE] [-i CLIENT_ID] [-q | --qos QOS] [-... | Python | 0 | @@ -2577,17 +2577,17 @@
ments%5B'-
-s
+l
'%5D:%0A
@@ -2632,16 +2632,41 @@
.stdin:%0A
+ if line:%0A
@@ -2705,16 +2705,200 @@
utf-8')%0A
+ if arguments%5B'-s'%5D:%0A import sys%0A message = bytearray()%0A for line in sys.stdin:%0A message.extend(line.enc... |
aae5146bd672fdec9a055666c9742acbc1dddd5b | remove obsolete comment | planetstack/core/dashboard/views/shell.py | planetstack/core/dashboard/views/shell.py | # /opt/planetstack/core/dashboard/views/helloworld.py
import datetime
import os
import sys
import time
import json
from django.http import HttpResponse, HttpResponseServerError, HttpResponseForbidden
from django.views.generic import TemplateView, View
from core.models import *
from django.forms.models import model_to_d... | Python | 0 | @@ -1,58 +1,4 @@
-# /opt/planetstack/core/dashboard/views/helloworld.py%0A
impo
|
d60b460928c55c544b18c57c0eb697ae88fde9e0 | Make masked fill values into nan before further processing to avoid issues with precision leading to different behaviours. (#632) | lib/improver/ensemble_calibration/ensemble_calibration_utilities.py | lib/improver/ensemble_calibration/ensemble_calibration_utilities.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2018 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | Python | 0 | @@ -2628,16 +2628,116 @@
ta = %5B%5D%0A
+ if np.ma.is_masked(forecast.data):%0A forecast.data = np.ma.filled(forecast.data, np.nan)%0A%0A
for
|
51a9a02ccf4a133818f14f3ff6e864c1e041ec37 | Update event_chat.py | ark/events/event_chat.py | ark/events/event_chat.py | from ark.chat_commands import ChatCommands
from ark.cli import *
from ark.database import Db
from ark.rcon import Rcon
class EventChat(object):
@classmethod
def output_chat_from_server(cls,text,line):
out(line)
@classmethod
def parse_chat_command(cls,steam_name,player_name,text,line):
... | Python | 0.000002 | @@ -930,28 +930,714 @@
xt,line):%0A out(line)%0A
+%0A @classmethod%0A def filter_chat(cls,steam_name,player_name,text,line):%0A words=text.split()%0A res=None%0A for word in words:%0A if res is None:%0A res=Db.check_word(word)%0A if res:%0A ... |
e236b7d34cdf156cc16ba8c95b0526785e717898 | update scenario | enquiry/tests/scenario.py | enquiry/tests/scenario.py | from enquiry.tests.model_maker import make_enquiry
def default_scenario_enquiry():
make_enquiry(
'Rick',
'Can I buy some hay?',
'',
'07840 538 357',
)
make_enquiry(
'Ryan',
(
'Can I see some of the fencing you have done?\n'
"I would l... | Python | 0.000001 | @@ -1,8 +1,89 @@
+from datetime import datetime%0A%0Afrom dateutil.relativedelta import relativedelta%0A%0A
from enq
@@ -625,14 +625,73 @@
7 890',%0A
+ email_sent=datetime.now() + relativedelta(days=1),%0A
)%0A
|
c13df93862fa154a51659dd119ca2390db10bfef | remove short circuit | rapidsms_httprouter/management/commands/send_messages.py | rapidsms_httprouter/management/commands/send_messages.py | import traceback
import time
from django.core.management.base import BaseCommand
from rapidsms.models import Backend, Connection, Contact
from rapidsms_httprouter.models import Message, MessageBatch
from rapidsms_httprouter.router import get_router
from django.conf import settings
from django.core.mail import send_mail... | Python | 0.999907 | @@ -5438,215 +5438,8 @@
-try:%0A batch = to_process%5B0%5D%0A except IndexError:%0A self.info(%22%25s is returning index error%22%25 to_process)%0A
batc
@@ -5452,16 +5452,19 @@
_process
+%5B0%5D
%0A
|
ecceb10500a395ce2cb79d913ab43187921468be | move fn towards dictionary comprehension | iatidataquality/dqparsetests.py | iatidataquality/dqparsetests.py | import re
import sys
import itertools
from functools import partial
import iatidataquality.models as models
class TestSyntaxError(Exception): pass
comment = re.compile('#')
blank = re.compile('^$')
def ignore_line(line):
return bool(comment.match(line) or blank.match(line))
def test_functions():
mappings = ... | Python | 0.000018 | @@ -3479,25 +3479,35 @@
+def function_
for
-
+_
test
- in
+(
test
-s
+)
:%0A
@@ -3848,44 +3848,131 @@
-test_functions%5B
+return test_id, f%0A%0A for test in tests:%0A
test_id
-%5D
+, f
= f
-%0A
+unction_for_test(test)%0A test_functions%5Btest_id%5D = f%0A
%0A
|
ddcd166b72ef96296a884f63f626c3ffd236059f | make tests pass without LMS settings | common/djangoapps/status/tests.py | common/djangoapps/status/tests.py | from django.conf import settings
from django.test import TestCase
from tempfile import NamedTemporaryFile
import os
from override_settings import override_settings
from status import get_site_status_msg
import xmodule.modulestore.django
from xmodule.modulestore.django import modulestore
from xmodule.modulestore impor... | Python | 0 | @@ -68,42 +68,24 @@
rom
-tempfile import NamedTemporaryFile
+mock import Mock
%0Aimp
@@ -138,16 +138,56 @@
settings
+%0Afrom tempfile import NamedTemporaryFile
%0A%0Afrom s
@@ -224,196 +224,220 @@
sg%0A%0A
-import xmodule.modulestore.django%0Afrom xmodule.modulestore.django import modulestore%0Afrom xmodule.modul... |
c2f99fe178ff853e87b3f034394b18956d395e87 | Change credits verbose_name to autorship. | ideascube/mediacenter/models.py | ideascube/mediacenter/models.py | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from taggit.managers import TaggableManager
from ideascube.models import (
LanguageField, SortedTaggableManager, TimeStampedModel)
from ideascube.search.models import SearchableQuerySe... | Python | 0 | @@ -1866,22 +1866,26 @@
name=_('
-credit
+Authorship
'), max_
|
f113aaae2232d0041e01a6f12ab2ba083df65d44 | Change submit module to use new interface. | autocms/submit.py | autocms/submit.py | """Functions to submit and register new jobs."""
import os
import socket
def submit_and_stamp(counter, testname, scheduler, config):
"""Submit a job to the scheduler and produce a newstamp file.
This function should be run from within the test directory.
If the submission fails an output log will be pro... | Python | 0 | @@ -57,22 +57,8 @@
os%0A
-import socket%0A
%0A%0Ade
@@ -192,185 +192,19 @@
Th
-is function should be run from within the test directory.%0A If the submission fails an output log will be produced with the%0A standard output of the submitter.%0A%0A The name
+e full path
of
@@ -306,606 +306,248 @@
... |
0973acf04fd2fd59db4880d5ba4d994f4c1733db | Add length detection for PNG images. | identifiers/image_identifier.py | identifiers/image_identifier.py |
# Identifier for basic image files
from identifier import Result
JPEG_PATTERNS = [
'FF D8 FF E0',
'FF D8 FF E1',
'FF D8 FF FE',
]
GIF_PATTERNS = [
'47 49 46 38 39 61',
'47 49 46 38 37 61',
]
PNG_PATTERNS = [
'89 50 4E 47'
]
BMP_PATTERNS = [
'42 4D 62 25',
'42 4D F8 A9',
'42 4D 76 02',
]
ICO_PATTERNS = [
... | Python | 0 | @@ -1,69 +1,248 @@
%0A
-# Identifier for basic image files%0Afrom identifier import Result
+import io%0Afrom struct import unpack%0Aimport sys%0Afrom identifier import Result%0A%0A#############%0A# Constants #%0A#############%0A%0APNG_CHUNK_IEND = b'IEND'%0APNG_CHUNK_IHDR = b'IHDR'%0A%0A#######################%0A# Ide... |
d7c5b8784fd747355884e3371f1c85ede9a9bf6f | Disable some packages for now, so that packaging can finish on the buildbots as they are. This should let wrench run the Mono test suite. | profiles/mono-mac-release-64/packages.py | profiles/mono-mac-release-64/packages.py | import os
from bockbuild.darwinprofile import DarwinProfile
class MonoReleasePackages:
def __init__(self):
# Toolchain
#package order is very important.
#autoconf and automake don't depend on CC
#ccache uses a different CC since it's not installed yet
#every thing after ccache needs a working ccache
self... | Python | 0 | @@ -1367,24 +1367,25 @@
er.py',%0A%09%09%09%09
+#
'libgdiplus.
@@ -1393,16 +1393,17 @@
y',%0A%09%09%09%09
+#
'xsp.py'
@@ -1404,24 +1404,25 @@
sp.py',%0A%09%09%09%09
+#
'gtk-sharp-2
@@ -1442,16 +1442,17 @@
y',%0A%09%09%09%09
+#
'boo.py'
@@ -1474,16 +1474,17 @@
y',%0A%09%09%09%09
+#
'ironlan
@@ -1495,16 +1495,1... |
fe0d872c69280b5713a4ad6f0a1cd4a5623fdd75 | Add createnapartcommand contents | cadnano/part/createnapartcommand.py | cadnano/part/createnapartcommand.py | Python | 0 | @@ -0,0 +1,705 @@
+from ast import literal_eval%0A%0Afrom cadnano.cnproxy import UndoCommand%0Afrom cadnano.part.nucleicacidpart import NucleicAcidPart%0A%0A%0Aclass CreateNucleicAcidPartCommand(UndoCommand):%0A def __init__(self, document, grid_type, use_undostack):%0A # TODO%5BNF%5D: Docstring%0A su... | |
72117d55715b80df0a01fa519be09bfeec0bc272 | fix generate empty tag bug | ezblog/blog/views.py | ezblog/blog/views.py | from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from .models import Post, Category, Tag
# index
def index(request):
per_page = 2
... | Python | 0.000003 | @@ -1765,16 +1765,69 @@
tags =
+ request.POST.get('tags')%0A if tags:%0A tags =
request
@@ -2157,20 +2157,21 @@
-print(name)%0A
+if name:%0A
@@ -2175,32 +2175,36 @@
try:%0A
+
@@ -2244,24 +2244,28 @@
+
+
except Tag.D
@@ -2285,32 +2285,36... |
b0858f61b29d1d4357c61f90cd45fd92a4b72c86 | Add the configs in order that user is prompted | fabfile/configure.py | fabfile/configure.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import ConfigParser
from fabric.tasks import Task
from fabric.colors import green
from fabric.api import task, env, sudo
from fabric.operations import put, prompt
# default to configuring DEV environment
os.environ.setdefault("CALACCESS_WEBSITE_ENV", "DEV")
cp_se... | Python | 0.000039 | @@ -49,16 +49,52 @@
port os%0A
+from collections import OrderedDict%0A
import C
@@ -1174,18 +1174,29 @@
onfig =
-%7B%7D
+OrderedDict()
%0A con
|
899254d3bd064ba8e5653ad9081674b7af1495fa | fix capture=True | fabfile/openstack.py | fabfile/openstack.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import os
import yaml
from fabric.api import task, local, settings, warn_only
from cuisine import file_exists
@task
def up():
""" Boot instances """
# call class OpenStack
op = OpenStack()
# Check if fingerprint exis... | Python | 0.998992 | @@ -1133,43 +1133,23 @@
int)
-)%0A print '#### ', output
+, capture=True)
%0A
|
0fb32166825d630cc5e87b39588e280737567448 | Fix AWS Athena Sensor object has no attribute 'mode' (#4844) | airflow/contrib/sensors/aws_athena_sensor.py | airflow/contrib/sensors/aws_athena_sensor.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) 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
#... | Python | 0 | @@ -2190,32 +2190,26 @@
super(
-BaseSensorOperat
+AthenaSens
or, self
|
0364ddd42b47aed0367746a3081f3064f9d1fa45 | Fix typo in TypedFlagHolder docstring. | fancyflags/_flags.py | fancyflags/_flags.py | # Copyright 2021 DeepMind Technologies Limited.
#
# 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 agre... | Python | 0.999993 | @@ -6583,17 +6583,16 @@
abseil
-l
-py drop
|
384b59222c1da09dacdb7ee70218ac407b1a0a68 | load Travis notification POST payload | service.py | service.py | #!/usr/bin/env python
# vim: set expandtab sw=4 ts=4:
'''
Retrieve Travis CI build data and log to Keen.io
Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/service
<https://github.com/buildtimetrend/service/>
This program is free software: you can redistribut... | Python | 0 | @@ -892,16 +892,28 @@
port os%0A
+import json%0A
import c
@@ -1867,16 +1867,52 @@
=None):%0A
+ self.load_travis_payload()%0A%0A
@@ -3880,16 +3880,425 @@
repo))%0A%0A
+ def load_travis_payload(self):%0A '''%0A Load payload from Travis notification%0A '''%0A if 'Content... |
f2b25679ff906615906552810368092cc5321a3c | Add source and issue tracker link warnings | fdroidserver/lint.py | fdroidserver/lint.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# rewritemeta.py - part of the FDroid server tool
# Copyright (C) 2010-12, Ciaran Gultnieks, ciaran@ciarang.com
#
# This program 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 Fr... | Python | 0 | @@ -843,16 +843,26 @@
nParser%0A
+import re%0A
import c
@@ -877,16 +877,16 @@
etadata%0A
-
%0Aconfig
@@ -1567,16 +1567,828 @@
False)%0A%0A
+ regex_warnings = %7B%0A 'Source Code': %5B%0A (re.compile(r'.*code%5C.google%5C.com/p/%5B%5E/%5D+/source/.*'),%0A %22/source ... |
926b9aaaf6a3a3f7680377804b42eae953793797 | call parent constructor in singpost.shipper | shipper.py | shipper.py | """
Copyright (C) 2009, Tay Ray Chuan
Please see LICENCE for licensing details.
"""
"""
Each shipping option uses the data in an Order object to calculate the shipping cost and return the value
"""
try:
from decimal import Decimal
except:
from django.utils._decimal import Decimal
from django.utils.translatio... | Python | 0 | @@ -756,16 +756,41 @@
__(self,
+ cart=None, contact=None,
service
@@ -816,16 +816,70 @@
MAIL'):%0A
+ super(Shipper, self).__init__(cart, contact)%0A%0A
|
9067da2973ff53c801811e0e414565784ab2910c | Fix tenant_id mismatch in test object creation | neutron_lbaas/tests/tempest/v2/api/test_pools_admin.py | neutron_lbaas/tests/tempest/v2/api/test_pools_admin.py | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | Python | 0.000014 | @@ -2147,16 +2147,26 @@
COL_PORT
+, **kwargs
)%0A
|
4d1c465e5c946ac17334e29e0ded7b6134533d12 | Disable save in Crop multi roi and show the image instead | plugins/Scripts/Plugins/Crop_Multi_Roi.py | plugins/Scripts/Plugins/Crop_Multi_Roi.py | from ij import IJ
from ij.plugin.frame import RoiManager
from io.scif.config import SCIFIOConfig
from io.scif.img import ImageRegion
from io.scif.img import ImgOpener
from io.scif.img import ImgSaver
from net.imagej.axis import Axes
import os
def main():
# Get current image filename
imp = IJ.getImage()
f... | Python | 0 | @@ -226,16 +226,75 @@
ort Axes
+%0Afrom net.imglib2.img.display.imagej import ImageJFunctions
%0A%0Aimport
@@ -1686,43 +1686,29 @@
-IJ.log(%22Saving crop to %25s%22 %25
+imp.setName(
crop_
-f
+base
name
@@ -1747,24 +1747,75 @@
age%0A
+#IJ.log(%22Saving crop to %25s%22 %25 crop_fname)%0A #
sa... |
5b3acc2d35c06554bce1b8d2245b14e1831304df | add the tests into the Sage doctest suite | sympy/test_external/test_sage.py | sympy/test_external/test_sage.py | # This testfile tests SymPy <-> Sage compatibility
# Execute this test inside Sage, e.g. with:
# sage -python bin/test sympy/test_external/test_sage.py
# Don't test any SymPy features here. Just pure interaction with Sage.
# Always write regular SymPy tests for anything, that can be tested in pure
# Python (without S... | Python | 0 | @@ -44,16 +44,17 @@
ibility%0A
+#
%0A# Execu
@@ -147,16 +147,221 @@
sage.py%0A
+#%0A# This file can be tested by Sage itself by:%0A# sage -t sympy/test_external/test_sage.py%0A# and if all tests pass, it should be copied (verbatim) to Sage, so that it is%0A# automatically doctested by Sage.%0A#
%0A# Don't
@@ -3873,... |
9a19c34a104aabd0c5b34734f587573d5766a4bd | support multi-file results | finishTest/Finish.py | finishTest/Finish.py | from __future__ import print_function
from BaseTask import BaseTask
from Engine import MasterTbl, Error, get_platform
from Dbg import Dbg
import os, json, time, platform
dbg = Dbg()
validA = ("passed", "failed", "diff")
comment_block = """
Test Results:
'notfinished': means that the test has s... | Python | 0 | @@ -697,12 +697,57 @@
, fn
+A
):%0A%0A
+ result = %22passed%22%0A%0A for fn in fnA:%0A
@@ -777,24 +777,26 @@
fn)):%0A
+
+
return %22fail
@@ -804,24 +804,26 @@
d%22%0A %0A
+
f = open(fn)
@@ -823,24 +823,26 @@
pen(fn)%0A
+
+
lineA = f.re
@@ -851,24 +851,26 @@
lines()%0A
+... |
bd710f64368d1606dbe52783e6fe2156a4c4e986 | Test get_manager | armstrong/core/arm_sections/tests/backends.py | armstrong/core/arm_sections/tests/backends.py | from django.core.exceptions import ObjectDoesNotExist
from ._utils import *
from ..models import Section
from arm_sections_support.models import *
class ManyToManyBackendTestCase(ArmSectionsTestCase):
"""
Test fetching items for content with a many-to-many relationship to sections.
"""
def setUp(self... | Python | 0.000001 | @@ -142,16 +142,197 @@
port *%0A%0A
+from armstrong.core.arm_sections.backends import ItemFilter%0Afrom armstrong.core.arm_sections.managers import SectionSlugManager%0Afrom model_utils.managers import InheritanceManager%0A%0A
%0Aclass M
@@ -4391,28 +4391,621 @@
e in self.pro_sports.items)%0A
+%0Aclass ManagerTestCa... |
3879f264e5faca6f96e4b16a30174aac4a5006e9 | Fix syntax error in tests | astropy/coordinates/tests/test_erfa_astrom.py | astropy/coordinates/tests/test_erfa_astrom.py | import numpy as np
import pytest
import astropy.units as u
from astropy.time import Time
from astropy.utils.exceptions import AstropyWarning
from astropy.coordinates import EarthLocation, AltAz, GCRS, SkyCoord
from astropy.coordinates.erfa_astrom import (
erfa_astrom, ErfaAstrom, ErfaAstromInterpolator
)
def te... | Python | 0.000042 | @@ -1849,17 +1849,16 @@
csecond)
-)
%0A%0A #
@@ -1975,17 +1975,16 @@
csecond)
-)
%0A%0A%0Adef t
|
079c466091fa44000b23f386bd3ff07c048c33e5 | Move test imports to the top | astropy/coordinates/tests/test_erfa_astrom.py | astropy/coordinates/tests/test_erfa_astrom.py | import numpy as np
import pytest
def test_science_state():
import astropy.units as u
from astropy.coordinates.erfa_astrom import (
erfa_astrom, ErfaAstrom, ErfaAstromInterpolator
)
assert erfa_astrom.get().__class__ is ErfaAstrom
res = 300 * u.s
with erfa_astrom.set(ErfaAstromInterpo... | Python | 0 | @@ -31,69 +31,186 @@
st%0A%0A
-%0Adef test_science_state():%0A import astropy.units as u%0A
+import astropy.units as u%0Afrom astropy.time import Time%0Afrom astropy.utils.exceptions import AstropyWarning%0Afrom astropy.coordinates import EarthLocation, AltAz, GCRS, SkyCoord%0A%0A
from
@@ -243,36 +243,32 @@
a... |
a3750ff624d0f929a53cdb2dcd8f44bd2d9573d4 | query get_solicitacoes busca última inclusão | src/cd/queries/novo_modulo/solicitacoes.py | src/cd/queries/novo_modulo/solicitacoes.py | from pprint import pprint
from utils.functions.models import dictlist
from utils.functions.queries import debug_cursor_execute
def get_solicitacoes(
cursor,
solicitacao=None,
pedido_destino=None,
ref_destino=None,
ref_reservada=None,
):
filtra_solicitacao = f"""--
AND sl.SOLICITACAO = {solicita... | Python | 0.999458 | @@ -1889,16 +1889,52 @@
TDE) qt%0A
+ , max(sl.INCLUSAO) inclusao%0A
|
8481cb40caa896b81386f4a9ddb6fda92e14cc76 | Fix a typo | ironic/tests/unit/db/sqlalchemy/test_types.py | ironic/tests/unit/db/sqlalchemy/test_types.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.999988 | @@ -2032,17 +2032,17 @@
ncodedLi
-c
+s
t_defaul
|
38efb136609b645b0076c0aa1481330f9e28ee51 | Add a rule for matching packages by regex. | fmn/rules/generic.py | fmn/rules/generic.py | # Generic rules for FMN
import fedmsg
import fmn.rules.utils
def user_filter(config, message, fasnick=None, *args, **kw):
""" All messages for a certain user
Use this rule to include messages that are associated with a
specific user.
"""
fasnick = kw.get('fasnick', fasnick)
if fasnick:
... | Python | 0 | @@ -17,16 +17,27 @@
for FMN%0A
+import re%0A%0A
import f
@@ -1819,24 +1819,561 @@
**config)%0A%0A%0A
+def package_regex_filter(config, message, pattern=None, *args, **kw):%0A %22%22%22 All messages pertaining to packages matching a given regex%0A%0A Use this rule to include messages that relate to packages tha... |
7f974b87c278ef009535271461b5e49686057a9a | Fix for django >= 1.10 | avatar/management/commands/rebuild_avatars.py | avatar/management/commands/rebuild_avatars.py | from django.core.management.base import NoArgsCommand
from avatar.conf import settings
from avatar.models import Avatar
class Command(NoArgsCommand):
help = ("Regenerates avatar thumbnails for the sizes specified in "
"settings.AVATAR_AUTO_GENERATE_SIZES.")
def handle_noargs(self, **options):
... | Python | 0 | @@ -33,22 +33,20 @@
import
-NoArgs
+Base
Command%0A
@@ -132,14 +132,12 @@
and(
-NoArgs
+Base
Comm
@@ -285,20 +285,20 @@
ndle
-_noargs(self
+(self, *args
, **
|
f36cad198c45caa40f179e5a9de134610cc3f6fe | fix date filter | skylines/commands/flights/selector.py | skylines/commands/flights/selector.py | from flask.ext.script import Option
from sqlalchemy import func
from datetime import datetime
from skylines.model import Airport, Flight
selector_options = (
Option('--date-from', help='Date from (YYYY-MM-DD)'),
Option('--date-to', help='Date to (YYYY-MM-DD)'),
Option('--uploaded-from', help='Date from (... | Python | 0.000011 | @@ -1363,26 +1363,25 @@
akeoff_time
-%3E=
+%3C
date_to)%0A
|
ba1764a7a34e3560f96b857e7c1194a760a4bd86 | fix layout of docstring, make paragraph a code block | feedinlib/weather.py | feedinlib/weather.py | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 9 16:01:02 2015
@author: uwe
"""
import pandas as pd
class FeedinWeather:
def __init__(self, **kwargs):
r"""
Class, containing all meta informations regarding the weather data set.
Parameters
----------
data : pandas.DataFr... | Python | 0.00001 | @@ -2362,16 +2362,40 @@
g form:%0A
+%0A .. code::%0A%0A
@@ -2414,16 +2414,20 @@
+
# name:
@@ -2431,16 +2431,20 @@
e: NAME%0A
+
@@ -2471,16 +2471,20 @@
+
# latitu
@@ -2494,16 +2494,20 @@
yy.yyy%0A
+
@@ -2533,32 +2533,36 @@
nt/City%0A ... |
e9727669db3d71e6cf1805306810ef296b390385 | fix post_*allocation calls | src/clusto/drivers/base/resourcemanager.py | src/clusto/drivers/base/resourcemanager.py |
import clusto
from clusto.schema import select, and_, ATTR_TABLE, Attribute, func, Counter
from clusto.drivers.base import Driver, ClustoMeta
from clusto.exceptions import ResourceTypeException, ResourceNotAvailableException, ResourceException
class ResourceManager(Driver):
"""The ResourceManager driver should ... | Python | 0 | @@ -6699,37 +6699,32 @@
hing, resource,
-attr.
number)%0A%0A
@@ -6754,37 +6754,32 @@
hing, resource,
-attr.
number)%0A
|
0da189464703837e212bff06c24cc6eb5b62eeea | Fix name of room | blackbelt/slack.py | blackbelt/slack.py | from slacker import Slacker
from blackbelt.config import config
class Slack(object):
def __init__(self, token=None):
if not token:
token = config['slack']['access_token']
slack = Slacker(token)
self.slack = slack
if not token:
raise ValueError("Can't ... | Python | 0.999953 | @@ -676,11 +676,19 @@
m='#
-sre
+engine-room
'):%0A
|
f2b6b31702126062d1f930b053cb0f2ba3e46c7c | add logging to file loading | smif/cli/parse_sector_model_config.py | smif/cli/parse_sector_model_config.py | # -*- coding: utf-8 -*-
"""Read and parse the config for sector models
"""
import os
from glob import glob
import fiona
from . parse_config import ConfigParser
class SectorModelReader(object):
"""Parses the configuration and input data for a sector model
Arguments
=========
model_name : str
T... | Python | 0.000001 | @@ -68,16 +68,31 @@
els%0A%22%22%22%0A
+import logging%0A
import o
@@ -678,16 +678,66 @@
onfig):%0A
+ self.logger = logging.getLogger(__name__)%0A
@@ -3419,32 +3419,117 @@
path in paths:%0A
+ self.logger.debug(%22Loading initial conditions from %7B%7D%22.format(path))%0A
... |
eb3a332cf5aeb6b213c333cbfba78b26b776db49 | fix facebook api | social_publisher/backends/facebook.py | social_publisher/backends/facebook.py | # -*- coding: utf-8 -*-
from social_publisher import facebook
from social_publisher.backends import base
class FacebookBackend(base.BaseBackend):
name = 'facebook'
auth_provider = 'facebook'
def get_api(self, social_user):
return facebook.GraphAPI(social_user.extra_data.get('access_token'))
... | Python | 0.000014 | @@ -736,20 +736,52 @@
id),
-
+%0A params=%7B'
image
-=
+':
image
+%7D
)%0A
|
07c8888a3623ea40c4f2047e11445726e61e2438 | Fix lint. | packs/csv/tests/test_action_parse.py | packs/csv/tests/test_action_parse.py | import unittest2
from parse_csv import ParseCSVAction
__all__ = [
'ParseCSVActionTestCase'
]
MOCK_DATA = """
first,last,year
name1,surename1,1990
""".strip()
class ParseCSVActionTestCase(unittest2.TestCase):
def test_run(self):
result = ParseCSVAction().run(data=MOCK_DATA, delimiter=',')
exp... | Python | 0.000001 | @@ -159,16 +159,17 @@
trip()%0A%0A
+%0A
class Pa
|
8d288053574753fcd2bc5d163b7035f2bfbd9f8e | Make categorical projection code simpler | chainerrl/agents/categorical_dqn.py | chainerrl/agents/categorical_dqn.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import chainer
import chainer.functions as F
import numpy as np
from chainerrl.agents import dqn
... | Python | 0.031496 | @@ -1813,16 +1813,159 @@
ate m_l%0A
+ # Note that u - bj in the original paper is replaced with 1 - (bj - l) to%0A # deal with the case when bj is an integer, i.e., l = u = bj%0A
scat
@@ -1965,32 +1965,32 @@
scatter_add(%0A
-
z_probs.
@@ -2065,22 +2065,28 @@
robs * (
-u
+1
-
+(
bj
+ - l)
... |
7c75a9c01aec6427bef573e69605087e7b30ff33 | test cases for createview | parcellate/apps/winparcel/tests.py | parcellate/apps/winparcel/tests.py | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from .models import (RSSObject,
RSSEntry)
from .lib import ReadRSS
class Simple... | Python | 0 | @@ -1,309 +1,1326 @@
-%22%22%22%0AThis file demonstrates writing tests using the unittest module. These will pass%0Awhen you run %22manage.py test%22.%0A%0AReplace this with more appropriate tests for your application.%0A%22%22%22%0A%0Afrom django.test import TestCase%0A%0Afrom .models import (RSSObject,%0A ... |
c68792c50f91445ed733c5e5ed0c226a04b1e173 | Use chromium snapshots for Linux_64 and Mac. | chrome/test/chromedriver/archive.py | chrome/test/chromedriver/archive.py | # Copyright (c) 2013 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.
"""Downloads items from the Chromium continuous archive."""
import os
import platform
import urllib
import util
CHROME_34_REVISION = '251854'
CHROME_3... | Python | 0.000001 | @@ -2825,18 +2825,40 @@
m()
-==
+in (
'Linux'
+, 'Linux_x64', 'Mac')
:%0A
|
4fba6f7473014c11558864d9425a790adf45baa5 | add midnight race condition note per Chris Petrilli | parsedatetime/tests/TestPhrases.py | parsedatetime/tests/TestPhrases.py |
"""
Test parsing of strings that are phrases
"""
import unittest, time, datetime
import parsedatetime as pdt
# a special compare function is used to allow us to ignore the seconds as
# the running of the test could cross a minute boundary
def _compareResults(result, check, dateOnly=False, debug=False):
targe... | Python | 0 | @@ -966,32 +966,437 @@
tPhrases(self):%0A
+ #%0A # NOTE - this test will fail under certain conditions%0A # It is building an absolute date for comparison and then testing%0A # the parsing of relative phrases and as such will fail if run%0A # near the midnight tr... |
9c898d7e547b13bb289c0d1cada0bbd4078803dc | Allow passing of size_cutoff to preassembler methods. | indra/db/pre_assemble_script.py | indra/db/pre_assemble_script.py | import indra.tools.assemble_corpus as ac
from indra.db.util import get_statements, insert_pa_stmts
from indra.preassembler import Preassembler
from indra.preassembler.hierarchy_manager import hierarchies
def make_unique_statement_set(preassembler, stmts):
stmt_groups = preassembler.get_stmt_matching_groups(stmts)... | Python | 0 | @@ -870,35 +870,48 @@
ique_stmts,
-num_procs=1
+**generate_id_map_kwargs
):%0A id_ma
@@ -954,33 +954,92 @@
nique_stmts,
- num_proc
+%0A **generate_id_map_kwarg
s)%0A retur
@@ -1040,17 +1040,23 @@
return
-%5B
+%7Btuple(
%5Bunique_
@@ -1100,16 +1100,17 @@
dx_pair... |
4df8aafb1d4ab12ad795b30f1f75937072216f1b | Implement proper event detection, lots of debugging code | hdltools/vcd/event.py | hdltools/vcd/event.py | """VCD Event tracker."""
from typing import Tuple, Dict
from hdltools.vcd.parser import BaseVCDParser, VCDParserError
from hdltools.vcd.trigger import VCDTriggerDescriptor
from hdltools.vcd.mixins.conditions import VCDConditionMixin
from hdltools.vcd.mixins.time import VCDTimeRestrictionMixin
from hdltools.vcd.trigge... | Python | 0.000001 | @@ -51,16 +51,54 @@
e, Dict%0A
+from colorama import Fore, Back, init%0A
from hdl
@@ -151,16 +151,16 @@
erError%0A
-
from hdl
@@ -393,16 +393,38 @@
rigger%0A%0A
+init(autoreset=True)%0A%0A
# an eve
@@ -1375,16 +1375,52 @@
print(
+%0A Back.RED%0A +
f%22DEBUG:
@@ -1422,31 +1422,34 @@
EBU... |
37fd4ea15564d6a3fb8a2486c17d30984a6675d5 | Use more generic variable | phileo/templatetags/phileo_tags.py | phileo/templatetags/phileo_tags.py | from django import template
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType
from phileo.models import Like
from phileo.utils import _allowed, widget_context
from phileo.settings import LIKABLE_MODELS
register = template.Library()
@register.assignment_t... | Python | 0.000001 | @@ -330,23 +330,19 @@
o_likes(
-athlete
+obj
):%0A r
@@ -432,23 +432,19 @@
r_model(
-athlete
+obj
),%0A
@@ -469,15 +469,11 @@
_id=
-athlete
+obj
.pk%0A
|
13c070948b5f8e22d853a85b6b711b0ead2b3ac9 | Fix pep8 issues in profile_roles (#25458) | lib/ansible/plugins/callback/profile_roles.py | lib/ansible/plugins/callback/profile_roles.py | # (C) 2017, Tennis Smith, http://github.com/gamename
#
# This file 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.
#
# File is distribu... | Python | 0 | @@ -1001,16 +1001,22 @@
tils.six
+.moves
import
@@ -1210,29 +1210,40 @@
+def
rediv
- = lambda ll, b:
+(ll, b):%0A return
lis
@@ -1271,16 +1271,17 @@
ll%5B1:%5D%0A
+%0A
retu
@@ -3879,9 +3879,8 @@
_total)%0A
-%0A
|
c3ea0ebccd1f40f38cb9ebcc724986f65e8c7a4a | use samehost instead of the host's ip address. | helpers/postgresql.py | helpers/postgresql.py | import os, psycopg2, re, time
import logging
from urlparse import urlparse
logger = logging.getLogger(__name__)
class Postgresql:
def __init__(self, config):
self.name = config["name"]
self.host, self.port = config["listen"].split(":")
self.data_dir = config["data_dir"]
self.re... | Python | 0 | @@ -5180,22 +5180,16 @@
res
-%25(network)s/32
+samehost
tru
|
37c65efa1b78abcc75d506554e6fb877678ec2f2 | Fix a typo | editorsnotes/api/views/topics.py | editorsnotes/api/views/topics.py | from editorsnotes.main.models import Topic
from .. import filters as es_filters
from ..serializers.topics import TopicSerializer
from .base import BaseListAPIView, BaseDetailView, DeleteConfirmAPIView
from .mixins import (ElasticSearchListMixin, EmbeddedMarkupReferencesMixin,
HydraProjectPermissi... | Python | 1 | @@ -752,20 +752,21 @@
ain.add_
-note
+topic
',)%0A%0A%0Acl
@@ -991,20 +991,21 @@
.change_
-note
+topic
', 'main
@@ -1012,20 +1012,21 @@
.delete_
-note
+topic
',)%0A%0A%0Acl
|
0091c41d8dd064b40ccf35d4d24c01ae4438f028 | Set sender in signal handlers | cityhallmonitor/signals/handlers.py | cityhallmonitor/signals/handlers.py | from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils import timezone
@receiver(pre_save)
def handle_pre_save(sender, instance, *args, **kwargs):
"""
Set updated_at timestamp if model is actually dirty
"""
if hasattr(sender, 'is_dirty'):
... | Python | 0.000001 | @@ -125,28 +125,105 @@
one%0A
-%0A%0A@receiver(pre_save
+from cityhallmonitor.models import DirtyFieldsModel%0A%0A%0A@receiver(pre_save, sender=DirtyFieldsModel
)%0Ade
@@ -283,21 +283,16 @@
%0A %22%22%22
-%0A
Set upda
@@ -334,21 +334,16 @@
ly dirty
-%0A
%22%22%22%0A
@@ -480,16 +480,41 @@
ost_save
... |
2409bf1377ceaee99e4d4b49d0c8c2a2fef57687 | Generate a new 'name' if necessary | ckanext/ddi/importer/ddiimporter.py | ckanext/ddi/importer/ddiimporter.py | import requests
import traceback
from pprint import pprint
from ckan.lib.munge import munge_title_to_name
from ckanext.harvest.harvesters import HarvesterBase
from ckanext.ddi.importer import metadata
import ckanapi
import logging
log = logging.getLogger(__name__)
class DdiImporter(HarvesterBase):
def run(self... | Python | 1 | @@ -1502,32 +1502,108 @@
pkg_dict%5B'id'%5D%0A
+ pkg_dict%5B'name'%5D = self._gen_new_name(pkg_dict%5B'name'%5D)%0A
|
fbe9de1d8f019b6f1c263337f04e5866131d0e60 | drop the chunk size of the kafka feed down | corehq/apps/change_feed/pillow.py | corehq/apps/change_feed/pillow.py | import json
from kafka import KeyedProducer
from kafka.common import KafkaUnavailableError
from casexml.apps.case.models import CommCareCase
from corehq.apps.change_feed import data_sources
from corehq.apps.change_feed.connection import get_kafka_client
from corehq.apps.change_feed.models import ChangeMeta
from corehq.... | Python | 0 | @@ -785,16 +785,31 @@
eckpoint
+, chunk_size=10
)%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.