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 |
|---|---|---|---|---|---|---|---|
88b2cfaac40cdd9e06994fb8104ace6740399564 | set new version 0.2.9 | opps/__init__.py | opps/__init__.py | # -*- coding: utf-8 -*-
import pkg_resources
pkg_resources.declare_namespace(__name__)
VERSION = (0, 2, 8, 3)
__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"Open Source Content Management Platform - CMS for the "
u"magazines, newspappers websites and portals with "
u"high-tr... | Python | 0.000007 | @@ -104,12 +104,9 @@
2,
-8, 3
+9
)%0A__
|
9ae8d3cf740d59ca0cc66cf1bb5106333730c2b1 | test mode | order_bom/bom.py | order_bom/bom.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.000003 | @@ -3014,17 +3014,16 @@
-#
('produc
|
d14368224c3b063d3e99f2f0ccf76d00bbf46e93 | fix py3 compatibility | pycycle/utils.py | pycycle/utils.py | import ast
import codecs
import os
import sys
import traceback
import click
import crayons
import re
if sys.version_info[0] > 2:
open_func = open
else:
open_func = codecs.open
REGEX_RELATIVE_PATTERN = re.compile('from \.')
class Node(object):
def __init__(self, name, imports=None, full_path=None, line... | Python | 0.000001 | @@ -5855,20 +5855,16 @@
imports.
-iter
items():
|
0453aec545a451b1b9cca01eb17fe7871c9d235c | Remove unused import | armstrong/cli/templates/standard/urls/defaults.py | armstrong/cli/templates/standard/urls/defaults.py | from django.conf.urls.defaults import patterns, include, url
from armstrong.core.arm_wells.views import QuerySetBackedWellView
from armstrong.core.arm_sections.views import SimpleSectionView, SectionFeed
from armstrong.apps.articles.models import Article
from armstrong.apps.articles.views import ArticleFeed
from django... | Python | 0.000001 | @@ -365,54 +365,8 @@
ail%0A
-from django.views.generic import TemplateView%0A
from
|
ae6274afafbc256d574106499fc3a07611e50745 | use original release format | yum-snapshot.py | yum-snapshot.py | #!/usr/bin/python
import argparse
import config
import logging
import os
import time
import re
import shutil
import subprocess
def createSnapshot( distro, release, arch, cwd = None ):
source = getSnapshotSource( distro, release, arch )
repoLocalDir = createRepoLocalDir( distro, release, arch , cwd )
logg... | Python | 0.000001 | @@ -1866,213 +1866,8 @@
)%0A%0A
-def ReleaseFormat( release ):%0A if re.match(%22%5E%5Cd%5C.%5Cd$%22, release ) is None:%0A msg = %22%25s is not in the correct format #.#%22 %25 release%0A raise argparse.ArgumentTypeError(msg)%0A return release%0A%0A
if _
@@ -2417,30 +2417,8 @@
se',
- type = Rel... |
e7b164da2620189dfedaf1c09e5902bad1e2c147 | add pagination | sdgs/settings.py | sdgs/settings.py | """
Django settings for sdgs project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
fr... | Python | 0.000008 | @@ -4923,11 +4923,114 @@
',%0A %5D
+,%0A 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',%0A 'PAGE_SIZE': 50
%0A%7D%0A
|
2a531f331ef5fe4d42e92460257d650ce481a2be | set empty prefix instead of None | labDNS/storages.py | labDNS/storages.py | try:
import redis
except ImportError:
redis = None
try:
import consul
except ImportError:
consul = None
class BaseStorage:
DEFAULT_CONFIG = dict()
def __init__(self, config):
self.config = self.DEFAULT_CONFIG
self._configure(config)
def get(self, key):
raise NotIm... | Python | 0.999882 | @@ -1267,20 +1267,18 @@
refix',
-None
+''
)%0A
|
34b6195fb5f2fbfb864adeb3dd9db744bb4f869e | Support subversion repositories of version 8. | Tools/scripts/svneol.py | Tools/scripts/svneol.py | #! /usr/bin/env python
"""
SVN helper script.
Try to set the svn:eol-style property to "native" on every .py, .txt, .c and
.h file in the directory tree rooted at the current directory.
Files with the svn:eol-style property already set (to anything) are skipped.
svn will itself refuse to set this property on a file... | Python | 0 | @@ -1023,16 +1023,442 @@
ort os%0A%0A
+def propfile(root, fn):%0A default = os.path.join(root, %22.svn%22, %22props%22, fn+%22.svn-work%22)%0A try:%0A format = int(open(os.path.join(root, %22.svn%22, %22format%22)).read().strip())%0A except IOError:%0A return default%0A # XXX I don't know wha... |
dd65eb488f2e683a77ccb0609e2cc3f4b58473e6 | Update 0.9 | src/cerberus_ac/admin.py | src/cerberus_ac/admin.py | # -*- coding: utf-8 -*-
"""Admin module."""
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from cerberus_ac.views import EditUserPermissions
from .models import *
class SecurityAdmin(AdminSite):
pass
class DataAdmin(AdminSite):
pass
class AuditAdmin(AdminSite):
pass... | Python | 0 | @@ -469,16 +469,18 @@
dmin')%0A%0A
+#
# Securi
@@ -494,16 +494,18 @@
n Pages%0A
+#
# Lo
@@ -507,16 +507,18 @@
# Logs%0A
+#
@securit
@@ -550,24 +550,26 @@
essHistory)%0A
+#
class Object
@@ -598,32 +598,34 @@
in.ModelAdmin):%0A
+#
pass%0A%0A@secur
@@ -617,17 +617,20 @@
pass%0A
-%0A
+#%0A#
@s... |
4289617da1a39d4c470604d777ce316855d058f1 | Support expectOutput. | tests/BaseTestClasses.py | tests/BaseTestClasses.py | from datetime import datetime
from subprocess import Popen, PIPE
import inspect
import io
import logging
import os
import os.path
import shutil
import tempfile
import unittest
class NormalizeFilenameTestCase(unittest.TestCase):
COMMAND = os.path.normpath(os.path.join(os.getcwd(), 'normalize-filename'))
def s... | Python | 0 | @@ -1843,16 +1843,36 @@
cwd=None
+, expectOutput=False
):%0A
@@ -2245,24 +2245,111 @@
, %22utf-8%22)%0A%0A
+ if expectOutput:%0A self.assertNotEqual(%22%22, output)%0A else:%0A
self
|
32935c32ae592e84cfb5d8e1c1988e5e96659be3 | fix tests | Jarvis/tests/test_brain.py | Jarvis/tests/test_brain.py | import unittest
from packages.aiml.brain import Brain
class BrainTest(unittest.TestCase):
def test_memory(self):
b = Brain()
response = b.respond("TEST")
self.assertEqual(str(response), 'TEST')
if __name__ == '__main__':
unittest.main()
| Python | 0.000001 | @@ -165,20 +165,28 @@
espond(%22
-TEST
+What are you
%22)%0A
@@ -224,14 +224,27 @@
e),
-'TEST'
+%22I'm a bot, silly!%22
)%0A%0A%0A
|
2e1d4556f6eadb6743b41515cf66d2f3f1d0b1d2 | use portable integer division (fix #1) | sldc/util.py | sldc/util.py | # -*- coding: utf-8 -*-
import numpy as np
from PIL import Image, ImageDraw
from shapely.geometry.base import BaseMultipartGeometry
__author__ = "Mormont Romain <romain.mormont@gmail.com>"
__version__ = "0.1"
def emplace(src, dest, mapping):
"""Place the values of src into dest at the indexes indicated by the ma... | Python | 0 | @@ -1891,32 +1891,33 @@
= (item_count /
+/
n_batches)%0A
@@ -1949,16 +1949,17 @@
_count /
+/
n_batch
|
1c2dc39aeea36ba9e21bec71dbf29b20bcdd1cf6 | Stop spamming about locally-disabled messages. | pyempt/pyempt.py | pyempt/pyempt.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""PyEmT is a python/emacs tiny syntax checker.
It is a wrapper script which makes it easy to use flymake to run various
syntax checking tools on your code. Since flymake expects to just run
the script with the filename and no other arguments, this file is mainly
expected to ... | Python | 0 | @@ -2376,16 +2376,25 @@
_cmd = %5B
+%0A
'pylint'
@@ -2436,17 +2436,108 @@
-r', 'n'
-%5D
+,%0A '--disable', 'locally-disabled', # stop pylint spam about disabled ids%0A %5D%0A
%0A cmd
|
d3eca7daed3051c4a458ab3cfc402759b72caa19 | Update yet-another missed import. | src/puzzle/heuristics/analyze.py | src/puzzle/heuristics/analyze.py | import collections
from typing import List, Optional, Set, Tuple, Type, Union
import numpy as np
from data import meta
from puzzle.problems import acrostic_problem, anagram_problem, \
cryptogram_problem, image_problem, logic_problem, morse_problem, \
number_problem, problem, solved_problem
from puzzle.problems.cr... | Python | 0 | @@ -204,23 +204,8 @@
lem,
- image_problem,
log
@@ -347,16 +347,64 @@
_problem
+%0Afrom puzzle.problems.image import image_problem
%0A%0AHint =
|
056c7aa5bd80d629191840543636da33f303a5f1 | Remove unicode test. | geoposition/tests/test_geoposition.py | geoposition/tests/test_geoposition.py | from decimal import Decimal
from django.test import SimpleTestCase
from geoposition import Geoposition
class GeopositionTestCase(SimpleTestCase):
def test_init_with_decimals(self):
gp = Geoposition(Decimal('52.5'), Decimal('13.4'))
self.assertEqual(gp.latitude, Decimal('52.5'))
self.assert... | Python | 0.00001 | @@ -543,202 +543,8 @@
))%0A%0A
- def test_init_with_unicodes(self):%0A gp = Geoposition(u'52.5', u'13.4')%0A self.assertEqual(gp.latitude, Decimal('52.5'))%0A self.assertEqual(gp.longitude, Decimal('13.4'))%0A%0A
|
916b4e25f163456b1f6869fb431fe4280be0bb6b | Fix YAML config reading. | twisted/plugins/graphite2holodeck.py | twisted/plugins/graphite2holodeck.py | from zope.interface import implements
import yaml
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from vumidash.graphite_client import GraphiteClient
from vumidash.dummy_client import DummyClient
from vumidash.holodeck_pusher import HolodeckPu... | Python | 0.000002 | @@ -1005,16 +1005,63 @@
e-url%22%5D%0A
+ with open(options%5B%22config%22%5D) as f:%0A
@@ -1084,33 +1084,24 @@
fe_load(
-options%5B%22config%22%5D
+f.read()
)%0A
|
6cc0d4d8d42412c79bff7585dbfe1c3d4d5930d7 | Make reverting real | dynaconfig/endpoints.py | dynaconfig/endpoints.py | import datetime
import rethinkdb as r
from flask import request
from flask.ext.restful import Resource, abort
from dynaconfig import db
from time import time
def config_id(user_id, config_name):
return "{}-{}".format(user_id, config_name)
class Config(Resource):
def get(self, user_id, config_name):
curren... | Python | 0.001041 | @@ -2830,16 +2830,17 @@
ersion %3C
+=
current
@@ -2879,12 +2879,392 @@
-pass
+current_version = current_config%5B%22version%22%5D%0A audit_trail = current_config%5B%22audit_trail%22%5D%0A values = self._revert_config(current_config%5B%22values%22%5D, audit_trail, version, current_version)%0A ... |
c1efaefbe6a098e3f74bed20ff55a4307ec90ddd | Use new version of Dockets | dynamic_requirements.py | dynamic_requirements.py | install_requires = [
'Dockets>=0.3.4,<0.4.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
| Python | 0 | @@ -34,16 +34,16 @@
%3E=0.
-3.4
+4.0
,%3C0.
-4
+5
.0',
|
ad9263732b502bf0d665fbdf59a14d1d27c545c6 | Improve filename formatting for xml. | xmlgen.py | xmlgen.py | import os
import xml.etree.cElementTree as ET
import re
import uuid
import urlparse
import urllib
from mediainfo.MediaInfoDLL import *
MI = MediaInfo()
Version = MI.Option_Static("Info_Version",
"0.7.7.0;MediaInfoDLL_Example_Python;0.7.7.0")
if Version == "":
print "\nMediaInfo.Dll: thi... | Python | 0.000001 | @@ -64,38 +64,8 @@
uuid
-%0Aimport urlparse%0Aimport urllib
%0A%0Afr
@@ -423,66 +423,118 @@
-return urlparse.urljoin('file:', urllib.pathname2url(path)
+folder, fn = os.path.split(path)%0A return %22file://localhost/%25s%22 %25 path.replace(%22:%22, %22%253A%22).replace(%22%5C%5C%22, %22/%22
)%0A%0A%0A
@@ -... |
2df8debeee6d6430c86344ed78ebd9249e46cf8c | Test external backend corner cases | geotrek/authent/tests/test_backend.py | geotrek/authent/tests/test_backend.py | from django.db import connections
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group
from ..models import Stru... | Python | 0 | @@ -1760,24 +1760,23 @@
AUTHENT_
+DA
TAB
-LENAM
+AS
E=None)%0A
@@ -1788,20 +1788,199 @@
ef test_
-conf
+base_missing(self):%0A self.assertRaises(ImproperlyConfigured, self.backend.authenticate, ('toto', 'totopwd'))%0A%0A @override_settings(AUTHENT_TABLENAME=None)%0A def test_table_
missing(
@@ -4943,3... |
7c1231dad89bc784880fa3634b10e6d0009bf08f | Make pyhdf import optional | typhon/spareice/handlers/cloudsat.py | typhon/spareice/handlers/cloudsat.py | from datetime import datetime, timedelta
import warnings
from netCDF4 import Dataset
import numpy as np
import pandas as pd
from pyhdf import HDF, VS, V
from typhon.spareice.array import Array
from typhon.spareice.geographical import GeoData
from .. import handlers
__all__ = [
'CloudSat',
]
class CloudSat(hand... | Python | 0.000001 | @@ -122,37 +122,8 @@
pd%0A
-from pyhdf import HDF, VS, V%0A
from
@@ -233,16 +233,165 @@
ndlers%0A%0A
+try:%0A from pyhdf import HDF, VS, V%0Aexcept ImportError:%0A warnings.warn(%0A %22Cannot use CloudSat handler without having installed pyhdf!%22)%0A%0A
__all__
|
291d64efef1f8d464a86fb822c0b82910f406d2c | Fix path | Dataiter.docset/Contents/Resources/index.py | Dataiter.docset/Contents/Resources/index.py | #!/usr/bin/env python3
import util
db = util.create_database()
root = "https://dataiter.readthedocs.io/en/latest/"
for soup in util.soups_from_files("Documents/*.html"):
for tag in soup.select('a[href*="#dataiter."]'):
name = tag.attrs["href"].split("#")[-1]
path = root + name
util.insert(... | Python | 0.000018 | @@ -288,20 +288,33 @@
root +
-name
+tag.attrs%5B%22href%22%5D
%0A
|
879deef448c2d06053d5e848b414d5e2ab2754bd | Update brain.py | pabiana/brain.py | pabiana/brain.py | import importlib
import os
from os import path
import pip
from . import load_interfaces, repo
def main(module_name, area_name):
req_path = path.join(os.getcwd(), module_name, 'requirements.txt')
if path.isfile(req_path):
pip.main(['install', '--upgrade', '-r', req_path])
intf_path = path.join(os.... | Python | 0.000001 | @@ -1098,24 +1098,366 @@
'clock'):%0D%0A
+%09%09if hasattr(mod, 'config'):%0D%0A%09%09%09params = %7B%7D%0D%0A%09%09%09if 'timeout' in mod.config:%0D%0A%09%09%09%09if mod.config%5B'timeout'%5D is not None:%0D%0A%09%09%09%09%09params%5B'timeout'%5D = mod.config%5B'timeout'%5D%0D%0A%09%09%09if 'use-template' in mod.con... |
e7edb86655cdbea2b66afa5dc483696b2b669cfc | fix typo in runs views | runs/views.py | runs/views.py | # coding: utf8
import logging
import healthgraph
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponseRedirect
from django.core.urlresolvers import revers... | Python | 0.000239 | @@ -5082,17 +5082,17 @@
se('runs
-.
+:
register
|
88615d0c25ea4d73cef2eb4d90bc2424b80ec9d8 | compute_state is str | beta/trials/malleable/Platform.py | beta/trials/malleable/Platform.py | import time
import logging
import collections
from infrastructure.resources.client import ResourcesProxy
def log(msg):
logging.debug("PLATFORM: " + msg)
return
def extrapolation(execution_log, compute_state):
if (len(execution_log) == 0):
return (0.0, 0.0)
else:
# predicting the execution time... | Python | 0.999999 | @@ -451,16 +451,22 @@
time) /
+float(
compute_
@@ -466,24 +466,25 @@
ompute_state
+)
%0A %0A
|
4b67edea1e4733b73895747af2724a4d6652effa | add save() for column | zhihu/column.py | zhihu/column.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = '7sDream'
from .common import *
class Column:
"""专栏类,请使用``ZhihuClient.column``方法构造对象."""
@class_common_init(re_column_url)
def __init__(self, url, name=None, follower_num=None,
post_num=None, session=None):
"""创建专栏类实例... | Python | 0.000001 | @@ -2277,16 +2277,140 @@
(post)%0A%0A
+ def save(self):%0A for post in self.posts:%0A post.save(filepath=self._name+'_'+str(self.follower_num))%0A%0A%0A
def
|
5ff4e4187ab73ca02ed86b06010ca7cd1e8528a9 | change description for customized invoice module | customized_invoice/__openerp__.py | customized_invoice/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': "Professional Invoice Report Templates - Odoo9.0",
'summary': """
Make your Odoo Invoice reports look professional by branding them. Choose from Five professional Invoice templates and customize the colors and logo on the invoice to look professional ans appealing to ... | Python | 0 | @@ -57,15 +57,8 @@
ice
-Report
Temp
@@ -117,13 +117,8 @@
our
-Odoo
Invo
@@ -181,11 +181,12 @@
rom
-Fiv
+thre
e pr
@@ -222,46 +222,222 @@
and
-customize the colors and
+unlimited colors %22%22%22,%0A%0A 'description': %22%22%22%0A This module will install a customized client invoice report for a... |
a0831cbe30cc3f487d683138eefb43ff56b3c687 | Allow for passing through URL arguments | pyroven/views.py | pyroven/views.py | import urllib
from django.http import HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.core.urlresolvers import reverse
from pyroven.utils import setting, HttpResponseSeeOther
def raven_return(request):
# Get the token which the Raven server sent us - this should reall... | Python | 0 | @@ -52,16 +52,30 @@
Redirect
+, HttpResponse
%0Afrom dj
@@ -228,16 +228,31 @@
SeeOther
+%0Aimport pyroven
%0A%0Adef ra
@@ -472,16 +472,29 @@
d token%0A
+ try:%0A
user
@@ -545,16 +545,158 @@
request)
+%0A except pyroven.MalformedResponseError:%0A return HttpResponseRedirect(%22/%22)%0A exc... |
48111f5f94ddbc05c48fb84ef51b28d17864ca35 | Update pysam version | pysam/version.py | pysam/version.py | # pysam versioning information
__version__ = "0.14.1"
# TODO: upgrade number
__samtools_version__ = "1.7"
# TODO: upgrade code and number
__bcftools_version__ = "1.6"
__htslib_version__ = "1.7"
| Python | 0 | @@ -46,11 +46,11 @@
%220.1
-4.1
+5.0
%22%0A%0A#
@@ -97,17 +97,17 @@
__ = %221.
-7
+9
%22%0A%0A# TOD
@@ -163,9 +163,9 @@
%221.
-6
+9
%22%0A%0A_
@@ -191,7 +191,7 @@
%221.
-7
+9
%22%0A
|
a6d84000b8738d8a10f95f53ea71c78f837095aa | Use len since it is sufficient for list comparison | pyshelf/utils.py | pyshelf/utils.py | import os.path
import json
import jsonschema
import collections
def create_path(*args):
"""
Gets the full absolute path based on the arguments provided. The part
it adds at the beginning is the path to the root of this repository.
WARNING: Do not start one of your path sections with a "/... | Python | 0.000002 | @@ -42,27 +42,8 @@
ema%0A
-import collections%0A
%0A%0Ade
@@ -2283,61 +2283,29 @@
if
-collections.Counter(name_list) != collections.Counter
+len(name_list) != len
(uni
|
da1a0f5e7ffcbe37cdee484b452b5376049dd1e5 | Work with Django 1.10 as well. | python/django.py | python/django.py | """
Django middleware that enables the MDK.
This is old-style (Django <1.10) middleware. Please see
https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware
if you're using Django 1.10.
"""
import atexit
from traceback import format_exception_only
from mdk import start
class MDKSessionMi... | Python | 0 | @@ -41,41 +41,118 @@
DK.%0A
-%0AThis is old-style (
+%22%22%22%0A%0Aimport atexit%0Afrom traceback import format_exception_only%0A%0Afrom mdk import start%0A%0A#
Django
-%3C
1.10
-)
+ new-style
mid
@@ -162,218 +162,133 @@
ware
-. Please see%0Ahttps://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrad... |
2ac8bc04d77cc158e4437d169cc17145b0f2f4cb | Fix debug-mode in pyvmrun-clone | pyvmrun-clone.py | pyvmrun-clone.py | #!/usr/bin/env python
import os, sys, config
# Set the help menu
def getSyntax():
return "Usage: clone-vm.py [options...] <vm_name>"
# Set arguments values
def setArguments(argv):
opts = {}
# Set available arguments
valued_args = { '--username': 'username', '-u': 'username', '--password': 'password', ... | Python | 0.000022 | @@ -2048,29 +2048,26 @@
.Config(
-args%5B'debug'%5D
+debug_mode
)%0A%0Avm_de
|
742a800d784a7f24cee1a1cdd522e2259a183f6d | make weeds, flowers and bushes instad of cars | pyweek12/main.py | pyweek12/main.py |
import sys
from os.path import join
from random import uniform
import pyglet
from rabbyt.sprites import Sprite
from .camera import Camera
from .eventloop import Eventloop
from .options import Options
from .path import DATA
from .render import Render
from .world import World
def main():
options = Options(sys.ar... | Python | 0 | @@ -134,16 +134,41 @@
Camera%0A
+from .color import Color%0A
from .ev
@@ -361,16 +361,64 @@
World()
+%0A world.background_color = Color(0.1, 0.3, 0)
%0A%0A de
@@ -436,10 +436,13 @@
em,
-*
_
+, dt
):%0A
@@ -481,16 +481,21 @@
velocity
+ * dt
%0A%0A fo
@@ -514,16 +514,81 @@
e(100):%0A
+ for i... |
b413f018dca708588170fe93532ab8cc19dc55b7 | Add filename creation output to templater | tests/alert_templater.py | tests/alert_templater.py | import os
import sys
# Handle python2
try:
input = raw_input
except NameError:
pass
alert_name = input('Enter your alert name (Example: proxy drop executable): ')
classname = ""
for token in alert_name.split(" "):
classname += token.title()
alert_classname = "Alert{0}".format(classname)
test_alert_clas... | Python | 0.000001 | @@ -949,32 +949,85 @@
lert_classname)%0A
+ print(%22Creating %7B0%7D%22.format(alert_filepath))%0A
python_a
@@ -1577,32 +1577,84 @@
lert_classname)%0A
+ print(%22Creating %7B0%7D%22.format(test_filepath))%0A
test_ale
|
087786e67f7c57ad43e39b97838569e60f774954 | fix FrameDebugger parent calls for Python 2 | nodepy/utils/__init__.py | nodepy/utils/__init__.py |
import pdb
import six
import sys
from .path import pathlib
from . import context, iter, machinery, path
def as_text(x, encoding=None):
"""
Accepts a binary or unicode string and returns a unicode string. If *x* is
not a string type, a #TypeError is raised.
"""
if not isinstance(x, six.string_types):
... | Python | 0.000001 | @@ -1114,34 +1114,15 @@
urn
-super(FrameDebugger, self)
+pdb.Pdb
.int
@@ -1130,16 +1130,22 @@
raction(
+self,
frame, t
@@ -1221,41 +1221,28 @@
urn
-super(FrameDebugger, self)
+pdb.Pdb
.setup(
+self,
f, t
|
94836ad0e556bdfa07660ae3f7d120b9e065e923 | Add workaround for missing imap function in gearman cluster pool. | glimpse/pools/gearman_cluster/pool.py | glimpse/pools/gearman_cluster/pool.py | # Copyright (c) 2011 Mick Thomure
# All rights reserved.
#
# Please see the file COPYING in this distribution for usage
# terms.
import logging
import gearman
import ConfigParser
import cPickle
from glimpse import pools
from glimpse.util.zmq_cluster import FutureSocket, InitSocket
from glimpse import util
import itert... | Python | 0 | @@ -2908,16 +2908,61 @@
ults))%0A%0A
+ imap = map # imap is not implemented yet%0A%0A
class Cl
|
f6cf1827eb05d85453f80fef98a14b1a0730e6cb | Remove useless assert. | packetmorpher.py | packetmorpher.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Provides code to morph a chunk of data to a given probability distribution.
The class provides an interface to morph network packet lengths to a previously
generated probability distribution. The packet lengths of the morphed network
data should then match the probabilit... | Python | 0.000001 | @@ -874,66 +874,8 @@
%22%22%0A%0A
- assert len(secret) == const.SHARED_SECRET_LENGTH%0A%0A
|
46c8487e565418073ae3e6b575ee4942ee42f111 | Add Receive_Message(Ciphertext) to the JSON-RPC API | cgi/api.py | cgi/api.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import psycopg2
import psycopg2.extras
import re
pg_connect_str = "dbname=bankapi"
pg_conn = None
def respond(result=None, error=None):
global pg_conn
response = {
"version": "1.1"
}
if result is not None:
... | Python | 0 | @@ -1756,51 +1756,19 @@
hod
-in ('encrypt_sign_message', 'decrypt_verify
+== 'receive
_mes
@@ -1772,17 +1772,16 @@
message'
-)
:%0A
@@ -1826,497 +1826,106 @@
-if method == 'encrypt_sign_message':%0A verify_params(params, %5B'frombankid', 'tobankid', 'message'%5D)%0A cur.ex... |
98b4eea9279efd2597d6b73b6289937e9f38f3e0 | Clarified the authentication failure message | PicasaSync/PicasaSync.py | PicasaSync/PicasaSync.py | #! /usr/bin/env python
import sys
if sys.hexversion < 0x020700F0:
raise SystemExit('This scripts needs at least Python 2.7')
import logging, os, mimetypes, calendar, argparse
try:
import googlecl
except ImportError:
raise SystemExit('Error importing the googlecl module. In debian/ubuntu you can install it by doin... | Python | 0.999797 | @@ -2107,17 +2107,17 @@
G.error(
-%22
+'
Error us
@@ -2175,10 +2175,87 @@
lecl
-.%22
+ using %22google picasa list-albums --force-auth%22 and following the instructions'
)%0A%09%09
|
084ff6d007017ab13fc3d8be056995fc3d2f9d29 | Bump version. | discoverage/__init__.py | discoverage/__init__.py | from discoverage.runner import DiscoverageRunner
__version__ = '0.2.1'
| Python | 0 | @@ -64,9 +64,9 @@
'0.
-2.1
+3.0
'%0A
|
1cef1da1e1da1b6592e1a656f8266325d10b0161 | Add missing whitespace to error message | atomic_reactor/plugins/pre_check_user_settings.py | atomic_reactor/plugins/pre_check_user_settings.py | """
Copyright (c) 2020 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals, absolute_import
from atomic_reactor.constants import PLUGIN_CHECK_USER_SETTINGS
from atomic_reactor... | Python | 0.000039 | @@ -1800,16 +1800,17 @@
registry
+
%22%0A
|
fa5b8686afc1949c1a0e391a38d425c745357d5d | remove superfluous logging | nodeup-server/tweeter.py | nodeup-server/tweeter.py | #!/usr/bin/env python3
import time
import logging
import tweepy
from models import twitter_access_token, twitter_access_secret, twitter_consumer_secret, twitter_consumer_key, tweet_queue
logging.basicConfig(level=logging.INFO)
def get_api():
auth = tweepy.OAuthHandler(twitter_consumer_key.get(), twitter_consum... | Python | 0.000058 | @@ -669,55 +669,8 @@
t))%0A
- logging.info(str(type(tweet)))%0A
|
37d266377d6dc45449d233b056568f1cdcc53876 | Fix call of tf.summary.create_file_writer on tf1. Fixes #32. | mesh_tensorflow/utils.py | mesh_tensorflow/utils.py | # coding=utf-8
# Copyright 2019 The Mesh TensorFlow 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 applicab... | Python | 0.000001 | @@ -822,16 +822,51 @@
1 as tf%0A
+import tensorflow.compat.v2 as tf2%0A
from ten
@@ -3783,16 +3783,17 @@
with tf
+2
.summary
|
f3c88a8dfe1b70796594f34ce1dcb81d60b424bc | Fix bitrot in ipmi deployment tests. | tests/deployment/ipmi.py | tests/deployment/ipmi.py | # Copyright 2013-2015 Massachusetts Open Cloud Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Python | 0 | @@ -1145,25 +1145,47 @@
e_state()%0A%0A%0A
-@
+with_request_context =
pytest.yield
@@ -1192,21 +1192,17 @@
_fixture
-%0Adef
+(
with_req
@@ -1217,57 +1217,9 @@
text
-():%0A with rest.RequestContext():%0A yield
+)
%0A%0A%0Ah
@@ -1536,13 +1536,9 @@
p')%0A
-
%0A
+
%0A%0Acl
@@ -1711,17 +1711,16 @@
... |
65e5557d709e7ee278e57315d66e8ea9a09cac2a | Fix up fcdxml to work with files containing windows line endings. | Tools/fcd2code/FCDElement.py | Tools/fcd2code/FCDElement.py |
import logging;
import re;
class FCDElement(object):
"""Base class for elements in a .fcd file.
Defines two dictionaries, m_fcdDict holds entries read from the .fcd
file, while m_tmplDict is filled during a call to finalize() with values
that can be accessed through the [] operator.
... | Python | 0.000386 | @@ -5197,24 +5197,68 @@
%22%5Cn%22, %22%22);%0A
+ line = line.replace(%22%5Cr%22, %22%22);%0A
|
e24b67409d414af82ff1ddae80e6b498520fdf57 | Fix typo | Lib/fontParts/world.py | Lib/fontParts/world.py | def OpenFont(path, showInterface=True):
"""
Open font located at **path**. If **showInterface**
is ``False``, the font should be opened without
graphical interface. The default for **showInterface**
is ``True``.
::
from fontParts.world import *
font = OpenFont("/path/to/my/fon... | Python | 0.999999 | @@ -1425,37 +1425,37 @@
port *%0A%0A
-glyph
+layer
= CurrentLayer(
|
3a80a347a944488b97369b56d0517c2580ced35b | Remove duplicates when send mail | dbaas/util/email_notifications.py | dbaas/util/email_notifications.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from email_extras.utils import send_mail_template
from system.models import Co... | Python | 0.00031 | @@ -6194,32 +6194,36 @@
, email_from(),
+set(
email_to(databas
@@ -6221,32 +6221,33 @@
o(database.team)
+)
,%0A fail_s
|
b59cd7c9afc938f2417a48e869f6d4e478b72d2d | Migrate old disk host | dbaas/workflow/steps/util/disk.py | dbaas/workflow/steps/util/disk.py | # -*- coding: utf-8 -*-
import logging
from util import exec_remote_command_host
from base import BaseInstanceStep
LOG = logging.getLogger(__name__)
class Disk(BaseInstanceStep):
OLD_DIRECTORY = '/data'
NEW_DIRECTORY = '/new_data'
@property
def is_valid(self):
return bool(self.instance.hostn... | Python | 0.000001 | @@ -3061,8 +3061,556 @@
iles()%7D%0A
+%0A%0Aclass ChangeSnapshotOwner(Disk):%0A def __unicode__(self):%0A return %22Change snapshots owner...%22%0A%0A def do(self):%0A for volume in self.instance.hostname.volumes.all():%0A volume.is_active = False%0A volume.host = self.host%0A... |
de99a7e665bcba140865ae8f7cfbb3264541f748 | Return a PartialOrderTuple from dimension_sort() | devito/ir/equations/algorithms.py | devito/ir/equations/algorithms.py | from operator import attrgetter
from devito.dimension import Dimension
from devito.symbolics import retrieve_indexed, split_affine
from devito.tools import filter_sorted, flatten, toposort
__all__ = ['dimension_sort']
def dimension_sort(expr, key=None):
"""
Topologically sort the :class:`Dimension`s in ``ex... | Python | 0.000009 | @@ -149,16 +149,35 @@
s import
+ PartialOrderTuple,
filter_
@@ -195,18 +195,8 @@
tten
-, toposort
%0A%0A__
@@ -251,18 +251,8 @@
expr
-, key=None
):%0A
@@ -391,184 +391,8 @@
d%60s.
-%0A%0A :param expr: The :class:%60devito.Eq%60 from which the :class:%60Dimension%60s are%0A extracted.%0A :... |
b776b512efc9838fde677f17170d6ce3cdecb400 | Update image-smoother.py | Python/image-smoother.py | Python/image-smoother.py | # Time: O(m * n)
# Space: O(1)
# Given a 2D integer matrix M representing the gray scale of an image,
# you need to design a smoother to make the gray scale of each cell becomes
# the average gray scale (rounding down) of all the 8 surrounding cells and itself.
# If a cell has less than 8 surrounding cells, then use ... | Python | 0 | @@ -1688,8 +1688,794 @@
result%0A
+# Another solution with getGray function simplified. %0Aclass Solution(object):%0A def imageSmoother(self, M):%0A %22%22%22%0A :type M: List%5BList%5Bint%5D%5D%0A :rtype: List%5BList%5Bint%5D%5D%0A %22%22%22%0A def getGray(M, i, j):%0A ... |
5292a379a7ebe316f92cae55d5af82b5323b9c1b | raise an exception if site_user_id is not passed to the interface server | hiispider/metacomponents/interface.py | hiispider/metacomponents/interface.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Executes new jobs on behalf of the Django application."""
from uuid import uuid4
from twisted.internet.defer import inlineCallbacks, returnValue
from hiispider.components import *
from hiispider.metacomponents import *
import logging
LOGGER = logging.getLogger(__name... | Python | 0.000001 | @@ -1410,16 +1410,116 @@
d', '')%0A
+ if not user_id:%0A raise Exception(%22site_user_id is a required keyword argument.%22)%0A
|
33fa48fda47fee09bc335bb166aa4621ffbfc78a | add mysql password | sns/views.py | sns/views.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Chunyang Guo
#
# Copyright (C) 2016 Zhihu Inc.
from __future__ import absolute_import
import json
import time
import tornado.web
import MySQLdb
import uuid
from sns import wrapper
from qiniu import Auth, put_file, etag, urlsafe_base64_encode
import qiniu.con... | Python | 0.000268 | @@ -333,16 +333,25 @@
word = %22
+sl2887729
%22%0A%0Aqiniu
|
87d15e732c0465ae2e243bff5d4f58cd620444b5 | Use NVE method in test instead of Brownian | hoomd/md/pytest/test_zero_momentum.py | hoomd/md/pytest/test_zero_momentum.py | import hoomd
import numpy as np
import pytest
def test_before_attaching():
trigger = hoomd.trigger.Periodic(100)
zm = hoomd.md.update.ZeroMomentum(trigger)
assert zm.trigger is trigger
trigger = hoomd.trigger.Periodic(10, 30)
zm.trigger = trigger
assert zm.trigger is trigger
def test_after_a... | Python | 0 | @@ -403,199 +403,8 @@
y):%0A
- brownian = hoomd.md.methods.Brownian(filter=hoomd.filter.All(),%0A kT=hoomd.variant.Constant(2.0),%0A seed=2)%0A%0A
@@ -457,24 +457,82 @@
_factory())%0A
+ nve = hoomd.md.methods.NVE(filter=hoomd.... |
b20d203656c8a1f1d364a0bce6cae49d593ddfd1 | fix show details button on notification window | src/lib/mechanic/ui/windows/notification.py | src/lib/mechanic/ui/windows/notification.py | from AppKit import NSImage
from vanilla import *
from mechanic import logger
from mechanic.threaded import Threaded
from mechanic.ui import progress
from mechanic.ui.font import Font
from mechanic.storage import Storage
from mechanic.extension import Extension
from mechanic.update import Update
from mechanic.ui.window... | Python | 0 | @@ -44,9 +44,34 @@
ort
-*
+ImageView, TextBox, Button
%0A%0Afr
@@ -243,49 +243,8 @@
age%0A
-from mechanic.extension import Extension%0A
from
@@ -322,16 +322,68 @@
eWindow%0A
+from mechanic.ui.windows.main import MechanicWindow%0A
%0A%0Aclass
@@ -2254,16 +2254,23 @@
cWindow(
+).open(
'updates
|
2382c2df2da5a2642c67933ecc89995ea6e35bb1 | Fix Jasmine unit tests failing | horizon/test/jasmine/jasmine_tests.py | horizon/test/jasmine/jasmine_tests.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
# distributed under t... | Python | 0.000016 | @@ -819,80 +819,8 @@
s',%0A
- 'horizon/js/angular/controllers/metadata-widget-controller.js',%0A
@@ -972,37 +972,37 @@
angular/
-help-panel/help-panel
+bind-scope/bind-scope
.js',%0A
@@ -1016,29 +1016,29 @@
angular/
-wizard/wizard
+charts/charts
.js',%0A
@@ -1052,27 +1052,36 @@
angular/
-table/ta... |
972bf4cbabf517e17a717ca02faa279f8bb67fea | set method instead of a set literal for py2 compatibility. | python-processing/src/main/python/add_keyword_slice.py | python-processing/src/main/python/add_keyword_slice.py | import codecs
import sys
from os import listdir
from os.path import isfile, join
import numpy as np
from scipy.sparse.coo import coo_matrix
from scipy.io import mmwrite
import six
from feature_extraction import vectorize_and_transform, apply_threshold, \
lemma_tokenizer, PosTagLemmaTokenizer
from evaluate_link_pr... | Python | 0 | @@ -549,17 +549,21 @@
er() in
-%7B
+set((
'y', 'ye
@@ -577,17 +577,18 @@
, 'true'
-%7D
+))
:%0A pr
|
37bbc95db3a52df13af2ba5714bf191f52d8d366 | support png format images for imagebytestomat (#417) | 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 | @@ -1458,16 +1458,32 @@
idth=-1,
+ image_codec=-1,
bigdl_t
@@ -2242,32 +2242,197 @@
esize the image%0A
+ :param image_codec specifying the color type of a loaded image, same as in OpenCV.imread.%0A By default is Imgcodecs.CV_LOAD_IMAGE_UNCHANGED(-1)%0A
:return
@@ -2610,29 +2610,87 @@
... |
86ef419b5cf71429ab192d0cf77fba0998cbee9d | Add `--hemisphere` option to python/generate_example_doosabin_regression_problem.py | python/generate_example_doosabin_regression_problem.py | python/generate_example_doosabin_regression_problem.py | # generate_example_doosabin_regression_problem.py
# Imports
import argparse
import numpy as np
from sklearn.neighbors import NearestNeighbors
# Requires subdivision/doosabin on `PYTHONPATH`.
import doosabin
# Requires common/python on `PYTHONPATH`.
from face_array import sequence_to_raw_face_array
impo... | Python | 0.998471 | @@ -601,16 +601,93 @@
=0.05)%0D%0A
+ parser.add_argument('--hemisphere', default=False, action='store_true')%0D%0A
pars
@@ -1249,16 +1249,78 @@
ewaxis%5D%0D
+%0A if args.hemisphere:%0D%0A Y%5BY%5B:, 2%5D %3C 0.0, 2%5D *= -1.0%0D
%0A%0D%0A #
|
89e8f4b06e8f433c0bc80b4a2e72cbe02b4fa6b8 | Merge from andrea4ever repository | stock_picking_package_preparation_line/tests/test_package_preparation_line.py | stock_picking_package_preparation_line/tests/test_package_preparation_line.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Francesco Apruzzese
# Copyright 2015 Apulia Software srl
#
# 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 | @@ -3809,32 +3809,572 @@
cking_ids), 1)%0A%0A
+ def test_change_qty_on_preparation_line(self):%0A # ---- Create a Preparation Line, then change qty on line%0A # Test if qty on stock move are equals to qty on Preparation Line%0A self._create_line(self.preparation, self.product2, 3.0)%0A ... |
f5ede7288175d4751edbbec4c5e04c9cef29d910 | fix log.py | raspisump/log.py | raspisump/log.py | import time
def log_reading(water_depth):
"""Log time and water depth reading."""
time_of_reading = time.strftime("%H:%M:%S,")
filename = "/home/pi/raspi-sump/csv/waterlevel-{}.csv".format(
time.strftime("%Y%m%d")
)
csv_file = open(filename, 'a')
csv_file.write(time_of_reading),
cs... | Python | 0.000002 | @@ -391,8 +391,260 @@
close()%0A
+%0A%0Adef log_restarts(reason):%0A '''Log all process restarts'''%0A logfile = open(%22/home/pi/raspi-sump/logs/process_log%22, 'a')%0A logfile.write(time.strftime(%22%25Y-%25m-%25d %25H:%25M:%25S,%22)),%0A logfile.write(reason),%0A logfile.write(%22%5Cn%22)%0A logfi... |
ad604f656a1b65debd361d412cdd25779587a0e8 | Update rollback for MySQL | ORM/MySQL/mysqlbase.py | ORM/MySQL/mysqlbase.py | #!/usr/bin/env python3.4
# -*- coding: utf-8 -*-
__author__ = 'Moskvitin Maxim'
from ORM.MySQL.mysqlmeta import *
from ORM.utils.extendableobject import *
from ORM.exceptions import *
class MySQLBase(metaclass=MySQLMeta):
fields = []
last_valid_state = {}
is_valid = True
commit_method = ""
fields... | Python | 0.000001 | @@ -1611,51 +1611,8 @@
lue)
-%0A self.keep_state_as_valid()
%0A%0A
@@ -2330,39 +2330,45 @@
self.
-is_valid = True
+keep_state_as_valid()
%0A%0A def __
@@ -2866,363 +2866,8 @@
e)%0A%0A
- def validate(self):%0A if self.is_valid:%0A return%0A if self.last_valid_s... |
38a4094591c3795919b1786e0fb10ca79ab74aa4 | Fix test | bluebottle/time_based/tests/test_notifications.py | bluebottle/time_based/tests/test_notifications.py | from bluebottle.activities.messages import ActivityRejectedNotification, ActivityCancelledNotification, \
ActivitySucceededNotification, ActivityRestoredNotification, ActivityExpiredNotification
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.utils import NotificationT... | Python | 0.000004 | @@ -4250,21 +4250,20 @@
enbauer
-appli
+join
ed to yo
|
94cfc4f398c56eae218db3cd1da673e5eb680113 | Add semesterpage app | kokekunster/settings.py | kokekunster/settings.py | """
Django settings for kokekunster project.
Generated by 'django-admin startproject' using Django 1.8.4.
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 ... | Python | 0.000001 | @@ -1063,16 +1063,36 @@
files',%0A
+ 'semesterpage',%0A
)%0A%0AMIDDL
|
77047fcc13431b07ddc468fd1f8da170c327d000 | Add SECCLOCK to parse bare second numbers like :22 | pytimeparse/timeparse.py | pytimeparse/timeparse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
timeparse.py
(c) Will Roberts <wildwilhelm@gmail.com> 1 February, 2014
Implements a single function, `timeparse`, which can parse various
kinds of time expressions.
'''
# MIT LICENSE
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy ... | Python | 0.000002 | @@ -1724,16 +1724,60 @@
r'%5B,/%5D'%0A
+SECCLOCK = r':(?P%3Csecs%3E%5Cd%7B2%7D(?:%5C.%5Cd+)?)'%0A
MINCLOCK
@@ -2697,24 +2697,78 @@
=DAYCLOCK),%0A
+ r'%7BSECCLOCK%7D'.format(%0A SECCLOCK=SECCLOCK),%0A
%5D%0A%0AMULTI
@@ -3398,32 +3398,64 @@
('1:24')%0A 84%0A
+ %3E%3E%3E timeparse(':22')%0A ... |
a00bd97721c4385885fd42f49506972781fb3b8b | Decrease sleep time | src/Notification/Subscriber/LED/RGB.py | src/Notification/Subscriber/LED/RGB.py | import time
import RPi.GPIO as GPIO
class RGB:
def __init__(self, configuration):
self._id = configuration['id']
self._R = configuration['channels']['r']
self._G = configuration['channels']['g']
self._B = configuration['channels']['b']
pins = [
self._R,
... | Python | 0.000554 | @@ -650,33 +650,33 @@
time.sleep(0.0
-2
+1
)%0A for i
@@ -758,17 +758,17 @@
leep(0.0
-2
+1
)%0A
|
0c84ce87e7aaf6b6daa190ef29ca7b66c6cf6784 | Version bump 0.0.35 -> 0.0.36 | dpa/__init__.py | dpa/__init__.py | __version__ = '0.0.35'
| Python | 0 | @@ -17,7 +17,7 @@
.0.3
-5
+6
'%0A
|
e7361737f68d73fcc87c6b09b7b34e010cb6044a | Test engine redundant code removal | rally/benchmark/utils.py | rally/benchmark/utils.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | Python | 0.000001 | @@ -1958,364 +1958,8 @@
5)%0A%0A
- running = processes.keys()%0A while 1:%0A for process in running:%0A if not processes%5Bprocess%5D.is_alive():%0A running.remove(process)%0A item = self._q.get()%0A res%5Bitem%5B'proc_nam... |
0ec4a20474a09f58330ed2a7571f7b91b95989c9 | Fix broken link to terms & conditions | enrolment/forms.py | enrolment/forms.py | import http
from directory_validators import enrolment as shared_validators
from directory_validators.constants import choices
import requests
from django import forms
from django.utils.safestring import mark_safe
from enrolment import constants, fields, helpers, validators
MESSAGE_COMPANY_NOT_FOUND = 'Company not... | Python | 0 | @@ -119,16 +119,63 @@
choices
+%0Afrom directory_constants.constants import urls
%0A%0Aimport
@@ -1711,37 +1711,21 @@
a href=%22
-/terms_and_conditions
+%7Burl%7D
%22 target
@@ -1803,16 +1803,75 @@
ervice.'
+.format(%0A url=urls.TERMS_AND_CONDITIONS_URL)
%0A
@@ -4362,29 +4362,13 @@
ef=%22
... |
a3357cd4bb0859f480fa91f50604a2f129431096 | Exclude upper case letters from generated passwords. | eduid_signup/vccs.py | eduid_signup/vccs.py | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password... | Python | 0.000755 | @@ -623,16 +623,38 @@
ength'),
+ no_capitalize = True,
no_symb
|
cd198b51d2c9271255b5e79a2216964c6d1ccd46 | Bump version to 0.0.12 | escpos/__init__.py | escpos/__init__.py | # -*- coding: utf-8 -*-
#
# escpos/__init__.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | Python | 0 | @@ -651,12 +651,12 @@
= '0.0.1
-1
+2
'%0A%0A
|
45f890b81d500f0d35c848fa1c5f926f145d9c1c | fix version so setuptools quits complaining | hadmin/__init__.py | hadmin/__init__.py | __version__ = '0.3.dev'
| Python | 0 | @@ -15,10 +15,11 @@
'0.3.dev
+0
'%0A
|
5af2ddef6c02d2650028e3b059a2f350599cb8e9 | Set module installable | hr_attendance_analysis/__openerp__.py | hr_attendance_analysis/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-15 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or m... | Python | 0.000001 | @@ -1846,12 +1846,11 @@
e%22:
-Fals
+Tru
e%0A%7D%0A
|
37f62628df3e79badc2a82460f336c99bb18634b | change handling for older ffmpeg version | haffmpeg/sensor.py | haffmpeg/sensor.py | """For HA camera components."""
import logging
import queue
import re
from time import time
from .core import HAFFmpegWorker, HAFFMPEG_QUEUE_END, FFMPEG_STDOUT
_LOGGER = logging.getLogger(__name__)
class SensorNoise(HAFFmpegWorker):
"""Implement a noise detection on a autio stream."""
STATE_NONE = 0
ST... | Python | 0 | @@ -3381,12 +3381,10 @@
d,.*
-(
%5Cd
-)
,.*%5C
@@ -5999,36 +5999,17 @@
frame =
-int(frames.group(1))
+0
%0A
@@ -6112,81 +6112,21 @@
-# other repeat frame%0A tmp
+re
_frame
++
=
-int(frames.group(1))
+1
%0A%0A
@@ -6159,16 +6159,16 @@
ready?%0A
+
@@ -6185,20 +6185,... |
91a5baee68870f3668f9495d919208d898f6c920 | disable broken test | tests/test_atmosphere.py | tests/test_atmosphere.py | import numpy as np
from acoustics.atmosphere import Atmosphere
from tests.get_data_path import data_path
class TestAtmosphere:
def test_standard_atmosphere(self):
a = Atmosphere()
"""Default values."""
assert(a.temperature == 293.15)
assert(a.pressure ==... | Python | 0.000002 | @@ -2462,16 +2462,17 @@
+#
print(ir
@@ -2492,24 +2492,25 @@
%0A
+#
assert(True=
@@ -2534,16 +2534,17 @@
+#
signal =
@@ -2563,24 +2563,25 @@
es)%0A
+#
ir = np.sque
@@ -2596,16 +2596,17 @@
+#
out = ff
|
94b468fa101a9ea1eab70e35faed24359d0b8e3a | Set initial value for thruster | app/pwm.py | app/pwm.py | #!/usr/bin/env python3
from PWM import PWMController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
import time
DEVICE = "PWM/Servo"
class Handler:
def __init__(self, logger):
self.logger = logger
self.pwm = PWMController()
self.lo... | Python | 0.000003 | @@ -3170,19 +3170,19 @@
, 1, 0,
-271
+400
)%0A%0A d
|
3f6bdfc418de5cde7a10e498f6eb3644a0f0fd96 | Check identifier type before decoding identifier | recommends/converters.py | recommends/converters.py | from collections import defaultdict
from django.apps import apps
def model_path(obj):
return '%s.%s' % (obj._meta.app_label, obj._meta.object_name.lower())
class IdentifierManager(object):
_sites = None
_ctypes = None
@property
def sites(self):
if self._sites is None:
from d... | Python | 0.000001 | @@ -1267,32 +1267,76 @@
)%60%60%0A %22%22%22%0A
+ if type(identifier) is not str:%0A
identifi
|
14bbe582d2d47444b7151916abd3731cd4f9c8e7 | Remove unused variable. | tests/test_column_dep.py | tests/test_column_dep.py | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2014, MIT Probabilistic Computing Project
#
# 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/LICENS... | Python | 0.000001 | @@ -1560,89 +1560,8 @@
)).T
-%0A data_csv = %5B'x,y,z,v,w'%5D+%5B','.join(str(val) for val in row) for row in data%5D
%0A%0A
|
d52830e5722614d7ab4e8f416f548bb6e388a238 | add matrix encoder | hal/data/matrix.py | hal/data/matrix.py | #!/usr/bin/env python
# coding: utf-8
""" Functions to deal with matrices """
import numpy as np
class Matrix:
def __init__(self, matrix):
self.matrix = matrix
def precision(self):
"""
:return: float
Calculates accuracy on database
"""
true_pos = self.ma... | Python | 0.000002 | @@ -92,16 +92,63 @@
y as np%0A
+from sklearn.preprocessing import LabelEncoder%0A
%0A%0Aclass
@@ -4675,20 +4675,277 @@
umn_names, new_data%0A
+%0A def encode(self):%0A %22%22%22%0A :return: tuple (LabelEncoder, matrix)%0A Encoder, encoded matrix%0A %22%22%22%0A%0A lb = Labe... |
0796791ad94f31a1e97dac42c29210af6fb0ea69 | Make backends/template a valid Python file | src/minimalkb/backends/template.py | src/minimalkb/backends/template.py | import logging; logger = logging.getLogger("minimalKB."+__name__);
DEBUG_LEVEL=logging.DEBUG
class TemplateBackend:
def __init__(self):
def clear(self):
""" Empties all knowledge models.
"""
raise NotImplementedError()
def add(self, stmts, model = "default"):
""" Add the ... | Python | 0.002954 | @@ -134,16 +134,29 @@
_(self):
+%0A pass
%0A%0A de
|
2ed4867602bf02640ff86160a994c567c974e70d | Add 'set active account' logic to CLI | sqrl/sqrl.py | sqrl/sqrl.py | #!/usr/bin/env python
# TODO Catch connection errors
# TODO Catch sqrlurl format errors
# TODO Add logging option
"""
Usage: sqrl [-d] [-n] [-l] [--create="<Users Name>"] [--path=<Dir>] [<SQRLURL>]
Options:
-d Debugging output
-l List Accounts
-c <Your Name> Create Account
-n ... | Python | 0.000004 | @@ -139,16 +139,35 @@
-n%5D %5B-l%5D
+ %5B--id %3CAccountID%3E%5D
%5B--crea
@@ -175,14 +175,8 @@
e=%22%3C
-Users
Name
@@ -252,16 +252,61 @@
output%0A
+ -id Set an account as Default%0A
-l
@@ -1130,16 +1130,80 @@
(path)%0A%0A
+ if account_id:%0A select_account(manager, account_id)... |
3a7ac1e8be7fa4b8ff34108d2aea235873056815 | fix unit test bug intro'ed by change dccc5a57797e | bin/tests/spiders_dot_py_tests.py | bin/tests/spiders_dot_py_tests.py | """This module contains "unit" tests for ```spiders.py```."""
import subprocess
import unittest
from nose.plugins.attrib import attr
@attr('integration')
class TestSpidersDotPy(unittest.TestCase):
def test_all_good(self):
p = subprocess.Popen(
['spiders.py'],
stdout=subprocess.P... | Python | 0 | @@ -56,16 +56,28 @@
%60%60.%22%22%22%0A%0A
+import json%0A
import s
@@ -1243,77 +1243,268 @@
-self.assertEqual(%0A stdout_and_stderr,%0A (%0A
+expected_stdout_and_stderr = %7B%0A %22cloudfeaster.samples.pypi_spider.PyPISpider%22: %7B%0A %22url%22: %22http://pypi-r... |
b03ed6307bd1354b931cdd993361d0a40a1d6850 | Reorder imports in alphabetical order | api/init/graphqlapi/proxy.py | api/init/graphqlapi/proxy.py | import graphqlapi.utils as utils
from graphql.parser import GraphQLParser
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphqlapi.exceptions import RequestException
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | Python | 0.000866 | @@ -42,36 +42,46 @@
phql
-.parser import GraphQLParser
+api.exceptions import RequestException
%0Afro
@@ -157,46 +157,36 @@
phql
-api.exceptions import RequestException
+.parser import GraphQLParser
%0A%0A%0Ai
|
d67ece5a1da17012eca3dbe59d5622dfbf7d1dbf | Fix docstring | salt/utils/smtp.py | salt/utils/smtp.py | # -*- coding: utf-8 -*-
'''
Return salt data via email
The following fields can be set in the minion conf file:
smtp.from (required)
smtp.to (required)
smtp.host (required)
smtp.port (optional, defaults to 25)
smtp.username (optional)
smtp.password (optional)
smtp.tls (optional, defaults t... | Python | 0.00003 | @@ -428,23 +428,23 @@
smtp.
-message
+content
(option
|
53e683f5219788247f93031c8b549aa80be6f77e | Remove relative import | src/ggrc_basic_permissions/contributed_roles.py | src/ggrc_basic_permissions/contributed_roles.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: david@reciprocitylabs.com
from ggrc.extensions import get_extension_modules
from .roles import (
Aud... | Python | 0.000001 | @@ -290,16 +290,38 @@
es%0Afrom
+ggrc_basic_permissions
.roles i
|
6a2fe29ecb88ad1e34b8ea518eb7f9686962027e | Stop matching to deprecated keywords in kulke importer | events/keywords.py | events/keywords.py | import re
from events.models import Keyword, KeywordLabel, DataSource
from difflib import get_close_matches
ENDING_PARENTHESIS_PATTERN = r' \([^)]+\)$'
class KeywordMatcher(object):
def __init__(self):
label_to_keyword_ids = {}
self.name_to_keyword_ids = {}
for label_id, keyword_id in Keyw... | Python | 0 | @@ -4059,16 +4059,34 @@
word_ids
+, deprecated=False
)%0A
|
28f5034bea422494835cac883db812fdc26fe1db | changed frameon default to False | scanpy/settings.py | scanpy/settings.py | """Settings
"""
verbosity = 1
"""Set global verbosity level.
Level 0: only show 'error' messages.
Level 1: also show 'warning' messages.
Level 2: also show 'info' messages.
Level 3: also show 'hint' messages.
Level 4: also show very detailed progress.
Level 5: also show even more detailed progress.
etc.
"""
plot_suf... | Python | 0.998326 | @@ -1597,19 +1597,20 @@
ameon =
-Tru
+Fals
e%0A%22%22%22See
@@ -1880,19 +1880,20 @@
frameon=
-Tru
+Fals
e, vecto
@@ -2549,20 +2549,23 @@
efault:
-True
+%60False%60
)%0A
@@ -2558,36 +2558,61 @@
False%60)%0A
-Plot
+Add frames and axes labels to
scatter plots w
@@ -2619,21 +2619,22 @@
ith
-frame... |
38db47aa8e2154139e6a9d15b261ed03fd221bdf | Use the new GYP_USE_SEPARATE_MSPDBSRV flag on the Win builder (2nd attempt). | masters/master.chromium/master_full_cfg.py | masters/master.chromium/master_full_cfg.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from master import master_config
from master.factory import chromium_factory
import master_site_config
ActiveMaster = master_site_config.Chromium
defa... | Python | 0.000032 | @@ -1883,33 +1883,34 @@
GYP_
-LINK_CONCURRENCY_MAX
+USE_SEPARATE_MSPDBSRV
': '
-4
+1
',%0A
|
217dfcf73788380a531f4e53a239849e7f8b5101 | Fix status-based counters. | api_v3/serializers/ticket.py | api_v3/serializers/ticket.py | from datetime import datetime
from rest_framework_json_api import serializers
from api_v3.models import Profile, Ticket
from .profile import ProfileSerializer
class TicketSerializer(serializers.ModelSerializer):
included_serializers = {
'users': 'api_v3.serializers.ProfileSerializer',
'responde... | Python | 0 | @@ -4307,16 +4307,143 @@
set())%0A%0A
+ # Reset status filters to gather proper counts.%0A queryset = queryset %7C queryset.filter(status=Ticket.STATUSES)%0A%0A
|
a5d9a1806225a5bbc50f57d3f190de3dee34ee59 | Support no_match_error in selects.with_or(). | lib/selects.bzl | lib/selects.bzl | # Copyright 2017 The Bazel 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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Python | 0 | @@ -680,32 +680,51 @@
th_or(input_dict
+, no_match_error=''
):%0A %22%22%22Drop-in
@@ -1023,16 +1023,93 @@
R %60...%60.
+%0A no_match_error: Optional custom error to report if no condition matches.
%0A%0A
@@ -1710,16 +1710,47 @@
ut_dict)
+, no_match_error=no_match_error
)%0A%0A%0Adef
|
932331600f07342ffd9a3877ebbb02269cc238e4 | add missing type annotation | eli5/sklearn/text.py | eli5/sklearn/text.py | from __future__ import absolute_import
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from sklearn.feature_extraction.text import VectorizerMixin
from sklearn.pipeline import FeatureUnion
from eli5.base import (
DocWeightedSpans, WeightedSpans, FeatureWeights, FeatureWeight,
TargetExplanat... | Python | 0.000004 | @@ -5066,16 +5066,46 @@
= set()
+ # type: Set%5BTuple%5Bstr, int%5D%5D
%0A for
|
7fc6a46f3ccadf127c8db279fbe1c96f1a7ced30 | add testcase | tests/test_controller.py | tests/test_controller.py | import functools as ft
import unittest as ut
from unittest import mock as utm
from pyfakefs import fake_filesystem as ffs
from ddld import controller as ctrl
from . import util as u
class TestDownloadController(ut.TestCase):
@utm.patch('wcpan.worker.AsyncQueue', autospec=True)
def testDownloadFrom(self, Fa... | Python | 0.000022 | @@ -2909,16 +2909,181 @@
b, a)%0A%0A%0A
+class TestSearchEngine(ut.TestCase):%0A%0A def testNormalization(self):%0A rv = ctrl.normalize_search_pattern(r'abc')%0A self.assertEqual(rv, r'.*abc.*')%0A%0A%0A
async de
|
05fc13ef7b0c48a8411252a9c05d518eac842071 | load calibration file properly; typo on variable name | stephmeter.py | stephmeter.py | #!/home/pi/.virtualenvs/stephmeter/bin/python
import nextbus
import pwm_calibrate
import led
import time
from settings import *
def main():
l = led.LED(SERIAL_DEVICE, SERIAL_SPEED)
p = pwm_calibrate.PWMCalibrator()
p_range = p.get_range()
nb = nextbus.NextbusPredictor(NEXTBUS_ROUTES)
while True:
nb.refresh_if... | Python | 0.000001 | @@ -212,16 +212,26 @@
rator()%0A
+%09p.load()%0A
%09p_range
@@ -522,17 +522,17 @@
255)%0A%09%09
-P
+p
.setPWM(
|
9e5583ab08bb40d0cedd4931a2fde59b2040d554 | fix error when no ssid is found in db | attendance/management/commands/update_ssid.py | attendance/management/commands/update_ssid.py | from django.core.management import BaseCommand
from attendance.models import SSIDName
class Command(BaseCommand):
help = 'Generates a new ssid(need to run as a cron job everyday)'
def handle(self, *args, **options):
ssid_name = SSIDName.objects.first()
ssid_name.generate_random_name()
... | Python | 0 | @@ -238,16 +238,25 @@
sid_name
+, created
= SSIDN
@@ -271,14 +271,26 @@
cts.
-first(
+get_or_create(id=1
)%0A
|
9dfe775ac99f68ee746b92995d36afdf8e7de1cb | South migration module is cities_light.south_migrations | test_project/test_project/settings.py | test_project/test_project/settings.py | # Django settings for test_project project.
import os.path
import django
if django.VERSION < (1, 7):
SOUTH_MIGRATIONS_MODULES = {
'cities_light': 'cities_light.south_migrations',
}
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
DATAB... | Python | 0.999324 | @@ -71,40 +71,8 @@
go%0A%0A
-if django.VERSION %3C (1, 7):%0A
SOUT
@@ -96,20 +96,16 @@
LES = %7B%0A
-
'cit
@@ -149,20 +149,16 @@
tions',%0A
-
%7D%0A%0ADEBUG
|
230802ee222a6850618517674b991e93a9ed9e6b | Add multiple columns simultaneously | zerver/lib/migrate.py | zerver/lib/migrate.py | import re
import time
def timed_ddl(db, stmt):
print
print time.asctime()
print stmt
t = time.time()
db.execute(stmt)
delay = time.time() - t
print 'Took %.2fs' % (delay,)
def validate(sql_thingy):
# Do basic validation that table/col name is safe.
if not re.match('^[a-z][a-z\d_]+$... | Python | 0 | @@ -430,21 +430,23 @@
ble, col
+s
, val
+s
, batch_
@@ -481,32 +481,57 @@
validate(table)%0A
+ for col in cols:%0A
validate(col
@@ -581,16 +581,19 @@
SET
+(
%25s
+)
=
-%25
+(
%25s
+)
%0A
@@ -640,28 +640,86 @@
' %25 (table,
-col)
+', '.join(cols), ', '.join(%5B'%25s'%5D * len(cols)))%0A p... |
d4f7055bd6e0952cb41e63fff4f00c1065387bb6 | Use the long form of the month in breadcrumb | zinnia/breadcrumbs.py | zinnia/breadcrumbs.py | """Breadcrumb module for Zinnia"""
import re
from functools import wraps
from datetime import datetime
from django.utils.dateformat import format
from django.utils.timezone import is_aware
from django.utils.timezone import localtime
from django.core.urlresolvers import reverse
from django.utils.translation import uget... | Python | 0.005191 | @@ -856,17 +856,17 @@
_date, '
-b
+F
').capit
|
915f1d66e894afe8d3b14482f3d210a388961d82 | fix for not having python in path | scripts/windows.py | scripts/windows.py | #!/usr/bin/env python3
import os
import requests
import subprocess
import buildtools.deps as deps
import buildtools.cmake as cmake
import buildtools.args as args
import buildtools.visualstudio as visualstudio
def get_root_folder():
return os.getcwd()
def get_build_folder():
return os.path.join(get_root_fol... | Python | 0.000001 | @@ -1076,21 +1076,18 @@
):%0A r
-eturn
+ =
cmake.C
@@ -1440,32 +1440,134 @@
der())%5C%0A
+.add_argument('PROTOBUF_SRC_ROOT_FOLDER', get_proto_folder())%0A if 'PYTHON' in os.environ:%0A r
.add_argument('P
@@ -1634,79 +1634,21 @@
xe')
-%5C
%0A
- .add_argument('PROTOBUF_SRC_ROOT_FOLDER',... |
f55e3384a35b2c916171ac855d8a63469aa31935 | fix test model name | tests/test_controller.py | tests/test_controller.py | # -*- coding: utf-8 -*-
from unittest.mock import MagicMock
from pytest import raises
from smif.controller import (Controller, SectorConfigReader,
SosModel, SoSModelBuilder,
SoSModelReader)
from smif.inputs import ModelInputs
from smif.sectormodel import Sector... | Python | 0.000376 | @@ -400,23 +400,16 @@
_input,
-Example
WaterSup
@@ -412,25 +412,21 @@
rSupplyS
-imulation
+ector
Model%0A%0A%0A
@@ -4456,39 +4456,32 @@
)%0A%0A ws =
-Example
WaterSupplySimul
@@ -4472,33 +4472,34 @@
WaterSupplyS
-imulation
+ectorModel
()%0A w
@@ -4905,15 +4905,8 @@
s =
-Example
Wate
@@ -4917,... |
07d01e16bec95941ac5a85116821190c86658458 | add request data to app class | server/server.py | server/server.py | import gevent.monkey
gevent.monkey.patch_all()
from gevent.pywsgi import WSGIServer
import re
from HTTPerror import HTTP404Error
def render(filename):
with open(filename, "r") as f:
res = f.read()
return res
def index():
return render("../templates/index.html")
def name():
return render... | Python | 0 | @@ -1067,16 +1067,169 @@
STRING'%5D
+%0A for data_pair in environ%5B'wsgi.input'%5D.read().split('&'):%0A key,value=data_pair.split('=')%0A self.request%5B'data'%5D%5Bkey%5D=value
%0A%0A de
|
b6f16b8166e3a7761f607be66d46acbd37dfaf43 | Update text_classification.py (#7607) | tensorflow/examples/learn/text_classification.py | tensorflow/examples/learn/text_classification.py | # Copyright 2016 The TensorFlow 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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | Python | 0.000096 | @@ -3800,53 +3800,157 @@
TH)%0A
+ %0A
x_tra
-in = np.array(list(vocab_processor.fit
+nsform_train = vocab_processor.fit_transform(x_train)%0A x_transform_test = vocab_processor.transform(x_test)%0A %0A x_train = np.array(list(x
_tra
@@ -3959,18 +3959,16 @@
form
-(x
_train))
)%0A
@@ -3963,17 +3963,16 @@
_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.