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 |
|---|---|---|---|---|---|---|---|
db2cac49c0e4171150db5f561e0d6249b3ff83d3 | Use get_base_url from w3lib | crawler/urls/parser.py | crawler/urls/parser.py | import urllib.parse
import re
import crawler
from crawler.urls import validator
from crawler.urls import url_tools
def is_page_wiki(soup):
"""Detect if page is wiki, from soup"""
meta_generators = soup.find_all('meta', {'name': 'generator'})
for meta_generator in meta_generators:
content = meta_... | Python | 0 | @@ -626,16 +626,29 @@
exists)
+ - DEPRECATED
%22%22%22%0A
@@ -3281,16 +3281,18 @@
url)%0A
+ #
page_ba
@@ -3316,24 +3316,84 @@
(soup, url)%0A
+ page_base_url = w3lib.html.get_base_url(soup.html, url)%0A
canonica
|
bbb7b253290f0e4172bceb78ccc6e2c99ed0eafd | Break out of busy loop | serfnode/handler/launcher.py | serfnode/handler/launcher.py | #!/usr/bin/env python
from __future__ import print_function
import functools
import json
import os
import signal
import socket
import sys
import time
import docker_utils
import serf
def handler(name, signum, frame):
print('Should kill', name)
try:
cid = open('/child_{}'.format(name)).read().strip()
... | Python | 0.000004 | @@ -2584,16 +2584,34 @@
json'))%0A
+ break%0A
|
03b8e53bae5125ddf79df4803152909a27217510 | Bump version -> 0.2.4 | tagalog/__init__.py | tagalog/__init__.py | from __future__ import unicode_literals
import datetime
import os
from tagalog import io
__all__ = ['io', 'stamp', 'tag', 'fields']
__version__ = '0.2.3'
# Use UTF8 for stdin, stdout, stderr
os.environ['PYTHONIOENCODING'] = 'utf-8'
def now():
return _now().strftime('%Y-%m-%dT%H:%M:%S.%fZ')
def stamp(iterabl... | Python | 0.000001 | @@ -150,9 +150,9 @@
0.2.
-3
+4
'%0A%0A#
|
6be31b53136ac9170201bd752dfc9aae1ab2e5d5 | Fix blocking? | SynchronousMultiplayer/server.py | SynchronousMultiplayer/server.py | import random
import time
import socket
import json
WIDTH = 640
HEIGHT = 480
TCP_IP = "0.0.0.0"
TCP_PORT = 1337
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((TCP_IP, TCP_PORT))
s.listen(1)
ball = {
"x": WIDTH/2,
"y": HEIGHT/2,
"xvel": 6 * (random.randrange(0, 2)-0.5),
"yvel": 6 * (random.randran... | Python | 0.000001 | @@ -694,41 +694,8 @@
t()%0A
-bat_l%5B%22conn%22%5D.setblocking(False)%0A
prin
@@ -904,16 +904,86 @@
date():%0A
+%09bat_l%5B%22conn%22%5D.setblocking(False)%0A%09bat_r%5B%22conn%22%5D.setblocking(False)%0A%09%0A
%09try:%0A%09%09
@@ -1135,32 +1135,32 @@
code()%0A%09except:%0A
-
%09%09pass%0A%09%0A%09if bat
@@ -1152... |
36be2bfd750209a5f5e067a53a3a01a37fbf0efb | Add basic type hints to subaru (#69324) | homeassistant/components/subaru/lock.py | homeassistant/components/subaru/lock.py | """Support for Subaru door locks."""
import logging
import voluptuous as vol
from homeassistant.components.lock import LockEntity
from homeassistant.const import SERVICE_LOCK, SERVICE_UNLOCK
from homeassistant.helpers import entity_platform
from . import DOMAIN, get_device_info
from .const import (
ATTR_DOOR,
... | Python | 0 | @@ -125,16 +125,69 @@
kEntity%0A
+from homeassistant.config_entries import ConfigEntry%0A
from hom
@@ -262,38 +262,153 @@
ant.
-helpers import entity_platform
+core import HomeAssistant%0Afrom homeassistant.helpers import entity_platform%0Afrom homeassistant.helpers.entity_platform import AddEntitiesCallback
%0A%0A... |
bf3c508b83e9fe36588fa295cf61a59b64ebc94b | fix some plotting artifacts with previous commit | htdocs/plotting/auto/scripts100/p102.py | htdocs/plotting/auto/scripts100/p102.py | import psycopg2
import datetime
import numpy as np
from pandas.io.sql import read_sql
from pyiem.network import Table as NetworkTable
MARKERS = ['8', '>', '<', 'v', 'o', 'h', '*']
def get_description():
""" Return a dict describing how to call this plotter """
d = dict()
d['data'] = True
d['cache'] =... | Python | 0.000001 | @@ -345,16 +345,327 @@
'%5D = %22%22%22
+The National Weather Service issues Local Storm%0A Reports (LSRs) with a label associated with each report indicating the%0A source of the report. This plot summarizes the number of reports%0A received each year by each source type. The values are the ranks for%0A ... |
53e0af3e3affef71958fb253df685392720ec0ee | Handle malformed Exif timestamps | python/image-tools/set-exif-timestamp.py | python/image-tools/set-exif-timestamp.py | #!/usr/bin/env python
import datetime
import optparse
import os
import os.path
import struct
import sys
# sudo pip3 install piexif
import piexif
def main():
def set_exif_timestamp(dt_to_set):
print('Setting Exif timestamp to {}'.format(dt_to_set))
exif_data[exif_dt_location][piexif.Imag... | Python | 0.000108 | @@ -1787,16 +1787,113 @@
= None:%0A
+ # I've seen timestamp values that look like this: ' : : : : '%0A try:%0A
@@ -2013,24 +2013,179 @@
IME_FORMAT)%0A
+ except ValueError as e:%0A sys.stderr.write('WARNING: Malformed DateTime%5Cn')%0A sys.stderr.write... |
fa55f26521487c9df9ca6cf2fb256cfe24083cfc | make sure not to go through param's limit if param not in request | yard/__init__.py | yard/__init__.py | #!/usr/bin/env python
# encoding: utf-8
from django.core.paginator import Paginator, EmptyPage
from django.core import serializers
from utils import *
from utils.exceptions import RequiredParamMissing
from utils.http_responses import JsonResponse, HttpResponse, HttpResponseUnauthor... | Python | 0.000001 | @@ -4632,16 +4632,71 @@
ame'%5D )%0A
+ if not value: return None%0A %0A
|
655cdb0c58a6eeb268c80818fa3a245c06f9404b | put tree_li on old | modules/vcms/apps/vwm/tree/generator.py | modules/vcms/apps/vwm/tree/generator.py | # encoding: utf-8
# copyright Vimba inc. 2010
# programmer : Francis Lavoie
from django import template
from django.template.loader import render_to_string
register = template.Library()
@register.inclusion_tag('tree/tree_dl.html')
def generetate_dl_tree(data, cssid, cssclass):
return {"data":data, "cssid":cssid,... | Python | 0.000003 | @@ -1716,32 +1716,133 @@
%0A return
+_generetate_dl_tree(data, cssid, cssclass)%0A # TODO: add generate_li_tree code%0A #return
_generetate_li_t
|
ca1393680444c1412ce64bad82dd5fc9283a9860 | Update route_guide_client.py | python/route_guide/route_guide_client.py | python/route_guide/route_guide_client.py | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | Python | 0 | @@ -4373,26 +4373,25 @@
eature(stub)
-;
%0A
+
print %22-
@@ -4458,25 +4458,24 @@
atures(stub)
-;
%0A print %22
@@ -4545,17 +4545,16 @@
te(stub)
-;
%0A pri
@@ -4590,32 +4590,32 @@
--------------%22%0A
+
guide_route_
@@ -4624,17 +4624,16 @@
at(stub)
-;
%0A%0A%0Aif __
|
eaacdc2824b64b5d27ed0d17135ef12f555648f1 | Support /api_req_combined_battle/sp_midnight in the screen transition. | server/kcaa/kcsapi/client.py | server/kcaa/kcsapi/client.py | #!/usr/bin/env python
import jsonobject
from kcaa import screens
import model
class Screen(model.KCAAObject):
"""Current screen.
This object provides the best guess of the current screen that the client
(Kancolle Flash player) is currently showing to the user.
"""
screen = jsonobject.JSONProper... | Python | 0 | @@ -1581,32 +1581,120 @@
ON_NIGHTCOMBAT,%0A
+ '/api_req_combined_battle/sp_midnight':%0A screens.EXPEDITION_NIGHTCOMBAT,%0A
'/api_re
|
5973786cf8b164732214385f4d150f33deb07d83 | Add ComplexStateTransition handler base | yawf/handlers.py | yawf/handlers.py | import logging
import collections
from yawf.permissions import BasePermissionChecker, OrChecker
logger = logging.getLogger(__name__)
class Handler(object):
'''
Basic class to express state transitions, both simple and extended.
Handler object is a callable. It gets a workflow object, message sender
... | Python | 0 | @@ -3395,8 +3395,246 @@
tate_to%0A
+%0A%0Aclass ComplexStateTransition(Handler):%0A%0A def transition(self, obj, sender, **kwargs):%0A raise NotImplementedError%0A%0A def perform(self, obj, sender, **kwargs):%0A return lambda obj: self.transition(obj, sender, **kwargs)%0A
|
0055e044a504e37fa96359e1bdb161fbad1acf78 | Update about_new_style_classes.py | python2/koans/about_new_style_classes.py | python2/koans/about_new_style_classes.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutNewStyleClasses(Koan):
class OldStyleClass:
"An old style class"
# Original class style have been phased out in Python 3.
class NewStyleClass(object):
"A new style class"
# Introduced in Python... | Python | 0.000001 | @@ -1294,18 +1294,26 @@
rtEqual(
-__
+'classobj'
, type(s
|
1994ef0f7d4b12421d0cfb3347212e403bdfbde5 | Make it conform to what is displayed to the user | sample_app/utils.py | sample_app/utils.py | from urllib.parse import urlencode
import tornado.web
import ipy_table
from transperth.jp.location import Location
from transperth_auth import TransperthAuthMixin
from transperth.smart_rider.smart_rider import smartrider_format
class BaseRequestHandler(TransperthAuthMixin, tornado.web.RequestHandler):
@propert... | Python | 0.000001 | @@ -1187,53 +1187,8 @@
s):%0A
- if 'smart_riders' not in kwargs:%0A
@@ -1218,20 +1218,16 @@
s'%5D = (%0A
-
@@ -1271,27 +1271,19 @@
- )%0A%0A
+)%0A%0A
@@ -1327,16 +1327,36 @@
, None)%0A
+ if sr_code:%0A
@@ -1923,16 +1923,24 @@
%5Bsr_num%5D
+%... |
327903dce8105c320ed1188587e2104dd2ad2c04 | fix bug | ThingCloud/OrderSystem/models.py | ThingCloud/OrderSystem/models.py | # -*- coding: utf-8 -*-
from django.db import models
from AccountSystem.models import User
from CloudList.models import Address, WareHouse
from MainSystem.models import Employee
from django.forms.models import model_to_dict
from TCD_lib.utils import dictPolish
# Create your models here.
class Courier(models.Model):
... | Python | 0.000001 | @@ -1362,16 +1362,25 @@
courier.
+employee.
id%0A
@@ -1420,16 +1420,25 @@
courier.
+employee.
name%0A
|
7e60524b9443d1815334aa7df9b44cfe363acafd | Update to version v0.7.7rc2 | sandman/__init__.py | sandman/__init__.py | """Sandman automatically generates a REST API from your existing database,
without you needing to tediously define the tables in typical ORM style. Simply
create a class for each table you want to expose in the API, give it's
associated database table, and off you go! The generated API essentially exposes
a completely ... | Python | 0 | @@ -554,7 +554,7 @@
.7rc
-1
+2
'%0A
|
41d45d7dce8756658ec3d28540f4a5bce425ff1d | Update instagram regex. | icekit/plugins/instagram_embed/forms.py | icekit/plugins/instagram_embed/forms.py | import re
from django import forms
from fluent_contents.forms import ContentItemForm
class InstagramEmbedAdminForm(ContentItemForm):
def clean_url(self):
"""
Make sure the URL provided matches the instagram URL format.
"""
url = self.cleaned_data['url']
if url:
... | Python | 0 | @@ -357,22 +357,28 @@
tagr
-.?am(
+(%5C.am%7Cam%5C
.com)
-?
/p/
+%5CS+
')%0A
|
82f66f42d5fee210c3bb2e535d559c5a5dbfccc4 | Clarify message for Unicode argument requrement | crypto_enigma/utils.py | crypto_enigma/utils.py | #!/usr/bin/env python
# encoding: utf8
# Copyright (C) 2015 by Roy Levien.
# This file is part of crypto-enigma, an Enigma Machine simulator.
# released under the BSD-3 License (see LICENSE.txt).
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division... | Python | 0.00055 | @@ -2167,25 +2167,15 @@
be
-a
Unicode
- literal
%22.fo
|
0f9bdbcd2c0f927097f534770c56e96244ce28a5 | Add a textarea widget | yyafl/widgets.py | yyafl/widgets.py | from yyafl.util import flatatt, smart_unicode
class Widget(object):
is_hidden = False
def __init__(self, attrs = None):
if attrs is not None:
self.attrs = attrs.copy()
else:
self.attrs = {}
def render(self, name, value, attrs = None):
"""
Returns ... | Python | 0.000002 | @@ -41,16 +41,17 @@
icode%0A%0A%0A
+%0A
class Wi
@@ -992,16 +992,300 @@
pass%0A%0A
+class TextArea(Widget):%0A def render(self, name, value, attrs = None):%0A if value is None: value = '' # default value%0A final_attrs = self.build_attrs(attrs, name=name)%0A%0A return u'%3Ctextarea' + flata... |
3f3df6c52c51ce9b454cc4c2643ae5f4f170f51a | Remove fancy integration | sasmodels/sesans.py | sasmodels/sesans.py | """
Conversion of scattering cross section from SANS (I(q), or rather, ds/dO) in absolute
units (cm-1)into SESANS correlation function G using a Hankel transformation, then converting
the SESANS correlation function into polarisation from the SESANS experiment
Everything is in units of metres except specified otherwis... | Python | 0 | @@ -577,17 +577,17 @@
import j
-1
+0
%0A%0A%0Aclass
@@ -2083,85 +2083,9 @@
ngth
-, dtype='float64')%0A%0A # Rmax = #value in text box somewhere in FitPage?
+)
%0A
@@ -2207,72 +2207,8 @@
- # q = np.arange(q_min, q_max, q_min, dtype='float32')%0A #
q =
@@ -2266,70 +2266,27 @@
log(
-2),%0A ... |
f459fd25b774d59a263edc220b6b0289209d30d9 | Bump version; 0.1.5.dev1 | tdclient/version.py | tdclient/version.py | __version__ = "0.1.5.dev0"
| Python | 0.000004 | @@ -17,11 +17,11 @@
.1.5.dev
-0
+1
%22%0A
|
f99315cda065d5f869114f725a52e7d79189a041 | update sitemap generation for multiple profiles and ref GetRepositoryItem | sbin/gen_sitemap.py | sbin/gen_sitemap.py | #!/usr/bin/python
# -*- coding: ISO-8859-15 -*-
# =================================================================
#
# $Id$
#
# Authors: Tom Kralidis <tomkralidis@hotmail.com>
#
# Copyright (c) 2011 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and ass... | Python | 0.000001 | @@ -1398,16 +1398,26 @@
sitory%0A%0A
+import os%0A
from lxm
@@ -1457,16 +1457,42 @@
config,
+ core_queryables, profile,
reposit
@@ -1590,19 +1590,65 @@
g')%0AREPO
+S
=
+%7B%7D%0A%0AREPOS%5BCFG%5B'repository'%5D%5B'typename'%5D%5D = %5C%0A
reposito
@@ -1685,17 +1685,17 @@
%5D%5B'db'%5D,
-%0A
+
CFG%5B'rep
@... |
47b3472b5036c7b8f7cb263c13816715a96c4ec4 | add --ignore-warnings option (forces write of new sample sheet even if errors are detected). | illumina2cluster/update_sample_sheet.py | illumina2cluster/update_sample_sheet.py | #!/bin/env python
#
# update_sample_sheet.py: edit sample sheet files from Illumina sequencer
# Copyright (C) University of Manchester 2012 Peter Briggs
#
########################################################################
#
# update_sample_sheet.py
#
#######################################################... | Python | 0 | @@ -4129,24 +4129,282 @@
1,3-5,7)%22)%0A
+ p.add_option('--ignore-warnings',action=%22store_true%22,dest=%22ignore_warnings%22,default=False,%0A help=%22ignore warnings about spaces and duplicated sampleID/sampleProject %22%0A %22combinations when writing new samplesheet.csv file%22... |
e2d0e830c2b9b8615523d73ee53fb86d98c59c3b | Bump version; 0.12.1.dev0 [ci skip] | tdclient/version.py | tdclient/version.py | __version__ = "0.12.0"
| Python | 0 | @@ -13,11 +13,16 @@
= %220.12.
+1.dev
0%22%0A
|
230516d4b4b2a4f5becd446465c4bc5ed46c39b6 | Initialize database if the tables doesn't exist. | danbooru/database.py | danbooru/database.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright 2012 codestation
#
# 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
#
# Unl... | Python | 0 | @@ -868,16 +868,187 @@
dbname)%0A
+ try:%0A f = open(%22danbooru-db.sql%22)%0A self.conn.executescript(f.read())%0A self.conn.commit()%0A except IOError:%0A pass%0A
|
1179f0afbf3c3a6a306979306f2c4fa4e8669e09 | load example configs for defaults | service/quickstart/config.py | service/quickstart/config.py | import ConfigParser
import os
class Config:
defaults = {}
configfiles = ['whatsapp.conf', 'service/whatsapp.conf']
config=None
@classmethod
def get(self, section, value):
if not self.config:
# load configuration file once
self.config = ConfigParser.RawConfigParser(... | Python | 0 | @@ -65,23 +65,167 @@
-configfiles = %5B
+# load example.conf for defaults and overwrite if a real config has been created.%0A configfiles = %5B'whatsapp.example.conf', 'service/whatsapp.example.conf',
'wha
|
263797516b2fb2b16c717b943571218eb3e68e7b | Clean up docstrings. | networkx/algorithms/tree/recognition.py | networkx/algorithms/tree/recognition.py | #-*- coding: utf-8 -*-
"""
We use the following definitions:
A forest is an (undirected) graph with no cycles.
A tree is a connected forest.
A directed forest is a directed graph whose underlying graph is a forest.
A directed tree is a (weakly) connected, directed forest.
Equivalently: It is a directed graph whos... | Python | 0 | @@ -1527,15 +1527,18 @@
if
-you had
+there were
two
@@ -3516,134 +3516,172 @@
hs,
-the direction of edges is ignored, and the graph %60G%60%0A is considered to be a directed tree if the underlying graph is a tree
+%60G%60 is a tree if the underlying graph is a tree. The%0A underlying graph is obtained by t... |
61dd8fcf801572cce97e3385a7928e5714359539 | add a docstring that makes sense | nikola/plugins/command/install_theme.py | nikola/plugins/command/install_theme.py | # -*- coding: utf-8 -*-
# Copyright © 2012-2013 Roberto Alsina and others.
# 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 t... | Python | 0.000002 | @@ -1425,25 +1425,23 @@
%22%22%22
-Start test server
+Install a theme
.%22%22%22
|
3880b2990b2f2360d27c1be86f60b482742a1506 | Make jobs more consistent. | custodian/vasp/jobs.py | custodian/vasp/jobs.py | #!/usr/bin/env python
"""
This module implements basic kinds of jobs for VASP runs.
"""
from __future__ import division
__author__ = "Shyue Ping Ong"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__status__ = "Beta"
__date__ = "2/4/13"
import subprocess
import os
import shuti... | Python | 0.0001 | @@ -2649,16 +2649,94 @@
ct, %22.%22)
+%0A for f in input_files:%0A shutil.copy(f, %22%7B%7D.orig%22.format(f))
%0A%0A de
@@ -3716,36 +3716,36 @@
shutil.
-copy
+move
(f, %22%7B%7D.relax2%22.
|
aa6d10aab91423e9f190af248de9bc591cc90dd2 | Add slots to DummyLock. | daapserver/provider.py | daapserver/provider.py | from datetime import datetime
import cStringIO
__all__ = ("LocalFileProvider", "Provider", "Session")
class DummyLock(object):
def __enter__(self):
pass
def __exit__(self, typ, value, traceback):
pass
class Session(object):
__slots__ = ("revision", "since")
def __init__(self):
... | Python | 0 | @@ -244,24 +244,74 @@
on(object):%0A
+ %22%22%22%0A Represents a client session.%0A %22%22%22%0A%0A
__slots_
@@ -334,16 +334,39 @@
%22since%22
+, %22user_agent%22, %22state%22
)%0A%0A d
@@ -406,24 +406,55 @@
evision = 0%0A
+ self.user_agent = None%0A
self
@@ -481,33 +481,219 @@
w(... |
70fa93238128440f7098940ebc67d5bb56ae8dcb | make more consistent | dacsspace/validator.py | dacsspace/validator.py | import json
from jsonschema import Draft202012Validator
class Validator:
"""Validates data from ArchivesSpace."""
def __init__(self, schema_identifier, schema_filepath):
"""Loads and validates the schema from an identifier or filepath.
Args:
schema_identifier (str): a pointer to... | Python | 0.000002 | @@ -1345,16 +1345,21 @@
dating %7B
+repr(
error.va
@@ -1369,10 +1369,9 @@
ator
-!r
+)
%7D in
|
a1b31a6c2029aac2b07ddc9fde8c23c44b951d04 | Check for app_context and request in g to prevent Attribute Errors. | app/celery/celery.py | app/celery/celery.py | import time
from gds_metrics.metrics import Histogram
from celery import Celery, Task
from celery.signals import worker_process_shutdown
from flask import g, request
from flask.ctx import has_request_context
@worker_process_shutdown.connect
def log_on_worker_shutdown(sender, signal, pid, exitcode, **kwargs):
# i... | Python | 0 | @@ -5,17 +5,16 @@
rt time%0A
-%0A
from gds
@@ -200,16 +200,33 @@
_context
+, has_app_context
%0A%0A%0A@work
@@ -2321,17 +2321,16 @@
s or %7B%7D%0A
-%0A
@@ -2469,18 +2469,39 @@
elif
-g.
+has_app_context() and '
request_
@@ -2502,16 +2502,22 @@
quest_id
+' in g
:%0A
|
2c6a6f62cabf72ae160c0550d8554fc3aab2780c | fix порядок набора данных на графике | dashboards/sql_func.py | dashboards/sql_func.py | import hashlib
import pickle
import psycopg2
from laboratory import VERSION
from laboratory.settings import DASHBOARD_CHARTS_CACHE_TIME_SEC
from utils.db import namedtuplefetchall
from django.db import connection
from django.core.cache import cache
def get_charts_dataset(dashboard_pk):
with connection.cursor() as... | Python | 0 | @@ -2040,24 +2040,61 @@
charts.order
+, dashboards_dashboardchartdata.order
%0A %22%22%22
|
3362c5b81499e2db50fbeac901427928d0a4541a | Remove debug remnant | instana/instrumentation/celery/hooks.py | instana/instrumentation/celery/hooks.py | from __future__ import absolute_import
import opentracing
from ...log import logger
from ...singletons import tracer
try:
import celery
from celery import registry, signals
from .catalog import task_catalog_get, task_catalog_pop, task_catalog_push, get_task_id
from celery.contrib import rdb
try:
... | Python | 0.000001 | @@ -271,43 +271,8 @@
k_id
-%0A from celery.contrib import rdb
%0A%0A
|
87bc8092a86fb9e6fd10a4a620def2a22c742003 | Simplify code a bit | integration-tests/features/src/utils.py | integration-tests/features/src/utils.py | """Unsorted utility functions used in integration tests."""
import requests
import subprocess
def download_file_from_url(url):
"""Download file from the given URL and do basic check of response."""
assert url
response = requests.get(url)
assert response.status_code == 200
assert response.text is n... | Python | 0.000037 | @@ -1220,25 +1220,25 @@
= %5Bx
- if x !=
+.replace(
password
els
@@ -1237,19 +1237,16 @@
word
- else
+,
'***'
+)
for
|
c9f294a1c9284975e711dbe0b37519e68606543c | Update ripencc.py | intelmq/bots/experts/ripencc/ripencc.py | intelmq/bots/experts/ripencc/ripencc.py | from intelmq.lib.bot import Bot, sys
from intelmq.bots.experts.ripencc.lib import RIPENCC
'''
Reference: https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=1.1.1.1
FIXME: Create a cache.
'''
class RIPENCCExpertBot(Bot):
def process(self):
event = self.receive_message()
... | Python | 0 | @@ -185,32 +185,129 @@
%0D%0A%0D%0A
-FIXME: Create a cache.%0D%0A
+TODO:%0D%0ALoad RIPE networks prefixes into memory.%0D%0ACompare each IP with networks prefixes loadad.%0D%0AIf ip matchs, query RIPE
%0D%0A''
|
e85fcd553756eab32cedca214c9b8b86ff48f8b8 | Make workload optional when editing vacancies | app/forms/vacancy.py | app/forms/vacancy.py | from flask_wtf import Form
from flask_babel import lazy_gettext as _ # noqa
from wtforms import StringField, SubmitField, TextAreaField, \
DateField, SelectField
from wtforms.validators import InputRequired
class VacancyForm(Form):
title = StringField(_('Title'), validators=[InputRequired(
message=_(... | Python | 0.000003 | @@ -1092,81 +1092,8 @@
ad')
-, validators=%5BInputRequired(%0A message=_('Workload is required.'))%5D
)%0A
|
c3cb5035889b7a428d0f2d99719765b6e1218e19 | Change initial twiss parameters | sirius/LI_V00/accelerator.py | sirius/LI_V00/accelerator.py |
import numpy as _np
import lnls as _lnls
import pyaccel as _pyaccel
from . import lattice as _lattice
_default_cavity_on = False
_default_radiation_on = False
_default_vchamber_on = False
def create_accelerator():
accelerator = _pyaccel.accelerator.Accelerator(
lattice=_lattice.create_lattice(),
... | Python | 0.000001 | @@ -950,15 +950,13 @@
ha=%5B
--1.0,-1
+0.0,0
.0%5D)
|
203d4ce11c461e62c0b847e5b7180a988cacb339 | Use alternate Markdown heading syntax | scripts/jsondiff.py | scripts/jsondiff.py | #! /usr/bin/env python3
"""Compares statuses of packages across two JSON files"""
import json
import blessings
import click
def has_misnamed(rpms):
for rpm in rpms:
if rpms[rpm].get('is_misnamed'):
return True
def compare_statuses(first, second):
first_status = first.get('status', 'mis... | Python | 0 | @@ -3676,24 +3676,68 @@
ora data'))%0A
+ print(term.green('=================='))%0A
print()%0A
@@ -4284,11 +4284,8 @@
en('
-##
Nami
@@ -4301,24 +4301,71 @@
changes'))%0A
+ print(term.green('---------------------'))%0A
print()%0A
|
f94061d2aefa3c8b42bca884d4f98bad34ca2a81 | Load new brief_response_manifests | app/main/__init__.py | app/main/__init__.py | from flask import Blueprint
from dmcontent.content_loader import ContentLoader
main = Blueprint('main', __name__)
content_loader = ContentLoader('app/content')
content_loader.load_manifest('g-cloud-6', 'services', 'edit_service')
content_loader.load_messages('g-cloud-6', ['dates', 'urls'])
content_loader.load_manife... | Python | 0.000001 | @@ -950,32 +950,139 @@
rief_response')%0A
+content_loader.load_manifest('digital-outcomes-and-specialists', 'brief-responses', 'edit_brief_response')%0A
content_loader.l
|
240c274fb8f5620ffb08ba8a6f06ff377c749fdb | fix import | acq4/devices/Pipette/__init__.py | acq4/devices/Pipette/__init__.py | from __future__ import print_function
from .pipette import Pipette | Python | 0.000001 | @@ -55,12 +55,30 @@
port Pipette
+, PipetteDeviceGui
|
9f725a6c4481d65e95c1d3119c96b13cd0543604 | Change the database connection | kinoreel_backend/settings/production.py | kinoreel_backend/settings/production.py | from .base import *
# SECURITY CONFIG
DEBUG = True
ALLOWED_HOSTS = ['api.kino-project.tech']
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
| Python | 0.000002 | @@ -91,16 +91,287 @@
tech'%5D%0A%0A
+try:%0A from .GLOBALS import *%0Aexcept ImportError or ModuleNotFoundError:%0A PG_SERVER = os.environ%5B'PG_SERVER'%5D%0A PG_PORT = os.environ%5B'PG_PORT'%5D%0A PG_DB = os.environ%5B'PG_DB'%5D%0A PG_USERNAME = os.environ%5B'PG_USERNAME'%5D%0A PG_PASSWORD = os.envi... |
e4426ed90b883ffd6526fc9cc1f1011f215a9b38 | Correct env test. | scripts/test-env.py | scripts/test-env.py | """
This script tests whether the current environment works correctly or not.
"""
import sys; sys.path.insert(0, '../')
import geoplot as gplt
from geoplot import crs as gcrs
import geopandas as gpd
# cf. https://github.com/Toblerity/Shapely/issues/435
# Fiona/Shapely/Geopandas test.
cities = gpd.read_file("../data... | Python | 0 | @@ -339,23 +339,28 @@
g.shp%22)%0A
-borough
+census_tract
s = gpd.
@@ -386,25 +386,40 @@
nyc_
-boroughs/boroughs
+census_tracts/census_tracts_2010
.geo
|
ca496c21989d92b0e1d717faa4e834326188e546 | fix lxml import after P3 migration | addons/board/controllers/main.py | addons/board/controllers/main.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from xml.etree import ElementTree
from odoo.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, action_id, co... | Python | 0.000001 | @@ -102,25 +102,20 @@
rom
+l
xml
-.etree
import
Elem
@@ -110,16 +110,25 @@
import
+etree as
ElementT
|
2627c2c5ea6fdbff9d9979765deee8740a11c7c9 | Fix module packaging thanks to landscape.io hint | backend/globaleaks/handlers/__init__.py | backend/globaleaks/handlers/__init__.py | # -*- encoding: utf-8 -*-
#
# In here you will find all the handlers that are tasked with handling the
# requests specified in the API.
#
# From these handlers we will be instantiating models objects that will take care
# of our business logic and the generation of the output to be sent to GLClient.
#
# In here we are ... | Python | 0 | @@ -619,26 +619,8 @@
e',%0A
- 'css',%0A
|
077e0799490c5eed2e7fcb9206cc4e4877c56ecc | True = True | app/members/tests.py | app/members/tests.py | from django.test import TestCase
class TestTestCase(TestCase):
def setUp(self):
self.truthy = True
def test_true(self):
"""Ensures that the value of true holds"""
self.assertEqual(self.truthy, False) | Python | 0.999999 | @@ -224,10 +224,9 @@
hy,
-Fals
+Tru
e)
|
6d15d77624dbb35ed415c4fbadd4eb84ec87eab3 | Add config for delimiter | smt/phrase/phrase_extract.py | smt/phrase/phrase_extract.py | #! /usr/bin/env python
# coding:utf-8
def phrase_extract(es, fs, alignment):
ext = extract(es, fs, alignment)
ind = {((x, y), (z, w)) for x, y, z, w in ext}
es = tuple(es)
fs = tuple(fs)
return {(es[e_s-1:e_e], fs[f_s-1:f_e])
for (e_s, e_e), (f_s, f_e) in ind}
def extract(es, fs, ali... | Python | 0.000006 | @@ -3333,16 +3333,75 @@
port sys
+%0A%0A delimiter = %22,%22%0A # load file which will be trained
%0A mod
@@ -3466,13 +3466,17 @@
lit(
-'%7C%7C%7C'
+delimiter
) fo
@@ -3477,24 +3477,41 @@
er) for line
+%0A
in modelfd.
@@ -3575,16 +3575,46 @@
enses)%0A%0A
+ # train model from corpus%0... |
81ba215d93ec7f0d7e71bd66514c15c24fdc131f | Add setUpQuerySideEffect method to DNSBLTest class | test/spambl_test.py | test/spambl_test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
from spambl import DNSBL, UnknownCodeError, NXDOMAIN, HpHosts, HpHostsItem
import mock
from ipaddress import ip_address as IP
from itertools import cycle
from __builtin__ import classmethod
spam_hostnames = 't1.pl', 't2.com', 't3.com.pl'
spam_ips = IP(u'255.... | Python | 0 | @@ -2461,24 +2461,481 @@
ry%0A %0A
+ def setUpQuerySideEffect(self, nxdomain = False):%0A ''' Set up side effect of patched query%0A %0A :param nxdomain: if True, the side effect will be raising NXDOMAIN exception, otherwise%0A it will be an iterator cycling through supported retu... |
159102ab8b908eb169b4d45a3cb6d2bfa7678622 | fix a small bug | search_lm_params.py | search_lm_params.py | import argparse
import json
import sys
from multiprocessing.pool import Pool
import numpy as np
import torch
from tqdm import tqdm
from decoder import BeamCTCDecoder
from model import DeepSpeech
from opts import add_decoder_args
parser = argparse.ArgumentParser(description='Tune an ARPA LM based on a pre-trained aco... | Python | 0.000029 | @@ -94,21 +94,8 @@
np%0A
-import torch%0A
from
@@ -113,16 +113,29 @@
t tqdm%0A%0A
+import torch%0A
from dec
@@ -2660,16 +2660,33 @@
eference
+.replace(' ', '')
)%0A%0A w
|
c09795027e4c3bd92e3c0cb5aca94edd0c6f6aaa | fix sequence increase on 'partner.write()' | base_partner_sequence/models/partner.py | base_partner_sequence/models/partner.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2013 initOS GmbH & Co. KG (<http://www.initos.com>).
# Author Thomas Rehn <thomas.rehn a... | Python | 0.00036 | @@ -1966,24 +1966,61 @@
edsRef(vals)
+ and %5C%0A not partner.ref
:%0A
@@ -2105,32 +2105,33 @@
('res.partner')%0A
+%0A
supe
|
9f76a9f8553a4ee858636b75f9842d20c8021cef | use for update rather than update returning | scripts/actions/get_analysis_articles.py | scripts/actions/get_analysis_articles.py | #!/usr/bin/python
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit ... | Python | 0 | @@ -1928,25 +1928,17 @@
tial=10)
-
%0A
+
%0A def
@@ -2375,322 +2375,153 @@
%22%22%22%0A
+%0A
#
-use custom postgres sql to make use of update .. returning%0A if not isinstance(analysis, int): analysis = analysis.id%0A sql = %22%22%22update a
+in django 1.4 this can be done using select_for_up... |
96f288861bfd96ad092aae5513d391fdc85b5096 | Fix #155 | letsencrypt/client/tests/config_util.py | letsencrypt/client/tests/config_util.py | import os
import pkg_resources
import shutil
import tempfile
import mock
from letsencrypt.client import CONFIG
from letsencrypt.client.apache import configurator
from letsencrypt.client.apache import obj
def dir_setup(test_dir="debian_apache_2_4/two_vhost_80"):
"""Setup the directories necessary for the configu... | Python | 0.000002 | @@ -932,16 +932,23 @@
t.client
+.apache
%22, os.pa
|
9f5bb909080c1f6fb768888deb53a38569385fc3 | fix sequence increase on 'partner.write()' | base_partner_sequence/models/partner.py | base_partner_sequence/models/partner.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2013 initOS GmbH & Co. KG (<http://www.initos.com>).
# Author Thomas Rehn <thomas.rehn a... | Python | 0.00036 | @@ -1966,24 +1966,61 @@
edsRef(vals)
+ and %5C%0A not partner.ref
:%0A
@@ -2105,32 +2105,33 @@
('res.partner')%0A
+%0A
supe
|
b14b12a234a513db83352761590a31b4f6eeb126 | add test for querying all images in database, check total number | test/testGetPost.py | test/testGetPost.py | import requests, json, unittest, os.path, logging, sys
from glob import glob
# test data directory
pattern = os.path.join('test/derivatives/', '*.json')
# url for GET
def getURL(postResponse, url):
dirID = postResponse.json()["_id"]
resURL = url + "/" + dirID
return resURL
def getRequest(postResponse, ... | Python | 0 | @@ -963,16 +963,740 @@
test_01_
+GETAllData(self):%0A # 1. initialize param. change to others for later use%0A url = %22http://localhost:80/scenarios%22%0A log= logging.getLogger( %22SomeTest.testSomething%22 )%0A%0A inputCount = 0%0A for fileName in glob(pattern):%0A with... |
38795110852f6c560ff4164c897f254867789f82 | add dan s email | sendmail_win_hb2.py | sendmail_win_hb2.py | #!/usr/bin/env python
# coding=utf-8
import glob
import click
import os
import json
import datetime
import re
import csv
from requests.exceptions import ConnectionError
from exchangelib import DELEGATE, IMPERSONATION, Account, Credentials, ServiceAccount, \
EWSDateTime, EWSTimeZone, Configuration, NT... | Python | 0.000073 | @@ -2641,19 +2641,17 @@
= '
-ronald.c
+dan.z
han
+g
@tou
|
d62dbd6e8068d0982e5b89d734c7ef09c7fd4871 | modify BufferGenerate | BufferGenerate.py | BufferGenerate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2015-05-12 18:35:26
# @Author : Matrixdom (Matrixdom@126.com)
# @Link :
# @Version : 0.1
#coding=utf-8
import re
import os
templateFilePattern=re.compile("^\w+\.tmp$")
#获取所有模板名
def getAllTemplateFiles(path):
result=set()
for parent,dirnames,filenames... | Python | 0.000001 | @@ -473,18 +473,80 @@
deFile(f
+ilename):%0A%09path=os.getcwd()+%22/templates/%22+filename%0A%09f=open(path
)
-:
%0A%09line=f
@@ -577,16 +577,54 @@
Temp=%7B%7D%0A
+%09Temp%5B%22Class%22%5D=filename.split(%22.%22)%5B0%5D%0A
%09Temp%5B%22F
@@ -903,16 +903,17 @@
%22)%5B1%5D%0A%09%09
+%09
lineNum+
@@ -953,170 +953,1... |
6728bf1fecef3ac1aea9489e7c74333ad0a3b552 | Comment out audo-discovery of addons | datalogger/__main__.py | datalogger/__main__.py | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.bin.workspace import Workspace
from datalogger.analysis_window_testing import AnalysisWindow
def full():
app = 0
app = QApplication(sys.argv)
# Create the window
w = AnalysisWindow()
w.CurrentWorkspace = Workspace()
# Load ... | Python | 0 | @@ -302,16 +302,131 @@
space()%0A
+ #w.CurrentWorkspace.path = %22//cued-fs/users/general/tab53/ts-home/Documents/urop/Logger 2017/cued_datalogger/%22%0A
# Lo
@@ -583,16 +583,17 @@
%22)%0A%0A
+#
w.addon_
|
e6079bd4059717cc05d8b514d958c0ca4910bd60 | bump version | datascience/version.py | datascience/version.py | __version__ = '0.5.10'
| Python | 0 | @@ -13,11 +13,11 @@
= '0.5.1
-0
+1
'%0A
|
29c32d5872b96559f494cd143a3e891281298a13 | Fix download on system with separate /home volume | dcos_kubernetes/cli.py | dcos_kubernetes/cli.py | import os
import os.path
import platform
import sys
import dcos.constants
import dcos.util
from dcos.subcommand import package_dir
def kubectl_binary_path_and_url(master):
# get kubectl meta json
import requests
meta_url = master + "/static/kubectl-meta.json"
try:
meta = requests.get(meta_url)... | Python | 0 | @@ -1999,16 +1999,44 @@
-os.renam
+import shutil%0A shutil.mov
e(fi
|
2e131140bad45598ff87bd7b842c44da5a01bacb | add new test | test/test_kraken.py | test/test_kraken.py | from sequana.kraken import *
from sequana import sequana_data, sequana_config_path
import os
import tempfile
import pytest
skiptravis = pytest.mark.skipif("TRAVIS_PYTHON_VERSION" in os.environ,
reason="On travis")
try:
kd = KrakenDownload()
kd.download('toydb')
kd.download('toydb2')
except:
pass
... | Python | 0.000001 | @@ -2597,20 +2597,260 @@
=%22barh%22) %0A
+%0A%0Adef test_mkr2():%0A from sequana.kraken import MultiKrakenResults2%0A mkr = MultiKrakenResults2(%5Bsequana_data(%22test_kraken_mkr2_summary_1.json%22),%0A sequana_data('test_kraken_mkr2_summary_2.json')%5D)%0A mkr.plot_stacked_hist()%0A
|
2be9eef18567acf8d0ea03849423ee222c6a6242 | Fix forgotten import | apps/dagsen/views.py | apps/dagsen/views.py | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
import json
import urllib2, urllib
import datetime
# Cache kept for
minutes = 10
cam_url = settings.CAM_URL
def nextMeal():
now = dat... | Python | 0.000001 | @@ -174,16 +174,49 @@
he_page%0A
+from django.conf import settings%0A
import j
|
b67813880694052a851bd88c6ec60c6c58df86ca | Remove unused import. | apps/events/admin.py | apps/events/admin.py | # -*- coding: utf-8 -*-
from django.contrib import admin, messages
from django.core import validators
from django.utils.translation import ugettext as _
from reversion.admin import VersionAdmin
from apps.events.models import (AttendanceEvent, Attendee, CompanyEvent, Event, Extras,
Fiel... | Python | 0 | @@ -65,43 +65,8 @@
ges%0A
-from django.core import validators%0A
from
|
e9d7476c281034a679c824eb9598ef1bb5fdf582 | Add missing sha1 import on known_hosts.py | lib/ansible/module_utils/known_hosts.py | lib/ansible/module_utils/known_hosts.py | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | Python | 0.000004 | @@ -1715,16 +1715,41 @@
rt hmac%0A
+from hashlib import sha1%0A
HASHED_K
|
d66f39a2514743b16ed7e75c552dfa27545aa0eb | test ttlser cleanup of code and some minor reworking | test/test_ttlser.py | test/test_ttlser.py | import inspect
import os
import random
import rdflib
import re
import subprocess
import sys
import unittest
rdflib.plugin.register('nifttl', rdflib.serializer.Serializer, 'pyontutils.ttlser', 'CustomTurtleSerializer')
class TestTtlser(unittest.TestCase):
def setUp(self):
goodpath = 'test/good.ttl'
... | Python | 0 | @@ -437,40 +437,8 @@
l'%0A%0A
- print(self.make_ser())%0A%0A
@@ -465,32 +465,32 @@
th, 'rb') as f:%0A
+
self
@@ -634,345 +634,8 @@
%0A
-%0A def test_ser(self):%0A assert self.actual == self.good%0A%0A def serialize(self):%0A graph = rdflib.Graph()%0A graph.pars... |
911badb2ababf1f265a755974098a35fd66ddbde | fix rjapi null response | aquests/lib/rjapi.py | aquests/lib/rjapi.py | import requests
import json
from urllib.parse import quote
def tostr (p):
if p:
return "?" + "&".join (["%s=%s" % (k, quote (str (v))) for k, v in p.items ()])
return ""
class API:
API_SERVER = "http://127.0.0.1:5000"
REQ_TIMEOUT = 30.0
def __init__ (self, server, timeout = 30.0):
self.API_SERVER = ser... | Python | 0 | @@ -384,16 +384,169 @@
ion ()%0A%09
+%0A%09def decode (self, resp):%0A%09%09try:%0A%09%09%09return resp.json ()%0A%09%09except ValueError:%0A%09%09%09if resp.status_code == 200:%0A%09%09%09%09return resp.content%0A%09%09%09else:%0A%09%09%09%09raise%09%0A
%09%09%0A%09def
@@ -567,32 +567,45 @@
i, d):%0A%09%09return
... |
6d02e8feeac74c40831f1d96c5d251e060fb7ec0 | Add 'post comment' api | server/resources.py | server/resources.py | from flask_restful import Resource, Api, abort
from .models import Comment, Lecture
api = Api()
class CommentListResource(Resource):
def get(self, lecture_id):
db_lecture = Lecture.query.filter(Lecture.id == lecture_id).first()
if not db_lecture:
abort(404, message="Lecture {} does n... | Python | 0 | @@ -1,12 +1,38 @@
+from flask import request%0A
from flask_r
@@ -65,16 +65,26 @@
i, abort
+, reqparse
%0Afrom .m
@@ -95,16 +95,20 @@
s import
+ db,
Comment
@@ -635,16 +635,704 @@
%7D%0A%0A
+ def post(self, lecture_id):%0A db_lectures = Lecture.query.filter(Lecture.id == lecture_id).all()%0A%0A ... |
5ab28b2429e4e50e19e4738213357ce4cabc9181 | Add a simple dumper for Debugger::Internal::ThreadId | share/qtcreator/debugger/creatortypes.py | share/qtcreator/debugger/creatortypes.py | ############################################################################
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# ... | Python | 0 | @@ -2353,32 +2353,151 @@
hildren(value)%0A%0A
+def qdump__Debugger__Internal__ThreadId(d, value):%0A d.putValue(%22%25s%22 %25 value%5B%22m_id%22%5D)%0A d.putPlainChildren(value)%0A%0A
def qdump__CPlus
|
58783b1dc96a7ee3d880a6483d38422d51930268 | drop to pdb on newest pypy | spyvm/plugins/vmdebugging.py | spyvm/plugins/vmdebugging.py | import os
from spyvm import model, error
from spyvm.plugins.plugin import Plugin
from spyvm.util.system import IS_WINDOWS
DebuggingPlugin = Plugin()
DebuggingPlugin.userdata['stop_ui'] = False
def stop_ui_process():
DebuggingPlugin.userdata['stop_ui'] = True
# @DebuggingPlugin.expose_primitive(unwrap_spec=[obje... | Python | 0 | @@ -1098,64 +1098,268 @@
-# No, this is not a mistake. Update your pypy checkout!%0A
+from rpython.config.translationoption import get_translation_config%0A from rpython.rlib.objectmodel import we_are_translated%0A if not we_are_translated() or get_translation_config().translation.lldebug or get_translation... |
388c37aa2c86ad0fa00f5faf5ad3c8e9d03d1aaf | Add console logging for Dajaxice | settings_example.py | settings_example.py | # Django settings for mailshare project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'... | Python | 0 | @@ -5424,16 +5424,64 @@
ration.%0A
+# - Mailshare adds console logging for Dajaxice%0A
LOGGING
@@ -5672,16 +5672,122 @@
andler'%0A
+ %7D,%0A 'console': %7B%0A 'level': 'INFO',%0A 'class': 'logging.StreamHandler'%0A
@@ -5949,20 +5949,150 @@
%0A %7D,%0A
+ '... |
e69d768daf2a51eeeea1f758e1108d5ef850abd5 | Remove debug print | argparse/__init__.py | argparse/__init__.py | import sys
# Per @jmchilton's suggestion, and this SO question:
# http://stackoverflow.com/a/6032023
def copy_in_standard_module_symbols(name, not_name, local_module):
import imp
print sys.modules
for i in range(0, 100):
random_name = 'random_name_%d' % (i,)
if random_name not in sys.modul... | Python | 0.000003 | @@ -182,30 +182,8 @@
mp%0A%0A
- print sys.modules%0A
|
dfc02d136ea3ec48f8c9a471441c8eeab8a69f2c | Swap the slashes just in case that's a problem for VC++ | setup_extensions.py | setup_extensions.py | #!python3
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
glew_dir = "/usr/include/GL"
sdl_dir = "/usr/include/SDL2"
opengl_lib = "GL"
glew_lib = "GLEW"
sdl_lib = "SDL2"
sdlmain_lib = "SDL2main"
sdltest_lib = "SDL2_test"
if sys.p... | Python | 0.000236 | @@ -350,34 +350,33 @@
dir = %22extern
-%5C%5C
+/
glew-2.0.0%5C%5Cincl
@@ -369,18 +369,17 @@
ew-2.0.0
-%5C%5C
+/
include%22
@@ -396,34 +396,33 @@
ir = %22extern
-%5C%5C
+/
SDL2-2.0.4%5C%5Cincl
@@ -415,18 +415,17 @@
L2-2.0.4
-%5C%5C
+/
include%22
@@ -479,18 +479,17 @@
%22extern
-%5C%5C
+/
glew-2.0
@@ -4... |
f2aabd3bdcd522769b28b5e160677d8a96ca6bb8 | fix https://github.com/PyThaiNLP/pythainlp/issues/155 | artagger/__init__.py | artagger/__init__.py | # -*- coding: utf-8 -*-
from .Utility.Utils import getWordTag, readDictionary
from .InitialTagger.InitialTagger import initializeSentence
from .SCRDRlearner.SCRDRTree import SCRDRTree
from .SCRDRlearner.Object import FWObject
import os
import copy
import pickle
import codecs
class Word:
def __init__(self, **kwargs... | Python | 0 | @@ -1633,17 +1633,22 @@
ing=%22utf
-8
+-8-sig
%22),%0A
@@ -1764,17 +1764,22 @@
ing=%22utf
-8
+-8-sig
%22)%0A
|
27414ae8635b2e7b5db735850a348e47d5730a44 | Add Ponder to list of Pants users. (#17500) | build-support/bin/generate_user_list.py | build-support/bin/generate_user_list.py | #!/usr/bin/env python3
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import pkgutil
from dataclasses import dataclass
import chevron
"""Generates the custom HTML/CSS block in https://www.pantsbuil... | Python | 0 | @@ -3453,32 +3453,119 @@
ll.png%22,%0A ),%0A
+ Org(%22Ponder%22, %22https://ponder.io/%22, %22https://files.readme.io/fd34269-ponder.png%22),%0A
Org(%0A
|
3118855005564cce752f40054e76b313a5c21c63 | Set scenario to '' if delete current scenario | cea/interfaces/dashboard/api/project.py | cea/interfaces/dashboard/api/project.py | import os
import geopandas
from flask_restplus import Namespace, Resource, fields, abort
import shutil
from staticmap import StaticMap, Polygon
import cea.config
import cea.inputlocator
from cea.utilities.standardize_coordinates import get_geographic_coordinate_system
api = Namespace('Project', description='Current ... | Python | 0.000903 | @@ -2832,32 +2832,165 @@
try:%0A
+ if config.scenario_name == scenario:%0A config.scenario_name = ''%0A config.save()%0A
@@ -3014,24 +3014,25 @@
nario_path)%0A
+%0A
|
5491eb6f552863c621df4087926300be16105360 | Version bump | signalfx/version.py | signalfx/version.py | # Copyright (C) 2015-2016 SignalFx, Inc. All rights reserved.
name = 'signalfx'
version = '1.1.4'
user_agent = 'signalfx-python/' + version
| Python | 0.000001 | @@ -93,9 +93,9 @@
1.1.
-4
+5
'%0A%0Au
|
605e362351bf3839ab6c15a67c29c339c6509d43 | increase version | simetuc/__init__.py | simetuc/__init__.py | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 31 14:27:37 2016
@author: Pedro
"""
DESCRIPTION = 'simetuc: Simulating Energy Transfer and Upconversion'
| Python | 0.000001 | @@ -77,16 +77,34 @@
dro%0A%22%22%22%0A
+VERSION = '1.6.4'%0A
DESCRIPT
|
35685f77d9590c7208877934f5e29851efac1277 | Fix incomplete docstring | privacyidea/lib/utils/compare.py | privacyidea/lib/utils/compare.py | # -*- coding: utf-8 -*-
#
# 2019-07-02 Friedrich Weber <friedrich.weber@netknights.it>
# Add a central module for comparing two values
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as published by the Free Softw... | Python | 0.998981 | @@ -1867,62 +1867,181 @@
eft:
-%0A :param comparator:%0A :param right:%0A :return:
+ Left operand of the comparison%0A :param comparator: Comparator to use, one of %60%60COMPARATORS%60%60%0A :param right: Right operand of the comparison%0A :return: True or False
%0A
|
d5aba53b285587f2d13ba3e5372ed699354c9135 | Add red_check | problem/color/find_color_name.py | problem/color/find_color_name.py | #! /usr/bin/env python
from functools import lru_cache
import colormath as cm
import colormath.color_objects as co
import seaborn as sns
assert 949 == len(sns.xkcd_rgb) # e.g. 'very light green': '#d1ffbd'
@lru_cache()
def get_name_to_srgb():
keys = sns.xkcd_rgb.keys()
return dict(zip(keys, sns.xkcd_palet... | Python | 0.000132 | @@ -329,72 +329,24 @@
))%0A%0A
-if __name__ == '__main__':%0A print(sns.xkcd_rgb%5B'bright red'%5D)
+def red_check():
%0A
@@ -422,18 +422,18 @@
-print(red,
+assert not
red
@@ -448,199 +448,122 @@
aled
-)
%0A
-print(co.sRGBColor(*red.get_value_tuple()),%0A co.sRGBColor(*red.get_value_tuple... |
efa8c6f8f3e3caecc8eaefaa6c607393c1609650 | Update __init__.py | RockStar/__init__.py | RockStar/__init__.py | #!/usr/bin/env python
import os
import sys
import uuid
from datetime import time, date, datetime, timedelta
from random import randint
import git
from progress.bar import Bar
hello_world_c = """#include <iostream>
int main()
{
std::cout << "Hello World!";
}"""
default_file_name = 'main.cpp'
class RockStar:
... | Python | 0.000072 | @@ -188,70 +188,41 @@
rld_
-c
+rb
= %22%22%22
-#include %3Ciostream%3E%0Aint main()%0A%7B%0A std::cout %3C%3C
+%0Adef hello%0A puts
%22Hello
Worl
@@ -221,18 +221,19 @@
llo
-W
+w
orld
-!%22;%0A%7D
+%22%0Aend%0A
%22%22%22%0A
@@ -263,11 +263,10 @@
ain.
-cpp
+rb
'%0A%0A%0A
@@ -378,17 +378,18 @@
o_world_
-c
... |
1eb6d685b2e72573da00ec6cbd00efe2e74bf10d | Fix xmf generator | proteusModule/scripts/H5toXMF.py | proteusModule/scripts/H5toXMF.py |
#import numpy
#import os
#from xml.etree.ElementTree import *
import tables
#from Xdmf import *
def H5toXMF(basename,size,start,finaltime,stride):
# Open XMF files
for step in range(start,finaltime+1,stride):
XMFfile = open(basename+str(step)+".xmf","w")
XMFfile.write(r"""<?xml... | Python | 0.000002 | @@ -252,16 +252,20 @@
asename+
+%22.%22+
str(step
|
a50c93a5166dc341640fad71fcb62466608d2494 | fix potential exceptions | py3status/modules/taskwarrior.py | py3status/modules/taskwarrior.py | # -*- coding: utf-8 -*-
"""
Display tasks currently running in taskwarrior.
Configuration parameters:
cache_timeout: refresh interval for this module (default 5)
format: display format for this module (default '{task}')
Format placeholders:
{task} active tasks
Requires
task: https://taskwarrior.org/d... | Python | 0.000199 | @@ -398,16 +398,114 @@
rt json%0A
+STRING_NOT_INSTALLED = %22taskwarrior: isn't installed%22%0ASTRING_ERROR = %22taskwarrior: unknown error%22%0A
%0A%0Aclass
@@ -644,16 +644,251 @@
(self):%0A
+ if not self.py3.check_commands('task'):%0A return %7B%0A 'cached_until': self.py3.CACHE_F... |
4a09ef767d28671c567fc5ac657e37ccf124d13b | change ssl make with shell | DDDProxyConfig.py | DDDProxyConfig.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2015年1月11日
@author: dx.wang
'''
import os
import ssl
import threading
import random
from os.path import dirname
from OpenSSL import crypto
localServerProxyListenPort = 8080
localServerAdminListenPort = 8081
localServerListenIp = "0.0.0.0"
remoteServerHost... | Python | 0 | @@ -129,22 +129,8 @@
ing%0A
-import random%0A
from
@@ -156,35 +156,8 @@
name
-%0Afrom OpenSSL import crypto
%0A%0Alo
@@ -1140,767 +1140,220 @@
:%0A%09%09
-k = crypto.PKey()%0A%09%09k.generate_key(crypto.TYPE_RSA, 1024)%0A%09%09cert = crypto.X509()%0A%09%09cert.get_subject().C = %22CN%22%0A%09%09cert.get_subject().... |
2b07ac752d5f001bd19ce67e6968d0fe256579cc | Fix bug in assignment database where we were using the wrong property as a foreign key. | pygenprop/assignment_database.py | pygenprop/assignment_database.py | #!/usr/bin/env python
"""
Created by: Lee Bergstrand (2019)
Description: A set of classes for generating an assignment database.
"""
from sqlalchemy import Column, Integer, String, ForeignKey, Float, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
Base = declara... | Python | 0 | @@ -850,24 +850,33 @@
ments'%0A%0A
+property_
assignment_i
@@ -4049,36 +4049,51 @@
e)%0A property_
-numb
+assignment_identifi
er = Column(Inte
@@ -4139,20 +4139,35 @@
roperty_
-numb
+assignment_identifi
er'))%0A
|
dd25ef8bd85221d711c1dbdddbf0e91ddcee7404 | make expired CSRF token message configurable | lux/extensions/rest/backends/session.py | lux/extensions/rest/backends/session.py | import time
from pulsar import PermissionDenied, ImproperlyConfigured
from lux import Parameter
from .. import AuthBackend
from .mixins import jwt, SessionBackendMixin
from .registration import RegistrationMixin
class SessionBackend(SessionBackendMixin, RegistrationMixin, AuthBackend):
def create_session(self... | Python | 0 | @@ -1009,16 +1009,155 @@
wrong')
+,%0A Parameter('EXPIRED_CSRF_TOKEN_MESSAGE', 'CSRF token expired',%0A 'Message to display when CSRF token has expired')
%0A %5D%0A
@@ -2569,16 +2569,85 @@
SSAGE'%5D%0A
+ expired_token = request.config%5B'EXPIRED_CSRF_TOKEN_MESSAGE'%5D%0A
... |
fc0e7c63667c99f3fd470e57430dcb859a33cd6a | Fix web API routing. | media_nommer/twisted/plugins/feederd.py | media_nommer/twisted/plugins/feederd.py | """
This twistd plugin is where the feederd is started. In addition to starting
the TCPServer process, a few other things are tied in like scheduling checks
of the S3 incoming buckets and determining whether more EC2 nodes are needed.
More documentation about the Twisted plugin system can be found here:
http://twisted... | Python | 0.000001 | @@ -1748,24 +1748,25 @@
tasks()%0A
+%0A
%0A
@@ -1753,24 +1753,53 @@
()%0A%0A
+factory = Site(APIResource())
%0A ser
@@ -1849,25 +1849,15 @@
%5D),
-Site(APIResource)
+factory
)%0A
|
36168b9ddc60caf8b12742430bfcbe05cd1c09f9 | Replace fft2 and ifft2 with rfft2 and irfft2 because we only need a real-valued FFT | pysteps/cascade/decomposition.py | pysteps/cascade/decomposition.py | """Implementations of cascade decompositions for separating two-dimensional
images into multiple spatial scales.
The methods in this module implement the following interface:
decomposition_xxx(X, filter, optional arguments)
where X is the input field and filter is a dictionary returned by a filter
method implement... | Python | 0.000017 | @@ -1497,13 +1497,15 @@
ed.%0A
+#
try:%0A
+#
@@ -1542,24 +1542,25 @@
_fft as fft%0A
+#
import p
@@ -1565,16 +1565,17 @@
pyfftw%0A
+#
# TO
@@ -1644,16 +1644,17 @@
give a%0A
+#
# se
@@ -1671,16 +1671,17 @@
h dask.%0A
+#
#pyf
@@ -1710,16 +1710,17 @@
nable()%0A
+#
fft_
@@ -1776,16 +1... |
f27d0ff2b5b4c5f58333d5d00499b35a3a75ac23 | version difference | querybuilder/tests/json_tests.py | querybuilder/tests/json_tests.py | import unittest
from django import VERSION
from django.test.testcases import TestCase
from django.test.utils import override_settings
from querybuilder.fields import JsonField
from querybuilder.query import Query, JsonQueryset
from querybuilder.tests.models import MetricRecord
from querybuilder.tests.utils import get_p... | Python | 0.000002 | @@ -1745,310 +1745,65 @@
-# Django 3.1 changes the raw queryset behavior so querybuilder isn't going to change that behavior%0A if VERSION%5B0%5D == 3 and VERSION%5B1%5D == 1:%0A self.assertEqual(query.select(), %5B%7B'my_two_alias': '%22two%22'%7D%5D)%0A else:%0A self.assertEq... |
f682351e08d925293e4a428afc8a379a45c8d2ac | change the boxplot script. now supports grouping | misc/create_boxplot_from_compare_out.py | misc/create_boxplot_from_compare_out.py | import argparse
import seaborn as sns
import pandas as pd
__author__ = 'buchholb'
parser = argparse.ArgumentParser()
parser.add_argument('--times-file',
type=str,
help='Output of the compare_performance.py script',
required=True)
def get_data_frame_from_... | Python | 0.000001 | @@ -50,16 +50,35 @@
as as pd
+%0Aimport numpy as np
%0A%0A__auth
@@ -361,32 +361,79 @@
-label_to_id_val_dict = %7B
+data = %7B'type': %7B%7D, 'approach': %7B%7D, 'time in ms': %7B%7D, 'nof matches': %7B%7D
%7D%0A
@@ -477,16 +477,27 @@
= True%0A
+ id = 0%0A
for
@@ -592,54 +592,8 @@
t')%0A
- ... |
12996480d6f4bd494a6d94b60921c6abca9ebbec | use orjson | readthedocs/search/parse_json.py | readthedocs/search/parse_json.py | """Functions related to converting content into dict/JSON structures."""
import json
import logging
from django.conf import settings
from django.core.files.storage import get_storage_class
from pyquery import PyQuery
log = logging.getLogger(__name__)
def generate_sections_from_pyquery(body, fjson_storage_path):
... | Python | 0.000001 | @@ -78,20 +78,23 @@
ort
-json
+logging
%0Aimport
logg
@@ -89,23 +89,22 @@
%0Aimport
-logging
+orjson
%0A%0Afrom d
@@ -3047,16 +3047,18 @@
data =
+or
json.loa
@@ -3385,41 +3385,43 @@
-sections.extend(generate_sections
+domain_data = generate_domains_data
_fro
@@ -3463,17 +3463,16 @@
ge_path)
-)
%0A ... |
1a6414ff62fa3706ab828fa628c64ad2f0eaf94d | update extected space | molo/polls/templatetags/poll_votings.py | molo/polls/templatetags/poll_votings.py |
from copy import copy
from django import template
from molo.polls.models import Question, Choice, PollsIndexPage
from molo.core.templatetags.core_tags import get_pages
register = template.Library()
@register.inclusion_tag('polls/poll_page.html',
takes_context=True)
def poll_page(context, ... | Python | 0 | @@ -771,16 +771,17 @@
ontext%0A%0A
+%0A
@registe
|
aa506a05f0a6e73294e30b51bfa023ad530deca2 | Format results from Coursera API to one that follows schema | mooc_aggregator_restful_api/coursera.py | mooc_aggregator_restful_api/coursera.py | '''
This module retrieves information of all the courses offered by Coursera
through their Catalog APIs
Link to documentation:
https://tech.coursera.org/app-platform/catalog/
'''
import requests
class CourseraAPI(object):
'''
This class defines attributes and methods for the Coursera Catalog API
'''
... | Python | 0 | @@ -662,32 +662,44 @@
.v1/universities
+?fields=name
'%0A COURSERA_C
@@ -888,106 +888,43 @@
tors
-'%0A COURSERA_CATALOG_API_ENDPOINT_SESSIONS = 'https://api.coursera.org/api/catalog.v1/sessions'%0A
+?fields=fullName,bio,photo150'%0A
%0A
@@ -2232,47 +2232,8 @@
-# instructors, categories, universit... |
f753fad8df7bf8d92001ceda9407b8a2e0fa9f5d | Support $location in gen_rule | src/blade/gen_rule_target.py | src/blade/gen_rule_target.py | # Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Michaelpeng <michaelpeng@tencent.com>
# Date: October 20, 2011
"""
This is the scons_gen_rule module which inherits the SconsTarget
and generates related gen rule rules.
"""
import os
import blade
import build_rules
import console
from blade... | Python | 0 | @@ -3474,32 +3474,41 @@
+
var_name,%0A
@@ -3509,32 +3509,41 @@
+
+
env_name,%0A
@@ -3548,24 +3548,33 @@
+
+
self._srcs_l
@@ -3616,32 +3616,41 @@
+
srcs_str,%0A
@@ -3659,19 +3659,145 @@
... |
a5faeb16a599b4260f32741846607dd05f10bc53 | Add ability to specify which settings are used via `export PRODUCTION=0' | myproject/myproject/project_settings.py | myproject/myproject/project_settings.py | # Project Settings - Settings that don't exist in settings.py that you want to
# add (e.g. USE_THOUSAND_SEPARATOR, GRAPPELLI_ADMIN_TITLE, CELERYBEAT_SCHEDULER,
# CELERYD_PREFETCH_MULTIPLIER, etc.)
#USE_THOUSAND_SEPARATOR = True
#GRAPPELLI_ADMIN_TITLE = ''
#import djcelery
#djcelery.setup_loader()
#CELERYBEAT_SCHEDUL... | Python | 0 | @@ -404,13 +404,159 @@
ort
-sys%0A%0A
+os%0Aimport sys%0A%0Aif 'PRODUCTION' in os.environ and os.environ%5B'PRODUCTION'%5D.lower() in %5BTrue, 'y', 'yes', '1',%5D:%0A from production_settings import *%0Ael
if '
|
9a766f09a656b110594c4b81654fd91d7fec591e | remove legacy model __eq__s | src/choo/models/locations.py | src/choo/models/locations.py | from ..types import Coordinates, PlatformIFOPT, StopIFOPT, StopAreaIFOPT, POIType, PlatformType
from .base import Field, Model, ModelWithIDs
class GeoPoint(Model):
def __init__(self, coords=None, **kwargs):
super().__init__(**kwargs)
self.coords = coords
def distance_to(self, other):
... | Python | 0.000047 | @@ -2240,619 +2240,8 @@
ry%0A%0A
- def __eq__(self, other):%0A if not isinstance(other, Stop):%0A return False%0A%0A if (self.full_name is not None and other.full_name is not None and%0A self.full_name.replace(',', '') == other.full_name.replace(',', '')):%0A retur... |
69af087e7115ff8443cfccb6979cdbeea95345b9 | change from manual toggling to automatic toggling | Graph/settings.py | Graph/settings.py | """
Django settings for Graph project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | Python | 0 | @@ -711,16 +711,282 @@
uction!%0A
+#There is a way to automatically toggle between the two environments%0A#This solves the probable Problems forever.%0Aimport socket%0A %0Aif socket.gethostname() == '%3Ca href=%22http://productionserver.com%22 target=%22_blank%22%3Eproductionserver.com%3C/a%3E':%0A DEBUG = False%0A... |
2adcc2d57c64cdf765dd3cbf9e2bfba63f8ca887 | remove os library usage | src/datreant/core/treants.py | src/datreant/core/treants.py | """
Treants: the organizational units for :mod:`datreant`.
"""
import os
import functools
import six
from pathlib2 import Path
from .collections import Bundle
from .trees import Tree
from .names import treantdir_name
from .util import makedirs
@functools.total_ordering
class Treant(Tree):
"""The Treant: a disco... | Python | 0 | @@ -61,18 +61,8 @@
%22%22%22%0A
-import os%0A
impo
@@ -1176,29 +1176,17 @@
r =
-os.path.join(
abspath
-,
+ /
tre
@@ -1192,25 +1192,24 @@
eantdir_name
-)
%0A%0A if
@@ -1217,23 +1217,8 @@
not
-os.path.exists(
trea
@@ -1222,16 +1222,24 @@
reantdir
+.exists(
):%0A
@@ -3583,21 +3583,8 @@
urn
-os.... |
ca2026bdf4d9b148115a236979c85ef761c85bc8 | fix logic in test_gf_coverage script | test_gf_coverage.py | test_gf_coverage.py | #!/usr/bin/env python2
# Copyright 2016 The Fontbakery Authors
# Copyright 2017 The Google Fonts Tools 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/lic... | Python | 0 | @@ -1384,13 +1384,25 @@
%5D%0A
-cps =
+diff = expected -
Cod
@@ -1429,31 +1429,8 @@
me)%0A
- diff = cps - expected
%0A p
|
eabfa0079371345a442d1a763ef6fcccc25e90d3 | fix tab vs spaces issue in conftest | testing/conftest.py | testing/conftest.py | import execnet
import py
import pytest
import sys
import subprocess
from execnet.gateway_base import get_execmodel, WorkerPool
collect_ignore = ['build', 'doc/_build']
rsyncdirs = ['conftest.py', 'execnet', 'testing', 'doc']
winpymap = {
'python2.7': r'C:\Python27\python.exe',
'python2.6': r'C:\Python26\pyth... | Python | 0 | @@ -6729,9 +6729,12 @@
am)%0A
-%09
+
if s
|
25671cdacf07931af992fcb86ebd87dd32cf6ed1 | Change the default for topLevelStrip | testrunner/suite.py | testrunner/suite.py | #!/usr/bin/python
#
# Copyright (c) 2009 rPath, Inc. All Rights Reserved.
#
import os
import sys
import unittest
class TestSuite(object):
individual = False
pathManager = None
testsuite_module = None
# Number of directories to strip off from testsuite.py's filename in order
# to get to the testsu... | Python | 0.000001 | @@ -349,17 +349,17 @@
Strip =
-1
+0
%0A cat
@@ -421,24 +421,92 @@
-def setup(self):
+setupDone = False%0A def setup(self):%0A if self.setupDone:%0A return
%0A
@@ -782,24 +782,55 @@
Specific()%0A%0A
+ self.setupDone = True%0A%0A
def setu
|
7cbad2ecab781391758ed7391612644d7a695652 | make things derive from SimError | simuvex/s_errors.py | simuvex/s_errors.py | #!/usr/bin/env python
class SimError(Exception):
pass
class SimIRSBError(SimError):
pass
class SimModeError(SimError):
pass
class SimProcedureError(Exception):
pass
class SimMergeError(Exception):
pass
class SimValueError(Exception):
pass
class SimUnsatError(SimValueError):
pass
class SimMemoryError(SimE... | Python | 0.004472 | @@ -144,33 +144,32 @@
cedureError(
-Exception
+SimError
):%0A%09pass%0A%0Acl
@@ -182,33 +182,32 @@
mMergeError(
-Exception
+SimError
):%0A%09pass%0A%0Acl
@@ -220,33 +220,32 @@
mValueError(
-Exception
+SimError
):%0A%09pass%0A%0Acl
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.