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 |
|---|---|---|---|---|---|---|---|
564bca1e051f6b1cc068d1dd53de55fcf4dc7c6f | Use SublimeLinter-javac as a base | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Josh Hagins
# Copyright (c) 2014 Josh Hagins
#
# License: MIT
#
"""This module exports the Scalac plugin class."""
from SublimeLinter.lint import Linter, util
class Scalac(Linter):
"""Provides an interface to... | Python | 0 | @@ -342,29 +342,15 @@
ax =
- ''%0A cmd =
'scala
-c
'%0A
@@ -360,28 +360,32 @@
xecutable =
-None
+'scalac'
%0A version
@@ -394,17 +394,16 @@
rgs = '-
--
version'
@@ -484,11 +484,12 @@
'%3E=
-1.0
+2.11
'%0A
@@ -502,11 +502,217 @@
x =
-r''
+(%0A r'%5E(?P%3Cfile%3E.+?):(?P%3Cline%3E%5Cd+): '%... |
1be097bad24827ed5ffd7f4c8a85f7ebafef10b0 | Fix deprecated function warning (#26) | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2015-2016 The SublimeLinter Community
# Copyright (c) 2013-2014 Aparajita Fishman
#
# License: MIT
#
"""This module exports the Annotations plugin class."""
import re
from SublimeLi... | Python | 0 | @@ -1472,52 +1472,8 @@
e):%0A
- settings = self.get_view_settings()%0A
@@ -1555,16 +1555,21 @@
words =
+self.
settings
|
1262366714500b34a943ae5c481f6489d7c44563 | Rename environment variable to match slim-lint | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Gavin Elster
# Copyright (c) 2015 Gavin Elster
#
# License: MIT
#
"""This module exports the SlimLint plugin class."""
import os
from SublimeLinter.lint import RubyLinter, util
class SlimLint(RubyLinter):
"""... | Python | 0.000001 | @@ -1241,16 +1241,26 @@
lf.env%5B%22
+SLIM_LINT_
RUBOCOP_
@@ -1267,10 +1267,8 @@
CONF
-IG
%22%5D =
|
628d65a15b5c51cb7d4a68e1e6babc01a712a538 | Add initial file for GUI | src/redevbazaar.py | src/redevbazaar.py | import pyforms
from pyforms import BaseWidget
from pyforms.Controls import ControlText
class WelcomeScreen(BaseWidget):
def __init__(self):
super(WelcomeScreen, self).__init__("TEST1")
self.testText = ControlText("WHERE IS THIS")
if __name__ == "__main__":
pyforms.startApp(WelcomeScreen) | Python | 0.000001 | @@ -237,16 +237,664 @@
%09%0A%09%09%0A%09%09%0A
+%09%09self.mainmenu = %5B%0A%09%09%09%7B 'Home': %5B%0A%09%09%09%09%09%7B'My Listings': self.__getlistingsEvent%7D,%0A%09%09%09%09%09'-',%0A%09%09%09%09%09%7B'My Orders': self.__getordersEvent%7D,%0A%09%09%09%09%09%7B'Settings': self.__getsettingsEvent%7D%0A%09%09%09%09... |
a6744443b32009027a22403974f3c7352c3335a6 | Add Python 2 line | kairbnb/preprocessing.py | kairbnb/preprocessing.py | """Utils used in the preprocessing stage."""
import pandas as pd
import numpy as np
from datetime import datetime
import holidays
from xgboost.sklearn import XGBClassifier
def one_hot_encoding(data, categorical_features):
"""Encode a list of categorical features using a one-hot scheme.
Parameters
------... | Python | 0.999996 | @@ -4252,16 +4252,130 @@
np.nan%0A%0A
+ # For Python 2 it's only needed to do:%0A # session%5B'most_used_device'%5D = user_session%5B'device_type'%5D.max()%0A%0A
# Gr
|
0f5defb5872f8f3d954d6df49f3ad4a73d7909d1 | Add StringTypeFactory class | dataproperty/_factory.py | dataproperty/_factory.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import abc
import six
from .converter import NopConverterCreator
from .converter import IntegerConverterCreator
from .converter import FloatConverterCreator
from .converter import BoolConverterCr... | Python | 0 | @@ -175,32 +175,78 @@
onverterCreator%0A
+from .converter import StringConverterCreator%0A
from .converter
@@ -463,32 +463,92 @@
eCheckerCreator%0A
+from ._type_checker_creator import StringTypeCheckerCreator%0A
from ._type_chec
@@ -1452,32 +1452,277 @@
rterCreator()%0A%0A%0A
+class StringTypeFactory(TypeConverte... |
e94f66f74f2f93f5d9b8f359a709000a3f529b36 | add mp image url | application/routes.py | application/routes.py | import json
import requests
from application import app
from application.utils import get_mp, constituency_extent, constituency_collection
from flask import render_template, request
from operator import itemgetter
@app.route('/', methods=["GET"])
def index():
return render_template('index.html')
@app.route('/peti... | Python | 0.000005 | @@ -1358,32 +1358,109 @@
rl'%5D = mp%5B'url'%5D
+%0A if 'image' in mp:%0A constituency%5B'mp_image'%5D = mp%5B'image'%5D
%0A%0A extents =
@@ -1511,35 +1511,8 @@
s)%0A%0A
- print sorted_countries%0A
|
c663ea69c8b810f7ffc9b330d50fa20427601332 | Update admin.py | apps/profile/admin.py | apps/profile/admin.py | from django.contrib import admin
from django.urls import reverse
from django.utils import html
from django.utils.encoding import force_text
from django.utils.translation import gettext_lazy as _
from apps.user.admin import UserAdmin as apps_UserAdmin
from apps.user.models import User
from .models import Profile,Profi... | Python | 0 | @@ -2330,12 +2330,19 @@
ange
-s
%25(
+profile_
imag
@@ -2362,16 +2362,24 @@
.') %25 %7B'
+profile_
image_na
|
2a4bc1a03bdd5bdca3bf00a30fe5e85c60ed151c | Add method to create mongo 3 monitors | dbaas_zabbix/provider.py | dbaas_zabbix/provider.py | # -*- coding: utf-8 -*-
import logging
LOG = logging.getLogger(__name__)
class ZabbixProvider(object):
__provider_name__ = None
__is_ha__ = None
__version__ = None
def __init__(self, dbaas_api, zabbix_api):
self.dbaas_api = dbaas_api
self.api = zabbix_api(dbaas_api.endpoint)
... | Python | 0 | @@ -879,16 +879,17 @@
ng datab
+a
se monit
@@ -974,32 +974,223 @@
tors(**kwargs)%0A%0A
+ def _create_mongo_three_monitors(self, **kwargs):%0A LOG.info(%22Creating mongo3 monitor with params: %7B%7D%22.format(kwargs))%0A return self.api.globo.createMongo3Monitors(**kwargs)%0A%0A
def _create_
|
2724a345c4a722f493425e2853e3a4ba3cbff8ff | Add a spot for the city. | appengine/models.py | appengine/models.py | """Model classes for SacTraffic."""
from datetime import datetime, timedelta
from google.appengine.ext import db
from google.appengine.api import memcache
class CHPData(db.Model):
"""Holds the last successful CHP data fetch."""
data = db.BlobProperty(required=True)
updated = db.DateTimeProperty(auto_now=True)
d... | Python | 0.000362 | @@ -952,32 +952,60 @@
GeoPtProperty()%0A
+%09city = db.StringProperty()%0A
%09updated = db.Da
|
1f5930b4ac9b91562768c01c8ff32ad6ceaa721e | Add docstring to app_engine_config.py | appengine_config.py | appengine_config.py | # appengine_config.py
from google.appengine.ext import vendor
# Add any libraries install in the "libs" folder.
vendor.add('libs')
| Python | 0.000001 | @@ -1,8 +1,253 @@
+%22%22%22 This module is used to add any third party libraries to%0A the project codebase. See the libs folder and the README file.%0A%0A This file is parsed when deploying the application or running the%0A local development server.%0A%22%22%22%0A%0A
# appeng
|
b0c4ac4d79b75db219a47f7f0081341d4098d49b | Correct mistake in docstring | src/SALib/sample/saltelli.py | src/SALib/sample/saltelli.py | from typing import Dict, Optional
import warnings
import numpy as np
import math
from . import common_args
from . import sobol_sequence
from ..util import (scale_samples, read_param_file,
compute_groups_matrix, _check_groups)
def sample(problem: Dict, N: int, calc_second_order: bool = ... | Python | 0.001974 | @@ -1180,26 +1180,27 @@
be a
- power
+n exponent
of
-2
and %3C
-=
%60sk
@@ -1388,22 +1388,26 @@
ust be a
- power
+n exponent
of 2).%0D
|
0c3d9395437c33263d3764614324ab95b9c31264 | Fix import in service forms | shuup/admin/modules/services/forms.py | shuup/admin/modules/services/forms.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms... | Python | 0 | @@ -510,17 +510,16 @@
rWidget%0A
-%0A
from shu
|
a9f940d8a20dc6ce9a7cae12a602e7d622040345 | Add support for device configuration URL to Nettigo Air Monitor integration (#57695) | homeassistant/components/nam/__init__.py | homeassistant/components/nam/__init__.py | """The Nettigo Air Monitor component."""
from __future__ import annotations
import logging
from typing import cast
from aiohttp import ClientSession
from aiohttp.client_exceptions import ClientConnectorError
import async_timeout
from nettigo_air_monitor import (
ApiError,
InvalidSensorData,
NAMSensors,
... | Python | 0 | @@ -3947,16 +3947,73 @@
CTURER,%0A
+ %22configuration_url%22: f%22http://%7Bself.host%7D/%22,%0A
|
579b1a2052959edc853bc8cfbbddd60c5c70a196 | use redis to lock updates | apps/updater/tasks.py | apps/updater/tasks.py | import json
from subprocess import Popen, PIPE, STDOUT
from celery.task import task
from django.conf import settings
import redisutils
def run(script):
p = Popen(script, stdout=PIPE, stderr=STDOUT, shell=True)
out, err = p.communicate()
return p.returncode, out, err
@task(ignore_result=True)
def update... | Python | 0 | @@ -378,16 +378,72 @@
master'%5D
+%0A lock = redis.lock('updater.%25s' %25 name, timeout=300)
%0A%0A tr
@@ -531,16 +531,91 @@
return%0A%0A
+ if not lock.acquire(False):%0A update_app.retry()%0A return%0A%0A
scri
@@ -1012,8 +1012,27 @@
ting.%22)%0A
+ lock.release()%0A
|
7fc57f554dc199564cd66257078a9d67180a61f6 | Add a match word. | word_match.py | word_match.py | # -*- coding: utf-8 -*-
import re
def word_check(check_word):
# Not process case
# => TODO this function
if check_word == "。":
return True
elif check_word == "、":
return True
elif check_word == " ":
return True
elif check_word == "":
return True
elif check_w... | Python | 0.999665 | @@ -355,16 +355,148 @@
el
-se:%0A
+if check_word == %22%E3%83%BB%22:%0A return True%0A elif check_word == %22!%22:%0A return True%0A elif check_word == %22?%22:%0A return True%0A%0A%0A
|
8b331a126d15665e22004304eb8c8b34e248b736 | Add images to articles | apps/blog/models.py | apps/blog/models.py | import os.path
import datetime
# Django
from django.conf import settings
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager
from ... | Python | 0 | @@ -833,16 +833,133 @@
_saved%0A%0A
+def article_file_path(instance=None, filename=None):%0A return os.path.join('article', str(instance.id), filename)%0A%0A
# Blog a
@@ -1503,16 +1503,112 @@
itle')%0A%0A
+ image = ThumbnailerImageField(max_length=255, upload_to=article_file_path, blank=True) %0A%0A
co... |
e3b67d9129f41838943a34c26886863483d414f4 | refactor test_catalog | keystone/tests/test_catalog.py | keystone/tests/test_catalog.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | Python | 0.000007 | @@ -737,16 +737,43 @@
357/v2'%0A
+SERVICE_FIXTURE = object()%0A
%0A%0Aclass
@@ -1781,28 +1781,371 @@
00,
-missing_param=None):
+service_id=SERVICE_FIXTURE,%0A publicurl='http://localhost:8080',%0A internalurl='http://localhost:8080',%0A adminu... |
8049b38cc7c89d6f0974259d5a6b9efff82abc77 | Add ability to debug json output | apps/maps/mixins.py | apps/maps/mixins.py | #
# Copyright (C) 2017 Dr. Maha Farhat
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is di... | Python | 0.000003 | @@ -906,16 +906,76 @@
uerySet%0A
+from django.template.response import SimpleTemplateResponse%0A
from dja
@@ -2285,32 +2285,103 @@
_timeout(self):%0A
+ %22%22%22Return the amount of time this data should be cached for%22%22%22%0A
return s
@@ -2432,32 +2432,97 @@
rgs, **kwargs):%0A
+ %22%22%22... |
13b602c50f3be62b2a3a8b267ba00b685fc0c7fe | Update data migration with new CPS description | python/ecep/portal/migrations/0011_auto_20160518_1211.py | python/ecep/portal/migrations/0011_auto_20160518_1211.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def populate_enrollment_info(apps, schema_editor):
"""
Populate the Enrollment info based on static text
"""
Location = apps.get_model('portal', 'Location')
for loc in Location.objects.all():... | Python | 0 | @@ -385,491 +385,448 @@
%22%3Cp%3E
-Visit a child-friendly location near you:%3C/p%3E%3Cul%3E%3Cli%3E%3Cstrong%3ELoop%3C/strong%3E 42 W. Madison Street Hours: 9:00 AM - 5:00 PM%3C/li%3E%3Cli%3E%3Cstrong%3EColman%3C/strong%3E 4655 S. Dearborn Street Hours: 9:00 AM - 5:00 PM%3C/li%3E%3Cli%3E%3Cstrong%3EHall Mall%3C/stro... |
d37090701513868dfd573ce0ca4cb0e3d0f303d3 | Remove South-related code | base/models.py | base/models.py | import os
from django.contrib.auth.models import User
from django.conf import settings
from django_comments.signals import comment_was_posted
from django.forms import forms
from django.db.models import FileField
from django.dispatch import receiver
from django.template.defaultfilters import filesizeformat
from django.... | Python | 0.000004 | @@ -2172,380 +2172,8 @@
s)%0A%0A
-# Add ContentTypeRestrictedFileField to South introspection rules%0Afrom south.modelsinspector import add_introspection_rules%0Aadd_introspection_rules(%5B%5D, %5B%22%5Ebase%5C.models%5C.ContentTypeRestrictedFileField%22%5D)%0A%0A# Add Photologue related introspection rules%0Aadd_intr... |
a66a6bb3f4ba6db11a762e44621c6752b4f9f5ca | Fix for Window.onError not using $pyjs | library/pyjamas/platform/WindowPyJS.py | library/pyjamas/platform/WindowPyJS.py |
def setOnError(onError):
if (not callable(onError)):
raise TypeError("object is not callable")
JS("""\
$wnd.onerror=function(msg, url, linenumber){
return onError(msg, url, linenumber);
}
""")
def onError(msg, url, linenumber):
dialog=JS("""$doc.createElement("div")""")
dia... | Python | 0.000007 | @@ -270,26 +270,21 @@
dialog=
-JS(%22%22%22$
doc
+()
.createE
@@ -296,20 +296,16 @@
t(%22div%22)
-%22%22%22)
%0A dia
@@ -344,16 +344,22 @@
# Note:
+$pyjs.
tracksta
@@ -360,19 +360,16 @@
ackstack
-str
is a gl
@@ -423,16 +423,26 @@
tackstr(
+JS(%22$pyjs.
tracksta
@@ -455,16 +455,18 @@
ce(0,-1)
+%22)
)%... |
da845cfaa37a4d7a5eddf4c245eaeb35ec5fecb8 | update feature expression test to new feature attr api that will throw if attr is not found | tests/python_tests/feature_test.py | tests/python_tests/feature_test.py | #encoding: utf8
import itertools
import unittest
from nose.tools import *
import mapnik
from binascii import unhexlify
def test_default_constructor():
f = mapnik.Feature(mapnik.Context(),1)
eq_(f is not None,True)
def test_python_extended_constructor():
context = mapnik.Context()
context.push('foo')
... | Python | 0 | @@ -2058,58 +2058,166 @@
e
-valuated = expr.evaluate(f)%0A eq_(evaluated,Fals
+q_(f.has_key('fielddoesnotexist'),False)%0A try:%0A evaluated = expr.evaluate(f)%0A except Exception, e:%0A eq_(%22Key does not exist%22 in str(e),Tru
e)%0A
|
b7bceab4e56317de717c171740b0758f0461f975 | Change room description from chat command | smserver/chat_commands/room_update.py | smserver/chat_commands/room_update.py | #!/usr/bin/env python3
# -*- coding: utf8 -*-
from smserver import ability
from smserver.chatplugin import ChatPlugin
from smserver.controllers.enter_room import EnterRoomController
class ChatMaxUsers(ChatPlugin):
command = "maxusers"
helper = "Set nb_max of users (0 to 255)."
room = True
permission =... | Python | 0 | @@ -1095,16 +1095,372 @@
ssage)%0A%0A
+%0Aclass ChatDescription(ChatPlugin):%0A command = %22description%22%0A helper = %22Update room description%22%0A room = True%0A permission = ability.Permissions.change_room_settings%0A%0A def __call__(self, serv, message):%0A serv.room.description = message... |
8b0c922ec11d7e7e0d59f9e68d4691bc5e46af20 | Fix OZP drought process | apps/mc/settings.py | apps/mc/settings.py | # mandatory, dictionary, at least one topic must be specified
TOPICS = {
# common.Topic.name_id, dictionary, at least one property must be specified
# topic represents an emergency situation, e.g. drought or floods
'drought': {
# dictionary of properties related to the topic
# mandatory, at... | Python | 0.001049 | @@ -1074,39 +1074,69 @@
'process': '
-measure
+apps.common.aggregate.arithmetic_mean
'%0A
|
0ff8211cd69d3c957c09e95f612eb842f1edb335 | add comment | tests/syft/lib/numpy/array_test.py | tests/syft/lib/numpy/array_test.py | # third party
import numpy as np
import pytest
# syft absolute
import syft as sy
ExampleArray = [
np.array([1, 2, -3], dtype=np.int8),
np.array([1, 2, -3], dtype=np.int16),
np.array([1, 2, -3], dtype=np.int32),
np.array([1, 2, -3], dtype=np.int64),
np.array([1, 2, 3], dtype=np.uint8),
# np.arr... | Python | 0 | @@ -638,24 +638,87 @@
complex64),%0A
+ # np.array(%5B1 + 2j, 3 + 4j, 5 + 0j%5D, dtype=np.complex128),%0A
np.array
|
367a77a3ffd02cd92bc6885ab242193934abc38a | Simplify observation monitor script | obs_monitor/monitor.py | obs_monitor/monitor.py | #!/usr/bin/env python3
"""This is a small program for monitoring observations and alerting a maintainer
if observations are not received within a specified time."""
import argparse
import configparser
import smtplib
import ssl
import sys
from datetime import datetime
from email.mime.text import MIMEText
from os.path i... | Python | 0 | @@ -214,19 +214,8 @@
lib%0A
-import ssl%0A
impo
@@ -1013,51 +1013,8 @@
'%5D%0A%0A
- context = ssl.create_default_context()%0A
@@ -1030,16 +1030,12 @@
-server =
+with
smt
@@ -1068,71 +1068,25 @@
er'%5D
-,%0A port=465, context=context)%0A
+) as server:%0A
@@... |
c2b1ba76beebef7030ee1a9a063db95cd843674f | Update venv | snipsskills/commands/install/skill.py | snipsskills/commands/install/skill.py | # -*-: coding utf-8 -*-
import os
from ..base import Base
from ...utils.pip_installer import PipInstaller
from snipsskillscore import pretty_printer as pp
class SkillInstallerException(Exception):
pass
class SkillInstallerWarning(Exception):
pass
class SkillInstaller(Base):
def run(self, force_d... | Python | 0.000001 | @@ -795,34 +795,32 @@
rt()%0A
+ #
try:%0A
-
PipI
@@ -879,36 +879,32 @@
wnload)%0A
-
-
message.done()%0A
@@ -901,32 +901,34 @@
e.done()%0A
+ #
except Exceptio
@@ -938,24 +938,26 @@
s e:%0A
+ #
message
@@ -968,24 +968,26 @@
or()%0A
+ #
raise S
|
ee90073152bb3e147fa619d91d3cb74ee7bc47e9 | Add dequeue method | array/create-queue.py | array/create-queue.py | # Create queue using a list
class Queue:
def __init__(self, head=None):
self.storage = [head]
def enqueue(self, new_element):
self.storage.append(new_element)
| Python | 0.000003 | @@ -160,8 +160,58 @@
lement)%0A
+%0A%09def dequeue(self):%0A%09%09return self.storage.pop(0)%0A
|
0cf661353e894c80f1fd107ec482dadf5317c34b | update to pandas for csv read/write | obztak/utils/fileio.py | obztak/utils/fileio.py | #!/usr/bin/env python
"""
Deal with file input/output.
"""
import os,pwd
from os.path import splitext, exists, join
from collections import OrderedDict as odict
import subprocess
from matplotlib import mlab
import numpy as np
import json
import logging
from obztak import __version__
from obztak.utils.constants import... | Python | 0 | @@ -177,43 +177,34 @@
ss%0A%0A
-from matplotlib import mlab
+import numpy as np
%0Aimport
nump
@@ -195,35 +195,36 @@
s np%0Aimport
-numpy
+pandas
as
-n
p
+d
%0Aimport json
@@ -848,470 +848,82 @@
th%0A%0A
-class FormatFloatForce(mlab.FormatFormatStr): %0A %22%22%22%0A mlab not doing well...%0A %22%2... |
6f94526a2cbc5acbc60e869c2cce88707df6ada5 | update after StructIntf implementation | hwtLib/samples/iLvl/axi/simpleAxiRegs.py | hwtLib/samples/iLvl/axi/simpleAxiRegs.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import If, connect
from hwt.hdlObjects.typeShortcuts import vecT
from hwt.interfaces.utils import addClkRstn, propagateClkRstn
from hwt.synthesizer.interfaceLevel.unit import Unit
from hwt.synthesizer.param import Param
from hwtLib.amba.axiLite import AxiLit... | Python | 0 | @@ -1654,16 +1654,24 @@
or(conv.
+decoded.
reg0, re
@@ -1708,16 +1708,24 @@
or(conv.
+decoded.
reg1, re
@@ -1852,9 +1852,4 @@
u))%0A
- %0A
|
327fa87b7b6f2ac204312918c27d5437080e600e | make pretty | soccer/gameplay/positions/position.py | soccer/gameplay/positions/position.py | # See PEP 0563 : Enabling the future behavior in Python 3.7
# In this current version, it is not allowed to have a return
# type of the current class, which has not fully been defined yet
# pylint: disable=no-name-in-module
from __future__ import annotations # type: ignore
import robocup
import single_robot_composite_... | Python | 0.000004 | @@ -252,16 +252,17 @@
tations
+
# type:
@@ -896,16 +896,17 @@
ons = %5B%5D
+
# type:
|
a968156d8a96cd4685c3973657b368d8f310ea74 | Add docstring | basicclient.py | basicclient.py | #An EXTREMELY basic client for W.I.L.L., mainly used for light debugging
import easygui
import urllib
import sys
def main(command):
command=urllib.urlencode({"command":command})
answer=urllib.urlopen("http://127.0.0.1:5000?context=command&%s"%command).read()
easygui.msgbox(answer)
while True:
command=easygui.enterb... | Python | 0.000005 | @@ -125,16 +125,71 @@
mmand):%0A
+%09'''A basic debugging oriented client using easygui'''%0A
%09command
|
b286e03f96cce8518dd60b74ff8dac6d7b7c5a97 | Support users with no name | octohatrack/helpers.py | octohatrack/helpers.py | #!/usr/bin/env python
import sys
def display_results(repo_name, contributors, api_len):
"""
Fancy display.
"""
print("\n")
print("All Contributors:")
# Sort and consolidate on Name
seen = []
for user in sorted(contributors, key=lambda k: k['name'].lower()):
if user["name"] ... | Python | 0.000032 | @@ -29,16 +29,162 @@
t sys%0A%0A%0A
+def _sort_by_name(contributor):%0A if contributor.get('name'):%0A return contributor%5B'name'%5D.lower()%0A%0A return contributor%5B'user_name'%5D%0A%0A%0A
def disp
@@ -409,61 +409,148 @@
key=
-lambda k: k%5B'name'%5D.lower()):%0A if user%5B%22name%22%5D
+_sor... |
e59118b9f72d060b6386301a984989ee7bb195eb | Remove an unused import | code/mkiccp.py | code/mkiccp.py | #!/usr/bin/env python
# $URL$
# $Rev$
# Make ICC Profile
# References
#
# [ICC 2001] ICC Specification ICC.1:2001-04 (Profile version 2.4.0)
# [ICC 2004] ICC Specification ICC.1:2004-10 (Profile version 4.2.0.0)
import struct
# Local module.
import iccp
def black(m):
"""Return a function that maps all values fr... | Python | 0.000001 | @@ -211,23 +211,8 @@
0)%0A%0A
-import struct%0A%0A
# Lo
|
a6bdf63816243b00c9f463b174886538b3705b91 | Update addons version | l10n_ch_base_bank/__openerp__.py | l10n_ch_base_bank/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by t... | Python | 0.000001 | @@ -1495,17 +1495,17 @@
on': '1.
-1
+2
',%0A 'aut
|
1c883c1931dbadc2b786db1d11968908f9b3201f | Fix broken SQL | src/ctf_gameserver/controller/database.py | src/ctf_gameserver/controller/database.py | from ctf_gameserver.lib.database import transaction_cursor
from ctf_gameserver.lib.date_time import ensure_utc_aware
from ctf_gameserver.lib.exceptions import DBDataError
def get_control_info(db_conn, prohibit_changes=False):
"""
Returns a dictionary containing relevant information about the competion, as sto... | Python | 0 | @@ -1262,16 +1262,21 @@
ice.id,
+team.
user_id,
@@ -1276,16 +1276,24 @@
ser_id,
+control.
current_
@@ -1365,21 +1365,16 @@
uth_user
- user
, regist
@@ -1384,16 +1384,21 @@
ion_team
+ team
,'%0A
@@ -1436,32 +1436,40 @@
ring_gamecontrol
+ control
'%0A
@@ -1488,16 +1488,21 @@
WHERE
+auth... |
dae04019a892d5329e9eb34a1a90921a029393f1 | Exclude inactive accounts | halalar/api/views.py | halalar/api/views.py | from braces.views import CsrfExemptMixin, JSONResponseMixin
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from django.utils.decorators import method_decorator
from .forms import UserForm, Profile... | Python | 0.000352 | @@ -2287,16 +2287,38 @@
Profile,
+ user__is_active=True,
token=g
@@ -2367,16 +2367,16 @@
oken'))%0A
-
%0A
@@ -2626,32 +2626,61 @@
Profile.objects.
+filter(user__is_active=True).
exclude(gender=p
@@ -3585,16 +3585,56 @@
le.sent.
+filter(recipient__user__is_active=True).
values_l
@@ -3718,16 +3718,53 @@
... |
75ac016e2bd39060d14a302292546d9dbc49f6a2 | Bump version (#3787) | python/ray/__init__.py | python/ray/__init__.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
if "pyarrow" in sys.modules:
raise ImportError("Ray must be imported before pyarrow because Ray "
"requires a specific version of pyarrow (which is "
... | Python | 0 | @@ -2587,17 +2587,17 @@
= %220.6.
-1
+2
%22%0A%0A__all
|
ac2f37f88475998197d619a584824e9c2c30eea1 | Update __init__.py | plantcv/plantcv/transform/__init__.py | plantcv/plantcv/transform/__init__.py | from plantcv.plantcv.transform.color_correction import get_color_matrix
from plantcv.plantcv.transform.color_correction import get_matrix_m
from plantcv.plantcv.transform.color_correction import calc_transformation_matrix
from plantcv.plantcv.transform.color_correction import apply_transformation_matrix
from plantcv.pl... | Python | 0.000072 | @@ -1041,16 +1041,82 @@
rp_align
+%0Afrom plantcv.plantcv.transform.gamma_correct import gamma_correct
%0A%0A__all_
@@ -1466,10 +1466,27 @@
p_align%22
+, %22gamma_correct%22
%5D%0A
|
164ae2bcbc1dfde2b7e2fd745553bb4a86ff431f | Extend system info with Python and PIO Core executables // Issue #3521 | platformio/commands/system/command.py | platformio/commands/system/command.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -1900,32 +1900,345 @@
(%22core%22),%0A %7D%0A
+ data%5B%22platformio_exe%22%5D = %7B%0A %22title%22: %22PlatformIO Core Executable%22,%0A %22value%22: proc.where_is_program(%0A %22platformio.exe%22 if proc.WINDOWS else %22platformio%22%0A ),%0A %7D%0A data%5B%22python_exe... |
b044a81ea53f4cfb4f31726e728a049d789fa9bb | check that newly created search channels are in Requests.Channels | tests/twisted/search/unextended.py | tests/twisted/search/unextended.py | """
Tests Contact Search channels to a simulated XEP-0055 service, without
extensibility via Data Forms
"""
import dbus
from twisted.words.protocols.jabber.client import IQ
from gabbletest import exec_test, sync_stream
from servicetest import call_async, unwrap, make_channel_proxy, EventPattern
from search_helper im... | Python | 0 | @@ -1565,24 +1565,222 @@
mat(props)%0A%0A
+ # check that channel is listed in Requests.Channels%0A channels = conn.Get(cs.CONN_IFACE_REQUESTS, 'Channels',%0A dbus_interface=cs.PROPERTIES_IFACE)%0A assert (path, props) in channels%0A%0A
c = make
|
b19eefc63e9bcc59120fe7164fa97f30fb8324e7 | Add static root | gotosite/settings.py | gotosite/settings.py | """
Django settings for event_calendar project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
im... | Python | 0.000003 | @@ -3986,16 +3986,47 @@
E_ID = 1
+%0ASTATIC_ROOT = '/root/gotosite'
%0A%0AEMAIL_
|
3bfa4e5ecae7aeafd8760843df682a0727c07c74 | disable debug setting on templates | democracy/settings_ch.py | democracy/settings_ch.py | # Django settings for democratiespel project.
from settings import *
import os.path
import os
import sys
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.split(PROJECT_PATH)[0] + '/external_apps/' )
BASE_PATH = os.path.dirname(__file__)
DEBUG = False
SERVER_EMAIL = 'reinder@rustema... | Python | 0.000001 | @@ -280,16 +280,80 @@
= False
+%0ATEMPLATE_DEBUG = False # on production this should be disabeled
%0A%0ASERVER
|
8e747655f08fb56bcdd5b272c2b3a659afe228a9 | Add cors headers to the signing servlet | sydent/http/servlets/blindlysignstuffservlet.py | sydent/http/servlets/blindlysignstuffservlet.py | # -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# 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 l... | Python | 0 | @@ -792,16 +792,37 @@
ire_args
+, jsonwrap, send_cors
%0A%0A%0Aclass
@@ -1031,16 +1031,42 @@
quest):%0A
+ send_cors(request)
%0A
@@ -2171,8 +2171,144 @@
signed)%0A
+%0A @jsonwrap%0A def render_OPTIONS(self, request):%0A send_cors(request)%0A request.setResponseCode(200)%0A ... |
a7c9fd9fde9e4d6725a15d14b620aa933ace4faa | fix param name | lambdas/index_html/index_html.py | lambdas/index_html/index_html.py | import boto3
import json
import os
import random
import re
import requests
import string
local = os.getenv('IS_LOCAL', "false")
client = boto3.client('dynamodb', endpoint_url='http://localhost:8001', region_name='us-east-1') if local == "true" else boto3.client('dynamodb')
def state_generator(size=32, chars=string.as... | Python | 0.000505 | @@ -2642,22 +2642,16 @@
event%5B'
-param_
access_t
@@ -2688,14 +2688,8 @@
nt%5B'
-param_
stat
|
d6f0bcaf272592dae046aa2d4fbf0e304da73d8e | fix bug | launch.py | launch.py | # coding: utf-8
'''
'''
import os.path
import tornado.web
import tornado.httpserver
import tornado.database
import tornado.options
import tornado.ioloop
from tornado.options import define, options
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from apps.loud import Lou... | Python | 0.000001 | @@ -1147,20 +1147,8 @@
dler
-, %7B%7D, 'loud'
),%0A
@@ -1306,20 +1306,8 @@
dler
-, %7B%7D, 'user'
),%0A
|
0566f69d12c80dfb50be20da5352f14457d00819 | fix the ptoblem about the observed monomass and calculated monomass, tagDTASelect.py | python/tagDTASelect.py | python/tagDTASelect.py | #!/usr/bin/env python
#
# tag each peptide line in DTASelect output file with its IPI name at beginning
import sys
from sys import argv
if len(argv) != 2:
print 'Usage: %s <DTASelect-filter.txt>'%argv[0]
print 'tag each peptide line in DTASelect output file with its IPI name at beginning'
sys.exit(-1)
##... | Python | 0.000001 | @@ -1470,16 +1470,22 @@
%09%09%09%09%09if
+float(
linespli
@@ -1492,11 +1492,18 @@
t%5B6%5D
+)
%3C
+float(
line
@@ -1510,17 +1510,89 @@
split%5B5%5D
-:
+) + 0.5 :%0A%09%09%09%09%09%09print float(linesplit%5B6%5D)%0A%09%09%09%09%09%09print float(linesplit%5B5%5D)
%0A%09%09%09%09%09%09f
|
6dc5d39f5fb075a5a810e18506a714d89a57a016 | Change the ipython printing test to use init_printing(). | sympy/interactive/tests/test_ipythonprinting.py | sympy/interactive/tests/test_ipythonprinting.py | """Tests that the IPython printing module is properly loaded. """
from sympy.interactive.session import init_ipython_session
from sympy.external import import_module
# run_cell was added in IPython 0.11
ipython = import_module("IPython", min_module_version="0.11")
# disable tests if ipython is not present
if not ipy... | Python | 0.000222 | @@ -1160,51 +1160,73 @@
ll(%22
-%25load_ext sympy.interactive.ipython
+from sympy import init_printing%22)%0A app.run_cell(%22init_
printing
%22)%0A
@@ -1217,24 +1217,26 @@
nit_printing
+()
%22)%0A # Pri
|
1ba6f53fb0503f9443f13e5affea70c244ee98d1 | update to use the algorithm class | launch.py | launch.py | import os.path
import pickle
from files import Inverted_File, Reader
file_path = "latimes/la100590"
pickle_path = "pickles/la100590"
if os.path.isfile(pickle_path):
with open(pickle_path, "rb") as file:
inv_file = pickle.load(file)
else:
documents = Reader.read_file(file_path)
print("Number of ... | Python | 0 | @@ -45,25 +45,24 @@
ort Inverted
-_
File, Reader
@@ -61,16 +61,59 @@
, Reader
+%0Afrom algorithm import SimpleScanAlgorithm
%0A%0Afile_p
@@ -424,17 +424,16 @@
Inverted
-_
File(doc
@@ -609,16 +609,51 @@
erm)))%0A%0A
+algorithm = SimpleScanAlgorithm()%0A%0A
while Tr
@@ -752,27 +752,44 @@
s =
-inv_file.scan(que... |
55c2e927af04726a316cf5d003fb0b6a888d4ec8 | handle special GEE columns with pandas | bin/atmcorr.py | bin/atmcorr.py | """
atmcorr.py, Sam Murphy (2017-04-25)
Atmospheric correction of satellite image collections in
Google Earth Engine (GEE).
Usage
-----
Please see the jupyter notebook for detailed usage:
https://github.com/samsammurphy/gee-atmcorr-S2-batch
"""
import ee
import sys
import os
from atmospheric import Atmospheric
fro... | Python | 0 | @@ -1446,16 +1446,21 @@
mcorr_'+
+time.
strftime
@@ -1669,24 +1669,471 @@
urn task%0A %0A
+ def handle_GEE_columns(df):%0A %22%22%22%0A Handles special GEE column names: 'system:index' and '.geo'%0A%0A df = pandas.DataFrame (from reading GEE .csv)%0A %22%22%22%0A %0A # remove system:index column%... |
9128d9032dac95128a01f60ef62b448e8e807a27 | Optimise collegehumor.py | mediaembedder/services/collegehumor.py | mediaembedder/services/collegehumor.py | services = []
def collegehumor(self):
id = self.match.group('collegehumor_id')
if self.width:
width = self.width
else:
try:
width = int(self.data['meta']['og:video:width'])
except:
width = 640
if self.height:
height = self.height
else:
... | Python | 0.000415 | @@ -77,16 +77,49 @@
or_id')%0A
+ width = 640%0A height = 360%0A
if s
@@ -162,37 +162,58 @@
h%0A el
-se:%0A try:%0A
+if 'og:video:width' in self.data%5B'meta'%5D:%0A
@@ -265,48 +265,8 @@
'%5D)%0A
- except:%0A width = 640%0A
@@ -320,29 +320,51 @@
el
-se:%0A... |
027c6c696ef8c58856806eb916c85f9fde97f758 | Update FA icons. | horizon_contrib/tables/filters.py | horizon_contrib/tables/filters.py |
from datetime import datetime
from django.utils.safestring import SafeString
def timestamp_to_datetime(value):
return datetime.fromtimestamp(value)
def nonbreakable_spaces(value):
return SafeString(value.replace(' ', ' '))
def unit_times(value):
return SafeString('%s%s' % (value, '×'))
... | Python | 0 | @@ -755,17 +755,20 @@
e fa fa-
-o
+chec
k%5C%22%3E%3C/i%3E
@@ -825,14 +825,13 @@
fa-
-remove
+times
%22%3E%3C/
|
d4f630be03dfbea93d3c13418e9d4ebe78ac1ebe | Improve ping | cogs/useful.py | cogs/useful.py | import asyncio
import time
from datetime import datetime
from collections import Counter
from discord.ext import commands
from cogs.utils import checks
class Useful:
def __init__(self, liara):
self.liara = liara
self.event_counter = Counter()
@commands.command()
async def ping(self, ctx... | Python | 0.000009 | @@ -261,16 +261,322 @@
nter()%0A%0A
+ @staticmethod%0A async def timeit(coro):%0A %22%22%22Times a coroutine.%22%22%22%0A before = time.monotonic()%0A coro_result = await coro%0A after = time.monotonic()%0A return after - before, coro_result%0A%0A @staticmethod%0A def for... |
49fca2ee989929cbfd24cf8c0c87df4e47885edf | fix bug of config.py | bgmi/config.py | bgmi/config.py | # coding=utf-8
from __future__ import unicode_literals
import os
import sys
try:
import ConfigParser as configparser
except ImportError:
import configparser
__all__ = ('DMHY_URL', 'BGMI_PATH', 'DB_PATH', 'BGMI_SAVE_PATH',
'BGMI_LX_PATH', 'DOWNLOAD_DELEGATE', 'CONFIG_FILE_PATH',
'DETAIL_... | Python | 0 | @@ -1535,24 +1535,37 @@
mi', i, v)%0A%0A
+ try:%0A
c.write(
@@ -1593,16 +1593,93 @@
, 'w'))%0A
+ except IOError:%0A print('%5B-%5D write config file error and ignored')%0A
%0A%0Adef wr
|
af4cdf089dab6e5085fd5d7e5b695e51305dad3f | Fix gate job for test_vnf_param_with_artifacts_image_tosca_template | tacker/tests/functional/vnfm/test_vnfm_param.py | tacker/tests/functional/vnfm/test_vnfm_param.py | # Copyright 2015 Brocade Communications System, 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 ... | Python | 0.000007 | @@ -621,16 +621,32 @@
cense.%0A%0A
+import unittest%0A
import y
@@ -4627,24 +4627,64 @@
template')%0A%0A
+ @unittest.skip(%22Until BUG 1847188%22)%0A
def test
|
b88ac062554e298ab2b9de6300754007d8a25096 | change timedelta to minutes | APControl.py | APControl.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""APControl.py
control system actuators and log states
dependencies:
actuator modules
"""
from actuators import relais, trans433, defaultState
from dbControl import dbLog
import sqlite3 as lite
import time, datetime
from datetime import timedelta
import sys, traceback
de... | Python | 0.000805 | @@ -6053,38 +6053,38 @@
%5B1%5D + timedelta(
-second
+minute
s=duration*60)%0A
@@ -6077,19 +6077,16 @@
duration
-*60
)%0A
@@ -6197,22 +6197,22 @@
medelta(
-second
+minute
s=increm
@@ -6214,19 +6214,16 @@
ncrement
-*60
)%0A
@@ -7361,12 +7361,13 @@
:%0A main()
+%0A
|
c64d3f5701ee9e228d53f4228327ca2392fbb305 | Update repo created event | polyaxon/event_manager/events/repo.py | polyaxon/event_manager/events/repo.py | from event_manager import event_actions, event_subjects
from event_manager.event import Attribute, Event
REPO_CREATED = '{}.{}'.format(event_subjects.REPO, event_actions.CREATED)
REPO_DOWNLOADED = '{}.{}'.format(event_subjects.REPO, event_actions.DOWNLOADED)
REPO_NEW_COMMIT = '{}.new_commit'.format(event_subjects.REPO... | Python | 0.000001 | @@ -502,32 +502,78 @@
ject.user.id'),%0A
+ Attribute('external', attr_type=bool)%0A
)%0A%0A%0Aclass Re
|
9c47519a8327640124adf27e23c80327269ad745 | Tweak allocator | thinc/backends/_cupy_allocators.py | thinc/backends/_cupy_allocators.py | from typing import cast
from ..types import ArrayXd
from ..util import tensorflow2xp
try:
import tensorflow
except ImportError:
pass
try:
import torch
except ImportError:
pass
try:
from cupy.cuda.memory import MemoryPointer
from cupy.cuda.memory import UnownedMemory
except ImportError:
p... | Python | 0.000002 | @@ -159,16 +159,38 @@
t torch%0A
+ import torch.cuda%0A
except I
@@ -1759,16 +1759,21 @@
= torch.
+cuda.
FloatSto
@@ -1800,15 +1800,8 @@
/ 4)
-.cuda()
%0A
|
7ec29c392a49c6ad4c2a7d2501d12c85c2480242 | insert data into mysql database | log-reader/log/LogDatabase.py | log-reader/log/LogDatabase.py | from simplemysql import SimpleMysql
class LogDatabase:
def __init__(self, **keyVals):
# saving database parameters
self.dbParams = keyVals
# table information
self.tablesPrefix = 'zipkin_'
self.tables = ['spans', 'annotations']
# connect to database
self.db... | Python | 0.000311 | @@ -196,25 +196,24 @@
self.table
-s
Prefix = 'zi
@@ -783,16 +783,20 @@
f, table
+Name
, rows):
@@ -808,31 +808,40 @@
-print %22Table: %22
+table = self.tablePrefix
+ table
%0A
@@ -836,16 +836,20 @@
+ table
+Name
%0A
@@ -853,18 +853,127 @@
-print rows
+if len(rows) %3E 0:%0A ... |
b4d350e165fe7351cdb0ce1fc03e992da89cd185 | Make the ship shut up | src/server/Ship.py | src/server/Ship.py | from Entity import Entity
from Component import *
from Missile import Missile
import sys
class Ship(Entity):
def __init__(self, config, universe):
super().__init__(config, universe)
self.__dict__.update(config)
self.energy = self.maxEnergy
# How much power Engineering is giving to each component - ... | Python | 0.000029 | @@ -1338,89 +1338,8 @@
or%0A%0A
- print(%22Consumed%22, totalNeeded * factor, %22power this tick; now%22, self.energy)%0A
@@ -1438,63 +1438,8 @@
%5Bi%5D%0A
- #print(%22Gave %22, i.energy, %22 power to %22, type(i))%0A
|
90e62a41b49a978b4bea3a5af87d26ef1fb23009 | Fix namespacing when retrieving remote URIs | combine/uri.py | combine/uri.py | # Copyright (c) 2010 John Reese
# Licensed under the MIT license
import urllib2
import urlparse
from combine import Package, File
class URI:
def __init__(self, uri, package=None, format=None, target=None):
self.uri = uri
self.parse = urlparse.urlparse(uri)
self.package = package
... | Python | 0.00001 | @@ -1063,16 +1063,21 @@
urlopen(
+self.
uri)%0A%0A
|
bab312c7723cdd759de1a27f4a4e5b5861af66aa | Update splitpath for new root-finding method | libsass/project.py | libsass/project.py | import json
from .pathutils import subpaths, mkdir_p
import os
import re
import sublime
def settings():
return sublime.load_settings("Libsass Build.sublime-settings")
def user_opts():
'''Get global config from Default/User Preferences.sublime-settings'''
s = settings()
opts = {
'output_dir... | Python | 0 | @@ -1807,24 +1807,46 @@
onfig(path)%0A
+ if opts_path:%0A
root = o
@@ -1869,20 +1869,53 @@
pts_path
- or
+)%0A else:%0A root = find_root(
path)%0A
|
122e160ce009d2462af4282408b85637f1341853 | Fix URL in documentation | pywikibot/xmlreader.py | pywikibot/xmlreader.py | # -*- coding: utf-8 -*-
"""
Each XmlEntry object represents a page, as read from an XML source
The XmlDump class reads a pages_current XML dump (like the ones offered on
http://download.wikimedia.org/wikipedia/de/) and offers a generator over
XmlEntry objects which can be used by other bots.
"""
#
# (C) Pywikibot te... | Python | 0.999996 | @@ -178,15 +178,12 @@
://d
-ownload
+umps
.wik
@@ -197,21 +197,25 @@
org/
-wikipedia/de/
+backup-index.html
) an
|
d14454e59f6ba6b2f7f2227e1a22e67c392c944e | make pyxl work when using codecs.decode in addition to codecs.streamreader | pyxl/codec/register.py | pyxl/codec/register.py | #!/usr/bin/env python
#
# 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, softwar... | Python | 0.000002 | @@ -705,162 +705,40 @@
ze%0A%0A
-class PyxlStreamReader(utf_8.StreamReader):%0A def __init__(self, *args, **kwargs):%0A codecs.StreamReader.__init__(self, *args, **kwargs)%0A%0A
+def pyxl_transform(stream):%0A
-
try:
@@ -750,16 +750,14 @@
- data
+output
= t
@@ -789,21 +789,16 @@
okeniz... |
a6f55e0238ce2c1de69b10424ee92724d8a623af | Add base class for InferenceError | i2vbot/bot.py | i2vbot/bot.py | #!/usr/bin/env python2
import importlib
import re
import string
import tempfile
import telepot
import config
import messages
import settings
handlersList = []
for i in config.HANDLERS:
try:
m = importlib.import_module("." + i, "handlers")
handlersList.append(m)
except ImportError as e:
... | Python | 0 | @@ -427,16 +427,25 @@
ceError(
+Exception
):%0A d
|
45382b9c6eb27ff5629f61619ab25716fac7caab | remove unused deprecated import | hawkmoth/__init__.py | hawkmoth/__init__.py | # Copyright (c) 2016-2017, Jani Nikula <jani@nikula.org>
# Licensed under the terms of BSD 2-Clause, see LICENSE for details.
"""
Hawkmoth
========
Sphinx C Domain autodoc directive extension.
"""
import glob
import os
import re
import stat
import subprocess
import sys
from docutils import nodes, statemachine
from d... | Python | 0 | @@ -409,55 +409,8 @@
ist%0A
-from sphinx.ext.autodoc import AutodocReporter%0A
from
|
a65a27e673dd46f77391d82e08c8687e1ad8b989 | Allow multiple starts by not subclassing from Thread | powerline/lib/threaded.py | powerline/lib/threaded.py | # vim:fileencoding=utf-8:noet
from __future__ import absolute_import
from powerline.lib.time import monotonic
from time import sleep
from threading import Thread, Lock
class ThreadedSegment(Thread):
daemon = True
min_sleep_time = 0.1
update_first = True
interval = 1
def __init__(self):
super(ThreadedSegmen... | Python | 0 | @@ -188,22 +188,22 @@
Segment(
-Thread
+object
):%0A%09daem
@@ -459,32 +459,53 @@
interval = False
+%0A%09%09self.thread = None
%0A%0A%09def __call__(
@@ -665,16 +665,16 @@
e_lock:%0A
-
%09%09%09retur
@@ -694,24 +694,210 @@
(**kwargs)%0A%0A
+%09def is_alive(self):%0A%09%09return self.thread and self.thread.is_al... |
4133f5f4c04ae75bb8fbe368d851957bceb844e3 | Update math_reverse_integer.py | leetcode/math_reverse_integer.py | leetcode/math_reverse_integer.py | # @file Math Reverse Integer
# @brief Given a 32-bit signed integer, reverse digits of an integer.
# https://leetcode.com/problems/reverse-integer/
'''
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example 3:
Input: 120
Outpu... | Python | 0.000114 | @@ -1656,12 +1656,191 @@
sign * ans%0A
+%0A# Approach 2: convert to string%0A def reverse(self, x):%0A sign = 1%0A if x %3C 0:%0A sign = -1%0A x = sign * x%0A return sign * int(str(x)%5B::-1%5D)%0A%0A
|
2a5d7af11230225200cdaf101bb36980a8fd3f8e | Make sure we have the unicode from of text in lxml fragment root | html5lib/treewalkers/lxmletree.py | html5lib/treewalkers/lxmletree.py | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
elif isinstance(s, text_type):
return s
... | Python | 0.000001 | @@ -3776,16 +3776,27 @@
XT,
+ensure_str(
node.obj
%0A%0A
@@ -3791,16 +3791,17 @@
node.obj
+)
%0A%0A
|
12bafa423f0b7edc3f9596ae71dab5a7cbbeaf74 | Add paper URLs. | ppp_hal/requesthandler.py | ppp_hal/requesthandler.py | """Request handler of the module."""
import pickle
import hashlib
try:
import pylibmc as memcache
except ImportError:
try:
import memcache
except ImportError:
raise ImportError('Neither pylibmc or python3-memcached is installed')
import requests
import functools
import itertools
from ppp_d... | Python | 0.000002 | @@ -2694,16 +2694,30 @@
e_as = %5B
+paper%5B'uri_s'%5D
%5D%0A if
@@ -3687,24 +3687,59 @@
nguage_s'%5D,%0A
+ 'url': paper%5B'uri_s'%5D,%0A
|
12a89261e5b831096e734688edf4a9c1b6ee21b3 | Fix pub integration test on arm64 macs | tools/bots/pub_integration_test.py | tools/bots/pub_integration_test.py | #!/usr/bin/env python3
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import optparse
import os
import subprocess
import sys
import shutil
import tempfil... | Python | 0.000016 | @@ -820,17 +820,16 @@
arch = '
-X
ARM64' i
|
d701885655b2b459df3920e8dd10df195138b11e | Add CSV output via hooks (#36) | kur/model/hooks/output_hook.py | kur/model/hooks/output_hook.py | """
Copyright 2016 Deepgram
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
distri... | Python | 0 | @@ -564,16 +564,27 @@
pickle%0A
+import csv%0A
import l
@@ -590,16 +590,16 @@
logging%0A
-
from . i
@@ -1389,16 +1389,880 @@
t, fh)%0A%0A
+%09###########################################################################%0A%09@staticmethod%0A%09def _save_as_csv(target, data, truth=None):%0A%09%09%22%22%22 Saves a fi... |
ba69549405b86573f2996db8d0d4336e0c2a084b | Replace urllib2 w/ requests | bills/utils.py | bills/utils.py | #! /usr/bin/python2.7
# -*- coding: utf-8 -*-
import html5lib
import json
import os
from shutil import copyfileobj
import urllib2
opener = urllib2.build_opener()
opener.addheaders.append(('Referer', 'http://likms.assembly.go.kr/bill/jsp/BillSearchResult.jsp'))
def check_dir(directory):
if not os.path.exists(dire... | Python | 0 | @@ -82,113 +82,59 @@
os%0A
-from shutil import copyfileobj%0Aimport urllib2%0A%0Aopener = urllib2.build_opener()%0Aopener.addheaders.append((
+import traceback%0A%0Aimport requests%0A%0AHEADERS = %7B%0A
'Ref
@@ -138,17 +138,17 @@
Referer'
-,
+:
'http:/
@@ -199,18 +199,19 @@
ult.jsp'
-))
+,%0A%7D
%0A%0Adef c... |
e64e86a68bae51cd5aefbff563112c0f4765065c | Set version number for v1.0.1 | gridfill/__init__.py | gridfill/__init__.py | """Fill missing values in a grid."""
# Copyright (c) 2012-2014 Andrew Dawson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | Python | 0.000182 | @@ -1260,11 +1260,8 @@
1.0.
-dev
1'%0A%0A
|
866f95cfb0db14da0596efe41a128baf2a3a1cfe | Fix form PageForm needs updating. | django_basic_tinymce_flatpages/admin.py | django_basic_tinymce_flatpages/admin.py | from django.conf import settings
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.module_loading import import_string
FLATPAGE_WIDGET = getattr(settings, 'FLATPAGE_WIDGET', 'tinymce.widgets.Tin... | Python | 0 | @@ -646,16 +646,43 @@
%7D%0A
+ fields = '__all__'%0A
%0A%0Aclass
|
f35002c04d4d3ca4ad8e71e8f1cb0f46a834fd38 | fix encoding of documentation warning file | scripts/ci/check-compliance.py | scripts/ci/check-compliance.py | #!/usr/bin/env python3
import sys
import subprocess
import re
import os
import xml.etree.ElementTree as ET
from email.utils import parseaddr
import sh
import logging
import argparse
import check_identity
if "ZEPHYR_BASE" not in os.environ:
logging.error("$ZEPHYR_BASE environment variable undefined.\n")
exit(1)... | Python | 0 | @@ -2778,16 +2778,17 @@
FILE, %22r
+b
%22) as f:
|
04983c399cfdd70cdde121bbbf4e06b8e94370b1 | add get_available_languages(). | linguist/mixins.py | linguist/mixins.py | # -*- coding: utf-8 -*-
from .models import Translation
from .utils import get_cache_key
class LinguistMixin(object):
def clear_translations_cache(self):
self._linguist.clear()
@property
def language(self):
return self._linguist.language
@language.setter
def language(self, value... | Python | 0 | @@ -357,16 +357,368 @@
value%0A%0A
+ def get_available_languages(self):%0A identifier = self._linguist.identifier%0A return (Translation.objects%0A .filter(identifier=identifier, object_id=self.pk)%0A .values_list('language', flat=True)%0A ... |
c40d0450846e5f23413587e138792dbad8e2afd3 | fix AttributeError | sfa/rspecs/elements/element.py | sfa/rspecs/elements/element.py | class Element(dict):
fields = {}
def __init__(self, fields={}, element=None, keys=None):
self.element = element
dict.__init__(self, dict.fromkeys(self.fields))
if not keys:
keys = fields.keys()
for key in keys:
if key in fields:
self[key]... | Python | 0.000017 | @@ -692,32 +692,67 @@
if not fields
+ and hasattr(element_class, fields)
:%0A fie
@@ -773,31 +773,24 @@
class.fields
-.keys()
%0A ele
|
4627b67b7ca8d96c31082bbaade8a6c317ac7e52 | fix the wrong number of arguments check-ups (#2945) | modules/tools/calibration/result2pb.py | modules/tools/calibration/result2pb.py | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | Python | 0 | @@ -3289,17 +3289,16 @@
ble_pb%0A%0A
-%0A
if __nam
@@ -3341,11 +3341,12 @@
gv)
-%3C 2
+!= 3
:%0A
@@ -3360,11 +3360,11 @@
rint
- %22u
+(%22U
sage
@@ -3423,16 +3423,37 @@
ult.csv%22
+)%0A sys.exit(0)
%0A%0A ct
@@ -3753,27 +3753,28 @@
le_pb)%0A%0A
-f =
+with
open('contr
@@ -3794,21 +3794,31 @@
... |
857a7542c8e55b0162420e408f5175ae48c5f030 | Remove gaps for workspace widget. Change colors. | widgets/ws.py | widgets/ws.py | #!/usr/bin/env python3
import sys
import json
import subprocess
from utils import set_b_color, set_f_color, set_spacing
from widgets.widget import Widget
from widgets.config import colors, icons
class Workspaces(Widget):
'''
'''
def __init__(self, value=''):
'''
Params:
bg: b... | Python | 0 | @@ -547,20 +547,20 @@
gaps = (
-3, 3
+0, 0
)%0A%0A
@@ -1523,15 +1523,12 @@
%5B'c_
-black_l
+gray
'%5D%0A
@@ -1551,34 +1551,29 @@
, colors%5B'c_
-foreground
+white
'%5D%0A )
@@ -1673,157 +1673,51 @@
lor(
-%0A set_b_color(%0A set_spacing(num, (3, 3)), colors%5B'c_back... |
acc1131002d9c498042ce1bd4a737dee6b47a2dd | Remove redundant import. | project/project_name/settings/base.py | project/project_name/settings/base.py |
from os.path import abspath, basename, dirname
from sys import path
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project folder:
SITE_ROOT = dirname(DJANGO_ROOT)
# Site name:
SITE_NAME = basename(DJANGO_ROOT)
| Python | 0.000003 | @@ -45,30 +45,8 @@
ame%0A
-from sys import path%0A%0A
%0ADJA
|
49439deadb92dc7c07817833d4f1ef5abbbc7eef | Add request body buffer size options. | app/server.py | app/server.py | #!/usr/bin/env python
# Copyright (C) 2014 Linaro Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This... | Python | 0 | @@ -3056,16 +3056,134 @@
ystem%22)%0A
+topt.define(%0A %22buffer_size%22, default=1024*1024*500, type=int,%0A help=%22The body buffer size for uploading files%22)%0A
%0A%0Aclass
@@ -4847,16 +4847,73 @@
rage_url
+,%0A %22max_buffer_size%22: topt.options.buffer_size
%0A
@@ -5352,16 +5352,68 @... |
f12e50a4c4d7cb26f0c7d153fa9efdda547ba7dd | Update __init__.py | tendrl/commons/flows/create_cluster/__init__.py | tendrl/commons/flows/create_cluster/__init__.py | # flake8: noqa
import json
import uuid
from tendrl.commons import flows
from tendrl.commons.event import Event
from tendrl.commons.message import Message
from tendrl.commons.flows import utils
from tendrl.commons.flows.create_cluster import ceph_help
from tendrl.commons.flows.create_cluster import gluster_help
from t... | Python | 0.000072 | @@ -1400,243 +1400,1477 @@
-all_ssh_jobs_done = True%0A%0A # SSH setup jobs finished above, now install sds bits and create cluster%0A if %22ceph%22 in self.parameters%5B%22TendrlContext.sds_name%22%5D:%0A ceph_help.create_ceph(self.parameters)%0A else:
+Event(%0A ... |
d1008437dcf618700bce53913f3450aceda8a23f | Remove xadmin as it will not work with guardian. | djangoautoconf/auto_conf_admin_utils.py | djangoautoconf/auto_conf_admin_utils.py | from guardian.admin import GuardedModelAdmin
#from django.contrib import admin
import xadmin as admin
def register_to_sys(class_inst, admin_class = None):
if admin_class is None:
admin_class = type(class_inst.__name__+"Admin", (GuardedModelAdmin, ), {})
try:
admin.site.register(class_inst, ad... | Python | 0 | @@ -39,17 +39,16 @@
lAdmin%0A%0A
-#
from dja
@@ -72,16 +72,56 @@
t admin%0A
+#The following not work with guardian?%0A#
import x
@@ -184,18 +184,17 @@
lass
- =
+=
None):%0A
+%0A
@@ -267,9 +267,11 @@
me__
-+
+ +
%22Adm
@@ -384,24 +384,62 @@
pass
+%0A%0A #admin.site.register(class_inst)
%0A ... |
1c9d981c8c6df32a73602e17d3cf6af5352acfa4 | Remove old imports | speculator/main.py | speculator/main.py | import argparse
from datetime import datetime as dt
import pandas as pd
from sklearn.metrics import accuracy_score
from speculator import market
from speculator.features import rsi
from speculator.features import so
from speculator.features import sma
from speculator.utils import date
from speculator.utils import polon... | Python | 0.000112 | @@ -75,253 +75,31 @@
om s
-klearn.metrics import accuracy_score%0Afrom speculator import market%0Afrom speculator.features import rsi%0Afrom speculator.features import so%0Afrom speculator.features import sma%0Afrom speculator.utils import date%0Afrom speculator.utils import poloniex
+peculator import market
%0A%0A%2... |
73d71171be71ba2983fcfc679cce0d07aca49959 | Fix typo | iatidataquality/usermanagement.py | iatidataquality/usermanagement.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.999999 | @@ -5623,24 +5623,25 @@
sion_value))
+)
%0A if
|
421f80ddf3b24a29a3b9fd02e8c7fb3d3f8e4419 | Remove draw_histogram | imgfilter/utils/histogram_analyzation.py | imgfilter/utils/histogram_analyzation.py | import numpy as np
import cv2
import math
from matplotlib import pyplot as plt
class LocationData(object):
def __init__(self, index, value):
self.index = index
self.value = value
def __repr__(self):
return 'index: ' + str(self.index) + ' value: ' + str(self.value)
def draw_histrogr... | Python | 0.000002 | @@ -23,61 +23,12 @@
ort
-cv2%0Aimport math%0A%0Afrom matplotlib import pyplot as plt
+math
%0A%0A%0Ac
@@ -251,134 +251,8 @@
)%0A%0A%0A
-def draw_histrogram(histogram):%0A plt.plot(histogram, color = 'red')%0A plt.xlim(%5B0, histogram.shape%5B0%5D%5D)%0A plt.show()%0A%0A%0A
def
|
23d1d4f11b081eb946df0895e8e622a2c53cfc72 | Update filter_genes_matrix.py | scripts/filter_genes_matrix.py | scripts/filter_genes_matrix.py | #! /usr/bin/env python
"""
Script that takes a ST dataset (matrix of counts)
where the columns are genes and the rows
are spot coordinates
gene gene
XxY
XxY
And removes the columns of genes
matching the regular expression given as input.
@Author Jose Fernandez Navarro <jose.fernandez.navarro@scilifela... | Python | 0.000002 | @@ -960,12 +960,8 @@
%5Bre.
-full
matc
|
4dca500899cd8785e09db27ee9111de1b818284e | Use downloads var | tools/ncbi_entrez_eutils/efetch.py | tools/ncbi_entrez_eutils/efetch.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import glob
import json
import os
import sys
import eutils
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def handleEfetchException(e, db, payload):
eprint('No results returned. This could either be due to no... | Python | 0 | @@ -922,35 +922,39 @@
(os.listdir(
-'downloads'
+final_directory
))%0A%0A file
|
fd431b48ab662cf9cca68bc6a25e5cfb52e50544 | Use style and symbolizer method names | spillway/styles.py | spillway/styles.py | from django.core.files.storage import default_storage
from django.db import connection
from greenwich import srs
from spillway.compat import mapnik
from spillway import colors, query
def add_colorizer_stops(style, bins, mcolors):
rule = style.rules[0]
symbolizer = rule.symbols[0]
for value, color in zip(b... | Python | 0 | @@ -437,24 +437,81 @@
(**kwargs):%0A
+ %22%22%22Returns a mapnik PostGIS or SQLite Datasource.%22%22%22%0A
if 'spat
@@ -561,16 +561,16 @@
GINE'):%0A
-
@@ -2124,47 +2124,8 @@
or:%0A
- style = layer.make_style()%0A
@@ -2165,21 +2165,29 @@
lename,
+layer.
style
+()
)%0A
@@ -... |
4b6bdef77223e838fe7449481e3588f4e4ed0870 | format of user CSV creation schema changed | doc/deployer/create_user_detail_csvs.py | doc/deployer/create_user_detail_csvs.py | import csv
import os
import string
from random import choice
from bson import ObjectId
all_small_letters = string.letters.lower()
# folder structure
data_path = '/data'
csvs_folder_name = 'user-csvs'
csvs_folder_path = os.path.join(data_path, csvs_folder_name)
if not os.path.exists(csvs_folder_path):
os.makedirs(cs... | Python | 0 | @@ -868,17 +868,8 @@
_no)
-.zfill(4)
)%0A%0A%09
@@ -2027,28 +2027,111 @@
#
+ csv schema:%0A # user_id,
school
-
+_
code
+, username, password, oid%0A%0A # user-id
%0A
@@ -2153,17 +2153,126 @@
ist
-
= %5Bc
-ode%5D
+urrent_user_id%5D%0A current_user_id += 1%0A%0A... |
76e35d291ae6619aaf95636deec96247b2e64d62 | Add logging to Cloudformation | lambda_utils/cloudformation.py | lambda_utils/cloudformation.py | import json
import urllib2
from lambda_utils import Event
class Cloudformation(Event):
event = None
status = None
response = None
reason = None
def wrapped_function(self, event, context):
self.event = self.extract_event(event)
self.status = 'FAILED'
self.response = None
... | Python | 0 | @@ -21,16 +21,18 @@
rllib2%0A%0A
+%0A%0A
from lam
@@ -53,16 +53,25 @@
rt Event
+, logging
%0A%0A%0Aclass
@@ -212,24 +212,52 @@
, context):%0A
+ logging.info(event)%0A
self
@@ -1408,16 +1408,47 @@
%7D%0A )%0A
+ logging.info(response_body)
%0A ope
|
a0d90cb94cdad6d3e34abcc8a80896bf62f1b9df | remove some midlewares | ask/ask/settings.py | ask/ask/settings.py | """
Django settings for ask project.
Generated by 'django-admin startproject' using Django 1.8.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths in... | Python | 0.000005 | @@ -1076,32 +1076,34 @@
_CLASSES = (%0A
+ #
'django.contrib
@@ -1236,32 +1236,34 @@
Middleware',%0A
+ #
'django.contrib
@@ -1301,32 +1301,34 @@
Middleware',%0A
+ #
'django.contrib
|
2182d15da2da623e5da8dcf8158de35dcb47937e | add get_connector_unit_for_model helper method on ConnectorUnit | queue_job/connector.py | queue_job/connector.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | Python | 0.000001 | @@ -2730,29 +2730,59 @@
get_
-binder_for_model(self
+connector_unit_for_model(self, connector_unit_class
, mo
@@ -3043,37 +3043,164 @@
nit(
-Binder)%0A return binder
+connector_unit_class)%0A return binder%0A%0A def get_binder_for_model(self, model=None):%0A return self.get_connector_unit_for... |
331da7f3004f295a120b3e61a9b525c16bb7f62a | Update version to 2.0-dev. | openslides/__init__.py | openslides/__init__.py | __author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.0b5'
| Python | 0 | @@ -124,8 +124,10 @@
'2.0
-b5
+-dev
'%0A
|
3a878c528929fa7090f0dd16f97e1ae1b0d73be1 | Remove feature selection | scripts/generate_submission.py | scripts/generate_submission.py | #!/usr/bin/env python
import pandas as pd
import numpy as np
import datetime
from sklearn.preprocessing import LabelEncoder
from xgboost.sklearn import XGBClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.feature_selection import SelectFromModel
def generate_submission(y_pred, test_users_ids,... | Python | 0.000001 | @@ -1042,30 +1042,41 @@
csv(path + '
-_encod
+ohe_count_process
ed_train_use
@@ -1121,22 +1121,33 @@
path + '
-_encod
+ohe_count_process
ed_test_
@@ -2041,140 +2041,8 @@
)%0A%0A
- model = SelectFromModel(ExtraTreesClassifier())%0A model.fit(x_train, encoded_y_train)%0A x_train = model.transform(x_train)%... |
35119551542a2e403e6d66b371d9913d6d1ed440 | Add unicode treatment on JSONField rendering | opps/fields/widgets.py | opps/fields/widgets.py | #!/usr/bin/env python
# -*- coding: utf-8 -*
import json
from django import forms
from django.template.loader import render_to_string
from .models import Field, FieldOption
class JSONField(forms.TextInput):
model = Field
def render(self, name, value, attrs=None):
elements = []
try:
... | Python | 0 | @@ -291,17 +291,16 @@
ts = %5B%5D%0A
-%0A
@@ -369,16 +369,16 @@
eError:%0A
-
@@ -394,16 +394,159 @@
s = %7B%7D%0A%0A
+ # value sometimes come as unicode and we need to treat it%0A if type(values) == unicode:%0A values = json.loads(values)%0A%0A
@@ -1012,17 +1012... |
1190983d578238f312577caedc368e0e60cc5f5d | fix do_files | imagy/core.py | imagy/core.py | # -*- coding: utf-8 -*-
# all uppercase
from config import *
from utils import make_path, same_file, MARK
from store import store
from smushing import compress_image
import watch
from path import path
import logging
logging.disable(logging.CRITICAL)
def revert():
'''Move stored originals back to their initial lo... | Python | 0.000002 | @@ -2659,15 +2659,16 @@
-do
files
+ =
(p f
@@ -2707,16 +2707,37 @@
files())
+%0A do_files(*files)
%0A%0Adef do
@@ -2744,19 +2744,20 @@
_files(*
-pth
+file
s):%0A
|
e8eaa7fd2870df0cb8d4a7c368c900887b78ef9f | 'name' field is unique | discovery/domain/apis.py | discovery/domain/apis.py | # -*- coding: utf-8 -*-
"""
discovery.domain.apis.py
~~~~~~~~~~~~~~~~~~~~~~~~
'apis' resource and schema settings.
:copyright: (c) 2015 by Nicola Iarocci and CIR2000.
:license: BSD, see LICENSE for more details.
"""
_schema = {
'name': {
'type': 'string',
'required': True,
... | Python | 0.999997 | @@ -305,24 +305,47 @@
red': True,%0A
+ 'unique': True%0A
%7D,%0A '
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.