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 |
|---|---|---|---|---|---|---|---|
e63613567b2fbf7abc19ab786a767d0e2018bd66 | fix typo | tests/test_run.py | tests/test_run.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2014-11-21 22:32:35
import os
import re
import time
import json
import shutil
import unittest2 as unittest
import run
from pyspider.libs.utils import Ob... | Python | 0.999991 | @@ -4130,17 +4130,16 @@
voke(ctx
-r
)%0A
|
3dbdc6fad5b50e9bba516ec42874900839ba9e02 | add test for media fetching | tests/content_api_test.py | tests/content_api_test.py |
import superdesk
from bson import ObjectId
from copy import copy
from flask import json
from superdesk.tests import TestCase
from content_api.publish import MONGO_PREFIX
from content_api.tokens import generate_subscriber_token
from content_api.app import get_app
class ContentAPITestCase(TestCase):
def setUp(se... | Python | 0 | @@ -1,8 +1,18 @@
+%0Aimport io
%0Aimport
@@ -4158,24 +4158,376 @@
atus_code)%0A%0A
+ with self.app.app_context():%0A data = io.BytesIO(b'content')%0A media_id = self.app.media.put(data, resource='upload')%0A%0A response = c.get('api/assets/%25s' %25 str(media_id), ... |
2c4a33772817a98cacc5bd82517cfd5918711f28 | Add allowed hosts | xanmel_web/settings/prod.py | xanmel_web/settings/prod.py | from .default import *
DEBUG = False
TEMPLATE_DEBUG = False
with open('/etc/xanmel.yaml', 'r') as f:
XANMEL_CONFIG = yaml.safe_load(f)
XONOTIC_SERVERS = XANMEL_CONFIG['modules']['xanmel.modules.xonotic.XonoticModule']['servers']
| Python | 0 | @@ -17,16 +17,55 @@
port *%0A%0A
+ALLOWED_HOSTS = %5B'xon.teichisma.info'%5D%0A
DEBUG =
|
7ab9403b1733360a53681ba39a0040c4231e8382 | Fix to Rest | gui/api/REST.py | gui/api/REST.py | from flask import Flask, jsonify
import os
from cross_domain import *
app = Flask(__name__)
try:
TARGET = os.environ['TARGET']
AlGDock = os.environ['AlGDock']
except Exception:
print 'export TARGET=<path to data>'
exit(1)
import sys
sys.path.insert(0, AlGDock)
from BindingPMF_arguments import *
@ap... | Python | 0 | @@ -1001,17 +1001,8 @@
ols(
-parameter
):%0A
|
23f6384326ee234e21acc9146a0941f2cb03083a | Support r4.8xlarge instances | perfrunner/utils/cloudrunner.py | perfrunner/utils/cloudrunner.py | import argparse
import time
from typing import Dict, Iterator, List
import boto3
import yaml
from logger import logger
class CloudRunner:
AMI = {
'clients': 'ami-714e5008',
'servers': 'ami-652f311c',
}
AWS_REGION = 'us-west-2'
EC2_META = 'ec2.yaml'
EC2_SETTINGS = {
'K... | Python | 0 | @@ -3814,24 +3814,38 @@
'r4.4xlarge'
+, 'r4.8xlarge'
%5D)%0A parse
|
d9ad65354ced13325617087ea9756a074bf0fbec | Add ignore accounts to income vs expense chart | gnu_reporting/reports/income_expenses.py | gnu_reporting/reports/income_expenses.py | """
Chart that will show the cash flow from income accounts to expense accounts.
"""
from gnu_reporting.reports.base import Report
from gnu_reporting.collate.bucket import PeriodCollate
from gnu_reporting.collate.bucket_generation import debit_credit_generator
from gnu_reporting.collate.store import store_credit_debit
... | Python | 0 | @@ -624,16 +624,55 @@
ccounts,
+ ignore_accounts=None,%0A
period_
@@ -916,32 +916,165 @@
xpense_accounts%0A
+ if ignore_accounts:%0A self._ignore_accounts = ignore_accounts%0A else:%0A self._ignore_accounts = %5B%5D%0A
self._pe
@@ -1568,16 +1568,51 @@
ex... |
87424b3ce50e9c3fac677460e364e01bab735db0 | revert test change | tests/callistocore/test_migrations.py | tests/callistocore/test_migrations.py | from unittest import skip
import json
from django_migration_testcase import MigrationTest
from mock import ANY, patch
from django.contrib.auth import get_user_model
from django.utils.crypto import get_random_string
from callisto.delivery.matching import MatchingApi
from callisto.delivery.models import _pepper, _unpe... | Python | 0.000001 | @@ -621,21 +621,42 @@
'000
-9_report_uuid
+7_add_argon2_with_rolling_upgrades
'%0A%0A
|
b4482a2c652db61d3722f0bf4e6e456bf8939604 | add exception test for 404 | tests/test_tpm.py | tests/test_tpm.py | import requests
import requests_mock
import unittest
import os.path
import tpm
import json
import logging
log = logging.getLogger(__name__)
api_url = 'https://tpm.example.com/index.php/api/v4/'
local_path = 'tests/resources/'
item_limit = 20
def fake_data(url, m):
"""
A stub urlopen() implementation that lo... | Python | 0.000001 | @@ -5648,28 +5648,623 @@
in str(context.exception))%0A
+%0A def test_exception_on_404(self):%0A %22%22%22Exception if 404 not found.%22%22%22%0A path_to_mock = 'passwords.json'%0A request_url = api_url + path_to_mock%0A exception_error = %22%7B%7D not found%22.format(request_url)%0A ... |
244a8ef2d3976970f8647e5fdd3979932cebe6d7 | Remove debug task from Celery | webserver/celery.py | webserver/celery.py | from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webserver.settings')
app = Celery('webserver')
# Using a string here means the worker will n... | Python | 0.001253 | @@ -472,97 +472,4 @@
S)%0A%0A
-%0A@app.task(bind=True)%0Adef debug_task(self):%0A print('Request: %7B0!r%7D'.format(self.request))%0A
|
ea6d18725f06ee76963d36c7e910a3d0a100e967 | change the name in my groups py | web/pages/mygroups.py | web/pages/mygroups.py | from google.appengine.ext.webapp import template
import webapp2
import json
from models.user import User
from models.link import Link
from models.group import Group
class IndexHandler(webapp2.RequestHandler):
def get(self):
template_params={}
user = None
if self.request.cookies.get('our_token'): #the cookie... | Python | 0.000026 | @@ -805,16 +805,17 @@
%5B'groups
+s
'%5D= grou
@@ -817,19 +817,16 @@
groups%0A
-%09%09%0A
%09%09html =
|
e4af848276255543e0ece169068a5d46fdd0549a | add specific LaTeX processing exception | resumepy/exceptions.py | resumepy/exceptions.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Christopher C. Strelioff <chris.strelioff@gmail.com>
#
# Distributed under terms of the MIT license.
"""exceptions.py
Exceptions for the resumepy packge.
"""
class resumepyException(Exception):
"""Root resumepy Exception."""
... | Python | 0 | @@ -714,28 +714,122 @@
r finding file.%22%22%22%0A pass%0A
+%0Aclass LaTeXError(resumepyException):%0A %22%22%22Exception raised when running LaTeX.%22%22%22%0A pass%0A
|
ac92aa78368717c9dadd810317b02bd3121ecd85 | Fix issue with preprocesor exception handling locking up the dev server. Fixes #81. | grow/pods/preprocessors/file_watchers.py | grow/pods/preprocessors/file_watchers.py | from grow.pods.preprocessors import translation
from grow.pods.preprocessors import routes_cache
from watchdog import events
from watchdog import observers
class PodspecFileEventHandler(events.PatternMatchingEventHandler):
patterns = ['*/podspec.yaml']
ignore_directories = True
def __init__(self, pod, managed_... | Python | 0 | @@ -29,27 +29,28 @@
import
-translation
+routes_cache
%0Afrom gr
@@ -74,36 +74,35 @@
sors import
-routes_cache
+translation
%0Afrom watchd
@@ -149,16 +149,48 @@
servers%0A
+from xtermcolor import colorize%0A
%0A%0Aclass
@@ -1107,16 +1107,27 @@
return%0A
+ try:%0A
if s
@@ -1145,16 +1145,18 @@
s ==... |
58002006d57ad1e1f3ffff4ce4f929b79ff4de73 | add basic logging facility | toppra/utils.py | toppra/utils.py | """
Some utility functions need to generate PathConstraints. Most are
specific to different scenarios.
"""
import logging
import numpy as np
LOGGER = logging.getLogger(__name__)
def compute_jacobian_wrench(robot, link, point):
""" Compute the wrench Jacobian for link at point point.
We look for J_wrench suc... | Python | 0 | @@ -114,16 +114,29 @@
logging
+, coloredlogs
%0Aimport
@@ -187,16 +187,181 @@
me__)%0A%0A%0A
+def setup_logging(level=%22WARN%22):%0A %22%22%22 Setup basic logging facility to console.%0A %22%22%22%0A coloredlogs.install(logger=logging.getLogger(%22toppra%22), level=level)%0A%0A%0A
def comp
|
82f05674039da32af5af542c8e72fe524ee6077f | allow requestedFields-Parameter to be a string that is automatically converted to PackageFields | apt_repos/QueryResult.py | apt_repos/QueryResult.py | #!/usr/bin/python3 -Es
# -*- coding: utf-8 -*-
##################################################################################
# Access information about binary and source packages in multiple
# (independent) apt-repositories utilizing libapt / python-apt/
# apt_pkg without the need to change the local system and it... | Python | 0 | @@ -3445,32 +3445,151 @@
list() %0A
+ if type(requestedFields) == str:%0A requestedFields = PackageField.getByFieldsString(requestedFields)%0A
for fiel
@@ -5554,16 +5554,135 @@
list()%0A
+ if type(requestedFields) == str:%0A requestedFields = PackageField.getByFie... |
a098fc8c0401f00c59a8fc7b00ca08539e4be740 | fix typo | tests/integration/util.py | tests/integration/util.py | from __future__ import print_function
import os
import sys
import errno
import logging
import subprocess
from time import sleep
from functools import partial
from contextlib import contextmanager
import requests
from what import What
from monotonic import monotonic
from kuyruk import Kuyruk
if os.environ.get('TRAVI... | Python | 0.999991 | @@ -1525,16 +1525,17 @@
pp='test
+s
.tasks.k
|
9a4e01f2ac2cad9bbba9943df8db885e5f9dca19 | fix ordering of issues | handkerchief.py | handkerchief.py | #!/usr/bin/env python
#
# Handkerchief: A GitHub Issues offline reader
#
# The MIT License (MIT)
#
# Copyright (c) <year> <copyright holders>
#
# 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.000004 | @@ -2721,16 +2721,30 @@
lter=all
+&direction=asc
' %25 sys.
|
6ccd2aedf8b8fa6607166f682c4ec4bb03f069cb | Fix #2647 increase analysis timeout on test | tests/job_timeout_test.py | tests/job_timeout_test.py | # -*- coding: utf-8 -*-
u"""test for canceling a long running simulation due to a timeout
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern.pkcollections import P... | Python | 0 | @@ -560,17 +560,17 @@
ALYSIS='
-2
+3
',%0A )
@@ -2011,19 +2011,8 @@
def
-issue_2647_
test
|
d151e632cbcdc033d0687922c95d70b69dcb7233 | test for searchUID for full record | misura/canon/indexer/tests/test_indexer.py | misura/canon/indexer/tests/test_indexer.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
from misura import parameters as params
from misura.canon import indexer
import os
cur_dir = os.path.dirname(os.path.realpath(__file__))
paths = [cur_dir + '/files']
dbPath = cur_dir + '/files/test.sqlite'
class Indexer(unittest.TestCase):
def setUp(se... | Python | 0 | @@ -1274,16 +1274,199 @@
1.h5')%0A%0A
+ def test_searchUIDFull(self):%0A result = self.indexer.searchUID('eadd3abc68fa78ad64eb6df7174237a0', True)%0A self.assertEqual(result, (cur_dir + '/files/dummy1.h5',))%0A%0A
if __nam
|
497cbcdbca9a568158d5223342041e034c28af3a | Set default encoding to utf-8 | import_export/admin.py | import_export/admin.py | import tempfile
from datetime import datetime
import tablib
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.conf.urls.defaults import patterns, url
from django.template.response import TemplateResponse
from django.contrib import messages
from django.http import Htt... | Python | 0.000039 | @@ -955,14 +955,13 @@
= %22
-cp1250
+utf-8
%22%0A%0A
@@ -5427,16 +5427,42 @@
= 'csv'
+%0A to_encoding = %22utf-8%22
%0A%0A de
|
09ffeb2f53b853914056e165e4e9824e025d2d31 | Add missing dependency. | utility.py | utility.py | from contextlib import contextmanager
import errno
import os
import socket
from jujupy import until_timeout
@contextmanager
def scoped_environ():
old_environ = dict(os.environ)
try:
yield
finally:
os.environ.clear()
os.environ.update(old_environ)
def wait_for_port(host, port, cl... | Python | 0.000001 | @@ -67,16 +67,27 @@
t socket
+%0Aimport sys
%0A%0Afrom j
|
0fc007c8fed272163be873cab4461fbdb1b9e2f1 | Fix indentation | webview/winforms.py | webview/winforms.py | # -*- coding: utf-8 -*-
"""
(C) 2014-2016 Roman Sirokov and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import os
import logging
from ctypes import windll
import clr
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Threading")
import System.Windows.Forms as WinFor... | Python | 0.017244 | @@ -145,16 +145,27 @@
port os%0A
+import sys%0A
import l
@@ -4136,17 +4136,16 @@
-
if sys.g
@@ -4183,33 +4183,32 @@
-
windll.user32.Se
@@ -4223,25 +4223,24 @@
DPIAware()%0A%0A
-
@@ -4274,25 +4274,24 @@
-
app.EnableVi
@@ -4303,17 +4303,16 @@
tyles()%0A
-... |
24a101c333ddc58fd4d00f96e80acbe37d747a03 | Add genre properties | music_annotator/views.py | music_annotator/views.py | from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
import json
def index(request):
freesound_ids = ['181425', '370934', '191630', '191630', '232014', '219056', '325407']
return render(request, 'choose_sound.html', {'freesound_ids': freesound_ids})
@csrf_exempt
def annot... | Python | 0.000019 | @@ -597,24 +597,33 @@
ent', 'mood'
+, 'genre'
%5D, 'chord pr
@@ -633,32 +633,41 @@
ession': %5B'mood'
+, 'genre'
%5D,%0A
@@ -749,16 +749,25 @@
%5B'mood'
+, 'genre'
%5D,%0A
@@ -821,16 +821,25 @@
%5B'mood'
+, 'genre'
%5D, 'text
@@ -857,16 +857,25 @@
%5B'mood'
+, 'genre'
%5D%7D,%0A
@@ -1... |
55018894068f9e63f04a4304f98b3a9ff0c282f2 | update : add kakao social auth | wef/wef/settings.py | wef/wef/settings.py | """
Django settings for wef project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Bui... | Python | 0 | @@ -2494,16 +2494,94 @@
Auth2',%0A
+ # Kakao talk Social auth%0A 'social.backends.kakao.KakaoOAuth2',%0A
@@ -2911,16 +2911,143 @@
PACE%22)%0A%0A
+# Kakao App key%0ASOCIAL_AUTH_KAKAO_KEY = os.environ.get(%22KAKAO_KEY%22)%0ASOCIAL_AUTH_KAKAO_SECRET = os.environ.get(%22KAKAO_SECRET%22)%0A%0A
# C... |
7f955ea02bab72543ac4fe8be7ccb25cc39ffc63 | Add ratelimit notification to raffle docstring. | joku/cogs/games/currency.py | joku/cogs/games/currency.py | """"""
import discord
import tabulate
from discord.ext import commands
import rethinkdb as r
from joku.bot import Jokusoramame, Context
from joku.cogs._common import Cog
from joku.redis import with_redis_cooldown
BAD_RESPONSES = [
":fire: Your bank account went up in flames and you lost `§{}`.",
":grapes: Yo... | Python | 0 | @@ -1316,16 +1316,56 @@
ose out?
+%0A%0A This can be ran once per hour.
%0A
|
39a25ae154d6e834a2c606c607ea5db360de9545 | fix for updating status | hyperadmin/resources/wizard/resources.py | hyperadmin/resources/wizard/resources.py | from hyperadmin.resources import BaseResource
from hyperadmin.resources.wizard.endpoints import StepList, StepProvider
class Wizard(BaseResource):
step_definitions = [] #tuples of Step and dictionary kwargs, kwarg must contain slug
list_endpoint = StepList
#CONSIDER: my resource adaptor is a wizard stora... | Python | 0 | @@ -1,28 +1,80 @@
+from django.utils.datastructures import SortedDict%0A%0A
from hyperadmin.resources im
@@ -1620,44 +1620,39 @@
s =
-%7B%0A
+SortedDict(%5B(
slug
-:
+, %5B
status
-%0A %7D
+%5D),%5D)
%0A
@@ -1752,44 +1752,97 @@
-self.state.pop('step_statuses', None
+if 'step_statuses'... |
9372147a8f0f2c66458e575453653be46ab8da49 | Set correct path in the mock api server module. | tests/mock_http_server.py | tests/mock_http_server.py | import time
import BaseHTTPServer
from yubico.yubico import BAD_STATUS_CODES
mock_action = None
signature = None
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
global mock_action, signature
if self.path.find('?') != -1:
self.path, self.query_string = self.p... | Python | 0 | @@ -1,12 +1,45 @@
+#!/usr/bin/env python%0A%0Aimport os%0A
import time%0A
@@ -38,16 +38,27 @@
rt time%0A
+import sys%0A
import B
@@ -72,16 +72,108 @@
Server%0A%0A
+from os.path import join as pjoin%0Asys.path.append(pjoin(os.path.dirname(__file__), '../'))%0A%0A
from yub
|
66c5d4e6383f0eb9873fbf25699bf15b170f4d86 | random walk is continuous | hypergan/samplers/random_walk_sampler.py | hypergan/samplers/random_walk_sampler.py | from hypergan.samplers.base_sampler import BaseSampler
import tensorflow as tf
class RandomWalkSampler(BaseSampler):
def __init__(self, gan, samples_per_row=8):
BaseSampler.__init__(self, gan, samples_per_row)
self.z = None
self.y = None
self.x = None
self.step = 0
s... | Python | 0.999574 | @@ -71,16 +71,35 @@
ow as tf
+%0Aimport numpy as np
%0A%0Aclass
@@ -587,19 +587,86 @@
elf.z =
-z_t
+gan.encoder.sample.eval()%0A self.target = gan.encoder.sample
.eval()%0A
@@ -741,49 +741,59 @@
elf.
-target is None or self.step %3E self.steps:
+step %3E self.steps:%0A self.z = self.target
... |
946aa536852ddd191aa4cb9550702b014c68dae4 | Check pep8 | tests/models/talk_test.py | tests/models/talk_test.py | from unittest import TestCase
from unittest.mock import patch, MagicMock
from meetup_facebook_bot.models.talk import Talk
class TalkTestCase(TestCase):
def setUp(self):
self.db_session = MagicMock()
self.user_id = 1
self.talk_id = 1
@patch('meetup_facebook_bot.models.talk.Like')
d... | Python | 0 | @@ -66,16 +66,17 @@
gicMock%0A
+%0A
from mee
@@ -117,16 +117,17 @@
t Talk%0A%0A
+%0A
class Ta
@@ -148,17 +148,16 @@
tCase):%0A
-%0A
def
@@ -199,32 +199,69 @@
n = MagicMock()%0A
+ self.like_mock = MagicMock()%0A
self.use
@@ -293,16 +293,58 @@
k_id = 1
+%0A self.talk = Talk(id=self.tal... |
e2b41828af969f2b0c6450a53b8827946ff8673d | Set 'cnn' as default network for retro (#683) | baselines/run.py | baselines/run.py | import sys
import multiprocessing
import os.path as osp
import gym
from collections import defaultdict
import tensorflow as tf
import numpy as np
from baselines.common.vec_env.vec_frame_stack import VecFrameStack
from baselines.common.cmd_util import common_arg_parser, parse_unknown_args, make_vec_env, make_env
from b... | Python | 0 | @@ -3725,18 +3725,29 @@
ype
-==
+in %7B
'atari'
+, 'retro'%7D
:%0A
|
51e2515f1d8fe595f14edc40d5ea34fcb4b6844c | Bump version post-release | seaworthy/__init__.py | seaworthy/__init__.py | """
seaworthy
~~~~~~~~~
.. todo::
Write some API reference docs for :mod:`seaworthy`.
"""
from .helpers import DockerHelper
from .logs import output_lines, wait_for_logs_matching
__all__ = ['DockerHelper', 'output_lines', 'wait_for_logs_matching']
__version__ = '0.2.1'
| Python | 0 | @@ -272,7 +272,12 @@
0.2.
-1
+2.dev0
'%0A
|
081d08b78e2dbdc05790eace07947d9e700523c9 | Correcting string1 | basic/string1.py | basic/string1.py | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | Python | 0.999999 | @@ -1946,32 +1946,31 @@
_1,'*')%0A
-output =
+return
text_1 + te
@@ -1982,27 +1982,8 @@
1:%5D%0A
- return output%0A
%0A%0A#
|
1e6f4c9bb79c4709ea17005025aa976ab035fe30 | switch to spaces indentation | ticket_checker.py | ticket_checker.py | import argparse
import mechanize
import re
from bs4 import BeautifulSoup
BEAUTIFUL_SOUP_PARSER = "html.parser"
parser = argparse.ArgumentParser()
parser.add_argument('--violation', help='Violation #')
args = parser.parse_args()
br = mechanize.Browser()
# Get first URL
br.open("http://www1.nyc.gov/assets/finance/jum... | Python | 0.000024 | @@ -1291,17 +1291,18 @@
r_tags:%0A
-%09
+
for tag
@@ -1320,10 +1320,12 @@
gs:%0A
-%09%09
+
prin
@@ -1343,17 +1343,18 @@
g%0Aelse:%0A
-%09
+
match =
@@ -1416,17 +1416,18 @@
, html)%0A
-%09
+
if match
@@ -1428,17 +1428,18 @@
match:%0A
-%09
+
prin
@@ -1497,16 +1497,18 @@
ion%0A
-%09
+
else... |
37ad21112e41133450284f9d99d323cae901dd06 | Update version | tikapp/version.py | tikapp/version.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2016 Fedele Mantuano (https://twitter.com/fedelemantuano)
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/lice... | Python | 0 | @@ -663,9 +663,9 @@
%221.
-4
+5
.0%22%0A
|
122a870812f3000639a439943bde980a6810a22e | Check output length before sending | Cogs/Ascii.py | Cogs/Ascii.py | from discord.ext import commands
from Cogs import Utils, DisplayName, PickList, FuzzySearch, Message
import pyfiglet
def setup(bot):
# Add the bot
bot.add_cog(Ascii(bot))
class Ascii(commands.Cog):
def __init__(self, bot):
self.bot = bot
global Utils, DisplayName
Utils = self.bot.get_cog(... | Python | 0.000002 | @@ -2005,43 +2005,17 @@
%0D%0A%09%09
-await ctx.send(%22%60%60%60%5Cn%7B%7D%60%60%60%22.format(
+output =
pyfi
@@ -2083,12 +2083,133 @@
LT_FONT)
+%0D%0A%09%09if not output: return await ctx.send(%22I couldn't beautify that text :(%22)%0D%0A%09%09await ctx.send(%22%60%60%60%5Cn%7B%7D%60%60%60%22.format(output
))%0D... |
0ce8f07d670d5fb6d5e52669ea97ef10c7a784e2 | update number of neighbors for knn graph | wedc/domain/service/category_identification/graph/knn_graph.py | wedc/domain/service/category_identification/graph/knn_graph.py |
from sklearn.neighbors import NearestNeighbors
from sklearn import preprocessing
import numpy as np
# X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
# X = np.array([])
# X = np.append(X, [[1, 1, 0, 0]], axis=0)
# X = np.append(X, [[0, 0, 0, 0]], axis=0)
# print X
# X = np.array(np.mat('1 2; 3... | Python | 0 | @@ -537,9 +537,10 @@
ors=
-5
+10
, al
@@ -561,16 +561,36 @@
tree'):%0A
+ n_neighbors += 1
%0A %0A
@@ -830,18 +830,16 @@
eighbors
-+1
, algori
|
fd427c4d6f2f607a1b186b64118ff06b05bf3a4d | Improve LUT UI so the lut, scalar_bar and scalar_bar_widget are configurable from the UI. | enthought/mayavi/core/ui/lut_manager.py | enthought/mayavi/core/ui/lut_manager.py | """
Traits View definition file.
The view trait of the parent class is extracted from the model definition
file. This file can either be exec()ed or imported. See
core/base.py:Base.trait_view() for what is currently used. Using exec()
allows view changes without needing to restart Mayavi, but is slower than
imp... | Python | 0 | @@ -1189,24 +1189,176 @@
erse_lut'),%0A
+ Item(name='lut',%0A show_label=False,%0A editor=InstanceEditor(label='Edit LUT properties')),%0A
@@ -2580,32 +2580,557 @@
),
+%0A%0A HGroup(%0A ... |
1f9964e0a39e405c06c274f50cc18d03a181cdec | remove what is hopefully unncessary code | xos/observers/helloworldservice/steps/sync_helloworldtenant.py | xos/observers/helloworldservice/steps/sync_helloworldtenant.py | import os
import sys
from django.db.models import Q, F
from helloworldservice.models import HelloWorldService, HelloWorldTenant
from observers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
parentdir = os.path.join(os.path.dirname(__file__), "..")
sys.path.insert(0, parentdir)
# Class to define how we ... | Python | 0.000013 | @@ -2313,24 +2313,26 @@
nothing.%0A
+ #
def delete_
@@ -2351,20 +2351,22 @@
m):%0A
+ #
return%0A
|
96e28bc426947d6e30000f7d867adebf6a1fe267 | Set version as 0.4.6 | version.py | version.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
# David Durieux. david.durieux@alignak.net
#
"""
Alignak - Checks pack for mail, slack,... notifications
"""
# Package name
__pkg_name__ = u"alignak_notifications"
# Checks types for PyPI k... | Python | 0.00215 | @@ -526,17 +526,17 @@
= u%220.4.
-5
+6
%22%0A__auth
|
53c16d467aee776f6931668c9e7728c6d5f438d3 | Update formatting | Cogs/Plist.py | Cogs/Plist.py | import asyncio
import discord
from discord.ext import commands
import os
import tempfile
import shutil
import plistlib
from Cogs import DL
from Cogs import Message
def setup(bot):
# Add the bot and deps
settings = bot.get_cog("Settings")
bot.add_cog(Plist(bot, settings))
... | Python | 0.000001 | @@ -2058,16 +2058,18 @@
(title=%22
+%E2%9A%A0
An error
@@ -2364,32 +2364,34 @@
ge.Embed(title=%22
+%E2%9D%8C
Plist format inv
@@ -2524,16 +2524,18 @@
(title=%22
+%E2%9C%85
Plist fo
@@ -2570,28 +2570,30 @@
)%0D%0A self.remove(path)
+%0D%0A
|
adbcb045d89fcb20f5ed758e985ba0f432178f6b | Set version as 0.2.2 | version.py | version.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak - Receiver module for the external commands
"""
# Package name
__pkg_name__ = u"alignak_module_ws"
# Module type for PyPI keywords
# Used for:
# - PyPI keywords
__module_types__ = u"web-services"
# Application manifest
__version__ = u"0.2.1"
__author__ = u... | Python | 0.999954 | @@ -296,17 +296,17 @@
= u%220.2.
-1
+2
%22%0A__auth
|
13ec50a7e2187edb03174ed4a9dbf8767f4c6ad4 | Tag commit for v0.0.8-master generated by gitmake.py | version.py | version.py | major = 0
minor=0
patch=0
branch="dev"
timestamp=1376412824.91 | Python | 0 | @@ -17,17 +17,17 @@
0%0Apatch=
-0
+8
%0Abranch=
@@ -31,11 +31,14 @@
ch=%22
-dev
+master
%22%0Ati
@@ -57,9 +57,9 @@
4128
-24.91
+92.53
|
25f70ebdaab40ff6390e46b053e15e29bddbf95c | Annotate zproject/jinja2/backends.py | zproject/jinja2/backends.py | zproject/jinja2/backends.py | from __future__ import absolute_import
import sys
import jinja2
from django.utils import six
from django.test.signals import template_rendered
from django.template.backends import jinja2 as django_jinja2
from django.template import TemplateDoesNotExist, TemplateSyntaxError, Context
from django.utils.module_loading im... | Python | 0 | @@ -43,16 +43,82 @@
port sys
+%0Afrom typing import Any, Optional, Union%0Afrom six import text_type
%0A%0Aimport
@@ -474,16 +474,52 @@
en_lazy%0A
+from django.http import HttpRequest%0A
%0A%0Aclass
@@ -867,32 +867,86 @@
rgs, **kwargs):%0A
+ # type: (Dict%5Bstr, Any%5D, *Any, **Any) -%3E None%0A
#... |
f5580bd7736023b94777b24e511b420a815f8680 | Add foreign key on update cascade for sqlite | timevis/models.py | timevis/models.py | import os.path
from sqlalchemy import ForeignKey, Column, Integer, String, Float, Time
from sqlalchemy import create_engine
from sqlalchemy.orm import relationship, backref, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
# Create Base, Session and engine
Base = declarative_base()
db_path = os.pa... | Python | 0 | @@ -237,16 +237,321 @@
e_base%0A%0A
+from sqlalchemy.engine import Engine%0Afrom sqlalchemy import event%0A%0A%0A# Enable sqlite foreign key support%0A@event.listens_for(Engine, %22connect%22)%0Adef set_sqlite_pragma(dbapi_connection, connection_record):%0A cursor = dbapi_connection.cursor()%0A cursor.execute(%2... |
4717a5fb5d25cb46e0950e33654d18e124b91ade | Support text/stylus in Riot tags | tokit/compiler.py | tokit/compiler.py | """
Transform to browsers' languages
Can serve files directly using shortcut: ``python3 -m tokit.compiler``
For Sass, it requires system's ``libsass`` installed.
For Coffeescript it need a Javascript runtime, either by
having Python's ``pyv8`` (with ``libv8`` installed or system's ``node``
For Stylus, it has same re... | Python | 0 | @@ -2790,16 +2790,17 @@
.js') +%0A
+%0A
@@ -2913,14 +2913,8 @@
%22
-;%5Cn%5Cn
var
@@ -3032,16 +3032,184 @@
xports;%22
+ +%0A%0A # Riot custom language%0A read_file(lib_path + 'stylus.js') +%0A 'riot.parsers.css.stylus = function(tagName, css) %7B return stylus.render(css) %7D;'
... |
5770754c7b451a9e175b4906a26dfae5ce4fe1e6 | Enable optimization. | tool_spatialdb.py | tool_spatialdb.py | import os
import sys
import eol_scons
tools = ['sqlitedb','doxygen','prefixoptions']
env = Environment(tools = ['default'] + tools)
thisdir = env.Dir('.').srcnode().abspath
libsources = Split("""
SpatiaLiteDB.cpp
""")
headers = Split("""
SpatiaLiteDB.h
""")
env.AppendUnique(CPPDEFINES=['SPATIALITE_AMALGAMATION',])
... | Python | 0 | @@ -840,24 +840,62 @@
AMATION',%5D)%0A
+ env.Replace(CCFLAGS=%5B'-g','-O2'%5D)%0A
env.Requ
|
cf7aed705dbfeaa8b9e56a0649fd70f48d80d33f | bump protocol version number, to see which servers have get_header and get_merkle | version.py | version.py | VERSION = "0.1"
| Python | 0 | @@ -10,7 +10,7 @@
%220.
-1
+2
%22%0A
|
0e6e66b4e4ea13e28f089e363d8f1409623566b6 | Implement set() method. | hetzner/rdns.py | hetzner/rdns.py | from urllib import urlencode
from hetzner import RobotError
class ReverseDNS(object):
def __init__(self, conn, ip=None, result=None):
self.conn = conn
self.ip = ip
self.update_info(result)
def update_info(self, result=None):
if result is None:
try:
... | Python | 0 | @@ -739,12 +739,67 @@
-pass
+self.conn.post('/rdns/%7B0%7D'.format(self.ip), %7B'ptr': value%7D)
%0A%0A
|
8a3d27eb10811e02d29489a3efde8dad593cd9be | add shrink option to sensor data api | modules/core_api/monitoring_controllers.py | modules/core_api/monitoring_controllers.py | from flask import jsonify, Response, current_app, Blueprint
from sqlalchemy import func, Float
from application.database import global_db
from core.job.helpers import expand_nodelist
from core.job.models import Job
from core.monitoring.models import JobPerformance, SENSOR_CLASS_MAP
from application.helpers import cros... | Python | 0 | @@ -1162,16 +1162,40 @@
result%0A%0A
+SHRINK_THRESHOLD = 500%0A%0A
@job_mon
@@ -1259,16 +1259,143 @@
sensor%3E%22
+, defaults=%7B'shrink': SHRINK_THRESHOLD%7D)%0A@job_monitoring_api_pages.route(%22/%3Cint:record_id%3E/sensor/%3Cstring:sensor%3E/%3Cint:shrink%3E%22
)%0A@cross
@@ -1443,32 +1443,45 @@
str, record_id... |
f3fd5fb2fefa0cdf421c4a76154300c7395444f4 | bump version | anki/__init__.py | anki/__init__.py | # -*- coding: utf-8 -*-
# Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import sys
import os
import platform
if sys.version_info[0] > 2:
raise Exception("Anki should be run with Python 2")
elif sys.version_info[1] < 6:
raise Exception("... | Python | 0 | @@ -973,17 +973,17 @@
n=%222.0.2
-8
+9
%22 # buil
|
9dc22371a6b79a455a137d313ca8643ac59afec2 | Update announcements.py | announcements.py | announcements.py | import sys
import icalendar
import requests
import pytz
from datetime import datetime, timedelta
from libs import post_text
from icalendar import Calendar
from database import find_bot_nname
import re
r = requests.get(sys.argv[2])
icsData = r.text
cal = Calendar.from_ical(icsData)
for evt in cal.walk('vevent'):
... | Python | 0 | @@ -340,19 +340,23 @@
t = evt.
-get
+decoded
('DTSTAR
@@ -362,15 +362,8 @@
RT')
-.date()
%0A
|
058eee8cf213cc0f488cab9707db748fd07718f4 | Make sure we always have a pre-work sha. | inthe_am/taskmanager/context_managers.py | inthe_am/taskmanager/context_managers.py | from contextlib import contextmanager
import datetime
import logging
import os
from django.conf import settings
from django.utils.timezone import now, utc
from lockfile import LockTimeout
from lockfile.pidlockfile import PIDLockFile
logger = logging.getLogger(__name__)
@contextmanager
def git_checkpoint(
stor... | Python | 0 | @@ -438,16 +438,40 @@
.lock')%0A
+ pre_work_sha = None%0A
try:
|
b832c794ad28d3dd9675a72389fc8f0a00a2c035 | Fix yapf | tests/mock_vws/test_target_summary.py | tests/mock_vws/test_target_summary.py | """
Tests for the mock of the target summary endpoint.
"""
import pytest
from urllib.parse import urljoin
import requests
from requests_mock import GET
from tests.utils import VuforiaServerCredentials
from vws._request_utils import authorization_header, rfc_1123_date
@pytest.mark.usefixtures('verify_mock_vuforia')... | Python | 0.000006 | @@ -1407,72 +1407,8 @@
)%0A%0A
- expected_keys = %7B%0A 'result_code',%0A %7D%0A%0A
|
532e3d2e9d3dd88e8f217378627258a68e3ac496 | fix uncaught python exception python on startup (from rexviewer.getUiView() returning None) | bin/pymodules/usr/keycommands.py | bin/pymodules/usr/keycommands.py | """a module that executes test commands bound to keys,
to help py api dev and testing"""
try:
import rexviewer as r
except ImportError: #not running under rex
import mockviewer as r
from circuits import Component
from naali import inputcontext
from PythonQt.QtCore import Qt
class KeyCommander(Component):
... | Python | 0.00003 | @@ -1098,24 +1098,47 @@
getUiView()%0A
+ if uiview:%0A
uivi
|
98540ab8e936ccf605d66dac66aa731a9ee83b42 | remove trailing line flake8 | tests/no_subcontext_extension_vows.py | tests/no_subcontext_extension_vows.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pyvows testing engine
# https://github.com/heynemann/pyvows
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 Bernardo Heynemann heynemann@gmail.com
from pyvows import Vows, expect
@Vows.batch
class ContextClass(V... | Python | 0.000001 | @@ -1295,9 +1295,8 @@
qual(3)%0A
-%0A
|
81dfd09b8ad7a3e070227040e3fa6714578e8773 | Add parameter documentation to forking module | hidi/forking.py | hidi/forking.py | from hidi.transform import Transform
from functools import partial
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
def map_fn(pipeline, io, progress, **kwargs):
return pipeline.run(io, progress=progress, **kwargs)
class ExecutorFork(Transform):
def __init__(self, pipelines, progress=F... | Python | 0 | @@ -789,88 +789,8 @@
n.%0A%0A
- This transform takes a list of Pipeline instances upon%0A initialization.%0A%0A
@@ -1096,16 +1096,248 @@
e given.
+%0A%0A :param pipelines: An array of pipelines to fork execution to.%0A :type pipelines: list%5Bhidi.pipeline.Pipeline%5D%0A%0A :param progress: When ... |
5045181241e9a6e4a2cd05a93da7ee0b63b4a568 | Allow the foreground reindex process to be interrupted. | itsy/management/commands/itsy_reindex.py | itsy/management/commands/itsy_reindex.py | import optparse
import traceback
from django.core.management import base as management_base
from django.utils import importlib
from ... import document as itsy_document
from ... import tasks as itsy_tasks
class Command(management_base.BaseCommand):
args = "class_path"
help = "Performs a reindex of the given docu... | Python | 0.000432 | @@ -2399,16 +2399,66 @@
Search)%0A
+ except KeyboardInterrupt:%0A raise%0A
|
181ffad1eaebc14532d9a3172df1805f7bc066d7 | Fix crash with Printer.warning | monolithe/generators/vspk/vspkgenerator.py | monolithe/generators/vspk/vspkgenerator.py | # -*- coding: utf-8 -*-
import os
import shutil
from monolithe.lib.utils.vsdk import VSDKUtils
from monolithe.lib.utils.printer import Printer
class VSPKGenerator(object):
""" Create a VSPK Package containing SDK versions
"""
def __init__(self, versions):
""" Initialize a VSPKGenerator
... | Python | 0.000001 | @@ -822,19 +822,16 @@
ter.warn
-ing
('master
|
c75f31a8722531309271c4b7ddb57b37e0433670 | Allow progress indication when running in dry-run mode. | libgsync/sync/file/remote/__init__.py | libgsync/sync/file/remote/__init__.py | # Copyright (C) 2013 Craig Phillips. All rights reserved.
import os, re
from libgsync.output import verbose, debug, itemize, Progress
from libgsync.sync.file import SyncFile, SyncFileInfo
from libgsync.options import GsyncOptions
from apiclient.http import MediaIoBaseUpload
from libgsync.drive import Drive
class Syn... | Python | 0 | @@ -269,16 +269,37 @@
seUpload
+, MediaUploadProgress
%0Afrom li
@@ -2608,17 +2608,16 @@
ten = 0%0A
-%0A
@@ -2621,38 +2621,27 @@
i
-f GsyncOptions.dry_run: return
+nfo = src.getInfo()
%0A%0A
@@ -2867,16 +2867,179 @@
llback)%0A
+%0A if GsyncOptions.dry_run:%0A bytesWritten = info.f... |
06640caec2aea61a17eab32e6806ec40e55e70cb | Bump version to 0.16.2 | incunafein/__init__.py | incunafein/__init__.py | __version__ = (0, 16, 1)
def get_version():
return '.'.join(map(str, __version__))
| Python | 0 | @@ -15,17 +15,17 @@
(0, 16,
-1
+2
)%0Adef ge
|
42f5973e4c2b67910c000d3d08f71307c1ec4505 | Remove no-longer-necessary output tanh. | wavenet.py | wavenet.py | #!/usr/bin/env python
'''
Wavenet model definition and generation using contrib.layers
- Carl Quillen
'''
from __future__ import print_function
import tensorflow as tf
import tensorflow.contrib.layers as layers
from tensorflow.contrib.framework import arg_scope
from ops import mu_law_decode, mu_law_encode
def wavn... | Python | 0.999754 | @@ -5808,36 +5808,36 @@
vation_fn=tf.nn.
-tanh
+relu
, scope='output_
|
3cc4f50162db35de5a9cb17b2abb002f3152abb4 | Fix arg parsing tests | tests/test_arg_parsing.py | tests/test_arg_parsing.py | import pytest
from withenv.cli import parse_args
class TestArgParsing(object):
def setup(self):
self.result = {
'cmd': [],
'env_files': [],
'env_dirs': [],
}
def test_defaults(self):
assert parse_args([]) == self.result
def test_single_short(s... | Python | 0.000296 | @@ -24,20 +24,16 @@
henv
-.cli
import
pars
@@ -28,26 +28,19 @@
import
-parse_args
+cli
%0A%0A%0Aclass
@@ -149,51 +149,20 @@
'
-env_files': %5B%5D,%0A 'env_dir
+action
s': %5B%5D
-,
%0A
@@ -205,32 +205,36 @@
%0A assert
+cli.
parse_args(%5B%5D) =
@@ -265,419 +265,107 @@
est_
-singl... |
00914093b5007c984ef6bb11e6cbdfb9f92b0726 | change email port in settings | nonhumanuser/settings.py | nonhumanuser/settings.py | """
Django settings for nonhumanuser project.
Generated by 'django-admin startproject' using Django 1.9.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import ... | Python | 0.000001 | @@ -4204,13 +4204,11 @@
_PORT =
-10
25%0A
|
7eba346d30111dfabcca8e2cd9eff42ef27ca98f | Remove module targets due to Linux-Release errors. | webrtc.gyp | webrtc.gyp | # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | Python | 0.000001 | @@ -632,24 +632,93 @@
*',%0A
+# TODO(andrew): enable when Linux-Release errors are fixed.%0A #
'src/modules
|
d61e952f38bc4c1ebc03ba1282efe178815b541d | Fix lint issues detected by new version of pylint. | st2actions/st2actions/runners/__init__.py | st2actions/st2actions/runners/__init__.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | Python | 0 | @@ -2964,26 +2964,34 @@
t):%0A
-if
+callback =
self.callba
@@ -2993,16 +2993,42 @@
allback
+or %7B%7D%0A if callback
and not
@@ -3057,21 +3057,16 @@
) - set(
-self.
callback
@@ -3119,21 +3119,16 @@
handler(
-self.
callback
@@ -3168,21 +3168,16 @@
allback(
-self.
callback
|
0c65c6257f28706fc24a25306a4b5cf8fe8b2ebd | fix bug | widgets.py | widgets.py | import tkinter
import _tkinter
from tkinter import ttk, messagebox
def update_title(self, frame):
parent = self.master
while True:
child = parent
parent = parent.master
if parent is None:
child.title(frame.file_path if frame.file_path
else frame.temp... | Python | 0.000001 | @@ -1210,17 +1210,16 @@
self.
-_
create_p
|
80434be948582f576e2bf65f67ae2144b471e966 | Use stmt_from_rule | bioagents/mra/model_diagnoser.py | bioagents/mra/model_diagnoser.py | import logging
import itertools
from copy import deepcopy
import networkx as nx
from indra.databases import hgnc_client
from indra.mechlinker import MechLinker
from indra.statements import *
from indra.explanation.model_checker import PysbModelChecker
from indra.explanation.reporting import stmt_from_rule, stmts_from_p... | Python | 0.000006 | @@ -5035,33 +5035,32 @@
u_stmt =
-_
stmt_from_rule(s
@@ -5178,17 +5178,16 @@
_stmt =
-_
stmt_fro
|
4570982344b920ce840ffcb42e756789f6eab8e2 | Change menu to reviews only for the first occurence in the link | hotels/zomat.py | hotels/zomat.py | import os
import logging
import requests
import json
class Zomat(object):
"""
Fetch data using the Zomato API
"""
def __init__(self):
logging.basicConfig(level=logging.INFO)
self.logger = logging.getLogger("Zomat")
self.userKey = os.environ.get("USER_KEY")
self.headers... | Python | 0 | @@ -5646,16 +5646,19 @@
reviews%22
+, 1
)%0A
|
fee05c1c301642b264bffed4e7de66b668ee3186 | Fix total coverage percentage | tools/coverage.py | tools/coverage.py | #!/usr/bin/env python3
import os, sys, glob, pickle
sys.path.insert(0, os.path.dirname(__file__))
from clang import cindex
sys.path = sys.path[1:]
def configure_libclang():
llvm_libdir = '/usr/lib/llvm-3.2/lib'
libdir = llvm_libdir
cindex.Config.set_library_path(libdir)
files = glob.glob(os.path.jo... | Python | 0.000072 | @@ -4549,68 +4549,8 @@
o)%0A%0A
-perc = int(((len(defs) - len(notused)) / len(defs)) * 100)%0A%0A
ss =
@@ -5382,48 +5382,65 @@
))%0A%0A
-# print(' %7B0%7D'.format(f.display)
+perc = int(((len(defs) - len(notused)) / len(defs)) * 100
)%0A%0Ap
|
511aafc0d82f497c33746de68f078d3f5d99b400 | fix Player next action | rprpg/battle/entity.py | rprpg/battle/entity.py | import abc
import pygame
from . import action
from ..window import Window
class EntityType(object):
NUM_DEFAULT_TYPES = 3
All, Player, Enemy = range(NUM_DEFAULT_TYPES)
@staticmethod
def get_type(entity_type, entities):
return [entity for entity in entities if entity.type == entity_type]
clas... | Python | 0 | @@ -68,16 +68,28 @@
Window%0A%0A
+import sys%0A%0A
class En
@@ -591,16 +591,93 @@
tesheet%0A
+ self.strip = self.spritesheet.load_strip(pygame.Rect(0, 0, 0, 0), 3)%0A
@@ -850,16 +850,99 @@
p = 20%0A%0A
+ @property%0A def bounding_box(self):%0A return self.strip%5B0%5D.get_rect()%0A%0A
... |
158cb977e7d91a7a343c58162e226a1ecc707e2e | fix the url for update user group | hs_core/urls.py | hs_core/urls.py | from django.conf.urls import patterns, url
from hs_core import views
urlpatterns = patterns('',
# resource API
url(r'^resourceTypes/$', views.resource_rest_api.ResourceTypes.as_view(),
name='list_resource_types'),
url(r'^resourceList/$', views.resource_rest_api.ResourceList.as_view(),
na... | Python | 0.000061 | @@ -3226,32 +3226,52 @@
date-user-group/
+(?P%3Cgroup_id%3E%5B0-9%5D+)
$', views.update
|
8d515e0329d9305fe6a1aa1f917c4ba3730e8a88 | use safe_eval instead of eval | stock_available/models/product_product.py | stock_available/models/product_product.py | # -*- coding: utf-8 -*-
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from openerp.addons import decimal_precision as dp
class ProductProduct(models.Model):
"""Add a field for the stock available to promise.
Useful impl... | Python | 0.000002 | @@ -205,16 +205,62 @@
n as dp%0A
+from openerp.tools.safe_eval import safe_eval%0A
%0A%0Aclass
@@ -1535,16 +1535,15 @@
-if eval(
+expr =
str(
@@ -1594,16 +1594,134 @@
r(value)
+%0A eval_dict = %7B'prod': prod, 'operator': operator, 'value': value%7D%0A if safe_eval(expr, eval_dict
):%... |
26a8df6ccaf73addad47d227a2edbfe69972dfd1 | change line color | rqbacktest/__main__.py | rqbacktest/__main__.py | # -*- coding: utf-8 -*-
import os
import shutil
import pytz
import click
from six import exec_
import pandas as pd
from .trading_params import TradingParams
from . import api
from .utils.click_helper import Date
from . import StrategyExecutor
from .data import RqDataProxy, LocalDataProxy
from .logger import user_log... | Python | 0.000001 | @@ -843,24 +843,141 @@
fault=True)%0A
+@click.option('-d', '--data-bundle-path', default=os.path.expanduser(%22~/.rqbacktest%22), type=click.Path(exists=True))%0A
def run(stra
@@ -1033,16 +1033,34 @@
w_result
+, data_bundle_path
):%0A '
@@ -1465,15 +1465,24 @@
oxy(
-'tools'
+data_bundle_path
)%0A%0A
@@ -2528,... |
680373529f08d02f3c6f8f56baeecfa92fe24887 | change update_session url | watcher.py | watcher.py | #!/usr/bin/env python
import os
import subprocess
import requests
import time
import sys
import logging
import socket
import fcntl
import struct
import click
from Queue import Queue, Empty
from threading import Thread, Event
from utils import *
from lcd import FakeLCDManager, LCDManager
logging.basicConfig(stream=sy... | Python | 0.000001 | @@ -1045,22 +1045,16 @@
'%7B%7D/
-update_
session
+s
/%7B%7D/
@@ -1115,34 +1115,33 @@
%09%09r = requests.p
-os
+u
t(url, data=open
|
466a29cb543c097c3976f096b1b0b349fc1bd645 | Remove exception handling in main | ReligiousPhraseMC/holy_twitter.py | ReligiousPhraseMC/holy_twitter.py | """Coordinates the twitter api with the markov chain models"""
import json
from pprint import pprint
from tweepy import Stream, OAuthHandler, API
from tweepy.streaming import StreamListener
from holy_markov import OldTestaPassagesMarkov
from twitter_secrets import api_tokens as at
class HolyListener(StreamListener)... | Python | 0 | @@ -1836,29 +1836,16 @@
%22%22%22%0A
- try:%0A
auth
@@ -1903,28 +1903,24 @@
CRET'%5D)%0A
-
-
auth.secure
@@ -1926,20 +1926,16 @@
= True%0A
-
auth
@@ -1991,21 +1991,16 @@
CRET'%5D)%0A
-%0A
api
@@ -2016,20 +2016,16 @@
h)%0A%0A
-
-
# If the
@@ -2067,20 +2067,16 @... |
c916385a437b114d60d195c4a663bd56e6483d36 | Remove JSON fodder | application/views.py | application/views.py | import json
from flask import redirect
from application import app
from application.modules.users import logout_view
from application.modules.oauth import alveo_authorise_view, alveo_callback_view
from application.modules.error import not_allowed, not_found, server_error
app.register_error_handler(403, not_allowed)
a... | Python | 0.000002 | @@ -937,17 +937,8 @@
mps(
-%7B'clips':
%5B%7B%0A
@@ -3138,11 +3138,10 @@
%7D%5D
-%7D
)%0A
|
fde3d8d078d7ca45bd7db50b5c89c8f5f923d786 | Rewrite harmonic_centrality to better use iterator | networkx/algorithms/centrality/harmonic.py | networkx/algorithms/centrality/harmonic.py | """
Harmonic centrality measure.
"""
# Copyright (C) 2015 by
# Alessandro Luongo
# BSD license.
from __future__ import division
import functools
import networkx as nx
__author__ = "\n".join(['Alessandro Luongo (alessandro.luongo@studenti.unimi.it'])
__all__ = ['harmonic_centrality']
def harmonic_centrality(... | Python | 0 | @@ -1570,16 +1570,27 @@
rality.%22
+%0A
Interne
@@ -1635,16 +1635,156 @@
%22%22%22%0A
+ if len(G) %3C= 1:%0A return %7Bsingleton: 0.0 for singleton in G.nodes()%7D%0A %0A if G.is_directed():%0A G = G.reverse()%0A
%0A if
@@ -1892,40 +1892,13 @@
-path_length = f... |
a7ee8cda2900225399762dced49f5f41b53899fb | fix removing all generated files before re-creating them | superflore/generators/bitbake/ros_meta.py | superflore/generators/bitbake/ros_meta.py | # Copyright 2017 Open Source Robotics Foundation, 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.000138 | @@ -2098,16 +2098,24 @@
', files
+.split()
)%0A%0A d
|
64398ee476a04d4cbad61b14151da1f14724065d | Add exception handling | src/Notification/Subscriber/LED/RGB.py | src/Notification/Subscriber/LED/RGB.py | import time
import logging
import RPi.GPIO as GPIO
from src.Notification.Subscriber.MQTTSubscriber import MQTTSubscriber
class RGB(MQTTSubscriber):
GREEN = 'green'
RED = 'red'
BLUE = 'blue'
DEFAULT_COLOUR = GREEN
DEFAULT_STYLE = 'flash'
def __init__(self, configuration, notification_manage... | Python | 0.000005 | @@ -2667,32 +2667,49 @@
ise_gpio(self):%0A
+ try:%0A
GPIO.set
@@ -2723,16 +2723,20 @@
IO.BCM)%0A
+
@@ -2828,32 +2828,36 @@
O.LOW)%0A%0A
+
+
self._red = GPIO
@@ -2874,32 +2874,36 @@
_red_gpio, 100)%0A
+
self._gr
@@ -2940,32 +2940,36 @@
o, 100)%0A
+... |
7b143f4a13f9faecdb013a0184b652ab7fcfd26b | Check that flake8-putty extension is installed | tests/test_integration.py | tests/test_integration.py | # -*- coding: utf-8 -*-
"""Test config parser."""
from __future__ import unicode_literals
import os.path
from unittest import TestCase
try:
from unittest import mock
except ImportError:
import mock # Python 3.2 and lower
from flake8 import engine
import pep8
# Ignore unrelated flake8 plugins
IGNORE_LIST ... | Python | 0 | @@ -604,16 +604,306 @@
ns.%22%22%22%0A%0A
+ @classmethod%0A def setUpClass(cls):%0A flake8_ext_data = engine._register_extensions()%0A flake8_ext_list = flake8_ext_data%5B0%5D%0A assert flake8_ext_list%0A flake8_ext_names = %5Bitem%5B0%5D for item in flake8_ext_list%5D%0A asser... |
c18884b10f345a8a094a3c4bf589888027d43bd5 | Remove url inlude for Django 2.0 | examples/django_app/example_app/urls.py | examples/django_app/example_app/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from example_app.views import ChatterBotAppView, ChatterBotApiView
urlpatterns = [
url(r'^$', ChatterBotAppView.as_view(), name='main'),
url(r'^admin/', include(admin.site.urls), name='admin'),
url(r'^api/chatterbot/', ChatterBotAp... | Python | 0.000014 | @@ -25,17 +25,8 @@
port
- include,
url
@@ -226,16 +226,8 @@
/',
-include(
admi
@@ -237,17 +237,16 @@
ite.urls
-)
, name='
|
68f24127a3f2ff31176301b624352ecffcd4fa15 | Add created and updated fields when a post is created, also extends update from basemodel | app/models/post.py | app/models/post.py | from .base import BaseModel
from flask_user import current_user
class Post(BaseModel):
def __init__(self, **kwargs):
# Add a comment list field
self.comment_list = []
super().__init__(**kwargs)
def add_comment(self, comment_id):
""" Append a comment id to a comment_list field... | Python | 0 | @@ -2,12 +2,15 @@
rom
-.bas
+datetim
e im
@@ -14,25 +14,24 @@
import
-BaseModel
+datetime
%0Afrom fl
@@ -59,16 +59,44 @@
nt_user%0A
+from .base import BaseModel%0A
%0A%0Aclass
@@ -147,16 +147,16 @@
wargs):%0A
-
@@ -182,16 +182,69 @@
t field%0A
+ self.created = self.updated = datetime.now()%... |
fe5ab7ce3485c91504d99a5f8b68e78208edc237 | Use unique zone for testing (to not break other tests) | tests/test_integration.py | tests/test_integration.py | from unittest import TestCase
from uuid import uuid4
from demands import HTTPServiceError
from pycloudflare.models import User
from pycloudflare.services import (
CloudFlareHostPageIterator, CloudFlareHostService, CloudFlarePageIterator,
CloudFlareService)
TEST_USER = {}
def setUpModule():
cfh = Cloud... | Python | 0 | @@ -5980,20 +5980,21 @@
'example
-.org
+2.com
')%0A%0A
|
499c5f1e1271555f98e91ce96dfad92d46586567 | Fix grammatical errors (#706) | examples/helpers/stats/stats_example.py | examples/helpers/stats/stats_example.py | import json
import os
from sendgrid.helpers.stats import *
from sendgrid import *
# NOTE: you will need move this file to the root directory of this project to execute properly.
# Assumes you set your environment variable:
# https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#environment-variab... | Python | 0.000044 | @@ -98,16 +98,19 @@
ll need
+to
move thi
@@ -222,16 +222,21 @@
iable:%0A#
+ See:
https:/
|
d7e02bf6a36a19dad268deae94757a21447b8220 | remove the executable bit and the hashbang in the python script | runCertTestsLocally.py | runCertTestsLocally.py | #!/usr/bin/python
"""
This script runs all of the CertTest cases to create a local 'gold standard'
set of solutions.
"""
import os
import sys
import shutil
import subprocess
# if the local output directory already exists, bail for two reasons
# 1. don't silenty overwrite previous outputs
# 2. the python files... | Python | 0.000001 | @@ -1,22 +1,4 @@
-#!/usr/bin/python%0A
%22%22%22%0A
|
780a7a3880bcfc1b54da5b06273ffc8a05abd94c | Replace `ExampleSerializer` by `features.serialize_example` | tf3d/datasets/utils/example_parser.py | tf3d/datasets/utils/example_parser.py | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Python | 0.000053 | @@ -1089,31 +1089,22 @@
%22%22%22%0A
-example_specs =
+return
feature
@@ -1097,36 +1097,34 @@
return features.
-get_
+de
serialized_info(
@@ -1120,189 +1120,35 @@
lize
-d_info()%0A parser = tfds.core.example_parser.ExampleParser(example_specs)%0A tfexample_data = parser.parse_example(serialized_example)%0A ... |
607cc13eb791f763c4d34256568ef5f45177ca3b | Revise typo for fibonacci_memo() and use generator | alg_fibonacci.py | alg_fibonacci.py | """Fibonacci series:
0, 1, 1, 2, 3, 5, 8,...
- Fib(0) = 0
- Fib(1) = 1
- Fib(n) = Fib(n - 1) + Fib(n - 2)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def fibonacci_recur(n):
"""Get the nth number of Fibonacci series, Fn, by recursion.
- ... | Python | 0.000004 | @@ -720,16 +720,17 @@
or n in
+x
range(2,
@@ -731,16 +731,20 @@
nge(2, n
+ + 1
):%0A
|
369d0e1a0040f7f4331cb7607dbaaaa8ab9d6f96 | Fix response with 504 code when SF is off-line | tests/test_pkgmanifest.py | tests/test_pkgmanifest.py | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import pytest
import requests
from os.path import basename
from platformio.util import get_api_result
@pytest.fixture(scope="session")
def sfpkglist():
result = None
r = None
try:
r = requests.get("http://sourceforge.net/... | Python | 0.000003 | @@ -1532,24 +1532,113 @@
rects=True)%0A
+ if r.status_code == 504:%0A raise requests.exceptions.ConnectionError()%0A
except r
|
06ed4fe212b0b35056c931aab0b084d2276ee79f | Use allOnlyFields instead of roundabout way, to remain atomic | IndexedRedis/compat_convert.py | IndexedRedis/compat_convert.py | # Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.
#
# Some conversion functions
import copy
# vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab :
# TODO: Add a "filterFetchOnlyFields" helper method
def compat_convertPickleFields(mdlClass):
'''
compat_convertPick... | Python | 0 | @@ -197,61 +197,8 @@
:%0A%0A
-# TODO: Add a %22filterFetchOnlyFields%22 helper method%0A%0A
def
@@ -945,53 +945,8 @@
s%5D%0A%0A
-%09allPks = mdlClass.objects.getPrimaryKeys()%0A%0A
%0A%09ol
@@ -1212,19 +1212,11 @@
cts.
-getMultiple
+all
Only
@@ -1226,16 +1226,8 @@
lds(
-allPks,
pick
|
c709cba9f84fa15b50819b5e77ab7cc66db8d647 | simplify output | tools/findAinB.py | tools/findAinB.py | import sys
import re
sep = re.compile(r"\s+")
stp = re.compile(r"^0[xX]")
fa = open(sys.argv[1])
fb = open(sys.argv[2])
la = {}
lb = {}
for f,l in ((fa, la), (fb, lb)):
for ln in f:
ln = ln.strip().upper()
if ln == "":
continue
if ln.startswith("#"):
continue
a = sep.split(ln)
p = stp.sub("", a[0])... | Python | 1 | @@ -466,33 +466,8 @@
)%0Ael
-se:%0A%09print(%22Not All In%22)%0A
if a
@@ -492,12 +492,39 @@
ll Not In%22)%0A
+else:%0A%09print(%22Not All In%22)%0A
|
78659ab199fef51cf8dbe15cbc2e7ed08b78eba9 | Add video search | apps/meetup/admin.py | apps/meetup/admin.py | # coding: utf-8
from django.contrib import admin
from .forms import EventAdminForm
from .models import Photo, Venue, MediaCoverage, Talk, Sponsor, Speaker, \
Event, Tutorial, Vote
def oembed_presentation(obj):
return bool(obj.presentation_data)
oembed_presentation.short_description = u'Слайды'
oembed_presenta... | Python | 0 | @@ -842,16 +842,45 @@
_data'%5D%0A
+ search_fields = %5B'name'%5D%0A
orde
|
f5eb47ad7ab1429263b31ad2cc16ac70e492505f | Add TestTokenObtainSerializer | tests/test_serializers.py | tests/test_serializers.py | from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.test import TestCase
from rest_framework_simplejwt.serializers import (
TokenObtainSlidingSerializer, TokenRefreshSlidingSerializer
)
from rest_framework_simplejwt.settings import api_settings
from rest_framework_simplejw... | Python | 0.000015 | @@ -168,39 +168,32 @@
TokenObtainS
-lidingS
erializer, Token
@@ -186,16 +186,50 @@
ializer,
+ TokenObtainSlidingSerializer,%0A
TokenRe
@@ -433,39 +433,32 @@
TestTokenObtainS
-lidingS
erializer(TestCa
@@ -770,39 +770,32 @@
s = TokenObtainS
-lidingS
erializer(data=%7B
@@ -947,39 +947,32 @@
s = TokenObtai... |
2a646f248e3a9e3d6ca1ffe1c9594af3b597dcb1 | Add edge cases for undo-push | wrapper.py | wrapper.py | import subprocess
import os
import sys
import sqlite3
import hashlib
import time
prompt = '> '
# strip new line
repo_path = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).strip()
# folder to store all settings and backups
common_path = os.path.expanduser("~/Library/Application Support/git-undo/")
... | Python | 0.000002 | @@ -1225,25 +1225,20 @@
%09%09elif (
-i.split()
+temp
%5B0%5D==%22co
@@ -1287,25 +1287,235 @@
%09return
-i.split()
+temp%5B1%5D%0A%09return False%09%0A%0A# returns commit id latest commit%0Adef getCurrentCommit():%0A%09x = subprocess.check_output(%5B%22git%22%5D+%5B%22log%22%5D)%0A%09y = x.split('%5Cn')%0A%09for i ... |
7c6af05e733a758223de812fc35d8ed975ee1fcc | Remove an old comment. | apps/package/urls.py | apps/package/urls.py | from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail, object_list
from django.views.generic.date_based import archive_index
from django.views.generic.simple import direct_to_template
from package.models import Package
from package.views import (
... | Python | 0 | @@ -2096,53 +2096,8 @@
l%22,%0A
- #template_object_name=%22package%22,%0A
|
7df8fc65fe7130a27aa85d9f88c32d0d50e93aff | Fix the mobilenet_ssd_quant_test expected result | tflitehub/mobilenet_ssd_quant_test.py | tflitehub/mobilenet_ssd_quant_test.py | # RUN: %PYTHON %s
# XFAIL: *
import absl.testing
import numpy
import os
import test_util
import urllib.request
from PIL import Image
# Model from https://github.com/google-coral/test_data/raw/master/ssd_mobilenet_v2_face_quant_postprocess.tflite
# but trimmed the final TFLite_PostProcess op.
model_path = "https://st... | Python | 0.996191 | @@ -14,19 +14,8 @@
N %25s
-%0A# XFAIL: *
%0A%0Aim
|
e7f63f1efd482eb42d8941a6748ed217c69b4c3c | Add polls.models.Poll and polls.models.Choice | apps/polls/models.py | apps/polls/models.py | from django.db import models
# Create your models here.
| Python | 0.00349 | @@ -27,31 +27,291 @@
ls%0A%0A
-# Create your models here.
+%0Aclass Poll(models.Model):%0A question = models.CharField(max_length=200)%0A pub_date = models.DateTimeField('date published')%0A%0Aclass Choice(models.Model):%0A poll = models.ForeignKey(Poll)%0A choice_text = models.CharField(max_length=200)%0A... |
8a750370c70c53822da4420caf3d3090544ff7d0 | Fix static analysis issue | anac/__init__.py | anac/__init__.py | # encoding: utf-8
'''Interface com a ANAC'''
import logging
import re
from netrc import netrc
from mechanize import Browser
def _log():
if not _log.logger:
_log.logger = logging.getLogger()
return _log.logger
_log.logger = None
class Anac(object):
def __init__(self, dryrun):
self.dryru... | Python | 0.000047 | @@ -221,16 +221,18 @@
.logger%0A
+%0A%0A
_log.log
|
3243f199fb46d2d6f95ae9afd18b1570f9b5f529 | Fix up bad last commit | astatsscraper/parsing.py | astatsscraper/parsing.py | def parse_app_page(response):
# Should always be able to grab a title
title = response.xpath('//div[@class = "panel panel-default panel-gameinfo"]/div[@class = "panel-heading"]/text()').extract()[0].strip()
# Parse times into floats
time_to_hundo = response.xpath('//table[@class = "Default1000"]/tr/td[s... | Python | 0.000903 | @@ -842,16 +842,17 @@
%7D%0A%0A
+%0A
def pars
@@ -1067,16 +1067,45 @@
yield
+ %7B%0A 'app_id' :
relativ
@@ -1110,17 +1110,16 @@
ive_url%5B
-:
len('Ste
@@ -1147,6 +1147,21 @@
D=')
+:
%5D%0A
+ %7D%0A
|
39b54be2fd7aeb30b42d9d03caf82290d6c365a6 | remove prints | analytic_code.py | analytic_code.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 XCG Consulting (www.xcg-consulting.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | Python | 0.000012 | @@ -2516,81 +2516,8 @@
)%0A
- print '###'%0A print 'BLABLA'%0A print ids%0A
|
2c3cd0e5e3678559c195ecb245c4f9e3fb8df098 | remove useless imports | apps/search/views.py | apps/search/views.py | # -*- coding: utf-8 -*-
import logging
from django import forms
from django.conf import settings
from django.views.generic.simple import direct_to_template
from whoosh.filedb.filestore import FileStorage
from whoosh import index, fields
from whoosh.qparser import QueryParser
from search import WHOOSH_SCHEMA
from search... | Python | 0 | @@ -212,101 +212,35 @@
oosh
- import index, fields%0Afrom whoosh.qparser import QueryParser%0Afrom search import WHOOSH_SCHEMA
+.qparser import QueryParser
%0Afro
|
6b9e636f24ca12a33b9e9a761e6c26ec1b36dec8 | update label in form | meinberlin/apps/maptopicprio/forms.py | meinberlin/apps/maptopicprio/forms.py | from ckeditor_uploader import fields
from django import forms
from django.utils.translation import ugettext_lazy as _
from adhocracy4.categories.forms import CategorizableFieldMixin
from adhocracy4.labels.mixins import LabelsAddableFieldMixin
from adhocracy4.maps import widgets as maps_widgets
from . import models
... | Python | 0 | @@ -914,16 +914,76 @@
e map.')
+%0A self.fields%5B'description'%5D.label = _('Description')
%0A%0A cl
@@ -1244,17 +1244,16 @@
label')
-,
%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.