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 |
|---|---|---|---|---|---|---|---|
665b37a26895b56ba3c3cb408128ac20911462b7 | Modify read_data fuction to speedup file reading. | read_data.py | read_data.py | #!/usr/bin/env python
#coding=utf-8
# Read data and read tree fuctions for INFORMS data
# user att ['DUID','PID','DUPERSID','DOBMM','DOBYY','SEX','RACEX','RACEAX','RACEBX','RACEWX','RACETHNX','HISPANX','HISPCAT','EDUCYEAR','Year','marry','income','poverty']
# condition att ['DUID','DUPERSID','ICD9CODX','year']
from g... | Python | 0 | @@ -345,19 +345,8 @@
Tree
-%0Aimport pdb
%0A%0A__
@@ -1432,86 +1432,8 @@
tree
-%0A%0A%0Adef read_cat_tree(treename):%0A %22%22%22read categorial data from tree%0A %22%22%22%0A
@@ -2280,35 +2280,32 @@
= %7B%7D%0A for
- i,
line in enumera
@@ -2297,26 +2297,16 @@
line in
-enumerate(
bms_webv
@@... |
036ec4468bf6431bd137417f51fb182dd990cb80 | read json file as OrderedDicts | read_json.py | read_json.py | """
example read for json file
"""
import json
filename = 'testdata/bondurant.json'
with open(filename,'r') as f:
week_list = json.load(f)
#
# print valid forecast periods for each week
#
for week in week_list:
print(week['valid'])
#
# print temperatures for week3 (index starts at 0)
#
temps = week_list[2]['t... | Python | 0.000001 | @@ -40,16 +40,53 @@
rt json%0A
+from collections import OrderedDict%0A%0A
filename
@@ -171,16 +171,46 @@
n.load(f
+,object_pairs_hook=OrderedDict
)%0A%0A#%0A# p
|
c7aff9003afcafa0707b3f3023c38472b6b22118 | resolve infinite loop >_> | callisto_core/delivery/view_helpers.py | callisto_core/delivery/view_helpers.py | '''
View helpers contain functionality shared between several view partials.
None of these classes provide full view functionality.
docs / reference:
- https://github.com/SexualHealthInnovations/django-wizard-builder/blob/master/wizard_builder/view_helpers.py
'''
import logging
from django.core.urlresolvers imp... | Python | 0 | @@ -2762,17 +2762,8 @@
elf.
-view.get_
seri
@@ -2774,18 +2774,16 @@
ed_forms
-()
,%0A
|
8e5ae93bb583b3547863862f80463f7eb46e4a1e | Update User settings active | handler/user.py | handler/user.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Powered By KK Studio
from BaseHandler import BaseHandler
from tornado.web import authenticated as Auth
from model.models import User, or_, and_
class LoginHandler(BaseHandler):
def get(self):
if not self.session.isGuest:
return self.redirect('/') # 已... | Python | 0.000001 | @@ -3061,36 +3061,40 @@
lf.nav_active%5B'/
-u
se
-r
+ttings
'%5D = 'active'%0A
@@ -4194,20 +4194,24 @@
ctive%5B'/
-u
se
-r
+ttings
'%5D = 'ac
|
05d4427f3998180a9e9caa192ddadd7bb5e8ccdd | remove extra spaces | src/pyquickhelper/pycode/code_helper.py | src/pyquickhelper/pycode/code_helper.py | """
@file
@brief Various function to clean the code.
"""
import os
from ..sync.synchelper import explore_folder
def remove_extra_spaces(filename):
"""
removes extra spaces in a filename, replace the file in place
@param filename file name
@return number of removed extr... | Python | 0.99997 | @@ -494,17 +494,16 @@
) from e
-
%0A%0A li
|
da7e82efccb8ace8d3473a553da896a51bdd3b24 | Bump version to 0.2.6 | hcl2/version.py | hcl2/version.py | """Place of record for the package version"""
__version__ = "0.2.5"
__git_hash__ = "GIT_HASH"
| Python | 0.000001 | @@ -63,9 +63,9 @@
0.2.
-5
+6
%22%0A__
|
c8049c01d2900a2cb1662edec390d35fe6fc706c | Remove unneeded SourcecodeCompiler object | src/som/compiler/sourcecode_compiler.py | src/som/compiler/sourcecode_compiler.py | import os
from rlib.streamio import open_file_as_stream
from rlib.string_stream import StringStream
from som.compiler.class_generation_context import ClassGenerationContext
from som.interp_type import is_ast_interpreter
if is_ast_interpreter():
from som.compiler.ast.parser import Parser
else:
from som.comp... | Python | 0 | @@ -417,448 +417,8 @@
e):%0A
- return _SourcecodeCompiler().compile(path, filename, system_class, universe)%0A%0A%0Adef compile_class_from_string(stmt, system_class, universe):%0A return _SourcecodeCompiler().compile_class_string(stmt, system_class,%0A univers... |
1e4276ea4311284835803e081566fc9ffc57191a | add time in UTC to generated manifest | support/build/_util/include/manifest.py | support/build/_util/include/manifest.py | import os, sys, json, re
require = {
"heroku-sys/"+os.getenv("STACK"): "^1.0.0",
"heroku/installer-plugin": "^1.0.0",
}
engine=re.match('heroku-sys-(\w+)-extension', sys.argv[1])
if engine:
require["heroku-sys/"+engine.group(1)] = sys.argv.pop(5)
manifest = {
"type": sys.argv[1],
"name": sys.argv[... | Python | 0 | @@ -17,16 +17,26 @@
json, re
+, datetime
%0A%0Arequir
@@ -635,16 +635,86 @@
4%5D%0A %7D
+,%0A %22time%22: datetime.datetime.utcnow().strftime(%22%25Y-%25m-%25d %25H:%25M:%25S%22)
%0A%7D%0A%0Aif n
|
ffece3c898136b701e072f0e29186898c21dadd7 | add test for non-existant manifest file | loader/test/test_dataloader.py | loader/test/test_dataloader.py | import tempfile
import numpy as np
from PIL import Image as PILImage
import random
import struct
import pytest
from neon.backends import gen_backend
from neon.models import Model
from loader.dataloader import DataLoader, LoaderRuntimeError
def random_image(filename):
"""
generate a small random image
""... | Python | 0.000003 | @@ -1421,19 +1421,24 @@
manifest
+_name
):%0A
-
retu
@@ -1479,17 +1479,17 @@
manifest
-.
+_
name,%0A
@@ -1879,16 +1879,215 @@
%7D%0A%0A%0A
+def test_loader_failed_manifest():%0A config = generic_config('/this_manifest_file_does_not_exist')%0A%0A with pytest.raises(Exception):%0A dl = DataLo... |
63a26cbf76a3d0135f5b67dd10cc7f383ffa7ebf | Change authenticate_credentials method to raise an exception if the account is disabled | helusers/jwt.py | helusers/jwt.py | from django.conf import settings
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework_jwt.settings import api_settings
from .user_utils import get_or_create_user
def patch_jwt_settings():
"""Patch rest_framework_jwt authentication settings from allauth"""
defaults = ap... | Python | 0.000001 | @@ -26,16 +26,54 @@
ettings%0A
+from rest_framework import exceptions%0A
from res
@@ -1016,24 +1016,227 @@
, payload):%0A
+ user = super().authenticate_credentials(payload)%0A%0A if user and not user.is_active:%0A msg = _('User account is disabled.')%0A raise exceptions.Authentica... |
237e59819cf8fd2586e7466c061c3d4d3360c0f6 | Prepare for more testfeeds | manage/fabfile/app/demodata.py | manage/fabfile/app/demodata.py | from __future__ import with_statement
from fabric.api import env, local, cd, roles
from fabric.contrib.files import *
from fabric.contrib.project import rsync_project
from fabfile.target import _needs_targetenv
from fabfile.app import _deploy_war
from fabfile.app import _deploy_war_norestart
from fabfile.util import ve... | Python | 0 | @@ -4183,16 +4183,19 @@
set%5Bkey%5D
+%5B0%5D
)%0A bu
|
3b5d95e84c3a81602c6c3fbd45645288f872a203 | Fix missing var | homely/utils.py | homely/utils.py | import contextlib
import os
import subprocess
import tempfile
import simplejson
CONFIG_DIR = os.path.join(os.environ.get('HOME'), '.homely')
REPO_CONFIG_PATH = os.path.join(CONFIG_DIR, 'repos.json')
class JsonError(Exception):
pass
class JsonConfig(object):
jsonpath = None
jsondata = None
def __i... | Python | 0.99926 | @@ -3849,16 +3849,20 @@
yield
+ cfg
%0A cfg
|
9ccd957dfde79db677c7ae19e0a271d69921f0b4 | bump version | hops/version.py | hops/version.py | __version__ = '1.6.4'
| Python | 0 | @@ -16,8 +16,8 @@
1.6.
-4
+5
'%0A%0A
|
754e08288be17db63747592fd5ce1d70a6fb154e | bump version | hops/version.py | hops/version.py | __version__ = '2.7.6'
| Python | 0 | @@ -16,9 +16,9 @@
2.7.
-6
+7
'%0A%0A%0A
|
08ff25cd49cf1ef5769ef0cbd49bce29eb5d8d1c | Update tests after changes in humans/utils.py | humans/tests.py | humans/tests.py | from django.contrib.auth.models import Group
from django.utils import timezone
from django.test import TestCase
from django.core import mail
from boxes.tests import create_and_login_user
from hawkpost import celery_app
from .models import Notification, User
from .forms import UpdateUserInfoForm
from .tasks import enque... | Python | 0 | @@ -5544,16 +5544,17 @@
_expire)
+
= key_st
|
ae21b9796abb1511d3af2cdd0c87f8d90386093c | Update inftp.py | bin/inftp.py | bin/inftp.py | __author__ = 'Lenny Morayniss'
'''
This project is licensed under the terms of the MIT license.
Copyright Lenny Morayiss 2015
'''
import argparse
from ftplib import FTP_TLS
import os
import time
def upload(ftp, filename):
ext = os.path.splitext(filename)[1]
if ext in (".txt", ".htm", ".html"):
ftp.stor... | Python | 0.000001 | @@ -110,16 +110,17 @@
ny Moray
+n
iss 2015
|
329a5fd0679c240b1be07a35d2845c2ce4b44ff6 | Fix an indexing bug | bin/learn.py | bin/learn.py | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import matplotlib.pyplot as pp
import numpy as np
import support
import tensorflow as tf
def learn(f, dimension_count, sample_count, train_each, predict_each,
predict_count, epoch_count, monitor):
assert(predict_each % tr... | Python | 0.000082 | @@ -3154,16 +3154,20 @@
f(j + l
+ + 1
)%0A%0A
|
764f8d9d7818076555cde5fcad29f3052b523771 | Add more search fields to autocomplete | company/autocomplete_light_registry.py | company/autocomplete_light_registry.py | import autocomplete_light
from .models import Company
class CompanyAutocomplete(autocomplete_light.AutocompleteModelBase):
search_fields = ['^name']
model = Company
autocomplete_light.register(CompanyAutocomplete)
| Python | 0 | @@ -144,9 +144,40 @@
= %5B'
-%5E
+name', 'official_name', 'common_
name
|
6e9381d1c122377effc1cb4f835e1499b7e47d98 | Allow overriding default config (e.g. for CLIs) | microcosm_logging/factories.py | microcosm_logging/factories.py | """
Factory that configures logging.
"""
from logging import getLogger
from logging.config import dictConfig
from microcosm.api import defaults
@defaults(
# default log level is INFO
level="INFO",
# tune down some common libraries
levels=dict(
default=dict(
debug=[],
... | Python | 0 | @@ -152,16 +152,97 @@
faults(%0A
+ default_format=%22%25(asctime)s - %25(name)-12s - %5B%25(levelname)s%5D - %25(message)s%22,%0A%0A
# de
@@ -2802,67 +2802,44 @@
t%22:
-%22%25(asctime)s - %25(name)-12s - %5B%25(levelname)s%5D - %25(message)s%22
+graph.config.logging.default_format,
%0A
|
482f1b1619a2714d06a99a2d7722100f03ea5d1c | Fix #1194 | mycroft/skills/audioservice.py | mycroft/skills/audioservice.py | # Copyright 2017 Mycroft AI 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 agreed to in writin... | Python | 0.000001 | @@ -2155,24 +2155,142 @@
terance%7D))%0A%0A
+ def stop(self):%0A %22%22%22 Stop the track. %22%22%22%0A self.emitter.emit(Message('mycroft.audio.service.stop'))%0A%0A
def next
|
e0b8866d3b1b6a9fc896d511227523391a1501f4 | Update binstar-push.py | continuous-integration/binstar-push.py | continuous-integration/binstar-push.py | import os
import glob
import subprocess
import traceback
token = os.environ['BINSTAR_TOKEN']
cmd = ['anaconda_server', '-t', token, 'upload', '--force']
cmd.extend(glob.glob('*.tar.bz2'))
try:
subprocess.check_call(cmd)
except subprocess.CalledProcessError:
traceback.print_exc()
| Python | 0.000001 | @@ -99,22 +99,14 @@
= %5B'
-anaconda_serve
+binsta
r',
|
c79cdd6ec15b11f44994c0b13d02054ff22b3d68 | Apply patches first in performance sim worker processes too. | contrib/performance/loadtest/ampsim.py | contrib/performance/loadtest/ampsim.py | ##
# Copyright (c) 2011 Apple Inc. 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 law or... | Python | 0.000003 | @@ -804,16 +804,48 @@
try:%0A
+ __import__(%22twext%22)%0A
|
a843e35113e1154620376949916d3076c8f800d0 | Add zeropoint stub | perpendicular-least-squares.py | perpendicular-least-squares.py | __author__ = 'Jacob Bieker'
import os, sys, random
import numpy
from multiprocessing import Pool
from astropy.io import fits
# Fit plane or line iteratively
# if more than one cluster, each cluster in separate STSDAS table
#
# Residuals are calculated according to resalgo
# per: perpendicular to the fitted rel... | Python | 0.000002 | @@ -1813,16 +1813,17 @@
ni.edu%0A%0A
+%0A
def rand
@@ -1992,16 +1992,17 @@
ndint(0,
+
1)%0A
@@ -2054,16 +2054,228 @@
_nums%0A%0A%0A
+%0Adef zeropoint(type_solution):%0A if type_solution.lower() == %22median%22:%0A # use with delta and quartile%0A return 0%0A elif type_solution.lower() == ... |
aff525e763bad24df9348252b9e25a2a2e8dc119 | Use current interpreter to upgrade PlatformIO | platformio/commands/upgrade.py | platformio/commands/upgrade.py | # Copyright 2014-2015 Ivan Kravets <me@ikravets.com>
#
# 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 | @@ -592,16 +592,38 @@
cense.%0A%0A
+import os%0Aimport sys%0A%0A
import c
@@ -1175,16 +1175,69 @@
%5B
+os.path.normpath(sys.executable),%0A %22-m%22,
%22pip%22, %22
@@ -1573,15 +1573,22 @@
%5B0%5D
-=
+!
= %22p
-ip
+latformio
%22:%0A
@@ -1610,65 +1610,85 @@
-r = util.exec_command(%5B%2... |
74d41ab647267405d5686f2b5bdf9fa3bd3c3960 | Add TODO to do | cpgintegrate/connectors/openclinica.py | cpgintegrate/connectors/openclinica.py | import requests
from lxml import etree
import typing
from .connector import FileDownloadingConnector
import cpgintegrate
from cpgintegrate import ColumnInfoFrame
from bs4 import BeautifulSoup
import re
from zipfile import ZipFile
from io import BytesIO
class OpenClinica(FileDownloadingConnector):
def __init__(se... | Python | 0 | @@ -2197,16 +2197,90 @@
else:%0A
+ # TODO Defer this download until iter_files or _read_dataset?%0A
|
805e6be1687622cd70e6475708d0e5d8b53f8132 | Update docs | pychatjs/server/user_server.py | pychatjs/server/user_server.py |
class UsernameInUseException(Exception):
pass
class User(object):
def __init__(self, server, name=None):
if name is None:
name = server.temp_name
self.name = name
self.server = server
def __str__(self):
return str(self.name)
def _to_json(se... | Python | 0.000001 | @@ -1,18 +1,16 @@
-%0D%0A
class UsernameIn
@@ -66,24 +66,83 @@
r(object):%0D%0A
+ %22%22%22 Class used to hold a user and the user server %22%22%22%0D%0A
def __in
@@ -368,32 +368,141 @@
to_json(self):%0D%0A
+ %22%22%22 Gets a dict of this object's properties so that it can be used to send a dump to th... |
7133060fc3c36077212ebed13a2de954c76941db | Include custom props. | pygubudesigner/widgeteditor.py | pygubudesigner/widgeteditor.py | # encoding: UTF-8
#
# Copyright 2012-2013 Alejandro Autalán
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
#... | Python | 0 | @@ -4203,32 +4203,101 @@
SPECIFIC_OPTIONS
+,%0A properties.WIDGET_CUSTOM_OPTIONS
)%0A for na
|
0b1499e87e5a2bdaadc13811378e869e13c9c3db | Update chat.py | blog/chat.py | blog/chat.py | # A simple chat server using websockets
# Uses a slight modification to the protocol I'm using to write a different
# application
# Modifications:
# No rooms
# Uses Facebook to authenticate
from flask import Flask, session, escape, request, redirect
from flask_socketio import SocketIO, emit
from blog.util import rend... | Python | 0 | @@ -2298,36 +2298,16 @@
ast=True
-, include_self=False
)%0A%09retur
|
a06010fcb2f4424d085da1487a6666867a8cbf5b | Remove add_view and add form for the hole admin | dbaas/maintenance/admin/maintenance.py | dbaas/maintenance/admin/maintenance.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = MaintenanceService
search_fields = ("sche... | Python | 0 | @@ -194,17 +194,52 @@
Service%0A
+from ..forms import MaintenanceForm
%0A
-
%0A%0Aclass
@@ -710,17 +710,43 @@
sk_id')%0A
+ form = MaintenanceForm
%0A
-
%0A def
@@ -1032,16 +1032,16 @@
equest,%0A
+
@@ -1099,172 +1099,5 @@
t)%0A%0A
- def add_view(self, request, form_url='', extra_context=None)... |
67643dd792967523fa7c12fb380274237e30c34d | Update trainLSTM-noATTN.py | runScripts/trainLSTM-noATTN.py | runScripts/trainLSTM-noATTN.py | # Original script developed by Harshal Priyadarshi https://github.com/harpribot
# Edited for purpose of this project.
# Script to initiate training process of the LSTM network with attention disabled.
# Import required libraries; Point system directory back to parent folder to allow import files below:
import os
impor... | Python | 0 | @@ -1226,11 +1226,12 @@
ion=
-Tru
+Fals
e)%0A#
|
81b4344d3f1882ff65308273b87395cae2d6cc6c | Disable OpenBSD service module on 5.0, it won't work reliably there. | salt/modules/openbsdservice.py | salt/modules/openbsdservice.py | '''
The service module for OpenBSD
'''
import os
# XXX enable/disable support would be nice
def __virtual__():
'''
Only work on OpenBSD
'''
if __grains__['os'] == 'OpenBSD' and os.path.exists('/etc/rc.d/rc.subr'):
return 'service'
return False
def start(name):
'''
Start the sp... | Python | 0 | @@ -228,16 +228,244 @@
subr'):%0A
+ v = map(int, __grains__%5B'kernelrelease'%5D.split('.'))%0A # The -f flag, used to force a script to run even if disabled,%0A # was added after the 5.0 release.%0A if v%5B0%5D %3E 5 or (v%5B0%5D == 5 and v%5B1%5D %3E 0):%0A
|
6f822cf46957d038588e7a71eb91f8ca9f9c95f1 | Use get_minion_path to get default dir. | scaffolder/commands/install.py | scaffolder/commands/install.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.template import TemplateManager
from scaffolder.core.commands import BaseCommand
class InstallCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
... | Python | 0 | @@ -107,16 +107,55 @@
nParser%0A
+from scaffolder import get_minion_path%0A
from sca
@@ -448,22 +448,33 @@
ult=
-'~/.cookieja
+get_minion_path('weave
r'
+)
,%0A
|
71f11601814366fddd8c01bcdb50629a5f6fb2a1 | Implement cassandra diffing | scrapi/processing/cassandra.py | scrapi/processing/cassandra.py | from __future__ import absolute_import
import json
import logging
from uuid import uuid4
from cqlengine import columns, Model
from scrapi import events
from scrapi import database # noqa
from scrapi.processing.base import BaseProcessor
logger = logging.getLogger(__name__)
logging.getLogger('cqlengine.cql').setLev... | Python | 0.998365 | @@ -1421,16 +1421,111 @@
ents%5B0%5D%0A
+ if self.different(dict(document), dict(docID=docID, source=source, **kwargs)):%0A
@@ -1586,32 +1586,36 @@
ate%0A
+
versions = docum
@@ -1631,37 +1631,8 @@
ons%0A
- if document.url:%0A
@@ -1781,24 +1781,28 @@
... |
c0682d5d53d3f136485f952dfa82e0dc44df89ae | change release_url | bootstrap.py | bootstrap.py | #!/usr/bin/env python
import urllib2
import json
import apt
import tarfile
import sys
from distutils import dir_util
from os import chdir
from os import symlink
from subprocess import call
# install packages
package_list = [
"python-pip",
"build-essential",
"tmux",
"ruby2.0",
"ruby2.0-dev",
"l... | Python | 0.000001 | @@ -1109,18 +1109,23 @@
kage%5D)%0A%0A
-gh
+release
_url = '
@@ -1196,261 +1196,8 @@
z'%0A%0A
-req = urllib2.Request(gh_url)%0Aheaders = req.headers = %7B%0A 'Content-Type': 'application/json'%0A%7D%0A%0A# upload the release asset%0Ahandler = urllib2.urlopen(req)%0Arelease = json.loads(handler.read())%0A%0Areleas... |
5d4203150fb19df68dadc415d6504f7acf9f143e | Fix UI bug | botox/aws.py | botox/aws.py | # If developing this further, see the following e-buddies to collaborate as they
# also have internal/unreleased solutions and have indicated interest:
#
# * Gavin McQuillan (gmcquillan)
# * Travis Swicegood (tswicegood)
# * Christopher Groskopf (onyxfish)
import os
import sys
import time
from boto.ec2 import regio... | Python | 0.000001 | @@ -6978,16 +6978,24 @@
.log(%22.%22
+, end=''
)%0A
|
27a6eaa94ef87c2b099a4ad7fca234232557d86f | Date was in the wrong order | bots/args.py | bots/args.py | import argparse
from collections import namedtuple
from datetime import datetime
import re
def ljoin(args, op='or'):
output = ', '.join(args[:-1])
if len(args) > 2:
output += ','
if len(args) > 1:
output += ' %s ' % op
return output + args[-1]
class EType(object):
def __init__(self... | Python | 0.999504 | @@ -3133,12 +3133,12 @@
, '%25
-d/%25m
+m/%25d
/%25Y'
|
6a111c64c50ffe6daa387034ef8fc3ad3e90fc75 | Move import to the top of the page. | test/requests/main_web_functionality.py | test/requests/main_web_functionality.py | from __future__ import print_function
import re
import requests
from lxml.html import parse
from requests.exceptions import ConnectionError
def check_home(url):
doc = parse(url).getroot()
search_button = doc.cssselect("#btsearch")
assert(search_button[0].value == "Search")
print("OK")
def check_search... | Python | 0 | @@ -85,16 +85,52 @@
t parse%0A
+from link_checker import check_page%0A
from req
@@ -889,48 +889,8 @@
l):%0A
- from link_checker import check_page%0A
|
7d948ef81c7f7cbd51cb941fc8a39b734bb44277 | Test fixes | test/rql_test/connections/connection.py | test/rql_test/connections/connection.py | ###
# Tests the driver API for making connections and excercizes the networking code
###
from sys import argv
from subprocess import Popen
from time import sleep
from sys import path
path.append('.')
from test_util import RethinkDBTestServers
path.append("../../drivers/python")
import rethinkdb as r
server_build = a... | Python | 0.000001 | @@ -2986,32 +2986,93 @@
le('t2').run(c)%0A
+ raise Exception(%22Should have thrown but didn't%22)%0A
except r
@@ -3126,20 +3126,28 @@
.message
- ==
+.startswith(
%22Table %60
@@ -3166,16 +3166,17 @@
exist.%22
+)
:%0A
|
7d6ef3724e9a506c46fc9d4012e6318aaaea3a9c | Add language files to mac release. | build_app.py | build_app.py | # coding=utf-8
import sys
import os
if sys.platform.startswith('darwin'):
from setuptools import setup
APP = ['Cura/cura.py']
DATA_FILES = ['Cura/LICENSE', 'Cura/resources/images', 'Cura/resources/meshes', 'Cura/resources/example', 'Cura/resources/firmware']
PLIST = {
u'CFBundleName': u'Cura',... | Python | 0 | @@ -264,16 +264,41 @@
irmware'
+, 'Cura/resources/locale'
%5D%0A PL
|
5da50f94fd2132840e55425969af92e3e2974c3a | add display name and reply info | desertbot/modules/urlfollow/Twitter.py | desertbot/modules/urlfollow/Twitter.py | """
Created on Jan 25, 2014
@author: StarlitGhost
"""
from twisted.plugin import IPlugin
from desertbot.moduleinterface import IModule
from desertbot.modules.commandinterface import BotCommand
from zope.interface import implementer
from desertbot.message import IRCMessage
from desertbot.utils import string
from bs4 ... | Python | 0 | @@ -1258,49 +1258,224 @@
-user = tweet.find(class_='username').text
+displayName = tweet%5B'data-name'%5D%0A user = tweet.find(class_='username').text%0A%0A reply = tweet.find(class_='ReplyingToContextBelowAuthor')%0A if reply:%0A reply = 'r' + reply.text.strip()%5B1:%5D
%0A%0A
... |
7c761c009a27802948f53e6c753444593080a822 | use curl wo wget | install_data.py | install_data.py | #!/usr/bin/env python
from optparse import OptionParser
import glob
import os
import subprocess
import sys
################################################################################
# install_data.py
#
# Download and arrange pre-trained models and data.
###########################################################... | Python | 0.00001 | @@ -49,16 +49,44 @@
nParser%0A
+from distutils import spawn%0A
import g
@@ -844,16 +844,287 @@
args()%0A%0A
+ if spawn.find_executable('wget').find('wget') != -1:%0A dl_cmd = 'wget'%0A elif spawn.find_executable('curl').find('curl') != -1:%0A dl_cmd = 'curl -L -O'%0A else:%0A print %3E%... |
ae47decb69b71f227ccb6caa0047c7a471161bc4 | Allow running jacquard/cli.py directly | jacquard/cli.py | jacquard/cli.py | import sys
import pathlib
import argparse
import configparser
import pkg_resources
from jacquard.storage import open_engine
from jacquard.users import get_settings
def argument_parser():
parser = argparse.ArgumentParser(description="Split testing server")
parser.add_argument(
'-v',
'--verbose... | Python | 0 | @@ -1731,8 +1731,50 @@
ptions)%0A
+%0A%0Aif '__name__' == '__main__':%0A main()%0A
|
7e271526835420c55dc1e9bcf6cadf7fd1d4a366 | add a test case for api.single_load with ac_dict option | tests/api/load/single_load/test_base.py | tests/api/load/single_load/test_base.py | #
# Copyright (C) 2012 - 2021 Satoru SATOH <satoru.satoh@gmail.com>
# License: MIT
#
# pylint: disable=missing-docstring
import ast
import collections
import pathlib
import anyconfig.api._load as TT
from anyconfig.api import (
UnknownFileTypeError, UnknownProcessorTypeError
)
from tests.base import NULL_CNTNR
fr... | Python | 0.000001 | @@ -346,16 +346,116 @@
tCase%0A%0A%0A
+class MyDict(collections.OrderedDict):%0A %22%22%22My original dict class keep key orders.%22%22%22%0A pass%0A%0A%0A
class Te
@@ -2651,16 +2651,242 @@
(exp))%0A%0A
+ def test_single_load_with_ac_dict(self):%0A for inp, exp in self.ies:%0A res = TT.sin... |
c3d08c69eac88d3d0fad10e42fa07a6fef9092f9 | Remove unnecessary newline | tests/mock_vws/test_database_summary.py | tests/mock_vws/test_database_summary.py | """
Tests for the mock of the database summary endpoint.
"""
from datetime import datetime, timedelta
import pytest
import requests
from freezegun import freeze_time
from requests import codes
from requests_mock import GET
from tests.conftest import VuforiaServerCredentials
from tests.mock_vws.utils import is_valid_... | Python | 0.001895 | @@ -1716,25 +1716,24 @@
s expected.%0A
-%0A
%22%22%22%0A%0A
|
603fa6d60916d8eee4c40d867ba3774e4671160c | Strengthen the main test with new assertions | tests/unit/son_analyze/cli/main_test.py | tests/unit/son_analyze/cli/main_test.py | # Copyright (c) 2015 SONATA-NFV, Thales Communications & Security
# 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
#
#... | Python | 0.999498 | @@ -3185,16 +3185,48 @@
if req
+ and hasattr(req, 'status_code')
and req
@@ -3283,16 +3283,63 @@
ep(0.2)%0A
+ assert req and hasattr(req, 'status_code')%0A
asse
|
fbff36df36e71eaf1849125682b792f5f29b900f | Fix unit test | tests/unit/states/boto_dynamodb_test.py | tests/unit/states/boto_dynamodb_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from... | Python | 0.000005 | @@ -923,32 +923,39 @@
': ''%7D%0A%0A
+exists_
mock = MagicMock
@@ -985,24 +985,71 @@
se, False%5D)%0A
+ dict_mock = MagicMock(return_value=%7B%7D)%0A
mock
@@ -1077,32 +1077,81 @@
urn_value=True)%0A
+ pillar_mock = MagicMock(return_value=%5B%5D)%0A
with pat
@@ -1223,32 +1223,2... |
19e673ccf93fbfde5d3bfce6476e0f61570f43e6 | use new sequence-based tester | teuthology/task/filestore_idempotent.py | teuthology/task/filestore_idempotent.py | import logging
from teuthology import misc as teuthology
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Test filestore/filejournal handling of non-idempotent events.
Currently this is a kludge; we require the ceph task preceeds us just
so that we get the tarball installed to run the te... | Python | 0 | @@ -7,16 +7,58 @@
logging
+%0Afrom ..orchestra import run%0Aimport random
%0A%0Afrom t
@@ -994,69 +994,109 @@
ent%0A
+%0A
-journal = '/tmp/cephtest/data/test.journal.%25s' %25 client%0A%0A
+seed = str(int(random.uniform(1,100)))%0A%0A try:%0A log.info('creating a working dir')%0A
@@ -1127,... |
c2a0e64c2a8cef2a9e4f1840aae6baf047092c16 | Work on item methods | character.py | character.py | """
St. George Game
character.py
Sage Berg
Created: 9 Dec 2014
"""
import random
from display import Display
from raffle import Raffle
from cheats import Cheat
import actions
import money
import persons
import places
class Character(object):
"""
Represents the character in the story who the player
is ro... | Python | 0 | @@ -4618,16 +4618,127 @@
if
+self.has_item(type(item)):%0A Display().write(%22You now have another %22 + str(item) + %22.%22)%0A elif
str(item
@@ -4759,16 +4759,16 @@
aeiou%22:%0A
-
@@ -4959,32 +4959,192 @@
em(self, item):%0A
+ self.items.remove(item)%0A if self.has_... |
785dc0740d15eb697286ce8bbcef7aa7765fd3e6 | use yaml to output cli lookups | cihai/cli.py | cihai/cli.py | # -*- coding: utf8 - *-
from __future__ import (absolute_import, division, print_function,
with_statement)
import logging
import click
import yaml
from .__about__ import __version__
from ._compat import PY2
from .core import Cihai
@click.group(context_settings={'obj': {}})
@click.version_op... | Python | 0 | @@ -1405,16 +1405,31 @@
first()%0A
+ attrs = %7B%7D%0A
for
@@ -1606,46 +1606,121 @@
-print('%7B:%3E30%7D %7B:%3E60%7D'.format(c
+attrs%5Bstr(c)%5D = value%0A print(%0A yaml.safe_dump(attrs
,
-v
al
-ue)
+low_unicode=True, default_flow_style=False)%0A
)%0A%0A%0A
|
c7b6d35fd43ca192c3e7e95bf0a0f2ea0b0fc4a5 | update docstring; moved to sys.exit from raising RuntimeError | tools/ci_check_duplicate_usb_vid_pid.py | tools/ci_check_duplicate_usb_vid_pid.py | #!/usr/bin/env python3
#
# This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2020 Michael Schroeder
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to ... | Python | 0.000003 | @@ -2585,31 +2585,62 @@
es.
-Raises a %60RuntimeError%60
+Exits with %60%60sys.exit()%60%60 (non-zero exit code)%0A
if
@@ -2664,24 +2664,16 @@
und, and
-%0A
lists t
|
6bf998fa9ae7f0edaddfbeca1ef7e5f9e764ee66 | print bug | code/test.py | code/test.py | # this file is made to see how theano works and the speedup
# it gives you on GPU versus a normal implementation on CPU (ran on my computer)
import theano
import theano.tensor as T
from theano import function, shared
import numpy as np
import time
x = T.matrix('x', dtype=theano.config.floatX)
y = T.matrix('y', dtype... | Python | 0.000002 | @@ -666,16 +666,37 @@
t %22go%22%0A%0A
+before = time.time()%0A
mydot(a,
@@ -726,37 +726,16 @@
.sum()%0A%0A
-before = time.time()%0A
print ti
|
9853ae44908156e29115f5c9859bbd2c7a756bd9 | fix typo in init | sikwidgets/widgets/__init__.py | sikwidgets/widgets/__init__.py | instantiable_widget_class_names = [
"Button",
"Checkbox",
"Image",
"Label",
"List",
"MenuButton",
"RadioButton",
"Tab",
"Table",
"TextField",
"Tooltip",
"Tree"
]
from widget import Widget
from page import Page
from button import Button
from checkbox import Checkbox
from image import Image
from label import... | Python | 0.998653 | @@ -47,17 +47,17 @@
%0A%09%22Check
-b
+B
ox%22,%0A%09%22I
@@ -252,16 +252,17 @@
om check
+_
box impo
@@ -269,17 +269,17 @@
rt Check
-b
+B
ox%0Afrom
|
e67348155732d99f7852cfd545a9ba3189fee9f2 | update help message wording | cogs/help.py | cogs/help.py | import discord
from discord.ext import commands
from db.dbase import DBase
from cogs.utils import constants
from cogs.utils.messages import MessageManager
class Help:
def __init__(self, bot):
self.bot = bot
self.bot.remove_command("help")
@commands.command(hidden=True)
async def help(s... | Python | 0 | @@ -3244,162 +3244,17 @@
= (%22
-Items in %3Cangled_brackets%3E are *required*%22%0A + %22%5CnItems in %5Bsquare_brackets%5D are *optional*%22%0A + %22%5Cn
+**
Note
- -
+:**
don
@@ -3272,27 +3272,22 @@
the
-%5B%5D and %3C%3E character
+square bracket
s%22)%0A
|
2f13b5e54989ded066b2bf4adf5bd2a614f26521 | fix item thumbnail url | cogs/osrs.py | cogs/osrs.py | import discord
import json
from utils import aiohttp_wrap as aw
from utils import dict_manip as dm
from discord.ext import commands
from pathlib import Path
class OSRS:
def __init__(self, bot):
self.bot = bot
self.aio_session = bot.aio_session
self.api_uri = 'https://api.rsbudd... | Python | 0.000265 | @@ -1728,22 +1728,8 @@
ool/
-1502360694249_
obj_
|
5e42bde844eb6c7260a4415e512646d061137640 | bump version | src/RequestsLibrary/version.py | src/RequestsLibrary/version.py | VERSION = '0.4.4'
| Python | 0 | @@ -8,11 +8,11 @@
= '0.4.
-4
+5
'%0A
|
95d9bb3a9500d80b5064c5fb4d5bd7b30406d1ae | Fix update remote to ConanCenter and grpc to highest buildable/supported version | conanfile.py | conanfile.py | from conans import ConanFile, CMake
class GrpccbConan(ConanFile):
name = "grpc_cb_core"
version = "0.2"
license = "Apache-2.0"
url = "https://github.com/jinq0123/grpc_cb_core"
description = "C++ gRPC core library with callback interface."
settings = "os", "compiler", "build_type", "arch"
op... | Python | 0 | @@ -416,30 +416,13 @@
c/1.
-17.2@inexorgame/stable
+44.0@
%22,%0A%0A
@@ -448,17 +448,17 @@
make%22, %22
-P
+p
remake%22
@@ -464,118 +464,37 @@
#
-A custom generator: PremakeGen/0.1@memsharded/testing%0A build_requires = %22PremakeGen/0.1@memsharded/testing%22
+The builtin premake generator
%0A
|
c13a12e6355423d6756b8b514942596c31b0e3a9 | Make cmake-unit, cmake-linter-cmake and style-linter-cmake normal deps | conanfile.py | conanfile.py | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.7"
class CMakeModuleCommonConan(ConanFile):
name = "cmake-module-common"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
url = "http://github.com/polysquare/cmake-module-com... | Python | 0 | @@ -337,16 +337,222 @@
= %22MIT%22
+%0A requires = (%22cmake-unit/master@smspillaz/cmake-unit%22,%0A %22cmake-linter-cmake/master@smspillaz/cmake-linter-cmake%22,%0A %22style-linter-cmake/master@smspillaz/style-linter-cmake%22)
%0A%0A de
|
bfcb37832b6198cae8c3779c4931b272774f9a32 | Fix task class bug | core/task.py | core/task.py | """This module defines tasks executed in the pipeline."""
from .base import GaiaObject
class Task(GaiaObject):
"""Defines a pipeline element.
A task is an element of the pipeline responsible for completing an
atomic task given one or more inputs and pushing the result to the
next task or tasks.
... | Python | 0.000031 | @@ -595,24 +595,29 @@
lf._inputs%5Bp
+.name
%5D = p(self)%0A
@@ -744,16 +744,21 @@
utputs%5Bp
+.name
%5D = p(se
@@ -1746,22 +1746,16 @@
ts%5Bname%5D
-.other
%0A%0A de
|
72dd9601ab21be4c46c942c7f5a089af34398314 | check args and use correct exit (the latter bug was pretty amusing) | src/robot/utils/application.py | src/robot/utils/application.py | # Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# 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 applic... | Python | 0 | @@ -1098,35 +1098,8 @@
s)%0D%0A
- self._exit = exit%0D%0A
@@ -1687,16 +1687,33 @@
cli_args
+, check_args=True
)%0D%0A
|
f39fc5c07421ddf27b3b921806fafcdb2c2ee3ed | Use WCSSUB_CELESTIAL | sunpy/coordinates/wcs_utils.py | sunpy/coordinates/wcs_utils.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import astropy.wcs.utils
from .frames import *
__all__ = ['solar_wcs_frame_mapping']
def solar_wcs_frame_mapping(wcs):
"""
This function registers the coordinates frames to their FITS-WCS coordinate
type values in the `astropy.wcs.u... | Python | 0.000002 | @@ -92,16 +92,58 @@
.utils%0A%0A
+from astropy.wcs import WCSSUB_CELESTIAL%0A%0A
from .fr
@@ -411,74 +411,116 @@
-xcoord = wcs.wcs.ctype%5B0%5D%5B0:4%5D%0A ycoord = wcs.wcs.ctype%5B1%5D%5B0:4%5D%0A
+# SunPy Map adds some extra attributes to the WCS object.%0A # We check for them here, and default to None.... |
b315778e1717dce8c6d5e493c0c7851f65aee25f | Add blank line above @classmethod joke2k/faker#552 | faker/providers/automotive/__init__.py | faker/providers/automotive/__init__.py | # coding=utf-8
localized = True
from .. import BaseProvider
from string import ascii_uppercase
import re
class Provider(BaseProvider):
license_formats = ()
@classmethod
def license_plate(cls):
temp = re.sub(r'\?',
lambda x: cls.random_element(ascii_uppercase),
cls.random_e... | Python | 0.999785 | @@ -156,16 +156,21 @@
ts = ()%0A
+ %0A
@cla
|
2fc0f9af70abb8b3658db13ff1ff6918b3083a2f | Fix unicode crash in urlrewriting plugin. | flexget/plugins/plugin_urlrewriting.py | flexget/plugins/plugin_urlrewriting.py | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget.plugin import get_plugins_by_group, priority, PluginError, register_plugin, register_task_phase
log = logging.getLogger('urlrewriter')
class UrlRewritingError(Exception):
def __init__(self, value):
self.value ... | Python | 0.001754 | @@ -2335,20 +2335,16 @@
(name,
-str(
r.value)
@@ -2336,33 +2336,32 @@
(name, r.value))
-)
%0A
@@ -2473,12 +2473,8 @@
me,
-str(
e.va
@@ -2478,17 +2478,16 @@
.value))
-)
%0A
|
32dcc7384613870b95dc8b55c42381050b12d6a5 | update test block ordering | freebasics/tests/test_env_variables.py | freebasics/tests/test_env_variables.py | from django.test import TestCase, RequestFactory
from molo.core.tests.base import MoloTestCaseMixin
from freebasics.views import HomeView
from freebasics.templatetags import freebasics_tags
class EnvTestCase(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
def test_block_ordering(self):... | Python | 0 | @@ -415,17 +415,17 @@
_LATEST=
-3
+2
,%0A
@@ -470,17 +470,17 @@
ESTIONS=
-4
+3
,%0A
@@ -524,17 +524,17 @@
ECTIONS=
-7
+4
):%0A
@@ -852,9 +852,9 @@
l',
-7
+4
))%0A
@@ -939,33 +939,33 @@
uestions.html',
-4
+2
))%0A s
@@ -1106,17 +1106,17 @@
.html',
-1
+4
))%0A%0A
|
3a7c2cd827c08b2ee5cee1224b4b1d78e19ef99a | remove comments from stupid test | gary/integrate/tests/test_cy_dop853.py | gary/integrate/tests/test_cy_dop853.py | # coding: utf-8
"""
Test the integrators.
"""
from __future__ import absolute_import, unicode_literals, division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os
import time
# Third-party
import numpy as np
import matplotlib.pyplot as plt
# Project
from ... import pote... | Python | 0 | @@ -1465,18 +1465,16 @@
%0A
- #
t1 = ti
@@ -1486,26 +1486,24 @@
me()%0A
- #
t,w = pot.i
@@ -1543,34 +1543,32 @@
=nsteps,%0A
- #
@@ -1616,18 +1616,16 @@
%0A
- #
@@ -1676,18 +1676,16 @@
%0A
- #
pytimes
@@ -1715,18 +1715,16 @@
%0A
- #
prin... |
dc46cc42db2787589843843cd225e473320eab0d | use mezzanine for the demo homepage | demo/urls.py | demo/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from mezzanine.core.views import direct_to_template
from demo.widgy import widgy_site
admin.autodiscover()
# Add the urlpatterns for any custom Django applications here.
# You can also change the ``... | Python | 0 | @@ -990,67 +990,65 @@
url(
-%22%5E$%22, direct_to_template, %7B%22template%22: %22index.html%22
+r'%5E$', 'mezzanine.pages.views.page', %7B'slug': '/'
%7D, name=
%22hom
@@ -1035,38 +1035,38 @@
ug': '/'%7D, name=
-%22
+'
home
-%22
+'
),%0A%0A # HOMEPA
|
47a82c24e410af3693fd61040b6d2e2957734795 | Change EOF from a string to a standalone class | graphene/storage/base/general_store.py | graphene/storage/base/general_store.py | import abc
from graphene.storage.base.graphene_store import *
class GeneralStore(object):
"""
Handles the general storage operations of different types.
"""
# Used to demarcate end of file
EOF = "EOF"
# Used to indicate abstract methods
__metaclass__ = abc.ABCMeta
def __init__(self... | Python | 0.000003 | @@ -57,16 +57,36 @@
port *%0A%0A
+class EOF:%0A pass%0A
%0Aclass G
@@ -236,13 +236,11 @@
F =
-%22
EOF
-%22
%0A%0A
|
31d9425e4941b4b7b55804f8fc2aa605eab2791a | Add entity category to Wiz number entities (#76191) | homeassistant/components/wiz/number.py | homeassistant/components/wiz/number.py | """Support for WiZ effect speed numbers."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from typing import Optional, cast
from pywizlight import wizlight
from homeassistant.components.number import (
NumberEntity,
NumberEntityDescriptio... | Python | 0.000023 | @@ -442,16 +442,72 @@
allback%0A
+from homeassistant.helpers.entity import EntityCategory%0A
from hom
@@ -1675,16 +1675,63 @@
ffect%22,%0A
+ entity_category=EntityCategory.CONFIG,%0A
),%0A
@@ -2093,24 +2093,71 @@
dual_head%22,%0A
+ entity_category=EntityCategory.CONFIG,%0A
),%0A)%0A%0A%0Aa
|
f94580bad7e0d6df6bb92b34d153ade658d59c01 | Print output in test_debug__library_versions | tests/functional/test_debug.py | tests/functional/test_debug.py | import pytest
from pip._internal.commands.debug import create_vendor_txt_map
from pip._internal.utils import compatibility_tags
@pytest.mark.parametrize('expected_text', [
'sys.executable: ',
'sys.getdefaultencoding: ',
'sys.getfilesystemencoding: ',
'locale.getpreferredencoding: ',
'sys.platform... | Python | 0.000001 | @@ -974,33 +974,30 @@
g=True)%0A
-stdout =
+print(
result.stdou
@@ -993,24 +993,26 @@
esult.stdout
+)%0A
%0A vendore
@@ -1141,24 +1141,31 @@
, value) in
+result.
stdout%0A%0A%0A@py
|
ef6b027e90e2c41bf0ee5b4019595e23e4a0cfbe | Fix salt key tests for new no_color option | tests/integration/shell/key.py | tests/integration/shell/key.py | # Import python libs
import sys
# Import salt libs
from saltunittest import TestLoader, TextTestRunner
import integration
from integration import TestDaemon
class KeyTest(integration.ShellCase):
'''
Test salt-key script
'''
def test_list(self):
'''
test salt-key -L
'''
... | Python | 0.000003 | @@ -380,18 +380,8 @@
'
-%5Cx1b%5B1;31m
Unac
@@ -384,39 +384,32 @@
Unaccepted Keys:
-%5Cx1b%5B0m
',%0A
@@ -416,18 +416,8 @@
'
-%5Cx1b%5B1;32m
Acce
@@ -426,23 +426,16 @@
ed Keys:
-%5Cx1b%5B0m
',%0A
@@ -446,39 +446,22 @@
'
-%5Cx1b%5B0;32mminion%5Cx1b%5B0m
+minion
',%0A
@@ -468... |
54571a029400f5c03d8db6f08b7dddfdcb1e459a | Update HttpClient.py | http_client_panel/panels/HttpClient.py | http_client_panel/panels/HttpClient.py | # -*- coding: utf-8 -*-
import functools
from vcr import VCR
from debug_toolbar.panels import Panel
from vcr.cassette import CassetteContextDecorator, Cassette
class MemoryCassette(Cassette):
"""A simple memory cassette"""
_records = {}
@classmethod
def clear_records(cls, path):
del cls._re... | Python | 0 | @@ -429,20 +429,16 @@
path%5D =
-zip(
data%5B%22re
@@ -464,17 +464,16 @@
ponses%22%5D
-)
%0A%0A @c
|
c9d1fb454671a639872afa5bfd24fd0ae4c832e5 | Update initializedb script | usingnamespace/scripts/initializedb.py | usingnamespace/scripts/initializedb.py | import os
import sys
import transaction
import datetime
from sqlalchemy import engine_from_config
from sqlalchemy.exc import IntegrityError
from pyramid.paster import (
get_appsettings,
setup_logging,
)
from ..models import *
defaults = {
'users': [
(u'xistence@0x58.com', u'B... | Python | 0.000001 | @@ -722,29 +722,16 @@
atever',
- u'whatever',
u'Every
@@ -798,25 +798,16 @@
u'test',
- u'test',
u'A sim
@@ -869,18 +869,8 @@
dy',
- u'howdy',
u'A
@@ -938,19 +938,8 @@
(
-u'Ni Hao',
u'%5Cu
@@ -1237,30 +1237,36 @@
ork.lan', u'
-Ni Hao
+%5Cu4f60%5Cu597d
'),%0A
@@ -1412,14 +1412,20 @@
, u'
-Ni Hao... |
1ad7a09e3b3c3c1c7c091aef0ab8f4a027018f17 | Test step to delete pods | integration-tests/features/steps/oc.py | integration-tests/features/steps/oc.py | """Test steps that access OC client."""
from behave import given, then, when
from src.utils import *
from src.attribute_checks import *
from subprocess import CalledProcessError
import json
import re
@given(u'The OpenShift Client is installed')
def check_oc_command(context):
"""Check if 'oc' command is availab... | Python | 0 | @@ -3051,12 +3051,198 @@
(name=name)%0A
+%0A%0A@when(u'I delete all pods for the service %7Bservice_name%7D')%0Adef oc_delete_selected_pods(context, service_name):%0A %22%22%22Delete selected pods.%22%22%22%0A oc_delete_pods(service=service_name)%0A
|
55a747db1ba846e59b559b6c70eda8a90dd41806 | Fix optional group when creating service mapping | cloudkittydashboard/dashboards/admin/hashmap/forms.py | cloudkittydashboard/dashboards/admin/hashmap/forms.py | # Copyright 2015 Objectif Libre
#
# 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.000092 | @@ -2917,12 +2917,10 @@
0, (
-None
+''
, '
|
4d9be5639802af21258bcc8de476fedc39c39b2c | test splitreports: correctly load config | intelmq/tests/lib/test_splitreports.py | intelmq/tests/lib/test_splitreports.py | """
Tests for intelmq.lib.splitreports
"""
import io
import os
import tempfile
import unittest
import itertools
import base64
from intelmq.lib.splitreports import read_delimited_chunks, generate_reports
from intelmq.lib.message import Report
csv_test_data = b"\n".join(b",".join(line) for line in
... | Python | 0 | @@ -51,34 +51,8 @@
io%0A
-import os%0Aimport tempfile%0A
impo
@@ -210,16 +210,47 @@
t Report
+%0Afrom .test_message import HARM
%0A%0Acsv_te
@@ -3553,34 +3553,52 @@
mplate = Report(
+harmonization=HARM
)%0A
-
template
@@ -4028,33 +4028,32 @@
csv_test_data)%0A%0A
-%0A
def test_gen
@@ -4192,32 +4192... |
2b572a3ce0aa5a1241589fcd911f1685f2511b0f | make edges when fingerprinting | jamjar/jamjar/tasks/transcode_video.py | jamjar/jamjar/tasks/transcode_video.py |
from django.conf import settings
from tasks import app
from lilo import Lilo
import subprocess, logging, os, shutil
import boto3
class VideoTranscoder(object):
"Helper class for transcoding, uploading, and fingerprinting"
def __init__(self):
self.production = (settings.JAMJAR_ENV == 'prod')
s... | Python | 0.000001 | @@ -124,16 +124,62 @@
boto3%0A%0A
+from jamjar.videos.models import Video, Edge%0A%0A
class Vi
@@ -2523,21 +2523,21 @@
for
-video
+match
in matc
@@ -2564,57 +2564,79 @@
-# TODO: make graph edges here :)%0A pass
+Edge.new(video_id, match%5B'video_id'%5D, video%5B'offset'%5D, video%5B'offset'%... |
306e6939c5b369f4a4ef4bb4d16948dc1f027f53 | Update for PYTHON 985: MongoClient properties now block until connected. | tests/test_initial_ismaster.py | tests/test_initial_ismaster.py | # Copyright 2015 MongoDB, 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 agreed to in writing, so... | Python | 0 | @@ -1055,13 +1055,12 @@
sert
-IsNon
+Fals
e(cl
@@ -1064,22 +1064,20 @@
(client.
-addres
+node
s)%0A
@@ -1102,32 +1102,45 @@
('ismaster').ok(
+ismaster=True
)%0A wait_u
@@ -1163,27 +1163,13 @@
ent.
-address is not None
+nodes
,%0A
@@ -1197,14 +1197,12 @@
ate
-addres
+node
s',
@@ -1266,16 +1266,... |
48356a03e62929456d7a319fba6fcbb3b7504f42 | Rename 'r' to 'response' | lib/verifier.py | lib/verifier.py | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2012 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... | Python | 0.999999 | @@ -3018,16 +3018,23 @@
(self, r
+esponse
):%0A
@@ -3157,16 +3157,23 @@
if r
+esponse
.get('er
@@ -3231,16 +3231,23 @@
ror:', r
+esponse
)%0A
@@ -3277,16 +3277,23 @@
rams = r
+esponse
%5B'params
@@ -3313,16 +3313,23 @@
rkle = r
+esponse
%5B'result
|
8648451ca0b79bb0cf14ac743011e8d187095bfb | print time spent in query. | lib/zohmgapp.py | lib/zohmgapp.py | # zohmgapp.
import simplejson as json
from paste.request import parse_formvars
from HBaseScanner import HBaseScanner
from zohmg import Config
class zohmg:
def __init__(self, table):
self.config = Config()
self.table = self.config.project_name()
self.projections = self.config.projections()... | Python | 0.000249 | @@ -6,16 +6,33 @@
mgapp.%0A%0A
+import sys, time%0A
import s
@@ -4955,24 +4955,82 @@
ilters = %7B%7D%0A
+ # TODO: there must be a neater way of doing this.%0A
for
@@ -5046,16 +5046,16 @@
e(1,5):%0A
-
@@ -5252,16 +5252,44 @@
h data.%0A
+ start = time.time()%0A
@@ -5338,16... |
f0b26198bc3c0e3937db334af3c99643481a3d91 | change from file | tgext/pylogservice/__init__.py | tgext/pylogservice/__init__.py | from tg import config
from tg import hooks
from tg.configuration import milestones
import logging
log = logging.getLogger('tgext.pylogservice')
# This is the entry point of your extension, will be called
# both when the user plugs the extension manually or through tgext.pluggable
# What you write here has the same e... | Python | 0.000001 | @@ -1739,55 +1739,47 @@
-print 'Application Running!'%0A log.info('
+ %0A log.info('tgext.pylogservice
+ Ap
@@ -1842,10 +1842,10 @@
ndler
-
+%0A
%0A
|
ace177c6d83209eac6038fb4b3cc4b0c392e1cf4 | Integrate LLVM at llvm/llvm-project@4e5c44964a7f | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "be199527205dc8a8c7febc057ad6be90fac15547"
LLVM_SHA256 = "b43318ef35679dd1b6cb6c4cf1cd5888ac4530fb4149128e345cade0b6628e88"
tfrt_http_archive(
... | Python | 0.000002 | @@ -162,132 +162,132 @@
= %22
-be199527205dc8a8c7febc057ad6be90fac15547%22%0A LLVM_SHA256 = %22b43318ef35679dd1b6cb6c4cf1cd5888ac4530fb4149128e345cade0b6628e8
+4e5c44964a7f3ecbe93cd69bdbcbbcf2a5f52c28%22%0A LLVM_SHA256 = %2213cd6f2bbd749d5386f133dc44b0707e7f780149a91cf56e05b8a730103122d
8%22%0A%0A
|
df73a47311c8527ee6a5bd7b461d9ffd44d2ff17 | Switch repo tests query to be a (somewhat) faster join (#391) | zeus/api/resources/repository_tests.py | zeus/api/resources/repository_tests.py | from datetime import timedelta
from sqlalchemy.sql import func
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Repository, TestCase, Job
from zeus.utils import timezone
from .base_repository import BaseRepositoryResource
from ..schemas import TestCaseStatisticsSchema
test... | Python | 0.004575 | @@ -1006,94 +1006,41 @@
.
-filter(%0A TestCase.job_id.in_(%0A db.session.query(Job.
+join(Job, Job.id == TestCase.job_
id)%0A
@@ -1047,32 +1047,24 @@
-
-
.filter(%0A
@@ -1072,32 +1072,24 @@
-
-
Job.reposito
@@ -1106,24 +1106,16 @@
... |
af7d139391fc797e1fa5a6540f0589e5b0c2a1c0 | Bump version to 4.1.0.13.dev2 | maec/version.py | maec/version.py | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
__version__ = "4.1.0.13.dev1"
| Python | 0 | @@ -125,11 +125,11 @@
0.13.dev
-1
+2
%22%0A
|
af5e90cb544e2e37819302f5750084fc17f7ee12 | Remove sdbus++ template search workaround | make_example.py | make_example.py | #!/usr/bin/env python
import os
import sys
import yaml
import subprocess
class SDBUSPlus(object):
def __init__(self, path):
self.path = path
def __call__(self, *a, **kw):
args = [
os.path.join(self.path, 'sdbus++'),
'-t',
os.path.join(self.path, 'template... | Python | 0 | @@ -73,629 +73,34 @@
s%0A%0A%0A
-class SDBUSPlus(object):%0A def __init__(self, path):%0A self.path = path%0A%0A def __call__(self, *a, **kw):%0A args = %5B%0A os.path.join(self.path, 'sdbus++'),%0A '-t',%0A os.path.join(self.path, 'templates')%0A %5D%0A%0A ... |
1e07e9424a1ac69e1e660e6a6f1e58bba15472c1 | Implement saving and loading the observer tau | make_spectra.py | make_spectra.py | # -*- coding: utf-8 -*-
import halospectra as hs
import randspectra as rs
import sys
snapnum=sys.argv[1]
sim=sys.argv[2]
#base="/n/hernquistfs1/mvogelsberger/projects/GFM/Production/Cosmo/Cosmo"+str(sim)+"_V6/L25n512/output/"
#savedir="/n/home11/spb/scratch/Cosmo/Cosmo"+str(sim)+"_V6_512/snapdir_"+str(snapnum).rjust(3... | Python | 0 | @@ -600,17 +600,18 @@
,numlos=
-3
+10
000,save
@@ -649,20 +649,16 @@
ctra
-_DLA
.hdf5%22)%0A
halo
@@ -653,16 +653,17 @@
.hdf5%22)%0A
+#
halo.get
@@ -659,24 +659,33 @@
)%0A#halo.get_
+observer_
tau(%22Si%22,2,2
@@ -682,18 +682,16 @@
u(%22Si%22,2
-,2
)%0Ahalo.g
@@ -706,16 +706,17 @@
H%22,1,1)%0A
+#
halo.get
... |
d5ceda333f0ce164b7e565e35a5466a96295c05a | Apply review comments. | tools/notes_for_all_persons.py | tools/notes_for_all_persons.py | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# Copyright 2015 Google 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... | Python | 0 | @@ -2004,20 +2004,38 @@
ord_ids(
-repo
+persons_feed_file_name
, batch_
@@ -2109,42 +2109,70 @@
ven
-repo.%22%22%22%0A with open(sys.argv%5B3%5D
+persons feed CSV file.%22%22%22%0A with open(persons_feed_file_name
) as
@@ -2338,39 +2338,39 @@
e_notes_for_all_
-in_repo
+persons
(%0A basena
@@ -2363,2... |
f6044325919967138e9690a04337cde55d3aa9bc | rename doc to website_theme | frappe/website/doctype/website_theme/website_theme.py | frappe/website/doctype/website_theme/website_theme.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from os.path import join as join_path, exists as path_exists, abspath
class Websi... | Python | 0.019168 | @@ -4178,19 +4178,29 @@
et_scss(
-doc
+website_theme
):%0A%09def
@@ -4282,19 +4282,29 @@
%09opts =
-doc
+website_theme
.as_dict
|
08b1f59fceead38753c3aedf225b1f2c6a2a3a5d | Create `ImageFolder` with the same (sorted) order on different machines (#193) | torchvision/datasets/folder.py | torchvision/datasets/folder.py | import torch.utils.data as data
from PIL import Image
import os
import os.path
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
]
def is_image_file(filename):
return any(filename.endswith(extension) for extension in IMG_EXTENSIONS)
def find_classes(d... | Python | 0 | @@ -619,24 +619,31 @@
r target in
+sorted(
os.listdir(d
@@ -641,24 +641,25 @@
listdir(dir)
+)
:%0A d
|
de09edfbfecf6d374144aebde10b0eea043f894c | fix bug fila | totalvoice/cliente/api/fila.py | totalvoice/cliente/api/fila.py | # coding=utf-8
from __future__ import absolute_import
from .helper import utils
from .helper.routes import Routes
from totalvoice.cliente.api.totalvoice import Totalvoice
import json, requests
class Fila(Totalvoice):
def __init__(self, cliente):
super(Fila, self).__init__(cliente)
def get_fila(s... | Python | 0 | @@ -2601,27 +2601,27 @@
st, Routes.F
-ila
+ILA
, %5Bid%5D)%0A
@@ -3101,19 +3101,19 @@
Routes.F
-ila
+ILA
, %5Bid%5D,
|
faa6e871ca0175d4a32a757e018c9a292e4f89f0 | Fix style. | mario/parser.py | mario/parser.py | #!/usr/bin/env python3
# Copyright (c) 2015 Damir Jelić
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from pyparsing import *
def make_parser():
ParserElement.setDefaultWhitespaceChars('')
EOL = LineEnd().suppress()
Space = Literal(' ').suppres... | Python | 0.000001 | @@ -726,18 +726,18 @@
pand
- the
%0A #
+ the
alp
@@ -866,14 +866,19 @@
g')%0A
+
# TODO
+:
all
@@ -3834,16 +3834,17 @@
cator)%0A%0A
+%0A
def pars
|
d4905477b812213da2333103c9fdd789151ae2d8 | Allow core config updated (#26398) | homeassistant/components/websocket_api/permissions.py | homeassistant/components/websocket_api/permissions.py | """Permission constants for the websocket API.
Separate file to avoid circular imports.
"""
from homeassistant.const import (
EVENT_COMPONENT_LOADED,
EVENT_SERVICE_REGISTERED,
EVENT_SERVICE_REMOVED,
EVENT_STATE_CHANGED,
EVENT_THEMES_UPDATED,
)
from homeassistant.components.persistent_notification i... | Python | 0 | @@ -248,32 +248,62 @@
THEMES_UPDATED,%0A
+ EVENT_CORE_CONFIG_UPDATE,%0A
)%0Afrom homeassis
@@ -930,32 +930,62 @@
MPONENT_LOADED,%0A
+ EVENT_CORE_CONFIG_UPDATE,%0A
EVENT_PANELS
|
3e6595d6bf2ec0e3065fdec0c4e8d01d9f061c9e | refactor pizza meetup association test | meetup/tests.py | meetup/tests.py | from django.test import TestCase
from meetup.models import Meetup
from pizzaplace.models import PizzaPlace
from django.db import IntegrityError, DataError
from django.core.exceptions import ValidationError
class TestMeetup(TestCase):
def test_meetup_is_a_thing(self):
meetup = Meetup()
self.assertIsInstance(... | Python | 0.999969 | @@ -2042,15 +2042,15 @@
als(
-1, len(
+place,
meet
@@ -2070,17 +2070,19 @@
es.all()
-)
+%5B0%5D
)%0A%0A def
|
942e4a9c442417cbd08fc909b3cf99288708dea2 | Update utils.py | intelmq/bots/utils.py | intelmq/bots/utils.py | import re
import dns
import pytz
import socket
import binascii
import datetime
import dateutil.parser
import dateutil.tz
from urlparse import urlparse
def get_domain_name_from_url(url):
res = urlparse(url)
if res.netloc != "" and not is_ip(res.netloc):
return res.netloc
return None
... | Python | 0.000001 | @@ -2546,48 +2546,8 @@
%0D%0A
- timezones = __generate_timezones()%0D%0A
@@ -2589,27 +2589,8 @@
alue
-, tzinfos=timezones
)%0D%0A
@@ -3218,219 +3218,8 @@
nt%0D%0A
- %0D%0A %0D%0Adef __generate_timezones():%0D%0A timezones = dict()%0D%0A for tz_name in pytz.all_timezones:%0D%0A tz_code... |
f7cbd3a1f0accca48208b608ccec38b9866c7e16 | tidy fs_perms.py output | isolation/fs_perms.py | isolation/fs_perms.py | #!/usr/bin/env python3
# This script walks the directories specified in sys.argv[1:] prepared by
# make-perms-test.sh and attempts to read, write, and traverse (cd) each of
# the entries within. It compares the result to the expectation encoded in the
# filename.
#
# A summary line is printed on stdout. Running chatte... | Python | 0.00018 | @@ -2255,34 +2255,21 @@
nt('
- %25s
%25s' %25
- (expect,
result
-)
, fi
@@ -3283,17 +3283,39 @@
write(b'
-*
+written by fs_test.py%5Cn
')%0A%0Aif (
|
1b224e868011c7fb9e20cabaed26fb029355d04d | Add the member name to the description in tracking. | joku/cogs/tracking.py | joku/cogs/tracking.py | """
NSA-tier presence tracking.
"""
import datetime
import time
import discord
from discord import Status
from discord.ext import commands
from joku.bot import Context
from joku.cogs._common import Cog
class Tracking(Cog):
async def on_message(self, message: discord.Message):
author = message.author # ... | Python | 0.000023 | @@ -1359,32 +1359,108 @@
%22%0A else:%0A
+ em.description = %22**Tracking data for %7B%7D**%22.format(member.name)%0A
# fl
|
794e00511783aaf08a49b24843a5e7a5beae4c1d | fix traivs-ci unit test failure | moban/engine.py | moban/engine.py | import os
from collections import defaultdict
from jinja2 import Environment, FileSystemLoader
from moban.hashstore import HashStore
from moban.filters.text import split_length
from moban.filters.github import github_expand
import moban.utils as utils
import moban.constants as constants
import moban.exceptions as exc... | Python | 0 | @@ -4103,32 +4103,92 @@
ndered_content)%0A
+ rendered_content = rendered_content.encode('utf-8')%0A
flag = s
@@ -4322,24 +4322,41 @@
te_file_out(
+%0A
output, rend
@@ -4372,14 +4372,44 @@
ent,
- strip
+%0A strip=False, encode
=Fal
|
0e6cf0f032ca8b8c48282eb16d8e1751c869494b | update error message validation | jsonrpc/exceptions.py | jsonrpc/exceptions.py | import six
class JSONRPCError(object):
""" Error for JSON-RPC communication.
When a rpc call encounters an error, the Response Object MUST contain the
error member with a value that is a Object with the following members:
code: A Number that indicates the error type that occurred.
This MUST... | Python | 0.000001 | @@ -1194,25 +1194,24 @@
ode%0A
-#
self.message
@@ -1224,24 +1224,8 @@
sage
- or self.message
%0A
@@ -1233,9 +1233,8 @@
-#
self
@@ -1537,16 +1537,327 @@
_code)%0A%0A
+ def __get_message(self):%0A return self._dict%5B%22message%22%5D%0A%0A def __set_message(self, value):%0A if n... |
01c02ef00944bf26a811a7fa2503b284c5ddcf92 | converted varchar to text | jx_sqlite/__init__.py | jx_sqlite/__init__.py | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from _... | Python | 0.999998 | @@ -3596,67 +3596,8 @@
ean%22
-,%0A %22VARCHAR(80)%22: %22string%22 #varchar(80) for guid only
%0A%7D%0AS
|
d8405b54d7fd2634582585bd420be0636d804eee | Bump version to 7.0.0a3 | resolwe/__about__.py | resolwe/__about__.py | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | Python | 0 | @@ -484,17 +484,17 @@
'7.0.0a
-2
+3
'%0A%0A__aut
|
601c837c8af4ae439d3205d8756701d008149bcd | Revise comments & change lines | lc0304_range_sum_query_2d_immutable.py | lc0304_range_sum_query_2d_immutable.py | """Leetcode 304. Range Sum Query 2D - Immutable
Medium
URL: https://leetcode.com/problems/range-sum-query-2d-immutable/
Given a 2D matrix matrix, find the sum of the elements inside the rectangle
defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
Range Sum Query 2D
The above rectangle... | Python | 0 | @@ -2156,16 +2156,54 @@
+ 1)%5D%0A%0A
+ # Compute top-left range sum:%0A
@@ -2381,24 +2381,52 @@
T%5Br - 1%5D%5Bc%5D
+%0A
+ T%5Br%5D%5Bc - 1
@@ -2476,16 +2476,43 @@
%5D%5Bc - 1%5D
+%0A
- T%5Br -
@@ -2957,126 +2957,57 @@
#
+ Compute
sum
... |
0511ad666a22375afe14b89e94828d1bf3c746b7 | Add a way to handle multiple regex expression. (Used to exclude file, directory or path | a_john_shots/regex.py | a_john_shots/regex.py | !/usr/bin/env python
# python-regex - A simple implementation ot the python.re package
# Copyright (C) 2017 Funilrys - Nissar Chababy <contact at funilrys dot com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | Python | 0.000004 | @@ -1,8 +1,9 @@
+#
!/usr/bi
@@ -1311,24 +1311,635 @@
.search%22%22%22%0A%0A
+ if type(self.data) is list:%0A result = %5B%5D%0A for item in self.regex:%0A to_match = compile(item)%0A local_result = to_match.search(self.data)%0A%0A if self.retur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.