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 |
|---|---|---|---|---|---|---|---|
ce0f4a30cad570557ad67122333041806d411adc | Set changelog_file for invocations release task, which now dry-runs ok | tasks.py | tasks.py | from invoke import Collection
from invocations import docs
from invocations.checks import blacken
from invocations.packaging import release
from invocations.pytest import test, coverage
ns = Collection(test, coverage, release, blacken, docs)
ns.configure({"packaging": {"sign": True}})
| Python | 0 | @@ -250,16 +250,21 @@
nfigure(
+%0A
%7B%22packag
@@ -286,8 +286,49 @@
True
+, %22changelog_file%22: %22docs/changelog.rst%22
%7D%7D
+%0A
)%0A
|
711aa6cbfdbf6bf43ce5531d033832eff49d6233 | Use overloaded division in pathlib like we do everywhere else | tasks.py | tasks.py | #
# -*- coding: utf-8 -*-
"""Development related tasks to be run with 'invoke'"""
import os
import pathlib
import shutil
import invoke
# shared function
def rmrf(items, verbose=True):
"Silently remove a list of directories or files"
if isinstance(items, str) or isinstance(items, pathlib.PosixPath):
i... | Python | 0 | @@ -2416,29 +2416,16 @@
LDDIR =
-pathlib.Path(
DOCS_SRC
@@ -2431,17 +2431,18 @@
CDIR
-,
+ /
%22build%22
)%0ASP
@@ -2437,17 +2437,16 @@
%22build%22
-)
%0ASPHINX_
|
b9de8879a3d84ad07a0e368e2cee822a78e25ae6 | Add workaround for uritemplate package conflict | tasks.py | tasks.py | from shutil import copyfile
import os
import sys
import webbrowser
from invoke import task
OSF_GIT_URL = 'https://github.com/sloria/osf.io.git'
POSTGRES_BRANCH = 'feature/postgres'
@task
def setup_tests(ctx, update=False, requirements=True, branch=POSTGRES_BRANCH):
if update and os.path.exists('osf.io'):
... | Python | 0 | @@ -1447,24 +1447,236 @@
--addons')%0A
+ # Hack to fix package conflict between uritemplate and uritemplate.py (dependency of github3.py)%0A ctx.run('pip uninstall uritemplate.py --yes')%0A ctx.run('pip install uritemplate.py==0.3.0')%0A
# In
|
bcee510a1437f5025ede61ad1a2bad59e41eaa3c | address field sync city_id TT33047 | base_location/models/res_partner.py | base_location/models/res_partner.py | # Copyright 2016 Nicolas Bessi, Camptocamp SA
# Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from lxml import etree
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class ResPartner(models.Model):
_inherit = "res.par... | Python | 0.000001 | @@ -5842,10 +5842,21 @@
%22zip_id%22
+, %22city_id%22
%5D%0A
|
35fab0222543a2f32ef395bf6b622bad29533ceb | Create lazy launcher in setUp. | tests.py | tests.py | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def setUp(self):
self.options = MockOptions()
def test_lazy_init(self):
... | Python | 0 | @@ -280,47 +280,21 @@
s()%0A
-%0A
-def test_lazy_init(self):%0A
+ self.
laun
@@ -325,32 +325,63 @@
ions, lazy=True)
+%0A%0A def test_lazy_init(self):
%0A self.as
@@ -391,16 +391,21 @@
tIsNone(
+self.
launcher
@@ -508,68 +508,20 @@
-launcher = Launcher(self.options, lazy=True)%0A ... |
837b2d6043a98a98b7f18f94b0d1452fda3558bd | Add test cases. | tests.py | tests.py | import unittest
import re
from peg import *
Int = Transform(re.compile(r'\d+'), int)
Number = Token(r'\d+')
class TestSimpleExpressions(unittest.TestCase):
def test_single_token_success(self):
ans = parse_all(Number, '123')
self.assertIsInstance(ans, BaseToken)
self.assertIsInstance(ans... | Python | 0.000001 | @@ -2636,16 +2636,270 @@
None))%0A%0A
+ def test_left_term(self):%0A T = Left('A', 'B')%0A ans = parse_all(T, 'AB')%0A self.assertEqual(ans, 'A')%0A%0A def test_right_term(self):%0A T = Right('A', 'B')%0A ans = parse_all(T, 'AB')%0A self.assertEqual(ans, 'B')%0A%0A
%0Ai... |
9718fef71423ffdf3083af6928627b8887389f01 | Remove explicit check for Python3 path, which is not available when tests are run on travis-ci | tests.py | tests.py | import os
import random
import shutil
import string
import tempfile
from unittest import TestCase
import unittest
import sys
import six
from virtualenvapi.manage import VirtualEnvironment
packages_for_pre_install = ['pep8']
packages_for_tests = ['flask', 'git+git://github.com/sjkingo/cartridge-payments.git']
def wh... | Python | 0 | @@ -3245,10 +3245,51 @@
thon
-3
'
+)%0A self.assertIsNotNone(self.python
)%0A
|
abbdc1d23f440351ce6009fb889e856ac816af1a | Add tests on Dario Fo's codice fiscale | tests.py | tests.py |
import unittest
import datetime
from codicefiscale import isvalid, get_birthday, get_sex, control_code, build
class TestRepos(unittest.TestCase):
def test_isvalid(self):
invalid = [ None, True, 16, "RCCMNL",
# the first 'I' shouldn't be there
"CSTNGL22I10D086... | Python | 0 | @@ -383,23 +383,288 @@
isvalid(
+cf))%0A %0A valid = ( 'MRTNTN23M02D969P', %0A 'RCCMNL83S18D969H', %0A 'MRSMSR81D60Z611H',%0A 'CNTCHR83T41D969D', %0A 'FOXDRA26C24H872Y' )%0A%0A for cf
in
+
valid
+:%0A self.assertTru... |
f1e1033e786d372641c2bdaa836547de2d714d8e | Add coverage omits | tests.py | tests.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | Python | 0.000001 | @@ -1635,16 +1635,54 @@
overage(
+%0A omit='*/tests/',%0A
)%0A
|
a2745253170147514d863504f0848b0d16bec11a | Change output colors | track.py | track.py | from termcolor import colored
class Track:
def __init__(self, track):
self.track = track
self.title = track.name.get()
self.artist = track.artist.get()
self.album = track.album.get()
def __str__(self):
return '{} - {}, {}'.format(colored(self.title, attrs=['bold']),
... | Python | 0.998575 | @@ -370,19 +370,20 @@
rtist, '
-red
+blue
'), %0A
|
eb16ae52f604e80adb57508596394a682ab8e2c4 | Update routes.py | domino/routes.py | domino/routes.py | class _Routes:
def __init__(self, host, owner_username, project_name):
self.host = host
self._owner_username = owner_username
self._project_name = project_name
# Project URLs
def _build_project_url(self):
return self.host + '/v1/projects/' + \
self._owner_usernam... | Python | 0 | @@ -393,9 +393,16 @@
f):%0A
-%09
+
retu
|
3de4e648f218db5269cc9d90af4c163294faaab7 | add sklearn.metrics.average_precision_score as apr in metrics | kaggler/metrics/classification.py | kaggler/metrics/classification.py | import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, precision_recall_curve, log_loss
from sklearn.metrics import roc_auc_score as auc # noqa
from ..const import EPS
def logloss(y, p):
"""Bounded log loss error.
Args:
y (numpy.array): target
p (numpy.array): prediction
... | Python | 0.000001 | @@ -149,16 +149,92 @@
auc
+ # noqa %0Afrom sklearn.metrics import average_precision_score as apr
# noqa%0A%0A
|
451ca8f9a4ce28eb6097f322cc58739b45986e74 | Fix session bug for new users | dsp/dst/views.py | dsp/dst/views.py | # -*- coding: utf-8 -*-
from django.contrib.sessions.models import Session
from django.core.urlresolvers import reverse
from django.db.models import get_model
from django.forms import ModelForm
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.t... | Python | 0 | @@ -1592,32 +1592,69 @@
start(request):%0A
+ request.session%5B'init'%5D = 'init'%0A
return %7B%0A
|
9a52545607086935aac1d605f96396c76e281668 | deploy script | eJRF/settings.py | eJRF/settings.py | """
Django settings for eJRF project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... | Python | 0.000001 | @@ -2360,18 +2360,8 @@
%22: %22
-un1c3f3jrf
%22,%0A
|
ce6284e3734358d7b70f2920b246af853bb48ccd | Update analogInOut.py | krempelair/lib/bus/analogInOut.py | krempelair/lib/bus/analogInOut.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import smbus
import logging as log
class analogInOut():
def __init__(self):
self._bus = smbus.SMBus(1)
LOG_FILENAME = 'krempelair.log'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
def getValue(self, address, chanel):
... | Python | 0 | @@ -210,20 +210,16 @@
log
-ging
.basicCo
|
21c5f1b995fce26a02a09ab7328cfaa85bb44c44 | add indenting for prettiness | steps/convert_to_c.py | steps/convert_to_c.py | #!/usr/bin/env python
###
# convert_to_c.py
#
# Reads a possibly machine-generated step program and
# converts it to C code that will run on the e-pucks
# (with some manual editing).
#
# Nicolas Ward
# nward@fas.harvard.edu
# 2012.04.30
###
import sys
import pyparsing
# Define really basic S-expression parser
left_pa... | Python | 0.000007 | @@ -1042,16 +1042,29 @@
exp_list
+, indent = %22%22
):%0A %22
@@ -1377,32 +1377,40 @@
in c_lines(child
+, indent
):%0A
@@ -1457,16 +1457,25 @@
yield
+ indent +
%22if (%25s
@@ -1505,24 +1505,39 @@
sexp_list%5B0%5D
+, indent + %22 %22
))%0A l
@@ -1568,16 +1568,31 @@
_list%5B1%5D
+, in... |
37329130cd181c05858db3dc9621a75effdbd100 | fix bug. convert amount config value to int | stf-connect/client.py | stf-connect/client.py | import six
import stfapi
import adb
class SmartphoneTestingFarmClient(stfapi.SmartphoneTestingFarmAPI):
def __init__(self, *args, **kwargs):
super(SmartphoneTestingFarmClient, self).__init__(*args, **kwargs)
self.session_devices = []
def connect_devices(self, device_spec):
self.add_de... | Python | 0.999239 | @@ -1922,16 +1922,20 @@
o_add =
+int(
wanted_d
@@ -1959,16 +1959,17 @@
amount%22)
+)
%0A
|
d49bc9a42d9bdc9e44f6f656c0daf3245c31e853 | Remove unnecessary takeoff command | dronesym-python/flask-api/src/mavparser.py | dronesym-python/flask-api/src/mavparser.py | from dronekit import Vehicle, Command
from pymavlink import mavutil
def create_mission(drone, waypoints):
cmds = drone.commands
cmds.clear()
cmds.add(Command(0, 0, 0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 0, 0, 0, 0, waypoints[0]['lat'], waypoints[0]['lon'], 10))... | Python | 0.000046 | @@ -142,185 +142,8 @@
()%0A%0A
-%09cmds.add(Command(0, 0, 0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 0, 0, 0, 0, waypoints%5B0%5D%5B'lat'%5D, waypoints%5B0%5D%5B'lon'%5D, 10))%0A%0A
%09for
|
b77937dbffe3739e429250f90092d8504aeec230 | fix test | test/functional/rpc_help.py | test/functional/rpc_help.py | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC help output."""
from test_framework.test_framework import SyscoinTestFramework
from test_fram... | Python | 0.000003 | @@ -1367,21 +1367,16 @@
-
%0A
@@ -1412,23 +1412,140 @@
ng',
- 'Governance',
+'Governance'%5D)%0A if self.is_wallet_compiled():%0A components.append('Governancewallet')%0A%0A components.extend(%5B
'Mas
@@ -1606,16 +1606,24 @@
coin'%5D)%0A
+
%0A
|
0c4588ca08d56b718d01ba89bb57fa974e363245 | allow to use str() on HTTPCode (rendered as /XXX url. i.e: /404) | lib/mother/routing.py | lib/mother/routing.py | # -*- coding: utf8 -*-
__version__ = "$Revision$ $Date$"
__author__ = "Guillaume Bour <guillaume@bour.cc>"
__license__ = """
Copyright (C) 2010, Guillaume Bour <guillaume@bour.cc>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published ... | Python | 0 | @@ -2158,24 +2158,28 @@
rl%0A%0A%09uri +=
+str(
target.__cal
@@ -2192,16 +2192,17 @@
_%5B'url'%5D
+)
%0A%09if pos
@@ -3109,25 +3109,130 @@
ass
-HTTPCode(object):
+MetaHTTPCode(type):%0A%09def __str__(cls):%0A%09%09return '/' + str(cls.code)%0A%0Aclass HTTPCode(object):%0A%09__metaclass__ = MetaHTTPCode
%0A%09co... |
a5d2e8feff29f70dadc45ff026f3c42ef5332bdb | define a logger | superfreq/__init__.py | superfreq/__init__.py | from .core import *
from .naff import *
| Python | 0.998227 | @@ -25,16 +25,58 @@
.naff import *%0A
+%0Aimport logging%0Alogger = logging.Logger()%0A
|
2fa45a342e1c884e557cf822c19fb99b009dcb7e | Change parameters for duplication genotyping model | svtyper/statistics.py | svtyper/statistics.py | import math
from collections import Counter
# ==================================================
# Statistical tools
# ==================================================
# efficient combinatorial function to handle extremely large numbers
def log_choose(n, k):
r = 0.0
# swap for efficiency if k is more than h... | Python | 0 | @@ -766,16 +766,18 @@
, 1/
-3
+5
.0,
-0.5
+1/3.0
%5D%0A
|
a22a4650a597e6ff0d882c8b2862b79b9fbd181d | Use json.dumps to print | electrumx_rpc.py | electrumx_rpc.py | #!/usr/bin/env python3
#
# Copyright (c) 2016, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Script to send RPC commands to a running ElectrumX server.'''
import argparse
import asyncio
import json
import pprint
from func... | Python | 0.000124 | @@ -294,22 +294,8 @@
son%0A
-import pprint%0A
from
@@ -2365,21 +2365,24 @@
-p
print
-.pprint
+(json.dumps
(res
@@ -2394,16 +2394,33 @@
indent=4
+, sort_keys=True)
)%0A%0Adef m
|
6e4c19e50b70388bee39fb34c639540cca82dfe1 | Add initial ICONPATH constants | syncplay/constants.py | syncplay/constants.py | #You might want to change these
DEFAULT_PORT = 8999
OSD_DURATION = 3
OSD_WARNING_MESSAGE_DURATION = 15
MPC_OSD_POSITION = 2 #Right corner, 1 for left
MPLAYER_OSD_LEVEL = 1
UI_TIME_FORMAT = "[%X] "
DEFAULT_CONFIG_NAME = ".syncplay"
#Changing these might be ok
REWIND_THRESHOLD = 4
SEEK_THRESHOLD = 1
SLOWDOWN... | Python | 0 | @@ -2102,16 +2102,168 @@
%5D%0D%0A
+%0D%0AVLC_ICONPATH = %22vlc.png%22%0D%0AMPLAYER_ICONPATH = %22mplayer.png%22%0D%0AMPV_ICONPATH = %22mpv.png%22%0D%0AMPC_ICONPATH = %22mpc-hc.png%22%0D%0AMPC64_ICONPATH = %22mpc-hc64.png%22%0D%0A%0D%0A
#Changin
|
1b36d962fc0c101347764daaf6baec9ad0f4c5a0 | Create Email Objects tests. | entity_emailer/tests/test_tasks.py | entity_emailer/tests/test_tasks.py | from entity.models import Entity, EntityRelationship
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django_dynamic_fixture import G, N
from mock import patch
from entity_emailer import tasks
from entity_emailer.models import Email, EmailType, EmailTemplate, Unsubscribe... | Python | 0 | @@ -105,16 +105,45 @@
entType%0A
+from django.core import mail%0A
from dja
@@ -346,16 +346,635 @@
ribed%0A%0A%0A
+class CreateEmailObjectTest(TestCase):%0A def test_no_html(self):%0A email = tasks.create_email_object(%0A %5B'to@example.com'%5D, 'from@example.com', 'Subject', 'Email Body.', ''%0A... |
83ba23989de94820166a6a330b3efce882dc15e5 | remove extra whitespace | tests/functional/test_yaml.py | tests/functional/test_yaml.py | """
Tests for the resolver
"""
import os
import re
import pytest
import yaml
from tests.lib import DATA_DIR, create_basic_wheel_for_package, path_to_url
_conflict_finder_pat = re.compile(
# Conflicting Requirements: \
# A 1.0.0 requires B == 2.0.0, C 1.0.0 requires B == 1.0.0.
r"""
(?P<package>... | Python | 0.99999 | @@ -150,17 +150,16 @@
to_url%0A%0A
-%0A
_conflic
|
f7852806c3198d58162b66e18bfd9998ef33b63c | Modify receiver to prevent using in future | lexos/receivers/stats_receiver.py | lexos/receivers/stats_receiver.py | from lexos.receivers.base_receiver import BaseReceiver
class StatsReceiver(BaseReceiver):
def __init__(self):
"""So far there is no frontend option for statistics analysis"""
super().__init__()
def options_from_front_end(self):
"""So far there is no frontend option for statistics anal... | Python | 0 | @@ -333,9 +333,30 @@
-pass
+raise NotImplementedError
%0A
|
3714e4dea377cddfbbe1dcc3712796bf234af2e8 | Fix a couple of typos. | libzilla/cli/shell.py | libzilla/cli/shell.py | from libzilla.session import LibzillaSession
from libzilla.session import RESOLUTIONS
from libzilla.session import STATUSES
import sys
import cmd
"""This module defines the ShellCommand class."""
INTRO = """Welcome to the Libzilla Shell!
For a complete list of commands, type help.
The current bug report # is {0}.
L... | Python | 0.999999 | @@ -4883,17 +4883,12 @@
%22%22%22
-Shut down
+Quit
she
|
17d34c49f07b4e71886c741a42edae6ad14919f3 | simplify read_events | life3/app/services.py | life3/app/services.py | import json
from .models import LifeLog
from .data import LifeLogDto
# TODO: do we need to consider class based?
def create_event(data: LifeLogDto):
# TODO: validation
life_log = LifeLog()
life_log.title = data.title
life_log.status = data.status
life_log.type = data.type
life_log.save()
... | Python | 0.999995 | @@ -1,15 +1,40 @@
-import json
+from django.http import JsonResponse
%0A%0Afr
@@ -427,61 +427,17 @@
-# FIXME: implement logic and serializer%0A query_set
+life_logs
= L
@@ -460,23 +460,16 @@
ll()
-%0A fields = %5B
+.values(
'tit
@@ -493,298 +493,59 @@
ype'
-%5D%0A query_list = list()%0A for quer... |
c76ec596f65fb984ee1484c1a19e5d24085c62f0 | Remove unused import | tests/pricing/test_numbers.py | tests/pricing/test_numbers.py | import unittest
from nose.tools import assert_equal
from mock import patch, ANY
from tests.tools import create_mock_json
from twilio.rest.resources.pricing.phone_numbers import PhoneNumberCountries
AUTH = ("AC123", "token")
BASE_URI = "https://pricing.twilio.com/v1"
class NumbersTest(unittest.TestCase):
@pat... | Python | 0.000001 | @@ -72,13 +72,8 @@
atch
-, ANY
%0Afro
|
012c827a643124c47c5cf93631021b5505d4aaf5 | Test with a nonexistent save directory | tests/response_saving_test.py | tests/response_saving_test.py | import os
import os.path
import webracer
import nose.plugins.attrib
from . import utils
from .apps import kitchen_sink_app
utils.app_runner_setup(__name__, kitchen_sink_app.app, 8060)
save_dir = os.path.join(os.path.dirname(__file__), 'tmp')
def list_save_dir():
entries = os.listdir(save_dir)
entries = [entr... | Python | 0 | @@ -236,16 +236,99 @@
, 'tmp')
+%0Anonexistent_save_dir = '/tmp/nonexistent.dee11123e367b4a7506f856cc55898fabd4caeff'
%0A%0Adef li
@@ -1368,8 +1368,396 @@
ponse')%0A
+ %0A @webracer.config(save_responses=True, save_dir=nonexistent_save_dir)%0A def test_save_unsuccessful(self):%0A assert not os.path.e... |
698496ca78ed8612f6c9d9a76783423d855db4f0 | Support delay in INotifyWatcher | livereload/watcher.py | livereload/watcher.py | # -*- coding: utf-8 -*-
"""
livereload.watcher
~~~~~~~~~~~~~~~~~~
A file watch management for LiveReload Server.
:copyright: (c) 2013 by Hsiaoming Yang
"""
import os
import glob
import time
class Watcher(object):
"""A file watcher registery."""
def __init__(self):
self._tasks = {}
... | Python | 0 | @@ -3688,16 +3688,23 @@
th, func
+, delay
)%0A%0A d
|
3ea22e0c7b1a1f4e026cb330a2de340245b17968 | Convert to string once it's been validated as JSON | load_configuration.py | load_configuration.py | # -*- coding: utf-8 -*-
"""
Loads wikiproject.json, validates it, stores it
Copyright (C) 2015 James Hare
Licensed under MIT License: http://mitlicense.org
"""
import os
import sys
import configparser
import json
import mw
import datetime
from bs4 import BeautifulSoup
from project_index import WikiProjectTools
def m... | Python | 0.999987 | @@ -1881,23 +1881,28 @@
(%25s);',
+(str
(output
+)
,))%0A
|
0ea3d1b47ec8f82f5dfdaea5ab0bdf777bbb0f05 | Remove leading and trailing whitespace from keyworder match groups. | lib/rapidsms/parsers/keyworder.py | lib/rapidsms/parsers/keyworder.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import re
class Keyworder(object):
TOKEN_MAP = [
("slug", "([a-z0-9\-]+)"),
("letters", "([a-z]+)"),
("numbers", "(\d+)"),
("whatever", "(.+)")]
def __init__(self):
self.regexen = []
self.prefix = ""
... | Python | 0 | @@ -2396,36 +2396,153 @@
-return (func, match.groups()
+# clean up leading and trailing whitespace%0A groups = map(lambda x: x.strip(), match.groups())%0A return (func, groups
)%0A
|
ed6a3ff15a844ab1e1e7243cb6302ad4950e61d6 | fix unit test | _unittests/ut_grabber/test_mailbox_extended.py | _unittests/ut_grabber/test_mailbox_extended.py | # -*- coding: utf-8 -*-
"""
@brief test log(time=1s)
"""
import sys
import os
import unittest
import warnings
import datetime
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
... | Python | 0.000001 | @@ -2273,16 +2273,55 @@
_from()%0A
+ frm = %5B_ for _ in fr if _%5D%0A
@@ -2337,16 +2337,17 @@
?%22 in fr
+m
%5B0%5D:%0A
|
8482fcd774c45b47c03b4a99a2b49d814cd96751 | Version 0.5. | endless_pagination/__init__.py | endless_pagination/__init__.py | VERSION = (0, 4) | Python | 0 | @@ -11,6 +11,6 @@
(0,
-4
+5
)
|
4f4841954c28a2e6c311b38796309a7ea8db81e7 | Remove required fields in account_banking_ccorp | account_banking_ccorp/account_banking_ccorp.py | account_banking_ccorp/account_banking_ccorp.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | Python | 0 | @@ -1897,39 +1897,24 @@
select=True
-, required=True
),%0A
@@ -2083,23 +2083,8 @@
True
-, required=True
),%0A
|
b9702a5ff1447225e95c86fa431cc66117bdc127 | change host for postgis | examples/example_postgis_connect.py | examples/example_postgis_connect.py | import psycopg2
import psycopg2.extras
import geocoder
import logging
import time
conn = psycopg2.connect("host=postgis.cbn8rngmikzu.us-west-2.rds.amazonaws.com port=5432 dbname=mydb user=addxy password=Denis44C")
cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
sql_search = """
SELECT * FROM geocoder
LIM... | Python | 0.000001 | @@ -110,15 +110,16 @@
ost=
-postgis
+kingston
.cbn
|
4bbe035b0597401fb6ef30f800d5efb44cafad6d | rename option | tweet.py | tweet.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from requests_oauthlib import OAuth1Session
import json
import yaml
import sys
import httplib
import pprint
class Tweet(object):
def __init__(self):
self.urls = {
"search": "https://api.twitter.com/1.1/search/tweets.json",
"timel... | Python | 0.000018 | @@ -4167,21 +4167,16 @@
%22
-show-
timeline
@@ -4212,13 +4212,8 @@
%22
-show-
list
@@ -4251,15 +4251,8 @@
arch
--tweets
%22: t
|
6dcbd10cd38ccc581d8fad94745ec5cea9c1e58a | Remove fun, add whitelist of attributes for markdownify | dpb/settings.py | dpb/settings.py | """
Django settings for dpb project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
SECRET_KEY = os.getenv("SECRET_KEY", "CHANGE_ME")
DEBUG = os.getenv(... | Python | 0 | @@ -4095,22 +4095,8 @@
l',%0A
- 'script',%0A
%5D%0AMA
@@ -4199,12 +4199,103 @@
s.extra',%0A%5D%0A
+MARKDOWNIFY_WHITELIST_ATTRS = %5B%0A 'href',%0A 'src',%0A 'alt',%0A 'class',%0A 'id',%0A%5D%0A
|
7b955bf98cde68ce126fe72b1e163a0d6c5cbe9c | Use module-scope constants for defaults. | system_tests/retry.py | system_tests/retry.py | import time
from functools import wraps
import six
def _retry_all(_):
"""Retry all caught exceptions."""
return True
class RetryBase(object):
"""Base for retrying calling a decorated function w/ exponential backoff.
:type max_tries: int
:param max_tries: Number of times to try (not retry) befo... | Python | 0.000002 | @@ -46,16 +46,53 @@
rt six%0A%0A
+MAX_TRIES = 4%0ADELAY = 1%0ABACKOFF = 2%0A%0A
%0Adef _re
@@ -709,33 +709,41 @@
, max_tries=
-4
+MAX_TRIES
, delay=
1, backoff=2
@@ -722,33 +722,37 @@
AX_TRIES, delay=
-1
+DELAY
, backoff=2, log
@@ -737,34 +737,57 @@
=DELAY, backoff=
-2,
+BACKOFF,%0A
logger=Non... |
26f5ea35c9b3fb9712cc10a2d152a3cabbcbb79a | improve relative to absolute url | scholarly_citation_finder/tools/crawler/HtmlParser.py | scholarly_citation_finder/tools/crawler/HtmlParser.py | from bs4 import BeautifulSoup
import requests
import re
from urlparse import urlparse
from requests.exceptions import ConnectionError
import logging
from scholarly_citation_finder.apps.core.models import PublicationUrl
logger = logging.getLogger(__name__)
class HtmlParserUnkownHeaderType(Exception):
pass
clas... | Python | 0.001796 | @@ -2162,16 +2162,94 @@
pass%0A
+ elif href.startswith('//'):%0A href = 'http:' + href%0A
|
0fda9f5a788e82c9d156c866c2d9f8b897f3d4dc | fix comment on getPartList | afs/dao/FileServerDAO.py | afs/dao/FileServerDAO.py | import re,string,os,sys, datetime
import afs.dao.bin
from afs.util import afsutil
from afs.exceptions.FServError import FServError
class FileServerDAO() :
"""
low level access to the FileServer/VolServer pair
"""
def __init__(self) :
pass
def getVolList(self, serv, part, cellname, tok... | Python | 0.000001 | @@ -5093,20 +5093,21 @@
return
-dict
+list
of Par
@@ -5113,16 +5113,22 @@
rtitions
+-dicts
%0A
|
b73bb0553368852b1656ff03e4e3bf2f66f8e2ec | Add debug output to failing test | tests/t_utils/test_filters.py | tests/t_utils/test_filters.py | # -*- coding: utf-8 -*-
"""
tests.t_utils.test_filters
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by The Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import os
import importlib
from unittest import TestCase
from xobox.utils import filters
class... | Python | 0.000004 | @@ -678,16 +678,41 @@
ile__))%0A
+ print(test_path)%0A
@@ -1101,51 +1101,170 @@
-result += list(filter(filters.files, files)
+print(root)%0A print(dirs)%0A print(files)%0A result += list(filter(filters.files, files))%0A print(expected)%0A print(resu... |
6b6b54a84de62fb80a1602cd9ebf65097614c0d2 | add static root | ltc_huobi/settings.py | ltc_huobi/settings.py | """
Django settings for ltc_huobi project.
Generated by 'django-admin startproject' using Django 1.11.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | Python | 0.000001 | @@ -3101,16 +3101,62 @@
-files/%0A
+STATIC_ROOT = os.path.join(BASE_DIR, 'static')
%0ASTATIC_
|
faae68e24f5c0d033ac2c62d0180a1ad44b775f9 | Remove all coordinate renaming from the cfgrib backend. | tests/test_40_xarray_store.py | tests/test_40_xarray_store.py |
from __future__ import absolute_import, division, print_function, unicode_literals
import os.path
import pytest
import xarray as xr
from cfgrib import eccodes
from cfgrib import cfgrib_
from cfgrib import xarray_store
SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), 'sample-data')
TEST_DATA = os.path.j... | Python | 0 | @@ -3147,372 +3147,4 @@
0.%0A
-%0A%0Adef test_open_dataset_cds():%0A res = xarray_store.open_dataset(TEST_DATA, flavour_name='cds')%0A%0A assert res.attrs%5B'GRIB_edition'%5D == 1%0A%0A var = res%5B't'%5D%0A assert var.attrs%5B'GRIB_gridType'%5D == 'regular_ll'%0A assert var.attrs%5B'units'%5D == 'K'%0... |
e7d5bac9a8457fe7986bbf4f4d87186ca9ee9cc7 | add allowed hosts | ltc_huobi/settings.py | ltc_huobi/settings.py | """
Django settings for ltc_huobi project.
Generated by 'django-admin startproject' using Django 1.11.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | Python | 0 | @@ -830,16 +830,32 @@
OSTS = %5B
+'104.160.41.214'
%5D%0A%0A%0A# Ap
|
1b7d6a795149588eb44c1b33dd7c34fe6669460a | Add info about allowed password length. | ports/esp8266/modules/webrepl_setup.py | ports/esp8266/modules/webrepl_setup.py | import sys
#import uos as os
import os
import machine
RC = "./boot.py"
CONFIG = "./webrepl_cfg.py"
def input_choice(prompt, choices):
while 1:
resp = input(prompt)
if resp in choices:
return resp
def getpass(prompt):
return input(prompt)
def input_pass():
while 1:
pas... | Python | 0 | @@ -333,32 +333,44 @@
ss(%22New password
+ (4-9 chars)
: %22)%0A if
@@ -389,83 +389,11 @@
%3C 4
-:%0A print(%22Password too short%22)%0A continue%0A elif
+ or
len
@@ -430,17 +430,25 @@
nt(%22
-P
+Invalid p
assword
too
@@ -447,16 +447,14 @@
ord
-too lo
+le
ng
+th
%22)%... |
6435193a41a38d99bfb0c0f0ab4733464e12a7d6 | allow to overwrite setting in the tests | django/crashreport/symbols/handler.py | django/crashreport/symbols/handler.py | # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from zipfile import ZipFile
from ... | Python | 0 | @@ -452,56 +452,8 @@
):%0A%0A
- symbol_location = settings.SYMBOL_LOCATION%0A%0A
@@ -638,44 +638,32 @@
all(
-SymbolsUploadHandler.symbol_location
+settings.SYMBOL_LOCATION
)%0A%0A
|
7de7ad466eeca464a878e69b7b3cd87a9674fe5b | Update test to match new eq sementics for records. | twext/who/test/test_directory.py | twext/who/test/test_directory.py | ##
# Copyright (c) 2013 Apple 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.000019 | @@ -6976,22 +6976,24 @@
f.assert
+Not
Equal
-s
(glyph,
@@ -7015,16 +7015,37 @@
matches
+, other fields do not
%0A
|
8a53a0dc7537a8c3f659ae919f778ad203532ec3 | Fix crash when canon tensor with empty eldag | drudge/canon.py | drudge/canon.py | """Canonicalization of tensorial factors.
This module supports the canonicalization of tensorial quantities,
by delegating the actual work to the core canonpy module.
"""
import itertools
import typing
from sympy import conjugate, Symbol
from .canonpy import canon_eldag, Group, Perm
from .utils import sympy_key
#... | Python | 0 | @@ -2706,24 +2706,158 @@
t(factors)%0A%0A
+ # TODO: make handling of empty eldags more elegant.%0A if len(factors) == 0 and len(sums) == 0:%0A return sums, factors, 1%0A%0A
eldag, f
|
90da090c395ceaebbac07270c016501ed476833c | Fix rehash error messages | txircd/modules/rfc/cmd_rehash.py | txircd/modules/rfc/cmd_rehash.py | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.config import ConfigError
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implementer
from fnmatch import fnmatchcase
from typing import Any, Callable, Dict, List, Optional, T... | Python | 0.000003 | @@ -2328,16 +2328,103 @@
r as e:%0A
+%09%09%09message = %22Rehash failed: %7B%7D%22.format(e)%0A%09%09%09for messageLine in message.split(%22%5Cn%22):%0A%09
%09%09%09user.
@@ -2485,37 +2485,19 @@
me,
-%22Rehash failed: %7B%7D%22.format(e)
+messageLine
)%0A%0A@
|
88e42c5091e8b3d5e04c5427a904ea3ebfcd2784 | add timer for view change | plenum/test/view_change/test_view_change.py | plenum/test/view_change/test_view_change.py | import types
import pytest
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from stp_core.loop.eventually import eventually
from plenum.server.node import Node
from plenum.test.delayers import delayNonPrimaries, \
reset_delays_and_process_delayeds
from plenum.test.helper import waitForV... | Python | 0 | @@ -3541,28 +3541,1155 @@
!= new_m_primary_node.name%0A
+%0A%0Adef testViewChangeTimeout(nodeSet, looper, up, wallet1, client1, viewNo):%0A # TODO: this probably should be moved to other file%0A%0A from plenum.test.delayers import icDelay%0A%0A for node in nodeSet:%0A node._primary_election_timeout = ... |
bcc3df62656cc4197b17b40fa88f5bba1ee5ffa9 | Update tree level. | obj_sys/ufs_obj_in_tree_view.py | obj_sys/ufs_obj_in_tree_view.py | from django.core.context_processors import csrf
from django.views.generic import TemplateView
from djangoautoconf.django_utils import retrieve_param
from models_mptt import UfsObjInTree
class ItemTreeView(TemplateView):
item_class = UfsObjInTree
default_level = 2
def get_context_data(self, **kwargs):
... | Python | 0 | @@ -694,16 +694,18 @@
lt_level
++1
)%0A
|
b82230d5be702be5662ca15d19f1053be0f30871 | version 1.5.3 | algoliasearch/version.py | algoliasearch/version.py | VERSION = "1.5.2"
| Python | 0.000002 | @@ -12,7 +12,7 @@
1.5.
-2
+3
%22%0A
|
ee90d58d65b004066fecf3630510a4d1df332f89 | Version Bump and Name Change. | dyn/__init__.py | dyn/__init__.py | # -*- coding: utf-8 -*-
"""This library provides an easily scriptable approach to accessing all of the
features provided by your Traffic Management (TM) or Message Management (MM)
services.
Requires Python 2.6 or higher, or the "simplejson" package.
"""
version_info = (1, 3, 13)
__name__ = 'dyn'
__doc__ =... | Python | 0 | @@ -271,17 +271,17 @@
(1, 3, 1
-3
+4
)%0A__name
@@ -491,30 +491,26 @@
er__ = '
-Jonathan Nappi
+Marc Howes
'%0A__emai
@@ -525,14 +525,14 @@
= '
-jnappi
+mhowes
@dyn
|
492a253ea1674bebc3051238fee759812917438a | Test that those uris which don't send keys in fact do not. | test/test_web_middleware.py | test/test_web_middleware.py | """
Tests for the outgoing middleware which stacks on the
appropriate Surrogate-Key header (if any) for the current URI.
"""
import shutil
from wsgi_intercept import httplib2_intercept
import wsgi_intercept
import httplib2
from tiddlyweb.config import config
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.t... | Python | 0 | @@ -2235,16 +2235,357 @@
keys%0A%0A%0A
+def test_no_keys():%0A %22%22%22%0A Test that a single revision of a tidlder in a bag has no keys.%0A And '/'.%0A %22%22%22%0A for uri in ('/bags/bagone/tiddlers/tidone/revisions/1', '/'):%0A response, content = http.request('http://0.0.0.0' + uri)%0A%0A ... |
2a7322608789b377a1315a1fcfbccb2617f73e4e | Update test_wrong_password.py | test/test_wrong_password.py | test/test_wrong_password.py | # -*- coding: utf-8 -*-
from model.credentials import Credentials
def test_success_login_mk(app):
app.cas.wrong_password(Credentials(login="380961451058", password="MK2prod_20"))
| Python | 0.000048 | @@ -147,15 +147,15 @@
8096
-1451058
+0000000
%22, p
@@ -167,18 +167,9 @@
rd=%22
-MK2prod_20
+1
%22))%0A
|
441f379cd12a6ff4b6d236c50521101c24faaeed | Test with live server | ambulances/mqttupdate.py | ambulances/mqttupdate.py | import atexit, sys, os, time
from django.utils.six import BytesIO
from django.core.management.base import OutputWrapper
from django.core.management.color import color_style, no_style
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from django.conf import settings
from ... | Python | 0 | @@ -926,14 +926,18 @@
se):
- #
%0A
+ #
Pub
@@ -945,24 +945,32 @@
ish to topic
+%0A
self.publis
@@ -978,16 +978,33 @@
(topic,%0A
+
JSON
@@ -1038,25 +1038,67 @@
r.data),
- qos=qos,
+%0A qos=qos,%0A
retain=
@@ -1167,16 +1167,24 @@
qos... |
addee67fbf46a795c9de4669c9951c84b6590d98 | Add params in BaseContext abtract methods | cartoframes/context/base_context.py | cartoframes/context/base_context.py | from abc import ABCMeta, abstractmethod
class BaseContext():
__metaclass__ = ABCMeta
@abstractmethod
def download(self):
pass
@abstractmethod
def upload(self):
pass
@abstractmethod
def execute_query(self):
pass
@abstractmethod
def execute_long_running_qu... | Python | 0.000001 | @@ -118,32 +118,54 @@
ef download(self
+, query, retry_times=0
):%0A pass%0A
@@ -200,24 +200,37 @@
upload(self
+, query, data
):%0A p
@@ -272,32 +272,99 @@
ecute_query(self
+, query, parse_json=True, do_post=True, format=None, **request_args
):%0A pass%0A
@@ -423,16 +423,23 @@
ery(self
+, q... |
eb7cadd64faee9e654a9aee992d21d7bceb716ea | Enable line number anchors when using pygments HtmlFormatter | utils.py | utils.py | """
Miscellaneous utilities.
These are mostly used in templates, for presentation purposes.
"""
try:
import pygments
from pygments import highlight
from pygments import lexers
from pygments.formatters import HtmlFormatter
except ImportError:
pygments = None
try:
import markdown
except ImportE... | Python | 0 | @@ -2506,16 +2506,100 @@
'table'
+,%0A anchorlinenos = True,%0A lineanchors = 'line'
)%0A%0A r
|
a4ffe16efa4b54ef86863b9bfe80dd6f2e0463ba | print call was fixed. | utils.py | utils.py | #! /usr/bin/env python
# $Id: utils.py 297 2007-03-30 11:25:28Z mhagger $
# Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu>
#
# This file is licensed under the GNU Lesser General Public License
# (LGPL). See LICENSE.txt for details.
"""utils.py -- Utility functions used by Gnuplot.
This module cont... | Python | 0 | @@ -1385,16 +1385,17 @@
print
+(
%22Fatal:
@@ -1422,16 +1422,17 @@
equal!%22
+)
%0A
|
df6fdf1a7a1f356ba06ef5641deb24861e2db77d | Clean up inplace ops in relu | thinc/neural/_classes/relu.py | thinc/neural/_classes/relu.py | from .affine import Affine
from ... import describe
from ... import check
from ...describe import Dimension, Synapses, Biases
from ...check import has_shape
class ReLu(Affine):
@check.arg(1, has_shape(('nB', 'nI')))
def predict(self, input__BI):
output__BO = Affine.predict(self, input__BI)
out... | Python | 0 | @@ -306,47 +306,8 @@
BI)%0A
- output__BO = output__BO.copy()%0A
@@ -349,35 +349,36 @@
ut__BO, inplace=
-Tru
+Fals
e)%0A retur
@@ -584,52 +584,11 @@
put_
-copy = output__BO.copy()%0A output_copy
+_BO
= s
@@ -607,34 +607,19 @@
(output_
-copy, inplace=True
+_BO
)%0A
@@ -710,47 +710... |
ad0c052c654f23162e05d848d89a8345b294d983 | Make hyphen compile on Win64 | third_party/hyphen/hyphen.gyp | third_party/hyphen/hyphen.gyp | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'hyphen',
'type': 'static_library',
'include_dirs': [
'.',
],
'defines': [
... | Python | 0.000045 | @@ -628,16 +628,119 @@
%7D,%0A
+ # TODO(jschuh): http://crbug.com/167187%0A 'msvs_disabled_warnings': %5B%0A 4267,%0A %5D,%0A
%7D,%0A
|
0a7039f7e167bd670d0642404eabec940546b3f4 | add magma stats | cbagent/collectors/kvstore_stats.py | cbagent/collectors/kvstore_stats.py | import json
from cbagent.collectors import Collector
from perfrunner.helpers.local import extract_cb_any, get_cbstats
class KVStoreStats(Collector):
COLLECTOR = "kvstore_stats"
CB_STATS_PORT = 11209
METRICS_ACROSS_SHARDS = (
"BlockCacheQuota",
"WriteCacheQuota",
"BlockCacheMemUsed... | Python | 0 | @@ -1879,32 +1879,94 @@
entBytesPerRead%22
+,%0A %22NGetStatsPerSec%22,%0A %22NGetStatsComputedPerSec%22
%0A )%0A METRI
|
0f98c41a7fcf7632903216f3fa29cfa13c769a7b | Clean up code in utils | utils.py | utils.py | import httplib
import urllib2
class Storage(dict):
"""
A Storage object is like a dictionary except `obj.foo` can be used
in addition to `obj['foo']`.
>>> o = Storage(a=1)
>>> o.a
1
>>> o['a']
1
>>> o.a = 2
>>> o['a']
2
>>> del o.... | Python | 0.000016 | @@ -22,16 +22,29 @@
urllib2
+%0Aimport socks
%0A%0Aclass
@@ -1045,16 +1045,34 @@
= None,
+%0A
rdns = T
@@ -1875,33 +1875,111 @@
st,
-port=port, strict=strict,
+%0A port=port, strict=strict, %0A
tim
|
bde130742db1805e4ae4e324334ca3160ae4cc71 | make sure to import datetime | utils.py | utils.py | from google.appengine.ext import db
def key(*args):
return db.Key.from_path(*args).id_or_name()
def get_or_create(model, **kwargs):
key_name = key(model.kind(), '/'.join(kwargs.values()))
return model.get_or_insert(key_name, **kwargs)
def parse_timestamp(timestamp):
FORMAT = '%Y-%m-%dT%H:%M:%S'
i... | Python | 0 | @@ -28,16 +28,46 @@
mport db
+%0Afrom datetime import datetime
%0A%0Adef ke
|
5577630be380c2625dc4e2113921330d483ef014 | fix migration issue with null qr.subject_ids | portal/migrations/versions/823de677d394_.py | portal/migrations/versions/823de677d394_.py | """empty message
Revision ID: 823de677d394
Revises: 320726253d2d
Create Date: 2017-05-24 12:27:57.861464
"""
# revision identifiers, used by Alembic.
revision = '823de677d394'
down_revision = '320726253d2d'
from alembic import op
from datetime import datetime
import sqlalchemy as sa
from portal.models.encounter im... | Python | 0.000001 | @@ -1929,24 +1929,625 @@
(enc_id))%0A%0A%0A
+def update_questionnaire_subjects():%0A bind = op.get_bind()%0A session = Session(bind=bind)%0A%0A for ques_id, user_id in session.execute(%0A %22SELECT questionnaire_responses.id, encounters.user_id%22%0A %22 FROM ques... |
b084e02dd2cf7b492c69090b6acd548066c7c34f | Check if quants are moved and pass moves to done to avoid duplication | pos_picking_state_fix/models/pos_picking.py | pos_picking_state_fix/models/pos_picking.py | # -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
from openerp import models, api
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:
super(PosPicking, self).create_picking()
except:
# ... | Python | 0 | @@ -78,16 +78,28 @@
tails.%0A%0A
+import time%0A
from ope
@@ -122,16 +122,73 @@
ls, api%0A
+from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT%0A
%0A%0Aclass
@@ -372,40 +372,8 @@
pt:%0A
- # Cancel move lines%0A
@@ -472,16 +472,380 @@
_lines:%0A
+ if move.quant_ids:%0A ... |
0aaf5ce169b7bcc0e54a7e93623f60b1e7f4e63e | add Particle.bonded_to upon adding bond | utils.py | utils.py | # ******************************************************************************
# pysimm.utils module
# ******************************************************************************
#
# Container class definition
# Item class definition
# ItemContainer(Sequence) class deinition
# comma separated string compare
#
# **... | Python | 0.000001 | @@ -3342,16 +3342,61 @@
ount+1))
+%0A return None%0A return _item
%0A%0A de
|
8545528c07ed9eaf006a49cf1b875dcec70e89c7 | Use `strip_html_tags` | utils.py | utils.py | import textwrap
import html2text
text_maker = html2text.HTML2Text()
text_maker.body_width = 0
def html_to_md(string):
string = string.replace('<br>', ' ')
return text_maker.handle(string)
def get_formatted_book_data(book_data):
template = textwrap.dedent("""\
**Title:** {0} by {1}
**R... | Python | 0.000001 | @@ -1,12 +1,22 @@
+import re%0A
import textw
@@ -109,67 +109,180 @@
def
-html_to_md(string):%0A string = string.replace('%3Cbr%3E', ' '
+strip_html_tags(text):%0A return re.sub('%3C%5B%5E%3C%5D+?%3E', '', text)%0A%0A%0Adef html_to_md(string, strip_html=True):%0A if strip_html is True:%0A string = str... |
3cb6abf9c079cf17a9c4c0def102338945fabfa1 | Fix fasttext loading | utils.py | utils.py | import os
import torch
from gensim.models import KeyedVectors
from gensim.models.wrappers import FastText
from vocab import Vocab
def load_word_vectors(embeddings_path):
if os.path.isfile(embeddings_path+ '.pth') and os.path.isfile(embeddings_path+ '.vocab'):
print('==> File found, loading to memory')
... | Python | 0.000009 | @@ -126,17 +126,16 @@
Vocab%0A%0A%0A
-%0A
def load
@@ -488,24 +488,25 @@
eddings_path
+
+ '.model'):
@@ -651,16 +651,16 @@
oad_
-fasttext
+word2vec
_for
@@ -682,12 +682,18 @@
path
-).wv
+ + '.vec')
%0A
|
8a05280b98b09d502d581ff277b829e574a1dc2c | remove markdown-added paragraph tags from topics. | utils.py | utils.py | import urllib
import hashlib
import re
import markdown
from datetime import datetime
from google.appengine.api import users
from models import *
__all__ = ['leave_room', 'gravatar', 'slugify', 'get_account', 'transform_message']
def leave_room(room=None, account=None, session=None):
"""
Handles app logic f... | Python | 0 | @@ -1901,16 +1901,52 @@
content%0A
+ markdown.HTML_REMOVED_TEXT = %22%22%0A
md =
@@ -2037,16 +2037,124 @@
'%0A )%0A
+ md_nohtml = markdown.Markdown(%0A safe_mode=%22replace%22,%0A output_format='html4'%0A )%0A
if c
@@ -2714,32 +2714,234 @@
ontent,content)%0A
+ if (M... |
dc0db6b76bb7e388c4272b42651e221c256613e1 | remove --force in favor of --replacepkgs | ceph_deploy/hosts/centos/install.py | ceph_deploy/hosts/centos/install.py | from ceph_deploy.util.wrappers import check_call
from ceph_deploy.util import pkg_managers
from ceph_deploy.hosts import common
def install(distro, logger, version_kind, version):
release = distro.release
machine = distro.sudo_conn.modules.platform.machine()
# Get EPEL installed before we continue:
i... | Python | 0 | @@ -1258,54 +1258,8 @@
s',%0A
- '--force',%0A '--quiet',%0A
@@ -2222,32 +2222,90 @@
%5B
+%0A '--replacepkgs',%0A
'epel-release-6*
@@ -2305,24 +2305,42 @@
ease-6*.rpm'
+,%0A
%5D,%0A
@@ -2741,16 +2741,74 @@
... |
14d4b325a83d8ce48e901b13750e1d545a969094 | Use f.convert(L) to read grayscale | chainercv/utils/image/read_image.py | chainercv/utils/image/read_image.py | import chainer
import numpy as np
from PIL import Image
import warnings
try:
import cv2
_cv2_available = True
except ImportError:
_cv2_available = False
def _read_image_cv2(path, dtype, color):
if color:
color_option = cv2.IMREAD_COLOR
else:
color_option = cv2.IMREAD_GRAYSCALE
... | Python | 0.00002 | @@ -767,17 +767,17 @@
onvert('
-P
+L
')%0A
|
08c3338f693bcc08d261100c9aecbc4cc65641a9 | Set p=1 for autoaug examples | docs/sphinx_autoaug/sphinx_autoaug.py | docs/sphinx_autoaug/sphinx_autoaug.py | """
Automatically document Augmax augmentations
including sample outputs
"""
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.ext.autodoc.directive import AutodocDirective
import jax
import json
import augmax
from imageio import imread, imwrite
from pathlib import Path
SEED = 42
N_IMG... | Python | 0.000007 | @@ -101,51 +101,8 @@
des%0A
-from docutils.parsers.rst import Directive%0A
from
@@ -155,16 +155,16 @@
rective%0A
+
%0Aimport
@@ -255,16 +255,32 @@
t Path%0A%0A
+import inspect%0A%0A
SEED = 4
@@ -324,32 +324,43 @@
mentation, args,
+ kwargs=%7B%7D,
to_float: bool=
@@ -531,16 +531,16 @@
_IMGS)%0A%0A
-
tran... |
fe01a92cac476fef87f4a1fc9a862f21eb9aaa4b | Add support for geography option in geodjango | south/introspection_plugins/geodjango.py | south/introspection_plugins/geodjango.py | """
GeoDjango introspection rules
"""
import django
from django.conf import settings
from south.modelsinspector import add_introspection_rules
has_gis = "django.contrib.gis" in settings.INSTALLED_APPS
if has_gis:
# Alright,import the field
from django.contrib.gis.db.models.fields import GeometryField
... | Python | 0 | @@ -736,32 +736,100 @@
%22default%22: 2%7D%5D,%0A
+ %22geography%22: %5B%22geography%22, %7B%22default%22: False%7D%5D,%0A
|
037fd3abf2c9a0942b70b83c0504a082cfeadabb | FIX integer division to double slash | examples/random_walk_1d_analysis.py | examples/random_walk_1d_analysis.py | # -*- coding: utf-8 -*-
# Copyright 2012, 2013, 2016 Pierre de Buyl
# Copyright 2013 Felix Hoëfling
#
# This file is part of pyh5md
#
# pyh5md is free software and is licensed under the modified BSD license (see
# LICENSE file).
import numpy as np
import matplotlib.pyplot as plt
from pyh5md import File, element
# Ope... | Python | 0.000001 | @@ -735,16 +735,17 @@
mpty((T/
+/
4, r.sha
@@ -769,16 +769,17 @@
time%5B:T/
+/
4%5D%0Afor n
@@ -790,16 +790,17 @@
range(T/
+/
4):%0A
|
9942dc698ecb315700ab8307910055bc4e326c79 | Fix PEP8 error | matador/commands/deploy_ticket.py | matador/commands/deploy_ticket.py | #!/usr/bin/env python
from .command import Command
from matador.commands.deployment import *
from matador.session import Session
import subprocess
import os
import shutil
def _checkout_ticket(ticket, repo_folder, ticket_folder, commit):
subprocess.run([
'git', '-C', repo_folder, 'checkout', commit],
... | Python | 0.000012 | @@ -165,16 +165,17 @@
shutil%0A%0A
+%0A
def _che
|
c45947fb67d8cb41d97659e849e5c5cfdf4275b0 | allow override of dir settings from env | eventkit_cloud/settings/project.py | eventkit_cloud/settings/project.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .celery import * # NOQA
import os
import json
# Project apps
INSTALLED_APPS += (
'oet2.jobs',
'oet2.tasks',
'oet2.api',
'oet2.ui',
'oet2.utils',
'eventkit_cloud'
)
INSTALLED_APPS += ("osgeo_importer", "djmp", "guardian")
IN... | Python | 0 | @@ -828,24 +828,57 @@
AGING_ROOT =
+ os.getenv('EXPORT_STAGING_ROOT',
'/var/lib/e
@@ -900,16 +900,17 @@
_stage/'
+)
%0A%0A# wher
@@ -972,16 +972,51 @@
D_ROOT =
+ os.getenv(''EXPORT_DOWNLOAD_ROOT',
'/var/l
@@ -1045,16 +1045,17 @@
wnload/'
+)
%0A%0A# the
@@ -1103,16 +1103,47 @@
A_ROOT =
+ os.getenv('EXPORT_ME... |
7c2b1dbed09fe08b44fdbbd50ac59af8e5357ea6 | add published to admin | ella/articles/admin.py | ella/articles/admin.py | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from ella.core.admin import PublishableAdmin, ListingInlineAdmin
from ella.articles.models import Article
class ArticleAdmin(PublishableAdmin):
ordering = ('-created',)
fieldsets = (
(_("Article heading"), {'fiel... | Python | 0 | @@ -589,16 +589,29 @@
sh_to'),
+ 'published',
'static
|
5b011488b5fcfd17f2029e833b757d24d437908e | Revert to Beta as document_page is Beta | document_page_project/__manifest__.py | document_page_project/__manifest__.py | # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com) - Lois Rilo
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Document Page Project",
"summary": "This module links document pages to projects",
"version": "13.0.1.0.1",
"development_status": "Production/Stable",... | Python | 0.999865 | @@ -298,25 +298,12 @@
%22: %22
-Production/Stable
+Beta
%22,%0A
|
3277c486d337c87b8c7c0d0fea1e8a5be4c48deb | Add function to print planet as roman numeral. | elmo/eve_sde/models.py | elmo/eve_sde/models.py | from django.db import models
class Region(models.Model):
id = models.IntegerField(primary_key=True)
name = models.CharField(
db_index=True,
unique=True,
max_length=64
)
def __str__(self):
return self.name
class Constellation(models.Model):
id = models.IntegerFie... | Python | 0.000022 | @@ -23,16 +23,30 @@
models%0A%0A
+import roman%0A%0A
%0Aclass R
@@ -1243,16 +1243,83 @@
=True)%0A%0A
+ def as_roman(self):%0A return roman.toRoman(self.number)%0A%0A
%0Aclass M
|
08587225e971d877f6a5271a3f5d83cc2acca4be | fix matplotlib in console in windows | python/helpers/pydev/pydev_ipython/matplotlibtools.py | python/helpers/pydev/pydev_ipython/matplotlibtools.py |
import sys
from import_hook import import_hook_manager
backends = {'tk': 'TkAgg',
'gtk': 'GTKAgg',
'wx': 'WXAgg',
'qt': 'Qt4Agg', # qt3 not supported
'qt4': 'Qt4Agg',
'osx': 'MacOSX'}
# We also need a reverse backends2guis mapping that will properly choose ... | Python | 0.000001 | @@ -2005,24 +2005,378 @@
ched_use)%0A%0A%0A
+def patch_is_interactive():%0A %22%22%22 Patch matplotlib function 'use' %22%22%22%0A matplotlib = sys.modules%5B'matplotlib'%5D%0A def patched_is_interactive():%0A return matplotlib.rcParams%5B'interactive'%5D%0A%0A setattr(matplotlib, %22real_is_interac... |
2f9020f9b285be5564c5e6120388189a31e161aa | Improve collectd http_check plugin logging | deployment_scripts/puppet/modules/lma_collector/files/collectd/http_check.py | deployment_scripts/puppet/modules/lma_collector/files/collectd/http_check.py | #!/usr/bin/python
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0 | @@ -1970,26 +1970,22 @@
-if r.status
+expected
_code
-!
= se
@@ -2020,114 +2020,282 @@
200)
-:%0A self.logger.warning(%22%7B%7D responded with code %7B%7D%22.format(%0A url,
+%0A if r.status_code != expected_code:%0A self.logger.warni... |
5b98363a8f3ee701b46a60841769e72a3c6bb405 | support running on machine with avx-512 (#4509) | python/nano/src/bigdl/nano/pytorch/trainer/Trainer.py | python/nano/src/bigdl/nano/pytorch/trainer/Trainer.py | #
# Copyright 2016 The BigDL 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 in ... | Python | 0 | @@ -657,124 +657,8 @@
pl%0A
-import intel_pytorch_extension as ipex%0Afrom bigdl.nano.pytorch.accelerators.ipex_accelerator import IPEXAccelerator%0A
from
@@ -2715,16 +2715,17 @@
+
%22 withou
@@ -2763,16 +2763,17 @@
error.%22%0A
+
@@ -2872,16 +2872,138 @@
s == 1:%0A
+ if use_ipex:... |
da830772aa6e02d40b8bb7a8b3a80aa633c34410 | Move the -sV option to the command | enumerator/lib/nmap.py | enumerator/lib/nmap.py | #!/usr/bin/env python
"""This module is the first
step in gathering initial
service enumeration data from
a list of hosts. It initializes
the scanning commands and parses
the scan results. The scan results
are then passed to the delegator
module which determines what enumerator
should do next.
@author: Steve Coward (s... | Python | 0.000005 | @@ -577,16 +577,20 @@
e)s -sS
+-sV
-oN %25(ou
@@ -705,20 +705,16 @@
'-T4 -p-
- -sV
',%0A '
@@ -727,20 +727,16 @@
h': '-T2
- -sV
',%0A%7D, %7B%0A
@@ -778,16 +778,20 @@
e)s -sU
+-sV
--open -
@@ -925,20 +925,16 @@
orts 100
- -sV
',%0A '
@@ -962,20 +962,16 @@
ports 10
- -sV
',%0A%7D%5D%0A%0A#
|
208a76bb86bd87878a85906875d0b4d51dbd7168 | Change the format of kclustering example. | examples/datamining/kclustering.py | examples/datamining/kclustering.py | """
K-clustering with MapReduce
===========================
More details to be added...
"""
from disco.core import Disco, Params, result_iterator
from disco.worker.task_io import chain_reader
from optparse import OptionParser
from os import getenv
# HACK: The following dictionary will be transformed into a class onc... | Python | 0 | @@ -243,16 +243,161 @@
getenv%0A%0A
+def reader(fd, size, url, params):%0A for e in chain_reader(fd, size, url):%0A L = e.split()%0A yield L%5B0%5D, %5Bfloat(s) for s in L%5B1:%5D%5D%0A
%0A# HACK:
@@ -2087,38 +2087,32 @@
s, map_reader =
-chain_
reader):%0A %22%22%22
@@ -3503,22 +3503,16 @@
ead... |
f9c2c807d8b2d8c922aaa466b185f9ea037d9f3b | Allow credential reissue in 'upload failed' status | src/encoded/types/file.py | src/encoded/types/file.py | from ..contentbase import location
from ..renderers import embed
from ..schema_utils import (
load_schema,
schema_validator,
)
from .base import (
ACCESSION_KEYS,
ALIAS_KEYS,
Collection,
)
from pyramid.httpexceptions import (
HTTPForbidden,
HTTPTemporaryRedirect,
HTTPNotFound,
)
from pyr... | Python | 0.000001 | @@ -597,19 +597,24 @@
status
-!=
+not in (
'uploadi
@@ -608,32 +608,50 @@
in ('uploading'
+, 'upload failed')
:%0A return
@@ -4647,19 +4647,24 @@
tatus'%5D
-!=
+not in (
'uploadi
@@ -4658,32 +4658,50 @@
in ('uploading'
+, 'upload failed')
:%0A raise
|
f40bf1441121c138877e27bd23bcef73cf5c2cef | Move ok response creation to pytest fixture | cisco_olt_http/tests/test_operations.py | cisco_olt_http/tests/test_operations.py |
import os
import pytest
import requests
from cisco_olt_http import operations
from cisco_olt_http.client import Client
@pytest.fixture
def data_dir():
return os.path.abspath(
os.path.join(os.path.dirname(__file__), 'data'))
def test_get_data():
client = Client('http://base-url')
show_equipment_... | Python | 0 | @@ -234,16 +234,245 @@
ta'))%0A%0A%0A
+@pytest.fixture%0Adef ok_response(data_dir, mocker):%0A response = mocker.Mock(autospec=requests.Response)%0A with open(os.path.join(data_dir, 'ok_response.xml')) as of:%0A response.content = of.read()%0A return response%0A%0A%0A
def test
@@ -709,197 +709,21 @@
... |
fad492674ccf67989fb074207b67e5f49ce9d018 | Remove old CIPD GN vars | pw_env_setup/py/pw_env_setup/gni_visitor.py | pw_env_setup/py/pw_env_setup/gni_visitor.py | # Copyright 2022 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 0 | @@ -2794,237 +2794,8 @@
e)))
-%0A # TODO(b/240726250) Remove dir_cipd_%7B%7D.%0A name = 'dir_cipd_%7B%7D'.format(match.group(1).lower())%0A self._lines.append(' %7B%7D = %22%7B%7D%22'.format(%0A name, self._abspath_to_gn_path(set.value)))
%0A%0A
|
b0e35c694e3741cb7f9c581ec25f2be1c406b53a | Remove import fallback of urllib2 in tests/modification-check. (#8677) | tests/modification-check.py | tests/modification-check.py | #!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import subprocess
import sys
import tempfile
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
def find_repo_path():
return os.path.dirname(os.path.dirname(os.path.realpath(__... | Python | 0 | @@ -128,18 +128,8 @@
ile%0A
-%0Atry:%0A
from
@@ -167,62 +167,8 @@
eve%0A
-except ImportError:%0A from urllib import urlretrieve
%0A%0Ade
@@ -327,17 +327,16 @@
newlines
-
%0A# handl
@@ -1663,17 +1663,16 @@
-auto'),
-
%0A
@@ -1787,17 +1787,16 @@
po_path,
-
%0A
@@ -2670,17 +2670,16 @@
sc... |
e0356ee74694339ec44a124cdaf63c8394ccaf37 | test fixed | tests/moo/test_algorithm.py | tests/moo/test_algorithm.py | #!/usr/bin/env python
#
import matplotlib as mp
mp.use('Agg')
import unittest
import os
from femagtools import moo
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as mpl
import matplotlib.cm as cm
class FesProblem(moo.Problem):
def __init__(self):
super(FesProblem, self).__i... | Python | 0 | @@ -28,110 +28,149 @@
ort
-matplotlib as mp%0Amp.use('Agg')%0Aimport unittest%0Aimport os%0Afrom femagtools import moo%0Aimport numpy as np
+unittest%0Afrom femagtools import moo%0Aimport numpy as np%0Aimport matplotlib as mp%0Amp.use('Agg') # Generate images without having a window appear
%0Aimp
@@ -1323,15 +1323,8... |
9f07865d3a57ec4683d4d7e47e6d1f1568d8dd29 | Fix test_get_replay_file_name for windows | tests/replay/test_replay.py | tests/replay/test_replay.py | # -*- coding: utf-8 -*-
"""
test_replay
-----------
"""
import pytest
from cookiecutter import replay, main, exceptions
def test_get_replay_file_name():
"""Make sure that replay.get_file_name generates a valid json file path."""
assert replay.get_file_name('foo', 'bar') == 'foo/bar.json'
@pytest.fixture(... | Python | 0.000016 | @@ -51,16 +51,26 @@
--%0A%22%22%22%0A%0A
+import os%0A
import p
@@ -241,16 +241,75 @@
ath.%22%22%22%0A
+ exp_replay_file_name = os.path.join('foo', 'bar.json')%0A
asse
@@ -353,22 +353,28 @@
==
-'foo/bar.json'
+exp_replay_file_name
%0A%0A%0A@
|
40f3171c716235f8e94f94b7b1211588eb993957 | ADD test for last Sunday of a month with only 4 weeks. | meetup/meetup_test.py | meetup/meetup_test.py | from datetime import date
import unittest
from meetup import meetup_day
try:
from meetup import MeetupDayException
except ImportError:
MeetupDayException = Exception
class MeetupTest(unittest.TestCase):
def test_monteenth_of_may_2013(self):
self.assertEqual(date(2013, 5, 13),
... | Python | 0 | @@ -1635,32 +1635,205 @@
day', 'last'))%0A%0A
+ def test_last_sunday_of_only_four_week_february_2015(self):%0A self.assertEqual(date(2015, 2, 22),%0A meetup_day(2015, 2, 'Sunday', 'last'))%0A%0A
def test_fir
|
c507d6f1763bbd6ff00953b369d86bdef2160022 | update Torch example (#3022) | python/dllib/src/bigdl/dllib/utils/utils.py | python/dllib/src/bigdl/dllib/utils/utils.py | #
# Copyright 2018 Analytics Zoo 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 | @@ -2606,16 +2606,727 @@
rip()%0A%0A%0A
+def detect_conda_env_name():%0A import subprocess%0A pro = subprocess.Popen(%0A %22conda info%22,%0A shell=True,%0A stdout=subprocess.PIPE,%0A stderr=subprocess.PIPE)%0A out, err = pro.communicate()%0A out = out.decode(%22utf-8%22)%0A ... |
f333fd72a3806e3250645d6fc6855aa43a489ff8 | Add capability to set chain | tcconfig/_iptables.py | tcconfig/_iptables.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import re
import dataproperty
from dataproperty.type import IntegerTypeChecker
from subprocrunner import SubprocessRunner
from ._common import ANYWHERE_NETWORK
from ._common import sanitize_netwo... | Python | 0.000001 | @@ -364,16 +364,71 @@
_list%0A%0A%0A
+VALID_CHAIN_LIST = %5B%22PREROUTING%22, %22INPUT%22, %22OUTPUT%22%5D%0A%0A%0A
class Ip
@@ -931,32 +931,39 @@
ce, destination,
+ chain,
protocol=%22all%22,
@@ -1225,268 +1225,106 @@
i
-s_valid_src = self.__is_valid_srcdst(self.source)%0A is_valid_dst = self.__is_vali... |
19af4b5c8c849750dd0885ea4fcfb651545b7985 | Remove disallowed fields before resaving on migrations. | migrations/002_add_month_start.py | migrations/002_add_month_start.py | """
Add _week_start_at field to all documents in all collections
"""
from backdrop.core.bucket import utc
from backdrop.core.records import Record
import logging
log = logging.getLogger(__name__)
def up(db):
for name in db.collection_names():
log.info("Migrating collection: {0}".format(name))
col... | Python | 0 | @@ -660,16 +660,102 @@
rt_at')%0A
+ if '_updated_at' in document:%0A document.pop('_updated_at')%0A
|
39c6b5b14153fe3c7fb03f0e4f7c96fb90e0e91c | Fix openssl dependant recipe: scrypt (and grants python3 compatibility) | pythonforandroid/recipes/scrypt/__init__.py | pythonforandroid/recipes/scrypt/__init__.py | import os
from pythonforandroid.recipe import CythonRecipe
class ScryptRecipe(CythonRecipe):
version = '0.8.6'
url = 'https://bitbucket.org/mhallin/py-scrypt/get/v{version}.zip'
depends = [('python2', 'python3crystax'), 'setuptools', 'openssl']
call_hostpython_via_targetpython = False
patches = [... | Python | 0 | @@ -1,14 +1,4 @@
-import os%0A
from
@@ -191,39 +191,8 @@
= %5B
-('python2', 'python3crystax'),
'set
@@ -530,25 +530,22 @@
openssl_
-build_dir
+recipe
= self.
@@ -555,29 +555,16 @@
_recipe(
-%0A
'openssl
@@ -579,33 +579,8 @@
ctx)
-.get_build_dir(arch.arch)
%0A
@@ -605,65 +605,41 @@
+=
-' -I... |
1bc2fe0ca44d6906bb0044a4d880bd606c2f44d6 | Update postgresql.py | src/bots/outputs/postgresql/postgresql.py | src/bots/outputs/postgresql/postgresql.py | import sys
import psycopg2
import time
from lib.bot import *
from lib.utils import *
from lib.event import *
from lib.cache import *
class PostgreSQLBot(Bot):
def init(self):
con = None
try:
self.con = psycopg2.connect(
database=self.parameters.... | Python | 0.000007 | @@ -24,20 +24,8 @@
pg2%0A
-import time%0A
from
@@ -93,32 +93,8 @@
rt *
-%0Afrom lib.cache import *
%0A%0Acl
@@ -118,18 +118,16 @@
(Bot):%0A%0A
-%0A%0A
def
@@ -417,16 +417,24 @@
assword,
+ # FIXME
%0A
@@ -860,17 +860,16 @@
or() %0A%0A%0A
-%0A
def
@@ -986,16 +986,61 @@
_dict2()
+ # FIXME: ren... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.