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 |
|---|---|---|---|---|---|---|---|
fa57bd304f5924586b6c46076c83f1c0f1dc11ee | remove py3k imcompatible string raise from data example (this deprecated syntax is not need for the tests) | test/data/module2.py | test/data/module2.py | # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# copyright 2003-2010 Sylvain Thenault, all rights reserved.
# contact mailto:thenault@gmail.com
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redi... | Python | 0 | @@ -1895,29 +1895,8 @@
s):%0A
- raise 'pas glop'%0A
|
9759a806407cd9259e7ef4eb0303aa9f3b6ae336 | remove left-in print statements. | hypernotes/web.py | hypernotes/web.py | import os
from flask import Flask, jsonify, render_template, json, request, redirect
from core import app
import logic
@app.route("/")
def home():
return 'Nothing to see here - go to api'
@app.route('/api/v1/note/<id>', methods=['GET', 'POST'])
def api_note(id):
if request.method == 'GET':
out = logi... | Python | 0 | @@ -542,44 +542,8 @@
se:%0A
- print 'XXXX', request.data%0A
@@ -582,36 +582,8 @@
ta)%0A
- print 'XXXXX', data%0A
|
3410bd8e6f51c56c0f96b83a8c67fa409357a48e | Version 0.15.0 | repokid/__init__.py | repokid/__init__.py | # Copyright 2020 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0.000001 | @@ -748,11 +748,11 @@
%220.1
-4.8
+5.0
%22%0A%0A%0A
|
6ce14f21cec2c37939f68aaf40d5227c80636e53 | Add docstring to explain the code | app_bikes/forms.py | app_bikes/forms.py | from dal import autocomplete
from django import forms
class BikeModelForm(forms.ModelForm):
def __init__(self, *args, **kw):
super(BikeModelForm, self).__init__(*args, **kw)
if self.instance is not None:
# Saved instance is loaded, setup choices to display the selected value
... | Python | 0.000001 | @@ -443,16 +443,194 @@
(self):%0A
+ %22%22%22If the form had an error and a station was chosen, we need to setup the widget choices to the previously selected value for the autocomplete to display it properly%22%22%22%0A
@@ -732,67 +732,8 @@
ta:%0A
- # A station was chosen, reinit choices ... |
ae7039a23746a0bbe953302db2957ebe3566c2f9 | Add default value | pyathena/converter.py | pyathena/converter.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import binascii
import json
import logging
from copy import deepcopy
from datetime import datetime
from decimal import Decimal
from distutils.util import strtobool
_logger = logging.getLogger(__name__)
def _to_dat... | Python | 0.000003 | @@ -2351,24 +2351,49 @@
ypes=None):%0A
+ if mappings:%0A
self
@@ -2426,59 +2426,178 @@
-self._default = default%0A self._types = types
+else:%0A self._mappings = dict()%0A self._default = default%0A if types:%0A self._types = types%0A else:%0A... |
c18be2bbf78bc84b4642a749d536ba1ff3a50a0e | Set version number to 0.9. | pybtex/__version__.py | pybtex/__version__.py | version = '20090402'
| Python | 0.000304 | @@ -8,14 +8,9 @@
= '
-20090402
+0.9
'%0A
|
2211db399c7ba57073cc44d894dcf2ba55c339a1 | remove get method | apps/apps/views.py | apps/apps/views.py | from django.http import HttpResponse
from push_notifications.models import APNSDevice, GCMDevice
from rest_framework.views import APIView
import json
from .models import *
from .serializers import *
class AddIosDeviceView(APIView):
"""
Add iOS device.
device -- Device parameter (format string)
"""
... | Python | 0.000002 | @@ -316,491 +316,8 @@
%22%22%0A%0A
- def get(self, request, format=None):%0A if request.GET.get('device', None):%0A device = APNSDevice.objects.filter(registration_id=request.GET%5B'device'%5D)%0A if not device:%0A APNSDevice.objects.create(registration_id=request.GET%5B'... |
7a9f29adc83a927c96c82c6e6310409ebc9541bc | Remove legacy support features | zipp.py | zipp.py | # coding: utf-8
from __future__ import division
import io
import sys
import posixpath
import zipfile
import functools
import itertools
from collections import OrderedDict
__metaclass__ = type
def _parents(path):
"""
Given a path with elements separated by
posixpath.sep, generate all parents of that pat... | Python | 0 | @@ -1,54 +1,4 @@
-# coding: utf-8%0A%0Afrom __future__ import division%0A%0A
impo
@@ -121,30 +121,8 @@
ct%0A%0A
-__metaclass__ = type%0A%0A
%0Adef
|
4546e9cf0a0b371a845620e0e48e74efbaf5dec9 | Make admin custom column names translatable | apps/core/admin.py | apps/core/admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext as _
from mptt.admin import MPTTModelAdmin
from . import models
class UUIDModelAdminMixin(object):
def get_short_uuid(self, obj):
return str(obj)
get_short_uuid.short_descri... | Python | 0.000002 | @@ -1598,33 +1598,36 @@
scription =
-'
+_(%22
Species
-'
+%22)
%0A%0A def ge
@@ -1750,17 +1750,19 @@
ption =
-'
+_(%22
Entry id
@@ -1769,17 +1769,18 @@
entifier
-'
+%22)
%0A%0A%0A@admi
@@ -2613,17 +2613,19 @@
n =
-'
+_(%22
Analysis
'%0A%0A%0A
@@ -2620,17 +2620,18 @@
Analysis
-'
+%22)
%0A%0A%0A@admi
@@... |
1f0224558c04996df0bf766c1d4dfb4af2f71365 | Check org code when adding users | iatidq/dqusers.py | iatidq/dqusers.py |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | Python | 0 | @@ -3264,24 +3264,256 @@
sation_id'%5D%0A
+ v = models.Organisation.where(%0A organisation_code=organisation_id).first()%0A if not v:%0A raise Exception('No organisation with ID: %7B%7D'.format(%0A organisation_id))%0A
|
b22c5cdeb75f77c15eba5ef9ad2f8fca24d1a9db | add json mixin for core views | apps/core/views.py | apps/core/views.py | # Create your views here.
# coding: utf-8
from apps.core.helpers import render_to
from django.http import HttpResponse
@render_to('index.html')
def index(request):
return {}
def write_redirect(request, pk):
response = HttpResponse()
response.write('redirected with: %s' % pk)
return response
@rende... | Python | 0 | @@ -104,32 +104,197 @@
rt HttpResponse%0A
+try:%0A import simplejson as json%0Aexcept ImportError:%0A import json%0Afrom django.views.generic.edit import (%0A FormMixin, TemplateResponseMixin, DeletionMixin%0A)%0A
%0A%0A@render_to('in
@@ -623,8 +623,1372 @@
)%0A %7D%0A
+%0A%0Aclass JSONViewMixin(Template... |
8b81699181f6b01784427d77e627bf722f78a68a | remove print() , use logger instead. | apps/decorators.py | apps/decorators.py | import re
import traceback
from functools import wraps
TOKENIZE_PATTERN = re.compile(r'["“](.+?)["”]|(\S+)', re.U | re.S)
def _extract_tokens(message):
'''Parse the given message, extract command and split'em into tokens
Args:
message (str): user gave message
Returns:
(... | Python | 0 | @@ -48,16 +48,43 @@
t wraps%0A
+from loggers import logger%0A
%0A%0ATOKENI
@@ -791,16 +791,88 @@
tokens)%0A
+ logger.debug('%5BDebug%5D message: %7B%7D'.format(message))%0A
@@ -1331,22 +1331,24 @@
-print(%22%5BWarn%5D
+logger.warning('
Can
@@ -1372,17 +1372,17 @@
channel
-%22
... |
ac807dc1f90ecdbe18ee8e0a2a46052ca38c7798 | Fix pycon-aid email address | pycon/finaid/utils.py | pycon/finaid/utils.py | from django.conf import settings
from django.core.mail import send_mail
from django.template import Context
from django.template.loader import get_template
from pycon.finaid.models import FinancialAidApplication, \
FinancialAidApplicationPeriod
DEFAULT_EMAIL_ADDRESS = "pycon-aid@pycon.org"
def applications_open... | Python | 0.9996 | @@ -277,25 +277,26 @@
pycon-aid@py
-c
+th
on.org%22%0A%0A%0Ade
@@ -1431,17 +1431,18 @@
n-aid@py
-c
+th
on.org%60%60
|
b6fe03d74c15a618ecbf1005adedec4cb1003796 | fix plot for get_frequency update | conkit/plot/sequencecoverage.py | conkit/plot/sequencecoverage.py | # BSD 3-Clause License
#
# Copyright (c) 2016-18, University of Liverpool
# 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 notic... | Python | 0 | @@ -4408,31 +4408,8 @@
X%22))
- * self._hierarchy.nseq
%0A%0A
|
166cd3a5986d7d834581c24987aee626a7e0ab17 | Remove superfluous `to_json()` | pycroft/model/host.py | pycroft/model/host.py | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from sqlalchemy import Column, ForeignKey, event, UniqueConstraint
from sqlalchemy.orm import backref, relations... | Python | 0.007663 | @@ -6295,35 +6295,8 @@
et)%0A
- .to_json()%0A
|
8b56d561bb120f1f3dba8962721c2156967e0d83 | Make rotation matrices | pycuber/cube/cubie.py | pycuber/cube/cubie.py | import numpy as np
class Cubie(np.ndarray):
def __new__(subtype, side_colour_map, **kwargs):
if isinstance(side_colour_map, Cubie):
return side_colour_map
if not isinstance(side_colour_map, np.ndarray):
side_colour_map = np.array(side_colour_map)
if side_colour_m... | Python | 0.000096 | @@ -180,68 +180,8 @@
ap%0A%0A
- if not isinstance(side_colour_map, np.ndarray):%0A
@@ -228,16 +228,16 @@
ur_map)%0A
+
%0A
@@ -455,16 +455,16 @@
%5B:, 1%5D%0A%0A
-
@@ -475,16 +475,399 @@
rn ret%0A%0A
+U, L, F, R, B, D = range(6)%0A%0AROT = np.zeros((3, 6, 6), int)%0A%0AX, Y, Z = ra... |
d56bdbcca82d5f7b68eebc9fbea6ffead1a9b0cd | add margin | connector_web_base/connector.py | connector_web_base/connector.py | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | Python | 0.000002 | @@ -2954,11 +2954,31 @@
ity
-%25',
+margin %25', %0A
dig
@@ -3049,20 +3049,23 @@
paign -
-this
+margin
%25'),
|
5e9b8d25ed6d1e40a66dc68581fee2e92ee8d57e | Add 'give up' | apps/relay_word.py | apps/relay_word.py | from apps.decorators import on_command
from apps.slackutils import is_koreanword
import random
import json
import os
WORD_DEFAULT_URL = './apps/game_cache/relay.json'
CACHE_DEFAULT_URL = './apps/game_cache/relay_word.json'
def get_startword(word):
start_word = [word[-1]]
ch = ord(word[-1]) - 0xAC00
if ch ... | Python | 0.999633 | @@ -656,24 +656,273 @@
hannel, msg%0A
+ if tokens%5B0%5D == '%ED%8F%AC%EA%B8%B0%ED%95%A0%EB%9E%98'%0A if os.path.exists(CACHE_DEFAULT_URL):%0A os.remove(CACHE_DEFAULT_URL)%0A msg = '%E3%85%8E%E3%85%8E %EB%82%B4%EA%B0%80%EC%9D%B4%EA%B9%80'%0A return channel, msg%0A else... |
66a9a4a92de43e43c22e201548a280ff62fbfcac | Fix setting state of task for retrying | pyfarm/models/task.py | pyfarm/models/task.py | # No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
#
# 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
#
# U... | Python | 0.99953 | @@ -5321,16 +5321,26 @@
return
+ new_value
%0A%0A
@@ -5492,21 +5492,24 @@
target.
-state
+agent_id
= None%0A
@@ -5520,37 +5520,69 @@
-target.agent_id = Non
+return None%0A else:%0A return new_valu
e%0A%0A @
@@ -6108,10 +6108,36 @@
nd_retry
+,%0A retval=True
)%... |
e7b105105ae1dd826f195eb5d6c6716a9940b9c3 | Document get_exe_path() | igcommit/utils.py | igcommit/utils.py | """igcommit - Utility functions
Copyright (c) 2021 InnoGames GmbH
Portions Copyright (c) 2021 Emre Hasegeli
"""
from os import X_OK, access, environ
def get_exe_path(exe):
for dir_path in environ['PATH'].split(':'):
path = dir_path.strip('"') + '/' + exe
if access(path, X_OK):
return... | Python | 0.000001 | @@ -169,16 +169,144 @@
h(exe):%0A
+ %22%22%22Traverse the PATH to find where the executable is%0A%0A This should behave similar to the shell built-in %22which%22.%0A %22%22%22%0A
for
|
029cfcf035985e9df0e7150f07c4f1d97c5e165c | Revert "[bug 794058] Reduce _kb_rebuild_chunk task rate to 10/min." | apps/wiki/tasks.py | apps/wiki/tasks.py | import logging
import time
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.core.mail import send_mail, mail_admins
from django.db import transaction
from django.template import Context, load... | Python | 0 | @@ -4026,17 +4026,17 @@
_limit='
-1
+2
0/m')%0Ade
|
0b1f38b8354a0ad6a021f247a7bc1336ae5d50fb | Change some of the relative imports, which fail in doctests, to absolute imports. | arcade/__init__.py | arcade/__init__.py | """
The Arcade Library
A Python simple, easy to use module for creating 2D games.
"""
import arcade.key
import arcade.color
from .version import *
from .window_commands import *
from .draw_commands import *
from .sprite import *
from .physics_engines import *
from .physics_engine_2d import *
from .application import ... | Python | 0 | @@ -124,16 +124,22 @@
r%0A%0Afrom
+arcade
.version
@@ -153,16 +153,22 @@
*%0Afrom
+arcade
.window_
@@ -190,16 +190,22 @@
*%0Afrom
+arcade
.draw_co
@@ -225,16 +225,22 @@
*%0Afrom
+arcade
.sprite
@@ -245,32 +245,38 @@
e import *%0Afrom
+arcade
.physics_engines
@@ -290,16 +290,22 @@
*%0Afrom
+arcade
... |
681d9339355468ee918b8959991b2628843b50f2 | Fix license record creation | areweblic/views.py | areweblic/views.py | # -*- coding: utf-8 -*-
import os
import subprocess
from flask import (
request, redirect, url_for, flash, render_template, make_response)
from flask_security import login_required, roles_accepted, current_user
from flask_uploads import UploadNotAllowed
from .app import app, request_uploader
from .models import... | Python | 0.000001 | @@ -2209,24 +2209,175 @@
e(licfile)%0A%0A
+ # product%0A name = request.form%5B'product'%5D%0A product = Product.query.filter(Product.name == name).first()%0A%0A
@@ -2403,16 +2403,16 @@
license%0A
-
@@ -2506,32 +2506,22 @@
duct
-=request.form%5B'
+... |
c1eec7effe7f4ac439ee554e4f893aa7822d959d | improve progress report on import tool | django-nonrel/ocl/oclapi/management/commands/import_concepts_to_source.py | django-nonrel/ocl/oclapi/management/commands/import_concepts_to_source.py | import json
from optparse import make_option
import os.path
from django.contrib.auth.models import User
from django.core.management import BaseCommand, CommandError
from concepts.models import Concept, ConceptVersion
from concepts.serializers import ConceptDetailSerializer, ConceptVersionUpdateSerializer
from sources.m... | Python | 0 | @@ -413,32 +413,36 @@
(BaseException):
+%0A
pass%0A%0A%0Aclass In
@@ -476,16 +476,20 @@
eption):
+%0A
pass%0A%0A%0A
@@ -1493,16 +1493,134 @@
, 'rb')%0A
+ # get total record count%0A total = sum(1 for line in self.input)%0A self.input.seek(0)%0A
@@ -2466,32 +2466,4... |
7150674eec92120c6107fe728798bdcefba1efd7 | Use os.path.sep in util.py for regex DEFAULT_SKIP_FILES | pyjs/src/pyjs/util.py | pyjs/src/pyjs/util.py | import os
import shutil
import re
import logging
DEFAULT_SKIP_FILES=re.compile(
r"^(.*%(sep)s)?("
r"(\..*)|"
r"(#.*#)|"
r"(.*~)|"
r"(.*\.py[co])|"
r"(.*\/RCS\/?.*)|"
r"(.*\/CVS\/?.*)|"
r"(.*\.egg-info.*)|"
r")$" % {'sep': os.path.sep})
def copytree_exists(src, dst, symlinks=False,
... | Python | 0.997147 | @@ -84,16 +84,17 @@
r%22%5E(.*
+%5C
%25(sep)s)
|
8f57ed9b9ed3e4dcb348487b29c18d2772147e07 | Stop bringing the test environment into the mocks | diskimage_builder/elements/package-installs/tests/test_package_squash.py | diskimage_builder/elements/package-installs/tests/test_package_squash.py | # Copyright 2018 Red Hat, Inc.
#
# 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 agre... | Python | 0.000001 | @@ -2705,30 +2705,16 @@
='arm64'
-, **os.environ
))%0A d
@@ -4300,58 +4300,8 @@
ease
-,%0A **os.environ
)):%0A
@@ -6479,49 +6479,8 @@
='1'
-,%0A **os.environ
))%0A
|
6307acd8fe8e2c2e8c780e90afe214e2daf3dd1a | Add missing RDO mapping | pymod2pkg/__init__.py | pymod2pkg/__init__.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Python | 0.001801 | @@ -1878,39 +1878,152 @@
le('
-distribute', 'python-setuptools
+Babel', 'python-babel'),%0A SingleRule('distribute', 'python-setuptools'),%0A SingleRule('google-api-python-client', 'python-google-api-client
'),%0A
@@ -2626,24 +2626,138 @@
-inotify'),%0A
+ SingleRule('tripleo-incubator', 'openstack-tripleo')... |
f95c5e1218aacc5cc4c01b19f5ee9f7baf9269d6 | change id variable name | youtube_dl/extractor/nowness.py | youtube_dl/extractor/nowness.py | # encoding: utf-8
from __future__ import unicode_literals
from .brightcove import BrightcoveIE
from .common import InfoExtractor
from ..utils import ExtractorError
from ..compat import compat_urllib_request
class NownessBaseIE(InfoExtractor):
def extract_url_result(self, post):
if post['type'] == 'video'... | Python | 0.000124 | @@ -1558,16 +1558,24 @@
+display_
id = sel
@@ -1717,16 +1717,24 @@
t_url %25
+display_
id, head
@@ -1839,16 +1839,24 @@
equest,
+display_
id)%0A
@@ -1866,16 +1866,24 @@
return
+display_
id, json
|
43b29c5de8f52cb574ef453349517e3756fa1b24 | Disable steppers on init | manipulator_interface/scripts/manipulator_interface.py | manipulator_interface/scripts/manipulator_interface.py | #!/usr/bin/env python
from numpy import clip, interp
import rospy
from vortex_msgs.msg import Manipulator, Pwm
from stepper import Stepper
COMPUTER = rospy.get_param('/computer')
SERVO_PWM_PIN = rospy.get_param('/pwm/pins/claw_servo')
LOOKUP_POSITION = rospy.get_param('/servo/lookup/position')
LOOKUP_PULSE_WIDTH = ... | Python | 0.000001 | @@ -2198,16 +2198,90 @@
wn('')%0A%0A
+ self.valve_stepper.disable()%0A self.agar_stepper.disable()%0A%0A
|
e49b2489d0b43ff21627a8b7092f70b338694edd | Initialize claw to middle servo position | manipulator_interface/scripts/manipulator_interface.py | manipulator_interface/scripts/manipulator_interface.py | #!/usr/bin/env python
import numpy
import rospy
from vortex_msgs.msg import Manipulator, Pwm
from stepper import Stepper
PWM_COUNTER_MAX = rospy.get_param('/pwm/counter/max')
FREQUENCY = rospy.get_param('/pwm/frequency/set')
FREQUENCY_MEASURED = rospy.get_param('/pwm/frequency/measured')
SERVO_PWM_PIN = rospy.get_pa... | Python | 0.000001 | @@ -1449,17 +1449,17 @@
ition =
-1
+0
.0 # 1 =
|
a36ee47a06d1c9670c4df9aed35a8b651db8be31 | correct bug with expected guarantees node - forgot to change variable name | mdp_plan_exec/scripts/mdp_task_guarantees_estimator.py | mdp_plan_exec/scripts/mdp_task_guarantees_estimator.py | #! /usr/bin/env python
import sys
import os
from copy import deepcopy
import rospy
from mdp_plan_exec.top_map_mdp import TopMapMdp
from mdp_plan_exec.prism_java_talker import PrismJavaTalker
from strands_executive_msgs.srv import GetGuaranteesForCoSafeTask, GetGuaranteesForCoSafeTaskResponse
class MdpTaskGuarantee... | Python | 0 | @@ -869,32 +869,22 @@
elf.
-travel_times_to_waypoint
+get_guarantees
_ser
@@ -2567,14 +2567,16 @@
-travel
+expected
_tim
|
ea9ae167e61e20e8417906b383ade7deaf529839 | fix timestamp upgrade | gnocchi/indexer/alembic/versions/5c4f93e5bb4_mysql_float_to_timestamp.py | gnocchi/indexer/alembic/versions/5c4f93e5bb4_mysql_float_to_timestamp.py | # -*- encoding: utf-8 -*-
#
# Copyright 2016 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | Python | 0.000007 | @@ -1106,16 +1106,63 @@
mysql%22:%0A
+ op.execute(%22SET time_zone = '+00:00'%22)%0A
|
7777a81dbf7f8a0da583497e9d54747074d5196a | Add full coverage for SlowQuery. | zerver/tests/test_middleware.py | zerver/tests/test_middleware.py | import time
from unittest.mock import Mock, patch
from zerver.lib.test_classes import ZulipTestCase
from zerver.middleware import is_slow_query
from zerver.middleware import write_log_line
class SlowQueryTest(ZulipTestCase):
def test_is_slow_query(self):
# type: () -> None
self.assertFalse(is_slow... | Python | 0 | @@ -6,16 +6,58 @@
t time%0A%0A
+from django.test import override_settings%0A
from uni
@@ -262,16 +262,309 @@
tCase):%0A
+ SLOW_QUERY_TIME = 10%0A log_data = %7B'extra': '%5Btransport=websocket%5D',%0A 'time_started': 0,%0A 'bugdown_requests_start': 0,%0A 'bugdown_ti... |
7f215e2b83f91ffd77b25658a0922c2af29ae7e2 | Update FileDropInput for django 1.11 django.forms.Widget build_attrs method | base/form_utils.py | base/form_utils.py | # -*- encoding: utf-8 -*-
from bleach import (
clean,
ALLOWED_TAGS,
ALLOWED_ATTRIBUTES,
)
from django import forms
from django.forms.utils import flatatt
from django.forms.widgets import FileInput
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
def bleach_clean(... | Python | 0.000001 | @@ -1660,29 +1660,29 @@
''%0A
-final
+extra
_attrs = sel
@@ -1682,63 +1682,160 @@
s =
-self.build_attrs(attrs, type=self.input_type, name=name
+attrs.copy() if attrs else %7B%7D%0A extra_attrs.update(name=name, type=self.input_type)%0A final_attrs = self.build_attrs(self.attrs, extra_attrs
)... |
54f0964aa1fe6b7ef7bc5ccf1dfabcb90b62206c | Remove extra debugging | bashhub/bashhub.py | bashhub/bashhub.py | #!/usr/bin/python
from time import *
import click
import traceback
import dateutil.parser
import sys
import os
from model import CommandForm
import rest_client
import bashhub_setup
import bashhub_globals
from bashhub_globals import BH_FILTER
from version import __version__
import shutil
import requests
import subproce... | Python | 0.000002 | @@ -4907,33 +4907,8 @@
(e)%0A
- print(formatted)%0A
|
5898e38274d30d3bf01466ef3d77fc6853e7a8b0 | Fix out of date filepath | openprescribing/frontend/management/commands/convert_hscic_prescribing.py | openprescribing/frontend/management/commands/convert_hscic_prescribing.py | import csv
import glob
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = ''
help = 'Converts HSCIC data files into the format needed for our SQL COPY '
help += 'statement. We use COPY because it is much faster than INSERT.'
def add_arguments(self, pa... | Python | 0.000064 | @@ -750,16 +750,21 @@
glob('./
+data/
raw_data
@@ -775,17 +775,20 @@
DPI+BNFT
-*
+.CSV
')%0A%0A
@@ -1149,16 +1149,105 @@
reader:%0A
+ print row%0A if len(row) == 1:%0A continue%0A
|
5f020777b661f9aa909da0a6fae64c3db3fe0a92 | ORDER BY | mozaik_virtual_partner_involvement/models/virtual_partner_involvement.py | mozaik_virtual_partner_involvement/models/virtual_partner_involvement.py | # Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class VirtualPartnerInvolvement(models.Model):
_name = "virtual.partner.involvement"
_inherit = "abstract.virtual.model"
_description = "Partner/Involvement"
_auto = False... | Python | 0 | @@ -1704,24 +1704,69 @@
onality_id,%0A
+ pi.id as partner_involvement_id,%0A
@@ -2457,8 +2457,391 @@
= TRUE%22%0A
+%0A @api.model%0A def _get_order_by(self):%0A %22%22%22%0A Since several records can have the same partner_id,%0A ORDER BY 'partner_id' doesn't give al... |
6d55e296e99bfff28f6bdf694206871b8d04de62 | Fix client metadata extractor test | plugins/metadata_extractor/plugin_tests/client_metadata_extractor_test.py | plugins/metadata_extractor/plugin_tests/client_metadata_extractor_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# 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 ... | Python | 0.000001 | @@ -1251,32 +1251,8 @@
f):%0A
- time.sleep(0.2)%0A
@@ -1312,32 +1312,32 @@
user=self.user)%0A
+
self.ass
@@ -1416,17 +1416,16 @@
meta'%5D)%0A
-%0A
@@ -1838,327 +1838,80 @@
th)%0A
-%0A start = time.time()%0A while True:%0A if time.time() - start %3E 15:%0A ... |
6627f00d592597b41bd3b288cd4ad3dccbecdecc | add prefix config | beetsplug/fuzzy.py | beetsplug/fuzzy.py | # This file is part of beets.
# Copyright 2013, Philippe Mongeau.
#
# 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, copy... | Python | 0.000007 | @@ -840,37 +840,25 @@
ort
-config%0Afrom beets
+util%0A
import
-util
+beets
%0Aimp
@@ -1083,11 +1083,132 @@
x =
-%22~%22
+beets.config%5B'fuzzy'%5D%5B'prefix'%5D.get() or '~'%0A self.threshold = beets.config%5B'fuzzy'%5D%5B'threshold'%5D.as_number() or 0.7
%0A%0A
@@ -1442,48 +1442,22 @@
) %3E
-conf... |
34606e49fead5cbddbcd1fb253f85dc97be67d52 | Version bump | bespin/__init__.py | bespin/__init__.py | VERSION="0.4.3"
| Python | 0.000001 | @@ -10,7 +10,7 @@
0.4.
-3
+5
%22%0A
|
9851ba8032b7c355a0b40c384786b3065ad3e7fd | debug cleanup | bgg/lib/cleanup.py | bgg/lib/cleanup.py | import os
import json
import operator
from . import config
from . import utils
from . import merge
from . import branches
def run(search):
if not search:
print (
"ERROR. You must supply a search term or "
"the magically keyword MERGED"
)
exit()
if search == 'M... | Python | 0.000001 | @@ -413,57 +413,8 @@
s()%0A
- # print branches_%0A # print merged%0A
|
f982b499580ec510f63aa279423c2684d6093899 | fix bug, if no datasets is given, prepare them all. | tensorflow_datasets/scripts/download_and_prepare.py | tensorflow_datasets/scripts/download_and_prepare.py | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | Python | 0.000001 | @@ -3819,27 +3819,72 @@
datasets
-.split(%22,%22)
+ and FLAGS.datasets.split(%22,%22)%0A
or tfds
|
44d6e7533877850566428795db69b512a6ca20ae | fix for talos files | testlog_etl/transforms/pulse_block_to_talos_logs.py | testlog_etl/transforms/pulse_block_to_talos_logs.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 pyL... | Python | 0 | @@ -563,16 +563,17 @@
REFIX =
+b
%22 IN
@@ -2277,24 +2277,25 @@
bytes.split(
+b
%22%5Cn%22):%0A
|
44574107a22a2cb20304151ee1b3907df4d1fcd4 | print warning instead of crash for overlapping input intervals | bin/fillTermini.py | bin/fillTermini.py | #!/usr/bin/env python
#Copyright (C) 2014 by Glenn Hickey
#
#Released under the MIT license, see LICENSE.txt
import sys
import os
import argparse
import copy
from pybedtools import BedTool, Interval
"""
Stick a bed interval between pairs of lastz termini. Script written to be used
in conjunction with tsdFinder.py:
... | Python | 0.000001 | @@ -1821,16 +1821,20 @@
start =
+min(
prevInte
@@ -1841,16 +1841,31 @@
rval.end
+, interval.end)
%0A
@@ -1887,16 +1887,40 @@
al.end =
+ max(prevInterval.start,
interva
@@ -1926,16 +1926,17 @@
al.start
+)
%0A
@@ -1965,32 +1965,229 @@
(prevInterval))%0A
+ if fillInterval.start %3E= fil... |
df02233bba4fc95a8c615b358772dd0c6ffbd5a0 | output test failures | bin/test_driver.py | bin/test_driver.py |
__usage__ = """Usage: %(program)s [-l log_level] [-n] [-h] app
Where OPTIONS is one or more of:
-l,--log
log level (DEBUG, INFO, WARNING, ERROR)
-n,--no-color
avoid using color in output
-h,--help
show usage and exit
and 'app' is the name of the app whic... | Python | 0.999999 | @@ -990,15 +990,8 @@
json
-summary
%22)%0A
@@ -1515,24 +1515,42 @@
l_tests = 0%0A
+ fail_log = %22%22%0A
%0A for
@@ -1617,28 +1617,20 @@
-test_results
+data
= drive
@@ -1641,24 +1641,68 @@
t(test_url)%0A
+ test_results = data%5B'testfiles'%5D%5B0%5D%0A
test
@@ -2219,24 +2219,... |
1ba050509865832ce72b8ee79084b56c9836c9ff | update the test file to reflect the rename of the blockfinder.use_sql_database_call method | blockfindertest.py | blockfindertest.py | #!/usr/bin/python
import blockfinder
import unittest
import os
class CheckReverseLookup(unittest.TestCase):
ipValues = ( (3229318011, '192.123.123.123'),
(3463778365, '206.117.16.61'),
(4278190202, '255.0.0.122'),
(3654084623, '217.204.232.15'),
... | Python | 0 | @@ -1402,13 +1402,8 @@
base
-_call
(%22ip
|
61a65132c54caa0011db467e639ac0553a1a93af | Update attribute handling scheme | blox/attributes.py | blox/attributes.py | '''blox/attributes.py
Defines how Blox handles the setting of and definition of attributes
Copyright (C) 2015 Timothy Edmund Crosley
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 rest... | Python | 0 | @@ -1442,114 +1442,8 @@
ue%0A%0A
- def to_python(obj, value):%0A return value%0A%0A def to_string(obj, value):%0A return value%0A%0A
%0Acla
@@ -2025,32 +2025,98 @@
ect_attribute)%0A%0A
+ def from_string(obj, value):%0A return self.type(value)%0A%0A
def __set__(
@@ -3530,16 +3530,87... |
d6fc8e8bb01ad0dda5a41bd954140b6fce607bbc | Fix port in the check collector | c2cgeoportal/views/checker.py | c2cgeoportal/views/checker.py | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Camptocamp SA
# 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 notice, this
# l... | Python | 0 | @@ -4991,13 +4991,8 @@
host
-:8080
%22)%0A
|
e70a45baa04a8f79bc0fd47d52fac24ca9a5985e | Clean '--' values | private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py | private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
columns = ['Poll','Date', 'Sample', 'Spread']
def __init__(self, url, extra_fields = {}):
self.url = url
self.extra_fields = extra_fields
de... | Python | 0.000219 | @@ -1042,18 +1042,36 @@
el
-se
+if values%5Bi%5D != '--'
:%0A
|
51ff0cb4b81009e01a07c1ce2f02677587f87ea1 | test context idea | web_version.py | web_version.py | ######################################
# File Name : web_version.py
# Author : Daniel Cuneo
# Creation Date : 11-21-2015
######################################
import logging
import pandas as pd
from flask import Flask
from flask import request, render_template, url_for, redirect
import indeed_scrape
import jinja2
from... | Python | 0.000315 | @@ -843,32 +843,46 @@
e.%3C/h1%3E%0A%3C/body%3E%0A
+%7B%7B results %7D%7D%0A
%3C/html%3E''')%0A%0Ainp
@@ -2483,21 +2483,25 @@
app.
-after_request
+context_processor
%0Adef
@@ -2999,16 +2999,29 @@
return
+dict(results=
encode_u
@@ -3029,16 +3029,17 @@
f8(html)
+)
%0A%0A ex
@@ -3235,24 +3235,25 @@
nd%22%0A ... |
f68f6ad57de3012da6fe848061dcc98f23c20e46 | Increase version number internally | laniakea/__init__.py | laniakea/__init__.py | # coding: 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/.
'''
Laniakea is a utility for managing instances at various cloud providers and aids in setting up a fuzz... | Python | 0.000001 | @@ -747,17 +747,17 @@
ON = '0.
-8
+9
'%0A%0A @
|
e6cb753e625d53281a0cc6146911d267aa147643 | fix argparse | whats_on_tv.py | whats_on_tv.py | #!venv/bin/python3
# media_namer.py - Renames passed media files in a folder (and subfolders) using
# OMDB for movies and theTVDB for TV shows
import sys
import os
import logging
import argparse
import random
import subprocess
import shlex
import videoLister
def main():
# set up logging
log... | Python | 0.998485 | @@ -656,13 +656,14 @@
to
-clone
+search
.')%0A
|
0a7ad972e3d12e9a20df7226ffd4cec622c6a38e | Fix render of animation times. | bluemonday78/render.py | bluemonday78/render.py | #!/usr/bin/env python3
# encoding: UTF-8
# This file is part of Addison Arches.
#
# Addison Arches 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)... | Python | 0 | @@ -1235,39 +1235,36 @@
yle=%22animation-d
-uration
+elay
: %7Banim.duration
@@ -1248,39 +1248,40 @@
n-delay: %7Banim.d
-uration
+elay:.2f
%7Ds; animation-de
@@ -1271,36 +1271,39 @@
f%7Ds; animation-d
-elay
+uration
: %7Banim.delay%7Ds%22
@@ -1291,28 +1291,35 @@
ion: %7Banim.d
-elay
+uration:.2f
%7Ds%22%3E%0A%3... |
c713c8859bc3fad3f1d6c98a65f6f7e805a1ac73 | Add test_*.txt cleanup | reportlab/test/runAll.py | reportlab/test/runAll.py | #!/usr/bin/env python
#copyright ReportLab Inc. 2000-2001
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/test/runAll.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/test/runAll.py,v 1.16 2004/03/26 14:20:44 rgbecker Exp $
"""Runs all test files in all subfo... | Python | 0 | @@ -241,17 +241,17 @@
py,v 1.1
-6
+7
2004/03
@@ -262,12 +262,12 @@
14:2
-0:44
+6:50
rgb
@@ -1593,16 +1593,30 @@
All.txt'
+, 'test_*.txt'
)):%0A
|
ec39fddcb8aff1f49cf897a1de6a1cf0c47676bf | Upgrade of vcf_filter.py. | sequana/vcf_filter.py | sequana/vcf_filter.py | """
Python script to filter a vcf-file generated by freebayes.
"""
import sys
import vcf
class VCF(vcf.Reader):
def __init__(self, filename, **kwargs):
"""
Filter vcf file with a dictionnary.
It takes a vcf file as entry.
"""
try:
filin = open(filename, "r")
... | Python | 0 | @@ -753,97 +753,363 @@
if(
-info_value %3C int(threshold%5B1:%5D)):%0A return False%0A else:%0A
+threshold.startswith(%22%3C=%22)):%0A if(info_value %3C= int(threshold%5B2:%5D)):%0A return False%0A elif(info_value %3C int(threshold%5B1:%5D... |
dbbcc862c55125e15aa3ce10b9fe5c3b81576192 | Fix function comment | bob/db/utfvp/models.py | bob/db/utfvp/models.py | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
"""Table models and functionality for the UTFVP database.
"""
import os
import pkg_resources
import bob.io.base
import bob.io.image
import bob.db.base
import numpy
from sqlalchemy import Table, Column, Integer, String, ForeignKey, Boolean
from sqlalchemy impor... | Python | 0.000013 | @@ -5177,17 +5177,18 @@
rray of
-8
+16
-bit uns
|
8f6abdc12292d3b8cc4ebd6a35563da05501aecd | add config parameter to dbImport | python/db_importer.py | python/db_importer.py | import os
from json_generator import JsonGenerator
# example call:
# snpQuery = 'select chromStart as Start, chromEnd as End, name as Name, transcript, frame, alleleCount, funcCodes, alleles, codons, peptides'
# db_importer.dbImport(conn, "snp132CodingDbSnp", snpQuery, "chromEnd", "chrom", "../data/", "snp132CodingDbS... | Python | 0.000001 | @@ -435,16 +435,29 @@
200000,
+%0A
compres
@@ -464,16 +464,76 @@
s = True
+,%0A config = %7B'style': %7B'className': 'feature2'%7D%7D
):%0A q
@@ -1412,88 +1412,14 @@
k',
-%7B%0A 'style': %7B%0A 'className': 'feature2'%0A %7D%0A %7D
+config
)%0A
|
1edca32de427db5e712c01dcd9c4f9ed1986da37 | Update miniPyMusic.py | python/miniPyMusic.py | python/miniPyMusic.py | #!/usr/bin/python
# -*- coding: iso-8859-1 -*-
# miniPyMusic - a minimalist music server
# Run me in the directory of your MP3/OGG files
# and point your browser at me.
# Great for a simple LAN music server.
import os,os.path,BaseHTTPServer,SimpleHTTPServer,SocketServer,socket,mimetypes,urllib
PORT = 8099
HOSTNAME =... | Python | 0 | @@ -202,16 +202,1324 @@
server.%0A
+'''%0AExplanations%0A%0AThe ThreadingTCPServer listens on the given port (8099). Each time a client connects, it spawns a new thread and instanciates a miniMusicServer object which will handle the HTTP request (do_GET()). Therefore each client has its miniMusicServer objet working f... |
507153dba7bfd7db4bc9770b1278c6501efb8c96 | support vertex colors for PLY writer | src/python/director/ioUtils.py | src/python/director/ioUtils.py | import os
import vtkAll as vtk
from shallowCopy import shallowCopy
def readPolyData(filename, computeNormals=False):
ext = os.path.splitext(filename)[1].lower()
readers = {
'.vtp' : vtk.vtkXMLPolyDataReader,
'.vtk' : vtk.vtkPolyDataReader,
'.ply' : vtk.vtkPLYReader,
... | Python | 0 | @@ -1763,24 +1763,146 @@
eToASCII()%0A%0A
+ if ext in ('.ply'):%0A if polyData.GetPointData().GetArray('RGB255'):%0A writer.SetArrayName('RGB255')%0A%0A
writer.S
|
b950882d66ed539372c0d0cddc968a0df297dd43 | update doc for resize when loading image (#415) | python/dllib/src/bigdl/dllib/feature/image/imageset.py | python/dllib/src/bigdl/dllib/feature/image/imageset.py | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | Python | 0 | @@ -2090,54 +2090,154 @@
size
-%0A :param resize_width width after resiz
+, by default is -1 which will not resize the image%0A :param resize_width width after resize, by default is -1 which will not resize the imag
e%0A
|
295317513e5bbd7dbc94e23b57184c788a80eb81 | Change to an OrderedDict to make Admin header tabs keep consistent order | sandman/model/utils.py | sandman/model/utils.py | """Various utility functions for registering and activating models."""
import webbrowser
from flask import current_app, g
from flask.ext.admin import Admin
from flask.ext.admin.contrib.sqla import ModelView
from sqlalchemy.engine import reflection
from sqlalchemy.ext.declarative import declarative_base, DeferredReflec... | Python | 0 | @@ -81,16 +81,35 @@
bbrowser
+%0Aimport collections
%0A%0Afrom f
@@ -6317,34 +6317,57 @@
ss_references =
-%7B%7D
+collections.OrderedDict()
%0A gen
|
bc95cf222a2f59e77962fb4ae5613d4695853944 | Add imports in halfedge_meshes/__init__.py | halfedge_mesh/__init__.py | halfedge_mesh/__init__.py | from halfedge_mesh import HalfedgeMesh | Python | 0 | @@ -31,8 +31,109 @@
edgeMesh
+%0Afrom halfedge_mesh import Vertex%0Afrom halfedge_mesh import Halfedge%0Afrom halfedge_mesh import Facet%0A
|
bd369471abb00478f7b5e03a22f94e25133d7d78 | add __version__ | bootstrap_contrast/__init__.py | bootstrap_contrast/__init__.py | from .bootstrap_contrast import * | Python | 0.000984 | @@ -26,8 +26,28 @@
import *
+%0A%0A__version__=0.327%0A
|
e9d6884e43869f5d22e882b0aec2a534fb2a735b | 部署2.1.1 | app/__init__.py | app/__init__.py | from flask import Flask,render_template
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from config import config
from flask.ext.login import LoginManager
from flask.ext.pagedown import PageDown
bootstrap... | Python | 0.000001 | @@ -407,18 +407,8 @@
wn()
- #%E5%AF%8C%E6%96%87%E6%9C%AC%E7%BC%96%E8%BE%91%E5%99%A8
%0D%0Alo
|
5974af661e1c8d11aa92c5fb36ee41e10f616202 | Update test file | python/ql/test/experimental/dataflow/ApiGraphs/test.py | python/ql/test/experimental/dataflow/ApiGraphs/test.py | import a1 #$ use=moduleImport("a1")
x = a1.blah1 #$ use=moduleImport("a1").getMember("blah1")
import a2 as m2 #$ use=moduleImport("a2")
x2 = m2.blah2 #$ use=moduleImport("a2").getMember("blah2")
import a3.b3 as m3 #$ use=moduleImport("a3").getMember("b3")
x3 = m3.blah3 #$ use=moduleImport("a3").getMember("b3").ge... | Python | 0 | @@ -760,16 +760,23 @@
5 = abcd
+.method
() #$ us
@@ -847,34 +847,55 @@
.get
-Return()%0A%0Ay5 = x5.method()
+Member(%22method%22).getReturn()%0A%0Afrom a6 import m6
#$
@@ -905,32 +905,33 @@
=moduleImport(%22a
+6
%22).getMember(%22b%22
@@ -920,33 +920,83 @@
a6%22).getMember(%22
-b
+m6%22)%0A%0Ax6 = m6().foo().b... |
a11c4b7c4f546156d5d70c9799d148b99e932e2c | Update __init__.py | app/__init__.py | app/__init__.py | # app/__init__.py
from flask_api import FlaskAPI
from flask_sqlalchemy import SQLAlchemy
# local import
from instance.config import app_config
# initialize sql-alchemy
db = SQLAlchemy()
def create_app(config_name):
app = FlaskAPI(__name__, instance_relative_config=True)
app.config.from_object(app_config[con... | Python | 0.000072 | @@ -364,16 +364,228 @@
ig.py')%0A
+ %0A# We've also disabled track modifications for SQLAlchemy because %0A# it'll be deprecated in future due to it's significant performance overhead. %0A# For debugging enthusiasts, you can set it to True for now.%0A%0A
app.
|
d0c28ede6de9440130b11088a0dcd01b5210c47e | fix block device import code | importrpm.py | importrpm.py | #
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import commit
import cook
import helper
import os
import stat
import util
from build import buildpackage
from build import lookaside
from repository import changeset
def doImport(repos, cfg, rpmFile):
# this is just to avoid a warning for all srs invoc... | Python | 0 | @@ -2077,17 +2077,16 @@
rdev
-e
s%5Bi%5D & 0
|
672d88d69c28d5304dbc2b1ed055289671a9444f | fix views in init for import | app/__init__.py | app/__init__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import Flask
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
from flask_login import LoginManager, current_user
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
app = Flask(__name__)
app.config.from_object('... | Python | 0 | @@ -597,16 +597,23 @@
p import
+ views,
models%0A
|
9107d03f3c19cbc1f488478dc428dfcfaac93ded | update test | test_SigSci.py | test_SigSci.py | from __future__ import print_function
from builtins import str
import unittest
import mock
from SigSciApiPy.SigSci import SigSciAPI
def mocked_requests_get(*args, **kwargs):
class MockResponse(object):
def __init__(self, json_data, status_code):
self.json_data = json_data
self.sta... | Python | 0.000001 | @@ -1764,18 +1764,17 @@
rt:time-
-de
+a
sc tag:S
|
e4b9633ddd4c5926efd6dec56d70b9c1ac9a3b31 | support search by attribute name | cartoview/app_manager/rest.py | cartoview/app_manager/rest.py |
from cartoview.app_manager.models import AppInstance
from geonode.api.resourcebase_api import *
from .resources import FileUploadResource
from tastypie.resources import ModelResource
from tastypie import fields
from geonode.maps.models import Map as GeonodeMap, MapLayer as GeonodeMapLayer
from geonode.layers.models i... | Python | 0 | @@ -1092,34 +1092,8 @@
ll()
-.order_by('display_order')
%0A
@@ -1110,16 +1110,29 @@
ring = %7B
+%0A
%22layer%22:
@@ -1150,16 +1150,70 @@
ELATIONS
+,%0A %22attribute%22: ALL_WITH_RELATIONS%0A
%7D%0A%0Aclass
|
ca9ca7c4a4ca951a0584f16716057629f8560021 | Remove unused imports | app/__init__.py | app/__init__.py | import re
from datetime import timedelta
from flask import Flask, request, redirect, session
from flask_login import LoginManager
from flask_wtf.csrf import CsrfProtect
from dmutils import apiclient, init_app, flask_featureflags
from dmutils.user import User
from config import configs
from jinja2 import Markup, esc... | Python | 0.000001 | @@ -86,16 +86,24 @@
session
+, Markup
%0Afrom fl
@@ -295,67 +295,8 @@
gs%0A%0A
-from jinja2 import Markup, escape%0Afrom flask import Markup%0A
from
|
56f160ff8c579c8119758d930795937c257f5b4e | build directory removed from the released tar | scripts/tool_release.py | scripts/tool_release.py | #!/usr/bin/env python
'This script prepares the franklin tarballs'
from optparse import OptionParser
import tempfile, shutil, os, subprocess, tarfile
from os.path import join, abspath, split
def remove_download_link(index_fpath):
'It removes the download link from the index page'
mod_fhand = open(join(index_f... | Python | 0 | @@ -2674,16 +2674,159 @@
c_dir)%0A%0A
+ #remove the build directory%0A build_dir = join(release_dir, 'build')%0A if os.path.exists(build_dir):%0A shutil.rmtree(build_dir)%0A%0A
#now
|
b8f2fabf062d58ed874956dc4895fc556f33089f | fix bugs with empty sync log id | casexml/apps/phone/restore.py | casexml/apps/phone/restore.py | import warnings
from dimagi.utils.decorators.memoized import memoized
from casexml.apps.case.exceptions import BadStateException, RestoreException
from casexml.apps.phone.models import SyncLog, CaseState
import logging
from dimagi.utils.couch.database import get_db, get_safe_write_kwargs
from casexml.apps.phone import ... | Python | 0 | @@ -1821,32 +1821,50 @@
.caching_enabled
+ and self.sync_log
:%0A pa
@@ -3649,16 +3649,34 @@
_enabled
+ and self.sync_log
:%0A
|
7fe56cf99297a2bef50345245e4457d03e269349 | Add request ID logging to the API. | app/__init__.py | app/__init__.py | import os
import uuid
from flask import Flask, _request_ctx_stack
from flask import request, url_for, g, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from monotonic import monotonic
from notifications_utils import logging
from werkzeug.local import LocalProxy
from app.... | Python | 0.000032 | @@ -264,16 +264,28 @@
logging
+, request_id
%0Afrom we
@@ -1457,24 +1457,61 @@
pplication)%0A
+ request_id.init_app(application)%0A
db.init_
|
b38c8dffbc19505e826f9a1426cbfac2b8b07515 | update check command | hokusai/commands/check.py | hokusai/commands/check.py | import os
from hokusai.lib.command import command
from hokusai.lib.config import config
from hokusai.services.ecr import ECR
from hokusai.services.kubectl import Kubectl
from hokusai.lib.common import print_red, print_green, shout, CalledProcessError
@command
def check():
return_code = 0
def check_ok(check_item)... | Python | 0.000002 | @@ -1088,24 +1088,25 @@
check_ok('
+$
AWS_ACCESS_K
@@ -1132,24 +1132,25 @@
check_err('
+$
AWS_ACCESS_K
@@ -1251,16 +1251,17 @@
eck_ok('
+$
AWS_SECR
@@ -1299,16 +1299,17 @@
ck_err('
+$
AWS_SECR
@@ -1621,32 +1621,34 @@
:%0A check_ok('
+./
hokusai/common.y
@@ -1667,32 +1667,34 @@
%0A check_err('
+./
h... |
31ea2191bb83101d0b9123f8e6a427aeefa9dee3 | test getsize | test_fakefs.py | test_fakefs.py | import unittest
import fakefs
from nose.tools import assert_equal, assert_true, assert_false
import os
class FakeTestCase(unittest.TestCase):
def run(self, result=None):
self.fs = fakefs.FakeFilesystem()
with self.fs.monkey.patch():
super(FakeTestCase, self).run(result)
def test_o... | Python | 0 | @@ -85,16 +85,24 @@
rt_false
+, raises
%0A%0Aimport
@@ -828,12 +828,223 @@
ts('/yup'))%0A
+%0A @raises(FileNotFoundError)%0A def test_getsize_missing(self):%0A os.path.getsize('/a')%0A%0A def test_getsiz(self):%0A self.fs.add_file('/a', '123')%0A assert_equal(os.path.getsize('/a'), 3)%0... |
799d78203aa8ff424005213f5bfb3788ba4c611a | Initialize fake adagios env after selenium | adagios/seleniumtests.py | adagios/seleniumtests.py | from django.test import LiveServerTestCase
from django.utils import unittest
import adagios.settings
import adagios.utils
import os
try:
from selenium import webdriver
except ImportError:
webdriver = None
def get_remote_webdriver(capabilities=None):
"""Get remote webdriver. Configured using environment va... | Python | 0 | @@ -1797,380 +1797,8 @@
cls.
-nagios_config = adagios.settings.nagios_config%0A cls.environment = adagios.utils.FakeAdagiosEnvironment()%0A cls.environment.create_minimal_environment()%0A cls.environment.configure_livestatus()%0A cls.environment.update_adagios_global_variables()%0A c... |
e55201457acf72240d522ab929aa6e9a7d69c31c | Exit with error code if --transport-options are not valid JSON | celery_prometheus_exporter.py | celery_prometheus_exporter.py | import argparse
import celery
import celery.states
import collections
import logging
import prometheus_client
import signal
import sys
import threading
import time
import json
import os
__VERSION__ = (1, 1, 0, 'final', 0)
DEFAULT_BROKER = 'redis://redis:6379/0'
DEFAULT_ADDR = '0.0.0.0:8888'
LOG_FORMAT = '[%(asctime... | Python | 0.000003 | @@ -5903,16 +5903,33 @@
options)
+, file=sys.stderr
)%0A
@@ -5938,14 +5938,19 @@
-return
+sys.exit(1)
%0A
|
0ec6f767d15bf59d6ba9f5088c88923136f18e2a | support mengxue | test_poetry.py | test_poetry.py | #! -*- coding: utf-8 -*-
# import sqlite3
import os
import json
import sys
import traceback
import functools
def check_json(f, _dir):
if not f.endswith('.json'):
return True
filepath = os.path.join(_dir, f)
with open(filepath) as file:
try:
_ = json.loads(file.read())
... | Python | 0.00628 | @@ -1,6 +1,5 @@
#
-!
-*-
@@ -21,25 +21,8 @@
-*-%0A
-# import sqlite3%0A
impo
@@ -303,31 +303,43 @@
-print(u%22%25s %E6%A0%A1%E9%AA%8C%E6%88%90%E5%8A%9F%22 %25 _dir
+sys.stdout.write(f%22%7Bfilepath%7D %E6%A0%A1%E9%AA%8C%E6%88%90%E5%8A%9F%22
)%0A
@@ -428,28 +428,16 @@
t_exc())
-
%0A
@@... |
ffb2b5a21018a59e99f5a2a959c30d95456244e0 | Update rtconfig.py | bsp/allwinner_tina/rtconfig.py | bsp/allwinner_tina/rtconfig.py | import os
# toolchains options
ARCH ='arm'
CPU ='arm9'
CROSS_TOOL ='gcc'
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
else:
RTT_ROOT = '../..'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'E:\wo... | Python | 0.000001 | @@ -368,17 +368,17 @@
print
-
+(
'Please
@@ -415,16 +415,17 @@
NU GCC!'
+)
%0A exi
|
a58eba2289395a34d5dad6a934c293500346c63e | Edit settings.py | qian/qian/settings.py | qian/qian/settings.py | # Django settings for qian project.
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Johan Sim Jian An', 'johansja@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3'... | Python | 0 | @@ -41,23 +41,24 @@
ort os%0A%0A
-PROJECT
+SETTINGS
_ROOT =
@@ -89,16 +89,58 @@
dirname(
+__file__))%0APROJECT_ROOT = os.path.abspath(
os.path.
@@ -147,25 +147,29 @@
dirname(
-__file__)
+SETTINGS_ROOT
))%0A%0ADEBU
@@ -1963,39 +1963,40 @@
= os.path.join(
-PROJECT
+SETTINGS
_ROOT, %22media%22)%0A
@@ -2442,10 +2... |
e7588dccb9ae5e10fe0512d15afc82e8efbe20ba | add role 'Owner' to new projects created at login | cendari/cendari_middleware.py | cendari/cendari_middleware.py | from django.contrib.auth.middleware import RemoteUserMiddleware
from django.contrib.auth.signals import user_logged_in
from django.conf import settings
from editorsnotes.main.models import Project
from cendari_api import *
import logging
logger = logging.getLogger('cendari.middleware')
DATA_API_SESSION_KEY = '_cenda... | Python | 0 | @@ -3644,24 +3644,123 @@
rs.add(user)
+%0A role=project.roles.get_or_create_by_name('Owner', is_super_role=True)%0A role.users.add(user)
%0A%0A if 'ep
|
06c4751370cbb3a8cc7bd816b48afeffb18d1206 | Change status code | bucketlist/helper_functions.py | bucketlist/helper_functions.py | """Contain helper functions."""
from sqlalchemy.exc import IntegrityError
from bucketlist.app import db, app
from flask import g, request, jsonify
from bucketlist.models import User, Bucketlist, Item
from flask_restful import marshal, fields
# Define serialisers
user_serializer = {"id": fields.Integer,
... | Python | 0 | @@ -2200,25 +2200,25 @@
again%22%7D), 40
-0
+4
%0A%0A%0Adef add_u
|
b1ad5c8a4d2e9a116a6bb385dbdbeb777f6852b0 | Fix ImportError in tests for `import_module` in django < 1.9 and >= 1.9 | tests/tests.py | tests/tests.py | # tests stolen from https://github.com/martinrusev/django-redis-sessions
from django.utils.importlib import import_module
from django.conf import settings
import time
from nose.tools import eq_
session_engine = import_module(settings.SESSION_ENGINE).SessionStore()
def test_modify_and_keys():
eq_(session_engine.... | Python | 0.000002 | @@ -66,16 +66,57 @@
essions%0A
+try:%0A # For Django versions %3C 1.9%0A
from dja
@@ -156,16 +156,128 @@
_module%0A
+except ImportError:%0A # For Django versions %3E= 1.9%0A from django.utils.module_loading import import_module%0A%0A
from dja
|
1172c5e538b09dc3b65c44c1deff8ba2a9ad669c | check back | example/mnist_softmax.py | example/mnist_softmax.py | """Tinyflow example code.
This code is adapted from Tensorflow's MNIST Tutorial with minimum code changes.
"""
import tinyflow as tf
from tinyflow.datasets import get_mnist
stdev = 0.01
# Create the model
x = tf.placeholder(tf.float32, [None, 784])
conv1_filter = tf.Variable(tf.normal([20, 3, 5, 5], stdev=stdev))
co... | Python | 0 | @@ -172,21 +172,8 @@
st%0A%0A
-stdev = 0.01%0A
# Cr
@@ -235,21 +235,9 @@
4%5D)%0A
-%0Aconv1_filter
+W
= t
@@ -254,180 +254,24 @@
(tf.
-normal(%5B20, 3, 5, 5%5D, stdev=stdev))%0Aconv1_bias = tf.Variable(tf.normal(%5B20%5D, stdev=stdev))%0Aconv1 = tf.nn.conv2d(conv1_filter, bias=conv1_bias)%0Aflatten = tf.nn.flatte... |
8d3d55146b25d5c12f4851a5ce15fb62058d57b9 | Fix test | test_switch.py | test_switch.py | from __future__ import absolute_import, division, print_function
import os
import sys
import time
import qt_helpers as qt
import pytest
from mock import MagicMock
class TestQT(object):
def teardown_class(cls):
for m in sys.modules.keys():
if m.startswith('PyQt4') or m.startswith('PySide'):... | Python | 0.000004 | @@ -397,16 +397,29 @@
qt.
+_import_hook.
deny_mod
|
348205f38fbc09f04a6e8d795b001f08cce96c30 | fix `__init__` | src/openbandparams/__init__.py | src/openbandparams/__init__.py | #
# Copyright (c) 2013-2014, Scott J Maddox
#
# This file is part of openbandparams.
#
# openbandparams 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
# ... | Python | 0.000101 | @@ -905,49 +905,206 @@
n__%0A
-from . import iii_v%0Afrom .iii_v import *%0A
+__all__ = %5B'__version__'%5D%0A%0Afrom . import iii_v_zinc_blende_binaries%0A__all__ += iii_v_zinc_blende_binaries.__all__%0Afrom .iii_v_zinc_blende_binaries import *%0A%0Afrom . import iii_v_zinc_blende_ternaries
%0A__a
@@ -1112,47 +1112,... |
503c5fd54ba8aa83f367bab6fa3ff2eef11eefe3 | fix uuid generation | channels/backends/redis_py.py | channels/backends/redis_py.py | import time
import json
import datetime
import redis
import uuid
from .base import BaseChannelBackend
class RedisChannelBackend(BaseChannelBackend):
"""
ORM-backed channel environment. For development use only; it will span
multiple processes fine, but it's going to be pretty bad at throughput.
"""
... | Python | 0.000004 | @@ -1042,16 +1042,20 @@
refix +
+str(
uuid.uui
@@ -1062,17 +1062,8 @@
d4()
-.get_hex(
)%0A
|
89bc64fc43f9f66d78c44d499bf3980cd00d24de | Check for has_config_files key in tests | tests/tests.py | tests/tests.py | # -*- coding: utf-8 -*-
#
# Copyright 2013 Thomas Bechtold <thomasbechtold@jpberlin.de>
# Copyright 2013 Thomas Bechtold <t.bechtold@telekom.de>
#
# 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,... | Python | 0 | @@ -4423,32 +4423,133 @@
dable'%5D, False)%0A
+ #not all versions of python-apt have this key%0A if hasattr(p, %22has_config_files%22):%0A
self.ass
|
2271da848094034432c62dc4d78959336b1a2edd | Fix for thread locals on Jython (see http://groups.google.com/group/cherrypy-users/browse_frm/thread/ccbad8001cdc0146 and also http://article.gmane.org/gmane.comp.lang.jython.devel/2601 and its responses). | cherrypy/_cpthreadinglocal.py | cherrypy/_cpthreadinglocal.py | # This is a backport of Python-2.4's threading.local() implementation
"""Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. Depending on the version of Python you're
using, there may be a faster one available. You should always import
the local class from threa... | Python | 0.000003 | @@ -3592,31 +3592,16 @@
key =
- '_local__key',
'thread
|
770ac67a924f33651e47d1c70f83de9fa26ff8c4 | Remove logging | photobox/main.py | photobox/main.py | import pygame
import time
import os
import Colors
import SwitchState
from photoslideshow import Photoslideshow
class Photobox():
def __init__(self, windowsize, photofolder, camera, switch):
pygame.init()
self.windowsize = windowsize
self.photofolder = photofolder
self.screen = pyg... | Python | 0.000001 | @@ -2259,158 +2259,27 @@
s
-tart = time.clock()%0A self.showcountdown(3)%0A stop = time.clock()%0A print(%22Showing Countdown took %22 + str(stop - start) + %22 seconds%22
+elf.showcountdown(3
)%0A
@@ -2318,37 +2318,8 @@
00)%0A
- start = time.clock()%0A
@@ -2395,293 +2395,57 @@... |
ee2c15f068607fc0d919b407f90d43056bd53ce9 | drop extraneous newline | tests/clone.py | tests/clone.py | #!/usr/bin/env python
import auracle_test
import os
class TestClone(auracle_test.TestCase):
def testCloneSingle(self):
p = self.Auracle(['clone', 'auracle-git'])
self.assertEqual(p.returncode, 0)
self.assertPkgbuildExists('auracle-git', git=True)
self.assertCountEqual(self.reque... | Python | 0.000009 | @@ -2076,17 +2076,16 @@
1'))%0A%0A%0A
-%0A
if __nam
|
1831a7608a063d3f9b3dce7e42f591c50b099150 | remove the router name validation because that has been done in the __init__.py | rap/servicefactory.py | rap/servicefactory.py | """ Factory of RoutingService classes """
import json
from .mb import MapboxRouter
from .graphhopper import GraphHopperRouter
# from . import mapzen
# from . import google
# from . import here
# from . import tomtom
""" Factory method of creating concrete routing service instances
"""
VALID_ROUTING_SERVICES = [
'... | Python | 0.000077 | @@ -285,341 +285,76 @@
%22%22%22%0A
-VALID_ROUTING_SERVICES = %5B%0A 'mapbox', 'graphhopper', 'mapzen', 'google', 'here', 'tomtom'%0A%5D%0A%0A%0Adef RoutingServiceFactory(service_name):%0A if service_name not in VALID_ROUTING_SERVICES:%0A # TODO(lliu): Here should throw an exception or deal with it in an%... |
9d6a0ecb4238ad4bd8109d5a5f13a51f7f515dff | Replace missing functions/modules in the culprit with <unknown> | raven/utils/stacks.py | raven/utils/stacks.py | """
raven.utils.stacks
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import inspect
import re
from raven.utils.encoding import transform
_coding_re = re.compile(r'coding[:=]\s*([-\w.]+)')
def get_lines_from_file(fi... | Python | 0.000004 | @@ -3527,33 +3527,16 @@
frames:%0A
- try:%0A
@@ -3558,23 +3558,54 @@
oin(
+(f or '%3Cunknown%3E' for f in
%5Bframe
-%5B
+.get(
'module'
%5D, f
@@ -3604,17 +3604,21 @@
ule'
-%5D
+)
, frame
-%5B
+.get(
'fun
@@ -3627,57 +3627,12 @@
ion'
-%5D%5D)%0A except KeyError:%0A conti... |
8be9e3af061876a1d47de2b76da4eb5a7c0e6941 | update title to include date year | idMatching_windowcards.py | idMatching_windowcards.py | # !/usr/local/bin/python3.4.2
# ----Copyright (c) 2016 Carnegie Hall | The MIT License (MIT)----
# ----For the full license terms, please visit https://github.com/CarnegieHall/quality-control/blob/master/LICENSE----
# run script with 5 arguments:
# argument 0 is the script name
# argument 1 is the path to the Isilon HD... | Python | 0.000011 | @@ -3017,16 +3017,33 @@
opas_id%5D
+, ', ', date_year
%5D)%0A
|
2f7fe5dc367344ae12e99b670d04e7cbb5781860 | change the number from int to float | inverted_index.py | inverted_index.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# This is a simple Inverted Index library to pretreatment for PMI compute or similar way
#
# @author: Jason Wu (Jasonwbw@yahoo.com)
from operator import itemgetter
class InvertedIndex(object):
'''
Inverted Index class for docs
The library constructs an inverte... | Python | 0.002839 | @@ -3438,16 +3438,31 @@
m_count%0A
+ base = 0.0%0A
try:
@@ -3467,38 +3467,32 @@
y:%0A return
-float(
self.term_count%5B
@@ -3488,33 +3488,32 @@
term_count%5Bword%5D
-)
%0A except:%0A
@@ -3558,16 +3558,23 @@
%5Bword%5D =
+ base +
len(sel
@@ -3608,14 +3608,8 @@
urn
-float(
self
@@ -3621,25 ... |
57986b928ca87c85ef2e3bcc418be5da2ee7a688 | remove default value for passphrase. pep8 compliance. | imcsdk/utils/imcbackup.py | imcsdk/utils/imcbackup.py | # Copyright 2016 Cisco Systems, Inc.
#
# 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 writin... | Python | 0 | @@ -858,19 +858,16 @@
ssphrase
-=%22%22
, timeou
@@ -881,16 +881,16 @@
c=600):%0A
+
%22%22%22%0A
@@ -1172,32 +1172,24 @@
tp%22, %22http%22,
- %22none%22,
%22scp%22, %22sft
@@ -1880,16 +1880,131 @@
System%0A%0A
+ if password == %22%22 or passphrase == %22%22:%0A raise ImcValidationException(%22Inva... |
89cc31bd99b7c1397662352b411a5be9bd7cf625 | Set version to 6.11.0 | thinc/about.py | thinc/about.py | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__name__ = 'thinc'
__version__ = '6.11.0.dev2'
__summary__ = "Practical Machine Learning for NLP"
__uri__ = 'https://github.com/explosion/thinc... | Python | 0.000053 | @@ -214,13 +214,8 @@
11.0
-.dev2
'%0A__
|
6e1e668085176116688050c19ede266e9990c7a4 | Add test for indexing files with build_index(), increase coverage. | importmagic/index_test.py | importmagic/index_test.py | from __future__ import absolute_import
import json
from textwrap import dedent
from importmagic.index import SymbolIndex
def serialize(tree):
return json.loads(tree.serialize())
def test_index_file_with_all():
src = dedent('''
__all__ = ['one']
one = 1
two = 2
three = 3
... | Python | 0 | @@ -33,16 +33,26 @@
import%0A%0A
+import re%0A
import j
@@ -187,24 +187,1103 @@
ialize())%0A%0A%0A
+def test_index_basic_api(index):%0A assert index.depth() == 0%0A subtree = index._tree%5B'os'%5D%0A assert subtree.depth() == 1%0A assert index.location_for('os.path') == subtree.location_for('os.path')%0A... |
8909d5e788f5de3fb338ce4ddb970e8ab97a05cf | fix the stats script | tests/stats.py | tests/stats.py | #!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core"))
import re
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cmudbac.settings")
import django
django.setup()
from library.models import *
... | Python | 0.006016 | @@ -2603,32 +2603,49 @@
latest_attempt)%0A
+ try:%0A
statisti
@@ -2709,32 +2709,14 @@
-if statistic != None and
+ if
sta
@@ -2737,32 +2737,36 @@
0:%0A
+
+
num_repos += 1%0A
@@ -2760,24 +2760,28 @@
_repos += 1%0A
+
@@ -2812,24 +2812,57 @@
istic.coun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.