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
ecb65ccb3351a9d137bf1c79fb1d35cad90a6e5b
Set seed for all random number generations in tests
tests/schema.py
tests/schema.py
""" Test schema definition """ import random import numpy as np import datajoint as dj from . import PREFIX, CONN_INFO schema = dj.schema(PREFIX + '_test1', locals(), connection=dj.conn(**CONN_INFO)) @schema class User(dj.Lookup): definition = """ # lab members username: varchar(12) """ content...
Python
0
@@ -1855,16 +1855,52 @@ rname'%5D%0A + random.seed('Amazing Seed')%0A @@ -1962,16 +1962,16 @@ bject):%0A - @@ -2550,32 +2550,68 @@ es)%0A %22%22%22%0A + random.seed('Amazing Seed')%0A for tria @@ -3094,32 +3094,68 @@ ata%0A %22%22%22%0A + random.seed('...
17c2d6baadfa91985ed8f3d32754ee7d30ba87d9
Use "1" as ui3 cookie value to not confuse IA analytics.
internetarchive/search.py
internetarchive/search.py
import requests.sessions from . import session # Search class # ________________________________________________________________________________________ class Search(object): """This class represents an archive.org item search. You can use this class to search for archive.org items using the advanced sea...
Python
0
@@ -1011,16 +1011,76 @@ if v2:%0A + # Use %221%22 as value to not confuse IA analytics.%0A @@ -1118,18 +1118,9 @@ = ' -ia-wrapper +1 '%0A
bf4147ec6c0b8ba73b484700912556367d7bbb81
Remove logging
tinman/model.py
tinman/model.py
""" Base tinman data models. The Model class is the base model that all other base model classes extend. StorageModel defines the interfaces for models with built in storage functionality. Specific model storage base classes exist in the tornado.model package. Example use:: from tornado import gen from torna...
Python
0.000001
@@ -5741,108 +5741,8 @@ n')%0A - LOGGER.info('%25r -- %25r', args, kwargs)%0A LOGGER.info(repr(kwargs.get('redis_client')))%0A
e0b298f1df9a2d4e8868d6f055a27b5fb0bb8296
Add helper method to model
links/maker/models.py
links/maker/models.py
import uuid from datetime import datetime from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.db import models from django.utils import timezone from maker.managers import (MakerManager, PasswordResetTokenManager, EmailChangeTok...
Python
0.000001
@@ -1578,24 +1578,102 @@ elf.save()%0A%0A + def verify_email(self):%0A self.verified = True%0A self.save()%0A%0A %0Aclass Email
c95a54df6ea3e5e5c98d9c6de701038b37c95298
Kill duplicate __getitem__ from a bad merge.
src/python/twitter/pants/goal/products.py
src/python/twitter/pants/goal/products.py
from collections import defaultdict class Products(object): class ProductMapping(object): """Maps products of a given type by target. Each product is a map from basedir to a list of files in that dir. """ def __init__(self, typename): self.typename = typename self.by_target = defaultdic...
Python
0
@@ -1742,400 +1742,8 @@ t%5D%0A%0A - def __getitem__(self, target):%0A %22%22%22%0A Support for subscripting into this mapping. Returns the product mapping for the given target%0A as a map of %3Cbasedir%3E -%3E %3Cproducts list%3E.%0A If no mapping exists, returns an empty map whose values...
88110772793f6c9a33e74c85a31edf7e7dd2f3e2
Fix error when catching exception: local variable 'releasedScenario' referenced before assignment
freppledb/execute/management/commands/scenario_release.py
freppledb/execute/management/commands/scenario_release.py
# # Copyright (C) 2010-2019 by frePPLe bv # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This library is d...
Python
0.000003
@@ -3214,32 +3214,68 @@ %22%5D%0A try:%0A + releasedScenario = None%0A try:
63cdfe0de155ed32af0332310340b4d57dcef145
bump version for release
stdeb/__init__.py
stdeb/__init__.py
# setuptools is required for distutils.commands plugin we use import logging import setuptools __version__ = '0.4.2.git' log = logging.getLogger('stdeb') log.setLevel(logging.INFO) handler = logging.StreamHandler() handler.setLevel(logging.INFO) formatter = logging.Formatter('%(message)s') handler.setFormatter(formatt...
Python
0
@@ -111,13 +111,9 @@ 0.4. -2.git +3 '%0A%0Al
a88a01f9e6ba01be7d68719f493405ea584b1566
Fix merge fallout
lib/aquilon/worker/commands/search_machine.py
lib/aquilon/worker/commands/search_machine.py
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013 Contributor # # 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 t...
Python
0.000329
@@ -3758,23 +3758,31 @@ d('host. -machine +hardware_entity '),%0A
cbe58b74f6d5fe5c96b197ced9c2269cf8886d24
make boolean functions in utils return real booleans
livesettings/utils.py
livesettings/utils.py
import sys import types import os def can_loop_over(maybe): """Test value to see if it is list like""" try: iter(maybe) except: return 0 else: return 1 def is_list_or_tuple(maybe): return isinstance(maybe, (types.TupleType, types.ListType)) def is_scalar(maybe): """Te...
Python
0.999134
@@ -140,16 +140,26 @@ except + TypeError :%0A @@ -171,36 +171,29 @@ urn -0%0A else:%0A +False%0A - return -1 +True %0A%0Ade @@ -591,24 +591,14 @@ urn -0%0A e +Fa lse -: %0A - @@ -604,17 +604,20 @@ return -1 +True %0A%0A%0Adef f
60217450d91cc560c42c1b6e04e514df318d8014
Remove redundant comment (it's repeated in the called method)
gitlabform/gitlabform/processors/util/branch_protector.py
gitlabform/gitlabform/processors/util/branch_protector.py
import logging import sys import cli_ui from gitlabform import EXIT_PROCESSING_ERROR from gitlabform.gitlab import GitLab from gitlabform.gitlab.core import NotFoundException class BranchProtector(object): old_api_keys = ["developers_can_push", "developers_can_merge"] new_api_keys = [ "push_access_...
Python
0
@@ -884,104 +884,8 @@ ):%0A%0A - # unprotect first to reset 'allowed to merge' and 'allowed to push' fields%0A%0A
8a2a44df94c838d65058a6666f93cd92625debed
comment error check for NON tweets
stream_twitter.py
stream_twitter.py
import gc import os import sys import logging import datetime import dateutil.parser as parser import ConfigParser import MySQLdb from twitter import * logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) logger = logging.getLogger('user') logger.info( "Reading configurations.....
Python
0
@@ -4471,24 +4471,25 @@ break%0A +# else :%0A @@ -4483,24 +4483,25 @@ #else :%0A +# print %22W @@ -4514,24 +4514,25 @@ this!?%22%0A +# print tw @@ -4535,24 +4535,25 @@ t tweet%0A +# break%0A
2bf6b59a129a9d93328c3478e57a27f35bdf2e6a
Trim the hardcoded list of keywords
screencasts/hello-weave/highlight.py
screencasts/hello-weave/highlight.py
#!/usr/bin/env python3 import json prompt = 'ilya@weave-01:~$ ' highlight = [ ('weave-01', 'red'), ('weave-02', 'red'), ('docker', 'red'), ('run', 'red'), ('--name', 'red'), ('hello', 'red'), ('netcat', 'red'), ('-lk', 'red'), ('1234', 'red'), ('sudo curl -s -L git.io/weave -o ...
Python
0.999999
@@ -279,162 +279,8 @@ '),%0A - ('sudo curl -s -L git.io/weave -o /usr/local/bin/weave', 'red'),%0A ('b4e40e4b4665a1ffa23f90eb3ab57c83ef243e64151bedc1501235df6e532e09%5Cr%5Cn', 'red'),%0A
d387a1976e902bbf7fa6d960bee5d16db7aacbb0
Fix indentation. Comment out superfluous code
tools/_build.py
tools/_build.py
""" The cython function was adapted from scikits-image (http://scikits-image.org/) """ import sys import os import shutil import subprocess import platform from distutils.dist import Distribution from distutils.command.config import config as distutils_config from distutils import log import optparse # deprecated in 2...
Python
0.000001
@@ -604,16 +604,91 @@ # HACK%0A + # this doesn't matter because mingw won't be given at install step%0A @@ -738,24 +738,25 @@ ons%0A +# parser = opt @@ -784,16 +784,17 @@ +# parser.a @@ -848,16 +848,17 @@ +# options, @@ -893,16 +893,17 @@ +# if optio @@ -951...
a91ac10af21cf644bfc45ef729e465726491db7b
Enable android_test and friends as waf commands.
tools/flambe.py
tools/flambe.py
#!/usr/bin/env python from waflib import * from waflib.TaskGen import * import os # Waf hates absolute paths for some reason FLAMBE_ROOT = os.path.dirname(__file__) + "/.." def options(ctx): ctx.add_option("--debug", action="store_true", default=False, help="Build a development version") def configure(ctx): ...
Python
0
@@ -1576,76 +1576,8 @@ e)%0A%0A -# TODO: How can we expose these handy commands to the main wscript?%0A def @@ -1933,72 +1933,64 @@ y%22)%0A -%0Adef flash_test(ctx):%0A os.system(%22flashplayer build/app.swf%22) +Context.g_module.__dict__%5B%22android_test%22%5D = android_test %0A%0Ade @@ -2062,8 +2062,181 @@ ...
15c9515a718fbb3e649a63582a4316f29c25fa6e
Check if regform requires users to be logged in
indico/modules/events/registration/controllers/display.py
indico/modules/events/registration/controllers/display.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
@@ -811,38 +811,135 @@ ect%0A -%0Afrom indico.core.db import db +from werkzeug.exceptions import Forbidden%0A%0Afrom indico.core.db import db%0Afrom indico.modules.auth.util import redirect_to_login %0Afro @@ -1630,16 +1630,47 @@ ettings%0A +from indico.util.i18n import _%0A from ind @@ -3161,16 +3161,378 @@ %0A ...
5e57234ec619d0de930333a8dde3004d1dc575d6
Support automatically stashing local modifications during repo-rebase.
subcmds/rebase.py
subcmds/rebase.py
# # Copyright (C) 2010 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Python
0.000007
@@ -2095,24 +2095,181 @@ git rebase') +%0A p.add_option('--auto-stash',%0A dest='auto_stash', action='store_true',%0A help='Stash local modifications before starting') %0A%0A def Exec @@ -3610,50 +3610,571 @@ -if GitCommand(project, args).Wait() != 0:%0A +needs_stash = False%...
7e519f6a04af460378b76d7d116131c528e8a25f
fix a logic error in directive evaluation
src/saga/utils/job/transfer_directives.py
src/saga/utils/job/transfer_directives.py
__author__ = "Andre Merzky, Ole Weidner" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" ''' Provides a parser class for the file transfer specification as it is defined in GFD.90, sction 4.1.3. ''' import saga.exceptions as se # 4.1.3 File Transfer Specifications (GFD90 p 176-...
Python
0.000054
@@ -2031,16 +2031,17 @@ elif '%3E +%3E ' in d:%0A @@ -2079,16 +2079,17 @@ split('%3E +%3E ')%0A @@ -2108,25 +2108,22 @@ elf._in_ -overwrite +append .append( @@ -2162,33 +2162,32 @@ elif '%3E -%3E ' in d:%0A @@ -2209,33 +2209,32 @@ em) = d.split('%3E -%3E ')%0A @@ -2237,38 +...
de262762002f3068c560d2121080bc4f0ea07c33
remove cruft, logging
loslassa/devserver.py
loslassa/devserver.py
#!/usr/bin/env python """ To get quick feedback this implements an automatically reloading web server to be run locally. Reloading functionality is taken from the fabulous `Werkzeug WSGI toolkit <http://www.pocoo.org/projects/werkzeug/#werkzeug>` """ import logging import mimetypes import os import subprocess import s...
Python
0
@@ -646,13 +646,13 @@ nfo( -' * R +%22***r esta @@ -670,17 +670,20 @@ reloader -' +***%22 )%0A @@ -2365,202 +2365,8 @@ ()%5D%0A - print(paths)%0A shortNames = %5Bstr(p).rpartition(str(pathToWatch))%5B-1%5D%5B1:%5D%0A for p in paths%5D%0A log.debug(%22check for change...
d42b47f971675af4b12f59089326276b3b8ff9f4
Bump version to 0.14.0
syntex/pkgmeta.py
syntex/pkgmeta.py
# ------------------------------------------------------------------------- # Package meta data. # ------------------------------------------------------------------------- # Package version number. __version__ = "0.13.4"
Python
0
@@ -215,9 +215,9 @@ %220.1 -3.4 +4.0 %22%0A
8390350b9b717258b2502cbcecc06ddfd73d1c59
Revert SAX changes
tslearn/docs/examples/misc/plot_sax.py
tslearn/docs/examples/misc/plot_sax.py
# -*- coding: utf-8 -*- """ PAA and SAX features ==================== This example presents a comparison between PAA [1], SAX [2] and 1d-SAX [3] features. PAA (Piecewise Aggregate Approximation) corresponds to a downsampling of the original time series and, in each segment (segments have fixed size), the mean value i...
Python
0
@@ -1478,22 +1478,8 @@ tion -, _breakpoints %0A%0Anu @@ -2912,118 +2912,8 @@ -%22)%0A -for bp in _breakpoints(n_bins=n_sax_symbols):%0A plt.axhline(y=bp, linestyle=%22dashed%22, color=%22k%22, alpha=0.4)%0A plt.
64d83d2f9c0d955b9d6ef721c0d953158ebfb72c
Add API to manually set the path of an item. + Automatic creation of files when getPath() is called.
jasy/item/Abstract.py
jasy/item/Abstract.py
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # Copyright 2013-2014 Sebastian Werner # import os from jasy import UserError import jasy.core.File as File class AbstractItem: id = None project = None kind = "jasy.Item" mtime = None __path = None __cache = None __text ...
Python
0
@@ -1801,38 +1801,358 @@ tem.%22%22%22%0A - return self.__ +%0A # Automatically write file (from eventually processed text content) when it does not exist%0A if self.__text is not None and not File.exists(self.__path):%0A File.write(self.__path, self.getText())%0A%0A return self....
a8679b6ac5392b80cd56fa2d67fd3bf3fb6f488f
Add distance handling to base class
turbustat/statistics/base_statistic.py
turbustat/statistics/base_statistic.py
from astropy.io import fits import astropy.units as u import numpy as np from ..io import input_data class BaseStatisticMixIn(object): """ Common properties to all statistics """ # Disable this flag when a statistic does not need a header need_header_flag = True # Disable this when the dat...
Python
0
@@ -1948,8 +1948,1107 @@ _equiv)%0A +%0A @property%0A def distance(self):%0A return self._distance%0A%0A @distance.setter%0A def distance(self, value):%0A '''%0A Value must be a quantity with a valid distance unit. Will keep the%0A units given.%0A '''%0A%0A if not ...
6b4c775219aade049fbed21ca10eed16317c4f7f
move to new apis
users_ldap_groups/users_ldap_groups.py
users_ldap_groups/users_ldap_groups.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2012 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
Python
0
@@ -3058,12 +3058,12 @@ pi.m -ulti +odel %0A @@ -3091,25 +3091,16 @@ er(self, - cr, uid, conf, l @@ -3115,17 +3115,18 @@ ap_entry -, +): %0A @@ -3130,41 +3130,56 @@ - context=None): +id_ = conf%5B'id'%5D%0A this = self.browse(id_) %0A @@ -3249,25 +3249,16 @@ ...
dadd800384358356542ccc49bbdad1ae54006cfc
Fix test_Bucket.BucketDataTests to test `needed` attribute.
lib/bridgedb/test/test_Bucket.py
lib/bridgedb/test/test_Bucket.py
# -*- coding: utf-8 -*- # # This file is part of BridgeDB, a Tor bridge distribution system. # # :copyright: (c) 2007-2014, The Tor Project, Inc. # (c) 2007-2014, all entities within the AUTHORS file # :license: 3-Clause BSD, see LICENSE for licensing information """Unittests for the :mod:`bridgedb.Bucket`...
Python
0
@@ -837,21 +837,22 @@ -alloc +needed = 10%0A @@ -944,36 +944,39 @@ c)%0A this( -dist +bucket. name).should.be. @@ -973,39 +973,36 @@ should.be.equal( -bucket. +dist name)%0A th @@ -996,37 +996,45 @@ e)%0A this( -alloc +bucket.needed ).should.be.equa @@ -1035,23 +1035,16 @@ e.eq...
eb856e854c3b6f94f49db6de41c3a5af758494b3
Change in forbidden_view_config in Pyramid 1.5a3
usingnamespace/views/authentication.py
usingnamespace/views/authentication.py
import logging log = logging.getLogger(__name__) from pyramid.view import ( view_config, view_defaults, forbidden_view_config, ) from pyramid.security import ( remember, forget, authenticated_userid ) from pyramid.httpexceptions import HTTPSeeOther from...
Python
0
@@ -295,16 +295,49 @@ import +(%0A HTTPForbidden,%0A HTTPSeeO @@ -340,16 +340,27 @@ SeeOther +,%0A ) %0A%0Afrom d @@ -2718,26 +2718,16 @@ )%0A%0A @ -forbidden_ view_con @@ -2723,32 +2723,67 @@ @view_config(%0A + context=HTTPForbidden,%0A cont
c86c80854ac5ea60f43619610a21bfba9b1094f2
add ratio
example/simple_male_female_ratio.py
example/simple_male_female_ratio.py
import pydcard def main(): male = 0 female = 0 for page_num in range(1, 41): print ('Sending request to page %d' % page_num) page = pydcard.getAllPage(page_num) for post_thread in range(0, len(page)): if page[post_thread].get('member').get('gender') == 'M': ...
Python
0.000001
@@ -171,12 +171,14 @@ .get -AllP +_all_p age( @@ -635,16 +635,71 @@ , male)) +%0A print ('Female to Male ratio: %25f' %25 (female/male)) %0A%0Aif __n
eb41e61e80cfc29957edfa30221cbbca3d8e7958
Update variance_reduction.py
libact/query_strategies/variance_reduction.py
libact/query_strategies/variance_reduction.py
"""Variance Reduction""" import copy from multiprocessing import Pool import numpy as np from libact.base.interfaces import QueryStrategy from libact.base.dataset import Dataset import libact.models from libact.query_strategies._variance_reduction import estVar class VarianceReduction(QueryStrategy): """Varian...
Python
0.000001
@@ -759,16 +759,18 @@ atrix as + a %0A
832525402091562950b1d14ccca40a68be5f306d
test that large big decimal roundtrips
tests/regression.py
tests/regression.py
## Copyright 2014 Cognitect. All Rights Reserved. ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable...
Python
0.998839
@@ -821,16 +821,44 @@ , false%0A +from decimal import Decimal%0A from Str @@ -1656,16 +1656,90 @@ %22a%5Cnb%22) +%0Aregression(%22big_decimal%22, Decimal(%22190234710272.2394720347203642836434%22)) %0A%0Aclass
b3f33521bc7f837a7e4f055758cd035339446a98
Fix an undefined variable in DB code
utils/database.py
utils/database.py
import json import copy from zirc.wrappers import connection_wrapper class Database(dict): """Holds a dict that contains all the information about the users and their last seen actions in a channel""" def __init__(self, bot): with open("userdb.json") as f: super(Database, self).__init...
Python
0.018335
@@ -858,17 +858,16 @@ = nick_i -n dent + '
2894f0e4ca62723c9b2507f2f0ec1cdf5ccc4774
Fix error messages
src/streamlink/plugins/twitcasting.py
src/streamlink/plugins/twitcasting.py
import hashlib import logging import re from streamlink.buffers import RingBuffer from streamlink.plugin import Plugin, PluginArgument, PluginArguments, PluginError, pluginmatcher from streamlink.plugin.api import useragents, validate from streamlink.plugin.api.websocket import WebsocketClient from streamlink.stream.s...
Python
0.000277
@@ -211,20 +211,8 @@ port - useragents, val @@ -1016,23 +1016,42 @@ +validate.optional( %22movie%22 +) : %7B%0A @@ -1113,22 +1113,41 @@ +validate.optional( %22fmp4%22 +) : %7B%0A @@ -1162,29 +1162,19 @@ %22host%22: -validate.text +str ,%0A @@ -1192,21 +1192,11 @@ o%22: -val...
c5e5bb6b066c0f6afa50dc469a0dc5bbcea68b6d
Explicit return False
ynr/apps/candidates/models/popolo_extra.py
ynr/apps/candidates/models/popolo_extra.py
import datetime from os.path import join import re from django.conf import settings from django.contrib.admin.utils import NestedObjects from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericRelation from django.core.files.storage import DefaultStorage from django.urls impor...
Python
0.999999
@@ -6200,24 +6200,46 @@ eturn True%0A%0A + return False%0A%0A def peop
8d438da54a15fa213c5b57899505e040a42548bf
Fix init for tests
linked_list.py
linked_list.py
from __future__ import unicode_literals class LinkedList(object): """Class for a singly-linked list.""" def __init__(self, iterable=()): self.length = 0 for val in iterable: self.insert(val) def __repr__(self): """Print LinkedList as Tuple literal.""" end_flag ...
Python
0.000007
@@ -35,16 +35,226 @@ erals%0A%0A%0A +class Node(object):%0A%0A def __init__(self, val, next=None):%0A self.val = val%0A self.next = next%0A%0A def __repr__(self):%0A # Just display value%0A return %22%7Bval%7D%22.format(val=self.val)%0A%0A%0A class Li @@ -350,16 +350,43 @@ le=()):%...
1bb4059a783fdbc8f397b596d5d5d5ed6d97a7b4
use radiasoft/beamsim-jupyter image
srv/salt/jupyterhub/jupyterhub_config.py
srv/salt/jupyterhub/jupyterhub_config.py
c.Authenticator.admin_users = {'{{ pillar.jupyterhub.admin_user }}',} c.JupyterHub.confirm_no_ssl = True c.JupyterHub.ip = '0.0.0.0' import base64 c.JupyterHub.cookie_secret = base64.b64decode('{{ pillar.jupyterhub.cookie_secret }}') c.JupyterHub.proxy_auth_token = '{{ pillar.jupyterhub.proxy_auth_token }}' # Allow bot...
Python
0
@@ -885,42 +885,24 @@ %5B0%5D%0A -# jupyter_client.localinterfaces%0A# +c.DockerSpawner. cont @@ -915,16 +915,17 @@ image = +' radiasof @@ -930,26 +930,21 @@ oft/ -jupyterhub-singleuser +beamsim-jupyter' %0A
8d00922e10ff2703237aafb95d16f4352c1a03e4
Add replaces and replaced_by to BallotSerializer
ynr/apps/elections/api/next/serializers.py
ynr/apps/elections/api/next/serializers.py
from drf_yasg.utils import swagger_serializer_method from rest_framework import serializers from api.next.serializers import OrganizationSerializer from candidates import models as candidates_models from elections import models as election_models from official_documents.api.next.serializers import OfficialDocumentSer...
Python
0
@@ -2935,26 +2935,288 @@ d%22,%0A + %22replaces%22,%0A %22replaced_by%22,%0A )%0A%0A replaces = serializers.SlugRelatedField(%0A read_only=True, slug_field=%22ballot_paper_id%22%0A )%0A replaced_by = serializers.SlugRelatedField(%0A read_only=True, slug_field=%22ball...
16fc80f36fa0bade1f4e5e7bef5595b3617a42bc
fix bartlett to pass participant not participant uuid
examples/bartlett1932/experiment.py
examples/bartlett1932/experiment.py
"""Bartlett's trasmission chain experiment from Remembering (1932).""" from wallace.networks import Chain from wallace.nodes import Source, ReplicatorAgent from wallace import processes from wallace.experiments import Experiment import random class Bartlett1932(Experiment): """Defines the experiment.""" de...
Python
0
@@ -1449,13 +1449,8 @@ pant -_uuid =Non
5ab014dc437707367806a97c52c0b48c8449c672
handle blank expanded urls
utils/json2csv.py
utils/json2csv.py
#!/usr/bin/env python """ A sample JSON to CSV program. Multivalued JSON properties are space delimited CSV columns. If you'd like it adjusted send a pull request! """ import sys import json import codecs import argparse import fileinput if sys.version_info[0] < 3: try: import unicodecsv as csv exce...
Python
0.000011
@@ -3529,32 +3529,38 @@ %5B'expanded_url'%5D + or '' for h in t%5B'ent
f6f88b0dfaac0edf6494e4691bf9100f20267d25
handle socket errors
mailmerge/__main__.py
mailmerge/__main__.py
""" Mail merge using CSV database and jinja2 template email. Command line interface implementation. Andrew DeOrio <awdeorio@umich.edu> """ import os import io import sys import csv import configparser import smtplib import jinja2 import click from . api import sendall @click.command(context_settings={"help_option_n...
Python
0.000001
@@ -176,16 +176,30 @@ ort csv%0A +import socket%0A import c @@ -3268,16 +3268,129 @@ .stderr) +%0A sys.exit(1)%0A except socket.error:%0A print(%22%3E%3E%3E Error connecting to server%22)%0A sys.exit(1) %0A%0A #
6073610cb08e03e142b80dc7b1196ce359a1f55a
fix pylint import error
selfdrive/debug/toyota_eps_factor.py
selfdrive/debug/toyota_eps_factor.py
#!/usr/bin/env python3 import sys import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model from tools.lib.route import Route from tools.lib.logreader import MultiLogIterator MIN_SAMPLES = 30*100 def to_signed(n, bits): if n >= (1 << max((bits - 1), 0)): n = n - (1 << max(bits, 0)) ...
Python
0.000001
@@ -110,16 +110,47 @@ ar_model + # pylint: disable=import-error %0A%0Afrom t
a6f95b71030026693683588287f8c54bbd7e3ee8
use persistor to upload trained model to s3
src/trainers/spacy_sklearn_trainer.py
src/trainers/spacy_sklearn_trainer.py
import spacy import os, datetime, json import cloudpickle import util from rasa_nlu.featurizers.spacy_featurizer import SpacyFeaturizer from rasa_nlu.classifiers.sklearn_intent_classifier import SklearnIntentClassifier from rasa_nlu.extractors.spacy_entity_extractor import SpacyEntityExtractor class SpacySklearnTrain...
Python
0
@@ -51,16 +51,30 @@ dpickle%0A +from rasa_nlu import u @@ -78,16 +78,16 @@ t util %0A - from ras @@ -1259,16 +1259,31 @@ elf,path +,persistor=None ):%0A @@ -2522,63 +2522,80 @@ -%0A util.sync_to_s3(dirname,'us-east-1','rasa_nlu' +if (persistor is not None):%0A persistor.send_tar_to_s...
60ebebb4cc167a010904763c5a4ffed6347c029e
Fix license tab.
lms/djangoapps/labster_course_license/tabs.py
lms/djangoapps/labster_course_license/tabs.py
""" Registers the Labster Course License for the edX platform. """ from django.conf import settings from django.utils.translation import ugettext_noop from xmodule.tabs import CourseTab from student.roles import CourseCcxCoachRole class LicenseCourseTab(CourseTab): """ The representation of the LTI Passport...
Python
0
@@ -226,16 +226,57 @@ achRole%0A +from courseware.access import has_access%0A %0A%0Aclass @@ -673,53 +673,8 @@ %22%22%22%0A - if not user:%0A return True%0A
d8e872c3d2aa141c29d993c08c207c1b7994b055
Add missing filter decorators
sequere/templatetags/sequere_tags.py
sequere/templatetags/sequere_tags.py
from django import template from sequere.registry import registry from sequere.models import (get_followers_count, get_followings_count) register = template.Library() def identifier(instance, arg=None): return registry.get_identifier(instance) def followers_count(instance, identifier=None): return get_fol...
Python
0.000001
@@ -160,24 +160,41 @@ Library()%0A%0A%0A +@register.filter%0A def identifi @@ -260,24 +260,41 @@ instance)%0A%0A%0A +@register.filter%0A def follower @@ -384,16 +384,33 @@ fier)%0A%0A%0A +@register.filter%0A def foll
90103ce492a77070a0d6e30c5247b334c803b5e7
check access and execute as superuser
mail_move_message/mail_move_message_models.py
mail_move_message/mail_move_message_models.py
from openerp import api, models, fields, SUPERUSER_ID from openerp.tools.translate import _ class wizard(models.TransientModel): _name = 'mail_move_message.wizard' message_id = fields.Many2one('mail.message', string='Message') message_body = fields.Html(related='message_id.body', string='Message to move',...
Python
0
@@ -1173,16 +1173,645 @@ model)%0A%0A + @api.one%0A def check_access(self):%0A cr = self._cr%0A uid = self.env.user.id%0A operation = 'write'%0A context = self._context%0A%0A if not ( self.model_id and self.res_id ):%0A return True%0A model_obj = self.pool%5Bs...
99c3eba0d6384cd42c90ef347823e6d66659d6e3
Fix typo in division operator
viper/interpreter/prelude/operators.py
viper/interpreter/prelude/operators.py
from ..value import ForeignCloVal def plus(a: int, b: int) -> int: return a + b def minus(a: int, b: int) -> int: return a - b def times(a: int, b: int) -> int: return a * b def divide(a: int, b: int) -> float: return a / b env = { '+': ForeignCloVal(plus, {}), '-': ForeignCloVal(minus...
Python
0.014756
@@ -361,17 +361,16 @@ ,%0A '/ -/ ': Forei
340e872114363ddc041b2c5cdcc5769c9b793efe
Add test_select_with_seed_too_small_raise_Exception
tests/test_bingo.py
tests/test_bingo.py
"""Unit tests for cat2cohort.""" import unittest from bingo import bingo class TestBingoGenerator(unittest.TestCase): """Test methods from bingo.""" def test_bingo_generator_has_default_size(self): bingo_generator = bingo.BingoGenerator() expected = pow(bingo.DEFAULT_SIZE, 2) self.a...
Python
0.000008
@@ -1261,8 +1261,338 @@ ction))%0A +%0A def test_select_with_seed_too_small_raise_Exception(self):%0A with self.assertRaises(ValueError):%0A test_size = 2%0A bingo_generator = bingo.BingoGenerator(size=test_size)%0A seed_list = %5B'a', 'b', 'c'%5D%0A bingo_generato...
fa26aa1651532af0f2862451c2c7a7583be0ad6f
fix typo
llvm/target.py
llvm/target.py
import llvm from llvmpy import api, extra from io import BytesIO import contextlib from llvm.passes import TargetData #===----------------------------------------------------------------------=== # Enumerations #===----------------------------------------------------------------------=== BO_BIG_ENDIAN = 0 BO_LI...
Python
0.999991
@@ -6887,19 +6887,22 @@ .target. -get +create MCInstrA
36f2376a2f23b295bba8cc2af16577efd3fe03ff
Add a couple of snippets.
utils/snippets.py
utils/snippets.py
#!/usr/bin/env python # A hacky script to do dynamic snippets. import sys import os import datetime snippet_map = { 'date' : datetime.datetime.now().strftime('%b %d %G %I:%M%p '), 'time' : datetime.datetime.now().strftime('%I:%M%p '), 'sign' : 'Best,\nSameer', } keys = '\n'.join(snippet_map.keys()) resul...
Python
0.000002
@@ -121,17 +121,16 @@ 'date' - : dateti @@ -188,17 +188,16 @@ 'time' - : dateti @@ -245,21 +245,86 @@ ' -sign' : 'Best +best': 'Best,%5CnSameer',%0A 'cheers': 'Cheers,%5CnSameer',%0A 'thanks': 'Thanks ,%5CnS @@ -541,16 +541,21 @@ ' %25 str( +%0A snippet_ @@ -574,9 +574,8 @@ _key%5D))%0A -%0A...
7d2c4140a74fa052eda6a6a19593321056c9eb80
convert prints to logging in jsonparser
src/unix/plugins/jsonparser/jsonparser.py
src/unix/plugins/jsonparser/jsonparser.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2011 Openstack, LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://...
Python
0.002846
@@ -3219,70 +3219,70 @@ - # log - it%0A print %22Missing data%22%0A print e +ging.error(%22Request dictionary contains no 'data' key%22)%25 %5C %0A @@ -3396,36 +3396,57 @@ -print %22Missing command name%22 +logging.error(%22Request is missing 'name' key%22)%25 %5C %0A
fc4340629c53f11aaeb77a829b81e685fc7f9b9f
fix test for python2.6.
tests/test_cbson.py
tests/test_cbson.py
#!/usr/bin/env python # # Copyright 2013 10gen Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
0
@@ -1007,16 +1007,293 @@ 8,9%5D))%0A%0A +def timediff(a, b):%0A delta = b - a%0A if hasattr(delta, 'total_seconds'):%0A return delta.total_seconds()%0A ret = abs(delta.days * 86400)%0A ret += abs(delta.seconds) %0A ret += abs(delta.microseconds / 1000000.0)%0A if b %3C a:%0A return -ret...
6dcde2c4931b0b8945e235005c28f7eb344cbebc
build LOAFER_ROUTE based on envvars
loafer/conf.py
loafer/conf.py
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 from prettyconf import config class Settings(object): # Logging LOAFER_LOGLEVEL = config('LOAFER_LOGLEVEL', default='WARNING') LOAFER_LOG_FORMAT = config('LOAFER_LOG_FORMAT', default='%(asctime)s - %(name)s - %(levelname)s ...
Python
0
@@ -744,80 +744,216 @@ e': -'example_route',%0A 'source': 'route_source',%0A 'handler': +config('LOAFER_DEFAULT_ROUTE_NAME', default='default'),%0A 'source': config('LOAFER_DEFAULT_ROUTE_SOURCE'),%0A 'handler': config('LOAFER_DEFAULT_ROUTE_HANDLER',%0A defaul...
8887ac66a221b443215e7ab57a2f21b1521b167b
move docs to readme
utils/workflow.py
utils/workflow.py
""" Helpers for my evolving workflow. draft [art] "My super article" creates a prepared md file with all the necessary settings to work on. publish drafts/my-super-article.md will make the necessary adjustments and publish it in the contents. deploy [clean] will create a [clean] build and push it onli...
Python
0
@@ -1,332 +1,4 @@ -%22%22%22%0AHelpers for my evolving workflow.%0A%0A draft %5Bart%5D %22My super article%22%0A%0Acreates a prepared md file with all the necessary settings to work on.%0A%0A publish drafts/my-super-article.md%0A%0Awill make the necessary adjustments and publish it in the contents.%0A%0A deplo...
692afa4421104109037b5bafbf5e3cdba3f54d52
Introduce Reggie to ui
src/victims_web/blueprints/ui/__init__.py
src/victims_web/blueprints/ui/__init__.py
# This file is part of victims-web. # # Copyright (C) 2013 The Victims Project # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
Python
0
@@ -1499,16 +1499,94 @@ on /%0A%0A%0A +_GROUP_REGEX = '%3Cregex(%22%25s%22):group%3E' %25 ('%7C'.join(SUBMISSION_GROUPS.keys()))%0A%0A%0A def _is_ @@ -2466,25 +2466,37 @@ /hashes/ -%3Cgroup%3E/' +%25s/' %25 (_GROUP_REGEX) , method @@ -4809,17 +4809,29 @@ mit/ -%3Cgroup%3E/' +%25s/' %25 (_GROUP_REGEX) , me
377f2120b3474d131b02dab90b6e51c35deb0c74
Add comments
mathphys/constants.py
mathphys/constants.py
"""Constants module.""" import math as _math from . import base_units as _u # temporary auxiliary derived units _volt = (_u.kilogram * _u.meter**2) / (_u.ampere * _u.second**2) _coulomb = _u.second * _u.ampere _joule = _u.kilogram * _u.meter**2 / _u.second**2 _pascal = _u.kilogram / (_u.meter * _u.second**2) # phy...
Python
0
@@ -363,16 +363,30 @@ - exact +by definition --%0A%0Aligh
f585619f5844250e5216aaa1d6894b7c9b651d8f
Change function name
tests/test_frame.py
tests/test_frame.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from pytest import fixture, yield_fixture from unittest.mock import patch import numpy as np from space.frames.poleandtimes import ScalesDiff from space.utils.date import Date from space.orbits.orbit import Orbit from space.frames.frame import * @yield_fixture def time...
Python
0.000092
@@ -1036,36 +1036,29 @@ )%0A%0A%0Adef -state +assert _vector -_testing (ref, pv @@ -2017,36 +2017,29 @@ F')%0A -state +assert _vector -_testing (pef_ref @@ -2126,36 +2126,29 @@ F')%0A -state +assert _vector -_testing (ref_orb @@ -2228,36 +2228,29 @@ D')%0A -state +assert _vector -_testing (tod_...
8441b7dbd0e56fd04361df778628078406a21f19
fix hastily-mocked unit test
tests/test_guano.py
tests/test_guano.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from guano import GuanoFile, wavparams, parse_timestamp class UnicodeTest(unittest.TestCase): NOTE = u'¡GUANO is the 💩 !' MD = u"""GUANO|Version: 1.0\nNote: %s""" % NOTE def setUp(self): pass def test_from_string(self): ...
Python
0
@@ -811,24 +811,25 @@ )%0A g. +_ wav_data = b @@ -835,11 +835,80 @@ b'%5C0 +1 %5C0 -' +2' # faking it, don't try this at home!%0A g._wav_data_size = 2 %0A
c72d67fbbbf5ea67e6e449ca941ae1760a43a24a
fix python 3 error
tests/test_music.py
tests/test_music.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import json from django.core.urlresolvers import reverse from django.http import HttpResponse import pytest from music.decorators import json_view from music.models import Music from music.views impo...
Python
0.000268
@@ -4011,16 +4011,25 @@ .content +.decode() == str(
e732615e2e8586cc3f6a31614372ef16bae26a36
update tests for prices.py
tests/test_price.py
tests/test_price.py
from bitshares import BitShares from bitshares.instance import set_shared_bitshares_instance from bitshares.amount import Amount from bitshares.price import Price from bitshares.asset import Asset import unittest class Testcases(unittest.TestCase): def __init__(self, *args, **kwargs): super(Testcases, se...
Python
0
@@ -2234,8 +2234,271 @@ p4), 2)%0A +%0A def test_div2(self):%0A p1 = Price(10.0, %22USD/GOLD%22)%0A p2 = Price(5.0, %22USD/GOLD%22)%0A%0A # 10 USD/GOLD / 5 USD/EUR = 2 EUR/GOLD%0A p3 = p1 / p2%0A self.assertTrue(isinstance(p3, (float, int)))%0A self.assertEqual(float(p3), 2...
86c43cdc1bddc8cf869e293b1deadd5126631410
Update test_spell.py
tests/test_spell.py
tests/test_spell.py
# -*- coding: utf-8 -*- import unittest from pythainlp.spell import ( NorvigSpellChecker, correct, spell, spell_sent, correct_sent ) class TestSpellPackage(unittest.TestCase): def test_spell(self): self.assertEqual(spell(None), [""]) self.assertEqual(spell(""), [""]) ...
Python
0.000004
@@ -1259,37 +1259,34 @@ esult = spell(%22%E0%B9%80 +%E0%B8%94 %E0%B8%81 -%E0%B8%AA%E0%B8%A1%E0%B8%A3%E0%B9%8C %22, engine=%22tltk%22
5297e301de33304fc00742bb944ffae654db7ee6
fix removing other colour option
vehicles/forms.py
vehicles/forms.py
import requests from django import forms from django.core.exceptions import ValidationError from django.db.models import Count, Q, Exists, OuterRef from busstops.models import Operator, Service from .models import VehicleType, VehicleFeature, Livery, Vehicle, get_text_colour from .fields import RegField def get_liver...
Python
0
@@ -2940,170 +2940,8 @@ tor) -%0A if vehicle:%0A colours = %5B('', 'None/mostly white')%5D + colours%0A else:%0A colours = %5B('', 'No change')%5D + colours %0A%0A @@ -3342,16 +3342,178 @@ olours:%0A + if vehicle:%0A colours = %5B('', 'N...
a26f04bddcdb92af050c2d8237ccb6c2ef1406e5
Fix identation
jst/common/context.py
jst/common/context.py
''' Created on Jan 18, 2015 @author: rz ''' import configparser import os from os.path import expanduser def load(): global_cfg_file = expanduser("~") + '/.jst/jst.properties' if (not os.path.isfile(global_cfg_file)): raise FileNotFoundError(global_cfg_file) cwd = os.getcwd() ctx_file = cwd +...
Python
0.001406
@@ -221,32 +221,33 @@ _file)):%0A + raise FileNotFou @@ -375,24 +375,25 @@ ctx_file)):%0A + raise
99bc38b7d33eef76fd99d7ce362b00080edf5067
Change dependencies
stock_shipment_management/__openerp__.py
stock_shipment_management/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joël Grand-Guillaume # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as pu...
Python
0.000001
@@ -1170,38 +1170,16 @@ : %5B%22 -sale%22,%0A %22purchase +delivery %22,%0A @@ -1197,16 +1197,30 @@ %22stock +_route_transit %22,%0A
aad19b0373f2b331ffbada431385173d2bf3e43e
Update cronjob.py
k8s/models/cronjob.py
k8s/models/cronjob.py
#!/usr/bin/env python # -*- coding: utf-8 # Copyright 2017-2019 The FIAAS Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
Python
0.000004
@@ -626,16 +626,17 @@ icense.%0A +%0A from __f @@ -1525,162 +1525,4 @@ %0A%0A%0A -class CronJobList(Model):%0A apiVersion = Field(six.text_type)%0A items = ListField(CronJob)%0A kind = Field(six.text_type)%0A metadata = Field(ListMeta)%0A
e7dca1dae8300dd702ecfc36110518b16c9c5231
change directory back to previous location (prevents following tests from pointing into the forest)
tests/testhelper.py
tests/testhelper.py
from contextlib import contextmanager import tempfile import os import shutil from configuration import Builder from gitFunctions import Initializer import configuration @contextmanager def mkchdir(subfolder, folderprefix="rtc2test_case"): tempfolder = tempfile.mkdtemp(prefix=folderprefix + subfolder) os.chd...
Python
0
@@ -299,24 +299,54 @@ subfolder)%0A + previousdir = os.getcwd()%0A os.chdir @@ -397,32 +397,62 @@ er%0A finally:%0A + os.chdir(previousdir)%0A shutil.r @@ -813,16 +813,46 @@ lizer()%0A + previousdir = os.getcwd()%0A os.c @@ -921,32 +921,62 @@ ld%0A finally:%0A + os.chdi...
5a8199744bf658d491721b16fea7639303e47d3f
Edit view pre-populates with data from user object
july/people/views.py
july/people/views.py
from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from django.template.context import RequestContext #from google.appengine.ext import db from july.people.models import Commit from gae_django.auth.models import User from django.http import Http404, HttpResponseRed...
Python
0
@@ -849,60 +849,8 @@ er%0A%0A - #CONSIDER FILES with no POST? Can that happen?%0A @@ -891,24 +891,29 @@ r None, +user= request. FILES or @@ -908,21 +908,12 @@ est. -FILES or None +user )%0A @@ -1001,12 +1001,14 @@ ser, + key, + form @@ -1099,24 +1099,16 @@ - reverse( @@ -1144,...
8e9edf002368df0cd4bfa33975271b75af191ef0
fix cache expiring
ujt/dash_app.py
ujt/dash_app.py
""" Configuration for Dash app. Exposes app and cache to enable other files (namely callbacks) to register callbacks and update cache. App is actually started by ujt.py """ import dash import dash_bootstrap_components as dbc import dash_cytoscape as cyto from flask_caching import Cache # Initialize Dash app and Flas...
Python
0
@@ -478,16 +478,25 @@ config=%7B +%0A %22CACHE_T @@ -514,16 +514,24 @@ system%22, +%0A %22CACHE_ @@ -547,13 +547,85 @@ che_dir%22 +,%0A %22CACHE_DEFAULT_TIMEOUT%22: 0,%0A %22CACHE_THRESHOLD%22: 0,%0A %7D,%0A)%0A
a8e43dcdbdd00de9d4336385b3f3def1ae5c2515
Update UserX, with back compatibility
main/modelx.py
main/modelx.py
# -*- coding: utf-8 -*- import hashlib class BaseX(object): @classmethod def retrieve_one_by(cls, name, value): cls_db_list = cls.query(getattr(cls, name) == value).fetch(1) if cls_db_list: return cls_db_list[0] return None class ConfigX(object): @classmethod def get_master_db(cls): r...
Python
0
@@ -386,16 +386,21 @@ atar_url +_size (self, s @@ -628,8 +628,52 @@ ,%0A %7D%0A + %0A avatar_url = property(avatar_url_size)%0A
6ba3fc5c9fade3609695aa7f5b0498b77a8c18fa
revert to 0.2.7 tag
keras_cv/__init__.py
keras_cv/__init__.py
# Copyright 2022 The KerasCV Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0.000001
@@ -936,10 +936,7 @@ 0.2. -8dev +7 %22%0A
97523ce0b98d97a4ce6d9d99d5807e1f32b21077
correcting a typo
constructiveness_toxicity_crowdsource/common/crowd_data_aggregator.py
constructiveness_toxicity_crowdsource/common/crowd_data_aggregator.py
import pandas as pd import numpy as np import math from crowd_data_aggregation_functions import * class CrowdsourceAggregator: ''' Aggregator for crowdsourced data for constructiveness and toxicity ''' def __init__(self, input_csv): self.df = pd.read_csv(input_csv) def get_gold_que...
Python
0.999886
@@ -535,16 +535,20 @@ en(self. +get_ non_gold @@ -548,18 +548,27 @@ on_gold_ -df +questions() %5B'_worke @@ -2257,21 +2257,157 @@ -pass%0A%0A%0A%0A%0A +ca = CrowdsourceAggregator('../CF_output/constructiveness/batch8/batch8_f1285429.csv')%0A print('The number of annotators: ', ca.get_nannotators())%0A ...
55a3b3a845014d0e4c4c4d057bbe088d7791d43d
Prepare for v1.10.0
src/pyckson/__init__.py
src/pyckson/__init__.py
from pyckson.decorators import * from pyckson.json import * from pyckson.parser import parse from pyckson.parsers.base import Parser from pyckson.serializer import serialize from pyckson.serializers.base import Serializer from pyckson.dates.helpers import configure_date_formatter, configure_explicit_nulls from pyckson....
Python
0.000001
@@ -364,9 +364,10 @@ '1. -9 +10 .0'%0A
7fcb80a43d39473001610015e92973d95c0b0267
Fix not track percent so it is not track percent
mica/web/star_hist.py
mica/web/star_hist.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.table import Table from Chandra.Time import DateTime from mica.stats import acq_stats, guide_stats def get_acq_data(agasc_id): """ Fetch acquisition history from mica acq stats for an agasc id :param agasc_id: AGASC id :retu...
Python
0.998902
@@ -1846,24 +1846,29 @@ ot_track'%5D = + (1 - s%5B'f_track' @@ -1868,16 +1868,17 @@ _track'%5D +) * 100.0
6d63ab2ef50512a794948c86cf1ce834b59acd90
Add str method for map area
maps/models.py
maps/models.py
import json from django.conf import settings # from django.contrib.postgres.fields import JSONField from django.db import models JSONTextField = models.TextField # See # https://developers.google.com/maps/documentation/javascript/reference?hl=en#LatLngBoundsLiteral class LatLngBounds(models.Model): east = mode...
Python
0
@@ -1031,16 +1031,100 @@ e='+')%0A%0A + def __str__(self):%0A return self.title or 'Map area #%7B%7D'.format(self.id)%0A%0A %0Aclass Q
f8fde8fd984242f75e36644d2e54c1d306c1b785
Remove --population=default
keysmith/__main__.py
keysmith/__main__.py
"""Keysmith Default Interface""" import argparse import math import string import pkg_resources import keysmith def cli(parser=None): """Parse CLI arguments and options.""" if parser is None: parser = argparse.ArgumentParser(prog=keysmith.CONSOLE_SCRIPT) parser.add_argument( '-d', '--de...
Python
0.000009
@@ -671,17 +671,8 @@ ric, - default, pri @@ -707,25 +707,72 @@ default= -'defaul +pkg_resources.resource_filename('keysmith', 'words.tx t' +) ,%0A )%0A @@ -1347,136 +1347,8 @@ ne:%0A - if args.population == 'default':%0A args.population = pkg_resources.resource_filename('keysmith', 'words.tx...
e2883d40a5c4bd49676a91da0a9aab54231634fe
Fix metric name.
st2reactor/st2reactor/rules/worker.py
st2reactor/st2reactor/rules/worker.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0.000533
@@ -3775,25 +3775,24 @@ 'st2.trigger -_ instance.%25s.
ef3e73cb7dc530a3e322225cd95a4ef3bbb319fa
Fix docstring for read
vtki/readers.py
vtki/readers.py
""" Contains a dictionary that maps file extensions to VTK readers """ import os import vtk import vtki READERS = { # Standard dataset readers: '.vtk': vtk.vtkDataSetReader, '.vti': vtk.vtkXMLImageDataReader, '.vtr': vtk.vtkXMLRectilinearGridReader, '.vtu': vtk.vtkXMLUnstructuredGridReader, '...
Python
0.000001
@@ -4371,87 +4371,104 @@ rs : -%0A A string list of reader attributes to call. If specified, the standard + dict, optional%0A A dictionary of attributes to call on the reader. Keys of dictionary are %0A @@ -4476,73 +4476,172 @@ -reading routine will be used with each attribute specified called ...
deaf4bac5ccc04b23cb340dcd1514ec967260db1
Fix session code in version.py
src/lesson/version.py
src/lesson/version.py
# lesson/version.py # # This file is part of LESSON. LESSON 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, version 2 or later. # # This program is distributed in the hope that it will be useful, but WITHOUT ...
Python
0
@@ -4386,39 +4386,39 @@ t set%22)%0A -cur_ver +session = self.db.sessi @@ -4404,32 +4404,67 @@ ssion = self.db. +create_session()%0A cur_ver = session.query(Ve @@ -4477,32 +4477,56 @@ .get(self.uuid)%0A + session.close()%0A if cur_v @@ -6130,31 +6130,31 @@ -cur_ver +s...
646548dff38ea476a35462cf51ba028e3275748a
Fix some undefined reference and attribute errors in the deallocate simprocedure
simuvex/procedures/cgc/deallocate.py
simuvex/procedures/cgc/deallocate.py
import simuvex class deallocate(simuvex.SimProcedure): #pylint:disable=arguments-differ def run(self, addr, length): #pylint:disable=unused-argument # return code (see deallocate() docs) r = self.state.se.ite_cases(( (addr % 0x1000 != 0, self.state.cgc.EINVAL), ...
Python
0.000001
@@ -9,16 +9,91 @@ imuvex%0A%0A +import logging%0Al = logging.getLogger(%22simuvex.procedures.cgc.deallocate%22)%0A%0A class de @@ -647,16 +647,249 @@ bits))%0A%0A + aligned_length = ((length + 0xfff) / 0x1000) * 0x1000%0A%0A # TODO: not sure if this is valuable until we actually model CGC%0A # a...
70c520d3ff882b499febfe021d02108f79171773
Fix ST2(python26) compatibility.
OmniMarkupLib/Renderers/MarkdownRenderer.py
OmniMarkupLib/Renderers/MarkdownRenderer.py
from .base_renderer import * import re import markdown @renderer class MarkdownRenderer(MarkupRenderer): FILENAME_PATTERN_RE = re.compile(r'\.(md|mkdn?|mdwn|mdown|markdown|litcoffee)$') YAML_FRONTMATTER_RE = re.compile(r'\A---\s*\n.*?\n?^---\s*$\n?', re.DOTALL | re.MULTILINE) def load_settings(self, rend...
Python
0.000001
@@ -504,12 +504,8 @@ s = -set( rend @@ -530,17 +530,16 @@ nsions'%5D -) %0A @@ -622,9 +622,9 @@ s = -%7B +%5B 'tab @@ -673,9 +673,46 @@ ite' -%7D +%5D%0A extensions = set(extensions) %0A
f5c9b1a31226d364426e0d435d64caaf6b432262
allow pickle for t-king
king/tking-server.py
king/tking-server.py
#!/usr/bin/python import exceptions, sys, os, socket, rpyc, pickle import dns.query, dns.rdatatype, dns.exception from twisted.internet import reactor from twisted.names import dns as twisted_dns from twisted.names import server from datetime import datetime, timedelta from random import randrange from threading import...
Python
0.000001
@@ -471,16 +471,74 @@ t ping%0A%0A +rpyc.core.protocol.DEFAULT_CONFIG%5B'allow_pickle'%5D = True%0A%0A myHostNa
b7523a8bbac9fdce7d97afda32b9a7982f00a6d0
Update Exp 7_2
examples/sparkfun_redbot/sparkfun_experiments/Exp7_2_DriveDistance.py
examples/sparkfun_redbot/sparkfun_experiments/Exp7_2_DriveDistance.py
""" Exp7_2_DriveDistance -- RedBot Experiment 7.2 In an earlier experiment, we used a combination of speed and time to drive a certain distance. Using the encoders, we can me much more accurate. In this example, we will show you how to setup your robot to drive a certain distance regardless of the motorPower...
Python
0
@@ -668,261 +668,234 @@ ath%0A -# This line %22includes%22 the RedBot library into your sketch.%0A# Provides special objects, methods, and functions for the RedBot.%0A%0A%0Aboard = PyMata3()%0Aencoders = RedBotEncoder(board)%0Amotors = RedBotMotors(board)%0Aencoder_pin_left = 16%0Aencoder_pin_right = 10%0A +%0ACOM_POR...
b58eaf077ff748c3604aa7520a956b03cdce6995
Add libevent_home command line parameter
site_scons/community/command_line.py
site_scons/community/command_line.py
from SCons.Script import * ## Command Line Variables # # Setup all of the command line variables across all of the products and # platforms. NOTE: if a path is configurable and will be created in the # build process then the validation MUST be PathAccept def get_command_line_opts( host, products, VERSIONS ): opts ...
Python
0.000001
@@ -2720,32 +2720,172 @@ ble.PathIsDir),%0A + PathVariable('libevent_home', 'Path to libevent Libraries',%0A 'c:%5C%5Clibevent', PathVariable.PathAccept),%0A )%0A%0A i
f0f542e0a9afb1eb849ce2f9e402006658f31f5e
Deshace cambios del commit anterior
webapp/forms.py
webapp/forms.py
from decimal import Decimal as D from django import forms from django.utils.translation import ugettext_lazy as _ from core import models class CreatePerson(forms.ModelForm): class Meta: model = models.Person fields = ('name', 'surname',) widgets = { 'name': forms.TextInput(...
Python
0
@@ -3489,76 +3489,15 @@ = ' -type_of_membership', 'payment_status', 'membership_fee', 'membership +payment _sta
686fe1f0318237e37b3c5f0fdb99cf02be3fe038
make server ip a variable
misc/build-windows.py
misc/build-windows.py
#!/usr/bin/env python # start up windows vm # some script should start on bootup and try to connect back to this script (through some port) # this script should send commands for building the tree and creating the exe # could also have a simple file transfer mechanism so I can get the exe without having to muck around...
Python
0.000003
@@ -349,16 +349,84 @@ = 15421%0A +# network settings in jon's virtual box %0Aserver_ip = '192.168.90.2'%0A quit_mes @@ -2764,30 +2764,25 @@ connect( -'192.168.90.2' +server_ip ))%0A%0A
168c80e3bf024f74fbb49184ceffbc2a09abe6c1
Allow empty labels
kk/models/hearing.py
kk/models/hearing.py
from django.conf import settings from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from .base import ModifiableModel class Label(ModifiableModel): label = models.CharField(verbose_name=_('Label'), default='', max_length=200) def __str__(se...
Python
0.998839
@@ -1790,10 +1790,22 @@ ld(Label +, blank=True )%0A
d58b82997d9e5d616da2f517c19c5191c43cd823
make membship optional, on which we revert to matching_dissim; speed improvement
kmodes/util/dissim.py
kmodes/util/dissim.py
""" Dissimilarity measures for clustering """ import numpy as np def matching_dissim(a, b, **_): """Simple matching dissimilarity function""" return np.sum(a != b, axis=1) def euclidean_dissim(a, b, **_): """Euclidean distance dissimilarity function""" if np.isnan(a).any() or np.isnan(b).any(): ...
Python
0
@@ -457,16 +457,21 @@ membship +=None ):%0A %22 @@ -902,23 +902,237 @@ hape%5B1%5D%0A - %22%22%22 +%0A In case of missing membship, this function reverts back to%0A matching dissimilarity.%0A %22%22%22%0A # Without membership, revert to matching dissimilarity%0A if membship is None:%0A re...
1b972c4ab088fd6566dd144992167f4a4ae62356
rebuild LevelRenderData after saving changed_geometries
src/c3nav/mapdata/models/update.py
src/c3nav/mapdata/models/update.py
from contextlib import contextmanager from django.conf import settings from django.core.cache import cache from django.db import models, transaction from django.utils.http import int_to_base36 from django.utils.timezone import make_naive from django.utils.translation import ugettext_lazy as _ from c3nav.mapdata.tasks...
Python
0
@@ -1925,105 +1925,8 @@ ()%0A%0A - from c3nav.mapdata.render.base import LevelRenderData%0A LevelRenderData.rebuild()%0A%0A @@ -2076,16 +2076,113 @@ e_key)%0A%0A + from c3nav.mapdata.render.base import LevelRenderData%0A LevelRenderData.rebuild()%0A%0A
dc300cf24651036e93e94f8c40f00f1126da4a85
fix 404 when user want to verify payments
lms/djangoapps/commerce/views.py
lms/djangoapps/commerce/views.py
""" Commerce views. """ import logging from django.conf import settings from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt from edxmako.shortcuts import render_to_response from microsite_configuration import microsite from lms.djangoapps.verify_student.model...
Python
0
@@ -480,86 +480,8 @@ s _%0A -from openedx.core.djangoapps.theming.helpers import is_request_in_themed_site%0A %0A%0Alo @@ -3624,35 +3624,12 @@ e': -is_request_in_themed_site() +True ,%0A
7b617d289d1771cf87635b0cfb2334c02352d9d2
remove commented legacy code
kneed/knee_locator.py
kneed/knee_locator.py
import numpy as np from scipy import interpolate from scipy.signal import argrelextrema class KneeLocator(object): def __init__(self, x, y, S=1.0, curve='concave', direction='increasing'): """ x = x values y = y values S = Sensitivity parameter, original paper suggests default of ...
Python
0
@@ -555,699 +555,35 @@ -# if (self.curve == 'concave' and direction == 'decreasing') or (self.curve == 'convex' and direction == 'increasing'):%0A # self.original_x = self.x%0A # self.original_y = self.y%0A # self.x = %5Bmax(self.x) - x_ for x_ in self.x%5D%0A # self.y = %5...
d095663247585110247e709dfd9aeca503824111
fix start_time in shootexec
yandextank/plugins/ShootExec/plugin.py
yandextank/plugins/ShootExec/plugin.py
import errno import collections import logging import os.path import subprocess import time from ...common.interfaces import AbstractPlugin, GeneratorPlugin, AggregateResultListener, AbstractInfoWidget, \ StatsReader from ...common.util import FileScanner from ..Console import Plugin as ConsolePlugin from ..Phanto...
Python
0.000002
@@ -3056,16 +3056,54 @@ .__cmd)%0A + self.start_time = time.time()%0A
292f88104ecb93705e7c54f0e43382667d1d3937
version bump
jupyterthemes/__init__.py
jupyterthemes/__init__.py
""" Juypiter theme installer Author: miraculixx at github.com, dunovank at github.com """ from __future__ import print_function from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir import os import shutil import argparse from glob import glob from tempfile import mkstemp __version__ = 0.3.1 jnb_config_d...
Python
0.000001
@@ -298,13 +298,15 @@ _ = +' 0.3.1 +' %0A%0Ajn
73b67a30495e7a6d638421ba8b9544a5e2dc4185
Fix task full resource
zou/app/resources/project/task_full.py
zou/app/resources/project/task_full.py
from flask import abort from flask_login import login_required from zou.app.models.task import Task from zou.app.models.project import Project from zou.app.models.person import Person from zou.app.models.entity import Entity from zou.app.models.entity_type import EntityType from zou.app.models.task_status import TaskS...
Python
0.000029
@@ -1367,28 +1367,11 @@ -parent = Entity.get( +if enti @@ -1378,25 +1378,37 @@ ty.parent_id -) + is not None: %0A if @@ -1408,18 +1408,19 @@ -if + parent is n @@ -1415,28 +1415,46 @@ parent -is not None: += Entity.get(entity.parent_id) %0A
807ea3a97377ec80e47b419baeaab1c1a432fd40
fix for python 3
language_tags/tags.py
language_tags/tags.py
# -*- coding: utf-8 -*- import os import json from io import open from language_tags.Subtag import Subtag from language_tags.Tag import Tag parent_dir = os.path.dirname(__file__) data_dir = '../node_modules/language-subtag-registry/data/json/' index = json.load(open(os.path.join(parent_dir, data_dir + "index.json")...
Python
0.000052
@@ -38,16 +38,27 @@ ort json +%0Aimport six %0A%0Afrom i @@ -3814,16 +3814,72 @@ gistry)%0A + if six.PY3:%0A records = list(records)%0A @@ -4251,22 +4251,9 @@ urn -map(lambda r: +%5B Subt @@ -4317,17 +4317,25 @@ g'%5D) -, + for r in results )%0A%0A @@ -4330,17 +4330,17 @@ resul...
d4563fe6991ee644350528a469884f697f02308d
Add production of very high S/N model images
models/make_images.py
models/make_images.py
#!/usr/bin/env python from glob import glob import pyfits import sys, os import numpy shape = (100,100) bands = ['u', 'g', 'r', 'i', 'z', 'Y', 'J', 'H', 'K'] zp = numpy.array([16.75,15.957,15.0,14.563,14.259,14.162,13.955,13.636,13.525]) def make_images(model='A', noiselevel=5, bandsel=['u', 'g', 'r...
Python
0
@@ -1030,16 +1030,43 @@ ain__':%0A + make_images('A', 0.01)%0A make @@ -1109,24 +1109,51 @@ 50, %5B'H'%5D)%0A + make_images('B', 0.01)%0A make_ima @@ -1253,40 +1253,131 @@ +x, -5, %5B'r'%5D)%0A make_images('D', 5 +0, %5B'r'%5D)%0A make_images('C'+x, 5, %5B'r'%5D)%0A make_images('D', 0....
183722bf88f04f5f8735cc61e62e8d89016bd32d
fix bug with user_course
models/user_course.py
models/user_course.py
import itertools import mongoengine as me import course import professor import rating import review import term class CritiqueCourse(me.Document): meta = { 'indexes': [ 'course_id', 'professor_id', ], } # id = me.ObjectIdField(primary_key=True) course_id = ...
Python
0
@@ -4206,16 +4206,69 @@ viewed,%0A + 'program_year_id': self.program_year_id,%0A
2417f7e3c445c7f369c9eb8cb48c83ebb4c2e43d
Change blueprints to be more container-like.
kyokai/blueprints.py
kyokai/blueprints.py
""" Kyōkai are simply groups of routes. They're a simpler way of grouping your routes together instead of having to import your app object manually all of the time. """ from kyokai.route import Route class Blueprint(object): """ A Blueprint contains one public method: `bp.route`. It acts exactly the same as ...
Python
0
@@ -4,16 +4,27 @@ %0AKy%C5%8Dkai +blueprints are simp @@ -260,184 +260,25 @@ int -contains one public method: %60bp.route%60. It acts exactly the same as a normal route method.%0A%0A If you set a %60url_prefix%60 in the constructor, this prefix will be added onto you +is a container fo r ro @@ -324,16 +324,54...
a43ada7785db136f3a5d7d96c6b64b0a686d052e
fix total_force missing
labs/lab2/analyze.py
labs/lab2/analyze.py
#!/usr/bin/env python import re import sys import csv import argparse # This defines the patterns for extracting relevant data from the output # files. patterns = { "energy": re.compile("total energy\s+=\s+([\d\.\-]+)\sRy"), "ecut": re.compile("kinetic\-energy cutoff\s+=\s+([\d\.\-]+)\s+Ry"), "alat": re....
Python
0.000053
@@ -842,16 +842,30 @@ 'energy' +,'total_force' %5D%0A wi
6e4e79afc3167d0b3a2816c35aef88aaf3314335
Add setLogLevel as an export.
mininet/log.py
mininet/log.py
"Logging functions for Mininet." import logging from logging import Logger import types # Create a new loglevel, 'CLI info', which enables a Mininet user to see only # the output of the commands they execute, plus any errors or warnings. This # level is in between info and warning. CLI info-level commands should no...
Python
0
@@ -5930,16 +5930,23 @@ debug = + ( %0A lg.info @@ -5980,14 +5980,8 @@ ror, - %5C%0A lg. @@ -5989,13 +5989,24 @@ ebug + ) = %5B +%0A make @@ -6034,16 +6034,29 @@ or f in +%0A lg.info, @@ -6075,33 +6075,16 @@ lg.warn, -%0A lg.erro @@ -6097,8 +6097,38 @@ debug ...
0ce8050b797b3e2c2a9b0e74cbc67fd8e31736b3
Remove working distros to focus on non-working ones
fog-aws-testing/scripts/settings.py
fog-aws-testing/scripts/settings.py
# The list of OSs. OSs = ["debian9","centos7","rhel7","fedora29","arch","ubuntu18_04"] dnsAddresses = ["debian9.fogtesting.cloud","centos7.fogtesting.cloud","rhel7.fogtesting.cloud","fedora29.fogtesting.cloud","arch.fogtesting.cloud","ubuntu18_04.fogtesting.cloud"] # The list of branches to process. branches = ["maste...
Python
0
@@ -12,16 +12,17 @@ of OSs.%0A +# OSs = %5B%22 @@ -81,16 +81,65 @@ 18_04%22%5D%0A +OSs = %5B%22rhel7%22,%22fedora29%22,%22arch%22,%22ubuntu18_04%22%5D%0A# dnsAddre @@ -308,16 +308,141 @@ .cloud%22%5D +%0AdnsAddresses = %5B%22rhel7.fogtesting.cloud%22,%22fedora29.fogtesting.cloud%22,%22arch.fogtesting.cloud%22,%22u...
7f3c8fd66b95e3246901efc0795e5631aadb7d36
Fix factories
src/competition/tests/factories.py
src/competition/tests/factories.py
import factory import random from datetime import timedelta from datetime import datetime from django.contrib.auth.models import User from competition.models import (Competition, Game, GameScore, Avatar, Team, Organizer, OrganizerRole, Registration, Invit...
Python
0.000001
@@ -965,32 +965,50 @@ Factory(factory. +django.DjangoModel Factory):%0A FA @@ -1076,13 +1076,21 @@ user -' + n +%7B%7D'.format(n) )%0A @@ -1440,32 +1440,50 @@ Factory(factory. +django.DjangoModel Factory):%0A FA @@ -1811,32 +1811,50 @@ Factory(factory. +django.DjangoModel Factory):%0A FA @@ -1892,32 ...
b72ab35056ca6ec1e48db963d61c31d89ec80161
fix on winsock2
autoconf/winsock2.py
autoconf/winsock2.py
from _external import * winsock2 = LibWithHeaderChecker( 'winsock2', ['winsock2.h'], 'c', name='ws2_32' )
Python
0
@@ -53,22 +53,20 @@ cker( 'w -insock +s2_3 2',%0A%09%09 @@ -115,17 +115,19 @@ %09name='w -s2_3 +insock 2' )%0A
0b499f01d517775fb03294c1c785318ca6224874
Bump to v0.0.5
backache/__init__.py
backache/__init__.py
from . core import * from . antioxidant import celerize # flake8: noqa from . errors import * __version__ = (0, 0, 4)
Python
0.000001
@@ -114,7 +114,7 @@ 0, -4 +5 )%0A
db0dd0dd97f2370eac5173c6b000589ceaa7458f
put euare show_user debug methods in try catch blocks
testcases/cloud_admin/create_resources.py
testcases/cloud_admin/create_resources.py
#!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2009-2011, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistri...
Python
0
@@ -2257,33 +2257,87 @@ t -ester.show_euare_whoami() +ry:%0A tester.show_euare_whoami()%0A except: pass %0A @@ -2493,16 +2493,33 @@ tester)%0A + try:%0A @@ -2539,32 +2539,53 @@ how_all_users()%0A + except: pass%0A for user @@ -3519,24 +351...