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 |
|---|---|---|---|---|---|---|---|
1c652e3ae8d5d091a9c87533329a5b727707cb1c | enable passwordless sudo as any user | fabtools/tests/functional_tests/conftest.py | fabtools/tests/functional_tests/conftest.py | from pipes import quote
import logging
import os
import sys
from mock import patch
import pytest
from fabric.api import env, hide, lcd, local, settings
from fabric.state import connections
from fabtools.vagrant import version as _vagrant_version
HERE = os.path.dirname(__file__)
VAGRANT_VERSION = _vagrant_version... | Python | 0 | @@ -3847,16 +3847,506 @@
ptodate_index()%0A
+%0A%0A@pytest.fixture(scope='session', autouse=True)%0Adef allow_sudo_user(setup_package):%0A %22%22%22%0A Fix sudo config if needed%0A%0A Some Vagrant boxes come with a too restrictive sudoers config%0A and only allow the vagrant user to run commands as root.%0... |
1374807c05d9ebacb7a8cc6a75811697198bae32 | add template fixture to document tests | fiduswriter/document/tests/editor_helper.py | fiduswriter/document/tests/editor_helper.py | import time
from random import randrange
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from testing.selenium_helper import SeleniumHelper
from document.models import Document
class EditorHelper(Selen... | Python | 0 | @@ -489,16 +489,58 @@
f.user,%0A
+ template_id=1 # from fixture%0A
|
4a0ee61e459803ce15765b8d6980fb32b9eca1b9 | handle errors better in cached test | ftl/cached/cached.py | ftl/cached/cached.py | # Copyright 2017 Google 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/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | Python | 0.000001 | @@ -2385,275 +2385,328 @@
-cmd = subprocess.Popen(%0A ftl_args,%0A stderr=subprocess.PIPE)%0A _, output = cmd.communicate()%0A logging.info('output of build %7B0%7D: %7B1%7D'.format(label, output))%0A lyr_shas.append(self._fetch_lyr_shas(img_name))%0A... |
03cf1abcb9262b4b0b9dd3b57ac07f7d507ddd8f | Drop fts.backends.base.BaseManager.__call__ convenience method. It breaks using manager (and, more importantly, RelatedManager which inherits that method) in views. See http://stackoverflow.com/questions/1142411/reverse-foreign-key-in-django-template for details. | fts/backends/base.py | fts/backends/base.py | "Base Fts class."
from django.db import transaction
from django.db import models
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
class InvalidFtsBackendError(ImproperlyConfigured):
pass
class BaseClass(object):
class Meta:
abstract = True
clas... | Python | 0 | @@ -905,105 +905,8 @@
r()%0D
-%0A %0D%0A def __call__(self, query, **kwargs):%0D%0A return self.search(query, **kwargs)%0D
%0A%0D%0A
|
16c218023f9119f8b7a1603dbf53fb890da2bac8 | Change scrape_page to avoid meta data. | news.py | news.py | import feedparser
import nltk
import requests
from bs4 import BeautifulSoup as bs
from sklearn.feature_extraction.text import TfidfVectorizer
import networkx as nx
import numpy as np
from nltk.corpus import stopwords
from nltk.stem import RSLPStemmer
from nltk import word_tokenize
from string import punctuation
from de... | Python | 0 | @@ -794,26 +794,21 @@
t()%0A
-paragraphs
+all_p
= tree.
@@ -829,25 +829,291 @@
-#print paragraphs
+t0 = None%0A for tag in all_p:%0A if t0 == None:%0A t0 = tag%0A else:%0A t1 = tag.parent%0A if t1 == t0.parent:%0A content = t1%0A ... |
3828c02e73fa2a190f47ee7b3ad4b3670944367c | Swap fields. Closes https://github.com/p2pu/p2pu-website/issues/480 | custom_registration/forms.py | custom_registration/forms.py | # coding=utf-8
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import PasswordResetForm
from django.utils.translation import ugettext as _
from django.forms import ValidationError
from django.contrib.auth import password_validation
from django.contrib.auth.forms impor... | Python | 0.000001 | @@ -1735,35 +1735,29 @@
sword2', 'co
-mmunication
+nsent
_opt_in', 'c
@@ -1753,29 +1753,35 @@
opt_in', 'co
-nsent
+mmunication
_opt_in'%5D%0A%0A%0A
|
2934b3e321655ff9f8dd9575d2e1bc465360db4e | comment code | filesystem/usr/share/crewchief/crewchief.py | filesystem/usr/share/crewchief/crewchief.py | #!/usr/bin/env python2
# Copyright 2013 Carl George
#
# 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 | @@ -1195,16 +1195,70 @@
s': 60%7D%0A
+ # overwrite defaults with values from config file%0A
try:
@@ -1436,24 +1436,31 @@
#
+do the
overwrite th
@@ -1460,51 +1460,8 @@
rite
- the default setting to the one from config
%0A
@@ -2536,86 +2536,243 @@
-region = output%5B0%5D.rstrip('%5Cn')%0... |
2cdfff730e66dccf749ca855e3c255568e248d01 | Use Unknown message with right path | vertica_python/vertica/messages/message.py | vertica_python/vertica/messages/message.py |
import types
from struct import pack
from vertica_python.vertica.messages import *
class Message(object):
@classmethod
def _message_id(cls, message_id):
instance_message_id = message_id
def message_id(self):
return instance_message_id
setattr(cls, 'message_id', types.... | Python | 0 | @@ -1063,17 +1063,8 @@
urn
-messages.
Unkn
|
acf7d9c9748531d4bc800353a71f0b152fda6d53 | Update map-sum-pairs.py | Python/map-sum-pairs.py | Python/map-sum-pairs.py | # Time: O(n), n is the length of key
# Space: O(t), t is the total size of trie
class MapSum(object):
def __init__(self):
"""
Initialize your data structure here.
"""
_trie = lambda: collections.defaultdict(_trie)
self.__root = _trie()
def insert(self, key, val)... | Python | 0.000001 | @@ -59,27 +59,31 @@
the
-total size of
+number of nodes in
trie
-
%0A%0Acl
|
98896c222c2686dbab96b58819c08131d31dc1b7 | Update self-crossing.py | Python/self-crossing.py | Python/self-crossing.py | # Time: O(n)
# Space: O(1)
# You are given an array x of n positive numbers.
# You start at point (0,0) and moves x[0] metres to
# the north, then x[1] metres to the west, x[2] metres
# to the south, x[3] metres to the east and so on.
# In other words, after each move your direction changes counter-clockwise.
#
# Wri... | Python | 0 | @@ -1344,16 +1344,21 @@
+
x%5Bi - 1%5D
|
bd5e4dc55341e6ec98bf17211d7c3c6fdb99a3b1 | Use country_template in test_extra_params | tests/core/test_extra_params.py | tests/core/test_extra_params.py | # -*- coding: utf-8 -*-
from openfisca_core import periods
from openfisca_core.columns import IntCol, BoolCol
from openfisca_core.periods import MONTH
from openfisca_core.variables import Variable
import openfisca_dummy_country as dummy_country
from openfisca_dummy_country.entities import Individu
from openfisca_core... | Python | 0.000031 | @@ -192,22 +192,20 @@
ariable%0A
-import
+from
openfis
@@ -211,38 +211,55 @@
sca_
-dummy_
country
- as dummy_country
+_template import CountryTaxBenefitSystem
%0Afro
@@ -270,29 +270,32 @@
enfisca_
-dummy_
country
+_template
.entitie
@@ -303,24 +303,22 @@
import
-Individu
+Person
%0Afrom op
@@ -483,32 +483,... |
205df82b9eabed709db90c8de3473a883c9c2c1b | reorder tinymce toolbars | wheelcms_axle/settings/settings_tinymce.py | wheelcms_axle/settings/settings_tinymce.py | TINYMCE_DEFAULT_CONFIG = {
'theme': "advanced",
'content_css': '/static/css/wheel_content.css',
'style_formats': [
{ 'title': 'Images'},
{ 'title': 'Original Size Image', 'selector': 'img', 'attributes': {'class': 'img_content_original' }},
{ 'title': 'Thumbnail Image', 'selector': ... | Python | 0.000001 | @@ -1347,16 +1347,57 @@
ns1' : %22
+%7C,undo,redo,%7C,styleselect,formatselect,%7C,
bold,ita
@@ -1483,115 +1483,96 @@
l,%7C,
-styleselect,formatselect%22,%0A 'theme_advanced_buttons2' : %22bullist,numlist,%7C,outdent,indent,%7C,undo,redo,%7C,
+bullist,numlist,%7C,outdent,indent,%7C,sub,sup,%7C,charmap%22,%0A '... |
e9bac7c9d980889cbab098934c392b7514c41a00 | remove printall plugin. | plugins/default.py | plugins/default.py | from alebot import Alebot, Hook, Event
class ConnectionReadyHook(Hook):
"""
This is a hook that can be subclassed in case you want to react
on a irc connection that is ready for commands. It waits for
the end of the motd, or the message that there is no motd.
The :func:`match` fun... | Python | 0 | @@ -2585,248 +2585,4 @@
l)%0A%0A
-%0A%0A@Alebot.hook%0Aclass PrintAll(Hook):%0A%0A %22%22%22%0A Prints all server input to the terminal.%0A %22%22%22%0A%0A def match(self, event):%0A return True%0A%0A def call(self, event):%0A print(event.name, event.user, event.target, event.body)%0A
|
a8e1c75cb28413fc66d77c2050b9b05b6b2a82d2 | Deal with full spectral pol sumwt case | workflows/shared/imaging/imaging_shared.py | workflows/shared/imaging/imaging_shared.py | """ Imaging context definitions, potentially shared by other workflows
"""
import numpy
import logging
from processing_components.imaging.base import normalize_sumwt
from processing_components.visibility.base import copy_visibility
from processing_components.image.operations import copy_image, calculate_image_freque... | Python | 0 | @@ -4134,16 +4134,51 @@
= arg%5B1%5D
+%5B..., numpy.newaxis, numpy.newaxis%5D
* arg%5B0
|
6015cb96e4a35112efcf0ee35e38c88a94a58004 | Add API key to headers | cogs/diffusion.py | cogs/diffusion.py | import asyncio
import backoff
from typing import Any, Literal
from discord import Embed
from discord.ext import commands
from aiohttp import ClientResponseError
from bot import QTBot
from utils.custom_context import CustomContext
class DiffusionError(Exception):
pass
class Diffusion(commands.Cog):
INPUT = ... | Python | 0 | @@ -8,16 +8,28 @@
asyncio%0A
+import json%0A
import b
@@ -722,44 +722,272 @@
ns%22%0A
-%0A def __init__(self, bot: QTBot):
+ HEADERS = %7B%22Content-Type%22: %22application/json%22%7D%0A%0A def __init__(self, bot: QTBot):%0A with open(%22data/apikeys.json%22) as f:%0A self.api_key = json.l... |
1363a09366594602562bcf34a5368c71299c4755 | Add zero in lol-regexp | plugins/lolrate.py | plugins/lolrate.py | from datetime import datetime
from toflib import cmd, Plugin
import re
class TimeSlice():
def __init__(self):
t = datetime.now()
self.date = t.date()
self.hour = t.hour
self.kevins = dict()
self.count = 0
def __str__(self):
return "%s %02dh-%02dh : %d lolz" % (... | Python | 0.999315 | @@ -1190,16 +1190,17 @@
%5BLl%5D+%5BoO
+0
%5D+%5BLl%5D+%22
|
492486fd561a039d63049e8cbc252d9981efcd6a | Change cb time for svoboda msg | summer_bot/bot.py | summer_bot/bot.py | import datetime
import logging
import random
from textwrap import dedent
from simple_settings import settings
from telegram.ext import Updater, CommandHandler, Job
import pytz
import emoji
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(m... | Python | 0.000001 | @@ -3429,12 +3429,12 @@
me(1
+9
,
-35
+0
)%0A
|
4d2f3431c587015d6962250fcc4ebcda06f0f988 | Update TOKEN_INCORRECT_CVV error in dummy payment | saleor/payment/gateways/dummy/__init__.py | saleor/payment/gateways/dummy/__init__.py | import uuid
from typing import Optional
from ... import TransactionKind
from ...interface import GatewayConfig, GatewayResponse, PaymentData
TOKEN_PREAUTHORIZE_SUCCESS = "4111111111111112"
TOKEN_PREAUTHORIZE_DECLINE = "4111111111111111"
TOKEN_EXPIRED = "4000000000000069"
TOKEN_INSUFFICIENT_FUNDS = "4000000000009995"
... | Python | 0 | @@ -627,11 +627,11 @@
ect
-cvv
+CVV
%22,%0A
|
98bd8d46a4a90d2c27767bd39894189caf03f7d0 | Correct iter call for python 3 | changes_lxc_wrapper/cli/manager.py | changes_lxc_wrapper/cli/manager.py | #!/usr/bin/env python3
import argparse
import re
from collections import defaultdict, namedtuple
from datetime import datetime, timedelta
from ..api import ChangesApi
from ..container import SNAPSHOT_CACHE
from ..snapshot_cache import SnapshotCache
DESCRIPTION = "LXC snapshot manager"
SnapshotInfo = namedtuple('Sn... | Python | 0.998663 | @@ -5887,32 +5887,37 @@
snapshot =
+next(
snapshot_size_it
@@ -5922,14 +5922,8 @@
iter
-.next(
)%0A
|
7b77d2569b8056c4c1b184503165a81a426df2e9 | Allow configuring separator in headeranchor | mdownx/headeranchor.py | mdownx/headeranchor.py | """
mdownx.headeranchor
An extension for Python Markdown.
Github style tasklists
MIT license.
Copyright (c) 2014 Isaac Muse <isaacmuse@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software ... | Python | 0 | @@ -62,22 +62,21 @@
hub
-style tasklist
+header anchor
s%0A%0AM
@@ -1936,11 +1936,30 @@
id,
-'-'
+self.config.get('sep')
)%0A
@@ -2211,16 +2211,243 @@
ension):
+%0A def __init__(self, configs):%0A self.config = %7B%0A 'sep': %5B'-', %22Separator to use when creating header ids - Default: '... |
bfb014b65932902f9cc07bc85c3aadfdb320c438 | add static config | chapter5/growth_studio/settings.py | chapter5/growth_studio/settings.py | """
Django settings for growth_studio project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
imp... | Python | 0 | @@ -3214,10 +3214,117 @@
ic/'),%0A)
+%0APROJECT_DIR = os.path.dirname(os.path.abspath(__file__))%0ASTATIC_ROOT = os.path.join(PROJECT_DIR, 'static')
%0A%0A
|
a9fd9bcecc5d237d767a2fbb773e0780cce7fa99 | Add combinations of all the python bins. | tests/functional/test_create.py | tests/functional/test_create.py | import os
import sys
import pytest
import scripttest
is_windows = (
sys.platform.startswith("win") or
(sys.platform == "cli" and os.name == "nt")
)
is_26 = sys.version_info[:2] == (2, 6)
@pytest.yield_fixture
def env(request):
env = scripttest.TestFileEnvironment()
try:
yield env
finall... | Python | 0 | @@ -49,26 +49,26 @@
ttest%0A%0A%0A
-is_windows
+IS_WINDOWS
= (%0A
@@ -152,18 +152,18 @@
%22nt%22)%0A)%0A
-is
+IS
_26 = sy
@@ -191,16 +191,412 @@
(2, 6)%0A
+PYTHON_BINS = %5B%0A %22C:%5C%5CPython27%5C%5Cpython.exe%22,%0A %22C:%5C%5CPython27-x64%5C%5Cpython.exe%22,%0A %22C:%5C%5CPython33%5C%5Cpython.ex... |
c407d023a59b5863b5890836c17a1aa1208244fa | use local_base_url from webfront to compose the API URL | tests/functional/test_webapi.py | tests/functional/test_webapi.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import requests
from ava.util.tests import AgentTest
SUCCESS = 'success'
ERROR = 'error'
class TestWebAPI(AgentTest):
api_url = 'http://127.0.0.1:5080/api'
def test_ping(self):
r = requests.... | Python | 0 | @@ -227,16 +227,18 @@
st):%0A
+ #
api_url
@@ -267,16 +267,219 @@
080/api'
+%0A api_url = ''%0A%0A @classmethod%0A def setUpClass(cls):%0A AgentTest.setUpClass()%0A webfront = cls.agent.context().lookup('webfront')%0A cls.api_url = webfront.local_base_url + 'api'
%0A%0A de
|
6028ae4c2c75a29c0a050429f7ab76da129791fd | Improve keosd_auto_launch_test by checking stderr | tests/keosd_auto_launch_test.py | tests/keosd_auto_launch_test.py | #!/usr/bin/env python3
# This script tests that cleos launches keosd automatically when keosd is not
# running yet.
import subprocess
def run_cleos_wallet_command(command: str, no_auto_keosd: bool):
"""Run the given cleos command and return subprocess.CompletedProcess."""
args = ['./programs/cleos/cleos']
... | Python | 0.000001 | @@ -574,23 +574,20 @@
process.
-DEVNULL
+PIPE
)%0A%0A%0Adef
@@ -920,30 +920,43 @@
cleos.%0A
-assert
+completed_process =
run_cleos_w
@@ -980,80 +980,142 @@
st',
-%0A no_auto_keosd=True).returncode != 0
+ no_auto_keosd=True)%0A assert completed_process.returncode != 0%0A... |
ae1469e450616ba1ac50958262c2c834b75fc77c | store reference type in lowercase | citeproc/source/bibtex/bibparse.py | citeproc/source/bibtex/bibparse.py | #!/usr/bin/python
#
# Simple, naive bibtex parser
#
# Vassilios Karakoidas (2008) - vassilios.karakoidas@gmail.com
#
# bib categories
#
# @Article{
# @Book{
# @Booklet{
# @InBook{
# @InCollection{
# @InProceedings{
# @Manual{
# @MastersThesis{
# @Misc{
# @PhDThesis{
# @Proceedings{
# @TechReport{
# @Unpublished{
#
i... | Python | 0.000334 | @@ -2081,24 +2081,32 @@
p(1).strip()
+.lower()
%0A%09%09%09continue
|
d43ddab5908a543236a05860fb15658ec154aa5b | Fix import in test | tests/outputs/gstreamer_test.py | tests/outputs/gstreamer_test.py | import multiprocessing
import unittest
from mopidy.outputs.gstreamer import GStreamerOutput
from mopidy.process import pickle_connection
from mopidy.utils.path import path_to_uri
from tests import data_folder, SkipTest
class GStreamerOutputTest(unittest.TestCase):
def setUp(self):
self.song_uri = path_to... | Python | 0.000001 | @@ -102,40 +102,37 @@
idy.
-process import pickle_connection
+utils.path import path_to_uri
%0Afro
@@ -139,35 +139,38 @@
m mopidy.utils.p
-ath
+rocess
import path_to_
@@ -162,26 +162,32 @@
import p
-ath_to_uri
+ickle_connection
%0A%0Afrom t
|
010a827abdc891bd79f7474c5ef65b991edf2a1b | Update candidate_party_corrections.py | calaccess_processed/candidate_party_corrections.py | calaccess_processed/candidate_party_corrections.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Includes correct party affiliation for candidate in specific contests.
"""
corrections = (
# http://elections.cdn.sos.ca.gov/statewide-elections/2014-primary/updated-contact-info.pdf # noqa
('WINSTON, ALMA MARIE', 2014, 'PRIMARY', 'GOVERNOR', 'REPUBLICAN'),
... | Python | 0.000001 | @@ -871,160 +871,139 @@
p://
-elections.cdn.sos.ca.gov/statewide-elections/2014-general/updated-contact-info.pdf%0A ('KEPHART, GARY
+cal-access.sos.ca.gov/Campaign/Candidates/Detail.aspx?id=1273672%0A ('WALDRON, MARIE
', 201
-4, 'GENERAL', 'STATE SENATE 36', 'DEMOCRATIC
+8, 'PRIMARY', 'ASSEMBLY 75', 'REPUBLICAN... |
f37813595d7aa6b67ebf3066636eee5259b180cc | Should fix #153 | post-challenges.py | post-challenges.py | #!/usr/bin/env python3
"""
Author: Freddie Vargus (github.com/FreddieV4)
File: post_challenges.py
Purpose: Used to pull weekly challenges from r/dailyprogrammer
"""
import re
import os
import praw
from pprint import pprint
NUM_CHALLENGES = 3
debug = False
def db(string):
if debug:
print("DB: ", string)
def get_... | Python | 0.99935 | @@ -998,16 +998,83 @@
testamp%0A
+%09%09t = re.sub(r'%5B%3C%3E:%5C%22%5C%5C%5C/%7C?*%5D', '', title) # removes special chars%0A
%09%09title_
|
4674a0ccbba7596cfcfd4cd21e3355b0afaa0c95 | Fix l10n history movements | postatus/status.py | postatus/status.py | import requests
import sys
import time
def format_time(t):
return time.ctime(t)
def format_short_date(t):
return time.strftime('%m/%d', time.gmtime(t))
# ./bin/l10n_status.py --app=feedback --type=history --highlight=es,pt_BR,po,hu,de,gr,fr,it,ru,ja,tr,zh_TW,zh_CN https://input.mozilla.org/static/l10n_com... | Python | 0.006142 | @@ -2337,16 +2337,47 @@
, day))%0A
+ prev_day = day%0A
@@ -2548,20 +2548,10 @@
el
-if day %3C 100
+se
:%0A
@@ -3793,40 +3793,8 @@
)
-%0A print output%5B'locales'%5D
%0A%0A
|
cc13845684230565fe8bb94f2877001af67a170d | Update %%powershell help | powershellmagic.py | powershellmagic.py | """IPython magics for Windows PowerShell.
"""
__version__ = '0.1'
import atexit
import os
from subprocess import Popen, PIPE
import sys
import tempfile
from IPython.core.magic import (cell_magic, Magics, magics_class)
from IPython.core.magic_arguments import (
argument, magic_arguments, parse_argstring)
@magics... | Python | 0 | @@ -1020,16 +1020,21 @@
edirect
+cell
stdout t
@@ -1131,16 +1131,21 @@
edirect
+cell
stderr t
@@ -1238,99 +1238,78 @@
%22%22%22
-Execute a cell written in PowerShell by spawning a process%0A that invokes the command
+Use Windows PowerShell to execute an IPython cell.%0A%0A An example
:%0A%0A
@... |
f3802e794496f3f4ac7c3251f795fd64b3e7ef55 | Add a missing no-cover to increase coverage under py3 | pre_commit/util.py | pre_commit/util.py | from __future__ import unicode_literals
import contextlib
import errno
import functools
import os
import os.path
import shutil
import stat
import subprocess
import tarfile
import tempfile
import pkg_resources
from pre_commit import five
@contextlib.contextmanager
def cwd(path):
original_cwd = os.getcwd()
o... | Python | 0.000002 | @@ -3682,16 +3682,22 @@
no cover
+ (py3)
%0A
@@ -3745,32 +3745,58 @@
o_text%0A else:
+ # pragma: no cover (py2)
%0A __str__
|
af3ddbf32379ecf96224746eb59d0685be9586ae | Simplify compression | src/mock_vws/_mock_web_query_api.py | src/mock_vws/_mock_web_query_api.py | """
A fake implementation of the Vuforia Web Query API.
See
https://library.vuforia.com/articles/Solution/How-To-Perform-an-Image-Recognition-Query
"""
import email.utils
import gzip
import uuid
from io import BytesIO
from typing import Callable, List, Set
from requests_mock import POST
from requests_mock.request im... | Python | 0.000068 | @@ -194,31 +194,8 @@
uid%0A
-from io import BytesIO%0A
from
@@ -2029,19 +2029,21 @@
) -%3E
-str
+bytes
:%0A
@@ -2501,145 +2501,43 @@
-out = BytesIO()%0A with gzip.GzipFile(fileobj=out, mode='w') as f:%0A f.write(text.encode())%0A%0A value = out.getvalue(
+value = gzip.compre... |
2b7e95d7964bd194c509ca3b69f5d7a324df1679 | Switch argument from function_path to path | furious/job_utils.py | furious/job_utils.py | #
# Copyright 2012 WebFilings, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 0.000005 | @@ -2368,25 +2368,16 @@
ference(
-function_
path):%0A
@@ -2736,25 +2736,16 @@
es.%0A
-function_
path = s
@@ -2747,25 +2747,16 @@
h = str(
-function_
path)%0A%0A
@@ -2772,25 +2772,16 @@
not in
-function_
path:%0A
@@ -2836,25 +2836,16 @@
ins__%22%5D%5B
-function_
path%5D%0A
@@ -2942,25 +2942,16 @@
... |
b19acf693b1b428fdc3440fa3dd78cb5cf173ba4 | Add the needed wait for ajax statements to checklist acceptance test methods | cms/djangoapps/contentstore/features/checklists.py | cms/djangoapps/contentstore/features/checklists.py | # pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_true, assert_equal # pylint: disable=E0611
from terrain.steps import reload_the_page
from selenium.common.exceptions import StaleElementReferenceException
############### ACTIONS ####################
@step(... | Python | 0 | @@ -492,16 +492,51 @@
nk_css)%0A
+ world.wait_for_ajax_complete()%0A
%0A%0A@step(
@@ -3971,16 +3971,51 @@
(task))%0A
+ world.wait_for_ajax_complete()%0A
%0A%0A# TODO
@@ -4703,28 +4703,63 @@
cklist) + ' a', index=task)%0A
+ world.wait_for_ajax_complete()%0A
|
00500833f354158cc5fb918fbdc70d8ede7b3d09 | Fix and improve debugging of Optparse test. | tests/test_django1_10_fixers.py | tests/test_django1_10_fixers.py | from __future__ import absolute_import, print_function, unicode_literals
import _test_utilities
import pytest
def test_fix_incoming_urls_submodule():
from django.urls import (
get_callable,
RegexURLPattern,
RegexURLResolver,
NoReverseMatch,
)
assert get_callable
def tes... | Python | 0 | @@ -3431,24 +3431,55 @@
optparse():%0A
+ from django import VERSION%0A
from dja
@@ -3602,16 +3602,378 @@
stdout%0A%0A
+ with captured_stdout() as stdout, captured_stderr():%0A # Check that new, argparse-based commands, still work as intended!%0A management.execute_from_command_line(%5B'django... |
c830eb5b6b1581ccd3c6c9d80cb48cddc22bb26b | Update interop html template location | tools/run_tests/python_utils/report_utils.py | tools/run_tests/python_utils/report_utils.py | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | Python | 0 | @@ -3705,24 +3705,32 @@
ests/interop
+/interop
_html_report
|
524ccb07e924f4b21ddf53bc204385c0596bd297 | Make record_wpr respect Tests before Measurements. | tools/telemetry/telemetry/page/record_wpr.py | tools/telemetry/telemetry/page/record_wpr.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import sys
import tempfile
import time
from telemetry import test
from telemetry.core import browser_optio... | Python | 0.000003 | @@ -2873,26 +2873,19 @@
s%5B0%5D in
-measuremen
+tes
ts:%0A
@@ -2889,26 +2889,19 @@
ps =
-measuremen
+tes
ts%5Bargs%5B
@@ -2924,14 +2924,8 @@
Set(
-args,
opti
@@ -2939,35 +2939,42 @@
elif args%5B0%5D in
-tes
+measuremen
ts:%0A ps = tes
@@ -2962,35 +2962,42 @@
ments:%0A ps =
-tes
+measuremen
... |
c5ccf36fbeb6b744918e3090422763103b181de8 | Fix name (copy paste fail...) | tests/test_tripleStandardize.py | tests/test_tripleStandardize.py | import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestCase):
def ... | Python | 0 | @@ -318,24 +318,28 @@
ef testBuild
+From
Bucket(self)
|
fdd4a88c7a7981e8df1dd7da150b164c8121d4be | Add more youtube and vimeo links for testing | tests/testapp/test_embedding.py | tests/testapp/test_embedding.py | from django.test import TestCase
from feincms3 import embedding
class EmbeddingTest(TestCase):
def test_no_handlers(self):
"""Embed video without handlers"""
self.assertEqual(embedding.embed_video("stuff"), None)
def test_youtube(self):
"""Test a youtube link"""
self.assertEq... | Python | 0 | @@ -629,240 +629,1325 @@
-def test_vimeo(self):%0A self.assertEqual(%0A embedding.embed_video(%22https://vimeo.com/455728498%22),%0A %22%22%22%5C%0A%3Cdiv class=%22responsive-embed widescreen vimeo%22%3E%3Ciframe %5C%0Asrc=%22https://player.vimeo.com/video/45572849
+ self.assertEqu... |
9b4af9cc7864be8ed38f34628ae012c9e5b4e4c1 | Fix person tests | zou/app/services/index_service.py | zou/app/services/index_service.py | from pathlib import Path
from zou.app.utils import indexing
from zou.app import app
from zou.app.index_schema import asset_schema, person_schema
from zou.app.services import (
assets_service,
persons_service,
projects_service
)
def get_index(index_name):
"""
Retrieve whoosh index from disk. It ... | Python | 0.000001 | @@ -3730,16 +3730,20 @@
ndex(),
+str(
asset_id
@@ -3743,16 +3743,17 @@
sset_id)
+)
%0A%0A%0Adef r
@@ -3913,16 +3913,20 @@
ndex(),
+str(
person_i
@@ -3919,17 +3919,18 @@
, str(person_id)
+)
%0A
|
0991a09a3678818683614a6735c9c46379b13a96 | Fix unicode representation | gasistafelice/rest/views/blocks/__init__.py | gasistafelice/rest/views/blocks/__init__.py |
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from django.shortcuts import render_to_response
from django.contrib.auth.models import User
from gasistafelice.globals import type_model_d
from gasistafelice.rest.models import BlockConfiguration
#--------------------------------------------... | Python | 0.999999 | @@ -5552,12 +5552,8 @@
' %25
-(str
(sel
@@ -5572,17 +5572,16 @@
ption())
-)
,%0A
|
c9d45a96236b822e2a5ca11490afdb02b9a5e699 | Drop Py2 and six on tests/unit/states/test_modjk.py | tests/unit/states/test_modjk.py | tests/unit/states/test_modjk.py | # -*- coding: utf-8 -*-
"""
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.states.modjk as modjk
from salt.ext import six
# Import Salt Testing Libs
from tests.support.unit import T... | Python | 0 | @@ -1,28 +1,4 @@
-# -*- coding: utf-8 -*-%0A
%22%22%22%0A
@@ -60,341 +60,84 @@
%22%22%22%0A
-# Import Python libs%0Afrom __future__ import absolute_import, print_function, unicode_literals%0A%0A# Import Salt Libs%0Aimport salt.states.modjk as modjk%0Afrom salt.ext import six%0A%0A# Import Salt Testing Libs%0Afrom tes... |
0a84c767395bd8cb88711afae8bc94b045d50e78 | Remove unused import | tests/utils/test_train_utils.py | tests/utils/test_train_utils.py | from typing import Any, Dict
import numpy as np
import pytest
import rasa.utils.train_utils as train_utils
from rasa.core.policies.ted_policy import TEDPolicy
from rasa.nlu.constants import NUMBER_OF_SUB_TOKENS
from rasa.nlu.tokenizers.tokenizer import Token
from rasa.shared.nlu.constants import (
SPLIT_ENTITIES_... | Python | 0.000001 | @@ -106,60 +106,8 @@
ils%0A
-from rasa.core.policies.ted_policy import TEDPolicy%0A
from
|
a42c361b3014c7acf479528cbd07593ce08d3f41 | Test or keywords must have a name | src/robotide/validators/__init__.py | src/robotide/validators/__init__.py | # Copyright 2008-2009 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0.000001 | @@ -4574,32 +4574,105 @@
te(self, name):%0A
+ if not name:%0A return 'Test case name cannot be empty'%0A
return s
@@ -4786,32 +4786,108 @@
te(self, name):%0A
+ if not name:%0A return 'User keyword name cannot be empty'%0A
return s
|
d5f77356c5f49e04bbbed08b576b48c4b76c6b1f | clean up comments. | proptools/solid.py | proptools/solid.py | """ Solid rocket motor equations.
"""
from scipy.integrate import cumtrapz
from proptools import nozzle
def chamber_pressure(K, a, n, rho_solid, c_star):
"""Chamber pressure due to solid propellant combustion.
See equation 12-6 in Rocket Propulsion Elements 8th edition.
Args:
K (scalar): Ratio... | Python | 0 | @@ -26,16 +26,110 @@
uations.
+%0A%0A.. autosummary::%0A%0A chamber_pressure%0A burn_area_ratio%0A burn_and_throat_area%0A thrust_curve
%0A%22%22%22%0A%0Afr
@@ -314,13 +314,20 @@
-See e
+Reference: E
quat
@@ -356,32 +356,33 @@
pulsion Elements
+,
8th edition.%0A%0A
@@ -854,16 +854,24 @@
%0A
+ s... |
96dbf260a5c7bf9d5f89951f77792cf1c04d5e38 | add profiling to perf.py | perf.py | perf.py | import time
from parinfer import indent_mode, paren_mode
def timeProcess(string, options):
numlines = len(string.splitlines())
print "Testing file with", numlines, "lines"
t = time.clock()
indent_mode(string, options)
dt = time.clock() - t
print "Indent Mode:", dt, "s"
t = time.clock()
paren_mode(str... | Python | 0.000001 | @@ -1,12 +1,28 @@
+import cProfile%0A
import time%0A
@@ -399,16 +399,158 @@
t, %22s%22%0A%0A
+ cProfile.runctx(%22indent_mode(string, options)%22, globals(), locals())%0A cProfile.runctx(%22paren_mode(string, options)%22, globals(), locals())%0A%0A
with ope
|
e8df708d7d926d82a7df13031aabbfb64e7347b4 | Change to work with entryparser changes | contrib/plugins/comments/xmlrpcplugins/pingback.py | contrib/plugins/comments/xmlrpcplugins/pingback.py | from config import py
from libs.pyblosxom import PyBlosxom
from libs.Request import Request
from libs import tools
import cgi, os, re, sgmllib, time, urllib
class parser(sgmllib.SGMLParser):
""" Shamelessly grabbed from Sam Ruby
from http://www.intertwingly.net/code/mombo/pingback.py
"""
""" extract t... | Python | 0 | @@ -1005,101 +1005,8 @@
ta()
-%0A import libs.entryparsers.__init__%0A libs.entryparsers.__init__.initialize_extensions()
%0A%0A
@@ -1109,16 +1109,117 @@
(config)
+%0A%0A # do start callback%0A tools.run_callback(%22start%22, %7B'request': req%7D, mappingfunc=lambda x,y:y)
%0A %0A
@@ -1302,24 +13... |
dbb6fff417a3beac0db7dec603d4793eabc68a89 | bump version but not calling it stable in readme yet | psiturk/version.py | psiturk/version.py | version_number = '2.2.3'
| Python | 0 | @@ -19,7 +19,7 @@
2.2.
-3
+4
'%0A
|
a804f44414bdb68053e05f04e778ca95f81d5048 | Add missing import for OrderedDict in query.py | psqlextra/query.py | psqlextra/query.py | from typing import List, Tuple, Optional, Dict, Any
from enum import Enum
from django.db import models
from django.db.models import sql
from django.db.models.constants import LOOKUP_SEP
from django.core.exceptions import SuspiciousOperation
from .fields import HStoreField
from .expressions import HStoreColumn
from .d... | Python | 0 | @@ -1,12 +1,34 @@
+from enum import Enum%0A
from typing
@@ -72,32 +72,46 @@
ny%0Afrom
-enum import Enum
+collections import OrderedDict
%0A%0Afrom d
|
b22b9d8d1e3d84d89368a4ed8ea4fad576f2c7b5 | Fix a NameError in LibNotifyHandler | logbook/notifiers.py | logbook/notifiers.py | # -*- coding: utf-8 -*-
"""
logbook.notifiers
~~~~~~~~~~~~~~~~~
System notify handlers for OSX and Linux.
:copyright: (c) 2010 by Armin Ronacher, Christopher Grebs.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import base64
import urllib2
from urllib import urlencode
from... | Python | 0.000447 | @@ -4746,21 +4746,16 @@
if not
-self.
no_init:
|
c5e3188ab7d476805f7acad6bd3a4e6e96ebf440 | Update cumulusci/tasks/bulkdata/generate_and_load_data.py | cumulusci/tasks/bulkdata/generate_and_load_data.py | cumulusci/tasks/bulkdata/generate_and_load_data.py | import os
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
from cumulusci.tasks.bulkdata import LoadData
from cumulusci.utils import temporary_dir
from cumulusci.core.config import TaskConfig
from cumulusci.core.utils import import_global
from cumulusci.core.exceptions import TaskOptionsError
class Genera... | Python | 0 | @@ -576,17 +576,16 @@
%60mapping
-s
%60 option
|
faebedc4621a9a1e6e9b2b20fb4f98f61ba3fcf9 | Update skbio/parse/sequences/factory.py | skbio/parse/sequences/factory.py | skbio/parse/sequences/factory.py | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | Python | 0.000001 | @@ -2137,20 +2137,29 @@
-pass
+return opened
%0A exc
@@ -2240,27 +2240,8 @@
))%0A%0A
- return opened%0A%0A
%0Adef
|
e9fd001a21c594f3efd076aab73fdb3fafaa49f0 | fix typo | tests/build_utilities/native_config.xpybuild.py | tests/build_utilities/native_config.xpybuild.py | import os, glob, logging
from xpybuild.propertysupport import *
from xpybuild.buildcommon import *
from xpybuild.pathsets import *
from xpybuild.utils.compilers import GCC, VisualStudio
log = logging.getLogger('xpybuild.tests.native_config')
# some basic defaults for recent default compilers for running our t... | Python | 0.999991 | @@ -1033,17 +1033,16 @@
0.0%5Cucrt
-x
%22):%0D%0A%09%09l
|
bdaf7b8f30b6a3a493cc5246dd908bdcdff69ab8 | Increase test coverage | tests/commands/load/test_load_cnv_report_cmd.py | tests/commands/load/test_load_cnv_report_cmd.py | # -*- coding: utf-8 -*-
import os
from scout.demo import cnv_report_path
from scout.commands import cli
def test_load_cnv_report(mock_app, case_obj):
"""Testing the load delivery report cli command"""
# Make sure the path to delivery report is a valid path
assert os.path.isfile(cnv_report_path)
run... | Python | 0 | @@ -420,29 +420,12 @@
oke(
-%0A cli,%0A
+cli,
%5B%22l
@@ -484,21 +484,16 @@
, %22-u%22%5D,
-%0A
)%0A%0A a
@@ -572,8 +572,404 @@
de == 0%0A
+%0A%0Adef test_invalid_path_load_cnv_report(mock_app, case_obj):%0A %22%22%22Testing the load delivery report cli command%22%22%22%0A%0A runner = m... |
2ca2792289fd4c426f77395df92a3c2019c7fae5 | use SafeLoader | tests/retime/robustness/test_robustness_main.py | tests/retime/robustness/test_robustness_main.py | import pytest
import numpy as np
import yaml
import re
import pandas
import tabulate
import time
try:
import pathlib
except ImportError:
import pathlib2 as pathlib
import toppra
import toppra.constraint as constraint
import toppra.algorithm as algo
import matplotlib.pyplot as plt
def test_robustness_main(re... | Python | 0 | @@ -790,16 +790,40 @@
d_text()
+, Loader=yaml.SafeLoader
)%0A fo
|
a403dff24e33e6b0ef0b31b4342a9b978f9090f2 | Improve admin display | src/cerberus_ac/admin.py | src/cerberus_ac/admin.py | # -*- coding: utf-8 -*-
"""Admin module."""
from django.contrib import admin
from .models import (
AccessHistory, PrivilegeHistory, Role, RoleHierarchy, RolePrivilege)
# class SecurityAdmin(AdminSite):
# pass
#
#
# class DataAdmin(AdminSite):
# pass
#
#
# class AuditAdmin(AdminSite):
# pass
#
#
# s... | Python | 0 | @@ -72,16 +72,193 @@
t admin%0A
+from django.core.urlresolvers import reverse%0Afrom django.utils.safestring import mark_safe%0Afrom django.utils.translation import ugettext_lazy as _%0A%0Afrom .apps import AppSettings
%0Afrom .m
@@ -1096,24 +1096,101 @@
class.%22%22%22%0A%0A
+ list_display = ('role_type_a', 'ro... |
8a29107eb7c061b0559081ddea263b5ddaa9d804 | Modify return to handle cases with less than 10 documents | search.py | search.py | import getopt
import sys
import pickle
from nltk.stem.porter import PorterStemmer
from nltk.tokenize import word_tokenize
from collections import Counter
import math
import string
import operator
import heapq
from pprint import pprint
dictionary = {}
postings_file = None
postings_sizes = []
starting_byte_offset = 0
al... | Python | 0.000001 | @@ -1951,102 +1951,175 @@
)%0A%0A%09
-result = %5B%5D%0A%09for i in range(10):%0A%09%09result.append(heapq.heappop(scores_heap)%5B1%5D)%0A%09return result
+if len(scores_heap) %3E= 10:%0A%09%09return %5Bheapq.heappop(scores_heap)%5B1%5D for i in range(10)%5D%0A%09else:%0A%09%09return %5Bheapq.heappop(scores_heap)%5B1%... |
5103ac24b5513441ea1ea318cfdb7b6a6425b648 | Add query weight calculations | search.py | search.py | import getopt
import sys
import pickle
from nltk.stem.porter import PorterStemmer
from nltk.tokenize import word_tokenize
import math
import string
import operator
dictionary = {}
postings_file = None
postings_sizes = []
starting_byte_offset = 0
all_doc_ids = []
def usage():
print("usage: " + sys.argv[0] + " -d dict... | Python | 0.000006 | @@ -115,16 +115,48 @@
okenize%0A
+from collections import Counter%0A
import m
@@ -826,16 +826,24 @@
%09return
+Counter(
%5Bstemmer
@@ -926,16 +926,17 @@
uations%5D
+)
%0A%0Adef ha
@@ -1030,16 +1030,132 @@
pq%0A%09
-for term
+query_l2_norm = math.sqrt(sum(%5Bmath.pow(1 + math.log10(query_tf), 2) for t, query_tf ... |
b7f4696d1384f656df71332055cd4ea87f85e3c9 | Bump to v0.2.3. | luminoth/__init__.py | luminoth/__init__.py | __version__ = '0.2.3dev0'
__title__ = 'Luminoth'
__description__ = 'Computer vision toolkit based on TensorFlow'
__uri__ = 'https://luminoth.ai'
__doc__ = __description__ + ' <' + __uri__ + '>'
__author__ = 'Tryolabs'
__email__ = 'luminoth@tryolabs.com'
__license__ = 'BSD 3-Clause License'
__copyright__ = 'Copyright... | Python | 0 | @@ -17,12 +17,8 @@
.2.3
-dev0
'%0A%0A_
|
ea5e6ca2e6523f0b2a585112b5fd5f18e9fcf969 | add namespace | ds9/library/parser.tac | ds9/library/parser.tac | %{
%}
%token INT_
%token REAL_
%token STRING_
%token FOOCMD_
%token EXITCMD_
%token CLOSE_
%token FIT_
%token OPEN_
%token TO_
%%
commands : commands command
| command
;
int : INT_ {set _ $1}
;
command : FOOCMD_ foo
| EXITCMD_ exit
;
numeric : int {set _ $1}
| REAL_ {set _ $1}
;
foo : STRING_ {puts "STR... | Python | 0.000015 | @@ -545,16 +545,20 @@
%25%0A%0Aproc
+yy::
yyerror
@@ -614,16 +614,18 @@
tderr %22$
+yy
::yy_buf
@@ -661,16 +661,18 @@
%22%25*s%22 $
+yy
::yy_ind
|
3a2f56b6c6a0e4a00426d786adc875e494fc323a | Make CSV export generic | ebmdatalab/bigquery.py | ebmdatalab/bigquery.py | import psycopg2
from google.cloud import bigquery
from google.cloud.bigquery import SchemaField
import time
import csv
import tempfile
from os import environ
PRESCRIBING_SCHEMA = [
SchemaField('sha', 'STRING'),
SchemaField('pct', 'STRING'),
SchemaField('practice', 'STRING'),
SchemaField('bnf_code', 'S... | Python | 0.000118 | @@ -5851,29 +5851,62 @@
-conn.cursor().copy_to
+sql = %22COPY %25s(%25s) TO STDOUT (FORMAT CSV, NULL '')%22 %25
(%0A
@@ -5914,26 +5914,16 @@
- csv_file,
pg_tabl
@@ -5934,38 +5934,84 @@
me,
-sep=',', null='', columns=cols
+%22,%22.join(cols))%0A conn.cursor().copy_expert(%0A sql... |
d0e28e5049ecd70bb67ab0cc565e5f22986ddee7 | fix exception when raising exceptions! | elfinder/exceptions.py | elfinder/exceptions.py | from django.utils.translation import ugettext as _
class ElfinderErrorMessages:
"""
Standard error message codes, the text message of which is handled by the
elFinder client
"""
ERROR_UNKNOWN = 'errUnknown'
ERROR_UNKNOWN_CMD = 'errUnknownCmd'
ERROR_CONF = 'errConf'
ERROR_CONF_NO_JSON ... | Python | 0 | @@ -3118,34 +3118,39 @@
super(
-DirNotFoun
+PermissionDenie
dError, self
@@ -3551,35 +3551,34 @@
super(
-DirNotFound
+NotAnImage
Error, self)
|
818d89c897603eeb33caf1ca2cdaeae5c3010880 | Use passed directory in mako engine. | engines/mako_engine.py | engines/mako_engine.py | #!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(self, template, t... | Python | 0 | @@ -311,16 +311,30 @@
emplate,
+ dirname=None,
toleran
@@ -445,16 +445,140 @@
wargs)%0A%0A
+ directories = %5Bdirname%5D if dirname is not None else %5B'.'%5D%0A lookup = TemplateLookup(directories=directories)%0A%0A
@@ -901,59 +901,8 @@
n'%5D%0A
- lookup = TemplateLookup(directories... |
cb59aaff2d120ffa5f15b822ec21d3137f90184f | Bump logistic_requisition version - fixup | logistic_requisition/__openerp__.py | logistic_requisition/__openerp__.py | # -*- coding: utf-8 -*-
#
#
# Author: Joël Grand-Guillaume, Jacques-Etienne Baudoux, Guewen Baconnier
# Copyright 2013-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Softw... | Python | 0 | @@ -879,16 +879,18 @@
n%22: %221.4
+.1
%22,%0A %22aut
|
dcbc52ba5f4c4e82dbad8b37064b6dae18302468 | add hostManagementIface to autogeneration | xos/synchronizer/steps/sync_onos_netcfg.py | xos/synchronizer/steps/sync_onos_netcfg.py | import os
import requests
import socket
import sys
import base64
import json
from synchronizers.base.syncstep import SyncStep
from core.models import Service, Slice, Controller, ControllerSlice, ControllerUser, Node, TenantAttribute, Tag
from services.vtn.models import VTNService
from xos.logger import Logger, logging
... | Python | 0.000001 | @@ -4331,32 +4331,236 @@
p%0A %7D%0A
+%0A # this one is optional%0A try:%0A node_dict%5B%22hostManagementIface%22%5D = self.get_node_tag(node, %22hostManagementIface%22)%0A except IndexError:%0A pass%0A%0A
data
|
13260904c6d34d7554eea8152ceaa2ee8601e3e9 | Add missing import | pulldb/volumes.py | pulldb/volumes.py | # Copyright 2013 Russell Heilling
from datetime import datetime
import logging
from math import ceil
import re
from google.appengine.api import search
from google.appengine.ext import ndb
import pycomicvine
from pulldb import base
from pulldb import publishers
from pulldb import subscriptions
from pulldb import uti... | Python | 0.000466 | @@ -57,16 +57,22 @@
datetime
+, date
%0Aimport
|
d3057d336332f8315580cc7fa7c6e3d3fb1cbcc8 | Use a format-string to build the command | py3status/modules/taskwarrior.py | py3status/modules/taskwarrior.py | # -*- coding: utf-8 -*-
"""
Display tasks currently running in taskwarrior.
Configuration parameters:
cache_timeout: refresh interval for this module (default 5)
format: display format for this module (default '{task}')
filter: arguments passed to the command
(default 'start.before:today status:pen... | Python | 0.00028 | @@ -1063,19 +1063,28 @@
= 'task
+%25s export
'
-+
+%25
self.fi
@@ -1091,20 +1091,8 @@
lter
- + ' export'
%0A
|
9fc7ce4d0af6e1cb923c8f3a5ca5d693b5c52f4c | set SESSION_SAVE_EVERY_REQUEST = True | gem/settings/base.py | gem/settings/base.py | """
Django settings for base gem.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from os.path import abspath, dirname, join
from os import environ
from django.con... | Python | 0.999814 | @@ -2740,16 +2740,142 @@
ation'%0A%0A
+# GEM-195%0A# Automatically log users out after 10 mins of inactivity%0A# Closing the browser window/tab will NOT end the session%0A
SESSION_
@@ -2908,16 +2908,50 @@
minutes
+%0ASESSION_SAVE_EVERY_REQUEST = True
%0A%0A# Data
|
c4652d7772a0d9b374fc178502a71efd03d35d48 | Remove hs.parse_eventid | synapse/server.py | synapse/server.py | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0.000104 | @@ -1151,42 +1151,8 @@
ore%0A
-from synapse.types import EventID%0A
from
@@ -4264,323 +4264,8 @@
t)%0A%0A
- # TODO: Why are these parse_ methods so high up along with other globals?%0A # Surely these should be in a util package or in the api package?%0A%0A def parse_eventid(self, s):%0A %22%22%22Pars... |
ae9b7bf45832b69f6a3ca94e24ed6d2e7d3a384d | Update __init__.py | gemstone/__init__.py | gemstone/__init__.py | """
Build microservices with Python
"""
from gemstone.core.microservice import MicroService
from gemstone.core.decorators import private_api_method, public_method, event_handler
from gemstone.core.handlers import TornadoJsonRpcHandler
from gemstone.client.remote_service import RemoteService
from gemstone.util import ... | Python | 0.000072 | @@ -445,9 +445,9 @@
%220.
-4
+5
.0%22%0A
|
322d10c8932f160a305fab126401e3f172453e7e | Refactor prototxt generation. | generate_prototxt.py | generate_prototxt.py | #!/usr/bin/python
import os
import sys
caffe_root = os.getenv('CAFFE_ROOT', './')
sys.path.insert(0, caffe_root + '/python')
import caffe
from caffe import layers as L, params as P
def lenet():
n = caffe.NetSpec()
# empty layers as placeholders
# the resulting prototxt must be edited manually
n.dat... | Python | 0 | @@ -188,16 +188,33 @@
f lenet(
+batch_size, phase
):%0A n
@@ -943,24 +943,56 @@
='xavier'))%0A
+%0A if (phase == 'TRAIN'):%0A
n.loss
@@ -1029,16 +1029,83 @@
.label)%0A
+ else if (phase == 'TEST'):%0A n.prob = L.Softmax(n.score)%0A
%0A
@@ -1194,24 +1194,35 @@
e(str(lenet(
+50, 'TR... |
ef80c3374b41b9ab1b390adda5a2e4c16252c137 | fix pep8 | pyedflib/tests/test_edfreader.py | pyedflib/tests/test_edfreader.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Holger Nahrstaedt
from __future__ import division, print_function, absolute_import
import os
import numpy as np
from datetime import datetime
# from numpy.testing import (assert_raises, run_module_suite,
# assert_equal, assert_allclose, assert_alm... | Python | 0.000001 | @@ -741,28 +741,16 @@
return%0A
-
%0A
@@ -1450,24 +1450,16 @@
return
-
%0A
@@ -2505,32 +2505,16 @@
return
-
%0A
|
739df1a5be70f5044d7c6be357776e36ae330ce3 | Fix a bug in the OpenMP backend. | pyfr/backends/openmp/compiler.py | pyfr/backends/openmp/compiler.py | # -*- coding: utf-8 -*-
import os
import shutil
import subprocess
import tempfile
import itertools as it
from abc import ABCMeta, abstractmethod
from ctypes import CDLL
import numpy as np
from pyfr.ctypesutil import platform_libname
from pyfr.nputil import npdtype_to_ctypestype
from pyfr.util import memoize, chdir
... | Python | 0 | @@ -1327,17 +1327,22 @@
backend-
-c
+openmp
', 'cc',
|
81d41ceaf89848851d8353021f01f41c724aaae8 | Add docstring to PySplunk | pygraphc/misc/splunk/pysplunk.py | pygraphc/misc/splunk/pysplunk.py | from os import system, remove
class PySplunk(object):
def __init__(self, username, source, host, output_mode, tmp_file='/tmp/pysplunk_cluster.csv'):
self.username = username
self.source = source.replace(' ', '\ ')
self.host = host
self.output_mode = output_mode
self.tmp_fil... | Python | 0.000001 | @@ -57,102 +57,933 @@
-def __init__(self, username, source, host, output_mode, tmp_file='/tmp/pysplunk_cluster.csv'):
+%22%22%22Get log clustering using Python Splunk API %5BSplunkDev2016%5D_.%0A%0A References%0A ----------%0A .. %5BSplunkDev2016%5D Command line examples in the Splunk SDK for Python.%0A ... |
15c7851fda49caa4a0e13e4a128fed739e384e69 | fix discrete unif problem when using int64: no idea what its about, but we should fix it at some point | pymc/tests/test_distributions.py | pymc/tests/test_distributions.py | import itertools as its
from checks import *
from pymc import *
from numpy import array, inf
from scipy import integrate
from numdifftools import Gradient
R = array([-inf, -2.1, -1, -.01, .0, .01, 1, 2.1, inf])
Rplus = array([0, .01, .1, .9, .99, 1, 1.5, 2, 100, inf])
Rplusbig = array([0, .5, .9, .99, 1, 1.5, 2, 20,... | Python | 0.000021 | @@ -428,16 +428,25 @@
, 0, 10%5D
+, 'int64'
)%0ARplusu
@@ -502,16 +502,25 @@
10, 100%5D
+, 'int64'
)%0A%0AI = a
|
c3d856561887c61839a3781251f36929af0e8718 | relax bool | pycaffe2/utils.py | pycaffe2/utils.py | from caffe2.proto import caffe2_pb2
from caffe.proto import caffe_pb2
from google.protobuf.message import DecodeError, Message
from google.protobuf import text_format
import numpy as np
def CaffeBlobToNumpyArray(blob):
return np.asarray(blob.data, dtype=np.float32).reshape(
blob.num, blob.channels, blob.height... | Python | 0.999777 | @@ -917,17 +917,119 @@
) is int
-:
+ or type(value) is bool:%0A # We make a relaxation that a boolean variable will also be stored as int.
%0A arg
|
bfdc6fe5d0a8f6200f80c071fe4d3150020b4cdd | version 20200404.1 | pydal/__init__.py | pydal/__init__.py | __version__ = "20200321.1"
from .base import DAL
from .objects import Field
from .helpers.classes import SQLCustomType
from .helpers.methods import geoPoint, geoLine, geoPolygon
| Python | 0 | @@ -17,11 +17,11 @@
0200
-321
+404
.1%22%0A
|
d8c280170cd8c9be6af9c913360ffce28e1bda7a | remove debug code | src/cineca.py | src/cineca.py | #!/usr/bin/env python
from collections import namedtuple
from six.moves import input
from operator import itemgetter
from tabulate import tabulate
from scopus import ScopusClient
from utils import *
import traceback
import os.path
import sqlite3
import json
import sys
from colorama import init, Fore, Style
init(auto... | Python | 0.02323 | @@ -3710,43 +3710,8 @@
inue
-%0A else:%0A continue
%0A%0A
|
931c016e43402f847c6e58b4679f7f5cf132776f | add DESI_LOGLEVEL environment variable, add doc, define WARNING... in module | py/desispec/log.py | py/desispec/log.py | """
Utility functions to dump log messages
We can have something specific for DESI in the future but for now we use the standard python
"""
import sys
import logging
desi_logger = None
def get_logger(level=logging.DEBUG) :
"""
returns a default desi logger
"""
global desi_logger
if desi_... | Python | 0 | @@ -160,16 +160,25 @@
logging%0A
+import os
%0A%0Adesi_l
@@ -195,159 +195,1923 @@
ne%0A%0A
-def get_logger(level=logging.DEBUG) :%0A %22%22%22 %0A returns a default desi logger %0A %22%22%22%0A%0A global desi_logger%0A %0A if desi_logger is not None :
+# just for convenience to avoid importing logg... |
16fd5a92ec48f9f35f07d51160aa2cc59a3b339b | add args to update_progress signal | src/client.py | src/client.py | import libxml2, sys, time, os, weakref, cPickle
import logging
from kaa import ipc, db
from kaa.notifier import Signal, OneShotTimer, execute_in_timer
from server import *
from channel import *
from program import *
__all__ = ['Client']
log = logging.getLogger()
class Client(object):
def __init__(self, server_... | Python | 0.000001 | @@ -1439,24 +1439,41 @@
rogress(self
+, *args, **kwargs
):%0A s
@@ -1508,16 +1508,31 @@
%22%5D.emit(
+*args, **kwargs
)%0A%0A
|
c8c2785b156523204e530cd78268686886ce2a37 | Fix incorrect module publics | py/oldfart/make.py | py/oldfart/make.py | import os
import re
import subprocess
__all__ = ['NOOP', 'SUCCESS', 'FAIL', 'Maker']
NOTHING_DONE = 1
SUCCESS = 2
NO_RULE = 3
FAILURE = 4
class Maker(object):
def __init__(self, project_dir='.', makefile='Makefile'):
self.project_dir = os.path.abspath(project_dir)
self.makefile = os.path.absp... | Python | 0.000025 | @@ -51,10 +51,18 @@
%5B'NO
-OP
+THING_DONE
', '
@@ -74,14 +74,28 @@
SS',
+ 'NO_RULE',
'FAIL
+URE
', '
|
89c2e367e4d691e83ccf92055c1dc8be59e05497 | use list comprehensions for legibility | pynder/session.py | pynder/session.py | from . import api
from . import models
class Session(object):
def __init__(self, facebook_id, facebook_token):
self._api = api.TinderAPI()
# perform authentication
self._api.auth(facebook_id, facebook_token)
self.profile = models.Profile(self._api.profile(), self)
def nearby_... | Python | 0.000001 | @@ -345,25 +345,9 @@
urn
-map(lambda user:
+%5B
mode
@@ -362,38 +362,24 @@
ul(u
-ser
, self)
-,%0A
+ for u in
sel
@@ -402,17 +402,17 @@
esults'%5D
-)
+%5D
%0A%0A de
@@ -551,26 +551,9 @@
urn
-map(lambda match:
+%5B
mode
@@ -566,39 +566,24 @@
ch(m
-atch
, self)
-,%0A ... |
042c32cbeca30da82239e7f6b9d83e88a2391dce | Fix name mangling to also replace : with _ | pybindgen/utils.py | pybindgen/utils.py | import sys
from typehandlers.codesink import CodeSink
from typehandlers.base import TypeConfigurationError, CodeGenerationError
import version
import settings
def write_preamble(code_sink, min_python_version=(2, 3)):
"""
Write a preamble, containing includes, #define's and typedef's
necessary to correctly... | Python | 0.000022 | @@ -2249,16 +2249,34 @@
ace(' ',
+ '_').replace(':',
'_') fo
|
f2a83197d9e0eaf04a3c062aa9a16c197ffd3c4d | add error logging | pyroute2/proxy.py | pyroute2/proxy.py | '''
Netlink proxy engine
'''
import errno
import struct
import threading
class NetlinkProxy(object):
'''
Proxy schemes::
User -> NetlinkProxy -> Kernel
|
<---------+
User <- NetlinkProxy <- Kernel
'''
def __init__(self, policy='forward', nl=None,... | Python | 0.000004 | @@ -49,16 +49,48 @@
struct%0A
+import logging%0Aimport traceback%0A
import t
@@ -1257,16 +1257,74 @@
n as e:%0A
+ logging.error(traceback.format_exc())%0A
|
cf0c31f553ea5a8265bd3213a4c5d384d0e72127 | Unify double quotes. | mail_forward/wizard/mail_forward.py | mail_forward/wizard/mail_forward.py | # -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | Python | 0.000134 | @@ -1707,17 +1707,17 @@
get(
-'
+%22
ir.model
')%0A
@@ -1712,17 +1712,17 @@
ir.model
-'
+%22
)%0A
@@ -1793,21 +1793,21 @@
%5B(
-'
+%22
model
-', 'in'
+%22, %22in%22
, co
|
82379ddc145673cca008127099e4bdc2e0aa503b | make sure we won't traverse 'None' object | pyswagger/scan.py | pyswagger/scan.py | from __future__ import absolute_import
from .base import BaseObj
from .utils import scope_compose
import six
def default_tree_traversal(root):
""" default tree traversal """
objs = [(None, None, root)]
while len(objs) > 0:
scope, name, obj = objs.pop()
# get children
new_scope = s... | Python | 0.99859 | @@ -2527,32 +2527,121 @@
%22%22%22%0A %22%22%22%0A
+ if root == None:%0A raise ValueError('Can%5C't scan because root==None')%0A%0A
merged_r
|
d10ff922cdd9eab4ff78bd94b7170f74148f97f3 | Version bump to 1.10 | pyglui/__init__.py | pyglui/__init__.py | __version__ = '1.9'
| Python | 0 | @@ -14,7 +14,8 @@
'1.
-9
+10
'%0A
|
4aad9edfbcb657f2c1f97dc73b245f8fa92341db | define a run method that does nothing | pyipmi/__init__.py | pyipmi/__init__.py | """pyipmi provides IPMI client functionality"""
from __future__ import print_function
__all__ = ['Handle', 'Tool', 'Command', 'make_bmc']
class Handle:
"""A handle to speak with a BMC
Handles use a Tool to speak with a BMC. It's basically a session handle
from its user's perspective, although handles may... | Python | 0.000003 | @@ -4376,16 +4376,117 @@
tring)%0A%0A
+ def run(self, command):%0A %22%22%22This should be defined in a subclass of Tool%22%22%22%0A pass%0A%0A
class Co
|
060f7400f27f0452eb4ed11ffed07aab16230126 | Update cts link | pynayzr/streams.py | pynayzr/streams.py | # -*- coding: utf-8 -*-
import os
import asyncio
import subprocess
import tempfile
from PIL import Image
support_news = {
'ttv': 'https://www.youtube.com/watch?v=yk2CUjbyyQY',
'ctv': 'https://www.youtube.com/watch?v=XBne4oJGEhE',
'cts': 'https://www.youtube.com/watch?v=TL8mmew3jb8',
'pts': 'https://ww... | Python | 0 | @@ -223,19 +223,19 @@
h?v=
-XBne4oJGEhE
+hVNbIZYi1nI
',%0A
|
1aa687b70aea9074ae28d1154ae0db4364add26e | Rewrite example.py. | pyoommf/example.py | pyoommf/example.py | import sim, mesh
# Mesh specification.
lx = ly = lz = 50e-9 # x, y, and z dimensions (m)
dx = dy = dz = 5e-9 # x, y, and z cell dimensions (m)
Ms = 8e5 # saturation magnetisation (A/m)
A = 1e-11 # exchange energy constant (J/m)
H = (1e6, 0, 0) # external magnetic field (A/m)
m_init = (0, 0, 1) # initial magneti... | Python | 0.000003 | @@ -1,20 +1,125 @@
-import sim, mesh
+from sim import Sim%0Afrom mesh import Mesh%0Afrom exchange import Exchange%0Afrom demag import Demag%0Afrom zeeman import Zeeman
%0A%0A#
@@ -486,21 +486,16 @@
%0Amesh =
-mesh.
Mesh(lx,
@@ -552,20 +552,16 @@
.%0Asim =
-sim.
Sim(mesh
@@ -594,10 +594,10 @@
.add
-_e
+(E
xcha... |
50ae1d3fb7e14fec94831a4c6667c7b1ba2e073b | add python script | python/python2.py | python/python2.py | #!/usr/bin/python2
# -*- coding: UTF-8 -*-
# install
# sudo pip install pymongo
# sudo pip install MySQL-python
# sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Python/2.7/site-packages/_mysql.so
# sudo pip install requests
# sudo pip install threadpool
# s... | Python | 0.000019 | @@ -532,16 +532,152 @@
.com%22)%0A%0A
+import urllib%0Ahtml = urllib.urlopen(%22http://www.baidu.com%22)%0Atemp_file = urllib.urlretrieve(%22http://www.baidu.com%22)%0Aurllib.urlcleanup()%0A%0A
# script
|
c0cbc2458c42bfb116c0d631c837f042f66d33a8 | Add explanatory comments to Python varargs script | python/varargs.py | python/varargs.py | def f(x, y=1000, *z):
print('x={} y={} z={}'.format(x,y,z))
f(0)
f(0,1)
f(0,1,2)
f(0,1,2,3)
f(0,1,2,3,4)
f(*[i for i in range(6)])
f(*range(7))
| Python | 0 | @@ -64,84 +64,344 @@
f(0)
-%0Af(0,1)%0Af(0,1,2)%0Af(0,1,2,3)%0Af(0,1,2,3,4)%0Af(*%5Bi for i in range(6)%5D)%0Af(*range(7)
+ # x=0, y=1000, z=()%0Af(0,1) # x=0, y=1, z=()%0Af(0,1,2) # x=0, y=1, z=(2,)%0Af(0,1,2,3) # x=0, y=1, z=(2,3)%0Af(0,... |
04c3cac3054626773bc0434453378cb295f7e38c | Add handling of invalid values | pytus2000/read.py | pytus2000/read.py | import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
nrows=50,
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
def _column_name... | Python | 0.000007 | @@ -154,26 +154,8 @@
t',%0A
- nrows=50,%0A
@@ -745,29 +745,189 @@
-return enumcls(value)
+try:%0A value = enumcls(value)%0A except ValueError as ve:%0A print(ve)%0A return None%0A else:%0A return value
%0A
|
fd421a4c5f7cdacdc98aa049b4650c9d1d62267a | Fix some issues with open. | grit/command/Open.py | grit/command/Open.py | from __future__ import absolute_import, division, print_function, unicode_literals
import os
import platform
import random
from grit import Call
from grit import Git
from grit import GitRoot
from grit import Settings
from grit.String import startswith
HELP = """
grit open [filename]
Open the filename as a Github... | Python | 0 | @@ -851,13 +851,215 @@
url(
-url):
+branch, path,%0A project=Settings.PROJECT,%0A user=Settings.USER):%0A path = os.path.relpath(path, GitRoot.ROOT)%0A u = _URL.format(branch=branch, path=path, project=project, user=user)
%0A
@@ -1116,18 +1116,16 @@
em()%5D, u
-rl
))%0A%0Adef
@@ -1... |
ace38408875e31e1dfc8e6b1f2e2bf956fffc761 | - message type 'groupchat' is valid | pyxmpp/message.py | pyxmpp/message.py | #
# (C) Copyright 2003 Jacek Konieczny <jajcus@bnet.pl>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
#... | Python | 0.998913 | @@ -836,16 +836,28 @@
,%22error%22
+,%22groupchat%22
)%0A%0Aclass
|
dbde102d14632bbaef7d6319d0742ac2819d6e38 | Implement the given spec. | mlab-ns-simulator/mlabsim/update.py | mlab-ns-simulator/mlabsim/update.py | """
This approximates the mlab-ns slice information gathering. The actual
system uses nagios and we're not certain about the details. This much
simplified version is just a web URL anyone may PUT data into.
Warning: This doesn't have any security properties! We need a way to
prevent the addition of malicious entrie... | Python | 0.000495 | @@ -1038,75 +1038,263 @@
-request.setResponseCode(400, 'invalid')%0A request.finish(
+self._send_response(request, 400, 'invalid', 'Malformed JSON body.')%0A return NOT_DONE_YET%0A%0A try:%0A fqdn = dbentry%5B'fqdn'%5D%0A except KeyError:%0A self._send_res... |
35a8be144c4924ae787da9c05087aee8d25bb3f5 | refactor __get and __post | morfeu/tsuru/client.py | morfeu/tsuru/client.py | import requests
import logging
from .exceptions import TsuruClientBadResponse
from morfeu.settings import TSURU_TOKEN, TIMEOUT, TSURU_HOST, POOL_WHITELIST
from morfeu.settings import PLATFORM_BLACKLIST, TSURU_APP_PROXY_URL
LOG = logging.getLogger(__name__)
class TsuruClientUrls(object):
@classmethod
def lis... | Python | 0.000147 | @@ -1262,29 +1262,24 @@
et(self, url
-=None
, params=%7B%7D)
@@ -1275,18 +1275,20 @@
params=
-%7B%7D
+None
):%0A
@@ -1566,21 +1566,16 @@
elf, url
-=None
, payloa
@@ -1576,18 +1576,20 @@
payload=
-%7B%7D
+None
):%0A
|
b8fc002fbc8a83486567c232d62678c3b4bb39b8 | Update new path | hassio/addons/git.py | hassio/addons/git.py | """Init file for HassIO addons git."""
import asyncio
import logging
from pathlib import Path
import shutil
import git
from .util import get_hash_from_repository
from ..const import URL_HASSIO_ADDONS
_LOGGER = logging.getLogger(__name__)
class AddonsRepo(object):
"""Manage addons git repo."""
def __init__... | Python | 0.000001 | @@ -2507,20 +2507,20 @@
_addons_
+co
re
-po
, URL_HA
|
9ae12dbc66827c74ef8202b1cbd26bc896f5081c | Handle importing local modules that don't exist | hesitate/rewriter.py | hesitate/rewriter.py | import ast
import imp
import itertools
import os.path
import sys
class RewriterHook(object):
def __init__(self):
self.loaded_modules = {}
def find_module(self, full_name, path=None):
if path and not isinstance(path, list):
path = list(path)
if path and len(path) == 1:
... | Python | 0 | @@ -479,28 +479,105 @@
-fobj = open(modpath)
+try:%0A fobj = open(modpath)%0A except IOError:%0A return None
%0A
|
6715615d553f57ecbf9db674611f4d56bebf1a5e | Add missing EXC variable and combine tokenizer exceptions | spacy/sv/tokenizer_exceptions.py | spacy/sv/tokenizer_exceptions.py | # encoding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
# Verbs
for verb_data in [
{ORTH: "driver"},
{ORTH: "kör"},
{ORTH: "hörr", LEMMA: "hör"},
{ORTH: "fattar"},
{ORTH: "hajar", LEMMA: "förstår"},
{ORTH: "lever"},
{ORTH: "s... | Python | 0.000001 | @@ -115,16 +115,27 @@
_LEMMA%0A%0A
+%0AEXC = %7B%7D%0A%0A
# Verbs%0A
@@ -627,23 +627,17 @@
%5D%0A%0A
-TOKENIZER_EXCEP
+%0AABBREVIA
TION
@@ -3128,16 +3128,94 @@
%5D%0A%7D%0A%0A%0A
+TOKENIZER_EXCEPTIONS = dict(EXC)%0ATOKENIZER_EXCEPTIONS.update(ABBREVIATIONS)%0A%0A%0A
ORTH_ONL
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.