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 |
|---|---|---|---|---|---|---|---|
800634c4980886fd1fd64c3e7c6d6a0cb87d8b1c | remove useless code | src/search.py | src/search.py | #! /usr/bin/python3
from functools import reduce
from operator import or_, and_
from hashlib import sha1
from sys import exit, stderr
from json import loads
from itertools import chain
from syslog import syslog
import elasticsearch
from elasticsearch_dsl import FacetedSearch, Search, Q
from elasticsearch_dsl.aggs impo... | Python | 0.006635 | @@ -609,450 +609,8 @@
xt%0A%0A
-def sectionToJSON(section):%0A return %7B%0A %22prof%22 : section.prof,%0A %22sem%22 : section.sem,%0A %22day%22 : section.day%0A %7D%0A%0Adef classToJSON(clss):%0A return %7B%0A %22title%22 : clss.title,%0A %2... |
0059b1f16a297c71e66915fb115e4fd36cd1095e | update revoke email template placeholders | ecommerce/extensions/offer/utils.py | ecommerce/extensions/offer/utils.py | """Offer Utility Methods. """
import logging
from decimal import Decimal
from django.conf import settings
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from ecommerce_worker.sailthru.v1.tasks import send_offer_assignment_email, send_offer_update_email
from oscar.core.load... | Python | 0 | @@ -5518,26 +5518,26 @@
-user_email
+USER_EMAIL
=learner
@@ -5552,20 +5552,20 @@
-code
+CODE
=code,%0A
|
ac9cd5ff007ee131e97f70c49c763f79f06ebf5a | Include the entire existing environment for integration tests subprocesses | green/test/test_integration.py | green/test/test_integration.py | import multiprocessing
import os
from pathlib import PurePath
import subprocess
import sys
import tempfile
from textwrap import dedent
import unittest
try:
from unittest.mock import MagicMock
except:
from mock import MagicMock
from green import cmdline
class TestFinalizer(unittest.TestCase):
def setUp(s... | Python | 0 | @@ -1,12 +1,24 @@
+import copy%0A
import multi
@@ -1296,16 +1296,96 @@
arent)%0A%0A
+ env = copy.deepcopy(os.environ)%0A env%5B%22PYTHONPATH%22%5D = pythonpath%0A%0A
@@ -1549,34 +1549,11 @@
env=
-%7B%22PYTHONPATH%22: pythonpath%7D
+env
,%0A
|
8a22390819e3890939d56ca4b009151d007bf5e3 | Use uuid to generate nonce | lexicon/providers/aliyun.py | lexicon/providers/aliyun.py | """Module provider for Aliyun"""
import base64
import datetime
import hmac
import logging
import random
import sys
import time
from hashlib import sha1
import requests
from six.moves import urllib
from lexicon.exceptions import AuthenticationError
from lexicon.providers.base import Provider as BaseProvider
LOGGER = ... | Python | 0.000128 | @@ -87,22 +87,8 @@
ing%0A
-import random%0A
impo
@@ -101,20 +101,20 @@
%0Aimport
-time
+uuid
%0Afrom ha
@@ -7505,57 +7505,19 @@
str(
-int(time.time())) + str(random.randint(1000, 9999
+uuid.uuid4(
))%0A%0A
|
c47197bbf4d6a69e4f68087cb4f5a0e2ad7cc12a | make a last ditch effort to find blog posts on a 404 | blogdor/views.py | blogdor/views.py | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
from django.shortcuts import render_to_response, get_object_or_... | Python | 0.000001 | @@ -249,16 +249,25 @@
Redirect
+, Http404
%0Afrom dj
@@ -1433,24 +1433,45 @@
ear, slug):%0A
+ try: %0A
return l
@@ -1710,16 +1710,297 @@
='post')
+%0A except Http404, e:%0A try:%0A post = Post.objects.published().filter(date_published__year=year, slug__startswith=slug).latest... |
d206b948124aeee5df46be1603eddd85c741880e | Update nic.py | azurecloudify/nic.py | azurecloudify/nic.py | ########
# Copyright (c) 2015 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... | Python | 0.000001 | @@ -5298,17 +5298,16 @@
_):%0A
-#
client_i
|
63ebe84538e76abf68b088fc3f8b3d268aaed8ce | update blacklist | eg/openstates/convert_openstates.py | eg/openstates/convert_openstates.py | #!/usr/bin/env python
from popolo.organization import Organization
from popolo.membership import Membership
from popolo.person import Person
from billy.core import db
from pymongo import Connection
connection = Connection('localhost', 27017)
nudb = connection.popolo # XXX: Fix the db name
type_tables = {
Orga... | Python | 0.000001 | @@ -2141,16 +2141,151 @@
= set(%5B%0A
+ %22district%22,%0A %22chamber%22,%0A %22country%22,%0A %22_scraped_name%22,%0A %22state%22,%0A %22active%22,%0A %22party%22,%0A
|
b91974d3e830d97cdb0808dadf8ff5d22b506bdf | Add toString() | lib/var/countpage.py | lib/var/countpage.py | #!/usr/bin/env python
'''
Copyright (c) 2016 anti-XSS developers
'''
class CountPage(object):
number = 0
def __init__(self, number=0):
self.number = number
def setNumber(self, number):
self.number = number
def getNumber(self):
return self.number
def incNumber(self):
... | Python | 0.000005 | @@ -162,32 +162,46 @@
umber = number%0A%0A
+ pass%0A%0A
def setNumbe
@@ -217,16 +217,16 @@
umber):%0A
-
@@ -239,32 +239,46 @@
umber = number%0A%0A
+ pass%0A%0A
def getNumbe
@@ -331,32 +331,32 @@
ncNumber(self):%0A
-
self.num
@@ -364,8 +364,88 @@
er += 1%0A
+%0A pas... |
3408f7dc56220ea202b7df00c807cdb21d269287 | Add splitting to report | Orange/widgets/model/owtree.py | Orange/widgets/model/owtree.py | """Tree learner widget"""
from AnyQt.QtCore import Qt
from collections import OrderedDict
from Orange.data import Table
from Orange.modelling.tree import TreeLearner
from Orange.widgets import gui
from Orange.widgets.settings import Setting
from Orange.widgets.utils.owlearnerwidget import OWBaseLearner
class OWTree... | Python | 0 | @@ -3540,16 +3540,247 @@
%22None%22%0A
+ if self.limit_majority:%0A items%5B%22Splitting%22%5D = %22Stop splitting when majority reaches %25d%25%25 %22 %5C%0A %22(classification only)%22 %25 %5C%0A self.sufficient_majority%0A
|
46ba8967de7b6f6c714749dd7ff2771f447b9258 | fix field allowance | PersonalSite/content/models.py | PersonalSite/content/models.py | from django.db import models
# Create your models here.
class Project(models.Model):
title = models.CharField(max_length=128,blank=True,null=True,default="")
body = models.TextField(blank=True,null=True,default="")
preview = models.ImageField(upload_to="img/project_previews/",blank=True,null=True,def... | Python | 0 | @@ -509,24 +509,34 @@
s.DateField(
+blank=True
)%0A%0A def s
@@ -1123,16 +1123,26 @@
meField(
+blank=True
)%0A%0A d
@@ -1788,54 +1788,18 @@
lse,
-max_length=128,blank=True,null=True,default=%22%22
+blank=True
)%0A%0A
|
0fc37dc4007e6136ce808aa85449702e5bcdd3cf | version 1.9.8 | lib/version.py | lib/version.py | ELECTRUM_VERSION = "1.9.7" # version of the client package
PROTOCOL_VERSION = '0.6' # protocol version requested
SEED_VERSION = 4 # bump this every time the seed generation is modified
SEED_PREFIX = '01' # the hash of the mnemonic seed must begin with this
| Python | 0.000001 | @@ -21,9 +21,9 @@
1.9.
-7
+8
%22 #
|
c1abb8ea05c68de7072a34c2f40f1e8c303be0fe | Bump version to 1.0 | lib/version.py | lib/version.py | ELECTRUM_VERSION = "0.61"
SEED_VERSION = 4 # bump this everytime the seed generation is modified
TRANSLATION_ID = 28344 # version of the wiki page
| Python | 0 | @@ -17,12 +17,11 @@
= %22
-0.61
+1.0
%22%0ASE
|
5c8dafb38cf6d6b2535f5fd66ae504d28c61fb03 | set Note.name to filename by default | karmaworld/apps/ajaxuploader/backends/local.py | karmaworld/apps/ajaxuploader/backends/local.py | from io import FileIO, BufferedWriter
import os
from django.conf import settings
from ajaxuploader.backends.base import AbstractUploadBackend
from karmaworld.apps.notes import tasks
from karmaworld.apps.notes.models import Note
from karmaworld.apps.courses.models import Course
class LocalUploadBackend(AbstractUpload... | Python | 0.000001 | @@ -2291,24 +2291,53 @@
te = Note()%0A
+ note.name = filename%0A
note
|
ddd8c4d3f913a1f87b68496cca8e1deb10a8ee8e | remove obsolete replacements from synth.py (#37) | packages/google-cloud-recommender/synth.py | packages/google-cloud-recommender/synth.py | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -1585,162 +1585,8 @@
%5D)%0A%0A
-# Fix broken links to cloud.google.com documentation%0As.replace('src/v1beta1/*.ts', '/data-catalog/docs/', 'https://cloud.google.com/data-catalog/docs/')%0A%0A
# No
|
71b5883a6693361facf705f2dc840cdd9ff4c225 | format dates more like BibTeX | pybtex/styles/formatting/plain.py | pybtex/styles/formatting/plain.py | # Copyright 2006 Andrey Golovizin
#
# This file is part of pybtex.
#
# pybtex is free software; you can redistribute it and/or modify
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# pybtex i... | Python | 0 | @@ -1096,33 +1096,111 @@
ersons)%0A
- return p%0A
+%0A def format_date(self, entry):%0A return Phrase(entry.month, entry.year, sep=' ')%0A
%0A def
@@ -1520,22 +1520,35 @@
l), vp,
-e.year
+self.format_date(e)
))%0A
@@ -2007,14 +2007,27 @@
er,
-e.year
+self.format_date(e)
, ad
|
c1477601e88ce1fb6ab26d87096a50245dcf161a | Fix bug when query contains words outside training vocabulary | classifier/feature.py | classifier/feature.py | """
This file
- Transforms a training file to the input format required by LibLINEAR.
- Convert a query to the format required by LibLINEAR when doing prediction.
- Output feature file for prediction.
============================================================================
Original training file format, for each... | Python | 0.000798 | @@ -6523,16 +6523,33 @@
ow = %7B%7D%0A
+ try:%0A
@@ -6559,32 +6559,36 @@
f in features:%0A
+
oner
@@ -6619,16 +6619,122 @@
+1%5D = 1%0A
+ except ValueError:%0A #print '%25s is not in the feature list' %25 f.lower()%0A pass
%0A
@@ -7042,12 +7... |
73f86006f7e5fab897794186da3064708e7a24ad | Bump READ_VERSION of BlockCompletionTransformer to 1. | lms/djangoapps/course_api/blocks/transformers/block_completion.py | lms/djangoapps/course_api/blocks/transformers/block_completion.py | """
Block Completion Transformer
"""
from xblock.completable import XBlockCompletionMode as CompletionMode
from lms.djangoapps.completion.models import BlockCompletion
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockCompletionTransformer(BlockStructureTra... | Python | 0 | @@ -434,17 +434,17 @@
RSION =
-0
+1
%0A WRI
|
fe65a9a1d1652d1ece4a4cf5c08c1e893086c7b3 | fix test_colsample | test_colsample_bylevel.py | test_colsample_bylevel.py | import xgboost as xgb
from sklearn.datasets import make_classification
X, y = make_classification(n_samples=2**15+1, n_features=10, n_informative=5, n_redundant=5,
shuffle=True, random_state=123)
param = {'objective':'binary:logistic','tree_method':'approx',
'eval_metric':'logloss'... | Python | 0 | @@ -2113,19 +2113,16 @@
el:0.01%0A
-..%0A
%5B02:55:4
@@ -2680,47 +2680,66 @@
.01%0A
-..%0Axgboost.core.XGBoostError: %5B03:04:47
+%5B02:56:02%5D dmlc-core/include/dmlc/logging.h:235: %5B02:56:02
%5D sr
|
8dce66a2fba0945dbfab77c22855037abb2e1ae3 | Fix stack.ChainMap tests | tests/python/test_context/test_stack/test_chainmap.py | tests/python/test_context/test_stack/test_chainmap.py | # encoding: utf-8
import unittest
AVAILABLE = True
try:
from logging_utils.context.stack.chainmap import ChainMapContextStack
except:
AVAILABLE = False
@unittest.skipUnless(AVAILABLE, "ChainMap-backed ContextStack is unavailable for this Python")
class SimpleContextStackTest(unittest.TestCase):
def setU... | Python | 0.000002 | @@ -426,32 +426,58 @@
(self):%0A
+self.stack.pop()%0A #
self.assertRaise
@@ -784,32 +784,27 @@
ssertRaises(
-Attribut
+Typ
eError, list
@@ -924,32 +924,27 @@
ssertRaises(
-Attribut
+Typ
eError, list
@@ -1061,32 +1061,27 @@
ssertRaises(
-Attribut
+Typ
eError, list
@@ -1212,17 +1212,13 @@
ses(
-At... |
25040609dd5d4c5a4a31a2c7588971ec066f54da | return list of TxIn objects | pypeerassets/provider/cryptoid.py | pypeerassets/provider/cryptoid.py | import requests
from operator import itemgetter
from .common import Provider
from pypeerassets.exceptions import InsufficientFunds
class Cryptoid(Provider):
'''API wrapper for http://chainz.cryptoid.info blockexplorer.'''
@classmethod
def __init__(self, network: str):
"""
: network = pee... | Python | 0.000534 | @@ -124,16 +124,80 @@
ntFunds%0A
+from btcpy.structs.transaction import TxIn, Sequence, ScriptSig%0A
%0A%0Aclass
@@ -3164,14 +3164,15 @@
utxo
+s
= %5B%5D%0A
-
@@ -3511,16 +3511,17 @@
utxo
+s
.append(
%7B%0A
@@ -3516,17 +3516,16 @@
.append(
-%7B
%0A
@@ -3541,16 +3541,18 @@
-'
+TxIn(
txid... |
5f8ee4e483050599fc107b10eefe931b08654b15 | Use devel version of LP API. | files/scripts/update_cla_group.py | files/scripts/update_cla_group.py | #! /usr/bin/env python
# Copyright (C) 2011 OpenStack, 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 la... | Python | 0.000005 | @@ -1819,16 +1819,66 @@
DENTIALS
+,%0A version='devel'
)%0A%0Alp_me
|
ef1d5c9a977d89e6a4a4971548f53f65625f1604 | Fix pandas_read_json compatibility issue (#26494) | python/ray/serve/http_adapters.py | python/ray/serve/http_adapters.py | from io import BytesIO
from typing import Any, Dict, List, Optional, Union
from fastapi import File, Request
from pydantic import BaseModel, Field
import numpy as np
import starlette.requests
from ray.util.annotations import PublicAPI
from ray.serve.utils import require_packages
_1DArray = List[float]
_2DArray = Li... | Python | 0 | @@ -2902,16 +2902,96 @@
.body()%0A
+ if isinstance(raw_json, bytes):%0A raw_json = raw_json.decode(%22utf-8%22)%0A
retu
|
047ed9f72206f9f275006922c9632d72573c0c53 | Update ninjapic.pyw | app/ninjapic.pyw | app/ninjapic.pyw | from surface import Surface
from PyQt4.QtCore import QBuffer, QByteArray, QIODevice, QString, SIGNAL, SLOT
from PyQt4.QtGui import (QApplication, QSystemTrayIcon, QIcon, QMenu, QAction,
QImage, QKeySequence)
from imgurpython import ImgurClient
from pygs import QxtGlobalShortcut
import os
import sys
import webb... | Python | 0 | @@ -25,87 +25,8 @@
ace%0A
-from PyQt4.QtCore import QBuffer, QByteArray, QIODevice, QString, SIGNAL, SLOT%0A
from
|
016fa58761c1ea42657409bb3f4d6260671d8ea1 | Update note_util.py so that it reads the new note offsets | app/note_util.py | app/note_util.py | import datetime
import os
import dotenv
from getenv import env
import markdown2
import pytz
root_path = os.path.dirname(os.path.realpath(__file__)) + '/../'
dotenv.read_dotenv(os.path.join(root_path, '.env'))
# See https://github.com/trentm/python-markdown2/wiki/Extras
MARKDOWN_EXTRAS = [
'code-friendly',
'f... | Python | 0 | @@ -1225,17 +1225,17 @@
ot note%5B
-2
+4
%5D.isdigi
@@ -1263,37 +1263,8 @@
one%0A
- timestamp = int(note%5B2%5D)%0A
@@ -1350,10 +1350,39 @@
ote%5B
-1%5D
+2%5D%0A timestamp = int(note%5B4%5D)
%0A
@@ -1539,9 +1539,9 @@
ote%5B
-3
+6
:%5D),
|
117c84bba009aeff166900f5eb70aa640e05beb2 | Modify to use casefold | typepy/converter/_bool.py | typepy/converter/_bool.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .._common import strip_ansi_escape
from .._const import DefaultValue, ParamKey
from ..error import TypeConversionError
from ._interface import AbstractValueConverter
class BoolConverter(AbstractValueConverter):
def force_convert(self):
... | Python | 0.00006 | @@ -1043,21 +1043,24 @@
= value.
-lower
+casefold
()%0A
|
40777e44e2403d633ecaa4d45b6985be3a5bc907 | add version 1.1 (#5461) | var/spack/repos/builtin/packages/parsplice/package.py | var/spack/repos/builtin/packages/parsplice/package.py | ##############################################################################
# Copyright (c) 2017, Los Alamos National Security, LLC
# Produced at the Los Alamos National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, ... | Python | 0 | @@ -1448,20 +1448,100 @@
ice/
-tags/v1.0
+repository/archive.tar.gz?ref=v1.1
%22%0A%0A
+ version('1.1', '3a72340d49d731a076e8942f2ae2f4e9')%0A
|
a47ab9c6b216e4926a5cc4564a7db24379354fb4 | Add extra version of py-psutil (#15063) | var/spack/repos/builtin/packages/py-psutil/package.py | var/spack/repos/builtin/packages/py-psutil/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPsutil(PythonPackage):
"""psutil is a cross-platform library for retrieving information ... | Python | 0 | @@ -638,16 +638,112 @@
f63f3')%0A
+ version('5.6.2', sha256='828e1c3ca6756c54ac00f1427fdac8b12e21b8a068c3bb9b631a1734cada25ed')%0A
vers
|
6f4f29aae4731ac1006c782f79519f8534d0b7e9 | add task definition to run record | bobsled/tasks.py | bobsled/tasks.py | from __future__ import print_function
import os
import glob
import json
import yaml
import boto3
from botocore.exceptions import ClientError
from .dynamo import Run
def checkout_tasks():
os.system('GIT_SSH_COMMAND="ssh -i deploy.key" '
'git clone git@github.com:{}/{}.git --depth 1'.format(
... | Python | 0.000005 | @@ -6548,24 +6548,94 @@
task_name)%0A%0A
+ taskdef = ecs.describe_task_definition(taskDefinition=task_name)%0A%0A
response
@@ -7306,22 +7306,34 @@
ion=
-%7B%7D, # TODO
+taskdef%5B'taskDefinition'%5D,
%0A
|
148bfc0c850d9883278a41e98c65f14c9eef59f7 | fix filter stats urls | apps/turan/urls.py | apps/turan/urls.py | from django.conf import settings
from django.conf.urls.defaults import *
from models import Route, CycleTrip, Hike, OtherExercise
from views import index, trip_compare, logout, events, route_detail, week, statistics, generate_tshirt, calendar, calendar_month, cycletrip, json_tripdetail, TripsFeed, json_serializer, crea... | Python | 0.000002 | @@ -673,17 +673,16 @@
atistics
-$
', stati
@@ -767,32 +767,37 @@
name='statistics
+-year
'),%0A url(r'%5Es
@@ -858,32 +858,38 @@
name='statistics
+-month
'),%0A url(r'%5Eg
|
c647708991988769357aaa5793d808e4c610e54e | Fix ReporterBase not loading the correct templates | botbot/report.py | botbot/report.py | """Generate a report about file errors"""
import os
import sys
import math
from pkg_resources import resource_exists, resource_filename
from jinja2 import Environment, FileSystemLoader
from . import problems
_DEFAULT_RES_PATH = os.path.join('resources', 'templates')
class ReporterBase():
def __init__(self, chk... | Python | 0 | @@ -263,16 +263,53 @@
plates')
+%0A_GENERIC_REPORT_NAME = 'generic.txt'
%0A%0Aclass
@@ -1220,36 +1220,148 @@
get_
-template(self, tmp_respath):
+env(self, template):%0A tmppath = os.path.join(_DEFAULT_RES_PATH,%0A self._get_template_filename(template))
%0A
@@ -1396,28 +1396,... |
299ed52e872a2242610cc553ac90764275b05272 | Update test_glove2word2vec.py | gensim/test/test_glove2word2vec.py | gensim/test/test_glove2word2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Test for gensim.scripts.glove2word2vec.py."""
import unittest
import os
import sys
import gensim
from gensim.utils import check_out... | Python | 0.000003 | @@ -834,13 +834,12 @@
output,
-b
'')%0A
|
8eb2be1c6b08a458e739d56fde4601c6e1c8cf56 | Version bump to 0.4.5 | bprc/_version.py | bprc/_version.py | __version__ = "0.4.4"
| Python | 0 | @@ -12,11 +12,11 @@
= %220.4.
-4
+5
%22%0A
|
d8762c1f5c72c07d5bef4e56e88829e01da107e4 | fix ipynb runner | ipynb_runner.py | ipynb_runner.py | """
Script for running ipython notebooks.
"""
from __future__ import print_function
from IPython.nbformat.current import read
from IPython.kernel import KernelManager
import argparse
#from pprint import pprint
import sys
def get_ncells(nb):
# return number of code cells in a notebook
ncells=0
for ws in nb.... | Python | 0.000003 | @@ -1367,16 +1367,36 @@
nnels()%0A
+kc.wait_for_ready()%0A
shell=kc
@@ -1721,21 +1721,18 @@
-shell
+kc
.execute
@@ -1764,17 +1764,20 @@
msg=
+kc.get_
shell
-.get
_msg
|
df1e33283485b76c61185a98b5b2c909431c2ae5 | Remove white space between print and () | client_api_example.py | client_api_example.py | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0.997877 | @@ -2619,17 +2619,16 @@
)%0A%0Aprint
-
('Giving
|
9c3affb42773f6994d39b4f12a0ec32d041c461c | Add wait-until parameter to cluster_sim. | scripts/cluster_sim.py | scripts/cluster_sim.py | #!/usr/bin/python
import sys
import math
import subprocess
from cluster_config import ClusterConfig
from cluster_run import ClusterRun
from cluster_run import ClusterDeploymentRun
from cluster_scp import ClusterSCP
# User parameters
class ClusterSimSettings:
def __init__(self, x, y):
self.layout_x = x
... | Python | 0 | @@ -53,16 +53,32 @@
process%0A
+import datetime%0A
from clu
@@ -1978,32 +1978,114 @@
nstances(self):%0A
+ wait_until_time = datetime.datetime.now().strftime(%22%25Y-%25m-%25d %25H:%25M:%25S%25z%22)%0A
# Constr
@@ -2244,16 +2244,17 @@
%25(node)d
+
%22%0A
@@ -2567,32 +2567,96 @@
andwidth) + %... |
8e02a4de41b0c979f4c4d890dfe3b242a4a3f37d | fix filters in post | DisSoNet/front/views/post.py | DisSoNet/front/views/post.py | from .base import BaseView
from data.forms import PostCreationForm
from data.models import Post
from django.db.models import Q
from django.http import HttpResponseRedirect, HttpResponse
from .mixins.post_list import PostListMixin
import json
from django.http import HttpResponse
from data.models import Post, Comment... | Python | 0 | @@ -539,32 +539,78 @@
rgs, **kwargs):%0A
+ kwargs%5B'post_list_filter'%5D = 'public'%0A
super(Pu
@@ -713,65 +713,8 @@
s):%0A
- posts = Post.objects.filter(visibility=%22PUBLIC%22)%0A
@@ -880,32 +880,78 @@
_dict_list = %5B%5D%0A
+ posts = self.context%5B'post_list'%5D%0A
... |
8c19f53e606fbe55e9ec9b2aed46e49121f390ef | Improve Context.embed_send method formatting | Discord/utilities/context.py | Discord/utilities/context.py |
import discord
from discord.ext import commands
import collections
import json
from modules import utilities
from utilities import errors
class Context(commands.Context):
async def embed_reply(self, *args, in_response_to = True, attempt_delete = True, **kwargs):
in_response_to_text = "In response to"
if "aut... | Python | 0 | @@ -1051,16 +1051,17 @@
%0A%09%09%09%09%09%09
+%09
title =
@@ -1111,24 +1111,25 @@
bed.Empty, %0A
+%09
%09%09%09%09%09%09author
@@ -1210,24 +1210,25 @@
bed.Empty, %0A
+%09
%09%09%09%09%09%09image_
@@ -1268,16 +1268,17 @@
%0A%09%09%09%09%09%09
+%09
footer_t
@@ -1340,24 +1340,25 @@
bed.Empty, %0A
+%09
%09%09... |
7f38c86d3a574cdd9b461c9b7be4a876d844021b | Replace AT specific cust.attr.def with mixins | src/ggrc/models/assessment_template.py | src/ggrc/models/assessment_template.py | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: peter@reciprocitylabs.com
# Maintained By: peter@reciprocitylabs.com
"""A module containing the implementation of the assessment template entity.""... | Python | 0 | @@ -2752,369 +2752,8 @@
py%0A%0A
- def get_custom_attributes(self):%0A %22%22%22Get custom attributes defined for certain assessment template%22%22%22%0A from ggrc.models import CustomAttributeDefinition%0A return CustomAttributeDefinition.query.filter(%0A CustomAttributeDefinition.definition_type == ... |
532ce0999a61dd1ba35e3e7513157277fc3806dc | Refactor a bit | bdd_tester/runner.py | bdd_tester/runner.py | from behave.configuration import Configuration
from behave.formatter._registry import make_formatters
from behave.runner import Runner, Context
from behave.runner_util import parse_features, print_undefined_step_snippets
from behave.model import Examples, ScenarioOutline, Table
from lxml import etree
class DQRunner(R... | Python | 0.000008 | @@ -875,38 +875,577 @@
lf)%0A
- self.context.doc = doc
+%0A # add a bunch of useful stuff to the context%0A organisations = doc.xpath('//iati-organisation')%0A if len(organisations) %3E 0:%0A self.context.filetype = 'org'%0A # if this looks like an org file, set the or... |
658e4704b42261f3322075feafb9d899e4d799ec | Fix for subclasses | closuretree/models.py | closuretree/models.py | from django.db import models
from django.db.models.query import Q
from django.utils.translation import ugettext as _
def mybulkcreate(objs):
for obj in objs:
obj.save()
class ClosureModel(models.Model):
class Meta:
abstract = True
def __init__(self, *args, **kwargs):
super(Closur... | Python | 0.000001 | @@ -62,59 +62,8 @@
rt Q
-%0Afrom django.utils.translation import ugettext as _
%0A%0Ade
@@ -1081,16 +1081,175 @@
model%0A%0A
+ @classmethod%0A def _toplevel(cls):%0A x = list(set(ClosureModel.__subclasses__()) & cls._meta.get_parent_list())%0A return x%5B0%5D if x else cls%0A%0A
@cla
@@ -16... |
3f877871a9f439be8d0839bfee965dc6462b7b3b | fix class method declaration | raspberry-pi/led-switch-toggle.py | raspberry-pi/led-switch-toggle.py | import RPi.GPIO as GPIO
import time
# tell GPIO to use the Pi's board numbering for pins
GPIO.setmode(GPIO.BOARD)
# simple class that toggles the output value of the outputPin (HIGH/LOW)
# by pressing the switch on switchInputPin
#
# to use, instantiate and call the toggle() method in your loop
class SwitchToggler:
... | Python | 0.000003 | @@ -628,16 +628,20 @@
toggle(
+self
):%0A
|
e40c6076da9f31207b81589082acaca962078107 | Fix #2971 | module/plugins/crypter/FshareVnFolder.py | module/plugins/crypter/FshareVnFolder.py | # -*- coding: utf-8 -*-
from ..internal.SimpleCrypter import SimpleCrypter
class FshareVnFolder(SimpleCrypter):
__name__ = "FshareVnFolder"
__type__ = "crypter"
__version__ = "0.08"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?fshare\.vn/folder/.+'
__config__ = [("activated", "b... | Python | 0 | @@ -18,16 +18,27 @@
-8 -*-%0A%0A
+import re%0A%0A
from ..i
@@ -49,42 +49,75 @@
nal.
-SimpleCrypter import SimpleCryp
+Crypter import Crypter%0Afrom ..internal.misc import replace_pat
ter
+ns
%0A%0A%0Ac
@@ -140,14 +140,8 @@
der(
-Simple
Cryp
@@ -225,17 +225,17 @@
_ = %220.0
-8
+9
%22%0A __
@@ -661,16 +661,18... |
27470493eb1d5c628ff6cf0585782a0190642631 | figuring out what is borked | kyzr/__init__.py | kyzr/__init__.py | from flask import Flask, render_template, request
import json
# pyMongodb wrapper
from kyzr_db import dbEditor
kyzr = dbEditor()
# Setup flask
app = Flask(__name__)
# Main homepage
# TODO: Add login ability and other inputs
@app.route('/')
def index():
return render_template('index.html')
# Map page
# TODO: Mer... | Python | 0.99965 | @@ -812,18 +812,20 @@
if
-not
coords
+ != %5B%5D
:%0A
|
2753495389ffc4e6c750db91b659178e6264cbb0 | Make transofrm graph docs non-asropy specific | astropy/coordinates/builtin_frames/__init__.py | astropy/coordinates/builtin_frames/__init__.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains the coordinate frames actually implemented by astropy.
Users shouldn't use this module directly, but rather import from the
`astropy.coordinates` module. While it is likely to exist for the long-term,
the... | Python | 0.000014 | @@ -3642,24 +3642,33 @@
all of the
+built in
coordinate s
@@ -3677,59 +3677,13 @@
tems
- built into the%0A %60~astropy.coordinates%60 package,
+,%0A
the
|
c9ad789262f2e75010d0f6690d793a2f7c36f352 | Add locked and lock_suggested properties to OfficialDocument | ynr/apps/official_documents/models.py | ynr/apps/official_documents/models.py | from __future__ import unicode_literals
import os
from django.db import models
from django.utils.translation import ugettext_lazy as _
from popolo.models import Post
from elections.models import Election
from django_extensions.db.models import TimeStampedModel
from compat import python_2_unicode_compatible
DOCUME... | Python | 0 | @@ -1595,8 +1595,346 @@
lf.pk%7D)%0A
+%0A @property%0A def locked(self):%0A %22%22%22%0A Is this post election locked?%0A %22%22%22%0A return self.post_election.candidates_locked%0A%0A @property%0A def lock_suggested(self):%0A %22%22%22%0A Is there a suggested lock... |
e863c1b380911d39ebc309fa584dd3c847bc5312 | add beta in fabfile | {{cookiecutter.repo_name}}/fabfile.py | {{cookiecutter.repo_name}}/fabfile.py | from fabric.api import env, run, local
def live():
"""Connects to the server."""
env.hosts = ['bankenverband.de']
env.user = 'freshmilk'
env.cwd = '/var/www/{{cookiecutter.project_name}}'
env.connect_to = '{0}@{1}:{2}'.format(env.user, env.hosts[0], env.cwd)
def gitpull(tag=None):
... | Python | 0 | @@ -281,24 +281,299 @@
env.cwd)%0D%0A%0D%0A
+def beta():%0D%0A %22%22%22Connects to beta/testing server%22%22%22%0D%0A env.hosts = %5B'beta.%7B%7Bcookiecutter.domain_name%7D%7D'%5D%0D%0A env.user = 'username'%0D%0A env.cwd = '/var/www/beta.%7B%7Bcookiecutter.project_name%7D%7D'%0D%0A env.connect_to = '%... |
ede0103939fa25cf04524dfc4d3d1a1430aead82 | Update affected content loader tests. | st2common/tests/unit/test_content_loader.py | st2common/tests/unit/test_content_loader.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 | @@ -1039,17 +1039,16 @@
tCase):%0A
-%0A
def
@@ -1214,33 +1214,35 @@
content(base_dir
-=
+s=%5B
packs_base_path,
@@ -1232,32 +1232,33 @@
%5Bpacks_base_path
+%5D
, content_type='
@@ -1899,17 +1899,19 @@
base_dir
-=
+s=%5B
packs_ba
@@ -1917,16 +1917,17 @@
ase_path
+%5D
, conten
|
0f729d07c6501fe5cb1904ec72264694a5e9023c | Fix some bugs in djbuildhere | scripts/djbuildhere.py | scripts/djbuildhere.py | #!/usr/bin/env python
"""
Build
"""
import glob
import os
import shutil
import sys
import djtools
# would be good not to overwrite old _djtools_common.py
if len(sys.argv > 1):
destdir = sys.argv[1]
else:
destdir = os.getcwd()
for file in glob(djtools.get_skel_dir() + '/*'):
shutil.copy(file, destdir) | Python | 0 | @@ -79,16 +79,179 @@
rt sys%0A%0A
+try:%0A import djtools%0A# this is for testing purposes%0Aexcept ImportError:%0A sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))%0A
import d
@@ -257,16 +257,16 @@
djtools%0A
-
%0A# would
@@ -334,13 +334,13 @@
argv
+)
%3E 1
-)
:%0A
@@... |
5fa67ca6b10cc55c514e687d790b0ab03e18b867 | clean up | code/lib/cnnLayers.py | code/lib/cnnLayers.py | import numpy as np
import numpy.random as random
import theano
from theano import tensor as T
from theano.tensor.nnet import conv
from theano.tensor.signal import downsample
from activationfunctions import *
from common import *
theanoFloat = theano.config.floatX
# TODO: maybe set initialWeights to None so that ... | Python | 0.000001 | @@ -1789,29 +1789,29 @@
lf,
-k
+nrK
ernel
-Size, nrK
+s, k
ernel
-s
+Size
, ac
@@ -1933,58 +1933,8 @@
s%0A%0A%0A
- # you can initialize the weights here for sure%0A%0A
de
|
923ca5a7083d9833e74a6c5e312c54ff9c2b3209 | add docstrings for logger.py | life/logger.py | life/logger.py | import logging
from sys import stdout
class LoggerClass(object):
@staticmethod
def create_logger(log_level=logging.INFO):
logger = logging.getLogger('')
logger.setLevel(log_level)
log_formatter = logging.Formatter("%(asctime)s %(message)s", datefmt='[%d/%b/%Y %H:%M:%S]')
console_handler = logging.... | Python | 0.000001 | @@ -1,12 +1,79 @@
+%22%22%22This module creates a logger for formatted console logging.%22%22%22%0A%0A
import loggi
@@ -133,66 +133,332 @@
:%0A
-@staticmethod%0A def create_logger(log_level=logging.INFO):
+%22%22%22This class creates a logger for formatted console logging.%22%22%22%0A @staticmethod%0A def create... |
f585e7f61a35811cbc85cc39a30ecc6b827ccec0 | Add first and last name to userInfo REST endpoint; Addresses #884 | hs_core/views/user_rest_api.py | hs_core/views/user_rest_api.py | from rest_framework.views import APIView
from rest_framework.response import Response
class UserInfo(APIView):
def get(self, request):
user_info = {"username": request.user.username}
if request.user.email:
user_info['email'] = request.user.email
return Response(user_info)
| Python | 0 | @@ -272,16 +272,209 @@
er.email
+%0A if request.user.first_name:%0A user_info%5B'first_name'%5D = request.user.first_name%0A if request.user.last_name:%0A user_info%5B'last_name'%5D = request.user.last_name
%0A%0A
|
d3e4973b8b52ccf1ff78f3780c002e5449622c66 | change the length of str to 80 in parse_head.py | http_proxy/tools/parse_head.py | http_proxy/tools/parse_head.py | # The MIT License (MIT)
#
# Copyright shifvb 2015-2016
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... | Python | 0.001317 | @@ -1729,17 +1729,17 @@
_LEN = 3
-6
+5
%0A%0A%0Adef p
@@ -1972,17 +1972,17 @@
%7B:7%7D %7B:3
-6
+5
%7D %7B%7D'.fo
|
46aff719c3ec9cdaef4f2123b4c6dfad069b0fc6 | Add tests for logged in user and for invalid username | reddit/tests/test_registration.py | reddit/tests/test_registration.py | from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from reddit.forms import UserForm
from django.contrib.auth.models import User
from reddit.models import RedditUser
class RegistrationFormTestCase(TestCase):
def setUp(self):
User.objects.create(username="user", password=... | Python | 0 | @@ -734,32 +734,45 @@
s%5B'username'%5D, %5B
+%0A
u%22Ensure this va
@@ -1080,24 +1080,37 @@
sername'%5D, %5B
+%0A
u%22Ensure thi
@@ -1194,32 +1194,373 @@
rm.is_valid())%0A%0A
+ def test_invalid_username(self):%0A test_data = %7B'username': 'matt-ex',%0A 'passw... |
2e49dea9ded9eb4f9e798b56c67ed48b71c37cc8 | ADMIN_USER should be None by default | lib/pegasus/python/Pegasus/service/defaults.py | lib/pegasus/python/Pegasus/service/defaults.py | import os
# SERVER CONFIGURATION
SERVER_HOST = "127.0.0.1"
SERVER_PORT = 5000
# SSL config: path to certificate and private key files
CERTIFICATE = None
PRIVATE_KEY = None
# Max number of processes to fork when handling requests
MAX_PROCESSES = 10
# Enable debugging
DEBUG = False
# The secret key used by Flask to... | Python | 0.999998 | @@ -805,18 +805,12 @@
S =
-%7B'mayani'%7D
+None
%0A%0A#
|
eecf1445d3c14ea3a0b6074eb23b3a18da9715d6 | add comment | jinja/reader.py | jinja/reader.py | import os
from xml.dom import minidom
class Reader(object):
files = []
def __init__(self, xml_dir_path):
self.tree_files = {}
self.xml_dir = xml_dir_path
self.__set_files_to_parse()
self.__open_files()
def __open_files(self):
for x in self.files:
self.t... | Python | 0 | @@ -1,12 +1,13 @@
+%EF%BB%BF
import os%0Afr
@@ -33,16 +33,89 @@
inidom%0A%0A
+%0A#To jest reader to konkretnych xmlwoych plik%C3%B3w a nie genertyczny reader%0A
class Re
@@ -181,16 +181,173 @@
r_path):
+ # czy oby na pewno ma on czyta%C4%87 pliki w momencie konstrukcji? Potem te dane sa w ramie przez ca%C5%82y czas... |
11064ab18677755c3900ffb03a553c32e73f03a9 | Fix form field names for transaction billing | hiicart/gateway/braintree/forms.py | hiicart/gateway/braintree/forms.py | import braintree
from datetime import datetime
from django import forms
from django.forms.util import ErrorDict
EXPIRATION_MONTH_CHOICES = [(i, "%02d" % i) for i in range(1, 13)]
EXPIRATION_YEAR_CHOICES = range(datetime.now().year, datetime.now().year + 10)
class _BasePaymentForm(object):
"""
Braintree payme... | Python | 0.000001 | @@ -4307,29 +4307,16 @@
action__
-credit_card__
billing_
|
ccf218eafcabdfc8b9f29075f2d45311c016ae0e | fix region requirement in cli args | stacks/cli.py | stacks/cli.py | import os.path
import configargparse
def parse_options():
'''Handle command-line options
Return parser object and list of arguments
'''
parser = configargparse.ArgumentParser()
parser.add_argument('-p', '--profile', env_var='AWS_DEFAULT_PROFILE', default='default')
parser.add_argument('-r', '... | Python | 0 | @@ -359,27 +359,28 @@
', required=
-Tru
+Fals
e)%0A subpa
|
6b75e8ac365459f98f7752f64ae71e7657b95c38 | allow change of operator even when operator = None | vehicles/forms.py | vehicles/forms.py | import requests
from django import forms
from django.core.exceptions import ValidationError
from django.db.models import Count, Q, Exists, OuterRef
from busstops.models import Operator
from .models import VehicleType, VehicleFeature, Livery
from .fields import RegField
def get_livery_choices(operator):
choices = ... | Python | 0.999264 | @@ -2626,21 +2626,16 @@
ne, user
-=None
, vehicl
@@ -3548,24 +3548,29 @@
vehicle and
+(not
operator and
@@ -3566,19 +3566,18 @@
perator
-and
+or
operato
@@ -3584,16 +3584,17 @@
r.parent
+)
:%0A
@@ -3690,16 +3690,173 @@
'pk')))%0A
+ if operator:%0A operators = Operator.object... |
bbee25c7abaf618ef1db74ab093e87a10737b80f | fix bulk vehicle edit where changes field is falsey | vehicles/utils.py | vehicles/utils.py | from .models import Vehicle, VehicleEdit, VehicleRevision, VehicleType, Livery
def get_vehicle_edit(vehicle, fields, now, request):
edit = VehicleEdit(vehicle=vehicle, datetime=now)
if request.user.is_authenticated:
edit.user = request.user
for field in ('fleet_number', 'reg', 'vehicle_type', 'b... | Python | 0.000001 | @@ -4019,30 +4019,17 @@
rator'%5D%0A
- else:%0A
+%0A
revi
@@ -4075,24 +4075,28 @@
ions if
+str(
revision
.changes
@@ -4087,24 +4087,17 @@
revision
-.changes
+)
%5D%0A%0A r
|
6a52ec759a93636bc3134850e539f684dbfbf3cf | Fix view of projects selection for private share types | manila_ui/dashboards/admin/shares/workflows.py | manila_ui/dashboards/admin/shares/workflows.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 | @@ -2432,33 +2432,22 @@
= %22
-add_project_to_share_type
+update_members
%22%0A%0A
|
fb1a991d5840e261462a5378cfc02e43c0606ad8 | Add try-catch block to Hausa stemming | mediacloud/mediawords/languages/ha/__init__.py | mediacloud/mediawords/languages/ha/__init__.py | import hausastemmer
from typing import List
from mediawords.languages import McLanguageException, SpaceSeparatedWordsMixIn, StopWordsFromFileMixIn
from mediawords.languages.en import EnglishLanguage
from mediawords.util.perl import decode_object_from_bytes_if_needed
from mediawords.util.log import create_logger
log =... | Python | 0 | @@ -1188,53 +1188,286 @@
se:%0A
- stem = hausastemmer.stem(word
+%0A stem = None%0A try:%0A stem = hausastemmer.stem(word)%0A except Exception as ex:%0A # Stemmer fails at certain words%0A log.warning(%... |
4a2aaa2e51e1bf7350e703e3b042fd8c5b6e6a33 | Update utils.py | tendrl/commons/utils/central_store/utils.py | tendrl/commons/utils/central_store/utils.py | import datetime
import etcd
import sys
import time
import thread
from tendrl.commons.utils.central_store import fields
PY_TO_TENDRL_TYPE_MAP = {dict: fields.DictField,
str: fields.StrField,
int: fields.IntField,
bool: fields.StrField,
... | Python | 0.000001 | @@ -738,83 +738,150 @@
-NS._int.wclient = None%0A while not NS._int.wclient:%0A try:%0A
+sys.stderr.write(%22Error connecting to central store (etcd), trying %22%0A %22again...%22)%0A time.sleep(2)%0A NS._int.wclient = None%0A
@@ -929,32 +929,24 @@
tcd_kwargs)%0A
- ... |
c44165ed95fdc6f8d246101a2ca15566738da1f7 | Modify test to ensure that builder inputs with dashes are parsed correctly. | tensorflow_datasets/core/registered_test.py | tensorflow_datasets/core/registered_test.py | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | Python | 0 | @@ -3341,16 +3341,21 @@
er/conf1
+-attr
:1.0.1/k
@@ -3509,16 +3509,21 @@
: %22conf1
+-attr
%22, %22data
|
8d18ab448f8160868df18f4617369517e7a2193f | Modify public names to ignore directories based on regex | scripts/publicNames.py | scripts/publicNames.py | import collections
import os
import six
import subprocess
Tree = lambda: collections.defaultdict(Tree)
EXCLUDE_DIRS = ['test', 'tests', 'plugin_tests']
def addSymbol(symbolScope, symbolTree):
if not symbolScope:
return
addSymbol(
symbolScope[1:],
symbolTree[symbolScope[0]]
)
def... | Python | 0 | @@ -50,16 +50,26 @@
bprocess
+%0Aimport re
%0A%0ATree =
@@ -155,17 +155,78 @@
n_tests'
-%5D
+, '.*egg-info'%5D%0A%0Aexcluder = re.compile(%22%7C%22.join(EXCLUDE_DIRS))
%0A%0Adef ad
@@ -1642,35 +1642,35 @@
and
-subName not in EXCLUDE_DIRS
+not excluder.match(subName)
:%0A
|
57aa29e3fbeb6f0527c6f9ed07edbe8271b19db6 | add dot graph code modified. | bst.py | bst.py | import random
class Leaf(object):
'''Create leaf.'''
def __init__(self, key, left=None, right=None):
self.left = left
self.key = key
self.right = right
class Tree(object):
'''Create tree'''
def __init__(self, root=None):
self.root = root
def _contains(self, key,... | Python | 0 | @@ -180,16 +180,784 @@
right%0A%0A
+ def _get_dot(self):%0A %22%22%22recursively prepare a dot graph entry for this node.%22%22%22%0A if self.left is not None:%0A yield %22%5Ct%25s -%3E %25s;%22 %25 (self.key, self.left.key)%0A for i in self.left._get_dot():%0A yi... |
290a1f7a2c6860ec57bdb74b9c97207e93e611f0 | Add option to visualize data in reverse | visualize_data.py | visualize_data.py | from __future__ import division
import argparse
import cv2
import h5py
import util
def main():
parser = argparse.ArgumentParser()
parser.add_argument('hdf5_fname', type=str)
parser.add_argument('--vis_scale', '-r', type=int, default=10, metavar='R', help='rescale image by R for visualization')
args =... | Python | 0.000205 | @@ -301,16 +301,74 @@
zation')
+%0A parser.add_argument('--reverse', action='store_true')
%0A%0A ar
@@ -460,46 +460,16 @@
-for image_curr, vel, image_diff in zip
+dsets =
(hdf
@@ -532,16 +532,156 @@
_diff'%5D)
+%0A if args.reverse:%0A dsets = tuple(dset%5B()%5D%5B::-1%5D for dset in d... |
5f640ec134c52d946a594093b3d549681218b7fd | Revert "direct INFO to stdout, WARNING and ERROR to stderr" | submission.py | submission.py | import sys
import xlrd
import json
import argparse
import logging
import unittest
import metastructure
import sheetreader
import poster
import validator
import bookdata
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--excel',
'-x',
action="store",
de... | Python | 0 | @@ -2981,18 +2981,16 @@
BUG)%0A
- #
else:%0A
@@ -2987,26 +2987,24 @@
else:%0A
- #
logging
@@ -3089,26 +3089,24 @@
n level.%0A
- #
logging
|
bf9bff4aa6367f0af62db2d102f110f30409c585 | Test token scope methods | tests/cases/token_test.py | tests/cases/token_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013, 2014 Kitware 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... | Python | 0.000001 | @@ -844,35 +844,128 @@
der.
-models.token import genToke
+constants import TokenScope%0Afrom girder.models.token import genToken%0Afrom girder.models.model_base import AccessExceptio
n%0A%0A%0A
@@ -3020,28 +3020,775 @@
elf.assertStatus(resp, 401)%0A
+%0A def testHasScope(self):%0A scope = TokenScope.DATA_R... |
fba448252550e806e7c641c37a42f41a1cca92f1 | Remove unneccasry print | swg_python.py | swg_python.py | import json
import yaml
import io
import os
class SwgParser:
"""
SwgParser is a simple parser that extracts the Swagger API documentation throughout the given folders. The Swagger documentation must be written in
YAML format. The specification is the same as the Swagger specification except a few details.... | Python | 0.000021 | @@ -2216,34 +2216,8 @@
rs:%0A
- print(folder)%0A
|
e214cd39396489c35c36b9e06ba4edb0f426181d | Use a sleep of 0.01s longer than what we're testing for | tests/core/test_timers.py | tests/core/test_timers.py | # Module: test_timers
# Date: 10th February 2010
# Author: James Mills, prologic at shortcircuit dot net dot au
"""Timers Tests"""
from time import sleep
from circuits import Event, Component, Timer
class Test(Event):
"""Test Event"""
class App(Component):
flag = False
def timer(self):
... | Python | 0 | @@ -457,29 +457,10 @@
(0.1
+1
)
-%0A while app: pass
%0A
@@ -629,33 +629,10 @@
(0.1
+1
)
-%0A while app: pass
%0A
|
6468b28b57e808e799df08ad21cbe8655d20b679 | fix cause | testlog_etl/transforms/pulse_block_to_es.py | testlog_etl/transforms/pulse_block_to_es.py | # encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __fu... | Python | 0.000001 | @@ -560,16 +560,26 @@
coalesce
+, listwrap
%0Afrom py
@@ -6571,21 +6571,28 @@
e =
-e.caus
+listwrap(
e.cause
+)%5B0%5D
%0A
@@ -6609,16 +6609,20 @@
og.note(
+caus
e.templa
@@ -6631,16 +6631,20 @@
, param=
+caus
e.param)
|
d62588af4e8ee547308d87e95a867581c28e8d03 | add example plist | tests/featureWriters/featureWriters_test.py | tests/featureWriters/featureWriters_test.py | from __future__ import (
print_function,
absolute_import,
division,
unicode_literals,
)
from ufo2ft.featureWriters import (
BaseFeatureWriter,
FEATURE_WRITERS_KEY,
loadFeatureWriters,
loadFeatureWriterFromString,
)
import pytest
from ..testSupport import _TempModule
class FooBarWriter... | Python | 0 | @@ -245,60 +245,650 @@
,%0A)%0A
-import pytest%0Afrom ..testSupport import _TempModule%0A
+%0Atry:%0A from plistlib import loads, FMT_XML%0A def readPlistFromString(s):%0A return loads(s, fmt=FMT_XML)%0Aexcept ImportError:%0A from plistlib import readPlistFromString%0A%0Aimport pytest%0Afrom ..testSupp... |
bf6d6cdaf946af7ce8d1aa6831e7da9b47fef54f | Put import back on top | user_deletion/managers.py | user_deletion/managers.py | from dateutil.relativedelta import relativedelta
from django.utils import timezone
class UserDeletionManagerMixin:
def users_to_notify(self):
"""Finds all users who have been inactive and not yet notified."""
from django.apps import apps
user_deletion_config = apps.get_app_config('user_de... | Python | 0 | @@ -42,16 +42,45 @@
vedelta%0A
+from django.apps import apps%0A
from dja
@@ -249,46 +249,8 @@
%22%22%22%0A
- from django.apps import apps%0A%0A
@@ -614,46 +614,8 @@
%22%22%22%0A
- from django.apps import apps%0A%0A
|
d34091604d0b4329a5ff9dfc80f62ab31dc085c8 | allow test command to test everything in one run | tasks/test.py | tasks/test.py | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from __future__ import print_function, unicode_literals
import os
import sys
from invoke import task
from invoke.exceptions import Exit
from .constants import AGENT_BASED_INTEGRATIONS, ROOT, TESTABLE_FILE_EXTENSI... | Python | 0.000001 | @@ -888,32 +888,39 @@
, target, bench,
+ every,
dry_run):%0A %22
@@ -1143,32 +1143,227 @@
)%0A else:%0A
+ if every:%0A sys.stdout.write('%5CnRunning tox in %60%7B%7D%60...%5Cn'.format(target))%0A ctx.run('tox')%0A sys.stdout.write('Ok.%5Cn')%0A ... |
8d0e16041a24f4526ac35aaad1c2f16e601236b1 | simplify import for ViewItem | tools/tcam-capture/tcam_capture/ViewItem.py | tools/tcam-capture/tcam_capture/ViewItem.py | # Copyright 2018 The Imaging Source Europe GmbH
#
# 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 ... | Python | 0.000001 | @@ -598,153 +598,27 @@
yQt5
- import QtGui, QtWidgets%0Afrom PyQt5.QtWidgets import (QAction, QMenu, QGraphicsView,%0A QGraphicsItem, QGraphicsScene,
+.QtWidgets import (
QGra
@@ -652,12 +652,11 @@
5.Qt
-Core
+Gui
imp
@@ -664,46 +664,13 @@
rt Q
-Object, pyqtSignal, Qt, QEvent, QSizeF
... |
2fae2d594f3cdf59b0a4be231c6b5c62351ee647 | Add match() test for operators | tests/test_aggregation.py | tests/test_aggregation.py | """Tests of the aggregation module."""
try:
import unittest2 as unittest
except ImportError:
import unittest
import mock
from simon import Model, aggregation
from .utils import ModelFactory
MappedModel = ModelFactory('MappedModel', field_map={'fake': 'real'})
MapNestedModel = ModelFactory('MapNestedModel',... | Python | 0.000001 | @@ -1997,32 +1997,252 @@
h, %7B'a.b': 1%7D)%0A%0A
+ def test_match_operator(self):%0A %22%22%22Test the %60match()%60 method with a comparison operator.%22%22%22%0A%0A p = aggregation.Pipeline()%0A p.match(a__gt=1)%0A%0A self.assertEqual(p._match, %7B'a': %7B'$gt': 1%7D%7D)%0A%0A
de... |
9b597d7c5077cfbf8bd00e5e79bedadc483b708e | add blank line to conform to code formatting conventions | tests/test_conversions.py | tests/test_conversions.py | from io import BytesIO
from isaw.awib.conversions import MasterMaker
import logging
from nose.tools import assert_equal
from os import listdir, mkdir
from os.path import abspath, dirname, isfile, join, realpath, splitext
from PIL import Image
from PIL.ImageCms import getOpenProfile, getProfileName
from PIL.ImageStat im... | Python | 0.000001 | @@ -367,16 +367,17 @@
T = 10%0A%0A
+%0A
class Te
|
afd0ec4501963dcf0b65858ab075c577d4aec216 | stop leaving stuff in disk | tests/test_integration.py | tests/test_integration.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import codecs
from contextlib import contextmanager
import locale
import os
import shutil
import tempfile
import unittest
import mock
import lxml.html
from context import nikola
from nikola import main
@contextmanager
def cd(path):
... | Python | 0 | @@ -1834,17 +1834,16 @@
-#
shutil.r
|
3d8d6f906f8adcf60a8e91f2962f2756789581a7 | update test_mesh_expand.py for pytest | tests/test_mesh_expand.py | tests/test_mesh_expand.py | from __future__ import absolute_import
from sfepy.base.testing import TestCommon
class Test(TestCommon):
@staticmethod
def from_conf(conf, options):
test = Test(conf=conf, options=options)
return test
def test_mesh_expand(self):
import numpy as nm
from sfepy.mesh.mesh_tool... | Python | 0.000001 | @@ -1,236 +1,4 @@
-from __future__ import absolute_import%0Afrom sfepy.base.testing import TestCommon%0A%0Aclass Test(TestCommon):%0A%0A @staticmethod%0A def from_conf(conf, options):%0A test = Test(conf=conf, options=options)%0A return test%0A%0A
def
@@ -18,19 +18,11 @@
and(
-self):%0A
+... |
3ffd450209198abf88d15d1bdb72bc29ffe833d1 | Fix unrelated test failure, presumably with a newer numpy version | tests/test_periodogram.py | tests/test_periodogram.py | """
Tests for periodogram module.
"""
from __future__ import (absolute_import, division, print_function)
import numpy as np
import utide.periodogram as pgram
def random_ts(ndays, dt_hours, complex=True):
"""Returns t (time in days) and x (random series)."""
np.random.seed(1)
npts = ndays * 24 / dt_hours... | Python | 0.000009 | @@ -292,16 +292,20 @@
npts =
+int(
ndays *
@@ -317,16 +317,17 @@
dt_hours
+)
%0A if
|
287389927050c6cc32cab0d572ad8c9931fe922e | Remove some optional middleware from the testsuite | tests/testapp/settings.py | tests/testapp/settings.py | import os
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.staticfiles',
'django.contri... | Python | 0.000001 | @@ -1208,61 +1208,8 @@
= %5B%0A
- 'django.middleware.security.SecurityMiddleware',%0A
@@ -1538,70 +1538,8 @@
e',%0A
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',%0A
%5D%0A#
|
6833b16e2125d2068f57eb4097237d084245cf0e | Add another test | tests/unit/test_parser.py | tests/unit/test_parser.py | """
Unit tests for the lexer
"""
from pypred import parser, ast
class TestParser(object):
def assert_nodes(self, inp, exp_nodes):
lexer = parser.get_lexer()
p = parser.get_parser()
res = p.parse(inp, lexer=lexer)
assert isinstance(res, ast.Node)
# Do a pre-order traversal
... | Python | 0.000035 | @@ -450,24 +450,25 @@
es%5D%0A
+#
assert len(n
@@ -1859,20 +1859,671 @@
_wins%22,%0A %5D)%0A%0A
+ def test_server_parse(self):%0A inp ='server matches %22east-web-(%5B%5Cd%5D+)%22 and errors contains %22CPU load%22 and environment != test'%0A self.assert_nodes(inp, %5B%0A%22LogicalOpe... |
8f6882d217c40d82f9d5bca29c00631d64fd1d21 | Add EagerTensor to Tensor type. | tf_agents/typing/types.py | tf_agents/typing/types.py | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Python | 0.000197 | @@ -965,16 +965,174 @@
y as tfp
+%0A# pylint:disable=g-direct-tensorflow-import%0Afrom tensorflow.python.framework.ops import EagerTensor # TF internal%0A# pylint:enable=g-direct-tensorflow-import
%0A%0Aif sys
@@ -1711,16 +1711,29 @@
edTensor
+, EagerTensor
%5D%0AArray
|
263a7ed26f0899bb874da303c25810f1e56218cb | Clean up template value passing | waypointviewer.py | waypointviewer.py | # waypointviewer.py Waypoint Viewer Google Maps/Google AppEngine application
# Copyright (C) 2011 Tom Payne
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versi... | Python | 0 | @@ -1454,76 +1454,80 @@
-url = self.request.get('url')%0A template_values = %7B'url': url%7D
+template_values = dict((key, self.request.get(key)) for key in ('url',))
%0A
|
4b458427bc09863c2a53162e4900310e8504d0c9 | Use debug variable | waypointviewer.py | waypointviewer.py | # waypointviewer.py Waypoint Viewer Google Maps/Google AppEngine application
# Copyright (C) 2011 Tom Payne
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versi... | Python | 0.000002 | @@ -3181,33 +3181,13 @@
if
-self.request.get('
debug
-')
:%0A
|
32ae4df3ace7c7f44ed9f7c55d144c43e55f2c4b | Fix build for third_party/qcms when SSE is diabled. | third_party/qcms/qcms.gyp | third_party/qcms/qcms.gyp | # Copyright (c) 2010 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.
{
'targets': [
{
'target_name': 'qcms',
'product_name': 'qcms',
'type': '<(library)',
'sources': [
'qcms.h',
... | Python | 0.000001 | @@ -558,16 +558,257 @@
%7D,%0A
+ 'conditions': %5B%0A %5B'OS==%22linux%22 and (branding==%22Chrome%22 or disable_sse2==1)', %7B%0A 'sources/': %5B%0A %5B'exclude', 'transform-sse1.c'%5D,%0A %5B'exclude', 'transform-sse2.c'%5D,%0A %5D,%0A %7D,%5D,%0A ... |
661c447ba216568ed665fc07ec4a7846bc25bfed | Add label column for dates, fixes #19. | spendb/etl/extract.py | spendb/etl/extract.py | import logging
import random
from decimal import Decimal
from datetime import datetime, date
from loadkit.operators.table import resource_row_set
from loadkit.operators.table import generate_field_spec
log = logging.getLogger(__name__)
def date_field(name, section):
return '%s__%s' % (name, section)
def field... | Python | 0 | @@ -806,16 +806,215 @@
%7D%0A
+ name = date_field(field%5B'name'%5D, 'label')%0A spec%5Bname%5D = %7B%0A 'name': name,%0A 'type': 'string',%0A 'title': field%5B'title'%5D%0A %7D%0A
@@ -1762,24 +1762,30 @@
None, None,
+ None... |
ef86938c1f97d4f577ab45557848e55fc058b44e | Fix tests | autostew_back/tests/unit/test_api_connector.py | autostew_back/tests/unit/test_api_connector.py | from unittest import mock
from unittest.mock import Mock
import requests
from django.test import TestCase
from autostew_back.ds_api.api_connector import ApiConnector
from autostew_web_enums.models import DamageDefinition
simple_translation = [
{'model_field': 'practice1_length', 'api_field': 'Practice1Length'}
]... | Python | 0.000003 | @@ -1607,33 +1607,10 @@
foo'
-, 'copy_to_next': False
%7D%0A
+
@@ -2507,39 +2507,16 @@
Type': 2
-, 'copy_to_next': False
%7D%0A
@@ -3941,39 +3941,16 @@
lags': 0
-, 'copy_to_next': False
%7D%0A
@@ -4381,39 +4381,16 @@
lags': 1
-, 'copy_to_next': False
%7D%0A
@@ -4782,32 +4782,32 @@
et_at... |
bd0f14fd56680ef0b81536cc3267d6f92428ad1a | Fix bug (thanks to JP Dutrève) | modules/hellobank/perso/accounts_list.py | modules/hellobank/perso/accounts_list.py | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Christophe Lampin
# Copyright(C) 2009-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either ... | Python | 0 | @@ -1968,32 +1968,36 @@
lance = Decimal(
+str(
compte%5B'soldeDis
@@ -2001,16 +2001,17 @@
Dispo'%5D)
+)
%0A
@@ -2044,16 +2044,20 @@
Decimal(
+str(
compte%5B'
@@ -2070,16 +2070,17 @@
Venir'%5D)
+)
%0A
|
4926502cc3b7f18aa9c471f9a78e64ad4e1937fa | Fix src/trusted/validator_ragel/PRESUBMIT.py | src/trusted/validator_ragel/PRESUBMIT.py | src/trusted/validator_ragel/PRESUBMIT.py | # Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Documentation on PRESUBMIT.py can be found at:
# http://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
import json
import hashl... | Python | 0.01784 | @@ -3028,24 +3028,26 @@
12)))%0A
+
need_dfachec
|
88e56a74e85f46290966cd881d2a84b08f9c975e | Fix children bug | pycuber/ext/solvers/cfop/f2l.py | pycuber/ext/solvers/cfop/f2l.py | """
Module for solving Rubik's Cube F2L.
"""
from ....cube import *
from ....algorithm import *
from ....util import a_star_search
class F2LPairSolver(object):
"""
F2LPairSolver() => Solver for solving an F2L pair.
"""
def __init__(self, cube=None, pair=None):
self.cube = cube
self.pai... | Python | 0.000003 | @@ -752,16 +752,23 @@
children
+.copy()
%0A
@@ -1031,16 +1031,17 @@
ge)%5B0%5D)%0A
+%0A
|
6a767780253ef981e78b00bb9937e9aaa0f9d1b8 | Add sleep after nickserv identify | motobot/core_plugins/network_handlers.py | motobot/core_plugins/network_handlers.py | from motobot import hook
from time import sleep
@hook('PING')
def handle_ping(bot, context, message):
""" Handle the server's pings. """
bot.send('PONG :' + message.params[-1])
@hook('439')
def handle_wait(bot, context, message):
""" Handles too fast for server message and waits 1 second. """
bot.id... | Python | 0.000001 | @@ -911,16 +911,33 @@
ssword)%0A
+ sleep(1)%0A
%0A%0A@hook(
|
68832a3638029713b59f8a462b96e797ce754c72 | Add docstrings to Singleton methods | pyexperiment/utils/Singleton.py | pyexperiment/utils/Singleton.py | """Implements a singleton base-class (as in tornado.ioloop.IOLoop.instance())
Written by Peter Duerr (inspired by tornado's implementation)
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import threading
class ... | Python | 0.000001 | @@ -488,32 +488,82 @@
_instance(cls):%0A
+ %22%22%22Get the singleton instance%0A %22%22%22%0A
if not c
@@ -807,32 +807,75 @@
_instance(cls):%0A
+ %22%22%22Reset the singleton%0A %22%22%22%0A
if cls._
|
1a9122d59be0c351b14c174a60880c2e927e6168 | Fix failing host name test and add wildcard tests | lib/tests/test_interface.py | lib/tests/test_interface.py | import unittest
from .. import interface
class TestInterface(unittest.TestCase):
def test_match_host_name(self):
self.assertTrue(interface._match_hostname('asd.fgh.com', 'asd.fgh.com'))
self.assertFalse(interface._match_hostname('asd.fgh.com', 'asd.zxc.com'))
self.assertTrue(interface._m... | Python | 0 | @@ -871,17 +871,17 @@
tName':
-%5B
+(
('DNS',
@@ -886,33 +886,34 @@
, 'foo.bar.com')
-%5D
+,)
%7D,%0A n
@@ -1009,63 +1009,651 @@
ject
+AltName
':
-%5B('commonName', 'foo.bar.com')%5D%7D,%0A name='
+(('DNS', '*.bar.com'),)%7D,%0A name='foo.bar.com'))%0A self.assertFalse(i... |
53167d797daae81488c7341810194f3e6b99c064 | Make sure eif_location is passed on to PostPerfectPublication when doing a silent correction | activity/activity_PublishToLax.py | activity/activity_PublishToLax.py | import activity
import json
from provider.execution_context import Session
import boto.sqs
from boto.sqs.message import RawMessage
import provider.lax_provider as lax_provider
import base64
"""
activity_PublishToLax.py activity
"""
class activity_PublishToLax(activity.activity):
def __init__(self, settings, logg... | Python | 0 | @@ -3507,16 +3507,735 @@
ow_data%0A
+%0A # added this block because when doing silent corrections we will not have the opportunity to get the data from%0A # the previous workflow (PreparePostEIF sets the data and when in silent corrections it is part of the same%0A # workflow) currently we cannot ... |
d7d16f5c154b1c135e4eede78338022307bc720d | Fix bug in zhengzhou jiesuan parameter | options/script/zzjiesuan_parameter.py | options/script/zzjiesuan_parameter.py | #!/usr/bin/python
# coding: utf-8
import sys
import urllib2
import time
from datetime import datetime
from bs4 import BeautifulSoup
TODAY=datetime.today().strftime('%Y%m%d')
IMPORTANT='20101008'
def getDataOnDate(ts):
t=0;
alldata=[]
while True:
time.sleep(3)
try:
if ts>=IMPORTANT:
print 'http://www.czc... | Python | 0 | @@ -374,32 +374,33 @@
aClearParams.htm
+?
'%25(ts%5B:4%5D,ts)%0A%09%09
@@ -413,32 +413,48 @@
urllib2.urlopen(
+urllib2.Request(
'http://www.czce
@@ -531,24 +531,25 @@
(ts%5B:4%5D,ts))
+)
%0A%09%09%09else:%0A%09%09
@@ -808,16 +808,52 @@
utf-8')%0A
+ return soup%0A
%09%09%09for i
|
832951d57a76d106db485c9a3469870713759ba5 | Fix ID of previous migration in comment | blazar/db/migration/alembic_migrations/versions/e069c014356d_add_floatingip.py | blazar/db/migration/alembic_migrations/versions/e069c014356d_add_floatingip.py | # Copyright 2019 OpenStack Foundation.
#
# 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.000007 | @@ -638,20 +638,20 @@
es:
-35b314cd39ee
+9593f3656974
%0ACre
|
c2d3c2c471dfb504626509a34256eb2d9898cfa2 | Fix to use get_serializer_class method instead of serializer_class | rest_framework_nested/viewsets.py | rest_framework_nested/viewsets.py | class NestedViewSetMixin(object):
def get_queryset(self):
"""
Filter the `QuerySet` based on its parents as defined in the
`serializer_class.parent_lookup_kwargs`.
"""
queryset = super(NestedViewSetMixin, self).get_queryset()
if hasattr(self.serializer_class, 'parent_... | Python | 0.000001 | @@ -263,16 +263,71 @@
ryset()%0A
+ serializer_class = self.get_serializer_class()%0A
@@ -337,21 +337,16 @@
hasattr(
-self.
serializ
@@ -452,21 +452,16 @@
name in
-self.
serializ
|
a1918e97da071d826b7393eff21e4fa6168dc294 | Spw needs to be a str | 17B-162/imaging/transform_and_uvsub.py | 17B-162/imaging/transform_and_uvsub.py |
'''
Split out each SPW from the combined MS (concat_and_split.py), convert
to LSRK, and subtract continuum in uv-plane
'''
import os
from tasks import mstransform
myvis = '17B-162_lines.ms'
# Load in the SPW dict in the repo on cedar
execfile(os.path.expanduser("~/code/VLA_Lband/17B-162/spw_setup.py"))
for spw_nu... | Python | 0.999457 | @@ -674,23 +674,28 @@
is, spw=
+str(
spw_num
+)
, dataco
|
c6790535ea1e49ec65c4926f997db746d9b0833b | use common board mode | klimalogger/sensor/sht1x_sensor.py | klimalogger/sensor/sht1x_sensor.py | # -*- coding: utf8 -*-
from injector import singleton, inject
try:
import configparser
except ImportError:
import configparser as configparser
from sht1x.Sht1x import Sht1x as SHT1x
@singleton
class Sensor:
name = "SHT1x"
@inject
def __init__(self, config_parser: configparser.ConfigParser):
... | Python | 0.000001 | @@ -536,12 +536,10 @@
IO_B
-OARD
+CM
)%0A%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.