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 |
|---|---|---|---|---|---|---|---|
0ea683383edefc79fbeb54e97ff42c7acd391561 | add users model | project/models/user.py | project/models/user.py | # -*- coding: utf-8 -*-
| Python | 0.000001 | @@ -17,8 +17,811 @@
f-8 -*-%0A
+%0A# python imports%0Afrom passlib.apps import custom_app_context as pwd_context%0A%0A# project imports%0Afrom project.extensions import db%0A%0A%0Aclass User(db.Model):%0A%09__tablename__ = 'users'%0A%09id = db.Column(db.Integer, primary_key=True)%0A%09username = db.Column(db.String(32... |
bccb40657174e2b02da96712b053ca81f143ba12 | Update version to 9.2.27.dev0 [ci skip] | claripy/__init__.py | claripy/__init__.py | #!/usr/bin/env python
# pylint: disable=F0401,W0401,W0603,
__version__ = "9.2.26.dev0"
if bytes is str:
raise Exception("This module is designed for python 3 only. Please install an older version to use python 2.")
import os
import sys
import socket
import logging
l = logging.getLogger("claripy")
l.addHandler(lo... | Python | 0 | @@ -73,17 +73,17 @@
= %229.2.2
-6
+7
.dev0%22%0A%0A
|
ce86e48c2d996af9d747927d6f1206569d604500 | use view to provide active confs | corehq/apps/userreports/data_source_providers.py | corehq/apps/userreports/data_source_providers.py | from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
from corehq.apps.userreports.models import DataSourceConfiguration, StaticDataSourceConfiguration
import six
class DataSourceProvider(six.with_metaclass(ABCMeta, object)):
@abstractmethod
def get_data_sources(self):
pass
... | Python | 0 | @@ -419,87 +419,247 @@
rn %5B
-config for config in DataSourceConfiguration.all() if not config.is_deactivated
+DataSourceConfiguration.wrap(r%5B'doc'%5D)%0A for r in%0A DataSourceConfiguration.get_db().view('userreports/active_data_sources',%0A ... |
3746d049417fbf208bf9bcf8a4a100283079f81c | rename single string tuple holders for semantics | projects_controller.py | projects_controller.py | import psycopg2
import config
PROJECTS_KEY_ORDER = ['id', 'name', 'slug', 'description', 'photo_url', 'past_project']
GET_PROJECTS_QUERY = 'SELECT project_id, name, slug, description, photo_url, past_project FROM projects ORDER BY display_order;'
GET_PROJECT_PHOTOS_QUERY = 'SELECT photo_url FROM project_photos WHERE p... | Python | 0.000042 | @@ -2894,38 +2894,42 @@
= %5B
-text_holder%5B0%5D for text_holder
+need_text_raw%5B0%5D for need_text_raw
in
@@ -3114,36 +3114,42 @@
= %5B
-url_holder%5B0%5D for url_holder
+photo_url_raw%5B0%5D for photo_url_raw
in
|
d640e1ab5297f0596fbcff5f88aa779820807505 | allow calculation of channel capacity with just conditional matrix | dit/algorithms/channelcapacity.py | dit/algorithms/channelcapacity.py | """
Simple implementation for channel capacity.
"""
import numpy as np
import dit
from ..exceptions import ditException
from ..cdisthelpers import (
cdist_array,
)
__all__ = [
'channel_capacity',
]
def channel_capacity(cdists, marginal=None, rtol=None, atol=None):
"""
Calculates the channel capacit... | Python | 0 | @@ -402,16 +402,25 @@
s : list
+, ndarray
%0A
@@ -560,16 +560,69 @@
Y %7C X=x)
+; or%0A the conditional distribution as an array
.%0A ma
@@ -2247,24 +2247,107 @@
ield cc, r%0A%0A
+ try:%0A cdists.shape%0A carr = cdists%0A except AttributeError:%0A
# Build
@@ -2367,16 ... |
4d67df23a92c92832c32f66d4dd20dfefb6a1a27 | test delete events published | corehq/ex-submodules/casexml/apps/case/tests/test_delete.py | corehq/ex-submodules/casexml/apps/case/tests/test_delete.py | from django.test import TestCase
from casexml.apps.case.cleanup import safe_hard_delete
from casexml.apps.case.exceptions import CommCareCaseError
from casexml.apps.case.mock import CaseFactory, CaseStructure, CaseIndex
from casexml.apps.case.tests.util import TEST_DOMAIN_NAME
from corehq.form_processor.exceptions imp... | Python | 0 | @@ -272,16 +272,59 @@
IN_NAME%0A
+from corehq.apps.change_feed import topics%0A
from cor
@@ -388,16 +388,16 @@
otFound%0A
-
from cor
@@ -542,16 +542,159 @@
ackends%0A
+from corehq.form_processor.utils.general import should_use_sql_backend%0Afrom testapps.test_pillowtop.utils import capture_kafka_changes_context%0A... |
0ada927ed7f4435d80db515a8b2e8e9e2c618b18 | Bump version to 0.0.1 | setuppycheck.py | setuppycheck.py | #!/usr/bin/env python
__author__ = 'Marc Abramowitz'
__version__ = '0.0.0'
import __builtin__
import logging
import mock
import os
import sys
level = logging.INFO
# level = logging.DEBUG
logging.basicConfig(level=level)
logger = logging.getLogger(__name__)
orig_open = __builtin__.open
is_setuppy_ok = True
def set... | Python | 0.000001 | @@ -66,17 +66,17 @@
= '0.0.
-0
+1
'%0A%0Aimpor
|
fa33c24a7c99825737cdf698b0541b2500c1b023 | fix pep8 warning | csmpe/core_plugins/csm_install_operations/exr/deactivate.py | csmpe/core_plugins/csm_install_operations/exr/deactivate.py | # =============================================================================
#
# Copyright (c) 2016, Cisco Systems
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source ... | Python | 0 | @@ -2888,32 +2888,16 @@
)%0A
-
%0A
|
399cb40aa42fcc6fd7b71e4d010f5adf4ca9a224 | Patch from Amos Latteier for macports libgeos | shapely/geos.py | shapely/geos.py | """
Exports the libgeos_c shared lib, GEOS-specific exceptions, and utilities.
"""
import atexit
import os
import sys
from ctypes import cdll, CDLL, PyDLL, CFUNCTYPE, c_char_p
from ctypes.util import find_library
if sys.platform == 'win32':
try:
local_dlls = os.path.abspath(os.__file__ + "../../../DLLs")
... | Python | 0 | @@ -957,16 +957,85 @@
/GEOS%22,%0A
+ # macports%0A '/opt/local/lib/libgeos_c.dylib',%0A
@@ -1161,30 +1161,24 @@
- else:%0A
+if lib is None:%0A
|
720f0926249f8f9e1d255a6d206e3f5a42bd17a4 | Connect straight to the IP | match_making/mm_server.py | match_making/mm_server.py | #!/usr/bin/env python
import socket
#Create which contains all the servers and maps they are running. This string is then send to clients.
def createServerList(serverList):
ser_string = ""
for server in serverList:
ser_string = ser_string + server[0] + " " + server[1] + "\200"
return ser_string
def getOwnA... | Python | 0 | @@ -324,352 +324,8 @@
():%0A
- #We're creating connection to google server, to find out our own IP%0A googleAddr = socket.getaddrinfo('8.8.8.8', 53)%0A #googleAddr = socket.getaddrinfo('www.google.fi', 80)%0A #Choose last tuple from the received list of addresses to get an IPv4 connection%0A googleAddr = googleAd... |
2695690b345f9835f990a631ccf0797956653904 | Bump version to 6.1.4a1 | platformio/__init__.py | platformio/__init__.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 | @@ -633,17 +633,21 @@
(6, 1,
-3
+%224a1%22
)%0A__vers
|
96957203434f5e27f0f1bf0895371d380c3cf12a | Bump version to 5.0.1a1 | platformio/__init__.py | platformio/__init__.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 | @@ -633,17 +633,21 @@
(5, 0,
-0
+%221a1%22
)%0A__vers
|
d38aed748d6fa68ae5f3418f4dcfdb6ea6f3930d | Update uniprot_proteome_table.py | apricotlib/uniprot_proteome_table.py | apricotlib/uniprot_proteome_table.py | #!/usr/bin/env python
import sys
try:
import urllib.request
from urllib.request import urlopen
except ImportError:
print('Python package urllib is missing. Please install/update.'
'Please ignore if you are only testing the example provided by APRICOT')
sys.exit(0)
__description__ = "Downloads the... | Python | 0 | @@ -189,84 +189,10 @@
ate.
-'%0A 'Please ignore if you are only testing the example provided by APRICOT
+%5Cn
')%0A
|
d6697e4c0f3155f4a1b886ea043b7ad555db82d9 | Test main.main, assert prints | tests/test_main.py | tests/test_main.py | from argparse import Namespace
from concurrent.futures import ThreadPoolExecutor
from mock import Mock
from os import path
from digestive.entropy import Entropy
from digestive.hash import MD5, SHA1, SHA256, SHA512
from digestive.io import Source
from digestive.main import file_size, parse_arguments, process_arguments,... | Python | 0.000002 | @@ -95,16 +95,23 @@
ort Mock
+, patch
%0Afrom os
@@ -284,16 +284,22 @@
le_size,
+ main,
parse_a
@@ -2565,24 +2565,661 @@
4%0A%0A
-# TODO: test main(
+%0Adef test_main():%0A with patch('builtins.print') as mocked:%0A arguments = %5B'--hashes', path.join(here, 'files/empty'), path.join(here, 'files/1234'... |
6ea3662df84c3c204fd6c023d413883f59bb3109 | tag 1.0.2 | tmuxp/__about__.py | tmuxp/__about__.py | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.0.1'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2016 Tony Narlock'
| Python | 0.000018 | @@ -59,17 +59,17 @@
= '1.0.
-1
+2
'%0A__desc
|
33155756a4354049fa4cd406a3f48a22cc9a3f77 | Save notification record between sending notif... like I do literally everywhere else. | bot/app/notifications/netstamp_handler.py | bot/app/notifications/netstamp_handler.py | import logging
from datetime import datetime
import pytz
from bot.app.notifications.notification_handler import NotificationHandler
from bot.app.notifications.social_handler import SocialEvents
from bot.utils.util import seconds_to_time
from spacelaunchnow import config
logger = logging.getLogger('bot.notifications'... | Python | 0 | @@ -490,39 +490,38 @@
ug%0A self.
-twitter
+social
_handler = Socia
@@ -761,316 +761,8 @@
f))%0A
- date = launch.net%0A message = 'SCHEDULE UPDATE: %25s now launching in %25s at %25s.' %25 (launch.name,%0A seconds_to_time(diff)... |
29ad11103d922ca1866bd0f1ef66b321c366718a | delete node if exists test works | simple_graph.py | simple_graph.py |
class Node(object):
def __init__(self, value=None):
self.value = value
class Edge(object):
def __init__(self, n1=None, n2=None):
self.n1 = n1
self.n2 = n2
class Graph(object):
def __init__(self):
self.nodes_list = []
self.edges_list = []
def nodes(self):
... | Python | 0.000001 | @@ -931,12 +931,605 @@
dd_node(n2)%0A
+%0A def del_node(self, n):%0A %22%22%22Delete specified node from the graph%22%22%22%0A # Determine if node exists in edges & remove%0A for edge in self.edges_list:%0A if n == edge.n1 or n == edge.n2:%0A self.edges_list.remove(edg... |
f70ea73c446eb327512cc9b2419df6f9bfea1db7 | Change local variables to snake case | update_licenses.py | update_licenses.py | #!/usr/bin/env python
import rdflib
from collections import OrderedDict
from pprint import pprint
import os
import sys
def get_license_ids():
graph = rdflib.Graph()
graph.parse('http://spdx.org/licenses/index.html', 'rdfa')
ref = rdflib.URIRef('http://spdx.org/rdf/terms#licenseId')
objs = graph.subjec... | Python | 0.998922 | @@ -854,33 +854,34 @@
nse_text(license
-I
+_i
d):%0A return g
@@ -895,33 +895,34 @@
nse_term(license
-I
+_i
d, %22http://spdx.
@@ -980,17 +980,18 @@
(license
-I
+_i
d):%0A
@@ -1017,25 +1017,26 @@
term(license
-I
+_i
d, %22http://s
@@ -1102,25 +1102,26 @@
term(license
-I
+_i
d, term):%0A
@@ -1212,17 +... |
a59cfae9aac914c8378e85c3b0bae6fade95182c | Check if readline.__doc__ is iterable. | click_shell/_cmd.py | click_shell/_cmd.py | """
click_shell._cmd
This module overrides the builtin python cmd module
"""
import os
from cmd import Cmd
try:
import readline
except ImportError:
try:
import pyreadline as readline
except ImportError:
readline = None
import click
from click._compat import raw_input as get_input
class... | Python | 0.000164 | @@ -2208,16 +2208,37 @@
if
+readline.__doc__ and
'libedit
|
97cdf5e8112f0725d34f28ecb494a8f6c45424a4 | Change method name | utils/link/base.py | utils/link/base.py | '''
Created on Aug 14, 2016
@author: David Zwicker <dzwicker@seas.harvard.edu>
'''
import logging
import os
import subprocess
import six
class ExecutableBase(object):
''' Base class for external programs '''
name = 'program_name'
standards_args = []
skip_stdout_lines = 0
_detected_path = ... | Python | 0.000018 | @@ -1413,20 +1413,16 @@
def
-found_execut
+is_avail
able
|
c8fd0ac7d2dc8543398bb50e90a5e10d8e2f3018 | enable one test | _unittests/ut_ml_helper/test_pandas_missing.py | _unittests/ut_ml_helper/test_pandas_missing.py | """
@brief test log(time=7s)
"""
import sys
import os
import unittest
import pandas
import numpy
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if... | Python | 0.000001 | @@ -492,17 +492,16 @@
def
-_
test_mis
|
254cba0f93f67b2ac128f8d3b689255ab6c8a3cd | Use resultcodes more | tests/mock_vws/test_database_summary.py | tests/mock_vws/test_database_summary.py | """
Tests for the mock of the database summary endpoint.
"""
from datetime import datetime, timedelta
import pytest
import requests
from freezegun import freeze_time
from requests import codes
from requests_mock import GET
from common.constants import ResultCodes
from tests.conftest import VuforiaServerCredentials
f... | Python | 0 | @@ -3230,14 +3230,30 @@
==
-'Fail'
+ResultCodes.FAIL.value
%0A%0A
|
e2ecc85de9ca6fab1947f566b8d44f484bddb1e3 | fix example autoapp | xmantissa/examples/autoapp.py | xmantissa/examples/autoapp.py |
from axiom.store import Store
from axiom.userbase import LoginSystem
from xmantissa.webadmin import DeveloperSite, DeveloperApplication, DONTUSETHISBenefactor
from xmantissa.webapp import PrivateApplication
from xmantissa.website import WebSite
from xmantissa.signup import FreeTicketSignup, TicketBooth
from xmantissa... | Python | 0.000006 | @@ -848,18 +848,22 @@
=s, port
-no
+Number
=8080).i
|
9dd8f98e736dc70ae4f1a78f13ee643a63aa2e47 | Update unit test for static metaobjet to work with new optimizations | tests/signals/static_metaobject_test.py | tests/signals/static_metaobject_test.py | #!/usr/bin/env python
"""Tests covering signal emission and receiving to python slots"""
import sys
import unittest
import functools
from PySide.QtCore import *
from helper import BasicPySlotCase, UsesQCoreApplication
class MyObject(QObject):
def __init__(self, parent=None):
QObject.__init__(self, paren... | Python | 0 | @@ -95,44 +95,16 @@
ort
-sys%0Aimport unittest%0Aimport functools
+unittest
%0A%0Afr
@@ -131,9 +131,23 @@
ort
-*
+QObject, SIGNAL
%0Afro
@@ -165,25 +165,8 @@
port
- BasicPySlotCase,
Use
@@ -542,35 +542,8 @@
()%0A%0A
- m = o.metaObject()%0A
@@ -600,17 +600,30 @@
rtEqual(
-m
+o.metaObject()
.inde... |
eb640c1966393a6ca7f6f07f4b6acf58df4d9f5f | fix archive module if-absent-path bug | sources/salt/states/archive.py | sources/salt/states/archive.py | # -*- coding: utf-8 -*-
"""
Archive states.
"""
import logging
import os
# Import salt libs
import salt.utils
from salt._compat import urlparse
log = logging.getLogger(__name__)
def extracted(name,
source,
archive_format,
tar_options=None,
source_hash=None,
... | Python | 0 | @@ -3969,24 +3969,240 @@
ce, __env__)
+%0A else:%0A ret%5B'result'%5D = True%0A ret%5B'comment'%5D = ('Any special path is existed or file sum set for file %7B0%7D of %7B1%7D is unchanged.'%0A ).format(filename, source_hash%5B'hsum'%5D)%0A return ret
%0A%0A ## pre
|
38fd8ad23dcd125c872e332cdf51d3e465924c42 | update to fix standalone testing | sparc/common/tests/test_cli.py | sparc/common/tests/test_cli.py | import unittest
from sparc.testing.fixture import test_suite_mixin
class test_suite(test_suite_mixin):
package = 'sparc.common'
module = 'cli'
if __name__ == '__main__':
unittest.main(defaultTest='test_suite') | Python | 0 | @@ -1,23 +1,40 @@
import
-unittest
+os%0Aimport zope.testrunner
%0Afrom sp
@@ -200,43 +200,256 @@
-unittest.main(defaultTest='test_suite'
+zope.testrunner.run(%5B%0A '--path', os.path.dirname(__file__),%0A '--tests-pattern', os.path.splitext(%0A ... |
d6f799d3fad549d5cfb916c23aca028459a3b74b | Fix for logging status of ads program - part 2 | telephony/advertisement_action.py | telephony/advertisement_action.py | from rootio.config import *
import json
from rootio.content.models import ContentTrack
class AdvertisementAction:
def __init__(self, track_id, start_time, duration, program):
self.__track_id = track_id
self.__track = None
self.__is_valid = True
self.start_time = start_time
... | Python | 0 | @@ -5147,38 +5147,32 @@
for_call_hangup(
-self,
event_json%5B'Call
|
a5c19cacf74fedb95c68b1c6f00e381ceb5bff8f | Fix first secret func | maine.py | maine.py | import requests
import datetime
import telebot
import pybooru
import os
from common_func import *
from urllib.request import urlopen
from flask import Flask, request
tele_api = "426351504:AAHomR1jc-m2B7iabRnOFR8OkPTKlkWMIdw"
weath_token = "795819f679706a61cd7938b26ac247af"
yan_api = "r5oUMfysc4C566kI312u_A"
bot = tel... | Python | 0.999813 | @@ -2894,52 +2894,8 @@
%0A%09%09b
-ot.send_message(message.chat.id, %22st 1%22)%0A%09%09b
itch
@@ -2909,16 +2909,25 @@
e,%22start
+%22, %22bitch
%22)%0A%09%09day
|
c24d8ba725168ffe57fb4e8de45a7a51ec004227 | make tests work in development + master | test/integration/006_simple_dependency_test/test_simple_dependency_with_configs.py | test/integration/006_simple_dependency_test/test_simple_dependency_with_configs.py | from test.integration.base import DBTIntegrationTest
class BaseTestSimpleDependencyWithConfigs(DBTIntegrationTest):
def setUp(self):
DBTIntegrationTest.setUp(self)
self.run_sql_file("test/integration/006_simple_dependency_test/seed.sql")
@property
def schema(self):
return "simple_... | Python | 0 | @@ -873,32 +873,37 @@
gration-project@
+with-
configs'%0A
@@ -887,32 +887,32 @@
t@with-configs'%0A
-
%5D%0A
@@ -1810,32 +1810,37 @@
gration-project@
+with-
configs'%0A
@@ -2841,32 +2841,37 @@
gration-project@
+with-
configs'%0A
@@ -4148,32 +4148,32 @@
epositories%22: %5B%0A
-... |
cdd4a34559a7f1281399288d943f1158857f2829 | Add vpc_network to create_routers | qingcloud/cli/iaas_client/actions/router/create_routers.py | qingcloud/cli/iaas_client/actions/router/create_routers.py | # =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | Python | 0.000001 | @@ -1288,25 +1288,17 @@
eate.')%0A
-
%0A
+
@@ -1464,25 +1464,17 @@
uters')%0A
-
%0A
+
@@ -1718,24 +1718,25 @@
ified')%0A
+%0A
%0A @cl
@@ -1727,16 +1727,261 @@
+parser.add_argument('-n', '--vpc_network', dest='vpc_network',%0A action='store'... |
0e45ad2d7f459ecf6a7068b9309b27a9aa4208e3 | remove invalid homepage (#28269) | var/spack/repos/builtin/packages/r-illuminahumanmethylationepicmanifest/package.py | var/spack/repos/builtin/packages/r-illuminahumanmethylationepicmanifest/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RIlluminahumanmethylationepicmanifest(RPackage):
"""Manifest for Illumina's EPIC methylati... | Python | 0 | @@ -331,80 +331,8 @@
%22%22%0A%0A
- homepage = %22https://bitbucket.com/kasperdanielhansen/Illumina_EPIC%22%0A
|
4324c02773aa4bcfc916552ab35dd99a3187b154 | Add tokens parsing. | micro.py | micro.py | #!/usr/bin/env python
from sys import argv
def get_code():
return argv[1]
if __name__ == '__main__':
code = get_code()
print(code)
| Python | 0 | @@ -71,16 +71,63 @@
rgv%5B1%5D%0A%0A
+def get_tokens(code):%0A%09return code.split(' ')%0A%0A
if __nam
@@ -169,16 +169,45 @@
()%0A%09
-print(code
+tokens = get_tokens(code)%0A%09print(tokens
)%0A
|
d2150bbf65c190d0c92c99b1206222df867c6cb1 | bump version to 0.1.8 | cms_saq/__init__.py | cms_saq/__init__.py | __version__ = "0.1.7"
| Python | 0 | @@ -16,7 +16,7 @@
0.1.
-7
+8
%22%0A
|
d3c941ad4a955043fa41bfb800f6310e6f91a7bc | Modify return tag search data with tag name | coco/users/views.py | coco/users/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.shortcuts import redirect
# from django.contrib.auth.decorators import login_required
from forms import Lo... | Python | 0.000001 | @@ -17,16 +17,17 @@
f-8 -*-%0A
+%0A
from dja
|
883128e89bd1d359364d0621bab30c214e27a173 | Version bump | mkenv.py | mkenv.py | """
mkenv creates virtualenvs.
By default it places them in the appropriate data directory for your platform
(See `appdirs <https://pypi.python.org/pypi/appdirs>`_), but it will also
respect the :envvar:`WORKON_HOME` environment variable for compatibility with
:command:`mkvirtualenv`.
"""
import argparse
import os
i... | Python | 0.000001 | @@ -404,11 +404,11 @@
%220.
-1.2
+2.0
%22%0A%0A%0A
|
146ffb3afa24a7dddc9d19a26f6b52b0260f3f2c | Remove unused function | indico/modules/rb/models/utils.py | indico/modules/rb/models/utils.py | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2013 European Organization for Nuclear Research (CERN).
##
## Indico is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; eith... | Python | 0.000004 | @@ -774,154 +774,30 @@
rom
-datetime import datetime%0Afrom functools import wraps%0Afrom dateutil.relativedelta import MO, TU, WE, TH, FR%0Afrom dateutil.rrule import rrule, DAILY
+functools import wraps
%0A%0Afr
@@ -1157,16 +1157,16 @@
rapper%0A%0A
+
retu
@@ -1189,302 +1189,8 @@
d%0A%0A%0A
-def next_work_da... |
4bf8c9ba30ba80b31318e302f1d5a2a403549d2e | Apply same padding-top on TextArea fields | indico/web/forms/jinja_helpers.py | indico/web/forms/jinja_helpers.py | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0 | @@ -833,16 +833,26 @@
Select,
+ TextArea,
HiddenI
@@ -1360,16 +1360,79 @@
idden'%7D%0A
+ if isinstance(field.widget, TextArea):%0A return True%0A
retu
|
f649acedbf06ee38b5d1255469a7ae2e57176102 | Update temperature.py | code/temperature.py | code/temperature.py | import os
import glob
import time
import subprocess
import datetime
dataFile_sensor1 = open('/home/thijs/HAB/code/results/inside.csv', 'a') #creating sensor1.txt
dataFile_sensor2 = open('/home/thijs/HAB/code/results/outside.csv', 'a')
os.system('modprobe w1-gpio') #Initializing the sensors
os.system('modprobe w1-therm... | Python | 0.000001 | @@ -156,11 +156,11 @@
or1.
-txt
+csv
%0Adat
@@ -228,16 +228,38 @@
v', 'a')
+ #creating sensor1.csv
%0Aos.syst
@@ -338,16 +338,41 @@
therm')
+#Initializing the sensors
%0A%0A#Senso
@@ -764,17 +764,16 @@
slave'%0A%0A
-
%0Adef rea
@@ -2402,16 +2402,46 @@
))+'%5Cn')
+ #output format in sensor1.csv
%0A
@@... |
86f3647531c65dbc2c940aa617625b2adc195273 | Make temporary test account respect new password rules | isaactest/utils/initialisation.py | isaactest/utils/initialisation.py | import selenium.webdriver
import time
from .log import log, INFO
from .i_selenium import new_tab, NoWebDriverException
from .isaac import TestUsers, User
from ..emails.guerrillamail import GuerrillaInbox, set_guerrilla_mail_address
def define_users():
"""Set up the TestUser object and add the temporary email addr... | Python | 0.000012 | @@ -448,16 +448,19 @@
%22, %22test
+ing
%22)%0A U
|
30103ef19635343b91ed590811639312d6f69795 | Add license text to a report test file | tests/views/hearing/text_xlsx_report.py | tests/views/hearing/text_xlsx_report.py | import pytest
from flask import url_for
from tests.factories import HearingFactory
@pytest.mark.usefixtures('request_ctx')
def test_xlsx_report_url():
assert (
url_for('hearing.report_as_xlsx', slug='some-slug') ==
'/some-slug/raportti.xlsx'
)
@pytest.mark.usefixtures('database', 'request_c... | Python | 0 | @@ -1,12 +1,742 @@
+# -*- coding: utf-8 -*-%0A# Kuulemma%0A# Copyright (C) 2014, Fast Monkeys Oy%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published by%0A# the Free Software Foundation, either version 3 of the License,... |
c743e32d7476532a5c73612eeedf52d93084ba9e | Fix float as a parameter of the listed() function | source/utils.py | source/utils.py | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Python API for the Nitrate test case management system.
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Th... | Python | 0 | @@ -5297,16 +5297,17 @@
e.days /
+/
365%0A
@@ -5359,16 +5359,17 @@
ear%22%5D) /
+/
30%0A
@@ -5460,16 +5460,17 @@
econds /
+/
3600%0A
@@ -5528,16 +5528,17 @@
our%22%5D) /
+/
60%0A
|
44a5d71858cbe3f1dd399af6991e9438a520a197 | refactor location permission resource | rhizome/api/resources/location_permission.py | rhizome/api/resources/location_permission.py | from rhizome.api.resources.base_model import BaseModelResource
from rhizome.models import LocationPermission
class LocationPermissionResource(BaseModelResource):
'''
**GET Request** This endpoint tells which locations a user is responsible for.
- *Required Parameters:*
'user_id'
- ... | Python | 0.000036 | @@ -820,37 +820,55 @@
def
-get_object_list(self, request
+apply_filters(self, request, applicable_filters
):%0A
@@ -866,35 +866,35 @@
lters):%0A
-'''
+%22%22%22
%0A In this
@@ -890,76 +890,66 @@
-In this resoruce we only override the get_object_list method so that
+This is not the locations t... |
8d61736917ad802ff02d50458cb211dc14a44198 | Remove dead code | robot/robot/src/autonomous/TwoBallHotGyro.py | robot/robot/src/autonomous/TwoBallHotGyro.py | try:
import wpilib
except ImportError:
from pyfrc import wpilib
from common.autonomous_helper import StatefulAutonomous, timed_state
class TwoBall(StatefulAutonomous):
MODE_NAME = 'Two Balls Hot Gyro'
DEFAULT = False
DISABLED = False
# do not use
def __init__(se... | Python | 0.001497 | @@ -154,16 +154,23 @@
TwoBall
+HotGyro
(Statefu
@@ -1465,84 +1465,8 @@
t:%0D%0A
- self.drive_rotate_speed = self.drive_rotate_speed_left%0D%0A
@@ -1597,231 +1597,63 @@
lf.d
-rive_rotate_speed = self.drive_rotate_speed_right%0D%0A self.direction = 1%0D%0A ... |
fe3430fdaddf6d715fca2fe6ae6d3b45e0445cc6 | make sure dtype matches what labview sends | polarimeter/labview.py | polarimeter/labview.py | """
labview.py is a module to interface with a Windows PC running a LabVIEW
VI that acquires data with an NI-DAQ.
Using TCP/IP the VI listens for incoming connections. The requesting
computer sends a message requesting a capture time. The Windows PC
acquires the data, writes it to file, then uses the WinSCP utility to... | Python | 0 | @@ -1107,14 +1107,14 @@
()%0A%09
-data =
+return
np.
@@ -1166,48 +1166,66 @@
=','
-)%0A%09return (data%5B:,0%5D, data%5B:,1%5D, data%5B:,2%5D
+,%0A dtype=np.dtype('d'), unpack=True
)%0A
|
9bb961f986de86ceff4d60c33b97e7a633d8dfe5 | allow db connection object to be changed (for tests) | src/Database.py | src/Database.py | import sqlite3
class Database(object):
class DbFile(object):
name = "merchants-almanac.db"
conn = sqlite3.connect(name, detect_types=sqlite3.PARSE_DECLTYPES)
conn.row_factory = sqlite3.Row
def __init__(self, **kwargs):
self.conn = self.DbFile.conn
self.database_schema... | Python | 0 | @@ -42,102 +42,204 @@
-class DbFile(object):%0A name = %22merchants-almanac.db%22%0A conn = sqlite3.connect(nam
+db_file = %22merchants-almanac.db%22%0A __conn = None%0A%0A def __init__(self, **kwargs):%0A if not Database.__conn:%0A Database.__conn = sqlite3.connect(%0A ... |
70b490fe3a04f9e50734abab4e22153533ae9096 | Update analogInOut.py | krempelair/lib/bus/analogInOut.py | krempelair/lib/bus/analogInOut.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import smbus
import logging as log
class analogInOut():
def __init__(self):
self._bus = smbus.SMBus(1)
LOG_FILENAME = 'krempelair.log'
log.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
def getValue(self, address, chanel):
... | Python | 0 | @@ -254,20 +254,16 @@
evel=log
-ging
.DEBUG)%0A
|
db2a796e73a9963c58f601a0aa08b2aa4954a3c3 | Revise first/last to left/right | lc0034_find_first_and_last_position_of_element_in_sorted_array.py | lc0034_find_first_and_last_position_of_element_in_sorted_array.py | """Leetcode 34. Find First and Last Position of Element in Sorted Array
Medium
URL: https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
Given an array of integers nums sorted in ascending order,
find the starting and ending position of a given target value.
Your algorithm's runtime... | Python | 0.999999 | @@ -18,21 +18,21 @@
ind
-Firs
+lef
t and
-Las
+righ
t Po
@@ -117,21 +117,21 @@
ind-
-firs
+lef
t-and-
-las
+righ
t-po
@@ -573,16 +573,33 @@
Solution
+BinarySearchTwice
(object)
@@ -1062,18 +1062,18 @@
-first, las
+left, righ
t =
@@ -1100,35 +1100,35 @@
while
-first %3C las
+left %3C righ
t:%0... |
f95f6df2e9ee3a3976553a6f73e5f65c18f8e16d | fix call to insertcallbacks -- commit made from testing machine | parse.py | parse.py | #!/usr/bin/env python
import logging
# http://docs.python.org/howto/argparse.html
import argparse
import os
import datetime
import re
import mmap
import contextlib
import multiprocessing
import itertools
import sys
sys.path.append( '.' )
sys.path.append( './lib/' )
import shutil
from patXML import XMLPatent
from pat... | Python | 0 | @@ -4264,245 +4264,74 @@
for
-table in tables:%0A # Cut the chaining here to better parameterize the call, allowing%0A # the databases to be built in place%0A # (/var/share/patentdata/patents/%3Cyear%3E)%0A # outdb = PATENTROOT + %22/%22 + table%0A x
+patent in xmllist:%0A fo... |
3a421249b952696d3a57f3cfbc2892e65fe43038 | Tweak openstates example | pscl/ext/openstates.py | pscl/ext/openstates.py | import logging
from collections import defaultdict
from pscl import Rollcall
from pandas import DataFrame
class RollcallBuilder(object):
'''Provides an easy(ish) way to build a rollcall object from
the Open States API.
'''
def __init__(self, valid_ids, YES=1, NO=2, OTHER=3, NA=9):
self.voteda... | Python | 0 | @@ -294,9 +294,9 @@
NA=
-9
+0
):%0A
@@ -1334,32 +1334,44 @@
leg_ids)%0A
+ dataframe =
dataframe.filln
@@ -1751,16 +1751,25 @@
states,
+response_
cache%0A
@@ -1766,24 +1766,33 @@
e_cache%0A
+response_
cache.enable
@@ -1805,16 +1805,25 @@
o')%0A
+response_
cache.lo
@@ -1841,16 +1841,67 @@
... |
b25b35e4396638388ad4b05b61b54c64e5e60008 | Update PedidoListar.py | backend/Models/Curso/PedidoListar.py | backend/Models/Curso/PedidoListar.py | from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoEditar(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoEditar, self).__init__(variaveis_do_ambiente)
try:
self.nome = self.corpo['nome']
self.codigo = self.corpo['codigo']
self.id... | Python | 0 | @@ -595,35 +595,39 @@
rmatura'%5D%0A%09%09
+%09
-%09
self.creditos_op
@@ -688,24 +688,30 @@
'%5D%0A%09%09 %09
+
self.credito
@@ -789,16 +789,15 @@
%5D%0A%09%09
-
+%09
-%09
self
@@ -1206,16 +1206,22 @@
lf):%0A%09
+
return s
@@ -1354,32 +1354,37 @@
onexa(self)%0A%09
+ ... |
732eaa061fce4aa7aee58003be08ce7c5248121d | Use different image hosting service since 0x0.st has banned AWS IPs. | scripts/send-benchmark-completion-notification-to-slack.py | scripts/send-benchmark-completion-notification-to-slack.py | #!/usr/bin/env python
# Copyright 2014-2020 Scalyr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python | 0 | @@ -1240,16 +1240,26 @@
ort sys%0A
+import re%0A
import g
@@ -1262,16 +1262,16 @@
rt glob%0A
-
import j
@@ -2376,16 +2376,43 @@
json%22%7D%0A%0A
+# 0x0 has banned AWS IPs%0A#
IMAGE_SE
@@ -2440,16 +2440,54 @@
0x0.st%22%0A
+IMAGE_SERVICE_URL = %22https://oshi.at%22%0A
%0A%0Adef up
@@ -2931,24 +2931,43 @@
t))%0A... |
6d37e60c833e0e641c8e836c60b7cdf8ac4c43d4 | use histogram for prometheus | biomaj_process/biomaj_process_web.py | biomaj_process/biomaj_process_web.py | '''
Web interface to query list/download status
Manage sessions and metrics
'''
import ssl
import os
import yaml
from flask import Flask
from flask import jsonify
from flask import request
from prometheus_client import Counter
from prometheus_client import Gauge
from prometheus_client.exposition import generate_lates... | Python | 0.000001 | @@ -258,16 +258,56 @@
t Gauge%0A
+from prometheus_client import Histogram%0A
from pro
@@ -849,21 +849,25 @@
etric =
-Gauge
+Histogram
(%22biomaj
@@ -2809,11 +2809,15 @@
st).
-set
+observe
(pro
|
2c382653808d7ce4ca5bd7e7987e316e8884b330 | Move KeyError handling to populate_data | mfr/ext/tabular/render.py | mfr/ext/tabular/render.py | """Tabular data renderer module.
.. note::
jQuery must be included on the page for this renderer to work properly.
"""
import json
import mfr
import os
from .configuration import config
from .exceptions import TableTooBigException, \
EmptyTableException, MissingRequirementsException, \
UnexpectedFormattin... | Python | 0.000001 | @@ -867,29 +867,16 @@
%22%22%22%0A%0A
- try:%0A
colu
@@ -908,75 +908,8 @@
(fp)
-%0A except KeyError:%0A raise UnexpectedFormattingException()
%0A%0A
@@ -2613,26 +2613,130 @@
-return imported(fp
+try:%0A return imported(fp)%0A except KeyError:%0A ... |
9ef6641a4164ee5760e24db7460915c5ae5c5a52 | Support stride and pad in backward | chainer/functions/pooling/unpooling_2d.py | chainer/functions/pooling/unpooling_2d.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import six
import numpy
from chainer import cuda
from chainer.functions.pooling import pooling_2d
from chainer.utils import conv
def get_deconv_outsize(size, k, s, p):
return s * (size - 1) + k - 2 * p
class Unpooling2D(pooling_2d.Pooling2D):
"""Unpooling ov... | Python | 0 | @@ -44,20 +44,8 @@
*-%0A%0A
-import six%0A%0A
impo
@@ -1279,334 +1279,104 @@
-n, c, h, w = x%5B0%5D.shape%0A gx = numpy.zeros((n, c, h, w), dtype=numpy.float32)%0A%0A # TODO(wkentaro): Make it fast%0A for i in numpy.ndindex(n, c, h, w):%0A j = i%5B0%5D, i%5B1%5D, i%5B2%5D * self.... |
f51b77717ea9d75fa1c5c47bc6361f1a63e95c5c | Fix lint | boilerplateapp/helpers/decorators.py | boilerplateapp/helpers/decorators.py | """Contains a bunch of helpful decorators."""
import functools
def login_exempt(f):
"""All routes decorated with this will be exempt from authorization.
This means that using this decorator a function can be marked for anonymous access.
Example:
@api.route('/login', methods=['POST'])
@l... | Python | 0.000032 | @@ -255,17 +255,16 @@
xample:%0A
-%0A
@@ -362,16 +362,17 @@
pass%0A
+%0A
%22%22%22%0A
|
03d1bdcb10ab7cb3c8b159ad28093b6c0995ea6c | Use DataFrame#iloc instead of DataFrame#ix to supress deprecation warnings | pptx_template/chart.py | pptx_template/chart.py | #
# coding=utf-8
import logging
from io import StringIO
from pptx.shapes.graphfrm import GraphicFrame
from pptx.chart.data import ChartData, XyChartData
from pptx.enum.chart import XL_CHART_TYPE as ct
import pandas as pd
import pptx_template.pyel as pyel
import pptx_template.text as txt
import pptx_template.pptx_ut... | Python | 0 | @@ -649,25 +649,27 @@
_col = csv.i
-x
+loc
%5B:, %5B0, i%5D%5D%0A
@@ -936,17 +936,19 @@
= csv.i
-x
+loc
%5B:, i%5D%0A
|
ed3e14576db40f68c1afb932e3b69246d15b1608 | Fix bug | scan/src/main/org/apache/rat/scan/connect.py | scan/src/main/org/apache/rat/scan/connect.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
#
# Unle... | Python | 0.000003 | @@ -4405,17 +4405,17 @@
ame%5B0:-1
-4
+5
%5D%0A
|
d977f9747e4309bc98e5f3d3c175293fa54544d8 | clear urls | src/RGT/urls.py | src/RGT/urls.py | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from authentication.views import *
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'RGT.views.home', name='home'),
# url(r'^RGT/', inc... | Python | 0.000004 | @@ -58,60 +58,8 @@
url%0A
-# Uncomment the next two lines to enable the admin:%0A
from
@@ -123,17 +123,16 @@
port *%0A%0A
-%0A
admin.au
@@ -145,16 +145,16 @@
over()%0A%0A
+
urlpatte
@@ -176,313 +176,8 @@
'',%0A
- # Examples:%0A # url(r'%5E$', 'RGT.views.home', name='home'),%0A # url(r'%5ERGT/', include(... |
8a8cac343fb36cf3c99a1455c208b1b4667e3e99 | Rename a function | pathvalidate/_common.py | pathvalidate/_common.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
from .error import NullNameError
def _validate_null_string(text, error_msg="null name"):
if is_not_null_string(text):
return
if is_null_string(text):
... | Python | 0.999998 | @@ -786,32 +786,38 @@
get_unprintable_
+ascii_
char_list():%0A
@@ -962,28 +962,34 @@
get_unprintable_
+ascii_
char_list()%0A
|
b11ee8d32f2a1085fecb21a800d03c086a0887cd | Update importer to check for key existance. | pupa/importers/base.py | pupa/importers/base.py | import os
import glob
import json
import uuid
import logging
import datetime
from pupa.core import db
def make_id(type_):
return 'ocd-{0}/{1}'.format(type_, uuid.uuid1())
def insert_object(obj):
""" insert a new object into the appropriate collection
params:
obj - object to insert
return:
... | Python | 0 | @@ -1308,16 +1308,41 @@
if
+not hasattr(old, key) or
getattr(
@@ -1361,16 +1361,70 @@
value:%0A
+ # If we have a *new* value, let's update.%0A
|
33836bb70a2fe2a61200c9ef381523c957d69d2c | Add catch for Readtimeout | micstream/splmeter.py | micstream/splmeter.py | #!/usr/bin/env python
import alsaaudio
import array
import datetime
import getopt
import math
import requests
import sys
import time
def rms(buffer):
"""Calculate the root-mean-square of some iterable full of numbers."""
total = 0.
for el in buffer:
total += el**2
return int(math.sqrt(total))
... | Python | 0 | @@ -3549,16 +3549,41 @@
t_url))%0A
+ try:%0A
@@ -3637,16 +3637,20 @@
IMEOUT)%0A
+
@@ -3716,16 +3716,120 @@
_code))%0A
+ except requests.exceptions.ReadTimeout:%0A print('ERROR: Read timeout')
%0A
|
c4a8af10c2b6b8d7367cb4a22609ac29de4fb5f1 | Allow listing multiple subjects by ID | panoptes_cli/commands/subject.py | panoptes_cli/commands/subject.py | import click
from panoptes_cli.scripts.panoptes import cli
from panoptes_client import Subject
@cli.group()
def subject():
pass
@subject.command()
@click.option('--subject-set-id', type=int, required=False)
@click.option(
'--quiet',
'-q',
is_flag=True,
help='Only print subject IDs',
)
@click.argu... | Python | 0 | @@ -325,24 +325,25 @@
('subject-id
+s
', type=int,
@@ -357,16 +357,26 @@
ed=False
+, nargs=-1
)%0Adef ls
@@ -409,16 +409,17 @@
bject_id
+s
):%0A i
@@ -430,18 +430,62 @@
bject_id
+s
:%0A
+ for subject_id in subject_ids:%0A
@@ -523,24 +523,28 @@
id)%0A
+
if quiet:%0A
@@ -54... |
510c5e405d1771c670e032525a5c35b5e2e2a66c | Remove cruft from docstring. | parsimonious/tests/test_nodes.py | parsimonious/tests/test_nodes.py | # -*- coding: utf-8 -*-
from nose import SkipTest
from nose.tools import eq_, ok_, assert_raises, assert_in
from parsimonious import Grammar, NodeVisitor, VisitationError, rule
from parsimonious.expressions import Literal
from parsimonious.nodes import Node
class HtmlFormatter(NodeVisitor):
"""Visitor that turns... | Python | 0 | @@ -1012,116 +1012,8 @@
tly.
-%0A%0A We start with a tree from applying this grammar... ::%0A%0A%0A ...to this text::%0A%0A ((o hai))%0A%0A
%22%22%22%0A
|
b5c82f27efb4e5eddb230f140721ab65163abdc4 | Remove duplicative filter | project/api/filters.py | project/api/filters.py | # Third-Party
from django_filters.rest_framework import (
FilterSet,
OrderingFilter,
)
# Local
from .models import (
Award,
Chart,
Contestant,
Convention,
Entity,
Entry,
Member,
Office,
Officer,
Panelist,
Participant,
Person,
Round,
Score,
Session,
... | Python | 0.000021 | @@ -1302,108 +1302,8 @@
%5D,%0A
- 'entity__officers__office__is_award_manager': %5B%0A 'exact',%0A %5D,%0A
|
b195c21d9567432298308d2fb04a7ade2c0fa9b8 | Add return to user delete | project/api/signals.py | project/api/signals.py | # Django
# Third-Party
from auth0.v3.management import Auth0
from auth0.v3.management.rest import Auth0Error
from django.conf import settings
from django.db.models.signals import (
post_save,
pre_delete,
)
from django.dispatch import receiver
# Local
from .models import (
Person,
User,
)
from .utils i... | Python | 0.000002 | @@ -1101,24 +1101,51 @@
er.delete()%0A
+ return%0A
|
8b83428335f867d016ace95dfc44b5e4a3275bde | first micro image window title is path | py/mel/cmd/microadd.py | py/mel/cmd/microadd.py | """Capture images from an attached microscope and add to existing moles."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import os
import numpy
import mel.lib.moleimaging
def setup_parser(parser):
parser.add_argument(
'PATH',
... | Python | 0.999925 | @@ -2639,22 +2639,23 @@
one%0A
-print(
+return
micro_pa
@@ -2656,28 +2656,17 @@
cro_path
-)%0A return
+,
cv2.imr
@@ -3025,16 +3025,21 @@
ro_image
+_data
= load_
@@ -3091,16 +3091,21 @@
ro_image
+_data
is not
@@ -3106,24 +3106,93 @@
s not None:%0A
+ first_micro_path, first_micro_image = first... |
7e1d9de89ce1258fc2000a33ad5e0c19a99807ef | fix linux file load | pyLibrary/jsons/ref.py | pyLibrary/jsons/ref.py | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
import os
from pyLibrary import convert
from ... | Python | 0.000001 | @@ -674,32 +674,63 @@
# RELATIVE%0A
+ if os.sep == %22%5C%5C%22:%0A
url = %22f
@@ -789,16 +789,111 @@
url%5B7:%5D%0A
+ else:%0A url = %22file://%22 + os.getcwd().replace(os.sep, %22/%22) + %22/%22 + url%5B7:%5D%0A%0A%0A
%0A if
@@ -5382,17 +5382,16 @@
try:%0A
-%0A
... |
b24d3cae83f4b53b92deb38cc64d7198d02e3e26 | Update docs to combined possibility location and query | pydov/search/boring.py | pydov/search/boring.py | # -*- coding: utf-8 -*-
"""Module containing the search classes to retrieve DOV borehole data."""
import pandas as pd
from pydov.search.abstract import AbstractSearch
from pydov.types.boring import Boring
from pydov.util import owsutil
class BoringSearch(AbstractSearch):
"""Search class to retrieve information a... | Python | 0 | @@ -2378,15 +2378,8 @@
ide
-either
%60loc
@@ -2377,32 +2377,36 @@
vide %60location%60
+and/
or %60query%60.%0A
|
099ae768056a4ab160179be89c8750a2bfc06b2c | Implement expr2bdd function and unique table | pyeda/test/test_bdd.py | pyeda/test/test_bdd.py | """
Test binary decision diagrams
"""
| Python | 0.000022 | @@ -27,12 +27,509 @@
iagrams%0A%22%22%22%0A
+%0Afrom pyeda.bdd import expr2bdd%0Afrom pyeda.expr import var%0A%0Aa, b, c = map(var, 'abc')%0A%0Adef test_expr2bdd():%0A f = a * b + a * c + b * c%0A bdd_f = expr2bdd(f)%0A assert bdd_f.root == a.var%0A assert bdd_f.low.root == b.var%0A assert bdd_f.high.ro... |
886ebc0427fa8d93b26aa56807b5150530d346c5 | put all logic in a main function as attempt to get console_scripts in setup.py to work | pyfilemail/__main__.py | pyfilemail/__main__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import getpass
import logging
import keyring
from keyring.errors import PasswordDeleteError
KEYRING = True
k = keyring.get_keyring()
if isinstance(k, keyring.backends.fail.Keyring):
KEYRING = False
from pyfilemail import logger, streamhandl... | Python | 0 | @@ -5388,33 +5388,18 @@
s%0A%0A%0A
-if __name__ == '__
+def
main
-__'
+()
:%0A
@@ -6286,8 +6286,46 @@
fo(msg)%0A
+%0Aif __name__ == '__main__':%0A main()
|
a7f8a2812c5e3728caf98a79451dccc40a97f8ab | change module name | tkp/classification/features/catalogs.py | tkp/classification/features/catalogs.py | """
Module that checks the database for source associations
If the database is not available or the database module cannot be
imported, functions will silently return None.
"""
from tkp.database.database import DataBase
from tkp.database.utils import match_nearests_in_catalogs
def match_catalogs(transient):
"... | Python | 0.000004 | @@ -235,21 +235,23 @@
atabase.
-utils
+general
import
@@ -636,13 +636,15 @@
ase.
-utils
+general
.mat
|
d8e40329ea787e23a3bc915472efe1d417cd1410 | Fix flaky comparison in log_handler_test.py | sdks/python/apache_beam/runners/worker/log_handler_test.py | sdks/python/apache_beam/runners/worker/log_handler_test.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 0 | @@ -3090,32 +3090,37 @@
lf.assertGreater
+Equal
(log_entry.times
|
44a39603d8af2e8574d8ce4b667ed7d6931bf56a | Add DEBIAN_FRONTEND=noninteractive env var to apt | pyinfra/modules/apt.py | pyinfra/modules/apt.py | # pyinfra
# File: pyinfra/modules/apt.py
# Desc: manage apt packages & repositories
from pyinfra.api import operation, server
@operation
def repo(name, present=True):
return []
@operation
def packages(packages, present=True, update=False, upgrade=False):
commands = []
if update:
commands.appen... | Python | 0.000002 | @@ -112,16 +112,31 @@
eration,
+ operation_env,
server%0A
@@ -186,30 +186,107 @@
-return %5B%5D%0A%0A%0A@operation
+pass%0A%0A%0A@operation%0A@operation_env(DEBIAN_FRONTEND='noninteractive') # surpresses interactive prompts
%0Adef
|
4dd996b9789f851ed32e35d9cae173508582ff74 | Fix handling of nested namespaces in Renderer.get_fully_qualified_name | breathe/renderer/rst/doxygen/base.py | breathe/renderer/rst/doxygen/base.py |
class Renderer(object):
def __init__(self,
project_info,
context,
renderer_factory,
node_factory,
state,
document,
target_handler,
domain_directive_factory,
):
self.project_info = project_info
... | Python | 0 | @@ -3249,18 +3249,18 @@
lude the
+i
r
-e
parent
@@ -3272,17 +3272,14 @@
pace
+(s)
in
- there
com
@@ -3429,95 +3429,149 @@
o'.
-But our node_stack includes 'foo' so we only want 'bar' at%0A # this point
+We need full compoundname because node_stack doesn't necessarily%0A # inclu... |
0f6e5eb100fd8c0bd4129630d59c5fed498b6124 | Remove chain keyword argument to point | pymc3/backends/base.py | pymc3/backends/base.py | """Base backend for traces
See the docstring for pymc3.backends for more information (includng
creating custom backends).
"""
import numpy as np
from ..model import modelcontext
class BackendError(Exception):
pass
class BaseTrace(object):
"""Base trace object
Parameters
----------
name : str
... | Python | 0 | @@ -2697,36 +2697,24 @@
nt(self, idx
-, chain=None
):%0A %22
|
67757db8648d4ffbeb2795072d75add0801de07c | Correct database Integrity Exception | dojo/db_migrations/0118_remove_finding_images.py | dojo/db_migrations/0118_remove_finding_images.py | # Generated by Django 3.1.13 on 2021-07-10 00:04
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
def move_images_to_files(apps, schema_editor):
Finding_model = apps.get_model('dojo', 'Finding')
FileUpload_model = apps.get_model('dojo', 'FileUpload')
... | Python | 0 | @@ -116,17 +116,58 @@
, models
+, IntegrityError, transaction%0Aimport uuid
%0A
-
import d
@@ -425,16 +425,39 @@
False):%0A
+ passed = False%0A
@@ -491,16 +491,128 @@
.all():%0A
+ caption_uuid = uuid.uuid4().hex%0A try:%0A with transaction.atomic():%0A
... |
ffdb34d9196fe2a8b594ca83f504d9bb6be97e43 | Add python scripts: list | algorithms/GradientDescent/BatchGradientDescent.py | algorithms/GradientDescent/BatchGradientDescent.py | import numpy as np
class GradientDescent:
"""
*****************************************************
Batch Gradient Descent Implementation In Python 2.7
*****************************************************
Dependency: numpy
GradientDescent Class
=====================================
... | Python | 0.999989 | @@ -850,16 +850,72 @@
x, y):%0A
+ if not any(isinstance(i, list) for i in x):%0A
@@ -943,24 +943,28 @@
y)%0A%0A
+
+
self.x = np.
@@ -1003,16 +1003,185 @@
spose()%0A
+ else:%0A assert len(x%5B0%5D) == len(y)%0A%0A temp = %5Bnp.ones(len(x%5B0%5D))%5D%0A ... |
fe52f04aa2b15d656909c139dce6abc5acfedd01 | Remove sort function in Switch Server List Panel #5 | panel/switch_server_list_panel.py | panel/switch_server_list_panel.py |
class SwitchServerListPanel(object):
def __init__(self, window, servers):
self.window = window
self.servers = servers
self.choices = []
def on_done(self, index):
if index == -1:
return
self.callback(index)
def show(self, callback):
self.callba... | Python | 0 | @@ -522,36 +522,8 @@
%5D)%0A
- self.choices.sort()%0A
|
c2a5f3585c6fe3d12f7cc4696d961a87f2f1fa75 | fix factories | pyrefflat/factories.py | pyrefflat/factories.py | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
__author__ = 'ahbbollen'
from .parser import Exon, Record
from .generics import *
class ExonFactory(object):
"""
This class defines a factory for producing Exons
Takes the a ... | Python | 0.000001 | @@ -1393,16 +1393,97 @@
%5D = gene
+%0A%0A def set_transcript(self, name):%0A assert isinstance(name, basestring)
%0A
@@ -1496,35 +1496,35 @@
items%5B%22name%22%5D =
-gen
+nam
e%0A%0A def set_c
@@ -2658,17 +2658,17 @@
ems%5B%22exo
-N
+n
Count%22%5D%0A
|
2b3912ba3bae951e9f147be5631e91111622cc9b | Update gn.py | python_gist_note/gn.py | python_gist_note/gn.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import json
import requests
from os.path import expanduser
import sys
reload(sys)
sys.setdefaultencoding('utf8')
version = '0.2.3'
h = """
USAGE:
1. 获取 gist 内容(写入到 file.py):
gn gist-id > file.py
2. 新建 gist (根据 file.py 文件的内容):
gn [op... | Python | 0.000001 | @@ -190,17 +190,17 @@
= '0.2.
-3
+4
'%0A%0Ah = %22
|
9b513c620b2c079c12370969929599f2a77a3b98 | Bump version number to 3.3 | src/__init__.py | src/__init__.py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# --------------------------------------------------------------------
"""
PETSc for Python
================
This package is an interface to PETSc libraries.
PETSc_ (the Portable, Extensible Toolkit for Scientific Computation)
is a suite of data structures and... | Python | 0.000716 | @@ -636,11 +636,11 @@
= '
-1.2
+3.3
'%0A__
|
861055a8391734c76083f31cba6eb912c5b58337 | Update fetch-dependees.py to work with opam 2 | src/util/fetch-dependees.py | src/util/fetch-dependees.py | #! /usr/bin/env python
# Retrieves source code of OPAM packages recursively depending on Lwt into a
# subdirectory ./dependees/, so you can grep through the code.
import os.path
import subprocess
DEPENDEES = "dependees"
def main():
packages = subprocess.check_output([
"opam", "list", "--unavailable", "-... | Python | 0 | @@ -301,19 +301,11 @@
%22--
-unavailable
+all
%22, %22
@@ -335,16 +335,25 @@
epopts%22,
+ %22--dev%22,
%0A
@@ -377,16 +377,45 @@
--short%22
+, %22--with-test%22, %22--with-doc%22
%5D)%0A%0A
|
182d17186aa1adb283306a28daeaed0b7ae7ca69 | Bump version number. | qrc_pathlib/version.py | qrc_pathlib/version.py | VERSION = '1.0.1'
| Python | 0 | @@ -8,11 +8,11 @@
= '1.0.
-1
+2
'%0A
|
b443d648d935337579b4c146744a223de961c36d | fix typo | queue_util/consumer.py | queue_util/consumer.py | """Listens to 1 (just one!) queue and consumes messages from it endlessly.
We set up a consumer with two things:
1) The name of the source queue (`source_queue_name`)
2) A callable that will process
The `handle_data` method must process the data. It can return nothing or a
sequence of `queue_name, data` pairs.
If it r... | Python | 0.999991 | @@ -2416,24 +2416,27 @@
while self.
+is_
paused:%0A
|
2eb7d1a29af10ae9278cc0c784f8cdfb14e4daac | Format docstring | reactivex/operators/_multicast.py | reactivex/operators/_multicast.py | from typing import Callable, Optional, TypeVar, Union
from reactivex import ConnectableObservable, Observable, abc
from reactivex import operators as ops
from reactivex.disposable import CompositeDisposable
_TSource = TypeVar("_TSource")
_TResult = TypeVar("_TResult")
def multicast_(
subject: Optional[abc.Subje... | Python | 0.000002 | @@ -1197,16 +1197,28 @@
bject(),
+%0A
mapper=
@@ -1700,13 +1700,8 @@
ory%22
- is a
%0A
@@ -1709,16 +1709,21 @@
+is a
factory
|
7ffdb3943d810c1538ae15c60fc4c491066ad841 | Remove tests of dropped functions. | test/test_transport.py | test/test_transport.py | import unittest
from node.openbazaar_daemon import OpenBazaarContext
import mock
from node import protocol, transport
def get_mock_open_bazaar_context():
return OpenBazaarContext.create_default_instance()
class TestTransportLayerCallbacks(unittest.TestCase):
"""Test the callback features of the TransportLa... | Python | 0 | @@ -95,18 +95,8 @@
port
- protocol,
tra
@@ -2333,1846 +2333,8 @@
)%0A%0A%0A
-class TestTransportLayerMessageHandling(unittest.TestCase):%0A%0A def setUp(self):%0A ob_ctx = get_mock_open_bazaar_context()%0A guid = 1%0A nickname = None%0A self.tl = transport.TransportLayer(ob_ctx, guid,... |
3e31fc91ad2d53ee97def200f9a15d626d67b00d | Make unit tests properly shut down the Jupyter server when done. | test/unit/run_tests.py | test/unit/run_tests.py | # Adapted from a Karma test startup script
# developebd by the Jupyter team here;
# https://github.com/jupyter/jupyter-js-services/blob/master/test/run_test.py
#
from __future__ import print_function
import subprocess
import sys
import argparse
import threading
import time
KARMA_PORT = 9876
argparser = argparse.Argu... | Python | 0 | @@ -267,16 +267,40 @@
ort time
+%0Aimport os%0Aimport signal
%0A%0AKARMA_
@@ -929,21 +929,12 @@
and,
- shell=False,
+%0A
std
@@ -964,55 +964,59 @@
- stdout=subprocess.PIPE
+stdout=subprocess.PIPE,%0A preexec_fn = os.setsid%0A
)%0A%0A#
@@ -1294,32 +1294,172 @@
n use' in line:%0... |
36da09eae8e70afff6dd98c234da95223d53056e | Add getStock test. | tests/auction/query.py | tests/auction/query.py | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import unittest
import pydarkstar.logutils
import pydarkstar.database
import pydarkstar.auction.query
import pydarkstar.rc
pydarkstar.logutils.setDebug()
class TestQuery(unittest.TestCase):
def setUp(self):
self.db = pydarkstar.database.Data... | Python | 0 | @@ -348,16 +348,77 @@
c.sql)%0A%0A
+ def test_getStock(self):%0A self.assertTrue(False)%0A%0A
if __nam
|
18677b16d85722032c8d92e287b028b3012b4651 | use keyword arguments | molo/core/migrations/0073_run_wagtail_migration_before_core_34.py | molo/core/migrations/0073_run_wagtail_migration_before_core_34.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.core.management.sql import emit_pre_migrate_signal
class Migration(migrations.Migration):
"""
Migration 34 needs migration 0040 from wagtail core
and this Migration will run wagtail migrat... | Python | 0.000002 | @@ -512,18 +512,43 @@
nal(
-2,
+verbosity=2, interactive=
False,
+db=
db_a
|
f431924ccfeaaea69fb82df3a61a71e5bbab8df2 | Add django.request to default excluded loggers | raven/conf/__init__.py | raven/conf/__init__.py | """
raven.conf
~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import logging
from raven.utils.urlparse import urlparse
__all__ = ('load', 'setup_logging')
# TODO (vng): this seems weirdly located in raven.conf. Seems like
# ... | Python | 0.000001 | @@ -204,17 +204,16 @@
lparse%0A%0A
-%0A
__all__
@@ -241,16 +241,132 @@
ging')%0A%0A
+EXCLUDE_LOGGER_DEFAULTS = (%0A 'raven',%0A 'gunicorn',%0A 'south',%0A 'sentry.errors',%0A 'django.request',%0A)%0A%0A
%0A# TODO
@@ -1437,163 +1437,31 @@
ude=
-%5B'raven',%0A 'gun... |
35c98829981186917359683245afb51d2294e4ba | Move test file | tests/lib/test_path.py | tests/lib/test_path.py | import sublime
import unittest
from unittest import mock
import os
from subprocess import check_output
from Dart.lib.path import find_in_path
from Dart.lib.path import is_pubspec
from Dart.lib.path import extension_equals
class Test_find_in_path(unittest.TestCase):
def setUp(self):
self.view = sublime.a... | Python | 0.000001 | @@ -128,84 +128,219 @@
ort
-find_in_path%0Afrom Dart.lib.path import is_pubspec%0Afrom Dart.lib.path import
+extension_equals%0Afrom Dart.lib.path import find_in_path%0Afrom Dart.lib.path import is_dart_script%0Afrom Dart.lib.path import is_pubspec%0Afrom Dart.lib.path import is_view_dart_script%0Afrom Dart.lib.path... |
905961913fa39aad60a8622e6a2b705f908695c3 | Rename Test case, add todo | tests/model/test_wu.py | tests/model/test_wu.py | from itertools import permutations
from unittest import TestCase
from unittest.mock import MagicMock, patch
from flask.ext.login import AnonymousUserMixin
from sqlalchemy.orm.exc import NoResultFound
from sipa.model.wu.user import User, UserDB
from sipa.model.wu.ldap_utils import UserNotFound, PasswordInvalid
class... | Python | 0 | @@ -318,16 +318,20 @@
ass User
+NoDB
TestCase
@@ -5094,16 +5094,164 @@
Mixin)%0A%0A
+ # TODO: Comprehensively test %60from_ip%60 testing with sample database%0A # e.g. test that the correct status coder have been used in the filter%0A%0A
%0Aclass U
|
dcf91c49acd267654ac2c38baf56b197638e517d | Remove debug code | platformio/clients/http.py | platformio/clients/http.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.000299 | @@ -2049,16 +2049,18 @@
%0A
+ #
print(s
|
f661314e2fa6da1008cf8dbff221ea869a785485 | Add some doc | wordutils/utils.py | wordutils/utils.py | from __future__ import division
def split_num(n, s):
"""
Split n into groups of s numbers
>>> split_num(123, 2)
[1, 23]
>>> split_num(12345, 3)
[12, 345]
>>> split_num(123, 4)
[123]
"""
groups = []
div = 10 ** s
while n:
groups.append(n % div)
n //= ... | Python | 0.000002 | @@ -83,16 +83,21 @@
oups of
+size
s number
@@ -97,16 +97,62 @@
numbers
+ starting from the least%0A significant digit
%0A%0A %3E%3E
|
b5cd3ef8033b99d45f6684442c87945de4f32b8f | Update RSA.py | RSA.py | RSA.py |
# Make sure both primes just in case
def phi(primeone, primetwo):
if primeCheck(primeone) and primeCheck(primetwo):
return (primeone - 1) * (primetwo - 1)
# Reads in ints
def primeCheck(prime):
if prime > 1:
for i in range(2,prime):
if (prime % i == 0):
return False
e... | Python | 0.000002 | @@ -500,26 +500,24 @@
rime q: %22)%0D%0A
-%0D%0A
p = int(
@@ -618,18 +618,16 @@
= 100:%0D%0A
-%0D%0A
if
@@ -685,28 +685,8 @@
%22)%0D%0A
- %0D%0A %0D%0A
@@ -752,18 +752,16 @@
rime%22)%0D%0A
-%0D%0A
if
@@ -821,25 +821,16 @@
prime%22)
-%0D%0A
%0D%0A
@@ -891,34 +89... |
c1be2aa2fa5acee18aa8b0c8e317221161303c79 | add basic split test | tests/parallel_test.py | tests/parallel_test.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0.000002 | @@ -898,16 +898,31 @@
ke_jaxpr
+, axisvar_split
%0Afrom ja
@@ -3856,21 +3856,19 @@
)%0A%0A%0A
-#
class
-Chunk
+Split
Test
@@ -3887,19 +3887,296 @@
Case):%0A%0A
-#
+def testSplitBasic(self):%0A f = lambda x: psum(np.sin(x), 'i')%0A x = onp.ones((2, 2))%0A fsplit = axisvar_split(f, 'i', ('j', 'k'))%0... |
a70dd99b47dea5aba3e4d8fa2954d2700974ec3e | Allow to plot unknown/missing tests | tests/perf/conftest.py | tests/perf/conftest.py | from __future__ import absolute_import, division, print_function
import os.path
try:
from builtins import __dict__ as builtins
except ImportError: # Python 2
from __builtin__ import __dict__ as builtins
import py
import pytest
from .data import gen_dict, load_benchmarks
from .plot import make_plot
BENCH_D... | Python | 0.000001 | @@ -5004,24 +5004,25 @@
d = key%0A
+%0A
if found
@@ -5017,242 +5017,75 @@
-if found is None:%0A raise pytest.UsageError('Unknown benchmark ID: '%0A 'no test matches %7Blookup!r%7D: %7Bself%7D'%0A .format(**locals()))%0A ... |
cd38c29321df23474f034ccf443b89394a981115 | fix fallback test | tests/comms/push/test_fallback.py | tests/comms/push/test_fallback.py | import os
from datetime import datetime
import pytest
from em2 import Settings
from em2.comms.fallback.aws import AwsFallbackHandler
from em2.core import Action, Components, Controller, Verbs, perms
from tests.fixture_classes import future_result, get_private_key
@pytest.yield_fixture
def fallback_ctrl_pusher(loop,... | Python | 0.000002 | @@ -5597,24 +5597,51 @@
loop=loop)%0A
+ await fallback.ainit()%0A
msg_id =
|
2e9cec4960692da3ad03fb7d7b6c4b91a1696e17 | fix incorrect name of show device view | mygpo/web/views/device.py | mygpo/web/views/device.py | #
# This file is part of my.gpodder.org.
#
# my.gpodder.org 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.
#
# my.gpodder.org i... | Python | 0.999753 | @@ -5352,22 +5352,20 @@
return
-device
+show
(request
|
53b37016e74ad771094f063d84410697be6031aa | revert the last changes as they're not necessary and don't help. If one uses the right solr url everything works just fine | src/zeit/solr/connection.py | src/zeit/solr/connection.py | # Copyright (c) 2009 gocept gmbh & co. kg
# See also LICENSE.txt
import hashlib
import lxml.etree
import lxml.html
import os.path
import pysolr
import urllib2
import zeit.solr.interfaces
import zope.app.appsetup.product
import zope.interface
class SolrConnection(pysolr.Solr):
# XXX this class is untested
zo... | Python | 0 | @@ -616,196 +616,33 @@
/xml
-;charset=UTF-8'%7D)%0A result = lxml.objectify.fromstring(result)%0A status = result.get('status')%0A if status != '0':%0A raise pysolr.SolrError(status, result.text)
+'%7D)%0A return result
%0A%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.