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 |
|---|---|---|---|---|---|---|---|
207fbc64fc9001abc62d0e687beefb3e3a25ef73 | fix exception error | orator/exceptions/orm.py | orator/exceptions/orm.py | # -*- coding: utf-8 -*-
class ModelNotFound(RuntimeError):
def __init__(self, model):
self._model = model
self.message = 'No query results found for model [%s]' % self._model.__name__
def __str__(self):
return self.message
class MassAssignmentError(RuntimeError):
pass
class ... | Python | 0.000054 | @@ -587,24 +587,16 @@
r):%0A
-default_
detail =
@@ -668,24 +668,28 @@
f detail is
+not
None:%0A
@@ -711,51 +711,8 @@
il =
- self.default_detail if detail is None else
det
|
a26ad106dba7ce2f00a0b9438629abf32a15a061 | Improve reliability of test by clearing cache | orgviz/tests/test_web.py | orgviz/tests/test_web.py | import os
import tempfile
import shutil
import unittest
import textwrap
import json
import datetime
from .. import web
TMP_PREFIX = 'orgviz-test-'
def totimestamp(dt):
zero = datetime.datetime.fromtimestamp(0)
return (dt - zero).total_seconds()
class TestWebEventsData(unittest.TestCase):
@classmethod... | Python | 0.000001 | @@ -636,16 +636,64 @@
mpdir)%0A%0A
+ def setUp(self):%0A web.cache.clear()%0A%0A
def
|
82c0698a0d1ff39a18a6ba7192a18e6f08c8aa77 | add define_martian_year | planet4/stats.py | planet4/stats.py | import numpy as np
from math import pi
tau = 2 * pi
def get_fan_and_blotch_nunique_cids(data):
f1 = data.marking == 'fan'
f2 = data.marking == 'blotch'
return data[f1 | f2].classification_id.nunique()
def get_fb_to_all_ratio(data):
n_classifications = data.classification_id.nunique()
n_class_fb ... | Python | 0.000134 | @@ -1,55 +1,352 @@
-import numpy as np%0Afrom math import pi%0Atau = 2 * pi
+from math import tau%0A%0Aimport numpy as np%0Aimport pandas as pd%0Afrom pandas import to_datetime%0A%0Amars_years = %7B28: %222006-01-23%22,%0A 29: %222007-12-10%22,%0A 30: %222009-10-27%22,%0A 31: %222... |
8fa744582291aa45fcc5c8101b8f2c24744a399f | Fix #67 - print error message and exit when started without params. | sacredboard/bootstrap.py | sacredboard/bootstrap.py | # coding=utf-8
"""
Bootstrap module parses command line arguments and initializes the app.
Configures the database connection and starts the web application.
"""
import locale
import sys
import click
from flask import Flask
from gevent.pywsgi import WSGIServer
from sacredboard.app.config import jinja_filters
from sa... | Python | 0 | @@ -3305,17 +3305,19 @@
ance or
-%5C
+%22 +
%0A
@@ -3323,18 +3323,17 @@
-
+%22
a path t
@@ -3349,17 +3349,117 @@
storage.
-%22
+%5CnRun sacredboard --help %22%0A %22for more information.%22, file=sys.stderr)%0A sys.exit(1
)%0A%0A a
|
b1d52ad5318532fa07112ab6165099e958008fda | fix a little bug in coco datasets loader | mmdet/datasets/coco.py | mmdet/datasets/coco.py | import numpy as np
from pycocotools.coco import COCO
from .custom import CustomDataset
class CocoDataset(CustomDataset):
CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic_light', 'fire_hydrant',
'stop_sign', 'parking_meter', ... | Python | 0.000001 | @@ -1905,16 +1905,31 @@
ann_info
+,self.with_mask
)%0A%0A d
|
0cbb38671098b938ce7f6cf66543cb7155a66b7b | Add note about default permissions of files.write() | osgtest/library/files.py | osgtest/library/files.py | """
Functions for dealing with writing and tracking of files.
The most important part of this module is the backup mechanism.
Backups are identified by a (filepath, owner) pair--where owner is an
arbitraty string identifying the test component responsible for the file,
specifically its cleanup.
preserve() does the ba... | Python | 0.000001 | @@ -3061,16 +3061,233 @@
backup.
+%0A%0A NOTE: If the file doesn't exist, the default permissions are '0600' and%0A owned by root/root. Make sure to properly set the permissions of the file%0A afterwards if you need specific permissions or ownership.
%0A %22%22%22
|
79c8707965603551b1ff386c17d99467f48b6035 | determine units of loaded SVG and also scale the display units | svg2plt.py | svg2plt.py | import xml.dom.minidom
import re
from svg.path import parse_path
class SVG2PLT:
# the plt code to output
plt = ''
delimiter = 'z' # path delimiter (mM -> zZ)
# factors to transform the SVG as it is read
scale = 1.0
x_offset = 0.0
y_offset = 0.0
divisions = 30.0 # the number of point divisions on an e... | Python | 0 | @@ -1519,16 +1519,20 @@
nd(%22in%22)
+!=-1
):%0A%09%09%09se
@@ -1579,16 +1579,20 @@
nd(%22mm%22)
+!=-1
):%0A%09%09%09se
@@ -1639,16 +1639,20 @@
nd(%22cm%22)
+!=-1
):%0A%09%09%09se
@@ -1675,16 +1675,76 @@
= %22cm%22%0A
+%09%09elif(height.find(%22px%22)!=-1):%0A%09%09%09self.display_units = %22px%22%0A
%09%09%09... |
8a71e75501bc7965df86f4e31ffb200edba876ee | Change history API endpoints so we can get the main page's history. | wikked/views/history.py | wikked/views/history.py | import os.path
from flask import g, jsonify, request, abort
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import get_formatter_by_name
from wikked.page import PageLoadingError
from wikked.scm.base import ACTION_NAMES
from wikked.utils import PageNotFoundError
from... | Python | 0 | @@ -1876,24 +1876,29 @@
route('/api/
+site-
history')%0Ade
@@ -2139,32 +2139,153 @@
onify(result)%0A%0A%0A
+@app.route('/api/history/')%0Adef api_main_page_history():%0A return api_page_history(g.wiki.main_page_url.lstrip('/'))%0A%0A%0A
@app.route('/api
|
6147a5229f67874179f371ded2e835c318a2bd56 | correct prob formulation for secondary user beamforming | examples/secondary_user_beamforming.py | examples/secondary_user_beamforming.py | #!/usr/bin/python
# Secondary user multicast beamforming
# minimize ||w||^2
# subject to |h_i^H w|^2 >= tau
# |g_i^H w|^2 <= eta
# with variable w in complex^n
import numpy as np
import cvxpy as cvx
import qcqp
n = 10
m = 8
l = 2
tau = 10
eta = 1
np.random.seed(1)
H = np.random.randn(m, n)
G = np.... | Python | 0 | @@ -170,16 +170,151 @@
omplex%5En
+.%0A# Data vectors h_i and g_i are also in complex%5En.%0A# The script below expands out the complex part and%0A# works with real numbers only.
%0A%0Aimport
@@ -359,16 +359,39 @@
t qcqp%0A%0A
+# n, m, l: 100, 30, 10%0A
n = 10%0Am
@@ -397,9 +397,9 @@
m =
-8
+3
%0Al =
@@ -439,16 ... |
183e08be99fae2ba521c5fb60b7205d3c3c5b520 | Add grappelli styles to make inlines collapsible | winthrop/books/admin.py | winthrop/books/admin.py | from django.contrib import admin
from winthrop.common.admin import NamedNotableAdmin
from .models import Subject, Language, Publisher, OwningInstitution, \
Book, Catalogue, BookSubject, BookLanguage, CreatorType, Creator, \
PersonBook, PersonBookRelationshipType
class NamedNotableBookCount(NamedNotableAdmin)... | Python | 0 | @@ -648,24 +648,195 @@
'notes')%0A%0A%0A
+class CollapsibleTabularInline(admin.TabularInline):%0A 'Django admin tabular inline with grappelli collapsible classes added'%0A classes = ('grp-collapse grp-open',)%0A%0A%0A
class Catalo
@@ -837,38 +837,43 @@
CatalogueInline(
-admin.
+Collapsible
TabularInline):%0A... |
f0fab0c0add34e6b74583f524c86a3b42a7c7c54 | remove 'fml' | plugins/games.py | plugins/games.py | """
games.py: Create a bot that provides game functionality (dice, 8ball, etc).
"""
import random
import urllib.request
import urllib.error
from xml.etree import ElementTree
from pylinkirc import utils
from pylinkirc.log import log
mydesc = "The \x02Games\x02 plugin provides simple games for IRC."
gameclient = utils... | Python | 0 | @@ -17,161 +17,63 @@
eate
+s
a bot
-that
provid
-es game functionality (dice, 8ball, etc).%0A%22%22%22%0Aimport random%0Aimport urllib.request%0Aimport urllib.error%0Afrom xml.etree import ElementTree
+ing a few simple games.%0A%22%22%22%0Aimport random
%0A%0Afr
@@ -2325,1481 +2325,8 @@
')%0A%0A
-def fml(irc, s... |
850cc5b6401fd4d72e69b1f52050bfeef28e2132 | add room configuration, groupchat and some clean up, still needs documentation and a bit more stuff to add re #24 | wokkel/test/test_muc.py | wokkel/test/test_muc.py | # Copyright (c) 2003-2008 Ralph Meijer
# See LICENSE for details.
"""
Tests for L{wokkel.muc}
"""
from zope.interface import verify
from twisted.trial import unittest
from twisted.internet import defer
from twisted.words.xish import domish, xpath
from twisted.words.protocols.jabber import error
from twisted.words.pr... | Python | 0 | @@ -1397,16 +1397,883 @@
ocol)%0A%0A%0A
+ def test_presence(self):%0A %22%22%22Test receiving room presence%0A %22%22%22%0A p = muc.UserPresence()%0A%09%0A def userPresence(prs):%0A self.failUnless(len(prs.children)==1, 'Not enough children')%0A self.failUnless(geta... |
46d58dc9ae6db2dc8566cbc7bc9cc1399283f90f | Fix OSError when roots file hash hasn't been built | salt/fileserver/roots.py | salt/fileserver/roots.py | '''
The default file server backend
Based on the environments in the :conf_master:`file_roots` configuration
option.
'''
# Import python libs
import os
# Import salt libs
import salt.fileserver
import salt.utils
def find_file(path, env='base', **kwargs):
'''
Search the environment for the relative path
... | Python | 0 | @@ -2001,24 +2001,25 @@
return ret%0A%0A
+%0A
def update()
@@ -2103,24 +2103,37 @@
che%0A '''%0A
+ try:%0A
salt.fil
@@ -2166,16 +2166,29 @@
che_dir(
+%0A
os.path.
@@ -2232,19 +2232,143 @@
h'),
- find_file)
+%0A find_file%0A )%0A except os.error:%0A # Hash fil... |
4745f1a0dd24913869daf641fc5c920561279aef | fix Python tests compute_dt_matrices call to Interaction constructor | wrap/utils/functions.py | wrap/utils/functions.py | """Set of functions used in python tests"""
import siconos.kernel as SK
import numpy as np
def compute_dt_matrices(A, B, h, TV=False):
# variable declaration
t0 = 0.0 # start time
T = 1 # end time
n, m = B.shape
# Matrix declaration
x0 = np.random.random(n)
Csurface = np.random.random(... | Python | 0.000004 | @@ -1074,19 +1074,16 @@
raction(
-m,
nslaw, r
|
4b0d846fc782ad80399adcbeb6bbea725e0b68f5 | Fix find and read up | salt/wheel/file_roots.py | salt/wheel/file_roots.py | '''
Read in files from the file_root and save files to the file root
'''
# Import python libs
import os
# Import salt libs
import salt.utils
def find(path, env='base'):
'''
Return a dict of the files located with the given path and environment
'''
# Return a list of paths + text or bin
ret = []
... | Python | 0 | @@ -547,20 +547,20 @@
th open(
-path
+full
, 'rb')
@@ -2134,14 +2134,69 @@
-if fn_
+full = fn_.keys()%5B0%5D%0A form = fn_%5Bfull%5D%0A if form
==
@@ -2225,18 +2225,19 @@
h open(f
-n_
+ull
, 'rb')
@@ -2273,18 +2273,19 @@
ppend(%7Bf
-n_
+ull
: fp_.re
|
a40c80eea715626616ef280b87de6bbcc7b73b7f | use relative imports | transport_information/model/__init__.py | transport_information/model/__init__.py | # -*- coding: utf-8 -*-
import transport_mode
import transport_vehicle
| Python | 0.000001 | @@ -17,16 +17,23 @@
f-8 -*-%0A
+from .
import t
@@ -46,16 +46,23 @@
rt_mode%0A
+from .
import t
|
08cf82852ab19417f9521af45f2fb296d9e223d6 | Update batch processing example | batch_eg.py | batch_eg.py | """Example of using nbparameterise API to substitute variables in 'batch mode'
"""
from nbparameterise import code
from IPython.nbformat import current as nbformat
from IPython.nbconvert.preprocessors.execute import ExecutePreprocessor
from IPython.nbconvert.exporters.notebook import NotebookExporter
from IPython.nbco... | Python | 0 | @@ -113,47 +113,14 @@
ode%0A
-from IPython.nbformat import current as
+import
nbf
@@ -126,32 +126,24 @@
format%0Afrom
-IPython.
nbconvert.pr
@@ -190,32 +190,24 @@
cessor%0Afrom
-IPython.
nbconvert.ex
@@ -256,16 +256,8 @@
rom
-IPython.
nbco
@@ -399,15 +399,20 @@
(f,
-'ipynb'
+as_version=4
)%0A%0Ad
@@ -106... |
97939c334543d9ca4d717a7bc75ae30e848c8a09 | Replace native.git_repository with skylark rule | bazlets.bzl | bazlets.bzl | NAME = "com_googlesource_gerrit_bazlets"
def load_bazlets(
commit,
local_path = None):
if not local_path:
native.git_repository(
name = NAME,
remote = "https://gerrit.googlesource.com/bazlets",
commit = commit,
)
else:
native.local_rep... | Python | 0.000381 | @@ -1,12 +1,83 @@
+load(%22@bazel_tools//tools/build_defs/repo:git.bzl%22, %22git_repository%22)%0A%0A
NAME = %22com_
@@ -199,23 +199,16 @@
-native.
git_repo
|
36cc738308b8ae4435d6becac38fa3c4e96dc491 | Remove useless code | patchboard/patchboard.py | patchboard/patchboard.py | # patchboard.py
#
# Copyright 2014 BitVault.
from __future__ import print_function
import json
from api import API
from schema_manager import SchemaManager
from client import Client
from util import to_camel_case
def discover(url):
"""
Retrieve the API definition from the given URL and construct
a Pa... | Python | 0.001027 | @@ -93,16 +93,46 @@
t json%0A%0A
+from resource import Resource%0A
from api
@@ -1745,200 +1745,42 @@
= (
-object,)%0A # TODO: fill in stub class definition%0A class_body = %22%22%22%0Adef __init__(self):%0A pass%0A %22%22%22%0A class_dict = %7B%7D%0A exec(class_body, globals(),... |
382a715ec78d9bcc53e949e9536bdb1077d3ed98 | Update docstring | pathvalidate/__init__.py | pathvalidate/__init__.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
import re
import dataproperty
__INVALID_PATH_CHARS = '\:*?"<>|'
def validate_filename(filename):
"""
:param str filename: Filename to validate.
:raises ValueError:
If ``filename`` is empty or include invalid cha... | Python | 0.000001 | @@ -269,16 +269,20 @@
If
+the
%60%60filena
@@ -305,16 +305,17 @@
include
+s
invalid
@@ -319,16 +319,20 @@
lid char
+(s):
%0A
@@ -777,24 +777,276 @@
t_text=%22%22):%0A
+ %22%22%22%0A Replace invalid chars within the %60%60filename%60%60 with%0A the %60%60replacement_text%60%60.%0A%0A :... |
8065d5677e63d17a231e362115738bc278f00a77 | Add new tests cases for signature and orders parsing. | payu/tests/test_forms.py | payu/tests/test_forms.py | import pytest
from payu.forms import PayULiveUpdateForm, OrdersField
@pytest.mark.parametrize("payload,signature", [
({
'ORDER_REF': 112457,
'ORDER_DATE': '2012-05-01 15:51:35',
'ORDER': [
{
'PNAME': 'MacBook Air 13 inch',
'PCODE': 'MBA13',
... | Python | 0 | @@ -896,270 +896,9 @@
96')
-%0A%5D)%0Adef test_calculate_correct_hash(payload, signature):%0A payu_form = PayULiveUpdateForm(initial=payload)%0A assert payu_form.signature == signature%0A assert payu_form.fields%5B'ORDER_HASH'%5D.initial == signature%0A%0A%0A@pytest.mark.parametrize(%22payload,orders%22, %5B
... |
ace0fa76496fe59f38debf858d9ad24ace69882a | remove the expm_multiply from linalg because I am too noob at python to figure out the cyclic import issues | scipy/linalg/__init__.py | scipy/linalg/__init__.py | """
====================================
Linear algebra (:mod:`scipy.linalg`)
====================================
.. currentmodule:: scipy.linalg
Linear algebra functions.
.. seealso::
`numpy.linalg` for more linear algebra functions. Note that
although `scipy.linalg` imports most of them, identically named... | Python | 0 | @@ -3347,72 +3347,8 @@
ial%0A
- expm_multiply - Product of a matrix exponential and a matrix%0A
%0A%0AMa
@@ -4954,54 +4954,8 @@
rt *
-%0Afrom scipy.sparse.linalg import expm_multiply
%0A%0A__
|
3064bdeaf75a0bec4644340fe06a7bac07bb2e7c | Fix pydocstyle | f8a_jobs/handlers/invoke_graph_sync.py | f8a_jobs/handlers/invoke_graph_sync.py | """Sync all pending packages to Graph DB."""
from os import environ
import urllib
import concurrent.futures
import requests
from .base import BaseHandler
class InvokeGraphSync(BaseHandler):
"""Sync all finished analyses to Graph DB."""
_SERVICE_HOST = environ.get("BAYESIAN_DATA_IMPORTER_SERVICE_HOST", "bay... | Python | 0.000488 | @@ -2414,25 +2414,24 @@
atabase.%22%22%22%0A
-%0A
# fe
|
58d701a99eae46464c280478a7949f964e05f3d2 | Load testing database URI from environmental variable if set | portal/config.py | portal/config.py | """Configuration"""
import os
from flask.ext.script import Server
from flask import Config
class BaseConfig(object):
"""Base configuration - override in subclasses"""
ANONYMOUS_USER_ACCOUNT = True
CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_IMPORTS = ('portal.tasks', )
CELERY_RESULT_BACK... | Python | 0 | @@ -1548,17 +1548,67 @@
SE_URI =
-%5C
+ os.environ.get(%0A 'SQLALCHEMY_DATABASE_URI',
%0A
@@ -1673,16 +1673,23 @@
_tests'%0A
+ )%0A%0A
WTF_
|
798639f4d22bec341667a4067db7a18095d36beb | Add missing doc string values. | flask_jsondash/data_utils/wordcloud.py | flask_jsondash/data_utils/wordcloud.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
flask_jsondash.data_utils.wordcloud
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities for working with wordcloud formatted data.
:copyright: (c) 2016 by Chris Tabor.
:license: MIT, see LICENSE for more details.
"""
from collections import Counter
# Py2/3 compat.
try:
... | Python | 0.000001 | @@ -2111,16 +2111,81 @@
d cloud.
+%0A%0A Returns:%0A list: A list of dicts w/ appropriate keys.
%0A %22%22%22
|
584e5edc27d8f63f3d780ba72abdd30e4781cb3e | fix FeaturedTheme icon, set icon_src for all text_enabled plugins | foundation/organisation/cms_plugins.py | foundation/organisation/cms_plugins.py | from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from cms.extensions.extension_pool import extension_pool
from sorl.thumbnail import get_thumbnail
from .models import (Project, Theme, ... | Python | 0.000002 | @@ -1,12 +1,45 @@
+from django.conf import settings%0A
from django.
@@ -271,50 +271,8 @@
ol%0A%0A
-from sorl.thumbnail import get_thumbnail%0A%0A
from
@@ -799,93 +799,72 @@
-im = get_thumbnail(instance.theme.picture, '50x50', quality=99)%0A return im.url
+return settings.STATIC_URL + %22cms/img/icons/pl... |
e442f6874d71bf876116da6add66b0f099c0887f | Fix Tempy Factory parser with void tags | tempy/t.py | tempy/t.py | # -*- coding: utf-8 -*-
# @author: Federico Cerchiari <federicocerchiari@gmail.com>
import importlib
from html.parser import HTMLParser
from .elements import Tag, VoidTag, TagAttrs
class TempyParser(HTMLParser):
"""Custom parser used to translate an html into Tempy Tags.
See https://docs.python.org/3/library/... | Python | 0 | @@ -1725,16 +1725,56 @@
else:%0A
+ if not tempy_tag._void:%0A
@@ -1797,32 +1797,36 @@
_tag(tempy_tag)%0A
+
self
|
57a263f8671afd0c0b05443acb192bcccaf3eef7 | Remove remote_field from guardian.compat (Django < 1.9) | guardian/compat.py | guardian/compat.py | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import handler404, handler500, include, url
from django.contrib.auth.models import AnonymousUser, Group, Permission
from importlib import import_module
import django
import six
import sys
__all__ = [
'User',
'Group... | Python | 0 | @@ -3947,29 +3947,29 @@
%0Adef remote_
-fi
+mod
el
-d
(field):%0A
@@ -3973,289 +3973,81 @@
-%22%22%22%0A https://docs.djangoproject.com/en/1.9/releases/1.9/#field-rel-changes%0A %22%22%22%0A if django.VERSION %3C (1, 9):%0A return field.rel%0A return field.remote_field%0A%0A%0Adef remote_... |
253361e56ad2b1e331691f0bf3c9010c22c0c9aa | Fix tests | test/test_blacklists.py | test/test_blacklists.py | #!/usr/bin/env python3
from glob import glob
from helpers import only_blacklists_changed
def test_blacklist_integrity():
for bl_file in glob('bad_*.txt') + glob('blacklisted_*.txt'):
with open(bl_file, 'r') as lines:
seen = dict()
for lineno, line in enumerate(lines, 1):
... | Python | 0.000003 | @@ -985,18 +985,28 @@
%22%22%22
-helpers.py
+watched_keywords.txt
%0A
@@ -1036,31 +1036,24 @@
-test/test_blacklists.py
+bad_keywords.txt
%0A
@@ -1095,15 +1095,14 @@
ted_
-usernam
+websit
es.t
@@ -1194,77 +1194,72 @@
%22%22%22
-blacklisted_websites.txt%0A watched_keywords.txt%0A... |
e13cfe7a7e215f43e8210fb6d116ccafe80c8756 | fix names of functions | gary/observation/tests/test_rrlyrae.py | gary/observation/tests/test_rrlyrae.py | # coding: utf-8
"""
Test the RR Lyrae helper functions.
"""
from __future__ import absolute_import, unicode_literals, division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import astropy.units as u
import numpy as np
import pytest
from ..core imp... | Python | 0.999104 | @@ -424,25 +424,38 @@
rrs = gaia_r
-v
+adial_velocity
_error(d)%0A%0Ad
@@ -533,25 +533,36 @@
rrs = gaia_p
-m
+roper_motion
_error(d)%0A%0A
|
9681ad615487c282a70e85ded1e3020bc47e71bf | modify demonstration.py | scripts/demonstration.py | scripts/demonstration.py | #!/usr/bin/env python
from SPyFFI.Observation import Observation, default
# initialize to default settings
inputs = default
'''
------------_--------------_--------------_--------------_--------------_-------
"camera" inputs change many of the basics of the observations.
------------_--------------_--------------_--... | Python | 0.000001 | @@ -4582,16 +4582,171 @@
:None%7D%0A%0A
+# a dictionary, like those above%0A# should exposures of a particular cadence be compressed?%0Ainputs%5B'expose'%5D%5B'compress'%5D = %7B2:True, 120:True, 1800:False%7D%0A%0A%0A
%0A%0A'''%0A--
|
ff2cfb51b1fa30d0103bc782843f69fea08e0d51 | Fix formatting for table declaration | girder/utility/assetstore_utilities.py | girder/utility/assetstore_utilities.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | Python | 0.000042 | @@ -1067,16 +1067,21 @@
able = %7B
+%0A
Assetsto
@@ -1124,39 +1124,24 @@
oreAdapter,%0A
-
Assetsto
@@ -1180,31 +1180,16 @@
dapter,%0A
-
Asse
@@ -1222,16 +1222,17 @@
eAdapter
+%0A
%7D%0A%0A%0Adef
|
0cafc534c1b0398c47fbdb279df196e02e68fb11 | Fix decoding of PID in URLs | gmn/src/d1_gmn/app/views/decorators.py | gmn/src/d1_gmn/app/views/decorators.py | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... | Python | 0.000266 | @@ -2884,18 +2884,16 @@
gs):%0A
- #
return
@@ -2958,24 +2958,26 @@
*kwargs)%0A
+ #
return f(re
|
38e224c282c62ad358c753eb707cf71ad1f00aff | fix os x gyp settings | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "detection",
"sources": [
"src/detection.cpp",
"src/detection.h",
"src/deviceList.cpp"
],
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="win"',
{
'source... | Python | 0 | @@ -577,24 +577,119 @@
on_mac.cpp%22%0A
+ %5D,%0A %22libraries%22: %5B%0A %22-framework%22, %0A %22IOKit%22%0A
|
de0180ccccdd3e2b83c6a7188fd2688c64c70580 | add rpath linker option in binding.gyp when --sqlite option is used with a custom sqlite | binding.gyp | binding.gyp | {
'includes': [ 'deps/common-sqlite.gypi' ],
'variables': {
'sqlite%':'internal',
},
'targets': [
{
'target_name': 'node_sqlite3',
'conditions': [
['sqlite != "internal"', {
'libraries': [
'-L<@(sqlite)/lib',
'-lsqlite3'
],
... | Python | 0 | @@ -359,16 +359,111 @@
include'
+ %5D,%0A 'conditions': %5B %5B 'OS==%22linux%22', %7B'libraries+':%5B'-Wl,-rpath=%3C@(sqlite)/lib'%5D%7D %5D
%5D%0A
|
c908f4f9b602dcfea81847144cfd4e43fe308798 | Bump OSX minimum to 10.11 | binding.gyp | binding.gyp | {
'variables': {
'libsass_ext%': '',
},
'targets': [
{
'target_name': 'binding',
'win_delay_load_hook': 'true',
'sources': [
'src/binding.cpp',
'src/create_string.cpp',
'src/custom_function_bridge.cpp',
'src/custom_importer_bridge.cpp',
'src/sass... | Python | 0.000015 | @@ -954,9 +954,10 @@
'10.
-7
+11
'%0A
|
3fe8dd01906fe2d8e3e52b537acd34f65073ca01 | remove the cflags | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "objc",
"sources": [
"src/binding/objc.cc",
"src/binding/Proxy.cc",
"src/binding/utils.cc",
"src/binding/Invocation.cc",
"src/binding/constants.cpp"
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
... | Python | 0.998747 | @@ -320,82 +320,8 @@
%5D,%0A
- %22cflags%22: %5B%0A %22-std=c++14%22,%0A %22-stdlib=libc++%22%0A %5D,%0A
|
0a90376144ee5568e6e140cbf657d7e85070f1f1 | remove the matplotlib agg setting | tests/base/test_view.py | tests/base/test_view.py | from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import unittest
import numpy as np
import matplotlib.pyplot as plt
import discretize
from discretize import Tests, utils
import warnings
import pytest
np.random.seed(16)
TOL = 1e-1
class Cyl3DView(unittest.TestCase):
def setUp(self... | Python | 0.000001 | @@ -52,30 +52,8 @@
tlib
-%0Amatplotlib.use('Agg')
%0A%0Aim
|
a114325be4f81cd34438f96fbc134a7881d5fe7a | Add link to get_input_var_names | bmi/vars.py | bmi/vars.py | #! /usr/bin/env python
class BmiVars(object):
"""Defines an interface for converting a standalone model into an
integrated modeling framework component.
"""
def get_var_type(self, long_var_name):
"""Returns the type of the given variable.
Parameters
----------
long_va... | Python | 0.000001 | @@ -2082,16 +2082,169 @@
ifier.%0A%0A
+ See Also%0A --------%0A bmi.info.BmiInfo.get_input_var_names : Get %60long_var_name%60 from this method or from **get_output_var_names**.%0A%0A
|
390059007169b964649b3ec8af84503b38e41e97 | refactor date formatting | postweb/utils.py | postweb/utils.py | import bleach
from django.conf import settings
import dateutil.parser
import markdown
markdown = markdown.Markdown()
# Tags suitable for rendering markdown
# From https://github.com/yourcelf/bleach-allowlist/blob/main/bleach_allowlist/bleach_allowlist.py
MARKDOWN_TAGS = [
"h1",
"h2",
"h3",
"h4",
... | Python | 0.000001 | @@ -680,16 +680,65 @@
%22%5D,%0A%7D%0A%0A%0A
+PREFERRED_DATE_FORMAT = %22%25a %25b %25d %25Y %25I:%25M %25p%22%0A%0A%0A
def serv
@@ -1552,38 +1552,37 @@
trftime(
-%22%25a %25b %25d %25Y %25I:%25M %25p%22
+PREFERRED_DATE_FORMAT
)%0A%0A%0Adef
|
d0ac7153cd9a88c5a9c6edef4f6d415b4d88143b | make admin classes overridable | pinax/referrals/admin.py | pinax/referrals/admin.py | from django.contrib import admin
from .models import Referral, ReferralResponse
admin.site.register(
Referral,
list_display=[
"user",
"code",
"label",
"redirect_to",
"target_content_type",
"target_object_id"
],
readonly_fields=["code", "created_at"],
... | Python | 0.000001 | @@ -75,27 +75,24 @@
sponse%0A%0A
+%0A@
admin.
-site.
register
@@ -96,22 +96,56 @@
ter(
-%0A Referral,
+Referral)%0Aclass ReferralAdmin(admin.ModelAdmin):
%0A
@@ -149,33 +149,35 @@
list_display
-=
+ =
%5B%0A %22user%22
@@ -293,25 +293,24 @@
ct_id%22%0A %5D
-,
%0A readonl
@@ -317,17 +317,... |
5623eb94b0114c011bc5f9df62c1fc1dd6751b6a | Fix some compatibily issue | EMSL_api.py | EMSL_api.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""EMSL Api.
Usage:
EMSL_api.py list_basis [--basis=<basis_name>...]
[--atom=<atom_name>...]
[--db_path=<db_path>]
[--average_mo_number]
EMSL_api.py list_atoms --basis=<basis_name>
... | Python | 0.001068 | @@ -2649,13 +2649,15 @@
- '%7B
+0
%7D' (%7B
+1
%7D) %7C
@@ -2762,16 +2762,17 @@
nt %22- '%7B
+0
%7D' %7C%7C %7B:
|
042085d6bc964b66086dd0d6931e4ae327833369 | fix some pylint complains | yaranullin/framework.py | yaranullin/framework.py | # yaranullin/framework.py
#
# Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE... | Python | 0.000017 | @@ -940,20 +940,8 @@
ect%0A
-import time%0A
impo
@@ -982,17 +982,31 @@
import
-*
+TICK, ANY, QUIT
%0A%0A%0A_QUEU
@@ -1029,17 +1029,16 @@
deque()%0A
-%0A
_EVENTS
@@ -1042,17 +1042,16 @@
TS = %7B%7D%0A
-%0A
_EVENTS%5B
@@ -1708,16 +1708,18 @@
for ev
+nt
, handle
@@ -1733,32 +1733,32 @@
EVENTS.items():%0A
-... |
51cf3706504adb6b1772b491c6d9d612a64e49ab | fix check mention | yubari/bots/qq_watch.py | yubari/bots/qq_watch.py | #!/usr/bin/env python
# coding: utf-8
import time
import logging
from yubari.config import QQ_GROUP, MENTION_NAME
from yubari.lib.qq import qqbot
logger = logging.getLogger(__name__)
def run():
continue_count = 0
last_msg = ""
last_call = 0
for msg in qqbot.poll():
logger.info(msg)
... | Python | 0 | @@ -108,17 +108,24 @@
ION_NAME
+, QQ_ME
%0A
-
from yub
@@ -189,16 +189,150 @@
me__)%0A%0A%0A
+def check_mention_self(content):%0A for word in MENTION_NAME:%0A if word in content:%0A return True%0A return False%0A%0A%0A
def run(
@@ -500,70 +500,40 @@
-for word in MENTION_NAME:%0A ... |
0420ecadeb3632b853510c35e8c557fcf204827f | Use stream ID for sender's default sending stream. | zerver/lib/addressee.py | zerver/lib/addressee.py |
from typing import Iterable, List, Optional, Sequence, Union, cast
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from zerver.lib.exceptions import JsonableError
from zerver.lib.request import JsonableError
from zerver.models import (
Realm,
UserProfile,
... | Python | 0 | @@ -4560,20 +4560,18 @@
_stream.
-name
+id
%0A
|
cf9c7f2f020121c3a4272dd58c8c62baee8679b9 | fix typo | src/py/gopythongo/assemblers/django.py | src/py/gopythongo/assemblers/django.py | # -* encoding: utf-8 *-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import base64
import shutil
import os
from typing import Any, Type
import configargparse
fro... | Python | 0.999991 | @@ -5875,16 +5875,17 @@
path.exi
+s
ts(os.pa
|
eda12e10ae41dce8a34903709afb7a0c73fcd3e2 | Add dict merging and fix wrapped | src/server/blueprints/rest/restutil.py | src/server/blueprints/rest/restutil.py | """
Utilities specific to REST blueprints.
"""
from enum import Enum
from util import get_current_app
from functools import wraps
import re
class ClientType(str, Enum):
BROWSER = "browser" # most useful in debug
CURL = "cURL" # also useful in debug
OTHER = "other" # usually production apps
browsers =... | Python | 0 | @@ -71,35 +71,105 @@
rom
-util import get_current_app
+collections.abc import MutableMapping%0Afrom util import get_current_app%0Afrom flask import Response
%0Afro
@@ -1353,135 +1353,628 @@
-merged_kwargs.update(data%5B'kwargs'%5D)%0A fn = data%5B'wrapped'%5D%0A%0A @wraps(fn)%0A def wr... |
13e22652473eac3d2b8e700f674cfcd03a5f2155 | Remove the library dependency for the cluster command. | haascli/cluster.py | haascli/cluster.py | import click
import boto3
import executor
from executor.ssh.client import RemoteCommand
class ClusterTopology(object):
@staticmethod
def parse(stack_name):
client = boto3.client('cloudformation')
client_autoscaling = boto3.client('autoscaling')
client_ec2 = boto3.client('ec2')
... | Python | 0 | @@ -2265,32 +2265,41 @@
RemoteCommand(
+%0A
topology.get_mas
@@ -2311,86 +2311,236 @@
p(),
- 'source ~/project-aws/init.sh; cd ~/project-aws; hpcc service --action start'
+%0A 'sudo bash -c %22/opt/HPCCSystems/sbin/hpcc-run.sh -a dafilesrv start%22'%0A ).start()%0A RemoteCommand(%0A top... |
77921afc66e68a65d5cd8992a49550896b491082 | Load random state test is fixed. | tests/core/test_base.py | tests/core/test_base.py | import unittest
import os
import numpy as np
from examples.game_of_life import GameOfLife, GOLExperiment
class TestCellularAutomaton(unittest.TestCase):
num_steps = 1000
num_runs = 3
def test_single_ca(self):
for i in range(self.num_runs):
ca = GameOfLife(GOLExperiment)
... | Python | 0 | @@ -2882,20 +2882,49 @@
numpy RNG state.%22)%0A
+ os.remove(%22test.ca%22)%0A
|
74ad5c935abd69b7408a0c1ba2d7cc4ed57e3bd9 | test solely running linkcheck as it requires the html to be built | tests/docs/test_docs.py | tests/docs/test_docs.py | import subprocess
import unittest
import os
import platform
class Doc_Test(unittest.TestCase):
@property
def path_to_docs(self):
dirname, file_name = os.path.split(os.path.abspath(__file__))
return dirname.split(os.path.sep)[:-2] + ["docs"]
def test_html(self):
wd = os.getcwd()
... | Python | 0 | @@ -260,24 +260,26 @@
%22docs%22%5D%0A%0A
+ #
def test_ht
@@ -283,32 +283,34 @@
_html(self):%0A
+ #
wd = os.get
@@ -310,32 +310,34 @@
os.getcwd()%0A
+ #
os.chdir(os
@@ -363,36 +363,43 @@
.path_to_docs))%0A
+ #
%0A
+ #
if platform
@@ -417,32 +417,34 @@
= %22Windows%22:%0A
+ #... |
a80ac141b7341e867f1395858e0bdccaa9a83b37 | Fix for Py2 test. | tests/filesys_test_7.py | tests/filesys_test_7.py | # -*- coding: utf-8 -*-
##==============================================================#
## SECTION: Imports #
##==============================================================#
from testlib import *
from auxly.filesys import File
##========================================... | Python | 0 | @@ -481,16 +481,17 @@
8_STR =
+u
%22%C3%81%C3%8D%C3%93%C3%9A%C3%80%C3%88%C3%8C
|
3a5b8344364306d6f4af266fb8485269bbc8383e | remove device parameter | hoomd/hpmc/pytest/test_remove_drift.py | hoomd/hpmc/pytest/test_remove_drift.py | # Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Test hoomd.hpmc.update.RemoveDrift."""
import hoomd
from hoomd.conftest import operation_pickling_check
import pytest
import hoomd.hpmc.pytest.conftest
impor... | Python | 0.000003 | @@ -1099,16 +1099,8 @@
ion(
-device,
cons
|
2f9a0e326b120b5bad886417ba338314b26da4ea | version bump to 0.4.4.1 | hangups/version.py | hangups/version.py | __version__ = '0.4.4'
| Python | 0.000001 | @@ -13,10 +13,20 @@
= '0.4.4
+.1+das7pad
'%0A
|
6f7908294cd69e419c0be3f1561febed6b673f6e | fix user feeds | muckrock/foia/feeds.py | muckrock/foia/feeds.py | """
Feeds for the FOIA application
"""
# Django
# pylint: disable=no-name-in-module
from django.contrib.auth.models import User
from django.contrib.syndication.views import Feed
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.template.defaultfilters import escape, linebreaks
... | Python | 0.000008 | @@ -3487,16 +3487,26 @@
+composer__
user=obj
@@ -3507,16 +3507,16 @@
er=obj,%0A
-
@@ -4673,25 +4673,68 @@
.filter(
-user=obj,
+%0A composer__user=obj,%0A
embargo
@@ -4739,17 +4739,17 @@
go=False
-)
+,
%0A
@@ -4745,32 +4745,33 @@
se,%0A
+)
.or... |
cc7ca20a4f86cedc4e0b20c50f6cbb9a3f512a20 | Fix FullTrigger conditions list attribute instantiation | hawkular/alerts.py | hawkular/alerts.py | """
Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
and other contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | Python | 0 | @@ -2161,33 +2161,33 @@
onditions =
-Dampening
+Condition
.list_to_obj
|
e883d625bf78c52d4f1206f13ef64e53df23c3dd | Add a tool for getting the current schema. Not sure if this could break things. Concurrency might be a bitch. | multi_schema/schema.py | multi_schema/schema.py | Python | 0.000001 | @@ -0,0 +1,257 @@
+from django.db import models%0Afrom .models import Schema%0A%0Adef get_schema():%0A cursor = models.connection.cursor()%0A cursor.execute('SHOW search_path')%0A search_path = cursor.fetchone()%5B0%5D%0A return Schema.objects.get(schema=search_path.split(',')%5B0%5D)%0A
| |
6306288b7b65481a7e0706d3515d673b2344d2f0 | Bump version | hbmqtt/__init__.py | hbmqtt/__init__.py | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
VERSION = (0, 2, 0, 'final', 0)
| Python | 0 | @@ -102,20 +102,20 @@
(0,
-2
+3
, 0, '
-final
+alpha
', 0
|
6076b6a7824072b97936aaa3da3ba1acf2bc87d6 | Bump version | mythril/__version__.py | mythril/__version__.py | """This file contains the current Mythril version.
This file is suitable for sourcing inside POSIX shell, e.g. bash as well
as for importing into Python.
"""
__version__ = "v0.21.6"
| Python | 0 | @@ -178,7 +178,7 @@
.21.
-6
+7
%22%0A
|
f7a02791db913353a7bef7afbe71d19a0bbd645b | make logging work | chatdemo.py | chatdemo.py | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | Python | 0.000001 | @@ -3796,47 +3796,8 @@
():%0A
- logging.info(%22Starting hello app%22)%0A
@@ -4305,16 +4305,56 @@
)
+%0A%0A logging.info(%22Starting hello app%22)
%0A app
|
4d072bf3e1042bd7996f54c9a173bf39ed67c283 | Remove unused imports | promgen/forms.py | promgen/forms.py | import datetime
from django import forms
from django.core.exceptions import ValidationError
from promgen import models, plugins, prometheus
class ImportConfigForm(forms.Form):
config = forms.CharField(
widget=forms.Textarea(attrs={'rows': 5, 'class': 'form-control'}),
required=False)
url = f... | Python | 0.000001 | @@ -38,59 +38,8 @@
orms
-%0Afrom django.core.exceptions import ValidationError
%0A%0Afr
@@ -75,20 +75,8 @@
gins
-, prometheus
%0A%0A%0Ac
|
4e6fd7f491adb94e2503443828bd143b17d382c5 | Fix typo | nbs/models/document.py | nbs/models/document.py | # -*- coding: utf-8 -*-
from nbs.models import db
from nbs.models.misc import TimestampMixin
class PurchaseDocument(db.Model, TimestampMixin):
__tablename__ = 'purchase_document'
__table_args__ = (
db.UniqueConstraint('pos_no', 'number', 'supplier_id'),
)
TYPE_FACTURA_A = 'TYPE_FACTURA_A'
... | Python | 0.999999 | @@ -5406,16 +5406,17 @@
quantity
+,
%0A
|
e906e108ab5118ec1c8856a54b8ebe1fd69484ac | Add shebang to and update permissions of servefiles.py | servefiles/servefiles.py | servefiles/servefiles.py | import os
import socket
import struct
import sys
import threading
import time
import urllib
try:
from SimpleHTTPServer import SimpleHTTPRequestHandler
from SocketServer import TCPServer
from urlparse import urljoin
from urllib import pathname2url, quote
except ImportError:
from http.server import SimpleHTTPReques... | Python | 0 | @@ -1,12 +1,26 @@
+#!/bin/python%0A
import os%0Aim
|
d45e2237cccf9a29db93fd485de34b9cc4dc3cfe | Update gpio.py | 02traffic_python/gpio.py | 02traffic_python/gpio.py | ##########################################################
# * Python GPIO Functions for Traffic Signal Simulation
# * using Baglebone Black running Debian 7 Linux distribution
##########################################################
# * Developed by MicroEmbedded Technologies
########################################... | Python | 0.000001 | @@ -232,111 +232,8 @@
####
-%0A# * Developed by MicroEmbedded Technologies%0A##########################################################
%0A%0Aim
|
1aa45fa857a6af15a7e29eab08a63ac594738c6e | clean up | html_cluster/commands/download_html.py | html_cluster/commands/download_html.py | import os
import json
import base64
import click
import requests
import htmlmin
from html_cluster.settings import (
HTML_CLUSTER_DATA_DIRECTORY, SPLASH_URL, USER_AGENT, SPLASH_TIMEOUT
)
from html_cluster.utils.common import file_name
from html_cluster.utils.html import is_html_page_from_string
from html_cluster.u... | Python | 0.000001 | @@ -384,20 +384,16 @@
ownload
-the
html fro
|
358f200348b06096dcd2562a8d377efe706ff8ce | clean up | classify.py | classify.py | """ Classify the output based on the choice neuron in the last layer with the highest probability."""
import numpy as np
#import chainer
from chainer import cuda, Variable, Chain, optimizers, serializers
import chainer.links as L
import chainer.functions as F
class BaseNetwork(Chain):
"""
BaseNetwork is th... | Python | 0 | @@ -860,80 +860,8 @@
1):%0A
- print hidden_layers%5Bi%5D%0A print hidden_layers%5Bi+1%5D%0A
@@ -1053,17 +1053,17 @@
l
-1
+0
= layer
@@ -1081,17 +1081,17 @@
l
-2
+1
= layer
@@ -1192,17 +1192,22 @@
dd_link(
-i
+str(i)
, layers
@@ -1358,153 +1358,116 @@
-h1 = F.relu... |
eb1c75dd167ed66d60762d722e496e756efc7e38 | fix bug in Model.py | ARCCSSive/CMIP5/Model.py | ARCCSSive/CMIP5/Model.py | #!/usr/bin/env python
"""
Copyright 2015 ARC Centre of Excellence for Climate Systems Science
author: Scott Wales <scott.wales@unimelb.edu.au>
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
h... | Python | 0 | @@ -2683,19 +2683,19 @@
version%5B
-:
-8
+:
%5D)%0A
@@ -2798,19 +2798,19 @@
version%5B
-:
-8
+:
%5D==vlate
@@ -2827,11 +2827,11 @@
ion%5B
-:
-8
+:
%5D:%0A
|
ef59a8e94b4cd38906e62e2f9832a37cbf65c399 | Add note on heuristic for A* | transit.py | transit.py | #!/usr/bin/env python3
import argparse
import collections
import re
import string
import sys
#
# Hex Grid Calculations
#
# http://www.redblobgames.com/grids/hexagons/#coordinates
# SWN hex grids are an "odd-q" layout (flat bottoms, high top-left corner) with "offset" coordinates.
def offset_to_cube(col, row):
x... | Python | 0 | @@ -3924,16 +3924,147 @@
problem.
+ Heuristic is point-to-point (single-hop, infinite drive level) distance (can precomputed easily)? ==%3E Admissiblity of that for A*?
%0A%0A pa
|
f76a2896eb806cf8a8f5c35e579abe0c22461824 | Use nicer Event repr | indico/modules/events/models/events.py | indico/modules/events/models/events.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0 | @@ -1169,16 +1169,29 @@
_unicode
+, format_repr
%0Afrom in
@@ -7460,36 +7460,48 @@
urn
-'%3CEvent(%7B%7D)%3E'.format(self.id
+format_repr(self, 'id', is_deleted=False
)%0A%0A
|
22ab27f9966c19c1f3496e445e460f9ac6400de7 | Fix doubling order admin when custom order model used | shop/admin/orderadmin.py | shop/admin/orderadmin.py | #-*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.admin.options import ModelAdmin
from django.utils.translation import ugettext_lazy as _
from shop.models.ordermodel import (Order, OrderItem,
OrderExtraInfo, ExtraOrderPriceField, OrderPayment)
class OrderExtraInfoInline(admin.Tabula... | Python | 0 | @@ -156,16 +156,49 @@
azy as _
+%0Afrom django.conf import settings
%0A%0Afrom s
@@ -1835,16 +1835,98 @@
)%0A%0A%0A
+ORDER_MODEL = getattr(settings, 'SHOP_ORDER_MODEL', None)%0Aif not ORDER_MODEL:%0A
admin.si
|
1b3e5d52911f3c623b8f320adadea2d8f3ee226a | Implement web service based Pathway Commons client | indra/biopax/pathway_commons_client.py | indra/biopax/pathway_commons_client.py | from indra.java_vm import autoclass, JavaException
def run_pc_query(query_type, source_genes, target_genes=None, neighbor_limit=1):
cpath_client = autoclass('cpath.client.CPathClient').\
newInstance('http://www.pathwaycommons.org/pc2/')
query = cpath_client.createGraphQuery()
query.kind(query_type)... | Python | 0 | @@ -1,8 +1,31 @@
+import urllib, urllib2%0A
from ind
@@ -72,43 +72,85 @@
on%0A%0A
-def run_pc_query(query_type
+pc2_url = 'http://www.pathwaycommons.org/pc2/'%0A%0Adef send_request(kind
, source
_gen
@@ -149,22 +149,16 @@
urce
-_genes
, target
_gen
@@ -157,533 +157,845 @@
rget
-_genes=None, neighbor_limit=1):%0... |
a7062bb3d87954478f4be23a8ac2cc3d125804e7 | resolve #13: consecutive blank row are preserved | tests/test_bug_fixes.py | tests/test_bug_fixes.py | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import os
from pyexcel_ods import get_data, save_data
from nose.tools import raises
def test_bug_fix_for_issue_1():
data = get_data(os.path.join("tests", "fixtures", "repeated.ods"))
assert data["Sheet1"] == [['repeated', 'repeated', 'repeated', 'repeated']]
def t... | Python | 0.005453 | @@ -120,16 +120,21 @@
t raises
+, eq_
%0A%0A%0Adef t
@@ -1868,12 +1868,297 @@
67890%22)%0A
-
+%0A%0Adef test_issue_13():%0A test_file = %22test_issue_13.ods%22%0A data = %5B%0A %5B1,2%5D,%0A %5B%5D,%0A %5B%5D,%0A %5B%5D,%0A %5B3,4%5D%0A %5D%0A save_data(test_file, %... |
2fb41f6e9e6ba69181707b0699a4c6735737c7fa | Add CLI test for imxim create and extract boot image | tests/test_cli_imxim.py | tests/test_cli_imxim.py | # Copyright (c) 2019 Martin Olejar
#
# SPDX-License-Identifier: BSD-3-Clause
# The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution
# or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText
import os
import pytest
import shutil
# Used Directories
DATA_DIR = os.... | Python | 0 | @@ -1513,106 +1513,418 @@
-pass%0A%0A%0A@pytest.mark.script_launch_mode('subprocess')%0Adef test_imxim_extract(script_runner):%0A pa
+ret = script_runner.run('imxim', 'create',%0A os.path.join(DATA_DIR, 'imx7d_bootimg.yaml'),%0A os.path.join(TEMP_DIR, 'imx7... |
b7cb5fc036cc2715a184f099fd403a4f6b722969 | Add output writing to single pop model | single-pop/single_pop.py | single-pop/single_pop.py | import sys
import numpy as np
import numpy.random as npr
from sklearn.neighbors.kde import KernelDensity
from scipy.special import gammaln
import matplotlib.pyplot as plt
from calculate_phist import read_counts
from calculate_phist import normalize_haplotypes
def log_factorial(n):
return gammaln(n+1)
def log_multino... | Python | 0.000027 | @@ -2592,28 +2592,39 @@
steps, plot_
-base
+flname, prob_fl
name):%0A%09prin
@@ -2846,16 +2846,46 @@
ounts)%0A%0A
+%09fl = open(prob_flname, %22w%22)%0A%0A
%09locus_l
@@ -3020,53 +3020,154 @@
b%0A%0A%09
-plot_log_prob(plot_basename + %22_log_prob.pdf%22
+%09if i %25 100 == 0:%0A%09%09%09for j, prob in enumerate(lo... |
cc32b41359c044556c76007dbb1772e3564acfc6 | Add more tests | tests/test_endpoints.py | tests/test_endpoints.py | from tests import SuperTestCase
from flask import jsonify
from manage import app
import json
class TestEndPoints(SuperTestCase):
""" Endpoints being tested:
/api/v1/bucketlists/
/api/v1/bucketlists/<bucket_list_id>
/api/v1/bucketlists/<bucketlist_id>/items/
/api/v1/bucketlists/<buck... | Python | 0 | @@ -2705,33 +2705,390 @@
.status_code, 20
-1
+0)%0A%0A def test_editing_a_none_existing_item(self):%0A %22%22%22 Test for editing an item %22%22%22%0A self.item = %7B%22name%22:%22learn the guitar%22, %22description%22:%22take guitar classes%22%7D%0A response = self.app.put(%22/api/v1/bucketlis... |
12d244ce9bd15d95817d4c4d774a1ab1758db894 | fix broken build | tests/test_extension.py | tests/test_extension.py | from nose.tools import raises
class TestExt:
def test_test(self):
"""test test"""
from pyexcel.ext import test
from pyexcel.io import READERS
from pyexcel.io import WRITERS
assert READERS['test'] == 'test'
assert WRITERS['test'] == 'test'
@raises(ImportErr... | Python | 0.000001 | @@ -647,8 +647,119 @@
Matrix%22%0A
+%0A def tearDown(self):%0A from pyexcel.presentation import STRINGIFICATION%0A STRINGIFICATION = %7B%7D%0A
|
12786677d454de5bccee6f0461021727481fbf24 | use simplified integral definition in tests/test_functions.py | tests/test_functions.py | tests/test_functions.py | # c: 14.04.2008, r: 14.04.2008
import numpy as nm
from sfepy import data_dir
filename_mesh = data_dir + '/meshes/2d/square_unit_tri.mesh'
def get_pars(ts, coors, mode=None, region=None, ig=None, extra_arg=None):
if mode == 'special':
if extra_arg == 'hello!':
ic = 0
else:
... | Python | 0.000001 | @@ -1712,58 +1712,8 @@
%0A%7D%0A%0A
-integrals = %7B%0A 'i1' : ('v', 'gauss_o2_d2'),%0A%7D%0A%0A
ebcs
@@ -1863,18 +1863,17 @@
laplace.
-i1
+2
.Omega(
@@ -3118,16 +3118,68 @@
%5B'mf3'%5D%0A
+ key = mat3.get_keys(region_name='Omega')%5B0%5D%0A
@@ -3203,39 +3203,27 @@
t3.get_data(
-('Omega', 'i1... |
ba6c18a95a01153f142b1da46e7b803e8f5923da | Add options to plot_eigvals to specify the symbol to use and the axes to plot onto. | Plotting.py | Plotting.py | import scipy
import SloppyCell
# We've had yet more trouble running in parallel, but these errors were actually
# killing the job without raising any error. So let's just only even try
# importing if we're the master node.
if SloppyCell.my_rank != 0:
raise ImportError
try:
from pylab import *
except RuntimeE... | Python | 0 | @@ -1583,24 +1583,61 @@
, join=False
+, %0A sym=None, ax=None
):%0A posVa
@@ -1888,24 +1888,89 @@
en(vals)))%0A%0A
+ if axis is None:%0A ax = gca()%0A%0A if sym is None:%0A
sym = va
@@ -2103,16 +2103,19 @@
+ax.
semilogy
@@ -2169,16 +2169,19 @@
sym%5B1%5D,%0A
+
... |
47b32b1b2d5fe81dcf86c78d61690c1f0572b8ea | Add failing name and docstring test for things exported | tests/test_interface.py | tests/test_interface.py | import pkgutil
import pytest
import funcy
from funcy.cross import PY2, PY3
from funcy.py2 import cat
from funcy import py2, py3
py = py2 if PY2 else py3
# Introspect all modules
exclude = ('cross', '_inspect', 'py2', 'py3', 'simple_funcs', 'funcmakers')
module_names = list(name for _, name, _ in pkgutil.iter_module... | Python | 0 | @@ -1881,8 +1881,474 @@
icts'%5D)%0A
+%0A%0Adef test_docs():%0A exports = %5B(name, getattr(funcy, name)) for name in funcy.__all__%0A if name not in ('print_errors', 'print_durations') and%0A getattr(funcy, name).__module__ != 'funcy.types'%5D%0A # NOTE: we are testing this way ... |
1e8f1882a357f11925e79395409716620f91677c | Fix import error python_2_unicode_compatible | hitcount/models.py | hitcount/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import timedelta
from django.db import models
from django.conf import settings
from django.db.models import F
from django.utils import timezone
from django.dispatch import receiver
from django.utils.encoding import python_2_unicode_compatibl... | Python | 0.000001 | @@ -262,29 +262,11 @@
rom
-django.utils.encoding
+six
imp
|
5baa216b615b39fe5d9bf5bb71e9ae8048ef4dc0 | delete samples on metric delete | holodeck/models.py | holodeck/models.py | import uuid
from django.db import models
from holodeck.utils import get_widget_type_choices, load_class_by_string, \
metric_to_shard_mapper, sample_to_shard_mapper
from django.contrib.auth.models import User
class Dashboard(models.Model):
name = models.CharField(max_length=255)
owner = models.ForeignKey(... | Python | 0 | @@ -22,24 +22,154 @@
ngo.
-db import models
+contrib.auth.models import User%0Afrom django.db import models%0Afrom django.db.models.signals import post_delete%0Afrom django.dispatch import receiver
%0Afro
@@ -296,52 +296,8 @@
per%0A
-from django.contrib.auth.models import User%0A
%0A%0Acl
@@ -1764,28 +1764,315 @@
... |
62150ec45c9c062397f0ac0270466b4497d459de | Fix world time plugin | will/plugins/productivity/world_time.py | will/plugins/productivity/world_time.py | import datetime
import requests
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
from will import settings
class TimePlugin(WillPlugin):
@respond_to("what time is it in (?P<place>.*)")
def what_time_is_it_in(self, ... | Python | 0 | @@ -16,24 +16,49 @@
%0Aimport
-requests
+pytz%0Aimport requests%0Aimport time%0A
%0Afrom wi
@@ -226,1516 +226,921 @@
s%0A%0A%0A
-class TimePlugin(WillPlugin):%0A%0A @respond_to(%22what time is it in (?P%3Cplace%3E.*)%22)%0A def what_time_is_it_in(self, message, place):%0A %22%22%22what time is it in __... |
47bb5b64dfec5ea4718d8eac4c204f8e61dd60f8 | Add test that checks relative variable initialisation | tests/test_particles.py | tests/test_particles.py | from parcels import Grid, ScipyParticle, JITParticle, Variable
import numpy as np
import pytest
ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
@pytest.fixture
def grid(xdim=100, ydim=100):
U = np.zeros((xdim, ydim), dtype=np.float32)
V = np.zeros((xdim, ydim), dtype=np.float32)
lon = np.linspace(0... | Python | 0.000008 | @@ -89,16 +89,48 @@
pytest%0A
+from operator import attrgetter%0A
%0A%0Aptype
@@ -586,24 +586,94 @@
npart=10):%0A
+ %22%22%22Test that checks correct initialisation of custom variables%22%22%22%0A
class Te
@@ -897,16 +897,17 @@
fault=12
+.
)%0A ps
@@ -1463,32 +1463,32 @@
in pset%5D).all()%0A
-
... |
def480fd6b44e85cb85bcb3ed8cc0b98d771ee97 | Rework test. | src/test/ed/lang/python/import4_test.py | src/test/ed/lang/python/import4_test.py | '''
Copyright (C) 2008 10gen Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License, version 3,
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but ... | Python | 0 | @@ -858,273 +858,203 @@
elp%0A
-m = __import__('import3_help', %7B%7D, %7B%7D, %5B%5D)%0Aassert m == import3_help%0Am = __import__('import3_help', %7B%7D, %7B%7D, %5B'foo'%5D)%0Aassert m == import3_help%0Am = __import__('import3_help', None, None, %5B%5D)%0Aassert m == import3_help%0Am = __import__('import3_help', Non... |
519ad83f47ead62549c2e0a533ffd3ff5488e384 | Add lint test and format generated code (#4114) | java-asset/google-cloud-asset/synth.py | java-asset/google-cloud-asset/synth.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 | @@ -696,150 +696,220 @@
gcp%0A
-%0Agapic = gcp.GAPICGenerator()%0Acommon_templates = gcp.CommonTemplates()%0A%0A# tasks has two product names, and a poorly named artman yaml%0Av1beta1_
+import synthtool.languages.java as java%0A%0Agapic = gcp.GAPICGenerator()%0A%0Aservice = 'asset'%0Aversions = %5B'v1beta1'%5D%0Aconfi... |
5555b8d93e127d92a577bdc33a2865dd2f1b81e7 | Add a couple descriptive comments | tests/test_sim_setup.py | tests/test_sim_setup.py | """This contains a set of tests for ParaTemp.sim_setup"""
########################################################################
# #
# This script was written by Thomas Heavey in 2018. #
# theavey@bu.edu thomasjheavey@... | Python | 0 | @@ -3960,16 +3960,108 @@
h(path)%0A
+ # If a backup of the original was made, copy the backup over the updated%0A # version:%0A
if o
@@ -4363,50 +4363,153 @@
-assert get_solv_count_top(n_top_dc) == 361
+# Test giving the file name as input%0A assert get_solv_count_top(n_top_dc) == 361%0A ... |
a24d0879c4722ffa2349fbd322d11ced430b3434 | Fix test | tests/test_transform.py | tests/test_transform.py | import unittest
from singer import transform
from singer.transform import *
class TestTransform(unittest.TestCase):
def test_integer_transform(self):
schema = {'type': 'integer'}
self.assertEqual(123, transform(123, schema))
self.assertEqual(123, transform('123', schema))
self.asse... | Python | 0.000004 | @@ -8277,36 +8277,35 @@
self.assert
-Fals
+Tru
e(success)%0A
@@ -8310,39 +8310,48 @@
self.assert
-IsNone(
+DictEqual(data,
transformed_data
|
286d0d577921126512263e8d16a01a75878ee453 | Add missing import | jenkinsapi/utils/urlopener_kerberos.py | jenkinsapi/utils/urlopener_kerberos.py | import urllib2
import kerberos as krb
class KerberosAuthHandler(urllib2.BaseHandler):
"""
A BaseHandler class that will add Kerberos Auth headers to a request
"""
def __init__(self,tgt):
self.tgt = tgt
def http_request(self,req):
req.add_unredirected_header('Authorization', 'Negoti... | Python | 0.000466 | @@ -30,16 +30,46 @@
s as krb
+%0Afrom urlparse import urlparse
%0A%0Aclass
@@ -1601,8 +1601,9 @@
andler %5D
+%0A
|
9fa4543e9f6c6c5bb0954954649b7c691e462e3c | improve the volume export - sleep & check export | nova/volume/service.py | nova/volume/service.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
# not use this file except in compli... | Python | 0 | @@ -6522,24 +6522,25 @@
e(None)%0A
+%0A
# NOTE(v
@@ -6535,82 +6535,75 @@
-# NOTE(vish): these commands sometimes sends output to stderr for warnings
+yield process.simple_execute(%22sleep 5%22) # wait for blades to appear
%0A
@@ -6705,35 +6705,31 @@
-terminate_on_stderr
+check_exit_code
... |
e1e76fefbd5a41ae14308a43245b4ecdf3099252 | Simplify and still reuse out with float16 inputs. | numpy/core/_methods.py | numpy/core/_methods.py | """
Array methods which are called by both the C-code for the method
and the Python code for the NumPy-namespace function
"""
from __future__ import division, absolute_import, print_function
import warnings
from numpy.core import multiarray as mu
from numpy.core import umath as um
from numpy.core.numeric import asan... | Python | 0 | @@ -1654,32 +1654,62 @@
asanyarray(a)%0A%0A
+ is_float16_result = False%0A
rcount = _co
@@ -1740,31 +1740,8 @@
is)%0A
- orig_dtype = dtype%0A
@@ -2139,16 +2139,53 @@
pe('f4')
+%0A is_float16_result = True
%0A%0A re
@@ -2379,69 +2379,41 @@
if
-orig_dtype is None and issubclass(arr.... |
5044b8049e667630301262836eba82902ce33d09 | Allow overriding the 404 page for missing files | private_storage/views.py | private_storage/views.py | """
Views to send private files.
"""
import os
from django.http import Http404, HttpResponseForbidden
from django.utils.module_loading import import_string
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from . import appconfig
from .models import PrivateFile
from .serv... | Python | 0.000001 | @@ -2024,83 +2024,654 @@
r
-aise Http404(%22File not found%22)%0A%0A return self.serve_file(private_file
+eturn self.serve_file_not_found(private_file)%0A else:%0A return self.serve_file(private_file)%0A%0A def serve_file_not_found(self, private_file):%0A %22%22%22%0A Displ... |
f95555ee63323d4046444f14395813a415aa0683 | implement just enough of mtrand to make tests start passing | numpy/random/mtrand.py | numpy/random/mtrand.py | random_sample = None
| Python | 0 | @@ -1,21 +1,409 @@
-random_sample = None
+import random%0Afrom numpy import zeros%0Adef random_sample(length=0):%0A if length == 0:%0A return random.random()%0A ret = zeros((length,))%0A for x in xrange(length):%0A ret%5Bx%5D = random.random()%0A return ret%0A%0Adef randn(length=0):%0A if l... |
92162564fb95ba20090b230695b52d4ddb41a38b | Add support for reading SSH keys from file. | cog/util.py | cog/util.py | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Activision Publishing, Inc.
# the cog project is free software under 3-clause BSD licence
# see the LICENCE file in the project root for copying terms
# miscellaneous utility functions, mostly borrowed
import os
import pwd
import string
import random
import keyring
impo... | Python | 0 | @@ -324,16 +324,64 @@
getpass%0A
+import sshpubkeys%0A%0Afrom sshpubkeys import SSHKey
%0Afrom it
@@ -437,24 +437,422 @@
512_crypt%0A%0A%0A
+def read_ssh_key(path):%0A %22%22%22%0A Read an SSH key given path, bail out when bad. Limit the keyfile length.%0A %22%22%22%0A key = None%0A try:%0A wit... |
422e5e71767df502e504d3f0482e6c8981c7eb25 | Update rng.py | cogs/rng.py | cogs/rng.py | # -*- coding: utf-8 -*-
from discord.ext import commands
import random as rng
import copy
class RNG:
"""Utilities that provide pseudo-RNG."""
el_fractions=['necro', 'walkers', 'xyuecro', 'lords']
def __init__(self, bot):
self.bot = bot
self.el_pull = copy.copy(RNG.el_frections)
@com... | Python | 0.000001 | @@ -1089,378 +1089,8 @@
y)%0A%0A
- @commands.group(pass_context=True, aliases=%5B%5D)%0A async def el(self, ctx):%0A r_answer = ''%0A for fract in self.el_pull:%0A str_answer += '%7B%7D%5Cn'.format(fract)%0A await self.bot.say(str_answer)%0A%0A @el.command(pass_context=True)%0A... |
34f4d6c095c112ed0c8a64c9ab3f28e22827c4f0 | Fix randomfact + fmt | cogs/rng.py | cogs/rng.py | import discord
import random
import json
from discord.ext import commands
from bs4 import BeautifulSoup
from utils import aiohttp_wrap as aw
class RNG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.session = bot.aio_session
self.fact_url = "http://www.unkno.com/"
self.... | Python | 0.000119 | @@ -26,20 +26,8 @@
dom%0A
-import json%0A
from
@@ -59,38 +59,8 @@
nds%0A
-from bs4 import BeautifulSoup%0A
from
@@ -243,78 +243,56 @@
http
+s
://
-www.unkno.com/%22%0A self.react_url = %22http://api.chew.pro/trbmb
+uselessfacts.jsph.pl/random.json?language=en
%22%0A%0A
@@ -427,20 +427,20 @@
-ht... |
65998c13dfa7f1b13cc2332eeceec186e9d6af1c | fix syntax | channels.py | channels.py | channels = {
"#huggle":
lambda x: x.get("X-Bugzilla-Product", None) == "Huggle",
"#pywikibot":
lambda x: x.get("X-Bugzilla-Product", None) == "Pywikibot",
"#wikimedia-corefeatures":
lambda x: (x.get("X-Bugzilla-Product", None) == "MediaWiki extensions") and \
(x.get... | Python | 0.999704 | @@ -1201,17 +1201,16 @@
one) ==
-%22
%22deploym
|
0b048cef1f0efd190d8bf8f50c69df35c59b91a3 | Add verbosity on JSON compare fail | xdc-plugin/tests/compare_output_json.py | xdc-plugin/tests/compare_output_json.py | #!/usr/bin/env python3
"""
This script extracts the top module cells and their corresponding parameters
from json files produced by Yosys.
The return code of this script is used to check if the output is equivalent.
"""
import sys
import json
def read_cells(json_file):
with open(json_file) as f:
data = j... | Python | 0 | @@ -239,16 +239,73 @@
t json%0A%0A
+parameters = %5B%22IOSTANDARD%22, %22DRIVE%22, %22SLEW%22, %22IN_TERM%22%5D%0A%0A
def read
@@ -503,24 +503,173 @@
ls.items():%0A
+ attributes = opts%5B'parameters'%5D%0A if len(attributes.keys()):%0A if any(%5Bx in parameters for x in attributes.keys()%5D)... |
fa28919d3d968fead742138484fcc81a6fca46d4 | Add tests for hubsync.sync.yesno_as_boolean | tests/unit/sync_test.py | tests/unit/sync_test.py | """Sync module tests"""
import unittest
from hubsync import sync
class ZipPairsTestCase(unittest.TestCase):
def test_empty_lists(self):
self.assertEqual(
[],
list(sync.zip_pairs([], []))
)
def test_empty_first_list(self):
self.assertEqual(
[(1, Non... | Python | 0.001036 | @@ -61,16 +61,247 @@
sync%0A%0A%0A
+class SyncTestCase(unittest.TestCase):%0A def test_yesno_as_boolean_yes(self):%0A self.assertTrue(sync.yesno_as_boolean(%22yes%22))%0A%0A def test_yesno_as_boolean_no(self):%0A self.assertFalse(sync.yesno_as_boolean(%22no%22))%0A%0A%0A
class Zi
|
816d6bcd5660d539c4482ea76f1adcf69c23cc92 | add inverse test | streams/coordinates/tests/test_core.py | streams/coordinates/tests/test_core.py | # coding: utf-8
"""
Test conversions in core.py
"""
from __future__ import absolute_import, division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
import os
import pytest
import numpy as np
import astropy.coordinates as coord
import astropy.units as u
from astropy.io import ascii
from ..core im... | Python | 0.999869 | @@ -852,16 +852,22 @@
al(v_hel
+.value
, row%5B'v
@@ -887,9 +887,471 @@
mal=
-2
+4)%0A%0Adef test_hel_to_gsr():%0A for row in data:%0A l = row%5B%22lon%22%5D * u.degree%0A b = row%5B%22lat%22%5D * u.degree%0A v_hel = row%5B%22vhelio%22%5D * u.km/u.s%0A v_sun_lsr = %5Brow%5B%22vx%22%5D,... |
675f3cdb2080fb71136b1da18a47321111a34fd9 | Fix Python version check, fix formatting | updates.py | updates.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Mikhail Fedosov (tbs.micle@gmail.com)"
__version__ = "0.1.4"
# http://code.activestate.com/recipes/577708-check-for-package-updates-on-pypi-works-best-in-pi/
# http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
import pip
i... | Python | 0.000001 | @@ -388,20 +388,25 @@
sion
- %3C '3':%0A
+_info %3C (3, 0):%0A%09
from
@@ -445,12 +445,9 @@
se:%0A
-
+%09
from
@@ -499,14 +499,22 @@
sion
- %3C '3'
+_info %3C (3, 0)
:%0A%09r
@@ -671,17 +671,16 @@
%0A%09pass%0A%0A
-%09
%0Aclass c
@@ -1356,18 +1356,8 @@
i =
-xmlrpclib.
Serv
@@ -1395,16 +1395,17 @@
/p... |
2a4adaa7e5bca8bc8bd3f552f23a46d73ef04a86 | fix authentication bug in token_Data and start_session | cheezapi.py | cheezapi.py | from flask import url_for, session
import os
import requests
def redirect_uri():
redirect_uri = url_for('cheez', _external=True)
# API includes protocol as part of URL matching. Use this to force HTTPS:
if os.environ.get('FORCE_HTTPS') == 'True':
redirect_uri = redirect_uri.replace('http://', 'http... | Python | 0.000001 | @@ -490,16 +490,20 @@
en_data(
+code
):%0A r
@@ -731,17 +731,16 @@
.json()%0A
-
%0Adef sta
@@ -762,21 +762,16 @@
):%0A t
-oken_
data = t
@@ -813,29 +813,24 @@
_token'%5D = t
-oken_
data%5B'access
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.