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 |
|---|---|---|---|---|---|---|---|
a8104d2765ef97b698f108192dfc0b334498151a | Add ability to look up other rietveld instances | my_reviews.py | my_reviews.py | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Get rietveld stats.
Example:
- my_reviews.py -o me@chromium.org -Q for stats for last quarter.
"""
import datetime
import op... | Python | 0.000001 | @@ -424,16 +424,30 @@
d_before
+, instance_url
):%0A %22%22%22
@@ -731,51 +731,8 @@
%22%22%22%0A
- instance_url = 'codereview.chromium.org'%0A
re
@@ -2166,16 +2166,95 @@
_true')%0A
+ parser.add_option('-i', '--instance_url', default='codereview.chromium.org')%0A
# Remo
@@ -2996,24 +2996,52 @@
eated_before... |
30d4f070a1b10d0748dea10c244dc9ee0f5d2aa7 | change STDOUT to PIPE to get ssh connection module working | lib/ansible/runner/connection/ssh.py | lib/ansible/runner/connection/ssh.py | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | Python | 0 | @@ -3207,22 +3207,20 @@
process.
-STDOUT
+PIPE
)%0A
@@ -4424,14 +4424,12 @@
ess.
-STDOUT
+PIPE
)%0A%0A
|
8a11d39892f9fb2b7506e0381144606e5f4e0a34 | Use highest protocol for log dumping | libs/blocks/blocks/extensions/saveload.py | libs/blocks/blocks/extensions/saveload.py | """Extensions for saving and loading the state of a training process."""
import os.path
import logging
from six.moves import cPickle
from blocks.extensions import SimpleExtension, TrainingExtension
from blocks.utils import reraise_as
from blocks.serialization import secure_dump, load, load_parameter_values
logger = ... | Python | 0.000012 | @@ -3448,16 +3448,57 @@
kle.dump
+,%0A protocol=-1
)%0A
|
f4408cb2feb5a28a5117fefebe782a61ea80de96 | fix res_company | hr_employee_time_clock/models/__init__.py | hr_employee_time_clock/models/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>).
#
# This program is free software: you can redistribute it and/or modify
# it... | Python | 0.000001 | @@ -1362,18 +1362,16 @@
account%0A
-#
from . i
|
6c80293a9895ccd611cdc4533d4474ad21e0523d | Mark failing baikal tests as xfail | tests/storage/dav/test_caldav.py | tests/storage/dav/test_caldav.py | import datetime
from textwrap import dedent
import pytest
import requests.exceptions
from . import dav_server
from . import DAVStorageTests
from .. import format_item
from tests import EVENT_TEMPLATE
from tests import TASK_TEMPLATE
from tests import VCARD_TEMPLATE
from vdirsyncer import exceptions
from vdirsyncer.sto... | Python | 0.000003 | @@ -534,16 +534,93 @@
.param%0A%0A
+ @pytest.mark.xfail(dav_server == %22baikal%22, reason=%22Baikal returns 500.%22)%0A
def
@@ -1314,24 +1314,101 @@
%5D,%0A )%0A
+ @pytest.mark.xfail(dav_server == %22baikal%22, reason=%22Baikal returns 500.%22)%0A
def test
@@ -4677,32 +4677,109 @@
VTODOs.%22... |
c7299a7eb742f8f0a88e69369416829331eb67eb | Fix overextends tag with cached template loader | mezzanine/template/loader_tags.py | mezzanine/template/loader_tags.py | from __future__ import unicode_literals
from future.builtins import map
import os
from itertools import chain
from django.template import Template, TemplateSyntaxError, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from mezzanine import template
register = template.Library()
class Over... | Python | 0 | @@ -3297,413 +3297,21 @@
-loader_names = set(chain.from_iterable(%0A %5Btemplate_engine.get('OPTIONS', %7B%7D).get('loaders', %5B%5D)%0A for template_engine in settings.TEMPLATES%5D))%0A loader_names.update( # default template loaders%0A %5B'django.template.loaders.filesy... |
f71a4ca03b8c7c63816bab57a71f9d28a7139e2d | Add justification for utility method as comment. | contrib/vcloud/vcloud_util.py | contrib/vcloud/vcloud_util.py | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import collections
import os
import sys
import benchexec.util
sys.dont_write_bytecode = ... | Python | 0 | @@ -2005,24 +2005,107 @@
y_value(s):%0A
+ # Contrary to benchexec.util.parse_frequency_value, this handles float values.%0A
if not s
|
96158b6b5a153db6b9a5e5d40699efefc728a9b3 | Make our LiveWidget handle a 'topics' property along with 'topic' | moksha/api/widgets/live/live.py | moksha/api/widgets/live/live.py | # This file is part of Moksha.
# Copyright (C) 2008-2009 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ... | Python | 0 | @@ -1351,15 +1351,57 @@
ic',
+ d.get('topics', getattr(self, 'topics',
None))
+))
%0A
|
410f02a4f657f9a8b9c839f3e08b176f443de9e8 | Handle cases when searched word is only part of the people name. | linkedin_scraper/spiders/people_search.py | linkedin_scraper/spiders/people_search.py | from os import environ
from scrapy_splash import SplashRequest
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
class PeopleSearchSpider(InitSpider):
name = 'people_search'
allowed_domains = ['linkedin.com']
login_page = 'https://www.linkedin.com/uas/login'
def... | Python | 0.000001 | @@ -1446,71 +1446,162 @@
-*first_name, last_name = search_result.css('b::text').extract()
+names = search_result.css('a.title.main-headline').xpath(%0A 'string(.)').extract_first()%0A *first_name, last_name = names.split()%0A
%0A
|
0e0a0de8f6be116ba00a6938586dcbc315c4db3f | Clarify that symbolic representations are Tensors | cleverhans/model.py | cleverhans/model.py | from abc import ABCMeta
class Model(object):
"""
An abstract interface for model wrappers that exposes model symbols
needed for making an attack. This abstraction removes the dependency on
any specific neural network package (e.g. Keras) from the core
code of CleverHans. It can also simplify expo... | Python | 0.999999 | @@ -923,32 +923,41 @@
c representation
+ (Tensor)
of the network
@@ -1070,32 +1070,41 @@
c representation
+ (Tensor)
of the hidden f
@@ -1232,16 +1232,25 @@
entation
+ (Tensor)
for thi
@@ -1504,32 +1504,41 @@
c representation
+ (Tensor)
of the network
@@ -1577,32 +1577,41 @@
c representation
+ (Tensor)
... |
655fcce56abd0d3f0da9b52e911636d931157443 | bump version | dockercloud/__init__.py | dockercloud/__init__.py | import base64
import logging
import os
import requests
from future.standard_library import install_aliases
install_aliases()
from dockercloud.api import auth
from dockercloud.api.service import Service
from dockercloud.api.container import Container
from dockercloud.api.repository import Repository
from dockercloud.... | Python | 0 | @@ -930,9 +930,9 @@
1.0.
-5
+6
'%0A%0Ad
|
6589c5cc30c228e5aacd77184310e9afd9dc0345 | Fix test | tests/test_contributors_views.py | tests/test_contributors_views.py | # -*- coding: utf-8 -*-
from nose.tools import * # noqa; PEP8 asserts
from tests.factories import ProjectFactory, NodeFactory, AuthUserFactory
from tests.base import OsfTestCase, fake
from framework.auth.decorators import Auth
from website.profile import utils
class TestContributorUtils(OsfTestCase):
def se... | Python | 0.000004 | @@ -3500,19 +3500,19 @@
ould be
-one
+all
contrib
@@ -3519,46 +3519,38 @@
utor
- to the parent who is both visible and
+s, client-side handles marking
%0A
@@ -3559,14 +3559,8 @@
#
- not a
con
@@ -3571,25 +3571,46 @@
utor
- on the component
+s that are already added to the child.
%0A
@@ -3687,9 +3687... |
b0c5d485543e123c985336d054b6f20d60634221 | Add new kumquat settings.py file from the origin. We need to find a other solution in the future to overwrite config files | copy/tmp/kumquat-settings.py | copy/tmp/kumquat-settings.py | """
Django settings for kumquat_web 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, ...... | Python | 0 | @@ -330,16 +330,56 @@
sys, os%0A
+from django.conf import global_settings%0A
BASE_DIR
@@ -1328,16 +1328,140 @@
es'),)%0A%0A
+TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (%0A%09'django_settings_export.settings_export',%0A)%0A%0A
# Intern
@@ -1747,31 +1747,8 @@
/'%0A%0A
-# Redirect af... |
b41e563c866a8918a65253c1cbb1a1fa5c44c212 | Placate angry bot | xunit-autolabeler-v2/ast_parser/python/test_data/new_tests/fixture_detection_test.py | xunit-autolabeler-v2/ast_parser/python/test_data/new_tests/fixture_detection_test.py | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0.999805 | @@ -8,17 +8,17 @@
ight 202
-0
+1
Google
|
ef150166d49504475b3d37c8754e35e5f1356e9f | make sql form operations more closely match couch operations | corehq/form_processor/serializers.py | corehq/form_processor/serializers.py | from jsonfield import JSONField
from rest_framework import serializers
from corehq.apps.commtrack.models import StockState
from corehq.form_processor.models import (
CommCareCaseIndexSQL, CommCareCaseSQL, CaseTransaction,
XFormInstanceSQL, XFormOperationSQL, XFormAttachmentSQL,
LedgerValue)
class Deletab... | Python | 0.000003 | @@ -850,24 +850,76 @@
erializer):%0A
+ user = serializers.CharField(source=%22user_id%22)%0A%0A
class Me
@@ -952,24 +952,68 @@
perationSQL%0A
+ exclude = ('id', 'form', 'user_id')%0A
%0A%0Aclass XFor
|
d16e9decb8a8bc4f2ea8adc81327e2290a532c69 | update method names | hwtLib/structManipulators/structReader.py | hwtLib/structManipulators/structReader.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import StaticForEach, connect
from hwt.hdlObjects.frameTmpl import FrameTmpl
from hwt.hdlObjects.transTmpl import TransTmpl
from hwt.hdlObjects.types.struct import HStruct
from hwt.interfaces.std import Handshaked, Signal
from hwt.interfaces.structIntf impor... | Python | 0.000001 | @@ -4070,31 +4070,20 @@
elf.
-createInterfaceForField
+_mkFieldIntf
)%0A%0A
|
7947ed60730d46810e768e6c7baa27f739e8259e | Break up caps-cache.py | tests/twisted/caps/caps-cache.py | tests/twisted/caps/caps-cache.py |
"""
Test that requesting a caps set 1 time is enough with hash and that we need 5
confirmation without hash.
"""
from twisted.words.xish import xpath
from servicetest import EventPattern, assertEquals, assertContains
from gabbletest import exec_test, make_presence
import constants as cs
import ns
from caps_helper im... | Python | 0 | @@ -715,16 +715,266 @@
ms=%7B%7D):%0A
+ h = send_presence(q, conn, stream, contact, caps)%0A%0A if disco:%0A stanza = expect_disco(q, contact, caps)%0A send_disco_reply(stream, stanza, dataforms)%0A%0A expect_caps(q, conn, h)%0A%0Adef send_presence(q, conn, stream, contact, caps):%0A
h =
@... |
4617750140daf87e6e686bce19497a0e4e8bea75 | remove out of context request checking | tests/test_ember_osf_web.py | tests/test_ember_osf_web.py |
import mock
from flask import request
from tests.base import OsfTestCase
from website.ember_osf_web.decorators import ember_flag_is_active
from osf_tests.factories import FlagFactory, UserFactory
from django.contrib.auth.models import Group
class TestEmberFlagIsActive(OsfTestCase):
def setUp(self):
su... | Python | 0.000001 | @@ -1809,44 +1809,8 @@
g')%0A
- assert request.user == user%0A
@@ -2522,57 +2522,8 @@
g')%0A
- assert not request.user.is_authenticated%0A
|
dae16f72b9ca5d96c7f894601aa3a69facbbb00e | Fix memory limit in MongoDB while loading logs (#5) | scripts/load_logs_to_mongodb.py | scripts/load_logs_to_mongodb.py | import os
import sys
from datetime import datetime
from collections import defaultdict
from pymongo import MongoClient
logs_file = open(sys.argv[1])
article_urls = set()
article_views = defaultdict(list) # article_url: list of user's id's
article_times = {}
for line in logs_file:
try:
timestamp, url, user... | Python | 0 | @@ -997,16 +997,53 @@
articles
+%0A# Clear articles%0Aarticles.remove(%7B%7D)
%0A%0Afor ar
@@ -1127,32 +1127,234 @@
continue%0A
+ views = article_views%5Barticle%5B'url'%5D%5D%0A compressed_views = %5B%5D%0A # Save only every 10th view%0A for i in range(len(views)):%0A if i %25 10 == 0:%0A ... |
3375c9cd3311bff8ff3ab07c361e18c68226784c | remove stray print | mc2/controllers/base/managers/rabbitmq.py | mc2/controllers/base/managers/rabbitmq.py | import base64
import hashlib
import random
import time
import uuid
from django.conf import settings
from pyrabbit.api import Client
from pyrabbit.http import HTTPError
class ControllerRabbitMQManager(object):
def __init__(self, controller):
"""
A helper manager to get to connect to RabbitMQ
... | Python | 0.000215 | @@ -581,34 +581,8 @@
ORD)
-%0A print self.client
%0A%0A
|
6a9aceef33230a36b5d98eb1dae68884f57de53a | Remove print in test suite | tests/twisted/test-caps-cache.py | tests/twisted/test-caps-cache.py |
"""
Test that requesting a caps set 1 time is enough with hash and that we need 5
confirmation without hash.
"""
import dbus
import sys
from twisted.words.xish import domish, xpath
from gabbletest import exec_test, make_result_iq
text = 'org.freedesktop.Telepathy.Channel.Type.Text'
sm = 'org.freedesktop.Telepathy.... | Python | 0.000003 | @@ -1605,32 +1605,8 @@
nt)%0A
- print str(presence)%0A
|
2cee1d5bff32831a9c15755e7482057ac7b9a39a | Update packets.py | cs143sim/packets.py | cs143sim/packets.py | """This module contains all packet definitions.
.. autosummary::
Packet
DataPacket
RouterPacket
.. moduleauthor:: Lan Hongjian <lanhongjianlr@gmail.com>
.. moduleauthor:: Yamei Ou <oym111@gmail.com>
.. moduleauthor:: Samuel Richerd <dondiego152@gmail.com>
.. moduleauthor:: Jan Van Bruggen <jancvanbruggen... | Python | 0.000001 | @@ -2350,16 +2350,40 @@
r_table%0A
+ self.number = 0%0A
|
d043e50a636ffa06f3383a81c37eb8947f4f8fa1 | Implement a method to switch a pair of engine and partition simultaneously | modin/__init__.py | modin/__init__.py | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | Python | 0 | @@ -3738,11 +3738,23 @@
def
+_
put
+_nocallback
(sel
@@ -3866,24 +3866,91 @@
alue, value%0A
+ return oldvalue%0A%0A def _check_callbacks(self, oldvalue):%0A
if o
@@ -3957,19 +3957,26 @@
ldvalue
-!
+=
=
+self.__
value:%0A
@@ -3970,32 +3970,47 @@
lf.__value:%0A
+ return%0A
... |
0c35c0f7fe126b87eccdf4f69933b84927956658 | Fix account __type__ | module/plugins/accounts/XFileSharingPro.py | module/plugins/accounts/XFileSharingPro.py | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.XFSPAccount import XFSPAccount
class XFileSharingPro(XFSPAccount):
__name__ = "XFileSharingPro"
__type__ = "crypter"
__version__ = "0.01"
__description__ = """XFileSharingPro dummy account plugin for hook"""
__license__ = "GPLv3"
... | Python | 0 | @@ -180,15 +180,15 @@
= %22
-crypter
+account
%22%0A
@@ -207,17 +207,17 @@
_ = %220.0
-1
+2
%22%0A%0A _
@@ -256,13 +256,21 @@
Pro
-dummy
+multi-purpose
acc
@@ -284,17 +284,8 @@
ugin
- for hook
%22%22%22%0A
|
a396d3e7b4de10710c2f2e0beab0ef82acaf866b | Create first test | web/impact/impact/tests/test_track_api_calls.py | web/impact/impact/tests/test_track_api_calls.py | from django.test import (
RequestFactory,
TestCase,
)
from mock import patch
class TestTrackAPICalls(TestCase):
def test_when_user_auth(self):
pass
def test_when_no_user_auth(self):
pass
| Python | 0 | @@ -23,28 +23,8 @@
t (%0A
- RequestFactory,%0A
@@ -56,16 +56,22 @@
port
+ mock,
patch%0A%0A
%0Acla
@@ -66,16 +66,68 @@
patch%0A%0A
+from impact.tests.api_test_case import APITestCase%0A%0A
%0Aclass T
@@ -143,16 +143,19 @@
PICalls(
+API
TestCase
@@ -165,51 +165,306 @@
-def test_when_user_auth(se... |
200e75471f9c49d64cfa558ceed267b77a0b5627 | Replace cumulative product with exponentiation. | cupy/_creation/matrix.py | cupy/_creation/matrix.py | import numpy
import cupy
from cupy import _core
def diag(v, k=0):
"""Returns a diagonal or a diagonal array.
Args:
v (array-like): Array or array-like object.
k (int): Index of diagonals. Zero indicates the main diagonal, a
positive value an upper diagonal, and a negative value a... | Python | 0.999999 | @@ -4479,141 +4479,60 @@
-if N %3E 0:%0A tmp%5B:, 0%5D = 1%0A if N %3E 1:%0A tmp%5B:, 1:%5D = x%5B:, None%5D%0A cupy.cumprod(tmp%5B:, 1:%5D, out=tmp%5B:, 1:%5D, axis=1
+cupy.power(x.reshape(-1, 1), cupy.arange(N), out=tmp
)%0A%0A
|
1fc456f00d9895358ee52e967edfdfc2512315d0 | Update stackexchange.py | data_loaders/stackexchange.py | data_loaders/stackexchange.py | #
# stackexchange.py
# Mich, 2015-03-12
# Copyright (c) 2015 Datacratic Inc. All rights reserved.
#
import requests
import json
from datetime import datetime
def load_data(mldb, payload):
mldb.log("StackExchange data loader")
payload = json.loads(payload)
assert payload['site'], mldb.log("payload: site i... | Python | 0.000001 | @@ -708,16 +708,17 @@
:///
-var/
mldb
+_data
/' +
|
55333de064cf81ee08d957f059bdd06641d50456 | Document LocationT | transperth/location.py | transperth/location.py | import re
from lxml import etree
from collections import namedtuple
import requests
from . import BASE
from .utils import format_date, clean
from .exceptions import InvalidStopNumber, InvalidDirection
STOPNUM_RE = re.compile(r'\d{5}')
__all__ = [
'determine_location',
'Location',
'parse_locations',
... | Python | 0.000001 | @@ -333,57 +333,8 @@
%0A%5D%0A%0A
-LocationT = namedtuple('LocationT', 'name,code')%0A
%0Ais_
@@ -1823,16 +1823,151 @@
%0A %7D%0A%0A
+class LocationT(namedtuple('LocationT', 'name,code')):%0A %22%22%22%0A Represents a location as considered by the transperth api%0A %22%22%22%0A%0A%0A
%0Aclass L
|
41e2fa118efc65a120af461e636c9ebe7e945ba4 | Store original text in LogLine named tuples. | magichour/api/local/modelgen/preprocess.py | magichour/api/local/modelgen/preprocess.py | """
This module contains functions for the initial preprocessing of log files. The functions here are responsible
for reading in data and converting them into LogLine named tuples. (see named tuple definition in
magichour.api.local.util.namedtuples). Transforms named tuples represent a preprocessing step that .
TODO: ... | Python | 0.000001 | @@ -6150,20 +6150,28 @@
formed,
-None
+logline.text
, replac
|
92e2d5530915a60e4fa4f256787301d156cfd05d | Replace 'assertFalse(a in b)' with 'assertNotIn(a, b)' | tests/unit/core/test_test_set.py | tests/unit/core/test_test_set.py | # -*- coding:utf-8 -*-
#
# Copyright (c) 2016 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | Python | 0.999999 | @@ -6220,37 +6220,37 @@
self.assert
-False
+NotIn
('Import' in bla
@@ -6242,19 +6242,17 @@
'Import'
- in
+,
blackli
@@ -6286,13 +6286,13 @@
sert
-False
+NotIn
('Im
@@ -6300,19 +6300,17 @@
ortFrom'
- in
+,
blackli
|
2152a52f9e3bd2a1924fd76399fca2127c1961a9 | Enable HTTPS option for social auth | tola/settings/local.py | tola/settings/local.py | from base import *
import os
from os.path import join, normpath
try:
DATABASES = {
'default': {
'ENGINE': os.environ["TOLA_DB_ENGINE"],
'NAME': os.environ["TOLA_DB_NAME"],
'USER': os.environ["TOLA_DB_USER"],
'PASSWORD': os.environ["TOLA_DB_PASS"],
... | Python | 0.000003 | @@ -1559,16 +1559,121 @@
RET = ''
+%0A%0ASOCIAL_AUTH_REDIRECT_IS_HTTPS = True if os.getenv('SOCIAL_AUTH_REDIRECT_IS_HTTPS') == 'True' else False
%0ASOCIAL_
|
9e577694d2f8665599d590299e58355dd7472011 | Fix less | cupy/logic/comparison.py | cupy/logic/comparison.py | from cupy.logic import ufunc
def allclose(a, b, rtol=1e-05, atol=1e-08):
# TODO(beam2d): Implement it
raise NotImplementedError
def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False, allocator=None):
# TODO(beam2d): Implement it
raise NotImplementedError
def array_equal(a1, a2):
# TODO(bea... | Python | 0.000092 | @@ -817,16 +817,17 @@
ss', '%3C'
+,
%0A '''
|
244f3262989b0331a120eb546ca22c9bea9194e4 | add DownloadDelta to the admin | crate_project/apps/packages/admin.py | crate_project/apps/packages/admin.py | from django.contrib import admin
from packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI
from packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI, ChangeLog
from packages.models import ReadTheDocsPackageSlug
class PackageURIAdmin(admin.TabularInline):
... | Python | 0 | @@ -240,16 +240,31 @@
s import
+ DownloadDelta,
ReadThe
@@ -1968,24 +1968,242 @@
release%22%5D%0A%0A%0A
+class DownloadDeltaAdmin(admin.ModelAdmin):%0A list_display = %5B%22file%22, %22date%22, %22delta%22%5D%0A list_filter = %5B%22date%22%5D%0A search_fields = %5B%22file__release__package__name%22, %22fil... |
4c703480fe395ddef5faa6d388a472b7053f26af | Add debug command line option. | jskom/__main__.py | jskom/__main__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import asyncio
import logging
from hypercorn.asyncio import serve
from hypercorn.config import Config
from jskom import app, init_app
log = logging.getLogger("jskom.main")
def run(host, port):
# use 127.0.0.1 instead of localhost to avoid delays re... | Python | 0 | @@ -640,13 +640,12 @@
ing.
-DEBUG
+INFO
)%0A%0A
@@ -700,16 +700,133 @@
'Jskom')
+%0A parser.add_argument(%0A '--debug', help='Enable debug logging',%0A default=False, action='store_true')
%0A%0A #
@@ -979,16 +979,25 @@
rgument(
+%0A
'--host'
@@ -1034,32 +1034,16 @@
en on',%0A
- ... |
cdcc807ecd7126f533bbc01721276d62a4a72732 | fix all_docs dbs to work after flip | corehq/couchapps/__init__.py | corehq/couchapps/__init__.py | from corehq.preindex import CouchAppsPreindexPlugin
from django.conf import settings
CouchAppsPreindexPlugin.register('couchapps', __file__, {
'form_question_schema': 'meta',
'users_extra': (settings.USERS_GROUPS_DB, settings.NEW_USERS_GROUPS_DB),
'noneulized_users': (settings.USERS_GROUPS_DB, settings.NEW... | Python | 0 | @@ -353,32 +353,12 @@
': (
-settings.USERS_GROUPS_DB
+None
, se
|
39f26d6bb46eeb96c54881ab9c0147051328b8e8 | fix another misuse of the 1.0 DB API. | trac/tests/env.py | trac/tests/env.py | from __future__ import with_statement
from trac import db_default
from trac.core import ComponentManager
from trac.env import Environment
import os.path
import unittest
import tempfile
import shutil
class EnvironmentCreatedWithoutData(Environment):
def __init__(self, path, create=False, options=[]):
Comp... | Python | 0.000005 | @@ -810,69 +810,8 @@
f):%0A
- with self.env.db_query as db:%0A db.close()%0A
@@ -1272,69 +1272,8 @@
f):%0A
- with self.env.db_query as db:%0A db.close()%0A
|
a27e667dedeaaa0aefadc3328149f311bb277c45 | Update bottlespin.py | bottlespin/bottlespin.py | bottlespin/bottlespin.py | import discord
from discord.ext import commands
from random import choice
class Bottlespin:
"""Spins a bottle and lands on a random user."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True, alias=["bottlespin"])
async def spin(self, ctx, role):
... | Python | 0 | @@ -334,24 +334,62 @@
bottle%22%22%22%0A%0A
+ await self.bot.say(str(role))%0A
role
@@ -431,32 +431,41 @@
-role = discord.Role.name
+await self.bot.say(str(roles%5B1%5D))
%0A
|
7a25ace4851da30a252842b5d5e3a7efee90ce00 | Raise error when /boundaries/set-slug URL points to a nonexistent set | boundaryservice/views.py | boundaryservice/views.py | from django.contrib.gis.db import models
from django.http import Http404
from boundaryservice.base_views import (ModelListView, ModelDetailView,
ModelGeoListView, ModelGeoDetailView)
from boundaryservice.models import BoundarySet, Boundary
class BoundarySetListView(ModelListVie... | Python | 0 | @@ -2157,16 +2157,117 @@
t_slug:%0A
+ if not BoundarySet.objects.filter(slug=set_slug).exists():%0A raise Http404%0A
|
c63463ff040f79c605d6c0414261527dda3ed00a | Switch to new babel version in require test. | tests/test_jsinterpreter.py | tests/test_jsinterpreter.py | import unittest
from dukpy._dukpy import JSRuntimeError
import dukpy
from diffreport import report_diff
class TestJSInterpreter(unittest.TestCase):
def test_interpreter_keeps_context(self):
interpreter = dukpy.JSInterpreter()
ans = interpreter.evaljs("var o = {'value': 5}; o")
assert ans... | Python | 0 | @@ -915,10 +915,10 @@
l-6.
-14
+26
.0.m
|
18fb4c40d4460edf437aabfe7b88afa2905972f6 | fix test docstring + pyflakes | mne/tests/test_source_estimate.py | mne/tests/test_source_estimate.py | import os.path as op
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from ..datasets import sample
from .. import stats
from .. import read_stc, write_stc, read_w, write_w, SourceEstimate, morph_data
from ..source_estimate import spatio_tem... | Python | 0.000001 | @@ -232,25 +232,8 @@
stc,
- read_w, write_w,
Sou
@@ -1823,17 +1823,16 @@
a /=
-
2 * a%0A
@@ -2655,32 +2655,47 @@
ral connectivity
+ from triangles
%22%22%22%0A tris = n
@@ -3104,16 +3104,36 @@
ectivity
+ from source spaaces
%22%22%22%0A
|
3681ada3917d5811e1e959270e1df0edea7ebf55 | Update __init__.py | mapclientplugins/smoothfitstep/__init__.py | mapclientplugins/smoothfitstep/__init__.py |
'''
MAP Client Plugin
'''
__version__ = '0.1.0'
__author__ = 'Richard Christie'
__stepname__ = 'smoothfit'
__location__ = ''
# import class that derives itself from the step mountpoint.
from mapclientplugins.smoothfitstep import step
# Import the resource file when the module is loaded,
# this enables... | Python | 0.000072 | @@ -377,8 +377,10 @@
urces_rc
+%0D%0A
|
379d2df1041605d3c8a21d543f9955601ee07558 | Add threading to syncer | imageledger/management/commands/syncer.py | imageledger/management/commands/syncer.py | from collections import namedtuple
import itertools
import logging
from elasticsearch import helpers
from django.core.management.base import BaseCommand, CommandError
from django.db import connection, transaction
from imageledger import models, search
console = logging.StreamHandler()
log = logging.getLogger(__name_... | Python | 0.000001 | @@ -59,16 +59,69 @@
logging
+%0Afrom multiprocessing.dummy import Pool as ThreadPool
%0A%0Afrom e
@@ -301,16 +301,17 @@
search%0A%0A
+%0A
console
@@ -1762,20 +1762,17 @@
rations=
-1000
+5
):%0A
@@ -1851,64 +1851,433 @@
-count = 0%0A while count %3C num_iterations:%0A
+pool = ThreadPool... |
33b7e9371305c4171594c21c154cd5724ea013cb | allow segment and overlap be specified as a parameter | scripts/nanopolish_makerange.py | scripts/nanopolish_makerange.py | import sys
from Bio import SeqIO
recs = [ (rec.name, len(rec.seq)) for rec in SeqIO.parse(open(sys.argv[1]), "fasta")]
SEGMENT_LENGTH = 50000
OVERLAP_LENGTH = 200
for name, length in recs:
n_segments = (length / SEGMENT_LENGTH) + 1
for n in xrange(0, length, SEGMENT_LENGTH):
if ( n + SEGMENT_LENGTH)... | Python | 0 | @@ -4,16 +4,32 @@
ort sys%0A
+import argparse%0A
from Bio
@@ -43,16 +43,386 @@
SeqIO%0A%0A
+parser = argparse.ArgumentParser(description='Partition a genome into a set of overlapping segments')%0Aparser.add_argument('--segment-length', type=int, default=50000)%0Aparser.add_argument('--overlap-length', type=int, def... |
0d474b3945c1b98d897c57184ff1b7a33f6c9a3d | add caucasus to eu tourism chart | dataviz/eutourism.py | dataviz/eutourism.py | import sys
sys.path.append('..')
from charts import *
atlas = pd.read_csv("datasets/countries.csv").split_columns('country', "|").split_rows('country').set_index('country')
df = pd.read_csv("datasets/eutourism.csv").set_index("Destination").select(lambda c: atlas.continent[c] == "Europe")
df = df.fillna({'2015': df['... | Python | 0 | @@ -283,16 +283,61 @@
%22Europe%22
+ or c in %5B%22Georgia%22, %22Azerbaijan%22, %22Armenia%22%5D
)%0Adf = d
|
9061c071981c1123df60963dcfa83663d4495223 | Remove thumbnail testing workarounds. | coverart_redirect/request.py | coverart_redirect/request.py | # Copyright (C) 2011 Lukas Lalinsky
# Copyright (C) 2011 Robert Kaye
# Distributed under the MIT license, see the LICENSE file for details.
import re
import os
import sys
import coverart_redirect
from coverart_redirect.utils import statuscode
from wsgiref.util import shift_path_info, request_uri
# FIXME: fix http sta... | Python | 0 | @@ -3040,451 +3040,8 @@
%22%5D%0A%0A
- # ------------------------------------------------------------------------------------------------%0A # Remove me for deploying this service for real. This code is for testing only!%0A # ------------------------------------------------------------------------... |
105a413b18456f9a505dd1ed4bf515987b4792d2 | add --force option to management command to force all files to be pushed | mediasync/management/commands/syncmedia.py | mediasync/management/commands/syncmedia.py | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import mediasync
class Command(BaseCommand):
help = "Sync local media with S3"
args = '[options]'
requires_model_validation = False
option_list = BaseCommand.option_list + (
make_op... | Python | 0 | @@ -320,17 +320,17 @@
ption(%22-
-f
+F
%22, %22--fo
|
47322c47197ce5f0300ed8efd9333e19fa8d45fd | Set initial user | tracker/models.py | tracker/models.py | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from django.dispatch.dispatcher import receiver
from django.db.models.signals import post_save, pre_save
from django.core.mail import EmailMultiAlternatives, EmailMessage, ... | Python | 0.000001 | @@ -580,32 +580,37 @@
er', %0A%09%09default=
+1)%0A%09#
User.objects.fil
@@ -1877,24 +1877,27 @@
ainer',
+%0A%09%09
default=
User.obj
@@ -1888,16 +1888,22 @@
default=
+1,%0A%09%09#
User.obj
@@ -1939,16 +1939,19 @@
%5B0%5D.id,
+%0A%09%09
blank=Tr
|
a8f7507d34ab4f2cbefeadc64ccf88fb90696966 | Kill speedups, not available on Ubuntu. | convert.py | convert.py | # Convert NYC building footprints and addresses into importable OSM files.
from fiona import collection
from lxml import etree
from lxml.etree import tostring
from rtree import index
from shapely.geometry import asShape
from shapely import speedups
from sys import argv
from glob import glob
import re
from pprint import... | Python | 0 | @@ -326,27 +326,8 @@
nt%0A%0A
-speedups.enable()%0A%0A
# Co
|
0be6bddf8c92c461af57e7c61c2378c817fb0143 | Make oppetarkiv work with --all-episodes again | lib/svtplay_dl/service/oppetarkiv.py | lib/svtplay_dl/service/oppetarkiv.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import re
from svtplay_dl.service.svtplay import Svtplay
from svtplay_dl.log import log
class OppetArkiv(Svtplay):
supported_domains = ['oppetarkiv.se']
def find_all_episodes(self, ... | Python | 0 | @@ -693,28 +693,8 @@
(1)%0A
- more = True%0A
@@ -711,16 +711,16 @@
es = %5B%5D%0A
+
%0A
@@ -856,19 +856,19 @@
while
-mor
+Tru
e:%0A
@@ -1028,13 +1028,8 @@
url)
-.text
%0A
@@ -1041,111 +1041,87 @@
-visa = re.search(r'svtXColorDarkLightGrey', data)%0A if not visa:%0A... |
478c2ffc09fb189c4f36ccb82aad945b3db5f9b3 | Fix secondaryFiles v1.1 updater (#1131) | cwltool/update.py | cwltool/update.py | from __future__ import absolute_import
import copy
import re
from typing import (Any, Callable, Dict, MutableMapping, MutableSequence,
Optional, Tuple, Union)
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from schema_salad import validate
from schema_salad.ref_resolver import Loader ... | Python | 0 | @@ -1864,34 +1864,109 @@
rn %5B
-%7B%22pattern%22: p%7D for p in t%5D
+update_secondaryFiles(p) for p in t%5D%0A elif isinstance(t, MutableMapping):%0A return t
%0A
|
a52b4097dfcb9fea26af0bc994426baecb97efc1 | update image if streetview url | croplands_api/views/api/locations.py | croplands_api/views/api/locations.py | from croplands_api import api
from croplands_api.models import Location
from processors import api_roles, add_user_to_posted_data, remove_relations, debug_post
from records import save_record_state_to_history
from croplands_api.tasks.records import get_ndvi
def process_records(result=None, **kwargs):
"""
This... | Python | 0.000005 | @@ -225,38 +225,81 @@
api.
-tasks.records import get_ndvi%0A
+utils.s3 import upload_image%0Aimport requests%0Aimport uuid%0Aimport cStringIO
%0A%0Ade
@@ -927,16 +927,496 @@
tos'%5D%0A%0A%0A
+def check_for_street_view_image(data=None, **kwargs):%0A if 'images' not in data:%0A return%0A%0A for image in d... |
1d305388fd1c673096e327ea2c0259b955d64156 | Update test_step_7.py | pySDC/tests/test_tutorials/test_step_7.py | pySDC/tests/test_tutorials/test_step_7.py | import os
import subprocess
import pytest
from pySDC.tutorial.step_7.B_pySDC_with_mpi4pyfft import main as main_B
@pytest.mark.fenics
def test_A():
from pySDC.tutorial.step_7.A_pySDC_with_FEniCS import main as main_A
main_A()
@pytest.mark.parallel
def test_B():
main_B()
@pytest.mark.parallel
def test_... | Python | 0.000014 | @@ -228,24 +228,25 @@
main_A()%0A%0A
+%0A
@pytest.mark
@@ -283,16 +283,17 @@
in_B()%0A%0A
+%0A
@pytest.
|
928d498b5f67970f9ec75d62068e8cbec0fdc352 | Update python3, flake8 | ni_scanner.py | ni_scanner.py | from ConfigParser import SafeConfigParser
from utils.cli import CLI
from api.queue import Queue
from api.nerds import NerdsApi
from scanner.host import HostScanner
from scanner.exceptions import ScannerExeption
from utils.url import url_concat
import logging
FORMAT = '%(name)s - %(levelname)s - %(message)s'
logging.ba... | Python | 0.000004 | @@ -381,17 +381,16 @@
ner')%0A%0A%0A
-%0A
def proc
@@ -475,17 +475,16 @@
try:
-
%0A
@@ -550,17 +550,16 @@
er(item)
-
%0A
@@ -704,10 +704,13 @@
tem
-%22+
+%25s%22,
str(
@@ -958,16 +958,17 @@
or(%22%25s%22,
+
e)%0A
@@ -979,32 +979,33 @@
failed(queue,
+
item)%0A ex
@@ -10... |
720c8a36cfff3270ae54e8c91c18d8ef4fb1c330 | Remove no longer needed empty .jslib output workaround. | build_defs/internal_do_not_use/j2cl_java_library.bzl | build_defs/internal_do_not_use/j2cl_java_library.bzl | """Common utilities for creating J2CL targets and providers."""
load(":j2cl_transpile.bzl", "J2CL_TRANSPILE_ATTRS", "j2cl_transpile")
load(":j2cl_js_common.bzl", "J2CL_JS_ATTRS", "JS_PROVIDER_NAME", "j2cl_js_provider")
# Constructor for the Bazel provider for J2CL.
_J2clInfo = provider(fields = ["_J2clJavaInfo"])
Lib... | Python | 0 | @@ -1180,138 +1180,8 @@
s)%0A%0A
- # Write an empty .jslib output (work around b/38349075 and maybe others).%0A ctx.actions.write(ctx.outputs.dummy_jslib, %22%22)%0A%0A
@@ -1306,33 +1306,8 @@
.jar
-, ctx.outputs.dummy_jslib
%5D),%0A
@@ -4783,48 +4783,8 @@
p%22,%0A
- %22dummy_jslib%22: %22%25%7Bna... |
c2b6210f7a6a2ed5fe3dcad4495161008d8cf399 | Remove duplicate like | meetup_facebook_bot/messenger/messaging.py | meetup_facebook_bot/messenger/messaging.py | # -*- coding: utf-8 -*-
import json
import requests
def send_rate_menu(access_token, user_id, talk, db_session):
""" Makes use of Quick Replies:
https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies
"""
if talk.is_liked_by(user_id, db_session):
rate_but... | Python | 0.00009 | @@ -1095,13 +1095,8 @@
%D1%80%D0%B0%D0%BB
-%D0%BB%D0%B0%D0%B9%D0%BA
%D0%BB%D0%B0%D0%B9%D0%BA
|
496007543f941bb3ca46c011383f2673b9362e47 | Bump development version | debreach/__init__.py | debreach/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '1.4.0'
version_info = version.StrictVersion(__version__).version
default_app_config = 'debreach.apps.DebreachConfig'
| Python | 0 | @@ -113,9 +113,9 @@
1.4.
-0
+1
'%0Ave
|
e10ec71a57f8e0287335da3a82260e1fc8086963 | Remove unnecessary pass statement (#1481) | thumbor/storages/file_storage.py | thumbor/storages/file_storage.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import hashlib
import os
from datetime import datetime
from json imp... | Python | 0.000099 | @@ -1978,29 +1978,8 @@
key%0A
- pass%0A
|
9cc88d9162f35cf0f8828ded5566f52f3bd506bd | Fix #387: fix deluge JSON queries | modules/deluge.py | modules/deluge.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import traceback
import sys
import os
import cherrypy
import htpc
import urllib2
import gzip
import socket
from json import loads, dumps
import logging
import cookielib
from StringIO import StringIO
from cherrypy.lib.auth2 import require
class Deluge:
cookieJar = coo... | Python | 0 | @@ -4372,24 +4372,125 @@
dumps(data)%0A
+ req = urllib2.Request(url, data=post_data, headers=%7B'Content-Type': 'application/json'%7D)%0A
@@ -4504,17 +4504,16 @@
tringIO(
-
self.ope
@@ -4525,23 +4525,21 @@
pen(
-url, post_data,
+req, timeout=
1).r
|
31d6ce09382035458eca2a310f99cb3c958ea604 | Use main template environment for rendering document content | nib/render.py | nib/render.py | import jinja2
from jinja2 import Environment, FileSystemLoader, Template
from os import path
import time
jinja_filters = {}
def jinja(name):
def decorator(f):
jinja_filters[name] = f
return f
return decorator
class Render(object):
def __init__(self, options, documents):
self.optio... | Python | 0 | @@ -893,32 +893,44 @@
ent.short =
-Template
+self.env.from_string
(document.sh
@@ -978,24 +978,36 @@
ntent =
-Template
+self.env.from_string
(documen
|
00ed3465351f3f99b736904baecc530c03cbc91b | test flac to flac conversion | unmollom/tests/test_speech_recognition.py | unmollom/tests/test_speech_recognition.py | # -*- coding: utf-8 -*-
__author__ = 'Flurin Rindisbacher'
import unittest
import os
import json
import uuid
from .. import speech_recognition
from ..exceptions import RecognitionException, CommunicationException
def server_response_stub(success_answer=True,response_text=''):
""" a stub for injecting our own ser... | Python | 0.000001 | @@ -3682,17 +3682,16 @@
rs%5Bh%5D)%0A%0A
-%0A
def
@@ -3705,16 +3705,31 @@
nversion
+_no_conv_needed
(self):%0A
@@ -3740,12 +3740,219 @@
-pass
+cls = speech_recognition.GoogleSpeechRecognition()%0A flac = open(self.input_flac, 'rb').read()%0A converted = cls.convert_to_flac(self.input_flac, ... |
5ba7f7b0df17f95538c24b56c1c7f4a8a650bd16 | Write str(eq) instead of srepr(eq) | transmute_expr.py | transmute_expr.py | import re
import json
import sympy
from sympy.codegen.ast import Assignment, CodeBlock
with open('transmute_data.json') as f:
DATA = json.load(f)
t= sympy.symbols('t')
# G = 1
# phi = sympy.MatrixSymbol('phi', G, 1)
phi = sympy.symbols('phi')
decay_rxs = ['bminus', 'bplus', 'ec', 'alpha', 'it', 'sf', 'bminus_n'... | Python | 0.99951 | @@ -3038,17 +3038,9 @@
te(s
-ympy.srep
+t
r(eq
|
00eea597cc43cb379bf8eca29be2ebe832dcb0f2 | remove unused FileDecoder super-class in LiveDecoder | timeside/plugins/decoder/live.py | timeside/plugins/decoder/live.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2007-2013 Parisson
# Copyright (c) 2007 Olivier Guilyardi <olivier@samalyse.com>
# Copyright (c) 2007-2013 Guillaume Pellerin <pellerin@parisson.com>
# Copyright (c) 2010-2013 Paul Brossier <piem@piem.org>
#
# This file is part of TimeSide.
# This program is f... | Python | 0 | @@ -1251,16 +1251,17 @@
ib, Gst%0A
+#
from tim
@@ -1610,16 +1610,18 @@
eDecoder
+:#
(FileDec
|
8a03a3fbcfdb22dc21e5539462a2b235e744abba | change open/close to with | output.py | output.py | def summarizeECG(instHR, avgHR, brady, tachy):
"""Create txt file summarizing ECG analysis
:param instHR: (int)
:param avgHR: (int)
:param brady: (int)
:param tachy: (int)
"""
#Calls hrdetector() to get instantaneous heart rate
#instHR = findInstHR()
#Calls findAvgHR() to get avera... | Python | 0 | @@ -623,20 +623,12 @@
-ecgResults =
+with
ope
@@ -649,17 +649,36 @@
xt','w')
-%0A
+ as ecgResults:%0A
inst
@@ -744,16 +744,20 @@
HR)%0A
+
+
avgHRstr
@@ -803,24 +803,28 @@
str(avgHR)%0A
+
bradystr
@@ -869,16 +869,20 @@
(brady)%0A
+
tach
@@ -932,16 +932,20 @@
tachy)%0A%0A... |
91613b0f2c5d393312b5bae60e71fce783097c2d | Move ptpos_to_wn() to lelesk | coolisf/common.py | coolisf/common.py | # -*- coding: utf-8 -*-
'''
Common functions
Latest version can be found at https://github.com/letuananh/intsem.fx
References:
ACE:
http://moin.delph-in.net/AceOptions
@author: Le Tuan Anh <tuananh.ke@gmail.com>
@license: MIT
'''
# Copyright (c) 2015, Le Tuan Anh <tuananh.ke@gmail.com>
#
# Permission i... | Python | 0.00001 | @@ -1500,16 +1500,52 @@
eHelper%0A
+from lelesk.util import ptpos_to_wn%0A
%0A%0A# ----
@@ -3394,1680 +3394,8 @@
t%0A%0A%0A
-def ptpos_to_wn(ptpos):%0A ''' Penn Treebank Project POS to WN '''%0A # Ref: http://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html%0A # CC Coordinating conjunctio... |
b0a1f10d60abc6c9fc7751e3bae492976d3f3306 | Update version 1.0.0.dev3 -> 1.0.0.dev4 | dimod/package_info.py | dimod/package_info.py | __version__ = '1.0.0.dev3'
__author__ = 'D-Wave Systems Inc.'
__authoremail__ = 'acondello@dwavesys.com'
__description__ = 'A shared API for binary quadratic model samplers.'
| Python | 0.000001 | @@ -21,9 +21,9 @@
.dev
-3
+4
'%0A__
|
eccc07a4639e1da98c09689295964e0f15c8068c | Add fix author functionality | dasem/runeberg.py | dasem/runeberg.py | """runeberg.
Usage:
dasem.runeberg download-catalogue
dasem.runeberg catalogue-as-csv
Description
-----------
Runeberg is a digital library with primarily Nordic texts. It is available from
http://runeberg.org/
"""
from __future__ import absolute_import, division, print_function
from os.path import join
from... | Python | 0.000001 | @@ -952,16 +952,20 @@
%0A if
+len(
author_p
@@ -968,16 +968,17 @@
or_parts
+)
== 2:%0A
@@ -1740,32 +1740,49 @@
f catalogue(self
+, fix_author=True
):%0A %22%22%22Re
@@ -1928,16 +1928,166 @@
rmation.
+%0A fix_author : bool, optional%0A Determine if author names should be rearranged ... |
6ab60cc808bed0ae9cc98f3cf0c5b139e394b67c | Raise VM images exceptions appropriately | test/common/vmimages.py | test/common/vmimages.py | # -*- coding: utf-8 -*-
# This file is part of Cockpit.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# Cockpit is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your... | Python | 0 | @@ -2440,16 +2440,26 @@
raise
+ Exception
(%22curl:
@@ -2570,16 +2570,26 @@
raise
+ Exception
(%22unxz:
@@ -5017,12 +5017,14 @@
-Ba
+rai
se
+
Exce
|
034fa60d73468df21b6f75eb7a8130ab9a40cbae | Fix #3225 | module/plugins/hoster/FilerNet.py | module/plugins/hoster/FilerNet.py | # -*- coding: utf-8 -*-
import os
import re
from ..captcha.ReCaptcha import ReCaptcha
from ..internal.SimpleHoster import SimpleHoster
class FilerNet(SimpleHoster):
__name__ = "FilerNet"
__type__ = "hoster"
__version__ = "0.27"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?filer\.ne... | Python | 0 | @@ -238,9 +238,9 @@
%220.2
-7
+8
%22%0A
@@ -1345,29 +1345,16 @@
ml_form(
-%0A
input_na
@@ -1401,16 +1401,34 @@
if
+inputs is None or
'token'
@@ -1463,41 +1463,14 @@
elf.
-error(_(%22Unable to detect token%22)
+retry(
)%0A%0A
@@ -1637,16 +1637,34 @@
if
+inputs is None or
'hash' n
... |
5514b8345e575732985643c70b01c220a80b9a0b | Set a custom timeout for the elastic search indexer. (#51) | indexer_util/indexer_util/indexer_util.py | indexer_util/indexer_util/indexer_util.py | """Utilities for Data Explorer indexers"""
import jsmin
import json
import logging
import os
import time
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import ConnectionError
from elasticsearch.helpers import bulk
# Log to stderr.
logging.basicConfig(
level=logging.INFO,
format='%(asct... | Python | 0 | @@ -3889,16 +3889,108 @@
%7D)%0A%0A
+ # For writing large amounts of data, the default timeout of 10s is sometimes not enough%0A
bulk
@@ -4016,10 +4016,30 @@
s_by_id)
+, request_timeout=60
)%0A
|
518443854f7ef4466885d88cf7b379c626692da1 | Add PlannedBudgetLimits to Budgets::Budget BudgetData | troposphere/budgets.py | troposphere/budgets.py | # Copyright (c) 2012-2018, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean
class Spend(AWSProperty):
props = {
'Amount': (float, True),
'Unit': (basestring, True),
}
class CostTypes(... | Python | 0.000006 | @@ -21,9 +21,9 @@
-201
-8
+9
, Ma
@@ -108,16 +108,112 @@
icense.%0A
+#%0A# *** Do not modify - this file is autogenerated ***%0A# Resource specification version: 8.0.0%0A%0A
%0Afrom .
@@ -228,17 +228,30 @@
WSObject
-,
+%0Afrom . import
AWSProp
@@ -291,124 +291,38 @@
ean%0A
-%0A%0Aclass Spend(AWSProperty):%0A ... |
f612fafa3e4d7352b64d993390fb074686fe46b7 | Update slack post format | chainer/ya/utils/slack.py | chainer/ya/utils/slack.py | import os
import requests
import json
from chainer.training import extension
class SlackPost(extension.Extension):
def __init__(self, token, channel, **kwargs):
self.token = token
self.channel = channel
self.priority = 50
def initialize(self, trainer):
try:
plot_r... | Python | 0 | @@ -1,12 +1,24 @@
+import json%0A
import os%0Aim
@@ -15,16 +15,17 @@
port os%0A
+%0A
import r
@@ -32,28 +32,16 @@
equests%0A
-import json%0A
from cha
@@ -111,17 +111,16 @@
nsion):%0A
-%0A
def
@@ -681,16 +681,33 @@
args = %5B
+%0A
%22%7B%7D:%5Ct%7B%7D
@@ -717,16 +717,17 @@
ormat(k,
+
get... |
48412195e020c7f2a549deb869d98f6a366d9552 | improve workflow conversion | cwlupgrader/main.py | cwlupgrader/main.py | #!/usr/bin/env python
from __future__ import print_function
import ruamel.yaml
from typing import Any, Dict, Union
from collections import Mapping, MutableMapping, Sequence
import sys
import copy
def main(): # type: () -> int
for path in sys.argv[1:]:
with open(path) as entry:
document = ruam... | Python | 0.000002 | @@ -962,16 +962,55 @@
kflow%22:%0A
+ inputOutputClean(document)%0A
@@ -1082,33 +1082,37 @@
urce%22%5D = out
-%5B
+.pop(
%22source%22
%5D%0A
@@ -1103,43 +1103,157 @@
rce%22
-%5D%0A del out%5B%22source
+).lstrip('#')%0A for step in document%5B%22steps%22%5D:%0... |
ba84f4a1b11f486d211254721397be43f8c9b07a | update __manifest__.py | tko_coexiste_coa/__manifest__.py | tko_coexiste_coa/__manifest__.py | # -*- coding: utf-8 -*-
# © 2017 TKO <http://tko.tko-br.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Plano de Contas Brasileiro',
'summary': '',
'description': 'Plano de contas brasileiro adaptável a qualquer segmento.',
'author': 'TKO',
'category': 'l10n_br',
... | Python | 0.000059 | @@ -755,24 +755,66 @@
'data': %5B%0A
+ 'data/chart_data_properties.xml',%0A
'dat
@@ -881,49 +881,8 @@
v',%0A
- 'data/chart_data_properties.xml',
%0A
|
febb2e9369a706d7319d89851cac3dc9a1fd167e | add source of kyoko image | tsundiary/jinja_env.py | tsundiary/jinja_env.py | from tsundiary import app
app.jinja_env.globals.update(theme_nicename = {
'classic': 'Classic Orange',
'minimal': 'Minimal Black/Grey',
'misato-tachibana': 'Misato Tachibana',
'rei-ayanami': 'Rei Ayanami',
'saya': 'Saya',
'yuno': 'Yuno Gasai',
'kyoko-sakura': 'Kyoko Sakura',
'colorful':... | Python | 0 | @@ -838,46 +838,93 @@
a':
-%22An artist drew this Kyoko, I'm
+'%3Ca href=%22http://3071527.deviantart.com/art/kyoko-sakura-376238110%22%3EKyoko
s
+o
ur
-e.%22
+ce%3C/a%3E'
%0A%7D)%0A
|
fb9e2ec66f2c80b60ae565665f091b0ee47843a9 | Remove six lib from install script | docs/scripts/install.py | docs/scripts/install.py | #!/usr/bin/env python
'''
File name: install.py
Author: Tim Anema
Date created: Sep 29, 2016
Date last modified: Nov 19 2020
Python Version: 2.x, 3.x
Description: Install script for themekit. It will download a release and make it executable
'''
import os, json, sys, hashlib
from six.moves.urll... | Python | 0 | @@ -45,12 +45,9 @@
tall
-.py
%0A
+
@@ -123,19 +123,19 @@
ed:
-Nov 19 2020
+Sep 14 2018
%0A
@@ -157,14 +157,9 @@
: 2.
-x, 3.x
+7
%0A
@@ -290,54 +290,8 @@
ib%0A%0A
-from six.moves.urllib.request import urlopen%0A%0A
clas
@@ -927,23 +927,26 @@
n.loads(
-urlopen
+self.__req
(Install
@@ -972,15 +972,8... |
ec74aa53c889c854f9dc056578748201e69db0fb | Add basic logging support | tweak/__init__.py | tweak/__init__.py | #!/usr/bin/env python3
from __future__ import print_function, unicode_literals, division, absolute_import
import os, sys, json, errno, collections, atexit
class Config(collections.MutableMapping):
"""
Provides a self-contained (no dependencies outside the standard library), Python 2 and 3 compatible configur... | Python | 0 | @@ -149,17 +149,26 @@
, atexit
+, logging
%0A
-
%0Aclass C
@@ -972,16 +972,58 @@
onfig%22))
+%0A _logger = logging.getLogger(__name__)
%0A%0A de
@@ -2017,24 +2017,113 @@
f._load(fh)%0A
+ self._logger.info(%22Loaded configuration from %25s%22, self._config_file)%0A
@@ -4069,2... |
3cf93f7f640ef04a1be31d515c19cffec19cec45 | Remove logging import unused | searchlightclient/osc/plugin.py | searchlightclient/osc/plugin.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | Python | 0.000001 | @@ -606,43 +606,8 @@
ls%0A%0A
-LOG = logging.getLogger(__name__)%0A%0A
DEFA
|
18d66a1325e9c8825c4b33ea5438fe0ec8fcab33 | Don't swallow the underlying decrypt error | decrypt-windows-ec2-passwd.py | decrypt-windows-ec2-passwd.py | #!/usr/bin/env python
import base64, binascii, getpass, optparse, sys
from Crypto.PublicKey import RSA
def pkcs1_unpad(text):
#From http://kfalck.net/2011/03/07/decoding-pkcs1-padding-in-python
if len(text) > 0 and text[0] == '\x02':
# Find end of padding marked by nul
pos = text.fi... | Python | 0.998796 | @@ -2574,16 +2574,20 @@
lueError
+, ex
:%0D%0A
@@ -2666,17 +2666,26 @@
tected?)
-%22
+: %25s%22 %25 ex
%0D%0A
|
57cb5546d0e832bae8b2171d42fc4428ebc6dc74 | add try for imports | tumb_borg/authorize.py | tumb_borg/authorize.py | #!/usr/bin/python
from tumblpy import Tumblpy as T
from urlparse import urlparse, parse_qs
def authorize(KEY, SECRET, CALLBACK):
def get_authorization_properties():
t = T(KEY, SECRET)
return t \
.get_authentication_tokens(
callback_url=CALLBACK)
auth_p = get... | Python | 0 | @@ -44,16 +44,93 @@
py as T%0A
+try:%0A from urllib.parse import urlparse, parse_qs%0Aexcept ImportError:%0A
from url
|
6e4ec337bf4c64768cd81df581c4dcf34131599d | use nano2sec, issue #33 | buildtimetrend/stages.py | buildtimetrend/stages.py | # vim: set expandtab sw=4 ts=4:
'''
Reads timestamps.csv, calculates stage duration and saves the result
to an xml file
Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtime-trend
<https://github.com/ruleant/buildtime-trend/>
This program is free software: you can redi... | Python | 0 | @@ -972,16 +972,58 @@
ck_file%0A
+from buildtimetrend.tools import nano2sec%0A
from lxm
@@ -6680,21 +6680,24 @@
p(name,
-float
+nano2sec
(timesta
@@ -6703,28 +6703,8 @@
amp)
- / float(1000000000)
)%0A%0A
|
483fea2f62ea336d6882076136de30d6cd719134 | Update routers.py | directions/routers.py | directions/routers.py | """
Classes for major routing providers
* Google
* Mapquest
* Mapquest Open
* Mapbox
Please consult the terms of service of each provider before using the service
Google - https://developers.google.com/maps/terms
Mapquest - Contact for licensed data agreement
Mapquest Open - http://developer.mapquest.com/web/info/term... | Python | 0.000001 | @@ -6009,16 +6009,18 @@
conUrl'%5D
+,%0A
@@ -6032,32 +6032,105 @@
+distance=m_in%5B'distance'%5D,%0A time=m_in%5B'time'%5D
%0A
|
e5fd6111d164cee574cb929849934e0b2c7a70a1 | Add ArticleImportView tests | molo/core/api/tests/test_views.py | molo/core/api/tests/test_views.py | from django.contrib.auth.models import User
from django.test import Client, TestCase
from django.core.urlresolvers import reverse
from mock import patch
from molo.core.api.tests.utils import mocked_requests_get
from molo.core.tests.base import MoloTestCaseMixin
class MainImportViewTestCase(MoloTestCaseMixin, TestCa... | Python | 0 | @@ -1510,20 +1510,24 @@
tChooser
-View
+TestCase
(MoloTes
@@ -2070,48 +2070,616 @@
)%0A%0A
- def test_redirects_to_article_import
+%0Aclass ArticleImportViewTestCase(MoloTestCaseMixin, TestCase):%0A%0A def setUp(self):%0A self.mk_main()%0A self.client = Client()%0A User.objects.create_sup... |
1fcb7c2e12d7f025b032e58b30a3e35b1fa25ba5 | fix path in windows tests | tests/test_snapshot_diff.py | tests/test_snapshot_diff.py | # -*- coding: utf-8 -*-
#
# Copyright 2014 Thomas Amland <thomas.amland@gmail.com>
#
# 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
#
# Unles... | Python | 0.000001 | @@ -1577,33 +1577,36 @@
)%0A mv(p('dir1
-/
+', '
a'), p('dir2/b')
@@ -1593,33 +1593,36 @@
', 'a'), p('dir2
-/
+', '
b'))%0A diff =
@@ -1863,33 +1863,36 @@
)%0A mv(p('dir1
-/
+', '
a'), p('dir2/b')
@@ -1879,33 +1879,36 @@
', 'a'), p('dir2
-/
+', '
b'))%0A diff =
@@ -2005,17 +2005,20 @@
%5Bp('dir1
... |
3a49982dfe1a94159bb2543540ae3638688c7c31 | make RAOB download backend more time forgiving | cgi-bin/request/raob.py | cgi-bin/request/raob.py | #!/usr/bin/env python
"""
Download interface for data from RAOB network
"""
import cgi
import datetime
import pytz
from pyiem.util import get_dbconn, ssw
from pyiem.network import Table as NetworkTable
def m(val):
"""Helper"""
if val is None:
return 'M'
return val
def fetcher(station, sts, ets)... | Python | 0 | @@ -69,16 +69,27 @@
ork%0A%22%22%22%0A
+import sys%0A
import c
@@ -410,16 +410,30 @@
.cursor(
+'raobstreamer'
)%0A st
@@ -1350,74 +1350,187 @@
def
-main():%0A %22%22%22Go Main Go%22%22%22%0A form = cgi.FieldStorage()%0A sts
+friendly_date(form, key):%0A %22%22%22More forgiving date conversion%22%22... |
2b3214d52d3bd1230fb0af4a010642391e0bbfbb | fix keys if error is returned (#5) | datpy.py | datpy.py | import subprocess
import time
import cPickle
try:
import ujson as json
except:
import json
try:
import pandas as pd
except:
pd = False
class DatException(Exception):
pass
def on_error(log):
message = log.get('message')
if not message:
message = 'Unknown error. Please contact us at #dat in freenode... | Python | 0 | @@ -2070,32 +2070,56 @@
= stream_out(p)%0A
+ if 'keys' in res:%0A
return res%5B'
@@ -2124,16 +2124,31 @@
%5B'keys'%5D
+%0A return res
%0A%0A @ret
|
aaba385ba46e9d9ed118630181eaa546f310923e | use VERSION constant, issue #6 | buildtimetrend/travis.py | buildtimetrend/travis.py | # vim: set expandtab sw=4 ts=4:
'''
Interface to Travis CI API.
Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtime-trend
<https://github.com/ruleant/buildtime-trend/>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU ... | Python | 0 | @@ -881,16 +881,60 @@
eck_file
+%0Afrom buildtimetrend.settings import VERSION
%0A%0ATRAVIS
@@ -4856,56 +4856,8 @@
%7B%0A
- # get version from Config class%0A
@@ -4903,16 +4903,19 @@
end/
-0.2-dev'
+' + VERSION
,%0A
|
7124f56f3a9ac1185138d88c02648a3442c98606 | Replace the inlined SDK path with apple_common call. | tools/build_defs/apple/swift.bzl | tools/build_defs/apple/swift.bzl | # Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Python | 0.000011 | @@ -2158,113 +2158,56 @@
-# TODO(b/28049126): Replace this value with apple_toolchain call.%0A %22-sdk%22, %22__BAZEL_XCODE_SDKROOT__%22
+%22-sdk%22, apple_common.apple_toolchain().sdk_dir()
,%0A
|
991320a060058fa1cd9e75d689c9ec99501bae08 | Add exception and some comments | pygraphc/evaluation/DaviesBouldinIndex.py | pygraphc/evaluation/DaviesBouldinIndex.py | from __future__ import division
from pygraphc.similarity.CosineSimilarity import CosineSimilarity
from itertools import combinations, product
class DaviesBouldinIndex(object):
def __init__(self, clusters, preprocessed_logs, log_length):
self.clusters = clusters
self.preprocessed_logs = preprocesse... | Python | 0 | @@ -680,34 +680,50 @@
centroid
-+
=
+ centroid + ' ' +
self.preprocess
@@ -869,10 +869,29 @@
oid
-+
=
+ ' '.join(%5Bcentroid,
sel
@@ -917,16 +917,18 @@
%5Blog_id%5D
+%5D)
%0A%0A
@@ -982,32 +982,65 @@
operties(self):%0A
+ # get cluster properties%0A
for clus
@@ -1323,24 +1323,68... |
88cc76833444b346dfe7ec614467d61ca82789ac | Revert "Revert "Improve logger/printer colours"" | km3pipe/logger.py | km3pipe/logger.py | # Filename: logger.py
# pylint: disable=locally-disabled,C0103
"""
The logging facility.
"""
from hashlib import sha256
import socket
import logging
from .tools import colored, supports_color
__author__ = "Tamas Gal"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license... | Python | 0.000059 | @@ -2217,21 +2217,23 @@
%0A pre
+1
, suf
+1
= hash_
@@ -2289,16 +2289,124 @@
'', '')%0A
+ pre2, suf2 = hash_coloured_escapes(name + 'salt') %5C%0A if supports_color() else ('', '')%0A
form
@@ -2449,12 +2449,18 @@
me)s
--%3E%7B%7D
+ %7B%7D%E2%97%8F%7B%7D%E2%97%8F%7B%7D
%25(na
@@ -2464... |
722de274d3ee9866c7580a7f95e32de1777e6a3b | Add note | csscms/properties_scraper.py | csscms/properties_scraper.py | from pyquery import PyQuery as pq
"""A quick and dirty scraper for w3c's css properties list."""
def strip_all_prefixes(string):
bad_prefixes = [
'text-text-',
'pos-',
'font-font-',
'nav-',
'class-',
'gen-',
'tab-'
]
for prefix in bad_prefixes:
... | Python | 0 | @@ -32,16 +32,17 @@
pq%0A%0A%0A%22%22%22
+%0A
A quick
@@ -89,16 +89,140 @@
es list.
+%0ASee css_properties.py for the example output. This is meant to be run once, except when new properties%0Aneed to be scraped.%0A
%22%22%22%0A%0A%0Ade
|
e38dfc9bc39199a07ec509a6ba7d07a3bcc12a3d | Fix all Python DSL incompatibilities for running tests. | tools/build_rules/java_rules.bzl | tools/build_rules/java_rules.bzl | """Module containing java macros."""
load("@bazel_skylib//lib:collections.bzl", "collections")
load("//tools/build_rules:module_rules_for_tests.bzl", "convert_module_deps_to_test")
def _add_immutables(deps_arg, **kwargs):
kwargs[deps_arg] = collections.uniq(kwargs.get(deps_arg, []) + [
'//src/com/facebook... | Python | 0.000007 | @@ -5068,34 +5068,8 @@
**'%5D
-, exclude_directories=True
) if
|
4f9b97766f33dca8d83e528ab7a2953b9168b92c | Add preprocess logs and check number of processors | pygraphc/preprocess/ParallelPreprocess.py | pygraphc/preprocess/ParallelPreprocess.py | from re import sub
from nltk import corpus
import multiprocessing
class ParallelPreprocess(object):
def __init__(self, log_file, count_groups=None):
self.log_file = log_file
self.logs = []
self.log_length = 0
self.unique_events = []
self.unique_events_length = 0
sel... | Python | 0 | @@ -224,32 +224,66 @@
.log_length = 0%0A
+ self.preprocess_logs = %7B%7D%0A
self.uni
@@ -294,24 +294,24 @@
events = %5B%5D%0A
-
self
@@ -1560,32 +1560,52 @@
e_events(self):%0A
+ # read logs%0A
self.__r
@@ -1731,24 +1731,112 @@
dex, log))%0A%0A
+ # run preprocessing in... |
d13204abb2cf5d341eff78416dd442c303042697 | Modify add_occupant method to raise exception in case of a duplicate | classes/room.py | classes/room.py | class Room(object):
def __init__(self, room_name, room_type, max_persons):
self.room_name = room_name
self.room_type = room_type
self.max_persons = max_persons
self.persons = []
def add_occupant(self, person):
if len(self.persons) < self.max_persons:
self.per... | Python | 0 | @@ -244,16 +244,59 @@
erson):%0A
+ if person not in self.persons:%0A
@@ -340,32 +340,36 @@
ns:%0A
+
self.persons.app
@@ -380,16 +380,20 @@
person)%0A
+
@@ -577,16 +577,20 @@
itle())%0A
+
@@ -607,16 +607,20 @@
+
raise Ex
@@ -707,8 +707,... |
372eb236eb85a74f85ce489270b24cc789b3fb0e | Add docstrings to parser | npc/parser.py | npc/parser.py | #!/usr/bin/env python3.5
import re
import itertools
from os import path, walk
from collections import defaultdict
def get_characters(search_paths = ['.'], ignore_paths = []):
return itertools.chain.from_iterable((_parse_path(path, ignore_paths) for path in search_paths))
def _parse_path(start_path, ignore_paths ... | Python | 0.000002 | @@ -170,16 +170,287 @@
= %5B%5D):%0A
+ %22%22%22%0A Get data from character files%0A%0A Args:%0A search_paths (list): Paths to search for character files%0A ignore_paths (list): Paths to exclude from the search%0A%0A Returns:%0A List of dictionaries containing parsed character informa... |
90d3f00cd8fea8fab9274069ac06ea461f8e4dfd | Send only pics and gifs to OOO_B_R. | channels/ooo_b_r/app.py | channels/ooo_b_r/app.py | #encoding:utf-8
from utils import get_url, weighted_random_subreddit
# Group chat https://yal.sh/dvdahoy
t_channel = '-1001065558871'
subreddit = weighted_random_subreddit({
'ANormalDayInRussia': 1.0,
'ANormalDayInAmerica': 0.1,
'ANormalDayInJapan': 0.01
})
def send_post(submission, r2t):
what, url... | Python | 0 | @@ -447,210 +447,8 @@
k)%0A%0A
- if what == 'text':%0A return False%0A elif what == 'other':%0A return False%0A elif what == 'album':%0A r2t.send_album(url)%0A return True%0A elif what in ('gif', 'img'):%0A
@@ -497,35 +497,4 @@
xt)%0A
- else:%0A return False... |
35d8defa245d9ad1a038b297e9cfe711b65beb3c | fix sorting function | monolithe/specifications/specification.py | monolithe/specifications/specification.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# no... | Python | 0.000074 | @@ -6522,36 +6522,32 @@
sorted(ret,
-key=
lambda x
: getattr(x,
@@ -6538,36 +6538,41 @@
da x
-: getattr(x, %22specification%22
+, y: cmp(x.rest_name, y.rest_name
))%0A%0A
@@ -6799,20 +6799,16 @@
et,
-key=
lambda x
: ge
@@ -6807,26 +6807,30 @@
da x
-: getattr(x, %22
+, y: cmp(x.name, y.
name
-%22
))%0A
|
e309ed0a2f1f991e4015fcede373dccfe3843d97 | Change version tag. | core/info/info.py | core/info/info.py | # -*- coding: utf-8 -*-
"""Informations.
+ Pyslvs version.
+ Module versions.
+ Help descriptions.
+ Check for update function.
"""
__author__ = "Yuan Chang"
__copyright__ = "Copyright (C) 2016-2018"
__license__ = "AGPL"
__email__ = "pyslvs@gmail.com"
from sys import version_info
import platform
import argparse
imp... | Python | 0 | @@ -512,11 +512,15 @@
0, '
-dev
+release
')%0A%0A
|
35d2a174d671e29e08ad512f9bee08e150d39984 | Save original, then parse amounts. | db/db.py | db/db.py | #!/usr/bin/python
import sys
import copy
import json
import getpass
import aesjsonfile
sys.path.append("../")
import config
def parse_amount(amount):
if type(amount) == int:
return amount
if "." not in amount:
amount += ".00"
return int(amount.replace("$","").replace(",","").replace(".","... | Python | 0 | @@ -2559,16 +2559,139 @@
+k%5D = v%0A
+ trans%5B%22orig_amount_str%22%5D = trans%5B%22amount%22%5D%0A trans%5B%22amount%22%5D = parse_amount(trans%5B%22amount%22%5D)%0A
|
d966b0973da71f5c883697ddd12c2728b2a04cce | Improve git tag to version conversion | ci/cleanup-binary-tags.py | ci/cleanup-binary-tags.py | #!/usr/bin/env python3
import os
import subprocess
import re
import semver
def tag_to_version(tag):
version = re.sub(r'binary-', '', tag)
version = re.sub(r'-[x86|i686].*', '', version)
return version
subprocess.check_call('git pull --tags', shell=True)
tags = subprocess.check_output(
'git tag --li... | Python | 0.000001 | @@ -104,116 +104,44 @@
-version = re.sub(r'binary-', '', tag)%0A version = re.sub(r'-%5Bx86%7Ci686%5D.*', '', version)%0A return version
+return tag.split('-')%5B1%5D.lstrip('v')
%0A%0A%0As
|
634c126a3a775419ae35365a3ea8ce6e1f3e4156 | Update acg_gamer_com_tw_acgDetail.py | my-ACG/util/acg_gamer_com_tw_acgDetail.py | my-ACG/util/acg_gamer_com_tw_acgDetail.py | import argparse
import logging
import re
import requests
import pywikibot
from bs4 import BeautifulSoup
class AcgGamerComTwAcgDetail:
RATING_IMG = {
'ALL': 0,
'6TO12': 6,
'12TO18': 12,
'15TO18': 15,
'18UP': 18,
}
RATING_ITEM = {
0: 'Q46',
6: 'Q47',... | Python | 0.000001 | @@ -46,34 +46,33 @@
ort
-requests%0A%0Aimport pywikibot
+pywikibot%0Aimport requests
%0Afro
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.