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 |
|---|---|---|---|---|---|---|---|
030b23f4b7a0c0729e87d3cc712c37198ff9c6e2 | Add setters + use own name. | pynessus/models/group.py | pynessus/models/group.py | """
Copyright 2014 Quentin Kaiser
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
dis... | Python | 0 | @@ -1027,33 +1027,27 @@
create(self
-, name
):%0A
+
%22%22%22%0A
@@ -1283,32 +1283,37 @@
%7B%22name%22:
+self.
name%7D%0A
@@ -1657,14 +1657,8 @@
self
-, name
):%0A
@@ -1923,16 +1923,21 @@
%22name%22:
+self.
name%7D%0A
@@ -2731,32 +2731,32 @@
t supported.%22)%0A%0A
-
def lis... |
d7249e710be3da451b4ca752780e5a86501f6198 | update version number to 1.8.3 | python/flame/__init__.py | python/flame/__init__.py |
from collections import OrderedDict
from ._internal import (Machine as MachineBase,
GLPSPrinter, _GLPSParse,
_pyapi_version, _capi_version,
FLAME_ERROR, FLAME_WARN,
FLAME_INFO, FLAME_DEBUG,
setLogLe... | Python | 0.000006 | @@ -1502,11 +1502,11 @@
= '1.8.
-1
+3
'%0A
|
7a82076b8c7fb61a317053749957cf735721808a | Fix spelling error in recordio module description (#5892) | python/mxnet/recordio.py | python/mxnet/recordio.py | """Read and write for the RecrodIO data format."""
from __future__ import absolute_import
from collections import namedtuple
import ctypes
import struct
import numbers
import numpy as np
from .base import _LIB
from .base import RecordIOHandle
from .base import check_call
from .base import c_str
try:
import cv2
ex... | Python | 0.000001 | @@ -22,18 +22,18 @@
the Rec
-r
o
+r
dIO data
|
1809f2d3c73bff910fb7e538ace0e2584d1bd857 | remove debug print | python/smurff/prepare.py | python/smurff/prepare.py | import numpy as np
import scipy as sp
import pandas as pd
import scipy.sparse
import numbers
from .helper import SparseTensor
def make_sparse(Y, nnz, shape = None, seed = None):
Ytr, Yte = make_train_test(Y, nnz, shape, seed)
return Yte
def make_train_test(Y, ntest, shape = None, seed = None):
"""Split... | Python | 0.000001 | @@ -121,16 +121,38 @@
seTensor
+%0Afrom . import wrapper
%0A%0Adef ma
@@ -2247,242 +2247,8 @@
r)%0A%0A
- print(%22train = %22, train)%0A print(%22test = %22, test)%0A print(%22Y.columns = %22, Y.columns)%0A print(%22Y.columns%5B0%5D = %22, Y.columns%5B0%5D)%0A print(%22np.array(Y.c... |
2573670f0875e48cfacfb96f61a69b63c80cbec7 | debug flag | analysis.py | analysis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Author: Tim Henderson
#Email: tim.tadh@hackthology.com
#For licensing see the LICENSE file in the top level directory.
import itertools
from gram_parser import parse, EmptyString, EoS, NonTerminal
def first(productions, sym):
if isinstance(sym, tuple):
symbo... | Python | 0 | @@ -1779,24 +1779,37 @@
(productions
+, DEBUG=False
):%0A ret =
@@ -2145,24 +2145,54 @@
) != set():%0A
+ if DEBUG:%0A
@@ -2193,32 +2193,36 @@
print%0A
+
@@ -2258,32 +2258,36 @@
+
print ' '*4, a%0A
@@ -2277,32 +2277,36 @@
p... |
a26e735796534c34b31eef0d8f19eb400d137b9c | allow for empty string argument | pywebdata/baseservice.py | pywebdata/baseservice.py | import copy
import json
import requests
from itertools import product, imap
from xml.etree import ElementTree as ET
from parameter import Input, Output
from parsers import parse_query
output_parsers = {'json': json.loads, 'xml': ET.parse}
class ServiceMount(type):
def __init__(self, name, bases, attrs):
... | Python | 0.000223 | @@ -1358,10 +1358,12 @@
ing=
-''
+None
):%0A
@@ -1369,19 +1369,18 @@
-out
+in
puts = s
@@ -1391,45 +1391,17 @@
get_
-out
+in
puts()%0A
- if qry_string:%0A
@@ -1528,32 +1528,36 @@
qry))%0A%0A
+get_
input_ranges = %5B
@@ -1555,138 +1555,27 @@
ange
-s
=
-%5B%5D%0A inp... |
b42f1a89ad849274d2b6e78dfb772e95b49d23de | remove unused variable | qa_tests/bcr_unittest.py | qa_tests/bcr_unittest.py | # Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuake is distributed in the hope that it will be useful,
# but WITHOUT AN... | Python | 0.001259 | @@ -1899,29 +1899,8 @@
%7D
-%0A delta = 1e-5
%0A%0A
|
6708830ab2bde841bbc3da2befbbe5ab9f3d21aa | Put test stuff inside `if __name__ == '__main__'` | ansi_str.py | ansi_str.py | import re
_ansi_re = re.compile('\033\[((?:\d|;)*)([a-zA-Z])')
def strip_ansi(value):
return _ansi_re.sub('', value)
def len_exclude_ansi(value):
return len(strip_ansi(value))
class ansi_str(str):
"""A str subclass, specialized for strings containing ANSI escapes.
When you call the ``len`` metho... | Python | 0.00001 | @@ -755,16 +755,48 @@
ipped)%0A%0A
+%0Aif __name__ == '__main__':%0A
# s = an
@@ -809,16 +809,20 @@
('abc')%0A
+
# print
@@ -823,16 +823,20 @@
print s%0A
+
# print
@@ -843,16 +843,20 @@
len(s)%0A%0A
+
s = ansi
@@ -894,24 +894,28 @@
1b%5B0m')%0A
+
print s%0A
print le
@@ -906,16 +906,20 @... |
adf8c09588c0e95207738a72dd1ec3f5fa3f7338 | version 0.5.13 | api/info.py | api/info.py | from collections import OrderedDict
from rest_framework import viewsets, mixins, response, reverse
NAME = 'vsemionov.boomerang.api'
VERSION = '0.5.12.2'
class ApiInfoViewSet(mixins.ListModelMixin,
viewsets.GenericViewSet):
view_name = 'Api Info'
@staticmethod
def _get_user_url(request... | Python | 0.000001 | @@ -147,11 +147,9 @@
.5.1
-2.2
+3
'%0A%0A%0A
|
0a4652c7221c16aa2a95e33dd9742e1d64fa45d5 | Fix person search | api/view.py | api/view.py | # -*- coding: utf-8 -*-
from flask import abort, make_response, request
from flask.ext.sqlalchemy import BaseQuery
from flask.views import MethodView
from api.models.api_key import ApiKey
from utils.jsonify import jsonify
class ApiView(MethodView):
'''Create basic REST HTTP endpoints for a single resource type.... | Python | 0.000004 | @@ -2576,24 +2576,85 @@
et('q', '')%0A
+%0A if self.model.__module__=='popong_models.bill':%0A
s =
@@ -2679,32 +2679,36 @@
s', '')%0A
+
+
return self._que
@@ -2719,16 +2719,20 @@
ilter(%5C%0A
+
@@ -2799,32 +2799,36 @@
+
self.model.spons
@@ -2857,... |
17812e091bcf2a0bc8ad54fc76bb8c9bfeb97148 | Clean up | ab_state.py | ab_state.py | #!/usr/bin/python
import board
import game_state
import alpha_beta
import nearby_filter
import game
import gui
from board_strip import *
from length_counter import *
from take_counter import *
import pdb
CAPTURE_SCORE_BASE = 120 ** 3
TAKE_SCORE_BASE = 190
class ABState():
""" Bridge for state, for use by alph... | Python | 0.000002 | @@ -5004,16 +5004,89 @@
lusive%0A%0A
+ length_counters = %5BNone, self.black_lines, self.white_lines%5D%0A
@@ -5158,41 +5158,22 @@
ca,
-self.black_lines, self.white_line
+length_counter
s, i
@@ -5737,32 +5737,32 @@
terminal(self):%0A
+
return s
@@ -5803,957 +5803,4 @@
TY%0A%0A
-'''%0... |
b9e12e6bb1d4d4cdb337cbf3d3cd7a41f57b4d24 | Use a more standard RPM query format | JsonStats/FetchStats/Plugins/RPM.py | JsonStats/FetchStats/Plugins/RPM.py | import datetime
from JsonStats.FetchStats import Fetcher
class RPM(Fetcher):
def __init__(self):
"""
Returns an rpm manifest (all rpms installed on the system.
**Note**: This takes more than a few seconds!!
"""
self.context = 'rpm'
self._load_data()
def _load_... | Python | 0.999989 | @@ -462,16 +462,35 @@
VERSION%7D
+-%25%7BRELEASE%7D.%25%7BARCH%7D
%5Cn%22'%0A%0A
|
93e40e791153ee07dad3410388e662de99efcbb0 | fix goodrain run error | app/blog.py | app/blog.py | #!/usr/bin/env python3
# coding=utf-8
"""
@version:0.1
@author: ysicing
@file: blog/blog.py
@time: 2017/9/10 22:46
"""
from flask_frozen import Freezer
from flask_flatpages import FlatPages
from flask import current_app as app
flatpages = FlatPages(app)
freezer = Freezer(app)
class Post(object):
def __init__... | Python | 0.000011 | @@ -1403,32 +1403,91 @@
%E7%AB%A0%E5%88%97%E8%A1%A8%0A %22%22%22%0A
+ if isinstance(tag, int):%0A tag = str(tag)
%0A tag = t
|
9ec8aa9fbb9b8c6656e5fe8920787f2c03a93683 | create Cell class and method add_neighbor that returns a list of neighbor positions | app/life.py | app/life.py | Python | 0 | @@ -0,0 +1,484 @@
+class Cell(object):%0A%0A def __init__(self, pos):%0A self.neighbors = 0%0A self.neighbor_list = %5B%5D%0A self.pos = pos%0A self.posx = pos%5B0%5D%0A self.posy = pos%5B1%5D%0A%0A def add_neighbors(self):%0A self.neighbor_list = %5B%5D%0A%0A for ... | |
777eaf01586b330b976c2691bf73b9a2053ff978 | Store real non-stemmed texts | app/main.py | app/main.py | from flask import *
import collect_hs
import collections
import nltk
import numpy
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
app = Flask(__name__)
## common constructs
stem = nltk.stem.snowball.SnowballStemmer('finnish')
@app.route("/"... | Python | 0.000005 | @@ -590,16 +590,31 @@
xts = %5B%5D
+%0A texts = %5B%5D
%0A%0A fo
@@ -630,16 +630,53 @@
mments:%0A
+%0A _texts.append( c%5B'text'%5D )%0A%0A
@@ -768,33 +768,32 @@
text )%0A
-_
texts.append( '
|
1056c3f489b162d77b6c117fad2b45bfa06beee1 | Revert "Added a post view" | app/urls.py | app/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
#from . import views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'app.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', 'app.views.splash', name='... | Python | 0 | @@ -133,18 +133,16 @@
views%0A%0A
-%0A%0A
urlpatte
@@ -793,80 +793,9 @@
p'),
- #delete eventually%0A url(r'%5Eposts', 'app.views.posts', name='posts'),
+%0A
%0A
@@ -839,9 +839,8 @@
rls))%0A)%0A
-%0A
|
1165c923145be18d40fda1fc4303cac3e1613078 | Update cached_function wrapper to set qualname instead of name | app/util.py | app/util.py | # Various utility functions
import os
SHOULD_CACHE = os.environ.get('ENV', 'development') == 'production'
def cached_function(func):
data = {}
def wrapper(*args):
if not SHOULD_CACHE:
return func(*args)
cache_key = ' '.join([str(x) for x in args])
if cache_key not in dat... | Python | 0 | @@ -404,16 +404,20 @@
apper.__
+qual
name__ =
@@ -424,16 +424,20 @@
func.__
+qual
name__%0A
|
48f517b0b6639bcecd5bac6e2c2e750441ffc347 | reset compass fully | nodes/compass.py | nodes/compass.py | #!/usr/bin/env python
"""
Copyright (c) 2012, Michael Koval
Copyright 2012, Cody Schafer <cpschafer --- gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must ... | Python | 0 | @@ -1860,16 +1860,38 @@
UP_180)%0A
+ compass.stopAll()%0A
comp
@@ -2850,48 +2850,8 @@
= 1%0A
- compass.stopStreaming()%0A
|
7e8e7ff7438bad167a64beeda0d4e66562886841 | Improve JSON rendering for invoice item [WAL-2168] | src/waldur_mastermind/invoices/admin.py | src/waldur_mastermind/invoices/admin.py | from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import admin
from django.forms import ModelForm, ModelChoiceField
from django.http import HttpResponse
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.html import format_html
from django... | Python | 0 | @@ -589,23 +589,23 @@
%0A%0Aclass
-Invo
+Gener
ic
-e
ItemInli
@@ -677,24 +677,31 @@
el = models.
+Generic
InvoiceItem%0A
@@ -723,16 +723,25 @@
elds = (
+%0A
'name',
@@ -787,31 +787,16 @@
'end',%0A
-
@@ -861,272 +861,299 @@
ode'
-)%0A exclude = ('project',)%0A%0A%0Aclass G... |
a6ad8491e8e8625acb3eee0bf703848a94f1cad8 | Use title-case header name to request value | src/weitersager/http.py | src/weitersager/http.py | """
weitersager.http
~~~~~~~~~~~~~~~~
HTTP server to receive messages
:Copyright: 2007-2021 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from dataclasses import dataclass
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import sys
from typing impo... | Python | 0 | @@ -2019,17 +2019,17 @@
rs.get('
-a
+A
uthoriza
|
d39eb13f555daa429838b76de2f4088a46f36237 | tweak `do` | amino/do.py | amino/do.py | from types import GeneratorType
from typing import TypeVar, Callable, Any, Generator, cast, Optional, Type
import functools
from amino.tc.base import F
from amino.tc.monad import Monad
A = TypeVar('A')
B = TypeVar('B')
G = TypeVar('G', bound=F)
Do = Generator
def untyped_do(f: Callable[..., Generator[G, B, None]]) ... | Python | 0.000001 | @@ -88,18 +88,8 @@
ast,
- Optional,
Typ
@@ -587,29 +587,29 @@
-c: Optional%5BF%5D =
+init = itr.send(
None
+)
%0A
@@ -618,35 +618,32 @@
m
-: Optional%5BMonad%5BF%5D%5D = None
+ = Monad.fatal_for(init)
%0A
@@ -677,34 +677,8 @@
B%5D:%0A
- nonlocal c, m%0A
@@ -710,11 +710,14 @@
... |
9d52ed3867192ec47d7c218fa9bb9d4e5d16f1cc | Update src/compas_rhino/interop/primitives.py | src/compas_rhino/interop/primitives.py | src/compas_rhino/interop/primitives.py | from compas.geometry import Point
from compas.geometry import Vector
from compas.geometry import Line
from compas.geometry import Plane
from compas.geometry import Frame
from compas.geometry import Circle
from compas.geometry import Ellipse
from compas.geometry import Polyline
from compas.geometry import Polygon
from ... | Python | 0 | @@ -5815,38 +5815,39 @@
compas.geometry.
-Ellips
+Polylin
e%60%0A%0A Returns%0A
|
2d1466b10f74b05c32b1c2efb560515cceba4869 | Fix YML export titles | rbm2m/action/exporter.py | rbm2m/action/exporter.py | # -*- coding: utf-8 -*-
"""
Record export functions
"""
from __future__ import unicode_literals
import datetime
import logging
from sqlalchemy import func, or_
import jinja2
from jinja2.filters import do_truncate
from ..models import Scan, Record, Genre, RecordFlag, Image, scan_records
from . import user_settings... | Python | 0.000002 | @@ -4739,23 +4739,8 @@
tle(
-rec%5B'artist'%5D,
rec%5B
@@ -6436,24 +6436,16 @@
t_title(
-artist,
title, f
@@ -6464,16 +6464,16 @@
th=50):%0A
+
%22%22%22%0A
@@ -6537,19 +6537,8 @@
- %7Bartist%7D -
%7Bti
@@ -6640,39 +6640,16 @@
len(
-%22%7B%7D - %7B%7D%22.format(artist, fmt))
+fmt) - 1
%0A
@@ -6... |
90c79493f2b039b9bc3bea93dffe10cc17b08282 | print overall result | test/mavsdk_tests/mavsdk_test_runner.py | test/mavsdk_tests/mavsdk_test_runner.py | #!/usr/bin/env python3
import argparse
import atexit
import datetime
import errno
import os
import psutil
import subprocess
import sys
test_matrix = [
{
"model": "iris",
"test_filter": "[multicopter]",
"timeout_min": 10,
},
# {
# "model": "standard_vtol",
# "test_f... | Python | 0.000019 | @@ -4733,16 +4733,44 @@
return%0A%0A
+ overall_success = True%0A%0A
for
@@ -5330,16 +5330,56 @@
_min'%5D)%0A
+ was_success = (returncode == 0)%0A
@@ -5390,27 +5390,22 @@
t(%22Test
-exited with
+group:
%7B%7D%22.for
@@ -5404,36 +5404,126 @@
%7B%7D%22.format(
-returncode))
+%22Success%22... |
b613ac1b3bef1ff639bee16d874c55c4da6948f6 | add comment | src/wormhole/cli/cli.py | src/wormhole/cli/cli.py | from __future__ import print_function
import os
import time
start = time.time()
import traceback
from textwrap import fill, dedent
from sys import stdout, stderr
from . import public_relay
from .. import __version__
from ..timing import DebugTiming
from ..errors import WrongPasswordError, WelcomeError, KeyFormatError
... | Python | 0 | @@ -5089,16 +5089,52 @@
= code%0A%0A
+ # note: react() does not return%0A
retu
@@ -6646,16 +6646,52 @@
= None%0A%0A
+ # note: react() does not return%0A
retu
|
0200eedc7c76ba0cf38f53a8fd213e55349aa7c0 | return name under which existing resource was registered | rctk/resourceregistry.py | rctk/resourceregistry.py | import os
import stat
import sys
import time
import mimetypes
from rctk.compat import OrderedDict
class BaseResource(object):
type = "application/data"
counter = 0
def __init__(self, data, name=None, type=None, timestamp=None):
self._data = data
if type is not None:
self.type ... | Python | 0.000049 | @@ -3800,16 +3800,39 @@
licates%0A
+ ## XXX optimze%0A
@@ -3882,24 +3882,27 @@
+ ##
return
None%0A%0A
@@ -3893,20 +3893,190 @@
return
-None
+its name nonetheless%0A for k, v in self.resources.iteritems():%0A if v == resource:%0A return k%... |
98a82f084c6693dbd7cd44774f52e1bbdd835d05 | Fix urls.py | rdmo/projects/urls/v1.py | rdmo/projects/urls/v1.py | from django.urls import include, path
from rest_framework_extensions.routers import ExtendedDefaultRouter
from ..viewsets import (ProjectQuestionSetViewSet, ProjectSnapshotViewSet, ProjectMembershipViewSet,
ProjectValueViewSet, ProjectViewSet, MembershipViewSet, SnapshotViewSet,
... | Python | 0.999857 | @@ -128,50 +128,84 @@
rt (
-ProjectQuestionSetViewSet, ProjectSnapshot
+CatalogViewSet, MembershipViewSet,%0A ProjectMembership
View
@@ -212,34 +212,35 @@
Set, Project
-Membership
+QuestionSet
ViewSet,%0A
@@ -267,29 +267,77 @@
Project
-ValueViewSet,
+SnapshotViewSet, ProjectValueViewSet,... |
0addd5540bfc24bff3aa2f66d78c24d83b6d275e | Use env in uninstall_hook (#677) | base_multi_image/hooks.py | base_multi_image/hooks.py | # -*- coding: utf-8 -*-
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, SUPERUSER_ID
import logging
_logger = logging.getLogger(__name__)
def pre_init_hook_for_submodules(cr, model, field):
"""Moves images from single to m... | Python | 0.000001 | @@ -2506,17 +2506,20 @@
%22%5D%0A i
-d
+mage
s = Imag
@@ -2527,34 +2527,16 @@
.search(
-cr, SUPERUSER_ID,
%5B(%22owner
@@ -2566,21 +2566,22 @@
-I
+i
mage
+s
.unlink(
cr,
@@ -2580,29 +2580,8 @@
ink(
-cr, SUPERUSER_ID, ids
)%0A%0A%0A
|
15a5958a92b7a1a5034cb821da0c0eb1e6b14b5c | Rename router.log *attribute* to .logger so it doesn't conflict with the router.log() method. | lib/rapidsms/router.py | lib/rapidsms/router.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import time
import threading
import log
class Router (object):
incoming_phases = ('parse', 'handle', 'cleanup')
outgoing_phases = ('outgoing',)
def __init__(self):
self.backends = []
self.apps = []
self.log = log.Log()
def l... | Python | 0 | @@ -290,16 +290,19 @@
self.log
+ger
= log.L
@@ -414,16 +414,19 @@
self.log
+ger
, level)
|
8b7ef1066abefae83876607fd1a9153662463185 | add try for obnl version loading in init | obnl/__init__.py | obnl/__init__.py | import pkg_resources # part of setuptools
__version__ = pkg_resources.require("obnl")[0].version | Python | 0 | @@ -36,16 +36,25 @@
uptools%0A
+try:%0A
__versio
@@ -95,12 +95,30 @@
)%5B0%5D.version
+%0Aexcept:%0A pass%0A
|
e27c74754eb8afebe36d982edba96383a8aa9d86 | Remove redundant call to super(__init__) | lib/rapidsms/router.py | lib/rapidsms/router.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import time, datetime
import threading
import component
import log
class Router (component.Receiver):
incoming_phases = ('parse', 'handle', 'cleanup')
outgoing_phases = ('outgoing',)
def __init__(self):
component.Receiver.__init__(self)
... | Python | 0.000126 | @@ -414,58 +414,8 @@
None
-%0A super(component.Receiver,self).__init__()
%0A%0A
|
f4d8ffbbaea5a1155540b167b740ab7bbaa4fd0f | load balance ICDS warehouse reads | corehq/sql_db/routers.py | corehq/sql_db/routers.py | from __future__ import absolute_import
from django.conf import settings
from .config import partition_config
PROXY_APP = 'sql_proxy_accessors'
FORM_PROCESSOR_APP = 'form_processor'
SQL_ACCESSORS_APP = 'sql_accessors'
ICDS_REPORTS_APP = 'icds_reports'
ICDS_MODEL = 'icds_model'
SCHEDULING_PARTITIONED_APP = 'scheduling_... | Python | 0 | @@ -66,16 +66,93 @@
ttings%0A%0A
+from corehq.sql_db.connections import connection_manager, ICDS_UCR_ENGINE_ID%0A
from .co
@@ -538,32 +538,45 @@
read_write(model
+, write=False
)%0A%0A def db_fo
@@ -644,16 +644,28 @@
te(model
+, write=True
)%0A%0A d
@@ -2229,18 +2229,217 @@
te(model
-):
+, write=True):%0A ... |
32d49946279cab868b493aae432b431fa9d5e2bc | Add wrap at wrap_width unless it's 0. | autowrap.py | autowrap.py | import sublime, sublime_plugin, re, sys
if sys.version >= '3':
long = int
class AutoWrapListener(sublime_plugin.EventListener):
saved_sel = 0
def on_modified(self, view):
if view.is_scratch() or view.settings().get('is_widget'): return
if not view.settings().get('auto_wrap', False): retur... | Python | 0 | @@ -425,83 +425,263 @@
-rulers = view.settings().get('rulers')%0A if not rulers: rulers
+wrap_width = view.settings().get('wrap_width')%0A if not wrap_width or wrap_width == 0:%0A rulers = view.settings().get('rulers')%0A if rulers:%0A wrap_width = rulers%5B0%5D%... |
2cf95fe7f2bec746cc4c76dd716d299754bf1491 | implement click.prompt, and unicode litteral for py2 py3 compatibility | stackit/stackit_core.py | stackit/stackit_core.py | #!/usr/bin/env python
from __future__ import print_function
import sys
import stackexchange
from stackexchange import Sort
# A good testing URL: http://stackoverflow.com/questions/16800049/changepassword-test
# The approved answer ID: 16800090
import requests
import webbrowser
import subprocess
import click
import bs4... | Python | 0 | @@ -53,16 +53,56 @@
unction%0A
+from __future__ import unicode_literals%0A
import s
@@ -1189,36 +1189,43 @@
user_input =
-inpu
+click.promp
t(%22Enter b to la
@@ -1265,34 +1265,32 @@
ch, or q to quit
-:
%22)%0A if us
@@ -1986,20 +1986,27 @@
input =
-inpu
+click.promp
t(%22Enter
@@ -2059,18 +2059,16... |
0f85b39fcca84b60815c54201f5f52eb9a2840c7 | Split the normalize function into two. | avena/np.py | avena/np.py | #!/usr/bin/env python2
from numpy import around, empty as _empty, mean, std
from numpy import int8, int16, int32, int64
from numpy import uint8, uint16, uint32, uint64
from numpy import float32, float64
from sys import float_info as _float_info
_eps = 10.0 * _float_info.epsilon
# Map of NumPy array type strings to ... | Python | 0.999846 | @@ -797,24 +797,219 @@
nt8_array%0A%0A%0A
+def clip(array, (min, max)):%0A '''Clip the values of an array to the given interval.'''%0A x = array %3C min + _eps%0A y = array %3E max - _eps%0A array%5Bx%5D = min%0A array%5By%5D = max%0A return%0A%0A%0A
def normaliz
@@ -1209,112 +1209,8 @@
min%0A
- ... |
bdcafd0c5af46e88ae06e6bbb853d415a30f8d26 | test algo affine | testing/test_sct_register_multimodal.py | testing/test_sct_register_multimodal.py | #!/usr/bin/env python
#########################################################################################
#
# Test function for sct_register_multimodal script
#
# replace the shell test script in sct 1.0
#
# ---------------------------------------------------------------------------------------
# Copyright (c) ... | Python | 0.000001 | @@ -1633,24 +1633,497 @@
utput += o%0A%0A
+ # check other method%0A cmd = 'sct_register_multimodal -i ' + path_data + folder_data + file_data%5B0%5D %5C%0A + ' -d ' + path_data + folder_data + file_data%5B1%5D %5C%0A + ' -o data_reg.nii.gz' %5C%0A + ' -p step=1,algo=affine,iter=1,smoo... |
1e704b4ac648d06a05d8c97e3ca38b64ea931c0a | Fix version number | ooni/__init__.py | ooni/__init__.py | # -*- encoding: utf-8 -*-
__author__ = "Arturo Filastò"
__version__ = "1.0.0-rc3"
__all__ = ['config', 'inputunit', 'kit',
'lib', 'nettest', 'oonicli', 'reporter',
'templates', 'utils']
| Python | 0.000041 | @@ -77,9 +77,9 @@
0-rc
-3
+5
%22%0A%0A_
|
83c26b1b05df1b9593ef2e2f82764ee527806395 | decrease noise level in the initial image | neural_artistic_style.py | neural_artistic_style.py | #!/usr/bin/env python
import os
import argparse
import numpy as np
import scipy.misc
import deeppy as dp
from matconvnet import vgg19_net
from style_network import StyleNetwork
def weight_tuple(s):
try:
conv_idx, weight = map(float, s.split(','))
return conv_idx, weight
except:
raise... | Python | 0 | @@ -2517,12 +2517,12 @@
ult=
-2e-7
+5e-8
,%0A
@@ -3944,16 +3944,21 @@
nit_img)
+*1e-1
)%0A in
|
c4701ae084ae35ec4b9f9acd6e7cb7c114adcb3c | Fix ocr reader (#2346) | dygraph/ocr_recognition/data_reader.py | dygraph/ocr_recognition/data_reader.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import cv2
import tarfile
import numpy as np
from PIL import Image
from os import path
from paddle.dataset.image import load_image
import paddle
SOS = 0
EOS = 1
NUM_CLASSES = 95
DATA_SHAPE = [1, 48, 5... | Python | 0.000001 | @@ -426,16 +426,50 @@
tar.gz%22%0A
+CACHE_DIR_NAME = %22attention_data%22%0A
SAVED_FI
|
0c244f0b295785378c85dfdf7a70c238d0a4f20b | Add a warning to prevent people from running nipy from the source directory. | neuroimaging/__init__.py | neuroimaging/__init__.py | # -*- coding: utf-8 -*-
"""
Neuroimaging tools for Python (NIPY).
The aim of NIPY is to produce a platform-independent Python environment for
the analysis of brain imaging data using an open development model.
While
the project is still in its initial stages, packages for file I/O, script
support as well as single su... | Python | 0 | @@ -2243,16 +2243,17 @@
Tester%0A
+%0A
test = T
@@ -2288,8 +2288,434 @@
).bench%0A
+%0Adef _test_local_install():%0A %22%22%22 Warn the user that running with neuroimaging being%0A imported locally is a bad idea.%0A %22%22%22%0A import os%0A if os.getcwd() == os.sep.join(%0A ... |
d1b6235413ffd81266e101673facef08c699f37b | Update openid.kvform | openid/kvform.py | openid/kvform.py | __all__ = ['seqToKV', 'kvToSeq', 'dictToKV', 'kvToDict']
import types
import logging
class KVFormError(ValueError):
pass
def seqToKV(seq, strict=False):
"""Represent a sequence of pairs of strings as newline-terminated
key:value pairs. The pairs are generated in the order given.
@param seq: The pair... | Python | 0.000001 | @@ -1,8 +1,24 @@
+import logging%0A%0A
__all__
@@ -71,36 +71,8 @@
'%5D%0A%0A
-import types%0Aimport logging%0A
%0Acla
@@ -109,16 +109,17 @@
pass%0A%0A
+%0A
def seqT
@@ -695,35 +695,36 @@
k = k.decode('
-UTF
+utf-
8')%0A elif
@@ -1679,16 +1679,18 @@
de('
-UTF
+utf-
8')%0A%0A
+%0A
def
@@ -2053,32 +... |
0b6ced2e048d4538db68abe356b8a4719a830fa0 | Check the needed env vars are provided to the backfill script | backfill.py | backfill.py | #!/usr/bin/env python
import json
from os import environ
import boto3
bucket = boto3.resource('s3').Bucket(environ.get('AWS_S3_BUCKET'))
queue = boto3.resource('sqs').Queue(environ.get('AWS_SQS_URL'))
items_queued = 0
for item in bucket.objects.all():
if not item.key.endswith('.json.gz'):
continue
... | Python | 0 | @@ -67,16 +67,276 @@
boto3%0A%0A%0A
+if not all(%5Benviron.get('AWS_S3_BUCKET'), environ.get('AWS_SQS_URL')%5D):%0A print('You have to specify the AWS_S3_BUCKET and AWS_SQS_URL environment variables.')%0A print('Check the %22Backfilling data%22 section of the README file for more info.')%0A exit(1)%0A%0A%0A
... |
d16cdad0fd12dcab26d670e83a746fede085d085 | fix the test .tac to use new createService arguments | opennsa-test.tac | opennsa-test.tac | #!/usr/bin/env python # syntax highlightning
import os, sys
from twisted.python import log
from twisted.python.log import ILogObserver
from twisted.application import internet, service
from opennsa import setup, registry, logging
from opennsa.backends import dud
from opennsa.topology import gole
DEBUG = False
PROF... | Python | 0.000001 | @@ -1114,44 +1114,8 @@
rk)%0A
- es = registry.ServiceRegistry()%0A
@@ -1156,14 +1156,8 @@
ork,
- topo,
bac
@@ -1162,18 +1162,20 @@
ackend,
-es
+topo
, HOST,
|
f662fafd2f69d64306ab89a1360a3cadda072b59 | clean up pylint ignores to be more specific | functional/util.py | functional/util.py | # pylint: disable=no-name-in-module,unused-import,too-many-instance-attributes,too-many-arguments, too-few-public-methods
import collections
import six
import builtins
if six.PY2:
from itertools import ifilterfalse as filterfalse
def dict_item_iter(dictionary):
return dictionary.viewitems()
else:
... | Python | 0 | @@ -46,80 +46,8 @@
port
-,too-many-instance-attributes,too-many-arguments, too-few-public-methods
%0A%0Aim
@@ -1175,24 +1175,98 @@
le(object):%0A
+ # pylint: disable=too-few-public-methods,too-many-instance-attributes%0A
def __in
@@ -1382,16 +1382,61 @@
=None):%0A
+ # pylint: disable=too-many-argumen... |
f5679597865a9dd9607fda0a25c7ed31299c45c8 | enforce backend in tests; clear cache in tests | tests/cupy_tests/core_tests/test_raw.py | tests/cupy_tests/core_tests/test_raw.py | import os
import pytest
import shutil
from tempfile import mkdtemp
import unittest
import cupy
from cupy import testing
_test_source1 = r'''
extern "C" __global__
void test_sum(const float* x1, const float* x2, float* y) {
int tid = blockDim.x * blockIdx.x + threadIdx.x;
y[tid] = x1[tid] + x2[tid];
}
'''
# ... | Python | 0 | @@ -114,16 +114,47 @@
testing%0A
+from cupy.cuda import compiler%0A
%0A%0A_test_
@@ -2873,16 +2873,67 @@
HE_DIR')
+%0A compiler._empty_file_preprocess_cache = %7B%7D
%0A%0A de
@@ -4952,16 +4952,65 @@
ION=3%22,)
+,%0A backend=self.backend
)%0A
@@ -5416,16 +5416,65 @@
.cub... |
2ed48a7ac268f3de781b77843420343452e012f6 | Fix to DTypeLike | cupyx/jit/_cuda_types.py | cupyx/jit/_cuda_types.py | from typing import Mapping, Optional, Sequence, Union, TYPE_CHECKING
import numpy
import numpy.typing as npt
import cupy
from cupy._core._scalar import get_typename
if TYPE_CHECKING:
from cupyx.jit._internal_types import Data
# Base class for cuda types.
class TypeBase:
def __str__(self) -> str:
r... | Python | 0.000015 | @@ -1687,25 +1687,27 @@
dtype: n
-umpy.dtyp
+pt.DTypeLik
e,%0A
@@ -1828,21 +1828,34 @@
dtype =
-dtype
+numpy.dtype(dtype)
%0A
|
dc3ef62120b9199a798243f4d3e5716838c9a8d5 | Delete removed files from S3 on upload | staticpy/s3_uploader.py | staticpy/s3_uploader.py | from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.s3.key import Key
import os
import Queue
import threading
class BulkUploader:
'''Multi-Threaded s3 directory BulkUploader
Walks a directory uploading everyfile to s3, you can apply filters/transforms to file paths.
... | Python | 0 | @@ -1334,24 +1334,53 @@
eue.Queue()%0A
+ current_keys = set()%0A
for
@@ -1701,34 +1701,124 @@
-queue.put((key, file_path)
+current_keys.add(key)%0A queue.put((key, file_path))%0A%0A self.delete_removed_keys(current_keys
)%0A
@@ -2644,16 +2644,368 @@
, '/')%0A%0A
+ ... |
4e74723aac53956fb0316ae0d438da623de133d5 | Add and update tests for video renderer | tests/extensions/video/test_renderer.py | tests/extensions/video/test_renderer.py | import pytest
from mfr.core.provider import ProviderMetadata
from mfr.extensions.video import VideoRenderer
@pytest.fixture
def metadata():
return ProviderMetadata('test', '.mp4', 'text/plain', '1234', 'http://wb.osf.io/file/test.mp4?token=1234')
@pytest.fixture
def file_path():
return '/tmp/test.mp4'
@... | Python | 0 | @@ -55,17 +55,16 @@
etadata%0A
-%0A
from mfr
@@ -201,16 +201,44 @@
'1234',
+%0A
'http:/
@@ -940,16 +940,99 @@
in body
+%0A assert '%3Cstyle%3Ebody%7Bmargin:0;padding:0;%7D%3C/style%3E' in ''.join(body.split())
%0A%0A de
|
e6024d35e1b6717ba360fe98bc55ca1d0c9b250e | Add optional hide parameter to send_mail | stalker.py | stalker.py | #!/usr/bin/python3
# This file is part of the URL Stalker.
# URL Stalker 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 vers... | Python | 0 | @@ -1296,16 +1296,28 @@
p_server
+, hide=False
):%0A a
@@ -1426,16 +1426,37 @@
nd_from%0A
+ if not hide:%0A
# Ba
@@ -1505,17 +1505,19 @@
ut.%0A
-#
+
msg%5B'To
@@ -4613,24 +4613,35 @@
s=%5Bnew_name%5D
+, hide=True
)%0A
|
e1c359fab8c351c77556e34731cd677b4c0cc99b | Update mono to 4.0.1 | packages/mono.py | packages/mono.py | class MonoPackage (Package):
def __init__ (self):
Package.__init__ (self, 'mono', '4.0.0',
sources = [
'http://download.mono-project.com/sources/%{name}/%{name}-%{version}.tar.bz2'
],
configure_flags = [
'--with-jit=yes',
'--with-ikvm=no',
'--with-mcs-docs=no',
'--with-moonlight=no',
... | Python | 0 | @@ -83,17 +83,17 @@
', '4.0.
-0
+1
',%0A%09%09%09so
@@ -546,17 +546,16 @@
-#
'--build
|
366501cd91f2988d793b050297b76a89082f72ef | Store stashed files in a private directory. | nimp/commands/fileset.py | nimp/commands/fileset.py | # -*- coding: utf-8 -*-
# Copyright © 2014—2016 Dontnod Entertainment
# 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, including
# without limitation the rights to use, c... | Python | 0 | @@ -1164,16 +1164,31 @@
ort abc%0A
+import hashlib%0A
import o
@@ -3503,34 +3503,142 @@
ash_
-file = '.stash-%25s.txt' %25 (
+dir = env.format('%7Broot_dir%7D/.nimp/stash')%0A nimp.system.safe_makedirs(stash_dir)%0A%0A stash_file = os.path.join(stash_dir,
env.
@@ -3638,33 +3638,32 @@
r, env.fileset)... |
a376b080779c6c09e6c8f4705ef3947645433151 | Increase timeout for File.upload_from_url test | tests/integration/test_api_resources.py | tests/integration/test_api_resources.py | # coding: utf-8
from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
from tempfile import NamedTemporaryFile
from datetime import datetime
import time
from pyuploadcare import conf
from pyuploadcare.api_resources import File, FileGroup
from .utils impor... | Python | 0.000001 | @@ -1288,33 +1288,34 @@
timeout =
-5
+30
%0A time_st
|
aed0cd2d9f82d5e028f3d98d08f0e27826765a4e | update decorators.py | stoplight/decorators.py | stoplight/decorators.py |
import inspect
from functools import wraps
import stoplight
from stoplight.exceptions import *
from stoplight.rule import *
def validate(**rules):
"""Validates a function's input using the specified set of rules."""
def _validate(f):
@wraps(f)
def wrapper(*args, **kwargs):
funcpa... | Python | 0.000001 | @@ -4082,19 +4082,18 @@
args, **
-out
+kw
args)%0A
|
7e627a16c85a9ffa88833176201351908a5458c2 | Fix (#795) | stripe/api_resources/terminal/reader.py | stripe/api_resources/terminal/reader.py | # File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function
from stripe import util
from stripe.api_resources.abstract import APIResourceTestHelpers
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import DeletableAPIResource... | Python | 0 | @@ -2364,14 +2364,51 @@
-resp =
+self.resource.refresh_from(%0A
sel
@@ -2472,58 +2472,8 @@
-stripe_object = util.convert_to_stripe_object(resp
)%0A
@@ -2494,17 +2494,17 @@
rn s
-tripe_object
+elf.resource
%0A
|
f6e570627cf513acb6b2de35a4ecabbadd8cfae7 | Remove node-based dashboard nav | stores/dashboard/app.py | stores/dashboard/app.py | from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext_lazy as _
from oscar.core.application import Application
from oscar.apps.dashboard.nav import register, Node
from oscar.views.decorators import staff_member_required
from stores.dashboard import views
node = Node(_('St... | Python | 0 | @@ -48,64 +48,8 @@
url
-%0Afrom django.utils.translation import ugettext_lazy as _
%0A%0Afr
@@ -97,60 +97,8 @@
ion%0A
-from oscar.apps.dashboard.nav import register, Node%0A
from
@@ -192,204 +192,8 @@
s%0A%0A%0A
-node = Node(_('Store Manager'))%0Anode.add_child(Node(_('Stores'), 'stores-dashboard:store-list'))%0A... |
38de1280ff97d468dcb0214e6c1037ee12d9676b | Add another action | dashboard/controllers.py | dashboard/controllers.py | import cherrypy
class Dashboard:
@cherrypy.expose
def index(self):
return "Dashboard!"
| Python | 0.000015 | @@ -97,8 +97,99 @@
board!%22%0A
+ @cherrypy.expose%0A def edit(self, number):%0A return %22Dashboard edit %22 + number%0A
|
cd3f94c7574825812d4e0fea6fda20f9e4432495 | Test GetApplication | tests/registryd/test_root_accessible.py | tests/registryd/test_root_accessible.py | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
import pytest
import dbus
from utils import get_property, check_unknown_p... | Python | 0 | @@ -2555,28 +2555,219 @@
ce=ACCESSIBLE_IFACE)) == 0%0A%0A
+def test_root_get_application(registry_root, session_manager):%0A (name, path) = registry_root.GetApplication(dbus_interface=ACCESSIBLE_IFACE)%0A assert path == '/org/a11y/atspi/null'%0A %0A
|
2ee9e4200c90eae9739a44cb56270d0e873907e9 | Add more example | pandas/pandas.py | pandas/pandas.py | import pandas as pd
# Reading csv without header
inp = pd.read_csv('data.txt', header=None)
# Retrieving particular columns by indexes, since column headers are not there
X_df = inp[inp.columns[0:2]]
# Converting dataframe to numpy ndarray
X_nd = X_df.values | Python | 0 | @@ -87,16 +87,372 @@
=None)%0A%0A
+# Reading csv and set name of columns%0Ainp = pd.read_csv('data.txt', names=%5B'column1', 'column2'%5D)%0A%0A# Reading csv and set index%0Ainp = pd.read_csv('data.txt', index_col=%5B'column1'%5D)%0Ainp = pd.read_csv('data.txt', index_col=0)%0A%0A# Reset index%0Ainp = inp.reset_index(... |
1bf7b678a0420f471c2af2e943e65d7bad756ae3 | Make the requests test use unittest2, rather than the system unittest. | tests/regressiontests/requests/tests.py | tests/regressiontests/requests/tests.py | from datetime import datetime, timedelta
import time
from StringIO import StringIO
import unittest
from django.http import HttpRequest, HttpResponse, parse_cookie
from django.core.handlers.wsgi import WSGIRequest, LimitedStream
from django.core.handlers.modpython import ModPythonRequest
from django.utils.http import c... | Python | 0.999814 | @@ -1,12 +1,24 @@
+import time%0A
from datetim
@@ -46,28 +46,16 @@
medelta%0A
-import time%0A
from Str
@@ -80,210 +80,228 @@
gIO%0A
-import unittest%0A%0Afrom django.http import HttpRequest, HttpResponse, parse_cookie%0Afrom django.core.handlers.wsgi import WSGIRequest, LimitedStream%0Afrom django.core.handlers.mod... |
7aab5bcf7195526c37d556872c1530051e0dc8b6 | Fix summary tests | summary/test_summary.py | summary/test_summary.py | # -*- coding: utf-8 -*-
import unittest
from jinja2.utils import generate_lorem_ipsum
# generate one paragraph, enclosed with <p>
TEST_CONTENT = str(generate_lorem_ipsum(n=1))
TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False)
from pelican.contents import Page
import summary
class TestSummary(unittest.TestCase... | Python | 0.000013 | @@ -260,16 +260,40 @@
ort Page
+%0Aimport pelican.settings
%0A%0Aimport
@@ -401,16 +401,85 @@
.setUp()
+%0A pelican.settings.DEFAULT_CONFIG%5B'SUMMARY_MAX_LENGTH'%5D = None
%0A%0A
@@ -1573,32 +1573,70 @@
(**page_kwargs)%0A
+ summary.extract_summary(page)%0A
# test b
@@ -2053,32 +2053,7... |
5db44f4a2aa60ef26607d81d6e6d7d5f4723d349 | Remove irellevant test cases | tests/test_fms_api_event_list_parser.py | tests/test_fms_api_event_list_parser.py | import datetime
import json
import unittest2
from datafeeds.parsers.fms_api.fms_api_event_list_parser import FMSAPIEventListParser
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.district_type import DistrictType
from consts.event_type import EventType
from models.event impo... | Python | 0 | @@ -1912,115 +1912,8 @@
A%22)%0A
- self.assertEquals(event.venue_address, %22Jacob K. Javits Convention Center, New York, NY, USA%22)%0A
@@ -1948,32 +1948,32 @@
ent.year, 2015)%0A
+
self
@@ -3028,109 +3028,8 @@
A%22)%0A
- self.assertEquals(event.venue_address, %22Hartford Pub... |
abd32bb9e79d771cae2117f9e754b4a7e38434bf | Add storage nominal capacity to parameters dict in storage_at_hvmv_substation | edisgo/flex_opt/storage_integration.py | edisgo/flex_opt/storage_integration.py | from edisgo.grid.components import Storage, Line
from edisgo.grid.tools import select_cable
import logging
def integrate_storage(network, position, operational_mode, parameters):
"""
Integrate storage units in the grid and specify its operational mode
Parameters
----------
network: :class:`~.gri... | Python | 0.000012 | @@ -969,16 +969,70 @@
%7B%0A
+ 'nominal_capacity': %3Cfloat%3E, # in kWh%0A
@@ -1071,17 +1071,16 @@
# in kWh
-,
%0A
@@ -1785,31 +1785,8 @@
mode
-, nominal_capacity=1000
):%0A
@@ -2230,76 +2230,8 @@
ail%0A
- nominal_capacity : float%0A Storage's apparent rated power... |
54fab13f466d17acfa4f9b3d67d777de8d34f67f | Remove interdependence from get_path_category() | src/core/templatetags/pycontw_tools.py | src/core/templatetags/pycontw_tools.py | import re
from django.template import Library
register = Library()
@register.filter
def message_bootstrap_class_str(message):
return ' '.join('alert-' + tag for tag in message.tags.split(' '))
@register.filter
def get_path_category(url):
lang = '\/(zh\-hant|en\-us)'
category_pattern_mapping = {
... | Python | 0.000005 | @@ -250,19 +250,30 @@
-lang = '%5C/(
+pattern = r'/(?P%3Clang%3E
zh%5C-
@@ -288,22 +288,21 @@
-us)
-'%0A
+/(?P%3C
category
_pat
@@ -301,292 +301,77 @@
gory
-_pattern_mapping = %7B%0A 'about': '%5C/about/pycontw',%0A 'sponsor': '%5C/sponsor/sponsor',%0A 'speaking': '%5C/speaking%5C/(c... |
0bffe17c50c41f85a8dea42a468d282248c75ef9 | Make static url absolute | svenv/svenv/settings.py | svenv/svenv/settings.py | """
Django settings for svenv project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | Python | 0.999822 | @@ -2240,16 +2240,17 @@
_URL = '
+/
static/'
|
435547a747b5085076bdc6ddf1f687e146f8e071 | Fix another unit test stacktrace in pkg_resource | tests/unit/modules/pkg_resource_test.py | tests/unit/modules/pkg_resource_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
import yaml
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_R... | Python | 0.000002 | @@ -4670,14 +4670,20 @@
pkg(
+%7B
'pkgs'
+: %5B%5D%7D
, 'n
|
61627e72f4f3f0f9c7058264cb605650152192b5 | Remove extra comments description for Google | geocoder/google.py | geocoder/google.py | #!/usr/bin/python
# coding: utf8
import ratelim
import requests
from .base import Base
class Google(Base):
"""
Google Geocoding API
====================
Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway,
Mountain View, CA") into geographic coordinates (like latitud... | Python | 0 | @@ -217,66 +217,8 @@
sses
- (like %221600 Amphitheatre Parkway,%0A Mountain View, CA%22)
int
@@ -229,16 +229,20 @@
ographic
+%0A
coordin
@@ -274,20 +274,16 @@
3021 and
-%0A
longitu
@@ -298,16 +298,20 @@
083739),
+%0A
which y
@@ -462,714 +462,247 @@
ding
-/
%0A%0A
-OSM Quality (6/6)%0A -... |
09dc63bc729d3415277cd66c78cb7acc615b791c | add real time mean | Sound/core.py | Sound/core.py | #! /usr/bin/python3
import alsaaudio
import time
import audioop
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.ndimage.filters import gaussian_laplace
import pylab
import multiprocessing
class MyProcess(multiprocessing.Process):
def __init__(self, array):
multiprocess... | Python | 0.000628 | @@ -290,16 +290,42 @@
f, array
+, seconde_size, total_loop
):%0A
@@ -441,78 +441,245 @@
ray%0A
-%0A def run(self):%0A sns.set_style('darkgrid')%0A plt.ion(
+ self.seconde_size = seconde_size%0A self.total_loop = total_loop%0A%0A def run(self):%0A sns.set_style('darkgrid'... |
320a96337c55d770ed032520ecb75155e2d124e5 | Update version | geoip2/__init__.py | geoip2/__init__.py | #pylint:disable=C0111
__title__ = 'geoip2'
__version__ = '0.1.0'
__author__ = 'Gregory Oschwald'
__license__ = 'LGPLv2+'
__copyright__ = 'Copyright 2013 Maxmind, Inc.'
| Python | 0 | @@ -56,17 +56,17 @@
= '0.1.
-0
+1
'%0A__auth
|
d38fd28c47f3749ed3fb7a64827768108a413c78 | introduce ec2.volume handling | src/main/python/monocyte/handler/ec2.py | src/main/python/monocyte/handler/ec2.py | from __future__ import print_function
import boto
import boto.ec2
from boto.exception import EC2ResponseError
from monocyte.handler import Resource, aws_handler
@aws_handler
class Handler(object):
VALID_TARGET_STATES = ["terminated", "shutting-down"]
def __init__(self, region_filter, dry_run=True):
... | Python | 0 | @@ -176,23 +176,24 @@
r%0Aclass
-Handler
+Instance
(object)
@@ -456,34 +456,22 @@
e =
-__name__.rsplit(%22.%22, 1)%5B1%5D
+%22ec2.instance%22
%0A
@@ -1140,23 +1140,24 @@
tate in
-Handler
+Instance
.VALID_T
@@ -1304,15 +1304,16 @@
oin(
-Handler
+Instance
.VAL
@@ -1970,16 +1970,16 @@
ances))%0A
-
... |
87e83a29dbdc0c656fffee92ac8b90556e540e19 | Rename variable | tests/unit/son_analyze/cli/main_test.py | tests/unit/son_analyze/cli/main_test.py | # Copyright (c) 2015 SONATA-NFV, Thales Communications & Security
# 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.000003 | @@ -3067,17 +3067,19 @@
-_
+msg
= 'The
@@ -3157,17 +3157,19 @@
R.debug(
-_
+msg
, target
|
01dd6198cba28623e3d2a72bc9b1f720a70112f0 | Bump version to 0.2.1 | geomet/__init__.py | geomet/__init__.py | # Copyright 2013 Lars Butler & individual contributors
#
# 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 applicab... | Python | 0.000001 | @@ -627,11 +627,9 @@
0.2.
-0-2
+1
'%0A%0A%0A
|
ab8d6fc2163e7170e8d184f1321119bbcd469709 | Update ipc_lista1.9.py | lista1/ipc_lista1.9.py | lista1/ipc_lista1.9.py | #ipc_lista1.9
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura em graus Celsius.
| Python | 0 | @@ -190,8 +190,9 @@
elsius.%0A
+%0A
|
c9ba6d141e356b48caf1820a309e554f21e016c4 | Transpose guards against None result | sympy/matrices/expressions/transpose.py | sympy/matrices/expressions/transpose.py | from sympy import Basic, Q
from sympy.functions import adjoint, conjugate
from sympy.matrices.expressions.matexpr import MatrixExpr
from sympy.matrices import MatrixBase
class Transpose(MatrixExpr):
"""
The transpose of a matrix expression.
This is a symbolic object that simply stores its argument withou... | Python | 0.000244 | @@ -1009,20 +1009,22 @@
re
-turn
+sult =
arg._ev
@@ -1038,16 +1038,84 @@
spose()%0A
+ return result if result is not None else Transpose(arg)%0A
|
6a0fd67cbe50ee952c0b8ab1a7dc29fa7b3449f5 | Log task name more succinctly | nodepool/task_manager.py | nodepool/task_manager.py | #!/usr/bin/env python
# Copyright (C) 2011-2013 OpenStack Foundation
#
# 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 ... | Python | 0.999999 | @@ -2671,20 +2671,67 @@
.name, t
-ask,
+ype(task).__name__,%0A
self.qu
@@ -2999,19 +2999,34 @@
.name, t
-ask
+ype(task).__name__
, dt))%0A
|
b4d3d4a5ec2986e119590b9aa498d958c633171e | Change era interim to gldas | gldas/reshuffle.py | gldas/reshuffle.py | # -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2016, TU Wien
#
# 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, including without limitation the rights
... | Python | 0.000002 | @@ -1740,35 +1740,29 @@
path where
-era interim
+GLDAS
data was do
|
e2f49a941ac34d86be2fbea177e7f84685787c91 | Add rdfs:label and make first type less confusing For #7-pure-papers | src/main/python/dot/rural/sepake/oai.py | src/main/python/dot/rural/sepake/oai.py | '''
Created on 2 Dec 2014
@author: Niels Christensen
'''
from dot.rural.sepake.xml_to_rdf import XMLGraph
import urllib2
from rdflib.term import URIRef
_PATH_TO_RESUMPTION_TOKEN = URIRef(u'http://www.openarchives.org/OAI/2.0/#resumptionToken') / URIRef(u'http://www.w3.org/1999/02/22-rdf-syntax-ns#value')
_CONSTRUCT_... | Python | 0.000001 | @@ -744,61 +744,142 @@
v/%3E%0A
-CONSTRUCT %7B%0A ?sepakeuri rdf:type sepake:Unverified
+PREFIX rdfs: %3Chttp://www.w3.org/2000/01/rdf-schema#%3E %0ACONSTRUCT %7B%0A ?sepakeuri rdf:type prov:Entity .%0A ?sepakeuri dc:title ?title
.%0A
@@ -888,32 +888,34 @@
?sepakeuri
-dc:title
+rdfs:label
?title .%0A ... |
92699fa0ac8c97a5a54da2a4155b08145c524d5d | revert the previous change: regression found | web_seven/openerpweb.py | web_seven/openerpweb.py | # -*- coding: utf-8 -*-
def patch_web7():
import babel
import os.path
import sys
import openerp.addons.web
try:
from openerp.addons.web import http as openerpweb
except ImportError:
# OpenERP Web 6.1
return
# Self-reference for 6.1 modules which import 'web.common... | Python | 0.000306 | @@ -76,23 +76,8 @@
path
-%0A import sys
%0A%0A
@@ -241,194 +241,8 @@
rn%0A%0A
- # Self-reference for 6.1 modules which import 'web.common.http'%0A openerp.addons.web.common = openerp.addons.web%0A sys.modules%5B'openerp.addons.web.common'%5D = openerp.addons.web%0A%0A
|
d091f28028af0d303dc0e8fe76f18b9aa82fda81 | Tidy up comments in Method according to PEP 8 | malcolm/core/method.py | malcolm/core/method.py | #!/bin/env dls-python
from collections import OrderedDict
from malcolm.core.loggable import Loggable
class Method(Loggable):
"""Exposes a function with metadata for arguments and return values"""
def __init__(self, name):
super(Method, self).__init__(logger_name=name)
self.name = name
... | Python | 0 | @@ -1485,16 +1485,17 @@
#
+
Assumes
@@ -1565,16 +1565,17 @@
#
+
in the o
|
f03b47e987ed2259b10e21123ed8bca711b8bf15 | Add -D_REENTRANT to cflags as per Gemfire docs | binding.gyp | binding.gyp | # vim: set ft=javascript
{
# NOTE: 'module_name' and 'module_path' come from the 'binary' property in package.json
# node-pre-gyp handles passing them down to node-gyp when you build from source
"targets": [
{
"target_name": "<(module_name)",
"include_dirs": [ "include" ],
"sources": [ "src/binding.cpp"... | Python | 0 | @@ -358,17 +358,16 @@
mac%22', %7B
-
%0A
@@ -386,17 +386,16 @@
ings': %7B
-
%0A
@@ -481,17 +481,16 @@
%7D
-
%0A %7D
@@ -654,16 +654,32 @@
'-frtti'
+, '-D_REENTRANT'
%5D,%0A
|
726e70910e72f68085ecc7cdcc2d474c2ba99c6a | add source dir to include_dirs | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "node_mifare",
"dependencies": ["node_modules/libfreefare-pcsc/binding.gyp:freefare_pcsc"],
"conditions": [
['OS=="linux"', {
"defines": [
"USE_LIBNFC",
],
}]
],
"sources": [
"src/mif... | Python | 0.000001 | @@ -1,11 +1,61 @@
%7B%0D%0A
+ %22variables%22: %7B%0D%0A %22source_dir%22: %22src%22,%0D%0A %7D,%0D%0A
%22targe
@@ -323,24 +323,66 @@
%0D%0A %5D,%0D%0A
+ %22include_dirs%22: %5B%22%3C(source_dir)%22%5D,%0D%0A
%22sourc
|
2efa169358051980279abee57fda495273326735 | add ORIGIN/lib | binding.gyp | binding.gyp | {
'includes': [ 'common.gypi' ],
'targets': [
{
'target_name': 'make_vector_tile',
'hard_dependency': 1,
'type': 'none',
'actions': [
{
'action_name': 'generate_setting',
'inputs': [
'gen_settings.py'
],
'outputs': [
... | Python | 0 | @@ -3971,16 +3971,88 @@
z,now',%0A
+ %22-Wl,-z,origin%22,%0A %22-Wl,-rpath=%5C$$ORIGIN/lib%22%0A
|
7dc9a5518db6a8176f04ee63681d65a9ad6f7974 | fix python 3.2 compat | teamcity/nose_report.py | teamcity/nose_report.py | # coding=utf-8
import os
from teamcity import is_running_under_teamcity
from teamcity.unittestpy import TeamcityTestResult
from teamcity.common import is_string, split_output, limit_output
# from nose.util.ln
def _ln(label):
label_len = len(label) + 2
chunk = (70 - label_len) // 2
out = '%s %s %s' % ('-'... | Python | 0.99899 | @@ -464,25 +464,24 @@
arker = _ln(
-u
'%3E%3E begin ca
@@ -547,17 +547,16 @@
%22 + _ln(
-u
'%3E%3E end
|
e24c74aa08c1be4e196001f3511a3742acc61e81 | Add basic read-only tests for heat cli | tempest/cli/__init__.py | tempest/cli/__init__.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
# 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.apach... | Python | 0.000001 | @@ -3119,32 +3119,274 @@
dmin, fail_ok)%0A%0A
+ def heat(self, action, flags='', params='', admin=True,%0A fail_ok=False):%0A %22%22%22Executes heat command for the given action.%22%22%22%0A return self.cmd_with_auth(%0A 'heat', action, flags, params, admin, fail_ok)%0A%0A
... |
d060b5b7daba4a62174f6ad3fbacd6cdd4da11ef | change spawn rate | asteroid.py | asteroid.py | # Permite usar o modulo do Sense HAT
from sense_hat import SenseHat
from time import sleep
import pygame,sys,random
sense = SenseHat()
red = [255,0,0]
green = [0,255,0]
yellow = [255,255,0]
black = [0,0,0]
white = [255,255,255]
pygame.init()
pygame.display.set_mode()
sense.clear(0,0,0)
#direction, 0-right, 1-up,... | Python | 0 | @@ -3031,21 +3031,42 @@
r(index,
-10
+random.randrange(250,5
00)
+)
%0A dra
@@ -3132,30 +3132,29 @@
m.randrange(
-1
500,
-2
+1
500))%0A%0Acreat
@@ -3226,35 +3226,11 @@
yID,
-random.randrange(1500,
250
-0)
)%0Amo
|
0b7eca03c652b5afefb7eabd48011310b122acbc | Fix #47 contect handling | envelope/templatetags/envelope_tags.py | envelope/templatetags/envelope_tags.py | # -*- coding: utf-8 -*-
"""
Template tags related to the contact form.
"""
from __future__ import unicode_literals
from django import template
register = template.Library()
try:
import honeypot
# Register antispam_fields as an inclusion tag
t = template.Template('{% load honeypot %}{% render_honeypot_f... | Python | 0 | @@ -960,63 +960,32 @@
-try:%0A form = context%5B'form'%5D%0A except KeyError
+if 'form' not in context
:%0A
@@ -1025,16 +1025,29 @@
axError(
+%0A
%22There i
@@ -1096,47 +1096,34 @@
xt.%22
-)
%0A
-return %7B%0A
+)%0A
-'form': form,%0A %7D
+return context
%0A
|
444baf986cf90a952f5d2406b5aba60113494349 | Add FloatingIP object implementation | nova/objects/__init__.py | nova/objects/__init__.py | # Copyright 2013 IBM Corp.
#
# 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 agree... | Python | 0.000002 | @@ -1220,12 +1220,55 @@
.fixed_ip')%0A
+ __import__('nova.objects.floating_ip')%0A
|
7dd346572cdccfdd2d1b0fae04241e252bb39e74 | Add CLI test for invalid format | numba/tests/test_help.py | numba/tests/test_help.py | from __future__ import print_function
import sys
import subprocess
import types as pytypes
import os.path
import numpy as np
from numba.six.moves import builtins
from numba import types
from .support import TestCase, temp_directory
from numba.help.inspector import inspect_function, inspect_module
class TestInspect... | Python | 0 | @@ -3157,28 +3157,370 @@
path.isfile(expected_file))%0A
+%0A # Try unsupported format%0A cmds = cmdbase + %5B'--file', filename, '--format', 'foo', 'math'%5D%0A # Run CLI%0A with self.assertRaises(subprocess.CalledProcessError) as raises:%0A subprocess.check_output(cmds, stderr=s... |
3b642056d6761133bb27676993a83650c91b4057 | Fix parameters differ from overridden in StratisPoolDevice | blivet/devices/stratis.py | blivet/devices/stratis.py | # devices/stratis.py
#
# Copyright (C) 2020 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the... | Python | 0 | @@ -3124,26 +3124,16 @@
ate(self
-, **kwargs
):%0A
@@ -3178,24 +3178,16 @@
_create(
-**kwargs
)%0A%0A
|
97ec23d61d4aa78097e50328a2a3509ab3f6fb0d | Fix #4, oauth_callback_confirmed now returns 'error' if not True, not anymore hardcoded to ease debugging | oauth_provider/models.py | oauth_provider/models.py | import urllib
import urlparse
from time import time
from django.db import models
from django.contrib.auth.models import User
from managers import TokenManager, ConsumerManager, ResourceManager
from consts import KEY_SIZE, SECRET_SIZE, CONSUMER_KEY_SIZE, CONSUMER_STATES,\
PENDING, VERIFIER_SIZE, MAX... | Python | 0.000001 | @@ -3274,15 +3274,53 @@
d':
-'true',
+self.callback_confirmed and 'true' or 'error'
%0A
@@ -3378,18 +3378,9 @@
dict
-.update(%7B
+%5B
'oau
@@ -3391,17 +3391,19 @@
erifier'
-:
+%5D =
self.ve
@@ -3412,11 +3412,8 @@
fier
- %7D)
%0A%0A
|
7a5c344e29e0f3760c312a43d03f8b665c155ba9 | Add more HTTP helper methods to RESTOAuthClient. | rightscale/httpclient.py | rightscale/httpclient.py | from functools import partial
import requests
DEFAULT_ROOT_RES_PATH = '/'
class RESTOAuthClient(object):
"""
HTTP client that is aware of REST and OAuth semantics.
Provides CRUD methods for API resources using HTTP verbs. It also
interrogates the API server for links to related resources and expo... | Python | 0 | @@ -1438,89 +1438,241 @@
elf.
-get = partial(self.request, 'get')%0A self.post = partial(self.request, 'pos
+delete = partial(self.request, 'delete')%0A self.get = partial(self.request, 'get')%0A self.head = partial(self.request, 'head')%0A self.post = partial(self.request, 'post')%0A ... |
d3aae51f37321e1c73261284e057a569116ce5cc | revert changes to cvc code | rpmimport/recipemaker.py | rpmimport/recipemaker.py | #!/usr/bin/python
#
# Copyright (c) 2006,2008 rPath, Inc.
#
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http:/... | Python | 0 | @@ -976,149 +976,8 @@
ce%0A%0A
- def _cvc(self, *args, **kwargs):%0A %22%22%22%0A Run cvc command.%0A %22%22%22%0A%0A cvc.sourceCommand(self.cfg, *args, **kwargs)%0A%0A
@@ -1036,16 +1036,16 @@
ntents,%0A
+
@@ -1384,38 +1384,63 @@
-self._cvc(
+cvc.sourceCommand(self... |
4f7590ea19036ceb358c323d796be0046f33327e | move config.json to correct location | omtk/core/preferences.py | omtk/core/preferences.py | """
Provide a Preference class to store the user preferences of the local installation.
"""
import os
import inspect
import json
import logging
log = logging.getLogger('omtk')
CONFIG_FILENAME = 'config.json'
def get_path_preferences():
"""
:return: The search path of the configuration file.
"""
curren... | Python | 0.000002 | @@ -442,22 +442,16 @@
r, '..',
- '..',
'..'))%0A
@@ -1730,8 +1730,9 @@
s.load()
+%0A
|
e27741a4a15c81151e8922da26b14b80afc579a5 | use packet library | ryu/app/simple_switch.py | ryu/app/simple_switch.py | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | Python | 0 | @@ -916,211 +916,81 @@
_to_
-str%0A%0A%0A# TODO: we should split the handler into two parts, protocol%0A# independent and dependant parts.%0A%0A# TODO: can we use dpkt python library?%0A%0A# TODO: we need to move the followings to something like db
+bin%0Afrom ryu.lib.packet import packet%0Afrom ryu.lib.packet import ... |
cae6e403efdef67af23a3b8a6c80082fa9efe4bd | Fix test | bluebottle/files/views.py | bluebottle/files/views.py | import mimetypes
import magic
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from rest_framework.parsers import FileUploadParser
from rest_framework.permissions import IsAuthenticated
from rest_framework_json_api.views import AutoPrefetchMixin
f... | Python | 0.000004 | @@ -73,83 +73,86 @@
ngo.
-core.exceptions import ValidationError%0Afrom django.http import HttpResponse
+http import HttpResponse%0Afrom rest_framework.exceptions import ValidationError
%0Afro
@@ -2173,17 +2173,16 @@
-Type')%0A
-%0A
|
01e7a5b6880badaa0bd0dfe667972de53628d4e0 | version 0.1.4 | openapi_core/__init__.py | openapi_core/__init__.py | """OpenAPI core module"""
from openapi_core.shortcuts import create_spec
from openapi_core.wrappers import RequestParametersFactory, RequestBodyFactory
__author__ = 'Artur Maciąg'
__email__ = 'maciag.artur@gmail.com'
__version__ = '0.1.3'
__url__ = 'https://github.com/p1c2u/openapi-core'
__license__ = 'BSD 3-Clause Li... | Python | 0.000002 | @@ -230,17 +230,17 @@
= '0.1.
-3
+4
'%0A__url_
|
ab4351afae1f1a16206cce6801d114b047babf76 | Update main to use tag and reuse_mesage | bot/main.py | bot/main.py | #!/usr/bin/env python3
import logging
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, InlineQueryHandler
from game.api.server import start_api_server
from game.chooser import inline_query_game_chooser_handler
from game.launch import callback_query_game_launcher_handler
from tools import confi... | Python | 0 | @@ -609,16 +609,45 @@
gger(bot
+, %22START%22, reuse_message=True
)%0Alogger
|
23a1922afac917b06dbd6772fefc3b8a7c53c5ff | fix linespacing in footnotes (part of #3) | backends.py | backends.py | class LaTeX:
def preamble(self, typeface):
return """
\\documentclass[a4paper,12pt]{{article}}
\\usepackage{{fontspec}}
\\usepackage{{dblfnote}}
\\usepackage{{pfnote}}
\\setromanfont{{{typeface}}}
\\linespread{{1.5}}
\\spaceskip 0.5em
\\begin{{document}}
""".format(typeface=typeface)
def chapter_v... | Python | 0 | @@ -102,16 +102,41 @@
icle%7D%7D%0A%0A
+%5C%5Cusepackage%7B%7Bsetspace%7D%7D%0A
%5C%5Cusepac
@@ -257,23 +257,22 @@
%7D%0A%5C%5C
-spaceskip 0.5em
+onehalfspacing
%0A%0A%5C%5C
|
a24d41a3868cca15b3682590eb033f492a9b8293 | Remove multi-step decoding process before parsing HTML meta. | openid/yadis/discover.py | openid/yadis/discover.py | # -*- test-case-name: openid.test.test_yadis_discover -*-
__all__ = ['discover', 'DiscoveryResult', 'DiscoveryFailure']
from io import StringIO
import urllib.error
from openid import fetchers
from openid.yadis import etxrd
from openid.yadis.constants import \
YADIS_HEADER_NAME, YADIS_CONTENT_TYPE, YADIS_ACCEPT_H... | Python | 0 | @@ -114,16 +114,27 @@
lure'%5D%0A%0A
+import cgi%0A
from io
@@ -2322,1194 +2322,133 @@
-# Parse as HTML if the header is missing.%0A #%0A # XXX: do we want to do something with content-type, like%0A # have a whitelist or a blacklist (for detecting that it's%0A # HTML)?%0A%0A # Decode body by enc... |
96d17640a1aef57f35f22620fe45028bf1c0f6fb | Fix error with Django admin urls | openquake/server/urls.py | openquake/server/urls.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2018 GEM Foundation
#
# OpenQuake 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 Licen... | Python | 0.000072 | @@ -1973,24 +1973,16 @@
dmin/',
-include(
admin.si
@@ -1989,17 +1989,16 @@
te.urls)
-)
,%0A
|
b5416d4e68e273ce7164fc177d99f7c5b29e8ca4 | Handle OSError on sendall, re-connect socket when error occurred. | opentsdb/tsdb_connect.py | opentsdb/tsdb_connect.py | import threading
import logging
import socket
import time
logger = logging.getLogger('opentsdb-py')
class TSDBConnect:
def __init__(self, host: str, port: int, check_tsdb_alive: bool=False):
self.tsdb_host = host
self.tsdb_port = int(port)
if check_tsdb_alive:
self.is_alive(... | Python | 0 | @@ -1995,16 +1995,25 @@
IOError
+, OSError
) as err
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.