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 |
|---|---|---|---|---|---|---|---|
3495bc44c4c961bd0edf55fd8ce4a8f58986e449 | include a context argument | scripts/debug_emr_logs.py | scripts/debug_emr_logs.py | import argparse
import gzip
import os
import re
import shutil
import boto.emr
from subprocess import Popen, PIPE
DEFAULT_REGION = 'us-east-1'
def main():
arg_parser = argparse.ArgumentParser(description='Get Traceback information from emr-logs.')
arg_parser.add_argument(
'-b', '--bucket-name',
... | Python | 0.001063 | @@ -9,16 +9,46 @@
rgparse%0A
+from collections import deque%0A
import g
@@ -996,16 +996,167 @@
.'%0A )
+%0A arg_parser.add_argument(%0A '-n', '--context',%0A type=int,%0A help='Number of lines of the log to include before the error.'%0A )
%0A%0A ar
@@ -1973,24 +1973,38 @@
.output_p... |
d5cfb00c7d70853fd6ba3c2f5091defce13afaa2 | Fix ps_calcs hedu dependency | scripts/hedu/_calc_rca.py | scripts/hedu/_calc_rca.py | import sys, os
import pandas as pd
import numpy as np
ps_calcs_lib_path = os.path.abspath(os.path.join(file_path, "../../", "lib/ps_calcs"))
sys.path.insert(0, ps_calcs_lib_path)
import ps_calcs
def calc_rca(ybuc, year):
ybc = ybuc.groupby(level=["year", "bra_id", "course_hedu_id"]).sum()
ybc = ybc[["enrolle... | Python | 0.000001 | @@ -48,16 +48,72 @@
as np%0A%0A
+file_path = os.path.dirname(os.path.realpath(__file__))%0A
ps_calcs
|
c26addafc49e89cc03ad86bb0994070b9ba1c576 | Update crossmatch.py | flexget/plugins/filter/crossmatch.py | flexget/plugins/filter/crossmatch.py | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('crossmatch')
class CrossMatch(object):
"""
Perform action based on... | Python | 0.000004 | @@ -2459,17 +2459,20 @@
exact',
-1
+True
))%0A
|
1691b7dfac125c2076de03da1c7932078958152d | Move manipulate event segregation to feed_start from process_start. | flexget/plugins/module_manipulate.py | flexget/plugins/module_manipulate.py | import logging
import re
from flexget.plugin import priority, register_plugin
log = logging.getLogger('manipulate')
class Manipulate(object):
"""
Usage:
manipulate:
- <destination field>:
[event]: <event>
[from]: <source field>
[extract... | Python | 0.000059 | @@ -1312,23 +1312,20 @@
def on_
-process
+feed
_start(s
|
25e673d205c060671ef8011db3671900568748fe | Make test_vcf_parser.py independent of bootstrap_data.py. | genome_designer/scripts/tests/test_vcf_parser.py | genome_designer/scripts/tests/test_vcf_parser.py | """
Tests for vcf_parser.py
"""
import os
from django.test import TestCase
import vcf
from main.models import AlignmentGroup
from main.models import Dataset
from main.models import ExperimentSample
from main.models import Project
from main.models import Variant
from main.models import VariantCallerCommonData
from sc... | Python | 0.000002 | @@ -37,16 +37,60 @@
ort os%0A%0A
+from django.contrib.auth.models import User%0A
from dja
@@ -114,16 +114,16 @@
estCase%0A
-
import v
@@ -354,63 +354,8 @@
ata%0A
-from scripts.bootstrap_data import bootstrap_fake_data%0A
from
@@ -576,16 +576,117 @@
D_ROOT%0A%0A
+TEST_USERNAME = 'gmcdev'%0ATEST_PASSWORD = 'g3n3d3... |
0282c7ffc43c5330da27515a42a3392dfa20c57e | Add Universe Test | room_calendar/tests.py | room_calendar/tests.py | from django.test import TestCase
# Create your tests here.
| Python | 0.000001 | @@ -26,17 +26,16 @@
estCase%0A
-%0A
# Create
@@ -52,8 +52,46 @@
s here.%0A
+%0Adef test_answer():%0A assert 1 == 1%0A
|
10ba49915b287ad0238575b7d605390ef85e37ec | Add experimental flag | msmbuilder/decomposition/sparsetica.py | msmbuilder/decomposition/sparsetica.py | # Author: Robert McGibbon <rmcgibbo@gmail.com>
# Contributors:
# Copyright (c) 2014, Stanford University
# All rights reserved.
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import... | Python | 0.000001 | @@ -438,16 +438,49 @@
rt tICA%0A
+from ..utils import experimental%0A
from .sp
@@ -4744,24 +4744,56 @@
= verbose%0A%0A
+ @experimental('SparseTICA')%0A
def _sol
|
75b2a861f6585580f7244c4eb8d112a4548e32a5 | Add force_tuple argument | chainer/functions/array/transpose_sequence.py | chainer/functions/array/transpose_sequence.py | import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
def _transpose(xs):
xp = cuda.get_array_module(*xs)
lengths = numpy.zeros(len(xs[0]), dtype='i')
for i, x in enumerate(xs):
lengths[0:len(x)] = i + 1
dtype = xs[0].dtype
unit = xs[0].sh... | Python | 0.0088 | @@ -968,24 +968,39 @@
nce(
-*
xs
+, force_tuple=True
):%0A
-return
+ys =
Tra
@@ -1017,12 +1017,95 @@
ence()(*xs)%0A
+ if force_tuple and not isinstance(ys, tuple):%0A ys = (ys,)%0A return ys%0A
|
51134c8136bf799a5d6745a53f6f4b97d72d3e57 | Update API_VERSION = '48.0' | salesforce/__init__.py | salesforce/__init__.py | # django-salesforce
#
# by Phil Christensen
# (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org)
# See LICENSE.md for details
#
"""
A database backend for the Django ORM.
Allows access to all Salesforce objects accessible via the SOQL API.
"""
import logging
from salesforce.dbapi.exceptions import ( ... | Python | 0.000003 | @@ -916,22 +916,22 @@
= '4
-7
+8
.0' #
-Winter
+Spring
'20
|
932854849299b19264eb6ba47ac65e87a604a5eb | add import of missing AuthError | nipap-www/nipapwww/controllers/auth.py | nipap-www/nipapwww/controllers/auth.py | import logging
from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from nipapwww.lib.base import BaseController, render
from nipap.authlib import AuthFactory
from nipap.nipapconfig import NipapConfig
from ConfigParser import NoOptionError
log = ... | Python | 0 | @@ -223,16 +223,27 @@
hFactory
+, AuthError
%0Afrom ni
|
0e44cae365259a7c1285f9e918ba5cf789a00def | Refactor tests for MM1EventHandler. | simulator/tests/mm1.py | simulator/tests/mm1.py | #!/usr/bin/env python
# encoding: utf-8
import numpy as np
from simulator.modules.mm1 import *
from simulator.modules.sim import SimulationEngine, Event
class MM1EventHandlerTests(unittest.TestCase):
def setUp(self):
sim = SimulationEngine()
self.seed = 0
sim.prng = np.random.RandomState(self.seed)
... | Python | 0 | @@ -248,26 +248,8 @@
e()%0A
- self.seed = 0%0A
@@ -277,33 +277,25 @@
RandomState(
-self.seed
+0
)%0A self.e
@@ -656,75 +656,8 @@
f):%0A
- self.eh.interarrival_rate = 0.2%0A self.eh.service_rate = 0.5%0A
@@ -702,17 +702,18 @@
rate, 0.
-2
+05
)%0A se
@@ -751,17 +751,17 @@
rate, 0.
-5
+1
... |
346582df1eda50a7f120871c9b010971997480fe | Add full version number in nxdrive package | nuxeo-drive-client/nxdrive/__init__.py | nuxeo-drive-client/nxdrive/__init__.py | __version__ = '1-dev'
| Python | 0 | @@ -15,8 +15,46 @@
'1-dev'%0A
+FULL_VERSION = '1.2.0-' + __version__%0A
|
b04975af2e1f3fe1d21c18fac239da338cb85027 | Improve __init__ | subliminal/__init__.py | subliminal/__init__.py | # -*- coding: utf-8 -*-
#
# Subliminal - Subtitles, faster than your thoughts
# Copyright (c) 2011 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of Subliminal.
#
# Subliminal is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published b... | Python | 0.000038 | @@ -825,201 +825,58 @@
.%0A#%0A
-%0A%0Afrom infos import *%0Afrom languages import *%0Afrom utils import *%0Afrom exceptions import *%0Afrom videos import *%0Afrom tasks import *%0Afrom subtitles import *%0Afrom core import *%0Afrom plugins import *
+__all__ = %5B'Subliminal'%5D%0A%0Afrom core import Subliminal
%0A
|
b3d9c38828f4929f30c7d71122910b8eca65aa6a | Add save roi to MultiKymographBuilder.py | plugins/Scripts/Plugins/MultiKymographBuilder.py | plugins/Scripts/Plugins/MultiKymographBuilder.py | # @Context context
# @Dataset dataset
# @ImageJ ij
# @LogService log
# @DatasetIOService io
import os
from ij.plugin.frame import RoiManager
import fiji.plugin.kymographbuilder.KymographFactory as KFactory
from java.io import File
rm = RoiManager.getInstance()
counter = 0
parent_folder = File(dataset.getSource()).g... | Python | 0 | @@ -324,16 +324,19 @@
arent()%0A
+%22%22%22
%0Afor roi
@@ -709,16 +709,140 @@
%22.tif%22)
+%22%22%22%0A%0Aroi_path = os.path.join(parent_folder, os.path.splitext(dataset.getName())%5B0%5D + %22.zip%22)%0Arm.runCommand(%22Save%22, roi_path)
%0A%0Alog.in
|
845cffa14f4d2846aec04526f430e59038f6c12f | enable disable test | _unittests/ut_helpgen/test_notebooks_bug_svg.py | _unittests/ut_helpgen/test_notebooks_bug_svg.py | """
@brief test log(time=30s)
@author Xavier Dupre
"""
import sys
import os
import unittest
import re
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
".."... | Python | 0.000001 | @@ -708,17 +708,16 @@
def
-_
test_not
|
06b5ad5f2e83302bdff3d9c902c206cab59f5353 | Fix typos | openslides/utils/auth/AnonymousAuth.py | openslides/utils/auth/AnonymousAuth.py | from django.contrib.auth.models import Permission
from openslides.config.api import config
class AnonymousAuth(object):
"""
Authenticates the AnonymousUser against the Permission-Group 'Anonymous'.
No rights are granted unless the group is defined and contains them.
"""
supports_anonymous_user = ... | Python | 0.999999 | @@ -724,17 +724,16 @@
is gran
-e
ted by h
@@ -1386,16 +1386,17 @@
luding g
+r
oup perm
|
5805a676d2b76abd2d355419ee320c95360a3cb2 | Update fingerprint.py | dejavu/fingerprint.py | dejavu/fingerprint.py | import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import (generate_binary_structure,
iterate_structure, binary_erosion)
import hashlib
IDX_FREQ_I = 0
IDX_TIME_J = 1
DEF... | Python | 0.000002 | @@ -3069,68 +3069,8 @@
rs%0A%0A
- fingerprinted = set() # to avoid rehashing same pairs%0A%0A
|
fc99b2c51c2d33e7aed09d2726a69b364f7712e2 | Upgrade to Pillow>=3 api | demo/image_blender.py | demo/image_blender.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2006-2012 Filip Wasilewski <http://en.ig.ma/>
# See COPYING for license details.
"""
Wavelet Image Blender.
Blend image A with texture extracted from image B by selecting
detail coefficients:
----------------- -----------------
| ... | Python | 0 | @@ -1807,22 +1807,21 @@
image.to
-string
+bytes
(), nump
@@ -2187,22 +2187,21 @@
age.from
-string
+bytes
(mode, a
@@ -2223,22 +2223,21 @@
, arr.to
-string
+bytes
())%0A%0A%0Ade
|
5471b60fae5919195d24ce0c6780c1902e88509f | Make 3-bits more obvious. | functional_tests/test_curve_curve.py | functional_tests/test_curve_curve.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
# distributed under th... | Python | 0.000001 | @@ -1995,18 +1995,23 @@
sa_err %3C
- 8
+= 0b111
%0A%0A%0Adef c
|
c9cf7d4027fc16b9c54fb5e214463c5a705191db | Update App Catalog dead link checker | jenkins/scripts/check_app_catalog_yaml.py | jenkins/scripts/check_app_catalog_yaml.py | #! /usr/bin/env python
#
# Copyright (c) 2015 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
#
# U... | Python | 0.000004 | @@ -1,11 +1,10 @@
#!
-
/usr/bin
@@ -21,73 +21,8 @@
n%0A#%0A
-# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.%0A#%0A
# Li
@@ -623,2947 +623,61 @@
l%0A%0A%0A
-from collections import OrderedDict%0A%0A%0Adef project_representer(dumper, data):%0A return dumper.represent_mapping('tag:yaml.org,2002:ma... |
0780681656c26ddc04b7987db9d1c21c66160395 | add sliver keys to resctl configuration | plugins/omf_resctl.py | plugins/omf_resctl.py | #
# $Id$
# $URL$
#
# NodeManager plugin - first step of handling omf_controlled slices
"""
Overwrites the 'resctl' tag of slivers controlled by OMF so slivermanager.py does the right thing
"""
import os
import glob
import subprocess
import tools
import logger
priority = 50
def start():
logger.log("omf_resctl: ... | Python | 0 | @@ -1146,16 +1146,155 @@
'name'%5D%0A
+ sliver_pub_key_dir=os.path.join(%22/home%22, name, %22.ssh/%22)%0A sliver_private_key=os.path.join(sliver_pub_key_dir, %22.ssh/id_rsa%22)%0A
@@ -2427,16 +2427,170 @@
@',name)
+%5C%0A .replace('@SLIVER_PRIVATE_KEY@',sliver_private_k... |
619a3ab61e6c34d4cee2d822724629a196297dc3 | make log line easier to read | algoliahelper/algoliahelper.py | algoliahelper/algoliahelper.py | from algoliasearch import algoliasearch
class AlgoliaHelper(object):
"""Handles the Algolia stuff."""
def __init__(self):
self.app_id = 'PBF4ZR3KBT'
self.api_key = '9188cd13a0dbf3d0af949802b0e31489' # search-only
self.index_name = 'ubuntu_irc_logs'
# Restricted search (for acq... | Python | 0.000005 | @@ -1,8 +1,39 @@
+%22%22%22Algolia is a funny word.%22%22%22%0A
from alg
@@ -2024,16 +2024,17 @@
'%5D + '%5D
+%3C
' + %5C%0A
@@ -2070,17 +2070,17 @@
me'%5D + '
-:
+%3E
' + hit
|
2c6e1a8c323cce535a1714957448240c26132fd4 | fix wrong summary for IgnoredSetuid | policy/permissions.py | policy/permissions.py | #
# Copyright (c) 2004-2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... | Python | 0.000156 | @@ -4086,39 +4086,38 @@
out
-world-writeable executable file
+potentially missing setuid bit
s%0A%0A
|
17aa71b4d7e3a747935d464cc4a37b62458789ae | Remove useless Item.get_fields method | populous/blueprint.py | populous/blueprint.py | from collections import namedtuple
from cached_property import cached_property
from populous import generators
from populous.exceptions import ValidationError
ITEM_ATTRIBUTES = ('name', 'table', 'count', 'fields', 'blueprint')
COUNT_ATTRIBUTES = ('number', 'by')
FIELD_ATTRIBUTES = ('name', 'generator')
class Bluep... | Python | 0.000002 | @@ -5480,273 +5480,8 @@
s)%0A%0A
- def get_field(self, name):%0A for field in self.fields:%0A if field.name == name:%0A return field%0A else:%0A raise KeyError(%22Field %7B%7D not found in blueprint item %7B%7D%22%0A .format(name, self.nam... |
71e68394322d34ab777007317f97d4663a7ee40f | Prepare for v0.3.1 release | popupcrud/__init__.py | popupcrud/__init__.py | __version__ = "0.3.0"
| Python | 0 | @@ -12,11 +12,11 @@
= %220.3.
-0
+1
%22%0A
|
27265c5c290a3ddb5148e71c292ba71a0deea461 | Complete naive sol by nested loops | lc0121_best_time_to_buy_and_sell_stock.py | lc0121_best_time_to_buy_and_sell_stock.py | """Leetcode 121. Best Time to Buy and Sell Stock
Easy
URL: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction
(i.e., buy one and sell one share of the sto... | Python | 0.0001 | @@ -881,63 +881,562 @@
int%0A
- %22%22%22%0A pass%0A %0A%0Adef main():%0A pass
+%0A Time complexity: O(n%5E2), where n is the number of prices.%0A Space complexity: O(1).%0A %22%22%22%0A max_profit = 0%0A%0A n = len(prices)%0A%0A for i in range(n - 1):%... |
9ddb83788322facb4aa41de2f8997f416359581e | Refactor for improved clarity | lets_do_dns/acme_dns_auth/authenticate.py | lets_do_dns/acme_dns_auth/authenticate.py | """letsencrypt's certbot Authentication Logic."""
from lets_do_dns.acme_dns_auth.record import Record
from lets_do_dns.acme_dns_auth.command import run
from lets_do_dns.acme_dns_auth.time_delay import sleep
class Authenticate(object):
"""Handle letsencrypt DNS certificate identity authentication."""
def __i... | Python | 0 | @@ -510,103 +510,32 @@
_in_
-post_hook_phase:%0A self._delete_record()%0A self._run_post_cmd()%0A els
+authentication_hook_stag
e:%0A
@@ -649,58 +649,274 @@
-return 0%0A%0A @property%0A def _in_post_hook_phas
+elif self._in_cleanup_hook_stage:%0A self._delete_recor... |
a22d445e61bc3735039a496b3aa2ee390f129e08 | Simplify error printing inside _format_errors | lib/KBaseReport/utils/validation_utils.py | lib/KBaseReport/utils/validation_utils.py | # -*- coding: utf-8 -*-
import os
from cerberus import Validator
import pprint
pp = pprint.PrettyPrinter(indent=4)
"""
Utilities for validating parameters
We use the `cerberus` schema validation library: http://docs.python-cerberus.org
"""
def validate_simple_report_params(params):
""" Validate all parameters t... | Python | 0.000024 | @@ -4972,25 +4972,8 @@
%22%22%22%0A
- err_str = %22%22%0A
@@ -5032,126 +5032,8 @@
age%0A
- for key in errors:%0A for err_msg in errors%5Bkey%5D:%0A err_str += %22 * %22 + key + %22: %22 + err_msg + %22%5Cn%22%0A
@@ -5115,15 +5115,30 @@
-err_str
+pprint.pformat(errors)
,%0A ... |
b90ec60af8ce24711907da217a2e95c683f89858 | Allow sending custom cookies in the client | contrib/python/api/skydive/websocket/client.py | contrib/python/api/skydive/websocket/client.py | #
# Copyright (C) 2017 Red Hat, Inc.
#
# Licensed to the Apache Software Foundation (ASF) 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, Versi... | Python | 0 | @@ -3692,16 +3692,46 @@
word=%22%22,
+ cookie=None,%0A
sync=%22%22
@@ -3918,16 +3918,45 @@
assword%0A
+ self.cookie = cookie%0A
@@ -4908,24 +4908,101 @@
elf.filter%0A%0A
+ if self.cookie:%0A factory.headers%5B'Cookie'%5D = self.cookie%0A%0A
self
|
d1c157b7671453dbb10787d9e71e727128345f2c | Change literals to constants | src/psd2svg/converter/shape.py | src/psd2svg/converter/shape.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from logging import getLogger
from psd2svg.converter.constants import BLEND_MODE2
logger = getLogger(__name__)
class ShapeConverter(object):
def _get_vector_stroke(self, layer, target):
blocks = layer._tagged_blocks
if b'vstk' in bl... | Python | 0.000296 | @@ -86,16 +86,60 @@
tLogger%0A
+from psd_tools.constants import TaggedBlock%0A
from psd
@@ -348,59 +348,165 @@
if
-b'vstk' in blocks and (b'vsms' in blocks or b'vmsk'
+TaggedBlock.VECTOR_STROKE_DATA in blocks and (%0A TaggedBlock.VECTOR_MASK_SETTING2 in blocks or%0A TaggedBlock.VECTOR... |
544c2ed8f88cdfc0a4e651f4de11c36eb2d411e6 | Optimize remove ontology | src/pysumo/syntaxcontroller.py | src/pysumo/syntaxcontroller.py | """ Handles all write accesses to the Ontologies and kif files. The
SyntaxController's main purpose is to act as an intermediary between the user
and the Ontology.
This module contains:
- SyntaxController: The interface to the parser/serializer.
"""
from io import StringIO, BytesIO
from os import listdir, fdopen, r... | Python | 0 | @@ -5078,32 +5078,51 @@
or%0A%0A %22%22%22%0A
+ offset = 0%0A
for c in
@@ -5120,14 +5120,27 @@
for
+ n,
c in
+enumerate(
list
@@ -5165,16 +5165,17 @@
hildren)
+)
:%0A
@@ -5243,23 +5243,68 @@
oot.
-remove_child(c)
+children.pop(n - offset)%0A offset = offset + 1
%0A... |
72796a97a24c512cf43fd9559d6e6b47d2f72e72 | Allow address to be null | preferences/models.py | preferences/models.py | import uuid
from django.db import models
from django.contrib.auth.models import User
from opencivicdata.models.people_orgs import Person
from django.contrib.auth.models import User
class Preferences(models.Model):
user = models.OneToOneField(User, related_name='preferences')
address = models.CharField(max_le... | Python | 0.000013 | @@ -135,53 +135,8 @@
on%0A%0A
-from django.contrib.auth.models import User%0A%0A
%0Acla
@@ -284,24 +284,35 @@
, blank=True
+, null=True
)%0A lat =
|
58e838d2fed690a8e5929fc8f82a492fbb908030 | Remove .stats command | willie/modules/info.py | willie/modules/info.py | """
info.py - Willie Information Module
Copyright 2008, Sean B. Palmer, inamidst.com
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
"""
def doc(willie, trigger):
"""Shows a command's documentation, and possibly an example."""
name = trigger.group(2)
name = name.lower()
if willie.d... | Python | 0 | @@ -1729,1492 +1729,8 @@
w'%0A%0A
-def stats(willie, trigger):%0A %22%22%22Show information on command usage patterns.%22%22%22%0A commands = %7B%7D%0A users = %7B%7D%0A channels = %7B%7D%0A%0A ignore = set(%5B'f_note', 'startup', 'message', 'noteuri'%5D)%0A for (name, user), count in willie.stats.it... |
03545250a25d47729c8a4634ef3098b6b7666c8f | Update s2_pi.py | s2_pi/s2_pi.py | s2_pi/s2_pi.py | #!/usr/bin/env python3
"""
s2_pi.py
Copyright (c) 2016, 2017 Alan Yorinks All right reserved.
Python Banyan is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your option) any l... | Python | 0.000003 | @@ -2298,17 +2298,24 @@
servo:%0A
-%09
+
#Using S
@@ -2325,17 +2325,24 @@
servo:%0A
-%09
+
#180%C2%B0 =
@@ -2370,17 +2370,24 @@
Pulses%0A
-%09
+
#Want Se
@@ -2571,17 +2571,24 @@
#Where:%0A
-%09
+
#Test th
@@ -2664,17 +2664,24 @@
ormula %0A
-%09
+
#%3E%3E%3E%3E---
@@... |
c9fb12426734a16941b9f9231843aec8a63ec196 | version 0.1.4 | diceseq/__init__.py | diceseq/__init__.py | # Copyright(c) 2014, The DICEseq developer (Yuanhua Huang)
# Licensed under the MIT License at
# http://opensource.org/licenses/MIT
__version__ = "0.1.2"
from utils.reads_utils import ReadSet
from utils.bias_utils import FastaFile, BiasFile
from utils.tran_utils import TranUnits, TranSplice
from utils.sam_utils impor... | Python | 0.000002 | @@ -145,17 +145,17 @@
= %220.1.
-2
+4
%22%0A%0Afrom
|
f6ea03230e0c4f11be378c00ce92d74d935ac973 | Make parameters passed to Reaction.user keyword-only | discord/reaction.py | discord/reaction.py | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | Python | 0 | @@ -5147,16 +5147,19 @@
rs(self,
+ *,
limit:
|
5952c27619c340dd212cbf4023919441c5827765 | Make HBox and VBox helper functions | IPython/html/widgets/widget_container.py | IPython/html/widgets/widget_container.py | """Container class.
Represents a container that can be used to group other widgets.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from .widget import DOMWidget
from IPython.utils.traitlets import Unicode, Tuple, TraitError, Int, CaselessStrEnum
from IPytho... | Python | 0 | @@ -1248,24 +1248,81 @@
ation =
-Unicode(
+CaselessStrEnum(values=%5B'vertical', 'horizontal'%5D, default_value=
'vertica
@@ -1860,177 +1860,231 @@
)%0A%0A%0A
-class
+def
VBox(
-FlexContainer):%0A _view_name = Unicode('VBoxContainerView', sync=True)%0A%0A%0Aclass HBox(FlexContainer):%0A _view_name = Unicode... |
49dc1820fc85f980a6bf2b447944373203120f18 | allow to drive usage of cache by httplib2 from ConfigHolder via useHttpCache field | core/src/main/python/stratuslab/HttpClient.py | core/src/main/python/stratuslab/HttpClient.py | #
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2011, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | Python | 0 | @@ -1307,24 +1307,57 @@
onse = True%0A
+ self.useHttpCache = True%0A
conf
@@ -6099,16 +6099,104 @@
+if self.useHttpCache:%0A h = httplib2.Http(%22.cache%22)%0A else:%0A
h = http
@@ -6201,32 +6201,24 @@
tplib2.Http(
-%22.cache%22
)%0A h.
|
02a07289db2061f53490422efb285a32fbf4989b | Add a couple more "bad parameter" tests | corehq/apps/hqcase/tests/test_case_list_api.py | corehq/apps/hqcase/tests/test_case_list_api.py | import datetime
import uuid
from django.http import QueryDict
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock, IndexAttrs
from pillowtop.es_utils import initialize_index_and_mapping
from corehq import privileges
from corehq.apps.es.tests.utils import es_test
from corehq.elastic import g... | Python | 0.000002 | @@ -5317,16 +5317,224 @@
-30'%22),%0A
+ (%22password=1234%22, %22'password' is not a valid parameter.%22),%0A (%22case_name.gte=a%22, %22'case_name.gte' is not a valid parameter.%22),%0A (%22date_opened=2020-01-30%22, %22'date_opened' is not a valid parameter.%22),%0A
%5D, TestC
|
b3d6ea48fb2d5c60535bbf854790ba317f4bb175 | Fix lint issue | src/foremast/utils/gate.py | src/foremast/utils/gate.py | # Foremast - Pipeline Tooling
#
# Copyright 2019 Redbox Automated Retail, 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
#
... | Python | 0.000002 | @@ -1861,24 +1861,16 @@
uest.')%0A
-
%0A
|
73823fa9ce5310b913519dbce8e0f388577bfff1 | remove unused import | corehq/apps/reports/standard/users/reports.py | corehq/apps/reports/standard/users/reports.py | import json
from django.db.models import Q
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from memoized import memoized
from corehq.apps.reports.datatables import DataTablesColumn, DataTablesHeader
from corehq.apps.reports.dispatcher import UserManagementReportD... | Python | 0.000001 | @@ -660,69 +660,8 @@
ort%0A
-from corehq.apps.reports.util import datespan_from_beginning%0A
from
|
196fcc2f0e8995576bc1afa1e7c376bd60807440 | Use path.join to manipulate paths in dataproc describe (#6829) | hail/python/hailtop/hailctl/dataproc/describe.py | hail/python/hailtop/hailctl/dataproc/describe.py | import json
from zlib import decompress, MAX_WBITS
from subprocess import check_output
from statistics import median, mean, stdev
from collections import OrderedDict
SECTION_SEPARATOR = '-' * 40
IDENT = ' ' * 4
def parse_schema(s):
def parse_type(s, end_delimiter, element_type):
keys = []
values ... | Python | 0 | @@ -5,16 +5,36 @@
rt json%0A
+from os import path%0A
from zli
@@ -3568,16 +3568,26 @@
%5B'cat',
+path.join(
args.fil
@@ -3587,21 +3587,19 @@
rgs.file
- +
+,
'
-/
metadata
@@ -3607,16 +3607,17 @@
json.gz'
+)
%5D),%0A
@@ -5043,16 +5043,26 @@
%5B'ls',
+path.join(
args.fil
@@ -5066,13 +5066,11 @@
file
-... |
ce1f3738ccced4af6648a0ab5cb94d39cd65275a | Remove ref to threading.currentThread (#2842) | synapse/glob.py | synapse/glob.py | import os
import signal
import asyncio
import logging
import threading
import faulthandler
logger = logging.getLogger(__name__)
_glob_loop = None
_glob_thrd = None
def _asynciostacks(*args, **kwargs): # pragma: no cover
'''
A signal handler used to print asyncio task stacks and thread stacks.
'''
p... | Python | 0 | @@ -1224,17 +1224,18 @@
.current
-T
+_t
hread()%0A
|
34320ef61714ad859bc26b9e7c374094fa8d5a1e | Include mac address in rainmachine device info (#50438) | homeassistant/components/rainmachine/__init__.py | homeassistant/components/rainmachine/__init__.py | """Support for RainMachine devices."""
import asyncio
from datetime import timedelta
from functools import partial
from regenmaschine import Client
from regenmaschine.controller import Controller
from regenmaschine.errors import RainMachineError
from homeassistant.config_entries import ConfigEntry
from homeassistant.... | Python | 0 | @@ -607,16 +607,67 @@
n as cv%0A
+import homeassistant.helpers.device_registry as dr%0A
from hom
@@ -6727,16 +6727,96 @@
.mac)%7D,%0A
+ %22connections%22: %7B(dr.CONNECTION_NETWORK_MAC, self._controller.mac)%7D,%0A
|
269bf7eec9a8e5ea721bce08c29793f0a2999d15 | Add unauthorized handler to flask | src/ggrc/login/__init__.py | src/ggrc/login/__init__.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""ggrc.login
Provides basic login and session management using Flask-Login with various
backends
"""
import flask_login
from ggrc.extensions import get_extension_module_for
def get_login_module():
ret... | Python | 0 | @@ -217,27 +217,136 @@
%0Aimport
-flask_login
+json%0Aimport re%0Aimport flask_login%0Afrom flask_login import login_url%0Afrom flask import request%0Afrom flask import redirect
%0Afrom gg
@@ -596,16 +596,73 @@
p(app):%0A
+ %22%22%22Initialize Flask_Login LoginManager with our app%22%22%22%0A
login_
@@ -873,16 ... |
6862e30f09ce2d5c1cd19734d4b7d627a6f5d075 | Fix for no edges network in code oracle | cviewer/plugins/codeoracle/cnetwork_action.py | cviewer/plugins/codeoracle/cnetwork_action.py |
from enthought.traits.api import Code, Button, Int, on_trait_change, Any, HasTraits,List, Str, Enum, Instance, Bool
from enthought.traits.ui.api import (View, Item, Group, HGroup, CodeEditor,
spring, Handler, EnumEditor)
from cviewer.plugins.cff2.cnetwork import CNetwork
class Ma... | Python | 0 | @@ -2110,32 +2110,36 @@
',%0A
+
buttons=%5B'OK'%5D,%0A
@@ -5340,67 +5340,21 @@
-raise Exception(%22No edges exist in the connectome network%22)
+ev = %5B%22None%22%5D
%0A
@@ -5362,37 +5362,42 @@
+else:%0A
-%0A
@@ -5446,16 +5446,20 @@
+
+
... |
1ac6d22a98bef3a713cba7ff89629b2ea3c9a2a6 | Fix urllib3 import statement (#11065) | http_check/datadog_checks/http_check/adapters.py | http_check/datadog_checks/http_check/adapters.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import ssl
import warnings
import urllib3
from requests.adapters import HTTPAdapter
from urllib3.exceptions import SecurityWarning
from urllib3.packages.ssl_match_hostname import match_hostname
from urlli... | Python | 0 | @@ -253,16 +253,293 @@
urllib3.
+util import ssl_%0A%0A# %60ssl_match_hostname%60 package has moved locations from %60urllib3.packages.ssl_match_hostname%60%0A# to %60urllib3.util.ssl_match_hostname%60 in urllib3 %3E= 1.26.8%0Atry:%0A from urllib3.util.ssl_match_hostname import match_hostname%0Aexcept ImportError:%... |
3826969e3c905819b036df26d78722b5ec3db3ae | drop dependency on pipeline spec files from the code | datapackage_pipelines_knesset/common/utils.py | datapackage_pipelines_knesset/common/utils.py | import importlib, logging, os
from contextlib import contextmanager
from tempfile import mkdtemp
import yaml
from datapackage_pipelines_knesset.common import object_storage
import json
import requests
@contextmanager
def temp_loglevel(level=logging.INFO):
root_logging_handler = logging.root.handlers[0]
old_le... | Python | 0 | @@ -2274,18 +2274,24 @@
d):%0A
-if
+bucket =
pipelin
@@ -2296,654 +2296,160 @@
ine_
-id == 'committee_meeting_protocols_parsed':%0A parameters = get_pipeline_run_step_parameters(pipeline_spec, %22committee-meeting-protocols%22, %22dump_to_sql%22,%0A pa... |
2f55210be8651a80f0c054e4f92cc3fcefaea12c | Add check for gaps in roll tables | table_loader.py | table_loader.py | import csv
def load_table(filepath, headers=False):
'''Return a dict representing a roll table loaded from filepath.
Loads a roll table from the CSV file at filepath into a dict whose keys
are ranges containing the range of rolls (min, max) associated with the
event specified in that key's value (a s... | Python | 0.000056 | @@ -4,16 +4,44 @@
ort csv%0A
+from itertools import chain%0A
%0A%0Adef lo
@@ -854,16 +854,159 @@
overlap.
+ If there is a gap in the table i.e. a roll%0A within the bounds of the table which is not associated with an event, an%0A IOError is raised.
'''%0A%0A
@@ -1749,16 +1749,16 @@
t(roll)%0A
-
... |
2012d5da39559987e6215b4559b9a12794f5b244 | Add select on read example to memory test script | scripts/uvfits_memtest.py | scripts/uvfits_memtest.py | #!/usr/bin/env python2.7
# -*- mode: python; coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from memory_profiler import profile
import numpy as np
from astropy import constants as const
from astropy.io import fits
from pyuvdata import UVData
@profile
def read_uvfits():
filena... | Python | 0 | @@ -496,25 +496,330 @@
me,
-metadata_only=Tru
+read_data=False, read_metadata=False)%0A uv_obj.read_uvfits_metadata(filename)%0A uv_obj.read_uvfits_data(filename)%0A del(uv_obj)%0A%0A # now test uvdata.read_uvfits with select on read.%0A uv_obj = UVData()%0A uv_obj.read_uvfits(filename, read_data=Fa... |
b3e3ec98f80cdc355842ba2dc13858892adc9476 | Fix lint errors | lib/node_modules/@stdlib/math/base/dist/beta/ctor/benchmark/python/benchmark.scipy.py | lib/node_modules/@stdlib/math/base/dist/beta/ctor/benchmark/python/benchmark.scipy.py | #!/usr/bin/env python
"""Benchmark scipy.stats.beta."""
import timeit
repeats = 3
count = [0] # use a list to allow modification within nested scopes
def print_version():
"""Print the TAP version."""
print("TAP version 13")
def print_summary(total, passing):
"""Print the benchmark summary.
# Ar... | Python | 0.000396 | @@ -54,40 +54,78 @@
%22%22%0A%0A
-import timeit%0A%0Arepeats = 3%0Acount
+from __future__ import print_function%0Aimport timeit%0A%0AREPEATS = 3%0ACOUNT
= %5B
@@ -1541,32 +1541,35 @@
-for i in xrange(repeats)
+i = 0%0A while i %3C REPEATS
:%0A
@@ -1609,21 +1609,21 @@
-count
+COUNT
%5B0%5D += 1... |
89988284ba19293f988e107ba4f1054d01cdc5a6 | Version bump to 0.1.7 | devserver/__init__.py | devserver/__init__.py | """
django-devserver
~~~~~~
`django-devserver <http://www.github.com/dcramer/django-devserver>` is a package
that aims to replace the built-in runserver command by providing additional
functionality such as real-time SQL debugging.
:copyright: 2010 by David Cramer
"""
__all__ = ('__version__', '__build__', '__docfor... | Python | 0 | @@ -362,9 +362,9 @@
1,
-6
+7
)%0A__
|
dd0bdf0339aa690b4df166de98fd61ede74aac53 | Fix typo | test/helpers.py | test/helpers.py | from textwrap import dedent
import tempfile
import yaml
import os
import subprocess as sp
import conda_build.api
def ensure_missing(package):
"""
Delete a package if it exists and re-index the conda-bld dir.
If a package is deleted from the conda-bld directory but conda-index is not
re-run, it remai... | Python | 0.999999 | @@ -3653,16 +3653,22 @@
dirnames
+(self)
:%0A
|
4897b561c131e0f4e4334b7a584f2c6614c5408c | allow specific tests on cmdline | test/run_all.py | test/run_all.py | #!/usr/bin/python
"""
Run all of the t????-*.in tests in the current directory and compare with the
expected output.
"""
import sys, os
import glob
import difflib
from subprocess import Popen, PIPE
PROG = '../vt100.py'
IN_EXT = '.in'
FORMATS = ['text', 'html']
def slurp(filename):
with open(filename, 'rb') as f:... | Python | 0.000001 | @@ -1558,16 +1558,21 @@
est_all(
+tests
):%0A r
@@ -1587,67 +1587,8 @@
%5B%5D%0A
- tests = glob.glob('t????-*' + IN_EXT)%0A tests.sort()%0A
@@ -2021,35 +2021,157 @@
ts%0A%0A
-%0Aif __name__ == %22__main__%22:
+def main(patterns = None):%0A if not patterns:%0A tests = glob.glob('t????-*' + ... |
09a7d18767e7ee7d1f439c3d208606cd42c68d4e | change simple test case for assertErrorRegex to work on both Python 2.6 and 2.4 | test/testing.py | test/testing.py | #!/usr/bin/env python
##
#
# Copyright 2012-2014 Ghent University
#
# This file is part of vsc-base,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the H... | Python | 0.000001 | @@ -2213,18 +2213,19 @@
gex(
-OS
+Key
Error, %22
No s
@@ -2224,55 +2224,27 @@
r, %22
-No such file or directory%22, os.remove, testfile
+foo%22, %7B%7D.pop, 'foo'
)%0A
|
c8fcda66041f15278e09a77ad2f4674f876a2755 | Update version file. | src/lib/opensub/version.py | src/lib/opensub/version.py | """
Version of the opensub-utils distribution.
* Keep _one_ version number for the whole distribution.
Don't start versioning the scripts, modules, etc separately.
* Use Semantic Versioning v2 as a guide: http://semver.org/
* Don't repeat the version in the commit message.
* Tag the commit changing this... | Python | 0 | @@ -454,9 +454,9 @@
%22, %22
-4
+5
%22)%0A_
|
ced078272a52a7b28fd960678f2c5397ce4bb783 | Add special indexers for month, day and year | djangae/indexing.py | djangae/indexing.py | import logging
import yaml
import os
_special_indexes = {}
def _get_index_file():
from djangae.boot import find_project_root
index_file = os.path.join(find_project_root(), "djangaeidx.yaml")
return index_file
def _get_table_from_model(model_class):
return model_class._meta.db_table.encode("utf-8")
... | Python | 0 | @@ -29,16 +29,32 @@
mport os
+%0Aimport datetime
%0A%0A_speci
@@ -2090,16 +2090,20 @@
.append(
+str(
index_ty
@@ -2105,16 +2105,17 @@
ex_type)
+)
%0A%0A wr
@@ -2902,66 +2902,1426 @@
n)%0A%0A
-REQUIRES_SPECIAL_INDEXES = %7B%0A %22iexact%22: IExactIndexer(),
+class DayIndexer(Indexer):%0A def validate_can... |
f873c1b54257d4d19ea05bc776de7147c8b3914d | Update django_cache_url.py | django_cache_url.py | django_cache_url.py | # -*- coding: utf-8 -*-
import os
import urlparse
# Register cache schemes in URLs.
urlparse.uses_netloc.append('db')
urlparse.uses_netloc.append('dummy')
urlparse.uses_netloc.append('file')
urlparse.uses_netloc.append('locmem')
urlparse.uses_netloc.append('memcache')
DEFAULT_ENV = 'CACHE_URL'
CACHE_TYPES = {
'... | Python | 0.000001 | @@ -623,16 +623,90 @@
MCCache'
+,%0A 'pymemcached': 'django.core.cache.backends.memcached.MemcachedCache'
%0A%7D%0A%0Adef
|
ac39b38bf32850fe53f0244f25b41b0082ea47ac | make django-redis configuration use get_redis_connection as supplied by django-redis, and not cache.client.get_client() | django_rq/queues.py | django_rq/queues.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import redis
from rq.queue import FailedQueue, Queue
from django_rq import thread_queue
def get_commit_mode():
"""
Disabling AUTOCOMMIT causes enqueued jobs to be stored in a temporary queue.
Jobs in this queue are ... | Python | 0 | @@ -2403,32 +2403,239 @@
try:%0A
+ from django_redis import get_redis_connection as get_dr_redis_connection%0A return get_dr_redis_connection(config%5B'USE_REDIS_CACHE'%5D)%0A except ImportError:%0A
|
425c1d7b92f8eebdeb8f41f805c9aaa3fa5842fc | Use DN in test case | api/tests/test_cloud_record.py | api/tests/test_cloud_record.py | """
This module tests GET and POST requests.
to the Cloud Sumamry Record endpoint.
"""
import glob
import logging
import os
import shutil
from django.test import Client, TestCase
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
QPATH_TEST = '/tmp/django-test/'
class Clou... | Python | 0.000003 | @@ -779,16 +779,92 @@
lient()%0A
+ example_dn = %22/C=XX/O=XX/OU=XX/L=XX/CN=cloud.recas.ba.infn.it%22 %0A
@@ -1185,32 +1185,18 @@
_DN=
-%22cloud.recas.ba.infn.it%22
+example_dn
)%0A%0A
|
0e38f624d6ab43773aba2f9b67caf06958e32241 | fix ethernet segment value | lib/exabgp/bgp/message/update/nlri/evpn/segment.py | lib/exabgp/bgp/message/update/nlri/evpn/segment.py | # encoding: utf-8
"""
segment.py
Created by Thomas Mangin on 2014-06-27.
Copyright (c) 2014-2015 Exa Networks. All rights reserved.
"""
from exabgp.protocol.ip import IP
from exabgp.bgp.message.update.nlri.qualifier import RouteDistinguisher
from exabgp.bgp.message.update.nlri.qualifier import ESI
from exabgp.bgp.m... | Python | 0.000054 | @@ -984,17 +984,17 @@
%09CODE =
-1
+4
%0A%09NAME =
|
f2e0ffd246ef2f86407bdb9ed8dcc2a7182f532a | Update script to patch disassembly for CFU instructions. | scripts/fix_cfu_dis.py | scripts/fix_cfu_dis.py | #!/usr/bin/env python3
# Copyright 2021 The CFU-Playground 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 a... | Python | 0 | @@ -1248,32 +1248,34 @@
= re.match(r%22%5E(
+ ?
%5Cw+:%5Cs+%5Cw+%5Cs+)(0
@@ -1678,16 +1678,18 @@
tch(r%22%5E(
+ ?
%5Cw+:%5Cs+%5C
|
394a760d6b507edd008459af6062683e684614ef | Update image.py | mapclientplugins/hearttransformstep/utils/image.py | mapclientplugins/hearttransformstep/utils/image.py | '''
Created on May 21, 2015
@author: hsorby
'''
# import dicom
import pydicom
import os
import numpy as np
def extractImageCorners(directory, filename):
'''
Extract the image corners from an image that is assumed to be
a DICOM image.
Corners are returned as:
[bl, br, tl, tr]
'''
# ds = ... | Python | 0.000001 | @@ -46,23 +46,8 @@
'''%0A
-# import dicom%0A
impo
@@ -291,70 +291,8 @@
'''%0A
- # ds = dicom.read_file(os.path.join(directory, filename))%0A
|
3041d2fc1afbdc0a3c3a0fd10fa59b79989b9d5f | Fix error message in ShellClient class | app/util/shell/shell_client.py | app/util/shell/shell_client.py | import socket
class ShellClient(object):
"""
Shell Client interface
"""
def __init__(self, host, user):
self.host = host
self.user = user
self.connected = False
def connect(self):
"""
Initializes the shell connection with the host
:return:
"... | Python | 0.000001 | @@ -2452,26 +2452,28 @@
sage = '
-c
+C
ommand
+%22
%7B%7D
+%22
on host
@@ -2469,26 +2469,28 @@
%7B%7D%22 on host
+%22
%7B%7D
+%22
as user %7B%7D
@@ -2486,18 +2486,20 @@
as user
+%22
%7B%7D
+%22
failed
@@ -2512,19 +2512,21 @@
xit code
+:
%7B%7D
+.
'.format
@@ -2538,32 +2538,41 @@
... |
382fff28c025858a8b273898afebc5ce4ae60a1e | convert services.yaml to bytes before dumping to yaml (#924) | paasta_tools/generate_services_yaml.py | paasta_tools/generate_services_yaml.py | #!/usr/bin/env python
# Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python | 0 | @@ -863,16 +863,17 @@
LHOST =
+b
'169.254
@@ -882,16 +882,16 @@
55.254'%0A
-
%0A%0Adef ge
@@ -1124,16 +1124,32 @@
fig%5Bname
+.encode('utf-8')
%5D = %7B%0A
@@ -1158,16 +1158,17 @@
+b
'host':
@@ -1190,16 +1190,17 @@
+b
'port':
@@ -1513,16 +1513,29 @@
ml.dump(
+%0A
configur
... |
dbdf537ee2feb4831d23f7698942827eaa07077b | version bump | protector/__init__.py | protector/__init__.py | __author__ = 'Sergey Lihobabin'
__version__ = '0.4.21'
default_app_config = 'protector.apps.ProtectorConfig'
| Python | 0.000001 | @@ -49,9 +49,9 @@
.4.2
-1
+3
'%0Ade
|
7346665052eac9dbf7578728b85e4cbd16727249 | Add docstrings to core.mixins module (#23, #27) | xentica/core/mixins.py | xentica/core/mixins.py | import inspect
import xentica.core.base
from xentica.core.exceptions import XenticaException
class BscaDetectorMixin:
@property
def _bsca(self):
frame = inspect.currentframe()
while frame is not None:
for l in frame.f_locals.values():
if hasattr(l, "__get__"):
... | Python | 0 | @@ -1,160 +1,606 @@
-import inspect%0A%0Aimport xentica.core.base%0Afrom xentica.core.exceptions import XenticaException%0A%0A%0Aclass BscaDetectorMixin:%0A%0A @property%0A def _bsca(self):
+%22%22%22%0AThe collection of mixins to be used in core classes.%0A%0AWould be interesting only if you are planning to hack... |
c050203b9faa7a28e74e4295c559a258edb20be0 | fix initial event time | xgds_core/redisUtil.py | xgds_core/redisUtil.py | # __BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance... | Python | 0.914214 | @@ -1247,22 +1247,22 @@
.dumps(%7B
-'
+%22
type
-'
+%22
:sse_typ
@@ -1256,38 +1256,38 @@
type%22:sse_type,
-'
+%22
data
-'
+%22
: jsonString%7D)%0A
@@ -1437,25 +1437,25 @@
info = %7B
-'
+%22
channel
-'
+%22
: channe
@@ -1481,17 +1481,17 @@
-'
+%22
publishT
@@ -1493,17 +1493,17 @@
lishTime
-'
+%22... |
03764d38c381efdda2566589953c5430e2a4962d | Implement definition for dev env | selfupdate/__init__.py | selfupdate/__init__.py | #!/usr/bin/env python3
import inspect
import git
import os
__version__ = "0.1.0"
__author__ = "Broderick Carlin (beeedy)"
__email__= "broderick.carlin@gmail.com"
__license__= "MIT"
def __get_calling_file():
'''
This function will go through the python call stack and find
the script that originally called into th... | Python | 0.000001 | @@ -1248,16 +1248,97 @@
_file()%0A
+%09# walk up the file tree looking for a valid git repo, stop when we hit the base%0A
%09while T
@@ -1524,16 +1524,33 @@
%09return
+os.path.normpath(
file_pat
@@ -1550,16 +1550,17 @@
ile_path
+)
%0A%09%09excep
@@ -1652,40 +1652,1669 @@
%22)%0A%0A
-%0A%0Adef test():%0A%09print... |
b62293e4ca939919cae30eba5447262cea486d61 | Fix reference to keys()[0] -- doesn't work in py3 | yamlicious/document.py | yamlicious/document.py | import yaml
class TypeMismatch(Exception):
pass
class CantMergeType(Exception):
pass
def merge_dicts(l, r, safe=True):
shared_keys = set(l.keys()) & set(r.keys())
new_dict = {}
for k in shared_keys:
if not type(l[k]) == type(r[k]):
raise TypeMismatch(k, type(l[k]), type(r[k]))
if isinsta... | Python | 0.000001 | @@ -1524,24 +1524,29 @@
= 1 and
+list(
d.keys()
%5B0%5D in f
@@ -1537,16 +1537,17 @@
d.keys()
+)
%5B0%5D in f
@@ -1570,24 +1570,29 @@
key =
+list(
d.keys()
%5B0%5D%0A
@@ -1583,16 +1583,17 @@
d.keys()
+)
%5B0%5D%0A
|
d3b59d32b93eb8ede7a3d118ad062114faf7eb0e | Fix docstrings | yatsm/mapping/utils.py | yatsm/mapping/utils.py | """ Utilities for turning YATSM record results into maps
Also stores definitions for model QA/QC values
"""
import logging
import numpy as np
from ..regression import design_to_indices
logger = logging.getLogger('yatsm')
# QA/QC values for segment types
MODEL_QA_QC = {
'INTERSECT': 3,
'AFTER': 2,
'BEFO... | Python | 0.00008 | @@ -3844,16 +3844,18 @@
:%0A
+
record (
@@ -3886,16 +3886,18 @@
result%0A
+
da
@@ -3963,16 +3963,18 @@
s%0A
+
after (b
@@ -4045,16 +4045,20 @@
+
+
availabl
@@ -4068,24 +4068,26 @@
ime segment%0A
+
before
@@ -4144,16 +4144,28 @@
del, use
+%0A
previou
... |
b91d4618ea0584e36ede80bae2e3dbc451b428bb | test train on two batch with different sequence length | sequence/understand.py | sequence/understand.py | # coding: utf-8
import numpy as np
from keras.models import Sequential
from keras.layers.recurrent import GRU
def understand_return_sequence():
"""用来帮助理解 recurrent layer 中的 return_sequences 参数"""
model_1 = Sequential()
model_1.add(GRU(input_dim=256, output_dim=256, return_sequences=True))
model_1.com... | Python | 0.000001 | @@ -2972,16 +2972,494 @@
n_y))%0A%0A%0A
+def try_variable_length_train_in_batch():%0A %22%22%22%E5%8F%98%E9%95%BF%E5%BA%8F%E5%88%97%E8%AE%AD%E7%BB%83%E5%AE%9E%E9%AA%8C(2)%22%22%22%0A model = Sequential()%0A model.add(GRU(input_dim=256, output_dim=256, return_sequences=True))%0A model.compile(loss='mean_squ... |
76fe5b58ebf08f0a58c4ed87244ebf148fcd86df | structure covar matrix, comment | yfc/user_operations.py | yfc/user_operations.py | import _data_operations as dops
from _decorators import *
@timeit
def current(tickers, write_to_csv=False, result_csv_path=None):
"""Retrieves realtime stock data from Yahoo Finance.
Arguments:
tickers --> list of tickers or path to ticker csv file
write_to_csv --> boolean, current writes dat... | Python | 0 | @@ -2606,16 +2606,17 @@
aframe%0A%0A
+%0A
def cova
@@ -2716,348 +2716,542 @@
ist.
-%0A%0A This function is a one-liner and it uses lambda, zip, map, reduce and listcomps.%0A Why be a king... when you can be a god... of unreadable code.%0A %22%22%22%0A%0A return reduce(lambda df1, df2: df1.join(df2, how='... |
ed83bb7f5423aef20b7e8201c117bced12583365 | Refactor zerver.views.upload. | zerver/views/upload.py | zerver/views/upload.py | from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse, HttpResponseForbidden
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from zerver.decorator import authenticated_json_post_view, zulip_login_required
from zerver.lib.request import has_re... | Python | 0 | @@ -634,70 +634,12 @@
gs%0A%0A
-@authenticated_json_post_view%0A@has_request_variables%0Adef json_
+def
uplo
@@ -641,24 +641,32 @@
upload_file
+_backend
(request, us
@@ -1264,175 +1264,73 @@
%7D)%0A%0A
-@zulip_login_required%0A@has_request_variables%0Adef get_uploaded_file(request, realm_id_str, filename,%0A ... |
49a99db58de4673ab006264c99bbcc105e827412 | Include checks in transaction commit results. | zoonado/transaction.py | zoonado/transaction.py | from tornado import gen
from zoonado import protocol
class Transaction(object):
def __init__(self, client):
self.client = client
self.request = protocol.TransactionRequest()
def check_version(self, path, version):
path = self.client.normalize_path(path)
self.request.add(
... | Python | 0 | @@ -1788,22 +1788,19 @@
uest, re
-sponse
+ply
in pair
@@ -1822,38 +1822,181 @@
if isinstance(re
-sponse
+ply, protocol.CheckVersionResponse):%0A result.checked.add(self.client.denormalize_path(request.path))%0A elif isinstance(reply
, protocol.Creat
@@ -2073,22 +2073,21 @@
_path(re
-spon... |
d7c41853277c1df53192b2f879f47f75f3c62fd5 | Add redirect for / to collections | server/covmanager/urls.py | server/covmanager/urls.py | from django.conf.urls import patterns, include, url
from rest_framework import routers
from covmanager import views
router = routers.DefaultRouter()
router.register(r'collections', views.CollectionViewSet, base_name='collections')
router.register(r'repositories', views.RepositoryViewSet, base_name='repositories')
ur... | Python | 0 | @@ -427,16 +427,59 @@
ork')),%0A
+ url(r'%5E$', views.index, name='index'),%0A
url(
@@ -998,8 +998,9 @@
rls)),%0A)
+%0A
|
91cbb2b79c565484389f659d436dc3a0813107a4 | bump version | shadowsocks/version.py | shadowsocks/version.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 breakwa11
#
# 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 | @@ -651,19 +651,19 @@
3.2.
-1
+2
201
-7-10-15
+8-05-22
'%0A%0A
|
2dc20d4478af52673cc44eb271661aea732728c2 | fix computation of symbol name | hotdoc/extensions/gi/gtkdoc_links.py | hotdoc/extensions/gi/gtkdoc_links.py | import os
from xdg import XDG_DATA_HOME, XDG_DATA_DIRS
from lxml import etree
from hotdoc.extensions.gi.utils import DATADIR
from hotdoc.utils.loggable import info
GTKDOC_HREFS = {}
def parse_devhelp_index(dir_):
path = os.path.join(dir_, os.path.basename(dir_) + '.devhelp2')
if not os.path.exists(path):
... | Python | 0 | @@ -597,16 +597,63 @@
uthor')%0A
+ language = dh_root.attrib.get('language')%0A%0A
if n
@@ -1304,24 +1304,189 @@
property'%5D:%0A
+ # Heuristic to determine that the naming follows the gtk-doc %22logic%22%0A if '#' in link and (language.lower() == 'c' or author == 'hotdoc'):%0A
... |
ab442c822242ea34a752a154873f69c55801c121 | Fix warnings during tests | tests/models.py | tests/models.py | from __future__ import unicode_literals
from django.db import models
from django.db.models import CASCADE
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
a = models.IntegerField()
b = models.CharField(max_length=255)
def __str__(self):
... | Python | 0.000018 | @@ -362,16 +362,60 @@
elf.b)%0A%0A
+ class Meta:%0A ordering = ('pk',)%0A%0A
%0Aclass B
@@ -515,16 +515,60 @@
ield()%0A%0A
+ class Meta:%0A ordering = ('pk',)%0A%0A
%0Aclass B
@@ -623,8 +623,52 @@
ld(Foo)%0A
+%0A class Meta:%0A ordering = ('pk',)%0A
|
05e5b195849fa69f94833807013bfb40e5f442b2 | Fix PEP8 E713 - test for membership should be "not in" | tests/saltsh.py | tests/saltsh.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''\
Welcome to the Salt repl which exposes the execution environment of a minion in
a pre-configured Python shell
__opts__, __salt__, __grains__, and __pillar__ are available.
Jinja can be tested with full access to the above structures in the usual way:
JINJA("""\\... | Python | 0 | @@ -1468,20 +1468,16 @@
if
-not
'grains'
in
@@ -1472,16 +1472,20 @@
'grains'
+ not
in __op
@@ -1651,20 +1651,16 @@
%0A if
-not
'file_cl
@@ -1664,16 +1664,20 @@
_client'
+ not
in __op
|
376357185a7cff4c2dea663e87d334bd5e7daa27 | Rename function name. | simphony/cuds/utils.py | simphony/cuds/utils.py | import warnings
import importlib
from functools import wraps
_CUBA_CUDS_MAP = None
def deprecated(func):
@wraps(func)
def _deprecated(*args, **kwargs):
warnings.warn("Deprecation warning: {}".format(func.__name__))
return func(*args, **kwargs)
return _deprecated
def turn_cuba_into_cuds... | Python | 0.000001 | @@ -53,16 +53,38 @@
rt wraps
+%0Afrom .meta import api
%0A%0A_CUBA_
@@ -320,27 +320,34 @@
def
-turn
+map
_cuba_
-in
+key_
to_cuds
+_class
(cub
@@ -1081,16 +1081,21 @@
items()
+%5C%0A%09%09%09
if isins
@@ -1114,6 +1114,41 @@
ype)
+ and issubclass(cls, api.CUDSItem)
%5D)
+%0A
|
639d5b7b16b7cd633e6bdbb638b2c2beefec2656 | Fix a issue that text doent appear with certain themes | kiwi/ui/cellrenderer.py | kiwi/ui/cellrenderer.py | #
# Kiwi: a Framework and Enhanced Widgets for Python
#
# Copyright (C) 2008 Async Open Source
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (a... | Python | 0.000898 | @@ -2259,12 +2259,12 @@
VE,
- Tru
+Fals
e,%0A
|
6aa1682e81f84f95c5ea58990608fa9a333d6ff9 | Add iteritems ind init of SerializerManager | djoser/serializers.py | djoser/serializers.py | from django.contrib.auth import authenticate, get_user_model
from django.db import IntegrityError, transaction
from django.utils import six
from django.utils.module_loading import import_string
from rest_framework import exceptions, serializers
from rest_framework.authtoken.models import Token
from . import constants... | Python | 0 | @@ -8100,16 +8100,28 @@
s.copy()
+.iteritems()
:%0A
|
7c2904615e7c18e2a93900d6315b3489ad1296c4 | Resolve Django 4.0 warning in urls config | djoser/social/urls.py | djoser/social/urls.py | from django.conf.urls import url
from djoser.social import views
urlpatterns = [
url(
r"^o/(?P<provider>\S+)/$",
views.ProviderAuthView.as_view(),
name="provider-auth",
)
]
| Python | 0 | @@ -9,13 +9,8 @@
ngo.
-conf.
urls
@@ -17,19 +17,23 @@
import
-url
+re_path
%0A%0Afrom d
@@ -79,19 +79,23 @@
= %5B%0A
-url
+re_path
(%0A
|
eeb8100ad82b517823481ac1ba849bbf4952ae2a | Update stager.py | pandaharvester/harvesterbody/stager.py | pandaharvester/harvesterbody/stager.py | from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.job_spec import JobSpec
from pandaharvester.harvestercore.db_proxy_pool import DBProxyPool as DBProxy
from pandaharvester.harvestercore.plugin_factory import PluginFactory
fr... | Python | 0 | @@ -4429,35 +4429,33 @@
# trigger
-preparation
+stage-out
%0A
|
cb1e1d115bc410e2ff3a749e8498dc5c32ba9cb7 | Translate to English | slimmermeten/models.py | slimmermeten/models.py | from django.db import models
# Create your models here.
class ElektrischStand(models.Model):
# Kan per 10 seconden, doen per minuut
date = models.DateTimeField('datum meting')
# T1 standen (normaal + teruggeleverd)
t1_stand = models.IntegerField(default=0) #23:00-07:00
t1_stand_terug = models.IntegerField(defaul... | Python | 1 | @@ -27,35 +27,8 @@
ls%0A%0A
-# Create your models here.%0A
%0Acla
@@ -41,16 +41,19 @@
ktri
-schStand
+cityReading
(mod
@@ -71,11 +71,20 @@
%0A%09#
-Kan
+Gives a tick
per
@@ -97,16 +97,21 @@
cond
-en, doen
+s? We measure
per
@@ -119,10 +119,10 @@
minu
-u
t
+e
%0A%09da
@@ -147,33 +147,40 @@
meField('dat
-u... |
768ab71faef2e72b9f0c2a93fa9f507eba47becd | update test logging | testsettings.py | testsettings.py | from __future__ import absolute_import
from __future__ import unicode_literals
import settingshelper as helper
from settings import *
USING_CITUS = any(db.get('ROLE') == 'citus_master' for db in DATABASES.values())
# note: the only reason these are prepended to INSTALLED_APPS is because of
# a weird travis issue with... | Python | 0.000001 | @@ -3106,16 +3106,42 @@
ugging.%0A
+ 'alembic': 'WARNING',%0A
'aud
@@ -3153,24 +3153,24 @@
e': 'INFO',%0A
-
'boto3':
@@ -3235,24 +3235,62 @@
t': 'INFO',%0A
+ 'couchdbkit.designer': 'WARNING',%0A
'datadog
@@ -3337,130 +3337,8 @@
R',%0A
- 'quickcache': 'INFO',%0A 'requests.packages.urllib3'... |
7bc7ca5503e0a02ecc95097a65f44579c8c11263 | Update about.py | tincan/about.py | tincan/about.py | # Copyright 2014 Rustici Software
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | Python | 0 | @@ -1533,119 +1533,8 @@
-:raises ValueError if invalid version string provided%0A :raises TypeError if unsupported type is provided
%0A
|
51300b12d71038f029c64ebd0424bea7e1989635 | fix typo in _build.py | tools/_build.py | tools/_build.py | """
The cython function was adapted from scikits-image (http://scikits-image.org/)
"""
import sys
import os
import shutil
import subprocess
import platform
from distutils.dist import Distribution
from distutils.command.config import config as distutils_config
from distutils import log
import optparse # deprecated in 2... | Python | 0.000002 | @@ -2929,11 +2929,11 @@
.exi
-t
st
+s
(scr
|
d88cbd6a4df9c7464eea965186430516e6877669 | Use distutils.version.LooseVersion to compare versions for gitpython because the present code chokes on something like '0.3.2 RC1'. | sumatra/versioncontrol/_git.py | sumatra/versioncontrol/_git.py | """
Defines the Sumatra version control interface for Git.
Classes
-------
GitWorkingCopy
GitRepository
:copyright: Copyright 2006-2014 by the Sumatra team, see doc/authors.txt
:license: CeCILL, see LICENSE for details.
"""
import logging
import git
import os
import shutil
from ConfigParser import NoSectionError, ... | Python | 0 | @@ -272,16 +272,59 @@
shutil%0A
+from distutils.version import LooseVersion%0A
from Con
@@ -868,137 +868,64 @@
-gitpython_version = tuple(int(x) for x in git.__version__.split(%22.%22))%0A if gitpython_version%5B1%5D %3C 2 or gitpython_version%5B2%5D %3C 6
+if LooseVersion(git.__version__) %3C LooseVersion(... |
18f0f07a5cacd82e930c022d877bf30de70181af | simplify with pipe | py-subprocess/test.py | py-subprocess/test.py | #!/usr/bin/env python3
import subprocess
import io
import tempfile
def main():
with tempfile.NamedTemporaryFile(mode='w', buffering=1) as f_out, \
tempfile.NamedTemporaryFile(mode='w', buffering=1) as f_err:
proc = subprocess.Popen(
['./out.sh'],
shell=True,
s... | Python | 0 | @@ -79,154 +79,8 @@
():%0A
- with tempfile.NamedTemporaryFile(mode='w', buffering=1) as f_out, %5C%0A tempfile.NamedTemporaryFile(mode='w', buffering=1) as f_err:%0A
@@ -112,20 +112,16 @@
-
%5B'./out.
@@ -134,20 +134,16 @@
-
shell=Tr
@@ -154,20 +154,16 @@
- ... |
10f3768b4ec3d3ad5e828d34a30c8efb6503b2a4 | Remove GET check in manage_posts route | py/webserver/views.py | py/webserver/views.py | import flask
import os.path
import datetime
import database
import auth
import blog
import configmanager
from . import webhelpers
FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../configs/"))
TEMPLATE_PATH = os.path.abspath(os.path.join(FILE_LOC... | Python | 0 | @@ -2686,44 +2686,8 @@
():%0A
-%09if flask.request.method == %22GET%22:%0A%09
%09ses
@@ -2714,33 +2714,32 @@
eckForSession()%0A
-%09
%09if session != N
@@ -2739,25 +2739,24 @@
on != None:%0A
-%09
%09%09posts = bl
@@ -2781,17 +2781,16 @@
False)%0A
-%09
%09%09return
@@ -2849,25 +2849,23 @@
posts)%0A%0A
-%09
%0... |
9940a61cd7dbe9b66dcd4c7e07f967e53d2951d4 | Change signature to match other resources auth functions | pybossa/auth/token.py | pybossa/auth/token.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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 version 3 of the License, or
# (at... | Python | 0 | @@ -898,37 +898,32 @@
def update(token
-=None
):%0A return Fa
@@ -936,37 +936,32 @@
def delete(token
-=None
):%0A return Fa
|
e654a17e6aef3a914247b3aeaeb55cba27826b92 | Raise a 403 error if user is not allowed to delete it | pybossa/view/admin.py | pybossa/view/admin.py | # This file is part of PyBOSSA.
#
# PyBOSSA 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 version 3 of the License, or
# (at your option) any later version.
#
# PyBOSSA is distributed in the ho... | Python | 0.000001 | @@ -7300,10 +7300,15 @@
-raise
+abort(403)
%0A
|
9d1268fe44f4eab78cdb76f70a914fa3851db00d | Add names.name_part template node to simplify porting BibTeX name formatting patterns. | pybtex/style/names.py | pybtex/style/names.py | # Copyright (C) 2006, 2007, 2008 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 vers... | Python | 0 | @@ -825,16 +825,28 @@
t Symbol
+, Text, nbsp
%0Afrom py
@@ -886,16 +886,355 @@
together
+, node, _format_list%0Afrom pybtex.bibtex.name import tie_or_space%0A%0A@node%0Adef name_part(children, data, before='', tie=False):%0A parts = together %5Bchildren%5D.format_data(data)%0A if not parts:%0A return Te... |
52f141039e1d84d1e1a59e3bbfe875c0f5bec23a | Allow sessions to be older than 1h. :-P | trac/Session.py | trac/Session.py | # -*- coding: iso8859-1 -*-
#
# Copyright (C) 2004 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
#
# Trac is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# ... | Python | 0.000005 | @@ -1143,17 +1143,16 @@
5 mins%0A
-#
PURG
@@ -1209,64 +1209,8 @@
dle%0A
- PURGE_AGE = 3600 # Purge session after 90 days idle%0A
|
a27b9131115367e487e5a4149302b207982adaea | Use a non-reentrant lock in the connection pool so that we don't return two different connections for the same thread. | trac/db/pool.py | trac/db/pool.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgew... | Python | 0.000002 | @@ -1653,9 +1653,8 @@
ing.
-R
Lock
|
bfdf2b45baf6a57bf186ef6e710e081d1abb104f | Add error reports to admin. | sweettooth/extensions/admin.py | sweettooth/extensions/admin.py |
from django.contrib import admin
from sorl.thumbnail.admin import AdminImageMixin
from extensions.models import Extension, ExtensionVersion
from review.models import CodeReview
class CodeReviewAdmin(admin.TabularInline):
model = CodeReview
fields = 'reviewer', 'comments',
class ExtensionVersionAdmin(admin.M... | Python | 0 | @@ -134,16 +134,29 @@
nVersion
+, ErrorReport
%0Afrom re
@@ -1094,16 +1094,499 @@
ExtensionAdmin)%0A
+%0Aclass ErrorReportAdmin(admin.ModelAdmin):%0A list_display = 'user_or_email', 'extension', 'version_num'%0A list_display_links = list_display%0A%0A def user_or_email(self, report):%0A if report.use... |
e31be1519269d5225e28dad8a77b58412b7fe435 | Add version changed directive to documentation for Media | tweepy/media.py | tweepy/media.py | # Tweepy
# Copyright 2009-2022 Joshua Roesslein
# See LICENSE for details.
from tweepy.mixins import DataMapping
class Media(DataMapping):
"""Media refers to any image, GIF, or video attached to a Tweet. The media
object is not a primary object on any endpoint, but can be found and
expanded in the Tweet ... | Python | 0 | @@ -680,16 +680,79 @@
field%0A%0A
+ .. versionchanged:: 4.12%0A Added %60%60variants%60%60 field%0A%0A
Attr
|
50b6a5a1aec88c2e3b12af8b7f673d7f3daf4dea | remove unnecessary vispy depencdency | AE2_SampledPlaneWave.py | AE2_SampledPlaneWave.py | # SOFiA example 2: Sampled unity plane wave simulation for different kr
# Generate a full audio spectrum plane wave using S/W/G
# Additionally requires vispy, see http://vispy.org
import numpy as np
from sofia import gen, process, plot
from vispy import scene
pi = np.pi
r = 0.1 # Array radius
ac = 0 # Rigi... | Python | 0.000762 | @@ -233,32 +233,8 @@
plot
-%0Afrom vispy import scene
%0A%0Api
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.