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 |
|---|---|---|---|---|---|---|---|
66056c97972011831fb36ce0ae37cc9bd490ddba | Swap In New Function | web/impact/impact/v1/helpers/program_helper.py | web/impact/impact/v1/helpers/program_helper.py | from impact.models import Program
from impact.v1.helpers.model_helper import (
FLOAT_FIELD,
INTEGER_FIELD,
ModelHelper,
PK_FIELD,
STRING_FIELD,
)
PROGRAM_FIELDS = {
"id": PK_FIELD,
"name": STRING_FIELD,
"program_family_id": INTEGER_FIELD,
"program_family_name": STRING_FIELD,
"cy... | Python | 0 | @@ -916,31 +916,29 @@
elf.
-get_
field_
-value
+element
(%22cycle%22
).na
@@ -933,22 +933,25 @@
(%22cycle%22
-).
+, %22
name
+%22)
%0A%0A @p
@@ -1017,23 +1017,21 @@
elf.
-get_
field_
-value
+element
(%22pr
@@ -1047,11 +1047,14 @@
ily%22
-).
+, %22
name
+%22)
%0A
|
0b46aed8c55ecf0b6757e6bcc4a73e5e6d2fe77d | Fix active field initialization on vlan. | neutron/plugins/ml2/drivers/datacom/dcclient/xml_manager/data_structures.py | neutron/plugins/ml2/drivers/datacom/dcclient/xml_manager/data_structures.py | """ Data structures used to build the XML
"""
import xml.etree.ElementTree as ET
import neutron.plugins.ml2.drivers.datacom.utils as utils
class Pbits(object):
""" Class pbits represents bitmasks (usually from ports)
This class has one property:
bits: Internally this property is implemented ... | Python | 0 | @@ -3242,19 +3242,19 @@
active=
-Non
+Tru
e):%0A
@@ -3416,19 +3416,21 @@
ctive =
-Tru
+activ
e%0A%0A @
|
0ab8381aeefc4492cce6101260d080e603357ae0 | Use secretmanager v1 API instead of v1beta1 | event_handler/sources.py | event_handler/sources.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0.000001 | @@ -655,24 +655,16 @@
tmanager
-_v1beta1
%0A%0APROJEC
|
74c3095e553759b05ccc57b7c4ffd291ee9568a2 | Update get_main_movies_base_data function | webs/douban/tasks/get_main_movies_base_data.py | webs/douban/tasks/get_main_movies_base_data.py | # -*- coding: utf-8 -*-
import requests
import gevent
import models
from gevent.pool import Pool
from helpers import random_str, get_video_douban_ids
from webs.douban import parsers
from config import sqla
types = ['movie', 'tv']
sorts = ['recommend', 'time', 'rank']
tags_dict = {
'tv': ['热门', '美剧', '英剧', '韩剧', ... | Python | 0.000001 | @@ -1732,16 +1732,63 @@
l_number
+, types=types, tags_dict=tags_dict, sorts=sorts
):%0A v
|
fe6d37efa59cbf222dd703a52456de2aa628fecf | Update random-pick-with-weight.py | Python/random-pick-with-weight.py | Python/random-pick-with-weight.py | # Time: O(logn)
# Space: O(n)
# Given an array w of positive integers,
# where w[i] describes the weight of index i,
# write a function pickIndex which randomly picks an index in proportion to its weight.
#
# Note:
#
# 1 <= w.length <= 10000
# 1 <= w[i] <= 10^5
# pickIndex will be called at most 10000 times.
# Exampl... | Python | 0 | @@ -819,16 +819,30 @@
random%0A
+import bisect%0A
%0A%0Aclass
|
c261c85fb3f3858222577974e97fde2f3713cdc5 | Allow Editors to update People | src/ggrc_basic_permissions/roles/Editor.py | src/ggrc_basic_permissions/roles/Editor.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
scope = "System"
description = """
This role grants a user basic object creati... | Python | 0 | @@ -3439,32 +3439,50 @@
%22ObjectPerson%22,%0A
+ %22Person%22,%0A
%22Option%22
|
ea660e370b05cfe34dc819211b2f28992a924194 | Update random-pick-with-weight.py | Python/random-pick-with-weight.py | Python/random-pick-with-weight.py | # Time: O(logn)
# Space: O(n)
# Given an array w of positive integers,
# where w[i] describes the weight of index i,
# write a function pickIndex which randomly picks an index in proportion to its weight.
#
# Note:
#
# 1 <= w.length <= 10000
# 1 <= w[i] <= 10^5
# pickIndex will be called at most 10000 times.
# Exampl... | Python | 0 | @@ -1,16 +1,47 @@
# Time:
+ ctor: O(n)%0A# pickIndex:
O(logn)
|
056a1b769db7f05402b41ffdcb565585db06bf97 | Update top-k-frequent-elements.py | Python/top-k-frequent-elements.py | Python/top-k-frequent-elements.py | # Time: O(n)
# Space: O(n)
# Given a non-empty array of integers,
# return the k most frequent elements.
#
# For example,
# Given [1,1,1,2,2,3] and k = 2, return [1,2].
#
# Note:
# You may assume k is always valid,
# 1 <= k <= number of unique elements.
# Your algorithm's time complexity must be better
# than O(n lo... | Python | 0 | @@ -728,17 +728,16 @@
, key))%0A
-%0A
@@ -843,17 +843,16 @@
%5Bi%5D%5B1%5D)%0A
-%0A
|
c7c6b27c0678ba1da224d466e690f9b052079d15 | Update __init__.py | pyramid_igniter/__init__.py | pyramid_igniter/__init__.py | # encoding: utf-8
import inspect
from functools import wraps
from pyramid.renderers import render_to_response
from re import sub
def route(rule='/', **options):
def decorator(f):
if not hasattr(f, 'rules'):
f.rules = []
f.rules.append((rule, options))
return f
... | Python | 0.000072 | @@ -3982,19 +3982,16 @@
r = None
- #
%0D%0A __
|
3a156a11cd7b8a9bfc40b515a2f1d1351969ce3a | Simplify loading config for instagram middleware | me_api/middleware/instagram.py | me_api/middleware/instagram.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import requests
from flask import Blueprint, jsonify, request, redirect
from me_api.configs import Config
from me_api.cache import cache
config = Config.modules['modules']['instagram']
path = config['path']
client_secret... | Python | 0.000001 | @@ -180,22 +180,20 @@
pi.c
-onfigs
+ache
import
Conf
@@ -188,22 +188,21 @@
import
-Config
+cache
%0Afrom me
@@ -210,247 +210,88 @@
api.
-cache import cache%0A%0A%0Aconfig = Config.modules%5B'modules'%5D%5B'instagram'%5D%0Apath = config%5B'path'%5D%0Aclient_secret, access_token, client_id = (%0A config%5B'd... |
aeeb62f47a7211d945aafd294edb3d39d5d5cf6e | Modify error message | pytablereader/_validator.py | pytablereader/_validator.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import abc
import os.path
import dataproperty
import pathvalidate as pv
import six
from six.moves.urllib.parse import urlparse
from ._constant import SourceType
from .error import EmptyDataError
... | Python | 0.000001 | @@ -1842,16 +1842,33 @@
rlError(
+%0A
%22invalid
@@ -1877,24 +1877,71 @@
chem
-a: %7B:s%7D%22.format(
+e: expected=http/https, actual=%7B%7D%22.format(%0A
sche
|
6c095c0e14c084666b9417b4bd269f396804bfab | Update interface with the latest changes in functionality. | src/ensign/_interfaces.py | src/ensign/_interfaces.py | # pylint: skip-file
from zope.interface import Attribute, Interface
class IFlag(Interface):
"""
Flag Interface.
Any kind of flag must implement this interface.
"""
TYPE = Attribute("""Flag type""")
store = Attribute("""Flag storage backend""")
name = Attribute("""Flag name""")
value... | Python | 0 | @@ -625,32 +625,118 @@
e.%0A %22%22%22%0A%0A
+ def all(store):%0A %22%22%22%0A Retrieve all flags in the store.%0A %22%22%22%0A%0A
def _check()
@@ -1364,12 +1364,57 @@
rmation.%22%22%22%0A
+%0A def all():%0A %22%22%22Get all flags.%22%22%22%0A
|
249fa5a158cb554b2963eeed443e8d10197c267a | Revert "One hour is now 20 minutes" | ebs_snapshots/snapshot_manager.py | ebs_snapshots/snapshot_manager.py | """ Module handling the snapshots """
import datetime
import yaml
from boto.exception import EC2ResponseError
import kayvee
import logging
""" Configure the valid backup intervals """
VALID_INTERVALS = [
u'hourly',
u'daily',
u'weekly',
u'monthly',
u'yearly']
def run(connection, volume_id, interva... | Python | 0.004639 | @@ -3261,10 +3261,10 @@
a %3E
-12
+36
00:%0A
|
4484bee2c018a4db3951193c6615a34b76880fe3 | add tree migrate anonymous check | python/federatedml/protobuf/model_migrate/converter/tree_model_converter.py | python/federatedml/protobuf/model_migrate/converter/tree_model_converter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | Python | 0 | @@ -1455,16 +1455,160 @@
tances)%0A
+ fid_feature_mapping = dict(param.feature_name_fid_mapping)%0A feature_fid_mapping = %7Bv: k for k, v in fid_feature_mapping.items()%7D%0A
@@ -1898,16 +1898,75 @@
tename)%0A
+ if fp.fullname not in feature_fid_mapping:%0A
@@ -2694,9... |
a9253d6382c8eeb4261d0fc533d943046b51d109 | Remove unused variable | account_tax_analysis/account_tax_analysis.py | account_tax_analysis/account_tax_analysis.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville. Copyright 2013-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | Python | 0.000015 | @@ -1596,63 +1596,8 @@
f):%0A
- action_obj = self.env%5B'ir.actions.act_window'%5D%0A
|
d2f36dda1e6585a2c59bdf8c8290c34e573e4829 | Remove $? from exit status for Fish Shell compatibility | src/output.py | src/output.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
import os
import pickle... | Python | 0.000004 | @@ -5608,11 +5608,8 @@
exit
- $?
;')%0A
|
c433c649a9a4b32095a170f75c7e4aae9382089b | use absolute imports | em_examples/__init__.py | em_examples/__init__.py | import Attenuation
import BiotSavart
import CondUtils
import DC_cylinder
import DCLayers
import DCsphere
import DCWidget
import DCWidgetPlate2_5D
import DCWidgetPlate_2D
import DCWidgetResLayer2_5D
import DCWidgetResLayer2D
import DipoleWidget1D
import DipoleWidgetFD
import DipoleWidgetTD
import EMcircuit
import FDEMDi... | Python | 0.000146 | @@ -1,15 +1,16 @@
import
+.
Attenuat
@@ -20,16 +20,17 @@
%0Aimport
+.
BiotSava
@@ -39,16 +39,17 @@
%0Aimport
+.
CondUtil
@@ -57,16 +57,17 @@
%0Aimport
+.
DC_cylin
@@ -77,16 +77,17 @@
%0Aimport
+.
DCLayers
@@ -94,16 +94,17 @@
%0Aimport
+.
DCsphere
@@ -103,32 +103,33 @@
DCsphere%0Aimport
+.
DCWidget%... |
ae0f08294d52a5c32eccfc8b63b950bd2e336669 | fix argparse error printing | email_actions/server.py | email_actions/server.py | import logging
import asyncio
import argparse
import socket
from aiosmtpd.handlers import Message
from aiosmtpd.controller import Controller
from functools import partial
from email_actions.constants import VERSION
from email_actions.filters import Filter
from email_actions.config import check_config
def bind(family... | Python | 0.000005 | @@ -3301,16 +3301,25 @@
te it')%0A
+ try:%0A
args =
@@ -3338,16 +3338,38 @@
e_args()
+%0A except:%0A exit(1)
%0A%0A if a
|
7d9cec11479ce4fee821e5943fa1f1ef65938416 | monitor default:2 | src/gofer/agent/config.py | src/gofer/agent/config.py | #
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU Lesser General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (LGPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# includin... | Python | 0.000001 | @@ -3667,17 +3667,17 @@
itor': '
-0
+2
'%0A %7D,
|
19a78d29742f1f32e9e2502f066f16d0d2b5663c | Apply patch from PyMYSQL PR 592 | tap_mysql/connection.py | tap_mysql/connection.py | #!/usr/bin/env python3
import backoff
import pymysql
from pymysql.constants import CLIENT
import singer
import ssl
LOGGER = singer.get_logger()
CONNECT_TIMEOUT_SECONDS = 30
READ_TIMEOUT_SECONDS = 3600
# We need to hold onto this for self-signed SSL
match_hostname = ssl.match_hostname
@backoff.on_exception(backof... | Python | 0 | @@ -285,16 +285,726 @@
stname%0A%0A
+# MySQL 8.0 Patch:%0A# Workaround to support MySQL 8.0 without upgrading the PyMySQL version%0A# since there are breaking changes between these versions, this should suffice to allow%0A# new character sets to be used with MySQL 8.0 instances.%0A# FIXME: Remove when PyMYSQL upgrade ... |
13af44ee804508afc85711d2f0a0f4c9a09b131e | add logging to rpc connection | src/payout.py | src/payout.py | import json
import socket
import time
from httplib import CannotSendRequest
from threading import Timer
from bitcoinrpc.authproxy import JSONRPCException
from src import database
from src.utils import get_rpc
__author__ = 'sammoth'
def pay(app, log):
"""
Pay all users who have a balance greater than the min... | Python | 0 | @@ -1565,24 +1565,29 @@
get_rpc(app
+, log
)%0A
|
881c745646f3f638527d07bd1cfab9a443950f23 | add get_one method | tempoiq/protocol/row.py | tempoiq/protocol/row.py | from tempoiq.temporal.validate import convert_iso_stamp
from query.selection import AndClause, Compound, OrClause, ScalarSelector
class Row(object):
"""Data from one or more sensors at a single timestamp. Returned when
reading sensor data.
Example values dict of a row with a single sensor, *temperature*\... | Python | 0.000002 | @@ -1125,16 +1125,409 @@
aders)%0A%0A
+ def get_one(self, selection):%0A evaluator = SelectionEvaluator(selection)%0A results = %5Br for r in evaluator.filter(self.headers)%5D%0A if len(results) %3C 1:%0A raise ValueError('Selection would return no results')%0A elif len(result... |
2b8b0ea4c87f550dea60ad9dc769c822f181e397 | raise error on unknown top level element | src/pyrate.py | src/pyrate.py | #!/usr/bin/env python3
#
# Copyright (C) 2015 BMW Car IT GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Python | 0 | @@ -4958,16 +4958,177 @@
w_case)%0A
+ elif key == TestStep.KEY:%0A pass%0A else:%0A raise ParseException(%22unexpected token '%25s'%22 %25 key)%0A
exce
|
3c2887d5589cf634faf9b4466b4fb3711581a2b6 | rename cache to shops | src/webapp.py | src/webapp.py | #!/usr/bin/env python
import os
import json
import uuid
import tornado.ioloop
import tornado.web
import tornado.options
tornado.options.define('cookie_secret', default='sssecccc', help='Change this to a real secret')
tornado.options.define('favicon', default='static/favicon.ico', help='Path to favicon.ico')
tornado.o... | Python | 0.000002 | @@ -592,21 +592,21 @@
+json'%0A%0A
-cache
+shops
= %7B%7D%0A%0Ac
@@ -698,37 +698,37 @@
f shopid not in
-cache
+shops
:%0A in
@@ -1530,21 +1530,21 @@
-cache
+shops
%5Bshopid%5D
@@ -1736,21 +1736,21 @@
f.write(
-cache
+shops
%5Bshopid%5D
@@ -1805,21 +1805,21 @@
not in
-cache
+shops
:%0A ... |
e433bf1c6b8777921cdec4f84f7fc875a8f4677b | Fix DataProxy.partial() | umongo/data_proxy.py | umongo/data_proxy.py | from marshmallow import ValidationError, missing
from .abstract import BaseDataObject
from .exceptions import FieldNotLoadedError
__all__ = ('DataProxy', 'missing')
class DataProxy:
__slots__ = ('not_loaded_fields', '_schema', '_fields', '_data',
'_modified_data', '_fields_from_mongo_key')
... | Python | 0.000001 | @@ -2333,24 +2333,78 @@
ields=True)%0A
+ else:%0A self.not_loaded_fields = ()%0A
self
@@ -3477,24 +3477,78 @@
ields(data)%0A
+ else:%0A self.not_loaded_fields = ()%0A
self
|
c55e9136ee9c86dcd4088ba416043dbff7e65eac | Fix Fast.com autoupdate (#57552) | homeassistant/components/fastdotcom/__init__.py | homeassistant/components/fastdotcom/__init__.py | """Support for testing internet speed via Fast.com."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any
from fastdotcom import fast_com
import voluptuous as vol
from homeassistant.const import CONF_SCAN_INTERVAL
from homeassistant.core import HomeAssistant, Serv... | Python | 0 | @@ -104,16 +104,26 @@
e import
+ datetime,
timedel
@@ -2030,16 +2030,45 @@
ate(self
+, now: datetime %7C None = None
) -%3E Non
|
2c8151bb9a4300f4f7c1314aa80c3f612998c58b | Fix bad attribute in feeder handler. | src/main/resources/vertigo/_feeder.py | src/main/resources/vertigo/_feeder.py | # Copyright 2013 the original author or 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 a... | Python | 0 | @@ -5546,16 +5546,17 @@
er(self.
+_
feeder)%0A
|
d66995e313e99bff213cdc4eabe42d9f46e3599a | Add docstring | src/organizations/backends/modeled.py | src/organizations/backends/modeled.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2020, Ben Lopatin and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright ... | Python | 0.000005 | @@ -2383,22 +2383,64 @@
%0A %22%22%22
-%0A%0A
+Invitation backend for model-tracked invitations
%22%22%22%0A%0A
|
57cd7ea1500827942e042b4aabf2c44d489c430f | remove unneeed assert | ceph_installer/tests/controllers/test_mon.py | ceph_installer/tests/controllers/test_mon.py | from ceph_installer.controllers import mon
class TestMonController(object):
def setup(self):
self.configure_data = dict(
monitor_secret="secret",
cluster_network="0.0.0.0/24",
public_network="0.0.0.0/24",
host="node1",
monitor_interface="eth0",
... | Python | 0 | @@ -4822,48 +4822,8 @@
ta)%0A
- assert result.status_int == 200%0A
|
57841be69b9952a638f917923aa7d7acdb8bd8ba | Fix sync_current_joint | src/poppy_inverse_kinematics/model.py | src/poppy_inverse_kinematics/model.py | # coding= utf8
"""
.. module:: model
"""
import numpy as np
from . import forward_kinematics as fk
from . import inverse_kinematic as ik
from . import robot_utils
class Model():
"""Base model class
:param configuration: The configuration of the robot
:type configuration: model_config
:param computation_... | Python | 0.00014 | @@ -4556,36 +4556,39 @@
joint%5B%22name%22%5D).
-goal
+present
_position, joint
|
1ebe34b5ae889ed5f78eead61abd7f0d3b71678f | Fix docstring | byceps/services/board/topic_query_service.py | byceps/services/board/topic_query_service.py | """
byceps.services.board.topic_query_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from datetime import datetime
from typing import Optional
from sqlalchemy import select
from... | Python | 0.00003 | @@ -1839,32 +1839,37 @@
ic%5D:%0A %22%22%22
-Paginate
+Return recent
topics in t
|
717db7509b586e59c06d06ad60be3ca5671e1c35 | add support for circleci | src/pyquickhelper/pycode/ci_helper.py | src/pyquickhelper/pycode/ci_helper.py | """
@file
@brief Helpers for CI
.. versionadded:: 1.3
"""
def is_travis_or_appveyor():
"""
tells if is a travis environment or appveyor
@return ``'travis'``, ``'appveyor'`` or ``None``
The function should rely more on environement variables
``CI``, ``TRAVIS``, ``APPVEYOR``.
.. versi... | Python | 0 | @@ -326,16 +326,84 @@
ed:: 1.3
+%0A%0A .. versionchanged:: 1.5%0A Takes into account *circleci*.
%0A %22%22%22
@@ -664,16 +664,105 @@
pveyor%22%0A
+ if os.environ.get('CIRCLECI', %22undefined%22) != %22undefined%22:%0A return %22circleci%22%0A
retu
|
06513cf504c7da5cc912743d2b8ad2b39320557d | update help menu link to sphinx | src/python/director/actionhandlers.py | src/python/director/actionhandlers.py | import os
from PythonQt import QtCore, QtGui
import director.applogic as app
import director.objectmodel as om
import director.ioUtils as io
import director.visualization as vis
from director import roboturdf
from director import otdfmodel
_lastDir = None
def getDefaultDirectory():
return _lastDir or os.getcwd(... | Python | 0 | @@ -4242,60 +4242,31 @@
s://
-github.com/RobotLocomotion/director/blob/master/docs
+openhumanoids.github.io
/dir
@@ -4275,17 +4275,8 @@
tor/
-README.md
'))%0A
|
e6e68143e39dcc14833065b388f65879f2aa81f2 | Update import export TestCase | src/tests/ggrc/converters/__init__.py | src/tests/ggrc/converters/__init__.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from flask import json
from os.path import abspath
from os.path import dirname
f... | Python | 0 | @@ -406,16 +406,52 @@
ile__))%0A
+%0A%0Aclass TestCase(ggrc.TestCase):%0A%0A
CSV_DIR
@@ -491,41 +491,8 @@
%22)%0A%0A
-%0Aclass TestCase(ggrc.TestCase):%0A%0A
de
@@ -568,16 +568,21 @@
en(join(
+self.
CSV_DIR,
|
d00f63c4403cc1c6bc6fa3abeff4e81b30e4640b | put proper return type | examples/polymorph/polymorph2.py | examples/polymorph/polymorph2.py | from sqlalchemy import *
import sys
# this example illustrates a polymorphic load of two classes, where each class has a very
# different set of properties
db = create_engine('sqlite://', echo=True, echo_uow=False)
# a table to store companies
companies = Table('companies', db,
Column('company_id', Integer, pri... | Python | 0.020196 | @@ -3761,20 +3761,43 @@
return
-True
+sqlalchemy.mapping.EXT_PASS
%0A%0Apeople
|
671e877bc14eb2034bc4ff735c56c2d3aeb2e43d | Update a test | examples/raw_parameter_script.py | examples/raw_parameter_script.py | """ The main purpose of this file is to demonstrate running SeleniumBase
scripts without the use of Pytest by calling the script directly
with Python or from a Python interactive interpreter. Based on
whether relative imports work or don't, the script can autodetect
how this file was run. With pure Pyth... | Python | 0.000001 | @@ -1648,24 +1648,78 @@
gent = None%0A
+ b.extension_zip = None%0A b.extension_dir = None%0A
b.databa
@@ -1815,24 +1815,50 @@
csp = False%0A
+ b.enable_sync = False%0A
b.visual
@@ -2191,16 +2191,43 @@
ion = 2%0A
+ b.user_data_dir = None%0A
b.pr
|
870c69f6d8c0f0b9dbe60a053e839ae25283f8ba | map each step | pytest_bdd/cucumber_json.py | pytest_bdd/cucumber_json.py | """Cucumber json output formatter."""
import os
import time
import json
import py
def pytest_addoption(parser):
group = parser.getgroup('pytest-bdd')
group.addoption(
'--cucumberjson', '--cucumber-json', action='store',
dest='cucumber_json_path', metavar='path', default=None,
help='c... | Python | 0.999938 | @@ -2629,26 +2629,26 @@
-self.tests.append(
+def stepMap(step):
%0A
@@ -2648,32 +2648,39 @@
p):%0A
+return
%7B%0A
@@ -2673,32 +2673,40 @@
+
%22keyword%22: %22Scen
@@ -2704,51 +2704,28 @@
d%22:
-%22Scenario%22,%0A %22id%22: test_id,%0A
+s... |
7e98bf41b605c08c0cd04c9edf4479b9ac3961f8 | fix import wordnet | pythainlp/corpus/wordnet.py | pythainlp/corpus/wordnet.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals,print_function,absolute_import
import nltk
try:
nltk.data.find("corpora/omw")
except:
nltk.download('wordnet')
nltk.download('omw')
try:
from nltk.corpus import wordnet
except:
nltk.download('wordnet')
'''
API ตัวเก่า
'''
import sqlite3
import pythai... | Python | 0.000005 | @@ -136,16 +136,51 @@
a/omw%22)%0A
+%09nltk.data.find(%22corpora/wordnet%22)%0A
except:%0A
@@ -227,22 +227,16 @@
('omw')%0A
-try:%0A%09
from nlt
@@ -262,43 +262,8 @@
dnet
- %0Aexcept:%0A%09nltk.download('wordnet')
%0A'''
|
9a22781888c88b66d4438094159380f8e6d5075e | Use absolute times for S3 presignature, not deltas | euca2ools/commands/s3/__init__.py | euca2ools/commands/s3/__init__.py | # Copyright 2013-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | Python | 0.000008 | @@ -3190,34 +3190,35 @@
l(self,
-validity_timedelta
+expiration_datetime
):%0A
@@ -3411,47 +3411,49 @@
s=%7B'
-validity_timedelta': validity_timedelta
+expiration_datetime': expiration_datetime
%7D)%0A%0A
|
02a3fb6e1d7bde7b9f9d20089e8dd11040388e80 | remove testing code | python/app/extract_stats.py | python/app/extract_stats.py | # Copyright (C) 2014 Matthieu Caneill <matthieu.caneill@gmail.com>
#
# This file is part of Debsources.
#
# Debsources 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, o... | Python | 0.000021 | @@ -2133,197 +2133,4 @@
s))%0A
-%0A%0Aif __name__ == %22__main__%22:%0A from pprint import pprint%0A pprint(extract_stats(filename=%22stats.data%22,%0A filter_suites=%5B%22debian_wheezy%22, %22total%22%5D))%0A%0A %0A
|
e2fb56d315a08de736d6fcf5d3cf9cb19b5cba75 | check Available; add --no-clean option | cclint.py | cclint.py | #!/usr/bin/env python
"""
Detects problems in data exported from CoreCommerce.
"""
import ConfigParser
import cctools
import optparse
import sys
def check_string(type_name, item_name, item, key, min_len):
"""Print message if item[key] is empty or shorter than min_len."""
value_len = len(item[key])
if val... | Python | 0 | @@ -1422,25 +1422,17 @@
%22
-Discontinued Item
+Available
%22,%0A
@@ -1460,24 +1460,391 @@
%0A )%0A%0A
+ check_value_in_set(%0A %22Product%22,%0A display_name,%0A product,%0A %22Discontinued Item%22,%0A (%22Y%22, %22N%22)%0A )%0A%0A ... |
510a15371cdbb635bc4691eae6fad8070b582814 | Support for Pandoc-style code blocks (http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html) and code span elements (http://daringfireball.net/projects/markdown/syntax#code), which should not be rendered to LaTeX | MarkdownPP/Modules/LaTeXRender.py | MarkdownPP/Modules/LaTeXRender.py | # Copyright (C) 2012 Alex Nisnevich
# Licensed under the MIT license
import re
import httplib, urllib
from MarkdownPP.Module import Module
from MarkdownPP.Transform import Transform
singlelinere = re.compile("\$(\$?)..*\$(\$?)") # $...$ (or $$...$$)
startorendre = re.compile("^\$(\$?)|^\S.*\$(\$?)$") # $... or ...$ ... | Python | 0 | @@ -371,42 +371,192 @@
)%22)%0A
-fencedcodere = re.compile(%22%5E%60%60%60%5Cw*
+spancodere = re.compile(r'(%60%5B%5E%60%5D+%5C%60)') # code between backticks%0A%0A# Support for Pandoc style code blocks with attributes%0Afencedcodere = re.compile(%22%5E((%3E *)?%60%60%60%5Cw*%7C(%3E *)?~~~~*(%5Cs*%7B.*%7D)?)
$%22)%0A... |
adfb7518b47c36396c14a513f547fd5055a29883 | add bootstrap3 | MobileFoodOrderServer/settings.py | MobileFoodOrderServer/settings.py | """
Django settings for MobileFoodOrderServer 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/
"""
# Build paths inside the project like this: os.path.join(BAS... | Python | 0.000001 | @@ -1012,24 +1012,42 @@
aticfiles',%0A
+ 'bootstrap3',%0A
'order',
|
4aa36475ba9346b760d0e8df3b34429dfd9bb008 | Add options -s and -m (part I) | python/scripts/lpod-show.py | python/scripts/lpod-show.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
# David Versmisse <david.versmisse@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it... | Python | 0 | @@ -3361,19 +3361,48 @@
%22output
+, optionally styles and meta.
%22)%0A
-
pars
@@ -3637,17 +3637,17 @@
help=%22
-D
+d
ump outp
@@ -3680,24 +3680,420 @@
irectory.%22)%0A
+ # --meta%0A parser.add_option('-m', '--meta', dest='meta', action='store_true',%0A default=False,%0A ... |
47316dcb10d8eaa8be2ee7d9a0b5fcb2d4b562a6 | Fix Nonetype due to un-materialized runtime (#2389) | python/taichi/aot/module.py | python/taichi/aot/module.py | from taichi.lang import impl, kernel_arguments, kernel_impl
class Module:
"""An AOT module to save and load Taichi kernels.
This module serializes the Taichi kernels for a specific arch. The
serialized module can later be loaded to run on that backend, without the
Python environment.
Example::
... | Python | 0 | @@ -641,24 +641,65 @@
ernels = %5B%5D%0A
+ impl.get_runtime().materialize()%0A
self
|
d06fa1c8bfa5c782a5c28403caf44736620a3706 | add get_instruction method modified: qaamus/test_angka_parser.py | qaamus/test_angka_parser.py | qaamus/test_angka_parser.py | import unittest
from bs4 import BeautifulSoup
from ind_ara_parser import BaseParser
class AngkaParser(BaseParser):
pass
class AngkaParserTestCase(unittest.TestCase):
with open("../html/angka123", "rb") as f:
f = f.read()
soup = BeautifulSoup(f)
def setUp(self):
self.angka_parser = A... | Python | 0.000012 | @@ -118,12 +118,437 @@
-pass
+%22%22%22Handle terjemah angka page.%22%22%22%0A def get_instruction(self):%0A %22%22%22Return the instruction text.%0A%0A text is returning 'Terjemah angka adalah menterjemahkan angka%0A kedalam bahasa arab, caranya cukup mudah ketik angka%0A (tanpa ti... |
a063d15a58cdbaaaac4e63d12080664cef6c02e6 | Add detonation timeout to submission parameters. | modules/Detonation/VxStream.py | modules/Detonation/VxStream.py | # 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 __future__ import division, absolute_import, with_statement, print_function, unicode_literals
import requests
import ... | Python | 0 | @@ -790,32 +790,41 @@
apikey, secret,
+ runtime,
verify):%0A wi
@@ -813,24 +813,24 @@
e, verify):%0A
-
with ope
@@ -868,16 +868,17 @@
iles = %7B
+
'file':
@@ -878,16 +878,17 @@
file': f
+
%7D%0A
@@ -893,24 +893,37 @@
data = %7B
+%0A
'apikey': ap
@@ -919,32 +919,44 @@
apikey'... |
07ef4a31337685212b68aebd009e12ea7d4ce14e | Set default timestamp to now if not provided. | st2common/st2common/models/db/execution.py | st2common/st2common/models/db/execution.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Python | 0 | @@ -5259,32 +5259,73 @@
ld(required=True
+, default=date_utils.get_datetime_utc_now
)%0A%0A line = me
@@ -5948,16 +5948,57 @@
red=True
+, default=date_utils.get_datetime_utc_now
)%0A%0A l
|
455ec97adb158bf4a1512337ec96ea9d37ebb98a | Add support for configurable TEST_MASTER to client | client.py | client.py | #!/usr/bin/env python
import getpass
import logging
import optparse
import os
import sys
import time
import urllib
import urllib2
import simplejson
import time
TEST_MASTER = "http://a1228.halxg.cloudera.com:8081"
RED = "\x1b[31m"
RESET = "\x1b[m"
def generate_job_id():
return "%s.%d.%d" % (getpass.getuser(), int(... | Python | 0 | @@ -168,16 +168,51 @@
MASTER =
+ os.environ.get(%22DIST_TEST_MASTER%22,
%22http:/
@@ -242,16 +242,17 @@
om:8081%22
+)
%0A%0ARED =
|
6509a1c1e9ee92841378d0b6f546ebf64991bbea | add xyz to exportable formats | stltovoxel.py | stltovoxel.py | import argparse
from PIL import Image
import numpy as np
import os.path
import slice
import stl_reader
import perimeter
from util import arrayToPixel
def doExport(inputFilePath, outputFilePath, resolution):
mesh = list(stl_reader.read_stl_verticies(inputFilePath))
(scale, shift, bounding_box) = slice.calcula... | Python | 0.000001 | @@ -416,156 +416,93 @@
-outputFilePattern, outputFileExtension = os.path.splitext(outputFilePath)%0A for height in range(bounding_box%5B2%5D):%0A img = Image.new('RGB', (
+#Note: vol should be addressed with vol%5Bz%5D%5Bx%5D%5By%5D%0A vol = np.zeros((bounding_box%5B2%5D,
boun
@@ -505,33 +505,32 @@
... |
21f53bee1bfba8ef82b82898693c2cc09a7873c7 | add get_weight() to Keras interface | syft/interfaces/keras/models/sequential.py | syft/interfaces/keras/models/sequential.py | import syft
import syft.nn as nn
import sys
from syft.interfaces.keras.layers import Log
class Sequential(object):
def __init__(self):
self.syft = nn.Sequential()
self.layers = list()
self.compiled = False
def add(self, layer):
if(len(self.layers) > 0):
# look to the previous layer to get the input sh... | Python | 0 | @@ -1783,11 +1783,65 @@
ut=x)%0A%0A%09
+def get_weights(self):%0A%09%09return self.syft.parameters()
%0A%0A%0A
|
8299b323eee11dbfebb7c97bfcd16281b874be1d | add release endpoints for /thirdparty | synapse/rest/client/v2_alpha/thirdparty.py | synapse/rest/client/v2_alpha/thirdparty.py | # -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -941,23 +941,10 @@
ols%22
-, releases=()
)%0A
+
%0A
@@ -1503,55 +1503,8 @@
+)$%22
-,%0A releases=()
)%0A%0A
@@ -2244,55 +2244,8 @@
)?$%22
-,%0A releases=()
)%0A%0A
@@ -2848,32 +2848,32 @@
t(RestServlet):%0A
+
PATTERNS = c
@@ -2940,55... |
1caa24a8eda4a90caeeb41e7daee8b73735f7c2e | Add API endpoint returning waterpoint ids for open requests | taarifa_waterpoints/taarifa_waterpoints.py | taarifa_waterpoints/taarifa_waterpoints.py | import json
import requests
from eve.render import send_response
from flask import request, Response, send_from_directory
from werkzeug.contrib.cache import SimpleCache
cache = SimpleCache()
from taarifa_api import api as app, main
def post_waterpoints_get_callback(request, payload):
"""Strip all meta data but i... | Python | 0 | @@ -1020,16 +1020,500 @@
70000%0A%0A%0A
+@app.route('/' + app.config%5B'URL_PREFIX'%5D + '/waterpoints/requests')%0Adef waterpoint_requests():%0A %22Return the unique values for a given field in the waterpoints collection.%22%0A # FIXME: Direct call to the PyMongo driver, should be abstracted%0A requests = ap... |
423b8ed88cb1387e3b35eb2f3e270568c17ce13b | Make substitutions to avoid absolute paths. | test/command_line/tst_kapton_correction.py | test/command_line/tst_kapton_correction.py | from __future__ import absolute_import, division
from dials.array_family import flex # import dependency
class Test(object):
def __init__(self):
from os.path import join
import libtbx.load_env
try:
dials_regression = libtbx.env.dist_path('dials_regression')
except KeyError, e:
print 'SK... | Python | 0.000005 | @@ -418,33 +418,36 @@
ration_test_data
-/
+%22, %22
stills_PSII%22)%0A%0A
@@ -736,42 +736,48 @@
me)%0A
-%0A pickle_path = join(self.path,
+ loc = os.getcwd()%0A%0A pickle_name =
'id
@@ -811,17 +811,16 @@
.pickle'
-)
%0A jso
@@ -825,30 +825,14 @@
son_
-path = join(self.path,
+name =
'id
@@ -880,84... |
dc6390e58a26a6becedadb8705ef094507fb4281 | Remove superfluous quotes | tests/pytests/unit/states/test_ssh_auth.py | tests/pytests/unit/states/test_ssh_auth.py | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import pytest
import salt.states.ssh_auth as ssh_auth
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {ssh_auth: {}}
def test_present():
"""
Test to verifies that the specified SSH key
... | Python | 0.001816 | @@ -849,19 +849,16 @@
already
-%22 %22
present
@@ -1083,35 +1083,32 @@
ost key sshkeys
-%22 %22
for user root wa
@@ -1310,11 +1310,8 @@
eys
-%22 %22
for
|
2db00337d9179740f7c9ab2e0df5c12db42bd873 | Fix test | tests/test_simpleflow/swf/test_executor.py | tests/test_simpleflow/swf/test_executor.py | import unittest
import boto
from moto import mock_swf
from sure import expect
from simpleflow import activity, futures
from simpleflow.swf.executor import Executor
from swf.actors import Decider
from swf.models.history import builder
from swf.responses import Response
from tests.data import (
BaseTestWorkflow,
... | Python | 0.000001 | @@ -2663,24 +2663,76 @@
qual(%2230%22)%0A%0A
+%0Aclass TestCaseNotNeedingDomain(unittest.TestCase):%0A
def test
|
29c59225c04760e4670f63eee5ed15a910a8f7ec | test update added new parameter to experiment() | tests/texture_features_experiments_test.py | tests/texture_features_experiments_test.py | #! /usr/bin/python
# -*- coding: utf-8 -*-
# import funkcí z jiného adresáře
import sys
import os.path
import logging
path_to_script = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(path_to_script, "../experiments/"))
sys.path.append(os.path.join(path_to_script, "../extern/py3DSeedEditor/"))
... | Python | 0 | @@ -1820,16 +1820,118 @@
_shape,%0A
+ use_voxelsize_norm=False,%0A working_voxelsize_mm=%5B1,1,1%5D,%0A
|
cb0ba85a56c163436d6a4180413f0228407458d8 | Correct path specification error | tests/workflows/test_component_wrappers.py | tests/workflows/test_component_wrappers.py | """ Unit tests for json helpers
"""
import os
import unittest
from data_models.parameters import arl_path
from workflows.wrappers.component_wrapper import component_wrapper
class TestComponentWrappers(unittest.TestCase):
def test_run_components(self):
files = ["test_results/test_pipeline.log",
... | Python | 0.000001 | @@ -837,24 +837,40 @@
g_files = %5B%22
+tests/workflows/
test_create_
@@ -905,24 +905,40 @@
%22
+tests/workflows/
test_create_
@@ -974,24 +974,40 @@
%22
+tests/workflows/
test_predict
@@ -1043,24 +1043,40 @@
%22
+tests/workflows/
test_continu
@@ -1173,16 +1173,25 @@
wrapper(
+a... |
f535228e38f33263289f28d46e910ccb0a98a381 | Use list comprehension to evaluate PYTZ_TIME_ZONE_CHOICES | tournamentcontrol/competition/constants.py | tournamentcontrol/competition/constants.py | import pytz
from dateutil.rrule import DAILY, WEEKLY
from django.utils.translation import ugettext_lazy as _
GENDER_CHOICES = (
('M', _('Male')),
('F', _('Female')),
('X', _('Unspecified')),
)
SEASON_MODE_CHOICES = (
(WEEKLY, _("Season")),
(DAILY, _("Tournament")),
)
WIN_LOSE = {
'W': _("Winn... | Python | 0 | @@ -1095,16 +1095,34 @@
d((name,
+ %5Beach for each in
zip(val
@@ -1132,16 +1132,17 @@
, names)
+%5D
))%0APYTZ_
|
998feb0e9684c05240d1370085e7b83e4f9dd776 | Fix encoding problem when parsing cairo repository | utils/mkconstants.py | utils/mkconstants.py | # coding: utf-8
import os
import sys
import re
import pycparser.c_generator
def parse_constant(node):
if isinstance(node, pycparser.c_ast.Constant):
return node.value
elif isinstance(node, pycparser.c_ast.UnaryOp) and node.op == '-':
return '-' + parse_constant(node.expr)
else:
rai... | Python | 0.000189 | @@ -1035,16 +1035,39 @@
filename
+, encoding='iso-8859-1'
).read()
|
c8ecbda2b8c4d1a03285527dd11a27db74f746e7 | change IdP configuration order, enabled first | openedx/core/djangoapps/appsembler/tpa_admin/api.py | openedx/core/djangoapps/appsembler/tpa_admin/api.py | from rest_framework import generics, viewsets
from rest_framework.permissions import IsAuthenticated
from openedx.core.djangoapps.appsembler.sites.permissions import AMCAdminPermission
from openedx.core.lib.api.authentication import (
OAuth2AuthenticationAllowInactiveUser,
)
from third_party_auth.models import SAM... | Python | 0 | @@ -1584,29 +1584,50 @@
t().filter(site__id=site_id)
+.order_by('-enabled')
%0A
|
67a0bab4da1d31aba150ce5cb7831daaea1523de | Increase BQ_DEFAULT_TABLE_EXPIRATION_MS in e2etest settings | openprescribing/openprescribing/settings/e2etest.py | openprescribing/openprescribing/settings/e2etest.py | from __future__ import absolute_import
from .test import *
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': utils.get_env_setting('E2E_DB_NAME'),
'USER': utils.get_env_setting('DB_USER'),
'PASSWORD': utils.get_env_setting('DB_PASS'),
'HO... | Python | 0.000001 | @@ -665,8 +665,74 @@
= True%0A
+%0ABQ_DEFAULT_TABLE_EXPIRATION_MS = 24 * 60 * 60 * 1000 # 24 hours%0A
|
904c9ff5f98cea7975850bfa994b43d936691da4 | Fix typos and trailing spaces | weboob/applications/galleroob/galleroob.py | weboob/applications/galleroob/galleroob.py | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Noé Rubinstein
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | Python | 0.998815 | @@ -734,26 +734,8 @@
%3E.%0A%0A
-import subprocess%0A
impo
@@ -741,16 +741,16 @@
ort sys%0A
+
import o
@@ -1620,25 +1620,9 @@
ult%0A
-
%0A
+
%0Acla
@@ -2061,13 +2061,9 @@
gs)%0A
-
%0A
+
@@ -2440,17 +2440,16 @@
esults',
-
%0A
@@ -4349,12 +4349,22 @@
dir(
-%22..%22
+os.path.p... |
2660096db01f88cd0e71860935862fe969204666 | Fix a script missed in refactor | paasta_tools/contrib/check_registered_slaves_aws.py | paasta_tools/contrib/check_registered_slaves_aws.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import argparse
import sys
from paasta_tools.autoscaling.autoscaling_cluster_lib import get_sfr
from paasta_tools.autoscaling.autoscaling_cluster_lib import get_sfr_slaves
from paasta_tools.autoscaling.autoscaling_clu... | Python | 0.00003 | @@ -193,172 +193,13 @@
et_s
-fr%0Afrom paasta_tools.autoscaling.autoscaling_cluster_lib import get_sfr_slaves%0Afrom paasta_tools.autoscaling.autoscaling_cluster_lib import get_spot_fleet_instances
+caler
%0Afro
@@ -553,92 +553,85 @@
-if resource%5B'type'%5D == 'aws_spot_fleet_request':%0A resource%5... |
e1cf1e0f2cdfd98d47d47a222511127cfee63610 | fix config test | corehq/sql_db/tests/test_partition_config.py | corehq/sql_db/tests/test_partition_config.py | from django.test import SimpleTestCase
from django.test.utils import override_settings
from corehq.sql_db.management.commands.configure_pl_proxy_cluster import get_pl_proxy_server_config_sql, \
get_shard_config_strings
from ..config import PartitionConfig
from ..exceptions import PartitionValidationError
TEST_PAR... | Python | 0.000002 | @@ -2127,20 +2127,16 @@
ehq host
-name
=hqdb0 p
|
f4a941eade4f2d9b08a81003b7028d3cfc754ae2 | Read the data instead of returning a link to the file. | src/otest/rp/endpoints.py | src/otest/rp/endpoints.py | import logging
import mimetypes
import os
from aatest.check import State
from aatest.check import ERROR
from aatest.events import EV_CONDITION
from aatest.events import EV_HTTP_INFO
from aatest.events import EV_REQUEST
from future.backports.urllib.parse import parse_qs
from oic.utils.http_util import BadRequest
from... | Python | 0 | @@ -1679,16 +1679,23 @@
h, 'rb')
+.read()
%0A
|
cad9bf433d0fadd8fff27194be9d7a5428b58ae4 | missing path | src/plone.server/setup.py | src/plone.server/setup.py | # -*- coding: utf-8 -*-
from setuptools import find_packages
from setuptools import setup
from distutils.core import Extension
import os
import sys
import platform
py_impl = getattr(platform, 'python_implementation', lambda: None)
pure_python = os.environ.get('PURE_PYTHON', False)
is_pypy = py_impl() == 'PyPy'
is_jyt... | Python | 0.999092 | @@ -537,24 +537,47 @@
+ 'src', 'plone.server',
'plone', 's
|
d406cf8f4812fce7314f10d3a4b1303d54230099 | Remove unused import. | src/pyhmsa/util/signal.py | src/pyhmsa/util/signal.py | #!/usr/bin/env python
"""
================================================================================
:mod:`signal` -- Signal pattern
================================================================================
.. module:: signal
:synopsis: signal pattern
.. inheritance-diagram:: pyhmsa.util.signal
"""
... | Python | 0 | @@ -553,36 +553,8 @@
les.
-%0Afrom weakref import WeakSet
%0A%0A#
|
ac2fc5dbd75d7a897473c4da06875d1b10783bcc | return after getting DatabaseError | src/sentry/utils/raven.py | src/sentry/utils/raven.py | from __future__ import absolute_import, print_function
import inspect
import logging
import raven
import sentry
from django.conf import settings
from django.db.utils import DatabaseError
from raven.contrib.django.client import DjangoClient
from . import metrics
UNSAFE_FILES = (
'sentry/event_manager.py',
's... | Python | 0.000005 | @@ -1972,16 +1972,35 @@
o=True)%0A
+ return%0A
|
50d65e246f451b1ecaaa683f5b65d34fbaf6905e | (chore) remove blanks | photo_editor/settings/development.py | photo_editor/settings/development.py | # -*- coding: utf-8 -*-
from django_envie.workroom import convertfiletovars
convertfiletovars()
from .base import *
DEBUG = True
INSTALLED_APPS += ('django_nose',)
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
'--with-coverage',
]
| Python | 0.999999 | @@ -161,16 +161,17 @@
nose',)%0A
+
%0ATEST_RU
@@ -211,16 +211,17 @@
Runner'%0A
+
%0ANOSE_AR
|
2180d9ef6d9af45c80fdc89cd64b90df2924c8a7 | Fix comment in stepwise (follow up to #5555) [skip ci] (#5560) | src/_pytest/stepwise.py | src/_pytest/stepwise.py | import pytest
def pytest_addoption(parser):
group = parser.getgroup("general")
group.addoption(
"--sw",
"--stepwise",
action="store_true",
dest="stepwise",
help="exit on test failure and continue from last failing test next time",
)
group.addoption(
"--s... | Python | 0 | @@ -2159,81 +2159,8 @@
t):%0A
- # Skip this hook if plugin is not active or the test is xfailed.%0A
|
7534cadc6a83e94d92b7a92d693a13abdc70c7b4 | Add command-line arg for content processes | example/comp_analysis.py | example/comp_analysis.py | #!/usr/bin/env python
# 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/.
import argparse
import os
import mozinfo
from selenium import webdriver
from selenium.webdriver.c... | Python | 0.000003 | @@ -612,19 +612,34 @@
proxy
+, process_count
):%0A
-
%0A tes
@@ -1305,17 +1305,21 @@
in
-(2, 4, 8)
+process_count
:%0A
@@ -2496,16 +2496,57 @@
oxy=None
+,%0A process_count=(2,4,8)
):%0A f
@@ -2837,24 +2837,60 @@
_time, proxy
+,%0A process_count
)%0A%0A%0Adef ma... |
9a5135f9cd27cf24d27b2393fd071073b4485ac7 | add test gat_plot_slice | mne/viz/tests/test_decoding.py | mne/viz/tests/test_decoding.py | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: Simplified BSD
import os.path as op
import warnings
from nose.tools import assert_raises
from mne.decoding import GeneralizationAcrossTime
from mne import io, Epochs, read_events, pick_types
from mne.utils import requires_sklearn, run_tests_if_main
im... | Python | 0.000012 | @@ -1816,16 +1816,360 @@
.plot)%0A%0A
+%0Adef test_gat_plot_slice():%0A %22%22%22Test GAT slice plot%22%22%22%0A gat = _get_data()%0A gat.plot_slice(gat.train_time%5B'times_'%5D%5B0%5D)%0A # test invalid time point%0A assert_raises(ValueError, gat.plot_slice, -1.)%0A # test float type%0A assert_ra... |
476d7da17c7d22415cbd16b625ba8e443a750f0f | update change_upstream_proxy example | examples/change_upstream_proxy.py | examples/change_upstream_proxy.py | # This scripts demonstrates how mitmproxy can switch to a different upstream proxy
# in upstream proxy mode.
#
# Usage: mitmdump -s "change_upstream_proxy.py host"
from libmproxy.protocol.http import send_connect_request
alternative_upstream_proxy = ("localhost", 8082)
def should_redirect(flow):
return flow.reques... | Python | 0.000001 | @@ -51,16 +51,23 @@
ch to a
+second/
differen
@@ -128,16 +128,61 @@
mitmdump
+ -U http://default-upstream-proxy.local:8080/
-s %22cha
|
40a5e35b58fcb00022235ec00536dc8aa63091a2 | fix min/max mess up | modules/core/PlayerAnalysis.py | modules/core/PlayerAnalysis.py | from collections import namedtuple
import datetime
import pymongo
import random
import numpy
class PlayerAnalysis(namedtuple('PlayerAnalysis', ['id', 'titled', 'engine', 'gamesPlayed', 'closedReports', 'gameAnalyses', 'PVAssessment'])): # id = userId, engine = (True | False | None)
def setEngine(self, engine):
... | Python | 0.000002 | @@ -1420,18 +1420,18 @@
anoa%5B:m
-in
+ax
(1, int(
|
0bc9ba5d9f15b443e5af53cb1e1a593446874bbe | put monkapi exits in Site's shutdown | monk/roles/executor_service.py | monk/roles/executor_service.py | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 19 16:20:55 2014
@author: pacif_000
"""
import os
import simplejson
import logging
from bson.objectid import ObjectId
from twisted.web import server
from twisted.internet import reactor
from deffered_resource import DefferedResource
import monk.core.api as monkapi
import... | Python | 0 | @@ -596,31 +596,26 @@
MonkAPI(
-DefferedResourc
+server.Sit
e):%0A
@@ -622,15 +622,19 @@
def
-__del__
+stopFactory
(sel
@@ -661,16 +661,54 @@
exits()%0A
+ server.Site.stopFactory(self)%0A
@@ -3302,23 +3302,32 @@
%0Aroot =
-MonkAPI
+DefferedResource
()%0Aroot.
@@ -3439,27 +3439,23 @@
%0Asi... |
e60faa1512357ed1ecbb4d107b67e9a5f434626a | Add doctring for grid parse function | SudokuSolver.py | SudokuSolver.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import OrderedDict
class Sudoku(object):
"""
Sudoku(values) -> new instance
A class for a Sudoku puzzle.
Keyword arguments:
values -- an array containing all 81 values of a puzzle horizontally
Instance variables:
values ... | Python | 0 | @@ -1891,32 +1891,84 @@
rse_grid(self):%0A
+ %22%22%22Parses the values into the grid dict.%22%22%22%0A
j = 0%0A
@@ -2943,43 +2943,4 @@
es)%0A
-sudoku.parse_grid()%0Aprint(sudoku.grid)%0A
|
96a6993935fe82cad5b34a6a11fb32585e3823ec | Fix syntax. | astrobin_apps_platesolving/views/solution.py | astrobin_apps_platesolving/views/solution.py | # Python
import simplejson
import urllib2
# Django
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
from django.db import IntegrityError
from django.http import Http404, HttpResponse
from... | Python | 0.000005 | @@ -1891,16 +1891,17 @@
except
+(
urllib2.
@@ -1932,24 +1932,25 @@
ror, IOError
+)
:%0A
|
acef3b83c265078b69061de0054317a31c7a91d0 | Fix permission check on exportdb widget (#3906) | bluebottle/bluebottle_dashboard/dashboard.py | bluebottle/bluebottle_dashboard/dashboard.py | import importlib
from django.urls.base import reverse, reverse_lazy
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from jet.dashboard import modules
from jet.dashboard.dashboard import Dashboard, DefaultAppIndexDashboard
from jet.dashboard.modules import DashboardModule, ... | Python | 0 | @@ -323,16 +323,30 @@
nkList%0A%0A
+import rules%0A%0A
from blu
@@ -2224,55 +2224,70 @@
if
-context%5B'request'%5D.user.has_perm('sites.export'
+rules.test_rule('exportdb.can_export', context%5B'request'%5D.user
):%0A
|
5af79b94c6f1b0117e229db23811d3e1c58ff3fa | Add password encrpytion and try to fix mailgun again | config.py | config.py | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
SECRET_KEY = 'this_is_so_secret' #used for development, reset in prod
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(b... | Python | 0 | @@ -1471,24 +1471,124 @@
BASE_URL')%0A%0A
+ SECURITY_PASSWORD_HASH = 'bcrypt'%0A SECURITY_PASSWORD_SALT = '$2a$16$PnnIgfMwkOjGX4SkHqSOPO'%0A%0A
#Mail co
@@ -1708,37 +1708,14 @@
T',
-2
5
+87
))%0A
- MAIL_USE_SSL = True%0A
@@ -1826,16 +1826,62 @@
SSWORD')
+%0A SECURITY_EMAIL_SENDER = 'joe@joe... |
a10967f6c4d52cac1cf263d2415b1154ecd40745 | Remove console level logging in test | test/test_summariser.py | test/test_summariser.py | """This file contains the BinSummariserTest class."""
import os
import shutil
import tempfile
import unittest
from bin import summariser
class BinSummariserTest(unittest.TestCase):
"""A class to test the bin/summariser.py file."""
def setUp(self):
"""Create tempory config files and populate the db ... | Python | 0.000002 | @@ -1840,11 +1840,12 @@
e =
-tru
+fals
e%5Cn'
|
fe809de47989a8f7378576cdbf88f0ad382fe3f3 | increase words in list to 4 | crypto.py | crypto.py | # -*- coding: utf-8 -*-
import hmac, hashlib, subprocess, random, threading
myrandom = random.SystemRandom()
import gnupg
import config
import store
WORDS_IN_RANDOM_ID = 3
HASH_FUNCTION = hashlib.sha256
GPG_KEY_TYPE = "RSA"
GPG_KEY_LENGTH = "4096"
class CryptoException(Exception): pass
def clean(s, also=''):
"""... | Python | 0.999999 | @@ -164,17 +164,17 @@
OM_ID =
-3
+4
%0AHASH_FU
|
9a3442e5ab54488cc0c6aaad13ff5af85f3faa8e | Use match instead of wildcard filter by default | resolwe/elastic/viewsets.py | resolwe/elastic/viewsets.py | """.. Ignore pydocstyle D400.
================
Elastic Viewsets
================
.. autoclass:: resolwe.elastic.viewsets.ElasticSearchMixin
:members:
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from elasticsearch_dsl.query import Q
from django.conf import settings
fro... | Python | 0 | @@ -2813,16 +2813,13 @@
ry('
-wildcard
+match
', *
|
cdbf0f2c82360c866d8c26f2d8a9539fa943df6b | Bump version 1.0.0. | rpm_py_installer/version.py | rpm_py_installer/version.py | """Version string."""
# main = X.Y.Z
# sub = .devN for pre-alpha releases
VERSION = '0.9.2'
| Python | 0 | @@ -82,11 +82,11 @@
= '
-0.9.2
+1.0.0
'%0A
|
9b5c1892dd4731df564d627ae9dafe95bd82b6a9 | Bump version 0.7.1. | rpm_py_installer/version.py | rpm_py_installer/version.py | """Version string."""
# main = X.Y.Z
# sub = .devN for pre-alpha releases
VERSION = '0.7.0'
| Python | 0 | @@ -82,11 +82,11 @@
= '0.7.
-0
+1
'%0A
|
b1d5f52537d9b8081ebfcf900610b2f97abcb72b | remove now useless annotation | rsqueakvm/model/database.py | rsqueakvm/model/database.py | from rsqueakvm.model.pointers import W_PointersObject
from rpython.rlib import jit
from rsqueakvm.plugins.database_plugin import dbm, SQLConnection
from rsqueakvm.error import PrimitiveFailedError
class DBType(object): pass
NIL = DBType()
TEXT = DBType()
INTEGER = DBType()
REAL = DBType()
BLOB = DBType()
ALTER_SQL =... | Python | 0.000001 | @@ -3260,29 +3260,8 @@
Id%0A%0A
- @jit.unroll_safe%0A
@@ -3421,17 +3421,16 @@
xt_id()%0A
-%0A
|
2d2513ce860503a7ab69e56f47998ca075efaa3b | Add new production hosts | rtei/settings/production.py | rtei/settings/production.py | import sys
from .base import *
DEBUG = False
# Update database configuration with $DATABASE_URL.
import dj_database_url
db_from_env = dj_database_url.config()
DATABASES['default'].update(db_from_env)
SECRET_KEY = os.environ.get('SECRET_KEY')
# AWS S3 settings
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3Boto... | Python | 0 | @@ -895,16 +895,74 @@
app.com'
+,%0A 'rtei-production.herokuapp.com',%0A 'www.rtei.org',
%0A%5D%0A%0A# Em
|
eff874de1ae663ee65f37990cd9b75e7ad574750 | Support ability to pass "*" as wildcard backend in haproxyconn enable/disable_server modules. | salt/modules/haproxyconn.py | salt/modules/haproxyconn.py | # -*- coding: utf-8 -*-
'''
Support for haproxy
.. versionadded:: 2014.7.0
'''
from __future__ import generators
from __future__ import absolute_import
# Import python libs
import stat
import os
import logging
try:
import haproxy.cmds
import haproxy.conn
HAS_HAPROXY = True
except ImportError:
HAS_HA... | Python | 0 | @@ -1503,33 +1503,69 @@
haproxy backend
+, or all backends if %22*%22 is supplied
%0A
-
%0A socket%0A
@@ -1726,32 +1726,189 @@
et_conn(socket)%0A
+%0A if backend == '*':%0A backends = show_backends(socket=socket).split('%5Cn')%0A else:%0A backends = %5Bbackend%5D%0A%0A for backend in ... |
6d8f5e3cd6d2c2997b53121b55bd5da3114ab517 | Use the same function for multiple purposes | salt/modules/nagios_json.py | salt/modules/nagios_json.py | # -*- coding: utf-8 -*-
'''
Check Host & Service status from Nagios via JSON RPC.
.. versionadded:: Beryllium
'''
# Import python libs
from __future__ import absolute_import
import logging
import httplib
# Import 3rd-party libs
# pylint: disable=import-error,no-name-in-module,redefined-builtin
from salt.ext.six.mov... | Python | 0.000029 | @@ -3326,31 +3326,24 @@
not config%5B'
-nagios_
url'%5D:%0A
@@ -3364,26 +3364,47 @@
Missing
-n
+N
agios
-_url
+ URL in the configuration
')%0A
@@ -3420,16 +3420,61 @@
False%0A%0A
+ target = service and 'service' or 'host'%0A
resu
@@ -3497,23 +3497,14 @@
ery(
-query='service'
+target
,%0A
@... |
ce741c0bb862d0a9cd4c58576836a0cbbb669833 | Add docstring | salt/modules/win_network.py | salt/modules/win_network.py | '''
Module for gathering and managing network information
'''
# Import python libs
import re
# Import salt libs
import salt.utils
from salt.utils.socket_util import sanitize_host
# Import 3rd party libraries
HAS_WMI = False
try:
import wmi
HAS_WMI = True
except ImportError:
pass
def __virtual__():
... | Python | 0.000005 | @@ -5795,24 +5795,85 @@
terfaces():%0A
+ '''%0A Return details about network interfaces%0A '''%0A%0A
with sal
|
1df00cb6adf8b9cac677f5f6a272331ab5388c90 | Update main.py | vkfeed/pages/main.py | vkfeed/pages/main.py | # -*- coding: utf-8 -*-
'''Generates the main page.'''
from __future__ import unicode_literals
import re
import urllib
import webapp2
import RSSvk.utils
class MainPage(webapp2.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.he... | Python | 0.000001 | @@ -139,21 +139,22 @@
%0Aimport
-RSSvk
+vkfeed
.utils%0A%0A
@@ -391,37 +391,38 @@
ponse.out.write(
-RSSvk
+vkfeed
.utils.render_te
@@ -1424,13 +1424,14 @@
ite(
-RSSvk
+vkfeed
.uti
|
8c89a8252c807581661d729282c94744040dceb3 | Add OutStream.closed property | IPython/kernel/zmq/iostream.py | IPython/kernel/zmq/iostream.py | """Wrappers for forwarding stdout/stderr over zmq"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import threading
import time
import uuid
from io import StringIO, UnsupportedOperation
import zmq
from zmq.eventloop.ioloop import IOLoop
from .session ... | Python | 0.000002 | @@ -3811,24 +3811,100 @@
ket = None%0A%0A
+ @property%0A def closed(self):%0A return self.pub_socket is None%0A%0A
def _flu
|
be8f36aeacfa448fe9ea6dfa3cdf6f7404c9a88a | use future division | chainercv/links/model/segnet/segnet_basic.py | chainercv/links/model/segnet/segnet_basic.py | import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
from chainercv.transforms import resize
class SegNetBasic(chainer.Chain):
"""SegNet Basic for semantic segmentation.
This is a SegNet [#]_ model for semantic segmenation. This is based on
SegNetBasic model that i... | Python | 0 | @@ -1,12 +1,45 @@
+from __future__ import division%0A%0A
import numpy
|
4b5e8dc1808d1a6107545d486b4097482d07635c | Add dataum_to_img method for pascal dataset | fcn/pascal.py | fcn/pascal.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cPickle as pickle
import os.path as osp
import numpy as np
from scipy.misc import imread
from sklearn.datasets.base import Bunch
import plyvel
import fcn
class SegmentationClassDataset(Bunch):
... | Python | 0 | @@ -724,16 +724,84 @@
,%0A %5D)
+%0A mean_bgr = np.array((104.00698793, 116.66876762, 122.67891434))
%0A%0A de
@@ -2930,26 +2930,8 @@
ch%0A%0A
- @staticmethod%0A
@@ -2947,16 +2947,22 @@
o_datum(
+self,
img):%0A
@@ -3067,82 +3067,139 @@
-=
-np.array((104.00698793, 116.66876762, 122.67891434)... |
7474f18234d46e827400a79a8117590215bca21d | Fix error in forcefield file | examples/neq-switching/run_equilibrium_setup.py | examples/neq-switching/run_equilibrium_setup.py | import numpy as np
import os
import tqdm
from openeye import oechem, oeiupac
from openmmtools import integrators, states, mcmc, constants
from openmoltools import forcefield_generators
from perses.rjmc.topology_proposal import TopologyProposal, SystemGenerator
from perses.rjmc.geometry import FFAllAngleGeometryEngine
f... | Python | 0.000004 | @@ -3083,18 +3083,30 @@
r(%5B'
-ff99sbildn
+amber14/protein.ff14SB
.xml
@@ -3121,16 +3121,24 @@
.xml', '
+amber14/
tip3p.xm
|
15129d5cc4c3a4981a41bebbfc6ace855004cd20 | Add organizational structure. | students/psbriant/session08/circle.py | students/psbriant/session08/circle.py | class Circle:
def __init__(self, radius):
"""
"""
self.radius = radius
self.diameter = radius * 2
@classmethod
def from_diameter(cls, diameter):
self = cls(diameter / 2)
return self
def __str__(self):
return "A circle ob... | Python | 0.000085 | @@ -1,12 +1,157 @@
+%22%22%22%0AName: Paul Briant%0ADate: 11/29/16%0AClass: Introduction to Python%0ASession: 08%0AAssignment: Circle Lab%0A%0ADescription:%0AClasses for Circle Lab%0A%22%22%22%0A%0A%0A
class Circle
|
13886b465c5ba81968064acfe6f60fd9b04aed8d | remove integrate hack | streams/inference/core.py | streams/inference/core.py | # coding: utf-8
""" Core functionality for doing stream inference """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import logging
# Third-party
import emcee
import numpy as np
import astropy.units as u
from ..dynamics import Partic... | Python | 0 | @@ -2685,51 +2685,8 @@
CK%0A%0A
- return np.random.uniform() # HACK%0A%0A
|
c79723b179b0bfeda9b324139d8478bf4f24c1e5 | add unicode char to test print | Lib/glyphNameFormatter/test.py | Lib/glyphNameFormatter/test.py |
def printRange(rangeName):
from glyphNameFormatter import GlyphName
from glyphNameFormatter.unicodeRangeNames import getRangeByName
from glyphNameFormatter.data import unicode2name_AGD
for u in range(*getRangeByName(rangeName)):
g = GlyphName(uniNumber=u)
name = g.getName()
if... | Python | 0.000002 | @@ -522,17 +522,17 @@
e.ljust(
-2
+3
0), %22%2504
@@ -554,16 +554,51 @@
r, %22%5Ct%22,
+ g.uniLetter.encode(%22utf-8%22), %22%5Ct%22,
g.uniNa
|
7be409211181bed5d38bde3be0b6c3d892c9cb29 | Fix patch key error and remove print statements | frappe/patches/v11_0/remove_skip_for_doctype.py | frappe/patches/v11_0/remove_skip_for_doctype.py | import frappe
from frappe.desk.form.linked_with import get_linked_doctypes
from frappe.patches.v11_0.replicate_old_user_permissions import get_doctypes_to_skip
# `skip_for_doctype` was a un-normalized way of storing for which
# doctypes the user permission was applicable.
# in this patch, we normalize this into `appli... | Python | 0.000001 | @@ -1152,33 +1152,37 @@
_for_doctype_map
-%5B
+.get(
(user_permission
@@ -1210,17 +1210,17 @@
on.user)
-%5D
+)
== None
@@ -2515,48 +2515,8 @@
st:%0A
-%09%09print(len(new_user_permissions_list))%0A
%09%09fr
@@ -2809,49 +2809,8 @@
te:%0A
-%09%09print(len(user_permissions_to_delete))%0A
%09%09fr
|
c09274936df73668afd14ccac6d7f7c322d5e8b8 | Add naive logging in Main.py | Main.py | Main.py | """Main Module of PDF Splitter"""
import argparse
import os
from PyPDF2 import PdfFileWriter
from Util import all_pdf_files_in_directory, split_on, concat_pdf_pages, is_landscape, write_pdf_file
parser = \
argparse.ArgumentParser(
description='Split all the pages of multiple PDF files in a directory by d... | Python | 0.000001 | @@ -43,16 +43,31 @@
rgparse%0A
+import logging%0A
import o
@@ -456,16 +456,138 @@
ory'%0A)%0A%0A
+# Get default logger%0Alog = logging.getLogger(__name__)%0Alog.addHandler(logging.StreamHandler())%0Alog.setLevel(logging.INFO)%0A
%0Adef mai
@@ -701,16 +701,70 @@
irectory
+%0A log.info('Working on PDF files in %2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.