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 |
|---|---|---|---|---|---|---|---|
4f1820c67593b4e288d818a0c138d4eb72fe261e | fix tests | testapps/test_pillowtop/tests/test_reindexer.py | testapps/test_pillowtop/tests/test_reindexer.py | import uuid
from django.conf import settings
from django.core.management import call_command
from django.test import TestCase
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.domain.tests.test_utils import delete_all_domains
from corehq.apps.es import UserES, CaseES, FormES, ESQuery, DomainES
fro... | Python | 0.000001 | @@ -1533,16 +1533,50 @@
'domain'
+, 'cleanup': True, 'noinput': True
%7D)%0A
@@ -3108,32 +3108,60 @@
er_v2', index_id
+, cleanup=True, noinput=True
)%0A%0A self.
@@ -3760,16 +3760,44 @@
index_id
+, cleanup=True, noinput=True
)%0A%0A
|
d5cdf80b2076622bd136505e7ccececbc659a0bc | FAST=TRUE | modules/streams.py | modules/streams.py | import willie, sys, json
from os.path import expanduser
def setup(bot):
global twitchlist
with open("{0}/.willie/conf-module/streams.json".format(expanduser("~"))) as f: # loads streams.json from USER_HOME/.willie/conf-module/
twitchlist = json.load(f)
def lookup_twitch():
global twitchlist
tw... | Python | 0.99999 | @@ -833,18 +833,27 @@
dia=true
+&fast=true
%22
-
%25 team,
@@ -1328,19 +1328,30 @@
dia_
-user_name%22%5D
+display_name%22%5D.lower()
, st
|
b4149f9a5a3783cc00702bd60ce7637e3513b57f | Add a number of synthetic Java tests | px/px_commandline_test.py | px/px_commandline_test.py | import px_commandline
def test_get_command_python():
assert px_commandline.get_command("python") == "python"
assert px_commandline.get_command("/apa/Python") == "Python"
assert px_commandline.get_command("python --help") == "python"
# These are inspired by Python 2.7.11 --help output
assert px_co... | Python | 0.000001 | @@ -1705,17 +1705,8 @@
java
- -version
%22) =
@@ -1713,16 +1713,977 @@
= %22java%22
+%0A assert px_commandline.get_command(%22java -version%22) == %22java%22%0A assert px_commandline.get_command(%22java -help%22) == %22java%22%0A%0A assert px_commandline.get_command(%22java SomeClass%22) == %22SomeClass%22%... |
e60930a57f3fdd9e960e5f4f4c96d320faf59aaf | Add verified field to user admin | src/users/admin.py | src/users/admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .models import User
from .forms import AdminUserChangeForm, UserCreationForm
@admin.register(User)
class UserAdmin(UserAdmin):
fieldsets = (
(
None,
... | Python | 0 | @@ -713,16 +713,28 @@
+ 'verified',
'is_act
@@ -1199,74 +1199,15 @@
', '
-photo',%0A 'twitter_id', 'github_id', 'facebook_i
+verifie
d',%0A
@@ -1382,16 +1382,50 @@
lter = (
+%0A 'verified', 'is_active',
'is_staf
@@ -1443,29 +1443,24 @@
eruser',
- 'is_active',
+%0A
'g... |
66b76eb197f6ad6bce71fff7fe12481349f5016f | fix a pylint complain | claripy/ast.py | claripy/ast.py | import logging
l = logging.getLogger("claripy.ast")
class A(object):
'''
An A(ST) tracks a tree of operations on arguments. It has the following methods:
op: the operation that is being done on the arguments
args: the arguments that are being used
length: the length (in bits)
It also has the following usefu... | Python | 0.002039 | @@ -4243,24 +4243,56 @@
ult=result))
+ #pylint:disable=maybe-no-member
%0A%09%09%09else:%0A%09%09
|
9b8fbf586a379f11f09d981c46030cf5b9c48398 | remove msg | py/desispec/darkfinder.py | py/desispec/darkfinder.py | """
desispec.darkfinder
====================
Reading and selecting calibration data from $DESI_SPECTRO_DARK using content of image headers
"""
import re
import os
import glob
import numpy as np
import yaml
import os.path
from desispec.util import parse_int_args, header2night
from desiutil.log import get_logger
from d... | Python | 0.001059 | @@ -6010,128 +6010,60 @@
bug(
+f
%22F
-ound %25d data for camera %25s in filename %25s%22%25(len(data),cameraid,yaml_file))%0A log.debug(%22Finding matching version
+inding matching dark frames for camera %7Bcameraid%7D
...
|
4e0589aa1fee22a22816d3a44b175070073aecd8 | Add dummy functions for file dialog. | ProxyWidget.py | ProxyWidget.py | #!/usr/bin/env python3
import platform
import tkinter as tk
from tkinter import ttk
import tkinter.messagebox
from modules import ssh
from modules import socks
from modules import configurator
#Global variables
#Main app logic
class Application(ttk.Frame):
def __init__(self, master=None):
ttk.Frame.__init... | Python | 0 | @@ -2745,32 +2745,309 @@
pack()%0A %0A
+ self.idLabel = ttk.Label(self.optionsFrame, text = 'SSH Keyfile:')%0A self.chooseIdButton = ttk.Button(self.optionsFrame, text = 'Choose...', command = self.choose_id)%0A self.idLabel.pack(anchor = %22w%22)%0A self.chooseIdButton.pack(anchor =... |
97f64d01199efc65d18a08c47812d2820e872eb0 | update dev version after 0.57.1 tag [ci skip] | py/desitarget/_version.py | py/desitarget/_version.py | __version__ = '0.57.1'
| Python | 0 | @@ -14,10 +14,18 @@
'0.57.1
+.dev4806
'%0A
|
ae729a4c4b7360ec7884b3aa4018188d2c97d3d3 | Fix lint-unfriendly loop variable in flavors | bob/flavors.py | bob/flavors.py | #
# Copyright (c) 2008 rPath, Inc.
#
# All rights reserved.
#
'''
Defines default flavor sets and provides a mechanism for reading a config
target and producing a list of build flavors for that trove.
'''
from conary.deps import arch
from conary.deps import deps
_DISTROS = {
'rPL 1': { # rPath Linux 1 flavor de... | Python | 0.000017 | @@ -1372,16 +1372,20 @@
for
+one_
arch in
@@ -1428,16 +1428,20 @@
rches'%5D%5B
+one_
arch%5D%0A
|
007550f5918001bf925ec3307c5d246b318953bd | Clean up updateService | odm2api/ODM2/services/updateService.py | odm2api/ODM2/services/updateService.py | from __future__ import (absolute_import, division, print_function)
__author__ = 'jmeline'
from datetime import datetime
from odm2api.ODM2 import serviceBase
from odm2api.ODM2.models import *
# ################################################################################
# Annotations
# #########################... | Python | 0 | @@ -189,9 +189,26 @@
ort
-*
+(Actions, Results)
%0A%0A%0A#
@@ -414,25 +414,24 @@
rviceBase):%0A
-%0A
def upda
@@ -533,16 +533,20 @@
value%0A%0A
+
# ######
@@ -624,15 +624,23 @@
###%0A
+
# Core%0A
+
# ##
@@ -789,16 +789,17 @@
#
+
check ty
@@ -829,16 +829,17 @@
#
+
if not d
... |
55e9b1f6169d5b805bf0a65a15ff93a4e76abbc0 | make molotov work with the new asyncio.payload module | molotov/session.py | molotov/session.py | import socket
from urllib.parse import urlparse
import asyncio
from aiohttp.client import ClientSession, ClientRequest
from aiohttp import TCPConnector
from molotov.util import resolve
_HOST = socket.gethostname()
_UNREADABLE = "***WARNING: Molotov can't display this body***"
_BINARY = "**** Binary content ****"
_COM... | Python | 0 | @@ -145,16 +145,100 @@
nnector%0A
+try:%0A from aiohttp.payload import Payload%0Aexcept ImportError:%0A Payload = None%0A
from mol
@@ -2954,34 +2954,192 @@
if
-isinstance(req.body, bytes
+Payload is not None and isinstance(req.body, Payload):%0A body = req.body._value%0A else:%0A ... |
51a505747d29198ea3df0a43c32b1018a40e6bc9 | Move ratelimit functionality into its own class | monopoly/Bank/g.py | monopoly/Bank/g.py | import time
import json
import sqlite3
import socket
from collections import deque
class safesocket(socket.socket):
def __init__(self, *args):
self.floodQueue = deque([0] * 10, maxlen=10)
super().__init__(*args)
def send(self, message, *args):
try:
elapsed = int(time.time()... | Python | 0 | @@ -77,16 +77,539 @@
deque%0A%0A
+class ratelimit:%0A def __init__(self, max, duration):%0A self.max = max%0A self.duration = duration # in milliseconds%0A self.rateQueue = deque(%5B0%5D * max, maxlen=max)%0A%0A def queue(self, job):%0A elapsed = int(time.time() * 1000) - self.rateQu... |
7444c4e3b3549a6caf09ca85566ba4834e63a256 | Add iso8601 translator. | axes/utils.py | axes/utils.py | from axes.models import AccessAttempt
def reset(ip=None, username=None):
"""Reset records that match ip or username, and
return the count of removed attempts.
"""
count = 0
attempts = AccessAttempt.objects.all()
if ip:
attempts = attempts.filter(ip_address=ip)
if username:
... | Python | 0 | @@ -455,8 +455,592 @@
n count%0A
+%0A%0Adef iso8601(value):%0A %22%22%22Returns datetime.timedelta translated to ISO 8601 formatted duration.%0A %22%22%22%0A seconds = value.total_seconds()%0A minutes, seconds = divmod(seconds, 60)%0A hours, minutes = divmod(minutes, 60)%0A days, hours = divmod(hours... |
aa654a29018cb989fb8f1e3fe2a7d03a01f45981 | Add missing import | lib/mixminion/ScheduleUtils.py | lib/mixminion/ScheduleUtils.py | # Copyright 2002-2005 Nick Mathewson. See LICENSE for licensing information.
# Id: ClientMain.py,v 1.89 2003/06/05 18:41:40 nickm Exp $
"""mixminion.ScheduleUtils
Simple implementation of a block-until-it's-time-to-do-something scheduler.
"""
import threading
__all__ = [ 'ScheduledEvent', 'OneTimeEvent', 'Re... | Python | 0.000466 | @@ -246,16 +246,28 @@
%22%22%22%0A%0A
+import time%0A
import t
|
7315b03f014e8b92f2fddf9127e7092c7043a7b3 | handle case where there are few votes | mptracker/votes.py | mptracker/votes.py | from datetime import date
from collections import defaultdict
import logging
import re
import flask
from flask.ext.script import Manager
from flask.ext.rq import job
from sqlalchemy import or_
from mptracker import models
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
votes_manager = Manager()
v... | Python | 0.000045 | @@ -3161,18 +3161,20 @@
-top = max(
+votelist = %5B
%0A
@@ -3306,33 +3306,33 @@
novote'%0A
-)
+%5D
%0A return
@@ -3328,18 +3328,77 @@
-return top
+if not votelist:%0A return None%0A return max(votelist)
%5B1%5D%0A
|
455a948621983a23dd1d0d966152b8f14fcb6d42 | Update Ch. 16 PracticeQuestions: removed comment | books/CrackingCodesWithPython/Chapter16/PracticeQuestions.py | books/CrackingCodesWithPython/Chapter16/PracticeQuestions.py | # Chapter 16 Practice Questions
# 1. Why can't a brute-force attack be used against a simple substitution
# cipher, even with a powerful supercomputer?
# Hint: Check page 208
from math import factorial # Don't do this - imports should be at the top of the file
numKeys = factorial(26)
print(numKeys)
# 2. What does th... | Python | 0 | @@ -199,68 +199,8 @@
rial
- # Don't do this - imports should be at the top of the file
%0Anum
|
785d7ec6cb07283b6cef0f96543a831517b753c9 | Remove Numpy from pip install | APIs/python/setup.py | APIs/python/setup.py | """ Setup for Koheron TCP server API
From https://github.com/pypa/sampleproject/blob/master/setup.py
(c) Koheron
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
# http://stackoverflow.com/que... | Python | 0 | @@ -472,16 +472,17 @@
ld_ext%0A%0A
+#
class bu
@@ -502,16 +502,17 @@
d_ext):%0A
+#
def
@@ -535,16 +535,17 @@
(self):%0A
+#
@@ -578,16 +578,17 @@
s(self)%0A
+#
@@ -651,16 +651,17 @@
rocess:%0A
+#
@@ -697,16 +697,17 @@
= False%0A
+#
@@ -719,16 +719,17 @@
t numpy%0A
+#... |
f52287bfc6a38b35daf9d880886cc159550a157c | Make sure to avoid loading hacks on mutant loading | mutant/__init__.py | mutant/__init__.py | import logging
__version__ = VERSION = (0, 0, 1)
logger = logging.getLogger('mutant')
import hacks | Python | 0 | @@ -85,17 +85,4 @@
t')%0A
-%0Aimport hacks
|
610919069481e7d073930afa6ad00db3ecf5e242 | Fix to comparison using upper case | pyathenajdbc/formatter.py | pyathenajdbc/formatter.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
from datetime import date, datetime
from decimal import Decimal
from future.utils import PY3, iteritems
from pyathenajdbc.error import ProgrammingError
_logger = logging.getLogger(__name__)
if PY3... | Python | 0.999996 | @@ -2672,16 +2672,24 @@
eration.
+upper().
startswi
|
e33d44ca880f31c93dc5eef8d5162fec71f8d090 | Add PostgresqlDialect. | katagawa/backends/postgresql/__init__.py | katagawa/backends/postgresql/__init__.py | # used for namespace packages
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
DEFAULT_CONNECTOR = "asyncpg"
| Python | 0 | @@ -55,16 +55,17 @@
nd_path%0A
+%0A
__path__
@@ -104,34 +104,266 @@
_)%0A%0A
-DEFAULT_CONNECTOR = %22asyncpg%22
+from katagawa.backends.base import BaseDialect%0A%0ADEFAULT_CONNECTOR = %22asyncpg%22%0A%0A%0Aclass PostgresqlDialect(BaseDialect):%0A %22%22%22%0A The dialect for Postgres.%0A %22%22%22%0A de... |
a263e3ba31df4b63006617b2c7ed2717b2071bf9 | Troubleshoot Heroku deployment | mysite/settings.py | mysite/settings.py | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import dj_... | Python | 0.000001 | @@ -1465,24 +1465,26 @@
leware',%0A
+ #
'whitenoise
@@ -3718,16 +3718,18 @@
ic')%0A%5D%0A%0A
+#
STATICFI
|
5d86d7d0ddde0dbc2c2c934ae7af6ba390a63656 | Edit view | remo/profiles/views.py | remo/profiles/views.py | from datetime import datetime
import django.db
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponseForbidden
from django.contrib.auth.views import login as django_login
from django.views.generic.simple import direct_to_template
from session_csrf import anonymous_csrf
fr... | Python | 0.000001 | @@ -821,22 +821,121 @@
%0A%0A%0A@
-login_required
+permission_check(permissions=%5B'profiles.can_edit_profiles'%5D,%0A display_name_field='display_name')
%0Adef
@@ -965,45 +965,106 @@
name
-=None
):%0A
-return direct_to_template
+user = get_object_or_404(User, userprofile__display_name = displa... |
892667105fed04d0f36a045b9ff97f6b6df69feb | Fix extra collect_snippets warning (#2277) (#2307) | onnx/backend/test/case/node/scatter.py | onnx/backend/test/case/node/scatter.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
from onnx import helper
# The below Scatter's numpy implementation is from ... | Python | 0.000001 | @@ -1574,19 +1574,26 @@
attered%5B
+tuple(
idx
+)
%5D = upda
|
40176d3084c64cae33906bdef24cadcaa94544b0 | Fix a lint issue | src/vws/query.py | src/vws/query.py | """
Tools for interacting with the Vuforia Cloud Recognition Web APIs.
"""
import datetime
import io
from typing import List
from urllib.parse import urljoin
import requests
from urllib3.filepost import encode_multipart_formdata
from vws_auth_tools import authorization_header, rfc_1123_date
from vws._result_codes im... | Python | 0.000136 | @@ -635,16 +635,17 @@
pass%0A%0A
+%0A
class Cl
|
f09e3422bb49a7263653d99ed9ccfb1ee52288e4 | Update nim (#1426) | pygments/lexers/nimrod.py | pygments/lexers/nimrod.py | # -*- coding: utf-8 -*-
"""
pygments.lexers.nimrod
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Nim language (formerly known as Nimrod).
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include... | Python | 0 | @@ -1066,18 +1066,8 @@
sm',
- 'atomic',
'bi
@@ -1512,18 +1512,8 @@
rn',
- 'shared',
'sh
@@ -1582,40 +1582,30 @@
', '
-when
+using
', 'wh
-il
e
+n
', 'w
-ith', 'without
+hile
', '
|
4585ab22a4185122162b987cf8cc845a63ed5a05 | Make it possible for modules to send a response | pyheufybot/modules/say.py | pyheufybot/modules/say.py | from module_interface import Module, ModuleType
class Say(Module):
def __init__(self):
self.trigger = "say"
self.moduleType = ModuleType.ACTIVE
self.messagesTypes = ["PRIVMSG"]
self.helpText = "Usage: say <message> | Makes the bot say the given line"
def execute(self, message, ... | Python | 0.000001 | @@ -40,16 +40,62 @@
duleType
+%0Afrom message import IRCResponse, ResponseType
%0A%0Aclass
@@ -384,9 +384,87 @@
-pass
+return %5B IRCResponse(message.replyTo, ResponseType.MESSAGE, message.messageText) %5D
%0A
|
ce3d6c50b693d0183b8b1476567bc86762055129 | Fix substitude regex replacement | pykg_config/substitute.py | pykg_config/substitute.py | # Copyright (c) 2009-2012, Geoffrey Biggs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | Python | 0.000001 | @@ -3684,24 +3684,155 @@
ce_re(name)%0A
+ # Make sure backslashes are escaped (e.g. '%5Cg' or '%5C0', ... are escaped)%0A substitution = substitution.replace('%5C%5C', '%5C%5C%5C%5C')%0A
return t
|
7d3fdf6dcd1662c2c729df1fb4a415953b2e3eab | Allow sort order of events to be specified. | been/couch.py | been/couch.py | from hashlib import sha1
import time
import calendar
import couchdb
from core import Store
def dates_to_epoch(d):
for key, value in d.iteritems():
if hasattr(value, "iteritems"):
d[key] = dates_to_epoch(value)
elif type(value) is time.struct_time:
d[key] = calendar.timegm(va... | Python | 0 | @@ -3387,16 +3387,33 @@
rce=None
+, descending=True
):%0A
@@ -3457,20 +3457,26 @@
nding':
-True
+descending
%7D%0A
|
f391190692c599ce8be9c649a88f7e9a17b0b744 | Add args. | pymatgen/core/spectrum.py | pymatgen/core/spectrum.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from monty.json import MSONable
import numpy as np
from scipy.ndimage.filters import gaussian_filter1d
from pymatgen.util.coord_utils import get_linear_interpolated_value
"""
This module defines classes to re... | Python | 0.000002 | @@ -1116,156 +1116,755 @@
-if len(x) != len(y):%0A raise ValueError(%22x and y values have different lengths!%22)%0A self.x = np.array(x)%0A self.y = np.array(y
+%22%22%22%0A Args:%0A x (ndarray): A ndarray of N values.%0A y (ndarray): A ndarray of N x k value... |
85513edd0a2b0e3c0e64e8a00bef6381d5f370d1 | Bump version to 2.5.1.dev0 | pyqode/python/__init__.py | pyqode/python/__init__.py | # -*- coding: utf-8 -*-
"""
pyqode.python is an extension of pyqode.core that brings support
for the python programming language. It provides a set of additional modes and
panels for the frontend and a series of worker for the backend (code
completion, documentation lookups, code linters, and so on...).
"""
__version... | Python | 0 | @@ -323,11 +323,16 @@
= '2.5.
+1.dev
0'%0A
|
cc2e44d76c20b5eb03a645ce6ef3601be05e3f69 | Modify imports | pytablewriter/__init__.py | pytablewriter/__init__.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from dataproperty import LineBreakHandling
from typepy import (
Bool,
DateTime,
Dictionary,
Infinity,
Integer,
IpAddress,
List,
Nan,
NoneType,
NullString,
RealNumber,
String,
)
from .__version__ imp... | Python | 0.000001 | @@ -112,190 +112,8 @@
ling
-%0Afrom typepy import (%0A Bool,%0A DateTime,%0A Dictionary,%0A Infinity,%0A Integer,%0A IpAddress,%0A List,%0A Nan,%0A NoneType,%0A NullString,%0A RealNumber,%0A String,%0A)
%0A%0Afr
@@ -563,24 +563,209 @@
ign, Format%0A
+from .typehint import (%0A ... |
6c2adfde086fb13026d296fb796417232e0e40d2 | allow empty blocks in parser. | clay/parser.py | clay/parser.py | from clay.parserlib import *
from clay import tokens as t
from clay import lexer
from clay.ast import *
from clay.error import Location, raiseError
__all__ = ["parse"]
#
# combinators
#
def tokenType(klass) :
def predicate(x) : return type(x) is klass
return modify(condition(predicate), lambda x : x.value)
... | Python | 0 | @@ -4504,19 +4504,20 @@
l(%22%7B%22),
-one
+zero
Plus(sta
|
b723289c95333ddfcf07fb167d8af59d4fba31b2 | Update test_basics | openfisca_tunisia/tests/test_basics.py | openfisca_tunisia/tests/test_basics.py | # -*- coding: utf-8 -*-
from __future__ import division
import datetime
from openfisca_tunisia.model.data import CAT
from openfisca_tunisia.tests import base
scenarios_arguments = [
dict(
period = year,
parent1 = dict(
date_naissance = datetime.date(1972, 1, 1),
salaire_... | Python | 0.000001 | @@ -1415,14 +1415,15 @@
sca-
-France
+Tunisia
bas
|
577c5b61f936f59d3ff08a0aacf1411014e600e0 | Remove unnecessary context | manage.py | manage.py | #!/usr/bin/env python
import os
from flask_admin import Admin
from flask_admin.menu import MenuLink
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Shell
from labsys.app import create_app
from labsys.extensions import db
from labsys.auth.models import User, Role, PreAllowedUser
fro... | Python | 0.000174 | @@ -993,32 +993,33 @@
b.session),%0A
+#
ProtectedModelVi
@@ -1041,32 +1041,33 @@
b.session),%0A
+#
ProtectedModelVi
@@ -1087,32 +1087,33 @@
b.session),%0A
+#
ProtectedModelVi
@@ -1133,32 +1133,33 @@
b.session),%0A
+#
ProtectedModelVi
@@ -1178,32 +1178,33 @@
b.session),%0A
+#
ProtectedModel... |
ad707a7865c5374394fde3341468ecf099acfe21 | Make manage.py executable | manage.py | manage.py | #!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized t... | Python | 0.000015 | |
76cca32c453d43b2afbd0ed628ffeacbafc648eb | move import up in function definition | manage.py | manage.py | """
Flask-Script Manager commands to be run from command line. Examples
python manager.py --help
python manager.py create_db
"""
from flask_script import Manager
from extensions import db
from models import User
from factory import create_app
manager = Manager(create_app())
@manager.command
def gen_secret():
... | Python | 0.000001 | @@ -3747,24 +3747,58 @@
atabase.%22%22%22%0A
+ from datetime import datetime%0A
from mod
@@ -4164,42 +4164,8 @@
= 2%0A
- from datetime import datetime%0A
|
eff2461087bea6b0959dcdbd48d1873fd350e880 | Change config settings in manage.py | manage.py | manage.py | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from app import app
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
migrate = Migrate(app, db)
manager = Manager(app)
... | Python | 0.000001 | @@ -232,16 +232,34 @@
('config
+.DevelopmentConfig
')%0D%0A%0D%0Adb
@@ -422,8 +422,10 @@
er.run()
+%0D%0A
|
b56a14d247395f65fe54c22227b599b66270ded9 | Update spinthewheel.py | jarviscli/plugins/spinthewheel.py | jarviscli/plugins/spinthewheel.py | from plugin import plugin
import random
'''This code picks one of the random inputs given by the user
like spin wheel'''
@plugin("spin wheel")
def spin(jarvis, s):
jarvis.say(' ')
jarvis.say('welcome to spin the wheel\n')
jarvis.say('enter the number of elements in the wheel')
num = jarvis.input()
... | Python | 0 | @@ -306,24 +306,46 @@
vis.input()%0A
+ intnum = int(num)%0A
jarvis.s
@@ -426,16 +426,19 @@
ange(0,
+int
num):%0A
|
884cdda7304edfed8c026aac02217b4087f49d81 | fix recipe | kokki/cookbooks/mdadm/recipes/default.py | kokki/cookbooks/mdadm/recipes/default.py |
from kokki import *
if env.config.mdadm.arrays:
Package("mdadm")
Execute("mdadm-update-conf",
action = "nothing",
command = ("("
"echo DEVICE partitions > /etc/mdadm/mdadm.conf"
"; mdadm --detail --scan >> /etc/mdadm/mdadm.conf"
")"
))
for array in env.config.mdadm.arrays:
en... | Python | 0.999648 | @@ -470,17 +470,16 @@
fstype'%5D
-,
== %22xfs
|
bafea222db835f4f2fee8ad603b2b997b33922d4 | Fix call to create_tunnel and some other small things. | astral/node/tunnel.py | astral/node/tunnel.py | import threading
import asyncore
import time
from astral.net.tunnel import Tunnel
from astral.models import Ticket
from astral.models.ticket import TUNNEL_QUEUE
import logging
log = logging.getLogger(__name__)
class TunnelControlThread(threading.Thread):
def __init__(self):
super(TunnelControlThread, se... | Python | 0 | @@ -354,16 +354,46 @@
n = True
+%0A self.tunnels = dict()
%0A%0A de
@@ -624,25 +624,10 @@
ket.
-source.ip_address
+id
, ti
@@ -633,29 +633,35 @@
icket.source
-_port
+.ip_address
,%0A
@@ -661,32 +661,52 @@
+ ticket.source_port,
ticket.destinat
@@ -720,16 +720,36 @@
address,... |
7b48dc3d22c87d80aba8f7c11b5af6f55095735a | Remove import re | ciphers/vigenere.py | ciphers/vigenere.py | #!/usr/bin/python
import sys, getopt, re
def vigenereCipher(plainText, key):
# @see [asciitable] http://www.asciitable.com/
# @authors:
# - Bruno Souza Silva <bruno.souza.silva@grad.ufsc.br>
# - Guilherme Trilha <guitrilha@icloud.com>
# - Lucas Tonussi <lucas.tonussi@grad.ufsc.com>
cipherText = list()
... | Python | 0 | @@ -30,20 +30,105 @@
, getopt
-, re
+%0A%0Aclass Error(Exception):%0A %22%22%22Deciphering Exception Bad Password as Input.%22%22%22%0A pass
%0A%0Adef vi
|
6f118a880049c38b5a698aba77030a81f89d2371 | add hacky flag to disable jabber for now | parsers/vtec_parser.py | parsers/vtec_parser.py | '''
VTEC product ingestor
The warnings table has the following timestamp based columns, this gets ugly
with watches. Lets try to explain
issue <- VTEC timestamp of when this event was valid for
expire <- When does this VTEC product expire
updated <- Product Timestamp of when a product gets updated
... | Python | 0 | @@ -618,16 +618,27 @@
datetime
+%0Aimport sys
%0A%0A# thir
@@ -966,16 +966,161 @@
t = %7B%7D%0A%0A
+JABBER_ON = True%0Aif len(sys.argv) == 2 and sys.argv%5B1%5D == 'nojabber':%0A log.msg(%22Disabling Jabber as per command line%22)%0A JABBER_ON = False%0A%0A
def shut
@@ -3180,24 +3180,50 @@
oduct.text)%0A
+ ... |
abcb8e05914efd47d071039bb143e993542c09ee | use CherryPy as the HTTP server | manage.py | manage.py | #!/usr/bin/env python
from werkzeug import script
def make_app():
from websod.application import WebSod
return WebSod('sqlite:///sod.db')
def make_shell():
from websod import models, utils
application = make_app()
return locals()
action_runserver = script.make_runserver(make_app, use_reloader=Tr... | Python | 0 | @@ -43,16 +43,48 @@
t script
+%0Afrom cherrypy import wsgiserver
%0A%0Adef ma
@@ -279,16 +279,449 @@
cals()%0A%0A
+def make_server(hostname=%22localhost%22, port=9000):%0A def start_server(hostname=('h', hostname), port=('p', port)):%0A %22%22%22start a serveronduty server%0A %22%22%22%0A ser... |
705c129fcace300d96762ebbcbf1f84a7f6ac1a7 | Set the executable bit for manage.py | manage.py | manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wger.workout_manager.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Python | 0.000005 | |
ccbbd0bbacb6e07dee80d04886be3d6b970b1890 | Improve test output of scripted.py. | lib/rapidsms/tests/scripted.py | lib/rapidsms/tests/scripted.py | # vim: ai ts=4 sts=4 et sw=4
from harness import MockRouter, EchoApp
from rapidsms.backends.backend import Backend
from rapidsms.message import Message
import unittest, re
class MetaTestScript (type):
def __new__(cls, name, bases, attrs):
for key, obj in attrs.items():
if key.startswith("test"... | Python | 0.000003 | @@ -2904,19 +2904,18 @@
xpected
-for
+to
: %25s%22 %25
@@ -3015,16 +3015,21 @@
to send
+ '%25s'
to %25s,
@@ -3079,16 +3079,26 @@
%25 (
+msg.text,
num, msg
@@ -3178,19 +3178,20 @@
+(
%22%5Cn
-Received
+Incoming
tex
@@ -3197,24 +3197,24 @@
xt: %25s%5Cn
-Expected
+Response
text: %25
@@ -3214,1... |
59fec8fdcf811aefec7a03e0fc107a24ecb1d5ed | Refactor manager | manage.py | manage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" A script to manage development tasks """
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
from os import path as p
from manager import Manager
from subprocess import call
manager = Manager()
_basedir = p.d... | Python | 0.000001 | @@ -456,28 +456,16 @@
'clean')
-, shell=True
)%0A%0A%0A@man
@@ -588,28 +588,16 @@
-stage')
-, shell=True
)%0A%0A%0A@man
@@ -644,16 +644,70 @@
check')%0A
+@manager.arg('strict', 's', help='Check with pylint')%0A
@manager
@@ -734,16 +734,30 @@
ere=None
+, strict=False
):%0A %22
@@ -775,22 +775,23 @@
le with
... |
2ada26ff27c88685f97e7d82f5a3e1f923966b12 | change evolve_basis to a property | qspectra/dynamics/base.py | qspectra/dynamics/base.py | from abc import ABCMeta, abstractmethod
from ..operator_tools import hilbert_subspace_index
from ..utils import copy_with_new_cache, inspect_repr
class DynamicalModel(object):
"""
Abstract base class defining the DynamicalModel API used by spectroscopy
simulation methods
A DynamicalModel instance co... | Python | 0.000001 | @@ -2192,24 +2192,301 @@
repr(self)%0A%0A
+ @property%0A def evolve_basis(self):%0A return self._evolve_basis%0A%0A @evolve_basis.setter%0A def evolve_basis(self, val):%0A if val == 'site' or val == 'eigen':%0A self._evolve_basis = val%0A else:%0A raise ValueError... |
43484e16fd90b6a7de6a67915acbc776269f8850 | Use layout property to keep synced | bids/analysis/base.py | bids/analysis/base.py | import json
from .variables import BIDSVariableManager
from collections import namedtuple
DesignMatrix = namedtuple('DesignMatrix', ('entities', 'groupby', 'data'))
class Analysis(object):
def __init__(self, layouts, model, manager=None, **selectors):
if isinstance(model, str):
model = json.... | Python | 0 | @@ -611,26 +611,60 @@
- self.layout =
+@property%0A def layout(self):%0A return self.
mana
@@ -674,16 +674,17 @@
.layout
+
# for co
|
7fb63b44e6a9cddc04a9fe7f4e1ca13be7632e5c | Work around a bug in sqlite/sqlalchemy<0.7 (Closes #21,#22) | adhocracy/config/environment.py | adhocracy/config/environment.py | """Pylons environment configuration"""
import os
import time
import traceback
from mako.lookup import TemplateLookup
from paste.deploy.converters import asbool
from pylons import config, tmpl_context as c
from pylons.error import handle_mako_error
from sqlalchemy import engine_from_config
from sqlalchemy.interfaces im... | Python | 0 | @@ -242,16 +242,34 @@
o_error%0A
+import sqlalchemy%0A
from sql
@@ -2067,30 +2067,23 @@
-connectionproxy = None
+engineOpts = %7B%7D
%0A
@@ -2144,16 +2144,28 @@
+engineOpts%5B'
connecti
@@ -2171,16 +2171,18 @@
ionproxy
+'%5D
= Timer
@@ -2185,24 +2185,313 @@
imerProxy()%0A
+%0A # Work aroun... |
0f4fd0d49ba06963b0b97e032fd2e6eedf8e597a | Fix missing space between lede and rest of article | cloacina/extract_from_b64.py | cloacina/extract_from_b64.py | from bs4 import BeautifulSoup
import json
import re
def extract_from_b64(encoded_doc):
#doc = base64.urlsafe_b64decode(encoded_doc)
doc = encoded_doc.decode("base64")
doc = re.sub("</p><p>", " ", doc)
soup = BeautifulSoup(doc)
news_source = soup.find("meta", {"name":"sourceName"})['content']
ar... | Python | 0.999994 | @@ -203,24 +203,75 @@
, %22 %22, doc)%0A
+ doc = re.sub('%3Cdiv class=%22BODY-2%22%3E', %22 %22, doc)%0A
soup = B
|
f0f775247053ba4da68b3540ee5e0d3ebb4f8383 | Revise comments | lc0300_longest_increasing_subsequence.py | lc0300_longest_increasing_subsequence.py | """LC300. Longest Increasing Subsequence
Medium
URL: https://leetcode.com/problems/longest-increasing-subsequence/
Given an unsorted array of integers,
find the length of longest increasing subsequence.
Example:
Input: [10,9,2,5,3,7,101,18]
Output: 4
Explanation: The longest increasing subsequence is [2,3,7,101], ... | Python | 0 | @@ -1837,18 +1837,16 @@
e a
-LIS
table
+T
with
@@ -1851,23 +1851,20 @@
th each
-element
+T%5Bi%5D
denotin
@@ -1930,23 +1930,19 @@
of each
-element
+num
is at l
@@ -2042,15 +2042,9 @@
l i
-left to
+%3C
j;
@@ -2057,23 +2057,19 @@
# if
-element
+num
i is sm
@@ -2079,23 +2079,19 @@
er than
-ele... |
8b3d641c2cb1f43f5ddb122b68fd37df6d0ab1e3 | Update MIDDLEWARE to be compatible with Django 1.11+ | tests/fixtures/django1/bugsnag_demo/settings.py | tests/fixtures/django1/bugsnag_demo/settings.py | """
Django settings for bugsnag_demo project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... | Python | 0 | @@ -326,16 +326,32 @@
port os%0A
+%0Aimport django%0A%0A
BASE_DIR
@@ -1029,16 +1029,17 @@
es',%0A)%0A%0A
+_
MIDDLEWA
@@ -1044,16 +1044,8 @@
WARE
-_CLASSES
= (
@@ -1441,16 +1441,119 @@
are'%0A)%0A%0A
+if django.VERSION %3E= (1, 10):%0A MIDDLEWARE = _MIDDLEWARE%0Aelse:%0A MIDDLEWARE_CLASSES = _MIDDLEWARE%0A... |
a154ccdf9bb0d6ba06b4038789437bd98d656282 | fix incorrect url pattern for archived studentships | vacancies_and_studentships/urls.py | vacancies_and_studentships/urls.py | from django.conf.urls.defaults import patterns, url
import views
urlpatterns = patterns('',
# vacancies and studentships items
url(r"^vacancy/(?P<slug>[-\w]+)/$", views.vacancy, name="vacancy"),
url(r"^studentship/(?P<slug>[-\w]+)/$", views.studentship, name="studentship"),
# entities' vacanc... | Python | 0.99241 | @@ -621,36 +621,31 @@
)?$', views.
-vacancies_an
+archive
d_studentshi
@@ -650,36 +650,31 @@
hips, name=%22
-vacancies_an
+archive
d_studentshi
|
ba87bbfb11b0fe7ff2b760204bf2e5b047a2c314 | Remove duplicate function | alignak_app/dock/widgets/spy.py | alignak_app/dock/widgets/spy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | Python | 0.002925 | @@ -1427,26 +1427,24 @@
elf.add_
+spy_
host
-_spied
)%0A%0A d
@@ -1450,26 +1450,24 @@
def add_
+spy_
host
-_spied
(self, h
@@ -1519,17 +1519,53 @@
ied list
-.
+ and create corresponding EventItem()
%0A%0A
@@ -2030,494 +2030,8 @@
m)%0A%0A
- def create_item_spied(self, host_id):%0A %22%22%22%0... |
5987747657a031f41f1bbb0f741e5cc86d980810 | Refactor import in base | yerba/base.py | yerba/base.py | import argparse
import atexit
import json
import logging
from time import sleep
import zmq
from yerba import core
from yerba.managers import (ServiceManager, WorkflowManager)
from yerba.routes import (route, dispatch)
from yerba.workqueue import WorkQueueService
logger = logging.getLogger('yerba')
running = True
deco... | Python | 0.000004 | @@ -95,24 +95,29 @@
om yerba
+.core
import
core%0Afro
@@ -108,19 +108,42 @@
import
-cor
+status_message, status_nam
e%0Afrom y
@@ -240,16 +240,57 @@
spatch)%0A
+from yerba.workflow import WorkflowError%0A
from yer
@@ -919,20 +919,23 @@
while
-T
ru
-e
+nning
:%0A
@@ -2496,23 +2496,99 @@
5)%0A%0A
... |
29ca88405f37019932ea82042ebdadaafbda69af | Remove lang arg, dont need it ...yet | apps/codrspace/templatetags/short_codes.py | apps/codrspace/templatetags/short_codes.py | """Custom filters to grab code from the web via short codes"""
import requests
import re
from django.utils import simplejson
from django import template
from django.utils.safestring import mark_safe
from codrspace.templatetags.syntax_color import _colorize_table
import markdown
register = template.Library()
@regis... | Python | 0 | @@ -357,30 +357,24 @@
losivo(value
-, lang
):%0A %22%22%22%0A
@@ -837,22 +837,16 @@
ar(value
-, lang
)%0A
@@ -962,30 +962,24 @@
r_gist(value
-, lang
):%0A patte
@@ -1559,33 +1559,24 @@
return (
-%0A
re.sub(patte
@@ -1617,35 +1617,21 @@
alue)),
-%0A match%0A
+match
)%0A%0A%... |
23a27a0b8b0c23338612b27db4db6efe94c79b18 | Add types to comments | avalon/tags/insert.py | avalon/tags/insert.py | # -*- coding: utf-8 -*-
#
# Avalon Music Server
#
# Copyright 2012-2015 TSH Labs <projects@tshlabs.org>
#
# Available under the MIT license. See LICENSE for details.
#
"""Functionality for loading various audio tag metadata into the database."""
from __future__ import absolute_import, unicode_literals
import sys
imp... | Python | 0 | @@ -310,16 +310,17 @@
ort sys%0A
+%0A
import s
@@ -333,17 +333,16 @@
emy.exc%0A
-%0A
from ava
@@ -403,16 +403,17 @@
n.util%0A%0A
+%0A
__all__
@@ -1203,17 +1203,246 @@
and tags
-.
+ to insert.%0A%0A :param sqlalchemy.orm.Session session: Database session to use.%0A :param list tags: List of audio m... |
ffdc346e2234291d3e9279f3290cdc8003435210 | fix import error. spotted by samueladam. | couchdbkit/utils.py | couchdbkit/utils.py | # -*- coding: utf-8 -
#
# This file is part of couchdbkit released under the MIT license.
# See the NOTICE for more information.
"""
Mostly utility functions couchdbkit uses internally that don't
really belong anywhere else in the modules.
"""
from __future__ import with_statement
import codecs
import string
from c... | Python | 0 | @@ -493,20 +493,22 @@
-from
+import
simplej
@@ -511,22 +511,18 @@
plejson
-import
+as
json%0A
|
51d37f7ac6bebf9b1d4c6efd16a968b7410a7791 | Save mul at the end to force execution. | rcnmf/tests/test_tsqr2.py | rcnmf/tests/test_tsqr2.py | import dask.array as da
from into import into
from dask.array.into import discover
from dask.dot import dot_graph
import tempfile
import rcnmf.tsqr
x = da.random.standard_normal(size=(100, 100), blockshape=(100, 50))
temp_file = tempfile.NamedTemporaryFile(suffix='.hdf5')
uri = temp_file.name + '::/X'
into(uri, x)
... | Python | 0 | @@ -713,16 +713,64 @@
'mul')%0A%0A
+uri = temp_file.name + '::/mul'%0Ainto(uri, mul)%0A%0A
temp_fil
|
d707426caae0038609fcc71531fd5d7aa61f4f47 | Bump jaxlib version to 0.1.5 in preparation for building new wheels. | build/setup.py | build/setup.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -745,9 +745,9 @@
0.1.
-4
+5
',%0A
|
070f96cba5417b96e4c1b0a496f7bff0b9907172 | Fix resolve condition | rdmo/conditions/models.py | rdmo/conditions/models.py | from django.conf import settings
from django.core.cache import caches
from django.db import models
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import copy_model, join_url
from rdmo.domain.models import Attribute
class Condition(models.Model):
RELATION_EQUAL = 'eq'
RELATION_N... | Python | 0.000003 | @@ -4707,120 +4707,8 @@
dex)
-%0A else:%0A # set_prefix is empty, this is the highest level%0A return False
%0A%0A
|
b70ccdef84bd818ee445c974f0c6a8eca17f9257 | modify re_path from urls.py file | credentials/urls.py | credentials/urls.py | """credentials URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: re_path(r'^$', views.home, name='home')
Cl... | Python | 0 | @@ -1927,17 +1927,17 @@
_ui(
-'
+%22
swagger
-'
+%22
, ca
|
6703427bb70ebec3df22844df7b22026266c0b04 | Set PYTHONPATH during runtime | tests/python-test-library/testcases/runtests.py | tests/python-test-library/testcases/runtests.py | #!/usr/bin/env python2.5
##
## @file runtests.py
##
## Copyright (C) 2008 Nokia. All rights reserved.
##
##
##
##
## Requires python2.5-gobject and python2.5-dbus
##
## Implements also some testing API:
##
##
import os
from time import sleep
import dbus
import commands
import dbus_emulator
import conf
import contex... | Python | 0.000001 | @@ -205,16 +205,86 @@
%0A##%0A## %0A
+import sys%0Asys.path.append(%22../testcases%22)%0Asys.path.append(%22../stubs%22)
%0Aimport
|
bc4b6e80688f9bebd3220fed12645aeb58d710c9 | Update : client db_name param renamed | client/base.py | client/base.py | from __future__ import absolute_import
import zmq
import msgpack
from .message import Message
from .error import ELEVATOR_ERROR
from elevator.constants import FAILURE_STATUS
from elevator.db import DatabaseOptions
class Client(object):
def __init__(self, db_name=None, *args, **kwargs):
self.protocol =... | Python | 0.000001 | @@ -260,21 +260,16 @@
self, db
-_name
=None, *
@@ -607,21 +607,16 @@
db
-_name
= 'defa
@@ -633,21 +633,16 @@
t db
-_name
else db
_nam
@@ -637,21 +637,16 @@
else db
-_name
%0A
@@ -666,21 +666,11 @@
t(db
-_name=db_name
+=db
)%0A%0A
@@ -731,37 +731,32 @@
connect(self, db
-_name
):%0A s... |
54bcdb0ca215c1d76b096240778354c30d16f453 | fix a few bugs in shape features | bin/helloRadiomics.py | bin/helloRadiomics.py | from radiomics import firstorder, glcm, preprocessing, shape, rlgl
import SimpleITK as sitk
import sys, os
#imageName = sys.argv[1]
#maskName = sys.argv[2]
testBinWidth = 25
#testResampledPixelSpacing = (3,3,3) no resampling for now.
dataDir = os.path.dirname(os.path.abspath(__file__)) + os.path.sep + ".." + os.path... | Python | 0 | @@ -2285,507 +2285,8 @@
al%0A%0A
-%0A#%0A# Show Shape features%0A#%0AshapeFeatures = shape.RadiomicsShape(image, mask, 10)%0AshapeFeatures.enableAllFeatures()%0A%0Aprint 'Will calculate the following Shape features: '%0Afor f in shapeFeatures.enabledFeatures.keys():%0A print ' ',f%0A print eval('shapeFeatures.get'+... |
a591f5617de1280441012ddf846ccc1088963f47 | Fix SSL protocol error (thx cocoto) | module/plugins/hoster/MegaNz.py | module/plugins/hoster/MegaNz.py | # -*- coding: utf-8 -*-
import random
import re
from Crypto.Cipher import AES
from Crypto.Util import Counter
from array import array
from base64 import standard_b64decode
from os import remove
from module.common.json_layer import json_loads, json_dumps
from module.plugins.Hoster import Hoster
class MegaNz(Hoster)... | Python | 0 | @@ -47,70 +47,8 @@
re%0A%0A
-from Crypto.Cipher import AES%0Afrom Crypto.Util import Counter%0A
from
@@ -128,16 +128,114 @@
remove%0A%0A
+from Crypto.Cipher import AES%0Afrom Crypto.Util import Counter%0Afrom pycurl import SSL_CIPHER_LIST%0A%0A
from mod
@@ -427,17 +427,17 @@
_ = %220.1
-5
+6
%22%0A%0A _
@@ -39... |
fc526b19fbd23976742fd146ed521ba80cdea40f | Add 'make admin' command | manage.py | manage.py | #!/usr/bin/env python
import os, csv
COV = None
if os.environ.get('FLASK_COVERAGE'):
import coverage
COV = coverage.coverage(branch=True, include='app/*')
COV.start()
if os.path.exists('.env'):
print('Importing environment from .env...')
for line in open('.env'):
var = line.strip().split('=... | Python | 0.000012 | @@ -2146,16 +2146,192 @@
oles()%0A%0A
+@manager.command%0Adef make_admin(username):%0A u = User.query.filter_by(username=username).first()%0A u.role_id = 1%0A print(u.username,'was made admin')%0A db.session.commit()%0A %0A%0A
@manager
|
c647e8be710bbb0f696a6071d2ac3e4992e44b09 | 删除win32 api使用。 | src/SwitchHosts.py | src/SwitchHosts.py | # -*- coding: utf-8 -*-
#
# author: oldj
# blog: http://oldj.net
# email: oldj.wu@gmail.com
#
import os
import time
import wx
import libs.common_operations as co
from libs.MainFrame import MainFrame
from libs.VERSION import VERSION as sVer
class SwitchHostsApp(object):
VERSION = sVer
def __init__(self):
... | Python | 0 | @@ -2968,453 +2968,8 @@
n%0A%0A%0A
-def isAppRunning():%0A u%22%22%22%E5%AE%9E%E7%8E%B0Windows%E4%B8%8B%E5%8D%95%E4%B8%80%E5%AE%9E%E4%BE%8B%22%22%22%0A%0A is_exist = False%0A%0A if os.name != %22nt%22:%0A return is_exist%0A%0A import win32ui%0A import win32con%0A%0A try:%0A win = win32u... |
359040acc4b8c54db84e154b15cabfb23b4e18a6 | Use VISION_BONNET_MODELS_PATH env var for custom models path. | src/aiy/vision/models/utils.py | src/aiy/vision/models/utils.py | """Utility to load compute graphs from diffrent sources."""
import os
def load_compute_graph(name):
path = os.path.join('/opt/aiy/models', name)
with open(path, 'rb') as f:
return f.read()
| Python | 0.000005 | @@ -65,16 +65,17 @@
ort os%0A%0A
+%0A
def load
@@ -112,18 +112,49 @@
os.
-path.join(
+environ.get('VISION_BONNET_MODELS_PATH',
'/op
@@ -170,14 +170,8 @@
els'
-, name
)%0A
@@ -180,20 +180,40 @@
th open(
+os.
path
+.join(path, name)
, 'rb')
@@ -238,9 +238,8 @@
.read()%0A
-%0A
|
80057aa81aa016573dfb648f5661be7621f91f40 | Introduce tfrt_py_binary that has adds a "do_not_disable_rtti" tag by default. Make tf_runtime.no_rtti TAP project ignore those python binary and test targets to avoid linker issues. | build_defs.bzl | build_defs.bzl | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -3277,28 +3277,229 @@
res,%0A **kwargs%0A )%0A
+%0Adef tfrt_py_binary(%0A tags = %5B%5D,%0A **kwargs):%0A %22%22%22A py_binary with tfrt-specific options.%22%22%22%0A native.py_binary(%0A tags = tags + %5B%22do_not_disable_rtti%22%5D,%0A **kwargs%0A )%0A
|
9cb4ba7bd05b8a7b6bd69bcc33cd791580f84be1 | write longest sequence to a file | bin/longest_contig.py | bin/longest_contig.py | """
Print the length of the longest contig for each file in a directory of fasta files.
"""
import os
import sys
import argparse
from roblib import read_fasta
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Print the length of the longest contig for each file i... | Python | 0.017446 | @@ -152,16 +152,25 @@
ad_fasta
+, bcolors
%0A%0A__auth
@@ -439,183 +439,903 @@
-args = parser.parse_args()%0A%0A for f in os.listdir(args.d):%0A fa = read_fasta(os.path.join(args.d, f))%0A lengths = %5Blen(fa%5Bx%5D) for x in fa%5D%0A lengths.sort()
+parser.add_argument('-f', help='fasta... |
274e0eaa2c60ea116d798e1aaa7429ac59c60fbd | make manage.py is more simple | manage.py | manage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Manager for pywebase
#
import os
import sys
import settings
from packages import bottle
from packages import pywebase
# -----------------------------------------------
# Application functions (they can be changed
# in your application)
# ----------------------... | Python | 0.000001 | @@ -73,74 +73,8 @@
%0A#%0A%0A
-import os%0Aimport sys%0Aimport settings%0A%0Afrom packages import bottle%0A
from
@@ -693,16 +693,31 @@
':%0A %0A
+ import sys%0A
from
@@ -940,17 +940,16 @@
: manage
-r
%3Cstart,
|
d569336a291be8dcfcc30156c10544dd9161886a | fix recursion for wrong sequence on function declaration | module_version/models/module.py | module_version/models/module.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2013-2015 Didotech srl (info at didotech.com)
#
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the w... | Python | 0.000001 | @@ -2990,17 +2990,8 @@
uid,
- count=0,
con
@@ -2991,32 +2991,41 @@
id, context=None
+, count=0
):%0A conte
|
5110110545152d5a13e8eab54c85c30ca2d67485 | refactor runtime props | cloudstack_plugin/network.py | cloudstack_plugin/network.py | ########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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 requir... | Python | 0.000003 | @@ -947,24 +947,43 @@
'name': ctx.
+runtime_properties.
node_id,%0A
@@ -1567,24 +1567,43 @@
.format(ctx.
+runtime_properties.
node_id, ctx
@@ -1621,32 +1621,52 @@
rties))%0A%0A ctx
+.runtime_properties.
%5B'network_id'%5D =
@@ -1666,24 +1666,43 @@
_id'%5D = ctx.
+runtime_properties.
node_id%0A%0A
@@ -4... |
84c5ac764b6ca2f452db2f387d0f838d395e31fa | Remove duplicate import of "sys" module. | manage.py | manage.py | #!/usr/bin/env python
import os
import site
import sys
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
prev_sys_path = list(sys.path)
site.addsitedir(path('apps'))
site.addsitedir(path('lib'))
site.addsitedir(path('vendor'))
# Move the new items to the front of sys.path.
... | Python | 0 | @@ -905,27 +905,8 @@
or:%0A
- import sys%0A
|
7127132e0a0c7c478ed1aa29dc9c6ffe9ed670d2 | Add comments and NotImplementedErrors for _ParticleFilterSetOperations | hoomd/filter/set_.py | hoomd/filter/set_.py | from hoomd.filter.filter_ import _ParticleFilter
from hoomd import _hoomd
class _ParticleFilterSetOperations(_ParticleFilter):
def __init__(self, f, g):
if f == g:
raise ValueError("Cannot use same filter for {}"
"".format(self.__class__.__name__))
else:
... | Python | 0 | @@ -118,24 +118,529 @@
cleFilter):%0A
+ %22%22%22An abstract class for %60ParticleFilters%60 with set operations.%0A%0A Should not be instantiated directly.%22%22%22%0A%0A @property%0A def _cpp_cls_name(self):%0A %22%22%22The name of the C++ class in the %60_hoomd%60 module.%0A%0A Used for Py... |
b001530004d856462b1edd5c6053e3c4cb0ea466 | Use reloader for runserver | manage.py | manage.py | #!/usr/bin/env python
from flask.ext.script import Manager
from flask.ext.migrate import MigrateCommand
from kcsrv import app
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()
| Python | 0 | @@ -51,16 +51,24 @@
Manager
+, Server
%0Afrom fl
@@ -151,16 +151,92 @@
er(app)%0A
+manager.add_command('runserver', Server(host='0.0.0.0', use_reloader=True))%0A
manager.
|
85f8e7e79c56caa9c37fead6b650f6c0321207e9 | Rebase master | manage.py | manage.py | # coding: utf-8
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mbaas.settings")
import pymysql
pymysql.install_as_MySQLdb()
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv... | Python | 0 | @@ -174,13 +174,8 @@
sql%0A
- %0A
|
63dd856fad5f6afd0927d9b051c4e59ed85dd092 | Remove unnecessary variable | cmake/print_cmake_command.py | cmake/print_cmake_command.py | import sys
import os
from subprocess import check_output
if __name__ == '__main__':
build_type = "RelWithDebInfo"
if len(sys.argv) > 1:
build_type = sys.argv[1]
ValidBuildTypes = ('Debug', 'Release', 'RelWithDebInfo')
if not build_type in ValidBuildTypes:
raise ValueError("invalid build... | Python | 0.000978 | @@ -179,25 +179,28 @@
-ValidB
+if b
uild
-Types =
+_type not in
('D
@@ -238,49 +238,8 @@
fo')
-%0A if not build_type in ValidBuildTypes
:%0A
|
823a772ee95e3e7db244108534478ffd5147e96d | Fix failed test runner | manage.py | manage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
""" A script to manage development tasks """
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
from os import path as p
from subprocess import call, check_call, CalledProcessError
from... | Python | 0 | @@ -2716,32 +2716,42 @@
'failed') else '
+ --with-id
'%0A opts += '
|
7b82626201812710c4013d05279572a06e641bbd | remove unnecessary imports | manage.py | manage.py | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from golf_stats import app, db
from golf_stats.utils import export_all, import_all
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCom... | Python | 0.000079 | @@ -1,68 +1,4 @@
-from flask import Flask%0Afrom flask_sqlalchemy import SQLAlchemy%0A
from
|
b2320932ecdfe09bbd0fad71ebffce0f4fde6f94 | Update web_app.py | simple_vatic/server/web_app.py | simple_vatic/server/web_app.py | # encoding / decoding
import json
# time / logging
import time
#import logging
#import traceback
# flask
import flask
import werkzeug
import tornado.wsgi
import tornado.httpserver
# misc
import argparse
import os
# Obtain the flask app object
app = flask.Flask(__name__)
def load_annotation_tasks():
"""
Wr... | Python | 0 | @@ -882,16 +882,17 @@
# anno
+t
ations :
@@ -1619,31 +1619,132 @@
#
-dummy code %0A
+find the task to update%0A task = filter(lambda x: x%5B'id'%5D == video_id, annotation_tasks)%0A %0A # ...%0A %0A #
return
True
@@ -1743,12 +1743,69 @@
urn
-T
+t
rue
+ if task is updated, false if not%0... |
9cd9fc25d3f708b83041508960ced66d3f4a5e36 | reset managed attributes on mapped classes when clear_mappers called | lib/sqlalchemy/orm/__init__.py | lib/sqlalchemy/orm/__init__.py | # mapper/__init__.py
# Copyright (C) 2005, 2006, 2007 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
the mapper package provides object-relational functionality, building upon the schema and sq... | Python | 0 | @@ -753,16 +753,35 @@
_session
+, attribute_manager
%0A%0A__all_
@@ -3314,24 +3314,129 @@
mapper.%22%22%22%0A
+ for mapper in mapper_registry.values():%0A attribute_manager.reset_class_managed(mapper.class_)%0A
mapper_r
|
7725f1af0134c6d9db5b9ed116118fd6a9dd1295 | make server candlestick demo sync with file demo | examples/plotting/server/candlestick.py | examples/plotting/server/candlestick.py |
import pandas as pd
from bokeh.sampledata.stocks import MSFT
from bokeh.plotting import *
output_server("candlestick.py example")
hold()
df = pd.DataFrame(MSFT)
df['date'] = pd.to_datetime(df['date'])
dates = df.date.astype(int)
mids = (df.open + df.close)/2
spans = abs(df.close-df.open)
inc = df.close > df.ope... | Python | 0 | @@ -159,16 +159,21 @@
me(MSFT)
+%5B:50%5D
%0Adf%5B'dat
@@ -491,25 +491,25 @@
mids%5Binc%5D,
-5
+w
, spans%5Binc%5D
@@ -583,17 +583,17 @@
s%5Bdec%5D,
-5
+w
, spans%5B
|
b779199a38ba4a8f08ca8f0aa321e69433f231a4 | add type hints | binary_search_tree.py | binary_search_tree.py | class BinarySearchTree:
def __init__(self):
self.root = None
def min(self, start_node=None):
if not start_node:
start_node = self.root
if not start_node:
return None # empty tree
last_taversed_node = start_node
while last_taversed_node.left_child... | Python | 0 | @@ -1,24 +1,824 @@
+from typing import Optional%0A%0A%0Aclass BinarySearchNode:%0A def __init__(self, label: int,%0A parent: Optional%5B'BinarySearchNode'%5D=None,%0A left_child: Optional%5B'BinarySearchNode'%5D=None,%0A right_child: Optional%5B'BinarySearchNode'%5D=No... |
c23e136d929ac2fb626d407f1259fd6acf63d7ac | Remove reference to a test that no longer exists | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main(args):
pwd = os.environ.get('PWD', '')
is_integration_bot = 'nacl-chrome' in pwd
... | Python | 0.000011 | @@ -3078,328 +3078,8 @@
n':%0A
- # The following test is failing on Mac OS X 10.5. This may be%0A # because of a kernel bug that we might need to work around.%0A # See http://code.google.com/p/nativeclient/issues/detail?id=1835%0A # TODO(mseaborn): Remove this when the issue is resolved.%0A tests_to_di... |
26811edc8023c24377a5cfae9d4699ae91df47f8 | Add required module | bitshares/proposal.py | bitshares/proposal.py | from .instance import BlockchainInstance
from .account import Account
from .exceptions import ProposalDoesNotExistException
from .blockchainobject import BlockchainObject
from .utils import parse_time
import logging
log = logging.getLogger(__name__)
class Proposal(BlockchainObject):
""" Read data about a Proposal... | Python | 0.000002 | @@ -163,16 +163,29 @@
inObject
+, ObjectCache
%0Afrom .u
|
80a72771b037bbe8a6fbae7f61441d0cadadb932 | Change some lists to generators. | lib/event.py | lib/event.py | """
An Event is a collection of Particles.
"""
import itertools
import math
import numpy as np
from .particle import Particle
def frominput(iterable):
"""
Generate Events from standard particle info.
Arguments
---------
iterable -- containing standard particle lines [bytes or strings]
Yi... | Python | 0 | @@ -3150,17 +3150,16 @@
-%5B
v_min, .
@@ -3163,25 +3163,24 @@
, ..., v_max
-%5D
%0A%0A %22%22
@@ -3263,17 +3263,17 @@
return
-%5B
+(
sqrt(v%5B0
@@ -3315,17 +3315,17 @@
ectors()
-%5D
+)
%0A%0A%0A d
@@ -3417,17 +3417,16 @@
-%5B
Psi_min,
@@ -3438,17 +3438,16 @@
Psi_max
-%5D
%0A%0... |
26b2eb5efd7d1be8c19cb7395cae7d5b2ac9f3df | Fix url prefix. | dev/docs/build_api_docs.py | dev/docs/build_api_docs.py | # Copyright 2021 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | Python | 0.000879 | @@ -1123,16 +1123,17 @@
ster/src
+/
%22%0A
|
917a38845f3fd03805b99c3a8df6f09b047ed0e0 | Fix tvseries preprocess script to accomodate literal NER refactor. | examples/tvseries/scripts/preprocess.py | examples/tvseries/scripts/preprocess.py | """
Wikia Series Pre Processing
Usage:
preprocess.py <dbname>
"""
import re
from docopt import docopt
from mwtextextractor import get_body_text
from iepy.db import connect, DocumentManager
from iepy.models import set_custom_entity_kinds
from iepy.preprocess import PreProcessPipeline
from iepy.tokenizer import T... | Python | 0 | @@ -367,22 +367,23 @@
port Lit
-Tagger
+eralNER
Runner%0Af
@@ -953,21 +953,24 @@
ave()%0A%0A%0A
-MEDIC
+FREEBASE
_ENTITIE
@@ -1016,152 +1016,88 @@
T'%5D%0A
-%0A%0Aclass MedicNERRunner(LitTaggerRunner):%0A%0A def __init__(self):%0A labels = MEDIC_ENTITIES%0A filenames = %5B'tvseries/disease.txt', '... |
621d7e2d9dd4c1735ceb98b6d019b7691a0be5a5 | make replay_file guess file topic name | modules/tools/replay/replay_file.py | modules/tools/replay/replay_file.py | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 ... | Python | 0.000001 | @@ -1996,118 +1996,744 @@
def
-topic_publisher(topic, filename, period):%0A %22%22%22publisher%22%22%22%0A rospy.init_node('replay_node', anonymous=Tru
+identify_topic(filename):%0A f_handle = file(filename, 'r')%0A file_content = f_handle.read()%0A for topic, msg_type in topic_msg_dict.items():%0A ... |
379ca60d8b79a8b6ce5ae7256ccae8a90bb83be8 | Remove experimental. | Lib/glyphNameFormatter/rangeProcessors/mathematical_alphanumeric_symbols.py | Lib/glyphNameFormatter/rangeProcessors/mathematical_alphanumeric_symbols.py |
def process(self):
self.setExperimental()
self.edit("MATHEMATICAL")
self.edit("EPSILON SYMBOL", "epsilonsymbol")
self.edit("CAPITAL THETA SYMBOL", "Thetasymbol")
self.edit("THETA SYMBOL", "thetasymbol")
self.edit("KAPPA SYMBOL", "kappasymbol")
self.edit("PHI SYMBOL", "phisymbol")
self.... | Python | 0 | @@ -17,35 +17,8 @@
f):%0A
- self.setExperimental()%0A
|
c137ab86377db9d74f9deb523460eaa8ffd2dac8 | Resolve unittests failures by provided a default value for tags | lib/tower_cli/resources/job.py | lib/tower_cli/resources/job.py | # Copyright 2014, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.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 requi... | Python | 0 | @@ -2122,16 +2122,21 @@
te, tags
+=None
, monito
|
8bdea3b82660301466740b4aa653b595af1c9c46 | fix api dashboard | dashboards/views.py | dashboards/views.py | from collections import defaultdict, Counter
from django.contrib.auth.decorators import user_passes_test
from django.db.models import Count, F
from django.contrib.auth.models import User
from django.shortcuts import render
from allauth.socialaccount.models import SocialAccount
from profiles.models import Subscription, ... | Python | 0.000002 | @@ -3187,16 +3187,48 @@
ts.all()
+.select_related(%22profile__user%22)
)%0A fo
@@ -3280,16 +3280,88 @@
t.date)%0A
+ key = f%22%7Breport.profile.api_key%7D - %7Breport.profile.user.email%7D%22%0A
@@ -3438,31 +3438,19 @@
e%5Bdate%5D%5B
-str(report.
key
-)
%5D += rep
@@ -3482,23 +3482,11 @@
als%... |
534cd21cc4421ec2d6ac653058b9934c7003c212 | rename local var | pentai/db/zodb_dict.py | pentai/db/zodb_dict.py | #/usr/bin/python
from ZODB import FileStorage, DB
from BTrees import OOBTree
from persistent import Persistent
from persistent.mapping import PersistentMapping as ZM
from persistent.list import PersistentList as ZL
import transaction
import zc.zlibstorage
import os
class DBConn(object):
def __init__(self, db_name... | Python | 0.000193 | @@ -645,17 +645,17 @@
k file i
-t
+s
a pain
@@ -680,20 +680,21 @@
-lock
+whole
_file_pa
@@ -750,20 +750,21 @@
.unlink(
-lock
+whole
_file_pa
|
45663d2eb5ad1309f309978aecce25dc74994d17 | fix packagist | vedro/hooks/packagist/packagist.py | vedro/hooks/packagist/packagist.py | import os
from ..hook import Hook
class Packagist(Hook):
def __get_files(self, path):
files = []
for filename in os.listdir(path):
if not filename.startswith('_'):
files += [filename[:-3] if filename.endswith('.py') else filename]
return files
def __get_directories(self, path):
dir... | Python | 0.000001 | @@ -138,32 +138,33 @@
path):%0A if
+(
not filename.sta
@@ -175,16 +175,52 @@
ith('_')
+) and (not filename.startswith('.'))
:%0A
|
0ac3d7cf48bbeda33e319e149b1a2d36b04fbf94 | Add base pipeline data source class | collection_pipelines/core.py | collection_pipelines/core.py | import functools
def coroutine(fn):
def wrapper(*args, **kwargs):
generator = fn(*args, **kwargs)
next(generator)
return generator
return wrapper
class CollectionPipelineProcessor:
sink = None
start_source = None
receiver = None
def process(self, item):
rais... | Python | 0 | @@ -1959,12 +1959,293 @@
return None%0A
+%0A%0Aclass CollectionPipelineSource(CollectionPipelineProcessor):%0A %22%22%22Pipeline data source processor.%22%22%22%0A def __init__(self):%0A self.source(self.make_generator)%0A%0A def make_generator(self):%0A %22%22%22Constructs the items generator.%... |
550fd42b1e66436cdc814fa77d39b9ba414beb87 | Refactor with lambda | src/Testing/Python/Unit/add_module.py | src/Testing/Python/Unit/add_module.py | import sys
m1 = scirun_add_module("ReadMatrix")
m2 = scirun_add_module("ReportMatrixInfo")
if len(scirun_module_ids()) != 2:
scirun_quit_after_execute()
scirun_execute_all()
else:
scirun_force_quit()
| Python | 0.00001 | @@ -1,131 +1,112 @@
-import sys%0A%0Am1 = scirun_add_module(%22ReadMatrix%22)%0Am2 = scirun_add_module(%22ReportMatrixInfo%22)%0A%0Aif len(scirun_module_ids()) != 2:%0A
+def scirun_assert(func):%0A if not func():%0A scirun_add_module(%22ReadMatrix%22) # guarantee errored network%0A
sc
@@ -131,16 +131,18 @@
ec... |
b5936f07c88ae260babb1850949b26dc6a06ab65 | fix counter today | diaphragm/counter/views.py | diaphragm/counter/views.py | from datetime import datetime
from flask import Blueprint, request, abort
from diaphragm.counter.models import Visitor
from diaphragm.database import db
from diaphragm.utils import render_ajax, json_dict
counter = Blueprint('counter', __name__,
template_folder="templates")
@counter.route('/api/... | Python | 0 | @@ -1068,17 +1068,17 @@
.date()
-%3E
+%3C
datetim
@@ -1118,33 +1118,33 @@
.visits_today =
-0
+1
%0A visitor
@@ -1158,17 +1158,17 @@
today =
-0
+1
%0A
@@ -1835,17 +1835,16 @@
%0A if
-(
visitor.
@@ -1868,17 +1868,16 @@
est.path
-)
:%0A
|
96f4f81532fdf851292594c560d17d87ef4e4ea4 | Fix issue where incorrect shell could be detected when psutil installed. | cpenv/shell.py | cpenv/shell.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
# Standard library imports
import fnmatch
import os
import subprocess
# Local imports
from . import compat
def binpath(*paths):
'''Like os.path.join but acts relative to this packages bin path.'''
package_root = os.path.dirname(... | Python | 0 | @@ -1562,354 +1562,169 @@
-if compat.platform == 'win':%0A py_proc = 'py*.exe'%0A else:%0A py_proc = 'python*'%0A%0A proc = psutil.Process()%0A while True:%0A exe = proc.exe()%0A exe_name = os.path.basename(exe)%0A if fnmatch.fnmatch(exe_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.