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 |
|---|---|---|---|---|---|---|---|
17157a4eb9d4aa934da89892f4f42f851902b44c | fix missing return in celery SiteRouter :rage1: | frappe/celery_app.py | frappe/celery_app.py | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import
from celery import Celery
# initiate logger
from celery.utils.log import get_task_logger
task_logger = get_task_logger(__name__)
from datetime import timedel... | Python | 0 | @@ -1437,24 +1437,31 @@
long%22):%0A%09%09%09%09
+return
get_queue(fr
@@ -1507,16 +1507,23 @@
se:%0A%09%09%09%09
+return
get_queu
|
619b51a579801b8ae211cb062b00149c19af11a7 | Make manage task more general | admin/tasks.py | admin/tasks.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from invoke import task, run
from tasks.utils import pip_install
from website import settings
HERE = os.path.dirname(os.path.abspath(__file__))
WHEELHOUSE_PATH = os.environ.get('WHEELHOUSE')
@task()
def manage(cmd_str, target=''):
"""Take... | Python | 0.000954 | @@ -292,19 +292,8 @@
_str
-, target=''
):%0A
@@ -538,19 +538,16 @@
ython %7B%7D
- %7B%7D
%7B%7D'.for
@@ -578,16 +578,8 @@
_str
-, target
)%0A
|
453b53cf3a72e1e982a0b4bf7d21fd12fc143a93 | Refactor binary search sols to better search | alg_peak_1d.py | alg_peak_1d.py | """
Find a peak position in 1D array.
Support nums is an array of length n.
In general, nums[k] is a peak iff
nums[k] > nums[k - 1] and nums[k] > nums[k + 1].
If nums[0] > nums[1], then nums[0] is a peak.
If nums[n - 2] < nums[n - 1], then nums[n - 1] is a peak.
"""
from __future__ import absolute_import
from __fu... | Python | 0.000008 | @@ -853,16 +853,8 @@
if
- right -
lef
@@ -858,17 +858,21 @@
left ==
-0
+right
:%0A
@@ -885,34 +885,29 @@
rn left%0A
-else:%0A
+%0A
mid = le
@@ -928,36 +928,32 @@
left) // 2%0A%0A
-
-
if nums%5Bmid%5D %3C n
@@ -966,36 +966,32 @@
d + 1%5D:%0A
-
# If mid %3C mid's
@@ -... |
50a2ac8e5aeee2c4435707a72c22092e28ecf5ba | Update zeromq_server.py | examples/zeromq_server.py | examples/zeromq_server.py | import zmq
from jsonrpcserver import Success, method, dispatch
socket = zmq.Context().socket(zmq.REP)
@method
def ping():
return Success("pong")
if __name__ == "__main__":
socket.bind("tcp://*:5000")
while True:
request = socket.recv().decode()
socket.send_string(dispatch(request))
| Python | 0.000001 | @@ -1,15 +1,4 @@
-import zmq%0A
from
@@ -44,16 +44,27 @@
dispatch
+%0Aimport zmq
%0A%0Asocket
|
80a5609b35baecfe8d208b9abec36b25c10bb609 | Revert "minor date fix" | generic/reporting/reports.py | generic/reporting/reports.py | import datetime, time
from generic.reporting.forms import DateRangeForm
class Column(object):
report = None
order = 0
title = None
chart_title = None
chart_subtitle = None
chart_yaxis = None
def get_title(self):
return self.title
def set_report(self, report):
self.repo... | Python | 0 | @@ -1593,14 +1593,18 @@
onth
+ + 1
, 1)
-+
+-
dat
@@ -1628,10 +1628,9 @@
ays=
-30
+1
)%0A
|
709e9dddf94e8afa43d908e92f7c7d6bc0817e46 | remove commented line | humid_temp.py | humid_temp.py | # import Adafruit_Python_DHT
import weather_utils
import Adafruit_DHT
def get_data():
humidity, temp_c = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 4)
temp_f = weather_utils.c_to_f(temp_c)
return { 'temp_f': temp_f,
'temp_c': temp_c,
'humidity': humidity,
'dewptf': weather_... | Python | 0 | @@ -1,33 +1,4 @@
-# import Adafruit_Python_DHT%0A
impo
|
b359d2418210499573705015f057a79d71899da7 | Fix for empty raw-data option (#109) | alertaclient/commands/cmd_send.py | alertaclient/commands/cmd_send.py |
import sys
import click
@click.command('send', short_help='Send an alert')
@click.option('--resource', '-r', metavar='RESOURCE', required=True, help='Resource under alarm')
@click.option('--event', '-e', metavar='EVENT', required=True, help='Event name')
@click.option('--environment', '-E', metavar='ENVIRONMENT', h... | Python | 0.000001 | @@ -2036,16 +2036,29 @@
%0A if
+raw_data and
raw_data
|
c06e904588503768331a580d8766bf4a47f83574 | add option "-k" to limit tests in test-install command (#2635) | allennlp/commands/test_install.py | allennlp/commands/test_install.py | """
The ``test-install`` subcommand verifies
an installation by running the unit tests.
.. code-block:: bash
$ allennlp test-install --help
usage: allennlp test-install [-h] [--run-all]
[--include-package INCLUDE_PACKAGE]
Test that installation works by running the unit t... | Python | 0 | @@ -1478,16 +1478,158 @@
tests.%22)
+%0A subparser.add_argument('-k', type=str, default=None,%0A help=%22Limit tests by setting pytest -k argument%22)
%0A%0A
@@ -2093,169 +2093,290 @@
ir)%0A
- if args.run_all:%0A # TODO(nfliu): remove this when notebooks have been... |
c7c39f9c32ca6f52ba60335ebbaa2b960e74fa8f | handle conversion better | twtoolbox/streaming.py | twtoolbox/streaming.py | # Twitter Toolbox for Python
# Copyright 2016 Hugo Hromic
#
# 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 ... | Python | 0 | @@ -2582,32 +2582,90 @@
tions=locations)
+%0A follow = %5Bstr(f) for f in follow%5D if follow else None
%0A%0A # initiali
@@ -2866,32 +2866,14 @@
low=
-%5Bstr(f) for f in
follow
-%5D
, tr
|
71769c444ef911cc0303762e23e385bea865b4ef | Add docs for server.py | typedjsonrpc/server.py | typedjsonrpc/server.py | """Contains the Werkzeug server for debugging and WSGI compatibility."""
from __future__ import absolute_import, print_function
import json
from werkzeug.debug import DebuggedApplication
from werkzeug.debug.tbtools import get_current_traceback
from werkzeug.exceptions import abort
from werkzeug.serving import run_sim... | Python | 0 | @@ -3322,39 +3322,204 @@
:
-type environ: dict%5Bstr, object%5D
+param environ: The environment which is passed into the wsgi application%0A :type environ: dict%5Bstr, object%5D%0A :param start_response: The start_response function of the wsgi application
%0A
@@ -4999,39 +4999,204 @@
:
-type e... |
411b95793ff5e73e14949aabc3466a9f39336267 | Figure out what's in that resp | micro.py | micro.py | #!/usr/bin/env python
from __future__ import division
from flask import Flask, render_template, url_for, session, request, g, \
redirect, flash
from flaskext.oauth import OAuth
import os
#setup code
app = Flask(__name__)
app.secret_key = 'pagerduty'
oauth = OAuth()
facebook = oauth.remote_app('facebook',
ba... | Python | 0.99993 | @@ -1956,16 +1956,83 @@
'index')
+%0A%0A%09#Figure out what resp is (i.e. print str(resp))%0A%09print str(resp)
%0A%09%0A%09if r
|
5a0c6904c23a84d1ee931e3ef82f297197141222 | add twitter and flags | light.py | light.py | #!/usr/bin/python
"""
light.py
Read analog values from the photoresistor
=======
run with:
sudo ./light.py
Copyright 2014 David P. Bradway (dpb6@duke.edu)
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... | Python | 0 | @@ -911,16 +911,158 @@
as plt%0A
+ import collections%0A import twitter%0A %0A # Set Flags%0A plotit = 0%0A debug = 0%0A printit = 1%0A tweetit = 1%0A %0A # Set ADC
%0A sen
@@ -1079,21 +1079,16 @@
'P9_40'%0A
- %0A
ADC.
@@ -1092,24 +1092,172 @@
DC.setup()%0A%0A
+ # Set da... |
e6b3a02376f832ee1bf79905ececfc76933197fc | Fix client | client/client.py | client/client.py | import socket
import os
import json
import time
class Client():
def __init__(self):
abs_prefix = os.path.join(os.path.dirname(__file__), "../data")
with open(abs_prefix + '/config.json','r') as f:
conf = json.load(f)
self.port = conf["port"]
self.host = conf["hos... | Python | 0.000001 | @@ -147,20 +147,22 @@
_), %22../
-data
+client
%22)%0A
@@ -315,24 +315,64 @@
onf%5B%22host%22%5D%0A
+ print (self.host,self.port)%0A
@@ -408,79 +408,8 @@
d%22%5D%0A
- server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)%0A
@@ -657,16 +657,16 @@
%22quit%22:%0A
+
... |
d4d4a065323d61073eb80a4f7f04d2902a33e4fe | fix ntb publish service get_filename for events | server/ntb/publish/ntb_publish_service.py | server/ntb/publish/ntb_publish_service.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2016 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superde... | Python | 0 | @@ -986,16 +986,37 @@
else:%0A
+ try:%0A
@@ -1088,16 +1088,83 @@
ntent'%5D%0A
+ except AttributeError:%0A filename = None%0A
|
936e6427c48ebbf16a12fb3afa0f48ad6c397046 | fix feature input to hb-view | Lib/diffenator/utils.py | Lib/diffenator/utils.py | import subprocess
from PIL import Image
from fontTools.varLib.mutator import instantiateVariableFont
try:
from StringIO import StringIO
except ImportError: # py3 workaround
from io import BytesIO as StringIO
def render_string(font, string, features=None, pt_size=128):
"""Use Harfbuzz to render a string""... | Python | 0 | @@ -609,42 +609,295 @@
-cmd += %5B'--features=%25s' %25 features
+# ignore aalt tag. This feat is used so users can access glyphs%0A # via a glyph pallette.%0A # https://typedrawers.com/discussion/1319/opentype-aalt-feature%0A # glyphsapp will autogen this feature%0A cmd += %5B'--featu... |
1d51a59a6e1406852a081585e252afab892e9756 | Handle cases where the states don't exist when getting dialogue config's states | go/apps/dialogue/vumi_app.py | go/apps/dialogue/vumi_app.py | # -*- test-case-name: go.apps.dialogue.tests.test_vumi_app -*-
import pkg_resources
import json
from vumi.application.sandbox import SandboxResource
from go.apps.jsbox.vumi_app import JsBoxConfig, JsBoxApplication
def determine_endpoints(poll):
names = set(
s['channel_type']
for s in poll['stat... | Python | 0.000002 | @@ -311,17 +311,21 @@
poll
-%5B
+.get(
'states'
%5D if
@@ -320,17 +320,21 @@
'states'
-%5D
+, %5B%5D)
if s%5B't
|
7bce0c3e1c2cc0ca8f37916ad88abd0f91ba2c38 | Update Keras.py | tanh/Keras.py | tanh/Keras.py | from keras.datasets import mnist
from keras.initializers import RandomUniform
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import SGD
from keras.utils import to_categorical
batch_size = 128
epochs = 30
learning_rate = 0.5
(x_train, y_train), (x_test, y_test) = mn... | Python | 0 | @@ -1211,18 +1211,8 @@
%0D%0A%0D%0A
-history =
mode
@@ -1237,26 +1237,16 @@
-
-
y_train,
@@ -1257,26 +1257,16 @@
-
-
batch_si
@@ -1291,26 +1291,16 @@
-
-
epochs=e
@@ -1307,26 +1307,16 @@
pochs,%0D%0A
-
|
ac545eb8b21ed1bfadc5649fc84e58da10a35846 | Change `compose` to return a string instead of a generator | tinysrt.py | tinysrt.py | #!/usr/bin/env python
'''A tiny library for parsing, modifying, and composing SRT files.'''
import functools
import re
from datetime import timedelta
from itertools import groupby
SUBTITLE_PATTERN = r'(\d+)\n(\d+:\d+:\d+,\d+) --> (\d+:\d+:\d+,\d+)\n(.+?)\n\n'
SUBTITLE_REGEX = re.compile(SUBTITLE_PATTERN, re.MULTILI... | Python | 0 | @@ -2266,16 +2266,23 @@
return
+''.join
(subtitl
@@ -2375,28 +2375,19 @@
or s
-rt_block in compose(
+ubtitle in
subt
@@ -2387,25 +2387,24 @@
in subtitles
-)
:%0A sr
@@ -2419,18 +2419,26 @@
.write(s
-rt_block
+ubtitle.to_srt()
)%0A
|
7977939caa8b521bd99112a3d368e343db3169cd | Fix a bug about losing the owner of a password when doing a modification on the password | yithlibraryserver/views.py | yithlibraryserver/views.py | import json
import bson
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.view import view_config, view_defaults
from yithlibraryserver.errors import password_not_found, invalid_password_id
from yithlibraryserver.utils import jsonable
from yithlibraryserver.validation import validate_password
@view_de... | Python | 0.000006 | @@ -1758,115 +1758,8 @@
st%0A%0A
- # the user is actually not used in this view since%0A # the passwords ids are globally unique%0A
@@ -3172,32 +3172,70 @@
in the database%0A
+ password%5B'owner'%5D = self.user%0A
result =
|
c624fe37353128f661839be475a352515b243610 | Update broker.py | fx_collect/broker.py | fx_collect/broker.py | from settings import FX_USER, FX_PASS, URL, FX_ENVR
from datetime import datetime, timedelta
import forexconnect as fx
import numpy as np
import time
OLE_TIME_ZERO = datetime(1899, 12, 30)
class FXCMBrokerHandler(object):
"""
The BrokerHandler object is designed to interact directly
with FXCM using the p... | Python | 0.000001 | @@ -2472,19 +2472,69 @@
-bid
+while True:%0A try:%0A bid, ask
= self.
@@ -2548,16 +2548,20 @@
.get_bid
+_ask
(offer)%0A
@@ -2572,41 +2572,156 @@
-ask = self.session.get_ask(offer)
+ if bid %3E 0 and ask %3E 0:%0A break%0A except RuntimeE... |
fa99e3eb8504016fee706347fe162c2692b74c70 | Support concurrent loops. | gearman/client.py | gearman/client.py | """
Gearman client implementation.
"""
import sys
import struct
from collections import deque
from twisted.internet import defer
from twisted.protocols import stateful
from twisted.python import log
from constants import *
__all__ = ['GearmanProtocol', 'GearmanWorker']
class GearmanProtocol(stateful.StatefulProto... | Python | 0 | @@ -2619,16 +2619,45 @@
ons = %7B%7D
+%0A self.sleeping = None
%0A%0A de
@@ -2954,84 +2954,455 @@
-@defer.inlineCallbacks%0A def getJob(self):%0A %22%22%22Get the next job.%22%22%22
+def _sleep(self):%0A if not self.sleeping:%0A self.sleeping = self.protocol.pre_sleep()%0A ... |
4063d94b405a41ead8d5c3df5a1d27dd1dba140f | remove config for warmup | gae/tap/warmup.py | gae/tap/warmup.py | # -*- coding: utf-8 -*-
from functools import wraps
import os
import sys
from google.appengine.api import lib_config
import webapp2
# Config
class ConfigDefaults(object):
IS_TEST = "unittest" in sys.modules.keys()
SITE_PACKAGES = "site-packages"
config = lib_config.register("warmup", ConfigDefaults.__dict__)
... | Python | 0.000001 | @@ -72,252 +72,22 @@
ys%0A%0A
-from google.appengine.api import lib_config%0Aimport webapp2%0A%0A%0A# Config%0A%0Aclass ConfigDefaults(object):%0A IS_TEST = %22unittest%22 in sys.modules.keys()%0A SITE_PACKAGES = %22site-packages%22%0A%0Aconfig = lib_config.register(%22warmup%22, ConfigDefaults.__dict__)
+import web... |
3dfac1e6ef418e180d4967aba921ff527ff31e6b | Update ittr_multiplayer.py | nose_ittr/ittr_multiplayer.py | nose_ittr/ittr_multiplayer.py | __author__ = 'Sergey Ragatsky'
__version__ = '0.0.2'
import re
import logging
from types import FunctionType
from itertools import product
logger = logging.getLogger(__name__)
def ittr(*args, **kwargs):
"""
Decorator that adds iteration attributes to test method
"""
def update_attr(func):
# ... | Python | 0.000001 | @@ -856,18 +856,17 @@
rMultipl
-ay
+i
er%0A
@@ -2901,16 +2901,50 @@
= False%0A
+ # mark has been multiplied
%0A
@@ -2977,34 +2977,8 @@
ue
-# mark has been multiplied
%0A
|
d2466f376a19389a8cdc3aeaa070a30edb406b10 | store 'curve_type' in layer's lib | Lib/ufo2ft/filters/cubicToQuadratic.py | Lib/ufo2ft/filters/cubicToQuadratic.py | from __future__ import (
print_function, division, absolute_import, unicode_literals)
from ufo2ft.filters import BaseFilter
from cu2qu.ufo import DEFAULT_MAX_ERR, CURVE_TYPE_LIB_KEY
from cu2qu.pens import Cu2QuPointPen
import logging
logger = logging.getLogger(__name__)
class CubicToQuadraticFilter(BaseFilter... | Python | 0 | @@ -84,16 +84,64 @@
erals)%0A%0A
+from ufo2ft.constants import DEFAULT_LAYER_NAME%0A
from ufo
@@ -837,16 +837,46 @@
Set=None
+, layerName=DEFAULT_LAYER_NAME
):%0A
@@ -905,32 +905,167 @@
emberCurveType:%0A
+ # check first in the global font lib, then in layer lib%0A for lib in (font.lib, ... |
b842d9f553fe5c4cbf8273c2c11362b85c0ffbf5 | Change _get_tests to static method. | health_monitor/models.py | health_monitor/models.py | """
Copyright 2017 Gracenote
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 writ... | Python | 0 | @@ -2888,29 +2888,30 @@
_test%0A%0A @
-class
+static
method%0A d
@@ -2924,21 +2924,16 @@
t_tests(
-cls,
group):%0A
|
2ee4f2d423cf1b3dba9ceed3cd31db91ee0ce86d | Fix variable referenced before assignment | nsone/rest/transport/basic.py | nsone/rest/transport/basic.py | #
# Copyright (c) 2014 NSONE, Inc.
#
# License under The MIT License (MIT). See LICENSE in project root.
#
from __future__ import absolute_import
from nsone.rest.transport.base import TransportBase
from nsone.rest.errors import ResourceException, RateLimitException, \
AuthException
try:
from urllib.request im... | Python | 0.002868 | @@ -2179,39 +2179,8 @@
= e%0A
- body = resp.read()%0A
@@ -2326,16 +2326,47 @@
inally:%0A
+ body = resp.read()%0A
|
3967ecb61f28a952bb0ec5e3798be60849d845e5 | Add support for feeds sorted by awesome_count to apiv2 | dwitter/views_v2.py | dwitter/views_v2.py | import datetime
from dateutil.parser import parse
from django.contrib.auth.models import User
from django.db.models import Prefetch
from django.utils import timezone
from rest_framework import mixins, viewsets
from rest_framework.decorators import action
from rest_framework.exceptions import PermissionDenied
from rest... | Python | 0 | @@ -125,16 +125,23 @@
Prefetch
+, Count
%0Afrom dj
@@ -2174,39 +2174,57 @@
ted', '-posted',
+ '-awesome_count',
'?'):%0A
-
orde
@@ -2241,16 +2241,17 @@
otness'%0A
+%0A
@@ -2631,121 +2631,8 @@
1)%0A%0A
- if order_by not in ('hotness', '-hotness', 'posted', '-posted', '?'):%0A ... |
5f663eb971542d252186dbf9345ca458dca93c16 | fix file not exist during render file | tpl/tpl.py | tpl/tpl.py | # -*- coding:utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import jinja2
from tpl import path
from tpl import errors
class Template(object):
IGNORE_FILES = [
'construct.sh',
'construct.py'
]
def __init__(self, tpl_dir):
... | Python | 0.000001 | @@ -611,32 +611,59 @@
trictUndefined)%0A
+ render_file = file%0A
if '%7B%7B'
@@ -696,24 +696,31 @@
+render_
file = env.f
@@ -825,32 +825,39 @@
.read()%0A
+render_
file_content = e
@@ -916,22 +916,36 @@
return
-file,
+render_file, render_
file_con
|
92911d0299b299af92e1ff8936748d8838e529cb | Fix faulty login url | shuup_workbench/settings/base_settings.py | shuup_workbench/settings/base_settings.py | # This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import os
from shuup.addons import add_enabled_addons
BASE_DIR = os.getenv("SHUUP_WORKBEN... | Python | 0.000001 | @@ -4993,16 +4993,17 @@
%22/login
+/
%22%0A%0ASESSI
|
7b385ca9897ab8a7b25966cc54324a4b42596f7d | fix case of no saved lists or items | lists.py | lists.py | # manage list functions
import os
import redis
import json
r = redis.from_url(os.environ.get("REDIS_URL"))
def getLists():
lists = []
items = []
lists = json.loads(r.get('lists'))
items = json.loads(r.get('items'))
return True
def putLists()
r.put('lists', json.dumps(lists))
r.pub('items'... | Python | 0.00001 | @@ -126,73 +126,223 @@
-lists = %5B%5D%0A items = %5B%5D%0A lists = json.loads(r.get('lists'))%0A
+savedLists = r.get('lists')%0A if savedLists == None:%0A lists = %5B%5D%0A else:%0A lists = json.loads(savedLists)%0A savedItems = r.get('items')%0A if savedItems == None:%0A i... |
2a08d3154992b5f0633d7cd2ca1bbfc7ecd63f69 | Fix to allow version number to be imported without dependencies being installed. | email_extras/__init__.py | email_extras/__init__.py |
from django.core.exceptions import ImproperlyConfigured
from email_extras.settings import USE_GNUPG
__version__ = "0.1.0"
if USE_GNUPG:
try:
import gnupg
except ImportError:
raise ImproperlyConfigured, "Could not import gnupg"
| Python | 0 | @@ -1,63 +1,4 @@
-%0D%0Afrom django.core.exceptions import ImproperlyConfigured%0D%0A
%0D%0Afr
@@ -86,17 +86,26 @@
G:%0D%0A
-%09
+
try:%0D%0A
-%09%09
+
impo
@@ -114,17 +114,20 @@
gnupg%0D%0A
-%09
+
except I
@@ -141,12 +141,103 @@
ror:
-%0D%0A%09%09
+%0A try:%0A from django.core... |
b39518482da1d3e064cdbc34490e4a9924f6d5f1 | Add a test for vectorized call | quantecon/tests/test_ecdf.py | quantecon/tests/test_ecdf.py | """
Tests for ecdf.py
"""
import unittest
import numpy as np
from quantecon import ECDF
class TestECDF(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.obs = np.random.rand(40) # observations defining dist
cls.ecdf = ECDF(cls.obs)
def test_call_high(self):
"ecdf: x abo... | Python | 0 | @@ -849,8 +849,289 @@
2, F_1)%0A
+%0A def test_vectorized(self):%0A %22ecdf: testing vectorized __call__ method%22%0A t = np.linspace(-1, 1, 100)%0A self.assertEqual(t.shape, self.ecdf(t).shape)%0A t = np.linspace(-1, 1, 100).reshape(2, 2, 25)%0A self.assertEqual(t.shape, self.ecd... |
e36192babd239366d51d1ea7cdfab94c06791fe7 | Test assertElementPresents return function | functional_tests/test_base.py | functional_tests/test_base.py | # -*- coding: utf-8 -*-
from .base import FunctionalTestCase
import unittest
from unittest import mock
class TestBaseFuctionalTest(unittest.TestCase):
def test_assertelementpresent_can_find_string(self):
e = [mock.Mock(text='test')]
ft = FunctionalTestCase()
ft.assertElementPresent(e, 'tes... | Python | 0.000002 | @@ -541,28 +541,280 @@
rtElementPresent(e, 'test')%0A
+%0A def test_assertelementpresent_returns_element_found(self):%0A e = %5Bmock.Mock(text='test'), mock.Mock(text='some string')%5D%0A ft = FunctionalTestCase()%0A ret = ft.assertElementPresent(e, 'test')%0A self.assertEquals(e%5B0%5D,... |
273ad7c297974cc97eb2889ebdbafe40e34be095 | Add better comments at protocol class | honey/server.py | honey/server.py | import logging
from twisted.conch import manhole, avatar
from twisted.conch.interfaces import IConchUser, ISession
from twisted.conch.ssh import keys, session
from twisted.cred import checkers
from twisted.cred.portal import Portal, IRealm
from twisted.internet import reactor
from twisted.conch.insults import insults
... | Python | 0 | @@ -536,66 +536,238 @@
-This is the bulk of the logic that handles all connections
+After authentication and Avatar(user) creation%0A This is where all connections end up.%0A Async calls at lineReceived%0A Manhole protocol has a lot of magic.%0A It gives a line history and has a rough emulation of a t... |
472c22a83e9e3982e5b6705757f79fba3b32f3e6 | Set path dependency with context to development and deployment | hooks/common.py | hooks/common.py | import os
import sys
import urllib2
# Add charmhelpers to the system path.
sys.path.insert(0, os.path.abspath(os.path.join('..', 'lib')))
from charmhelpers.core.hookenv import (
log,
config,
)
from charmhelpers.core.host import (
mkdir,
)
from charmhelpers.fetch import (
apt_install,
apt_update,
... | Python | 0 | @@ -69,16 +69,171 @@
m path.%0A
+try:%0A sys.path.insert(0, os.path.abspath(os.path.join(os.environ%5B'CHARM_DIR'%5D,%0A 'lib')))%0Aexcept:%0A
sys.path
|
a2b6cef1fc6dee679407d61312a23f96c3e99cda | Use a plain list of url instances for the tests urls too | oauth2_provider/tests/urls.py | oauth2_provider/tests/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
)
| Python | 0 | @@ -25,18 +25,8 @@
port
- patterns,
inc
@@ -110,25 +110,9 @@
s =
-patterns(%0A '',
+(
%0A
|
aaf243646eccebea2e1d764d7de58c40c279830c | test info | hostend/main.py | hostend/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
sys.path.append('..')
from tornado.web import Application
import tornado.ioloop
import tornado.options
import tornado.httpserver
import tornado.autoreload
from tornado.options import define, options
from hostend.controller... | Python | 0.000001 | @@ -817,16 +817,54 @@
uuid'%5D%0A%0A
+print 'my host id is : %25s'%25host.uuid%0A%0A
%0Adefine(
|
0fbfef27d35cea23ad0e20fd2c9df3e8a4a046cb | Fix GCF region tags (#1827) | functions/log/main.py | functions/log/main.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -587,33 +587,24 @@
nctions_log_
-bigquery_
stackdriver%5D
@@ -656,17 +656,8 @@
log_
-bigquery_
stac
@@ -840,33 +840,32 @@
RT functions_log
-s
_retrieve%5D%0Aimpor
@@ -924,17 +924,16 @@
ions_log
-s
_retriev
|
8d56c42dd3a721a477fa1333c1d979f4002e7cc1 | Simplify importer paths after dockerization | labonneboite/importer/conf/lbbdev.py | labonneboite/importer/conf/lbbdev.py | import os
# --- importer input directory of DPAE and ETABLISSEMENT exports
INPUT_SOURCE_FOLDER = '/srv/lbb/data'
# --- job 1/8 & 2/8 : check_etablissements & extract_etablissements
JENKINS_ETAB_PROPERTIES_FILENAME = os.path.join(os.environ["WORKSPACE"], "properties.jenkins")
MINIMUM_OFFICES_TO_BE_EXTRACTED_PER_DEPART... | Python | 0.000009 | @@ -873,89 +873,4 @@
ags%0A
-BACKUP_OUTPUT_FOLDER = '/srv/lbb/backups/outputs'%0ABACKUP_FOLDER = '/srv/lbb/backups'%0A
|
b2b573c706ec8c7a29b82edbae6f19917bf4b92f | Make generated corpus easier to learn | generateCPTCorpus.py | generateCPTCorpus.py | """Script that generates a (synthetic) corpus to test the CPT model.
The corpus consists of 5 documents containing fixed topics and opinions.
The generation process is described in the CPT paper.
A text document contains the topic words on the first line and the opion words
on the second line.
Usage: python generat... | Python | 0 | @@ -2279,30 +2279,30 @@
ay(%5B%5B0.4, 0.
-6
+2
, 0.
-0
+4
, 0.0, 0.0,
@@ -2485,14 +2485,14 @@
, 0.
-0
+2
, 0.
-6
+4
, 0.
|
6fb2c9b56dfecafa5da5d3326b06654d9cdcf2e5 | change self.Rs to self.Rbs to avoid problems with inherited KeplerLike | EXOSIMS/PlanetPopulation/AlbedoByRadius.py | EXOSIMS/PlanetPopulation/AlbedoByRadius.py | from EXOSIMS.PlanetPopulation.SAG13 import SAG13
import astropy.units as u
import astropy.constants as const
import numpy as np
import scipy.integrate as integrate
class AlbedoByRadius(SAG13):
"""Planet Population module based on SAG13 occurrence rates.
NOTE: This assigns constant albedo based on radius r... | Python | 0 | @@ -1380,16 +1380,17 @@
R
+b
s (float
@@ -2227,16 +2227,17 @@
self.R
+b
s = np.h
@@ -4973,16 +4973,17 @@
n(self.R
+b
s)-1):%0A
@@ -5020,16 +5020,17 @@
%3E=self.R
+b
s%5Bi%5D)&(R
@@ -5037,16 +5037,17 @@
p%3Cself.R
+b
s%5Bi+1%5D))
|
f1c270f2145cf1f48a0207696cb4f6e9592af357 | Correct db `NAME`, use in-memory database for testing | NTHU_Course/settings/testing_sqlite.py | NTHU_Course/settings/testing_sqlite.py | '''
A configuration for testing in travis CI with sqlite3
'''
from .default import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
# https://docs.djangoproject.com/en/1.10/topics/testing/overview/#the-test-database
# django uses in memory database for testing
... | Python | 0.000001 | @@ -333,19 +333,16 @@
': '
-test_sqlite
+:memory:
'%0A
|
34f3d762f608c3ea3fd12cded38dc3853d36545f | Update vouchers.py | 2014-2015/B4-vouchers/vouchers.py | 2014-2015/B4-vouchers/vouchers.py | vouchers = [1, 2, 3, 5, 8, 9, 18, 19, 46, 154, 313]
def main():
for b in range(1, max(vouchers)):
# Amount can be created with one voucher.
if b in vouchers:
continue
bins = []
ws = sorted(vouchers, reverse=True)
for w in ws:
for x in bins:
if sum(x) + w <= b:
x.append(w)
w = None
b... | Python | 0 | @@ -1,16 +1,635 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*- %0A%0A# Copyright 2014 Fabian M.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# %09http://www.apache.... |
4ef31ecf71a8e1107329a49ed205c8b2cdffef65 | Update utils.py | httpie/utils.py | httpie/utils.py | import json
import mimetypes
import re
import sys
import time
from collections import OrderedDict
from http.cookiejar import parse_ns_headers
from pprint import pformat
from typing import Any, List, Optional, Tuple
import requests.auth
RE_COOKIE_SPLIT = re.compile(r', (?=[^ ;]+=)')
Item = Tuple[str, Any]
Items = List... | Python | 0.000001 | @@ -431,22 +431,16 @@
te keys.
-%0A%0A
%22%22%22%0A%0A
|
caa36d6a0e1a0b3d2c64d42b1494f3e4eeb30722 | Update docstrings | husc/metrics.py | husc/metrics.py | from itertools import combinations
import numpy as np
from scipy.spatial.distance import pdist
def sq_to_dist(i, j, n):
"""Convert coordinate of square distance matrix to condensed matrix index.
The condensed version of a squareform, pairwise distance matrix is
a linearisation of the upper triangular, non... | Python | 0.000001 | @@ -1687,33 +1687,145 @@
dict
-%0A Query dictionary
+ %7B string : list of tuple %7D%0A Query dictionary mapping the specified group_by field to a list of%0A (plate, well) co-ordinates
.%0A
@@ -2802,13 +2802,13 @@
tra/
-extra
+inter
gen
|
241376f76d4175c98c8226998832b8054697504c | Fix xpath expression for tomorrows forecast | app/jobs/yr.py | app/jobs/yr.py | #!/usr/bin/env python
import requests
from jobs import AbstractJob
from lxml import etree
class Yr(AbstractJob):
def __init__(self, conf):
self.url = conf['url']
self.interval = conf['interval']
def _parse_tree(self, tree, tabular_xpath=None):
if tabular_xpath is None:
t... | Python | 0.000131 | @@ -32,16 +32,57 @@
equests%0A
+from datetime import datetime, timedelta%0A
from job
@@ -1266,108 +1266,266 @@
-data.update(%7B'tomorrow': self._parse_tree(%0A tree, '/weatherdata/forecast/tabular/time%5B3%5D'
+tomorrow = datetime.now().date() + timedelta(days=1)%0A xpath = ('/weatherdata/fore... |
b6b522bbdde24f0e6eab0e7a91830171bcac63a5 | Add logout url | genevieve/urls.py | genevieve/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from .views import UserCreateView
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', in... | Python | 0.000003 | @@ -759,16 +759,127 @@
login'),
+%0A url(r'%5Eaccounts/logout/$', auth_views.logout, %7B'next_page': '/file_process'%7D,%0A name='auth_logout'),
%0A%0A) + st
|
babc90158facf0e215aa18a2c0f262c2eb6e78a2 | Fix issue with connecting to postgres on development | geodj/settings.py | geodj/settings.py | import os
# Override these on production env
os.environ.setdefault("APP_ENV", "development")
os.environ.setdefault("SECRET_KEY", "^uhrm48x9y=1f&+$bg=oc(#23mp0*g5k%8+si9tdz7&4_xk&lf")
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = os.environ['APP_ENV'] != 'production'
TEMPLATE_DEBUG = DEBUG
ADMINS = (
... | Python | 0 | @@ -707,24 +707,33 @@
'HOST': '
+localhost
',%0A '
|
ba2161f6adf5a0e0782e322371d7071ca79d02e3 | Update tornado for mypy | gidgethub/tornado.py | gidgethub/tornado.py | from typing import Mapping, Optional, Tuple
from tornado import gen
from tornado import httpclient
from . import abc as gh_abc
class GitHubAPI(gh_abc.GitHubAPI):
async def _request(self, method: str, url: str, headers: Mapping,
body: bytes = b'') -> Tuple[int, Mapping, bytes]:
""... | Python | 0 | @@ -228,16 +228,26 @@
Mapping
+%5Bstr, str%5D
,%0A
@@ -303,16 +303,26 @@
Mapping
+%5Bstr, str%5D
, bytes%5D
|
ad56d5aa6b2359098c4ed6bf9cd37cb58613a372 | Update github3.repos.tag for consistency | github3/repos/tag.py | github3/repos/tag.py | # -*- coding: utf-8 -*-
"""
github3.repos.tag
=================
This module contains the RepoTag object for GitHub's tag API.
"""
from __future__ import unicode_literals
from ..models import GitHubCore
class RepoTag(GitHubCore):
"""The :class:`RepoTag <RepoTag>` object. This stores the information
represen... | Python | 0 | @@ -24,46 +24,8 @@
%0A%22%22%22
-%0Agithub3.repos.tag%0A=================%0A%0A
This
@@ -81,18 +81,16 @@
tag API.
-%0A%0A
%22%22%22%0Afrom
@@ -136,23 +136,16 @@
om .
-.models
import
GitH
@@ -140,26 +140,44 @@
import
-GitHubCore
+commit%0Afrom .. import models
%0A%0A%0Aclass
@@ -185,16 +185,23 @@
RepoTag(
... |
73f3c743139927a049c5e733f98e1fcb8125721a | Update release version | gdaltools/metadata.py | gdaltools/metadata.py | # -*- coding: utf-8 -*-
"""Project metadata
Information describing the project.
"""
# The package name, which is also the "UNIX name" for the project.
package = 'pygdaltools'
project = 'pygdaltools'
project_no_spaces = project.replace(' ', '')
version = '0.2'
description = """Python wrapper for Gdal/OGR command line ... | Python | 0 | @@ -252,17 +252,17 @@
on = '0.
-2
+3
'%0Adescri
|
ad423635860c93021d8dcf8ba33cc86ddd006132 | fix error message when no OpenJPEG library can be found, closes #284 | glymur/lib/config.py | glymur/lib/config.py | """
Configure glymur to use installed libraries if possible.
"""
# configparser is new in python3 (pylint/python-2.7)
# pylint: disable=F0401
import ctypes
from ctypes.util import find_library
import os
import platform
import warnings
import sys
if sys.hexversion <= 0x03000000:
from ConfigParser import SafeConfig... | Python | 0 | @@ -2819,71 +2819,72 @@
= '
-%22L
+The l
ibrary
-%7B0%7D%22 could not be loaded. Operating in degraded mode.
+specified by configuration file at %7B0%7D could not be
'%0A
@@ -2896,26 +2896,20 @@
msg
++
=
-msg.format(path)
+'loaded.'
%0A
@@ -2929,16 +2929,29 @@
warn(msg
+.format(path)
, UserWa
|
2c0dbf04f04b686cac79e40791c3ed298618dd07 | add more info on process | gen-gallery-images.py | gen-gallery-images.py | '''Generates small and medium gallery images from a set of large originals. Some maps will be tall, some wide, some square so we want to simply maintain the ratio and resize down to a set maximum.
Original images need to be downloaded to the large path below. They are accessible in this Dropbox folder
https://www.dr... | Python | 0 | @@ -243,16 +243,22 @@
e large
+image
path bel
@@ -378,16 +378,250 @@
t0a?dl=0
+%0A%0AOnce large, medium, and small images are in place the folders are copied into the foss4g Wordpress theme, in the uploads/mapgallery folder where the images are served from to the map gallery page. See the map gallery page templat... |
1ea1773fd8f1e43bb8d0fa9c24efc158376a077b | Fix spelling for Volume | packages/mesos/extra/make_disk_resources.py | packages/mesos/extra/make_disk_resources.py | #!/opt/mesosphere/bin/python3
import json
import os
import re
import shutil
import subprocess
import sys
from datetime import datetime
from itertools import chain
from math import floor
from string import Template
PROG = os.path.basename(__file__)
JSON_COMMON_TEMPLATE = Template('''
{
"name": "disk",
"role... | Python | 0.99999 | @@ -3065,16 +3065,17 @@
rint('Vo
+l
ume disc
|
ec8abd51b1ee818dc428c1d4c6efd8e94a91eeb0 | Fix bug in build comparison | extruder/copy_packages.py | extruder/copy_packages.py | from __future__ import print_function
from argparse import ArgumentParser
import os
from ruamel import yaml
from binstar_client.utils import get_server_api
from binstar_client.errors import NotFound
from conda.version import VersionOrder
__all__ = ['PackageCopier']
class PackageCopier(object):
def __init__(s... | Python | 0 | @@ -3679,16 +3679,81 @@
builds.%0A
+ check_version = pinned_version or cf_version%0A
@@ -3946,33 +3946,36 @@
c
-f
+heck
_version)%0A
|
b8cfbbe0965ff869d4c254413420209a4cdcd82c | Update twine/commands/upload.py | twine/commands/upload.py | twine/commands/upload.py | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -1207,26 +1207,19 @@
#
-Warehouse and old
+PyPI / Test
PyPI
|
1c986a578946118966b3b5e99932831e189400df | Fix euca-upload-bundle --skipmanifest | euca2ools/commands/bundle/uploadbundle.py | euca2ools/commands/bundle/uploadbundle.py | # Copyright 2009-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... | Python | 0 | @@ -3720,17 +3720,16 @@
et('skip
-_
manifest
|
2fcca753e2877d21e158d5e4a3923e1d22e61608 | Add mask A to causal atrous conv1d (WIP) | eva/layers/causal_atrous_convolution1d.py | eva/layers/causal_atrous_convolution1d.py | import keras.backend as K
from keras.layers import AtrousConvolution1D
from keras.utils.np_utils import conv_output_length
class CausalAtrousConvolution1D(AtrousConvolution1D):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.border_mode != 'valid':
raise V... | Python | 0 | @@ -196,24 +196,39 @@
self, *args,
+ mask_type='B',
**kwargs):%0A
@@ -448,16 +448,95 @@
h - 1)%0A%0A
+ # XXX debug.%0A if mask_type == 'A':%0A self.length = 3%0A%0A
def
|
56de128ac7462a297505ec4b207d07c1af613c9b | connect annotations to api | ui/app/api/__init__.py | ui/app/api/__init__.py | from flask import Blueprint
api = Blueprint('api', __name__)
#
# end-points to create
# query
from . import query
# services
from . import services
# spans
from . import spans
#
# traces
# services
# annotations
# dependencies
# pin
from . import pin
| Python | 0.000001 | @@ -175,16 +175,57 @@
spans%0A%0A
+# annotations%0Afrom . import annotations%0A%0A
#%0A# trac
|
6fdeeb8941753e2394406ef2b90fab51684dab6d | Update mainapp.py | app/mainapp.py | app/mainapp.py | # -*- coding: utf-8 -*-
from flask import Flask, jsonify, request, abort, make_response
from futu_server_api import *
from db import save_update_token
from db import delete_tokens
import logging
import logging.config
import json
app = Flask(__name__)
logging.config.fileConfig('./conf/logging.conf')
no_db_logger = log... | Python | 0.000001 | @@ -283,25 +283,20 @@
conf/log
-ging.conf
+.ini
')%0Ano_db
|
c5b00edd9b8acbe594e43ecce093cd1c695b8b01 | Use user ID instead of username to get messages even with username changes | getalltextfromuser.py | getalltextfromuser.py | #!/usr/bin/env python3
"""
A program to extract all text sent by a particular user from a Telegram chat log which is in json form
"""
import argparse
from json import loads
def main():
parser = argparse.ArgumentParser(
description="Extract raw text sent by a user from a json telegram chat log")
parser... | Python | 0 | @@ -570,16 +570,89 @@
ername%0A%0A
+ user_id = %22%22%0A%0A #first, get the ID of the user with that username.%0A
with
@@ -1027,24 +1027,552 @@
ername:%0A
+ #print(event%5B%22text%22%5D)%0A print(event%5B'from'%5D%5B'id'%5D)%0A user_id = ... |
48b227f0019fb28a5b96874f62662fee79998fe5 | Add a TODO for diamondash metric snapshot request auth in diamondash proxy view | go/dashboard/views.py | go/dashboard/views.py | from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
from go.dashboard import client
@login_required
@csrf_exempt
@require_http_methods(['GET'])
def diamondash_... | Python | 0 | @@ -709,16 +709,132 @@
.body)%0A%0A
+ # TODO for the case of snapshot requests, ensure the widgets requested are%0A # allowed for the given account%0A%0A
retu
|
e7d6f5fbd21819ba0c5d3b5e952331b2eabe32e8 | move ballsearch para to config | gpbo/core/__init__.py | gpbo/core/__init__.py | from collections import defaultdict
debugoutput=defaultdict(lambda :False)
debugoutput['path']='dbout'
from .optimize import *
from .optutils import *
from .acquisitions import *
from .reccomenders import *
from .config import *
from .GPdc import *
from .ESutils import *
from .choosers import *
| Python | 0 | @@ -96,16 +96,17 @@
'dbout'%0A
+%0A
from .op
|
c937d19b263070f380fcbc75dfe60d15840fe477 | Drop call to 'service' wrapper in 'vyos-config-mdns-repeater.py' | src/conf-mode/vyos-config-mdns-repeater.py | src/conf-mode/vyos-config-mdns-repeater.py | #!/usr/bin/env python3
#
# Copyright (C) 2017 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... | Python | 0 | @@ -2366,31 +2366,16 @@
, %22s
-ervice%22, %22mdns-repeater
+ystemctl
%22%5D%0A%0A
@@ -2481,16 +2481,65 @@
tart%22)%0A%0A
+ systemd_cmd.append(%22mdns-repeater.service%22)%0A%0A
subp
|
8914b9e5d38e7c97940b25c6a041ce7f4660f25d | Update padus.py | padus.py | padus.py | #!/usr/bin/python
"""
INSTALL
yum install python-ldap
groupadd -g 10002 ldap_test
ldapsearch -x -H ldap://172.16.2.201 -D cn=ldap,cn=users,dc=gm,dc=local -w ldap -b
CN=ldap_test,CN=Users,DC=gm,DC=local
"""
import os
import sys
import pwd
import ldap
def finduser(user):
try:
pwd.getpwnam(user)
print user, "u... | Python | 0 | @@ -20,42 +20,8 @@
%22%22%22%0A
-INSTALL%0A%0Ayum install python-ldap%0A%0A
grou
|
61e4d7742c3a5ec2df4301773fc53d9cd09d5179 | fix for unknown objects | art_detectors/art_arcode_detector/src/detector.py | art_detectors/art_arcode_detector/src/detector.py | #!/usr/bin/env python
from ar_track_alvar_msgs.msg import AlvarMarkers, AlvarMarker
from art_msgs.msg import ObjInstance, InstancesArray
from art_msgs.srv import getObject
from shape_msgs.msg import SolidPrimitive
import sys
import rospy
from visualization_msgs.msg import Marker
from geometry_msgs.msg import Point
fro... | Python | 0.000006 | @@ -1379,40 +1379,122 @@
-print %22Service call failed: %25s%22%25
+%0A # error or unknown object - let's ignore it%0A self.objects_cache%5Baid%5D = Non
e%0A
@@ -1675,32 +1675,98 @@
ox%7D%0A
+%0A if self.objects_cache%5Baid%5D is None: continue%0A ... |
e4fb1dbc9030a7a2d538f83e903cd38d77c5272b | Version bump for new requirements | espwrap/__init__.py | espwrap/__init__.py | __version__ = '1.2.3'
| Python | 0 | @@ -16,7 +16,7 @@
1.2.
-3
+4
'%0A
|
e964df34a7f1f7dc85da21429b2978b01034140f | Fix typo | i2v/__init__.py | i2v/__init__.py | from i2v.base import Illustration2VecBase
caffe_available = False
chainer_available = False
try:
from i2v.caffe_i2v import CaffeI2V, make_i2v_with_caffe
caffe_available = True
except ImportError:
pass
try:
from i2v.chainer_i2v import ChainerI2V, make_i2v_with_chainer
caffe_available = True
except... | Python | 0.999999 | @@ -281,28 +281,30 @@
hainer%0A c
-affe
+hainer
_available =
|
8731d5a3ad84872811b1e12b8f0fb85c5a4a5754 | update example project | example/settings.py | example/settings.py | """
Django settings for app project.
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/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | Python | 0 | @@ -2447,24 +2447,56 @@
ct%0A%5D
- + PROJECT_APPS%0A
+%0A%0AINSTALLED_APPS = PROJECT_APPS + INSTALLED_APPS
%0A%0ARO
|
37da5f36e4f341b0923081235885786c494239d9 | Remove unused return | lexos/models/stats_model.py | lexos/models/stats_model.py | from typing import Optional, List, NamedTuple
import numpy as np
import pandas as pd
from lexos.helpers.error_messages import EMPTY_LIST_MESSAGE
from lexos.models.base_model import BaseModel
from lexos.models.matrix_model import MatrixModel
from lexos.receivers.matrix_receiver import MatrixReceiver, IdTempLabelMap
... | Python | 0.000005 | @@ -849,50 +849,8 @@
ed.%0A
- num_file: int # The number of files.%0A
@@ -4767,53 +4767,8 @@
ze,%0A
- num_file=num_file,%0A
|
40c3ed631a962d0a986a7d3752ad1247ded75a33 | Fix save dir of listing files | parsers/transparence-sante/crawl_details.py | parsers/transparence-sante/crawl_details.py | # -*- coding: utf-8 -*-
import os, sys
from crawler import TSCrawler
from parse import parse_listing
from utils import info
from settings import EXTRACT_DETAIL_DIR
import threading
import logging
import time
import Queue
from plan_crawl import get_all_tasks
logging.basicConfig(level=logging.DEBUG,
... | Python | 0 | @@ -1530,16 +1530,18 @@
name = %22
+%25s
/%25s/list
@@ -1585,24 +1585,35 @@
, dept_code,
+ dept_code,
page)%0A%0A
|
5d32ee0e41aee95f30f972eef3d1abcf9de50a0c | Kill unused var | untz_manager/__main__.py | untz_manager/__main__.py | """Main entry point for untz."""
from concurrent.futures import ThreadPoolExecutor
import logging
import os
from .encoder import apply_gain, encode_file
from .utils import get_args, preflight_checks, recursive_file_search
ARGS = get_args()
LOGGER = logging.getLogger(__name__)
threads = [] # pylint: disable=C0103
de... | Python | 0 | @@ -276,45 +276,8 @@
__)%0A
-threads = %5B%5D # pylint: disable=C0103%0A
%0A%0Ade
|
f71b1a5c7cb8ecd8403c93c1e806387f0a6d780a | Version bump. | uploadstatic/__init__.py | uploadstatic/__init__.py | # following PEP 386
__version__ = "0.2.1"
| Python | 0 | @@ -34,9 +34,9 @@
%220.
-2.1
+3.0
%22%0A
|
ae4da4d5d6af27ddab376cb41067f21b053fcf5e | make tokenz lazy | goethe/corpora.py | goethe/corpora.py | import os
from . import util
import itertools as it
class Corpus:
def __init__(self, path, limit=None):
"""Pass path to corpus. Expects following structure:
path/to/my/corpus
corpus.txt
corpus.tokens.txt
"""
self.path = os.path.normpath(path)
self.lim... | Python | 0.001279 | @@ -826,9 +826,9 @@
s =
-%5B
+(
line
@@ -861,9 +861,9 @@
in f
-%5D
+)
%0A
|
c6fe6e7ae212dab3b8cc4615355f782664dc2d05 | raise invalid error in relations if unable to get rid or rtype | drfjsonapi/relations.py | drfjsonapi/relations.py | """
drfjsonapi.relations
~~~~~~~~~~~~~~~~~~~~
DRF relationship fields to assist with a JSON API spec
compliant API.
"""
from django.utils.translation import ugettext_lazy as _
from rest_framework.relations import SlugRelatedField
class JsonApiRelatedField(SlugRelatedField):
""" JSON API related ... | Python | 0 | @@ -1160,32 +1160,49 @@
%7D%0A %22%22%22%0A%0A
+ try:%0A
rid, rty
@@ -1231,16 +1231,76 @@
'type'%5D%0A
+ except TypeError:%0A self.fail('invalid')%0A%0A
@@ -1955,24 +1955,44 @@
ype(obj),%0A %7D%0A
+ return None%0A
|
6b8b2ebfd17cd96a08511a31d2f1159981b5c7cd | Update drakar.py | apps/drakar.py | apps/drakar.py | import os
import sys
import platform
from os.path import isfile, isdir, join
DRAKAR_PATH = os.environ.get('DRAKAR', '/mnt/drakar')
if not isdir(DRAKAR_PATH):
raise OSError("No such directory: '{}'".format(DRAKAR_PATH))
SYSTEM = sys.platform + '-' + platform.machine()
sources = {
'linux2-x86_64/processing-2.... | Python | 0 | @@ -1026,16 +1026,22 @@
name))%0A%0A
+print(
get_arch
@@ -1073,9 +1073,10 @@
64.tgz')
+)
%0A
|
c2e36c0c59e728e246f20aacbc5f6f368ca274b7 | add comment | usr/sbin/traverse_dir.py | usr/sbin/traverse_dir.py | #!/usr/bin/env python
###############################################################################
# Copyright (c) 2015 Jamis Hoo
# Project:
# Filename: traverse_dir.py
# Version: 1.0
# Author: Jamis Hoo
# E-mail: hoojamis@gmail.com
# Date: Aug 3, 2015
# Time: 14:06:02
# Description:
##########... | Python | 0 | @@ -475,16 +475,61 @@
_load%0A%0A%0A
+# command line arguments: lib_path conf_path%0A
if __nam
|
1c02294073c855fab8d6fc0965f3584b0ac0137b | clean up example file | examples/example.py | examples/example.py | #!/usr/bin/env python3
import matplotlib.pyplot as plt
from oemof import db
conn = db.connection(section='oedb')
from dingo.core import NetworkDingo
from dingo.tools import config as cfg_dingo
from dingo.tools.debug import compare_graphs
plt.close('all')
cfg_dingo.load_config('config_db_tables')
cfg_dingo.load_confi... | Python | 0.000002 | @@ -74,44 +74,8 @@
db%0A
-conn = db.connection(section='oedb')
%0Afro
@@ -154,53 +154,8 @@
ingo
-%0Afrom dingo.tools.debug import compare_graphs
%0A%0Apl
@@ -330,23 +330,8 @@
)%0A%0A#
- get engine for
dat
@@ -347,17 +347,16 @@
nection%0A
-#
conn = d
@@ -368,19 +368,16 @@
nection(
-db_
section=
@@ -382,468 +... |
2645ac98fd2698bcfbf4a23cdb6c9583e6b31a50 | create test user from python updated | src/apps/flow_manager/createdb.py | src/apps/flow_manager/createdb.py | import requests
dbhost = "localhost"
dbport = "5984"
dbuser = "root"
dbpass = "asm123"
database = "faucet"
userdatabase = "users"
username = "testflowmgr@faucetsdn.org"
password = "testflowmgr"
role = "1"
data = {"username": username, "password": password, "role": role}
# createdb = requests.put("http://"+dbuser+":"+d... | Python | 0.000001 | @@ -8,16 +8,28 @@
requests
+%0Aimport json
%0A%0Adbhost
@@ -277,18 +277,16 @@
: role%7D%0A
-#
createdb
@@ -373,18 +373,16 @@
se+%22/%22)%0A
-#
print cr
@@ -404,13 +404,14 @@
a =
-%22
%7B
+'
_id
+'
: '_
@@ -424,21 +424,23 @@
/users',
+'
views
+'
: %7B'user
@@ -494,449 +494,213 @@
'%7D%7D%7D
-%22%0Acreat... |
f6a5ad0d2107b60899f5abaf2dbce65beae34a59 | Drop remaining "OrderedDict" usages. | utilities/export_todo.py | utilities/export_todo.py | #!/usr/bin/env python
"""
Export TODOs
============
"""
from __future__ import annotations
import codecs
import os
from collections import OrderedDict
__copyright__ = "Copyright 2013 Colour Developers"
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause"
__maintainer__ = "Colour Developers"... | Python | 0 | @@ -113,44 +113,8 @@
t os
-%0Afrom collections import OrderedDict
%0A%0A__
@@ -946,24 +946,17 @@
str) -%3E
-OrderedD
+d
ict:%0A
@@ -1150,28 +1150,9 @@
ss:%60
-collections.OrderedD
+d
ict%60
@@ -1202,21 +1202,10 @@
s =
-OrderedDict()
+%7B%7D
%0A
@@ -2453,16 +2453,9 @@
ms:
-OrderedD
+d
ict,
|
937da42ae66a4f88f5fa4493c804df415559680c | fix in _adjustAttributeFields(): protect from cases when attribute list is empty | core/src/main/python/stratuslab/Monitor.py | core/src/main/python/stratuslab/Monitor.py | #
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2010, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | Python | 0.000001 | @@ -5967,24 +5967,46 @@
attrList):%0A
+ if _list:%0A
for
@@ -6019,24 +6019,28 @@
n attrList:%0A
+
@@ -6104,16 +6104,20 @@
+
+
lenMax =
@@ -6188,16 +6188,20 @@
+
if lenMa
@@ -6232,16 +6232,20 @@
%5Bi%5D%5B1%5D:%0A
+
|
547ee3fb5db9ebb0bed0443d865ec76f44904b9e | Add url_shortener.views.render_preview function | url_shortener/views.py | url_shortener/views.py | # -*- coding: utf-8 -*-
from flask import session, redirect, url_for, flash, render_template
from . import app
from .forms import ShortenedUrlForm
from .models import ShortenedUrl, register
@app.route('/', methods=['GET', 'POST'])
def shorten_url():
'''Display form and handle request for url shortening
If s... | Python | 0.000004 | @@ -1425,24 +1425,210 @@
url%0A )%0A%0A%0A
+def render_preview(shortened_url, warning_message=None):%0A return render_template(%0A 'preview.html',%0A shortened_url=shortened_url,%0A warning=warning_message%0A )%0A%0A%0A
@app.route('
|
561e7905de823e5c2ff2f4822d4051d9a7635dfc | Fix checking whether the heap contains the node when e.g. calling .pop(). | idiokit/heap.py | idiokit/heap.py | class HeapError(Exception):
pass
class Heap(object):
def __init__(self, iterable=()):
self._heap = list()
for value in iterable:
self.push(value)
def _get(self, node):
if not self._heap:
raise HeapError("empty heap")
if node is None:
n... | Python | 0 | @@ -345,16 +345,50 @@
if
+len(self._heap) %3C= node._index or
self._he
|
2ec06da007f2b2118e7275acf289b0bea2e5f53d | Fix usage of method strtime | gceapi/context.py | gceapi/context.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | Python | 0.000154 | @@ -4167,26 +4167,8 @@
p':
-timeutils.strtime(
self
@@ -4177,16 +4177,27 @@
imestamp
+.isoformat(
),%0A
|
b95fa25a5d3a00d8d1113f2d61defee69215374b | add tests for submitted graderoster | course_grader/test/dao/test_graderoster.py | course_grader/test/dao/test_graderoster.py | from django.test import TestCase
from uw_pws.util import fdao_pws_override
from uw_sws.util import fdao_sws_override
from course_grader.dao.person import PWS
from course_grader.dao.section import get_section_by_label
from course_grader.dao.graderoster import graderoster_for_section
from course_grader.exceptions import ... | Python | 0 | @@ -26,16 +26,50 @@
estCase%0A
+from django.utils import timezone%0A
from uw_
@@ -310,16 +310,70 @@
section%0A
+from course_grader.models import SubmittedGradeRoster%0A
from cou
@@ -1055,146 +1055,1767 @@
-self.assertRaises(%0A ReceiptNotFound, graderoster_for_section, section, user, user,%0A ... |
0baa58ed1564934158d43b5f8556913014535a60 | clean up: get.py imported modules | gdcmdtools/get.py | gdcmdtools/get.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from apiclient import errors
from base import GDBase
import logging
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
from gdcmdtools.auth import GDAuth
from gdcmdtools.auth import SCOPE
import requests
from requests_oauthlib import OAuth2Session
import re
imp... | Python | 0 | @@ -43,269 +43,8 @@
-*-%0A
-%0Afrom apiclient import errors%0Afrom base import GDBase%0Aimport logging%0Alogger = logging.getLogger()%0Alogger.setLevel(logging.ERROR)%0A%0Afrom gdcmdtools.auth import GDAuth%0Afrom gdcmdtools.auth import SCOPE%0A%0Aimport requests%0Afrom requests_oauthlib import OAuth2Session%0A%0A
im... |
69df5ba1baf92238e98065d60dac73d2214787d3 | Fix usage of biobank_identifier parameter | import-imput.py | import-imput.py | from pymongo import MongoClient
import csv
import re
import argparse
def categorize_float(value):
if value <= 0.001:
return "[0,0.001]"
elif value <= 0.01:
return "(0.001,0.01]"
elif value <= 0.1:
return "(0.01,0.1]"
elif value <= 0.2:
return "(0.1,0.2]"
elif value ... | Python | 0.00005 | @@ -2446,16 +2446,21 @@
uted%22: %7B
+args.
biobank_
|
d166563f648d409f7039ce2df1149a8cb15b13ab | add sub-package: plot | gdpy3/__init__.py | gdpy3/__init__.py | __name__ = "gdpy3"
__doc__ = "gdpy3: Gyrokinetic Toroidal Code Data Processing tools"
__author__ = "shmilee"
__version__ = "0.0.1"
__status__ = "alpha"
__license__ = "MIT"
__email__ = "shmilee.zju@gmail.com"
__all__ = ['convert', 'read']
| Python | 0.999514 | @@ -222,16 +222,24 @@
onvert',
+ 'plot',
'read'%5D
|
f276c840f2981ec2951e07c7b847f82811db0745 | Remove unnecessary None handling | openstack/database/v1/user.py | openstack/database/v1/user.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Python | 0.000062 | @@ -1083,17 +1083,16 @@
e')%0A
-_
password
@@ -1125,246 +1125,8 @@
')%0A%0A
- @property%0A def password(self):%0A try:%0A val = self._password%0A except AttributeError:%0A val = None%0A return val%0A%0A @password.setter%0A def password(self, val):%0A ... |
d1596872f11f95e406a6a3a97222e499abf4f222 | update plot_ts | examples/plot_ts.py | examples/plot_ts.py | """
======================
Plotting a time series
======================
An example plot of `pyts.visualization.plot_ts`
"""
import numpy as np
from scipy.stats import norm
from pyts.visualization import plot_ts
# Parameters
n_samples = 100
n_features = 48
rng = np.random.RandomState(41)
delta = 0.5
dt = 1
# Genera... | Python | 0.000001 | @@ -71,55 +71,31 @@
==%0A%0A
-An example plot of %60pyts.visualization.plot_ts%60
+Plotting a time series.
%0A%22%22%22
@@ -148,46 +148,39 @@
orm%0A
-from pyts.visualization import plot_ts
+import matplotlib.pyplot as plt
%0A%0A#
@@ -333,16 +333,21 @@
*2 * dt,
+%0A
size=n_
@@ -353,17 +353,19 @@
_samples
-*... |
c9762ec881fc041eafb0b8906242cefcdbc4bf7f | Add UsageRecord class | accloudtant/__main__.py | accloudtant/__main__.py | import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
def is_data_transfer(entry):
if "DataTransfer" in entry[" UsageType"] or "CloudFront" in entry[" UsageType"]:
return True
return False
def get_areas(entries, resource_areas):
areas = {}
... | Python | 0 | @@ -6,16 +6,165 @@
t csv%0A%0A%0A
+class UsageRecord(object):%0A def __init__(self, data):%0A self._data = data%0A%0A def __getitem__(self, key):%0A return self._data%5Bkey%5D%0A%0A%0A
def area
@@ -2173,16 +2173,53 @@
reader:%0A
+ entry = UsageRecord(row)%0A
@@ -2235,19 +2235... |
78deea6602671917c5cc78de8ed20e6825179948 | add PATCH support | coyote_framework/requests/requestdriver.py | coyote_framework/requests/requestdriver.py | """
Wrapper for python's "requests" library that has options to maintain session
and keep a history of responses in a queue
"""
import requests
from collections import deque
class RequestDriver(object):
GET = 'GET'
POST = 'POST'
PUT = 'PUT'
DELETE = 'DELETE'
session = None
responses = deque... | Python | 0 | @@ -250,16 +250,36 @@
= 'PUT'%0A
+ PATCH = 'PATCH'%0A
DELE
@@ -2037,32 +2037,130 @@
**coyote_args)%0A%0A
+ elif method == self.PATCH:%0A response = self.session.patch(uri, **coyote_args)%0A%0A
elif met
|
28e64a576a25b7fb41997da8ecfb4472d9adee38 | simplify main greenlet caching | greenhouse/compat.py | greenhouse/compat.py | import os
import sys
try:
from greenlet import greenlet, GreenletExit
except ImportError, error:
try:
from py.magic import greenlet
GreenletExit = greenlet.GreenletExit
except ImportError:
# suggest standalone greenlet, not the old py.magic.greenlet
raise error
__all__ = ["... | Python | 0.000269 | @@ -473,45 +473,21 @@
it%0A
-def _find_main():%0A glet =
+main_
greenlet
.get
@@ -482,17 +482,19 @@
greenlet
-.
+ =
getcurre
@@ -502,47 +502,24 @@
t()%0A
-
while
-glet.parent:%0A glet = g
+main_green
let.
@@ -528,25 +528,14 @@
rent
+:
%0A
-return glet%0A
main
@@ -550,17 +550,25 @@
t = ... |
ced03203126b9ad47a74d173627f4db8ed7c2e92 | change names | model_flow/model_trainer.py | model_flow/model_trainer.py | import tensorflow as tf
def average_gradients(grads_list, loss_list):
"""Calculate the average gradient for each shared variable across all towers.
Note that this function provides a synchronization point across all towers.
Args:
grads_list: List of lists of (gradient, variable) tuples. The ... | Python | 0.000075 | @@ -2173,17 +2173,26 @@
-_
+model_loss
= model
@@ -2219,24 +2219,132 @@
ta, output)%0A
+ tf.add_to_collection(%22losses%22, model_loss)%0A%0A # The losses will also store weight decay loss.%0A
loss
|
da8aa20292e0df938f0e49884b21f08034b9f441 | fix typo | google_auth/authentication.py | google_auth/authentication.py | # -*- coding: utf-8 -*-
import requests
import httplib2
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.timezone import make_aware
from rest_framework import exceptions, authentication, HTTP_HEADER_ENCODING
from rest_framework.a... | Python | 0.999991 | @@ -2247,16 +2247,17 @@
auth_use
+r
= refre
|
512f8a09798eb79528ea6f8a59ec752f2c4ba879 | missing output value | lib/svtplay_dl/service/oppetarkiv.py | lib/svtplay_dl/service/oppetarkiv.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import re
import copy
import hashlib
from urllib.parse import urlparse, parse_qs
from svtplay_dl.service import Service, OpenGraphThumbMixin
from svtplay_dl.error import ServiceError
from svt... | Python | 0.999983 | @@ -1780,102 +1780,8 @@
s%22:%0A
- streams = hlsparse(self.config, self.http.request(%22get%22, i%5B%22url%22%5D), i%5B%22url%22%5D)%0A
@@ -1888,32 +1888,146 @@
ield streams%5Bn%5D%0A
+ streams = hlsparse(self.config, self.http.request(%22get%22, i%5B%22url%22%5D), i%5B%22url%22%5D... |
38989bf6e449bf2ada1ac4729564d9feacbc7b90 | use parseargs for cli processing | activity/activitylog.py | activity/activitylog.py | from peewee import *
from pprint import pprint
from copy import copy
import sys, getopt, os, inspect
db = SqliteDatabase('activitylog.db')
################
# Model classes
################
class BaseModel(Model):
is_abstract = BooleanField(default=False)
class Meta:
database = db
class NamedModel(B... | Python | 0 | @@ -77,16 +77,8 @@
sys,
- getopt,
os,
@@ -85,16 +85,48 @@
inspect
+%0Aimport optparse%0Aimport argparse
%0A%0Adb = S
@@ -1256,80 +1256,100 @@
-try:%0A opts, args = getopt.getopt(argv, %22%22, %5B%22list=%22, %22
+args = parse_args();%0A%0A if args.list:%0A lsModel(args.list)%0A elif (arg... |
4e7c07d1cf1c00a0ff166fb8f314b684bbefc339 | Add more customizations | graphics/wheel.py | graphics/wheel.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Wheel plot that shows continuous data in radial axes.
"""
import numpy as np
import sys
from collections import OrderedDict
from itertools import groupby
from jcvi.graphics.base import plt, savefig, normalize_axes, set2
from jcvi.apps.base import OptionParser, Actio... | Python | 0 | @@ -264,14 +264,8 @@
axes
-, set2
%0Afro
@@ -1661,13 +1661,11 @@
ze=%22
-10x10
+5x5
%22)%0A%0A
@@ -2355,16 +2355,17 @@
15928%22%5D%0A
+%0A
# Ba
@@ -2681,16 +2681,42 @@
upings)%0A
+ collapsed_groups = %5B%5D%0A
gg =
@@ -2716,18 +2716,18 @@
gg =
-%7B%7D
+%5B%5D
%0A for
@@ -2831,21 +2831,59 @@
... |
4565c961eca6f0d904d010cbdbf3d42fe2a6080b | Add persistence test | test/rlite.py | test/rlite.py | # coding=utf-8
from unittest import *
import hirlite
import sys
class RliteTest(TestCase):
def setUp(self):
self.rlite = hirlite.Rlite()
def test_none(self):
self.assertEquals(None, self.rlite.command('get', 'hello'))
def test_ok(self):
self.assertEquals(True, self.rlite.command(... | Python | 0.00001 | @@ -38,23 +38,23 @@
%0Aimport
-hirlite
+os.path
%0Aimport
@@ -58,16 +58,32 @@
rt sys%0A%0A
+import hirlite%0A%0A
%0Aclass R
@@ -916,8 +916,590 @@
, '3'%5D)%0A
+%0A%0Aclass PersistentTest(TestCase):%0A PATH = 'rlite.rld'%0A def setUp(self):%0A if os.path.exists(PersistentTest.PATH):%0A os.... |
7c24e0c3670a9d63478d0c8a095eef78f2a75142 | Print output of git.pull() | clowder/utility/git_utilities.py | clowder/utility/git_utilities.py | """Git utilities"""
import os, sys
from git import Repo
from termcolor import colored, cprint
# Disable errors shown by pylint for sh.git
# pylint: disable=E1101
def git_clone_url_at_path(url, repo_path):
"""Clone git repo from url at path"""
if not os.path.isdir(os.path.join(repo_path, '.git')):
if n... | Python | 0.99994 | @@ -2145,24 +2145,30 @@
s')%0A
+print(
git.pull()%0A
@@ -2161,24 +2161,25 @@
t(git.pull()
+)
%0A else:%0A
@@ -2693,24 +2693,30 @@
anges')%0A
+print(
git.pull()%0A%0A
@@ -2713,16 +2713,17 @@
t.pull()
+)
%0A%0Adef gi
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.