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 |
|---|---|---|---|---|---|---|---|
1df18d3c1753aadd1342f870905e60953b4aeba9 | Remove overwritten DEBUG mapping | cea/interfaces/dashboard/dashboard.py | cea/interfaces/dashboard/dashboard.py | from flask import Flask
import cea.config
import cea.plots
import cea.plots.cache
import webbrowser
import threading
import os
import sys
def list_tools():
"""List the tools known to the CEA. The result is grouped by category.
"""
import cea.scripts
from itertools import groupby
tools = sorted(... | Python | 0.000001 | @@ -1383,52 +1383,8 @@
ng(%7B
-'DEBUG': True,%0A
'SEC
|
4aa8f6ad999f87151f16681c2b968b680bb7eb66 | autoflush (#9385) | src/transformers/utils/logging.py | src/transformers/utils/logging.py | # coding=utf-8
# Copyright 2020 Optuna, Hugging Face
#
# 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 o... | Python | 0.999826 | @@ -645,16 +645,27 @@
port os%0A
+import sys%0A
import t
@@ -2358,16 +2358,66 @@
stream.
+%0A _default_handler.flush = sys.stderr.flush
%0A%0A
|
bd3a075dd5c08546883b55b868f4e90f4e2e25fa | Fixing typo in target name. | src/untrusted/pthread/pthread.gyp | src/untrusted/pthread/pthread.gyp | # 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.
{
'includes': [
'../../../build/common.gypi',
],
'variables': {
'common_sources': [
'nc_thread.c',
'nc_mutex.c',
'nc_cond... | Python | 0.999999 | @@ -820,17 +820,16 @@
'pthread
-b
_private
|
1ba20c9822887a6cd830af25fae76f11409f98a5 | Update validation.py | cea/optimization/master/validation.py | cea/optimization/master/validation.py | """
Validation
"""
from __future__ import division
import random
from cea.optimization.constants import DH_CONVERSION_TECHNOLOGIES_WITH_SPACE_RESTRICTIONS, \
DH_CONVERSION_TECHNOLOGIES_SHARE, DC_CONVERSION_TECHNOLOGIES_SHARE, DC_CONVERSION_TECHNOLOGIES_WITH_SPACE_RESTRICTIONS
def validation_main(individual_wit... | Python | 0.000001 | @@ -1093,75 +1093,8 @@
te =
- ''%0A while candidate.count('1') %3C 2:%0A candidate =
''.
@@ -1156,32 +1156,60 @@
building_name in
+%0A
column_names_bu
@@ -1225,38 +1225,37 @@
eating)%0A
- if
+while
candidate.count
@@ -1268,58 +1268,9 @@
%3C 2:
- #there ... |
de5b159360686839cffe82347d0db90301843e22 | Update NASM.py | executors/NASM.py | executors/NASM.py | import os
import subprocess
from cptbox import CHROOTSecurity, SecurePopen
from error import CompileError
from .utils import test_executor
from .resource_proxy import ResourceProxy
from judgeenv import env
ASM_FS = ['.*\.so']
class Executor(ResourceProxy):
def __init__(self, problem_id, source_code):
su... | Python | 0 | @@ -2034,16 +2034,28 @@
tialize(
+sandbox=True
):%0A i
@@ -2639,8 +2639,9 @@
msg%0A''')
+%0A
|
3192634b5468c3aff64367366f7419ad0aabf49b | Fix Objective-C executor | executors/OBJC.py | executors/OBJC.py | from subprocess import check_output, CalledProcessError
from GCCExecutor import GCCExecutor
from judgeenv import env
class Executor(GCCExecutor):
ext = '.m'
objc_flags = []
objc_ldflags = []
command = env['runtime'].get('gobjc')
name = 'OBJC'
address_grace = 131072
test_program = r'''
#i... | Python | 0.998125 | @@ -914,16 +914,30 @@
lize(cls
+, sandbox=True
):%0A
@@ -1337,16 +1337,31 @@
tialize(
+sandbox=sandbox
)%0A%0Ainiti
|
47a7321682f3f47c638c133ccbcb3f9daea32e77 | add help text for language | molo/core/models.py | molo/core/models.py | from django.db import models
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch import index
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
class HomePage(Page):
pass
class Main(Page):
parent_page_types = []
... | Python | 0.00002 | @@ -21,16 +21,72 @@
t models
+%0Afrom django.utils.translation import ugettext_lazy as _
%0A%0Afrom w
@@ -465,16 +465,25 @@
arField(
+%0A
max_leng
@@ -488,16 +488,83 @@
ngth=255
+,%0A help_text=_('The language code as specified in iso639-2')
)%0A%0A p
@@ -694,16 +694,18 @@
_name =
+_(
'Langua... |
9ffcb95f0475c9d3a090b8de62073049f999fcf0 | update version | mongoctl/version.py | mongoctl/version.py | __author__ = 'abdul'
MONGOCTL_VERSION = '0.9.0'
| Python | 0 | @@ -39,11 +39,11 @@
= '0.9.
-0
+1
'%0A
|
4084e79d56e93b70d986dbaccbd1510c9fecd1d4 | Split tests. | chaco/tests/linearmapper_test_case.py | chaco/tests/linearmapper_test_case.py |
import unittest
from numpy import array
from numpy.testing import assert_array_almost_equal, assert_equal
from chaco.api import ArrayDataSource, DataRange1D, LinearMapper
class LinearMapperTestCase(unittest.TestCase):
def test_basic(self):
ary = array([5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
ds = Array... | Python | 0 | @@ -898,32 +898,45 @@
creen_bounds
+_stretch_data
(self):%0A
ary
@@ -915,32 +915,32 @@
tch_data(self):%0A
-
ary = ar
@@ -1372,32 +1372,206 @@
04.0, 120.0%5D))%0A%0A
+ def test_update_screen_bounds_dont_stretch_data(self):%0A ary = array(%5B5.0, 6.0, 7.0, 8.0, 9.0, 10.0%5D)%0A ds ... |
b6b8ae74eabd69defcbf46a2e0bd46512872bd40 | Add tools to write bidsignore and dataset_description.json | mriqc/utils/bids.py | mriqc/utils/bids.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""PyBIDS tooling"""
from collections import defaultdict
DEFAULT_TYPES = ["bold", "T1w", "T2w"]
def collect_bids_data(
layout, participant_label=None, session=None, run=None, task=None, bids_type=Non... | Python | 0 | @@ -128,16 +128,63 @@
ling%22%22%22%0A
+import os%0Aimport json%0Afrom pathlib import Path%0A
from col
@@ -1023,8 +1023,1968 @@
ng_data%0A
+%0A%0Adef write_bidsignore(deriv_dir):%0A bids_ignore = (%0A %22*.html%22, %22logs/%22, # Reports%0A %22*_T1w.json%22, %22*_T2w.json%22, %22*_bold.json%22, # ... |
18644a1fde3d20600692cfa156d2a1b6be059ebf | Change build type to RelWithDebInfo | ci_scripts/test_linux-daemon-cmake.py | ci_scripts/test_linux-daemon-cmake.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import multiprocessing as mp
import neblio_ci_libs as nci
nci.setup_travis_or_gh_actions_env_vars()
working_dir = os.getcwd()
build_dir = "wallet"
deploy_dir = os.path.join(os.environ['BUILD_DIR'],'deploy', '')
packages_to_install = \
[
"ccache",
"qt5-default"... | Python | 0 | @@ -1067,13 +1067,22 @@
YPE=
-Debug
+RelWithDebInfo
-DN
|
363bb6f409b4c3184a5b9e72c095b6aca207a11f | Cut 0.9.1 final | fabric/version.py | fabric/version.py | """
Current Fabric version constant plus version pretty-print method.
This functionality is contained in its own module to prevent circular import
problems with ``__init__.py`` (which is loaded by setup.py during installation,
which in turn needs access to this version information.)
"""
VERSION = (0, 9, 0, "final", 0... | Python | 0 | @@ -300,17 +300,17 @@
(0, 9,
-0
+1
, %22final
|
9a3cade010fac5831db3aac2b6af020c3f816b73 | Make use of CMS content in image group test helper | src/zeit/content/image/testing.py | src/zeit/content/image/testing.py | from __future__ import with_statement
import gocept.httpserverlayer.wsgi
import gocept.selenium
import mimetypes
import os.path
import pkg_resources
import zeit.cms.repository.interfaces
import zeit.cms.testing
import zeit.content.image.image
import zeit.content.image.imagegroup
import zeit.workflow.testing
import zope... | Python | 0 | @@ -2210,16 +2210,126 @@
else:%0A
+ try:%0A fh = zeit.cms.interfaces.ICMSContent(file_name).open()%0A except TypeError:%0A
|
5dcff1c4b43465c39963d8f16302d8a66fda96ff | refactor sla methods | cla_backend/apps/complaints/models.py | cla_backend/apps/complaints/models.py | # -*- coding: utf-8 -*-
import datetime
from django.conf import settings
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.utils import timezone
from model_utils.models import TimeStampedModel
from cla_eventlog.constants import LOG_LEVELS
from complaints.constants... | Python | 0.000282 | @@ -4567,24 +4567,25 @@
return
+(
self.closed
@@ -4584,27 +4584,18 @@
.closed
-is None and
+or
timezon
@@ -4601,16 +4601,17 @@
ne.now()
+)
%3E sla%0A%0A
@@ -4843,24 +4843,25 @@
return
+(
self.holding
@@ -4872,19 +4872,10 @@
ter
-is None and
+or
tim
@@ -4885,16 +4885,17 @@
ne.now()
+)
%3E ... |
634ece667007468a6555e6ce0f496151c0cbf15b | Use a value with more entry so it's less likely it occurs in real world string payload. | st2common/st2common/util/jinja.py | st2common/st2common/util/jinja.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Python | 0 | @@ -996,16 +996,21 @@
LUE = '%25
+*****
__%25NONE%25
@@ -1011,16 +1011,21 @@
%25NONE%25__
+*****
%25'%0A%0A%0Acla
|
cbf5f26d4a1860082d9e29524146298ad0b4e0db | Support for pkgdb teams. | fedmsg_genacls.py | fedmsg_genacls.py | # -*- coding: utf-8 -*-
""" A fedmsg consumer that listens to pkgdb messages to update gitosis acls
Authors: Janez Nemanič <janez.nemanic@gmail.com>
Ralph Bean <rbean@redhat.com>
"""
import pprint
import subprocess
import os
import fedmsg.consumers
import moksha.hub.reactor
class GenACLsConsumer(fed... | Python | 0 | @@ -355,76 +355,280 @@
#
-Really, we want to use this specific topic to listen to.%0A topic =
+Because we are interested in a variety of topics, we tell moksha that%0A # we're interested in all of them (it doesn't know how to do complicated%0A # distinctions). But then we'll filter later in our consume() ... |
5022dada0153bca2c99f2faf302827307078e91a | Remove timestamp from forms | fellowms/forms.py | fellowms/forms.py | from django.forms import ModelForm, widgets
from .models import Fellow, Event, Expense, Blog
class FellowForm(ModelForm):
class Meta:
model = Fellow
exclude = [
"user",
"home_lon",
"home_lat",
"funding_notes",
"inaugur... | Python | 0.000054 | @@ -384,24 +384,76 @@
%22mentor%22,%0A
+ %22added%22,%0A %22updated%22,%0A
@@ -450,32 +450,32 @@
%5D%0A
-
%0A%0Aclass EventFor
@@ -661,24 +661,76 @@
eport_url%22,%0A
+ %22added%22,%0A %22updated%22,%0A
@@ -1152,3... |
49dc6eec1a6d408723159dec85fb00770edb7fc5 | raise error if chunk out of range | lacli/source/chunked.py | lacli/source/chunked.py | from __future__ import division
import os
import math
from sys import maxint
from itertools import imap
from tempfile import mkstemp
from boto.utils import compute_md5
from filechunkio import FileChunkIO
class FileHash(object):
def __get__(self, instance, owner):
try:
return (instance.md5, i... | Python | 0.000002 | @@ -2198,32 +2198,121 @@
art(self, num):%0A
+ if num %3E= self.chunks:%0A raise ValueError(%22chunk number out of range%22)%0A
return s
@@ -2385,22 +2385,16 @@
start =
- num *
self.ch
@@ -2392,24 +2392,34 @@
= self.chunk
+start(num)
%0A if
|
d866424562c2e392d04d03cffa25667211e1d56b | cleaned up query | lagesonum/bottle_app.py | lagesonum/bottle_app.py | # coding: utf-8
# Der WSGI-Server auf PythonAnywhere verwendet diese Datei
import sqlite3
import os
import time
import bottle
from bottle import default_app, route, view
from bottle import request
from bottle_utils.i18n import I18NPlugin
from bottle_utils.i18n import lazy_gettext as _
import input_number as ip
from... | Python | 0.998419 | @@ -2633,16 +2633,79 @@
number')
+%0A timestamp_first = '-'%0A timestamp_last = '-'%0A n = '0'
%0A%0A if
@@ -3140,98 +3140,78 @@
- return %7B'result': number, 'timestamp_first': timestamp_first,%0A
+else:%0A timestamp_first = 'NOT FOUND'%0A else:%0A
't... |
7163894c9c93ff31757de22dab01d1a2f00c67bf | Remove deprecated contrib package access. | law/contrib/__init__.py | law/contrib/__init__.py | # coding: utf-8
__all__ = ["available_packages", "loaded_packages", "load", "load_all"]
import os
import logging
import types
import uuid
import glob
import law
from law.util import law_src_path, flatten
thisdir = os.path.dirname(os.path.abspath(__file__))
logger = logging.getLogger(__name__)
#: List of names o... | Python | 0 | @@ -113,33 +113,8 @@
ing%0A
-import types%0Aimport uuid%0A
impo
@@ -1611,1675 +1611,8 @@
))%0A%0A
- # the contrib mechanism used to add all members of the module to the main law namespace%0A # but given the growing number of contrib packages, the chance of collisions is not%0A # negligible any l... |
2a1a5b738bd59880ea223606a321584145d6ba2b | Add archlinux chromium location | leapcast/environment.py | leapcast/environment.py | from __future__ import unicode_literals
import argparse
import glob
import logging
import os
import sys
import uuid
logger = logging.getLogger('Environment')
def _get_chrome_path():
if sys.platform == 'win32':
# First path includes fallback for Windows XP, because it doesn't have
# LOCALAPPDATA v... | Python | 0.000001 | @@ -1133,16 +1133,54 @@
browser'
+,%0A '/usr/bin/chromium'
%5D%0A fo
|
40da4a49ae389c8f3557d787197bbd44b5c8e53e | Put DateTimeShortcuts.js at the end and don't merge it | lfc/utils/initialize.py | lfc/utils/initialize.py | # portlets imports
from portlets.utils import register_portlet
# lfc imports
from lfc.utils.registration import register_template
from lfc.utils.registration import register_content_type
from lfc.models import NavigationPortlet
from lfc.models import Page
from lfc.models import PagesPortlet
from lfc.models import Rand... | Python | 0 | @@ -2986,100 +2986,8 @@
s%22)%0A
- register_resource(type=JS, group=%22manage%22, path=%22/admin/js/admin/DateTimeShortcuts.js%22)%0A
@@ -4550,24 +4550,125 @@
_manage.js%22)
+%0A register_resource(type=JS, group=%22manage%22, merge=0, path=%22/admin/js/admin/DateTimeShortcuts.js%22)
%0A%0A if cre
|
6917d2b7f868714f256266d3529edb5da1211311 | add ramen | ircbot/plugin/redditeu.py | ircbot/plugin/redditeu.py | import datetime
import random
import re
import socket
import urllib.error
import urllib.request
from ircbot import log
import ircbot.plugin
class YouPornComment():
_last_fetch = None
THROTTLE_SECS = 30
@classmethod
def get_random(cls, include_url=False):
now = datetime.datetime.now()
if cls._last_fetch is n... | Python | 0.998975 | @@ -2361,16 +2361,25 @@
'easiek'
+, 'ramen'
)%0A%0A%09@cla
|
b2d26411f80f2ccd685bbbe19af1eb6e9999c329 | rename method and add docstring. | ism_spectra/sfd_lookup.py | ism_spectra/sfd_lookup.py | import astropy.io.fits as fits
import numpy as np
x_offset = 0.5
y_offset = 0.5
class SFDLookUp(object):
"""
Get extinction values from the SFD maps[1].
[1]: https://arxiv.org/abs/astro-ph/9809230
"""
def __init__(self, ngp_filename, sgp_filename):
"""
:param ngp_filename: NGP fi... | Python | 0 | @@ -1846,16 +1846,24 @@
f lookup
+_nearest
(self, l
@@ -2338,32 +2338,374 @@
ar(self, l, b):%0A
+ %22%22%22%0A get extinction values in the specified galactic coordinates, using bilinear interpolation%0A :param l: l-parameter (1D array)%0A :type l: np.ndarray%0A :param b: b-paramet... |
e97a43f4558b19311eea9a5ef508502c7151256f | fix periodic task schedule_updates() | mygpo/data/tasks.py | mygpo/data/tasks.py | from operator import itemgetter
from datetime import datetime, timedelta
from celery.decorators import periodic_task
from mygpo.data.podcast import calc_similar_podcasts
from mygpo.celery import celery
from mygpo.podcasts.models import Podcast
@celery.task
def update_podcasts(podcast_urls):
""" Task to update a... | Python | 0.000001 | @@ -240,16 +240,97 @@
odcast%0A%0A
+from celery.utils.log import get_task_logger%0Alogger = get_task_logger(__name__)%0A%0A
%0A@celery
@@ -993,14 +993,8 @@
tes(
-self,
inte
@@ -1016,16 +1016,16 @@
ERVAL):%0A
+
%22%22%22
@@ -1215,16 +1215,54 @@
.objects
+.all()%5C%0A
.next_up
... |
6289cb892d0d9d683ba57e369941d48f1a982c4e | Add missing timeouts to client.py | netuitive/client.py | netuitive/client.py | import logging
import json
import time
from netuitive import __version__
try:
import urllib.request as urllib2
except ImportError: # pragma: no cover
import urllib2
try:
from urllib.parse import urlparse
except ImportError: # pragma: no cover
from urlparse import urlparse
class Client(object):
... | Python | 0.000002 | @@ -2405,32 +2405,65 @@
.urlopen(request
+, timeout=self.connection_timeout
)%0A lo
@@ -4276,16 +4276,49 @@
(request
+, timeout=self.connection_timeout
)%0A
@@ -6586,16 +6586,49 @@
open(req
+, timeout=self.connection_timeout
)%0A
|
140b8b829f566a75a09a1ff7bc2d7d4ba4ea5272 | fix version | newfies/__init__.py | newfies/__init__.py | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2012 Star2B... | Python | 0.000001 | @@ -538,17 +538,17 @@
(1, 2,
-2
+4
, %22%22)%0A__
|
df5bcec8f6d05a27ba6be3ea0af401ab6045d636 | Bump version to 0.5.2 | nio_cli/__init__.py | nio_cli/__init__.py | __version__ = '0.5.1'
| Python | 0.000001 | @@ -16,7 +16,7 @@
0.5.
-1
+2
'%0A
|
3e79c769e49f6677fe8922d37d6b63bcf71bbf7f | add autoreloading of SMS apps | lib/rapidsms/manager.py | lib/rapidsms/manager.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from config import Config
from router import Router
import os, sys, shutil
import i18n
# the Manager class is a bin for various RapidSMS specific management methods
class Manager (object):
def route (self, conf, *args):
router = Router()
router.se... | Python | 0 | @@ -235,16 +235,374 @@
bject):%0A
+%0A def testroute(self, conf, *args):%0A %22%22%22 Uses Django's autoreload functionality to automatically restart the %0A routing server when code is changed. %22%22%22%0A from django.utils import autoreload%0A%0A def run():%0A self.route(c... |
37f6e4f362586d6d966aad52b1df7d5e00baf148 | Update regsvr32.py | lib/stagers/regsvr32.py | lib/stagers/regsvr32.py | from lib.common import helpers
class Stager:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'regsvr32',
'Author': ['@subTee', '@enigma0x3'],
'Description': ('Generates an sct file (COM Scriptlet) Host this anywhere'),
'Comments': [
... | Python | 0 | @@ -345,21 +345,22 @@
nt simpl
-e
+y
lau
+n
ch regsv
|
a3ee5470379e58e67cf5a8884ad4790b7b5c6b03 | Remove redundant check message | libnamebench/base_ui.py | libnamebench/base_ui.py | # Copyright 2009 Google 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.000004 | @@ -3608,97 +3608,8 @@
))%0A%0A
- self.UpdateStatus('Checking nameserver health (%25s servers)' %25 len(self.nameservers))%0A
|
7addd05a33358c21e3d7979cb2a68fb3703c92fb | Version bump: 1.3-RC1 | libnamebench/version.py | libnamebench/version.py | VERSION = '1.3-BETA1'
| Python | 0 | @@ -12,12 +12,10 @@
1.3-
-BETA
+RC
1'%0A%0A
|
30b2247a9a7117a0662a111ae7161edc52634b17 | Make sure users without a first name aren't returned | lily/users/api/views.py | lily/users/api/views.py | import django_filters
from rest_framework import viewsets, mixins, status
from rest_framework.authtoken.models import Token
from rest_framework.decorators import list_route
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from .serializers import LilyGroupSerializer, ... | Python | 0 | @@ -1898,32 +1898,55 @@
.user.tenant_id)
+.exclude(first_name='')
%0A return
|
8c5de29849ca061ed528c93c36fb3479aef34e41 | Update ipc_lista1.15.py | lista1/ipc_lista1.15.py | lista1/ipc_lista1.15.py | #ipc_lista1.15
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#
qHora = input("Quanto você ganha por hora: ")
hT = input("Quantas horas você trabalhou: ")
SalBruto = qHora
ir = (11/100.0 * salBruto)
inss = (8/100.0m* SalBruto)
sindicato = (5/100.0 * SalBruto)
vT = ir + sindicato
SalLiq = SalBru... | Python | 0 | @@ -352,17 +352,16 @@
to e: %22,
-
SalBruto
|
6653e7d9289290b97f06e2b46314a12e194bfc6a | Update ipc_lista1.18.py | lista1/ipc_lista1.18.py | lista1/ipc_lista1.18.py | #ipc_lista1.18
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça o tamanho de um arquivo para download(em MB) e a velocidade de um link de internet (em Mbps), calcule e informe o tempo aproximado de downloado do arquivo usando este link (em minutos).
#
| Python | 0 | @@ -290,10 +290,81 @@
nutos).%0A
-#
+%0Aarquivo = input(%22Informe o tamanho do arquivo para download (em MB): %22)
%0A
|
6c4d6587939b6e186fdc7c76448803559a00d5ea | Update ipc_lista2.02.py | lista2/ipc_lista2.02.py | lista2/ipc_lista2.02.py | #ipc_lista2.02
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça um valor e mostre
| Python | 0 | @@ -121,9 +121,17 @@
e mostre
+ na tela
%0A
|
b029ecf823cb97c1d70a7599787bd798b9a95ac6 | Update ipc_lista2.06.py | lista2/ipc_lista2.06.py | lista2/ipc_lista2.06.py | #ipc_lista2.06
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que leia três números e mostre o maior deles.
| Python | 0 | @@ -141,8 +141,27 @@
deles.%0A
+%0Anumber1 =%0Anumber2%0A
|
2fbb692bc9937e72bc5840c867ec72041124d462 | Add swift support to toolchain.py | lit/helper/toolchain.py | lit/helper/toolchain.py | import os
import itertools
import platform
import subprocess
import sys
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import FindTool
from lit.llvm.subst import ToolSubst
def use_lldb_substitutions(config):
# Set up substitutions for primary tools. These tools must come from config.lldb_to... | Python | 0 | @@ -3829,16 +3829,408 @@
read'%5D%0A%0A
+ # Swift support%0A swift_sdk = %5B' -sdk ', sdk_path%5D if platform.system() in %5B'Darwin'%5D else %5B%5D%0A tools = %5B%0A ToolSubst(%0A '%25target-swiftc', command=config.swiftc, extra_args=swift_sdk),%0A ToolSubst(%0A '%25target... |
40bd026ec34c17bd9d512c25310efcdcbfc3425c | Version Bump | littlepython/version.py | littlepython/version.py | version = '0.4.7'
| Python | 0.000001 | @@ -12,7 +12,7 @@
0.4.
-7
+8
'%0A
|
37a55d4d0d4dd5827f1cd3e8cc62f3ac59f645fb | Remove old 'MIDDLEWARE_CLASSES'. | xadmin/plugins/language.py | xadmin/plugins/language.py |
from django.conf import settings
from django.template import loader
from django.views.i18n import set_language
from xadmin.plugins.utils import get_context_dict
from xadmin.sites import site
from xadmin.views import BaseAdminPlugin, CommAdminView, BaseAdminView
class SetLangNavPlugin(BaseAdminPlugin):
def block... | Python | 0.000042 | @@ -889,114 +889,8 @@
)%0A%0A%0A
-middleware = getattr(settings, %22MIDDLEWARE%22, None) or %5C%0A settings.MIDDLEWARE_CLASSES%0A%0A
if s
@@ -958,26 +958,35 @@
are' in
-middleware
+settings.MIDDLEWARE
:%0A si
|
5662921713bbd216d768cd563fb3764ea6b8fb59 | update studio_api | xarm/wrapper/studio_api.py | xarm/wrapper/studio_api.py | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
import json
import functools
from .xarm_api import XArmAPI
try:
from requests import Session
except:
import urllib.r... | Python | 0.000001 | @@ -1832,24 +1832,473 @@
ete_item')%0A%0A
+ def playback_trajectory(self, filename, times=1, double_speed=1):%0A return self.call_studio_api(None, 0, %7B%0A 'filename': filename,%0A 'times': times,%0A 'speed': double_speed,%0A 'wait': False,%0A %7D, api_name... |
03276ebebfd71e701583789888769df46f465c12 | fix dh bug | xos/services/vpn/models.py | xos/services/vpn/models.py | from core.models import Service, TenantWithContainer
from django.db import transaction
VPN_KIND = "vpn"
class VPNService(Service):
"""Defines the Service for creating VPN servers."""
KIND = VPN_KIND
class Meta:
proxy = True
# The name used to find this service, all directories are named ... | Python | 0.000001 | @@ -5805,34 +5805,26 @@
ter%0A def
-server_key
+dh
(self, value
|
5b0386d0872d4106902655ada78389503c62a95a | Add some default feedback types for item requests | yunity/models/relations.py | yunity/models/relations.py | from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
... | Python | 0 | @@ -1157,24 +1157,147 @@
BaseModel):%0A
+ @classproperty%0A def FEEDBACK(cls):%0A return cls.create_constants('feedback', 'OK', 'NO_SHOW', 'NOT_GRANTED')%0A%0A
requeste
|
f97ff7b1775fbe37fb081c514fa068ee44e1379f | Update remove-imageless-roms.py | remove-imageless-roms.py | remove-imageless-roms.py | import os
import os.path
import sys
import string
# config vars, if you are using non-standard stuff change these
rom_dir = '/home/pi/RetroPie/roms'
bak_dir = '/home/pi/RetroPie/cleaned_up'
img_dir = '/opt/retropie/configs/all/emulationstation/downloaded_images'
allowed_systems = [
... | Python | 0.000012 | @@ -3309,16 +3309,17 @@
'CLEAN'
+:
%0A%0A
|
eea375060727111a3590fad694f8a40823a33f43 | Add default sort to groups | representatives/views.py | representatives/views.py | import datetime
from django.db import models
from django.views import generic
from django.utils.text import slugify
from .models import Mandate, Group
class RepresentativeViewMixin(object):
"""
A view mixin to add pre-fetched main_mandate and country to Representative
If a Representative was fetched fr... | Python | 0.000001 | @@ -4618,9 +4618,43 @@
hamber')
+.order_by('chamber__name', 'name')
%0A
|
16d84c04b4f8d7861a9c75d2966eca8675d5cf58 | fix line break problem | stacktester/tests/test_servers.py | stacktester/tests/test_servers.py | # Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | Python | 0.000005 | @@ -1518,16 +1518,24 @@
.status)
+%0A
self.os
|
7eef48e81bd36f95550399f052cae37e83657288 | fix ids | databroker/tests/test_humantime_munging.py | databroker/tests/test_humantime_munging.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import time as ttime
import datetime
import pytz
import pytest
from databroker.core import _normalize_human_friendly_time
# ### Test metadatastore time formatting ######################################
def ... | Python | 0.000033 | @@ -2424,32 +2424,73 @@
stentTimeError%5D)
+%0A ids += %5BNone%5D * len(bad_test_values)
%0A%0A bad_test_v
@@ -2653,24 +2653,65 @@
sTimeError%5D)
+%0A ids += %5BNone%5D * len(bad_test_values)
%0A%0A bad_te
@@ -2867,32 +2867,32 @@
ad_test_values:%0A
-
rets.app
@@ -2920,16 +2920,51 @@
eError%5D... |
38b93a1c71aae112ec5a18234b1814b49d41066c | Add a test for operator / with an integer. | jpmesh/test/test_angle.py | jpmesh/test/test_angle.py | """
Tests for jpmesh.angle.
"""
import unittest
from jpmesh.angle import Angle
class TestAngle(unittest.TestCase):
"""
Tests for jpmesh.angle.Angle.
"""
def test_properties(self):
"""
Test for properties.
"""
millisecond = 3600000
angle = Angle.from_milliseco... | Python | 0.000002 | @@ -1020,24 +1020,89 @@
degree * 2)%0A
+ self.assertEqual((angle1 / 2).degree, angle1.degree / 2)%0A
self
|
150a8a66211d9f914216cf5a69908a4090d92cfb | Argument should be str | lrrbot/commands/live.py | lrrbot/commands/live.py | import common.http
import lrrbot.decorators
from lrrbot.main import bot
from lrrbot import googlecalendar
from common import space
from common import twitch
from common import utils
from common.config import config
import asyncio
import json
import urllib.parse
import urllib.error
import irc.client
import sqlalchemy
@... | Python | 0.999984 | @@ -571,13 +571,15 @@
s%22:
+%22
25000
+%22
,%0A%09%7D
|
af4c5a72afb80ff59662cc6992ce3084fed75dfe | Fix dedupe not preserving order | node/deduplicate.py | node/deduplicate.py | #!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq... | Python | 0.000144 | @@ -107,17 +107,17 @@
sults =
-2
+1
%0A %0A
@@ -240,33 +240,8 @@
%22%22%22%0A
- self.results = 1%0A
@@ -262,24 +262,110 @@
*2%0A %0A
+ @Node.test_func(%5B%5B1,2,3,1,1%5D%5D, %5B%5B1,2,3%5D%5D)%0A @Node.test_func(%5B%22hi!!!%22%5D, %5B%22hi!%22%5D)%0A
def func
@@ -429,24 +429,73 ... |
2c41bcc21f01be159be384fe5fa30c824dfb345c | Bump version to 14.0.0a7 | resolwe_bio/__about__.py | resolwe_bio/__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-bio'
__summary__ = 'Bioinformatics pipelines for the Resolwe platform'
__url__ = 'https://github.com/genial... | Python | 0 | @@ -498,9 +498,9 @@
0.0a
-6
+7
'%0A%0A_
|
4d2b384b7f91fac3b9a6aea7a5ef00de517314f9 | Support for external test id (key = 'id') | nose_json/plugin.py | nose_json/plugin.py | """
nose_json.plugin
~~~~~~~~~~~~~~~~
:copyright: 2012 DISQUS.
:license: BSD
"""
import codecs
import os
import simplejson
import traceback
from time import time
from nose.exc import SkipTest
from nose.plugins import Plugin
from nose.plugins.xunit import id_split, nice_classname, exc_message
class JsonReportPlugin(P... | Python | 0.000002 | @@ -2244,24 +2244,114 @@
r = time()%0A%0A
+ def external_id(self, test):%0A return getattr(test.test.test, 'test_id', None)%0A%0A
def addE
@@ -2376,32 +2376,32 @@
rr, capt=None):%0A
-
taken =
@@ -2817,32 +2817,74 @@
_split(id)%5B-1%5D,%0A
+ 'id': self.external_id(test),%0A
... |
5b7f080c1e7616c7f9e63b285147aa9b58ee0bc7 | Add arguments to __init__ - super to work on Python 2.7.X (#1796) | src/streamlink/plugins/btsports.py | src/streamlink/plugins/btsports.py | import re
import time
from uuid import uuid4
from streamlink.compat import quote
from streamlink.plugin import Plugin, PluginArguments, PluginArgument
from streamlink.plugin.api import http, useragents
from streamlink.stream import HLSStream
from streamlink.utils import url_equal
class BTSports(Plugin):
url_re =... | Python | 0 | @@ -1183,16 +1183,30 @@
super(
+BTSports, self
).__init
|
4bd52a868deecc9d4a65066d8879a3a0b89a5a4d | query quant_estagio utilizando sql_where | src/lotes/queries/analise/quant_estagio.py | src/lotes/queries/analise/quant_estagio.py | from pprint import pprint
from utils.functions.models import rows_to_dict_list
def quant_estagio(
cursor, estagio=None, ref=None, tipo=None, cor=None, tam=None,
only=None, less=None, group=None, deposito=None):
def monta_filtro(in_, estagios):
filtro = ''
if estagios is not None:... | Python | 0.999053 | @@ -73,16 +73,91 @@
ct_list%0A
+from utils.functions.queries import coalesce, sql_where, sql_where_none_if%0A
%0A%0Adef qu
@@ -821,770 +821,373 @@
o =
-''%0A if estagio is not None and estagio != '':%0A filtra_estagio = %22%22%22--%0A AND l.CODIGO_ESTAGIO = %7B%7D %22%22%22.format(
+sql_where_n... |
05c319f868215f832e97577f5e158edf82fab074 | Change version for next release | markdown/__version__.py | markdown/__version__.py | #
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 7)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
... | Python | 0 | @@ -221,9 +221,9 @@
s',
-7
+8
)%0A%0A%0A
|
2905d3ede8a34db95fc6a9321d77f60c59f90cc1 | Suppress multiple long reports | stores/weathprov/providerutils.py | stores/weathprov/providerutils.py | import json
import config
import logsupport
from logsupport import ConsoleWarning, ConsoleDetail
WeathProvs = {}
TermShortener = {}
StillLong = {}
GenericShortener = {
'moderate': 'mdrt',
'thunder': 'thndr',
'patchy': 'pchy',
'chance': 'chc',
'freezing': 'frzing',
'light': 'lt',
'heavy': 'hvy',
'shower': '... | Python | 0.999489 | @@ -1229,16 +1229,42 @@
axlength
+ and term not in StillLong
:%0A%09%09%09%09lo
|
e333ac12bed75a1ee8c974107aa3ec8f2453c27d | Version bump to v0.5.0 | kafka_influxdb/version.py | kafka_influxdb/version.py | __version__ = '0.4.1'
| Python | 0 | @@ -14,9 +14,9 @@
'0.
-4.1
+5.0
'%0A
|
ab10f3d134065047a7260662d3c39295904795b8 | Add fkey constraints at the same time | migration/versions/001_initial_migration.py | migration/versions/001_initial_migration.py | from __future__ import print_function
from getpass import getpass
import readline
import sys
from sqlalchemy import *
from migrate import *
from migrate.changeset.constraint import ForeignKeyConstraint
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer... | Python | 0.000001 | @@ -2,205 +2,49 @@
rom
-__future__ import print_function%0Afrom getpass import getpass%0Aimport readline%0Aimport sys%0A%0Afrom sqlalchemy import *%0Afrom migrate import *%0Afrom migrate.changeset.constraint import ForeignKeyConstraint
+sqlalchemy import *%0Afrom migrate import *
%0A%0Aim
@@ -431,16 +431,39 @@
Int... |
6ea40899c81a563f4e9a51b8c087f11f8557374b | Add continuous matching toggle check box | microphone_match_gui.py | microphone_match_gui.py | #!/usr/bin/python2
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
import sys
import os
from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QProgressBar)
from PyQt5.QtCore import (QCoreApplication, QThread, QBasicTimer)
import microphone_match
def... | Python | 0 | @@ -135,16 +135,24 @@
ication,
+%0A
QWidget
@@ -152,16 +152,24 @@
QWidget,
+%0A
QPushBu
@@ -173,16 +173,24 @@
hButton,
+%0A
QVBoxLa
@@ -194,16 +194,24 @@
xLayout,
+%0A
QHBoxLa
@@ -219,29 +219,72 @@
out,
- QLabel, QSizePolicy,
+%0A QLabel,%0A QSizePolicy,%0A ... |
728c06e2a4df11b03c9cd5c132fee003e0b2895b | Disable emailing | 14B-088/HI/job_generator.py | 14B-088/HI/job_generator.py |
'''
Generate a pbs script for job submission, submit the job, be happy
'''
import glob
import os
import shutil
import time
def return_template(output_direc, ms_name, model_name, mask_name):
template = \
'''
#!/bin/bash
#PBS -S /bin/bash
#PBS -l pmem=2000m
#PBS -l feature=X5675
#PBS -l nodes=1:ppn=12
#... | Python | 0.000005 | @@ -188,16 +188,82 @@
name):%0A%0A
+ # Emailing%0A #PBS -m bea%0A #PBS -M koch.eric.w@gmail.com%0A%0A
temp
@@ -408,50 +408,8 @@
:00%0A
-#PBS -m bea%0A#PBS -M koch.eric.w@gmail.com%0A
#PBS
|
4d101f6c17cbf63a3229ff90eb92c1e6b8ad9dd1 | add missing versionadded | kivy/modules/touchring.py | kivy/modules/touchring.py | '''
Touchring
=========
Shows rings around every touch on the surface / screen. You can use this module
to check that you don't have any calibration issues with touches.
Configuration
-------------
:Parameters:
`image`: str, defaults to '<kivy>/data/images/ring.png'
Filename of the image to use.
`sca... | Python | 0.000003 | @@ -478,16 +478,48 @@
o False%0A
+ .. versionadded:: 1.8.0%0A
%60cur
|
7ae0ae587ff38d8168a6e18515265bcc7170192c | Fix typo | laniakea/core/userdata.py | laniakea/core/userdata.py | # coding: 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/.
"""Utility class for UserData scripts."""
import re
import os
import logging
from laniakea.core.common i... | Python | 0.999999 | @@ -2177,18 +2177,18 @@
:r
-r
t
+y
pe: str%0A
|
d8e7bc454a3dea91f48905d32adeb9b1e8f11c5e | Add check_download_path to configuration and changes the get method | migmig/configuration.py | migmig/configuration.py | # Configuration module
#
## tmp note: you should add logger module and modify this module
#
from ConfigParser import SafeConfigParser
import os
program_name = "migmig"
# config file short path (hard coded !)
cfg_short_path = "~/." + program_name + ".ini"
server_address = "localhost"
server_port = "50001"
class Co... | Python | 0 | @@ -734,16 +734,46 @@
_path)%0A%0A
+%09%09self.check_download_path()%0A%0A
%0A%09def in
@@ -910,32 +910,24 @@
%22Setting%22, %22
-default_
download_pat
@@ -1581,20 +1581,19 @@
t(self,
-valu
+nam
e):%0A%09%09''
@@ -1613,66 +1613,251 @@
hod
-only returns values from %22Client%22 section.%0A%09%09'''
+looks for g... |
3b8365f8716add070490e7aca46b728eb8cbc43b | Remove square braces from IPv6 addresses (#561) | telethon/extensions/tcp_client.py | telethon/extensions/tcp_client.py | """
This module holds a rough implementation of the C# TCP client.
"""
import errno
import socket
import time
from datetime import timedelta
from io import BytesIO, BufferedWriter
from threading import Lock
MAX_TIMEOUT = 15 # in seconds
CONN_RESET_ERRNOS = {
errno.EBADF, errno.ENOTSOCK, errno.ENETUNREACH,
err... | Python | 0.000001 | @@ -1791,210 +1791,49 @@
-# The address needs to be surrounded by %5B%5D as discussed on PR#425%0A if not ip.startswith('%5B'):%0A ip = '%5B' + ip%0A if not ip.endswith('%5D'):%0A ip = ip + '%5D'%0A
+ip = ip.replace('%5B', '').replace('%5D', '')
%0A
|
03aec1decc66fcb259edb8abac114a5fac17d7ab | Fix "NotFound" error in _clear_stacks() | tempest/api/orchestration/base.py | tempest/api/orchestration/base.py | # 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, software
# d... | Python | 0.000001 | @@ -3082,32 +3082,53 @@
in cls.stacks:%0A
+ try:%0A
cls.
@@ -3165,32 +3165,36 @@
+
+
stack_identifier
@@ -3213,16 +3213,77 @@
MPLETE')
+%0A except exceptions.NotFound:%0A pass
%0A%0A @c
|
a3eea95b2f7bbd870651657c1a8b41b19304f546 | version 4.0.10 | misura/canon/version.py | misura/canon/version.py | __version__ = '4.0.9'
| Python | 0.000001 | @@ -16,7 +16,8 @@
4.0.
-9
+10
'%0A
|
218e7f2686eea1b55a28d041fc4df0118c2ca911 | Update ping_extension.py | third-party-synthetic/active-gate-extensions/extension-third-party-ping/src/ping_extension.py | third-party-synthetic/active-gate-extensions/extension-third-party-ping/src/ping_extension.py | from datetime import datetime
import logging
from ruxit.api.base_plugin import RemoteBasePlugin
from dynatrace import Dynatrace
from dynatrace.synthetic_third_party import SYNTHETIC_EVENT_TYPE_OUTAGE
import pingparsing
log = logging.getLogger(__name__)
class PingExtension(RemoteBasePlugin):
def initialize(sel... | Python | 0 | @@ -546,16 +546,50 @@
ons = 0%0A
+ self.failureDetected = 0%0A%0A
%0A def
@@ -1306,24 +1306,76 @@
t_target%22)%0A%0A
+ failureCount = self.config%5B%22failureCount%22%5D%0A%0A
step
@@ -1984,16 +1984,355 @@
ate == 0
+%0A%0A if not success:%0A self.failureDetected +... |
1421866ac3c4e4f1f09d17019d058aa903597df5 | Add new feature: find out is current week menu created already | modules/menus_reader.py | modules/menus_reader.py | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif... | Python | 0.000001 | @@ -593,15 +593,8 @@
ex%0A%09
-pass%0A%09#
retu
@@ -614,8 +614,82 @@
)%5Bindex%5D
+%0A%0Adef is_week_menu_created(week):%0A%09return week in get_menus()%09# True/False
|
0aae53e23a1a0f63499b8ec8dde5c3a1ca93f187 | Stop continually warning about a missing API key. | modules/sfp_emailrep.py | modules/sfp_emailrep.py | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_emailrep
# Purpose: Searches EmailRep.io for email address reputation.
#
# Author: <bcoles[at]gmail[.]com>
#
# Created: 2019-08-07
# Copyright: (c) bcoles 2019
# Licence: GPL... | Python | 0 | @@ -1946,24 +1946,48 @@
tate = False
+%0A errorWarned = False
%0A%0A def se
@@ -4124,24 +4124,49 @@
_key'%5D == ''
+ and not self.errorWarned
:%0A
@@ -4272,16 +4272,52 @@
mited.%22)
+%0A self.errorWarned = True
%0A%0A
|
8fe2a8735b11a834895d8a71fffa11349f890847 | Fix broken test. | test/cypher/cypher_record_test.py | test/cypher/cypher_record_test.py | #/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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 ... | Python | 0.000007 | @@ -622,16 +622,28 @@
ense.%0A%0A%0A
+import sys%0A%0A
from py2
@@ -1407,16 +1407,57 @@
%5B0%5D._id%0A
+ if sys.version_info %3E= (3,):%0A
@@ -1556,16 +1556,20 @@
+
%22values=
@@ -1600,16 +1600,295 @@
ce%5C%22%7D),
+%22%0A %22'Alice', 33))%22 %... |
fe1d7b70302f56a43bef3c0d400db829510d93da | Replace the old tokenizer tests with the refactored attributes. | test/test_parser/test_tokenize.py | test/test_parser/test_tokenize.py | from io import StringIO
from token import NEWLINE, STRING
from jedi._compatibility import u
from jedi import parser
from ..helpers import unittest
class TokenTest(unittest.TestCase):
def test_end_pos_one_line(self):
parsed = parser.Parser(parser.load_grammar(), u('''
def testit():
a = "huhu"
'''))
... | Python | 0 | @@ -1119,37 +1119,22 @@
g_token.
-_
pre
-ceding_whitespace
+fix
, '')%0A
@@ -1161,38 +1161,37 @@
al(string_token.
-string
+value
, '%22%22%22simple one
@@ -1646,37 +1646,22 @@
g_token.
-_
pre
-ceding_whitespace
+fix
, ' ')%0A
@@ -1698,22 +1698,21 @@
g_token.
-string
+value
, '%22%22%22si
@@ -1869,37 +1869,... |
c4c2b7936a89ffbf97d63e4b5d33ea59201c94b0 | Add tests for mine.send | tests/integration/modules/mine.py | tests/integration/modules/mine.py | '''
Test the salt mine system
'''
import integration
class MineTest(integration.ModuleCase):
'''
Test the mine system
'''
def test_get(self):
'''
test mine.get
'''
self.assertTrue(self.run_function('mine.update'))
self.assertTrue(self.run_function('mine.get', ['m... | Python | 0 | @@ -185,16 +185,32 @@
mine.get
+ and mine.update
%0A
@@ -352,8 +352,322 @@
ing'%5D))%0A
+%0A def test_send(self):%0A '''%0A test mine.send%0A '''%0A self.assertFalse(self.run_function('mine.send', %5B'foo.__spam_and_cheese'%5D))%0A self.assertTrue(self.run_function('mine.... |
e7697caf374b60d69cdd0d089900ac7b300b02fa | boolean evals of expressions return strings | tests/python_tests/filter_test.py | tests/python_tests/filter_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from utilities import Todo
import mapnik2
if hasattr(mapnik2,'Expression'):
mapnik2.Filter = mapnik2.Expression
map_ = '''<Map>
<Style name="s">
<Rule>
<Filter><![CDATA[(([region]>=0) and ([region]<=50))]]></Filter>
... | Python | 0.999997 | @@ -2237,33 +2237,35 @@
xpr.evaluate(f),
-1
+'1'
) # 1 == True%0A%0Ad
@@ -2428,17 +2428,19 @@
uate(f),
-1
+'1'
) # 1 ==
|
08d1873e39531a8cb453fab91e0bb1c95a236cd2 | Update Copyright | tests/test_cli_write_hierarchy.py | tests/test_cli_write_hierarchy.py | #!/usr/bin/env python
"""Test that hierarchy below specified GO terms is printed."""
from __future__ import print_function
__copyright__ = "Copyright (c) 2017-2018, DV Klopfenstein. Haiboa Tang. All rights reserved."
from goatools.cli.wr_hierarchy import WrHierCli
# --o Output file in ASCII text form... | Python | 0 | @@ -149,33 +149,33 @@
ght (c) 2017-201
-8
+9
, DV Klopfenstei
@@ -1990,9 +1990,9 @@
-201
-8
+9
, DV
|
43392fd2dd7d8775ef65a0d0767d7e9a3e170f6d | Fix test in Python 2.6 | tests/transport/threaded/tests.py | tests/transport/threaded/tests.py | import mock
import os
import time
from tempfile import mkstemp
from raven.utils.testutils import TestCase
from raven.base import Client
from raven.transport.threaded import ThreadedHTTPTransport
from raven.utils.urlparse import urlparse
class DummyThreadedScheme(ThreadedHTTPTransport):
def __init__(self, *args,... | Python | 0.002774 | @@ -1069,11 +1069,13 @@
e(%22%7B
+0
%7D %7B
+1
%7D%5Cn%22
@@ -2590,17 +2590,18 @@
-_
+fd
, filena
@@ -2628,16 +2628,41 @@
try:%0A
+ os.close(fd)%0A
|
4d38d318f4d4fc909c3ca0ea33530cf3f1d66991 | Implement error handling test for listing upgrades | tests/unit/modules/zypper_test.py | tests/unit/modules/zypper_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <bo@suse.de>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
import os
from ... | Python | 0 | @@ -297,16 +297,67 @@
EASON%0A)%0A
+from salt.exceptions import CommandExecutionError%0A%0A
import o
@@ -833,16 +833,998 @@
'''%0A%0A
+ def test_list_upgrades_error_handling(self):%0A '''%0A Test error handling in the list package upgrades.%0A :return:%0A '''%0A # Test handle... |
de93238fb16173f9d5cca3ef67106758e8039a97 | Fix test | thinc/tests/backends/test_lstm.py | thinc/tests/backends/test_lstm.py | from thinc.backends.jax_ops import lstm_weights_forward, backprop_lstm_weights
from thinc.backends.jax_ops import lstm_gates_forward, backprop_lstm_gates
import numpy.testing
from hypothesis import given, settings
from ..strategies import ndarrays_of_shape
try:
import jax
except ImportError:
has_jax = False
... | Python | 0.000004 | @@ -167,16 +167,30 @@
.testing
+%0Aimport pytest
%0A%0Afrom h
@@ -286,16 +286,35 @@
ort jax%0A
+ has_jax = True%0A
except I
|
9d798167ca1a8909fd8fb0845a8f55e761e25a1e | Update server | Server.py | Server.py | import sublime_plugin, sublime, sys, os, json, socketserver, socket
from sublime import Region
from functools import partial
from threading import Thread
from GulpServer.Utils import ignore, parse_commands
from GulpServer.Settings import Settings
from GulpServer.Logging import Console
END_OF_MESSAGE = b'\n'[0]
... | Python | 0.000001 | @@ -2180,24 +2180,28 @@
f.recvall()%0A
+%09%09%09%09
%0A%09%09%09%09if not
@@ -3521,16 +3521,69 @@
ish()%0A%09%0A
+%09# Keep receiving until an END_OF_MESSAGE is hit. %0A%09%0A
%09def rec
@@ -3704,19 +3704,26 @@
%09return
-b''
+data_bytes
%0A%09%09%09%0A%09%09%09
|
b7eefbea83768bd006c677aa5d69cf2a24e6e909 | Fix shebang line. | aeneas.py | aeneas.py | #!/usr/bin/env python2
import argparse
from os import environ
def bool_from_str(s):
if isinstance(s, basestring):
s = s.lower()
if s in ['true', 't', '1', 'y']:
return True
if s in ['false', 'f', '0', 'n']:
return False
return bool(s)
AENEAS_DEBUG = bool_from_str(environ.get... | Python | 0.000003 | @@ -18,9 +18,8 @@
thon
-2
%0A%0Aim
|
b55a4d1711fd9993e22ba6c5e3fe57380857d160 | Include firstbyte and terminator in wire logging. | aredis.py | aredis.py | import asyncore
import logging
import optparse
import socket
import sys
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record): pass
log = logging.getLogger(__name__)
log.addHandler(NullHandler())
getLogger = logging.getLogger
name = l... | Python | 0 | @@ -787,24 +787,54 @@
ndler = None
+%0A self.firstbyte = None
%0A%0A def co
@@ -2497,16 +2497,21 @@
+self.
firstbyt
@@ -2600,16 +2600,21 @@
andlers%5B
+self.
firstbyt
@@ -2811,16 +2811,21 @@
e %25r%22 %25
+self.
firstbyt
@@ -3312,22 +3312,84 @@
ug(%22%25r%22,
- reply
+%0A %22... |
79b2ad46334a35a68f334e8df621b208f3c617e2 | Remove `build-setup-requires-pex` options scope. (#9732) | src/python/pants/python/setup_py_runner.py | src/python/pants/python/setup_py_runner.py | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from pathlib import Path
from typing import Callable, Iterable, List, Optional
from pex.interpreter import PythonInterpreter
from pex.pex import PEX
from pex.pex_info import Pex... | Python | 0 | @@ -935,135 +935,8 @@
ner%22
-%0A deprecated_options_scope = %22build-setup-requires-pex%22%0A deprecated_options_scope_removal_version = %221.28.0.dev2%22
%0A%0A
|
600b054b950b26db8609d71a75350aaa995bb26e | Add import export to Geography admin | scorecard/admin.py | scorecard/admin.py |
from django.contrib import admin
from django.conf import settings
from django_q.tasks import async_task
from constance import config
from .models import (
Geography,
MunicipalityProfilesCompilation,
)
@admin.register(Geography)
class GeographyAdmin(admin.ModelAdmin):
list_display = ("geo_code", "geo_lev... | Python | 0 | @@ -126,16 +126,107 @@
t config
+%0Afrom import_export import resources%0Afrom import_export.admin import ImportExportModelAdmin
%0A%0Afrom .
@@ -341,30 +341,36 @@
graphyAdmin(
-admin.
+ImportExport
ModelAdmin):
|
6fb4bf39fd460b5f2d69d665d9e4d09e4279d88b | Add maximum page constraint for Pagination results | common/utils.py | common/utils.py | # common/utils.py
from flask import url_for, current_app
class PaginateData():
""""Pagination class.
Paginate query results
"""
def __init__(self, request, query, resource_for_url, key_name, schema):
self.request = request
self.query = query
self.resource_for_url = resourc... | Python | 0 | @@ -509,16 +509,135 @@
imit'):%0A
+ if int(request.args.get('limit')) %3E 100:%0A self.results_per_page = 100%0A else:%0A
|
3df6175723f1c9f22fc98ae1cc750046f265398e | Access ruler through naali | bin/pymodules/core/componentpropertyadder.py | bin/pymodules/core/componentpropertyadder.py | import circuits
import naali
import rexviewer as r
#from PythonQt.QtCore import QVariant
import PythonQt
#the ones not listed here are added using the c++ name, e.g. ent.EC_NetworkPosition
compshorthand = {
'EC_OpenSimPrim': 'prim',
'EC_OgrePlaceable': 'placeable',
'EC_NetworkPosition': 'network',
'EC_... | Python | 0 | @@ -522,17 +522,17 @@
d',%0A
-%22
+'
EC_OpenS
@@ -541,17 +541,17 @@
Presence
-%22
+'
: 'opens
@@ -596,16 +596,41 @@
ndruler'
+,%0A 'EC_Ruler': 'ruler'
%0A %7D
|
21f1cd585830e9d1b85f4201fb3c4914a4c1bd21 | Update test_code_style.py | _unittests/ut_module/test_code_style.py | _unittests/ut_module/test_code_style.py | # pylint: disable=R1721
"""
@brief test log(time=0s)
"""
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import check_pep8
from pyquickhelper.pycode.utils_tests_helper import _extended_refactoring
class TestCodeStyle(unittest.TestCase):
def test_code_style_src(s... | Python | 0.000004 | @@ -1863,32 +1863,41 @@
'R1720', 'C0209'
+, 'R1721'
),%0A
|
9c38604fa8e85efeed723b47e3486f9d09ea9858 | Fix login cookie | adhocracy/lib/auth/instance_auth_tkt.py | adhocracy/lib/auth/instance_auth_tkt.py | import datetime
from repoze.who.plugins.auth_tkt import AuthTktCookiePlugin, _now
class InstanceAuthTktCookiePlugin(AuthTktCookiePlugin):
def _get_cookies(self, environ, value, max_age=None):
if max_age is not None:
later = _now() + datetime.timedelta(seconds=int(max_age))
# Wdy, ... | Python | 0.000017 | @@ -75,17 +75,85 @@
n, _now%0A
+from pylons import config%0Afrom paste.deploy.converters import asbool
%0A
-
%0Aclass I
@@ -697,106 +697,181 @@
-cur_domain = environ.get('adhocracy.domain').split(':')%5B0%5D%0A wild_domain = '.' + cur_domain%0A
+if asbool(config.get('adhocracy.relative_urls', 'false')):... |
b886a7db3c6669ccf1e69747cca2fdddc54c15ee | Set encoding when opening languages files, fix error on windows. | lektor/i18n.py | lektor/i18n.py | import os
import json
from lektor._compat import iteritems
from lektor.uilink import UI_LANG
translations_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'translations')
KNOWN_LANGUAGES = list(x[:-5] for x in os.listdir(translations_path)
if x.endswi... | Python | 0 | @@ -14,16 +14,36 @@
ort json
+%0Afrom io import open
%0A%0Afrom l
@@ -458,16 +458,47 @@
'.json')
+,%0A encoding=%22utf8%22
) as f:%0A
|
1d4c5a38c1690be94b02ad3f8b34e6b62ae8473f | remove pdb | script/managers.py | script/managers.py | # This Python file uses the following encoding: utf-8
import os, sys
import datetime
from django.db.models import Manager
from django.db.models.query import QuerySet
from .models import *
from rapidsms_httprouter.models import Message
from poll.models import gettext_db
from django.db.models import Q
class ScriptProgre... | Python | 0.000024 | @@ -5490,43 +5490,8 @@
%22%22%22%0A
- import pdb;pdb.set_trace()%0A
|
10dc027ee15428d7ca210e0b74e5ae9274de0fa8 | Use raw_input instead of the unmodified words | lianXiangCi.py | lianXiangCi.py | #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
keyWord=urllib.quote('科学')
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
... | Python | 0.00008 | @@ -177,16 +177,67 @@
ist)%0D%0A%0D%0A
+input = raw_input(%22Please input your key words:%22)%0D%0A
keyWord=
@@ -253,12 +253,13 @@
ote(
-'%E7%A7%91%E5%AD%A6'
+input
)%0D%0A%0D
|
8664723edb16f5787aa35d3bd5d6aea21e205eb9 | Remove debug code & rename function | test-read.py | test-read.py | #!/usr/bin/python
import unittest
import random
import rarfile
import os, sys
class PyarrCheck(unittest.TestCase):
def setUp(self):
self.scriptdir = os.path.realpath(os.path.dirname(sys.argv[0]))
_, self.scriptname = os.path.split(sys.argv[0])
self.scriptpath = os.path.normpath(os.path.join(self.scriptdir, s... | Python | 0 | @@ -3178,16 +3178,27 @@
d_random
+_from_start
(rar_fil
@@ -3971,16 +3971,27 @@
d_random
+_from_start
(self, r
@@ -4464,150 +4464,8 @@
ze%0A%0A
-%09%09%09rawf.seek(byte)%0A%09%09%09rarf.seek(byte)%0A#%09%09%09print %22Offset %2510d: RAW - RAR: %25s %25s%22 %25 ( byte, rawf.read(read_bytes), str(rarf.read(read_bytes... |
5e13528a3c2912b4238f8f531a8f2c2652292b0a | Add init_db | scripts/init_db.py | scripts/init_db.py | import os
from pymongo import MongoClient
def main():
try:
client = MongoClient(host=os.environ.get('MONGODB_URI'))
db = client.get_default_database()
# tasks
db.users.create_index(keys='id', name='index_id', unique=True)
create_admin(db)
except Exception as e:
... | Python | 0.000042 | @@ -186,24 +186,26 @@
asks%0A
+ #
db.users.cr
@@ -263,16 +263,18 @@
%0A
+ #
create_
@@ -283,16 +283,196 @@
min(db)%0A
+ db.users.update_many(%7B'$or': %5B%7B'events.joi.conference.registered': True%7D, %7B'events.joi.table_ronde.registered': True%7D%5D%7D,%0A %7B'$set': %7B'events.joi... |
4871d8135a754374bb1b31b0e2e51bacc8075c4f | Reorder arguments for resource() and default the 'prefix' argument to an empty string | respite/urls/__init__.py | respite/urls/__init__.py | from copy import deepcopy
from django.conf.urls.defaults import *
from django.http import HttpResponse
from respite.inflector import pluralize, cc2us
from respite.urls import routes
def resource(prefix, views, routes):
"""
Route a collection of views.
:param prefix: A string to prefix the routes by (e.g... | Python | 0.000006 | @@ -195,16 +195,8 @@
rce(
-prefix,
view
@@ -200,24 +200,35 @@
iews, routes
+, prefix=''
):%0A %22%22%22%0A
|
aaac39fbf5a38bc95ada280738649ef188425528 | add imports for instances and sets to pcda | disaggregator/PecanStreetDatasetAdapter.py | disaggregator/PecanStreetDatasetAdapter.py | from ApplianceTrace import ApplianceTrace
import sqlalchemy
import pandas as pd
class PecanStreetDatasetAdapter():
schema_names = {'curated': '\"PecanStreet_CuratedSets\"',
'raw': '\"PecanStreet_RawData\"',
'shared': '\"PecanStreet_SharedData\"'}
time_co... | Python | 0.000005 | @@ -34,16 +34,102 @@
nceTrace
+%0Afrom ApplianceInstance import ApplianceInstance%0Afrom ApplianceSet import ApplianceSet
%0A%0Aimport
|
ce51d84dc2b3e78e8c1e78e8d00528dcb241a480 | update get_meta_table to get_table_metadata | disaggregator/PecanStreetDatasetAdapter.py | disaggregator/PecanStreetDatasetAdapter.py | from ApplianceTrace import ApplianceTrace
import sqlalchemy
import pandas as pd
class PecanStreetDatasetAdapter():
schema_names = {'curated': '\"PecanStreet_CuratedSets\"',
'raw': '\"PecanStreet_RawData\"',
'shared': '\"PecanStreet_SharedData\"'}
time_co... | Python | 0.000005 | @@ -1464,18 +1464,22 @@
get_
-meta_
table
+_metadata
(sel
@@ -1498,61 +1498,8 @@
le):
- # TODO change this func name to %22get_table_metadata%22
%0A
@@ -2112,18 +2112,17 @@
urn
-%5B
ids,
+
apps
-%5D
%0A%0A
|
de91561ab7e16a125dd403e395f081c78323a47c | Fix typobug | spectrocrunch/common/listtools.py | spectrocrunch/common/listtools.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2017 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Wout De Nolf (wout.de_nolf@esrf.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software")... | Python | 0.99804 | @@ -1825,17 +1825,18 @@
p(operat
-e
+or
.not_,ba
|
9ac47c86103d9a6db52f8feb8081c0b391f85e96 | Change Aeon config from string to dict | speech/data/ingest_librispeech.py | speech/data/ingest_librispeech.py | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems 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
#... | Python | 0.000003 | @@ -5543,19 +5543,8 @@
der(
-json.dumps(
aeon
@@ -5552,17 +5552,16 @@
config))
-)
%0A%0Aif __n
|
d85a27db790bb4bc1926fc78bcf0f2d54c876e48 | bump version | pvmismatch/__init__.py | pvmismatch/__init__.py | # -*- coding: utf-8 -*-
"""
This is the PVMismatch Package. It contains :mod:`~pvmismatch.pvmismatch_lib`
and :mod:`~pvmismatch.pvmismatch_tk`.
:mod:`~pvmismatch.pvmismatch_lib`
=================================
This package contains the basic library modules, methods, classes and
attributes to model PV system mismatc... | Python | 0 | @@ -1400,9 +1400,9 @@
'2.
-0
+1
'%0A__
@@ -1429,12 +1429,10 @@
an H
-oney
+am
'%0A__
|
45a624e18b9b870163a5852bd4d06c59b3bb5ac2 | Fix base for got on pie binaries (#618) | pwndbg/commands/got.py | pwndbg/commands/got.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import pwndbg.chain
import pwndbg.commands
import pwndbg.enhance
import pwndbg.file
import pwndbg.which
imp... | Python | 0 | @@ -1061,29 +1061,24 @@
bin_
-text_
base = pwndb
@@ -1083,44 +1083,25 @@
dbg.
-vmmap.find(pwndbg.elf.entry()).start
+elf.exe().address
%0A%0A
@@ -1693,13 +1693,8 @@
bin_
-text_
base
|
a735f36102b370415b9f49dae4ee3c5ceda30136 | Update cycling_light.py | apps/hue/cycling_light.py | apps/hue/cycling_light.py | # -*- coding: utf-8 -*-
# Author : jeonghoonkang, https://github.com/jeonghoonkang
import httplib
import time
conn = httplib.HTTPConnection("10.xxx.xxx.xxxx")
hue_uid = "c274b3c285d19cfxxxxxxxxxx"
restcmd = "/api"+hue_uid+"/lights"
str = " "
xhue = [10000,25000,46000,56280]
def shifthue() :
global str
glob... | Python | 0.000001 | @@ -1,8 +1,9 @@
+%0A
# -*- co
|
9979ef7149739e6523eddc439287807434090cbd | Add EDF readers, using fabio. | pyXPCS/pims_readers.py | pyXPCS/pims_readers.py | from pims import FramesSequence
from ..broker import DataBroker
from filestore.api import retrieve
from skimage import img_as_float
class Images(FramesSequence):
def __init__(self, headers, name, flat_field, dead_pixels,
process_func=None, dtype=None, as_grey=False):
"""
Load ima... | Python | 0 | @@ -125,16 +125,29 @@
s_float%0A
+import fabio%0A
%0A%0Aclass
@@ -3497,32 +3497,37 @@
path, flat_field
+=None
, dead_pixels,%0A
@@ -3515,32 +3515,37 @@
one, dead_pixels
+=None
,%0A
@@ -3838,18 +3838,73 @@
t(frame)
+%0A if flat_field is not None:%0A result
-
+=
img_as_
@@ -39... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.