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 |
|---|---|---|---|---|---|---|---|
60a95fee791a991930e97af12f6ef14e7d96244b | fix tests | releng/generate_tests_test.py | releng/generate_tests_test.py | #!/usr/bin/env python3
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | Python | 0 | @@ -845,39 +845,46 @@
tes-e2e-
-gce-cos-k8sbeta-ingress
+cloud_a-image_b-k8sfoo-focus_c
%22%0A
@@ -1005,31 +1005,38 @@
e2e-
-gce-cos-k8sbeta-ingress
+cloud_a-image_b-k8sfoo-focus_c
%22: s
@@ -1117,11 +1117,15 @@
: %7B%22
-gce
+cloud_a
%22: %7B
@@ -1166,11 +1166,15 @@
: %7B%22
-cos
+image_b
%22: %7B
@@ -12... |
f75e5890a0c0d1c416c1401fa149dcc89d4db631 | move view and event loop to Node.handle_connection | zechat/node.py | zechat/node.py | import logging
from contextlib import contextmanager
from base64 import b64encode, b64decode
import hashlib
from collections import defaultdict
import flask
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Hash import SHA256
from Crypto.Signature import PKCS1_PSS
from zechat import mode... | Python | 0.000001 | @@ -2214,16 +2214,236 @@
ws.id%5D%0A%0A
+ def handle_connection(self, ws):%0A with self.transport(ws) as transprot:%0A for pkt in transprot.iter_packets():%0A with self.app.app_context():%0A transprot.packet(pkt)%0A%0A
def
@@ -3603,150 +3603,8 @@
kt%0A%0A
-... |
b9227957c680522e04d2fe6ae148a4bc6f7eddad | Update account_invoice.py | l10n_ro_invoice_line_not_deductible/account_invoice.py | l10n_ro_invoice_line_not_deductible/account_invoice.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Fekete Mihai <mihai.fekete@forbiom.eu>
# Copyright (C) 2014 FOREST AND BIOMASS SERVICES ROMANIA SA
# (http://www.forbiom.eu).
#
# This program is free software: you can redistribute it and/or... | Python | 0.000001 | @@ -2495,25 +2495,10 @@
lse%0A
-
#
+
urma
@@ -2579,10 +2579,15 @@
-%09%09
+
res%5B
@@ -2602,17 +2602,19 @@
unt_id'%5D
-=
+ =
inv.comp
|
9b23afb958350c8d25c8541eb064c63b3b4c2d9b | Fix UserGeneratedContentExportMixin | adhocracy4/exports/mixins.py | adhocracy4/exports/mixins.py | from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from adhocracy4.comments.models import Comment
from adhocracy4.ratings.models import Rating
from . import unescape_and_strip_html
class VirtualFieldMixin:
def get_virtual_fields(self, virtual):
... | Python | 0 | @@ -4499,32 +4499,31 @@
if '
-location
+creator
' not in vir
@@ -4582,38 +4582,31 @@
if '
-location_label
+created
' not in vir
|
7783d1cc26486be91cf001f444e864b9cccc37ec | send message | aiotinder/controllers/api.py | aiotinder/controllers/api.py | # -*- coding: utf-8 -*-
"""API connector module for Tinder API.
"""
import warnings
from http import HTTPStatus
from typing import (AnyStr, Dict, List, TypeVar, Any)
import aiohttp
import ujson as json
from aiotinder import settings
from aiotinder.controllers import exceptions
from aiotinder.models.model import Use... | Python | 0.000002 | @@ -1382,19 +1382,19 @@
AnyStr,
-int
+Any
%5D = None
@@ -3936,32 +3936,394 @@
et%22, url_path)%0A%0A
+ async def message(self, match_id: str, message: str) -%3E Dict%5BAnyStr, G%5D:%0A %22%22%22Send message to the match.%0A :param match_id: Match Id.%0A :param message: Message.%0A :re... |
644ec6f3d66bf7c018bbfa0c46b07dbdb64bebba | implement ratio config | PyAnalysisTools/PlottingUtils/PlotConfig.py | PyAnalysisTools/PlottingUtils/PlotConfig.py | import ROOT
import re
from PyAnalysisTools.base import _logger, InvalidInputError
from PyAnalysisTools.base.YAMLHandle import YAMLLoader
class PlotConfig(object):
def __init__(self, **kwargs):
if "dist" not in kwargs and "is_common" not in kwargs:
_logger.error("Plot config does not contain di... | Python | 0.000001 | @@ -1082,63 +1082,345 @@
-setattr(self, k.lower(), v)%0A self.auto_decorate(
+if k == %22ratio_config%22:%0A self.set_ratio_config(**v)%0A continue%0A setattr(self, k.lower(), v)%0A self.auto_decorate()%0A%0A def set_ratio_config(self, **kwargs):%0A ... |
28b4b529c00deffd312531a66c493a92075560e6 | fix typing | aioworkers/core/formatter.py | aioworkers/core/formatter.py | import os
from abc import abstractmethod
from ..utils import import_name
from .base import AbstractEntity
class BaseFormatter:
name = NotImplemented
mimetypes = ()
@abstractmethod # pragma: no cover
def decode(self, value):
raise NotImplementedError
@abstractmethod # pragma: no cover
... | Python | 0.000423 | @@ -33,16 +33,41 @@
ctmethod
+%0Afrom typing import Tuple
%0A%0Afrom .
@@ -192,16 +192,41 @@
pes = ()
+ # type: Tuple%5Bstr, ...%5D
%0A%0A @a
@@ -3292,32 +3292,16 @@
/json',)
- # type: ignore
%0A con
@@ -4597,16 +4597,56 @@
= 'yaml'
+%0A mimetypes = ('application/x-yaml',)
%0A%0A de
|
c98146160d42f78c8be2ed87d54bb539b12b425b | fix mypy | aioworkers/net/web/server.py | aioworkers/net/web/server.py | import time
from email.utils import formatdate
from typing import Awaitable, Callable, Dict, Mapping
from aioworkers.core.config import ValueExtractor
from aioworkers.net.server import SocketServer
from aioworkers.net.uri import URL
from aioworkers.worker.base import Worker
from . import access_logger
from .protocol ... | Python | 0.004314 | @@ -58,16 +58,21 @@
g import
+ Any,
Awaitab
@@ -409,16 +409,33 @@
%5B%0A
+ Any,%0A
|
bb1d831d9486c1581f516c8fc9257ff2df4de9ea | Fix version extraction | .conan/build.py | .conan/build.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from cpt.packager import ConanMultiPackager
from cpt.ci_manager import CIManager
from cpt.printer import Printer
class BuilderSettings(object):
@property
def username(self):
""" Set taocpp as package's owner
"""
return ... | Python | 0.000001 | @@ -1893,17 +1893,16 @@
%22project
-
%5C(pegtl
|
c48706db3a1d5a68e173ed8212dde1c7269740c2 | use local aiohttpsession | alexBot/cogs/phoneMonitor.py | alexBot/cogs/phoneMonitor.py | import logging
from collections import defaultdict
from typing import TYPE_CHECKING
from discord.ext import tasks
from ..tools import Cog, get_json
if TYPE_CHECKING:
from bot import Bot
log = logging.getLogger(__name__)
TABLE = defaultdict(lambda: "Alex is Away")
TABLE['home'] = "Alex is At Home"
TABLE['walma... | Python | 0 | @@ -76,16 +76,31 @@
CHECKING
+%0Aimport aiohttp
%0A%0Afrom d
@@ -380,16 +380,21 @@
r(Cog):%0A
+ %0A
def
@@ -451,16 +451,67 @@
__(bot)%0A
+ self.session: aiohttp.ClientSession = None%0A
@@ -645,20 +645,16 @@
self.
-bot.
session,
@@ -1073,32 +1073,79 @@
_updates(self):%0A
+ self... |
35cfb9f1ffa3efd4d317494383222a543d5eeabf | Fix handling of ',' in selectors passed to Connectivity constructor. | connectivity.py | connectivity.py | #!/usr/bin/env python
"""
Represent connectivity pattern using pandas DataFrame.
"""
import itertools
import numpy as np
import pandas as pd
from plsel import PathLikeSelector
class Connectivity(object):
"""
Class for representing connectivity between sets of interface ports.
This class represents conn... | Python | 0 | @@ -1853,16 +1853,31 @@
ke_index
+('(%25s)+(%25s)' %25
(from_se
@@ -1881,19 +1881,17 @@
_sel
-+'+'+
+,
to_sel
+)
, na
|
bee9373dcf852e7af9f0f1a78dcc17a0922f96fe | Modify main.py tests to use get_anchorhub_path() | anchorhub/tests/test_main.py | anchorhub/tests/test_main.py | """
test_main.py - Tests for main.py
main.py:
http://www.github.com/samjabrahams/anchorhub/main.py
"""
from nose.tools import *
import anchorhub.main as main
def test_one():
"""
main.py: Test defaults with local directory as input.
"""
main.main(['.'])
| Python | 0 | @@ -153,16 +153,134 @@
as main%0A
+from anchorhub.util.getanchorhubpath import get_anchorhub_path%0Afrom anchorhub.compatibility import get_path_separator%0A
%0A%0Adef te
@@ -382,10 +382,90 @@
in(%5B
-'.
+get_anchorhub_path() + get_path_separator() +%0A '../sample/multi-file
'%5D)%0A
|
0d6cf1f121c6d27af2fe10bcc20a101847f6c87e | Return true if entity is unchaged on migration (todo: invert api for user-friendness) | console/yawp.py | console/yawp.py | from google.appengine.ext import ndb
from google.appengine.api import datastore
from google.appengine.api import datastore_types
from google.appengine.api import datastore_errors
from functools import partial
# import yawp from yawp
# yawp('/people').query().fetch()
# http://stackoverflow.com/questions/10709893/ndb-ex... | Python | 0.000002 | @@ -2059,24 +2059,58 @@
ities(keys)%0A
+ changed_entities = %5B%5D%0A
@@ -2149,16 +2149,19 @@
+if
fn(entit
@@ -2162,16 +2162,77 @@
(entity)
+ != True:%0A changed_entities.append(entity)
%0A
@@ -2241,32 +2241,40 @@
put_entities(
+changed_
entities)%0... |
b4d47364b18f68a6980aecfcfb8c33a75eb4e879 | Fix value conversion exception | annotator/count_annotator.py | annotator/count_annotator.py | #!/usr/bin/env python
"""
Annotates counts with the following attributes:
cumulative, case, death, age, hospitalization, approximate, min, max
"""
import re
from collections import defaultdict
from annotator import Annotator, AnnoTier, AnnoSpan
from jvm_nlp_annotator import JVMNLPAnnotator
import result_aggregators as... | Python | 0.000001 | @@ -2383,32 +2383,53 @@
': return False%0A
+ try:%0A
if i
@@ -2453,32 +2453,159 @@
e: return False%0A
+ except ValueError:%0A print %22Cannot parse count string: %22 + count_string%0A return False%0A
if v
|
d7e79e32240b73c8565c7e526e679b3c9bb84bae | Fix the bug in the blob admin async uploader when no local file is present | antxetamedia/blobs/fields.py | antxetamedia/blobs/fields.py | # -*- coding: utf-8 -*-
from django.forms import fields, widgets
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.core.files.storage import default_storage
class UploadWidget(widgets.TextInput):
widget =... | Python | 0.000001 | @@ -309,35 +309,16 @@
-widget = ('%3Cp%3E%7Binput%7D%3Cspan%3E
+link = '
%3Ca h
@@ -360,36 +360,57 @@
%3C/a%3E
-%3C/span%3E%3Cbr%3E'%0A '
+'%0A widget = '%3Cp%3E%7Binput%7D%3Cspan%3E%7Blink%7D%3C/span%3E%3Cbr%3E
%3Cinp
@@ -464,17 +464,16 @@
d%22%3E%3C/p%3E'
-)
%0A scr
@@ -860,57 +860,45 @@... |
186b8bd49e3122bfee366f69db2972cb9bbacc01 | Correct tests to account for regional adjustment in ticpe | openfisca_france_indirect_taxation/tests/test_ticpe.py | openfisca_france_indirect_taxation/tests/test_ticpe.py | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it ... | Python | 0 | @@ -1597,23 +1597,34 @@
iesel =
+(
(0.4284
+ + 0.0115)
* 1.196
@@ -1638,23 +1638,34 @@
14675 -
+(
(0.4284
+ + 0.0115)
* 1.196
@@ -2580,23 +2580,33 @@
te_95 =
+(
(0.6069
+ + 0.025)
* 1.196
@@ -2619,23 +2619,33 @@
.5367 -
+(
(0.6069
+ + 0.025)
* 1.196
@@ -2671,23 +2671,33 @@
te_98 =
+(
(0.6069
+ + ... |
fbc9e950c42829c366d28da978adbaa42a7f9a10 | Update berepi_logger.py | apps/logger/berepi_logger.py | apps/logger/berepi_logger.py | # -*- coding: utf-8 -*-
# author : http://github.com/jeonghoonkang
import logging
#import logging.config
from logging.handlers import RotatingFileHandler
#logging.config.fileConfig('logging.conf')
LOG_FILENAME = "./log/berelogger.log"
logger = logging.getLogger('BereLogger')
logger.setLevel(logging.DEBUG)
handler =... | Python | 0 | @@ -741,16 +741,56 @@
value)%0A%0A
+def berelog(msg):%0A logger.info(msg)%0A%0A
if __nam
|
8f34186a9b491070321f06896e12d67faf20a2d1 | Rename settings section to values | plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py | plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py | # Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import configparser #To read config files.
import io #To write config files to strings as if they were files.
import UM.VersionUpgrade
## Creates a new profile instance by parsing a serialised profile in version 1
# of... | Python | 0 | @@ -4954,23 +4954,21 @@
ection(%22
-setting
+value
s%22)%0A
@@ -5045,23 +5045,21 @@
ig.set(%22
-setting
+value
s%22, key,
|
1a53a238d3c2e3d58cd23857e2f42f60538ec7e7 | Connect cache_port and bus directly when we call addPrivateL1DCache(). | gem5/HybridDatapath.py | gem5/HybridDatapath.py | from m5.params import *
from MemObject import MemObject
from m5.proxy import *
class HybridDatapath(MemObject):
type = "HybridDatapath"
cxx_header = "aladdin/gem5/HybridDatapath.h"
benchName = Param.String("Aladdin Bench Name")
traceFileName = Param.String("Aladdin Input Trace File")
configFileName = Param.S... | Python | 0.000001 | @@ -2762,1039 +2762,216 @@
#
-This is the set of ports that should be connected to the memory bus.%0A _cached_ports = %5B'spad_port', %22cache_port%22%5D%0A _uncached_slave_ports = %5B%5D%0A _uncached_master_ports = %5B%5D%0A%0A def connectCachedPorts(self, bus):%0A for p in self._cached_ports:%0A ... |
f70d82aab8ab6575fae2e4c5b3b5efddb306501d | Move to Github | plugins/veurne_trash/cron.py | plugins/veurne_trash/cron.py | # -*- coding: utf-8 -*-
# Copyright 2017 Mobicage NV
#
# 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 o... | Python | 0.000001 | @@ -1338,17 +1338,16 @@
(self):%0A
-#
@@ -1395,18 +1395,36 @@
ings, %5B%5D
+, keys_only=False
)%0A
+#
@@ -1507,16 +1507,110 @@
get())%0A%0A
+def _query_settings():%0A return RogerthatSettings.query(namespace=plugin_consts.NAMESPACE)%0A%0A
def _wor
@@ -2193,16 +2193,67 @@
return%0A%0A
+ s... |
ac536fedbd5c39412f8413efae0f45b78f3d424c | Fix #1938. Return object from clean_ function | apps/profiles/forms.py | apps/profiles/forms.py | # -*- coding: utf-8 -*-
import re
from django import forms
from django.contrib import auth
from django.utils.translation import ugettext as _
from apps.authentication.models import OnlineUser, Position
from apps.profiles.models import Privacy
ZIP_CODE_VALIDATION_ERROR = "Postnummer må bestå av fire siffer."
class ... | Python | 0.001074 | @@ -1086,43 +1086,23 @@
if
-zip_code and len(zip_code) != 0 and
+not zip_code or
not
@@ -1113,21 +1113,23 @@
match(r'
+%5E
%5Cd%7B4%7D
+$
', zip_c
@@ -1201,16 +1201,41 @@
ERROR)%0A%0A
+ return zip_code%0A%0A
%0Aclass P
|
2217b51428a81bf4edf489c0e91eb20794597821 | use .distinct() instead of set(qs). i.e. don't be moron. | apps/profiles/views.py | apps/profiles/views.py | from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.contrib import messages
from django.shortcuts import render_to_response, get_object_or_404
from django.template impo... | Python | 0 | @@ -1759,24 +1759,18 @@
lls)
-%0A qs = set(qs
+.distinct(
)%0A
|
3d2c06e72d2165e6374e872b22bb2a11b6b73bf3 | Remove ")]}'" prefix from all responses | gerritclient/client.py | gerritclient/client.py | #
# Copyright 2017 Vitalii Kulanov
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python | 0.005144 | @@ -4472,47 +4472,8 @@
%7B%7D%0A
- if response.status_code == 200:
%0A
@@ -4477,20 +4477,16 @@
-
# Remove
@@ -4548,28 +4548,24 @@
SSI%0A
-
return json.
@@ -4603,39 +4603,8 @@
%22))%0A
- return response.json()%0A
%0A%0Ade
|
76e674b22ceed9fdf39ce2164597b619f5fecee6 | Remove url chache and move to utils | apps/uploads/models.py | apps/uploads/models.py | #
# Copyright (C) 2017 Maha Farhat
#
# 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 version.
#
# This program is distribu... | Python | 0 | @@ -2762,23 +2762,24 @@
if this
-dropbox
+external
downloa
@@ -3770,15 +3770,19 @@
oad.
-io.text
+get_error()
%0A%0A
@@ -4808,24 +4808,24 @@
ploadFile):%0A
+
url = UR
@@ -4838,589 +4838,8 @@
()%0A%0A
- @classmethod%0A def url_cache_filename(cls, name):%0A return os.path.join(settings.UPLOAD_... |
1e52c068d74763d7b2015b0fe871bf3c664bc0db | fix MF/MT slices | ENDF6.py | ENDF6.py | """
Tools to read an ENDF-6 data file.
From https://t2.lanl.gov/nis/endf/intro05.html
An ENDF-format nuclear data library has an hierarchical structure by tape, material, file, and section, denoted by numerical identifiers.
Tape is a data-file that contains one or more ENDF materials in increasing order by MAT.
E... | Python | 0.000001 | @@ -1418,17 +1418,17 @@
,%0A 'M
-T
+F
' : sli
@@ -1436,33 +1436,33 @@
e(70,72),%0A 'M
-F
+T
' : slice(72,75
|
564f1470e742f06dd2802341c4b5b118074a9013 | Support unhidden polygamy.json file in a config directory | polygamy/RepoConfigParser.py | polygamy/RepoConfigParser.py | from __future__ import absolute_import
import json
import os.path
class BaseConfigParser:
CONFIG_DIR = '.polygamy'
def parse_file(self):
pass
def find_config_file(self, path):
real_path = os.path.realpath(path)
config_file = os.path.join(path, self.CONFIG_FILE)
config_d... | Python | 0 | @@ -451,22 +451,14 @@
r a
-.polygamy.josn
+config
fil
@@ -528,12 +528,153 @@
dir)
- and
+:%0A for f in (self.CONFIG_FILE, self.DIR_CONFIG_FILE):%0A config_dir_file = os.path.join(config_dir, f)%0A if
os.
@@ -707,32 +707,40 @@
e):%0A
+
+
self.config_p... |
84c3e46145634c3b2acff25547175d821349e551 | Use directory junction to replace symlinks on windows | git_externals/utils.py | git_externals/utils.py | #!/usr/bin/env python
from __future__ import print_function
import subprocess
import os
import sys
import logging
import re
from subprocess import check_call
from contextlib import contextmanager
class ProgError(Exception):
def __init__(self, prog='', errcode=1, errmsg=''):
super(ProgError, self).__ini... | Python | 0 | @@ -4249,47 +4249,170 @@
-flags = 1 if os.path.isdir(src) else 0%0A
+if os.path.isdir(src):%0A # use directory junctions (fix for python 2.6)%0A ret = subprocess.call(%5B'mklink', '/J', src, dst%5D)%0A else:%0A
@@ -4436,21 +4436,17 @@
rc,
-flags
+1
) == 0:%0A
@@ -44... |
fe5f25e10f4b07fcfd3df8bd6d6bc6252b5617e8 | Raise read only filesystem for history view | gitfs/views/history.py | gitfs/views/history.py | import os
from datetime import datetime
from stat import S_IFDIR
from errno import ENOENT
from pygit2 import GIT_SORT_TIME
from fuse import FuseOSError
from gitfs.utils import strptime
from gitfs.log import log
from .view import View
class HistoryView(View):
def getattr(self, path, fh=None):
'''
... | Python | 0 | @@ -82,16 +82,23 @@
t ENOENT
+, EROFS
%0A%0Afrom p
@@ -694,16 +694,120 @@
'''%0A%0A
+ if path not in self._get_commit_dates() and path != '/':%0A raise FuseOSError(ENOENT)%0A%0A
@@ -1076,16 +1076,195 @@
pass%0A%0A
+ def open(self, path, fh):%0A return 0%0A%0A def create... |
3ace8c1e603dd07bde9c46e036e14b49a6103238 | Upgrade notify message | github/events/watch.py | github/events/watch.py | from data_types.hook import Hook
from data_types.repository import Repository
from data_types.user import User
from .base import EventBase
class EventWatch(EventBase):
def __init__(self, sdk):
super(EventWatch, self).__init__(sdk)
self.hook = None
self.repository = None
self.sende... | Python | 0 | @@ -133,16 +133,115 @@
ntBase%0A%0A
+import math%0Aordinal = lambda n: %22%25d%25s%22 %25 (n,%22tsnrhtdd%22%5B(math.floor(n/10)%2510!=1)*(n%2510%3C4)*n%2510::4%5D)%0A
%0Aclass E
@@ -1195,16 +1195,12 @@
ded
-new star
+a %7B%7D
%E2%AD%90%EF%B8%8F
@@ -1223,17 +1223,16 @@
%22%3E%7B%7D%3C/a%3E
-.
'.format
@@ -1306,... |
24d808ae518b192b0136e2dfe3cf8a3464ac857d | Update watch.py | github/events/watch.py | github/events/watch.py | from data_types.hook import Hook
from data_types.repository import Repository
from data_types.user import User
from .base import EventBase
import math
ordinal = lambda n: "%d%s" % (n,"tsnrhtdd"[(math.floor(n/10)%10!=1)*(n%10<4)*n%10::4])
class EventWatch(EventBase):
def __init__(self, sdk):
super(EventWa... | Python | 0 | @@ -137,108 +137,8 @@
se%0A%0A
-import math%0Aordinal = lambda n: %22%25d%25s%22 %25 (n,%22tsnrhtdd%22%5B(math.floor(n/10)%2510!=1)*(n%2510%3C4)*n%2510::4%5D)%0A%0A
clas
@@ -1089,24 +1089,13 @@
/a%3E
-added a %7B%7D %E2%AD%90%EF%B8%8F to
+%E2%AD%90%EF%B8%8F %7B%7D
%3Ca
|
aee36b42f59ae9e8ec2f4f2dd82cd758c73a7274 | Remove unneeded import from south_africa urls | pombola/south_africa/urls.py | pombola/south_africa/urls.py | from django.conf.urls import patterns, include, url
from pombola.core.views import PersonDetailSub
from pombola.south_africa.views import LatLonDetailView,SAPlaceDetailSub
urlpatterns = patterns('pombola.south_africa.views',
url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/', LatLonDetailView.as_view(), ... | Python | 0.000004 | @@ -50,55 +50,8 @@
rl%0A%0A
-from pombola.core.views import PersonDetailSub%0A
from
|
f878e80ea7d743abcb5b730568dff71bab391f33 | Combine tests into one | leap/leap.py | leap/leap.py | def is_leap_year(y):
if y % 400 == 0:
return True
elif y % 100 == 0:
return False
elif y % 4 == 0:
return True
else:
return False
| Python | 0.999526 | @@ -22,62 +22,41 @@
-if
+return (
y %25 4
-00
== 0
-:%0A return True%0A elif
+) and (
y %25 100
== 0
@@ -55,103 +55,26 @@
100
-== 0:%0A return False%0A elif
+!= 0 or
y %25 4
+00
== 0
-:%0A return True%0A else:%0A return False
+)
%0A
|
a1576b5e6cfcd4c766be4fc77718677fdbc7db92 | fix version bump | dev_tools.py | dev_tools.py | from __future__ import print_function
import fileinput
import os
import shutil
import subprocess
import click
def _get_version():
__version__ = None
with open('flexget/_version.py') as f:
exec(f.read())
if not __version__:
raise click.ClickException('Could not find __version__ from flexg... | Python | 0 | @@ -131,31 +131,8 @@
():%0A
- __version__ = None%0A
@@ -170,16 +170,53 @@
) as f:%0A
+ g = globals()%0A l = %7B%7D%0A
@@ -228,16 +228,22 @@
f.read()
+, g, l
)%0A if
@@ -247,16 +247,19 @@
if not
+l%5B'
__versio
@@ -261,16 +261,18 @@
ersion__
+'%5D
:%0A
@@ -366,16 +366,... |
187135f44e21a836fc86140167c4502cb9ad77ac | Add some fallback methods (ifconfig.me, dyndns) to determine external IP when myresolver is down | libnamebench/providers.py | libnamebench/providers.py | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 0 | @@ -701,16 +701,26 @@
berg)'%0A%0A
+import re%0A
import s
@@ -858,16 +858,34 @@
ervers%0A%0A
+import httplib2%0A%0A%0A
OPENDNS_
@@ -910,63 +910,198 @@
20'%0A
-MY_RESOLVER_IP = '188.165.43.98'%0AGOOGLE_IP = '8.8.8.8'%0A
+# TODO(tstromberg): Stop hardcoding ns2.myresolver.info.%0AMY_RESOLVER_IP = '188.165.43.98'%0AG... |
01c987128b11ae620e7baeb50b5d39fa7be6fdf9 | test can use existing co routine | tests/threadloop/test_threadloop.py | tests/threadloop/test_threadloop.py | from __future__ import absolute_import
from decimal import Decimal
import time
import pytest
from concurrent.futures import Future, as_completed
from threadloop import ThreadLoop
from tornado import gen
@pytest.yield_fixture
def threadloop():
with ThreadLoop() as threadloop:
yield threadloop
def test_... | Python | 0 | @@ -197,16 +197,24 @@
port gen
+, ioloop
%0A%0A%0A@pyte
@@ -1319,16 +1319,364 @@
ult()%0A%0A%0A
+def test_use_existing_ioloop():%0A io_loop = ioloop.IOLoop.current()%0A threadloop = ThreadLoop(io_loop)%0A%0A assert threadloop.io_loop is io_loop%0A%0A @gen.coroutine%0A def coroutine():%0A raise ... |
a3d53b2ce0691a032237d3752e28e81aa2d40736 | remove temporary prints | tests/unit/binning/test_RoundLog.py | tests/unit/binning/test_RoundLog.py | import unittest
from alphatwirl.binning import RoundLog
##__________________________________________________________________||
class TestRoundLog(unittest.TestCase):
def test_init(self):
obj = RoundLog()
def test_call(self):
obj = RoundLog()
self.assertAlmostEqual( 1.9952623149688, o... | Python | 0.000001 | @@ -481,239 +481,23 @@
-import math%0A obj = RoundLog()%0A print obj%0A print obj._round%0A print obj(2.23872113856834)%0A print math.log10(obj(2.23872113856834))%0A print 10**obj._round.next(math.log10(obj(2.23872113856834))
+obj = RoundLog(
)%0A
|
f8a97b90295bcb2801abe427d5ac09218e32ee75 | Remove goose user agent | goose/configuration.py | goose/configuration.py | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | Python | 0.000001 | @@ -2493,18 +2493,16 @@
%0A
- #
self.br
@@ -2570,33 +2570,32 @@
_7_2)%22%5C%0A
-#
@@ -2657,17 +2657,16 @@
-#
@@ -2714,32 +2714,33 @@
4.52.7%22%0A
+#
self.browser_use
|
5212327fccb6e6345bdd113a3abcf7b1a35abbe9 | Fix run cmd cwd | gpm/utils/operation.py | gpm/utils/operation.py | from subprocess import Popen, PIPE
import shlex
import re
import os
from gpm.utils.console import puts
from gpm.utils.log import Log
from gpm.const.status import Status
from gpm.utils.string import decode as str_decode
class LocalOperation(object):
@classmethod
def mkdir(cls, paths, *args, **kwargs):
i... | Python | 0.000014 | @@ -1595,20 +1595,16 @@
-abs_
path = c
@@ -1624,145 +1624,8 @@
th)%0A
- if cls.exist(abs_path):%0A cmd = %22cd %25s && %25s%22 %25 (abs_path, cmd)%0A else:%0A return False%0A
@@ -1646,24 +1646,36 @@
.__exec(cmd,
+ cwd = path,
*args, **kw
@@ -3854,... |
9011f4f5b984de16cbf5a166d75984ac95d37b6d | Add support for GRAFANA_API_TOKEN environment variable | grafcli/storage/api.py | grafcli/storage/api.py | import os
import requests
from climb.config import config
from grafcli.storage import Storage
from grafcli.documents import Dashboard
from grafcli.exceptions import DocumentNotFound
class APIStorage(Storage):
def __init__(self, host):
super().__init__(host)
self._config = config[host]
def _... | Python | 0 | @@ -457,16 +457,161 @@
+api_token = os.getenv('GRAFANA_API_TOKEN');%0A if api_token:%0A headers%5B'Authorization'%5D = 'Bearer %7B%7D'.format(api_token)%0A el
if self.
|
d0e7763827e542fa2c63d254010021c3ad507346 | Implement SchemaNavigator Update CollectionHelper.transform() method | grapher/core/common.py | grapher/core/common.py | import abc
class CollectionHelper(metaclass=abc.ABCMeta):
"""Helper for normalizing unknown structures into lists.
"""
@classmethod
def needs(cls, item):
"""Checks if :item needs to be transformed into a list.
:param item: the unknown structure.
:return: :boolean:
"""... | Python | 0.000001 | @@ -4,16 +4,37 @@
ort abc%0A
+from . import errors%0A
%0A%0Aclass
@@ -248,24 +248,202 @@
to a list.%0A%0A
+ Fundamentally, lists, tuples, sets and objects that have a member '__iter__' don't need transformation,%0A except for dictionaries and objects of their subclasses.%0A%0A
:par
@@ -568,16... |
7a9d91a91603bfb6adc514c483c5b552fccbff44 | fix circular reference in TimerCallback with calls to connect/disconnect | software/ddapp/src/python/ddapp/timercallback.py | software/ddapp/src/python/ddapp/timercallback.py | import time
from PythonQt import QtCore
import traceback
class TimerCallback(object):
def __init__(self, targetFps=30):
'''
Construct TimerCallback. The targetFps defines frames per second, the
frequency for the ticks() callback method.
'''
self.targetFps = targetFps
... | Python | 0 | @@ -387,66 +387,8 @@
rue)
-%0A self.timer.connect('timeout()', self._timerEvent)
%0A%0A
@@ -485,86 +485,8 @@
ue)%0A
- self.singleShotTimer.connect('timeout()', self._singleShotTimerEvent)%0A
@@ -653,32 +653,90 @@
self.startTime%0A
+ self.timer.connect('timeout()', self._timerEvent)%0A
... |
1192cb849fb23dfd516d40f5b32d86d76c4e765b | Use the right variable in this loop | django_lightweight_queue/management/commands/queue_configuration.py | django_lightweight_queue/management/commands/queue_configuration.py | from typing import Any
from django.core.management.base import BaseCommand, CommandParser
from ... import app_settings
from ...utils import get_backend, get_queue_counts, load_extra_config
from ...cron_scheduler import get_cron_config
class Command(BaseCommand):
def add_arguments(self, parser: CommandParser) ->... | Python | 0.000006 | @@ -1681,16 +1681,18 @@
ig.get(k
+ey
, '-')))
|
8341a704254e0175d12052abc23fd458ffd3c656 | add remapping kernels | gusto/theta_limiter.py | gusto/theta_limiter.py | from __future__ import absolute_import, print_function, division
from firedrake import dx, assemble, LinearSolver
from firedrake.function import Function
from firedrake.functionspace import FunctionSpace
from firedrake.parloops import par_loop, READ, RW
from firedrake.ufl_expr import TrialFunction, TestFunction
from fi... | Python | 0 | @@ -246,17 +246,22 @@
READ, RW
+, INC
%0A
-
from fir
@@ -2031,24 +2031,258 @@
%5D%5B0%5D);%0A%22%22%22%0A%0A
+ self._weight_kernel = %22%22%22%0Afor (int i=0; i%3Cweight.dofs; ++i) %7B%0A weight%5Bi%5D%5B0%5D += 1.0;%0A %7D%22%22%22%0A%0A self._average_kernel = %22%22%22%0Afor (int i=0; i%3Cvrec... |
82b2e87de2c41b43248a2bccdc75c0066ec2ef49 | Correct SDK PEP 564 nanosecond time reference (#1867) | opentelemetry-api/src/opentelemetry/util/_time.py | opentelemetry-api/src/opentelemetry/util/_time.py | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 0 | @@ -950,10 +950,10 @@
EP 5
-4
6
+4
for
|
8cdba7c151b287a40fe5ac722318eeeb330975f8 | Implement CardXML.deathrattle | hearthstone/cardxml.py | hearthstone/cardxml.py | from xml.etree import ElementTree
from .enums import (
CardClass, CardType, CardSet, Faction, Race, Rarity, GameTag, PlayReq
)
class CardXML(object):
def __init__(self, xml, locale="enUS"):
self.xml = xml
self.locale = locale
e = self.xml.findall("./Tag")
self.tags = {}
gametags = list(GameTag)
for e in... | Python | 0.000015 | @@ -2745,32 +2745,125 @@
tible, False))%0A%0A
+%09@property%0A%09def deathrattle(self):%0A%09%09return bool(self.tags.get(GameTag.DEATHRATTLE, False))%0A%0A
%09@property%0A%09def
|
393e8fb4ce36aa9af2f52cba35c8160b9b962f21 | work around sparkpost api problems | foodsaving/management/commands/setup_sparkpost.py | foodsaving/management/commands/setup_sparkpost.py | import requests
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from rest_framework import status
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('--quiet', action='store_true', dest='quiet')
errors = []
def log_res... | Python | 0 | @@ -2194,81 +2194,8 @@
se:%0A
- # TODO fix updating, if fails quite often%0A return%0A
@@ -4541,32 +4541,280 @@
e.status_code):%0A
+ if response.status_code == 409:%0A print('409: Failed to update existing relay webhook')%0A print('Ignor... |
f70798bd8386d5ae329c8dfc49ccff5b55ca5d05 | Add firehose key to event notifications | helpers/push_helper.py | helpers/push_helper.py | import logging
from collections import defaultdict
from google.appengine.ext import db
from google.appengine.ext import ndb
from google.appengine.api import users
from consts.client_type import ClientType
from consts.notification_type import NotificationType
from models.account import Account
from models.mobile_clie... | Python | 0 | @@ -3252,32 +3252,132 @@
notification):%0A
+ keys = %5B%5D%0A keys.append(event.key_name)%0A keys.append(%22%7B%7D*%22.format(event.year))%0A
users =
@@ -3421,26 +3421,17 @@
_key
- == event.key_name
+.IN(keys)
, Su
|
2ac9dc76c4300ec7c53d705841e266caf0a0acb7 | add v3.6.4, v3.6.5, v3.6.6 (#25923) | var/spack/repos/builtin/packages/dcmtk/package.py | var/spack/repos/builtin/packages/dcmtk/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Dcmtk(CMakePackage):
"""DCMTK is a collection of libraries and applications implementing l... | Python | 0.000001 | @@ -474,16 +474,304 @@
ar.gz%22%0A%0A
+ version('3.6.6', sha256='117097da6d50ddbad0e48bb1e6cdc61468e82ba1d32001dd8e2366b445133a8c')%0A version('3.6.5', sha256='37dad355d5513b4de4a86b5b7b0c3e9ec059860d88781b80916bba2a04e6d5b8')%0A version('3.6.4', sha256='e4b1de804a3fef38fe8cb9edd00262c3cbbd114b305511c14479dd8... |
f1465418e0f36b1062233672bdeece1382394b6f | Remove unnecessary idiokit.stop argument. | abusehelper/contrib/autoshun/autoshunbot.py | abusehelper/contrib/autoshun/autoshunbot.py | import idiokit
from abusehelper.core import utils, cymruwhois, bot, events
AUTOSHUN_CSV_URL = "http://www.autoshun.org/files/shunlist.csv"
class AutoshunBot(bot.PollingBot):
COLUMNS = ["ip", "time", "type"]
feed_url = bot.Param(default=AUTOSHUN_CSV_URL)
use_cymru_whois = bot.BoolParam(default=True)
... | Python | 0 | @@ -787,13 +787,8 @@
top(
-False
)%0A
|
9c591c864bbef43cfb632cb7992b746a7f957842 | Clarify the ProhibitNoAbortFunction message (#304) | vint/linting/policy/prohibit_no_abort_function.py | vint/linting/policy/prohibit_no_abort_function.py | from vint.ast.node_type import NodeType
from vint.linting.level import Level
from vint.linting.policy.abstract_policy import AbstractPolicy
from vint.linting.policy.reference.googlevimscriptstyleguide import get_reference_source
from vint.linting.policy_registry import register_policy
@register_policy
class ProhibitN... | Python | 0.000002 | @@ -387,16 +387,22 @@
ttribute
+ and !
for fun
|
ff47cffe8a5c2017a6e422d74d8831365159fee7 | Version bump to 0.18.0.dev0 | homeassistant/const.py | homeassistant/const.py | # coding: utf-8
"""Constants used by Home Assistant components."""
__version__ = "0.17.0"
REQUIRED_PYTHON_VER = (3, 4)
PLATFORM_FORMAT = '{}.{}'
# Can be used to specify a catch all when registering state or event listeners.
MATCH_ALL = '*'
# If no name is specified
DEVICE_DEFAULT_NAME = "Unnamed Device"
# #### CO... | Python | 0.000001 | @@ -83,10 +83,15 @@
%220.1
-7.
+8.0.dev
0%22%0AR
|
c9c95d5f20e2cd29b0c9198e273242e6b8e80215 | Update reapi.py | lib/reapi.py | lib/reapi.py | #!/usr/bin/env python
# tls-scan - lib: REST API
# https://github.com/ArtiomL/tls-scan
# Artiom Lichtenstein
# v1.0.1, 09/12/2016
import hashlib
import json
import log
import re
import requests
import time
__author__ = 'Artiom Lichtenstein'
__license__ = 'MIT'
__version__ = '1.0.1'
# SSL Labs REST API
class clsSLA(o... | Python | 0.000001 | @@ -1037,16 +1037,72 @@
oll = 5%0A
+%09%09# Show IP addresses in reports%0A%09%09self.boolIPs = False%0A
%09%09# Retu
@@ -2619,31 +2619,16 @@
%09break%0A%0A
-%09@staticmethod%0A
%09def fun
@@ -2630,24 +2630,30 @@
f funGrades(
+self,
diOper):%0A%09%09#
|
04f0a967d9ae5509f778e86486e782d7b581c816 | change the name of object_id /report_crm_fundraising | addons/report_crm/report_crm_fundraising.py | addons/report_crm/report_crm_fundraising.py | from osv import fields,osv
import tools
class report_crm_fundraising(osv.osv):
_name = "report.crm.fundraising"
_auto = False
_inherit = "report.crm.case"
_columns = {
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.... | Python | 0.002681 | @@ -309,35 +309,35 @@
, '=', 'crm.
-opportunity
+fundraising
')%5D%22),%0A
@@ -466,19 +466,19 @@
crm.
-opportunity
+fundraising
')%5D%22
|
17fdb2476abf3458a2d2521860ae48198723f51b | version bump | image_diet/__init__.py | image_diet/__init__.py | from image_diet import signals
from image_diet.diet import squeeze
VERSION = '0.1.4.2'
| Python | 0.000001 | @@ -82,7 +82,7 @@
1.4.
-2
+4
'%0A
|
0507dfbd23db74db1c59bd1084647cc49ef19aee | Change logger messages to info | addons/website_notfound_redirect/ir_http.py | addons/website_notfound_redirect/ir_http.py | # -*- coding: utf-8 -*-
import logging
import urllib2
from openerp.http import request
from openerp.osv import orm
logger = logging.getLogger(__name__)
class ir_http(orm.AbstractModel):
_inherit = 'ir.http'
def _handle_exception(self, exception, code=500):
code = getattr(exception, 'code', code)
... | Python | 0 | @@ -397,23 +397,20 @@
logger.
-warning
+info
(%22404 co
@@ -1029,24 +1029,16 @@
est_old:
-
%0A
@@ -1053,23 +1053,20 @@
logger.
-warning
+info
(%22URL no
@@ -1219,15 +1219,12 @@
ger.
-warning
+info
(%22Re
@@ -1317,24 +1317,16 @@
de=302)%0A
-
%0A
|
c0fbbb42a79baa823b517ee8f537cec1edc057c8 | Replace / with _ in the file hashes in rqtl_mapping.py, since they get translated to directories | wqflask/wqflask/marker_regression/rqtl_mapping.py | wqflask/wqflask/marker_regression/rqtl_mapping.py | import csv
import hashlib
import io
import requests
import shutil
from typing import Dict
from typing import List
from typing import Optional
from typing import TextIO
import numpy as np
from base.webqtlConfig import TMPDIR
from base.trait import create_trait
from utility.tools import locate
import utility.logger
lo... | Python | 0.000001 | @@ -1953,16 +1953,149 @@
digest()
+%0A hash_of_file = hash_of_file.replace(%22/%22, %22_%22) # Replace / with _ to prevent issue with filenames being translated to directories
%0A%0A re
|
f37eebdbd9caa1c1d2f8610e77e380b7e67833e9 | fix file name typo - add more debug statements to logger | pandaharvester/harvestermonitor/cobalt_monitor.py | pandaharvester/harvestermonitor/cobalt_monitor.py | import re
import subprocess
import json
import os.path
from pprint import pprint
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.work_spec import WorkSpec
from pandaharvester.harvestercore.plugin_base import PluginBase
# logger
baseLogger = core_utils.setup_logger()
# qstat out... | Python | 0 | @@ -766,33 +766,32 @@
t:%0A #
-
print %22pprint(di
@@ -813,25 +813,24 @@
#
-
pprint(dir(w
@@ -852,17 +852,16 @@
#
-
print %22p
@@ -896,17 +896,16 @@
#
-
pprint(v
@@ -2011,17 +2011,16 @@
#
-
DPBtmpLo
@@ -3580,17 +3580,16 @@
hStatus,
-
newStatu
@@ -3807,28 +380... |
1fc556ce4f1ede23e15a3b75749bd65a7394d29e | fix documentation error in parse_presence | src/knesset/simple/management/commands/parse_presence.py | src/knesset/simple/management/commands/parse_presence.py | from datetime import datetime, date
import gzip
WORKING_HOURS_PER_WEEK = 80.0
def parse_presence(filename=None):
"""Parse the presence reports text file.
filename is the reports file to parse. defaults to 'presence.txt'
Will throw an IOError if the file is not found, or can't be read
Returns... | Python | 0.000001 | @@ -485,28 +485,24 @@
lues%0A
-not_
enough_data
@@ -546,19 +546,11 @@
we
-didn't have
+had
eno
|
7ee5f5703cc95c6309e1e094963fb833074f88c4 | Remove old test | src/adhocracy_core/adhocracy_core/test_interfaces.py | src/adhocracy_core/adhocracy_core/test_interfaces.py | import unittest
from adhocracy_core.interfaces import ISheet
class SheetToSheetUnitTests(unittest.TestCase):
def test_create_valid(self):
from adhocracy_core.interfaces import SheetToSheet as Reference
# substanced standard tagged values
assert Reference.getTaggedValue('source_integrity'... | Python | 0.000177 | @@ -1758,1367 +1758,8 @@
A%0A%0A%0A
-class TestResourceMetadata:%0A%0A class ISample:%0A pass%0A%0A class ISampleSheetA:%0A pass%0A%0A class ISampleSheetB:%0A pass%0A%0A def make_one(self):%0A from .interfaces import ResourceMetadata%0A meta = ResourceMetadata(content_nam... |
f7182fe4f2f3b4fe91885b20fd91ff9a4f3ecf3a | Add explanation to _signal_client | src/python/grpcio_tests/tests/unit/_signal_client.py | src/python/grpcio_tests/tests/unit/_signal_client.py | # Copyright 2019 the gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 0.000511 | @@ -1546,32 +1546,94 @@
server_target):%0A
+ %22%22%22Initiate a unary RPC to be interrupted by a SIGINT.%22%22%22%0A
global per_p
@@ -2074,24 +2074,90 @@
er_target):%0A
+ %22%22%22Initiate a streaming RPC to be interrupted by a SIGINT.%22%22%22%0A
global p
|
2a68cfe1697a515f39ac21444eb919a9495b3ee7 | Fix statistics module | src/python/statistics/spatio_temporal_aggregation.py | src/python/statistics/spatio_temporal_aggregation.py | #
# Copyright 2015-2016 WIND,FORTH
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version... | Python | 0.000002 | @@ -3067,17 +3067,16 @@
mbda x:
-(
(x.user_
@@ -3222,18 +3222,16 @@
-1)
) %5C%0A
@@ -3252,51 +3252,8 @@
) %5C%0A
- .reduceByKey(lambda x, y: x + y) %5C%0A
@@ -3360,16 +3360,9 @@
da (
-(user_id
+_
, re
@@ -3382,12 +3382,8 @@
ime)
-, _)
: (%0A
|
d796e4864d45153b91bc3253ebb8d0f67d55128f | Add TODO | tests/render/test_data_documentation_site_builder.py | tests/render/test_data_documentation_site_builder.py | import os
import pytest
import json
from great_expectations.render.renderer.site_builder import SiteBuilder
from great_expectations.data_context.types import (
ValidationResultIdentifier
)
def test_configuration_driven_site_builder(titanic_data_context, filesystem_csv_2):
# profiling the Titanic datasource w... | Python | 0.000002 | @@ -1,12 +1,52 @@
+# TODO: Migrate / deprecate this test.%0A%0A
import os%0Aim
|
08b1c8cc29385caa1d8437b18319211838881e20 | Update soft-dtw example docstring | tslearn/docs/examples/plot_barycenter_interpolate.py | tslearn/docs/examples/plot_barycenter_interpolate.py | # -*- coding: utf-8 -*-
"""
Soft-DTW weighted barycenters
=============================
This example presents the weighted Soft-DTW time series barycenter method.
:math:`X_0, X_1, X_2` and :math:`X_3` are time series from 4 different classes
in the Trace dataset.
Other time series are weighted barycenters.
"""
# Aut... | Python | 0 | @@ -158,16 +158,452 @@
ethod.%0A%0A
+Soft-DTW %5B1%5D is a differentiable loss function for Dynamic Time Warping,%0Aallowing for the use of gradient-based algorithms. The barycenter corresponds%0Ato the time series that minimizes the sum of the distances between that time%0Aseries and all the time series from a datase... |
1827b4c5cbb53f652f47acdb45358dfdfda6c228 | use autotools. (#11808) | var/spack/repos/builtin/packages/mpileaks/package.py | var/spack/repos/builtin/packages/mpileaks/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mpileaks(Package):
"""Tool to detect and report leaked MPI objects like MPI_Requests and
... | Python | 0 | @@ -228,16 +228,25 @@
pileaks(
+Autotools
Package)
@@ -637,95 +637,69 @@
def
-install(self, spec, prefix):%0A configure(%22--prefix=%22 + prefix,%0A
+configure_args(self):%0A args = %5B%5D%0A%0A args.append(
%22--w
@@ -714,20 +714,27 @@
t-utils=
+%25s
%22
-+
+%25 self.
s... |
4e335bf4a9dc70d83091e6f4a10671eb13128928 | Use unicode_literals in compressor_precompilers | src/wirecloud/commons/compressor_precompilers.py | src/wirecloud/commons/compressor_precompilers.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 v... | Python | 0.000053 | @@ -772,16 +772,57 @@
ses/%3E.%0A%0A
+from __future__ import unicode_literals%0A%0A
import f
|
b08665d0b815cd5bc7942b490c03840b9054acee | Add packages/ and packages.tar to index | libredo/data/result_httpd.py | libredo/data/result_httpd.py | #!/usr/bin/env python3
# coding:utf-8
from __future__ import print_function
'PackagesHTTPD - stream folder content as .tar over http'
__author__ = 'Mathias Gumz <mgumz@tpip.net>'
__license__ = 'MPL2'
__version__ = ''
import sys
import os, os.path
import zipfile, tarfile
try:
from http.server import SimpleHTTPRe... | Python | 0 | @@ -268,16 +268,57 @@
tarfile%0A
+from StringIO import StringIO%0Aimport cgi%0A
try:%0A
@@ -1348,16 +1348,1309 @@
(self)%0A%0A
+ def list_directory(self, path):%0A try:%0A list = os.listdir(path)%0A except os.error:%0A self.send_error(404, %22No permission to list directory%... |
5cf7a348c7e2e1428fac882fc0beaf18a0502bcf | well, shit. forgot to adjust the second step too | pprof/experiments/polyjit.py | pprof/experiments/polyjit.py | #!/usr/bin/env python
# encoding: utf-8
from ..experiment import Experiment, RuntimeExperiment
from pprof.experiment import step, substep
from ..settings import config
from pprof import likwid
from pprof.utils.db import create_run, get_db_connection
from plumbum import local, FG
from plumbum.cmd import cp, awk, echo,... | Python | 0.999999 | @@ -2054,13 +2054,31 @@
_f,
-*
args
+, has_stdin = False
):%0A
@@ -2199,16 +2199,20 @@
+run_
cmd = ti
@@ -2233,26 +2233,192 @@
S-%25e%22, run_f
-,
+%5D%0A if has_stdin:%0A run_cmd = ( run_cmd%5Bargs%5D %3C sys.stdin )%0A else:%0A ... |
e82f0d863741e4d3ac5791096db77c47f826af4a | remove default none and type str | library/bigip_hostname.py | library/bigip_hostname.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | Python | 0.000001 | @@ -4681,66 +4681,8 @@
True
-,%0A default=None,%0A type='str'
%0A
|
8921f613deeed50b59384777e5bad4e6a7c9108b | Update build script | doc/build.py | doc/build.py | #!/usr/bin/env python
# Build the documentation.
from __future__ import print_function
import errno, os, shutil, sys, tempfile
from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE
from distutils.version import LooseVersion
def pip_install(package, commit=None, **kwargs):
"Install package... | Python | 0.000001 | @@ -246,16 +246,83 @@
ersion%0A%0A
+versions = %5B'1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0'%5D%0A%0A
def pip_
@@ -3145,16 +3145,32 @@
=
+ %7B0%7D/container.h
%7B0%7D/for
@@ -3189,16 +3189,44 @@
tream.h
+%5C%0A
%7B0%7D/prin
@@ -3584,24 +3584,81 @@
_WIN32=1 %5C%0A
+ ... |
1751d37ff7b155833dab612540c2f9aea8fbcbff | Add clarifying comments / call to action for _ValidateEMA model test helper. | lingvo/models_test_helper.py | lingvo/models_test_helper.py | # Lint as: python2, python3
# Copyright 2018 The TensorFlow 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
#
... | Python | 0 | @@ -3402,16 +3402,181 @@
s.train%0A
+ # If the model has explicitly specified ema_decay_moving_vars to%0A # True or False, then we assume they understand the implication%0A # of that choice.%0A
if
@@ -3745,24 +3745,183 @@
hNormLayer.%0A
+ #%0A # If a model fails this test, the user sho... |
5b14ed5ad9b45830951b2bf495bf1d46feeed7cf | remove superfluous shebang | alfred.py | alfred.py | #!/usr/bin/env python3
import subprocess
import json
def _fetch(data_type):
output = subprocess.check_output(["alfred-json", "-z", "-f", "json", "-r", str(data_type)])
return json.loads(output.decode("utf-8")).values()
def nodeinfo():
return _fetch(158)
def statistics():
return _fetch(159)
def v... | Python | 0.999951 | @@ -1,27 +1,4 @@
-#!/usr/bin/env python3%0A
impo
|
2c13128cdb2296f3b7920d8b1c083d01445c1a76 | Remove wait | allsky.py | allsky.py | import time
import numpy as np
import logging
import subprocess
import signal
import sys
import time
import os
import json
FORMAT = '%(asctime)-15s %(message)s'
logging.basicConfig(format=FORMAT,level=logging.DEBUG)
logger = logging.getLogger('imgserver')
def camera_active():
# is the camera running?
cmd = "p... | Python | 0.000002 | @@ -742,17 +742,15 @@
-a
-'
%7Bannot%7D
-'
-o
@@ -819,139 +819,8 @@
se)%0A
- for n in range(0,100):%0A if proc.poll() is None:%0A time.sleep(0.5)%0A proc.send_signal(signal.SIGUSR1)
%0A
|
8af3aef367135dbbc55e573c6a943a86ff3ccd9d | Use an absolute Path for localization tests | survey/tests/locale/test_locale_normalization.py | survey/tests/locale/test_locale_normalization.py | import os
import platform
import subprocess
import unittest
class TestLocaleNormalization(unittest.TestCase):
LOCALE_PATH = "survey/locale/"
def test_normalization(self):
""" We test if the messages were properly created with makemessages --no-obsolete --no-wrap. """
if platform.system() == ... | Python | 0 | @@ -53,16 +53,41 @@
nittest%0A
+from pathlib import Path%0A
%0A%0Aclass
@@ -153,24 +153,43 @@
H =
+Path(
%22survey
-/
+%22, %22
locale
-/
%22
+).absolute()
%0A%0A
|
7a174e05108b673ae3e6a7b259ee8992b764e973 | Use more robust quickfix parser. | lintreview/tools/yamllint.py | lintreview/tools/yamllint.py | import os
import logging
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
log = logging.getLogger(__name__)
class Yamllint(Tool):
name = 'yamllint'
def check_dependencies(self):
"""
See if yamllint is on the PATH
"""
... | Python | 0 | @@ -92,16 +92,34 @@
_command
+, process_quickfix
%0Afrom li
@@ -1234,490 +1234,57 @@
-for line in output:%0A filename, line, error = self._parse_line(line)%0A self.problems.add(filename, line, error)%0A%0A def _parse_line(self, line):%0A %22%22%22%0A yamllint only generate... |
8577fc79f2dbe2cb016f5e04cc0627505fddca03 | Clear the version information on asset change | avalon/tools/cbloader/app.py | avalon/tools/cbloader/app.py | import os
import sys
import time
from ..projectmanager.widget import AssetWidget, AssetModel
from ...vendor.Qt import QtWidgets, QtCore, QtGui
from ... import api, io
from .. import lib
from .widgets import SubsetWidget, VersionWidget
module = sys.modules[__name__]
module.window = None
module.root = api.registered_ro... | Python | 0.000001 | @@ -4462,16 +4462,129 @@
nts(i)%0A%0A
+ # Clear the version information on asset change%0A self.data%5B'model'%5D%5B'version'%5D.set_version(None)%0A%0A
|
b73a4030a03e9791ed8fc1002ab65300bbd02081 | Add new error handler to errors.py | lib/axon/errors.py | lib/axon/errors.py | # coding: utf-8
# The MIT License (MIT)
#
# Copyright (c) <2011-2015> <Shibzukhov Zaur, szport at gmail dot com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, incl... | Python | 0.000001 | @@ -2494,32 +2494,118 @@
ted key:val')%0A#%0A
+def error_expected_named_constant(self):%0A error(self, 'Expected named constant')%0A#%0A
def error_getnum
|
99c92e145724a6e980c3d7ce063a33c29dce67f9 | add the docstring of threshold_finders.brightness.find() | color_contrast_calc/threshold_finders/brightness.py | color_contrast_calc/threshold_finders/brightness.py | '''Module that implements the main logic of the instance method
``Color.find_brightness_threshold``.
'''
import math
from .. import checker
from ..converters.brightness import calc_rgb
from . import binary_search_width
from .criteria import threshold_criteria
def find(fixed_color, other_color, level=checker.WCAGLev... | Python | 0.000593 | @@ -321,16 +321,676 @@
el.AA):%0A
+ %22%22%22Try to find a color who has a satisfying contrast ratio.%0A%0A The color returned by this function will be created by changing the%0A brightness of %60%60other_color%60%60. Even when a color that satisfies the%0A specified level is not found, the function retur... |
3e8a64f522986f0b41836e045bf3826def55577f | Disable internet access for non-online tests | sunpy/conftest.py | sunpy/conftest.py | from __future__ import absolute_import, print_function
from functools import partial
import os
import socket
import tempfile
import json
from sunpy.extern.six.moves.urllib.request import urlopen
from sunpy.extern.six.moves.urllib.error import URLError
import pytest
# Force MPL to use non-gui backends for testing.
... | Python | 0.000001 | @@ -402,16 +402,60 @@
'Agg')%0A%0A
+from astropy.tests import disable_internet%0A%0A
from sun
@@ -814,16 +814,21 @@
%0A %22%22%22
+%0A
pytest h
@@ -987,17 +987,16 @@
ested).%0A
-%0A
%22%22%22%0A
@@ -1216,16 +1216,195 @@
name))%0A%0A
+ if 'online' not in item.keywords:%0A disable_inte... |
7a38e10afb3eaa62c8dc893566f0f52bfe1d73c8 | throw ProviderRateLimitError in slideshare provider when over quota | totalimpact/providers/slideshare.py | totalimpact/providers/slideshare.py | from totalimpact.providers import provider
from totalimpact.providers.provider import Provider, ProviderContentMalformedError, ProviderItemNotFoundError
import simplejson, urllib, time, hashlib, re, os
from xml.dom import minidom
from xml.parsers.expat import ExpatError
import logging
logger = logging.getLogger('ti.... | Python | 0 | @@ -141,24 +141,48 @@
otFoundError
+, ProviderRateLimitError
%0A%0Aimport sim
@@ -3253,24 +3253,363 @@
tFoundError%0A
+ elif (%22Account Exceeded Daily Limit%22 in page):%0A logger.info(u%22Exceeded api limit for provider %7Bprovider%7D%22.format(%0A provider=self.provide... |
9ff9a5585ad1535840fd802421c0664ae75c6460 | Add some additional test cases for types. | libcloud/test/compute/test_types.py | libcloud/test/compute/test_types.py | import sys
import unittest
from unittest import TestCase
from libcloud.compute.types import Provider, NodeState, StorageVolumeState, \
VolumeSnapshotState, Type
class TestType(Type):
INUSE = "inuse"
class TestTestType(TestCase):
model = TestType
attribute = TestType.INUSE
def test_provider_tos... | Python | 0 | @@ -203,16 +203,42 @@
%22inuse%22%0A
+ NOTINUSE = %22NOTINUSE%22%0A
%0A%0Aclass
@@ -285,39 +285,8 @@
Type
-%0A attribute = TestType.INUSE
%0A%0A
@@ -389,16 +389,91 @@
%22INUSE%22)
+%0A self.assertEqual(Provider.tostring(TestType.NOTINUSE), %22NOTINUSE%22)
%0A%0A de
@@ -568,32 +568,109 @@
Test... |
1d27673abd4782bdb42b67bc522fe7c48fa0e8ba | remove non used params on liked media method | libsaas/services/instagram/media.py | libsaas/services/instagram/media.py | from libsaas import http, parsers
from libsaas.services import base
from . import resource
from .comments import Comments, Comment
from .likes import Likes
class MediaBase(resource.ReadonlyResource):
path = 'media'
class Media(MediaBase):
@base.resource(Comments)
def comments(self):
"""
... | Python | 0.000001 | @@ -3075,71 +3075,13 @@
max_
-timestamp=None, min_timespan=None,%0A min_id=None, max
+liked
_id=
|
3279c37bea364f644045dab7aa13c2639e10767d | Remove a debugging statement | tests/functional/plugins/pmxbot_test_commands.py | tests/functional/plugins/pmxbot_test_commands.py | from pmxbot import core
@core.command("crashnow")
def crash_immediately():
"Crash now!"
raise TypeError("You should never call this!")
@core.command("crashiter")
def crash_in_iterator():
"Crash in iterator!"
raise TypeError("You should never call this!")
yield "You can't touch this"
@core.regexp('feck', r'\bf... | Python | 0.007895 | @@ -446,21 +446,22 @@
-yield
+return
%22Clean
@@ -491,34 +491,8 @@
nick
-%0A yield repr(match)
%0A%0A@c
|
eb26510d3a1ccfaa9e4f8e1e0c91b5c74ae7393e | Switch bitnami images in tests to "standard" ones (#23122) | tests/providers/docker/decorators/test_docker.py | tests/providers/docker/decorators/test_docker.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 0 | @@ -1041,32 +1041,16 @@
(image=%22
-quay.io/bitnami/
python:3
@@ -1043,32 +1043,37 @@
mage=%22python:3.9
+-slim
%22)%0A def f
@@ -1507,32 +1507,16 @@
(image=%22
-quay.io/bitnami/
python:3
@@ -1509,32 +1509,37 @@
mage=%22python:3.9
+-slim
%22)%0A def f
@@ -2075,32 +2075,16 @@
image=%22
-quay.io/b... |
c952a15b1c66a5e9b4f17bb2e8b4d11f030a455d | update mixins | digest/mixins.py | digest/mixins.py | # -*- encoding: utf-8 -*-
import datetime
import random
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
from django.utils.cache import patch_response_headers
from django.utils.decorators import method_decorator
from django.views.decorators.cache impo... | Python | 0 | @@ -1878,16 +1878,39 @@
in items
+ if item.vote_total %3E 0
%5D%0A
|
4b83009e1ffc109b09fbd66e6cdf2e47ae5f700e | add dependency for transport documents | logistic_requisition/__openerp__.py | logistic_requisition/__openerp__.py | # -*- coding: utf-8 -*-
#
#
# Author: Joël Grand-Guillaume, Jacques-Etienne Baudoux, Guewen Baconnier
# 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
# published by the Free Softw... | Python | 0 | @@ -1279,24 +1279,80 @@
formation%22,%0A
+ %22purchase_requisition_transport_document%22,%0A
|
b0d5d9ee2e507906f5af75d5f62c0db3836dfc00 | Reformat for 80 chars | aspen/hooks/filters.py | aspen/hooks/filters.py | import re
def by_regex(hook, regex_tuples, default=True):
"""A filter for hooks. regex_tuples is a list of (regex, filter?) where if the regex matches
the requested URI, then the hook is applied or not based on if filter? is True or False.
"""
regex_res = [ (re.compile(regex), disposition) for rege... | Python | 0 | @@ -79,16 +79,21 @@
r hooks.
+%0A%0A
regex_t
@@ -158,20 +158,17 @@
ches
+ the
%0A
- the
requ
@@ -237,16 +237,20 @@
is True
+%0A
or Fals
@@ -252,16 +252,17 @@
False.%0A
+%0A
%22%22%22%0A
@@ -311,16 +311,45 @@
osition)
+ %5C%0A
for reg
@@ -847,16 +847,20 @@
URI ... |
5ffaef699513f3145033cb6f0cb7360332834f82 | Prepare new attributes for Anime model | mangaki/mangaki/models.py | mangaki/mangaki/models.py | # coding=utf8
from django.db import models
from django.contrib.auth.models import User
from mangaki.api import get_discourse_data
from mangaki.choices import ORIGIN_CHOICES, TYPE_CHOICES
class Work(models.Model):
title = models.CharField(max_length=128)
source = models.CharField(max_length=1044, blank=True)
... | Python | 0 | @@ -726,59 +726,387 @@
-# editor%0A # category%0A # genre1
+%22%22%22studio = models.ForeignKey('Studio')%0A author = models.ForeignKey('Artist', related_name='authored')%0A editor = models.ForeignKey('Editor')%0A anime_type = models.TextField(max_length=42, choices=ANIME_TYPE_CHOICES)%0A genre ... |
f1dd58d58250e12e59800aef1fc8792ddf700b0e | Raise LockTimeout when 'lock' status from renderd | mapproxy/cache/renderd.py | mapproxy/cache/renderd.py | # This file is part of the MapProxy project.
# Copyright (C) 2012, 2013 Omniscale <http://omniscale.de>
#
# 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/L... | Python | 0 | @@ -982,16 +982,59 @@
rceError
+%0Afrom mapproxy.util.lock import LockTimeout
%0A%0Adef ha
@@ -2650,16 +2650,274 @@
nderd'))
+%0A elif result%5B'status'%5D == 'lock':%0A log_request(address, 503, None, duration=duration, method='RENDERD')%0A raise LockTimeout(%22Lock timeout from renderd... |
463fcd0832b29fa1d6fec55f827f767ee0edd466 | fix some lint warnings | matplotlib2tikz/legend.py | matplotlib2tikz/legend.py | # -*- coding: utf-8 -*-
#
import warnings
from . import color as mycol
def draw_legend(data, obj):
'''Adds legend code to the EXTRA_AXIS_OPTIONS.
'''
texts = []
childrenAlignment = []
for text in obj.texts:
texts.append('%s' % text.get_text())
childrenAlignment.append('%s' % text.ge... | Python | 0.000037 | @@ -65,16 +65,17 @@
mycol%0A%0A
+%0A
def draw
@@ -2159,16 +2159,17 @@
'black':
+
# black
@@ -2172,32 +2172,32 @@
lack is default%0A
-
lege
@@ -2470,16 +2470,17 @@
'white':
+
# white
@@ -2804,16 +2804,33 @@
gs.warn(
+%0A
'Varying
@@ -2882,16 +2882,33 @@
efault.'
+%0A ... |
047af39889aa08377effff5b25027325d698548c | Fix similar bug with albums | mediacrush/views/media.py | mediacrush/views/media.py | from flask.ext.classy import FlaskView, route
from flaskext.bcrypt import check_password_hash
from flask import send_file, render_template, abort, request, Response, g, redirect, current_app
import os
import json
import mimetypes
import random
from mediacrush.files import extension, get_mimetype, delete_file
from med... | Python | 0.000001 | @@ -3275,32 +3275,53 @@
data != 'null':%0A
+ try:%0A
meta
@@ -3342,32 +3342,73 @@
ads(f.metadata)%0A
+ except:%0A pass%0A
if 'has_
|
b73c53240ca6e51df8bb9a82a4724513ea250aa8 | Fix submit parameter consumption for MQ driven managers. | lwr/manager_endpoint_util.py | lwr/manager_endpoint_util.py | """ Composite actions over managers shared between HTTP endpoint (routes.py)
and message queue.
"""
from lwr.lwr_client.setup_handler import build_job_config
from lwr.managers import status
from galaxy.tools.deps import dependencies
def full_status(manager, job_status, job_id):
if job_status in [status.COMPLETE, ... | Python | 0 | @@ -1928,23 +1928,16 @@
ig.get('
-submit_
params',
|
cc246bd43efbc5e3873525f160eb360fb3335392 | fix logging issue with create_mapping | src/encoded/commands/create_mapping_on_deploy.py | src/encoded/commands/create_mapping_on_deploy.py | import argparse
import structlog
import logging
from pyramid.paster import get_app
from snovault.elasticsearch.create_mapping import run as run_create_mapping
from dcicutils.beanstalk_utils import whodaman
log = structlog.getLogger(__name__)
EPILOG = __doc__
def main():
parser = argparse.ArgumentParser(
... | Python | 0 | @@ -153,16 +153,49 @@
mapping%0A
+from snovault import set_logging%0A
from dci
|
4988bbe7fa3e75062bc0048aff18cba8d57a9bc1 | add more generic get_objs function | djangotoolbox/contrib/auth/models.py | djangotoolbox/contrib/auth/models.py | from django.db import models
from django.contrib.auth.models import User, Group, Permission
from djangotoolbox.fields import ListField
class UserPermissionList(models.Model):
user = models.ForeignKey(User)
_fk_list = ListField(models.ForeignKey(Permission))
def _get_permissions(self):
if... | Python | 0 | @@ -134,1255 +134,965 @@
ld%0A%0A
- %0Aclass UserPermissionList(models.Model):%0A user = models.ForeignKey(User)%0A _fk_list = ListField(models.ForeignKey(Permission))%0A%0A def _get_permissions(self):%0A if not hasattr(self, '_permissions_cache'):%0A perm_ids = self._fk_list%0A ... |
a54e9399ca0e3b4f9f71b8cfb9841822fb4299b2 | update markdownify to take advantage of those files | lib/markdownify.py | lib/markdownify.py | import sys
import os
from collections import OrderedDict
from os.path import exists, join as path_join
from .find_unmerged_branches_in_cwd import find_unmerged_branches_in_cwd
from .specs import get_files_and_steps
from .run import run
def unicode_truncate(string, length, encoding='utf-8'):
encoded = string.encod... | Python | 0 | @@ -4376,18 +4376,18 @@
nputs',
-%7B%7D
+%5B%5D
)%0A fo
@@ -4400,84 +4400,472 @@
name
-, contents
+ in inputs:%0A # remember that we're currently
in
-inputs.items():%0A with open(path_join(cwd, filename)
+%E2%80%A6 a folder. frick.%0A # can't assume that this is a child of the student's f... |
6f5292755523d717516379651c66c6fabfe594f8 | Fix bug in item mapping | lib/oelite/item.py | lib/oelite/item.py | from oebakery import die, err, warn, info, debug
class OEliteItem:
def __init__(self, item, context = (0, None)):
item = item.split(":", 1)
if len(item) == 1:
self.type = None
item = item[0]
else:
self.type = item[0]
item = item[1]
i... | Python | 0 | @@ -2361,37 +2361,38 @@
%22host%22%09%09: %22
-nativ
+machin
e%22,%0A
|
348f2be19271f445c899b41ba66988b73b96b1b3 | Make backends tests more resistant | src/mist/io/tests/gui/features/steps/backends.py | src/mist/io/tests/gui/features/steps/backends.py | from behave import *
from time import time, sleep
try:
from mist.io.tests.settings import CREDENTIALS
except ImportError:
pass
@given(u'backends credentials')
def load_backend_credentials(context):
context.credentials = CREDENTIALS
@given(u'"{backend}" backend added')
def given_backend(context, backend... | Python | 0.000011 | @@ -5530,32 +5530,49 @@
e() %3C end_time:%0A
+ try:%0A
backends
@@ -5628,32 +5628,36 @@
ttons%22)%0A
+
+
backend_buttons
@@ -5705,32 +5705,36 @@
i-btn%22)%0A
+
for button in ba
@@ -5752,32 +5752,36 @@
ns:%0A
+
+
if backend in bu
@@ -5807,23 +5807,68 @@... |
abefab5b688f22b0e569c33f0713ec5ec7db4c99 | Return localized team list with organization details | src/sentry/api/endpoints/organization_details.py | src/sentry/api/endpoints/organization_details.py | from __future__ import absolute_import
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry import features
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.decorators import sudo_required
from sent... | Python | 0.000004 | @@ -1412,32 +1412,243 @@
h%7D%0A%0A %22%22%22%0A
+ if request.user.is_authenticated():%0A team_list = list(Team.objects.get_for_user(%0A organization=organization,%0A user=request.user,%0A ))%0A else:%0A
team_lis
@@ -1669,32 +1669,36... |
6aeeff66c829af214a611ac0a1c65e836c9236e2 | Fix pep8 for mixins module. | linguist/mixins.py | linguist/mixins.py | # -*- coding: utf-8 -*-
import copy
from django.db import models
from django.db.models.fields import NOT_PROVIDED
from . import settings
from .models import Translation
from .utils.i18n import (get_cache_key,
build_localized_field_name,
get_language,
... | Python | 0 | @@ -21,100 +21,8 @@
-*-%0A
-import copy%0A%0Afrom django.db import models%0Afrom django.db.models.fields import NOT_PROVIDED%0A%0A
from
@@ -96,17 +96,16 @@
import
-(
get_cach
@@ -113,149 +113,8 @@
_key
-,%0A build_localized_field_name,%0A get_language,%0A ... |
fb6c1cc3da1a632e922c7bdeb467ad9f9cb32efe | undo temporary changes needed to fix #2699 | lino/utils/ajax.py | lino/utils/ajax.py | # -*- coding: UTF-8 -*-
# Copyright 2011-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""This middleware is automatically being installed on every Lino
site.
When an exception occurs during an AJAX call, Lino should not respond
with Django's default HTML formatted error report but with a
plain-te... | Python | 0 | @@ -1538,18 +1538,13 @@
%22%22%22%0A
-
%0A
-#
no_t
@@ -1592,24 +1592,26 @@
otExist)%0A
+ #
no_tracebac
@@ -1636,16 +1636,220 @@
ied, )%0A%0A
+ # see also /docs/specs/invalid_requests.rst%0A # it can be helpful to temporarily disable filtering of ObjectDoesNotExist%0A # exceptions on a product... |
efb7040cc852ac2f4c80cd86206ce435f841598a | Use `waitFor` instead of `sleep` to make test robust. | src/zeit/content/article/edit/browser/testing.py | src/zeit/content/article/edit/browser/testing.py | import time
import transaction
import zeit.cms.clipboard.interfaces
import zeit.cms.testing
import zeit.content.article.testing
import zope.security.management
class BrowserTestCase(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.article.testing.LAYER
block_type = NotImplemented
def setUp(self)... | Python | 0 | @@ -2769,20 +2769,47 @@
-time.sleep(2
+s.waitForElementPresent('link=Struktur'
)%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.