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 |
|---|---|---|---|---|---|---|---|
8b9a67d92377e44d6f53ab32661160543e4c3912 | Return 0 rather than None from get_curr_stat | ichnaea/content/tasks.py | ichnaea/content/tasks.py | from datetime import timedelta, datetime
from sqlalchemy import func
from sqlalchemy.exc import IntegrityError
from ichnaea.content.models import (
Stat,
STAT_TYPE,
)
from ichnaea.models import (
Cell,
CellMeasure,
Wifi,
WifiMeasure,
)
from ichnaea.tasks import (
DatabaseTask,
daily_ta... | Python | 0.007913 | @@ -1195,22 +1195,26 @@
me%5D%0A
-result
+cumulative
= get_c
@@ -1240,86 +1240,15 @@
ame)
-%0A cumulative = incr%0A if result is not None:%0A cumulative += result
+ + incr
%0A%0A
@@ -1807,20 +1807,17 @@
return
-None
+0
%0A%0A@celer
|
84bd860ec54a1adfcce0584a23263080af635372 | Remove debug code | nats_helper/__init__.py | nats_helper/__init__.py | import asyncio
import signal
import time
from nats.aio.client import Client as NatsClient
def require_connect_async(func):
async def wrapper(self, *args, **kwargs):
try:
if not self.connected and self._connect_params is not None:
await self.connect_async(**self._connect_params... | Python | 0.000299 | @@ -165,33 +165,16 @@
wargs):%0A
- try:%0A
@@ -237,36 +237,32 @@
ne:%0A
-
-
await self.conne
@@ -298,28 +298,24 @@
ms)%0A
-
return await
@@ -346,131 +346,8 @@
rgs)
-%0A except:%0A print('ERRA')%0A import traceback%0A tracebac... |
4fa4645b7802cc358a99888391b47d8ce82bbcae | fix custom.intrahealth.tests.test_fluffs:TestFluffs.test_taux_de_satifisfaction_fluff | custom/intrahealth/tests/test_fluffs.py | custom/intrahealth/tests/test_fluffs.py | from __future__ import absolute_import
from __future__ import unicode_literals
import os
from django.core import management
from corehq.apps.receiverwrapper.auth import AuthContext
from corehq.apps.receiverwrapper.util import submit_form_locally
from corehq.util.test_utils import softer_assert
import xml.etree.Elemen... | Python | 0.000001 | @@ -2397,32 +2397,33 @@
ry).fetchall())%0A
+%0A
self.ass
@@ -2429,62 +2429,38 @@
sert
+Items
Equal(
-len(results), 2)%0A%0A self.assertListEqual(%0A
+%0A %5B%0A
@@ -2477,32 +2477,36 @@
+
self.region.get_
@@ -2501,32 +2501,36 @@
.region.get_id,%0A
+
... |
cd06aa9d2625472237b0b9b96f6efa46494e82a5 | Clean up leftover code | advgoogle/advgoogle.py | advgoogle/advgoogle.py | from discord.ext import commands
from random import choice
import aiohttp
import re
import urllib
class AdvancedGoogle:
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
@commands.cooldown(5, 60, commands.BucketType.user)
async def google(self, ctx, text):
... | Python | 0 | @@ -1047,27 +1047,8 @@
e):%0A
- print(ctx)%0A
@@ -1385,29 +1385,8 @@
())%0A
- print(quary)%0A
|
ce96495cddee0503511df6015b2a0b1c3181a802 | Revert "missing s" | advgoogle/advgoogle.py | advgoogle/advgoogle.py | import discord
import aiohttp
from discord.ext import commands
from .utils import checks
from __main__ import send_cmd_help
from random import choice
import re
from cogs.utils.chat_formatting import *
import urllib
class AdvancedGoogle:
def __init__(self, bot):
self.bot = bot
self.option = {'User-... | Python | 0 | @@ -4319,33 +4319,32 @@
.say(uir, header
-s
= self.option)%0A
|
82660913a5f3902e3536b2bc557a019560a88a1a | Add column for Item Name | erpnext/stock/report/item_price_stock/item_price_stock.py | erpnext/stock/report/item_price_stock/item_price_stock.py | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
columns=get_columns()
data=get_data(filters,columns)
return columns, da... | Python | 0.000001 | @@ -374,11 +374,11 @@
tem
-Nam
+Cod
e%22),
@@ -400,19 +400,19 @@
: %22item_
-nam
+cod
e%22,%0A%09%09%09%22
@@ -470,32 +470,138 @@
%22: 120%0A%09%09%7D,%0A%09%09%7B%0A
+%09%09%09%22label%22: _(%22Item Name%22),%0A%09%09%09%22fieldname%22: %22item_name%22,%0A%09%09%09%22fieldtype%22: %22Data%22,%0A%09%09%09%22width... |
1bfab9dd43fc52bfdea0943703ee530e3b0f98de | remove SpecsParser | neurodocker/__init__.py | neurodocker/__init__.py | # Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import
import logging
import sys
LOG_FORMAT = '[NEURODOCKER %(asctime)s %(levelname)s]: %(message)s'
logging.basicConfig(stream=sys.stdout, datefmt='%H:%M:%S', level=logging.INFO,
format=LOG_FORMAT)
from neurodocker imp... | Python | 0.000001 | @@ -296,484 +296,8 @@
T)%0A%0A
-%0Afrom neurodocker import interfaces%0A%0ASUPPORTED_SOFTWARE = %7B'afni': interfaces.AFNI,%0A 'ants': interfaces.ANTs,%0A 'freesurfer': interfaces.FreeSurfer,%0A 'fsl': interfaces.FSL,%0A 'miniconda': i... |
44d74984bd4168eddb4cc5f9c0e77aad4e498a02 | fix broken plots | moca/plotter/__init__.py | moca/plotter/__init__.py | from .seqstats import perform_t_test
from .seqstats import get_pearson_corr
from .plotter import create_plot
| Python | 0.000006 | @@ -1,80 +1,4 @@
-from .seqstats import perform_t_test%0Afrom .seqstats import get_pearson_corr%0A
from
|
d2f1595fbb9e8d29e2126aa9453f4159e9b85a0d | add event to receive panel on focus | guicomm/events.py | guicomm/events.py | import wx.lib.newevent
# plot data
(NewPlotEvent, EVT_NEW_PLOT) = wx.lib.newevent.NewEvent()
# print the messages on statusbar
(StatusEvent, EVT_STATUS) = wx.lib.newevent.NewEvent()
#create a panel slicer
(SlicerPanelEvent, EVT_SLICER_PANEL) = wx.lib.newevent.NewEvent()
#print update paramaters for panel s... | Python | 0 | @@ -834,28 +834,152 @@
= wx.lib.newevent.NewEvent()
+%0D%0A##event that allow to add more that to the same plot%0D%0A(AddManyDataEvent, EVT_ADD_MANY_DATA) = wx.lib.newevent.NewEvent()
|
1c51ca868a3a1a2b3110b76ec7b563aa7d9d9c58 | update tests | hs_core/tests/api/native/test_folder_download_zip.py | hs_core/tests/api/native/test_folder_download_zip.py | import os
from django.contrib.auth.models import Group
from django.test import TestCase
from hs_core.hydroshare.users import create_account
from hs_core.hydroshare.resource import add_resource_files, create_resource
from hs_core.models import GenericResource
from hs_core.tasks import create_temp_zip
from django_irods.... | Python | 0 | @@ -3066,16 +3066,29 @@
t_path,
+True, sf_zip=
True))%0A
|
53f13515511e6851d59228e8cc9df24a74149eee | add test | corehq/apps/domain/tests/test_dbaccessors.py | corehq/apps/domain/tests/test_dbaccessors.py | import uuid
from django.test import TestCase
from corehq.apps.commtrack.models import CommtrackConfig
from corehq.apps.domain.dbaccessors import get_doc_ids_in_domain_by_class, get_domain_ids_by_names, \
get_docs_in_domain_by_class
from corehq.apps.domain.models import Domain
from corehq.apps.groups.models import G... | Python | 0.000002 | @@ -134,32 +134,38 @@
sors import
+(%0A
get_doc_
ids_in_domai
@@ -144,35 +144,37 @@
t (%0A get_doc_
-ids
+count
_in_domain_by_cl
@@ -181,35 +181,44 @@
ass,
+%0A
get_do
-main
+c
_ids_
-by_names, %5C
+in_domain_by_class,
%0A
@@ -245,16 +245,48 @@
by_class
+,%0A get_domain_ids_by_names,%0A)
%0... |
a0e07c3ecf84219b79889509e29da0b800e36a97 | fix angle normalization in get_draw_angles() | src/ezdxf/addons/drawing/utils.py | src/ezdxf/addons/drawing/utils.py | # Created: 06.2020
# Copyright (c) 2020, Matthew Broadway
# License: MIT License
import enum
import math
from math import tau
from typing import Union, List
from ezdxf.addons.drawing.type_hints import Radians
from ezdxf.entities import Face3d, Solid, Trace
from ezdxf.math import Vector, Z_AXIS, OCS
def normalize_ang... | Python | 0.000001 | @@ -839,46 +839,58 @@
urn
-e.angle %25 math.tau, s.angle %25 math.tau
+normalize_angle(e.angle), normalize_angle(s.angle)
%0A%0A%0Ad
|
272bb8da7a44e5a0ccb7953e0ccdfd7ab473e9f1 | Fix test_postgresql dependency analysis. | test/units/module_utils/test_postgresql.py | test/units/module_utils/test_postgresql.py | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import sys
from units.compat import unittest
from units.compat.mock import patch, MagicMock
from ansible.module_utils.six.moves import builtins
from ansible.module_utils._text import to_n... | Python | 0 | @@ -543,16 +543,252 @@
s%5Bmod%5D%0A%0A
+ def test_import(self):%0A # this import makes dependency analysis work so the tests will run when the module_utils change%0A from ansible.module_utils.postgres import HAS_PSYCOPG2%0A%0A assert HAS_PSYCOPG2 is not None%0A%0A
@pat
|
15c68d6f9232b84c35ac29f6ff8e9ba25c86ab17 | Improve check for single-survey redirect even more | indico/modules/events/surveys/controllers/display.py | indico/modules/events/surveys/controllers/display.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0 | @@ -1367,16 +1367,58 @@
ySurvey%0A
+from indico.util.date_time import now_utc%0A
from ind
@@ -1565,510 +1565,764 @@
y%0A%0A%0A
-class RHSurveyBaseDisplay(RHConferenceBaseDisplay):%0A def _checkParams(self, params):%0A RHConferenceBaseDisplay._checkParams(self, params)%0A self.event = self._conf%0A%0... |
9bf5096ee78c9b71db37c7d6b3e1a806e65bc493 | Fix render_to_response deprecation warning for django >= 1.9 | annoying/decorators.py | annoying/decorators.py | from django.shortcuts import render_to_response
from django import forms
from django import VERSION as DJANGO_VERSION
from django.template import RequestContext
from django.db.models import signals as signalmodule
from django.http import HttpResponse
from django.conf import settings
from django.core.serializers.json im... | Python | 0.000394 | @@ -21,16 +21,24 @@
s import
+ render,
render_
@@ -3258,20 +3258,158 @@
SION
-%5B0%5D
%3E=
-1 and
+(1, 9):%0A return render(request, tmpl, output,%0A content_type=content_type or mimetype)%0A elif
DJA
@@ -3423,16 +3423,18 @@
SION
-%5B1%5D
%3E=
-5
+(1, ... |
ad42d5df34074bfb21229a962d4b2a548a796e9a | Update data_validation/jellyfish_distance.py | data_validation/jellyfish_distance.py | data_validation/jellyfish_distance.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -602,16 +602,18 @@
ract
-C
+_c
losest
-M
+_m
atch
|
7c2f915b0ca89db2c44a73af8db3f803687f068b | reimplement load_library and backup_library | unskipper.py | unskipper.py | #! /usr/bin/env python3
# unskipper.py will prune all skipcounts from your Quod Libet library;
# the resulting lack of '~#skipcount' in your per-song entries will all
# be interpreted by QL as being skipcount 0.
import os
import sys
import shutil
import pickle
HOME = os.getenv("HOME")
QLDIR = ".quodlibet"
PATH_TO_S... | Python | 0.000001 | @@ -250,22 +250,33 @@
%0Aimport
-pickle
+quodlibet.library
%0A%0AHOME =
@@ -315,29 +315,26 @@
dlibet%22%0A
-PATH_TO_
SONGS
+_PATH
= os.pa
@@ -378,28 +378,25 @@
ngs%22,%0A)%0A
-PATH_TO_BKUP
+BKUP_PATH
= os.pa
@@ -434,16 +434,16 @@
%22
-unpruned
+songs.bk
%22,%0A)
@@ -473,112 +473,66 @@
-raise NotImp... |
ba8e7f03469b55e8517361ade605804cb87757e3 | Update res_partner.py | l10n_ro_fiscal_validation/models/res_partner.py | l10n_ro_fiscal_validation/models/res_partner.py | # Copyright (C) 2018 Forest and Biomass Romania
# Copyright (C) 2020 NextERP Romania
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import time
import requests
from odoo import api, fields, models
CEDILLATRANS = bytes.maketrans(
u"\u015f\u0163\u015e\u0162".encode("utf8"),
u"\u0219\u021... | Python | 0 | @@ -540,25 +540,25 @@
ervice/api/v
-5
+6
/ws/tva%22%0AANA
@@ -618,17 +618,17 @@
ce/api/v
-5
+6
/ws/tva?
|
a889d4726189d1a7c9a9fbd074ca2c1d6eca9d98 | delete unnecessary constraint | chainercv/links/model/extraction_chain.py | chainercv/links/model/extraction_chain.py | import chainer
import collections
class ExtractionChain(chainer.Chain):
def __init__(self, layers, layer_names=None):
super(ExtractionChain, self).__init__()
if not isinstance(layers, collections.OrderedDict):
if layer_names is not None:
raise ValueError('`layer_names... | Python | 0.000024 | @@ -231,185 +231,8 @@
t):%0A
- if layer_names is not None:%0A raise ValueError('%60layer_names%60 needs to be %60None%60 unless '%0A '%60layers%60 is OrderedDict.')%0A
|
ce143f40f3131bbd04e40cacec50cae3e725b598 | use new package module | updatecmd.py | updatecmd.py | #
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import package
import files
import shutil
import pwd
import grp
import files
def doUpdate(cfg, root, pkgName, binaries = 1, sources = 0):
if root == "/":
print "using srs to update to your actual system is dumb."
import sys
sys.exit(0)
if pkgNam... | Python | 0 | @@ -531,23 +531,12 @@
%0A
- (version,
pkg
-)
= p
@@ -550,17 +550,41 @@
etLatest
-(
+Package(cfg.defaultbranch
)%0A%0A f
|
6ebf6e6f2e8c4e2be5e4778089a8d4a66432c88b | update ProgressHook | chainercv/utils/iterator/progress_hook.py | chainercv/utils/iterator/progress_hook.py | from __future__ import division
import sys
import time
class ProgressHook(object):
"""A hook class reporting the progress of iteration.
This is a hook class designed for
:func:`~chainercv.utils.apply_prediction_to_iterator`.
Args:
n_total (int): The number of images. This argument is option... | Python | 0 | @@ -486,17 +486,21 @@
f, i
-mgs, pred
+n_values, out
_val
@@ -504,17 +504,19 @@
values,
-g
+res
t_values
@@ -555,11 +555,19 @@
en(i
-mgs
+n_values%5B0%5D
)%0A
@@ -719,28 +719,29 @@
:d%7D of %7B:d%7D
-imag
+sampl
es, %7B:.2f%7D F
@@ -731,35 +731,43 @@
samples, %7B:.2f%7D
-FPS
+samples/sec
'.format(%0A ... |
75f8cad103cc3d78864358d7940465ea4caf9964 | correct MissingStartTimeError Exception error message | corehq/apps/auditcare/utils/migration.py | corehq/apps/auditcare/utils/migration.py | import logging
from datetime import datetime, timedelta
from django.core.cache import cache
from dimagi.utils.dates import force_to_datetime
from corehq.apps.auditcare.models import AuditcareMigrationMeta
from corehq.apps.auditcare.utils.export import get_sql_start_date
CUTOFF_TIME = datetime(2013, 1, 1)
CACHE_TTL... | Python | 0.000009 | @@ -4194,43 +4194,166 @@
-start_key = %222021-06-02_2021-06-01%22
+%0A from datetime import datetime%0A from corehq.apps.auditcare.utils.migration import AuditCareMigrationUtil%0A start_key = datetime(2021,6,1)
%0A
@@ -4371,23 +4371,26 @@
areMigra
+t
ionUtil
+()
.set_nex
|
f26afa6ed467ba475a7d2d7572d93a41f84b794a | Create automatic form for the option of the TableGraph object | dataedit/forms.py | dataedit/forms.py | from django import forms
from django.db import models
from django.forms import ModelForm
from dataedit.models import Tag
# This structure maps postgresql data types to django forms
typemap = [
(["smallint"], models.SmallIntegerField),
(["integer", "serial"], forms.IntegerField),
(["bigint", "bigserial"], ... | Python | 0 | @@ -114,16 +114,28 @@
port Tag
+, TableGraph
%0A%0A# This
@@ -3510,16 +3510,489 @@
%22---%22%0A%0A%0A
+class TableGraphForm(ModelForm):%0A%0A class Meta:%0A model = TableGraph%0A fields = '__all__'%0A exclude = ('table', 'schema')%0A%0A def __init__(self, *args, **kwargs):%0A column... |
5f38b5423846255e2265166f926a2e072e833d89 | Fix typo in message | datajoint/jobs.py | datajoint/jobs.py | import hashlib
import os
import pymysql
from .base_relation import BaseRelation
ERROR_MESSAGE_LENGTH = 2047
TRUNCATION_APPENDIX = '...truncated'
def key_hash(key):
"""
32-byte hash used for lookup of primary keys of jobs
"""
hashed = hashlib.md5()
for k, v in sorted(key.items()):
hashed.u... | Python | 0.998587 | @@ -1247,33 +1247,32 @@
char(%7Berror_mess
-s
age_length%7D) #
@@ -1627,17 +1627,16 @@
ror_mess
-s
age_leng
|
fd6463dfa31802c1b35f5c91db591d9b0ce47c7e | fix config with empty dict | dataset/config.py | dataset/config.py | """ Config class"""
class Config:
""" Class for configs that can be represented as nested dicts with easy indexing by slashes. """
def __init__(self, config=None, **kwargs):
if config is None:
self.config = dict()
elif isinstance(config, dict):
self.config = self.parse(c... | Python | 0.000005 | @@ -5400,32 +5400,51 @@
nce(value, dict)
+ and len(value) %3E 0
:%0A
|
39c50ed20cbd282c1e351057cc67d7234ca0a37d | incorrect histogram | assignment-1/utilities.py | assignment-1/utilities.py | from random import expovariate, randint
from queue import Queue
import matplotlib.pyplot as plt
import numpy as np
class Packet:
def __init__(self, arrival_time, service_time):
self.arrival_time = arrival_time
self.service_time = service_time
class Generator:
def __init__(self, arrival_lambd... | Python | 0.999014 | @@ -1652,16 +1652,48 @@
nts%5Bi:%5D)
+ * (bin_edges%5B1%5D - bin_edges%5B0%5D)
for i i
|
6612e22cb4f001c3b3e5230c49988e232e37ffad | use Exception as a base class for classes inheriting from Exception | astroid/brain/brain_gi.py | astroid/brain/brain_gi.py | # Copyright (c) 2013-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2014 Cole Robinson <crobinso@redhat.com>
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015-2016 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2015 David Shea <... | Python | 0.001088 | @@ -3318,32 +3318,37 @@
e__%0A for name
+, obj
in sorted(class
@@ -3349,19 +3349,121 @@
(classes
+.items()
):%0A
+ base = %22object%22%0A if issubclass(obj, Exception):%0A base = %22Exception%22%0A
@@ -3483,22 +3483,18 @@
%25s(
-object
+%25s
):%5Cn%22 %25
name
@@ -3489,20... |
d31f1455f872c97104da24948bbdc459021ff03e | Comment spacing | dataactcore/scripts/get_fsrs_updates.py | dataactcore/scripts/get_fsrs_updates.py | import argparse
import re
import logging
import os
import csv
import boto3
import datetime
import json
from dataactcore.logging import configure_logging
from dataactcore.interfaces.db import GlobalDB
from dataactcore.config import CONFIG_BROKER
from dataactvalidator.health_check import create_app
logger = logging.get... | Python | 0.000001 | @@ -2414,24 +2414,28 @@
ion%0A %22%22%22%0A
+
Query Su
@@ -2441,16 +2441,20 @@
ummary:%0A
+
Each
@@ -2564,16 +2564,20 @@
day
- and
%0A
+ and
als
@@ -2648,17 +2648,16 @@
saction.
-
%0A %22%22%22
|
b6368d368368b27a8883fa27fa3bda6929067a2c | fix minor typo in docstring | astroquery/xmatch/core.py | astroquery/xmatch/core.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.extern import six
from astropy.io import ascii
from astropy.units import arcsec
from astropy.table import Table
from . import conf
from ..query import BaseQuery
from ..utils import (commons, url_helpers,
prepend_docstr_n... | Python | 0.000546 | @@ -1068,24 +1068,25 @@
VizieR table
+)
or a an Ast
@@ -1298,17 +1298,16 @@
umbers.%0A
-
|
378aa9b7b8fa74187c16f7bbd446a78c3b5658a8 | Fix error message typo | utils/api.py | utils/api.py | #!/usr/bin/env python
'''
THIS APP IS NOT PRODUCTION READY!! DO NOT USE!
Flask app that provides a RESTful API to
the multiscanner.
Proposed supported operations:
GET / ---> Test functionality. {'Message': 'True'}
GET /api/v1/tasks/list ---> Receive list of tasks in multiscanner
GET /api/v1/tasks/list/<task_id> --->... | Python | 0.000384 | @@ -1146,20 +1146,16 @@
that ID
-not
found!'%7D
|
22f293ff16dd977c6a37b64566b37405d81cb767 | Make the KeyIdentifier.key_id field a property. | atlassian_jwt_auth/key.py | atlassian_jwt_auth/key.py | import os
import re
import requests
class KeyIdentifier(object):
""" This class represents a key identifier """
def __init__(self, identifier):
self.key_id = validate_key_identifier(identifier)
def validate_key_identifier(identifier):
""" returns a validated key identifier. """
regex = re... | Python | 0 | @@ -163,16 +163,18 @@
self.
+__
key_id =
@@ -211,16 +211,82 @@
ifier)%0A%0A
+ @property%0A def key_id(self):%0A return self.__key_id%0A%0A
%0Adef val
|
a8d6959d32b50cab41e05ae9e1eed75c1b7d3fa7 | Add replace to routes.all | respite/urls/routes.py | respite/urls/routes.py | from respite.inflector import pluralize, cc2us
class Route(object):
"""A route instance connects a path and method to a view."""
def __init__(self, regex, view, method, name):
"""
Initialize a route.
Arguments:
regex -- A string describing a regular expression to which the ... | Python | 0.000006 | @@ -2815,14 +2815,23 @@
e, edit,
+ replace,
new%5D%0A
|
fab58f03eaf09b9f286a10f5a91a945f53a92a29 | Drop native specification | splauncher/core.py | splauncher/core.py | from __future__ import print_function
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$May 18, 2015 16:52:18 EDT$"
import datetime
import os
import logging
drmaa_logger = logging.getLogger(__name__)
try:
import drmaa
except ImportError:
# python-drmaa is not installed.
drmaa_logger... | Python | 0 | @@ -1656,69 +1656,8 @@
wd()
-%0A job_template.nativeSpecification = %22-pe batch %22 + str(1)
%0A%0A
|
e61247230b291bcf9f9dcc3050876b9f812c6541 | change url for methodcheck thanks steve steiner http://www.atxconsulting.com/blog/tjfontaine/2010/02/09/updated-linode-api#comment-195 | methodcheck.py | methodcheck.py | #!/usr/bin/python
"""
A quick script to verify that api.py is in sync with Linode's
published list of methods.
Copyright (c) 2009 Ryan Tucker <rtucker@gmail.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 i... | Python | 0 | @@ -1236,12 +1236,11 @@
p://
-beta
+www
.lin
|
cc413b49ce9dd63fcbe9396a5ac1c8c68872a6c1 | Update information in pkginfo, including the version information. | astroid/__pkginfo__.py | astroid/__pkginfo__.py | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
#... | Python | 0 | @@ -905,12 +905,12 @@
(1,
-2, 1
+3, 0
)%0Ave
@@ -1076,21 +1076,16 @@
'py
-thon-projects
+lint-dev
@lis
@@ -1208,21 +1208,9 @@
= %22
-rebuild a new
+A
abs
@@ -1232,24 +1232,41 @@
ee f
+o
r
-om
Python
-'s ast
+ with inference support.
%22%0A%0Ac
|
8db52cb2481e49d7ca5568a0d10886da41643aba | Update retrosign.py | retrosign/retrosign.py | retrosign/retrosign.py | import discord, aiohttp, re
from bs4 import BeautifulSoup as b_s
from io import BytesIO
from discord.ext import commands
import os
import random
from random import choice
import lxml
class retrosign:
def __init__(self, bot):
self.bot = bot
@commands.group(name="retrosign")
async def retros... | Python | 0 | @@ -273,13 +273,15 @@
nds.
-group
+command
(nam
@@ -2943,33 +2943,32 @@
%0A @
-retrosign
+commands
.command(nam
@@ -2970,19 +2970,28 @@
d(name=%22
-top
+retrotopsign
%22)%0A a
@@ -4265,25 +4265,24 @@
%0A @
-retrosign
+commands
.command
@@ -4288,22 +4288,31 @@
d(name=%22
+retro
bottom
+sign
%... |
f5c22cdfef99878027f3f9e78ff9ae2701a21a3f | fix the url 'watch/' and 'watch3/' error | src/you_get/extractors/dilidili.py | src/you_get/extractors/dilidili.py | #!/usr/bin/env python
__all__ = ['dilidili_download']
from ..common import *
from .ckplayer import ckplayer_download
headers = {
'DNT': '1',
'Accept-Encoding': 'gzip, deflate, sdch, br',
'Accept-Language': 'en-CA,en;q=0.8,en-US;q=0.6,zh-CN;q=0.4,zh;q=0.2',
'Upgrade-Insecure-Requests': '1',
'User-... | Python | 0.999999 | @@ -1721,16 +1721,17 @@
/watch%5CS
++
', url):
|
9fee9967deb9078e6b522cc638df3d2f8cb98443 | add test | tests/cupy_tests/cuda_tests/test_stream.py | tests/cupy_tests/cuda_tests/test_stream.py | import unittest
from cupy._creation import from_data
from cupy import cuda
from cupy import testing
@testing.parameterize(
*testing.product({
'stream_name': ['null', 'ptds'],
}))
@testing.gpu
class TestStream(unittest.TestCase):
def setUp(self):
if cuda.runtime.is_hip and self.stream_nam... | Python | 0.000002 | @@ -4374,16 +4374,459 @@
ream()%0A%0A
+ @testing.multi_gpu(2)%0A def test_per_device(self):%0A with cuda.Device(0):%0A stream0 = cuda.Stream()%0A with stream0:%0A assert stream0 == cuda.get_current_stream()%0A with cuda.Device(1):%0A a... |
a891594150a4456e0894f2b5b70f2bd4b650bd77 | use debug to log dqn_freeze model update to prevent log overflow | rl/agent/dqn_freeze.py | rl/agent/dqn_freeze.py | import os
import numpy as np
from rl.agent.double_dqn import DoubleDQN
from rl.agent.dqn import DQN
from keras.models import load_model
from rl.util import logger
class DQNFreeze(DoubleDQN):
'''
Extends DQN agent to freeze target Q network
and periodically update them to the weights of the
exploratio... | Python | 0 | @@ -1327,12 +1327,13 @@
ger.
-info
+debug
(%22Up
|
cf837175763cd99e19dd95f14c9ac0dfd705bffd | set global 'sqlalchemy' log level to ERROR so it is insulated from other logging configs [ticket:353] | lib/sqlalchemy/logging.py | lib/sqlalchemy/logging.py | # logging.py - adapt python logging module to SQLAlchemy
# Copyright (C) 2006 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides a few functions used by instances to turn on/off their loggi... | Python | 0.000001 | @@ -1039,16 +1039,121 @@
ging')%0A%0A
+# turn off logging at the root sqlalchemy level%0Alogging.getLogger('sqlalchemy').setLevel(logging.ERROR)%0A%0A
default_
@@ -1434,52 +1434,8 @@
y')%0A
- rootlogger.setLevel(logging.NOTSET)%0A
|
9c03b61730b6f2c09f789301f633551480ff4b5e | Tidy up of unused code | saleor/checkout/forms.py | saleor/checkout/forms.py | """Checkout-related forms."""
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import pgettext_lazy
from django_prices.templatetags.prices_i18n import format_price
from ..shipping.models import ShippingMethodCountry
class CheckoutAddressField(forms.ChoiceField):
... | Python | 0.000096 | @@ -4126,518 +4126,5 @@
se)%0A
- %0A# def __init__(self, *args, **kwargs):%0A# self.checkout = kwargs.pop('checkout')%0A# initial = kwargs.get('initial', %7B%7D)%0A# if 'note' not in initial:%0A# initial%5B'note'%5D = self.checkout.note%0A# kwargs%5B'initial'%5D = initial%0A# ... |
38efa9aa11f949fc8bd0b6c4d1a673ca3416dd3c | Fix up iterator implementation in LISTALLOBJECTs | groundstation/transfer/request_handlers/listallobjects.py | groundstation/transfer/request_handlers/listallobjects.py | import groundstation.transfer.request
from groundstation import settings
from groundstation import logger
log = logger.getLogger(__name__)
def chunks(l, n):
""" Yield successive n-sized chunks from l.
"""
for i in xrange(0, len(l), n):
yield l[i:i+n]
def handle_listallobjects(self):
if not ... | Python | 0.00006 | @@ -999,16 +999,53 @@
erator%22)
+%0A%0A @self.station.register_iter
%0A
@@ -1049,17 +1049,24 @@
def
-_
+iterator
():%0A
@@ -1201,39 +1201,37 @@
iptions%22 %25 (len(
-payload
+chunk
)))%0A
@@ -1332,39 +1332,37 @@
chr(0).join(
-payload
+chunk
))%0A
@@ -1416,16 ... |
1fc0026aa72f7fcf66c221de402971023361e6c3 | implement memo logger | spyne/util/memo.py | spyne/util/memo.py |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | Python | 0.000001 | @@ -926,25 +926,540 @@
%0Aimport
-functools
+logging%0Alogger = logging.getLogger(__name__)%0A%0Aimport functools%0A%0A%0AMEMOIZATION_STATS_LOG_INTERVAL = 60.0%0A%0A%0Adef _do_log():%0A logger.debug(%22%25d memoizers%22, len(memoize.registry))%0A for memo in memoize.registry:%0A logger.debug(%22%25r: %25... |
ae044f507f3bcf508648b1a73a802b657009cd48 | fix nxos_reboot command format (#30549) | lib/ansible/modules/network/nxos/nxos_reboot.py | lib/ansible/modules/network/nxos/nxos_reboot.py | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | Python | 0 | @@ -1935,17 +1935,17 @@
terminal
--
+
dont-ask
@@ -1945,16 +1945,34 @@
ont-ask'
+, 'output': 'text'
%7D,%0A
|
b8ed081ac4cc5953aaf5b1a2091fefa59d375bf1 | Add logging for extension | uno_image.py | uno_image.py | """
Example usage of UNO, graphic objects and networking in LO extension
"""
import uno
import unohelper
from com.sun.star.task import XJobExecutor
class ImageExample(unohelper.Base, XJobExecutor):
'''Class that implements the service registered in LibreOffice'''
def __init__(self, context):
self.con... | Python | 0.000001 | @@ -71,16 +71,31 @@
on%0A%22%22%22%0A%0A
+import logging%0A
import u
@@ -503,16 +503,130 @@
ovider%22)
+%0A logging.basicConfig(filename=%22opencl_uno_example.log%22,%0A level=logging.WARNING)
%0A%0A de
|
67d26378653c2764f0c95beae991370344644716 | add reset method. | rmake/lib/publisher.py | rmake/lib/publisher.py | #
# Copyright (c) 2006 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://www.opensource.org/licen... | Python | 0 | @@ -669,66 +669,8 @@
f):%0A
- self.listeners = %7B%7D%0A self.dispatchers = %7B%7D%0A
@@ -731,32 +731,133 @@
, state, state)%0A
+ self.reset()%0A%0A def reset(self):%0A self.listeners = %7B%7D%0A self.dispatchers = %7B%7D%0A
self._to
|
3050659a87a7386b0a1d038a8f2ebcce23df1aa1 | add missing command | mint/broker.py | mint/broker.py | #!/usr/bin/python
#
# Copyright (c) 2007 rPath, Inc.
#
# All rights reserved
#
import os, sys
import optparse
import httplib
from mcp import client as mcp_client
from mcp import queue
from mcp import jobstatus
from mint import config as mint_config
from mint import server as mint_server
from conary import dbstore
... | Python | 0.655937 | @@ -1853,16 +1853,49 @@
urlMap)%0A
+ client.stopJob(uuid)%0A
fina
|
22a2c4ec841741297825f0e8ac301d6cad3b739b | Add replace for "0x2212" to -. | translate.py | translate.py | #!/usr/bin/env python3
import re
# подцепляем словарь из внешнего файла
import translate_dict as dictionary
input_text = None
filename = None
def replace_lang(text, dic):
langs = re.findall('(?:^Languages|(?<= ))(\w+)[, ]*', text)
langru = "Языки "
for lang in langs:
try:
langru = l... | Python | 0 | @@ -714,22 +714,28 @@
ce(b
-'%5Cxe2%5Cx88%5Cx9
+ytes.fromhex('221
2'
+)
.dec
|
1a78c461a0dcf6895646086c7863889c78f95f03 | Fix Nanoleaf light turn_off transition (#57305) | homeassistant/components/nanoleaf/light.py | homeassistant/components/nanoleaf/light.py | """Support for Nanoleaf Lights."""
from __future__ import annotations
from aionanoleaf import Nanoleaf, Unavailable
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_HS_COLOR,
ATTR_TRANSITION,
PLATFORM_SCHEMA,
SUPPORT_... | Python | 0 | @@ -5697,32 +5697,46 @@
transition
+: float %7C None
= kwargs.get(AT
@@ -5788,16 +5788,24 @@
urn_off(
+None if
transiti
@@ -5806,16 +5806,45 @@
ansition
+ is None else int(transition)
)%0A%0A a
|
807d197ca0c131c9ef5f4a683be04c7df8f715bb | Add goToAlias button (my position) to Overkiz integration (#76694) | homeassistant/components/overkiz/button.py | homeassistant/components/overkiz/button.py | """Support for Overkiz (virtual) buttons."""
from __future__ import annotations
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
fro... | Python | 0 | @@ -74,16 +74,110 @@
ations%0A%0A
+from dataclasses import dataclass%0A%0Afrom pyoverkiz.types import StateType as OverkizStateType%0A%0A
from hom
@@ -611,16 +611,182 @@
Entity%0A%0A
+%0A@dataclass%0Aclass OverkizButtonDescription(ButtonEntityDescription):%0A %22%22%22Class to describe an Overkiz button.%22%22%22... |
77e09f2f085bc894c1f45e94662e32a981e9b0db | Convert Chinese quotation | PythonScript/Helper/Helper.py | PythonScript/Helper/Helper.py | def main():
try:
fileName = "MengZi_Traditional.md"
filePath = "../../source/" + fileName
with open(filePath, 'r') as file:
for line in file:
print line
except IOError:
print ("The file (" + filePath + ") does not exist.")
if __name__ == '__main__':
... | Python | 0.999998 | @@ -1,8 +1,62 @@
+# This Python file uses the following encoding: utf-8%0A
def main
@@ -157,16 +157,39 @@
ileName%0A
+ content = None%0A
@@ -207,17 +207,16 @@
ilePath,
-
'r') as
@@ -237,52 +237,333 @@
-for line in file:%0A
+content = file.read().decode(%22utf-8%22)%0A conte... |
81d0e9eb255cd9afe20797a6c4b657a26a6b0d0b | Fix handler creation in abusehelper.core.mail.imapbot | abusehelper/core/mail/imapbot.py | abusehelper/core/mail/imapbot.py | from __future__ import absolute_import
import ssl
import socket
import getpass
import imaplib
import idiokit
from .. import bot, utils
from .message import message_from_string, escape_whitespace
from . import HandlerParam, load_handler
_DEFAULT_PORT_IMAP4 = 143
_DEFAULT_PORT_IMAP4_SSL = 993
class _IMAP4(imaplib.I... | Python | 0 | @@ -7249,24 +7249,28 @@
elf.handler(
+log=
self.log)%0A
|
d93de18a890ce2b03e5eb872033aaa81e83cdc8b | Resolve missing exception import in cryptdev | salt/modules/cryptdev.py | salt/modules/cryptdev.py | # -*- coding: utf-8 -*-
'''
Salt module to manage Unix cryptsetup jobs and the crypttab file
'''
# Import python libraries
from __future__ import absolute_import
import json
import logging
import os
# Import salt libraries
import salt.utils
# Import 3rd-party libs
import salt.ext.six as six
from salt.ext.six.moves i... | Python | 0 | @@ -235,16 +235,66 @@
lt.utils
+%0Afrom salt.exceptions import CommandExecutionError
%0A%0A# Impo
|
491938c9a7e976012ce4d4242d3c0d2079288040 | Fix broken test. | numba/tests/test_gil.py | numba/tests/test_gil.py | from __future__ import print_function
import ctypes
import ctypes.util
import os
import sys
import threading
import warnings
import numpy as np
import numba.unittest_support as unittest
from numba.compiler import compile_isolated, Flags
from numba import config, jit
from .support import TestCase, tag
# This CPytho... | Python | 0.000003 | @@ -251,22 +251,22 @@
import
-config
+errors
, jit%0Afr
@@ -5532,22 +5532,22 @@
lways',
-config
+errors
.NumbaWa
@@ -5652,14 +5652,14 @@
is
-config
+errors
.Num
|
7d985243a7ca32041101f34cfa6138e197de0c3c | Fix compatibility problem with string.Teamplate #69 | awscfncli2/config/formats.py | awscfncli2/config/formats.py | # -*- coding: utf-8 -*-
import copy
import json
import os
import string
import jsonschema
import six
from semantic_version import Version
from .deployment import StackKey, StackDeployment, StackMetadata, StackProfile, \
StackParameters, Deployment
from .schema import load_schema
CANNED_STACK_POLICIES = {
'A... | Python | 0.000003 | @@ -6785,36 +6785,12 @@
n =
-'a%5E'%0A braceidpattern =
r'
+%5C%7B
(?a:
@@ -6809,16 +6809,18 @@
z0-9-%5D*)
+%5C%7D
'%0A%0A%0Adef
|
44733bc3e1b530d3deda89c8ebf9cd6c20a8e6c1 | Fix the context manager to return a connection object (fix #41) | pyathena/connection.py | pyathena/connection.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import os
import time
from boto3.session import Session
from pyathena.converter import TypeConverter
from pyathena.cursor import Cursor
from pyathena.error import NotSupportedError
from pyathena.form... | Python | 0.000004 | @@ -3383,17 +3383,8 @@
self
-.cursor()
%0A%0A
|
0046421f050057bf1c3c87b06677feaa4cdc1f4a | set log formatter message type | awx/main/utils/formatters.py | awx/main/utils/formatters.py | # Copyright (c) 2017 Ansible Tower by Red Hat
# All Rights Reserved.
from logstash.formatter import LogstashFormatterVersion1
from copy import copy
import json
import time
class LogstashFormatter(LogstashFormatterVersion1):
def __init__(self, **kwargs):
settings_module = kwargs.pop('settings_module', Non... | Python | 0.000001 | @@ -539,16 +539,84 @@
ER_UUID%0A
+ self.message_type = settings_module.LOG_AGGREGATOR_TYPE%0A
|
4545fd9f5a6652ff787da6db1f4868aa81f82f75 | change font | string_recorder/string_recorder.py | string_recorder/string_recorder.py | import io
import shutil
import subprocess
import tempfile
class StringRecorder(object):
font = 'consolas'
def __init__(self, max_frames=100000):
self.tmp_dir = tempfile.mkdtemp()
self.max_frames = max_frames
self.__frame_t = 0
self.height = -1
self.width = -1
def... | Python | 0.000002 | @@ -88,31 +88,8 @@
):%0A%0A
- font = 'consolas'%0A%0A
@@ -106,16 +106,32 @@
__(self,
+ font='Courier',
max_fra
|
35825bbf06d7eb98c9e06cbd98e610659627c3d4 | ajuste conta dv | pyboleto/bank/safra.py | pyboleto/bank/safra.py | # -*- coding: utf-8 -*-
from ..data import BoletoData, CustomProperty
class BoletoSafra(BoletoData):
"""
Boleto Safra
"""
agencia_cedente = CustomProperty('agencia_cedente', 5)
conta_cedente = CustomProperty('conta_cedente', 8)
conta_cedente_dv = CustomProperty('conta_cedente_dv',1)
noss... | Python | 0.000001 | @@ -611,16 +611,19 @@
n %22%25s/%25s
+-%25s
%22 %25 (sel
@@ -659,16 +659,38 @@
_cedente
+,self.conta_cedente_dv
)%0A%0A @
|
eccaff6482b4dcf4555cf05d425223b9c5afad97 | use cfdisk if available, per recommendation in fdisk man; make compatible with Ubuntu | salt/modules/qemu_nbd.py | salt/modules/qemu_nbd.py | '''
Qemu Command Wrapper
====================
The qemu system comes with powerful tools, such as qemu-img and qemu-nbd which
are used here to build up kvm images.
'''
# Import python libs
import os
import glob
import tempfile
import time
# Import third party tools
import yaml
# Import salt libs
import salt.utils
im... | Python | 0 | @@ -688,24 +688,127 @@
return ''
+%0A%0A if salt.utils.which('cfdisk'):%0A fdisk = 'cfdisk -P t'%0A else:%0A fdisk = 'fdisk -l'
%0A __salt_
@@ -919,35 +919,30 @@
.retcode'%5D('
-fdisk -l %7B0
+%7B0%7D %7B1
%7D'.format(nb
@@ -931,32 +931,39 @@
%7B0%7D %7B1%7D'.format(
+fdisk,
nbd)):%0A ... |
34e121f22adac487b7dbd5f79d3e2033a89fabd6 | fix mask utils unittest | plugin_tests/polygon_and_mask_utils_test.py | plugin_tests/polygon_and_mask_utils_test.py | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 11 22:50:03 2019
@author: tageldim
"""
import unittest
import os
import girder_client
from pandas import read_csv
from histomicstk.utils.polygon_and_mask_utils import (
get_image_from_htk_response, get_bboxes_from_slide_annotations,
_get_idxs_for_all_ro... | Python | 0 | @@ -647,10 +647,10 @@
bdee
-d1
+92
e629
@@ -663,11 +663,12 @@
d01b
-cb%22
+5d%22
%0AGTC
@@ -1294,33 +1294,24 @@
self.
-TestCase.
assertTupleE
@@ -1764,33 +1764,24 @@
self.
-TestCase.
assertTupleE
@@ -2797,19 +2797,20 @@
verbose=
-Tru
+Fals
e, monit
@@ -2845,33 +2845,24 @@
self.
-TestCas... |
44696aa932b1655d9850ecd9bfc6412696c06bd2 | disable parallel tests in http_provider_test | studio/tests/http_provider_test.py | studio/tests/http_provider_test.py | import unittest
import subprocess
import time
from random import randint
import os
import tempfile
import uuid
from studio import model
from studio.util import has_aws_credentials
from model_test import get_test_experiment
@unittest.skipIf('GOOGLE_APPLICATION_CREDENTIALS' not in os.environ.keys(),
"... | Python | 0 | @@ -473,16 +473,18 @@
e):%0A%0A
+ #
_mutlip
|
550766a1447b2d8ed8c1ee7f34e1e6d06b64859c | Add a pragma | dataproperty/_function.py | dataproperty/_function.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import decimal
import math
import re
from collections import namedtuple
from decimal import Decimal
from mbstrdecoder import MultiByteStrDecoder
from six import text_typ... | Python | 0.999999 | @@ -4051,32 +4051,52 @@
iguous_width=1):
+ # pragma: no cover
%0A import warn
|
82bf2b2ca661d9f1057d7001b26a741178749df5 | Fix the bug about dupefilter | zhihu/zhihu/spiders/zhihuspider.py | zhihu/zhihu/spiders/zhihuspider.py | # -*- coding: utf-8 -*-
import scrapy
import re
import pdb
import json
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from ..items import ZhihuItem,RelationItem
from scrapy.http import Request,FormRequest
from scrapy_redis.spiders import RedisSpider
# ----... | Python | 0.000002 | @@ -1375,32 +1375,49 @@
lback=self.parse
+,dont_filter=True
)%0A #retur
@@ -6789,28 +6789,29 @@
nswers',callback=self.parse)
+%0A
|
670bc221b7af6398c90dbbde64feb22003c97690 | Revert "Violate architecture (on purpose)" | squad/api/views.py | squad/api/views.py | from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseForbidden
from django.http import HttpResponse
import logging
# an architecture violation
from squad.frontend import vie... | Python | 0 | @@ -259,71 +259,8 @@
g%0A%0A%0A
-# an architecture violation%0Afrom squad.frontend import views%0A%0A%0A
from
|
d8241adb51dcb81b99013aa23744a7a4a45f7d84 | fix self importer | mod_pbxproj.py | mod_pbxproj.py | # MIT License
#
# Copyright (c) 2016 Ignacio Calderon aka kronenthaler
#
# 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,... | Python | 0.000001 | @@ -1607,13 +1607,13 @@
= '
-1.3.1
+2.0.0
'%0A__
@@ -1691,28 +1691,24 @@
ts%0A from
-mod_
pbxproj impo
@@ -2069,20 +2069,16 @@
ly%0Afrom
-mod_
pbxproj
|
87b3e1612bc57461b439355ad08b18480d526430 | Update plot_tests.py | autotest/plot_tests.py | autotest/plot_tests.py | import os
#import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pyemu
def plot_summary_test():
try:
import matplotlib.pyplot as plt
except:
return
par_df = pd.read_csv(os.path.join("utils","freyberg_pp.par.usum.csv"),
index_col=0)
idx ... | Python | 0.000001 | @@ -1460,17 +1460,16 @@
t()%0A
-#
pst.plot
@@ -1501,26 +1501,24 @@
y=False)%0A
- #
pst.plot(ki
@@ -1541,34 +1541,32 @@
e_only=True)%0A
- #
pst.plot(kind=%22
@@ -1612,34 +1612,32 @@
iors%22)%0A #%0A
- #
pst.plot(kind=%22
@@ -1642,26 +1642,24 @@
=%221to1%22)%0A
- #
pst.plot(ki
@@ -1682,34... |
b221251b13882789c2ed95e4cd24b2327e068711 | Bump @graknlabs_client_java and @graknlabs_benchmark | dependencies/graknlabs/dependencies.bzl | dependencies/graknlabs/dependencies.bzl | #
# GRAKN.AI - THE KNOWLEDGE GRAPH
# Copyright (C) 2018 Grakn Labs Ltd
#
# 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 v... | Python | 0.000001 | @@ -1907,48 +1907,48 @@
= %22
-a19c068650e83a1b6aa388a63847e92164bc7795
+97197af2424e9c1f056a46633ee1c566e3f85111
%22,%0A
@@ -2124,48 +2124,48 @@
= %22
-97ecea678665e155587a58ebcacb8d3226a76fc8
+a2d31c7a0e7a478a909792e12aa1198d8a56c16c
%22 #
|
cfa947f12f72ac2d74bc351c7ff268fc48840631 | Enable NTP by default | anaconda-updates/6/installclasses/silvereye/__init__.py | anaconda-updates/6/installclasses/silvereye/__init__.py | #
# silverye.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it wi... | Python | 0 | @@ -4353,16 +4353,67 @@
.xml%0Afi%0A
+/sbin/chkconfig ntpdate on%0A/sbin/chkconfig ntpd on%0A
%22%22%22%0A
|
7b1d8bd1b2a8b1cb78ec9ab13b61acde977e5642 | remove ability to create/delete volumes on v2 | api/v2/views/volume.py | api/v2/views/volume.py | import django_filters
from rest_framework import viewsets
from core.models import Volume
from api.v2.serializers.details import VolumeSerializer
from core.query import only_current_source
class VolumeFilter(django_filters.FilterSet):
min_size = django_filters.NumberFilter(name="size", lookup_type='gte')
max_s... | Python | 0.000001 | @@ -705,16 +705,92 @@
meFilter
+%0A http_method_names = %5B'get', 'put', 'patch', 'head', 'options', 'trace'%5D
%0A%0A de
|
7f709b974c37020054634c09589ffb9922c36737 | Fix typo in variable name. | model/model.py | model/model.py | #! /usr/bin/env python2.7
import lib.database
class Model(object):
@classmethod
def init_model(cls, table, primary_key):
cls._table = table
cls._primary_key = primary_key
cls._db = lib.database.db
try:
cls._db.cursor.execute("SELECT * FROM %s WHERE FALSE"%cls._table)
cls.COLUMNS = set([desc.name for d... | Python | 0.000014 | @@ -727,32 +727,33 @@
me))%0A%09%09%09cls.REQU
+I
RED_COLUMNS = se
@@ -2317,16 +2317,17 @@
cls.REQU
+I
RED_COLU
|
53fbbe47ea1d9af09df20f884399148b80373d3e | Fix update result function | libcrowds_analyst/view.py | libcrowds_analyst/view.py | # -*- coding: utf8 -*-
"""View module for libcrowds-analyst."""
import json
import enki
from redis import Redis
from rq import Queue
from flask import render_template, request, abort, flash, redirect, url_for
from flask import current_app
from libcrowds_analyst import analysis, auth, forms
queue = Queue('libcrowds_a... | Python | 0.000001 | @@ -777,17 +777,16 @@
bclient.
-_
update_r
|
daee45e358f61d2e9cfef109efd9f474f7e91a4d | Add viz import to top level __init__ | pycroscopy/__init__.py | pycroscopy/__init__.py | """
The Pycroscopy package.
Submodules
----------
.. autosummary::
:toctree: _autosummary
core
"""
from . import core
from .core import *
from .io import translators
from . import analysis
from . import processing
from .__version__ import version as __version__
from .__version__ import time as __time__
_... | Python | 0 | @@ -219,16 +219,34 @@
ocessing
+%0Afrom . import viz
%0A%0Afrom .
|
efa4aede4b9faa9f0fc8639e4495ca8e98127d15 | Bump @graknlabs_verification | dependencies/graknlabs/dependencies.bzl | dependencies/graknlabs/dependencies.bzl | #
# 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... | Python | 0 | @@ -1614,48 +1614,48 @@
= %22
-7221428a2315b2ec26438b7c99363fd36052e380
+0f831029010385cf584cfd6787f574e9f210dfe2
%22%0A
|
dd83da792fbe1c90da855fe7d298f446a839f8ca | change for localhost in door.py | paulla.ircbot/src/paulla/ircbot/plugins/door.py | paulla.ircbot/src/paulla/ircbot/plugins/door.py | import irc3
from irc3.plugins.cron import cron
import requests
from datetime import datetime
@irc3.plugin
class Door:
"""
Door state plugin
"""
def __init__(self, bot):
self.bot = bot
self.log = self.bot.log
@irc3.event(irc3.rfc.MY_PRIVMSG)
def question(self, mask, event, tar... | Python | 0.000001 | @@ -560,27 +560,17 @@
p://
-sd-36895.dedibox.fr
+localhost
:222
|
d564d73622902f10f46ae53d2e72090b9f93cc7b | Fix for AC-694, we weren't saving the instance if using the cached user | awx/main/middleware.py | awx/main/middleware.py | from django.conf import settings
from django.contrib.auth.models import User
from django.db.models.signals import pre_save, post_save
from django.utils.functional import curry
from awx.main.models import ActivityStream, AuthToken
import json
import uuid
import urllib2
class ActivityStreamMiddleware(object):
def p... | Python | 0 | @@ -1371,32 +1371,68 @@
elf.cached_user%0A
+ instance.save()%0A
|
f90f7bd226c42e900074f0c7bfcc5210e580b5ed | Fix error reporting to actually set the right response code. | obstaravania/serving.py | obstaravania/serving.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from data_model import Firma, Obstaravanie, Firma, Candidate, Session
import db
from utils import obstaravanieToJson, getEidForIco
from jinja2 import Template
import json
from paste import httpserver
import webapp2
db.connect(False)
def errorJSON(code, text):
d = {"c... | Python | 0 | @@ -279,100 +279,8 @@
e)%0A%0A
-def errorJSON(code, text):%0A d = %7B%22code%22: code, %22message%22: %22ERROR: %22 + text%7D%0A return d%0A
%0Acla
@@ -477,16 +477,170 @@
':')))%0A%0A
+ def returnError(self, code, message):%0A self.response.set_status(code)%0A self.returnJSON(%7B'code': code, ... |
a228f73ea12fa4fcfa29bc2249c74c9e94954cff | Test function name adjustment. | cnxrepo/tests.py | cnxrepo/tests.py | # -*- coding: utf-8 -*-
"""Application tests"""
import os
import transaction
from nose import with_setup
from pyramid import testing
from pyramid.paster import get_appsettings
HERE = os.path.abspath(os.path.dirname(__file__))
TEST_RESOURCE_FILENAME = 'test-resource.png'
with open(os.path.join(HERE, TEST_RESOURCE_FILE... | Python | 0 | @@ -1388,16 +1388,17 @@
_content
+_
added_re
@@ -2686,19 +2686,22 @@
_content
+_
add
+ed
_referen
|
1916f45ed5d6a77a585153a4daacc8a6ab48b3a3 | fix conftest.py | dit/conftest.py | dit/conftest.py | """
Configuration for tests.
"""
from hypothesis import settings
settings.default.deadline = None | Python | 0.000102 | @@ -73,24 +73,40 @@
ngs.
-default.
+register_profile(%22dit%22,
deadline
= N
@@ -105,11 +105,40 @@
line
- =
+=
None
+)%0Asettings.load_profile(%22dit%22)%0A
|
920f5476cd9f63ff611567a63dd125cc6efaa228 | Fix import | deepvoice/data/cmudict.py | deepvoice/data/cmudict.py | import numpy as np
import itertools
import re
from keras.utils.data_utils import get_file
from sklearn.model_selection import train_test_split
from deepvoice.util.data_util import CharacterTable
def get_cmudict(origin='https://raw.githubusercontent.com/cmusphinx/cmudict/master/cmudict.dict', test_size=0.33, verbose=... | Python | 0.000002 | @@ -157,22 +157,28 @@
ice.
-util.data_util
+data.character_table
imp
|
7d43e6fd794fa1ef942a39937a653d5b18e867de | reorganize automatic dashboard | .github/scripts/create_dashboard.py | .github/scripts/create_dashboard.py | import os
from glob import glob
statuses = glob("workflow_testing_indicator/notebooks/*/*/*.png")
user = "probml"
base_url = f"https://github.com/{user}/pyprobml/tree/"
get_url = lambda x: f'<img width="20" alt="image" src=https://raw.githubusercontent.com/{user}/pyprobml/{x}>'
get_nb_url = lambda x: os.path.join(base... | Python | 0.000073 | @@ -804,24 +804,58 @@
%7C --- %7C%5Cn%22)%0A
+ passing = %5B%5D%0A failing = %5B%5D%0A
for stat
@@ -1124,16 +1124,97 @@
.log%22))%0A
+ failing.append(f%22%7C %5B%7Bjob%7D%5D(%7Burl_to_nb%7D) %7C %7Burl%7D %7C %5Blog%5D(%7Blog%7D) %7C%5Cn%22)%0A
@@ -1274,31 +1274,42 @@
%22-%22%0A ... |
2bac8c8df7a6f99fdc8a4efbdf2a094d3c6a7bae | fix link type data | product_template_multi_link/__manifest__.py | product_template_multi_link/__manifest__.py | # Copyright 2017-Today GRAP (http://www.grap.coop).
# @author Sylvain LE GAL <https://twitter.com/legalsylvain>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Multi Links (Template)",
"version": "13.0.1.1.0",
"category": "Generic Modules",
"author": "GRAP, ACSONE SA/... | Python | 0.000012 | @@ -464,24 +464,71 @@
%22data%22: %5B%0A
+ %22data/product_template_link_type.xml%22,%0A
%22sec
@@ -823,64 +823,8 @@
%22: %5B
-%0A %22data/product_template_link_type.xml%22,%0A
%22dem
@@ -857,24 +857,16 @@
pe.xml%22,
-%0A
%22demo/p
@@ -886,30 +886,24 @@
te_link.xml%22
-,%0... |
e19a99a555cd39cd380b7ede12da2190eb164eec | Make CSV errors into warnings | ingestors/tabular/csv.py | ingestors/tabular/csv.py | import io
import csv
import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.encoding import EncodingSupport
from ingestors.support.table import TableSupport
from ingestors.exc import ProcessingException
log = logging.getLogger(__name__)
class CSVIngestor(Inges... | Python | 0.998737 | @@ -1195,16 +1195,28 @@
except
+(Exception,
UnicodeD
@@ -1229,191 +1229,8 @@
rror
- as ude:%0A log.warning(%22Encoding error: %25r%22, entity)%0A raise ProcessingException(%22Could not decode CSV (%25s)%22 %25 encoding) from ude # noqa%0A except (Exception
, cs
@@ -1266,17 +1266,15 ... |
f7f37620a605954e1aeb2034f37be7ff35b0b4d6 | rewrite api root view | djoser/views.py | djoser/views.py | from django.contrib.auth import get_user_model
from rest_framework import generics, permissions, status, response
from rest_framework.serializers import BaseSerializer
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
from rest_framework.reverse import reverse
from django.co... | Python | 0.000001 | @@ -127,25 +127,24 @@
amework.
-serialize
+decorato
rs impor
@@ -149,22 +149,16 @@
ort
-BaseSerializer
+api_view
%0Afro
|
3c0e18944c7ff712288ccb16e439e07d4db0b3c1 | Fix init migration dependency | cmsplugin_date/migrations/0001_initial.py | cmsplugin_date/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Date',
fields=[
('cmsplugin_ptr', models.OneToO... | Python | 0.000003 | @@ -158,24 +158,68 @@
dencies = %5B%0A
+ ('cms', '0003_auto_20140926_2347'),%0A
%5D%0A%0A o
|
890263898e23de06b6b864898d753362fd604c92 | debug output for dupe=false | address_deduper/views/address.py | address_deduper/views/address.py | from address_deduper.views.base import *
from address_normalizer.deduping.near_duplicates import *
from address_normalizer.models.address import *
class AddressView(BaseView):
blueprint = Blueprint('addresses', __name__, url_prefix='/addresses')
@classmethod
def address_from_params(cls, require_str... | Python | 0.009255 | @@ -2683,32 +2683,41 @@
n request.values
+ and dupe
:%0A
@@ -3526,32 +3526,46 @@
existing_address
+ and r%5B'dupe'%5D
:%0A
|
43b992c09b092391e95b5a1893b6c19855482ff7 | fix autoconf header | dist/tools/kconfiglib/riot_kconfig.py | dist/tools/kconfiglib/riot_kconfig.py | """ RIOT customization of Kconfig """
import argparse
import sys
from kconfiglib import Kconfig, KconfigError
class RiotKconfig(Kconfig):
""" RIOT adaption of Kconfig class """
def _parse_help(self, node):
""" Parses the help section of a node, removing Doxygen markers """
doxygen_markers = [... | Python | 0 | @@ -593,20 +593,49 @@
header=
-None
+%22/* RIOT Configuration File */%5Cn%22
):%0A
|
a0598143062d0b33fdf59ef56d16d27d0bff2dd6 | fix #108 | hitcount/views.py | hitcount/views.py | import warnings
from collections import namedtuple
from django.http import Http404, JsonResponse, HttpResponseBadRequest
from django.conf import settings
from django.views.generic import View, DetailView
from hitcount.utils import get_ip
from hitcount.models import Hit, BlacklistIP, BlacklistUserAgent
from hitcount.u... | Python | 0.000001 | @@ -4519,17 +4519,59 @@
est.
-is_ajax()
+headers.get('x-requested-with') == 'XMLHttpRequest'
:%0A
|
c9cd1497eee67af351bdc98ee43aa25330ab6d7a | Add another date | inspectors/peacecorps.py | inspectors/peacecorps.py | #!/usr/bin/env python
import datetime
import logging
import os
from bs4 import BeautifulSoup
from utils import utils, inspector
# http://www.peacecorps.gov/about/inspgen/
archive = 1989
# options:
# standard since/year options for a year range to fetch from.
#
# Notes for IG's web team:
#
REPORTS_URL = "http://w... | Python | 0.000126 | @@ -1955,16 +1955,104 @@
1, 23),%0A
+ %22PCIG_MAR_Peace_Corps_Cloud_Computing_Pilot_Program%22: datetime.datetime(2015, 3, 17),%0A
%7D%0A%0AREPOR
|
d7f734dfae48c43bf10ddcc4b1e2a3a9863f0807 | stop assuming addresses that start with D are DOGE addresses | homepage/views.py | homepage/views.py | from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from annoying.decorators import render_to
from blockexplorer.decorators import assert_valid_coin_symbol
from blockexplorer.settings impo... | Python | 0.003528 | @@ -4375,13 +4375,8 @@
in (
-'D',
'9',
|
6d7c21979a741e60053faf6d4e444ad4bf01dcde | Fix unittests | backward/backends/session.py | backward/backends/session.py | try:
import cPickle as pickle
except ImportError:
import pickle
from .base import Backend
from backward import settings
class SessionBackend(Backend):
def get_url_redirect(self, request):
return request.session.get(settings.URL_REDIRECT_NAME, None)
def save_url_redirect(self, request, respo... | Python | 0.000005 | @@ -781,32 +781,42 @@
on(self, request
+, response
):%0A try:%0A
|
81cfcd62dacebac895fd819ccf0640597cc2822f | define a one-to-many relation from PostState to Post. post.state will be a lazy backref. | models/blog.py | models/blog.py | from datetime import datetime
from flask_misaka import markdown
from extensions import db
posts_to_tags = db.Table('posts_to_tags',
db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')),
db.Column('post_id', db.Integer, db.ForeignKey('post.id')))
class Post(db.... | Python | 0.00001 | @@ -2351,32 +2351,101 @@
xt, unique=True)
+%0A posts = db.relationship('Post', backref='state', lazy='dynamic')
%0A%0A def __init
|
fdbaaa6c1f20a48d0891106455c91d600c8236f7 | Change client.skia.fyi ports | masters/master.client.skia.fyi/master_site_config.py | masters/master.client.skia.fyi/master_site_config.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class SkiaFYI(Master.Master3):
project_name = 'SkiaFYI'
master_port = 8094
slave... | Python | 0.000001 | @@ -304,17 +304,17 @@
rt = 809
-4
+8
%0A slave
@@ -324,17 +324,17 @@
rt = 819
-4
+8
%0A maste
@@ -349,17 +349,17 @@
lt = 829
-4
+8
%0A repo_
|
9a688a0311cbf802bc541e267afac968bcf7ae2c | break down sample with a little bit extra info and show each step along the way | ocv_image_artihmetic.py | ocv_image_artihmetic.py | import numpy as np
import cv2 as cv
blue = np.zeros((300,512,3), np.uint8)
img = cv.imread('messi5.jpg')
cv.imshow('b', blue)
k = 0
while k != ord('q'):
k = cv.waitKey(100)
cv.destroyAllWindows() | Python | 0 | @@ -31,16 +31,209 @@
as cv%0A%0A%0A
+def ims(img, key, windows_name='dummy'):%0A cv.destroyAllWindows()%0A cv.imshow(windows_name, img)%0A k = 0%0A while k != ord(key):%0A k = cv.waitKey(10)%0A cv.destroyAllWindows()%0A%0A#
blue = n
@@ -263,16 +263,18 @@
.uint8)%0A
+#
img = cv
@@ -300,100 +3... |
4a12f00012b1a49d5a3b6876c563a58ab4583b26 | Add comments and MSVS settings | lib/node_modules/@stdlib/math/base/blas/dasum/binding.gyp | lib/node_modules/@stdlib/math/base/blas/dasum/binding.gyp | {
"targets": [
{
"target_name": "addon",
"link_settings": {
"libraries": [
"<(module_root_dir)/src/c_dasum.o",
"<(module_root_dir)/src/dasum.o",
"<(module_root_dir)/src/dasumsub.o"
]
},
"include_dirs": [
"<!(node -e \"require('nan')\")"... | Python | 0 | @@ -1,17 +1,17 @@
%7B%0A
-%22
+'
targets
-%22
+'
: %5B%0A
@@ -22,17 +22,78 @@
%7B%0A
-%22
+# The target name should match the add-on export name:%0A '
target_n
@@ -99,27 +99,231 @@
name
-%22: %22
+': '
addon
-%22
+'
,%0A
+%0A
-%22
+# Allow developer to choose whether to build a static or sh... |
139cfb7756aa6c01d547c0a88cac939c6e88e926 | Print where file is saved to. | util/tsne.py | util/tsne.py | #!/usr/bin/env python2
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
plt.style.use('bmh')
import os
import sys
import argparse
print("""
Note: This e... | Python | 0 | @@ -1192,20 +1192,15 @@
d()%0A
-plt.savefig(
+%0Aout =
%22%7B%7D/
@@ -1229,10 +1229,60 @@
workDir)
+%0Aplt.savefig(out)%0Aprint(%22Saved to: %7B%7D%22.format(out)
)%0A
|
4a064569802edb08084458be3decdac9528d9a57 | no need for semicolon | odo/backends/sql_csv.py | odo/backends/sql_csv.py | from __future__ import absolute_import, division, print_function
import os
import re
import subprocess
import uuid
import mmap
from contextlib import closing
from functools import partial
from distutils.spawn import find_executable
import sqlalchemy as sa
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.... | Python | 0.676492 | @@ -5108,17 +5108,16 @@
oding%7D')
-;
%22%22%22%0A
|
7f05631528a80adec1375b9e26364b0fa8fb05e0 | fix getting game winner | backgammon/model/utils.py | backgammon/model/utils.py | # Copyright (c) 2015, Bartlomiej Puget <larhard@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:
#
# * Redistributions of source code must retain the above copyright notice,
# this... | Python | 0.000001 | @@ -2494,17 +2494,17 @@
rd if k
-%3C
+%3E
0)%0A
@@ -2542,25 +2542,25 @@
board if k
-%3E
+%3C
0)%0A%0A if
|
fa6db1cd5d58393f7abd2603979cb20f706f592e | fix sorting | base/views/api/api_strain.py | base/views/api/api_strain.py | from base.models2 import strain_m
from base.application import app
from base.utils.decorators import jsonify_request
from sqlalchemy import or_
from flask import request
from logzero import logger
@app.route('/api/strain/query/<string:query>')
@jsonify_request
def search_strains(query):
base_query = strain_m.query... | Python | 0.000011 | @@ -4156,32 +4156,23 @@
train_m.
-reference_strain
+isotype
)%0A if
|
680d71646773737b4c41543df55d292b9f4f388a | add doc | banana/views/mixins.py | banana/views/mixins.py | from django.db import models
from banana.db import check_database
class MultiDbMixin(object):
"""
This mxin makes a Django class based views support multiple databases.
It requires a db variable in your request.
"""
def get_queryset(self):
self.db_name = self.kwargs.get('db', 'default')
... | Python | 0 | @@ -641,16 +641,155 @@
bject):%0A
+ %22%22%22%0A Checks the request for a format variable. If it is json or csv, will%0A set the content_type and template accordingly.%0A %22%22%22
%0A def
@@ -2065,24 +2065,45 @@
mplateMixin,
+%0A
self).rende
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.