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 |
|---|---|---|---|---|---|---|---|
90067f5543ec883d849cefef30f079d4e127ad59 | Improve filter_news.py and fix some small issues. | data_analysis/filter_news.py | data_analysis/filter_news.py | """Generate year files with news counts
Usage:
filter_news.py <directory> <output>
Options:
-h, --help
"""
from docopt import docopt
from os import listdir
from os.path import isfile, join
import datetime
import pandas as pd
if __name__ == "__main__":
# Parse the command line
args = docopt(__doc__)
# Arr... | Python | 0 | @@ -207,16 +207,36 @@
tetime%0A%0A
+from tqdm import *%0A%0A
import p
@@ -248,16 +248,114 @@
as pd%0A%0A
+def find_index(id, lis):%0A%09for i in range(0, len(lis)):%0A%09%09if id == lis%5Bi%5D:%0A%09%09%09return i%0A%09return -1%0A%0A
if __nam
@@ -781,16 +781,21 @@
file in
+tqdm(
onlyfile
@@ -795,16 +795,17 @@
... |
ecd974320159eceb38578802ddb4c84b811f00aa | Print the name of an image file when it is saved. | Hipshot.py | Hipshot.py | #!/usr/bin/env python2
'''Simulate long-exposure photography
Hipshot converts a video file into a single image file simulating
a long-exposure photograph.
'''
import cv
try:
from os import EX_DATAERR as _EX_DATAERR
from os import EX_NOINPUT as _EX_NOINPUT
from os import EX_USAGE as _EX_USAGE
except Impo... | Python | 0.000001 | @@ -1239,16 +1239,34 @@
wimage)%0A
+ print newfile%0A
retu
|
4a6093e5cee98a05ea674ee21dc88f7c5d87bb0b | include refence in received invoices xlsx | l10n_es_vat_book/report/vat_book_xlsx.py | l10n_es_vat_book/report/vat_book_xlsx.py | # Copyright 2018 Luis M. Ontalba <luismaront@gmail.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, models
class VatNumberXlsx(models.AbstractModel):
_name = 'report.l10n_es_vat_book.l10n_es_vat_book_xlsx'
_inherit = 'report.report_xlsx.abstract'
def generat... | Python | 0 | @@ -477,16 +477,38 @@
e, lines
+, received_lines=False
):%0A
@@ -604,115 +604,67 @@
-sheet.write(row, col, 'Invoice', bold)%0A col += 1%0A sheet.write(row, col, 'Date', bold)
+xlsx_header = %5B'Invoice', 'Date', 'Partner', 'VAT', 'Base',
%0A
@@ -668,33 +668,24 @@
-co... |
b7968a474fa45c9cb9b18456b21bd96a12b83b91 | fix notify_exception arguments, remove imports | corehq/apps/hqcase/management/commands/ptop_fast_reindexer.py | corehq/apps/hqcase/management/commands/ptop_fast_reindexer.py | from datetime import datetime
from optparse import make_option
from django.core.management.base import NoArgsCommand
import logging
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.pillows import CasePillow, XFormPi... | Python | 0 | @@ -114,260 +114,8 @@
and%0A
-import logging%0Afrom django.core.mail import send_mail%0Afrom django.core.management.base import BaseCommand%0Afrom casexml.apps.case.models import CommCareCase%0Afrom corehq.pillows import CasePillow, XFormPillow%0Afrom couchforms.models import XFormInstance%0A
from
@@ -3098,16 +3098,... |
e2fe219071cb5e86c800000b9ca860a010a79de4 | Support python2 too | Mollie/API/Client.py | Mollie/API/Client.py | import platform
import sys
import ssl
import re
import pkg_resources
from urllib.parse import urlencode
import requests
from . import Error
from . import Resource
class Client(object):
CLIENT_VERSION = '2.0.0a0'
API_ENDPOINT = 'https://api.mollie.com'
API_VERSION = 'v2'
UNAME = ' '.joi... | Python | 0 | @@ -62,16 +62,25 @@
sources%0A
+try:%0A
from url
@@ -105,16 +105,92 @@
rlencode
+%0Aexcept ImportError:%0A # support python 2%0A from urllib import urlencode
%0A%0Aimport
|
587fc77284dace51a28be6a1ee639cf22831abdd | Check for DNS on UFS for 4.2 | calyptos/plugins/debugger/check_ports.py | calyptos/plugins/debugger/check_ports.py | from fabric.context_managers import hide
import re
from calyptos.plugins.debugger.debuggerplugin import DebuggerPlugin
class CheckPorts(DebuggerPlugin):
def debug(self):
all_hosts = self.component_deployer.all_hosts
with hide('everything'):
ports = self.run_command_on_hosts('netstat -ln... | Python | 0 | @@ -113,16 +113,17 @@
Plugin%0A%0A
+%0A
class Ch
@@ -425,12 +425,8 @@
777,
- 53,
844
@@ -468,12 +468,8 @@
': %5B
-53,
7500
@@ -478,16 +478,90 @@
18778%5D%7D%0A
+ ufs_ports = %7B'tcp': %5B8773, 53%5D,%0A 'udp': %5B53%5D%7D%0A
@@ -742,32 +742,33 @@
'udp': %5B%5D%7D%0A
+... |
0558b49e902ec7af6b78fe1660e756dd2f33ddae | Add REJECT rule on FWaaS Client | neutronclient/neutron/v2_0/fw/firewallrule.py | neutronclient/neutron/v2_0/fw/firewallrule.py | # Copyright 2013 Big Switch Networks
# 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 requir... | Python | 0 | @@ -3837,16 +3837,26 @@
, 'deny'
+, 'reject'
%5D,%0A
|
4f214c3fa35bf955534330c06028a56e01294925 | Save experience before passing it to minibatch_update | capstone/rl/learners/qlearning_approx.py | capstone/rl/learners/qlearning_approx.py | import random
from collections import deque
from ..learner import Learner
from ..utils import max_qvalue, min_qvalue
class ApproximateQLearning(Learner):
'''Q-learning with a function approximator'''
def __init__(self, env, policy, qfunction, discount_factor=1.0, selfplay=False,
experience_r... | Python | 0 | @@ -1444,34 +1444,21 @@
-self.replay_memory.append(
+experience =
(sta
@@ -1488,16 +1488,69 @@
t_state)
+%0A self.replay_memory.append(experience
)%0A
|
a79596be92323391ef79e3502b02e90904ec9f4e | Add PMT coordinates | globals.py | globals.py | MM = 1.
M = 1000 * MM
NS = 1.
S = 10**9 * NS
SPEED_OF_LIGHT = 299792458. * M / S
SPEED = (2./3.) * SPEED_OF_LIGHT
LENGTH = 500. * MM
| Python | 0 | @@ -126,12 +126,83 @@
500. * MM%0A%0A
+PMT_COORDS = %5B(0., 0.), (LENGTH, 0.), (0., LENGTH), (LENGTH, LENGTH)%5D%0A%0A
|
49026db21c3f200e68f6048ddac165ff5f5d8d17 | Update based on code review | buzzmobile/sense/inputer/inputer.py | buzzmobile/sense/inputer/inputer.py | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
def input_node():
pub = rospy.Publisher('dst', String, queue_size=0)
rospy.init_node('inputer', anonymous=True)
pub.publish("")
while not rospy.is_shutdown():
new_dst = raw_input("Dest> ")
pub.publish(new_dst)
if __name... | Python | 0 | @@ -106,19 +106,27 @@
lisher('
-dst
+input_value
', Strin
@@ -189,16 +189,94 @@
s=True)%0A
+ # Publish a nonsense initial value to make sure subscribers don't explode%0A
pub.
|
05e651b0e606f216a78c61ccfb441ce7ed41d852 | Exclude from coverage the code pathways that are specific to Python 2. | reg/compat.py | reg/compat.py | import sys
from types import MethodType
# True if we are running on Python 3.
PY3 = sys.version_info[0] == 3
if PY3:
string_types = (str,)
else: # pragma: no cover
string_types = (basestring,) # noqa
if PY3:
def create_method_for_class(callable, type):
return MethodType(callable, type)
d... | Python | 0 | @@ -405,16 +405,36 @@
j)%0Aelse:
+ # pragma: no cover
%0A def
|
695b211f8b4470394bd3518835cca049f097857a | Print iteration from 1 | reid/train.py | reid/train.py | from __future__ import print_function
import time
from torch.autograd import Variable
from .evaluation import accuracy, cmc
from .loss.oim import OIMLoss
from .metrics import pairwise_distance
from .utils.meters import AverageMeter
class Trainer(object):
def __init__(self, model, criterion, args):
super... | Python | 0.000929 | @@ -1447,33 +1447,39 @@
%0A if
-i
+(i + 1)
%25 self.args.pri
@@ -1761,16 +1761,20 @@
epoch, i
+ + 1
, len(da
@@ -4316,17 +4316,23 @@
if
-i
+(i + 1)
%25 self.
@@ -4520,16 +4520,20 @@
i
+ + 1
, len(da
|
25c29b61a2503a0d0ebdf90d5926e0c90bd61225 | Handle responses with empty content (#77) | yarn_api_client/base.py | yarn_api_client/base.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import requests
from .errors import APIError, ConfigurationError
try:
from urlparse import urlparse, urlunparse
except ImportError:
from urllib.parse import urlparse, urlunparse
class Response(object):
"""
Basic containe... | Python | 0 | @@ -500,44 +500,196 @@
data
-%0A self.data = response.json()
+. Handle cases where content is empty%0A # to prevent JSON decode issues%0A if response.content:%0A self.data = response.json()%0A else:%0A self.data = %7B%7D
%0A%0A%0Ac
|
205373d626e3db691efaf57a380fd6791a24252a | Use urlparse to parse url. | youtubeadl/api/views.py | youtubeadl/api/views.py | import datetime
import json
import os
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden, Http404, \
HttpResponseRedirect
from django.utils.encoding import smart_str
from ce... | Python | 0.000001 | @@ -30,16 +30,32 @@
mport os
+%0Aimport urlparse
%0A%0Afrom d
@@ -874,16 +874,117 @@
if url:%0A
+ qs = urlparse.parse_qs(urlparse.urlparse(url).query)%0A if qs%5B'v'%5D:%0A
@@ -1033,63 +1033,24 @@
h?v=
+%25s
' %25
-%5C%0A request.POST.get('v', None)... |
f7a46c8d19bf0c6c4c1f2f7576b4d05c7726666a | Fix error message of nova baremetal-node-delete | nova/api/openstack/compute/baremetal_nodes.py | nova/api/openstack/compute/baremetal_nodes.py | # Copyright (c) 2013 NTT DOCOMO, INC.
# Copyright 2014 IBM Corporation.
# 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/licen... | Python | 0.009607 | @@ -4805,33 +4805,33 @@
onic_proxy(%22
-port-crea
+node-dele
te%22)%0A%0A @w
|
678977459b4fd5dffb4cd817276de3fae1ec7bf4 | Remove commented out code | scripts/endpoints_json.py | scripts/endpoints_json.py | #!/usr/bin/env python3
import lxml.html
from lxml.cssselect import CSSSelector
import requests
import json
class EndpointIdentifier:
_page = 'https://www.reddit.com/dev/api/oauth'
_no_scope = '(any scope)'
_headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like... | Python | 0 | @@ -1338,17 +1338,16 @@
%0A %5D%0A%0A
-%0A
def
@@ -2652,78 +2652,6 @@
ue))
-%0A #print(EndpointIdentifier()._format_href(%22#GET_api_needs_captcha%22))
%0A%0A
|
9817712e0f250a0930bb47504a01d5438e81b7bd | fix code style | validr/model.py | validr/model.py | """
Model
model class is a convenient way to use schema, it's inspired by data class but
works differently, it's much simpler and easy to use.
define a base model:
@modelclass
class Model:
# define common fields and methods here
# __init__, __repr__ and __eq__ will auto created if not exists
... | Python | 0.000022 | @@ -937,24 +937,25 @@
r=compiler)%0A
+%0A
def deco
@@ -1021,24 +1021,25 @@
r=compiler)%0A
+%0A
return d
|
77d87bf92956232501616e5ef110bc6916c7c077 | Make parser error message for multiple values easier to read | value/parser.py | value/parser.py | import re
import sys
import argparse
from numpy import *
from other.core import *
from other.core.utility import Log
from other.core.vector import *
def fix_name(name):
return name.replace('_','-')
def try_autocomplete(props):
import os
def return_options(options, include_files=False):
os.system("echo Compl... | Python | 0.000012 | @@ -2759,20 +2759,18 @@
one of
-'
%25s
-'
, got '%25
@@ -2785,16 +2785,17 @@
f.dest,'
+,
'.join(
@@ -2798,19 +2798,36 @@
oin(map(
-str
+lambda s: %22'%25s'%22 %25 s
,prop.al
|
07c4a550857bedaaae1a1829f1036050a8d38ee2 | debug message | vespa/fitebs.py | vespa/fitebs.py | #! /usr/bin/env python
from __future__ import print_function, division
import logging
import sys, re, os
try:
import numpy as np
import pandas as pd
except ImportError:
np, pd = (None, None)
from .transit_basic import eclipse_pars, eclipse_tt
from .transit_basic import NoEclipseError, NoFitError
try:... | Python | 0.000001 | @@ -2978,24 +2978,161 @@
try:%0A
+ logging.debug('p0=%7B%7D, b=%7B%7D, aR=%7B%7D, P=%7B%7D, frac=%7B%7D, ecc=%7B%7D, w=%7B%7D, sec=%7B%7D, u1=%7B%7D, u2=%7B%7D'.format(p0,b,aR,P,frac,ecc,w,sec,u1,u2)%0A
|
d32e3c37244ace41a4ccb488a3782d8ec6b7d390 | Change text of execution start | bin/webdevops/taskloader/BaseTaskLoader.py | bin/webdevops/taskloader/BaseTaskLoader.py | #!/usr/bin/env/python
# -*- coding: utf-8 -*-
#
# (c) 2016 WebDevOps.io
#
# This file is part of Dockerfile Repository.
#
# 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, in... | Python | 0.000004 | @@ -1770,29 +1770,9 @@
nt '
-Collected %25s tasks, s
+S
tart
@@ -1784,16 +1784,28 @@
xecution
+ of %25s tasks
...' %25 (
|
ed03d9771e64e7237a727cb1759956b2fbc3372e | Support explicit timestamp in array_packet | zeeko/messages/array.py | zeeko/messages/array.py | # -*- coding: utf-8 -*-
"""
ZMQ support for serializing numpy arrays.
This file defines the protocol for sending a numpy array over a ZMQ socket.
"""
import numpy as np
import zmq
import json
import struct
import time
import itertools
from .. import ZEEKO_PROTOCOL_VERSION
from ..utils.sandwich import sandwich_unico... | Python | 0.000005 | @@ -5116,16 +5116,32 @@
r=False,
+ timestamp=None,
bundle=
@@ -5358,32 +5358,53 @@
ount=framecount,
+ timestamp=timestamp,
flags=flags, co
|
b5b4160c5ec89329367e4cb8903bcd705e0d5981 | version bump | zettelgeist/zversion.py | zettelgeist/zversion.py | #
# ZettelGeist Version for Python
#
__version__ = "1.0.20"
def version():
return __version__
| Python | 0.000001 | @@ -51,17 +51,17 @@
= %221.0.2
-0
+1
%22%0A%0Adef v
|
55a4e8246c81dfbd195dda9b019923efe303dc96 | Fix deed test | bluebottle/deeds/tests/test_transitions.py | bluebottle/deeds/tests/test_transitions.py | from datetime import timedelta, date
from bluebottle.test.utils import StateMachineTestCase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.deeds.tests.factories import DeedFactory, DeedParticipantFactory
from bluebottle.initiatives.tests.factories import InitiativeFactory
... | Python | 0.000004 | @@ -2699,16 +2699,24 @@
st_open_
+started_
no_end(s
@@ -3207,23 +3207,28 @@
ef test_
-running
+open_started
(self):%0A
@@ -3262,23 +3262,20 @@
us'%5D = '
-running
+open
'%0A%0A
@@ -4030,23 +4030,20 @@
ef test_
-running
+open
_no_end(
@@ -4088,15 +4088,12 @@
= '
-running
+open
'%0A
|
d00f510f69bacd6a9888f4cea77da110fa7165d7 | add install list generator | mngpacman.py | mngpacman.py | #!/usr/bin/env python
import os
import platform
import subprocess
class PackageManager(object):
def all_packages(self):
raise NotImplementedError()
def explicit_packages(self):
raise NotImplementedError()
def depend_packages(self, package):
raise NotImplementedError()
def gr... | Python | 0 | @@ -1588,63 +1588,570 @@
)%0A%0A%0A
-mng = get_package_manager()%0Acfg = Config(%22config.py%22)%0A%0A
+def gen_install_list(pkgs, gen_list=None, parent=None):%0A if gen_list is None:%0A gen_list = %5B%5D%0A if parent not in gen_list:%0A for it in pkgs if parent is None else pkgs%5Bparent%5D:%0A ... |
f450af8eb2b64e2f1eaccd6098a4004b6d0c766e | Add url validation. move imports to top of method. | 4ChanWebScraper.py | 4ChanWebScraper.py | #downloads an IMAGE to the provided path.
#this fails on .WEBM or other media
def downloadImage(url,path):
import requests
from PIL import Image
img = requests.get(url)
i = Image.open(StringIO(img.content))
i.save(path)
#Checks if input folder exists in the current directory. If not, create it.
de... | Python | 0 | @@ -1040,16 +1040,245 @@
String%0A%0A
+def validateUrl(url):%0A pattern = r'%5E(https?://)?(www%5C.)?4chan'%0A if( re.match(pattern, url, re.I)):%0A return url%0A else:%0A msg = %22URLs must be for a 4chan domain!%22%0A raise argparse.ArgumentTypeError(msg)%0A
%0Aif __na
@@ -1317,24 +131... |
f002039b2edeb8c38a55d10bee27e03fe3051b20 | Add Queen destinations | chess/core/possible_destinations.py | chess/core/possible_destinations.py | from .models import Coordinate, Piece
from .utils import BLACK_PIECES, WHITE_PIECES, INITIAL_BOARD
def is_valid(piece, dest_coord, chess_board):
print(dest_coord)
if not dest_coord.inside_board:
return False
if dest_coord.row >= 0 and dest_coord.row < 8 and dest_coord.column >= 0 and dest_coord.c... | Python | 0.000002 | @@ -2693,26 +2693,26 @@
rtical_desti
-a
n
+a
tions = %5BCoo
@@ -2870,18 +2870,18 @@
al_desti
-a
n
+a
tions%0A%0A
@@ -3303,32 +3303,32 @@
rd.column - i),%0A
-
%5D%0A%0A
@@ -3322,24 +3322,841 @@
%5D%0A%0A
+ if piece == Piece.WHITE_QUEEN or piece == Piece.BLACK_QUEEN:%0A h_destina... |
d681608efb591c35af9f8cef12f777d5d43b683d | Declare device before posting measurements to Safecast API | examples/safecast.py | examples/safecast.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Log measurements to Safecast open-data API (https://api.safecast.org).
Require the SafecastPy packages:
https://github.com/MonsieurV/SafecastPy
You'll also need a Safecast API key:
https://api.safecast.org/en-US/users/sign_up
Released under MIT Licen... | Python | 0 | @@ -622,257 +622,8 @@
URL%0D
-%0A# Radiation Watch Pocket Geiger is registered:%0D%0A# - As device id 90 on developement instance%0D%0A# http://dev.safecast.org/en-US/devices/90%0D%0A# - As device id 145 on production instance%0D%0A# https://api.safecast.org/en-US/devices/145%0D%0ADEVICE_ID = 90%0D
%0A%0D%0A#
@@ ... |
3775cf7369c7a7843ec4e4dc6399fe6616b2512d | access to maya optionVar and Env() | mayahook/optionvars.py | mayahook/optionvars.py | import os
import pymel.util as util
import pmcmds as cmds
#-----------------------------------------------
# Option Variables
#-----------------------------------------------
class OptionVarList(tuple):
def __init__(self, key, val):
self.key = key
tuple.__init__(self, val)
def appendVar( ... | Python | 0.000001 | @@ -40,10 +40,13 @@
ort
-p
m
+aya.
cmds
|
d36ce6289cb9bdcab9338d2a412fb675f57a3740 | Make progress bar to complete to 100% - fixes #103 | examples/terminal.py | examples/terminal.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# PYTHON_ARGCOMPLETE_OK
import os
import time
from demo_opts import device
from oled.virtual import terminal
from PIL import ImageFont
def make_font(name, size):
font_path = os.path.abspath(os.path.join(
os.path.dirname(__file__), 'fonts', name))
return I... | Python | 0 | @@ -1657,13 +1657,13 @@
1000
-0, 31
+1, 25
):%0A
|
b8b60bf646126ed3b2a4eb15b6ed51d7eba687a6 | add world bank example | oa_manual.py | oa_manual.py | from collections import defaultdict
from time import time
from util import elapsed
# things to set here:
# license, free_metadata_url, free_pdf_url
# free_fulltext_url is set automatically from free_metadata_url and free_pdf_url
def get_overrides_dict():
override_dict = defaultdict(dict)
# cindy wu ex... | Python | 0.999749 | @@ -2350,24 +2350,174 @@
r1998.pdf%22%0A%0A
+ # mentioned in world bank as good unpaywall example%0A override_dict%5B%2210.3386/w23298%22%5D%5B%22free_pdf_url%22%5D = %22https://economics.mit.edu/files/12774%22%0A
return o
|
ac891aed1215c62225fceca166e94a5a2aec1f14 | Update toon.py | climate/toon.py | climate/toon.py | """
Toon van Eneco Thermostat Support.
This provides a component for the rebranded Quby thermostat as provided by
Eneco.
"""
import logging
from homeassistant.components.climate import (ClimateDevice,
ATTR_TEMPERATURE,
STATE_A... | Python | 0 | @@ -833,30 +833,23 @@
N_MODE%0A%0A
-toonlib_values
+HA_TOON
= %7B%0A
|
04453cba5f6403a8e49cc8c3233c1fd45ca8e0a4 | fix typo | cep_web_service/app/zipcode/resources.py | cep_web_service/app/zipcode/resources.py | # coding: utf-8
from __future__ import absolute_import
import six
from flask import Blueprint
from flask_restful import Api, Resource, reqparse, abort
import postmon
from cep_web_service.app import app
from cep_web_service.app.constants import NULL
from .models import Zipcode
zipcode_blueprint = Blueprint('api', __n... | Python | 0.999991 | @@ -911,16 +911,19 @@
ip_code%7D
+ is
invalid
|
38006719cf50e3fb6b981a0a3540e289d1ef9065 | Use dictionary literal | examples/vae/data.py | examples/vae/data.py | import gzip
import os
import numpy as np
import six
from six.moves.urllib import request
parent = 'http://yann.lecun.com/exdb/mnist'
train_images = 'train-images-idx3-ubyte.gz'
train_labels = 'train-labels-idx1-ubyte.gz'
test_images = 't10k-images-idx3-ubyte.gz'
test_labels = 't10k-labels-idx1-ubyte.gz'
num_train = 6... | Python | 0.998632 | @@ -1807,29 +1807,24 @@
= %7B
-%7D
%0A
-mnist%5B
+
'data'
-%5D =
+:
np.
@@ -1864,27 +1864,26 @@
s=0)
+,
%0A
-mnist%5B
+
'target'
%5D =
@@ -1878,19 +1878,17 @@
'target'
-%5D =
+:
np.appe
@@ -1924,17 +1924,23 @@
axis=0)
-%0A
+,%0A %7D
%0A pri
|
56186c985b87fbbf0a7ea0f04c8b089a13b29fe3 | Test execution: Remove unneeded variable | execute_all_tests.py | execute_all_tests.py | #! /bin/python3
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be us... | Python | 0.000027 | @@ -1181,55 +1181,8 @@
()%0A%0A
- test_dir = os.path.abspath(%22coalib/tests%22)%0A
@@ -1219,16 +1219,39 @@
les(
-test_dir
+os.path.abspath(%22coalib/tests%22)
)%0A
|
ace9947582aec32d8e03b214bbf6e270c8978a50 | Add stack-docs clean command | documenteer/stackdocs/stackcli.py | documenteer/stackdocs/stackcli.py | """Implements the ``stack-docs`` CLI for stack documentation builds.
"""
__all__ = ('main',)
import logging
import sys
import click
from .build import build_stack_docs
# Add -h as a help shortcut option
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings=CONTEXT_SETTINGS)
@c... | Python | 0.000016 | @@ -103,16 +103,40 @@
logging%0A
+import os%0Aimport shutil%0A
import s
@@ -2064,8 +2064,546 @@
n_code)%0A
+%0A%0A@main.command()%0A@click.pass_context%0Adef clean(ctx):%0A %22%22%22Clean Sphinx build products.%0A %22%22%22%0A logger = logging.getLogger(__name__)%0A%0A dirnames = %5B'py-api', '_build', '... |
94e0dc267e159014675556687f52157371c5a813 | order standings by position | controllers/matches.py | controllers/matches.py | import tempfile
from datetime import datetime
@auth.requires_login()
def next_match():
where_next_match = (((db.matches.visiting_team == auth.user.team_name) |
(db.matches.home_team == auth.user.team_name)) &
(db.matches.datetime > datetime.today()))
match = d... | Python | 0.000013 | @@ -809,125 +809,8 @@
)))%0A
- # (db.standings.team_id == db.teams.id) &%0A # (db.standings.division_id == db.divisions.id))%0A
@@ -1102,24 +1102,92 @@
tandings.ALL
+,%0A orderby=db.standings.pos
)%0A return
|
61cf0429a2624e934cf6e8ea20ff819bbd304a37 | Fix linter error | volt/sources.py | volt/sources.py | """Site sources."""
# (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
import abc
from contextlib import suppress
from dataclasses import dataclass
from datetime import datetime as dt
from functools import cached_property
from pathlib import Path
from typing import cast, Optional
from urllib.parse import urljo... | Python | 0.000001 | @@ -524,16 +524,58 @@
nstants%0A
+from .exceptions import VoltResourceError%0A
from .co
@@ -4440,24 +4440,143 @@
ime%22, None)%0A
+ exc = VoltResourceError(%0A f%22value %7Bvalue!r%7D in %7Bstr(self.src)!r%7D is not a valid datetime%22%0A )%0A
if v
@@ -4589,16 +4589,16 @@
s None:%0... |
07a7a24d231a6807c1512632b903bb439d46f4e8 | remove default=uuid.uuid4, which does not work | vmlog/models.py | vmlog/models.py | import uuid
from jitlog.parser import _parse_jitlog
from django.db import models
from django.contrib import admin
from vmprofile.models import RuntimeData
from vmcache.cache import get_reader
def get_profile_storage_directory(profile, filename):
return "log/%d/%s" % (profile.pk, filename)
class BinaryJitLog(m... | Python | 0.000002 | @@ -378,28 +378,8 @@
=64,
- default=uuid.uuid4,
pri
|
0abcf329620ae195e0237cc4e5574ad1da4190ec | Add comments and licence information | convert_nmea_to_csv.py | convert_nmea_to_csv.py | # coding=utf-8
import math
# helpers
# getMilliSec
# hhmmss is a string timestamp of format hhmmss or hhmmss.ss
def getMilliSec(hhmmss):
if hhmmss:
hh = int(hhmmss[0:2])
mm = int(hhmmss[2:4])
ss = int(hhmmss[4:6])
ms = float(hhmmss[7:] or 0) # allow 2 digit ms if present otherwise fallback
if ... | Python | 0 | @@ -7,16 +7,707 @@
ng=utf-8
+%0A#%0A# Author @Mario Winkler%0A#%0A# Parse and structure GPS-Data%0A# - accept NMEA-Log and generate CSV-Position-Log%0A# - calculate distance from Points%0A#%0A# Credits%0A# - initial version of the parser was heavily inspired by @Ivan Pasic --%3E http://ipasic.com/article/convert... |
c5d78235d772aaf2f65a86e0c560e3f6a3bbf2e5 | Improve identification of optional fields | reprotobuf.py | reprotobuf.py | import sys
# read apk
#import androguard.core.bytecodes.apk as apk
#a = apk.APK(sys.argv[1])
import androguard.core.bytecodes.dvm as dvm
from androguard.core.analysis.analysis import *
import executor
# XXX must be library for this
def convert_upper_camel_case_to_lower_camel_case(s):
"""
ExpDateRecognizedB... | Python | 0 | @@ -238,117 +238,64 @@
def
-convert_upper_camel_case_to_lower_camel_case(s):%0A %22%22%22%0A ExpDateRecognizedByOcr -%3E expDateRecognizedByOcr
+has_field_name(s):%0A %22%22%22%0A fieldName -%3E hasFieldName
%0A
@@ -313,18 +313,26 @@
turn
+ 'has' +
s%5B:1%5D.
-low
+upp
er()
@@ -939,32 +939,63 @@
... |
d08fb4c80656937165868ed484c761ed0f88f0f8 | Fix formatting | sqltxt/joins.py | sqltxt/joins.py | from column import Column, ColumnName, merge_columns
from table import Table
import logging
LOG = logging.getLogger(__name__)
def join_tables(left_table, right_table, join_type, join_conditions):
"""Return a Table representing the join of the left and right Tables of this Query."""
LOG.debug('Performing join... | Python | 0.057169 | @@ -1968,17 +1968,17 @@
t of
+%0A
join
-%0A
con
|
097aa0bc21f8eea28edff148fb36146bbced92c4 | Exclude duecredit from the documentation. | doc/tools/buildmodref.py | doc/tools/buildmodref.py | #!/usr/bin/env python
"""Script to auto-generate API docs.
"""
from __future__ import print_function, division
# stdlib imports
import sys
import re
# local imports
from apigen import ApiDocWriter
# version comparison
from distutils.version import LooseVersion as V
#*************************************************... | Python | 0 | @@ -1538,24 +1538,77 @@
credit.*$',%0A
+ r'.*due.*$',%0A
|
be29e195bbdfd9acad4841d0e241554e735baf3a | add -dev suffix to version for code in master | voc/__init__.py | voc/__init__.py | # Examples of valid version strings
# __version__ = '1.2.3.dev1' # Development release 1
# __version__ = '1.2.3a1' # Alpha Release 1
# __version__ = '1.2.3b1' # Beta Release 1
# __version__ = '1.2.3rc1' # RC Release 1
# __version__ = '1.2.3' # Final Release
# __version__ = '1.2.3.post1' # Post Release... | Python | 0 | @@ -337,10 +337,14 @@
= '0.1.2
+-dev
'%0A
|
39f327bb9e37d6d290eb3f3179f7e79d60b5ab6d | Switch from ORM to Core | model.py | model.py | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
engine = create_engine('postgresql://wn:wn@localhost:5432/wndb')
Base = declarative_base()
from sqlalchemy import Column, Integer, Float, DateTime, Boolean, String
class Observation(Base):
__tablename__ = 'obs'
id =... | Python | 0 | @@ -1,60 +1,4 @@
-from sqlalchemy.ext.declarative import declarative_base%0A
from
@@ -101,35 +101,8 @@
')%0A%0A
-Base = declarative_base()%0A%0A
from
@@ -173,69 +173,72 @@
ring
-%0Aclass Observation(Base):%0A __tablename__ = 'obs'%0A%0A id =
+, MetaData%0A%0Ametadata = MetaData()%0Atable = Table('obs', metada... |
0fd5d89b9ebcd25d4be3b023020b0816bf5e6cab | boolean ... could happen | vumi/session.py | vumi/session.py | # TODO definitly need a session object
# with hist & expiry & to_str & to_json etc
import yaml
import json
from vumi.errors import VumiError
class VumiSession():
key = None
decision_tree = None
def __init__(self, **kwargs):
pass
def set_decision_tree(self, decision_tree):
self.decisi... | Python | 0.998838 | @@ -1415,16 +1415,75 @@
options%0A
+ boolean -%3E as for list, just yes/no questions only%0A
|
5909736a5c27f3daf3b63211dabc77bbc6865fc1 | feature($index):Add error message for empty username or password Add an error message stating that "Invalid credentials. Please try again." when the username or password is empty | wKRApp/views.py | wKRApp/views.py | from wKRApp import app
from flask import Flask, render_template, url_for, request, redirect, session, flash, g
from ipdb import set_trace
from functools import wraps
import sqlite3
import os.path
# 2 security flaws, need to sort out
# 1. the key should be randomy generated
# 2. the key should be set in a ... | Python | 0.999999 | @@ -1021,24 +1021,164 @@
r('admin'))%0A
+ elif request.form%5B'username'%5D == '' or request.form%5B'password'%5D == '':%0A error = 'Invalid credentials. Please try again.'%0A
else
|
3ccb2f688a568ff2193bf1f1e19cecc112c2054f | add losetup context manager | mount.py | mount.py | import os
import subprocess
import tempfile
class mount(object):
""" Context manager mounting and un-mounting a filesystem on a temporary directory.
>>> with mount("/dev/sdc1") as directory:
... print os.listdir(directory)
"""
def __init__(self, source, command="mount", *args):
... | Python | 0.000001 | @@ -977,16 +977,1089 @@
elf._directory)%0A
+%0Aclass losetup(object):%0A %22%22%22 Context manager mounting an un-mounting an image on a loop device. The size and%0A offset of the partition in the image are automatically computed using parted.%0A %22%22%22%0A%0A def __init__(self, image):%0A sel... |
bfb79a34a441bea3d5204a35a23c53d141496f90 | Put the summary after the reports so it won't scroll off | weakest_link.py | weakest_link.py | # Broken link finder/fixer
# 1. Starting with a given page, scan for all references
# <* href="..."> mainly <a> but also <link>
# <* src="..."> eg img, script, style
# <* background="..."> for inline background image styles?
# 2. If ref is external (http:// or https:// and not gsarchive.net), record
# the d... | Python | 0.002013 | @@ -5389,77 +5389,8 @@
n)%0A%0A
-print(len(unscanned), %22out of%22, unscanned_count, %22still unscanned%22)%0A%0A
# An
@@ -5479,12 +5479,81 @@
%22, %22/%22, fn)%0A
+%0Aprint(len(unscanned), %22out of%22, unscanned_count, %22still unscanned%22)%0A
|
a5b89ed7aa9e2fe4305f6431a3bdd675a7eda03f | Fix newline at the end of file. | web/__init__.py | web/__init__.py | # -*- coding: utf-8 -*-
from os import path
from flask import Flask
PACKAGE_DIR = path.dirname(path.realpath(__file__))
ROOT_DIR = path.realpath(path.join(PACKAGE_DIR, '..'))
ROOT_URL = 'http://pythoncz.herokuapp.com'
GITHUB_URL = (
'https://github.com/honzajavorek/python.cz/'
'blob/master/{template_fold... | Python | 0 | @@ -561,8 +561,9 @@
# NOQA
+%0A
|
76c09dfe2e151a59d5017b661a6f751245c35270 | Update version info | web/__init__.py | web/__init__.py | import os
from flask import Flask
__version__ = '0.1.1'
def create_app(name=__name__):
app = Flask(name)
from web.main import main_module
app.register_blueprint(main_module, url_prefix='/')
return app
app = create_app()
if __name__ == '__main__':
host = os.environ.get('HOST', '0.0.0.0')
... | Python | 0 | @@ -49,17 +49,17 @@
= '0.1.
-1
+2
'%0A%0A%0Adef
|
c4f7cc009e94f50562a985d0bc377cd696580c15 | fix output utf8 | web/imdb_cli.py | web/imdb_cli.py | #!/usr/bin/python
# Search a title on IMDb and display a nice line.
import imdb
import sys
def main(argv):
if len(argv) < 2:
print 'Usage: %s <search query>' % argv[0]
raise SystemExit(0)
result = imdb.SearchTitle(' '.join(argv[1:]))
if not result:
print 'Not found.'
rais... | Python | 0.99965 | @@ -800,16 +800,43 @@
'.join(
+i.encode('utf-8') for i in
infos)%0A%0A
|
6598b684892c061e1e17174e1435b5770d3f2933 | use CmsRepoException instead of KeyError | cms/__init__.py | cms/__init__.py | from cms.utils import CmsRepo
from pyramid_beaker import set_cache_regions_from_settings
from pyramid.config import Configurator
import logging
log = logging.getLogger(__name__)
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
set_cache_regions_from_settings... | Python | 0 | @@ -22,16 +22,34 @@
CmsRepo
+, CmsRepoException
%0A%0Afrom p
@@ -1249,24 +1249,32 @@
except
-KeyError
+CmsRepoException
:%0A
|
96944160a4d1a24c1459a0744215f6b68c124c3d | hold(False) | code/display.py | code/display.py | import numpy as np
import matplotlib.pyplot as plt
import os
import dnest4.classic as dn4
data = dn4.my_loadtxt("data.txt")
posterior_sample = dn4.my_loadtxt("posterior_sample.txt")
print("WARNING! This will delete\
movie.mkv and the Frames/ directory, if these exist.")
ch = input("Continue? y/n: ")
if ch != "y" and... | Python | 0.999983 | @@ -528,16 +528,36 @@
, 1, 1)%0A
+ plt.hold(False)%0A
plt.
|
70adbbb8b575adef43ef7907e21c1e13616fd73c | Update LogisticRegr.py | ml/GLM/LogisticRegr.py | ml/GLM/LogisticRegr.py | from math import log,e
from ..numc import *
from .lr import LR
class LogisticRegression():
def fit(self,X,Y):
LR.fit(self,X,Y)
#self.ran=0
return self
def hypo(self,it):
res=1/(1+e**(-LR.hyp(self,it)))
return res
def cost(self):
s=0
for _ in range(self.m):
s+=self.target[_]*log(self.hypo(_))+(1-se... | Python | 0 | @@ -127,22 +127,8 @@
,Y)%0A
-%09%09#self.ran=0%0A
%09%09re
@@ -696,129 +696,20 @@
)%0A%09%09
-#if not self.ran:self.gd()%0A%09%09#else:LogisticRegression.ran+=1%0A%09%09x=np.array(x)%0A%09%09#return self._labify(x.dot(self.theta%5B1:%5D)
+x=np.array(x
)%0A%09%09
|
a1d792af4c29ca0a612aa42f7f5b65d8b4ef56de | Correct checksum's sha256 when retrieve from remote (#25831) | lib/spack/spack/cmd/checksum.py | lib/spack/spack/cmd/checksum.py | # Copyright 2013-2021 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 __future__ import print_function
import argparse
import llnl.util.tty as tty
import spack.cmd
import spack.cmd.com... | Python | 0 | @@ -2258,16 +2258,375 @@
name))%0A%0A
+ # And ensure the specified version URLs take precedence, if available%0A try:%0A explicit_dict = %7B%7D%0A for v in pkg.versions:%0A if not v.isdevelop():%0A explicit_dict%5Bv%5D = pkg.url_for_version(v)%0A ... |
2243de9e2f6e81aaccdeef8d4ccfebd5caa2be04 | Make quiet mode default for spack spconfig | lib/spack/spack/cmd/spconfig.py | lib/spack/spack/cmd/spconfig.py | ##############################################################################
# Copyright (c) 2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Elizabeth Fischer
# LLNL-CODE-647188
#
# For details, see https://github.... | Python | 0.000001 | @@ -1665,20 +1665,22 @@
'-
-q
+v
', '--
-quiet
+verbose
', a
@@ -1705,21 +1705,23 @@
, dest='
-quiet
+verbose
',%0A
@@ -1734,15 +1734,8 @@
p=%22D
-o not d
ispl
@@ -3659,22 +3659,20 @@
ose=
-not
args.
-quiet
+verbose
,%0A
|
c2ee17b335d686b44d6cd05adadc17b69797993b | fix bugs | web/web/urls.py | web/web/urls.py | """web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | Python | 0.000001 | @@ -1352,35 +1352,36 @@
r' %7D,%0A ),%0A%5D%0A%0A
-ins
+stud
= %5B%0A url(r'%5E
|
a321d58730d491417dc08c7b8370149d07b460eb | Update count python script for 2.10 | count-zap-downloads.py | count-zap-downloads.py | #!/usr/bin/env python
# This script generates the dynamic data for http://zapbot.github.io/zap-mgmt-scripts/downloads.html
import glob,json,os,sys
# The file names
REL = 'v2.9.0'
CORE = 'ZAP_2.9.0_Core.zip'
CROSS = 'ZAP_2.9.0_Crossplatform.zip'
LINUX = 'ZAP_2.9.0_Linux.tar.gz'
UNIX = 'ZAP_2_9_0_unix.sh'
MAC = 'ZAP_2.... | Python | 0 | @@ -169,17 +169,18 @@
L = 'v2.
-9
+10
.0'%0ACORE
@@ -185,25 +185,26 @@
RE = 'ZAP_2.
-9
+10
.0_Core.zip'
@@ -219,17 +219,18 @@
'ZAP_2.
-9
+10
.0_Cross
@@ -258,17 +258,18 @@
'ZAP_2.
-9
+10
.0_Linux
@@ -291,17 +291,18 @@
'ZAP_2_
-9
+10
_0_unix.
@@ -318,17 +318,18 @@
'ZAP_2.
-9
+10
.0.dmg'%0A
@@ -335,33 +33... |
0cac1890a4e23cfe421a2d8ded083aae6f147942 | fix typo | modules/irwin/Train.py | modules/irwin/Train.py | import threading
import datetime
import time
from modules.irwin.updatePlayerEngineStatus import updatePlayerEngineStatus
from modules.irwin.TrainingStats import TrainingStats, Accuracy, Sample
from modules.irwin.writeCSV import writeClassifiedMovesCSV, writeClassifiedMoveChunksCSV
class Train(threading.Thread):
def... | Python | 0.999991 | @@ -897,17 +897,16 @@
.classif
-i
yMoveChu
|
39f1f2c162ebbe0ea9157876220a41ef2cdd85ac | change order of operator | lib/svtplay_dl/service/dplay.py | lib/svtplay_dl/service/dplay.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import re
import os
import hashlib
import random
from urllib.parse import urlparse
from svtplay_dl.service import Service
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.error imp... | Python | 0.000009 | @@ -6060,18 +6060,18 @@
and
-not
%22Free%22
+ not
in
|
6da921fbbacf65e271cc68b5db11a694e24ff1ba | make redditpost loop numbers bigger | modules/redditposts.py | modules/redditposts.py | import discord
import requests
import asyncio
from modules.botModule import BotModule
class RedditPost(BotModule):
name = 'RedditPost' # name of your module
description = 'RedditPost automatically posts recent posts from r/scuba' # description of its function
help_text = 'This module has no callable f... | Python | 0.000043 | @@ -1478,24 +1478,31 @@
count %3C 100
+0000000
:%0A
@@ -1774,16 +1774,23 @@
nt %3E 100
+0000000
:%0A
|
d5deb7149c633fffe34f2a264bdba01e4d920942 | 添加 poll 函数 | webqq/client.py | webqq/client.py | class WebQQClient(object):
def login(self, username=None, password=None):
return True
def logout(self):
pass
def heartbeat(self):
print 'Bom..bong!'
def run_forever(self):
i=0
while True:
i=i+1
if i>100:
... | Python | 0.000001 | @@ -189,24 +189,70 @@
..bong!'%0D%0A%0D%0A
+ def poll(self):%0D%0A return 'poll'%0D%0A%0D%0A
def run_
|
ddc1d6b3d971d86434a23c14f64902147c91ace5 | use remuxed audio for spectrogram extraction | create_hdf5_dataset.py | create_hdf5_dataset.py | import sys
import os
import glob
import random
import re
import numpy as np
import librosa
import h5py
SOURCE_PATH = "/home/sedielem/data/urbansound8k/audio_normalized"
TARGET_PATH = "/home/sedielem/data/urbansound8k/spectrograms.h5"
SIZE = 8732
N_FOLDS = 10
SAMPLERATE = 22050
N_FFT = 2048
HOP_LENGTH = 512
N_MELS ... | Python | 0 | @@ -158,16 +158,13 @@
dio_
-normaliz
+remux
ed%22%0A
|
54e0c6cb69f0d1cd659d4ed6f0ce3592daaf73c5 | raise error if status code not 200 in timegetter | modules/time_getter.py | modules/time_getter.py | import json
import yaml
import requests
from datetime import datetime
def light_on(yml_path="../config.yml"):
with open(yml_path) as f:
config = yaml.load(f)
r = requests.get(
"http://api.sunrise-sunset.org/json?lat={}&lng={}&date=today".format(
config['longitude'], config['latitud... | Python | 0.000017 | @@ -886,16 +886,134 @@
e, True%0A
+ else:%0A raise requests.HTTPError('Could not connect to server, HTTP status code: %7B%7D'.format(r.status_code))%0A
%0A%0Aif __n
|
78f8e5eb03f1a170c9ca1d9115597a6d41aca5be | add CSTRF token | amnesia/modules/content/views/crud.py | amnesia/modules/content/views/crud.py | # -*- coding: utf-8 -*-
# pylint: disable=E1101
import logging
from marshmallow import ValidationError
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.httpexceptions import HTTPNotFound
from pyramid.view import view_defaults
from pyramid.view import view_config
from pyramid.renderers import render_to... | Python | 0 | @@ -1381,49 +1381,8 @@
ue%0A%0A
- if 'csrf_token' not in data:%0A
|
8a2eee517b192cba7602ead9b1c66b818e7a5d7c | Split using `shlex.split()` to preserve quotes | shakedown/dcos/command.py | shakedown/dcos/command.py | import select
import subprocess
from shakedown.dcos.helpers import *
import shakedown
def run_command(
host,
command,
username='core',
key_path=None
):
""" Run a command via SSH, proxied through the mesos master
:param host: host or IP of the machine to execute the comma... | Python | 0 | @@ -7,16 +7,29 @@
select%0A
+import shlex%0A
import s
@@ -2292,22 +2292,27 @@
l =
+shlex.split(
command
-.split(
)%0A
|
4af620c9687c543255d3620d79d8f53b80bddac7 | Add configuration handling for mpg123 backend | mycroft/skills/playback_control/__init__.py | mycroft/skills/playback_control/__init__.py | import sys
from os.path import dirname, abspath, basename
from mycroft.skills.media import MediaSkill
from adapt.intent import IntentBuilder
from mycroft.messagebus.message import Message
from mycroft.configuration import ConfigurationManager
import subprocess
import time
import requests
from os.path import dirname... | Python | 0 | @@ -806,16 +806,45 @@
itter):%0A
+ self.config = config%0A
@@ -855,32 +855,32 @@
.process = None%0A
-
self.emi
@@ -952,20 +952,113 @@
._play)%0A
+%0A
+@property%0A def name(self):%0A return self.config.get('audio.mpg123.name', 'mpg123')%0A
%0A def
|
fdd48bae13e9185f9d0fbc55228062722fd6bb01 | Check for string 'None' as it is sometimes passed in the URL, very ugly | weight/views.py | weight/views.py | # This file is part of Workout Manager.
#
# Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Workout Manage... | Python | 0.000017 | @@ -1487,16 +1487,33 @@
if id
+ and id != 'None'
:%0A
|
882f9e24c99c033a1acb6660161ba7d7623230ed | reuse NUMBER_OF_ZONES_PER_HEMISPHERE constant | osmaxx/geodesy/coordinate_reference_system.py | osmaxx/geodesy/coordinate_reference_system.py | from django.contrib.gis.geos.collections import MultiPolygon
from django.contrib.gis.geos.polygon import Polygon
from osmaxx.conversion_api.coordinate_reference_systems import WGS_84
class UniversalTransverseMercatorZone:
HEMISPHERE_PREFIXES = dict(
north=326,
south=327,
)
NUMBER_OF_ZONES... | Python | 0.9988 | @@ -368,18 +368,46 @@
ange(1,
-60
+NUMBER_OF_ZONES_PER_HEMISPHERE
+ 1)%0A
|
27ae8584c57dd8b6647fb2401b8e4f12c1eab860 | Fix iframe attribute order. | app/datasources/twitterdisplay.py | app/datasources/twitterdisplay.py | import datetime
import itertools
import re
import xml.sax.saxutils
from base.constants import CONSTANTS
import base.util
from datasources import thumbnails, twitter
_BASE_TWITTER_URL = 'https://twitter.com'
_LINK_ATTRIBUTES = 'style="color:%s"' % CONSTANTS.ANCHOR_COLOR
_WHITESPACE_RE = re.compile('\\s+')
# Twitter e... | Python | 0 | @@ -3598,16 +3598,18 @@
rder=%220%22
+%25s
allowfu
@@ -3616,19 +3616,16 @@
llscreen
- %25s
%3E%3C/ifram
|
d505f346eb1efc01b1f75ea91c2e52616430645f | tweak route being tested | make_mozilla/users/tests/test_views.py | make_mozilla/users/tests/test_views.py | from django.conf import settings
from django.utils import unittest
from mock import patch, Mock
from nose.tools import eq_, ok_
from make_mozilla.base.tests.assertions import assert_routing
from make_mozilla.users import views
rf = RequestFactory()
class LoginJumpPageTest(unittest.TestCase):
def test_that_it_ro... | Python | 0 | @@ -227,31 +227,8 @@
ws%0A%0A
-rf = RequestFactory()%0A%0A
clas
@@ -338,16 +338,17 @@
rs/login
+/
', views
|
5f716da231aa3f338300295695b1513aa404ae7d | Use http instead of https | lino_xl/lib/appypod/__init__.py | lino_xl/lib/appypod/__init__.py | # Copyright 2014-2019 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
Adds functionality for generating printable documents using
LibreOffice and the `appy.pod <http://appyframework.org/pod.html>`__
package.
See also :ref:`lino.admin.appypod` and :doc:`/specs/appypod`.
"""
import six
from lino.api i... | Python | 0.000001 | @@ -678,33 +678,32 @@
yield %22svn+http
-s
://svn.forge.pal
|
36dfada15b08d927fab7bf88af1d71b29dabb99f | neccessary return statements | wikimap/data.py | wikimap/data.py | import itertools
import json
from xlrd import open_workbook
import networkx as nx
from wikipediabase.util import get_meta_infobox
# READING
# add caching decorator
def read_json(path):
"""Given path to a json file, return json as python dict"""
with open(path, 'rb') as fp:
return json.load(fp)
def ... | Python | 0.998347 | @@ -1713,24 +1713,31 @@
ings%22%22%22%0A
+return
_get_all_map
@@ -1755,32 +1755,32 @@
nfoboxes(path))%0A
-
%0A%0Adef _get_all_m
@@ -2076,16 +2076,23 @@
%22%22%22%0A
+return
_get_inf
@@ -2396,24 +2396,31 @@
oxes%22%22%22%0A
+return
_total_infob
@@ -2732,20 +2732,27 @@
ages%22%22%22%0A
-
+re... |
6f6bf45582ad06977e890d295b85290b1d169a01 | update doc | chainercv/transforms/image/pca_lighting.py | chainercv/transforms/image/pca_lighting.py | import numpy
def pca_lighting(img, sigma, eigen_value=None, eigen_vector=None):
"""Alter the intensities of input image using PCA.
This is used in training of AlexNet [1].
.. [1] Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. \
ImageNet Classification with Deep Convolutional Neural Networks. \... | Python | 0 | @@ -88,52 +88,191 @@
%22%22Al
-ter the intensities of input image using PCA
+exNet style color augmentation%0A%0A This method adds a noise vector drawn from a Gaussian. The direction of%0A the Gaussian is same as that of the principal components of the dataset
.%0A%0A
@@ -279,16 +279,23 @@
This
+method
... |
da5e500bbb135496acd793674752f3f2d3252a3b | Remove HTTPHandler, not useful | mpd_muspy/muspy_api.py | mpd_muspy/muspy_api.py | #!/usr/bin/python
# Author: Anthony Ruhier
import json
import musicbrainzngs
import urllib.error
import urllib.request
from config import MUSPY_USERNAME, MUSPY_PASSWORD, MUSPY_ID
from . import _release_name, _version
class ArtistNotFoundException(Exception):
pass
def get_mbid(artist):
"""
Get the music... | Python | 0.000007 | @@ -1637,60 +1637,8 @@
)%0A
- http_handler = urllib.request.HTTPHandler()%0A
@@ -1691,51 +1691,12 @@
ner(
-%0A auth_handler,%0A http
+auth
_han
|
c860accc5fd60f3105da44052164d66e9c43867c | make TemplateNotFound thrown if template not found | anytemplate/engines/stringTemplate.py | anytemplate/engines/stringTemplate.py | #
# Author: Satoru SATOH <ssato redhat.com>
# License: BSD3
#
"""
Template engine based on string.Template which in standard library.
"""
from __future__ import absolute_import
import logging
import string
import anytemplate.engines.base
import anytemplate.compat
LOGGER = logging.getLogger(__name__)
class Engine(a... | Python | 0.000001 | @@ -2481,37 +2481,91 @@
-with anytemplate.compat.cop
+read_content = anytemplate.engines.base.fallback_render%0A tmpl = read_cont
en
+t
(tem
@@ -2571,16 +2571,66 @@
mplate,
+at_paths=at_paths,%0A at_
encoding
@@ -2646,22 +2646,9 @@
ing)
- as tmpl:%0A
+%0A
@@ -2684... |
de7175f31efd286773747fed70b60988e3effdbd | correct import from energy_demand | energy_demand/technological_stock.py | energy_demand/technological_stock.py | """The technological stock for every simulation year"""
import technological_stock_functions as tf
import energy_demand.main_functions as mf
class ResidTechStock(object):
"""Class of a technological stock of a year of the residential model
The main class of the residential model. For every region,
a Regio... | Python | 0.000009 | @@ -56,16 +56,30 @@
%0Aimport
+energy_demand.
technolo
@@ -1807,17 +1807,16 @@
iciency,
-
%0A
@@ -1870,17 +1870,16 @@
ed based
-
%0A
|
b8fef45611c41ccc059c47b56030f3e384243f40 | Change word2vec settings | code/python/knub/thesis/word2vec.py | code/python/knub/thesis/word2vec.py | import argparse
import codecs
import logging
import os
from gensim.models import Word2Vec
from gensim.models.phrases import Phrases
from gensim.models.word2vec import LineSentence
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
def bigrams():
logging.info("Training bi... | Python | 0.000001 | @@ -2227,17 +2227,17 @@
1, iter=
-2
+4
0)%0A m
@@ -2361,24 +2361,334 @@
word2vec%22)%0A
+%0A if %22nips%22 in args.sentences:%0A for word in %5B%22paper%22, %22cortex%22, %22brain%22, %22learning%22, %22posterior%22, %22neural%22, %22section%22, %22optimization%22%5D:%0A try:%0A ... |
73ba3c3a53db6450784cfe05286fcb733b42af4e | Update step.py | mapclientplugins/trcsourcestep/step.py | mapclientplugins/trcsourcestep/step.py |
import os.path
import json
import os.path
from PySide2 import QtGui
from mapclient.mountpoints.workflowstep import WorkflowStepMountPoint
from mapclientplugins.trcsourcestep.configuredialog import ConfigureDialog
from mapclientplugins.trcsourcestep.trcdata import TRCData
class TRCSourceStep(WorkflowStepMountPoint)... | Python | 0.000001 | @@ -3877,33 +3877,16 @@
eDialog(
-self._main_window
)%0A
|
b49f733d675d537779bed931d0a079888a83a735 | Revert "Bump dev version to 0.3.0-dev.1" | mpfmonitor/_version.py | mpfmonitor/_version.py | # mpf-monitor
__version__ = '0.3.0-dev.1'
__short_version__ = '0.3'
__bcp_version__ = '1.1'
__config_version__ = '4'
__mpf_version_required__ = '0.33.0'
version = "MPF Monitor v{} (config_version={}, BCP v{}, Requires MPF v{})".format(
__version__, __config_version__, __bcp_version__, __mpf_version_required__)
| Python | 0 | @@ -28,17 +28,17 @@
'0.
-3
+2
.0-dev.
-1
+3
'%0A__
@@ -58,17 +58,17 @@
__ = '0.
-3
+2
'%0A__bcp_
@@ -144,16 +144,22 @@
'0.33.0
+.dev15
'%0A%0Aversi
|
3e7375d6ad94509afacc4acb7bce4470494b17c0 | Add default maximum features | worlds/world.py | worlds/world.py | '''
Created on Jan 11, 2012
@author: brandon_rohrer
The only methods that a world is required to implement are:
step() -advances the world by one time step
final_performance() -returns a performance value for the
agent in the world once the termination condition for the
worl... | Python | 0 | @@ -858,24 +858,58 @@
%0A '''%0D%0A%0D%0A
+ MAX_NUM_FEATURES = 700%0D%0A %0D%0A
def __in
|
1ec4cd2437d6ae8b7d5ea4fe2bbc5f7088978654 | Fix the path to some flackiness dashboard scripts. | webkit/tools/layout_tests/webkitpy/layout_tests/test_output_xml_to_json.py | webkit/tools/layout_tests/webkitpy/layout_tests/test_output_xml_to_json.py | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""
This is a script for generating JSON from JUnit XML output (generated by
google tests with --gtest_output=xml option).
"""
impo... | Python | 0.999999 | @@ -546,24 +546,22 @@
ools%22)%5D%0A
-webkitpy
+script
_dir = o
@@ -644,18 +644,16 @@
-
'Scripts
@@ -657,20 +657,36 @@
pts'
-, 'webkitpy'
+)%0Asys.path.append(script_dir
)%0Asy
@@ -708,32 +708,45 @@
s.path.join(
+script_dir, '
webkitpy
_dir, 'third
@@ -733,20 +733,17 @@
webkitpy
-_dir
+'
, 'third
... |
5220df4a5dc7c1e0934402ec8fafad53f64ed4b9 | reorganize question matching code | mptracker/questions.py | mptracker/questions.py | import csv
import logging
import subprocess
import flask
from flask.ext.script import Manager
from flask.ext.rq import job
from path import path
from mptracker import models
from mptracker.common import temp_dir
from mptracker.scraper.common import get_cached_session
from mptracker.nlp import match_names, get_placename... | Python | 0.999195 | @@ -3483,28 +3483,24 @@
f match_
-and_describe
+question
(questio
@@ -3590,25 +3590,16 @@
info = %7B
-%0A
'name':
@@ -3618,22 +3618,16 @@
son.name
-,%0A
%7D%0A ma
@@ -3823,17 +3823,16 @@
e)%5B:10%5D%0A
-%0A
retu
@@ -3839,47 +3839,8 @@
rn %7B
-%0A 'question': question,%0A
'to... |
6d1903d4acc6b0dcc7fb62a51cc4b3deab3b27d7 | support optional [server] processes = N for multi-process cubes server | cubes/server/slicer.py | cubes/server/slicer.py | # -*- coding=utf -*-
# Package imports
import json
import cubes
import logging
import ConfigParser
# Werkzeug - soft dependency
try:
from werkzeug.routing import Map, Rule
from werkzeug.wrappers import Request, Response
from werkzeug.wsgi import ClosingIterator
from werkzeug.exceptions import HTTPExcep... | Python | 0.000001 | @@ -8562,16 +8562,155 @@
False%0A%0A
+ if config.has_option('server', 'processes'):%0A processes = config.getint('server', 'processes')%0A else:%0A processes = 1%0A%0A
appl
@@ -8790,16 +8790,37 @@
ication,
+ processes=processes,
use_rel
|
e353ec6950edc4137cd8fa937e40cb0f6c76ca86 | Add support for lists to assert_equal_ignore | cybox/test/__init__.py | cybox/test/__init__.py | import json
def assert_equal_ignore(item1, item2, ignore_keys=None):
"""Recursively compare two dictionaries, ignoring differences in some keys.
"""
if not ignore_keys:
ignore_keys = []
if not (isinstance(item1, dict) and isinstance(item2, dict)):
assert item1 == item2, "%s != %s" % (... | Python | 0.000001 | @@ -213,13 +213,8 @@
if
-not (
isin
@@ -264,78 +264,8 @@
ict)
-):%0A assert item1 == item2, %22%25s != %25s%22 %25 (item1, item2)%0A else
:%0A
@@ -648,16 +648,313 @@
e_keys)%0A
+ elif isinstance(item1, list) and isinstance(item2, list):%0A assert len(item1) == len(item2), %22Lists are of di... |
0c29ee8be7ba2ccb9dd16c98065b56f1c6e4c92e | fix lint | dash/testing/plugin.py | dash/testing/plugin.py | # pylint: disable=missing-docstring
import pytest
from selenium import webdriver
from dash.testing.application_runners import ThreadedRunner, ProcessRunner
from dash.testing.browser import Browser
from dash.testing.composite import DashComposite
WEBDRIVERS = {
"Chrome": webdriver.Chrome,
"Firefox": webdriver... | Python | 0 | @@ -28,16 +28,37 @@
ocstring
+,redefined-outer-name
%0Aimport
|
b8c82af3b98e30ca9447d610a6a6b5859c1c90de | Bump version to 0.21.11 | mythril/__version__.py | mythril/__version__.py | """This file contains the current Mythril version.
This file is suitable for sourcing inside POSIX shell, e.g. bash as well
as for importing into Python.
"""
__version__ = "v0.21.10"
| Python | 0 | @@ -175,11 +175,11 @@
%22v0.21.1
-0
+1
%22%0A
|
131b051b3ae2b5e403b1691ba7344bf1b9eae99f | test commit | src/bst.py | src/bst.py | """Implementation of Binary Search Tree."""
class Node(object):
"""Class representation of bst node."""
def __init__(self, contents, left_child=None, right_child=None):
"""Instantiate linked list node."""
self.contents = contents
self.left_child = left_child
self.right_child =... | Python | 0.000001 | @@ -1559,17 +1559,16 @@
_size%0A%0A%0A
-%0A
def
|
e5c5306fb368c428ddb9f068fdbae642b2c4741d | Clean up: Extending list of iRODS collections in client. | testIRODS.py | testIRODS.py | """
Usage:
1) Cleaning testdata and folders
python testIRODS.py -c
2) Testing the connection to the iRODS server via port 1247 and all data ports
Uses by default the iRODS defaultResc as destination resource
python testIRODS.py -o [-r <irods resource>]
3) Performn... | Python | 0 | @@ -3352,16 +3352,17 @@
+#
cleanUp(
)%0A
@@ -3357,16 +3357,278 @@
cleanUp(
+collections = %5B%22CONNECTIVITY0%22, %22PERFORMANCE0%22%5D,%0A #folders = %5Bos.environ%5B%22HOME%22%5D+%22/testdata%22, os.environ%5B%22HOME%22%5D+%22/getdata%22%5D)%0A colls = %5B%22PERFORMANCE%22+str(i) for i in ran... |
6bd4fa5a52313c18da5f5ec7f63b8f2712c515ec | Update imports in cli to be less heavy | src/ocspdash/cli.py | src/ocspdash/cli.py | # -*- coding: utf-8 -*-
"""The CLI module for OCSPdash."""
import base64
import datetime
import json
import logging
import os
import secrets
import urllib.parse
from collections import OrderedDict
import click
import nacl.encoding
import nacl.signing
from requests import Response
from ocspdash.manager import Manage... | Python | 0 | @@ -472,56 +472,8 @@
ion%0A
-from ocspdash.web.app import create_application%0A
%0A%0A@c
@@ -3191,16 +3191,70 @@
O))%0A%0A
+ from ocspdash.web import create_application%0A app =
create_
@@ -3266,16 +3266,24 @@
cation()
+%0A app
.run(hos
|
79e067188ec0fe7f6cccb7069ca2d2ba21199ad8 | Fix for ocr import | misp_modules/modules/import_mod/ocr.py | misp_modules/modules/import_mod/ocr.py | import sys
import json
import base64
from io import BytesIO
import logging
log = logging.getLogger('ocr')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
log.a... | Python | 0 | @@ -2272,24 +2272,49 @@
image =
-document
+base64.b64decode(request%5B%22data%22%5D)
%0A%0A im
|
7f28eb7a677a76756f90ac6579627514216eb214 | fix CompletedTasks | skitai/wastuff/futures.py | skitai/wastuff/futures.py | import sys
from ..utility import make_pushables
from ..exceptions import HTTPError
from ..rpc.cluster_dist_call import DEFAULT_TIMEOUT
from skitai import was
from ..corequest import corequest
class TaskBase (corequest):
def __init__ (self, reqs, timeout = DEFAULT_TIMEOUT, cache_timeout = 0, cache_if = (200,)):
... | Python | 0.000001 | @@ -2000,18 +2000,141 @@
elf, rss
+, timeout = 10, cache_timeout = 0, cache_if = (200,)):%0A TaskBase.__init__ (self, %5B%5D, timeout, cache_timeout, cache_if
)
-:
%0A
@@ -3381,16 +3381,65 @@
elf.ress
+, self.timeout, self.cache_timeout, self.cache_if
)%0A
|
07726b187b6dc6a6c49a3ea701cd1f1be11cb6d0 | Use mocks to test the decorators. | test_knot.py | test_knot.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from knot import Container, factory, service, provider
class TestContainer(unittest.TestCase):
def test_returns_return_value_provider(self):
c = Container()
def foo(container):
return 'bar'
c.add_provider(foo, Fal... | Python | 0 | @@ -56,16 +56,43 @@
nittest%0A
+from mock import MagicMock%0A
from kno
@@ -1393,32 +1393,68 @@
c = Container()
+%0A c.add_factory = MagicMock()
%0A%0A @facto
@@ -1525,48 +1525,55 @@
-self.assertEqual(c.provide('foo'), 'bar'
+c.add_factory.assert_called_once_with(foo, None
)%0A%0A
@@ -1639,32 ... |
276f7904d552d9575babaca4ae5bcfde620a6f5b | fix suggested in #234 | module/plugins/hoster/MegasharesCom.py | module/plugins/hoster/MegasharesCom.py | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in ... | Python | 0 | @@ -977,17 +977,17 @@
_ = %220.2
-2
+3
%22%0A __
@@ -2996,16 +2996,20 @@
%22http://
+d01.
megashar
@@ -5040,8 +5040,9 @@
aresCom)
+%0A
|
a36d128a1af653760a7ea20f803e3f39d4e514e5 | Use the new optional argument to endRequest in the middleware | app/soc/middleware/value_store.py | app/soc/middleware/value_store.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange 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... | Python | 0 | @@ -1067,27 +1067,37 @@
elf, request
+, optional
):%0A
-
%22%22%22Empti
@@ -1228,32 +1228,42 @@
dRequest(request
+, optional
)%0A%0A def process
@@ -1665,16 +1665,22 @@
(request
+, True
)%0A re
@@ -1891,32 +1891,32 @@
ature.%0A %22%22%22%0A%0A
-
self.end(req
@@ -1911,18 +1911,25 @@
self.end(req... |
60a4010e25404e0211e938a2a2109e9244273d78 | fix for filer_gui_file_thumb templatetag | filer_addons/filer_gui/templatetags/filer_gui_tags.py | filer_addons/filer_gui/templatetags/filer_gui_tags.py | from django import template
from easy_thumbnails.exceptions import InvalidImageFormatError
from easy_thumbnails.files import get_thumbnailer
# support very big images
# https://stackoverflow.com/questions/51152059/pillow-in-python-wont-let-me-open-image-exceeds-limit
import PIL.Image
PIL.Image.MAX_IMAGE_PIXELS = 933120... | Python | 0.000001 | @@ -644,16 +644,111 @@
B_SIZE%7D%0A
+ if context == 'field':%0A thumbnail_options = %7B'size': conf.FIELD_THUMB_SIZE%7D%0A
@@ -903,16 +903,20 @@
pass%0A
+
if o
@@ -955,24 +955,28 @@
th('.pdf'):%0A
+
retu
|
a708f0258028213dd9bdee0e83742c76747844d4 | fix implicit commit | frappe/core/doctype/log_settings/test_log_settings.py | frappe/core/doctype/log_settings/test_log_settings.py | # Copyright (c) 2022, Frappe Technologies and Contributors
# License: MIT. See LICENSE
from datetime import datetime
import unittest
import frappe
from frappe.utils import now_datetime, add_to_date
from frappe.core.doctype.log_settings.log_settings import run_log_clean_up
class TestLogSettings(unittest.TestCase):
... | Python | 0.998478 | @@ -114,24 +114,8 @@
time
-%0Aimport unittest
%0A%0Aim
@@ -252,16 +252,62 @@
lean_up%0A
+from frappe.tests.utils import FrappeTestCase%0A
%0A%0Aclass
@@ -326,17 +326,14 @@
ngs(
-unittest.
+Frappe
Test
@@ -381,185 +381,27 @@
:%0A%09%09
-cls.savepoint = %22TestLogSettings%22%0A%09%09# SAVEPOINT can only be used i... |
aa077a89ac66787a90fcf066c5466a8152d8dc31 | Set final_link field of Work model as optional | works/models.py | works/models.py | from django.db import models
from django.contrib.auth.models import User
from clients.models import Client, Contact
from balarco import utils
class WorkType(models.Model):
name = models.CharField(max_length=100)
class ArtType(models.Model):
work_type = models.ForeignKey(WorkType, related_name='art_types', ... | Python | 0 | @@ -1746,16 +1746,28 @@
gth=1000
+, blank=True
)%0A%0A%0Aclas
|
7ecdb4fc2174c253009bb910e703f454767991a1 | fix comment | client/python/modeldb/utils/ConfigUtils.py | client/python/modeldb/utils/ConfigUtils.py | import sys
import yaml
import ConfigConstants as constants
class ConfigReader(object):
def __init__(self, filename):
# TODO: need to deal with errors here
self.config = yaml.load(file(filename, 'r'))
self.validate_config()
def validate_config(self):
# TODO: what all do we expe... | Python | 0 | @@ -966,52 +966,8 @@
me:%0A
- # return the default experiment%0A
|
f405bbaa9a768276e89848d0e679cfb5faacafff | fix mail test | src/muckrock/mailgun/tests.py | src/muckrock/mailgun/tests.py | """
Tests for mailgun
"""
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
import hashlib
import hmac
import nose.tools
import os
import time
from foia.models import FOIARequest
from settings import MAILGUN_ACCESS_KEY
# allow methods that could be functions ... | Python | 0.00003 | @@ -4765,16 +4765,81 @@
a.xls')%0A
+ if os.path.exists('static/foia_files/data.xls'):%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.