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
86d4b4a241887bfcd990180a6486cb8054bf514c
Add 'TODO' for YAML editor.
core/io/pyslvs_yaml.py
core/io/pyslvs_yaml.py
# -*- coding: utf-8 -*- """YAML format processing function.""" __author__ = "Yuan Chang" __copyright__ = "Copyright (C) 2016-2018" __license__ = "AGPL" __email__ = "pyslvs@gmail.com" import yaml from core.QtModules import QObject from core import main_window as mn class YamlEditor(QObject): """YAML reader and...
Python
0
@@ -179,16 +179,45 @@ l.com%22%0A%0A +from typing import Dict, Any%0A import y @@ -2592,32 +2592,223 @@ ve YAML file.%22%22%22 +%0A data = %7B%7D%0A # TODO: Data structure.%0A yaml_script = yaml.dump(data, default_flow_style=True)%0A with open(self.file_name, 'w') as f:%0A f.wr...
fe82dce52884661297ecf640cd3ffd18c76ffc25
change graph access
scdown/neo.py
scdown/neo.py
from py2neo import Graph, Relationship import logging import os try: import json except ImportError: import simplejson as json ID_PROP = "id" NODE_USER = "User" NODE_TRACK = "Track" NODE_COMMENT = "Comment" NODE_PROFILE = "Profile" UNIQUES = [(x, ID_PROP) for x in [NODE_USER, NODE_TRACK, NODE_CO...
Python
0
@@ -12,21 +12,27 @@ import -Graph +ServiceRoot , Relati @@ -961,45 +961,176 @@ raph - = Graph(os.getenv(%22GRAPHENEDB_URL%22)) +enedb_url = os.environ.get(%22GRAPHENEDB_URL%22,%0A %22http://localhost:7474/%22)%0A graph = ServiceRoot(graphenedb_url).graph %0A ...
33d55c74f2c0928c4052c5ae8be6754202616d9a
Add some additional exceptions to images.py.
common/imagenet_server/images.py
common/imagenet_server/images.py
""" Deals with image acquiring and manipulation. """ import httplib import logging import os import re import socket import ssl import urllib2 import urlparse import time import cv2 import numpy as np logger = logging.getLogger(__name__) BAD_IMAGES_DIR = "error_images" # How close an image has to be to a known ...
Python
0
@@ -2503,24 +2503,81 @@ ificateError +,%0A httplib.HTTPException, httplib.IncompleteRead ) as e:%0A
cc9743cabcc53be0e97ff76eca8ef14bdc911e11
fix indentation in plot script
cvpr15_eval/plot_score_vs_ocsvm.py
cvpr15_eval/plot_score_vs_ocsvm.py
#!/usr/bin/env python import os.path import sys sys.path.append('.') sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../toolbox/.') import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import argparse import math import structsvm import trackingfeatures if __name...
Python
0.000013
@@ -2374,16 +2374,20 @@ d = 0.9%0A + def filt @@ -2414,16 +2414,20 @@ precs):%0A + prec @@ -2450,14 +2450,22 @@ + + i = 0%0A + @@ -2516,24 +2516,28 @@ eshold)%0A + + for c in ran @@ -2560,16 +2560,20 @@ + if precs @@ -2605,13 +2605,21 @@ + + i+=1%...
3747f72e81a3c143145dcbbdcfbfc13b292f19e1
add filter plot test
neurodsp/tests/test_plts_filt.py
neurodsp/tests/test_plts_filt.py
""" test_burst.py Test burst detection functions """ import os import numpy as np import neurodsp from .util import _load_example_data def test_detect_bursts_dual_threshold(): """ Confirm consistency in burst detection results on a generated neural signal """ # Load data and ground-truth filtered sig...
Python
0
@@ -2,20 +2,24 @@ %22%22%0Atest_ -burs +plts_fil t.py%0ATes @@ -24,49 +24,29 @@ est -burst detection function +filtering plot s%0A%22%22%22%0A%0A -import os%0A impo @@ -60,22 +60,20 @@ y as np%0A -import +from neurods @@ -77,27 +77,66 @@ odsp -%0Afrom .ut +.filt import filter_signal%0Afrom neurodsp.plts.f il...
3e8bfa86026c9c99d697049acbbfac640bca8af8
Fix test so as to also pass in debug mode
Lib/test/test_cmd_line.py
Lib/test/test_cmd_line.py
# Tests invocation of the interpreter with various command line arguments # All tests are executed with environment variables ignored # See test_cmd_line_script.py for testing of script execution import test.support, unittest import os import sys import subprocess def _spawn_python(*args): cmd_line = [sys.executa...
Python
0
@@ -6378,37 +6378,33 @@ self.assert -Equal +_ (data.st rip(), b'x') @@ -6391,27 +6391,36 @@ (data.st -rip(), b'x' +artswith(b'x'), data )%0A%0A%0Adef
b3e04b7d4c395fdc2ebe1c0e140516d2c1f57a3a
Fix migration to work with Django 1.10
casepro/statistics/migrations/0010_existing_case_timings_count.py
casepro/statistics/migrations/0010_existing_case_timings_count.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from math import ceil from django.db import migrations, models def calculate_totals_for_cases(apps, schema_editor): from casepro.statistics.models import datetime_to_date Case = apps.get_model('cases', 'Case') CaseAction = apps.get_model('ca...
Python
0.000001
@@ -123,16 +123,111 @@ odels%0A%0A%0A +def get_partner(org, user):%0A return user.partners.filter(org=org, is_active=True).first()%0A%0A%0A def calc @@ -3442,16 +3442,33 @@ tion and + get_partner(org, author_ @@ -3488,24 +3488,8 @@ d_by -.get_partner(org ) !=
d3a57fafbbee1959d5369311f53e8fa8166b78ae
Fix typos
rnacentral_pipeline/databases/data/databases.py
rnacentral_pipeline/databases/data/databases.py
# -*- coding: utf-8 -*- from __future__ import annotations """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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/lic...
Python
0.999999
@@ -1085,24 +1085,25 @@ alue(4, %22Ens +e mbl Fungi%22)%0A @@ -1145,16 +1145,17 @@ (5, %22Ens +e mbl Meta
d57c3ad63b737fda4632f5896c8049329bcd4fe2
Make this test work under Windows as well.
Lib/test/test_fpformat.py
Lib/test/test_fpformat.py
''' Tests for fpformat module Nick Mathewson ''' from test_support import run_unittest import unittest from fpformat import fix, sci, NotANumber StringType = type('') # Test the old and obsolescent fpformat module. # # (It's obsolescent because fix(n,d) == "%.*f"%(d,n) and # sci(n,d) =...
Python
0.000001
@@ -959,59 +959,163 @@ ra 0 -%0A expected = expected%5B:-2%5D+'0'+expected%5B-2:%5D + if needed%0A num, exp = expected.split(%22e%22)%0A if len(exp) %3C 4:%0A exp = exp%5B0%5D + %220%22 + exp%5B1:%5D%0A expected = %22%25se%25s%22 %25 (num, exp) %0A%0A
728012090d3f24411e460b99f68f9b5754d38480
Handle character substitution in html formatter
npc/formatters/html.py
npc/formatters/html.py
""" Markdown formatter for creating a page of characters. Has a single entry point `dump`. """ import html import markdown import tempfile from .. import util from mako.template import Template def dump(characters, outstream, *, include_metadata=None, metadata=None, prefs=None): """ Create a markdown charact...
Python
0.000007
@@ -90,16 +90,30 @@ %60.%0A%22%22%22%0A%0A +import codecs%0A import h @@ -1141,16 +1141,256 @@ a = %7B%7D%0A%0A + # encode as ascii unless our stream has an opinion%0A try:%0A encoding = outstream.encoding%0A except AttributeError:%0A encoding = 'ascii'%0A%0A modstream = codecs.getwriter(en...
5f20029756f76380662684969a0235935cfb5f73
Add customer to filter fields list.
nodeconductor/openstack/views.py
nodeconductor/openstack/views.py
import django_filters from rest_framework import viewsets from nodeconductor.core import filters as core_filters from nodeconductor.structure import views as structure_views from nodeconductor.openstack import models, serializers class OpenStackServiceFilter(django_filters.FilterSet): name = django_filters.Char...
Python
0.000001
@@ -679,32 +679,55 @@ 'name',%0A + 'customer'%0A 'cus
d3c7f5de6a4c1d15ab3ffe19da18faaecd466fb6
replace mysteriously missing haystack settings from staging
tndata_backend/tndata_backend/settings/staging.py
tndata_backend/tndata_backend/settings/staging.py
from .base import * DEBUG = False #DEBUG = True STAGING = True # Site's FQDN and URL. For building links in email. SITE_DOMAIN = "staging.tndata.org" SITE_URL = "https://{0}".format(SITE_DOMAIN) INSTALLED_APPS = INSTALLED_APPS + ( 'debug_toolbar', 'querycount', ) # Just like production, but without the cach...
Python
0.000001
@@ -1424,16 +1424,197 @@ = True%0A%0A +# django-haystack settings for staging%0AHAYSTACK_CONNECTIONS%5B'default'%5D%5B'URL'%5D = 'http://worker.tndata.org:9200/'%0AHAYSTACK_CONNECTIONS%5B'default'%5D%5B'INDEX_NAME'%5D = 'haystack_staging'%0A%0A # django
cba82ad3bc1a726402e4193aec8a49a85f9999f0
Add an 'if 0''d block of code to numpy.distutils.log to ignore some log messages. Especially useful to turn on if you're developing by using eggs.
numpy/distutils/log.py
numpy/distutils/log.py
# Colored log, requires Python 2.3 or up. import sys from distutils.log import * from distutils.log import Log as old_Log from distutils.log import _global_log from misc_util import red_text, yellow_text, cyan_text, green_text, is_sequence, is_string def _fix_args(args,flag=1): if is_string(args): return...
Python
0
@@ -582,84 +582,236 @@ -print _global_color_map%5Blevel%5D(msg %25 _fix_args(args))%0A else:%0A +msg = msg %25 _fix_args(args)%0A if 0:%0A if msg.startswith('copying ') and msg.find(' -%3E ') != -1:%0A return%0A if msg.startswith('byte-com...
779bfca2e9fb39d29f644940a1ef5351ec4ced2b
handle fundamental parsing errors in emails
ingestors/email/msg.py
ingestors/email/msg.py
from __future__ import unicode_literals import six import rfc822 import logging from time import mktime from datetime import datetime from collections import defaultdict from normality import safe_filename from flanker import mime from flanker.addresslib import address from flanker.mime.message.errors import DecodingE...
Python
0.000004
@@ -498,32 +498,78 @@ ort HTMLSupport%0A +from ingestors.exc import ProcessingException%0A from ingestors.u @@ -2712,24 +2712,41 @@ temp_dir):%0A + try:%0A msg @@ -2770,16 +2770,125 @@ g(data)%0A + except DecodingError as derr:%0A raise ProcessingException('Cannot parse email...
fadfc73f101915a9d8a9f703e2bfab59bc16f631
Change language code.
src/oauau/settings.py
src/oauau/settings.py
""" Django settings for oauau project. Generated by 'django-admin startproject' using Django 1.8.4. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
Python
0.000003
@@ -2488,13 +2488,13 @@ = ' -en-us +pt-br '%0A%0AT
ec4c9a07dc5ca2fab6b341932f65d0cfbd6a332b
Bump version to 1.1
molly/__init__.py
molly/__init__.py
""" Molly Project http://mollyproject.org A framework for creating Mobile Web applications for HE/FE institutions. """ __version__ = '1.0'
Python
0
@@ -134,6 +134,6 @@ '1. -0 +1 '
75e61ecf5efebe78676512d714fc7551f3dfac4c
Fix test
src/program/lwaftr/tests/subcommands/generate_binding_table_test.py
src/program/lwaftr/tests/subcommands/generate_binding_table_test.py
""" Test uses "snabb lwaftr generate-binding-table" subcommand. Does not need NICs as it doesn't use any network functionality. The command is just to produce a binding table config result. """ from test_env import ENC, SNABB_CMD, BaseTestCase NUM_SOFTWIRES = 10 class TestGenerateBindingTable(BaseTestCase): ge...
Python
0.000004
@@ -30,29 +30,29 @@ enerate- -binding-table +configuration %22 subcom @@ -375,29 +375,29 @@ enerate- -binding-table +configuration ', '193. @@ -564,29 +564,29 @@ enerate- -binding-table +configuration subcomm @@ -619,55 +619,49 @@ -it gets back the number of softwires it expects +the output contains a vali...
f3de5cae870f9df2435ae8587cc7d17d059728b1
Add test, fixed #1073.
playhouse/tests/test_speedups.py
playhouse/tests/test_speedups.py
import datetime import unittest from peewee import * from playhouse import _speedups as speedups from playhouse.tests.base import database_initializer from playhouse.tests.base import ModelTestCase db = database_initializer.get_in_memory_database(use_speedups=True) class BaseModel(Model): class Meta: da...
Python
0
@@ -1069,24 +1069,377 @@ content'%5D)%0A%0A + def test_gh_regression_1073_func_coerce(self):%0A func = fn.GROUP_CONCAT(Note.id).alias('note_ids')%0A query = Note.select(func)%0A self.assertRaises(ValueError, query.get)%0A%0A query = Note.select(func.coerce(False))%0A result = quer...
72e0b19383ed00b83d2a3897d61e5130aea4d736
Change out of the temp directory before deleting
monty/tempfile.py
monty/tempfile.py
""" Temporary directory and file creation utilities. """ from __future__ import absolute_import import os import tempfile import shutil try: from pathlib import Path except ImportError: try: from pathlib2 import Path except ImportError: Path = None from monty.shutil import copy_r __autho...
Python
0
@@ -4791,32 +4791,80 @@ rmtree(tempdir)%0A + %0A os.chdir(self.cwd)%0A shut @@ -4899,34 +4899,16 @@ -os.chdir(self.cwd) %0A
224522e88347d4eafd68202222bb83c2d596524b
Modify SCons tools
conda/python-dev/boost_python.py
conda/python-dev/boost_python.py
from types import MethodType import itertools def generate(env): """Add Builders and construction variables to the Environment.""" if not 'boost_python' in env['TOOLS'][:-1]: env.Tool('system') env.AppendUnique(LIBS = ['boost_python']) env.AppendUnique(CPPDEFINES = ['BOOST_PYTHON_D...
Python
0
@@ -689,34 +689,8 @@ %5D))%0A - print sources%0A @@ -779,81 +779,30 @@ -print sources%0A SYSTEM = env%5B'SYSTEM'%5D%0A print SYSTEM +SYSTEM = env%5B'SYSTEM'%5D %0A
1ca5ba7884d35193f0a035b8e8f6ac4ac6032928
stop cycling after applying the forumla
mpexpertadjust.py
mpexpertadjust.py
#!/usr/bin/env python import os, sys, csv import tkinter, tkinter.messagebox STANDARD_FILE='defstd.txt' STANDARD_NAME=0 STANDARD_ELEMENT=1 STANDARD_QTY=2 SAMPLE_NAME=0 SAMPLE_DATE=2 SAMPLE_ELEMENT=4 SAMPLE_QTY=8 OUTPUT_FILE='output.csv' def is_standard(label, element, standards): """Check if a label is a standard...
Python
0
@@ -2760,28 +2760,39 @@ +','+row%5BSAMPLE_DATE%5D+'%5Cn')%0A +%09%09%09%09break%0A%0A
fc22465decac6a33543e5232097af7ea847c4029
Bump version to 1.0.1-machtfit-41
src/oscar/__init__.py
src/oscar/__init__.py
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 40) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
Python
0
@@ -115,17 +115,17 @@ tfit', 4 -0 +1 )%0A%0A%0Adef
14ee6e2e9986c58fdeb8e482f3426b756ab1d2cb
Bump dev version
mtools/version.py
mtools/version.py
#!/usr/bin/env python3 """Mtools version.""" __version__ = '1.6.4'
Python
0
@@ -60,9 +60,13 @@ '1. -6.4 +7.0-dev '%0A
f83ce11dccd7209e4c124e9dadbcbbd86568e320
Comment reason why the example is commented out
numba/tests/compile_with_pycc.py
numba/tests/compile_with_pycc.py
import cmath import numpy as np from numba import exportmany, export from numba.pycc import CC # # New API # cc = CC('pycc_test_simple') @cc.export('multf', 'f4(f4, f4)') @cc.export('multi', 'i4(i4, i4)') def mult(a, b): return a * b _two = 2 # This one can't be compiled by the legacy API as it doesn't exec...
Python
0.000008
@@ -1127,16 +1127,56 @@ rr%5B-1%5D%0A%0A +# Fails because it needs an environment%0A #@cc_nrt @@ -1191,24 +1191,27 @@ 'zeros', 'f8 +%5B:%5D (i4)')%0A#def @@ -1214,67 +1214,41 @@ def -empty_scalar(n):%0A #arr = np.empty(n)%0A #return arr%5B-1%5D +zeros(n):%0A #return np.zeros(n) %0A%0A%0A#
2f55f00c17b51f24b5407182516c22baead08879
remove BeautifulSoup for now
plugins/slideshare/slideshare.py
plugins/slideshare/slideshare.py
#!/usr/bin/env python import urllib2 import re import urllib import time import sha import BeautifulSoup from BeautifulSoup import BeautifulStoneSoup from optparse import OptionParser TOTALIMPACT_SLIDESHARE_KEY = "nyHCUoNM" TOTALIMPACT_SLIDESHARE_SECRET = "z7sRiGCG" SLIDESHARE_DOI_URL = "http://www.slideshare.net/a...
Python
0
@@ -78,16 +78,17 @@ ort sha%0A +# import B @@ -100,16 +100,17 @@ fulSoup%0A +# from Bea
63a3e6e0c65fa17e6abe58da06b4bdfa20c62bfe
Add onchange for set vector in orders
mx_agent/agent.py
mx_agent/agent.py
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Python
0
@@ -1692,32 +1692,710 @@ up from partner%0A + def on_change_partner_id(self, cr, uid, ids, partner_id, context=None):%0A res = super(SaleOrder, self).on_change_partner_id(%0A cr, uid, ids, partner_id, context=context)%0A %0A %0A # Update agent field for partner form%0A ...
6eedd6e5b96d9ee051e7708c4c127fdfb6c2a92b
modify file : add class Report and Score
NippoKun/report/models.py
NippoKun/report/models.py
from django.db import models # Create your models here.
Python
0
@@ -1,8 +1,52 @@ +from django.contrib.auth.models import User%0A from dja @@ -67,16 +67,17 @@ models%0A%0A +%0A # Create @@ -95,8 +95,727 @@ s here.%0A +%0A%0Aclass Report(models.Model):%0A report_author = models.ForeignKey(User, related_name='report_author')%0A report_title = models.CharField(max_length=50)%...
88d2918606870ef7bdaafda87b37537d21c02036
Extend failed and end with traceback
polyaxon_client/tracking/base.py
polyaxon_client/tracking/base.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import atexit import sys import time from polystores.stores.manager import StoreManager from polyaxon_client import PolyaxonClient, settings from polyaxon_client.exceptions import PolyaxonClientException from polyaxon_client.tra...
Python
0
@@ -2545,32 +2545,48 @@ us, message=None +, traceback=None ):%0A if se @@ -2731,24 +2731,31 @@ tatus(status +=status , message)%0A @@ -2751,16 +2751,45 @@ message +=message, traceback=traceback )%0A @@ -3135,24 +3135,40 @@ message=None +, traceback=None ):%0A i @@ -3254,16 +3254,37 @@ =me...
a2eae87fc76ba1e9fbfa8102c3e19c239445a62a
Fix form retrieval in ModelForm
nazs/web/forms.py
nazs/web/forms.py
from achilles.forms import * # noqa from nazs.models import SingletonModel # Override forms template Form.template_name = 'web/form.html' class ModelForm(ModelForm): def get_form(self, form_data=None, *args, **kwargs): # manage SingletonModels if issubclass(self.form_class.Meta.model, Singleto...
Python
0.000002
@@ -508,16 +508,27 @@ et_form( +form_data, *args, *
a4ee20e078175c5d75380afca7b02305440ab32f
Add a couple numeric columns to better portray overall performance.
postgresql/test/perf_query_io.py
postgresql/test/perf_query_io.py
#!/usr/bin/env python ## # copyright 2009, James William Pye # http://python.projects.postgresql.org ## # Statement I/O: Mass insert and select performance ## import os import time import sys def insertSamples(count, insert_records): recs = [ (-3, 123, 0xfffffea023, 'some_óäæ_thing', 'varying', 'æ') for x in rang...
Python
0
@@ -184,16 +184,31 @@ port sys +%0Aimport decimal %0A%0Adef in @@ -278,16 +278,84 @@ ffea023, + decimal.Decimal(%2290900023123.40031%22), decimal.Decimal(%22432.40031%22), 'some_%C3%B3 @@ -1244,16 +1244,39 @@ i8 int8, + n numeric, n2 numeric, t text, @@ -1377,16 +1377,24 @@ , $5, $6 +, $7, $8 )%22%0A%09)%0A%0...
475b4dfa711d475d57b1f6712b6286d8310a6945
Update help text
src/penn_chime/cli.py
src/penn_chime/cli.py
"""Command line interface.""" from argparse import ( Action, ArgumentParser, ) from datetime import datetime from pandas import DataFrame from .constants import CHANGE_DATE from .parameters import Parameters, RateDays from .models import SimSirModel as Model class FromFile(Action): """From File.""" ...
Python
0
@@ -1872,16 +1872,24 @@ None, %22 +Average Hospital @@ -2133,24 +2133,32 @@ , 0, None, %22 +Average Days in ICU%22 @@ -2874,16 +2874,24 @@ None, %22 +Average Days on
b6dff8fcd7dec56703006f2a7bcf1c8c72d0c21b
FIX price sec. related field as readonly
price_security/models/invoice.py
price_security/models/invoice.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api class ac...
Python
0.000003
@@ -845,16 +845,39 @@ rices',%0A + readonly=True,%0A
fb142d3324ca974c9308cb8ab18dd9db2c2aae0b
Use monospace font
editor.py
editor.py
#!/usr/bin/env python import sys import sip sip.setapi('QString', 2) from PyQt4.QtGui import QApplication, QPlainTextEdit, QSyntaxHighlighter, \ QTextCharFormat, QTextBlockUserData from qutepart.SyntaxHighlighter import SyntaxHighlighter from qutepart.syntax_manager import SyntaxManager def main(): if len...
Python
0.000001
@@ -102,16 +102,23 @@ ication, + QFont, QPlainT @@ -798,24 +798,60 @@ e(filePath)%0A + pte.setFont(QFont(%22Monospace%22))%0A %0A hl
a098efa1b69d2de3b1e2437a056b0c6937cbf998
add documentation
src/bat/images.py
src/bat/images.py
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2012 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' This is a plugin for the Binary Analysis Tool. It generates images of files, both full files and thumbnails. The files can be used for infor...
Python
0
@@ -428,16 +428,330 @@ ,%0Aetc.%0A%0A +It also generates histograms, which show how different byte values are distributed.%0AThis can provide another visual clue about how files are constructed. Binaries from%0Athe same type (like ELF binaries) are actually quite similar, so binaries that%0Asignificantly deviate from ...
7a60bd74b3af40223553c64dafed07c46c5db639
add a --jit commandline option
prolog/targetprologstandalone.py
prolog/targetprologstandalone.py
""" A simple standalone target for the prolog interpreter. """ import sys from prolog.interpreter.translatedmain import repl, execute # __________ Entry point __________ from prolog.interpreter.continuation import Engine from prolog.interpreter import term from prolog.interpreter import arithmetic # for side effec...
Python
0.000002
@@ -218,16 +218,27 @@ t Engine +, jitdriver %0Afrom pr @@ -476,54 +476,463 @@ -if len(argv) == 2:%0A execute(e, argv%5B1%5D) +# XXX crappy argument handling%0A for i in range(len(argv)):%0A if argv%5Bi%5D == %22--jit%22:%0A if len(argv) == i + 1:%0A print %22missing ar...
21eba24ffedf90046540bd9d400dce60b84cfac6
Change where kwargs go
src/pybel/io/lines.py
src/pybel/io/lines.py
# -*- coding: utf-8 -*- """This module contains IO functions for BEL scripts""" import codecs import logging import os from .line_utils import parse_lines from ..struct import BELGraph from ..utils import download __all__ = [ 'from_lines', 'from_path', 'from_url' ] log = logging.getLogger(__name__) d...
Python
0.000015
@@ -1349,45 +1349,46 @@ to -pass to :class:%60networkx.MultiDiGraph +:func:%60pybel.io.line_utils.parse_lines %60%0A @@ -1460,24 +1460,16 @@ ELGraph( -**kwargs )%0A pa @@ -1801,24 +1801,41 @@ validation,%0A + **kwargs%0A )%0A re
5087e961e45ed9c8cdb168da3ba480ee65a43644
Allow setting ES config, and convert results to utf-8 if needed
nlpipe/backend.py
nlpipe/backend.py
""" Useful functions for communication with elastic NLPipe assumes that raw texts are stored in an elastic index (see esconfig). If multiple fields are specified, and/or a field contains multiple results, they are joined with empty lines in between (e.g. "\n\n".join) Results are stored in a separate document type per...
Python
0
@@ -838,16 +838,170 @@ set()%0A%0A +def set_esconfig(host, port):%0A %22%22%22%0A Set the (global) es config%0A %22%22%22%0A global _es%0A _es = Elasticsearch(%5B%7B%22host%22: host, %22port%22: int(port)%7D%5D)%0A%0A def _che @@ -2864,24 +2864,142 @@ g(doc_type)%0A + if isinstance(result, bytes):...
3f1f86c358efc6d38012191c4b613aa775861805
Fix 'graph3d.py' to read from VTKData directory
Examples/Infovis/Python/graph3d.py
Examples/Infovis/Python/graph3d.py
from vtk import * reader = vtkXGMLReader() reader.SetFileName("fsm.gml") reader.Update() strategy = vtkSpanTreeLayoutStrategy() strategy.DepthFirstSpanningTreeOn() view = vtkGraphLayoutView() view.AddRepresentationFromInputConnection(reader.GetOutputPort()) view.SetVertexLabelArrayName("vertex id") view.SetVertexL...
Python
0
@@ -10,16 +10,90 @@ import * +%0Afrom vtk.util.misc import vtkGetDataRoot%0AVTK_DATA_ROOT = vtkGetDataRoot() %0A%0Areader @@ -130,17 +130,47 @@ ileName( -%22 +VTK_DATA_ROOT + %22/Data/Infovis/ fsm.gml%22
0cd2af0f20b6b544f0d36140a098ca8e3058d8fa
Update constants
node/constants.py
node/constants.py
######### KADEMLIA CONSTANTS ########### #: Small number Representing the degree of parallelism in network calls alpha = 3 #: Maximum number of contacts stored in a bucket; this should be an even number k = 8 # Delay between iterations of iterative node lookups (for loose parallelism) (in seconds) iterativeLookupDe...
Python
0.000001
@@ -205,16 +205,79 @@ %0Ak = 8%0A%0A +#: Timeout for network operations (in seconds)%0ArpcTimeout = 5%0A%0A # Delay @@ -1068,8 +1068,174 @@ meout/5%0A +%0A#: Max size of a single UDP datagram, in bytes. If a message is larger than this, it will%0A#: be spread accross several UDP packets.%0AudpDatagramMaxSize = 8192...
8765ac953047ba1c63eb2eb2eb087ba92e9213bc
fix switch template
Firefly/core/templates/__init__.py
Firefly/core/templates/__init__.py
# -*- coding: utf-8 -*- # @Author: Zachary Priddy # @Date: 2016-04-12 13:33:30 # @Last Modified by: Zachary Priddy # @Last Modified time: 2016-04-12 13:33:30 class Templates(object): def __init__(self): self._filepath = 'core/templates/' self._switch_template = self.get_template('switch') def get_tem...
Python
0.000001
@@ -643,16 +643,25 @@ ._switch +_template %0A%0A%0AffTem
85fe9b8b48b565488406343de41fa77b41357e4a
define skip
ooiservices/tests/test_models.py
ooiservices/tests/test_models.py
#!/usr/bin/env python ''' unit testing for the model classes. ''' __author__ = 'M@Campbell' import unittest from flask import url_for from ooiservices.app import create_app, db from ooiservices.app.models import Array, InstrumentDeployment, PlatformDeployment, Stream, \ StreamParameter, User, OperatorEvent, OperatorE...
Python
0.000207
@@ -337,16 +337,44 @@ zation%0A%0A +from unittest import skipIf%0A '''%0AThes
b87b63db7e99a867ec163574ce1d13ab13285f36
Remove minor troubleshooting accidently committed
ironic/cmd/status.py
ironic/cmd/status.py
# Copyright (c) 2018 NEC, Corp. # # 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 agr...
Python
0.00002
@@ -4069,103 +4069,8 @@ r()%0A - print('####################################################33')%0A print(results)%0A
03f9fe8ad1d52f15808e46440b14f9e9ae887448
Install EPEL into non-Fedora containers
container/generate-dockerfile.py
container/generate-dockerfile.py
#!/usr/bin/python import argparse labels = [ ("com.redhat.component", "openscap-docker"), ("name", "openscap"), ("version", "testing"), ("architecture", "x86_64"), ("summary", "OpenSCAP container image that provides security/compliance scanning capabilities for 'atomic scan'"), ("description",...
Python
0
@@ -4699,16 +4699,154 @@ ckage)%0A%0A + if args.base != %22fedora%22:%0A f.write(%22RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm%5Cn%5Cn%22)%0A%0A # ad
38de795103748ca757a03a62da8ef3d89b0bf682
Fix bug that prevent commands with no values from being added
GoProController/models.py
GoProController/models.py
from django.db import models class Camera(models.Model): ssid = models.CharField(max_length=255) password = models.CharField(max_length=255) date_added = models.DateTimeField(auto_now_add=True) last_attempt = models.DateTimeField(auto_now=True) last_update = models.DateTimeField(null=True, blank=T...
Python
0
@@ -817,32 +817,44 @@ odels.CharField( +blank=True, max_length=255)%0A
e1ad05fb19577aa108b94ea500106e36b29915fc
update indentation
amount_raised_by_candidate.py
amount_raised_by_candidate.py
# Written by Jonathan Saewitz, released May 24th, 2016 for Statisti.ca # Released under the MIT License (https://opensource.org/licenses/MIT) import csv, plotly.plotly as plotly, plotly.graph_objs as go, requests from bs4 import BeautifulSoup candidates=[] with open('presidential_candidates.csv', 'r') as f: reader=...
Python
0.000001
@@ -713,22 +713,20 @@ %0A%09%09%09%09%09%09%09 -%09%09%09%09%09%09 + #the can
0617c9a8bc320e0919f6dbf231b187c1d299525c
Include target variance in table.
analysis/process-movements.py
analysis/process-movements.py
#!/usr/bin/env python import climate import itertools import joblib import lmj.pca import os import pandas as pd import random import database logging = climate.get_logger('compress') MARKERS = [ 'marker00-r-head-back', 'marker01-r-head-front', 'marker02-l-head-front', 'marker03-l-head-back', 'm...
Python
0
@@ -3589,16 +3589,94 @@ trials%5D +%0A probes = (variance, 0.5, 0.8, 0.9, 0.95, 0.98, 0.99, 0.995, 0.998, 0.999) %0A%0A # @@ -3748,17 +3748,17 @@ N = -2 +3 %0A pca @@ -4187,62 +4187,14 @@ in -(0.5, 0.8, 0.9, 0.95, 0.98, 0.99, 0.995, 0.998, 0.999) +probes :%0A @@ -4508,62 +4508,14 @@ in -(0....
e7163abf13e5cec78f3cd894bd3b8393f9cea6d2
Fix counting total samples in cast view.
genome_designer/main/data_util.py
genome_designer/main/data_util.py
""" Common methods for getting data from the backend. These methods are intended to be used by both views.py, which should define only pages, and xhr_handlers.py, which are intended to respond to AJAX requests. This module interacts closely with the ModelViews in model_views.py. """ from collections import defaultdi...
Python
0
@@ -2636,14 +2636,8 @@ ing -other colu @@ -2690,16 +2690,52 @@ example, + in this initial%0A implementation, the 'ex @@ -2754,20 +2754,16 @@ ple_uid' -%0A column @@ -2770,20 +2770,16 @@ becomes -the 'total_s @@ -3315,52 +3315,182 @@ d'%5D%0A - total_samples = len(result_row_list) +%0A ...
928cb2244de7a167a754f3cf303a913d814afc66
Use C json encoder
openfisca_web_api/wsgihelpers.py
openfisca_web_api/wsgihelpers.py
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify # it ...
Python
0.000002
@@ -4231,16 +4231,18 @@ ers)%0A + # try:%0A @@ -4238,24 +4238,26 @@ # try:%0A + # text = @@ -4330,16 +4330,18 @@ = 2)%0A + # except @@ -4359,24 +4359,26 @@ deError:%0A + # text = @@ -4423,24 +4423,52 @@ indent = 2)%0A + text = json.dumps(data)%0A text = u
a391da79f8213d26246234e489d0947b8b4b2a82
Update to allo no CSRF when logining in on mobile
OctaHomeCore/authviews.py
OctaHomeCore/authviews.py
from django.contrib.auth import authenticate, login, logout from OctaHomeCore.baseviews import * from OctaHomeCore.models import * class handleLoginView(viewRequestHandler): loginToken = '' def handleRequest(self): if self.Request.user.is_authenticated(): return super(handleLoginView, self).handleRequest() ...
Python
0
@@ -123,16 +123,69 @@ import * +%0Afrom django.views.decorators.csrf import csrf_exempt %0A%0Aclass @@ -1831,32 +1831,167 @@ equestHandler):%0A +%09@csrf_exempt%0A%09def post(self, request, *args, **kwargs):%0A%09%09return super(handleLoginView, self).post(self, request, *args, **kwargs)%0A%09%09%0A %09def handleR...
caff96633ce29a2139bc61bb5ee333efd69d50ef
Remove default classifier path from default config
processmysteps/default_config.py
processmysteps/default_config.py
""" Base line settings """ CONFIG = { 'input_path': None, 'backup_path': None, 'dest_path': None, 'life_all': None, 'db': { 'host': None, 'port': None, 'name': None, 'user': None, 'pass': None }, # 'preprocess': { # 'max_acc': 30.0 # }, ...
Python
0.000001
@@ -851,16 +851,21 @@ _path': +None# 'classif
2aaa2c6794176a9867d10d3a32a48ee5b8cef7f5
version 0.17.0
crontabber/__init__.py
crontabber/__init__.py
__version__ = '0.16.1'
Python
0.000001
@@ -15,9 +15,9 @@ '0.1 -6.1 +7.0 '%0A
22f9b4bacbb0662d3c4de67218ff43cea9588f66
Add keyword argument handling to unicode decorator
crypto_enigma/utils.py
crypto_enigma/utils.py
#!/usr/bin/env python # encoding: utf8 # Copyright (C) 2015 by Roy Levien. # This file is part of crypto-enigma, an Enigma Machine simulator. # released under the BSD-3 License (see LICENSE.txt). """ Description .. note:: Any additional note. """ from __future__ import (absolute_import, print_function, division...
Python
0.000001
@@ -1435,18 +1435,20 @@ igma.py) +%0A# -- http:// @@ -1483,16 +1483,88 @@ /656912%0A +# http://code.activestate.com/recipes/454322-type-checking-decorator/%0A def requ @@ -1623,24 +1623,35 @@ func_, *args +, **kwargs ):%0A d @@ -1663,24 +1663,34 @@ dified(*args +, **kwargs ):%0A @@ -1850...
d8fc3888f0b40a8b7a476fc3fec0ca3dfe7a2416
make API able to work with single names
gender.py
gender.py
import requests, json def getGenders(names): url = "" cnt = 0 for name in names: if url == "": url = "name[0]=" + name else: cnt += 1 url = url + "&name[" + str(cnt) + "]=" + name req = requests.get("http://api.genderize.io?" + url) results = json.loads(req.text) retrn = [] for result in resu...
Python
0
@@ -58,16 +58,69 @@ cnt = 0%0A +%09if not isinstance(names,list):%0A%09%09names = %5Bnames,%5D%0A%09%0A %09for nam @@ -131,16 +131,16 @@ names:%0A - %09%09if url @@ -333,16 +333,61 @@ q.text)%0A +%09if len(names)==1 :%0A%09%09results = %5B results, %5D%0A %09%0A%09retrn @@ -621,17 +621,17 @@ :%0A%09print - +( ...
1933f6d3f97846a860a1b12ab25003cb807f3b4e
add rankings and alliances to csv backup
controllers/backup_controller.py
controllers/backup_controller.py
import cloudstorage import csv import os from google.appengine.api import taskqueue from google.appengine.ext import ndb from google.appengine.ext import webapp from google.appengine.ext.webapp import template from models.award import Award from models.event import Event from models.match import Match class TbaCSVB...
Python
0
@@ -1114,12 +1114,8 @@ hes, - and tea @@ -1120,16 +1120,56 @@ eam list +, rankings, and alliance selection order %0A %22%22%22 @@ -1555,24 +1555,294 @@ , event_key) +%0A RANKINGS_FILENAME_PATTERN = '/tbatv-prod-hrd.appspot.com/tba-data-backup/%7B%7D/%7B%7D/%7B%7D_rankings.csv' # %25 (year, event_key, event...
1564cd721b9ca4c2eaa98a7ac999a3bd5531a4a8
Update batch.py
tensorflow/contrib/learn/python/learn/dataframe/transforms/batch.py
tensorflow/contrib/learn/python/learn/dataframe/transforms/batch.py
# Copyright 2015 The TensorFlow Authors. 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 applica...
Python
0.000001
@@ -12,9 +12,9 @@ 201 -5 +6 The
fc6c6f9ecbf694198c650cf86151423226304c51
put import statement in try
alphatwirl/delphes/load_delphes.py
alphatwirl/delphes/load_delphes.py
# Tai Sakuma <tai.sakuma@cern.ch> import ROOT _loaded = False ##__________________________________________________________________|| def load_delphes(): global _loaded if _loaded: return # https://root.cern.ch/phpBB3/viewtopic.php?t=21603 ROOT.gInterpreter.Declare('#include "classes/DelphesC...
Python
0.000001
@@ -27,16 +27,25 @@ ern.ch%3E%0A +try:%0A import R @@ -47,16 +47,45 @@ ort ROOT +%0Aexcept ImportError:%0A pass %0A%0A_loade
1eb648b14c52c9a2e715774ec71b2c8e6228efc4
add vtkNumpy.numpyToImageData() function
src/python/director/vtkNumpy.py
src/python/director/vtkNumpy.py
from director.shallowCopy import shallowCopy import director.vtkAll as vtk from vtk.util import numpy_support import numpy as np def numpyToPolyData(pts, pointData=None, createVertexCells=True): pd = vtk.vtkPolyData() pd.SetPoints(getVtkPointsFromNumpy(pts.copy())) if pointData is not None: for ...
Python
0.000004
@@ -568,16 +568,422 @@ rn pd%0A%0A%0A +def numpyToImageData(img, flip=True, vtktype=vtk.VTK_UNSIGNED_CHAR):%0A if flip:%0A img = np.flipud(img)%0A height, width, numChannels = img.shape%0A image = vtk.vtkImageData()%0A image.SetDimensions(width, height, 1)%0A image.AllocateScalars(vtktype, numCha...
981e9a2348953374cc18669318d1d7e92197e0e1
Update clinical trials
providers/gov/clinicaltrials/normalizer.py
providers/gov/clinicaltrials/normalizer.py
import pendulum from share.normalize import * class Tag(Parser): name = ctx class ThroughTags(Parser): tag = Delegate(Tag, ctx) class AgentIdentifier(Parser): # email address uri = IRI(ctx) class WorkIdentifier(Parser): uri = IRI(ctx) class AffiliatedAgent(Parser): schema = GuessAgent...
Python
0
@@ -1306,24 +1306,87 @@ son, ctx)%0A%0A%0A +class Funder(Parser):%0A agent = Delegate(Institution, ctx)%0A%0A%0A class Creati @@ -1887,27 +1887,22 @@ elegate( -Institution +Funder ),%0A
f95ab3d2e9a9fc7c92698aded033f4860225c718
Add rate reporting for oadoi importer
backend/oadoi.py
backend/oadoi.py
# -*- encoding: utf-8 -*- import gzip import json from django.db import DataError from papers.models import Paper from papers.models import OaiSource from papers.baremodels import BareOaiRecord from papers.doi import doi_to_crossref_identifier from papers.doi import doi_to_url from papers.doi import to_doi from back...
Python
0
@@ -76,16 +76,46 @@ ataError +%0Afrom datetime import datetime %0A%0Afrom p @@ -1049,32 +1049,97 @@ db%0A %22%22%22%0A + last_rate_report = None%0A report_batch_size = 1000%0A with gzi @@ -1166,16 +1166,16 @@ ) as f:%0A - @@ -1459,13 +1459,25 @@ x %25 -10000 +report_batch_...
5f522cf58a1566513e874002bdaeb063e8a02497
Update model and add TODO
server/models/checkup.py
server/models/checkup.py
# -*- coding: utf-8 -*- from datetime import datetime from app import db class Checkup(db.Model): __tablename__ = 'checkup' id = db.Column(db.Integer, primary_key=True) created = db.Column(db.DateTime, default=datetime.utcnow) repo_name = db.Column(db.String, unique=True) # github-user/repo-name ...
Python
0
@@ -244,77 +244,144 @@ -repo_name = db.Column(db.String, unique=True) # github-user/repo-name +# TODO: add one unique constraint on the column group of owner and repo%0A owner = db.Column(db.String)%0A repo = db.Column(db.String) %0A
2f61692dd05f2ef529c9d2556c59eb7bc720b1f7
Fixed? reset password
oclubs/access/email.py
oclubs/access/email.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # """ Module to send emails. This module sends emails with either Postfix or SendGrid. """ from __future__ import absolute_import, unicode_literals import traceback from envelopes import Envelope, SMTP from oclubs.access.delay import delayed_func from_email = ('no-re...
Python
0.999775
@@ -620,17 +620,22 @@ TP(' -127.0.0.1 +connect.shs.cn ', 2
fb1ddcdd789d1c1be02a9f6d63a21548a8cf584e
Fix undo of PlatformPhysicsOperation after the SceneNode changes
printer/PlatformPhysicsOperation.py
printer/PlatformPhysicsOperation.py
from UM.Operations.Operation import Operation from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation from UM.Operations.TranslateOperation import TranslateOperation from UM.Operations.GroupedOperation import GroupedOperation ## A specialised operation designed specifically to modify the previous operat...
Python
0
@@ -475,43 +475,35 @@ lf._ -transform = node.getLocalTransforma +old_position = node.getPosi tion @@ -515,24 +515,28 @@ self._ +new_ position = n @@ -648,43 +648,35 @@ .set -LocalTransformation(self._transform +Position(self._old_position )%0A%0A @@ -727,24 +727,28 @@ ition(self._ +new_ position)%0A%0A
8b3952176203149adc06c2219e29ad72812208b6
Add doc to get_scans_cache for #267
src/scancode/cache.py
src/scancode/cache.py
# # Copyright (c) 2016 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
Python
0
@@ -7005,48 +7005,124 @@ che( -):%0A return ScanCache(cache_dir=scans_ +cache_dir=scans_cache_dir):%0A %22%22%22%0A Return a new unique persistent cache instance.%0A %22%22%22%0A return ScanCache( cach
e89c20e1ecfadb7e63a1fe80d821afafb8860352
add missing import
tfx/experimental/templates/taxi/launcher/stub_component_launcher.py
tfx/experimental/templates/taxi/launcher/stub_component_launcher.py
# Lint as: python3 # Copyright 2020 Google 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
Python
0.000042
@@ -855,16 +855,77 @@ launcher +%0Afrom tfx.experimental.templates.taxi.pipeline import configs %0A%0Aclass
a791f0f6823c48a6f5671c0fc4f676f203354a02
Use absolute paths for static and media.
eggtimer/settings.py
eggtimer/settings.py
# Django settings for eggtimer project. import dateutil.parser import os import dj_database_url from email.utils import formataddr HOME_DIR = os.path.expanduser("~") BASE_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir)) ADMINS = ( (os.environ.get('ADMIN_NAME', 'admin'), os.environ....
Python
0
@@ -3509,16 +3509,39 @@ C_ROOT = + os.path.join(BASE_DIR, 'static @@ -3546,16 +3546,17 @@ icfiles' +) %0ASTATIC_ @@ -3939,16 +3939,39 @@ OT = + os.path.join(BASE_DIR, 'media' %0AMED @@ -3966,16 +3966,17 @@ 'media' +) %0AMEDIA_U
7f4a02f7058c4e7dfd4bbb01ba847e6990b5e391
update admin
corehq/apps/userreports/admin.py
corehq/apps/userreports/admin.py
from __future__ import absolute_import, unicode_literals from django.contrib import admin from .models import AsyncIndicator, DataSourceActionLog, InvalidUCRData @admin.register(AsyncIndicator) class AsyncIndicatorAdmin(admin.ModelAdmin): model = AsyncIndicator list_display = [ 'doc_id', 'do...
Python
0
@@ -1197,24 +1197,51 @@ 'action',%0A + 'skip_destructive'%0A %5D%0A li @@ -1278,16 +1278,36 @@ 'action' +, 'skip_destructive' )%0A se
00f4106ad6bfcaf4f7bd74adca67b14065b760bc
Rename SETTINGS_PATH to PROJECT_PATH
onlineweb4/settings.py
onlineweb4/settings.py
import os TEST_RUNNER = "django_nose.NoseTestSuiteRunner" DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS SETTINGS_PATH = os.path.realpath(os.path.dirname(__file__)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add...
Python
0.001811
@@ -173,16 +173,15 @@ NS%0A%0A -SETTINGS +PROJECT _PAT
c10f222bb6de5150087a2ddd26ffbef2f8eeb4a3
break down method
corehq/apps/users/permissions.py
corehq/apps/users/permissions.py
from collections import namedtuple from corehq import privileges, toggles from corehq.apps.accounting.utils import domain_has_privilege FORM_EXPORT_PERMISSION = 'corehq.apps.reports.standard.export.ExcelExportReport' DEID_EXPORT_PERMISSION = 'corehq.apps.reports.standard.export.DeidExportReport' CASE_EXPORT_PERMISSIO...
Python
0.028979
@@ -2309,16 +2309,257 @@ pp_id):%0A + if _can_manage_releases_for_all_apps(couch_user, domain):%0A return True%0A role = couch_user.get_role(domain)%0A return app_id in role.permissions.manage_releases_list%0A%0A%0Adef _can_manage_releases_for_all_apps(couch_user, domain):%0A from @@ -2806,62 +280...
57e610836297ef136b892ea1cdea5fe9109c45fa
Change the way that test objects are named.
integration/testing.py
integration/testing.py
# Copyright (c) 2016 Canonical Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
0.000002
@@ -602,16 +602,28 @@ icense.%0A +import uuid%0A import u @@ -630,16 +630,16 @@ nittest%0A - %0Afrom py @@ -958,16 +958,185 @@ nt.api%0A%0A + def generate_object_name(self):%0A test = self.id().split('.')%5B-1%5D%0A rando = str(uuid.uuid1()).split('-')%5B-1%5D%0A return '%7B%7D-%7B%7D'.form...
8ef9164deda887ccbef71787e91501578aae2053
Version bump
cubric_mrs/_version.py
cubric_mrs/_version.py
__version__ = "0.1.1"
Python
0
@@ -12,10 +12,10 @@ = %220.1. -1 +2 %22
3010b87ba1c377ce6b98285b5dc88b60e96e7e8a
Delete error handle
cupy/sorting/search.py
cupy/sorting/search.py
import cupy from cupy import core from cupy.core import fusion def argmax(a, axis=None, dtype=None, out=None, keepdims=False): """Returns the indices of the maximum along an axis. Args: a (cupy.ndarray): Array to take argmax. axis (int): Along which axis to find the maximum. ``a`` is flattene...
Python
0.000001
@@ -1385,133 +1385,8 @@ s)%0A%0A - mask = cupy.isnan(a)%0A%0A if cupy.any(cupy.all(mask, axis=axis)):%0A raise ValueError('All-NaN slice encountered')%0A%0A @@ -1402,36 +1402,45 @@ gmax(cupy.where( -mask +cupy.isnan(a) , cupy.inf, a), @@ -2779,133 +2779,8 @@ s)%0A%0A - mask = cupy.isnan(a)%0A...
67e3a95d7c3227da0b8a06dc29f0e9e868e55153
Check file size before calculating md5sum.
danbooru/downloader.py
danbooru/downloader.py
# -*- coding: utf-8 -*- # Copyright 2012 codestation # # 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 app...
Python
0
@@ -710,16 +710,25 @@ le, join +, getsize %0Afrom ur @@ -1692,19 +1692,8 @@ if -nohash and isfi @@ -1726,144 +1726,154 @@ -#logging.debug(%22(%25i) %25s already exists, skipping%22 %25 (self._total, filename))%0A #self._total += 1%0A continue%0A +if getsize(filename) == dl.ima...
5450303c975e34265f6fda3c014b9aed7d002a3c
Fix download path, the existing one has been removed from nvidia's site (#10253)
var/spack/repos/builtin/packages/cudnn/package.py
var/spack/repos/builtin/packages/cudnn/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Cudnn(Package): """NVIDIA cuDNN is a GPU-accelerated library of primitives for deep ne...
Python
0
@@ -456,25 +456,24 @@ url='http -s ://developer @@ -465,32 +465,41 @@ ttp://developer. +download. nvidia.com/compu @@ -505,60 +505,26 @@ ute/ -machine-learning/cudnn/secure/v7.3.0/prod/9.0_201892 +redist/cudnn/v7.3. 0/cu
bb042f7bd76e364c3be6791c580b9426a4007627
fix url and add shared variant (#5358)
var/spack/repos/builtin/packages/latte/package.py
var/spack/repos/builtin/packages/latte/package.py
############################################################################## # Copyright (c) 2017, Los Alamos National Security, LLC # Produced at the Los Alamos National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # # For details, ...
Python
0
@@ -1354,38 +1354,36 @@ %22https://git -la +hu b.com/ -exaalt +lanl /latte%22%0A @@ -1401,38 +1401,36 @@ %22https://git -la +hu b.com/ -exaalt +lanl /latte/tags/ @@ -1426,18 +1426,21 @@ latte/ta -gs +rball /v1.0%22%0A%0A @@ -1482,22 +1482,20 @@ /git -la +hu b.com/ -exaalt +lanl /lat @@ -1511,214 +1511,82...
08b5b565666d42a6802e136fc8e7cf8d355929b0
add v2019.1 and v2020.1 (#17648)
var/spack/repos/builtin/packages/qhull/package.py
var/spack/repos/builtin/packages/qhull/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Qhull(CMakePackage): """Qhull computes the convex hull, Delaunay triangulation, Voronoi ...
Python
0
@@ -792,16 +792,358 @@ l.org%22%0A%0A + version('2020.1', sha256='1ac92a5538f61e297c72aebe4d4ffd731ceb3e6045d6d15faf1c212713798df4',%0A url=%22http://www.qhull.org/download/qhull-2020-src-8.0.0.tgz%22)%0A version('2019.1', sha256='2b7990558c363076261564f61b74db4d0d73b71869755108a469038c07dc43fb',%0A ...
13e5c3fbe23e3f57503064bf2c3d7c0a3713101a
build vtk without mpi support (#9649)
var/spack/repos/builtin/packages/visit/package.py
var/spack/repos/builtin/packages/visit/package.py
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Visit(CMakePackage): """VisIt is an Open Source, interactive, scalable, visualization, ...
Python
0
@@ -1364,16 +1364,20 @@ ~opengl2 +~mpi ')%0A d
1f6b1d2aca3995a4ac295f7e6a8ab6bf84d6e79b
add logging for ShotDetectorPlotService
shot_detector/services/shot_detector_service.py
shot_detector/services/shot_detector_service.py
# -*- coding: utf8 -*- from __future__ import absolute_import, division, print_function import time from shot_detector.detectors import SimpleDetector from .base_detector_service import BaseDetectorService from .plot_service import PlotService from shot_detector.utils.common import yes_no class ShotDetectorPlotSer...
Python
0
@@ -90,20 +90,23 @@ %0Aimport -time +logging %0A%0Afrom s @@ -291,16 +291,80 @@ yes_no%0A%0A +%0Afrom shot_detector.utils.log_meta import log_method_call_with%0A%0A class Sh @@ -815,17 +815,16 @@ wargs):%0A -%0A @@ -987,33 +987,32 @@ lt=0,%0A )%0A -%0A parser.a @@ -1166,33 +1166,32 @@ ...
6f05fa90a2134c24c753a50a43e91522531c72b6
update update
wsgi/usgs_update_02.py
wsgi/usgs_update_02.py
# Parse USGS JSON files # Populates the sites using the original URL requests # USGS site doesn't seem to let you just dump everything # For this purpose we use the hydrological are # This value goes from 01 to 21 and makes it easy to construct a series of operations # This version creates a customized dump because Mo...
Python
0.000001
@@ -1,8 +1,31 @@ +#!/usr/bin/env python%0A%0A # Parse
8b325f04f84259f287a1da78ef63f67eb14d525d
Add `most_likely` test
bayesian/tests.py
bayesian/tests.py
import sys sys.path.append('../') import unittest from bayesian import Bayes class TestBayes(unittest.TestCase): def test_empty_constructor(self): with self.assertRaises(ValueError): b = Bayes() def test_list_constructor(self): self.assertEqual(Bayes([]), []) self.assertE...
Python
0.000855
@@ -3442,16 +3442,283 @@ ** 2%5D)%0A%0A + def test_most_likely(self):%0A b = Bayes(%7B'a': 10, 'b': 1%7D)%0A self.assertEqual(b.most_likely(), 'a')%0A self.assertEqual(b.most_likely(0), 'a')%0A self.assertEqual(b.most_likely(0.9), 'a')%0A self.assertEqual(b.most_likely(0.91), None...
a6a920ee19a988a27920a4fe035a0d57b8cc36b7
Improve error message
wsgi_status/monitor.py
wsgi_status/monitor.py
# -*- coding: utf-8 -*- import fcntl import json import os import psutil import stat import signal import sys import time import threading class Monitor: def __init__(self, app, filename): self.app = app self.pid = os.getpid() self.filename = filename self.thread = False se...
Python
0.000015
@@ -2076,34 +2076,43 @@ f.update_status( +init=True )%0A - %0A def __call_ @@ -2494,32 +2494,42 @@ f.update_status( +init=False )%0A re @@ -2876,16 +2876,26 @@ _status( +init=False )%0A%0A d @@ -3249,16 +3249,26 @@ _status( +init=False )%0A @@ -3718,24 +3718,30 @@ _status(self +, init ...
251e11ef777ece9542b21af1ed43fa580c2186b3
Bump to 2.1.2
opencanada/__init__.py
opencanada/__init__.py
from django.utils.version import get_version VERSION = (2, 1, 1, 'final', 0) __version__ = get_version(VERSION)
Python
0.000219
@@ -56,17 +56,17 @@ (2, 1, -1 +2 , 'final
212d6bbc559c0a7fab74bff647a49817384e10ff
substitute {format} with json in oembed_url
embeddit/__init__.py
embeddit/__init__.py
import os import re import json import requests import fnmatch from urllib import urlencode from BeautifulSoup import BeautifulSoup _ROOT = os.path.abspath(os.path.dirname(__file__)) invalid_url = {'error': 'Invalid URL'} unreachable = {'error': 'Failed to reach the URL'} empty_meta = {'error': 'Found no meta info f...
Python
0.000079
@@ -2434,32 +2434,60 @@ s' %25 (oembed_url +.replace('%7Bformat%7D', 'json') , params))%0A
baa024a9e09607f8295cfe526a9eb25906aca806
modify the filename
PyStudy/loadfile_speed.py
PyStudy/loadfile_speed.py
#!/usr/bin/env python import datetime count = 0 begin_time = datetime.datetime.now() def readInChunks(fileObj, chunkSize=2048): """ Lazy function to read a file piece by piece. Default chunk size: 2kB. """ while True: data = fileObj.read(chunkSize) if not data: break ...
Python
0.999999
@@ -342,38 +342,23 @@ = open(' -fastapi-requests.log.1 +bigfile ')%0Afor c @@ -595,30 +595,15 @@ en(' -fastapi-requests.log.1 +bigfile ')%0Af
7c293a2d7551e7d83e0a429f836d7aa475157f92
Add get_by_scope class method to OrgTag model.
app/soc/modules/gsoc/models/organization.py
app/soc/modules/gsoc/models/organization.py
#!/usr/bin/python2.5 # # Copyright 2009 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
Python
0
@@ -2013,16 +2013,196 @@ ng_tag%0A%0A + @classmethod%0A def get_by_scope(cls, scope):%0A %22%22%22Get the list of tag objects that has the given scope.%0A %22%22%22%0A%0A return db.Query(cls).filter('scope =', scope).fetch(1000)%0A%0A @class
211f88cc377b0d9432258d0ebc3fdc2ebd54302f
EDIT requirements updated. imports updated
nsaba/geneinfo.py
nsaba/geneinfo.py
""" geneinfo.py: methods for querying, saving and loading gene information for NIH database. Author: Torben Noto """ import pandas as pd import os import random import urllib2 from BeautifulSoup import BeautifulSoup from time import sleep from collections import namedtuple def gene_info(eid): """ Pulls gene ...
Python
0.00325
@@ -176,29 +176,19 @@ b2%0Afrom -BeautifulSoup +bs4 import
96e26b74851c0b54493f3c269ceefb6b2ae53e7d
implement fromXml toXml and defaultInit method of Resolution class
settingMod/Resolution.py
settingMod/Resolution.py
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module to manage resolution settings''' import xml.etree.ElementTree as xmlMod from settingMod.Size import * import os class Resolution: '''class to manage resolution settings''' def __init__(self, xml= None): '''initialize resolution settings with default value or ...
Python
0
@@ -511,25 +511,76 @@ value'''%0A%09%09 +self.pourcent = 100%0A%09%09self.size = Size('1920x1080') %0A - %09%0A%09%0A%09%0A%09%0A%09%0A%09d @@ -680,24 +680,94 @@ object'''%0A%09%09 +self.pourcent = int(xml.get('pourcent'))%0A%09%09self.size = Size(xml = xml) %0A%09%0A%09%0A%09%0A%09%0A%09%0A%09 @@ -839,26 +839,10...
44dcbfe606377331a40777a7b387768c816b0e61
Increment to .2.11 for new package
nymms/__init__.py
nymms/__init__.py
__version__ = '0.2.10'
Python
0.000017
@@ -13,11 +13,11 @@ = '0.2.1 -0 +1 '%0A
e3a93aff39ed4a876bdfabd5e62271bce9fe11e9
remove unused analyzers import clause
src/cmdlr/amgr.py
src/cmdlr/amgr.py
"""Cmdlr analyzers holder and importer.""" import importlib import pkgutil import os import sys import functools import re from . import analyzers as _analyzers # NOQA from .exception import NoMatchAnalyzer from .exception import ExtraAnalyzersDirNotExists from .exception import AnalyzerRuntimeError class Analyzer...
Python
0.000001
@@ -122,54 +122,8 @@ re%0A%0A -from . import analyzers as _analyzers # NOQA%0A from
e7c39d4d2287309f82ca2c644880505cd896b921
Change normalize_encodings() to avoid using .translate() or depending on the string type. It will always return a Unicode string. The algoritm's specification is unchanged.
Lib/encodings/__init__.py
Lib/encodings/__init__.py
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Ea...
Python
0.000002
@@ -1170,415 +1170,8 @@ *'%5D%0A -_norm_encoding_map = (' . '%0A '0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ '%0A ' abcdefghijklmnopqrstuvwxyz '%0A ' ...
7095380ff71947f76ff60765e699da8e31fde944
Build - remove dir directory - not used
project_generator/commands/build.py
project_generator/commands/build.py
# Copyright 2015 0xc0170 # # 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, soft...
Python
0
@@ -1629,98 +1629,8 @@ nt(%0A - %22-dir%22, %22--directory%22, help=%22The projects directory%22)%0A subparser.add_argument(%0A
f06a7f0eb8fe79b3fc44a8adece15df5a85ccf27
make some sqlalchemy config options explicit (and not dependent on external specification) because they fundamentally change behaviors
src/server/_config.py
src/server/_config.py
import os from dotenv import load_dotenv from flask import Flask import json load_dotenv() VERSION = "0.3.20" MAX_RESULTS = int(10e6) MAX_COMPATIBILITY_RESULTS = int(3650) SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI", "sqlite:///test.db") SQLALCHEMY_ENGINE_OPTIONS = json.loads(os.environ.get("...
Python
0
@@ -257,16 +257,28 @@ est.db%22) +%0A%0A# defaults %0ASQLALCH @@ -297,16 +297,334 @@ PTIONS = + %7B%0A %22pool_pre_ping%22: True, # enable ping test for validity of recycled pool connections on connect() calls%0A %22pool_recycle%22: 5 # seconds after which a recycled pool connection is considered invalid%...
ff0ac35dcec8d5a4d0b9b5ba58d56cc865146ff9
add information about the exported RequestConnection method
src/server/connmgr.py
src/server/connmgr.py
# telepathy-python - Base classes defining the interfaces of the Telepathy framework # # Copyright (C) 2005, 2006 Collabora Limited # Copyright (C) 2005, 2006 Nokia Corporation # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as pub...
Python
0
@@ -3621,16 +3621,181 @@ keys()%0A%0A + @dbus.service.method('org.freedesktop.Telepathy.ConnectionManager',%0A in_signature='sa%7Bsv%7D',%0A out_signature='so')%0A def
9ec02a7cc31766d2b0d46547addddc0ca350e8ed
make pylint even more happy
neuralmonkey/runners/perplexity_runner.py
neuralmonkey/runners/perplexity_runner.py
""" This module contains an implementation of a runner that is supposed to be used in case we train a language model. Instead of decoding sentences in computes its perplexities given the decoder. """ #tests: lint from neuralmonkey.learning_utils import feed_dicts class PerplexityRunner(object): def __init__(self,...
Python
0.000001
@@ -259,16 +259,56 @@ _dicts%0A%0A +#pylint: disable=too-few-public-methods%0A class Pe @@ -783,162 +783,8 @@ id)) -%0A%0A batched_dataset = dataset.batch_dataset(self.batch_size)%0A losses = %5Bself.decoder.train_loss,%0A self.decoder.runtime_loss%5D %0A @@ -806,17 +806,16 @@ es ...
1fc9561148402c4eb558d183f4d8f3ecce0a0330
Set version to 0.4.1
alignak_backend/__init__.py
alignak_backend/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 4, 0) __application__ = u"Alignak_Backend" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU Affero ...
Python
0
@@ -110,17 +110,17 @@ (0, 4, -0 +1 )%0A%0A__app
e77381b087acd935bc3dae1f6c2e809970506db9
remove SECRET_KEY, again
bepasty/config.py
bepasty/config.py
# Copyright: 2013 Bastian Blank <bastian@waldi.eu.org> # License: BSD 2-clause, see LICENSE for details. class Config(object): """This is the basic configuration class for bepasty.""" #: name of this site (put YOUR bepasty fqdn here) SITENAME = 'bepasty.example.org' UPLOAD_UNLOCKED = True """ ...
Python
0.000007
@@ -1206,10 +1206,8 @@ = ' -xx '%0A%0A
b89426c4dbb272492533574572c2413c7671cd1d
Fix for a bug that caused the 'has_delete_permission' method of a view to be called in another totally unrelated one.
xadmin/views/delete.py
xadmin/views/delete.py
from django.core.exceptions import PermissionDenied from django.db import transaction, router from django.http import Http404, HttpResponseRedirect from django.template.response import TemplateResponse from django import VERSION as django_version from django.utils import six from django.utils.encoding import force_text...
Python
0
@@ -732,397 +732,8 @@ ne%0A%0A - def __init__(self, *args, **kwargs):%0A super(DeleteAdminView, self).__init__(*args, **kwargs)%0A admin_site_registry = self.admin_site._registry%0A for model in admin_site_registry:%0A if not hasattr(admin_site_registry%5Bmodel%5D, 'has_delete_permis...
0945d69af170d8eca723564a443f2d250c56bb0c
Switch to newer form of flask imports
ox_herd/scripts/serve_ox_herd.py
ox_herd/scripts/serve_ox_herd.py
"""Script to start the ox_herd server. This is the main script to run ox_herd and provide a python Flask based web server to respond to web requests. """ import configparser import argparse import logging import os from flask import Flask, redirect, url_for from flask_login import LoginManager, UserMixin, login_requ...
Python
0
@@ -270,16 +270,30 @@ sk_login +.login_manager import @@ -304,17 +304,40 @@ nManager -, +%0Afrom flask_login import UserMix
fd9039ac78985fc5f06f3f01bfafeacdb22f354b
Create sortable tables within the excel sheets
src/spz/spz/tables.py
src/spz/spz/tables.py
# -*- coding: utf-8 -*- """Table export utility. Used to format course lists for download. """ import csv import io from tempfile import NamedTemporaryFile from openpyxl import Workbook from flask import make_response, url_for, redirect, flash def export_course_list(courses, format): if for...
Python
0.000002
@@ -195,16 +195,60 @@ orkbook%0D +%0Afrom openpyxl.worksheet.table import Table%0D %0A%0D%0Afrom @@ -1241,32 +1241,73 @@ n(self, name):%0D%0A + # CSV does not support sections%0D%0A pass%0D%0A%0D%0A @@ -1410,32 +1410,197 @@ _init__(self):%0D%0A + # write_only=True would require additional lo...
b8e53ed353bf28bc1e532ae1577bf4a8b4ce976f
Add missing import
hackeriet/cardreaderd/__init__.py
hackeriet/cardreaderd/__init__.py
#!/usr/bin/env python from hackeriet import mifare from hackeriet.mqtt import MQTT from hackeriet.door import users import os, logging logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s') door_name = os.getenv("DOOR_NAME", 'hackeriet') door_topic = "hackeriet/door/%s/open" % door_name door_tim...
Python
0.000466
@@ -127,16 +127,22 @@ logging +, time %0A%0Aloggin
2e042201d6c0e0709d7056d399052389d1ea54b0
Move imports inside initialize() method so that we don’t break things on initial setup.
shopify_auth/__init__.py
shopify_auth/__init__.py
import shopify from django.conf import settings from django.core.exceptions import ImproperlyConfigured VERSION = (0, 1, 5) __version__ = '.'.join(map(str, VERSION)) __author__ = 'Gavin Ballard' def initialize(): if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET: raise Imp...
Python
0
@@ -1,111 +1,4 @@ -import shopify%0A%0Afrom django.conf import settings%0Afrom django.core.exceptions import ImproperlyConfigured%0A%0A%0A VERS @@ -18,9 +18,9 @@ 1, -5 +6 )%0A__ @@ -109,16 +109,134 @@ lize():%0A + import shopify%0A%0A from django.conf import settings%0A from django.core.exceptions import...