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 |
|---|---|---|---|---|---|---|---|
976db08aa8b5933483ee5209a84c1a401d654f0f | Correct MaternKernel docstring on lengthscale | gpytorch/kernels/matern_kernel.py | gpytorch/kernels/matern_kernel.py | #!/usr/bin/env python3
import math
import torch
from ..functions import MaternCovariance
from ..settings import trace_mode
from .kernel import Kernel
class MaternKernel(Kernel):
r"""
Computes a covariance matrix based on the Matern kernel
between inputs :math:`\mathbf{x_1}` and :math:`\mathbf{x_2}`:
... | Python | 0.000011 | @@ -614,17 +614,17 @@
Theta%5E%7B-
-1
+2
%7D (%5Cmath
|
b86db9d32a1aef728eaa38e1505e41dd5f104642 | Add _limit definition to __init__ | histogrammar/primitives/sample.py | histogrammar/primitives/sample.py | #!/usr/bin/env python
# Copyright 2016 Jim Pivarski
#
# 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.998775 | @@ -1448,16 +1448,44 @@
nit__()%0A
+ self._limit = limit%0A
@@ -1497,24 +1497,33 @@
specialize()
+%0A
%0A%0A @prope
|
b7768667c49be472198547a81d10b15517bb9014 | Fix formatting | hoomd/md/pytest/test_filter_md.py | hoomd/md/pytest/test_filter_md.py | import pytest
from hoomd.filter import (CustomFilter, Rigid)
import hoomd.md as md
import numpy as np
from hoomd import Snapshot
@pytest.fixture(scope="function")
def make_filter_snapshot(device):
def filter_snapshot(n=10, particle_types=['A']):
s = Snapshot(device.communicator)
if s.communicator... | Python | 0.000172 | @@ -32,17 +32,16 @@
import
-(
CustomFi
@@ -51,17 +51,16 @@
r, Rigid
-)
%0Aimport
|
4f7ce6890416fa8d660561f7eeecd082d91f136d | Add documentation for generateimage | imagekit/templatetags/imagekit.py | imagekit/templatetags/imagekit.py | from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
from .compat import parse_bits
from ..files import GeneratedImageCacheFile
from ..registry import generator_registry
register = template.Library()
ASSIGNMENT_DELIMETER = 'as'
HTML_ATTRS_DELIMITER = 'with'
... | Python | 0 | @@ -2387,16 +2387,808 @@
ments.%0A%0A
+ By default::%0A%0A %7B%25 generateimage 'myapp:thumbnail' from=mymodel.profile_image %25%7D%0A%0A generates an %60%60%3Cimg%3E%60%60 tag::%0A%0A %3Cimg src=%22/path/to/34d944f200dd794bf1e6a7f37849f72b.jpg%22 width=%22100%22 height=%22100%22 /%3E%0A%0A You ... |
ab4ae040895c50da6cb0827f6461d1733c7fe30a | Add real plugin state tests for plugins that always work (meta, containers, services). | tests/test_plugin_states.py | tests/test_plugin_states.py | from contextlib import contextmanager
from os import path
from unittest import TestCase
from canaryd_packages import six
from dictdiffer import diff
from jsontest import JsonTest
from mock import patch
from canaryd.plugin import get_plugin_by_name
@six.add_metaclass(JsonTest)
class TestPluginStates(TestCase):
j... | Python | 0 | @@ -86,41 +86,8 @@
se%0A%0A
-from canaryd_packages import six%0A
from
@@ -110,16 +110,16 @@
rt diff%0A
+
from jso
@@ -164,16 +164,50 @@
patch%0A%0A
+from canaryd_packages import six%0A%0A
from can
@@ -246,16 +246,388 @@
_name%0A%0A%0A
+class TestPluginRealStates(TestCase):%0A def run_plugin(self, plugin_name... |
e5081420c68251cb740c7b5a1dd3118b5bf89cca | Add encoding specification for Python 2 | tests/test_reconstructor.py | tests/test_reconstructor.py | import json
import unittest
from unittest import TestCase
from lark import Lark
from lark.reconstruct import Reconstructor
common = """
%import common (WS_INLINE, NUMBER, WORD)
%ignore WS_INLINE
"""
def _remove_ws(s):
return s.replace(' ', '').replace('\n','')
class TestReconstructor(TestCase):
def assert_... | Python | 0.000399 | @@ -1,12 +1,28 @@
+# coding=utf-8%0A%0A
import json%0A
|
705112bf10602eac4bc1371b5651b5341029411d | Fix test for authorization header | tests/test_request_utils.py | tests/test_request_utils.py | """
Tests for `vws._request_utils`.
"""
import base64
import datetime
import hashlib
import hmac
from freezegun import freeze_time
from hypothesis import given
from hypothesis.strategies import binary, text
from vws._request_utils import (
authorization_header,
compute_hmac_base64,
rfc_1123_date,
foo... | Python | 0.000001 | @@ -1724,20 +1724,22 @@
ess_key=
-text
+binary
(),%0A
@@ -2284,23 +2284,8 @@
%22%22%22%0A
- return%0A
@@ -2833,16 +2833,30 @@
pected =
+ (%0A
b'VWS '
@@ -2858,22 +2858,16 @@
VWS ' +
-bytes(
access_k
@@ -2868,35 +2868,16 @@
cess_key
-, encoding='utf-8')
+ b':'
@@ -2887,16 +2887,2... |
9472e9670da6d8b3e7ff7cb0ffd23b8362f7985c | remove extra print | tests/testapp/middleware.py | tests/testapp/middleware.py | from django.http import HttpResponse
from django.conf import settings
import json
class NonHtmlDebugToolbarMiddleware(object):
""" The Django Debug Toolbar usually only works for views that return HTML.
This middleware wraps any non-HTML response in HTML if the request
has a 'debug' query parameter (e.g... | Python | 0.000008 | @@ -654,65 +654,8 @@
8')%0A
- print(response%5B'Content-Type'%5D, content)%0A
|
b6e6951321f20fe2ad5bc92813c6438a60861ed0 | fix to_mbox test of ListservList | tests/unit/test_listserv.py | tests/unit/test_listserv.py | import os
import tempfile
from pathlib import Path
from unittest import mock
import pytest
import yaml
import bigbang
from bigbang import listserv
from bigbang.listserv import ListservArchive, ListservList, ListservMessage
from config.config import CONFIG
dir_temp = tempfile.gettempdir()
file_temp_mbox = dir_temp + ... | Python | 0.000019 | @@ -2202,38 +2202,55 @@
ert
-lines%5B21%5D == %22d activities:%5Cn%22
+%22What do you think of the approach?%5Cn%22 in lines
%0A
|
feb1efdca83a0c99f756dfe5dbb27ed56634e078 | Use shortened court name to lookup last record | collect_case_numbers.py | collect_case_numbers.py | import cookielib
import os
import pymongo
import re
import sys
import threading
import time
import urllib
import urllib2
from bs4 import BeautifulSoup
from datetime import datetime
from time import sleep
user_agent = u"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; " + \
u"rv:1.9.2.11) Gecko/20101012 Firef... | Python | 0.000001 | @@ -476,24 +476,89 @@
urt = court%0A
+ self.courtName = court%5B5:%5D.replace(' Circuit Court', '')%0A
def run(
@@ -808,16 +808,20 @@
lf.court
+Name
%7D, %5C%0A
@@ -1053,16 +1053,20 @@
lf.court
+Name
:%0A
@@ -1109,32 +1109,36 @@
print self.court
+Name
, last_name%0A
@@ -1181,16 +1181,32 ... |
3c572d213cdab91449427e76fc13ae5ef796b5a4 | Fix #15 in ansible >= 2.3.0 | lib/parse_ansible.py | lib/parse_ansible.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
from ansible.cli.doc import DocCLI
from ansible.playbook import Play
from ansible.playbook.block import Block
from ansible.playbook.role import Role
from ansible.playbook.task import Task
from ansible.plugins import lookup_loader, module_loader
from a... | Python | 0.000001 | @@ -1098,14 +1098,8 @@
doc
-, _, _
= m
@@ -1128,24 +1128,27 @@
ng(filename)
+%5B0%5D
%0A
|
52868ec01e009c78884e45abfb7aed12f1f5a10c | Rename Polygon.count to Polygon.elementCount and return the proper element count | LayerData.py | LayerData.py | from UM.Mesh.MeshData import MeshData
from UM.Math.Color import Color
import numpy
import math
class LayerData(MeshData):
def __init__(self):
super().__init__()
self._layers = {}
self._element_counts = {}
def addPolygon(self, layer, type, data):
if layer not in self._layers:
... | Python | 0.012129 | @@ -844,17 +844,24 @@
polygon.
-c
+elementC
ount)%0A%0Ac
@@ -2300,17 +2300,24 @@
def
-c
+elementC
ount(sel
@@ -2331,24 +2331,25 @@
return
+(
self._end -
@@ -2359,9 +2359,85 @@
f._begin
+) * 2 #The range of vertices multiplied by 2 since each vertex is used twice
%0A
|
5b73fb84089ed668ba5a63ec81112e6ae50114d5 | Fix token.py main code vs. dict views. | Lib/token.py | Lib/token.py | #! /usr/bin/env python
"""Token constants (from "token.h")."""
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# python Lib/token.py
#--start constants--
ENDM... | Python | 0 | @@ -2080,16 +2080,21 @@
keys =
+list(
tokens.k
@@ -2098,16 +2098,17 @@
s.keys()
+)
%0A key
|
02696b462a4ca40c0df1051f721cbba7822854f7 | Remove stray blank line | d4s2/urls.py | d4s2/urls.py | from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic.base import RedirectView
from django.contrib.auth import views as auth_views
from rest_framework.authtoken import views as authtoken_views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^ownership/', ... | Python | 0.998924 | @@ -35,17 +35,16 @@
include%0A
-%0A
from dja
|
e7bf0aac47b850ecb06d4233a21228d863c0f9ee | guess, duh | hangman/hangman.py | hangman/hangman.py | import discord
import os
from datetime import datetime
from discord.ext import commands
from .utils.dataIO import dataIO
from .utils import checks
class hangman:
def __init__(self, bot):
self.bot = bot
self.path = "data/Fox-Cogs/hangman"
self.file_path = "data/Fox-Cogs/hangman/hangman.json... | Python | 0.999936 | @@ -619,19 +619,21 @@
if
-str
+guess
is None
|
bafd884419079995a7c0b1f8df1d807f0c1250e5 | Add doc about db being offline to encryption utility | heat/cmd/manage.py | heat/cmd/manage.py | #
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | Python | 0.000022 | @@ -4406,16 +4406,139 @@
decrypt.
+ The '%0A 'heat-engine processes must be stopped to use '%0A 'this.
'))%0A
|
af35862acac49b52bb06dec5c6bd521d14097769 | Fix morphology method in Cell.py | PyOpenWorm/cell.py | PyOpenWorm/cell.py | from PyOpenWorm import *
from string import Template
import neuroml
__all__ = [ "Cell" ]
# XXX: Should we specify somewhere whether we have NetworkX or something else?
ns = {'ns1': 'http://www.neuroml.org/schema/neuroml2/'}
segment_query = Template("""
SELECT ?seg_id ?seg_name ?x ?y ?z ?d ?par_id ?x_prox ?y_prox ?z_p... | Python | 0.999956 | @@ -2181,13 +2181,8 @@
str(
-next(
self
@@ -2185,25 +2185,24 @@
self.name())
-)
%0A%0A #
@@ -6088,11 +6088,8 @@
(self):%0A
-%0A%0A%0A
|
eb05dbc15466e905463c78ee4ffc3e4b9b00de6c | Update Sunshine_Normalisation.py | Modules/Sunshine_Normalisation.py | Modules/Sunshine_Normalisation.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 4 18:08:04 2017
@author: Yu-Hsuan Tu
This module uses Sequoia's sunshine irradiance to adjust photo's brightness.
Usage:
Select a folder containing all the photos, then select one reference image (Band doesn't matter)
The program will use the sele... | Python | 0.000001 | @@ -824,16 +824,19 @@
h, '
-Calibrat
+SunNormalis
ed')
|
81955054d93799f0ed1ff0ec116e87cf98c60cb8 | correcting some typos | data/data.py | data/data.py | from __future__ import print_function, division
import hashlib
import os
import pdb
import json
def generate_file_md5(filename, blocksize=2**20):
"""Generate md5 hash for a file
Parameters
----------
filename: the name of the file for which a hash
is to be generated
Returns
-------
... | Python | 0.98261 | @@ -1885,16 +1885,24 @@
ain__%22:%0A
+ %22%22%22%0A
hash
@@ -1932,16 +1932,16 @@
ds005')%0A
-
with
@@ -2014,17 +2014,30 @@
hes, out
-)
+_file)%0A %22%22%22
%0A wit
@@ -2110,24 +2110,24 @@
ad(in_file)%0A
-
check_ha
@@ -2136,8 +2136,9 @@
es(dic)%0A
+%0A
|
6683f42057ba3128c4f83b98101fb699fe6674e9 | handle concurrency issue in cache layer | opmuse/cache.py | opmuse/cache.py | import time
import json
import pickle
from sqlalchemy.orm import deferred
from sqlalchemy import Column, Integer, String, BLOB, BigInteger, func
from sqlalchemy.dialects import mysql
from sqlalchemy.orm.exc import NoResultFound
from opmuse.database import Base, get_database
class CacheObject(Base):
__tablename__ ... | Python | 0 | @@ -67,16 +67,58 @@
eferred%0A
+from sqlalchemy.exc import IntegrityError%0A
from sql
@@ -2199,32 +2199,60 @@
t(time.time())%0A%0A
+ orig_value = value%0A%0A
if value
@@ -3049,32 +3049,53 @@
alue).__name__%0A%0A
+ try:%0A
para
@@ -3176,32 +3176,36 @@
pe%7D%0A ... |
698b29a82b94d9d819fa515e7593082abfccbc69 | Add environment update needed for issue #510 test | issue.features/environment.py | issue.features/environment.py | # -*- coding: UTF-8 -*-
# FILE: features/environment.py
"""
Functionality:
* active tags
"""
from behave.tag_matcher import ActiveTagMatcher, setup_active_tag_values
from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave
import six
import sys
import platform
# -- MATCHES ANY TAGS: @use.w... | Python | 0 | @@ -90,16 +90,54 @@
gs%0A%22%22%22%0A%0A
+from __future__ import print_function%0A
from beh
@@ -201,16 +201,16 @@
_values%0A
-
from beh
@@ -321,16 +321,1141 @@
latform%0A
+import os.path%0A%0A%0Adef require_tool(tool_name):%0A %22%22%22Check if a tool (an executable program) is provided on this platform.%0A%0A ... |
e657ee52210a2fb0a80ebc70f49e0a0285cf8919 | Support file-like objects in HydroShare Service | src/mmw/apps/export/hydroshare.py | src/mmw/apps/export/hydroshare.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import json
import StringIO
from rauth import OAuth2Service
from urlparse import urljoin, urlparse
from hs_restclient import HydroShare, HydroShareAuthOAuth2, HydroShareNotFound
from ... | Python | 0.000152 | @@ -2895,33 +2895,170 @@
tents': 'String'
-%7D
+, 'object': False%7D%0A or%0A %7B'name': 'String', 'contents': file_like_object, 'object': True%7D # NOQA
%0A :param
@@ -3154,24 +3154,69 @@
f in files:%0A
+ fobject = f.get('object', False)%0A
... |
bb45c09d18d9f3d967d4760c5567d852480d165e | Update area.py | pabiana/area.py | pabiana/area.py | """
Use this module to start a new Pabiana Area.
Each Area is initialized with a Receiver Interface.
The Receiver Interface accepts Requests for remote Triggers.
Subscription Interfaces are created as defined.
Subscription Interfaces call defined Reactions.
The Area name must not contain "_" characters.
A Publishing In... | Python | 0.000001 | @@ -321,18 +321,22 @@
terface
-is
+can be
added o
@@ -5051,16 +5051,17 @@
ath'%5D%0A%0A%0A__init()
+%0A
|
102374c49da1f2384dd9a7422b9e5463f24c2d54 | Update gmp to 6.0.0a and enable building on both darwin-32 and darwin-64 | packages/gmp.py | packages/gmp.py | class GmpPackage (Package):
def __init__ (self):
Package.__init__ (self, 'gmp', '5.0.4', sources = [
'ftp://ftp.gmplib.org/pub/%{name}-%{version}/%{name}-%{version}.tar.bz2'
],
configure_flags = ['--enable-cxx --disable-dependency-tracking'])
if Package.profile.name == 'darwin':
self.configure_flags.ext... | Python | 0 | @@ -81,13 +81,14 @@
', '
-5.0.4
+6.0.0a
', s
@@ -106,19 +106,21 @@
%09%09%09'
-f
+ht
tp
+s
://ftp.g
mpli
@@ -119,29 +119,26 @@
tp.g
-mplib
+nu
.org/
-pub
+gnu
/%25%7Bname%7D
-%25%7Bv
@@ -133,27 +133,16 @@
/%25%7Bname%7D
--%25%7Bversion%7D
/%25%7Bname%7D
@@ -161,15 +161,12 @@
tar.
-bz2'%0A%09%09
+xz'
%5D,... |
e78adec9a36c6279b9258f53e075a39bcfbb1dc0 | replace callbacks with coroutines | github.py | github.py | import config
import tornado.auth
import tornado.concurrent
import tornado.httpclient
import tornado.escape
import tornado.httputil
class GithubMixin(tornado.auth.OAuth2Mixin):
_OAUTH_AUTHORIZE_URL = 'https://github.com/login/oauth/authorize'
_OAUTH_ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token'
... | Python | 0.000003 | @@ -43,26 +43,41 @@
tornado.
-concurr
+escape%0Aimport tornado.g
en
-t
%0Aimport
@@ -95,38 +95,16 @@
pclient%0A
-import tornado.escape%0A
import t
@@ -470,31 +470,20 @@
ado.
-concurrent.return_futur
+gen.coroutin
e%0A%09d
@@ -536,23 +536,8 @@
code
-, callback=None
):%0A%09
@@ -720,220 +720,39 @@
)%0A%09%09
-... |
2ae440b9bcc6f6d322e5be72382eeb5218bec217 | remove spaces | examples/test_gevent.py | examples/test_gevent.py | import timeit
from gevent import monkey; monkey.patch_all()
import gevent
from restkit import *
from restkit.globals import set_manager, get_manager
from restkit.manager.mgevent import GeventManager
#set_logging("debug")
print "Manager was: %s" % type(get_manager())
set_manager(GeventManager())
print"Manager is se... | Python | 0.999999 | @@ -218,17 +218,16 @@
ebug%22)%0A%0A
-%0A
print %22M
@@ -344,18 +344,16 @@
ger())%0A%0A
-%0A%0A
urls = %5B
|
236dd26558a1ad4d71553164403ad48f7500aeb7 | Fix keyword detection in tables | parser/table.py | parser/table.py | import re
import sys
import parser
class Parser(parser.Parser):
def __init__(self, pctxt):
parser.Parser.__init__(self, pctxt)
self.tablePattern = re.compile(r'^ *(-+\+)+-+')
def parse(self, line):
global document, keywords, keywordsCount, chapters, keyword_conflicts
pctxt = s... | Python | 0.000014 | @@ -5374,26 +5374,22 @@
0,
-hasKeywords = Fals
+toplevel = Non
e):%0A
@@ -5752,32 +5752,60 @@
headerLine = %22%22%0A
+ hasKeywords = False%0A
i = 0%0A
@@ -6446,16 +6446,118 @@
column%0A
+ if j == 0 and i == 0 and keyword == 'keyword':%0A hasKeywords = True%0A
... |
53ca3d984213436199879eae0b79a87fd5d97fa7 | Fix error HTTP 414 Request URI Too Long | py3status/modules/icinga_simple.py | py3status/modules/icinga_simple.py | # -*- coding: utf-8 -*-
"""
Display Icinga2 service status information
Configuration Parameters:
- cache_timeout: how often the data should be updated
- base_url: the base url to the icinga-web2 services list
- disable_acknowledge: enable or disable counting of acknowledged service problems
- user: use... | Python | 0.00001 | @@ -1748,16 +1748,61 @@
state):%0A
+ url_parameters = self.url_parameters%0A
@@ -1842,21 +1842,16 @@
-self.
url_para
@@ -1851,37 +1851,32 @@
rl_parameters =
-self.
url_parameters +
@@ -1956,21 +1956,16 @@
e_url +
-self.
url_para
|
1541bb70ecc20a26b14784aaff8657327bb2adbe | add case sensitive support | grebot.py | grebot.py | from os import walk
from os.path import abspath, join
from argparse import ArgumentParser
from re import findall, sub, IGNORECASE
class Grebot(object):
LINE_FORMAT = '%s:\t%s'
def __init__(self, function_name, extensions, base_dir=None, color=False):
self._search_word = '%s|%s|%s|%s' % (function_nam... | Python | 0 | @@ -241,16 +241,33 @@
ir=None,
+ sensitive=False,
color=F
@@ -265,32 +265,32 @@
, color=False):%0A
-
self._se
@@ -574,16 +574,81 @@
ase_dir%0A
+ self._is_case_sensitive = 0 if sensitive else IGNORECASE%0A
@@ -1273,26 +1273,39 @@
, line,
-IGNORECASE
+self._is_case_sensitive
)%0A
@... |
4f6bdfd2e32fc0cfa80ce2a6b81dce83ee5cdaf8 | support namespaced JSON objects | parsers/text.py | parsers/text.py | import csv, json
from lxml import etree as xml
class CsvParser(object):
def parse(self):
self.csvdata = csv.DictReader(self.file)
self.data = [row for row in self.csvdata]
def dump(self, file=None):
if file is None:
file = self.file
csvout = csv.DictWriter(file, sel... | Python | 0 | @@ -547,24 +547,45 @@
dent = None%0A
+ namespace = None%0A
def pars
@@ -622,39 +622,203 @@
-self.data = json.load(self.file
+obj = json.load(self.file)%0A if self.namespace:%0A for key in self.namespace.split('.'):%0A obj = obj%5Bkey%5D%0A self.data... |
2f35456bce49493d77d08d7ab26ca419e551d9dc | Remove obsolete imports | pyFxTrader/strategy/sma_example.py | pyFxTrader/strategy/sma_example.py | # -*- coding: utf-8 -*-
import json
import time
from logbook import Logger
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from . import Strategy
from utils.indicators import moving_average, \
moving_average_convergence as macd, relative_strength as rsi
import talib
log = Logger('pyFxTra... | Python | 0.00051 | @@ -109,16 +109,29 @@
s as pd%0A
+import talib%0A
import m
@@ -182,133 +182,8 @@
egy%0A
-from utils.indicators import moving_average, %5C%0A moving_average_convergence as macd, relative_strength as rsi%0A%0Aimport talib
%0A%0Alo
@@ -1453,17 +1453,16 @@
array))%0A
-
%0A
|
1b010ae76dae7e45d835b2e160df81f67e5349ce | Fix pep8 issue | pyqode/python/frontend/__init__.py | pyqode/python/frontend/__init__.py | # -*- coding: utf-8 -*-
"""
The frontend packages contains classes and functions related to
tge gui side application. This is where you will find the python
specific modes and panels and an already configured CodeEdit made
for python programming.
"""
import re
import sys
from pyqode.core.frontend import open_file as _... | Python | 0 | @@ -855,97 +855,8 @@
263/
-%0A - http://docs.python.org/2/reference/lexical_analysis.html#encoding-declarations
%0A%0A
@@ -899,16 +899,20 @@
ed from%0A
+
|
d21a5dd515db50f1fdb1267e1544f8b73f79b73f | Add ReadOnlyPanel to PyCodeEdit | pyqode/python/widgets/code_edit.py | pyqode/python/widgets/code_edit.py | # -*- coding: utf-8 -*-
"""
This package contains the python code editor widget
"""
import sys
from pyqode.core.api import ColorScheme
from pyqode.python.backend import server
from pyqode.qt import QtCore, QtGui
from pyqode.core import api
from pyqode.core import modes
from pyqode.core import panels
from pyqode.python ... | Python | 0 | @@ -4408,16 +4408,91 @@
ion.TOP)
+%0A self.panels.append(panels.ReadOnlyPanel(), api.Panel.Position.TOP)
%0A%0A de
|
27e1cfef33841bffe7dde4a1d6f28a1c7e9c93fe | add noreorder for message MessageHandle because of circular dependency | tilequeue/queue/__init__.py | tilequeue/queue/__init__.py | from file import OutputFileQueue
from memory import MemoryQueue
from message import MessageHandle
from redis_queue import make_redis_queue
from sqs import JobProgressException
from sqs import make_sqs_queue
from sqs import make_visibility_manager
from sqs import SqsQueue
__all__ = [
JobProgressException,
make_... | Python | 0.000001 | @@ -1,12 +1,59 @@
+from message import MessageHandle # noreorder%0A
from file im
@@ -108,42 +108,8 @@
eue%0A
-from message import MessageHandle%0A
from
|
bbeaddcf6afde4a4c098bbfbc5b76d8afb9100ae | Improve the notebook generator. | python/matplotlib/make_notebook.py | python/matplotlib/make_notebook.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import sys
'''
Snippets should have the following structure:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
SNIPPET_TITLE
SNIPPET DESCRIPTION
"""
SNIPPET CODE
'''
SCRIPT_NAME = os.path.basename(sys.argv[0])
OUTPUT_FILE_PATH = "matplotlib_s... | Python | 0 | @@ -360,16 +360,106 @@
nippets%22
+%0AGIT_BASE_URL = %22https://github.com/jeremiedecock/snippets/blob/master/python/matplotlib/%22
%0A%0A# DIRE
@@ -4530,16 +4530,18 @@
Source:
+%7B%7D
%7B%7D%5Cn%5Cn%22.
@@ -4547,16 +4547,30 @@
.format(
+GIT_BASE_URL,
file_nam
|
5107eabe1bb0cddcbbcd23a4c244c26f6cfd08da | update (#14274) | python/ray/util/client/__init__.py | python/ray/util/client/__init__.py | from typing import List, Tuple, Dict, Any
import sys
import logging
logger = logging.getLogger(__name__)
# This version string is incremented to indicate breaking changes in the
# protocol that require upgrading the client version.
CURRENT_PROTOCOL_VERSION = "2020-02-01"
class RayAPIStub:
"""This class stands ... | Python | 0 | @@ -268,10 +268,10 @@
-02-
-01
+22
%22%0A%0A%0A
|
127c80a48a1e69885e73c3819d5780e33ea816d4 | Add bloom-filter-cpp lib target | binding.gyp | binding.gyp | {
"targets": [{
"target_name": "sample",
"type": "executable",
"sources": [
"main.cpp",
"BloomFilter.cpp",
"BloomFilter.h"
],
"include_dirs": [
".",
],
"conditions": [
['OS=="win"', {
}, {
'cflags_cc': [ '-fexceptions' ]
}
]
... | Python | 0.000001 | @@ -11,16 +11,577 @@
ts%22: %5B%7B%0A
+ %22target_name%22: %22bloom-filter-cpp%22,%0A %22type%22: %22lib%22,%0A %22sources%22: %5B%0A %22BloomFilter.cpp%22,%0A %22BloomFilter.h%22%0A %5D,%0A %22include_dirs%22: %5B%0A %22.%22,%0A %5D,%0A %22conditions%22: %5B%0A %5B'OS==%22win%... |
0ad3efcbc10f11195727532d515d5adb3640ed6b | add fibonacci demo | pynodegl-utils/pynodegl_utils/examples/misc.py | pynodegl-utils/pynodegl_utils/examples/misc.py | import math
from pynodegl import Texture, Shader, TexturedShape, Rotate, AnimKeyFrameScalar, Triangle
from pynodegl_utils.misc import scene
@scene({'name': 'size', 'type': 'range', 'range': [0,1.5], 'unit_base': 1000})
def triangle(cfg, size=0.5):
frag_data = '''
#version 100
precision mediump float;
varying vec... | Python | 0.000001 | @@ -95,16 +95,70 @@
Triangle
+%0Afrom pynodegl import Quad, UniformVec4, Camera, Group
%0A%0Afrom p
@@ -862,8 +862,1427 @@
rn node%0A
+%0A@scene(%7B'name': 'n', 'type': 'range', 'range': %5B2,10%5D%7D)%0Adef fibo(cfg, n=8):%0A frag_data = '''%0A#version 100%0Aprecision mediump float;%0Auniform vec4 color;%0Avoid ... |
4be2123258dd1184f3b105435cff53cf3af40d68 | fix encoding | webride/webride.py | webride/webride.py | #
# Copyright 2014 Janne Härkönen
# Distributed under the MIT License: http://opensource.org/licenses/MIT
#
import os
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def init():
names = os.listdir('testdata')
return render_template('main.html', suite_names=names)
@a... | Python | 0.274682 | @@ -23,12 +23,12 @@
ne H
-%C3%A4rk%C3%B6
+arko
nen%0A
|
be370e6c13ef7db287c9fb5198f16f262d2c86e7 | add VumiBackend to __init__ so rapidsms.backends.vumi.VumiBackend works | rapidsms/backends/vumi/__init__.py | rapidsms/backends/vumi/__init__.py | Python | 0.000046 | @@ -0,0 +1,84 @@
+from rapidsms.backends.vumi.outgoing import VumiBackend%0A%0A__all__ = ('VumiBackend',)%0A
| |
506b76e3b6ae11e6b1fa55e0be1da51ad4fb6dc8 | stop using easysoft (segfaults) | db/config.py | db/config.py | ###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | Python | 0 | @@ -3820,16 +3820,43 @@
else:%0A
+ return %22SQLServer%22%0A
@@ -3938,16 +3938,25 @@
LServer%22
+%0A
%0A%0Adef re
|
a26b88cd6b2034b7048d5b4729d3fa90ddfb255d | Update docs with actual MariaDB JSON support | lib/sqlalchemy/dialects/mysql/json.py | lib/sqlalchemy/dialects/mysql/json.py | # mysql/json.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
from ... import types as sqltypes
class JSON... | Python | 0 | @@ -401,52 +401,28 @@
5.7.
+%0A
-Note that MariaDB does **not**%0A
+ MariaDB
support
JSO
@@ -421,41 +421,60 @@
port
+s
JSON
-at the time of this writing
+(as an alias for LONGTEXT) as of version 10.2
.%0A%0A
|
282c83582215b53a1ae890501086baae141c61f3 | Correct variable name | recipes/nodes/source_extraction.py | recipes/nodes/source_extraction.py | # LOFAR TRANSIENT DETECTION PIPELINE
#
# Source extraction node
# Evert Rol, 2011
# evert.astro@gmai... | Python | 0.011243 | @@ -3545,16 +3545,23 @@
+upload_
thread.s
|
7e97722354f1b59eb97f29aa99102ff1212e33ce | Use parse_qsl instead of urldecode because facebook sends a pipe character in its output for client_credential grants. | requests_oauthlib/compliance_fixes/facebook.py | requests_oauthlib/compliance_fixes/facebook.py | from json import dumps
from oauthlib.common import urldecode
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if r.headers['content-type'] == 'application/json':
return r
# Facebook returns a content-t... | Python | 0 | @@ -54,16 +54,45 @@
ldecode%0A
+from urllib import parse_qsl%0A
%0A%0Adef fa
@@ -619,24 +619,48 @@
ict(
-urldecode(r.text
+parse_qsl(r.text, keep_blank_values=True
))%0A
|
1a79ea02ec226094ba3539ac4cd089643393fd8a | Test cleanup | Lib/fontParts/test/test_layer.py | Lib/fontParts/test/test_layer.py | import unittest
import collections
from fontParts.base import FontPartsError
class TestLayer(unittest.TestCase):
# ------
# Glyphs
# ------
def getLayer_glyphs(self):
layer, _ = self.objectGenerator("layer")
for name in "ABCD":
glyph = layer.newGlyph(name)
return ... | Python | 0 | @@ -4593,64 +4593,8 @@
urn%0A
- glyph3 = layer%5B%22C%22%5D%0A glyph4 = layer%5B%22D%22%5D%0A
|
2f48c53dbe8bafcaca596ce454ba8e7d987d86b1 | Create test within input | station.py | station.py | """Creates the station class"""
class Station:
"""
Each train station is an instance of the Station class.
Methods:
__init__: creates a new stations
total_station_pop: calculates total station population
"""
def __init__(self):
while True:
self.capacity = int(eval(inpu... | Python | 0 | @@ -375,29 +375,29 @@
if
-self.
+type(
capacity
== int:
@@ -388,16 +388,17 @@
capacity
+)
== int:
@@ -418,13 +418,47 @@
-break
+print(%22You just set the max capacity!%22)
%0A
|
f2a961332ef25e21d2d8b96616edd30eaa8bd622 | Make sure DOIs are matched in a case-insensitive way | papers/doi.py | papers/doi.py | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# 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 version 2
# of th... | Python | 0.000174 | @@ -1697,24 +1697,99 @@
721839'%0A
+ %3E%3E%3E to_doi('10.1093/jhmas/XXXI.4.480')%0A u'10.1093/jhmas/xxxi.4.480'%0A
%22%22%22%0A
m =
@@ -1776,24 +1776,24 @@
80'%0A %22%22%22%0A
-
m = doi_
@@ -1850,16 +1850,24 @@
ups()%5B0%5D
+.lower()
%0A els
@@ -1954,16 +1954,16 @@
_match:%0A
-
... |
1c6fb9e30b2b39af76d2a32066d45f142c598f65 | Fix call to call | paramsweep.py | paramsweep.py | #!/usr/bin/env python
"""
Run multiple simulations varying a single parameter.
"""
import foampy
from foampy.dictionaries import replace_value
import numpy as np
from subprocess import call
import os
import pandas as pd
from modules import processing as pr
def zero_tsr_fluc():
"""Set TSR fluctuation amplitude to... | Python | 0.000002 | @@ -1631,16 +1631,17 @@
call
+(
%5B%22git%22,
@@ -1671,16 +1671,17 @@
ptions%22%5D
+)
%0A%0A%0Aif __
|
ea2430f3476be545697ef41363af075c5467288f | Use intp pointers where appropriate. | Lib/weave/standard_array_spec.py | Lib/weave/standard_array_spec.py | from c_spec import common_base_converter
from c_spec import num_to_c_types
import numpy
num_typecode = {}
num_typecode['?'] = 'PyArray_BOOL'
num_typecode['b'] = 'PyArray_BYTE'
num_typecode['B'] = 'PyArray_UBYTE'
num_typecode['h'] = 'PyArray_SHORT'
num_typecode['H'] = 'PyArray_USHORT'
num_typecode['i'] = 'PyArray_INT'
... | Python | 0.002585 | @@ -5869,16 +5869,17 @@
'int
+p
* N%25(nam
@@ -5936,16 +5936,17 @@
'int
+p
* S%25(nam
|
0923e73e2a0657f2d0728f9c020589f5eb9976b4 | Add address back in | python/prm_fhir/extractors.py | python/prm_fhir/extractors.py | """
### CODE OWNERS: Shea Parkes, Steve Gredell
### OBJECTIVE:
Extraction methods for relevant items.
### DEVELOPER NOTES:
The lab dimenion table will likely be hand-entered.
"""
import csv
import typing
import traceback
from time import sleep
from collections import OrderedDict
from pathlib import Path
from fhi... | Python | 0.000139 | @@ -1870,16 +1870,74 @@
else:
+%0A address = _format_address(patient.address%5B0%5D)
%0A%0A
|
af58da55ed9923e581cb5879a01e24a2a414a04a | Remove measure_time switch in top_level and fix a bug where the measure_time is returned rather than the execution time | components/top_level.py | components/top_level.py | import sys
import time
from github import Github
from prompt_toolkit import prompt, AbortAction
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit.history import FileHistory
from prompt_toolkit.styles import style_from_pygments... | Python | 0.000001 | @@ -948,27 +948,8 @@
sql,
- measure_time=True,
dis
@@ -1010,37 +1010,8 @@
urn%0A
- if measure_time:%0A
@@ -1805,49 +1805,8 @@
)))%0A
- if measure_time:%0A
@@ -1891,70 +1891,32 @@
-else:%0A return result, measure_time%0A
+return result, ... |
baf9c5a6523a9b90db7572330d04e3e199391273 | bump version | wigiki/__init__.py | wigiki/__init__.py | """A static site generator which uses Github's gists as pages"""
__author__ = "Tasos Latsas"
__version__ = "0.6.2"
| Python | 0 | @@ -109,7 +109,7 @@
0.6.
-2
+4
%22%0A
|
1de75239707e5eefc0d15c18dee318e47b5e6213 | Resolve some crashes | annotran/languages/models.py | annotran/languages/models.py | '''
Copyright (c) 2013-2014 Hypothes.is Project and contributors
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the ... | Python | 0 | @@ -3211,32 +3211,139 @@
id, or None.%22%22%22%0A
+ if page is None:%0A return cls.query.filter(cls.pubid == pubid).first()%0A else:%0A
return c
@@ -3519,32 +3519,110 @@
id, or None.%22%22%22%0A
+ if page is None:%0A return cls.query.all()%0A else:%0A ... |
b072d495e12c8fe93942a8f64b9bc328a38b28f7 | Change underscore to + | anserv/modules/decorators.py | anserv/modules/decorators.py | import inspect
# import decorator
from django.core.cache import cache
import time
from decorator import decorator
import logging
import cronjobs
log=logging.getLogger(__name__)
import traceback
event_handlers = []
request_handlers = {'view':{}, 'query':{}}
def event_handler(batch=True, per_user=False, per_resource... | Python | 0.000814 | @@ -2339,17 +2339,17 @@
egory+=%22
-_
++
%22%0A
|
f2b180e3aa0fff9831b0aca8e7a858d56d54a600 | fix by david roe and nils bruin to not spawn thousands of zombies in docker image | src/dev/docker/run.py | src/dev/docker/run.py | #!/usr/bin/env python3
import os, tempfile, time, shutil, subprocess, sys
# Where the PostgreSQL data is stored
PGDATA = '/projects/postgres/data'
PGHOST = os.path.join(PGDATA, 'socket')
os.environ['PGHOST'] = PGHOST
os.environ['PGUSER'] = 'smc'
# ensure that everything we spawn has this umask, which is more secure... | Python | 0 | @@ -5334,23 +5334,16 @@
-time.sleep(3600
+os.wait(
)%0A%0Ai
|
f07a704d6ff61c2d3540868266f26081d0586092 | add GWTCanvas demo | library/pyjamas/Canvas/ImageLoader.py | library/pyjamas/Canvas/ImageLoader.py | """
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -1728,28 +1728,16 @@
-ImageLoader.
imageLoa
|
77daf73ebb9357a93f483cf21554260f903d1923 | Add logger to corilla stats module | src/tmlib/workflow/corilla/stats.py | src/tmlib/workflow/corilla/stats.py | '''
Calculation of illumination statistics, which can subsequently be applied
to individual images in order to correct them for illumination artifacts [1]_.
References
----------
.. _[1]: Stoeger T, Battich N, Herrmann MD, Yakimovich Y, Pelkmans L. 2015. "Computer vision for image-based transcriptomics". Methods.
'''... | Python | 0 | @@ -333,16 +333,31 @@
py as np
+%0Aimport logging
%0A%0Afrom t
@@ -427,16 +427,54 @@
sImage%0A%0A
+logger = logging.getLogger(__name__)%0A%0A
%0Aclass O
|
b0c1c660a3629bfc7103d00c502e02e2d5bbed60 | fix linting | accelerator/utils.py | accelerator/utils.py | from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
from bullet_train import BulletTrain
BULLET_TRAIN_ENVIRONMENT_ID ="aX45EUqSsAqhTvv5nW7WEL"
def create_mc_permission(permission):
ct, _ = ContentType.objects.get_or_create(
app_label="mc",
m... | Python | 0 | @@ -169,16 +169,17 @@
ENT_ID =
+
%22aX45EUq
@@ -196,16 +196,17 @@
W7WEL%22%0A%0A
+%0A
def crea
@@ -669,16 +669,17 @@
_perm)%0A%0A
+%0A
def bull
@@ -900,12 +900,8 @@
n False%0A
-
|
d7164f8f804a7c6e6df58a9be8cff1717ee7aeda | VERSION 0.10.1 | bulbs/__init__.py | bulbs/__init__.py | __version__ = "0.10.0"
| Python | 0.000003 | @@ -13,11 +13,11 @@
= %220.10.
-0
+1
%22%0A
|
49d7b896ed82ba9a96d92182643ced22db7ccdea | clean up redunancy | piazza_api.py | piazza_api.py | import requests
import json
import getpass
class AuthenticationError(Exception):
"""AuthenticationError"""
class NotAuthenticatedError(Exception):
"""NotAuthenticatedError"""
class PiazzaAPI(object):
"""Tiny wrapper around Piazza's Internal API
Example:
>>> p = PiazzaAPI(... | Python | 0.000022 | @@ -5136,27 +5136,16 @@
dents%22:
-json.dumps(
student_
@@ -5150,17 +5150,16 @@
t_emails
-)
%0D%0A
|
ac9332500fdcef8f5646658c62db760fdd61f6a5 | Fix build artifact path | packages/Python/lldbsuite/test/lang/swift/objc_runtime_ivars/TestObjCIvarDiscovery.py | packages/Python/lldbsuite/test/lang/swift/objc_runtime_ivars/TestObjCIvarDiscovery.py | # TestObjCIvarDiscovery.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CO... | Python | 0 | @@ -982,16 +982,42 @@
ramework
+/Versions/A/aTestFramework
.dSYM%22))
|
61be34225ae617d43cf7ca8c93c021523d93d8ca | fix #34 - use Session.evaluated_env_list to respect TOX_SKIP_ENV | detox/cli.py | detox/cli.py | from __future__ import print_function
import sys
from tox.session import prepare as tox_prepare
from detox import __version__
from detox.proc import Detox
def main(args=None):
args = sys.argv[1:] if args is None else args
if args and args[0] == "--version":
print("detox {} running as plugin in tox:... | Python | 0 | @@ -606,20 +606,43 @@
lti(
-config.
+detox.toxsession.evaluated_
env
+_
list
+()
)%0A
|
1513c99d7bd7c06825cea757cbd292547c4c8350 | Exclude anything starting with '::' or '__' | dev/func3.py | dev/func3.py | from pathlib import Path
import re
import json
dtx_files = Path('/usr/local/texlive/2019/texmf-dist/source/latex/l3kernel/').glob('*.dtx')
def parse_doc_block(block_content, _type):
objs = []
for match in re.findall(rf'\\begin{{{_type}}}(?:\[[^\]]*\])?[\s\n%]*{{([^}}]*)}}', block_content, flags=re.M):
... | Python | 0.999638 | @@ -134,16 +134,105 @@
.dtx')%0A%0A
+def exclude(entry: str) -%3E bool:%0A return not re.match(r'%5C%5C(?!(?:::)%7C(?:__))', entry)%0A%0A
def pars
@@ -525,25 +525,21 @@
if
-m.startswith('%5C%5C'
+not exclude(m
)%5D)%0A
|
62b1491a9d817fae3107a90bd047b7bbf83ab22d | Add corpus's full path | diplomacy.py | diplomacy.py | from random import randrange
from secret import *
import tweepy, time, sys, collections
# Get words
corpus = open("corpus.txt", "r")
wordLines = corpus.readlines()
for line in range(0, len(wordLines)-2):
wordLines[line] = wordLines[line][:-1]
# Store the start of sentences
sentenceStarters = []
# Create graph of w... | Python | 0.000039 | @@ -1,12 +1,31 @@
+#!/usr/bin/python%0A%0A
from random
@@ -45,106 +45,162 @@
nge%0A
-from secret import *%0Aimport tweepy, time, sys, collections%0A%0A# Get words%0Acorpus = open(%22corpus.txt%22
+import sys, os, tweepy%0Afrom secret import *%0A%0A# Get words%0AcorpusPath = os.path.dirname(os.path.realpath(__file__)... |
f46b655ed924ff5238d08e4aa0a660879976507e | Bump version. | libcloud/__init__.py | libcloud/__init__.py | # 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, Version 2.0
# (the "License"); you may not use ... | Python | 0.000017 | @@ -965,17 +965,17 @@
= '0.10.
-0
+1
'%0A%0Atry:%0A
|
d7fe1ef2ec3cc19c234d228cbdbd3a0067801e46 | Fix typo in addExpense | app/mod_budget/controller.py | app/mod_budget/controller.py | from flask import Blueprint, flash, redirect, render_template, request, session, \
url_for
from wtforms.fields.html5 import DecimalRangeField
from bson.objectid import ObjectId
from app import logger
from app.mod_budget.form import AddEntryForm, EditBudgetForm
from app.mod_budget.model import Category, CategoryBud... | Python | 0.999253 | @@ -2135,37 +2135,38 @@
$oid'%5D)%0A
-incom
+expens
e.owner = User.o
|
ea8b366f0619439bb02655cc77beca47d101a6df | Rename streams | jugg/core.py | jugg/core.py | import asyncio
import json
import pyarchy
import socket
import struct
from concurrent.futures import TimeoutError
from . import constants, security
class Datagram(object):
@classmethod
def from_string(cls, str_ : str):
return cls(**json.loads(str_))
def __init__(self,
command ... | Python | 0.000012 | @@ -1710,34 +1710,38 @@
__(self, stream_
-in
+reader
, stream_out):%0A
@@ -1733,19 +1733,22 @@
stream_
-out
+writer
):%0A
@@ -1800,19 +1800,29 @@
self._
-_in
+stream_reader
= strea
@@ -1823,18 +1823,22 @@
stream_
-in
+reader
%0A
@@ -1844,20 +1844,29 @@
self._
-_out
+stream_writer
= strea
... |
7906532576d13f28a353ca3ac628a9ff69bf6fcd | Kill unused import statement | sublime.py | sublime.py | """A plugin for Sublime Text to enhance f-string editing experience.
Specifically, this plugin simplifies typing of escaped curly braces
in an f-string:
{|}, where | is for cursir, gets replaced with
{{|, when '{' is typed again.
"""
import sublime
import sublime_plugin
class FstringbraceCommand(sublime_plug... | Python | 0 | @@ -240,23 +240,8 @@
%22%0A%0A%0A
-import sublime%0A
impo
|
9a1156f53c1f60f1cbd18fd486a87c72e2516889 | modify spacing | swc2vtk.py | swc2vtk.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 9 12:37:20 2016
@author: nebula
"""
import os
from swc import Swc
class VtkGenerator():
header_base = '''\
# vtk DataFile Version 3.0
VTK Example Cube
ASCII
DATASET UNSTRUCTURED_GRID
'''
def __init__(self):
self.header = self.header_base
... | Python | 0.000004 | @@ -4632,16 +4632,17 @@
l_list%0A%0A
+%0A
if __nam
@@ -4661,17 +4661,16 @@
in__':%0A%0A
-%0A
stop
|
6a36a2e97ab7a7bc86656415f6228c356083a779 | Increase timeout for UploadGMResults | master/skia_master_scripts/factory.py | master/skia_master_scripts/factory.py | # Copyright (c) 2012 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.
"""Utility class to build the Skia master BuildFactory's.
Based on gclient_factory.py and adds Skia-specific steps."""
import ntpath
import posixpath
... | Python | 0.000001 | @@ -7063,16 +7063,30 @@
Results'
+, timeout=1200
)%0A%0A def
|
269cc52852baa7acfd3dec86584d035a87f467a7 | add gcf openflow aggs too | src/python/expedient/clearinghouse/commands/management/commands/load_openflow_data.py | src/python/expedient/clearinghouse/commands/management/commands/load_openflow_data.py | '''
Created on Oct 7, 2010
@author: jnaous
'''
import re
from django.core.management.base import NoArgsCommand
from expedient.clearinghouse.project.models import Project
try:
from json import load
except ImportError:
from simplejson import load
from openflow.plugin.models import OpenFlowAggregate, OpenFlowIn... | Python | 0 | @@ -165,16 +165,81 @@
Project%0A
+from expedient_geni.gopenflow.models import GCFOpenFlowAggregate%0A
try:%0A
@@ -2744,24 +2744,181 @@
%0A ),%0A
+ make_option(%0A '--append', action='store_true', dest='append',%0A help='Add the information to the slice or replace?',%0A )... |
ef616ed18854eee64f8a49468195e99e989fe20f | Grr, wrong name | kiwi/dist.py | kiwi/dist.py | #
# Kiwi: a Framework and Enhanced Widgets for Python
#
# Copyright (C) 2005 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.982879 | @@ -2802,52 +2802,8 @@
x):%0A
- name = self.distribution.get_name()%0A
|
b3041b7aab663b8d02c08826142922e938d05341 | Update news | kuas/news.py | kuas/news.py | # -*- coding: utf-8 -*-
ENABLE = 1
NEWS_ID = 25
NEWS_TITLE = "高應盃籃球錦標賽"
NEWS_IMAGE = "http://i.imgur.com/NAxVxbV.jpg"
NEWS_URL = "http://goo.gl/Yh1iIF"
NEWS_CONTENT = """
"""
def news_status():
return [ENABLE, NEWS_ID]
def news():
"""
News for kuas.
return [enable, news_id, news_title, news_templat... | Python | 0.000001 | @@ -559,24 +559,8 @@
ter;
-margin-top:-15px
'%3E%22%0A
@@ -642,28 +642,8 @@
uto;
-margin-bottom:-15px;
max-
@@ -684,16 +684,25 @@
t:auto;'
+ ng-cache
src='%22%0A
|
6f88063fae644bd55d3dbe7688d6f4f19aa9115d | bump version to 7.0.1.dev0 | praw/const.py | praw/const.py | """PRAW constants."""
from .endpoints import API_PATH # noqa: F401
__version__ = "7.0.0"
USER_AGENT_FORMAT = "{} PRAW/" + __version__
MAX_IMAGE_SIZE = 512000
MIN_JPEG_SIZE = 128
MIN_PNG_SIZE = 67
JPEG_HEADER = b"\xff\xd8\xff"
PNG_HEADER = b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"
| Python | 0.000001 | @@ -81,16 +81,21 @@
= %227.0.
+1.dev
0%22%0A%0AUSER
|
2746e85066c0bf7c2f62b7f384a9a0ccd1179eb1 | indent the json in pre-commit hook so diffs look nice | pre-commit.py | pre-commit.py | #!/usr/bin/env python
import os
import json
import fnmatch
import subprocess
def strip_output_cell(fn):
changed = False
with open(fn, "r") as f:
js = json.load(f)
for cell in js["cells"]:
if cell["cell_type"] == "code":
if len(cell["outputs"]) != 0:
... | Python | 0 | @@ -594,16 +594,26 @@
mp(js, f
+, indent=2
)%0A%0Arepo_
|
ead5cac883124d7b89a2399f20904666428b2bb1 | drop gensim requirement | lda/parse.py | lda/parse.py | import json
import gensim
import sys, os, glob
import codecs
import utils
import nltk
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.WordNetLemmatizer()
stem = stemmer.lemmatize
else:
stemmer = nltk.stem.porter.PorterStemmer()
stem = stemmer.stem
stops = set(map(lambda s: s.strip(),
... | Python | 0 | @@ -9,22 +9,8 @@
son%0A
-import gensim%0A
impo
|
20809c17d6e7cb4e71f52b9cdc2755d2ce7b0ac1 | bump version to 0.8.0 | lifelines/version.py | lifelines/version.py | from __future__ import unicode_literals
__version__ = '0.7.1.0'
| Python | 0.000001 | @@ -55,11 +55,11 @@
'0.
-7.1
+8.0
.0'%0A
|
3c1e83ce79ef05fab0b7b91077c94351bbfa2f91 | remove testInternational2() | apps/authentication/tests.py | apps/authentication/tests.py | import logging
from copy import deepcopy
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.utils import timezone
from django_dynamic_fixture import G
f... | Python | 0.000003 | @@ -3271,196 +3271,8 @@
r)%0A%0A
- def testInternational2(self):%0A self.user.started_date = self.now.date() - timedelta(days=365)%0A self.user.field_of_study = 90%0A self.assertEqual(4, self.user.year)%0A%0A
|
f765d8ec947f7f2ec8a2fe1779ee0a45fc9dd81e | Fix bug reported by Simon | apps/project_sheet/models.py | apps/project_sheet/models.py | # -*- coding: utf-8 -*-
# import stuff we need from django
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from autoslug.fields import AutoSlugField
from imagekit.models import ImageModel
from tagging.fie... | Python | 0 | @@ -5796,16 +5796,21 @@
%25s%22 %25 (
+self.
project,
@@ -5810,16 +5810,21 @@
roject,
+self.
user)%0A%0A%0A
|
94a91f128b046a818acb873579c8aadd41aa5c3a | Fix remaining load_suparsers typo instance | test/streamparse/cli/test_sparse.py | test/streamparse/cli/test_sparse.py | from __future__ import absolute_import, unicode_literals
import argparse
import unittest
from streamparse.cli import sparse
from nose.tools import ok_
class SparseTestCase(unittest.TestCase):
def test_load_subparsers(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(... | Python | 0.000001 | @@ -337,16 +337,17 @@
.load_su
+b
parsers(
|
e0a0d4e8d403fec54cf9dae6c22c63c5fe21b9c0 | Modify description of replication() | processing.py | processing.py | # Copyright (c) 2016 Kirill 'Kolyat' Kiselnikov
# This file is the part of chainsyn, released under modified MIT license
# See the file LICENSE.txt included in this distribution
"""
Module "processing" with processing functions
replication() - function of DNA replication
"""
def replication(dna_chain):
"""
F... | Python | 0 | @@ -492,24 +492,316 @@
nd DNA chain
+%0A%0A Raises an exception if fails:%0A - TypeError -- when dna_chain is not string, list or tuple;%0A - ValueError -- when dna_chain is empty or contains forbidden%0A characters (non-alphabetic)%0A - KeyError - when dna_chain contains... |
510b0d2c1ff4d09a743792b58fa88ee33307891b | Check external links via HEAD Closes #9 | test_course/py_course_test/links.py | test_course/py_course_test/links.py | #!/bin/env python
# -*- coding: utf-8 -*-
"""
Check links within the course. Specifically these link types:
- Internal jump_to links
- Internal static links
- External links
"""
import HTMLParser
import os
from BeautifulSoup import BeautifulStoneSoup
from opaque_keys import InvalidKeyError
from xmodule.modulestore.exc... | Python | 0 | @@ -281,24 +281,40 @@
lidKeyError%0A
+import requests%0A
from xmodule
@@ -2085,24 +2085,754 @@
)%0A%0A%0A
+def check_external(element, href):%0A %22%22%22%0A This will go ahead and try and get the URL linked to%0A and if it is a 404 returns a failed test result.%0A %22%22%22%0A result_msg = No... |
26dcd1ce43864de77c1cd26065c09cc2b4c4788e | Make use of chained comparisons | tests/fuzzer/test_random_content.py | tests/fuzzer/test_random_content.py | # Copyright (c) 2016 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import pytest
import fuzzinator
@pytest.mark.parametrize('fuzzer_kwa... | Python | 0.000004 | @@ -13,16 +13,21 @@
(c) 2016
+-2021
Renata
@@ -682,19 +682,8 @@
sert
- out_len %3E=
exp
@@ -691,19 +691,18 @@
min_len
-and
+%3C=
out_len
|
958d598f500d10e6ef802020cbf3708431018eee | Fix diff usage of test | tests/ldap_sync/test_record_diff.py | tests/ldap_sync/test_record_diff.py | # Copyright (c) 2022. The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details
import pytest
from ldap_sync import types
from ldap_sync.action import AddAction, DeleteAction, IdleAction, ... | Python | 0 | @@ -1143,78 +1143,58 @@
rror
-):%0A # pylint: disable=expression-not-assigned%0A
+, match=%22different dn%22):%0A _ = diff_
record
- -
+s(
User
@@ -1228,16 +1228,25 @@
ttrs=%7B%7D)
+, record)
%0A%0A%0Adef t
|
cd3821260dfe9f03384eeeba25609b964832d743 | fix test | tests/test_apis/test_cordprotein.py | tests/test_apis/test_cordprotein.py | import unittest
from biothings_explorer.registry import Registry
from biothings_explorer.user_query_dispatcher import SingleEdgeQueryDispatcher
reg = Registry()
class TestSingleHopQuery(unittest.TestCase):
def test_protein2protein(self):
"""Test protein-protein"""
seqd = SingleEdgeQueryDispatcher... | Python | 0.000002 | @@ -3881,28 +3881,18 @@
put_id='
-PR:000008999
+pr
',%0A
@@ -3939,12 +3939,20 @@
es='
-3684
+PR:000008999
')%0A
|
c2d3a3a4a6ad43115459977d0d88a4878d0fb33a | Increase pylons.url testing to 100% | pylons/url.py | pylons/url.py | from repoze.bfg.threadlocal import get_current_registry
from pylons.interfaces import IRoutesMapper
def route_url(route_name, request, *elements, **kw):
try:
reg = request.registry
except AttributeError:
reg = get_current_registry() # b/c
mapper = reg.getUtility(IRoutesMapper)
route = ... | Python | 0 | @@ -1,12 +1,52 @@
+from repoze.bfg.encode import urlencode%0A
from repoze.
@@ -89,16 +89,59 @@
egistry%0A
+from repoze.bfg.url import _join_elements%0A%0A
from pyl
@@ -433,16 +433,26 @@
%0A if
+route and
'custom_
@@ -493,22 +493,52 @@
-return
+ route_name, request, elements, kw =
route.c
@@ -595,1... |
5edc773be179ebc21d65e8b06e8d66804b8f6b5f | Use 1 as default first index | python/ref.py | python/ref.py | # ref <master> <inputFile> <inds> <outputFile>
#
# compute summary statistics on an xyz stack
# each row is (x,y,z,timeseries)
#
import sys
import os
from numpy import *
from scipy.linalg import *
from scipy.sparse import *
from scipy.io import *
from pyspark import SparkContext
import logging
if len(sys.argv) < 4:... | Python | 0 | @@ -1073,19 +1073,16 @@
%5B0%5D == 1
-000
) & (k%5B1
@@ -1091,11 +1091,8 @@
== 1
-000
)).m
|
a1e284327c522a299928a58404797e6d6a3d4660 | correct issuer registration jsonschema | tob-api/api_v2/jsonschema/issuer.py | tob-api/api_v2/jsonschema/issuer.py | ISSUER_JSON_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"properties": {
"issuer": {
"type": "object",
"properties": {
# check length + valid characters?
"did": {"type": "string", "minLength": 1},
... | Python | 0.000002 | @@ -1050,169 +1050,8 @@
%22%7D,%0A
- %22cardinality_fields%22: %7B%0A %22type%22: %22array%22,%0A %22items%22: %7B%22type%22: %22string%22%7D,%0A %7D,%0A
@@ -1282,487 +1282,261 @@
%22
-from%22: %7B%0A ... |
10980027e621bbbb154d517dc630cb3b0e911ff5 | Disable smoothness.tough_webgl_cases | tools/perf/benchmarks/smoothness.py | tools/perf/benchmarks/smoothness.py | # Copyright (c) 2013 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.
from benchmarks import silk_flags
from measurements import smoothness
from telemetry import test
@test.Disabled # crbug.com/368767
class SmoothnessTop... | Python | 0.000035 | @@ -728,32 +728,90 @@
vas_cases.py'%0A%0A%0A
+@test.Disabled('linux', 'mac', 'win') # crbug.com/373812%0A
class Smoothness
|
8b7ec269dfc2991e23dcf1162abaff0f658083ff | Use isfile for server override, add print debug. | tools/update-setup-sandbox-local.py | tools/update-setup-sandbox-local.py | #!/usr/bin/python3
import sys
import os
import subprocess
import shutil
import socket
from os.path import expanduser
import shlex
import configparser
# Settings
home = expanduser("~")
repo_name=""
EMERGE_BASE=""
EMERGE_ETC=""
scriptsLocation=home + "/scripts/"
def generate_server_config():
config = configparser.Conf... | Python | 0 | @@ -83,38 +83,22 @@
ket%0A
-from os.path import expanduser
+import os.path
%0Aimp
@@ -503,22 +503,22 @@
os.path.
-exists
+isfile
(scripts
@@ -559,24 +559,81 @@
%7D.cfg' ):%0A
+ print('%7Bserverhost%7D.cfg' + %22 exists, using overrides%22)%0A
config.r
|
6f7943636f2222195a9c72bf4c3eb6e0ba3b6955 | make the combined parser lazy in a better way | src/parsy/__init__.py | src/parsy/__init__.py | # -*- coding: utf-8 -*- #
import re
from .version import __version__
class ParseError(RuntimeError):
pass
class Parser(object):
def __init__(self, fn):
self.fn = fn
def __call__(self, stream, index, on_success, on_failure):
return self.fn(stream, index, on_success, on_failure)
def p... | Python | 0.000008 | @@ -3063,41 +3063,118 @@
-return success(None).bind
+# this makes sure there is a separate instance of the generator%0A # for each parse%0A return Parser
(lambda
_: g
@@ -3169,17 +3169,21 @@
(lambda
-_
+*args
: genpar
@@ -3187,16 +3187,23 @@
parser()
+(*args)
)%0A%0Adef s
|
4c398a1f748f4688f30570ad2873841464bc9696 | fix esCore binding | src/pyESController.py | src/pyESController.py | '''
Copyright 2015, Institute e-Austria, Timisoara, Romania
http://www.ieat.ro/
Developers:
* Gabriel Iuhasz, iuhasz.gabriel@info.uvt.ro
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:
ht... | Python | 0 | @@ -953,25 +953,8 @@
rch(
-'109.231.121.210'
)%0A%0A#
|
37136603c1843e9992a316c6948f0d651a622939 | Add blacklist option to iteration over files | src/pybel_tools/io.py | src/pybel_tools/io.py | # -*- coding: utf-8 -*-
"""Additional input and output methods"""
import logging
import os
from pybel import from_path, from_pickle, to_pickle, union
from pybel.manager import Manager
__all__ = [
'from_path_ensure_pickle',
'from_directory',
'from_directory_pickles',
]
log = logging.getLogger(__name__)
... | Python | 0.000001 | @@ -1347,32 +1347,48 @@
ectory(directory
+, blacklist=None
):%0A %22%22%22Iterat
@@ -1472,32 +1472,116 @@
: The directory%0A
+ :param Optional%5Blist%5Bstr%5D%5D blacklist: An optional list of file names not to use%0A
:rtype: iter
@@ -1772,16 +1772,86 @@
if
+blacklist and path in blacklist:%0A ... |
a4ddd578f2c23299618dff254a6ae0aab64d8382 | Output RNA-eq specific parameters | src/rna_seq/models.py | src/rna_seq/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from analyses.models import AbstractAnalysisModel
from analyses.fields import StageStatusField
from analyses import pipelines
from analyses.tool_specs import ToolSpec, ToolSet
from data_sources.models import DataSource
ALL_TOOLS_IN_... | Python | 0.999949 | @@ -4247,16 +4247,1051 @@
lyses%22%0A%0A
+ def generate_analysis_info(self):%0A # Get the analysis_info from base classs%0A # Including data_sources, conditions, and etc.%0A analysis_info = super().generate_analysis_info()%0A%0A # Add RNA-seq specific analysis_info%0A parameters =... |
21017b79184459a6a2c0076d6cb1a60d3b1d3c12 | Fix errors in sim harness | src/run_similarity.py | src/run_similarity.py | import argparse
import datetime
from os import getcwd
from os.path import isdir, exists
from project import corpus, knn_corpus, lda_corpus, word2vec_corpus
algorithms = {"lda": lda_corpus.LDACorpus,
"knn": knn_corpus.KNNCorpus,
"w2v": word2vec_corpus.W2VCorpus}
base_dir = getcwd()
output_l... | Python | 0.000009 | @@ -832,29 +832,42 @@
ionary_loc %25
+ (algorithm,
size
+)
%0A cor
@@ -884,21 +884,34 @@
us_loc %25
+ (algorithm,
size
+)
%0A
@@ -938,16 +938,27 @@
_loc %25 (
+algorithm,
size, al
@@ -1025,16 +1025,21 @@
ctionary
+_file
=corpus_
@@ -1050,16 +1050,21 @@
, corpus
+_file
=corpus,
@@ -1153,23 +... |
b476480474fc6e49f425aeacda3661ee61454026 | Improve test_max_3pc_batches_in_flight | plenum/test/replica/test_max_3pc_batches_in_flight.py | plenum/test/replica/test_max_3pc_batches_in_flight.py | import pytest
from plenum.test.helper import max_3pc_batch_limits, sdk_send_random_requests, sdk_get_and_check_replies
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from stp_core.common.log import getlogger
BATCHES_TO_ORDER = 20
MAX_BATCHES_IN_FLIGHT = 4
logger = getlogger()
@pytest.f... | Python | 0 | @@ -8,16 +8,59 @@
pytest%0A%0A
+from plenum.test.delayers import delay_3pc%0A
from ple
@@ -241,44 +241,166 @@
rom
-stp_core.common.log import getlogger
+plenum.test.stasher import start_delaying, stop_delaying_and_process%0Afrom stp_core.common.log import getlogger%0Afrom stp_core.loop.eventually import eventually
... |
f256048258d7a7cb6cd34248db922e69e5b51a0b | add ophyd-olog hooks | profile_collection/startup/00-startup.py | profile_collection/startup/00-startup.py | import logging
from bluesky.standard_config import * # gs, etc.
import matplotlib.pyplot as plt
plt.ion()
from bluesky import qt_kicker
qt_kicker.install_qt_kicker()
from databroker import DataBroker as db, get_events, get_images, get_table
from epics import caput, caget
# connect olog
# gs.RE.logbook = olog_wrapper... | Python | 0.000001 | @@ -349,16 +349,142 @@
tion'%5D)%0A
+%0A# ophyd expects to find 'logbook' in the IPython namespace%0Afrom pyOlog import SimpleOlogClient%0Alogbook = SimpleOlogClient()%0A%0A
RE=gs.RE
|
3f9d560b58ea70902a19256a369da6f14c3615e4 | enable submitting jobs | py/desispec/scripts/healpix_redshifts.py | py/desispec/scripts/healpix_redshifts.py | """
script for running healpix-based coadds+redshifts, assuming that the
spectral regrouping into healpix has already happened
"""
import os, sys
import numpy as np
from desiutil.log import get_logger
from desispec.scripts.tile_redshifts import write_redshift_script
from desispec import io
def parse(options=None):
... | Python | 0 | @@ -140,16 +140,34 @@
os, sys%0A
+import subprocess%0A
import n
@@ -2736,24 +2736,612 @@
-print(batchscript)%0A
+log.info(f'Wrote %7Bbatchscript%7D')%0A if not args.nosubmit:%0A cmd = %5B'sbatch' ,%5D%0A if args.batch_reservation:%0A cmd.extend(%5B'--reservation', batch_reservation%5... |
b1e77aaf04c3697a074b6e977195b5be68d3f02a | Update conf.py | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | Python | 0.000001 | @@ -974,16 +974,143 @@
0.0.1'%0A%0A
+# Mock imports%0Aautodoc_mock_imports = %5B%0A %22numpy%22,%0A %22scipy%22,%0A %22astropy%22,%0A %22pymc3%22,%0A %22theano%22,%0A %22tensorflow%22%0A%5D%0A
%0A# -- Ge
@@ -5594,28 +5594,29 @@
----------------------------
+%0A
|
6c39874400a5d238977752d4ed54e7b35084ca1d | remove check for 'release' attribute | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# Astropy documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this file.
#
# All configurati... | Python | 0.000001 | @@ -5988,16 +5988,25 @@
ct'%5D%0A
+ # FAILS:
if vers
@@ -6025,36 +6025,45 @@
on.release:%0A
-
+# FAILS:
+
edit_on_github_b
@@ -6110,19 +6110,24 @@
%0A
+ # FAILS:
else:%0A
-
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.