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 |
|---|---|---|---|---|---|---|---|
da961ec779cc05b3629eb740a800122a493bfcaf | remove print statement | features/gestalten/templatetags/dismissible.py | features/gestalten/templatetags/dismissible.py | import json
from django import template
from django.db import models
from django.template import Library, loader
from ..models import GestaltSetting
register = Library()
@register.simple_tag(name='dismiss', takes_context=True)
def do_dismiss(context, name, category='dismissible', type='button'):
template_name ... | Python | 0.999999 | @@ -1795,44 +1795,9 @@
ist)
- as e:%0A print(type(e), e)
+:
%0A
|
46e52318c07a2021dafe549a84492e6cc60147e4 | Add new exception types | rabbitpy/exceptions.py | rabbitpy/exceptions.py | """
rabbitpy Specific Exceptions
"""
class ActionException(Exception):
def __repr__(self):
return self.args[0]
class ChannelClosedException(Exception):
def __repr__(self):
return 'Can not perform RPC requests on a closed channel, you must ' \
'create a new channel'
class Con... | Python | 0 | @@ -31,16 +31,49 @@
ns%0A%0A%22%22%22%0A
+from pamqp import specification%0A%0A
%0Aclass A
@@ -615,16 +615,139 @@
.args%0A%0A%0A
+class ConnectionResetException(Exception):%0A def __repr__(self):%0A return 'Connection was reset at socket level'%0A%0A%0A
class Em
@@ -1961,32 +1961,32 @@
eceived %25s' %25 ... |
d0b5933d0036979c92df577a085b29db9e1586bb | Add a method for retrieving frames of target change. | analysis/source.py | analysis/source.py | import climate
import os
import pandas as pd
logging = climate.get_logger('source')
class Subject:
'''Encapsulates data from a single subject.
Attributes
----------
root : str
The root filesystem path containing this subject's data.
blocks : list of `Block`
A list of the blocks f... | Python | 0 | @@ -2565,16 +2565,101 @@
%5B3:-2%5D%0A%0A
+ def target_contacts(self):%0A return self.df%5B'target'%5D.diff().nonzero()%5B0%5D%0A%0A
def
@@ -2686,23 +2686,17 @@
-markers
+i
= %7Bh: i
@@ -2725,32 +2725,8 @@
ers%7D
-%0A index = markers
%5Bnam
@@ -2743,17 +2743,27 @@
return
-%5B
+n... |
6797df54c6d201cba0c45bd4373de4951be546e8 | task 04 | task_04.py | task_04.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""In this task, you'll be defining a function with three parameters."""
def too_many_kittens(kittens, litterboxes, catfood):
"""Does some math and ensures we have enough supplies
Args:
kittens (int): Arg to tell us number of kittens we have.
litte... | Python | 0.999756 | @@ -113,16 +113,17 @@
rs.%22%22%22%0A%0A
+%0A
def too_
|
0faf594ee8b0bf7168e89f26bbed08c25defc568 | allow config-rewrite | lib/node_types/esp8266/freeze/uiot/_cfg.py | lib/node_types/esp8266/freeze/uiot/_cfg.py | # Configuration file management
#
_file = "/config.py"
def write():
global config
f = open(_file, "w")
f.write(
"""wifi_name = {}
wifi_pw = {}
netrepl = {}
mqtt_host = {}
mqtt_topic = {}
mqtt_user = {}
mqtt_pw = {}
""".format(
config.wifi_name,
config.wifi_pw,
) )
f.close()
def wifi(nam... | Python | 0.000002 | @@ -147,18 +147,20 @@
fi_pw =
+%22
%7B%7D
+%22
%0Anetrepl
@@ -162,18 +162,20 @@
trepl =
+%22
%7B%7D
+%22
%0Amqtt_ho
@@ -179,18 +179,20 @@
_host =
+%22
%7B%7D
+%22
%0Amqtt_to
@@ -197,18 +197,20 @@
topic =
+%22
%7B%7D
+%22
%0Amqtt_us
@@ -214,18 +214,20 @@
_user =
+%22
%7B%7D
+%22
%0Amqtt_pw
@@ -229,18... |
6389bebf4cac642d055fe1df3fe1ef4750f5861a | read data_server from environment in testing.py | testing.py | testing.py | import unittest
import sys
sys.path.append('roomfinder_web/roomfinder_web')
import web_server
class FlaskTestCase(unittest.TestCase):
def setUp(self):
sys.stderr.write('Setup testing.')
web_server.app.config['TESTING'] = True
self.app = web_server.app.test_client()
def test_correct_h... | Python | 0.000001 | @@ -189,24 +189,93 @@
testing.')%0A
+ web_server.data_server = os.getenv(%22roomfinder_data_server%22)%0A
web_
|
60daa277d5c3f1d9ab07ff5beccdaa323996068b | Add assignment tag util for rendering chunks to tpl context | feincmstools/templatetags/feincmstools_tags.py | feincmstools/templatetags/feincmstools_tags.py | import os
from django import template
register = template.Library()
@register.filter
def is_parent_of(page1, page2):
"""
Determines whether a given page is the parent of another page
Example:
{% if page|is_parent_of:feincms_page %} ... {% endif %}
"""
if page1 is None:
return False
... | Python | 0 | @@ -32,16 +32,87 @@
emplate%0A
+%0Afrom feincms.templatetags.feincms_tags import feincms_render_content%0A%0A
register
@@ -1140,8 +1140,179 @@
%5B1%5D%5B1:%5D%0A
+%0A%0A@register.assignment_tag(takes_context=True)%0Adef feincms_render_content_as(context, content, request=None):%0A return feincms_render_content(co... |
9bb0953b7aec9dddeaa8ef3c271bde1195a9cea5 | Update 3txt_tag_init.py | wangyi/wk5/3txt_tag_init.py | wangyi/wk5/3txt_tag_init.py |
# coding: utf-8
# In[ ]:
# In[1]:
import re
import os
if __name__ == '__main__':
root_path= r'/usr/yyy/wk5/txt_tagged/'
result_path = r'/usr/yyy/wk5/txt_tagged_init/'
if not os.path.exists(result_path):
os.mkdir(result_path)
file_list=os.listdir(root_path)
... | Python | 0.000001 | @@ -84,16 +84,106 @@
ain__':%0A
+%0A # Edit Area%0A # ===================================================================
%0A
@@ -275,16 +275,90 @@
_init/'%0A
+ # ===================================================================%0A
%0A
|
a388e1fd8dab1c745f750d08b75ae6ff612d8330 | Add more field types | rdmo/core/constants.py | rdmo/core/constants.py | from django.utils.translation import gettext_lazy as _
VALUE_TYPE_TEXT = 'text'
VALUE_TYPE_URL = 'url'
VALUE_TYPE_INTEGER = 'integer'
VALUE_TYPE_FLOAT = 'float'
VALUE_TYPE_BOOLEAN = 'boolean'
VALUE_TYPE_DATETIME = 'datetime'
VALUE_TYPE_OPTIONS = 'option'
VALUE_TYPE_FILE = 'file'
VALUE_TYPE_CHOICES = (
(VALUE_TYPE_... | Python | 0 | @@ -249,16 +249,74 @@
option'%0A
+VALUE_TYPE_OPTIONS = 'email'%0AVALUE_TYPE_OPTIONS = 'phone'%0A
VALUE_TY
|
3ef2e138afdad6cee0f4bc5191d3a762084b73b7 | Use pipe character as logical OR delimiter | kpi/filters.py | kpi/filters.py | from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.db.models import Q
from django.core.exceptions import FieldError
from rest_framework.compat import get_model_name
from rest_framework import filters
from haystack.query import SearchQuerySet
from haystack.inputs import Aut... | Python | 0.003061 | @@ -482,16 +482,17 @@
s_user%0A%0A
+%0A
class Kp
@@ -944,16 +944,17 @@
ryset)%0A%0A
+%0A
class Pa
@@ -1369,16 +1369,392 @@
eryset%0A%0A
+%0Aclass PipeDialect(unicodecsv.Dialect):%0A delimiter = '%7C'%0A quotechar = %22'%22%0A escapechar = '%5C%5C'%0A doublequote = False%0A skipinitialspace = False%0... |
44ad9ac2a1b471dea2c38e8b0a24d58918459df4 | Use ternary expression | tempy/t.py | tempy/t.py | # -*- coding: utf-8 -*-
# @author: Federico Cerchiari <federicocerchiari@gmail.com>
import importlib
from html.parser import HTMLParser
from mistune import Markdown
# Internal imports
from .markdown import TempyMarkdownRenderer
from .elements import Tag, VoidTag
class TempyParser(HTMLParser):
"""Custom parser us... | Python | 0.999992 | @@ -2720,22 +2720,16 @@
ss =
- %5BTag,
VoidTag
%5D%5Bse
@@ -2724,18 +2724,20 @@
VoidTag
-%5D%5B
+ if
self._vo
@@ -2734,25 +2734,33 @@
f self._void
-%5D
+ else Tag
%0A ret
|
e7a120b58dcde3c962f738eeb74f71cb2dc78f74 | Update hadoop version to 2.8.5 | blackbox/test_hdfs.py | blackbox/test_hdfs.py | # -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... | Python | 0 | @@ -1394,17 +1394,17 @@
= '2.8.
-4
+5
'%0AHADOOP
|
7ef5f1e887c0a155708d75453391fb002f09fc05 | fix script_detection flag in blla output | kraken/blla.py | kraken/blla.py | # -*- coding: utf-8 -*-
#
# Copyright 2019 Benjamin Kiessling
#
# 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 ... | Python | 0.000001 | @@ -6359,18 +6359,21 @@
ing' in
-nn
+model
.user_me
@@ -6387,18 +6387,21 @@
and len(
-nn
+model
.user_me
|
2c9702f64079a62cab9fc37e9b75718a890c7f30 | Fix pyflakes warning about unused array2 | tests/__init__.py | tests/__init__.py | '''
MMap Arrays Test Suite
(c) 2014 Farsight Security Inc.
Released under the MIT license. See license.txt.
'''
import math
import unittest
import tempfile
import os
import mmaparray
import six
def setUp(typecode, min_val=0, max_val=0, size=1024):
def fn(self):
self.backing = tempfile.NamedTemporaryFi... | Python | 0.000015 | @@ -2182,33 +2182,24 @@
lf):%0A
- array2 =
type(self.a
|
ea1587c6fc57f1765258a634e3968935aeebd88c | extend the meson cext import hack to _gi_cairo. Fixes #242 | tests/__init__.py | tests/__init__.py | from __future__ import absolute_import
import os
import sys
import unittest
import signal
import subprocess
import atexit
import warnings
import imp
class GIImport:
def find_module(self, fullname, path=None):
if fullname == 'gi._gi':
return self
return None
def load_module(self, ... | Python | 0 | @@ -233,19 +233,20 @@
ame
-==
+in (
'gi._gi'
:%0A
@@ -241,16 +241,33 @@
'gi._gi'
+, 'gi._gi_cairo')
:%0A
@@ -449,13 +449,27 @@
ule(
-'_gi'
+name.split('.')%5B-1%5D
)%0A
|
56a842fae1f88ee80d7ac88071819d82ee470e9f | Fix path for static_dir | keeper/dashboard/templateproviders.py | keeper/dashboard/templateproviders.py | """Providers load templates from specific sources and provider a
Jinja2 rendering environment.
"""
from __future__ import annotations
from pathlib import Path
import jinja2
from .context import BuildContextList, EditionContextList, ProjectContext
from .jinjafilters import filter_simple_date
class BuiltinTemplateP... | Python | 0.00001 | @@ -525,33 +525,37 @@
c_dir =
-self.template_dir
+Path(__file__).parent
.joinpat
|
6649f9edc226742b4184b73106df5496ad66406a | Add version 3.3.0 of R | var/spack/repos/builtin/packages/R/package.py | var/spack/repos/builtin/packages/R/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 | @@ -1803,16 +1803,73 @@
= True%0A%0A
+ version('3.3.0', '5a7506c8813432d1621c9725e86baf7a')%0A
vers
@@ -2760,16 +2760,62 @@
on('tk')
+%0A depends_on('curl')%0A depends_on('pcre')
%0A%0A de
|
5b74720878d96e8d20e0d75ef54e0e8eca5c191d | Remove test exclusion that wasn't working. | testsettings.py | testsettings.py | from settings import *
INSTALLED_APPS += (
'django_nose',
) + TEST_APPS
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
#'--no-migrations' # trim ~120s from test run with db tests
#'--with-fixture-bundling',
]
NOSE_PLUGINS = [
'corehq.tests.nose.AppLabelsPlugin',
'corehq.tests.nose.H... | Python | 0 | @@ -1093,213 +1093,8 @@
',%0A%0A
- 'NOSE_EXCLUDE_TESTS': ';'.join(%5B%0A # FIXME failing, excluded for now because they were not run by django test runner%0A 'corehq.apps.ota.tests.digest_restore.DigestOtaRestoreTest',%0A %5D),%0A%0A
|
1e5102d8bafb3b4d2cb07822129397aa56f30bbe | Handle using the input function in python 2 for getting username for examples | devicecloud/examples/example_helpers.py | devicecloud/examples/example_helpers.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2015 Digi International, Inc.
from getpass import getpass
import os
from devicecloud import DeviceCloud... | Python | 0.000082 | @@ -278,16 +278,44 @@
port os%0A
+from six.moves import input%0A
from dev
|
eba44b13b56a27882ff2de64180dd83d62a6061c | Add to_numpy_array function | dimod/binary_quadratic_model/convert.py | dimod/binary_quadratic_model/convert.py | from dimod import _PY2
from dimod.vartypes import Vartype
if _PY2:
def iteritems(d):
return d.iteritems()
def itervalues(d):
return d.itervalues()
else:
def iteritems(d):
return d.items()
def itervalues(d):
return d.values()
def to_networkx_graph(model, node_attribu... | Python | 0.004491 | @@ -3026,16 +3026,385 @@
adratic, offset%0A
+%0A%0Adef to_numpy_array(model):%0A %22%22%22todo%22%22%22%0A import numpy as np%0A%0A mat = np.zeros((len(model), len(model)), dtype=float)%0A%0A for v, bias in iteritems(model.binary.linear):%0A mat%5Bv, v%5D = bias%0A%0A for (u, v), bias in iteritem... |
f6d396157ad0b469f302506a2a55d5959d375d84 | use new string formatting style | toolbox.py | toolbox.py | #
# Author : Manuel Bernal Llinares
# Project : trackhub-creator
# Timestamp : 28-06-2017 11:03
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
This module implements some useful functions for the pipeline runner
"""
import os
import json
from exceptions import ToolBoxEx... | Python | 0.000002 | @@ -1095,18 +1095,13 @@
ion(
-folder + %22
+%22'%7B%7D'
is
@@ -1113,16 +1113,31 @@
folder%22
+.format(folder)
)%0A
|
2d5e7a3c0804cd30db9c099842f5dc76ec9fb670 | Fix tests | tests/__init__.py | tests/__init__.py | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
import tornado.testing
import celery
from flower.app import Flower
from flower.urls import handlers
from flower.events import Events
from flower.state import State
from flower.settings import APP_SETTINGS
class AsyncHT... | Python | 0.000003 | @@ -703,16 +703,97 @@
TTINGS)%0A
+ self.app.delay = lambda method, *args, **kwargs: method(*args, **kwargs)%0A
|
785d5ce8204bbe9727c38ac491e637b0a4b48a86 | fix omission in previous commit | lacli/cache.py | lacli/cache.py | import os
from glob import iglob
from lacli.adf import (load_archive, make_adf, Certificate, Archive,
Meta, Links, Cipher)
from lacli.log import getLogger
from lacli.archive import dump_archive, archive_slug
from lacli.exceptions import InvalidArchiveError
from lacli.decorators import contains
f... | Python | 0.00029 | @@ -2837,20 +2837,39 @@
ake_adf(
-docs
+list(docs.itervalues())
, out=f)
|
a2fadebe4147b8fa9700c54861138135df761d7f | Add celery time-to-run metric | corehq/celery_monitoring/signals.py | corehq/celery_monitoring/signals.py | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
from celery.signals import before_task_publish, task_prerun
from django.core.cache import cache
from dimagi.utils.parsing import string_to_utc_datetime
class TimingNotAvailable(Exception):
pass
class TimeToStartTime... | Python | 0.002857 | @@ -148,16 +148,30 @@
k_prerun
+, task_postrun
%0Afrom dj
@@ -312,27 +312,22 @@
%0A%0Aclass
-TimeToStart
+Celery
Timer(ob
@@ -363,16 +363,29 @@
task_id
+, timing_type
):%0A
@@ -409,16 +409,55 @@
task_id
+%0A self.timing_type = timing_type
%0A%0A @p
@@ -514,25 +514,18 @@
task.%7B%7D.
-time_sen... |
949b73d04154319bdb5d01dbbd235e0edbeb7e48 | version bump | vaxrank/__init__.py | vaxrank/__init__.py | __version__ = "1.2.0"
| Python | 0.000001 | @@ -14,9 +14,9 @@
%221.
-2
+3
.0%22%0A
|
08fc5aaacc646d003e72d63e1e3c069c522229d8 | add more xmpp logic | vbx/devices/xmpp.py | vbx/devices/xmpp.py | import queue
import threading
import twilio.twiml
import twilio.rest
import slixmpp.componentxmpp
import vbx
class XMPP(vbx.Device):
def __init__(self, jid, secret, server, port, target):
self.component = XMPPComponent(jid, secret, server, port, target)
def online(self):
return self.compon... | Python | 0 | @@ -1,12 +1,44 @@
+import asyncio%0Aimport functools%0A
import queue
@@ -110,30 +110,16 @@
slixmpp
-.componentxmpp
%0A%0Aimport
@@ -466,22 +466,8 @@
mpp.
-componentxmpp.
Comp
@@ -541,31 +541,8 @@
t):%0A
- self.jid = jid%0A
@@ -671,36 +671,283 @@
-def component_thread():%0A
+self.thread = t... |
0e33c3123e400f27639dfa54efe6a0a9d6164eab | use temp dir for upload test | django/crashreport/crashsubmit/tests.py | django/crashreport/crashsubmit/tests.py | from django.test import TestCase
from django.test import Client
from base.models import Version
import os
import tempfile
def get_test_file_path(file_name):
dir = os.path.dirname(__file__)
return os.path.join(dir, "testdata/%s" % (file_name))
def remove_dir(top):
for root, dirs, files in os.walk(top, to... | Python | 0 | @@ -1147,32 +1147,94 @@
c = Client()%0A
+ with self.settings(TEMP_UPLOAD_DIR=self.tmp_dir):%0A
with ope
@@ -1261,32 +1261,36 @@
(%22test%22)) as f:%0A
+
resp
@@ -1699,32 +1699,94 @@
c = Client()%0A
+ with self.settings(TEMP_UPLOAD_DIR=self.tmp_dir):%0A
w... |
3e6cf4541facb11aa446f128dfef67fd3196f926 | Change classe name | l10n_br_stock_account/models/stock.py | l10n_br_stock_account/models/stock.py | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2016 Renato Lima - Akretion
# Copyright (C) 2016 Luis Felipe Miléo - KMEE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | Python | 0.000003 | @@ -982,23 +982,28 @@
ss Stock
-Picking
+LocationPath
(models.
@@ -1324,15 +1324,20 @@
tock
-Picking
+LocationPath
, se
|
70acac5b1494301b933acd00e88dfefe46715bd1 | Fix webbrowser.open_url() (#319) | django_cloud_deploy/utils/webbrowser.py | django_cloud_deploy/utils/webbrowser.py | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -1098,102 +1098,608 @@
%22%22%22%0A
- with open(os.devnull, 'wb') as f:%0A os.dup2(f.fileno(), 2)%0A webbrowser.open(url)
+%0A # Save previous standard file descriptors%0A prev_stderr_fd = os.dup(2)%0A prev_stdout_fd = os.dup(1)%0A with open(os.devnull, 'wb') as f:%0A # redirect ... |
72c0d83390dbbd6053f0af3518266c3d6b517401 | remove backticks from field names in query | django_sphinx_db/backend/sphinx/base.py | django_sphinx_db/backend/sphinx/base.py | from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper
from django.db.backends.mysql.base import DatabaseOperations as MySQLDatabaseOperations
from django.db.backends.mysql.creation import DatabaseCreation as MySQLDatabaseCreation
class SphinxOperations(MySQLDatabaseOperations):
compile... | Python | 0.000002 | @@ -444,16 +444,175 @@
(%25s)'%0A%0A
+ def quote_name(self, name):%0A %22%22%22 Disable backtick field escaping, for support of sphinx fields%0A started with @-sign.%22%22%22%0A return name%0A%0A
%0Aclass S
|
3d4c3b2ca32d90937645194cf243a3b5f4e02e7a | put it back | tests/conftest.py | tests/conftest.py | import shutil
import tempfile
import numpy as np
import os
from os.path import getsize
import pytest
import yaml
from util import PATH_TO_TESTS, seed, dummy_predict_with_threshold
PATH_TO_ASSETS = os.path.join(PATH_TO_TESTS, 'assets')
PATH_TO_RETINA_DIR = os.path.join(PATH_TO_ASSETS, 'recordings', 'retina')
PATH_TO_R... | Python | 0.000007 | @@ -2035,15 +2035,8 @@
ut',
- 'tmp',
'pr
|
a89c173181283bba6cdbde26af8dbba0c6c3760c | fix test fixture | tests/conftest.py | tests/conftest.py | # pytest configuration file
from __future__ import absolute_import, division, print_function
import os
import pytest
@pytest.fixture
def testconfig():
'''Return the path to a configuration file pointing to a test database.'''
config_file = os.path.abspath(os.path.join(os.path.dirname(__file__),
... | Python | 0.000001 | @@ -99,16 +99,29 @@
ort os%0A%0A
+import ispyb%0A
import p
|
4fc0b0c3f2775ad04e8f148016b2590a9ffab1df | Update errors.py | src/errors.py | src/errors.py | """Custome errors"""
class AlApiError(Exception):
"""Base class for exceptions in this module"""
class NotAuthenticatedError(AlApiError):
"""Raise when a non 200 is returned"""
class CredentialsNotSet(AlApiError):
"""Placeholder for missing credentials"""
class EventNotRetrievedError(AlApiError):
... | Python | 0.000001 | @@ -2,17 +2,16 @@
%22%22Custom
-e
errors%22
|
3c572de428b5ec63afc38945a7c4953318fbd5df | Add EXIF filter (#46) | tests/conftest.py | tests/conftest.py | import os
from typing import Iterable, Tuple, Union
from unittest.mock import patch
import pytest
from organize.compat import Path
from organize.utils import DotDict
TESTS_FOLDER = os.path.dirname(os.path.abspath(__file__))
def create_filesystem(tmp_path, files, config):
# create files
for f in files:
... | Python | 0 | @@ -217,24 +217,83 @@
__file__))%0A%0A
+TESTS_FOLDER = os.path.dirname(os.path.abspath(__file__))%0A%0A
%0Adef create_
|
064e1f540e05ed5c92d688407c3aa36837e634a8 | Remove pytest 2.7.x compatibility fixture. | tests/conftest.py | tests/conftest.py | import copy
import shutil
from textwrap import dedent
import py
import pytest
from django.conf import settings
from pytest_django_test.db_helpers import (create_empty_production_database,
DB_NAME, get_db_engine)
pytest_plugins = 'pytester'
REPOSITORY_ROOT = py.path.local(_... | Python | 0 | @@ -752,211 +752,8 @@
%7D%0A%0A%0A
-@pytest.fixture%0Adef testdir(testdir):%0A # pytest 2.7.x compatibility%0A if not hasattr(testdir, 'runpytest_subprocess'):%0A testdir.runpytest_subprocess = testdir.runpytest%0A%0A return testdir%0A%0A%0A
@pyt
|
73c9bc5010dfa2821b54abb57a93d06087acf00f | Add new properties. | e3d/gui/LayerClass.py | e3d/gui/LayerClass.py | from ..Base3DObjectClass import Attachable
from cycgkit.cgtypes import *
class Layer(Attachable):
"""
Virtual top level container for gui objects.
Only objects attached to this will be drawn 'above' the scene, in 2D mode.
"""
def __init__(self, ID, guiMan, visible=True):
"""
... | Python | 0 | @@ -478,35 +478,36 @@
e%0A self._
-rea
+pixe
lSize = vec3(1)%0A
@@ -641,19 +641,20 @@
= self.
-rea
+pixe
lSize%0A
@@ -679,16 +679,90 @@
= True%0A
+%0A self._rotationMatrix = mat4(1)%0A self._position = vec3(0)%0A%0A
@@ -765,35 +765,36 @@
self._update
-Rea
+Pixe
lSize()%0A%0... |
6f926a6d56ac2148fcb147c217e41033a73fb4c2 | Handle the case where the original request doesn't exist (or has timed out) | vumi/transports/mtn_rwanda/mtn_rwanda_ussd.py | vumi/transports/mtn_rwanda/mtn_rwanda_ussd.py | # -*- test-case-name: vumi.transports.mtn_rwanda.tests.test_mtn_rwanda_ussd -*-
from twisted.internet import reactor
from twisted.web import xmlrpc, server
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.transports.base import Transport
from vumi.config import ConfigServerEndpoint, ConfigInt
c... | Python | 0.000004 | @@ -4968,16 +4968,208 @@
ly_to'%5D%0A
+%0A if self.get_request(request_id) is None:%0A return self.publish_nack(user_message_id=request_id,%0A sent_message_id=request_id, reason='Request not found')%0A%0A
@@ -5308,37 +5308,26 @@
sage_id=
-message%5B'message
+request
_id... |
95f5baeaff85e2f1f5f36e8cb4ffa871ab0c0a30 | Fix broken tutorial step | docs/samples/tutorial/step8/tutorial.py | docs/samples/tutorial/step8/tutorial.py | from wex.extractor import label, Attributes
from wex.url import get_url
from wex.etree import xpath, text
attrs = Attributes(
name = xpath('//h1') | text,
country = xpath('//dd[@id="country"]') | text,
region = xpath('//dd[@id="region"]') | text
)
extract = label(get_url)(attrs)
| Python | 0.000007 | @@ -50,26 +50,32 @@
wex.
-url import get_url
+response import Response
%0Afro
@@ -282,12 +282,20 @@
bel(
+Response.
get
-_
url)
|
7d09dd673bd2baeb30ba529498e7e71d6278f373 | Stop setting quiz finished boolean twice | src/nyc_trees/apps/home/training/views.py | src/nyc_trees/apps/home/training/views.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.db import transaction
from apps.home.training.utils import get_quiz_or_404
from apps.users.models import TrainingResult
def training_list_page(request):
from apps.hom... | Python | 0.000005 | @@ -1231,198 +1231,8 @@
e)%0A%0A
- passed_quiz_bool = 'training_finished_%25s' %25 quiz_slug%0A if passed_quiz and getattr(user, passed_quiz_bool) is False:%0A setattr(user, passed_quiz_bool, True)%0A user.save()%0A%0A
|
6dda000292731183d36cc8d9590e5512f4e00b16 | fix case | InvenTree/common/notifications.py | InvenTree/common/notifications.py | import logging
from datetime import timedelta
from django.template.loader import render_to_string
from allauth.account.models import EmailAddress
from InvenTree.helpers import inheritors
from common.models import NotificationEntry
import InvenTree.tasks
logger = logging.getLogger('inventree')
# region notificati... | Python | 0.000029 | @@ -4070,12 +4070,11 @@
#
-save
+Set
del
|
e64405624ae2bb76547037deac7342e40fd20808 | Remove unused imports. | scipy/linalg/setup.py | scipy/linalg/setup.py | #!/usr/bin/env python
import os
import sys
import re
from distutils.dep_util import newer_group, newer
from glob import glob
from os.path import join
#-------------------
# To skip wrapping single precision atlas/lapack/blas routines, set
# the following flag to True:
skip_single_routines = 0
# Some OS distributions... | Python | 0 | @@ -20,39 +20,8 @@
on%0A%0A
-import os%0Aimport sys%0Aimport re%0A
from
@@ -70,30 +70,8 @@
wer%0A
-from glob import glob%0A
from
|
76a360d3a7c5f2e2257a4edf2f38f7c214ec537a | Fix stats calculation function. | app/utils/stats/daily.py | app/utils/stats/daily.py | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... | Python | 0 | @@ -4894,25 +4894,24 @@
fields = %5B
-(
models.CREAT
@@ -4920,15 +4920,8 @@
_KEY
-, True)
%5D%0A%0A
@@ -5092,16 +5092,19 @@
art_doc%5B
+0%5D%5B
models.C
|
5f0cbb2d160e975d93b26b5f03193c4f90461ac3 | Fix LLVM/Mono build. Bumping LLVM to latest requires using libc++ for LLVM and Mono. Added this fix to mono-master-encrypted profile. | packages/mono-master-encrypted.py | packages/mono-master-encrypted.py | import os
class MonoMasterEncryptedPackage(Package):
def __init__(self):
if os.getenv('MONO_VERSION') is None:
raise Exception('You must export MONO_VERSION to use this build profile. e.g. export MONO_VERSION=3.1.0')
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
s... | Python | 0 | @@ -1148,16 +1148,58 @@
edllvm'%0A
+ 'CXXFLAGS=-stdlib=libc++'%0A
|
177658f45d1efe305da481fb2c2469bca9bfdd48 | handle GitHub race condition when requesting commits | leeroy/base.py | leeroy/base.py | # Copyright 2012 litl, LLC. Licensed under the MIT license.
import logging
from flask import Blueprint, current_app, json, request, Response, abort
from werkzeug.exceptions import BadRequest, NotFound
from . import github, jenkins
base = Blueprint("base", __name__)
@base.route("/ping")
def ping():
return "po... | Python | 0 | @@ -69,16 +69,22 @@
logging
+, time
%0A%0Afrom f
@@ -4222,24 +4222,285 @@
d(err_msg)%0A%0A
+ # There is a race condition in the GitHub API in which requesting%0A # the commits for a pull request can return a 404. Try a few%0A # times and back off if we get an error.%0A tries_left = 5%0A while True:%... |
f5342ae1a1f8473626a59bb6987e9f072d393a0b | Fix tag url regex | board/urls/default.py | board/urls/default.py | from django.conf import settings
from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from django.utils.functional import curry
from django.views.defaults import permission_denied
from redactor.forms import FileForm, ImageForm
from board.views import HCLoginView, HCSettingsVie... | Python | 0.00216 | @@ -1232,18 +1232,17 @@
(?P%3Ctag%3E
-%5Cw
+.
+)/', Po
|
0cfeeb68177969125adab4cad33d28137b7710ed | Clean up incorrect comment | apps/storybase_taxonomy/views.py | apps/storybase_taxonomy/views.py | from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from django.http import Http404
from storybase_story.views import ExplorerRedirectView, StoryListView, StoryListWidgetView
from storybase_taxonomy.models import Category, Tag
class CategoryExplorerRedirectView(Ex... | Python | 0.000005 | @@ -888,82 +888,8 @@
f):%0A
- %22%22%22Retrieve the object by it's model specific id instead of pk%22%22%22%0A
|
df301fad7106b0631215b96299801b81ccc38a0e | Update geoipupdater.py | geoipupdater.py | geoipupdater.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Update GeoIP.dat if newer version exists on maxmind.com
Intended to run as a cronjob
"""
__author__ = 'Morten Abildgaard <morten@abildgaard.org>'
__version__ = '1.1'
import logging as log
import os, sys
from cStringIO import StringIO
from datetime import datetime
from g... | Python | 0.000003 | @@ -1422,16 +1422,69 @@
fo()%5B1%5D)
+%0A%09%09else:%0A%09%09%09log.info('No newer version found online')
%0A%0A%09def g
|
f3653fdc3cefe5c398ed94f9e70a74cedbcf284b | fix typo | ttunnel.py | ttunnel.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from hashlib import md5
from Crypto.Cipher import AES
from tornado.ioloop import IOLoop
from tornado.gen import coroutine
from tornado.log import app_log
from tornado.tcpclient import TCPClient
from tornado.tcpserver import TCPServer
from tornado.options import define, option... | Python | 0.999991 | @@ -1494,24 +1494,62 @@
tpeername()%0A
+ fa = '%25s:%25s' %25 (fa%5B0%5D, fa%5B1%5D)%0A
ta =
@@ -1545,25 +1545,25 @@
ta =
-f
+t
.socket.getp
@@ -1571,16 +1571,54 @@
ername()
+%0A ta = '%25s:%25s' %25 (ta%5B0%5D, ta%5B1%5D)
%0A%0A
@@ -2437,22 +2437,20 @@
)%0A t.
-listen
+bin... |
3d8d181c6aea1c80c860b6735c878899baa57f70 | Update main.py | apps/telegram/diskreport/main.py | apps/telegram/diskreport/main.py | # -*- coding: utf-8 -*-
# Author : JeongooonKang (github.com/jeonghoonkang)
import json
import time
import local_port_scanning
import socket
import fcntl
import struct
import os
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
info = fcntl.ioctl (s.fileno(), 0x8915,
s... | Python | 0.000001 | @@ -98,35 +98,8 @@
ime%0A
-import local_port_scanning%0A
impo
@@ -145,16 +145,89 @@
port os%0A
+import datetime%0Aimport telegram%0Aimport requests%0Afrom pytz import timezone
%0A%0Adef ge
@@ -597,41 +597,17 @@
%EC%9D%B4%ED%8A%B8 %0A
- #print (free_space)%0A
ret
-r
u
+r
n fr
@@ -624,134 +624,103 @@
def ... |
3ba1ffaedc35ed4334db1ad33cdcb99f605953c3 | add trace_module to debugutils | boltons/debugutils.py | boltons/debugutils.py | # -*- coding: utf-8 -*-
"""
A small set of utilities useful for debugging misbehaving
applications. Currently this focuses on ways to use :mod:`pdb`, the
built-in Python debugger.
"""
__all__ = ['pdb_on_signal', 'pdb_on_exception']
def pdb_on_signal(signalnum=None):
"""Installs a signal handler for *signalnum*, ... | Python | 0 | @@ -224,16 +224,32 @@
ception'
+, 'trace_module'
%5D%0A%0A%0Adef
@@ -2004,8 +2004,957 @@
epthook%0A
+%0A%0Adef trace_module(modules):%0A '''Prints lines of code as they are executed only within the%0A given modules, in the current thread.%0A%0A Compare to '-t' option of trace from the standard library, mad... |
5afe484b4c78d0bd879e830b56bdb4045b779236 | Fix handle removal bug, introduce english check | twitbot.py | twitbot.py | from collections import namedtuple
import time
import tweepy
import herrbot_secrets
BOT_SCREEN_NAME = "herrbot_DE"
RespondableTweet = namedtuple(
typename='RespondableTweet',
field_names = ["tweet", "bot_caller"],
)
def report_error(api, e):
""" Report an exception to the owner of this bot
:par... | Python | 0 | @@ -110,16 +110,82 @@
bot_DE%22%0A
+ERROR_MSG = %22Entschuldigung Ich spieke nur Deutsch von Englisch%22%0A%0A
%0ARespond
@@ -2196,16 +2196,245 @@
nd_to%0A%0A%0A
+def _clean_text(text):%0A clean_text = text.replace(%22@%7B0%7D%22.format(BOT_SCREEN_NAME), %22%22)%0A clean_text = clean_text.replace(%22@%7B0%7D%2... |
869a4ac93230ccf1dad7e5e6eb12dd23236b3ef8 | Fix return default images but not on cards that do not exist in non-idolized | api/serializers.py | api/serializers.py | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User, Group
from rest_framework import serializers
from api import models
from dateutil.relativedelta import relativedelta
from django.core.urlresolvers import reverse as django_reverse
import datetime
class UserSerializer(serializers.ModelSerializer):
... | Python | 0 | @@ -2910,16 +2910,17 @@
+(
idolized
@@ -2977,16 +2977,17 @@
_promo))
+)
:%0A
|
ad11ab338b5b04919c18900ece86096dbe3222f8 | Update error message | vimeo/exceptions.py | vimeo/exceptions.py | #!/usr/bin/env python
class BaseVimeoException(Exception):
def _get_message(self, response):
json = None
try:
json = response.json()
except:
pass
if json:
message = json['error']
else:
message = response.text
return m... | Python | 0.000001 | @@ -2469,18 +2469,13 @@
ill
-be
reset
-ed
on:
|
0da15482bd95f5a659972749f9ad0460b6ba632a | Fix last diaper change time on card. | dashboard/templatetags/dashboard.py | dashboard/templatetags/dashboard.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from django import template
from django.utils import timezone
from core.models import DiaperChange, Feeding, Sleep, TummyTime
register = template.Library()
@register.inclusion_tag('cards/feeding_last.html')
def ca... | Python | 0 | @@ -1796,18 +1796,19 @@
stances.
-la
+fir
st()%7D%0A%0A%0A
|
e7c90e631e0efa0003d6d626885869f5ff920af1 | Add epic prefix to pull request title | gifi/git_hub.py | gifi/git_hub.py | import getpass
import logging
from github import Github, GithubException
from github.MainClass import DEFAULT_BASE_URL
import feature
from command import AggregatedCommand, Command, CommandException
from gifi.utils.ui import ask
from utils.configuration import Configuration, NOT_SET, configuration_command, REPOSITORY_... | Python | 0 | @@ -3535,23 +3535,94 @@
-default_title =
+epic = '/'.join(current_branch.split('/')%5B1:-1%5D)%0A default_title = %22(%25s) %25s%22 %25(epic,
rep
@@ -3642,16 +3642,17 @@
.summary
+)
%0A if
|
94763d1927f5ff70e7718af8beec9a4b741fc380 | Fix false positive handling of INT and ENUMs for migrate | website/database/migrate.py | website/database/migrate.py | import re
from warnings import warn
from database import db
from helpers.commands import got_permission
def add_column(engine, table_name, definition):
sql = f'ALTER TABLE `{table_name}` ADD {definition}'
engine.execute(sql)
def drop_column(engine, table_name, column_name):
sql = f'ALTER TABLE `{table_... | Python | 0.000179 | @@ -3120,16 +3120,17 @@
+r
'TINYINT
(1)'
@@ -3125,18 +3125,20 @@
'TINYINT
+%5C
(1
+%5C
)': 'BOO
@@ -3205,16 +3205,58 @@
+r
'INT
+%5C
(11
-)
+%5C)': 'INTEGER',%0A 'INT$
': '
@@ -3520,13 +3520,16 @@
n%3E%5B%5E
-,
+%5Cn
%5D*),
+%5Cn
?',
@@ -3850,80 +3850,206 @@
g =
-definition_... |
b6d84fbd01975bafe16b71b29760c02a5e9ed7c5 | clean up comments | to_lmdb.py | to_lmdb.py | '''
Created on Jul 18, 2015
@author: kashefy
'''
import os
import numpy as np
from scipy import io
import cv2 as cv2
import cv2.cv as cv
import lmdb
from read_img import read_img_cv2
def imgs_to_lmdb(paths_src, path_dst, CAFFE_ROOT=None):
'''
Generate LMDB file from set of images
Source: https://github.co... | Python | 0 | @@ -1689,77 +1689,8 @@
-#print content_field.shape%0A #print 'before', content_field
%0A
@@ -1785,50 +1785,12 @@
-%0A
- #print 'after', content_field
%0A
|
e38710cb8195d9ae7feacb996037abfa2289159d | include per_cpu_times() and Process.terminal in memory leak test script | test/test_memory_leaks.py | test/test_memory_leaks.py | #!/usr/bin/env python
#
# $Id$
#
"""
Note: this is targeted for python 2.x.
To run it under python 3.x you need to use 2to3 tool first:
$ 2to3 -w test/test_memory_leaks.py
"""
import os
import gc
import unittest
import psutil
from test_psutil import reap_children, skipUnless, skipIf, \
POSI... | Python | 0 | @@ -2451,24 +2451,87 @@
_running')%0A%0A
+ def test_terminal(self):%0A self.execute('terminal')%0A%0A
@skipUnl
@@ -4613,16 +4613,89 @@
imes')%0A%0A
+ def test_per_cpu_times(self):%0A self.execute('per_cpu_times')%0A%0A
%0Adef tes
|
b6b6b1949afab9a8a963afcdd34cd9ae83e5c296 | Remove *percent() calls from memory leak test script: there's no need to test them as they're written in python. | test/test_memory_leaks.py | test/test_memory_leaks.py | #!/usr/bin/env python
#
# $Id$
#
"""
Note: this is targeted for python 2.x.
To run it under python 3.x you need to use 2to3 tool first:
$ 2to3 -w test/test_memory_leaks.py
"""
import os
import gc
import sys
import unittest
import psutil
from test_psutil import reap_children, skipUnless, skipIf, \
... | Python | 0.000017 | @@ -2097,224 +2097,64 @@
get_
-cpu_percent(self):%0A self.execute('get_cpu_percent')%0A%0A def test_get_memory_info(self):%0A self.execute('get_memory_info')%0A%0A def test_get_memory_percent(self):%0A self.execute('get_memory_percent
+memory_info(self):%0A self.execute('get_memory_in... |
d13cb5cdf61e332977ca45b8f29f3a833e784725 | Fix issue 109: replace old cleanup() function with reap_children(). test_memory_leaks.py scrip works again. | test/test_memory_leaks.py | test/test_memory_leaks.py | #!/usr/bin/env python
#
# $Id$
#
import os
import gc
import sys
import unittest
import psutil
from test_psutil import cleanup, WINDOWS
LOOPS = 1000
MARGIN = 4096
class TestProcessObjectLeaks(unittest.TestCase):
"""Test leaks of Process class methods and properties"""
def setUp(self):
gc.collect()
... | Python | 0 | @@ -113,23 +113,29 @@
import
-cleanup
+reap_children
, WINDOW
@@ -356,15 +356,21 @@
-cleanup
+reap_children
()%0A%0A
|
4a41b33286cf881f0b3aa09c29a4aaa3568b5259 | Convert numpy int to native int for JSON serialization | website/stats/plots/mimp.py | website/stats/plots/mimp.py | from analyses.mimp import glycosylation_sub_types, run_mimp
from helpers.plots import stacked_bar_plot
from ..store import counter
@counter
@stacked_bar_plot
def gains_and_losses_for_glycosylation_subtypes():
results = {}
effects = 'loss', 'gain'
for source_name in ['mc3', 'clinvar']:
for site_ty... | Python | 0.998409 | @@ -589,16 +589,37 @@
fects, %5B
+%0A int(
effect_c
@@ -638,16 +638,33 @@
fect, 0)
+)%0A
for eff
@@ -677,16 +677,29 @@
effects
+%0A
%5D%0A re
|
0872a48326cc19afd4371d153897eae26487b0f4 | fix bug | scripts/create_xsd.py | scripts/create_xsd.py | '''
Script to convert CONTCAR to .xsd file
'''
from vaspy.matstudio import XsdFile
from vaspy.atomco import PosCar
status, output = commands.getstatusoutput('ls *.xsd | head -1')
xsd = XsdFile(filename=output)
poscar = PosCar(filename='CONTCAR')
xsd.data = poscar.data
jobname = output.split('.')[0]
xsd.tofile(fil... | Python | 0.000001 | @@ -44,16 +44,32 @@
ile%0A'''%0A
+import commands%0A
from vas
|
e287fe67a7c4aaf231b0eb0003cdd18cb615da47 | Bump version to 18.04.15-1 | gosubl/about.py | gosubl/about.py | import re
import sublime
# GoSublime Globals
ANN = 'a14.02.25-1'
VERSION = 'r14.12.06-1'
VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE)
DEFAULT_GO_VERSION = 'go?'
GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE)
GO_VERSION_NORM_PAT = re.compile... | Python | 0 | @@ -53,14 +53,14 @@
'a1
-4.02.2
+8.04.1
5-1'
@@ -77,15 +77,15 @@
'r1
-4.12.06
+8.04.15
-1'%0A
|
54602c4658e244e746a933491d4c1d98a806f34e | Fix error on dict return | asyncio_redis_cluster/replies.py | asyncio_redis_cluster/replies.py | import asyncio
from asyncio.tasks import gather
__all__ = (
'BlockingPopReply',
'DictReply',
'ListReply',
'PubSubReply',
'SetReply',
'StatusReply',
'ZRangeReply',
'ConfigPairReply',
'InfoReply',
)
class StatusReply:
"""
Wrapper for Redis status replies.
(for messages l... | Python | 0.000003 | @@ -1764,87 +1764,8 @@
nt)%0A
- b1 = data%5B0%5D%0A f = yield from b1._read(count=4)%0A print(f)%0A
|
6a87d036a7ced87ba39406032c42ec2749b2cb88 | configure maximum batch size to high value | drivers/dma/idxd/dpdk_idxd_cfg.py | drivers/dma/idxd/dpdk_idxd_cfg.py | #!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2020 Intel Corporation
"""
Configure an entire Intel DSA instance, using idxd kernel driver, for DPDK use
"""
import sys
import argparse
import os
import os.path
class SysfsDir:
"Used to read/write paths in a sysfs directory"
def ... | Python | 0.001771 | @@ -3047,16 +3047,69 @@
ty%22: 1,%0A
+ %22max_batch_size%22: 1024,%0A
|
a54a2dc1cd055c1a9a897fe09876b7a505b5facf | Add dummy vendor to test settings | tests/settings.py | tests/settings.py | SECRET_KEY = 'asdf'
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
},
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
import logging
logging.disable(logging.CRITICAL)
INSTALLED_APPS... | Python | 0 | @@ -690,16 +690,48 @@
apps()%0A%0A
+OSCAR_SAGEPAY_VENDOR = 'dummy'%0A%0A
from osc
|
f98c0dcabc40a4967c19b76551499afe32026fd9 | Add response class and define is_response() on test strategy | tests/strategy.py | tests/strategy.py | from social.strategies.base import BaseStrategy, BaseTemplateStrategy
TEST_URI = 'http://myapp.com'
TEST_HOST = 'myapp.com'
class Redirect(object):
def __init__(self, url):
self.url = url
class TestTemplateStrategy(BaseTemplateStrategy):
def render_template(self, tpl, context):
return tpl
... | Python | 0.000044 | @@ -195,24 +195,108 @@
url = url%0A%0A%0A
+class Response(object):%0A def __init__(self, value):%0A self.value = value%0A%0A%0A
class TestTe
@@ -1019,23 +1019,33 @@
return
+Response(
content
+)
%0A%0A de
@@ -2369,8 +2369,98 @@
rn user%0A
+%0A def is_response(self, value):%0A return isinst... |
ce5e821500955e8a64e3fd7bf2a114cb52718300 | Add docs | src/python/datapreprocessor/datapreprocessor/datanormaliser.py | src/python/datapreprocessor/datapreprocessor/datanormaliser.py | from dateutil.parser import *
from datetime import *
import re
DATA_TYPES = ['gifts', 'hospitality', 'meetings', 'travel']
class TypeNotFoundException(Exception):
pass
class MultipleTypesFoundException(Exception):
def __init__(self, type_keys):
self.type_keys = type_keys
# Some csv files have t... | Python | 0 | @@ -2358,16 +2358,950 @@
TYPES):%0A
+ %22%22%22%0A Look at a filename and attempt to extract the data type and year from it%0A%0A Does some simple searching in the filename for certain keywords that%0A indicate what type of data the file may contain. A single data type needs%0A to be found otherwise pro... |
41d161eab59817d56ea94d996e6a1c83fa30c71b | Add "Omit this to render as a normal GitHub README file." to help avoid confusion of `--gfm`. | grip/command.py | grip/command.py | """\
grip.command
~~~~~~~~~~~~
Implements the command-line interface for Grip.
Usage:
grip [options] [<path>] [<address>]
grip -h | --help
grip --version
Where:
<path> is a file to render or a directory containing README.md (- for stdin)
<address> is what to listen on, of the form <host>[:<port>], or just... | Python | 0 | @@ -402,16 +402,88 @@
issues.%0A
+ Omit this to render as a normal GitHub README file.%0A
--cont
|
0730a438ce4ef90a9ef18e926a8363b7df19af4f | Use getattr() to support Python 2.6 and older. | grit/lazy_re.py | grit/lazy_re.py | #!/usr/bin/python
# Copyright (c) 2012 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.
'''In GRIT, we used to compile a lot of regular expressions at parse
time. Since many of them never get used, we use lazy_re to compil... | Python | 0.000017 | @@ -1198,16 +1198,24 @@
return
+getattr(
self._la
@@ -1219,34 +1219,18 @@
_lazy_re
-.__getattribute__(
+,
name)%0A%0A%0A
|
91eed5ab2a43aecfb5f9ea521b16e2bc0927d304 | Add test for semaphore.destroy | tests/testLock.py | tests/testLock.py | '''
Created on 2015/12/14
:author: hubo
'''
from __future__ import print_function
import unittest
from vlcp.server.server import Server
from vlcp.event.runnable import RoutineContainer
from vlcp.event.lock import Lock, Semaphore
from vlcp.config.config import manager
class Test(unittest.TestCase):
def setUp(self... | Python | 0.000005 | @@ -4462,81 +4462,8 @@
%5B0%5D%0A
- smp = Semaphore('testobj', 2, rc.scheduler)%0A smp.create()%0A
@@ -4480,32 +4480,32 @@
utineLock(key):%0A
+
l =
@@ -4740,137 +4740,451 @@
-rc.subroutine(routineLock('testobj'))%0A rc.subroutine(routineLock('testobj'))%0A rc.subr... |
d7232d855d406a26b2485b5c1fcd587e90fddf39 | Fix Runtime warnings on async tests | tests/test_aio.py | tests/test_aio.py | import pytest
from ratelimiter import RateLimiter
@pytest.mark.asyncio
async def test_alock():
rl = RateLimiter(max_calls=10, period=0.01)
assert rl._alock is None
async with rl:
pass
alock = rl._alock
assert alock
async with rl:
pass
assert rl._alock is alock
| Python | 0.000001 | @@ -87,16 +87,26 @@
t_alock(
+event_loop
):%0A r
|
5af82e47c9ab6f649fb8c0daafb3f25eccb3e478 | fix copyright | src/eduid_common/api/tests/test_backdoor.py | src/eduid_common/api/tests/test_backdoor.py | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2016 NORDUnet A/S
# 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 retain the above copyright
# ... | Python | 0.000318 | @@ -44,23 +44,16 @@
) 20
-16 NORDUnet A/S
+20 SUNET
%0A# A
|
65a83066f041f8c5848de4edc71705c2f6acf761 | Allow just a bit longer to wait for the server to startup | tests/test_bin.py | tests/test_bin.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 eNovance <licensing@enovance.com>
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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 Lice... | Python | 0.000003 | @@ -3373,9 +3373,9 @@
ep(.
-3
+5
)%0A
@@ -3474,16 +3474,44 @@
urn r, c
+%0A return (None, None)
%0A%0A de
|
7dd4bdbf74524d7cf514c999113bbb066227f454 | reset self.items_searching_ids and move self.running = False | Contents/Code/support/tasks.py | Contents/Code/support/tasks.py | # coding=utf-8
import datetime
import time
from missing_subtitles import getAllRecentlyAddedMissing, searchMissing
from background import scheduler
class Task(object):
name = None
scheduler = None
running = False
time_start = None
stored_attributes = ("last_run", "last_run_time")
# task rea... | Python | 0.999342 | @@ -2983,16 +2983,45 @@
eep(0.1)
+%0A self.running = False
%0A%0A de
@@ -3325,30 +3325,41 @@
self.
-running = Fals
+items_searching_ids = Non
e%0A%0A%0Asche
|
37e31972cc36efd93a92cf52d80bdce8e2a6458e | Add trailing slash to dental plan detail url | app/schedule/urls.py | app/schedule/urls.py | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from app.schedule.views.clinic import ClinicDetail
from app.schedule.views.clinic import ClinicList, ClinicPatients
from app.schedule.views.dental_plan import DentalPlanList, DentalPlanDetail
from app.schedule.views.dentist ... | Python | 0 | @@ -1767,16 +1767,17 @@
%3E%5B0-9%5D+)
+/
$', Dent
|
97cbc26ee7343b36cdea7766f79a18f1a2e2700c | make main docstring one line for flit | wasmfun/__init__.py | wasmfun/__init__.py | """
A Python library that provides tools to handle WASM code, like generating
WASM, and perhaps someday interpreting it too.
"""
__version__ = '0.1'
from ._opcodes import OPCODES
from .fields import *
from .util import *
| Python | 0.000012 | @@ -57,71 +57,8 @@
code
-, like generating%0AWASM, and perhaps someday interpreting it too
.%0A%22%22
|
12c34053fbce82790a6a2f7102ea26530d1b2e32 | Throw an exception on invalid or missing credentials or region. | packs/aws/actions/lib/action.py | packs/aws/actions/lib/action.py | import re
import eventlet
import importlib
import boto.ec2
import boto.route53
import boto.vpc
from st2actions.runners.pythonrunner import Action
from ec2parsers import ResultSets
class BaseAction(Action):
def __init__(self, config):
super(BaseAction, self).__init__(config)
self.credentials = ... | Python | 0.000001 | @@ -3773,16 +3773,185 @@
ntials)%0A
+%0A if not obj:%0A raise ValueError('Invalid or missing credentials (aws_access_key_id,'%0A 'aws_secret_access_key) or region')%0A%0A
|
85b88eff8eb2d745649c9d8e60ebb45067c8f214 | make launch ipdb_on_exception importable | ipdb/__init__.py | ipdb/__init__.py | # Copyright (c) 2007, 2010, 2011, 2012 Godefroid Chapelle
#
# This file is part of ipdb.
# GNU package 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)
# ... | Python | 0.000002 | @@ -576,16 +576,18 @@
tails.%0A%0A
+#
You shou
@@ -711,16 +711,17 @@
enses/.%0A
+%0A
from ipd
@@ -787,16 +787,42 @@
runeval
+, launch_ipdb_on_exception
%0A%0Apm
@@ -970,16 +970,16 @@
yflakes%0A
-
set_trac
@@ -981,28 +981,71 @@
_trace # please pyflakes%0A
+launch_ipdb_on_exception # please pyflakes%0A
|
403e148d5f6d0ba3e79ccf4c8f98c57dcb89d846 | Set rq.worker log level earlier to work around a laziness issue with the CLI runner. | tests/test_cli.py | tests/test_cli.py | import logging
import click
import pytest
from flask_cli import FlaskGroup, ScriptInfo, cli
from flask_rq2 import app as flask_rq2_app
from flask_rq2 import cli as flask_rq2_cli
from flask_rq2.cli import _commands, add_commands
def test_click_missing_raises(app, rq, monkeypatch):
monkeypatch.setattr(flask_rq2_a... | Python | 0 | @@ -1740,16 +1740,71 @@
aplog):%0A
+ caplog.set_level(logging.INFO, logger='rq.worker')%0A
obj
@@ -2041,63 +2041,8 @@
= 0%0A
- caplog.set_level(logging.INFO, logger='rq.worker')%0A
|
8a2d0fb6432d7f903fd8f420f666f446688dcf9c | Change dry run long option name and descriptionn to be more intuitive. | renamer/application.py | renamer/application.py | """
Renamer application logic.
"""
import glob
import os
import string
import sys
from twisted.internet import reactor, defer
from twisted.python import usage
from twisted.python.filepath import FilePath
from renamer import logging, plugin, util
class Options(usage.Options, plugin.RenamerSubCommandMixin):
syno... | Python | 0 | @@ -536,17 +536,17 @@
('
-dry-run
+no-act
',
+
@@ -567,23 +567,46 @@
rform a
-dry-run
+trial run with no changes made
.'),%0A
|
85415c225de51ace61eff76a493f31bd4cd3955f | fix the incorrect filename | speechvalley/feature/libri/__init__.py | speechvalley/feature/libri/__init__.py | # encoding: utf-8
# ******************************************************
# Author : zzw922cn
# Last modified: 2017-12-09 11:00
# Email : zzw922cn@gmail.com
# Filename : __init__.py
# Description : Feature preprocessing for LibriSpeech dataset
# ******************************************************
... | Python | 1 | @@ -358,12 +358,12 @@
i_pr
-opre
+epro
cess
|
f096ff7d7e5b460e40878510d4222d6f82eb3e99 | Bump version for pypi to 0.2018.07.08.0419 | ipwb/__init__.py | ipwb/__init__.py | __version__ = '0.2018.07.08.0414'
| Python | 0 | @@ -24,11 +24,11 @@
7.08.041
-4
+9
'%0A
|
3a7a258f8e9cf255642dc8fb0fa8c207f73e37cf | add unit test for deprecating properties | tests/test_dev.py | tests/test_dev.py | __author__ = 'Shyue Ping Ong'
__copyright__ = 'Copyright 2014, The Materials Virtual Lab'
__version__ = '0.1'
__maintainer__ = 'Shyue Ping Ong'
__email__ = 'ongsp@ucsd.edu'
__date__ = '1/24/14'
import unittest
import warnings
from monty.dev import deprecated, requires
class DecoratorTest(unittest.TestCase):
d... | Python | 0 | @@ -769,16 +769,1126 @@
ning))%0A%0A
+ def test_deprecated_property(self):%0A%0A class a(object):%0A def __init__(self):%0A pass%0A%0A @property%0A def property_a(self):%0A pass%0A%0A @property%0A @deprecated(property_a)%0A ... |
b929b73880a7bf3cba97b138ddb96f6c3cf165b0 | add MIDDLEWARE_CLASSES for Django 1.7 | test_haystack/settings.py | test_haystack/settings.py | import os
from tempfile import mkdtemp
SECRET_KEY = "Please do not spew DeprecationWarnings"
# Haystack settings for running tests.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'haystack_tests.db',
}
}
INSTALLED_APPS = [
'django.contrib.admin',
'django.co... | Python | 0 | @@ -1758,20 +1758,391 @@
%7D,%0A%7D%0A%0ASITE_ID = 1%0A
+%0AMIDDLEWARE_CLASSES = ('django.middleware.common.CommonMiddleware',%0A 'django.contrib.sessions.middleware.SessionMiddleware',%0A 'django.middleware.csrf.CsrfViewMiddleware',%0A 'django.contrib.a... |
d47d56525f85c5fa8b1f6b817a85479b9eb07582 | Add query_entities to functions module import | sqlalchemy_utils/functions/__init__.py | sqlalchemy_utils/functions/__init__.py | from .defer_except import defer_except
from .mock import create_mock_engine, mock_engine
from .render import render_expression, render_statement
from .sort_query import sort_query, QuerySorterException
from .database import (
database_exists,
create_database,
drop_database,
escape_like,
is_auto_assi... | Python | 0.000002 | @@ -501,24 +501,44 @@
equivalent,%0A
+ query_entities,%0A
primary_
|
a5e9bcdf365921818c8c69810f014664a03ebf3e | update conan script | test_package/conanfile.py | test_package/conanfile.py | from conans import ConanFile, CMake
import os
class CerealoptionalnvpTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package"
... | Python | 0 | @@ -1,8 +1,19 @@
+import os%0A%0A
from con
@@ -43,18 +43,16 @@
Make
-%0Aimport os
+, tools%0A
%0A%0Acl
@@ -301,16 +301,26 @@
s.txt is
+%0A #
in %22tes
@@ -358,59 +358,8 @@
ure(
-source_dir=self.conanfile_directory, build_dir=%22./%22
)%0A
@@ -565,32 +565,88 @@
def test(self):%0A
+ if not tools.... |
178993d9f1da3b1bfade0b3fca076bd069936115 | Fix name of postgresql dialect. | sqlalchemy_utils/functions/database.py | sqlalchemy_utils/functions/database.py | from sqlalchemy.engine.url import make_url
import sqlalchemy as sa
from sqlalchemy.exc import ProgrammingError
import os
def database_exists(url):
"""Check if a database exists.
"""
url = make_url(url)
database = url.database
url.database = None
engine = sa.create_engine(url)
if engine.... | Python | 0.000001 | @@ -103,16 +103,34 @@
ingError
+, OperationalError
%0Aimport
@@ -348,32 +348,34 @@
ame == 'postgres
+ql
':%0A text
@@ -1015,16 +1015,17 @@
except
+(
Programm
@@ -1032,16 +1032,35 @@
ingError
+, OperationalError)
:%0A
@@ -1393,16 +1393,18 @@
postgres
+ql
':%0A
|
0edf6dde2b89583f3b57e686af789b7ca4e8147b | rename --shell to --cli | transit.py | transit.py | #!/usr/bin/env python3
from models import unserialize_typed
import sys
import networks
import json
import traceback
import socketserver
import argparse
import threading
import asyncio
try:
import msgpack
except ImportError:
msgpack = None
try:
import websockets
except ImportError:
websockets = None
s... | Python | 0.000336 | @@ -4749,21 +4749,19 @@
ment('--
-shell
+cli
', actio
@@ -4789,28 +4789,38 @@
'enable
-stdin/stdout
+command line interface
')%0A%0Apars
@@ -6056,21 +6056,19 @@
if args.
-shell
+cli
:%0A pr
@@ -6076,27 +6076,30 @@
nt('
-stdin/stdout server
+command line interface
run
|
91242483a79a66eb18fdcbf1090422541d6a06b0 | Add support for .db2 files | wdbc/environment.py | wdbc/environment.py | # -*- coding: utf-8 -*-
import os, os.path
from .. import wdbc
stripfilename = wdbc.getfilename
class Environment(object):
def __init__(self, build, locale="enGB", base="/var/www/sigrie/caches/caches/"):
self.build = build
self.path = "%s/%i/%s/" % (base, build, locale)
if not os.path.exists(self.path):
ra... | Python | 0 | @@ -438,16 +438,39 @@
)%0A%09%09%09if
+_f.endswith(%22.db2%22) or
_f.endsw
|
2ff4d22822d8f58a214b465015421fd9f5b06337 | Refactor atrous spatial pooling | dataset/models/tf/layers/pyramid.py | dataset/models/tf/layers/pyramid.py | """ Contains pyramid layers """
import numpy as np
import tensorflow as tf
from . import conv_block, upsample
def pyramid_pooling(inputs, layout='cna', filters=None, kernel_size=1, pool_op='mean', pyramid=(1, 2, 3, 6),
name='psp', **kwargs):
""" Pyramid Pooling module
Zhao H. et al. "`Py... | Python | 0.000001 | @@ -202,16 +202,19 @@
yramid=(
+0,
1, 2, 3,
@@ -752,16 +752,19 @@
, e.g. (
+0,
1, 2, 3,
@@ -766,16 +766,79 @@
2, 3, 6)
+.%0A %600%60 is used to include inputs into the output tensor.
%0A nam
@@ -1363,16 +1363,18 @@
or with
+a
fully de
@@ -1522,22 +1522,16 @@
yers = %5B
-inputs
%5D%0A
@@ -1... |
f825044662c9a495d2ca7c715d95f70cb406c7c9 | Validate that dashboards have required fields (#6833) | datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/dashboards.py | datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/dashboards.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
import click
from ....utils import file_exists, read_file
from ...constants import get_root
from ...utils import get_valid_integrations, load_manifest
from ..console import CONTEXT_... | Python | 0.000001 | @@ -396,35 +396,24 @@
= %7B
-'agent_version', 'check', '
+%22board_title%22, %22
desc
@@ -423,54 +423,42 @@
tion
-', 'groups', 'integration', 'name', 'statuses'
+%22, %22template_variables%22, %22widgets%22
%7D%0A%0A%0A
@@ -2092,14 +2092,29 @@
+f
' %7B
+dashboard_file
%7D is
@@ -2285,60 +2285,265 @@
ad... |
5ecad1be117fdf7f0770b238694904dbda6c97a6 | fix push to es | testlog_etl/push_to_es.py | testlog_etl/push_to_es.py | # encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __fu... | Python | 0 | @@ -1145,19 +1145,23 @@
if
-key
+message
== None
|
86ca1a738bffb9a5307e8ceb00c86bb23312c7ad | Move WeatherType out from the WeatherGenerator | weathergenerator.py | weathergenerator.py | from random import choice, randint
degrees = chr(0xBA) + "C"
wind_directions = [chr(0x2B06) + chr(0xFE0F), # N
chr(0x27A1) + chr(0xFE0F), # E
chr(0x2B05) + chr(0xFE0F), # W
chr(0x2B07) + chr(0xFE0F), # S
chr(0x2197) + chr(0xFE0F), # ... | Python | 0 | @@ -480,37 +480,9 @@
SW%0A%0A
-class WeatherGenerator:%0A%0A
+%0A
clas
@@ -496,28 +496,24 @@
erType:%0A
-
-
def __init__
@@ -552,20 +552,16 @@
_range,%0A
-
@@ -629,28 +629,24 @@
e):%0A
-
-
self.__weath
@@ -660,20 +660,16 @@
eathers%0A
-
@@ -721,36 +721,32 @@
... |
6b5bb4eca9f5884c75261d5b23266be5bf7310e7 | Use six now. | parse_type/cardinality_field.py | parse_type/cardinality_field.py | # -*- coding: utf-8 -*-
"""
Provides support for cardinality fields.
A cardinality field is a type suffix for parse format expression, ala:
"{person:Person?}" #< Cardinality: 0..1 = zero or one = optional
"{persons:Person*}" #< Cardinality: 0..* = zero or more = many0
"{persons:Person+}" #< Cardinalit... | Python | 0 | @@ -437,16 +437,26 @@
Builder%0A
+import six
%0A%0Aclass
@@ -4521,18 +4521,31 @@
_name, s
-tr
+ix.string_types
)%0A
|
a95f43767cb95d5a0137a6563c6fdbd725663aa6 | fix community dump | src/communities/management/commands/dump_community.py | src/communities/management/commands/dump_community.py | from communities.models import Community
from django.core import serializers
from django.core.management.base import BaseCommand
from issues.models import Issue, IssueComment, IssueCommentRevision, Proposal
from meetings.models import Meeting, AgendaItem, MeetingParticipant, \
MeetingExternalParticipant
from users.... | Python | 0.000001 | @@ -714,32 +714,97 @@
munity_id=cid),%0A
+ Membership.objects.filter(community_id=cid),%0A
@@ -1302,90 +1302,8 @@
d),%0A
- MeetingParticipant.objects.filter(meeting__community_id=cid),%0A
|
ffb95904557695594a93bdf203fc6f65a5b27244 | add reservation for exact day | reservations/rutils.py | reservations/rutils.py | from django.utils import timezone, dateparse
from datetime import datetime, timedelta
from .models import Reservation, Field
'''
kind of utils for django-reservations
'''
class ReservationExist(Exception):
pass
def create_reservation(field_id, res_date, reservation_time, user):
field = Field.objects.get(i... | Python | 0 | @@ -282,16 +282,294 @@
user):%0A
+ '''%0A Create reservation.%0A%0A :param field_id: id of field for which to create reservations%0A :param res_date: date on which to create reservation. None -%3E today%0A :param reservation_time: time of reservation%0A :param user: actual user or None%0A :return... |
88c74cd60724fd68c30f31f87940d4558b092023 | Add char protection, remove ending line return | parser/srcs/simpleFileParser.py | parser/srcs/simpleFileParser.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Simple File Parser
"""
import os
import sys
__author__ = 'Guieu Christophe, Tallot Adrien'
__date__ = '25-03-2014'
__version__ = '0.1'
dtl = []
ccl = []
deli = ''
def verifyFile(filename):
if filename == '':
print('Error : put filename')
sys.ex... | Python | 0.000001 | @@ -525,16 +525,305 @@
urn f%0A%0A%0A
+def removeCR(word):%0A return word%5B0:-1%5D%0A%0A%0Adef protectChar(word):%0A if '%22' in word:%0A lw = list(word)%0A lw%5Blw.index('%22')%5D = '%5C%5C%22'%0A word = ''.join(lw)%0A return word%0A%0A%0Adef parseWord(word):%0A word = removeCR(word)... |
1e7a6bcd6a2236feb32ec36224a3fb224f0e374c | Add license key in __openerp__.py | dbfilter_from_header/__openerp__.py | dbfilter_from_header/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | Python | 0.000043 | @@ -1064,16 +1064,41 @@
rp BV%22,%0A
+ %22license%22: %22AGPL-3%22,%0A
%22com
|
0f38711fab232a7cfc33608a9655dc296a13d13d | Allow images to be unlinked from gallery | apps/portfolio/models.py | apps/portfolio/models.py | from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from portfolio.utils import auto_delete_files
from upload.models import UploadedFile
class Gallery(models.Mode... | Python | 0 | @@ -1137,24 +1137,36 @@
b_index=True
+, blank=True
)%0A descri
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.