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 |
|---|---|---|---|---|---|---|---|
7bf84875d5999a537a5689df4c1bb9ff6ce950ae | Remove forgotten test link | src/app/sameas/plugin.py | src/app/sameas/plugin.py | '''
Created on 4 Nov 2013
@author: cmarat
'''
from flask import request, jsonify
from flask.ext.login import login_required
import requests
from app import app
SAMEAS_URL = "http://sameas.org/json"
@app.route('/sameas', methods=['POST'])
@login_required
def link_to_sameas():
# Retrieve the article from the p... | Python | 0 | @@ -545,118 +545,8 @@
ks'%5D
-%0A match_items.append(%7Bu'link': u'http://dbpedia.org/resource/Resource_Description_Framework', u'id': 9999%7D)
%0A%0A
|
e5e872d48db28237129fa8c4ebdb76e93dd05954 | Fix bug in casting variables when cuda is enabled | rbm.py | rbm.py | import torch
class RBM():
def __init__(self, num_visible, num_hidden, k, learning_rate=1e-3, momentum_coefficient=0.5, weight_decay=1e-4, use_cuda=True):
self.num_visible = num_visible
self.num_hidden = num_hidden
self.k = k
self.learning_rate = learning_rate
self.momentum... | Python | 0 | @@ -1967,38 +1967,22 @@
idden)).
-type(torch.FloatTensor
+float(
)%0A
@@ -2444,30 +2444,14 @@
n)).
-type(torch.FloatTensor
+float(
)%0A%0A
|
157a0f4c4c28ba3ead766bfe2150f4d8cf602594 | add 'enabled' backup configuration option to specify whether a backup job should be processed | rbt.py | rbt.py | #!/usr/bin/env python3
#
# apt-get install python3-tz python3-yaml
#
import argparse
import collections
import datetime
import os
import subprocess
import time
import typing
import pytz
import yaml
# BackupProperties defines standard set of backup configuration properties
BackupProperties = dict(name=None, template... | Python | 0.000003 | @@ -344,16 +344,30 @@
kups=28,
+ enabled=True,
%0A
@@ -7079,16 +7079,44 @@
ackup in
+ filter(lambda b: b.enabled,
load_ba
@@ -7120,32 +7120,33 @@
_backups(config)
+)
:%0A if
|
e8c71806e5f10c46fe4ac3e81322e9a44b42f933 | Simplify todo example | test/todo.py | test/todo.py | """Incomplete fixes."""
# E501: This should be wrapped similar to how pprint does it
{'2323k2323': 24232323, '2323323232323': 3434343434343434, '34434343434535535': 3434343434343434, '4334343434343': 3434343434}
# See below
{'2323323232323': 3434343434343434,
'2323k2323': 24232323,
'34434343434535535': 343434343434... | Python | 0.000563 | @@ -538,180 +538,39 @@
lon%0A
-from alnair.exception import (%0A NoSuchDirectoryError,%0A NoSuchFileError,%0A UndefinedPackageError,%0A ); NoSuchDirectoryError; NoSuchFileError; UndefinedPackageError
+(%0A 1,%0A 2,%0A 3); 4; 5; 5
#
|
631a231fc2a63dfc0b6d051aa6cef49bd67d80a6 | add WSGI | run.py | run.py | from app import app
import mapping
import models
if __name__ == "__main__":
models.createDB()
app.run()
| Python | 0.001935 | @@ -43,16 +43,39 @@
models%0A%0A
+wsgi = app.wsgifunc()%0A%0A
if __nam
|
45ede49006c65bc74ab9359e79571e788b8aaebd | Fix typo in run.py help | run.py | run.py | #!/usr/bin/python
"""
Thin wrapper around "docker run" which simplifies the creation of a build
environment for XenServer packages.
"""
import argparse
import os
import os.path
import subprocess
import shutil
import sys
import uuid
CONTAINER = "xenserver/xenserver-build-env"
SRPMS_MOUNT_ROOT = "/tmp/docker-SRPMS"
# ... | Python | 0.00094 | @@ -1543,16 +1543,17 @@
less you
+
'%0A
|
0db56e1c005ba3f198be5bfbc1e89d686e693284 | Fix dinky loop error | run.py | run.py | import json
import textwrap
from GeneticAlgorithm import PhoneOptimize
from celex import Celex
from nist import NIST
'''
fileName: run.py
Authors: Jacob Krantz, Max Dulin
Date Modified: 9/17
- main file to run machine
- Syllabifies a file using NIST or Celex
'''
class Color:
YELLOW = '\033[93m'
... | Python | 0.000037 | @@ -2466,17 +2466,17 @@
oice !=
-6
+7
:%0A
|
e7df2d658cdb0a3664b914d0577ea08da2845f08 | fix run.py python interpreter | run.py | run.py | #!env/bin/python
from api import app
app.run(debug = True)
| Python | 0.00052 | @@ -1,9 +1,11 @@
#!
-env
+flask
/bin
|
603cf4cab90e6655a5aa26269a93376d13dd7fe1 | Fix package installing | lib/pacman/sync.py | lib/pacman/sync.py | from lib.pacman.command import execute
def refresh_force():
"""pacman -Syy"""
execute('sudo -S pacman -Syy', discard_output=True)
def system_upgrade():
"""pacman -Syu"""
execute('sudo -S pacman -Syu --noconfirm', discard_output=True)
def install(package, asdeps=False):
"""pacman -S [--asdeps] ... | Python | 0 | @@ -479,24 +479,33 @@
ption),
+' '.join(
package)
%0A exe
@@ -496,16 +496,17 @@
package)
+)
%0A exe
|
8358796cb469f2e4b437877ea2d4d1043defdc59 | Disable verbose logging for tests | tests/run.py | tests/run.py | #!/usr/bin/env python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Python | 0.000001 | @@ -1479,16 +1479,36 @@
cover')%0A
+logging.disable(90)%0A
%0A%0Adef be
|
d7c751ddb71a2e0f1c67c045fcd8c52d8079c3f2 | fix lib/util/script:make_environment_wrapped_script() converting paths to absolute paths | lib/util/script.py | lib/util/script.py | # Copyright (c) 2017 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | Python | 0.00003 | @@ -4632,16 +4632,117 @@
path')%0A%0A
+ path = %5Bos.path.abspath(x) for x in path%5D%0A pythonpath = %5Bos.path.abspath(x) for x in pythonpath%5D%0A%0A
code =
|
612c809a68640fea9130952fdd626ee0118646bb | Fix code style for task group model | src/ggrc_workflows/models/task_group.py | src/ggrc_workflows/models/task_group.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc import db
from ggrc.models.mixins import (
Titled, Slugged, Describ... | Python | 0.001611 | @@ -344,14 +344,10 @@
act%0A
-
)%0A
+
from
@@ -467,16 +467,20 @@
kGroup(%0A
+
With
@@ -538,16 +538,16 @@
Model):%0A
-
__tabl
@@ -1474,16 +1474,17 @@
%0A #
+
'cycle_t
@@ -1496,20 +1496,16 @@
roups',%0A
-
%5D%0A%0A d
@@ -1630,16 +1630,24 @@
ied_by',
+%0A
'contex
@@ -1649,20... |
70b00ee903fac46038bafdd69dd8e643d6cc76ad | Fix setting "auto" flag with pkgng | libpb/pkg/pkgng.py | libpb/pkg/pkgng.py | """
The next generation package management tools (i.e. pkgng)..
"""
from __future__ import absolute_import
import os
from libpb import env
__all__ = ["add", "change", "info", "query", "remove"]
suffix = ".txz"
shell_pkg_add = """
if [ ! -d %(wrkdir)s ]; then
mkdir -p %(wrkdir)s;
clean_wrkdir="YES";
fi;
tar... | Python | 0 | @@ -1545,17 +1545,17 @@
et%22, %22-y
-a
+A
%22, auto,
|
0026536a68dfc58bc3e9ef89fc2e104287c30d67 | Fix bug where metadata is not written | src/create-extracts/create_extracts.py | src/create-extracts/create_extracts.py | #!/usr/bin/env python
"""Generate jobs for rendering tiles in pyramid and list format in JSON format
Usage:
create_extracts.py bbox <source_file> <tsv_file> [--patch-from=<patch-src>] [--upload] [--concurrency=<concurrency>] [--target-dir=<target-dir>]
create_extracts.py zoom-level <source_file> --max-zoom=<max-z... | Python | 0.000001 | @@ -3532,16 +3532,52 @@
value)%0A%0A
+ conn.commit()%0A conn.close()%0A%0A
%0Adef par
|
01bff2cb28dedb98e5ac16d35178569a8ca8bbe1 | improve readability | src/graphql/pyutils/suggestion_list.py | src/graphql/pyutils/suggestion_list.py | from typing import Collection, List
__all__ = ["suggestion_list"]
def suggestion_list(input_: str, options: Collection[str]) -> List[str]:
"""Get list with suggestions for a given input.
Given an invalid input string and list of valid options, returns a filtered list
of valid options sorted based on the... | Python | 0.000005 | @@ -2163,230 +2163,434 @@
-d%5Bi%5D%5Bj%5D = min(d%5Bi - 1%5D%5Bj%5D + 1, d%5Bi%5D%5Bj - 1%5D + 1, d%5Bi - 1%5D%5Bj - 1%5D + cost)%0A%0A if i %3E 1 and j %3E 1 and a%5Bi - 1%5D == b%5Bj - 2%5D and a%5Bi - 2%5D == b%5Bj - 1%5D:%0A d%5Bi%5D%5Bj%5D = min(d%5Bi%5D%5Bj%5D, d%5Bi - 2%5... |
cb46b2d3e31dd0af9db9e9df256db6d95c2162e0 | Fix buggy reset util | src/resetutil.py | src/resetutil.py | # Playhouse: Making buildings into interactive displays using remotely controllable lights.
# Copyright (C) 2014 John Eriksson, Arvid Fahlström Myrman, Jonas Höglund,
# Hannes Leskelä, Christian Lidström, Mattias Palo,
# Markus Videll, Tomas Wickman, Emil Öhman.
#
# This program... | Python | 0.000001 | @@ -2730,29 +2730,27 @@
ap%5Bb
-ridges.mac%5D = bridges
+.serial_number%5D = b
%0A
@@ -2773,18 +2773,22 @@
nt(b
-ridges.mac
+.serial_number
)%0A
@@ -3399,16 +3399,38 @@
bridge%0A%0A
+@tornado.gen.coroutine
%0Adef cre
@@ -4076,16 +4076,39 @@
t_num%0A%0A%0A
+@tornado.gen.coroutine%0A
def rese
@@ -4114,16 +41... |
e37174e733b7b186a40cc82ffe95c3d10014bd2f | Check for errors | src/redis.py | src/redis.py | #!/usr/bin/env python
#
# igcollect - Redis
#
# Copyright (c) 2016 InnoGames GmbH
#
from argparse import ArgumentParser
from subprocess import Popen, PIPE
from time import time
def parse_args():
parser = ArgumentParser()
parser.add_argument('--prefix', default='redis')
return parser.parse_args()
def m... | Python | 0.000001 | @@ -78,17 +78,16 @@
GmbH%0A#%0A%0A
-%0A
from arg
@@ -141,19 +141,20 @@
ort
-Popen, PIPE
+check_output
%0Afro
@@ -365,15 +365,22 @@
o =
-Popen((
+check_output(%5B
'red
@@ -417,100 +417,9 @@
nfo'
-),%0A stdout=PIPE).stdout.read()%0A redis_info = redis_info.splitlines(
+%5D
)%0A%0A
@@ -... |
9d8de33a72e821bf0fb7415f73ba8cfabc3ba93b | Update version 0.7.6 -> 0.7.7 | src/setup.py | src/setup.py | #!/usr/bin/env python
#
# Copyright 2012, 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... | Python | 0.000001 | @@ -2483,17 +2483,17 @@
on='0.7.
-6
+7
',%0A
|
1f9947598671422d86c76c036d4037690a3e99ba | summarize short-distance rides | src/utils.py | src/utils.py | import collections
import datetime
import stravalib.client
import time
class BaseException(Exception):
pass
class ConfigError(BaseException):
pass
class MyStravaClient(stravalib.client.Client):
API_CALL_PAUSE_SECONDS = 0.5
def get_all_gears(self):
all_activities = self.get_activities()
... | Python | 0.999999 | @@ -1930,24 +1930,50 @@
ivities_list
+, short_ride_threshold=5.0
):%0A summa
@@ -2145,16 +2145,47 @@
te_ids':
+ %5B%5D,%0A 'short_rides_ids':
%5B%5D%0A
@@ -2274,32 +2274,88 @@
tance.get_num()%0A
+ activity_distance = activity.distance.get_num()%0A
if activ
@@ -2414,33 +2414,33 @@
+... |
394581407a7788b315da97f870a6dcd0bfe4bd54 | fix js MIME type | src/utils.py | src/utils.py | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import json
def is_none(target):
return target is None
def is_none_or_empty(target):
return is_none(target) or len(target) == 0
def write_json_output(response, dic):
response_text, content_type = json.dumps(dic), "application/json"
_do_write(response, ... | Python | 0.000512 | @@ -591,10 +591,8 @@
ion/
-x-
java
|
a83a8a6b086d0cede9a8ca513a706a8d41659ce7 | Fix league post issue, only check on edit catchup dev | src/views.py | src/views.py | #!/usr/bin/python
#
# Copyright 2011 Friday Film Club. All Rights Reserved.
"""Main views of the Friday Film Club app."""
__author__ = 'adamjmcgrath@gmail.com (Adam McGrath)'
import logging
from operator import itemgetter
import uuid
from google.appengine.api import channel, files, users
from google.appengine.ext i... | Python | 0 | @@ -6749,32 +6749,35 @@
e.%0A if league
+_id
and league.owne
|
d816e103a6092766398bc74ae2ed844ff3f9598b | Handle missing sections | pwndbg/commands/elf.py | pwndbg/commands/elf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from elftools.elf.elffile import ELFFile
import gdb
import pwndbg.commands
@pwndbg.commands.Command
def elfheader():
"""
Prints the section mappings contained in the ELF header.
"""
local_path = pwndbg.file.get_fil... | Python | 0.000753 | @@ -1515,24 +1515,82 @@
ction_name)%0A
+%0A if not section:%0A return (None, None)%0A%0A
star
|
9778533d7ee241541deca9614cd5e8660f75607c | Create country without code or remove country code raise error | openerp/addons/base/res/res_country.py | openerp/addons/base/res/res_country.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | Python | 0.000001 | @@ -3175,16 +3175,22 @@
t('code'
+,False
):%0A
@@ -3404,22 +3404,30 @@
if
+vals.get(
'code'
- in v
+,F
als
+e)
:%0A
|
6226c17ed1e9313dc202b44fc69b098a09140983 | fix translation | pycket/values_regex.py | pycket/values_regex.py | from pycket.base import W_Object
from pycket.error import SchemeException
from pycket import values, values_string
from pycket import regexp
from rpython.rlib.rsre import rsre_core
CACHE = regexp.RegexpCache()
class W_AnyRegexp(W_Object):
_immutable_fields_ = ["source"]
errorname = "regexp"
def __init_... | Python | 0.000028 | @@ -1412,22 +1412,90 @@
-return
+if not isinstance(other, W_AnyRegexp):%0A return False%0A if
type(se
@@ -1516,14 +1516,9 @@
her)
- and %5C
+:
%0A
@@ -1526,16 +1526,19 @@
+if
(self.co
@@ -1540,18 +1540,18 @@
lf.code
-==
+or
other.c
@@ -1553,21 +1553,42 @@
her.code
- i... |
1b7c2d22bfc7987ab689602652e026a5fd72e551 | Update PkgDistributionCreator.py | MTM_Installer/PkgDistributionCreator.py | MTM_Installer/PkgDistributionCreator.py | #!/usr/bin/env python
#
#
# 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, softw... | Python | 0 | @@ -6115,293 +6115,8 @@
'%5D)%0A
- except OSError as e:%0A raise ProcessorError(%0A %22Can't find %25s%22 %25 (self.env%5B'source_file6'%5D, e.strerror))%0A if os.path.exists(self.env%5B'package_dir'%5D):%0A try:%0A self.output(%22Found %25... |
1069574db36d86745fa4357ff2bc35334883ad86 | Bump app version to 2019.7.1 | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2019.7.0"
__versionfull__ = __version__
| Python | 0 | @@ -15,17 +15,17 @@
%222019.7.
-0
+1
%22%0A__vers
|
20d5e52221713ef1ab1bc9cd74b47520bea69ac6 | Add tasks TODO | api/experiments/tasks.py | api/experiments/tasks.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import logging
import polyaxon as plx
from api.settings import CeleryTasks
from api.celery_api import app
from experiments.models import Experiment
from experiments.task_status import ExperimentStatus
logger = logging.getLogge... | Python | 0.001469 | @@ -103,32 +103,8 @@
ng%0A%0A
-import polyaxon as plx%0A%0A
from
@@ -263,17 +263,16 @@
Status%0A%0A
-%0A
logger =
@@ -1103,90 +1103,41 @@
-plx_xp = plx.experiments.create_experiment(experiment.to_config())%0A plx_xp.train()
+# TODO: fix me%0A return experiment
%0A
|
6904e4e83556136788dd3ffb18e89830733bf902 | Use correct attribute for property objects | pydispatch/dispatch.py | pydispatch/dispatch.py | import sys
import weakref
import types
from pydispatch.properties import Property
PY2 = sys.version_info.major == 2
if not PY2:
basestring = str
def get_method_vars(m):
if PY2:
f = m.im_func
obj = m.im_self
else:
f = m.__func__
obj = m.__self__
return f, obj
class Wea... | Python | 0.000007 | @@ -3009,35 +3009,19 @@
, '_
-Dispatcher__property_events
+PROPERTIES_
'):%0A
@@ -3065,32 +3065,27 @@
n self._
-_property_events
+PROPERTIES_
.values(
|
5430c47894c0a43def924a8703259a22f2092c85 | Change url to confirm_delete | api/nodes/serializers.py | api/nodes/serializers.py | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, Link, WaterbutlerLink
from website.models import Node
from framework.auth.core import Auth
from rest_framework import exceptions
class NodeSerializer(JSONAPISerializer):
# TODO: If we have to redo this i... | Python | 0.000001 | @@ -5681,19 +5681,30 @@
ue)%0A
-url
+confirm_delete
= ser.C
@@ -5743,44 +5743,15 @@
xt='
-Use
new url
- to submit DELETE request
')%0A%0A
|
9e8b6f47f25d4445031e0c996bc8c92ba6da4cd3 | Remove unnecessary else | pygametemplate/core.py | pygametemplate/core.py | """Module containing the core functions of pygametemplate."""
import os
import sys
import traceback
from datetime import datetime
import ctypes
import pygame
from pygametemplate.exceptions import CaughtFatalException
TEST = bool(int(os.environ.get("TEST", "0")))
PATH = os.getcwd()
def path_to(*path):
"""Retu... | Python | 0.000006 | @@ -1224,30 +1224,9 @@
1%5D)%0A
- else:%0A pass
+%0A
|
c306c3b408e880edfc6d49e31575dc91a31783bd | Switch reset command to use call_command instead of subprocess. | kive/metadata/management/commands/reset.py | kive/metadata/management/commands/reset.py | from optparse import make_option
import os
import shutil
import subprocess
import sys
from django.core.management.base import BaseCommand
from django.core.management import call_command
import kive.settings # @UnresolvedImport
class Command(BaseCommand):
help = 'Resets the database and loads sample data.'
... | Python | 0 | @@ -53,37 +53,8 @@
util
-%0Aimport subprocess%0Aimport sys
%0A%0Afr
@@ -448,76 +448,8 @@
s):%0A
- python = sys.executable%0A manage_script = sys.argv%5B0%5D%0A
@@ -892,24 +892,16 @@
-
%0A
@@ -905,75 +905,47 @@
-subprocess.check_call(%5Bpython, manage_script, %22flu... |
e52d0ee26ba4daf01567c460a480afb3a72667ab | Fix to pip provider | kokki/cookbooks/pip/libraries/providers.py | kokki/cookbooks/pip/libraries/providers.py |
__all__ = ["PipPackageProvider"]
import re
from subprocess import check_call, Popen, PIPE, STDOUT
from kokki import *
from kokki.providers.package import PackageProvider
version_re = re.compile(r'\S\S(.*)\/(.*)-(.*)-py(.*).egg\S')
best_match_re = re.compile(r'Best match: (.*) (.*)\n')
class PipPackageProvider(Packa... | Python | 0.000001 | @@ -704,13 +704,21 @@
=%22,
-2
+1
)%5B1%5D
+.strip()
%0A
|
8c26745c0608b2cc49db0e7d186eb3ad8a627bbc | Fix a copy-paste error in logging statements | examples/demo_receive.py | examples/demo_receive.py | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MP... | Python | 0.000021 | @@ -2500,20 +2500,23 @@
o(%22demo_
-send
+receive
: Connec
@@ -2671,20 +2671,23 @@
o(%22demo_
-send
+receive
: Receiv
@@ -2928,20 +2928,23 @@
o(%22demo_
-send
+receive
: Queue
@@ -3092,12 +3092,15 @@
emo_
-send
+receive
.han
|
d77e3fbc0d59ca31ce028cc31f5d1e06f08900f4 | Fix color effect decorator in GoL example (#20) | examples/game_of_life.py | examples/game_of_life.py | from hecate import core
from hecate import seeds
from hecate.core import color_effects
class GameOfLife(core.CellularAutomaton):
""" The Idea of classic CA built with HECATE framework """
state = core.IntegerProperty(max_val=1)
class Topology:
dimensions = 2
lattice = core.OrthogonalLatti... | Python | 0 | @@ -878,16 +878,15 @@
cts.
-m
+M
oving
-_a
+A
vera
|
cf77fca59a9073edfab27fd30e907a3054f1ffaa | Add setting for trusting X-Forwarded-Host header in Django | kerrokantasi/settings/base.py | kerrokantasi/settings/base.py | import os
import environ
import raven
gettext = lambda s: s
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
root = environ.Path(BASE_DIR)
env = environ.Env()
env = environ.Env(
DEBUG=(bool, False),
SECRET_KEY=(str, ''),
ALLOWED_HOSTS=(list, []),
ADMINS=(list,... | Python | 0 | @@ -750,16 +750,58 @@
8086'),%0A
+ TRUST_X_FORWARDED_HOST=(bool, False),%0A
)%0A%0ADEBUG
@@ -1633,16 +1633,71 @@
E_URL')%0A
+%0AUSE_X_FORWARDED_HOST = env('TRUST_X_FORWARDED_HOST')%0A%0A
### Sett
|
54682633b6312cb942d819be9c02beb2b5ad7bef | Add edit-entry, single-entry, new_entry. | learning_journal/learning_journal/views.py | learning_journal/learning_journal/views.py | from pyramid.response import Response
import os
HERE = os.path.dirname(__file__)
def home_page(request):
imported_text = open(os.path.join(HERE + '/static/', 'index.html')).read()
return Response(imported_text)
def includeme(config):
config.add_view(home_page, route_name='home')
| Python | 0 | @@ -226,77 +226,682 @@
def
-includeme(config):%0A config.add_view(home_page, route_name='home')%0A
+view_entry(request):%0A imported_text = open(os.path.join(HERE + '/static/', 'single-entry.html')).read()%0A return Response(imported_text)%0A%0A%0Adef new_entry(request):%0A imported_text = open(os.pat... |
f33ce12f1f4bd53cbaa22d7942c32e82f8b718e9 | Add an export version tag and encode strings as utf-8. | king_phisher/client/export.py | king_phisher/client/export.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/export.py
#
# 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, th... | Python | 0 | @@ -1889,16 +1889,84 @@
format()
+%0A%09version = ET.SubElement(metadata, 'version')%0A%09version.text = '1.0'
%0A%0A%09campa
@@ -2157,16 +2157,32 @@
r(value)
+.encode('utf-8')
%0A%0A%09# Tab
@@ -2614,16 +2614,32 @@
r(value)
+.encode('utf-8')
%0A%0A%09eleme
|
d59b01bc8156819b4c19374b79b244968f1043e1 | Fix location field typo when creating user | examples/parent_child.py | examples/parent_child.py | """
Complex data model example modeling stackoverflow-like data.
It is used to showcase several key features of elasticsearch-dsl:
* Object and Nested fields: see User and Comment classes and fields they
are used in
* method add_comment is used to add comments
* Parent/Child relationship
... | Python | 0.000001 | @@ -5806,25 +5806,24 @@
ic.co', loca
-l
tion='Colora
@@ -5952,17 +5952,16 @@
o', loca
-l
tion='Pr
|
7bb5238408d56a2b8491af8c389ef4b739f4ab54 | Improve archive help text | dog/ext/message_logging.py | dog/ext/message_logging.py | import datetime
import functools
import json
import logging
import re
import discord
from discord.ext import commands
from dog import Cog
from dog.core import checks, converters, utils
logger = logging.getLogger(__name__)
def require_logging_enabled(func):
@functools.wraps(func)
async def wrapper(*args, **k... | Python | 0.000818 | @@ -3871,16 +3871,24 @@
%22%22%22
+%0A
Fetches
@@ -3916,16 +3916,444 @@
a user.
+%0A%0A Only Dogbot Moderators can do this.%0A%0A The amount you specify is not equal to the amount of messages that will be shown to you.%0A Rather, it will be the amount of messages that are fetched f... |
1e07b574a36e205a9ec16d8b1039089b7fe6b6db | Add doc for PWSCF. | pymatgen/io/pwscfio.py | pymatgen/io/pwscfio.py | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module implements input and output processing from PWSCF.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Virtual Lab"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "ongsp@ucsd.edu"
__date_... | Python | 0.000028 | @@ -541,155 +541,1350 @@
one,
- electrons=None,%0A ions=None, cell=None, kpoints_mode=%22automatic%22,%0A kpoints_grid=(1, 1, 1),kpoints_shift=(0, 0, 0)):
+%0A electrons=None, ions=None, cell=None, kpoints_mode=%22automatic%22,%0A kpoints_grid=(1, 1, 1),k... |
e3e878ddfb95141b19bdae9e3713690759149ce1 | remove unused property | pyscreenshot/loader.py | pyscreenshot/loader.py | import logging
from pyscreenshot import plugins
import traceback
log = logging.getLogger(__name__)
class FailedBackendError(Exception):
pass
class Loader(object):
def __init__(self):
self.plugins = dict()
self.all_names = [x.name for x in self.plugin_classes()]
self.changed = Tr... | Python | 0.000001 | @@ -840,24 +840,26 @@
s not None%0A%0A
+#
@propert
@@ -852,32 +852,34 @@
# @property%0A
+#
def loaded_p
@@ -884,32 +884,34 @@
_plugins(self):%0A
+#
return s
|
7da9a772771b1734a275107a629ce89b4fb4820d | remove verbose debugging stuff from log. | pytest_nodev/plugin.py | pytest_nodev/plugin.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015-2016 Alessandro Amici
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, c... | Python | 0 | @@ -4411,43 +4411,8 @@
')%0A%0A
- config._warn('%25r' %25 locals())%0A%0A
|
0a765e620709dff244f32f0684e7fd5b6440215a | handle errors on resolve | lbrynet/extras/wallet/ledger.py | lbrynet/extras/wallet/ledger.py | import asyncio
import logging
from binascii import unhexlify
from torba.client.baseledger import BaseLedger
from lbrynet.schema.error import URIParseError
from lbrynet.schema.uri import parse_lbry_uri
from lbrynet.extras.wallet.dewies import dewies_to_lbc
from lbrynet.extras.wallet.resolve import Resolver
from lbrynet... | Python | 0.000001 | @@ -1998,87 +1998,8 @@
- except URIParseError as err:%0A return %7B'error': err.args%5B0%5D%7D%0A
@@ -2092,16 +2092,179 @@
*uris)%0A
+ except URIParseError as err:%0A return %7B'error': err.args%5B0%5D%7D%0A except Exception as e:%0A re... |
8680a745956ad948d83fe845931f75c814a23c70 | Change the SET_COM_PIN_CFG setting. | drivers/display/ssd1306.py | drivers/display/ssd1306.py | # MicroPython SSD1306 OLED driver, I2C and SPI interfaces
from micropython import const
import framebuf
# register definitions
SET_CONTRAST = const(0x81)
SET_ENTIRE_ON = const(0xA4)
SET_NORM_INV = const(0xA6)
SET_DISP = const(0xAE)
SET_MEM_ADDR = const(0x20)
SET_COL_ADDR = const(0x21)
SET_PAGE_ADDR = const(0x22)
SET... | Python | 0 | @@ -1682,20 +1682,31 @@
elf.
+width %3E 2 * self.
height
- == 32
els
|
4bbaa4170c77d8ab9c28df33c20cf3b86b003056 | allow replaying (shared lists bug), new voice line | alexBot/cogs/nOfThesePeopleAreLying.py | alexBot/cogs/nOfThesePeopleAreLying.py | import random
from typing import Dict, List
import discord
from discord import ButtonStyle, Interaction, Member, app_commands, ui
from ..tools import Cog
RANDOM_ARTICLES = ["The Statue Of Liberty", "The Eifle Tower", "Bass Pro Shop Pyramid", "The Taj Mahal", "Fortnite"]
class ArticalModal(ui.Modal, title="My Artic... | Python | 0 | @@ -1166,24 +1166,123 @@
w):%0A
+def __init__(self, *, timeout=180):%0A super().__init__(timeout=timeout)%0A self.
players: Lis
@@ -1309,16 +1309,25 @@
+ self.
orig = N
@@ -2440,10 +2440,14 @@
%5D =
-%7B%7D
+dict()
%0A
@@ -4329,16 +4329,21 @@
'.join(%5B
+f'**%7B
pla... |
0b11bf48989673245adbc89aa6f65c85debafd9f | Make sure billing/shipping aren't populated if they aren't there | armstrong/apps/donations/backends.py | armstrong/apps/donations/backends.py | from armstrong.utils.backends import GenericBackend
from billing import get_gateway
from . import forms
class AuthorizeNetBackend(object):
def get_form_class(self):
return forms.CreditCardDonationForm
def purchase(self, donation, form):
authorize = get_gateway("authorize_net")
author... | Python | 0 | @@ -531,15 +531,13 @@
r
-eturn
+ =
%7B
+%7D
%0A
@@ -541,20 +541,48 @@
-
+if donor.address:%0A r%5B
%22billing
@@ -582,33 +582,35 @@
billing_address%22
-:
+%5D =
%7B%0A
@@ -913,17 +913,50 @@
%7D
-,
+%0A if donor.mailing_address:
%0A
@@ -960,16 +9... |
c69d33b1d7ae22834cfdbeb4b3f07c7ed10fb0fd | Handle exception message with single quotes | python/toree_client.py | python/toree_client.py | #
# (C) Copyright IBM Corp. 2017
#
# 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 writi... | Python | 0.000001 | @@ -5532,17 +5532,17 @@
ception(
-%22
+'
Error: %25
@@ -5547,17 +5547,17 @@
%25s - %25s
-%22
+'
%25(reply
|
d167d79e5de0479bd3ddeeb0e7b03c5de6bb9ad5 | fix key error | iceprod/server/scheduled_tasks/dataset_monitor.py | iceprod/server/scheduled_tasks/dataset_monitor.py | """
Monitor the datasets.
Send monitoring data to graphite.
Initial delay: rand(1 minute)
Periodic delay: 5 minutes
"""
import logging
import random
import time
from tornado.ioloop import IOLoop
from iceprod.server import GlobalID
logger = logging.getLogger('dataset_monitor')
def dataset_monitor(module):
"""... | Python | 0.000006 | @@ -2203,24 +2203,204 @@
ocessing'):%0A
+ if 'suspended' not in tasks%5Bname%5D:%0A tasks%5Bname%5D%5B'suspended'%5D = tasks%5Bname%5D%5Bstatus%5D%0A else:%0A
|
c82a9583d3001e39a2ff3eb929c37ed775c66856 | add docstring stub | analysis/generate_model_predictions.py | analysis/generate_model_predictions.py | import pandas as pd
import numpy as np
import os
import analysis_helpers as h
split_types = ['balancedavg1','balancedavg2','balancedavg3','balancedavg4','balancedavg5']
model_space = ['human_combined_cost','multimodal_fc6_combined_cost','multimodal_conv42_combined_cost',
'multimodal_fc6_S0_cost','multim... | Python | 0.000001 | @@ -72,16 +72,286 @@
s as h%0A%0A
+'''%0ASee the script get_all_model_predictions.py, which is a wrapper around %0Athis script, generate_model_predictions.py to generate csv files that %0Asummarize key statistics of interest (e.g., target rank, cost)%0Afrom model predictions, for each model and data split.%0A'''%0A%0A... |
6ecc3fde7e0a7f767da161f627ad17f4cc249bb9 | Add AppPath class. | ievv_opensource/utils/ievvbuildstatic/filepath.py | ievv_opensource/utils/ievvbuildstatic/filepath.py | import os
from django.apps import apps
class FilePathInterface(object):
"""
Base interface for file path objects.
We provide subclasses if this interface with different use cases:
- :class:`.SourcePath`: Use this to specify a source file or folder
in the sources directory of a :class:`ievv_... | Python | 0 | @@ -3605,20 +3605,717 @@
ersion, *self.path)%0A
+%0A%0Aclass AppPath(AbstractDjangoAppPath):%0A %22%22%22%0A A path to a file or directory within the root directory of%0A a :class:%60ievv_opensource.utils.ievvbuildstatic.config.App%60.%0A %22%22%22%0A def __init__(self, appname, *path):%0A %22%22... |
5efddf26176ac778556a3568bf97c2e70daac866 | Replace many double quotes with single quotes | anchorhub/settings/default_settings.py | anchorhub/settings/default_settings.py | """
Defaults for all settings used by AnchorHub
"""
WRAPPER = "{ }"
INPUT = "."
OUTPUT = "out-anchorhub"
ARGPARSER = {
"description": "anchorhub parses through Markdown files and precompiles "
"links to specially formatted anchors."
}
ARGPARSE_INPUT = {
"help": "Path of directory tree to b... | Python | 0.999999 | @@ -60,13 +60,13 @@
R =
-%22%7B %7D%22
+'%7B %7D'
%0A%0AIN
@@ -75,11 +75,11 @@
T =
-%22.%22
+'.'
%0AOUT
@@ -84,17 +84,17 @@
UTPUT =
-%22
+'
out-anch
@@ -98,17 +98,17 @@
nchorhub
-%22
+'
%0A%0AARGPAR
@@ -119,17 +119,17 @@
= %7B%0A
-%22
+'
descript
@@ -131,17 +131,17 @@
cription
-%22
+'
: %22ancho
@@ -... |
0ac45656e3b76564d1e1752dd16ae91cfc918134 | Set room maximum capacity | app/room.py | app/room.py | class Room(object):
"""Room class that creates rooms in amity
"""
def __init__(self, room_name, room_type, capacity, occupants):
self.room_name = room_name
self.room_type = room_type
self.capacity = capacity
self.occupants = []
class LivingSpace(Room):
"""Creates livi... | Python | 0.000001 | @@ -692,33 +692,33 @@
fice%22, capacity=
-4
+6
, occupants=%5B%5D)%0A
@@ -701,25 +701,24 @@
pacity=6, occupants=%5B%5D)%0A
-%0A
|
89bbea9d4c61e211740ae649a0f3f15bcb89a1a5 | add device_type | lava-kernel-ci-job-creator.py | lava-kernel-ci-job-creator.py | #!/usr/bin/python
import urllib2
import urlparse
import re
import sys
import os
import shutil
base_url = None
kernel = None
dtb_list = []
dtb_map = {'exynos5250-arndale.dtb': 'arndale',
'am335x-boneblack.dtb': 'beaglebone-black',
'omap3-beagle-xm.dtb': 'beagle-xm',
'omap4-panda-es.dtb'... | Python | 0.000008 | @@ -1134,32 +1134,110 @@
tb in dtb_list:%0A
+ dtb_name = dtb.split('/')%5B-1%5D%0A device_type = dtb_map%5Bdtb_name%5D%0A
job_name
@@ -1292,39 +1292,29 @@
+ '-' + dtb
-.split('/')%5B-1%5D
+_name
%0A job
@@ -1824,33 +1824,32 @@
-#
tmp = tmp.replac
|
e3a84c3ccadb98ecb5dae563475de5108d46cf9d | Format external_plugin_dependencies.bzl with buildifier | external_plugin_deps.bzl | external_plugin_deps.bzl | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
maven_jar(
name = "mockito",
artifact = "org.mockito:mockito-core:2.15.0",
sha1 = "b84bfbbc29cd22c9529409627af6ea2897f4fa85",
deps = [
"@byte_buddy//jar",
"@byte_buddy_agent//jar",
"@objenesis//jar",
],
... | Python | 0.000001 | @@ -69,16 +69,18 @@
deps():%0A
+
maven_
@@ -76,32 +76,36 @@
%0A maven_jar(%0A
+
name = %22mock
@@ -110,16 +110,20 @@
ckito%22,%0A
+
arti
@@ -164,24 +164,28 @@
.15.0%22,%0A
+
+
sha1 = %22b84b
@@ -223,16 +223,20 @@
4fa85%22,%0A
+
deps
@@ -240,16 +240,22 @@
eps = %5B%0A
+ ... |
0a902a5afd43fe817320bd1e400828abcd1faa83 | make su promt AIX compatible | lib/ansible/utils/su_prompts.py | lib/ansible/utils/su_prompts.py | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | Python | 0 | @@ -1285,16 +1285,31 @@
%22.join(%5B
+'(%5Cw+%5C's )?' +
x + ' ?:
|
b19fa5114fa3e363a634defa9d4299ec7562c607 | Make p_debug more terse: print test in same line as `DEBUG` prefix. | libexec/windows_shares_discovery_runner.py | libexec/windows_shares_discovery_runner.py | #!/usr/bin/env python
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | Python | 0.000013 | @@ -15,16 +15,18 @@
python%0A
+#%0A
# Copyri
@@ -1852,17 +1852,16 @@
sword)%0A%0A
-%0A
def p_de
@@ -1906,23 +1906,11 @@
EBUG
-%22%0A print
+:%22,
s%0A%0A
|
6e2219643d789038b79ba80bd6be632836e81ce5 | Add app_label to UniversityIDSettings | lms/djangoapps/edraak_university/models.py | lms/djangoapps/edraak_university/models.py | """
Models for the University ID apps.
"""
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.utils.translation import ugettext, ugettext_lazy as _
from courseware.courses import get_course_by_id
from openedx.core.djangoapps.course_groups.cohorts imp... | Python | 0.000001 | @@ -4384,24 +4384,81 @@
nicode(self.course_key)%0A
+%0A class Meta:%0A app_label = 'edraak_university'%0A
|
ed09faba07647cbb67968e3f6c9d001dec8def98 | Rename tests to follow good naming convention. | localized_recurrence/tests/fields_tests.py | localized_recurrence/tests/fields_tests.py | import unittest
from datetime import timedelta
from mock import MagicMock, patch
from .. import fields
class Test_DurationField_to_python(unittest.TestCase):
def setUp(self):
"""Create a mock of the DurationField class and pin to_python to it.
"""
self.df = fields.DurationField()
de... | Python | 0 | @@ -98,37 +98,32 @@
fields%0A%0A%0Aclass
-Test_
DurationField_to
@@ -119,26 +119,28 @@
ionField
-_to_p
+ToP
ython
+Test
(unittes
@@ -1615,37 +1615,32 @@
(td_in)%0A%0A%0Aclass
-Test_
DurationField_ge
@@ -1640,23 +1640,24 @@
ield
-_get_prep_v
+GetPrepV
alue
+Test
(uni
@@ -2537,21 +2537,16 @@
%0A%0Aclass
-T... |
a402d356fbc5ec0a626af925694818d489c527b0 | Remove unused import | localtv/management/commands/bulk_import.py | localtv/management/commands/bulk_import.py | # This file is part of Miro Community.
# Copyright (C) 2010 Participatory Culture Foundation
#
# Miro Community is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at y... | Python | 0.000001 | @@ -926,55 +926,8 @@
ion%0A
-from django.core.files.base import ContentFile%0A
from
|
502ffa8fe93e0066f3553039493ef8b552069141 | Add KDumpConf shared mapper. | falafel/mappers/kdump.py | falafel/mappers/kdump.py | import re
from falafel.core.plugins import mapper
@mapper("cmdline")
def crashkernel_enabled(context):
"""
Determine if kernel is configured to reserve memory for the crashkernel
"""
for line in context.content:
if 'crashkernel' in line:
return True
@mapper("systemctl_list-unit-... | Python | 0 | @@ -3,16 +3,64 @@
port re%0A
+from falafel.core import computed, MapperOutput%0A
from fal
@@ -91,16 +91,16 @@
mapper%0A
-
%0A%0A@mappe
@@ -839,16 +839,17 @@
) and ('
+:
on' in l
@@ -893,32 +893,856 @@
return True%0A%0A%0A
+@mapper(%22kdump.conf%22)%0Aclass KDumpConf(MapperOutput):%0A%0A @staticmethod%0A ... |
4bce4da138c4dc8060e11451eb21fb2f7c0891f5 | Fix issue #1: Runserver failed when having callback function in root URLconf | quickadmin/register.py | quickadmin/register.py | from django.contrib import admin
from django.utils.module_loading import import_module
from django.db.models import get_models
from django.conf import settings
from django.conf.urls import include, url
from django.utils.log import getLogger
from .config import QADMIN_DEFAULT_EXCLUDES, USE_APPCONFIG
logger = getLogg... | Python | 0.000001 | @@ -1441,16 +1441,33 @@
tterns:%0A
+ try:%0A
@@ -1507,24 +1507,28 @@
+
old_pattern
@@ -1546,24 +1546,28 @@
+
+
admin_regex
@@ -1591,16 +1591,20 @@
pattern%0A
+
@@ -1665,14 +1665,172 @@
+
break%0A
+ except AttributeError:%0A ... |
3efd6e00859afd4f8b875ab0d74e937a172f887a | Fix formatting in fedmsg-tweet log. | fedmsg/commands/tweet.py | fedmsg/commands/tweet.py | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg 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 (at your option) any later version.
#... | Python | 0.000008 | @@ -2840,17 +2840,18 @@
for %25i%22
-,
+ %25
hiberna
|
8d45b1f4b25d7f97e74429822a39b5906e65f775 | Fix createdb AttributeError. | filebrowser_safe/base.py | filebrowser_safe/base.py | from __future__ import unicode_literals
# coding: utf-8
import os
import datetime
import time
import mimetypes
from django.core.files.storage import default_storage
from django.db.models.fields.files import FieldFile
from django.utils.encoding import smart_str
from django.utils.functional import cached_property
try:... | Python | 0 | @@ -4522,14 +4522,20 @@
_(self, path
+ or ''
)%0A
|
38a8d47d3bd476f195d866e01b8a800ae86132e5 | update battery script | files/bin/bin/battery.py | files/bin/bin/battery.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##############################################################################
#
# battery
# -------
#
# This script will output a specific icon based on the charge of a laptop
# battery. When the script is run on a system without a battery it will
# output an icon accord... | Python | 0.000001 | @@ -1565,32 +1565,51 @@
ef check_status(
+metric_percentage,
metric_status):%0A
@@ -1608,16 +1608,17 @@
tatus):%0A
+%0A
if m
@@ -1662,9 +1662,9 @@
rn %22
-%E2%9C%94
+%EF%80%8C
%22%0A
@@ -1720,9 +1720,9 @@
rn %22
-%E2%9A%A1
+%EF%83%A7
%22%0A
@@ -1773,17 +1773,326 @@
-return %22%E2%87%A3
+if metric... |
e191a1a52360f78fd65f65727e07695002d0cb77 | Convert PostArchiveAll to use paginate function. | firmant/writers/posts.py | firmant/writers/posts.py | # Copyright (c) 2010, Robert Escriva
# 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 condition... | Python | 0 | @@ -1573,16 +1573,54 @@
t copy%0A%0A
+from firmant.paginate import paginate%0A
from fir
@@ -2750,17 +2750,17 @@
Page
-0
+1
1-2 of
@@ -2836,17 +2836,17 @@
Page
-1
+2
3-4 of
@@ -2924,17 +2924,17 @@
Page
-2
+3
5-5 of
@@ -3160,311 +3160,76 @@
-num_pages = (len(posts) + per_page - 1) / per_pa... |
1cc8161fbbcf6c0994af1cd4d0b4bcc6ba2fe47f | Set message | bluebottle/activities/permissions.py | bluebottle/activities/permissions.py | from rest_framework import permissions
from bluebottle.activities.models import Activity
from bluebottle.initiatives.models import InitiativePlatformSettings
from bluebottle.utils.permissions import ResourcePermission, ResourceOwnerPermission, BasePermission
class ActivityOwnerPermission(ResourceOwnerPermission):
... | Python | 0.000002 | @@ -1709,16 +1709,35 @@
segment%22
+%0A message = None
%0A%0A de
|
bcb2f4677f0fd767cb3c638200398bd08a42d8b7 | Fix for issue #112 | lib/modules/management/runas.py | lib/modules/management/runas.py | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-RunAs',
'Author': ['rvrsh3ll (@424f424f)'],
'Description': ('Runas knockoff. Will bypass GPO path restrictions.'),
'Background' : False,
... | Python | 0 | @@ -3973,20 +3973,16 @@
%5B%22Domain
-Name
%22%5D%5B'Valu
@@ -4121,20 +4121,16 @@
%5D Domain
-Name
/UserNam
|
ff90958a0c79936d5056840ba03a5863bcdef099 | Mark as test as "todo" for now. | formal/test/test_util.py | formal/test/test_util.py | from twisted.trial import unittest
from formal import util
class TestUtil(unittest.TestCase):
def test_validIdentifier(self):
self.assertEquals(util.validIdentifier('foo'), True)
self.assertEquals(util.validIdentifier('_foo'), True)
self.assertEquals(util.validIdentifier('_foo_'), True)
... | Python | 0 | @@ -613,16 +613,84 @@
er('9'), False)%0A
+ test_validIdentifier.todo = %22Fails due to weird import poblem%22%0A%0A
|
03731136b6f2147ded54ce2881eddc4b1dba5d83 | fix missing check for None | bumblebee_status/modules/core/nic.py | bumblebee_status/modules/core/nic.py | # pylint: disable=C0111,R0903
"""Displays the name, IP address(es) and status of each available network interface.
Requires the following python module:
* netifaces
Requires the following executable:
* iw
* (until and including 2.0.5: iwgetid)
Parameters:
* nic.exclude: Comma-separated list of inter... | Python | 0.000016 | @@ -2761,16 +2761,58 @@
ot wlan%0A
+ strength = widget.get(%22strength%22)%0A
@@ -2828,24 +2828,37 @@
iswlan(intf)
+ and strength
:%0A
@@ -2862,36 +2862,24 @@
if
-widget.get(%22
strength
%22) %3C sel
@@ -2862,34 +2862,32 @@
if strength
-%22)
%3C self._strengt
@@ -2967,36 +... |
5163b23f5060e22aee64b2318fff19775ce68aed | Add unique constraints to FilingIDValue and FilerIDValue | calaccess_processed/models/common.py | calaccess_processed/models/common.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Models for storing general filer and filing data derived from raw CAL-ACCESS data.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from calaccess_processed.managers import ProcessedDa... | Python | 0 | @@ -1730,32 +1730,100 @@
ccess_processed'
+%0A unique_together = (('table_name', 'column_name', 'value'),)
%0A%0A def __str_
@@ -2989,16 +2989,69 @@
ocessed'
+%0A unique_together = (('table_name', 'value'),)
%0A%0A de
|
ca39ed340043f1ddeca6fb82e32b2ed3d8971029 | Update terrain_helper.py | cea/datamanagement/terrain_helper.py | cea/datamanagement/terrain_helper.py | """
This script extracts terrain elevation from NASA - SRTM
https://www2.jpl.nasa.gov/srtm/
"""
from __future__ import division
from __future__ import print_function
import os
import gdal
import numpy as np
import pandas as pd
import requests
from geopandas import GeoDataFrame as Gdf
from osgeo import ogr
from osgeo ... | Python | 0.000002 | @@ -5823,366 +5823,35 @@
-This is the main entry point to your script. Any parameters used by your script must be present in the %60%60config%60%60%0A parameter. The CLI will call this %60%60main%60%60 function passing in a %60%60config%60%60 object after adjusting the configuration%0A to reflect parameters... |
ca166f5eaec617eb56020a2349dc74dfa9bfcd57 | verify behavior for single monitors in a cluster | ceph_medic/tests/checks/test_mons.py | ceph_medic/tests/checks/test_mons.py | from ceph_medic import metadata
from ceph_medic.checks import mons
class TestGetSecret(object):
def setup(self):
self.data = {
'paths': {
'/var/lib/ceph': {
'files': {
'/var/lib/ceph/mon/ceph-mon-0/keyring': {
... | Python | 0 | @@ -4274,8 +4274,566 @@
ber: 2'%0A
+%0A%0Aclass TestSingleMon(object):%0A%0A def test_is_single(self, data):%0A metadata%5B'mons'%5D = %7B'mon.0': %5B%5D%7D%0A metadata%5B'cluster_name'%5D = 'ceph'%0A code, message = mons.check_for_single_mon(None, data())%0A assert code == 'WMON5'%0A ... |
2e7271a33e098d7cdef15207e8caa05e644c3223 | Use full URI for build failure reasons | changes/buildfailures/testfailure.py | changes/buildfailures/testfailure.py | from __future__ import absolute_import
from jinja2 import Markup
from changes.buildfailures.base import BuildFailure
class TestFailure(BuildFailure):
def get_html_label(self, build):
link = '/projects/{0}/builds/{1}/tests/?result=failed'.format(build.project.slug, build.id.hex)
try:
... | Python | 0 | @@ -112,16 +112,57 @@
Failure%0A
+from changes.utils.http import build_uri%0A
%0A%0Aclass
@@ -240,16 +240,26 @@
link =
+build_uri(
'/projec
@@ -338,16 +338,17 @@
.id.hex)
+)
%0A%0A
|
b45114af06f5f339b2a70d5a26edea79a1725b01 | Fix slot generator. | generate_custom_slots.py | generate_custom_slots.py | from kodi import Kodi
import re
import string
import random
config_file = os.path.join(os.path.dirname(__file__), "kodi.config")
config = KodiConfigParser(config_file)
kodi = Kodi(config)
# Generate MUSICARTISTS Slot
retrieved = kodi.GetMusicArtists()
all = []
if 'result' in retrieved and 'artists' in retrieved['r... | Python | 0 | @@ -1,25 +1,27 @@
-from kodi
+import re%0A
import
-Kodi
+string
%0Aimp
@@ -21,33 +21,37 @@
ing%0Aimport r
-e
+andom
%0Aimport
string%0Aimpor
@@ -38,36 +38,64 @@
%0Aimport
-string%0Aimport random
+os%0Afrom kodi_voice import KodiConfigParser, Kodi
%0A%0Aconfig
|
4c303007d6418e2a2f1b2e1778d6b7d0c0573c74 | Raise read-only fs on touch | gitfs/views/read_only.py | gitfs/views/read_only.py | import os
from errno import EROFS
from fuse import FuseOSError
from gitfs import FuseMethodNotImplemented
from .view import View
class ReadOnlyView(View):
def getxattr(self, path, fh):
raise FuseMethodNotImplemented
def open(self, path, flags):
return 0
def create(self, path, fh):
... | Python | 0 | @@ -1,14 +1,4 @@
-import os%0A
from
@@ -699,28 +699,103 @@
raise FuseOSError(EROFS)%0A
+%0A def utimens(self, path, times=None):%0A raise FuseOSError(EROFS)%0A
|
79acfd42a4c9eccc1d365412fca9186b568e4d6d | Fix performance for AssetForeignKey | glitter/assets/fields.py | glitter/assets/fields.py | from itertools import groupby
from django.db import models
from django.forms.models import ModelChoiceField, ModelChoiceIterator
class GroupedModelChoiceField(ModelChoiceField):
def __init__(self, queryset, group_by_field='category', group_label=None, *args, **kwargs):
"""
group_by_field is the n... | Python | 0 | @@ -771,16 +771,26 @@
related(
+'category'
).order_
|
7c3a164b74f345be07843482728b2e0b33a927bc | bump minor version | src/graceful/__init__.py | src/graceful/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 0, 4) # PEP 386 # noqa
__version__ = ".".join([str(x) for x in VERSION]) # noqa
"""
Minimalist framework for self-descriptive RESTful APIs build on top of
falcon.
It is inspired by Django REST Framework package. Mostly by how object
serialization is done but more emphasis is p... | Python | 0 | @@ -35,12 +35,12 @@
(0,
-0, 4
+1, 0
) #
|
fc15f0d36c4c0b32966845165445bba903a558ed | Update LinearEquationsSolver.py | LinearEquationsSolver.py | LinearEquationsSolver.py | #CS101 Project
#Linear equations solver using Gaussian elimination for equations with integer coefficients.
#Python 3.6
import sys, os
'''
The standard input textfile will contain an integer T in the first line, denoting the number of system of linear euations to be solved.
The first line of each test case will cont... | Python | 0 | @@ -4329,16 +4329,21 @@
it will
+read
x_ith is
|
9b5d2929f58a3155edc5f03a3cca14ff25356021 | Remove pidfile in Container.kill() | src/libcask/container.py | src/libcask/container.py | import os
import os.path
import time
import signal
import subprocess
import libcask.attach
class Container(object):
def __init__(
self,
name,
root_path,
pid_path,
hostname,
ipaddr,
ipaddr_host,
entry_point,
):
# Human-readable name for t... | Python | 0.000001 | @@ -1964,8 +1964,41 @@
IGKILL)%0A
+ os.unlink(self.pid_path)%0A
|
6f61215263cfe02dc50e508514d1d23208e46d92 | Allow modules context processor works without request.user Fix #524 | material/frontend/context_processors.py | material/frontend/context_processors.py | from . import modules as modules_registry
def modules(request):
"""Add current module and modules list to the template context."""
if not hasattr(request, 'user'):
raise ValueError('modules context processor requires "django.contrib.auth.context_processors.auth"'
'to be in TEM... | Python | 0 | @@ -134,242 +134,8 @@
%22%22%22%0A
- if not hasattr(request, 'user'):%0A raise ValueError('modules context processor requires %22django.contrib.auth.context_processors.auth%22'%0A 'to be in TEMPLATE_CONTEXT_PROCESSORS in your settings file.')%0A%0A
@@ -148,16 +148,16 @@
= None... |
b4a7d177f3d3607244948677c8d33a9dc94ab1a3 | Revise question docstring | lc1093_statistics_from_a_large_sample.py | lc1093_statistics_from_a_large_sample.py | """Leetcode 1093. Statistics from a Large Sample
Medium
URL: https://leetcode.com/problems/statistics-from-a-large-sample/
We sampled integers between 0 and 255, and stored the results in an array count:
count[k] is the number of integers we sampled equal to k.
Return the minimum, maximum, mean, median, and mode of ... | Python | 0.999896 | @@ -456,17 +456,18 @@
ple is:%0A
-%0A
+-
The midd
@@ -555,16 +555,18 @@
is odd;%0A
+-
The aver
|
0d8c30e58d8b53f90f9318cdf3db26ed1e272602 | Fix pep8 violation. | lms/envs/static.py | lms/envs/static.py | """
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We intentionally define lot... | Python | 0 | @@ -715,37 +715,8 @@
dev%22
-,%0A
)%0A%0AD
|
1af17b029cef4c3a197fd3a4813fc704cb277e59 | use the correct name | osmaxx-py/osmaxx/excerptexport/urls.py | osmaxx-py/osmaxx/excerptexport/urls.py | from django.conf.urls import url
from django.contrib.auth.views import login, logout
from django.views.generic import TemplateView
from osmaxx.excerptexport.views import (
list_downloads,
download_file,
extraction_order_status,
list_orders,
NewExtractionOrderView,
access_denied,
)
except_expo... | Python | 0.999997 | @@ -302,24 +302,25 @@
ed,%0A)%0A%0A%0Aexce
+r
pt_export_ur
@@ -1136,16 +1136,17 @@
s = exce
+r
pt_expor
|
dda9b7576269f7dfc7ca864da33f6b047228e667 | remove armeabi and mips targets | config/buildcfg.py | config/buildcfg.py | import sys, os
import dragon
import apps_tools.android as android
import apps_tools.ios as ios
android_pdraw_dir = os.path.join(dragon.WORKSPACE_DIR,
"packages", "pdraw")
android_jni_dir = os.path.join(android_pdraw_dir,
"libpdraw", "android", "jni")
android_app_dir = os.path.join(android_pdraw_dir,
"apps... | Python | 0 | @@ -563,19 +563,8 @@
= %5B
-%22armeabi%22,
%22arm
@@ -590,56 +590,8 @@
8a%22,
-%0A %22mips%22,%0A
%22x8
|
b46cf3c17afb7300d7a72725e70650c59a1e67ad | Update fun.py | code/fun.py | code/fun.py | import asyncio
import discord
from discord.ext import commands
class Fun:
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True)
async def ping(message):
if message.content.startswith('!ping'):
await client.send_message(message.chann... | Python | 0.000001 | @@ -129,25 +129,16 @@
%0A
-
@comman
@@ -179,19 +179,16 @@
m=True)%0A
-
async d
@@ -205,21 +205,16 @@
ssage):%0A
-
if
@@ -261,56 +261,48 @@
+
-await client.send_message(message.channel, 'Pong!'
+return await my_bot.say(%22Hello, world!%22
)%0A
+%0A
|
ae3cad82803198d5ec545419e6b078679be50d29 | Fix bug in scrub output. | apps/scrub.py | apps/scrub.py | """
Create item database.
"""
import logging
import os
import re
import pydarkstar.logutils
import pydarkstar.scrubbing.ffxiah
import pydarkstar.itemlist
import pydarkstar.options
import pydarkstar.common
class Options(pydarkstar.options.Options):
"""
Reads options from config file, then from command line.
... | Python | 0 | @@ -4510,25 +4510,16 @@
-ilist.add(itemid,
+kwargs =
pyd
@@ -4608,16 +4608,51 @@
stock12)
+%0A ilist.add(itemid, **kwargs
)%0A%0A #
|
c6b89b10c78c7a053aa7996c9a85cd64c81860c9 | check whole CSV row | apps/views.py | apps/views.py | from django.http import HttpResponse
from django.views import generic
from django.template import RequestContext, loader
from django.db.utils import ConnectionDoesNotExist
import string, re
from home.models import Crttype, Courts
class OutcomeView(generic.View):
def court_info(self, outcome_data):
court... | Python | 0 | @@ -959,16 +959,20 @@
outcome
+_csv
):%0A
@@ -985,478 +985,85 @@
urn
-outcome != '' %5C%0A and len(outcome) == 29 %5C%0A and re.compile('%5B0-9.%5D').match(outcome%5B0%5D) %5C%0A and re.compile('%5Cd+').match(outcome%5B1%5D) %5C%0A and re.compile('%5Cd+'... |
a307c5fc2555d282dfa6193cdbcfb2d15e185c0c | Allow query without table to run | aq/parsers.py | aq/parsers.py | from collections import namedtuple
import collections
from six import string_types
from aq.errors import QueryParsingError
from aq.select_parser import select_stmt, ParseException
TableId = namedtuple('TableId', ('database', 'table', 'alias'))
QueryMetadata = namedtuple('QueryMetadata', ('tables',))
class SelectP... | Python | 0.000003 | @@ -1,12 +1,31 @@
+import collections%0A
from collect
@@ -52,28 +52,8 @@
le%0A%0A
-import collections%0A%0A
from
@@ -604,111 +604,8 @@
e)%0A%0A
- if not parse_result.table:%0A raise QueryParsingError('No table specified in query')%0A%0A
|
27cd1984aab447e8c64a8b65cae705c3c55a8922 | Make conf argument required | argus/util.py | argus/util.py | # Copyright 2014 Cloudbase Solutions Srl
# 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 r... | Python | 0.002165 | @@ -4229,35 +4229,36 @@
, type=str,
-default=Non
+required=Tru
e,%0A
|
e1c4bb856f9296db92f2388d1a427204994eb88b | version where dependencies have been fixed | loompy/_version.py | loompy/_version.py | __version__ = '1.0.0'
| Python | 0 | @@ -12,11 +12,11 @@
= '1.0.
-0
+1
'%0A
|
e2852dc043f179a8e580447580f66674a3cd1534 | fix pointer-location delete on codeblock analysis. if we run into a location that's a pointer during code-flow, most times it will not be identified on the location of the instruction, but offset. this also brings up the question: what happens if we completely skip the pointer because it fell within the previous instru... | vivisect/analysis/generic/codeblocks.py | vivisect/analysis/generic/codeblocks.py |
"""
A function analysis module that will find code blocks in
functions by flow and xrefs. This is basically a mandatory
module which should be snapped in *very* early by parsers.
"""
#FIXME this belongs in the core disassembler loop!
import sys
import envi
import vivisect
from vivisect.const import *
def analyzeF... | Python | 0.000139 | @@ -1231,32 +1231,33 @@
vw.delLocation(
+l
va)%0A%0A
@@ -1279,16 +1279,19 @@
e're add
+ing
a valid
|
f48c0b25556c3ea89dcb3bd4c4d9608730689be8 | Make sure www.example.test is checked. | src/test-saml.py | src/test-saml.py | #!/usr/bin/python3
from sys import argv
from xvfbwrapper import Xvfb
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
print("Admin password " + argv[1])
with Xvfb() as xvfb:
driver = webdriver.Firefox(log_path = "/tmp/... | Python | 0.999101 | @@ -1053,35 +1053,49 @@
ons.url_
-changes(current_url
+to_be(%22https://www.example.test/%22
))%0A%09prin
|
ad0ef8f6e39b5ebc1e650b3e879d3f7dfea807ac | Make one tweak from python-modernize. | apitools/base/py/util.py | apitools/base/py/util.py | #!/usr/bin/env python
"""Assorted utilities shared between parts of apitools."""
import collections
import os
import random
import urllib
import urllib2
import six
from six.moves import http_client
from apitools.base.py import exceptions
__all__ = [
'DetectGae',
'DetectGce',
]
_RESERVED_URI_CHARS = r":/?#[... | Python | 0 | @@ -1262,18 +1262,31 @@
_spec, s
-tr
+ix.string_types
):%0A r
|
dc3a5d1bec7f03efe30c3dcf280301ad9f0eb24c | Change derivs function but still need multifield potential to test. | pyflation/multifieldmodels.py | pyflation/multifieldmodels.py | '''multifield.py - Classes for multi field cosmological models
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
'''
import numpy as np
from scipy import interpolate
import cosmomodels as c
class MultiFieldModels(c.CosmologicalModel):
'''
Parent ... | Python | 0 | @@ -2999,16 +2999,1490 @@
epsilon%0A
+%0Aclass MultiFieldBackground(MultiFieldModels):%0A %22%22%22Basic model with background equations for multiple fields%0A Array of dependent variables y is given by:%0A %0A y%5B0%5D - %5Cphi_a : Background inflaton%0A y%5B1%5D - d%5Cphi_a/d%5Cn... |
aed103de16687b54c7e66e3adef903d1430e4471 | remove unused model. | ats/models.py | ats/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import models
from django.contrib import admin
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from . import bigint_patch
class UserExtraAttr(models.Model):
user... | Python | 0 | @@ -274,201 +274,8 @@
h%0A%0A%0A
-class UserExtraAttr(models.Model):%0A user = models.ForeignKey(User)%0A expire_dt = models.DateField(null=False)%0A accounttype = models.IntegerField()%0A%0Aadmin.site.register(UserExtraAttr)%0A%0A%0A
@pyt
|
aa9c29dda9522008fefc580abc99ca4ffd369b1e | Rework how MPI packing/unpacking is handled. | pyfr/backends/cuda/packing.py | pyfr/backends/cuda/packing.py | # -*- coding: utf-8 -*-
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
from pyfr.backends.cuda.provider import CudaKernelProvider
from pyfr.backends.cuda.queue import CudaComputeKernel, CudaMPIKernel
from pyfr.util import npdtype_to_ctype, npdtype_to_mpitype
class CudaPackingKernels(CudaKerne... | Python | 0 | @@ -547,33 +547,12 @@
op,
-mpipreqfn, view, pid, tag
+view
):%0A
@@ -591,16 +591,37 @@
k kernel
+ from the pack module
%0A
@@ -693,256 +693,8 @@
))%0A%0A
- # Determine the MPI data type the view packs to/unpacks from%0A mpitype = npdtype_to_mpitype(view.viewof.dtype)%0A%0A # Create a ... |
0bbfcaabcee591ca19702ec071d711ac411597fd | Increment version to 0.2.4 | approvaltests/version.py | approvaltests/version.py | version_number = "0.2.3"
| Python | 0.998885 | @@ -19,7 +19,7 @@
0.2.
-3
+4
%22%0A
|
1e0947e79e6d65309800fd469a826ae6b72c8ba0 | Fix scoping error in coverage. | pyparser/coverage/__init__.py | pyparser/coverage/__init__.py | from __future__ import absolute_import, division, print_function, unicode_literals
from .. import source, lexer
import os, codecs
_buf = None
with codecs.open(os.path.join(os.path.dirname(__file__), '..', 'parser.py'),
encoding='utf-8') as f:
_buf = source.Buffer(f.read(), f.name)
# Inject the gr... | Python | 0 | @@ -4149,21 +4149,16 @@
(_buf, *
-rule.
loc)%0A
|
1eda7cfbda31ab7b39182e4a2fdacf8bfcf147a2 | Update __init__.py | pytorch_lightning/__init__.py | pytorch_lightning/__init__.py | """Root package info."""
__version__ = '0.9.1rc4'
__author__ = 'William Falcon et al.'
__author_email__ = 'waf2107@columbia.edu'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__
__homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
# this has to be simple string, ... | Python | 0.000072 | @@ -40,14 +40,15 @@
'0.
-9.1rc4
+10.0rc1
'%0A__
|
d24cf56d0ad2e8388eb931b10c170df86870c5b0 | Update __init__.py (#4308) | pytorch_lightning/__init__.py | pytorch_lightning/__init__.py | """Root package info."""
__version__ = '1.0.3'
__author__ = 'William Falcon et al.'
__author_email__ = 'waf2107@columbia.edu'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__
__homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
# this has to be simple string, see... | Python | 0 | @@ -38,17 +38,20 @@
= '1.0.
-3
+4rc0
'%0A__auth
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.