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 |
|---|---|---|---|---|---|---|---|
5cefd2c2b37763fe7756913757d9730a2e092de0 | Update hello.py | Python/pip_editable/sample/hello.py | Python/pip_editable/sample/hello.py | def main():
return 'Hello called again.'
| Python | 0.000029 | @@ -33,13 +33,6 @@
lled
- again.
'%0A
|
e9fbd541b3fcb84c6d2de9ba1de53886730a67fa | Add new changes to th branch | common.py | common.py | import os
def get_project_path():
root_dir = os.path.abspath(os.path.dirname(__file__))
return root_dir | Python | 0.000001 | @@ -96,16 +96,123 @@
return root_dir
+%0Adef get_yourproject_path():%0A root_dir = os.path.abspath(os.path.dirname(__file__))%0A return root_dir%0A
|
5ddea6f1280fa2420f5266e01704bceed7ce3afd | update concat.py | concat.py | concat.py | # coding: UTF-8
import os
import subprocess
def main():
movie_list = os.sys.argv[1:]
command = [
'ffmpeg', '-i',
r'concat:"' + '|'.join(movie_list) + r'"',
'-c:v', 'copy',
'-c:a', 'copy',
'concat_' + movie_list[0]
]
p = subprocess.call(' '.join(command), shell=T... | Python | 0 | @@ -9,17 +9,16 @@
: UTF-8%0A
-%0A
import o
@@ -41,166 +41,588 @@
ess%0A
-%0Adef main():%0A movie_list = os.sys.argv%5B1:%5D%0A command = %5B%0A 'ffmpeg', '-i',%0A r'concat:%22' + '%7C'.join(movie_list) + r'%22',%0A '-c:v', 'copy
+from datetime import datetime%0Aimport sys%0A%0Adef main():%... |
bfde5bf55bbd4ab261ffdc9255451a1170ab12a6 | Set default values for config settings | config.py | config.py |
import re
repos_re = re.compile(r'^\[repos "(?P<url_base>.*)"\]\s*$')
var_re = re.compile(r'^\s+(?P<name>\S+)\s*=\s*((?P<value>\S+)|"(?P<qvalue>.*)")\s*$')
class ConfigError(Exception):
pass
class Repos:
location = ''
trunk = ''
branches = ''
tags = ''
def __str__(self):
s = ""
... | Python | 0.000001 | @@ -232,24 +232,29 @@
trunk = '
+trunk
'%0A branch
@@ -255,24 +255,42 @@
branches = '
+branches/$(branch)
'%0A tags =
@@ -291,16 +291,27 @@
tags = '
+tags/$(tag)
'%0A%0A d
|
ddde9238ac6ee9b64e8a8182c1cd3eea8ca40854 | Update environment variables to get the correct directory ENsures that the full path of the files that needed to be loaded using the environment are always specified from the root of the application directory. | config.py | config.py | import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
dotenv_path = os.path.join(basedir, '.env')
load_dotenv(dotenv_path)
class Config:
WTF_CSRF_ENABLED = True
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SAML_PATH = os.environ.get('SAML_P... | Python | 0 | @@ -291,16 +291,17 @@
_PATH =
+(
os.envir
@@ -318,24 +318,40 @@
ML_PATH') or
+%0A
os.path.joi
@@ -367,30 +367,46 @@
.abspath(os.
-curdir
+path.dirname(__file__)
), 'saml')%0A
@@ -403,16 +403,17 @@
'saml')
+)
%0A AGE
@@ -423,16 +423,17 @@
_DATA =
+(
os.envir
@@ -452,24 +452,43 @@
CY_DAT... |
ac569d7240f88dbbb67fc6cfe13fdf9eead2a24d | Fix S3 host | config.py | config.py | # -*- coding: utf-8 -*-
import os
'''Used for finding environment variables through configuration
if a default is not given, the site will raise an exception'''
def get_env_variable(var_name, default=-1):
try:
return os.environ[var_name]
except KeyError:
if default != -1:
retur... | Python | 0.000002 | @@ -2917,16 +2917,32 @@
dataviva
+-site-production
.s3.amaz
|
ae0ac504e01667df8729fa062f7806c61c9d2433 | Correct HOME expansion. | config.py | config.py | #!/usr/bin/env python3
import os
#: Path to lgogdownloader config
lgog_config = os.path.realpath(os.environ.get("LGOG_CONFIG", "~/.config/lgogdownloader"))
#: Path to lgogdownloader cache
lgog_cache = os.path.realpath(os.environ.get("LGOG_CACHE", "~/.cache/lgogdownloader"))
#: Path to GOG game library
lgog_library = ... | Python | 0.000001 | @@ -79,32 +79,34 @@
g = os.path.
-realpath
+expanduser
(os.environ.
@@ -202,32 +202,34 @@
e = os.path.
-realpath
+expanduser
(os.environ.
@@ -329,16 +329,18 @@
ath.
-realpath
+expanduser
(os.
|
a6603ced72ea8284becfd96d3912e7115be3368f | Improve clarity of the code a bit. | conway.py | conway.py | #!/usr/bin/env python
"""Conway's Game of Life, drawn to the terminal care of the Blessings lib
A board is represented like this::
{(x, y): state,
...}
...where ``state`` is an int from 0..2 representing a color.
"""
from itertools import chain
from random import randint
from sys import stdout
from time im... | Python | 0.000001 | @@ -702,27 +702,26 @@
ells = c
-olored_cell
+ell_string
s(term)%0A
@@ -847,21 +847,16 @@
(board,
-wrap=
die)%0A
@@ -1072,19 +1072,18 @@
ef c
-olored_cell
+ell_string
s(te
@@ -1133,16 +1133,25 @@
nt each
+possible
living c
@@ -1163,17 +1163,8 @@
tate
- onscreen
.%0A%0A
@@ -1196,21 +1196,16 @@
ul ones
... |
39758c882bc16834da774a5776f8f9540eb8192e | fix -l for python3 | cuthon.py | cuthon.py | #!/usr/bin/env python
from __future__ import print_function
from __future__ import division
import argparse
import os
import subprocess
import sys
import xml.etree.ElementTree as ET
THRESHOLD = 0.05
SEP = "--"
def get_val(node):
return int(node.text.split()[0])
def get_usage():
cmd = ["nvidia-smi", "-x", "... | Python | 0 | @@ -774,16 +774,21 @@
_list =
+list(
zip(*lea
@@ -795,16 +795,17 @@
st_list)
+)
%5B0%5D%0A
|
30cc6bf4daae62b4c5c7c6f0096820f4877de711 | Fix daemon | daemon.py | daemon.py | import argparse
import logging
import logging.handlers
import os
import time
from daemonize import Daemonize
pid = '/tmp/prodtask-messaging.pid'
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'atlas.settings')
import django
django.setup()
from atlas.messaging.manager import start_proc... | Python | 0.000003 | @@ -116,11 +116,27 @@
= '/
-tmp
+var/log/prodtasklog
/pro
|
3fd04af45c5979cf28672d5ad115e256fc702f64 | bump version | asyncmailer/__init__.py | asyncmailer/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.1' # pragma: no cover
| Python | 0 | @@ -36,11 +36,11 @@
= '
-0.1
+1.0
' #
|
f4e8aff0a37e6c1c1d2e608788dfcfb6b8a68b93 | Add tests for wrong coord system values | tests/test_function_helpers.py | tests/test_function_helpers.py | # Copyright (c) 2020 Cheng Cui
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""py.test for fun... | Python | 0.000001 | @@ -505,16 +505,30 @@
StringIO
+%0Aimport pytest
%0A%0Aimport
@@ -2427,14 +2427,210 @@
0),%0A
+ (%0A %22Absolute%22,%0A 0,%0A 0,%0A ValueError(%0A %22%7B:s%7D is no valid value for Coordinate System%22.format(%22Absolute%22)%0A ),%0A ... |
858aa51c5d552b5c1c705fb5fb3809b55da2cb1b | Add tests for chown | tests/test_unit_module_file.py | tests/test_unit_module_file.py | import unittest
import mock
import tempfile
import shutil
import os
import stat
from base.file import File
from cct.errors import CCTError
class TestFileModule(unittest.TestCase):
test_data = "Test Data 123"
def setUp(self):
self.tempdir = tempfile.mkdtemp('', 'test_unit_module_file')
self.te... | Python | 0 | @@ -2225,16 +2225,1296 @@
0777%22)%0A%0A
+ @mock.patch('base.file.os.chown')%0A def test_chown(self, mock_patch):%0A %22%22%22%0A We can't run an actual chown, but we can test the other logic in%0A the routine.%0A %22%22%22%0A%0A # we can be fairly sure these exists on test sys... |
d483c00875ce59ce4bdcee0119b2d8d3ded959ea | use get_processor in test_vamp_simple_host | tests/test_vamp_simple_host.py | tests/test_vamp_simple_host.py | #! /usr/bin/env python
import unittest
from unit_timeside import TestRunner
from timeside.plugins.decoder.file import FileDecoder
from timeside.core import get_processor
from timeside.core import _WITH_VAMP
from timeside.core.tools.test_samples import samples
@unittest.skipIf(not _WITH_VAMP, 'vamp-simple-host librar... | Python | 0.000002 | @@ -88,36 +88,39 @@
ide.
-plugins.decoder.fi
+core.tools.test_samp
le
+s
import
File
@@ -115,27 +115,23 @@
import
-FileDecoder
+samples
%0Afrom ti
@@ -167,98 +167,147 @@
sor%0A
-from timeside.core import _WITH_VAMP%0Afrom timesi
+%0A%0AFileDecoder = get_processor('file_
de
-.
co
-re.tools.test_samples impo... |
42a54411634ef395ca3c2dfbfeefd7cea2d55101 | Update to v3 of the auth0 client for the exception handling | auth0plus/exceptions.py | auth0plus/exceptions.py |
try:
from auth0.v2.exceptions import Auth0Error
except ImportError: # pragma: no cover
class Auth0Error(Exception):
def __init__(self, status_code, error_code, message):
self.status_code = status_code
self.error_code = error_code
self.message = message
def ... | Python | 0 | @@ -19,9 +19,9 @@
h0.v
-2
+3
.exc
|
5953b8d5d390f21d2b9fd95163ea3527a93359b6 | fix transaction; add some legibility spaces | iatidataquality/test_queue.py | iatidataquality/test_queue.py |
import sys, os, json, ckan, urllib2
import itertools
from datetime import date, datetime
import models, dqprocessing, dqparsetests, \
dqfunctions, queue
import dqprocessing
from lxml import etree
from iatidataquality import db
# FIXME: this should be in config
download_queue='iati_tests_queue'
def aggregate_res... | Python | 0.000015 | @@ -2823,24 +2823,25 @@
on.commit()%0A
+%0A
prin
@@ -3003,24 +3003,25 @@
ommit() %0A
+%0A
dqfu
@@ -3057,16 +3057,29 @@
ge_id, 3
+, commit=True
)%0A ex
|
2694d0444b0200c6a480067174bb4786c489d842 | Update server.py | azurecloudify/server.py | azurecloudify/server.py | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | Python | 0.000001 | @@ -3453,16 +3453,17 @@
t_name+%22
+.
blob.cor
|
86258f714ecd3649873f744f60f2d796d304d4c1 | Fix indentation in `query_rfc_is_also()` | ietf/utility/query_is_also.py | ietf/utility/query_is_also.py | from ietf.sql.bcp import Bcp
from ietf.sql.rfc import IsAlso, Rfc
from ietf.utility.query_doc import (query_bcp, query_fyi, query_rfc,
query_std,)
from ietf.xml.enum import DocumentType
def query_bcp_is_also(Session, number):
docs = [] # List of docs to return
rfcs = Sessi... | Python | 0 | @@ -1053,16 +1053,20 @@
+
if alias
@@ -1092,16 +1092,20 @@
pe.RFC:%0A
+
@@ -1153,32 +1153,36 @@
as_id))%0A
+
+
elif alias_type
@@ -1202,16 +1202,20 @@
pe.STD:%0A
+
@@ -1255,32 +1255,36 @@
ion, alias_id))%0A
+
elif ali
@@ -1316,32 +1316,36 @@
CP:... |
3a983c2a53dee0c56ba67b248bea2e1cd0cf1cd6 | Make strategy test proper URL (https, %s) | backend/breach/tests.py | backend/breach/tests.py | from django.test import TestCase
from mock import patch
from breach.models import SampleSet, Victim, Target, Round
from breach.strategy import Strategy
from breach.analyzer import decide_next_world_state
@patch('sniffer.Sniffer')
class RuptureTestCase(TestCase):
def setUp(self):
target = Target.objects.cr... | Python | 0.000096 | @@ -345,16 +345,17 @@
nt='http
+s
://di.uo
@@ -359,16 +359,26 @@
.uoa.gr/
+?breach=%25s
',%0A
|
5dbf7a2d207affe3bf30355c1ef464165c8aec1d | removing whitespace | ENCODE_patchSet.py | ENCODE_patchSet.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
'''Read in a file of object, correction fields and patch each object'''
import argparse
import os.path
import encodedcc
EPILOG = '''Examples:
To get one ENCODE object from the server/keypair called "default" in the default keypair file and print the JSON:
%(pr... | Python | 0.99948 | @@ -4277,16 +4277,24 @@
temp%5B0%5D
+.strip()
%0A
@@ -4317,16 +4317,24 @@
temp%5B1%5D
+.strip()
%0A
|
ef9216ba4650d4e04b8c92c7e3d7b49edd1fe92d | Remove deprecated comment in breach views | backend/breach/views.py | backend/breach/views.py | from django.http import Http404, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from breach.strategy import Strategy
from breach.models import Victim
import json
def get_work(request, victim_id=0):
assert(victim_id)
try:
victim = Victim.objects.get(pk=victim_id)
except:
... | Python | 0 | @@ -386,163 +386,8 @@
im)%0A
-%0A # Example work structure:%0A # return %7B'url': 'https://www.dimkarakostas.com/?breach-test',%0A # 'amount': 10,%0A # 'timeout': 0%7D%0A%0A
|
217cba914707e48ff20dac7d596c1daeba89fe38 | add default /dashboard url | impactstoryanalytics/views.py | impactstoryanalytics/views.py | import requests
import os
import sys
import json
import logging
import iso8601
from impactstoryanalytics import app, highcharts
from impactstoryanalytics.widgets import *
from flask import request, abort, make_response, g, redirect, url_for
from flask import render_template
from flask.ext.assets import Environment, Bu... | Python | 0.000001 | @@ -4600,16 +4600,77 @@
resp%0A%0A%0A
+@app.route('/dashboard', defaults=%7B'dashboard_name': 'main'%7D)
%0A@app.ro
@@ -4735,17 +4735,16 @@
_name):%0A
-%0A
try:
|
a4fdaefacbceccd63ab41a62ea53cfcbed352bac | Update version.py | umi_tools/version.py | umi_tools/version.py | __version__ = "0.5.3"
| Python | 0.000001 | @@ -16,7 +16,7 @@
0.5.
-3
+4
%22%0A
|
d2fbdf9ad14891c68f5590e43c54383658b5a122 | Fix indentation/line continuation problem introduced with style fix | tools/gen.py | tools/gen.py | #!/usr/bin/env python
#
# Generate Actions from AWS static configuration
#
import json
import os
import urllib2
from slimit.parser import Parser
from slimit.visitors import nodevisitor
from slimit.visitors.ecmavisitor import ECMAVisitor
from slimit import ast
aws_url =
"https://awsiamconsole.s3.amazonaws.com/iam/asset... | Python | 0 | @@ -263,17 +263,23 @@
ws_url =
-%0A
+ %5C%0A
%22https:/
|
5c6a6e5db825905befa9ca903aa557ea3577b7af | Add $ var support in IAR project file. | tools/iar.py | tools/iar.py | #
# File : iar.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the ... | Python | 0 | @@ -3616,32 +3616,56 @@
path.isabs(path)
+ or path.startswith('$')
:%0A
|
e1c657ab19990a034eca381c67cf74f4ffe05425 | add newline after transformation | transform.py | transform.py | import png
import src.loader
import src.seed
import src.pixel
# Intro
print("\x1b[36mIce\x1b[0m Transforming Image 💡")
# Seed
seedText = src.seed.generateSeed()
# Read
f = open("art.png", "rb")
r = png.Reader(f)
info = r.read()
width = info[0]
height = info[1]
data = list(info[2])
alpha = info[3]["alpha"]
skip = 4 ... | Python | 0.000001 | @@ -178,11 +178,26 @@
en(%22
-art
+somecoolwaterfalls
.png
@@ -1526,11 +1526,13 @@
+ %22%5C%22 %E2%9C%A8
+%5Cn
%22)%0A
|
f5d0f7bef431475e596cbeed532e5623b88583d6 | Replace 'schedule_for' with timezone informagtions | dbaas/region_migration/admin/databaseregionmigration.py | dbaas/region_migration/admin/databaseregionmigration.py | # -*- coding: utf-8 -*-
import logging
from django_services import admin
from django.utils.html import format_html
from django.core.urlresolvers import reverse
from django.conf.urls import url, patterns
from django.http import HttpResponseRedirect
from datetime import datetime
from notification.models import TaskHistor... | Python | 0.999999 | @@ -254,20 +254,20 @@
date
+u
ti
-me
+l
import
date
@@ -266,16 +266,10 @@
ort
-datetime
+tz
%0Afro
@@ -5931,16 +5931,98 @@
llback')
+%0A scheduled_for.replace(tzinfo=tz.tzlocal()).astimezone(tz.tzutc())
%0A%0A
|
a69c482fded8bf84c0228b904cc9bd667d63f909 | update docstrings | deepchem/feat/molecule_featurizers/roberta_tokenizer.py | deepchem/feat/molecule_featurizers/roberta_tokenizer.py | from deepchem.feat import MolecularFeaturizer
from transformers import RobertaTokenizerFast
from deepchem.utils.typing import RDKitMol
class RobertaFeaturizer(RobertaTokenizerFast, MolecularFeaturizer):
def __init__(self, **kwargs):
super().__init__(**kwargs)
return
def _featurize(self, mol: RDKitMol, *... | Python | 0.000001 | @@ -129,16 +129,47 @@
KitMol%0A%0A
+from typing import Dict, List%0A%0A
%0Aclass R
@@ -348,24 +348,43 @@
l, **kwargs)
+ -%3E List%5BList%5Bint%5D%5D
:%0A %22%22%22Cal
@@ -586,88 +586,100 @@
-np.ndarray%0A 1D array of RDKit descriptors for %60mol%60. The length is 881.
+encoding: List%0A L... |
e4f924bb774a1a82f52563d73bbe884fb16104cd | Fix styles | bin/learn.py | bin/learn.py | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import matplotlib.pyplot as pp
import numpy as np
import support
import tensorflow as tf
def assess(f):
layer_count = 1
unit_count = 200
unroll_count = 10
learning_rate = 1e-4
train_count = int(1e5)
monitor_peri... | Python | 0.000001 | @@ -2406,16 +2406,63 @@
1:, 0%5D,
+%0A
%5Bunroll
@@ -2469,32 +2469,32 @@
_count - 1, 1%5D)%0A
-
Y_ob
@@ -3133,17 +3133,17 @@
ope(
-%22
+'
network
-%22
+'
) as
@@ -3314,16 +3314,64 @@
ias=0.0,
+%0A
state_... |
f6b3950a956116570a4bc2d9310555805a8b29a2 | Enable result backend | upol_search_engine/celery_app.py | upol_search_engine/celery_app.py | # from __future__ import absolute_import
from celery import Celery
from kombu import Exchange, Queue
from upol_search_engine import settings
class Config(object):
broker_url = 'amqp://guest:guest@localhost:5672//'
task_queues = (
Queue(
'crawler',
exchange=Exchange('crawler')... | Python | 0.000001 | @@ -213,16 +213,75 @@
:5672//'
+%0A result_backend = 'amqp://guest:guest@localhost:5672//'
%0A%0A ta
|
c9e1a1e99aa476b9f3719baf107f09b1c130ed63 | fix call to variables when they are not set (#15916) | bootstrap.py | bootstrap.py | #!/usr/bin/env python
import os
import sys
import subprocess as sp
import argparse
if sys.version_info.major == 3:
PY3 = True
from urllib.request import urlretrieve
else:
PY3 = True
from urllib import urlretrieve
usage = """
The easy way to test recipes is by using `circleci build`. However this doe... | Python | 0 | @@ -3889,18 +3889,25 @@
iron
-%5B
+.get(
'PATH'
-%5D
,
+%22%22),
%0A
@@ -3932,17 +3932,21 @@
.environ
-%5B
+.get(
'HTTPS_P
@@ -3950,17 +3950,21 @@
S_PROXY'
-%5D
+, %22%22)
,%0A 'h
@@ -3986,17 +3986,21 @@
.environ
-%5B
+.get(
'https_p
@@ -4004,17 +4004,21 @@
s_proxy'
-%5D
+, %22%22)
%0A%7D%0A%0Asp.c
|
2249dc80e1605bf7a098ac9c9c3f1143ac469731 | remove authtoken | bootstrap.py | bootstrap.py | #!/usr/bin/python
import argparse
import errno
import os
import os.path
api_template = """
module {module_name}.API where
import Html exposing (Html)
import StartApp
import Effects exposing (Never)
import Task exposing (Task)
import {module_name}.Update exposing (update, Action(..), Addresses)
import {module_name}.... | Python | 0.999495 | @@ -812,33 +812,8 @@
ml%0A%0A
-port authToken : String%0A%0A
port
|
0a67d5bbb7205912e3bf95182dc7a26cea59ead6 | Humanize the string 'twilio_enabled' a bit. | inthe_am/taskmanager/admin.py | inthe_am/taskmanager/admin.py | import datetime
import json
import urlparse
from django.contrib import admin
from django.utils.safestring import mark_safe
from django.utils.timezone import now
from .models import (
Announcement,
TaskAttachment,
TaskStore,
TaskStoreActivityLog,
UserMetadata
)
class DefaultFilterMixIn(admin.Mode... | Python | 0.999992 | @@ -2416,33 +2416,33 @@
title = 'twilio
-_
+
enabled'%0A par
|
6a987a05dc57f3c79ccbffce48d09eb589242a9d | Set a higher max_retries setting to see if that'll help. | inthe_am/taskmanager/tasks.py | inthe_am/taskmanager/tasks.py | from __future__ import absolute_import
from fnmatch import fnmatch as glob
import logging
import re
import shlex
import uuid
from celery import shared_task
from django.conf import settings
from django.utils.timezone import now
from django_mailbox.models import Message
from .context_managers import git_checkpoint
l... | Python | 0 | @@ -451,16 +451,76 @@
lay=60,%0A
+ max_retries=10, # We should always stop at two, anyway%0A
igno
|
64f04ee05de166d0c9197bd17eb661f76862804b | Fix version character replacement. | libftb/ftb.py | libftb/ftb.py | __author__ = 'Arkan'
import urllib.request
import os.path
import time
import xml.etree.ElementTree as ET
import libftb.internal.parser as parser
CDN_ROOT = "http://ftb.cursecdn.com/FTB2"
def get_packs():
root = __get_or_create_cache()
return parser.packs_xml_to_dict(root)
def get_pack_url(pack_dict, vers... | Python | 0 | @@ -490,16 +490,26 @@
on'%5D%0A
+ version =
version
|
9e8a7538e7242167572f888d99d2903464fc5f6e | Make variables class members | brainfuck.py | brainfuck.py | import sys
from getch import getch
commands = '><+-.,[]'
class BrainfuckInterpreter:
@staticmethod
def find_matching_paren(source, c):
paren = 0
d = {'[':']', ']':'['}
for k in range(len(source)):
if source[k]==c:
paren += 1
elif source[k]==d[c]:... | Python | 0.000005 | @@ -80,16 +80,104 @@
preter:%0A
+ def __init__(self):%0A self.i = 0%0A self.p = 0%0A self.cells = %5B0%5D%0A%0A
@sta
@@ -540,56 +540,8 @@
e):%0A
- i = 0%0A p = 0%0A cells = %5B0%5D%0A
@@ -550,16 +550,21 @@
while
+self.
i != len
@@ -596,16 +596,21 @@
sourc... |
59f29688d45916be81206201dd314ce140b8a154 | Improve handling of non-ASCII chars (fixes #3). | rsr/cmd.py | rsr/cmd.py | import signal
import sys
from argparse import ArgumentParser
from gi.repository import Gio, GLib
from rsr import __version__
from rsr.app import Application
parser = ArgumentParser(prog='runsqlrun', description='Run SQL statements')
parser.add_argument(
'--version', action='version', version='%(prog)s ' + __vers... | Python | 0 | @@ -1,16 +1,26 @@
+import os%0A
import signal%0Aim
@@ -331,16 +331,154 @@
ion__)%0A%0A
+# See issue3. Unfortunately this needs to be done before opening%0A# any Oracle connection.%0Aos.environ.setdefault('NLS_LANG', '.AL32UTF8')%0A%0A
%0Adef mai
|
871b3ccd536916f2c6fa6e283007c6237dcc21bc | fix data format bug | libs/utils.py | libs/utils.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2012-11-06 11:50:13
import logging
import hashlib
import datetime
md5string = lambda x: hashlib.md5(x).hexdigest()
class ReadOnlyDict(dict):
def __se... | Python | 0.000001 | @@ -2720,17 +2720,17 @@
seconds
-=
+%3C
= 1 else
@@ -2939,17 +2939,17 @@
minutes
-=
+%3C
= 1 else
@@ -3117,16 +3117,21 @@
f hours
+%3C= 1
else %5C%0A
|
c8085fda4afba86ca102c29019302e3dd778031b | Return creds in HTML | rum/rum.py | rum/rum.py | import threading
from flask import Flask
from users import users
api = Flask(__name__)
lock = threading.Lock()
user_num = 0
@api.route('/')
def index():
return 'Rackspace User Management'
@api.route('/user')
def get_user():
global user_num
with lock:
if user_num < len(users):
bash... | Python | 0 | @@ -309,21 +309,140 @@
-bash
+html = %22%3Cpre%3E%5Cn%22%0A html += %22export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/%5Cn%22%0A html +
= %22expor
@@ -462,10 +462,10 @@
AME=
-OR
+IA
D%5Cn%22
@@ -469,36 +469,36 @@
%5Cn%22%0A
-bash
+html
+= %22export OS_... |
50687e08cbac835a3eb0cbe1a9bfbc95f9ee2c63 | Fix QT with gcc 4.9 build error where QT's -Wl,--no-undefined interfered with gcc's implicit libgcc_s.so library | var/spack/packages/qt/package.py | var/spack/packages/qt/package.py | import os
from spack import *
import os
class Qt(Package):
"""Qt is a comprehensive cross-platform C++ application framework."""
homepage = "http://qt.io"
list_url = 'http://download.qt-project.org/official_releases/qt/'
list_depth = 2
version('5.4.0', 'e8654e4b37dd98039ba20da7a53877e6',
... | Python | 0.000006 | @@ -1741,16 +1741,21 @@
ke_conf
+
= 'mkspe
@@ -1771,32 +1771,93 @@
/g++-base.conf'%0A
+ qmake_unix_conf = 'mkspecs/common/g++-unix.conf'%0A
elif sel
@@ -1903,16 +1903,21 @@
ke_conf
+
= 'qtbas
@@ -1940,32 +1940,100 @@
/g++-base.conf'%0A
+ qmake_unix_conf = 'qtbase/mkspecs... |
65e8d59dbad3e6a69d685e0a00d82fe6e30cfc9e | save state of the UI to continue where you left off | like_items.py | like_items.py | from appJar import gui
from pickle import load, dump
from argparse import ArgumentParser
from os.path import join
from PIL import Image
from pprint import pprint
from data_sets.contains_images import add_border
SAVE_FOLDER = 'data'
def parse_command_line():
parser = ArgumentParser(description="Simple GUI to lik... | Python | 0 | @@ -106,16 +106,24 @@
ort join
+, isfile
%0Afrom PI
@@ -214,16 +214,54 @@
border%0A%0A
+STATE_FILE = 'data/like_items.state'%0A%0A
SAVE_FOL
@@ -1697,16 +1697,143 @@
Span 2%0A%0A
+ self.app.bindKey('l', self.like)%0A self.app.bindKey('d', self.dislike)%0A self.app.bindKey('s', self.stop)%0A%0A
... |
6f5a6d56125c48221e9f3a45e6eddc031c449966 | Fix CSS minification. | linkfinder.py | linkfinder.py | #!/usr/bin/env python
# Python 2.7.x - 3.6.x
# LinkFinder
# By Gerben_Javado
# Import libraries
import re
import sys
import os
import glob
import cgi
import argparse
import requests
from requests_file import FileAdapter
import jsbeautifier
# Regex used
regex = re.compile(r"""
([^\n]*(?:"|') # St... | Python | 0 | @@ -3950,16 +3950,19 @@
html = %22
+%22%22%0A
%3Cstyle%3E.
@@ -4016,26 +4016,16 @@
lvetica;
-%5C%0A
color: #
@@ -4067,24 +4067,16 @@
rtant%7D%5C%0A
-
.contain
@@ -4119,24 +4119,16 @@
g:5px;%5C%0A
-
font-fam
@@ -4178,24 +4178,16 @@
: 1px;%5C%0A
-
border-s
@@ -4222,24 +4222,16 @@... |
3afdaf71ccf7a541010812527d4d7f91100eae97 | Fix 'FileNotFoundError'. | linkfinder.py | linkfinder.py | #!/usr/bin/env python
# Python 2.7.x - 3.6.x
# LinkFinder
# By Gerben_Javado
# Import libraries
import re
import sys
import os
import glob
import cgi
import argparse
import requests
from requests_file import FileAdapter
import jsbeautifier
import webbrowser
from string import Template
# Regex used
regex = re.compile(... | Python | 0.000012 | @@ -4760,16 +4760,27 @@
pen('%25s/
+LinkFinder/
template
@@ -4804,28 +4804,28 @@
dirname(sys.
-argv
+path
%5B0%5D), 'r').r
|
9fe2172247a1ca943cf21633ce1ab7def7bc63bb | Update streaming.py | app/lib/twitter_api/streaming.py | app/lib/twitter_api/streaming.py | """
Streaming module.
This is not directly related to the tweet and trending part of the
Twitterverse package but it has been included anyway. Results are not
guaranteed due to rate limiting not being investigated fully.
This does not need any database setup like the rest of the project does.
You just need your Twitt... | Python | 0.000001 | @@ -7619,16 +7619,22 @@
erateApp
+Access
Token()%0A
|
07f1a36b30c35dee40a82ae1a6b6ab4635f7cf39 | Move constant | bootstrap.py | bootstrap.py | #!/usr/bin/env python
"""Bootstrap the setup tool.
This assumes Python is installed on the target os, but not specifically Python3.
What this does (only intended for Mac atm):
* installs Homebrew
* Homebrew installs a core set of packages (git and python3)
* git check out the project into ~/setup
* run
- setup (w... | Python | 0.000316 | @@ -763,16 +763,71 @@
/setup')
+%0ASETUP_EXE = os.path.join(SETUP_PATH, 'HOME/bin/setup')
%0A%0Adef ma
@@ -1648,67 +1648,8 @@
s%22)%0A
- setup_exe = os.path.join(SETUP_PATH, 'HOME/bin/setup')%0A
@@ -1744,25 +1744,25 @@
dirname(
-setup_exe
+SETUP_EXE
), # ad
@@ -1908,17 +1908,17 @@
ll(%5B
-setup_exe
+SET... |
ee7968f5b93f3c351da0fdf0ce2ce1a3118092e4 | fix wikipedia | jsb/plugs/common/wikipedia.py | jsb/plugs/common/wikipedia.py | # plugs/wikipedia.py
#
#
""" query wikipedia .. use countrycode to select a country specific wikipedia. """
## jsb imports
from jsb.utils.url import geturl, striphtml
from jsb.utils.generic import splittxt, handle_exception, fromenc
from jsb.lib.commands import cmnds
from jsb.lib.examples import examples
from jsb.ut... | Python | 0.999981 | @@ -538,25 +538,23 @@
-txt = txt.strip()
+input = %5B%5D
%0A
@@ -735,58 +735,34 @@
-txt = txt.replace(u%22-%25s%22 %25 lang, '')%0A txt = txt
+ input.append(i.strip()
.cap
@@ -770,16 +770,17 @@
talize()
+)
%0A wha
@@ -787,28 +787,22 @@
t =
-txt.replace(' ', '_'
+%22_%22.join(input
)%... |
4fa65fbb2f377c14673645800142d7334007818f | add doc for layers/normalization/BatchNormalization (#3248) | keras/layers/normalization.py | keras/layers/normalization.py | from ..engine import Layer, InputSpec
from .. import initializations
from .. import backend as K
class BatchNormalization(Layer):
'''Normalize the activations of the previous layer at each batch,
i.e. applies a transformation that maintains the mean activation
close to 0 and the activation standard deviat... | Python | 0 | @@ -1874,16 +1874,89 @@
ape,)%5D%60%0A
+ Note that the order of this list is %5Bgamma, beta, mean, std%5D%0A
|
21e6c074b311896b26d4bf2d6d9c3e5af345a1a6 | fix disable_on_activity feature | kivy/input/providers/mouse.py | kivy/input/providers/mouse.py | '''
Mouse provider implementation
=============================
On linux system, mouse provider can be annoying when used with another
multitouch provider (hidinput or mtdev.). Mouse can conflict with them: a single
touch can generate one event from mouse provider and from multitouch provider.
To avoid this behavior,... | Python | 0.000007 | @@ -2817,33 +2817,25 @@
ase.
-getCurrentMotionEventes()
+EventLoop.touches
%0A
|
9263daa9778ea2496067fe5ee3751c1aac7c23f6 | Use a fallback logger | leapp/libraries/stdlib/api.py | leapp/libraries/stdlib/api.py | """
This module implements a convenience API for actions that are accessible to actors.
Any code that wants use this convenience library has to be called from within the actors context.
This is true for actors, actor private libraries and repository libraries.
"""
from leapp.actors import Actor
ErrorSeverity = Actor... | Python | 0.000001 | @@ -259,16 +259,32 @@
es.%0A%22%22%22%0A
+import logging%0A%0A
from lea
@@ -1625,16 +1625,76 @@
or().log
+ if current_actor() else logging.getLogger('leapp.fallback')
%0A%0A%0Adef p
|
9336c9383eb3cd0c9b92e6524cccb2b7aa4a3ea6 | fix model inheritence | leonardo/module/nav/mixins.py | leonardo/module/nav/mixins.py |
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
ORIENTATION_CHOICES = (
('vertical', 'Vertical'),
('horizon', 'Horizon'),
)
class NavigationWidgetMixin(object):
display_active = models.NullBooleanField(
verbose_name=... | Python | 0.000001 | @@ -240,14 +240,20 @@
xin(
-object
+models.Model
):%0A%0A
@@ -614,8 +614,49 @@
ontal')%0A
+%0A class Meta:%0A abstract = True%0A
|
f752df6eece63a9ab6b806c0f24779f88e19ccd9 | Use test site in item tests | vasara/tests/test_item.py | vasara/tests/test_item.py | from unittest import TestCase
from vasara.item import Item
TEST_ITEM = """---
{
"name": "Test",
"list": [1, 2, 3]
}
---
Hello, world! This is the actual content."""
class TestItem(TestCase):
def setUp(self):
self.site = None # TODO
self.item = Item(key="test", site=self.site, raw=TEST_IT... | Python | 0 | @@ -51,16 +51,64 @@
ort Item
+%0Afrom vasara.tests.common import build_test_site
%0A%0ATEST_I
@@ -289,19 +289,25 @@
e =
-None # TODO
+build_test_site()
%0A
|
f916fe1715ab891ded093c9adb9a6d0a4d2b30eb | add more complex example | unification/tests/test_match.py | unification/tests/test_match.py | from unification.match import *
from unification.utils import raises
def inc(x):
return x + 1
def dec(x):
return x - 1
def test_simple():
d = Dispatcher('d')
d.add((1,), inc)
d.add((10,), dec)
assert d(1) == 2
assert d(10) == 9
def test_raises_error():
d = Dispatcher('d')
a... | Python | 0.000064 | @@ -61,16 +61,49 @@
t raises
+%0Afrom unification.core import var
%0A%0Adef in
@@ -154,24 +154,126 @@
urn x - 1%0A%0A%0A
+def add(x, y):%0A return x + y%0A%0A%0Adef mul(x, y):%0A return x * y%0A%0A%0Adef foo(*args):%0A return args%0A%0A%0A
def test_sim
@@ -369,16 +369,16 @@
1) == 2%0A
-
asse
@@ -393,... |
73e7b6b4c9393c60a4d30ec9def7513e4ac0e2f2 | add --skip | buildPDFs.py | buildPDFs.py | """
Build pdfs from student notebooks. You need a 'report_rubric.pdf' in the same directory as this file.
"""
import sys
import os
import glob
if len(sys.argv)>1:
paths=sys.argv[1:]
else:
paths=[os.curdir]
files = []
for path in paths:
if os.path.isdir(path):
files += glob.glob(os.path.join(path,... | Python | 0 | @@ -219,16 +219,35 @@
les = %5B%5D
+%0Askiprubric = False
%0A%0Afor pa
@@ -259,16 +259,93 @@
paths:%0A
+ if path.startswith('--skip'):%0A skiprubric = True%0A continue%0A
if o
@@ -554,16 +554,39 @@
.pdf')%0A%0A
+print(%22Files:%22,files)%0A%0A
for fnam
@@ -602,20 +602,26 @@
s:%0A f
-Root... |
17d13e0eb40efe2ac50a6616591a4e434546edc0 | convert to being a priority queue. (ref kaniini/mammon#12) | ircreactor/events.py | ircreactor/events.py | # events.py
# Purpose: Subscription, broadcast and mutation of events
#
# Copyright (c) 2014, William Pitcock <nenolod@dereferenced.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permi... | Python | 0 | @@ -1364,32 +1364,40 @@
ceiver):%0A
+ nlist =
self.subscriber
@@ -1401,24 +1401,87 @@
bers
-.append(receiver
+ + %5Breceiver%5D%0A self.subscribers = sorted(nlist, key=lambda x: x.priority
)%0A%0A
@@ -1892,34 +1892,140 @@
le, manager=None
-):
+, priority=10):%0A self.event = event%0A ... |
ffa8b40530c1be118a230312141cfb8ee4165bae | Add utils for shortcutting error responses | virtool/handlers/utils.py | virtool/handlers/utils.py | async def unpack_json_request(req):
return req.app["db"], await req.json()
| Python | 0 | @@ -1,8 +1,34 @@
+from aiohttp import web%0A%0A%0A
async de
@@ -98,8 +98,308 @@
.json()%0A
+%0A%0Adef not_found():%0A return web.json_response(%7B%22message%22: %22Not found%22%7D, status=404)%0A%0A%0Adef requires_login():%0A return web.json_response(%7B%22message%22: %22Requires login%22%7D, status=400)%0A%0A%... |
79a1351c45ac91bc079a44cb756011f07f96315e | Fix thread timing issue | synapse/tests/test_lib_threads.py | synapse/tests/test_lib_threads.py | import synapse.lib.socket as s_socket
import synapse.lib.threads as s_threads
from synapse.tests.common import *
def newtask(func, *args, **kwargs):
return (func, args, kwargs)
class ThreadsTest(SynTest):
def test_threads_pool(self):
def woot(x, y):
return x + y
with s_threads.Po... | Python | 0 | @@ -1692,16 +1692,42 @@
threads'
+, 'error running task for'
) as str
@@ -1832,22 +1832,32 @@
-time.sleep(0.1
+self.true(stream.wait(2)
)%0A%0A
@@ -1893,112 +1893,8 @@
y'))
-%0A stream.seek(0)%0A mesgs = stream.read()%0A self.isin('error running task for', mesgs)
%0A%0A
|
ba7f08d047afffc2b87950910cac0cdd48b76302 | Revert "Remove "fire_event" from AsyncClientMixin, since this was only added to remove infinite recusion in the reactor-- which is now not calling this API" | salt/client/mixins.py | salt/client/mixins.py | # coding: utf-8
'''
A collection of mixins useful for the various *Client interfaces
'''
from __future__ import print_function
import datetime
import logging
import multiprocessing
import salt.utils
import salt.utils.event
from salt.utils.event import tagify
from salt.utils.doc import strip_rst as _strip_rst
log = lo... | Python | 0 | @@ -1854,16 +1854,33 @@
tag, jid
+, fire_event=True
):%0A
@@ -2205,16 +2205,43 @@
%7D%0A
+ if fire_event:%0A
@@ -2292,16 +2292,20 @@
+
'master'
@@ -2314,32 +2314,36 @@
+
+
self.opts%5B'sock_
@@ -2345,24 +2345,28 @@
sock_dir'%5D,%0A
+
... |
bf793414727a04a1adbf5f0d6a837cae4e8413b6 | Add missing new line at the end of the file. | salt/runners/cache.py | salt/runners/cache.py | '''
Return cached data from minions
'''
# Import salt libs
import salt.utils.master
import salt.output
import salt.payload
def grains(minion=None):
'''
Return cached grains for all minions or a specific minion
'''
pillar_util = salt.utils.master.MasterPillarUtil('*', 'glob',
... | Python | 0 | @@ -117,16 +117,17 @@
ayload%0A%0A
+%0A
def grai
@@ -1936,20 +1936,21 @@
return cached_pillar
+%0A
|
2ab3a201509355fa0d426d9c6dc86a75c7c55b9d | make except more specific | saltobserver/views.py | saltobserver/views.py | from saltobserver import app, redis_pool
from flask import Response
from flask import render_template, redirect, url_for, request
from redis import Redis
import json
import time
@app.route('/_get_function_data/<minion>/<jid>/')
def get_function_data(minion, jid):
"""AJAX access for loading function/job details.... | Python | 0.000011 | @@ -1857,34 +1857,134 @@
%0A except
-Exception:
+ValueError: # from either time.strptime or json.loads%0A # should never occur when dealing with real data
%0A pas
|
76937d270ee10cf81f50c871a7b93dad33c80d37 | Remove unused data stash variable in join task | tukio/task/join.py | tukio/task/join.py | import asyncio
import logging
from copy import copy
from enum import Enum
from datetime import datetime, timezone
from .holder import TaskHolder
from .task import register
log = logging.getLogger(__name__)
class JoinStatus(Enum):
RUNNING = 'running'
TIMEOUT = 'timeout'
DONE = 'done'
@register('join'... | Python | 0.000001 | @@ -611,23 +611,8 @@
= (
-'_data_stash',
'_wa
@@ -648,16 +648,16 @@
'data')%0A
+
%0A def
@@ -718,38 +718,8 @@
ig)%0A
- self._data_stash = %5B%5D%0A
@@ -1614,63 +1614,8 @@
t):%0A
- self._data_stash.append(event.data.copy())%0A
@@ -1799,63 +1799,8 @@
or:%0A
- self._dat... |
2d875ce13d92e4943b24bbc34154da2031e492c5 | Fix file permissions. | fix-rpath.py | fix-rpath.py | #!/usr/bin/env python
"""fix-rpath.py - Fix run-time search paths
Usage:
python fix-rpath.py <prefix>
python fix-rpath.py [-h | --help]
"""
from __future__ import print_function
import os
import platform
import subprocess
import sys
__author__ = 'Mansour Moufid'
__copyright__ = 'Copyright 2015, 2016, Man... | Python | 0 | @@ -210,16 +210,28 @@
latform%0A
+import stat%0A
import s
@@ -429,72 +429,8 @@
'%0A%0A%0A
-def isrw(path):%0A return os.access(path, os.R_OK %7C os.W_OK)%0A%0A%0A
def
@@ -3655,59 +3655,8 @@
th))
-%0A paths = (path for path in paths if isrw(path))
%0A%0A
@@ -3750,24 +3750,118 @@
print(exe)%0A
+ m... |
6faa2ddadfd488029728bc969e16e6be1ef10c6d | Add detail parameter to jingju get_artists | compmusic/dunya/jingju.py | compmusic/dunya/jingju.py | import errno
import logging
import os
logger = logging.getLogger("dunya")
from compmusic.dunya import conn
import compmusic.dunya.docserver
COLLECTIONS = None
def set_collections(collections):
""" Set a list of collections mbid to restrict the queries.
You must call this before you can make any other calls... | Python | 0 | @@ -1767,16 +1767,35 @@
artists(
+artist_detail=False
):%0A %22
@@ -2166,32 +2166,97 @@
t_collections()%0A
+ args = %7B%7D%0A if artist_detail:%0A args%5B'detail'%5D = '1'%0A
return conn.
@@ -2311,32 +2311,40 @@
rs=extra_headers
+, **args
)%0A%0A%0Adef get_arti
|
4fb0ddc14e64fdde334ee7e863c99b9d0532cce6 | Fix including speaker names in kaf files | folia2kaf.py | folia2kaf.py | """Create a KAF file for each act in a FoLiA file
Usage: python folia2kaf.py <file in>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools.bs4_helpers import act, sentence, word, speaker_turn, note
import argparse
import os
_folia_pos2kaf_pos = {
'WW': 'V', # Werkwoord -> Verb
'VNW': 'Q',... | Python | 0 | @@ -1340,146 +1340,8 @@
id)%0A
- if speaker_turn(elem):%0A w.text = unicode(elem%5B'actor'%5D)%0A lemma = unicode(elem%5B'actor'%5D)%0A pos = 'O'%0A else:%0A
@@ -1372,20 +1372,16 @@
string)%0A
-
lemm
@@ -1408,20 +1408,16 @@
class')%0A
-
pos
@@ -2936,236 +2936,8... |
6cdd22b746f901c1d8de5356f78452e491411829 | use 6 inputs | footInput.py | footInput.py | #!/usr/bin/env python
'''
v0.4 2016 Apr 23
- add UDP_procCommand()
v0.3 2016 Apr 23
- add UDP_recvData()
- add UDP_setup()
- add GPIO_setup()
v0.2 2016 Apr 23
- define main()
- change interval to 10 msec base for UDP comm
v0.1 2016 Apr 23
- can check 5 GPIO input
'''
import RPi.GPIO as GPIO
import socke... | Python | 0.000005 | @@ -20,16 +20,50 @@
on%0A%0A'''%0A
+v0.5 2016 Apr 23%0A - use 6 inputs%0A
v0.4 201
@@ -63,32 +63,32 @@
0.4 2016 Apr 23%0A
-
- add UDP_proc
@@ -397,16 +397,20 @@
, 32, 26
+, 24
%5D%0Avals =
@@ -416,17 +416,17 @@
= range(
-5
+6
)%0A%0Adef G
@@ -480,33 +480,33 @@
or idx in range(
-5
+6
):%0A GPIO.
@@ -... |
12599d4ea46e21e6b2fe2bebf0c6ae8e54e417d2 | change training epochs | BEGAN/began_train.py | BEGAN/began_train.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import tensorflow as tf
import numpy as np
import sys
import time
import began_model as began
sys.path.append('../')
import image_utils as iu
from datasets import DataIterator
from datasets import CelebAData... | Python | 0.000001 | @@ -485,10 +485,10 @@
h':
-50
+77
,%0A
|
c05f816936ce5ddc728501d48892d00bbac40360 | Make popit_url readonly. | speeches/forms.py | speeches/forms.py | import os
import logging
from datetime import datetime
import pytz
from django_select2.widgets import Select2Widget, Select2MultipleWidget
from mptt.forms import TreeNodeChoiceField
from django import forms
from django.forms.forms import BoundField
from django.forms.widgets import Textarea
from django.core.files.uplo... | Python | 0 | @@ -7259,29 +7259,82 @@
forms.TextInput(
+%7B'class': 'input-block-level', 'readonly':'readonly'%7D
),%0A %7D%0A
|
89dd3992ac74996071e8627c80772f8ee64c4faa | Update run_codeml tool configuration to reflect changes in calling run_codeml Add TODO item to remove split_by_taxon after the above change is made final | split_by_taxon.py | split_by_taxon.py | #!/usr/bin/env python
"""Module to split multiple sequence alignments of two taxa into separate MSAs per taxon."""
from Bio import AlignIO
from Bio.Align import MultipleSeqAlignment
from divergence import parse_options, extract_archive_of_files, create_directory, create_archive_of_files
import logging as log
import os... | Python | 0 | @@ -361,16 +361,48 @@
mpfile%0A%0A
+#TODO Remove module & XML file%0A%0A
def spli
|
b19380e26e005d4ab71baaac1ee0158a82f64cf3 | fix encode | functions.py | functions.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
import hashlib
import functools
import os
import posixpath
import random
def GET_WIKI_PAGES():
content = 'content/pages/wiki'
wiki_pages = []
for page in os.listdir(content):
ler_arquivo = open(content+'/'+page, 'r', encoding='utf-8')
titulo... | Python | 0.998582 | @@ -40,16 +40,26 @@
-8 -*- #
+%0Aimport io
%0A%0Aimport
@@ -263,16 +263,19 @@
quivo =
+io.
open(con
|
a592dcdf1126867588753c2503a469f8cebb492a | Write out constructors and interfaces. | generator.py | generator.py | from xml.dom import minidom
def GenerateDocs(namespace_map):
for namespace, symbols in namespace_map.iteritems():
filepath = '%s.html' % namespace
doc = _GenerateDocument(namespace, symbols)
content = doc.documentElement.toprettyxml(indent=' ')
yield filepath, content
def _MakeTextNode(content):
... | Python | 0 | @@ -22,16 +22,36 @@
inidom%0A%0A
+import symboltypes%0A%0A
def Gene
@@ -393,16 +393,349 @@
n text%0A%0A
+def _MakeHeader(content=None):%0A return _MakeElement('h2', content)%0A%0Adef _MakeElement(tagname, content=None):%0A element = minidom.Element(tagname)%0A%0A if content:%0A element.appendChild(_MakeTextNod... |
53ad3866b8dfbd012748e4ad7d7ed7025d491bd0 | REVERT remove application id validation | src/alexa-main.py | src/alexa-main.py | import handlers.events as events
APPLICATION_ID = "amzn1.ask.skill.dd677950-cade-4805-b1f1-ce2e3a3569f0"
def lambda_handler(event, context):
if event['session']['new']:
events.on_session_started({'requestId': event['request']['requestId']},
event['session'])
request... | Python | 0 | @@ -137,16 +137,203 @@
ntext):%0A
+ # Make sure only this Alexa skill can use this function%0A if event%5B'session'%5D%5B'application'%5D%5B'applicationId'%5D != APPLICATION_ID:%0A raise ValueError(%22Invalid Application ID%22)%0A%0A
if e
|
5ac96262abac1978cd0c3461a73d88874d5b5d4b | remove dead code. | bento/commands/hooks.py | bento/commands/hooks.py | import os
import sys
import re
from bento.compat \
import \
inspect as compat_inspect
from bento.commands.core \
import \
command
from bento.core.utils \
import \
extract_exception
SAFE_MODULE_NAME = re.compile("[^a-zA-Z_]")
class HookRegistry(object):
def __init__(self):
... | Python | 0 | @@ -96,64 +96,8 @@
ect%0A
-from bento.commands.core %5C%0A import %5C%0A command%0A
from
@@ -1695,89 +1695,8 @@
es:%0A
- yo = %5Bf for f in vars(module).values() if isinstance(f, PreHookWrapper)%5D%0A
@@ -3054,74 +3054,8 @@
d):%0A
- name = %22%25s_%25s%22 %25 (kind, command_name)%0A hel... |
e5de331c8575147c0cbc3be0b85b1d7f5e385b88 | update tag classification appearence | bumblebee.py | bumblebee.py | #!usr/bin/python3
"""
bumblebee.py - A sample static website generater writen in python for Johnny Law's blog
"""
import os
from io import open
import shutil
import yaml
import argparse
import sys
from distutils import dir_util
from jinja2 import FileSystemLoader, Environment
import mistune
from pygments import hig... | Python | 0.000004 | @@ -5412,30 +5412,19 @@
s_type='
-Classification
+Tag
: ' + ta
|
c1f826d5a807c50c49d56620934f83db9e514192 | Add (ugly) simplfiier for IterativeLoops | thinglang/parser/simplifier.py | thinglang/parser/simplifier.py | from thinglang.parser.symbols import Transient
from thinglang.parser.symbols.arithmetic import ArithmeticOperation
from thinglang.parser.symbols.base import AssignmentOperation
from thinglang.parser.symbols.functions import MethodCall
from thinglang.parser.symbols.types import CastOperation
from thinglang.utils.tree_ut... | Python | 0.00004 | @@ -1,28 +1,86 @@
+from thinglang.lexer.tokens.base import LexicalIdentifier%0A
from thinglang.parser.symbol
@@ -98,16 +98,16 @@
ansient%0A
-
from thi
@@ -285,16 +285,101 @@
thodCall
+, Access, ArgumentList%0Afrom thinglang.parser.symbols.logic import IterativeLoop, Loop
%0Afrom th
@@ -556,16 +556,16 @@
NABLE%0A%... |
d36f16e804180c402f32a7e0e29d822592254a68 | Integrate LLVM at llvm/llvm-project@54cc7de4bc01 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "077f90315bec29443784a1bb2c55f3d7fc2eab64"
LLVM_SHA256 = "b8204098753a27847e6084c95d7aa62083cc752ba29899b55058e38ea3f1c4f6"
tf_http_archive(
... | Python | 0.000001 | @@ -160,133 +160,133 @@
= %22
-077f90315bec29443784a1bb2c55f3d7fc2eab64%22%0A LLVM_SHA256 = %22b8204098753a27847e6084c95d7aa62083cc752ba29899b55058e38ea3f1c4f6
+54cc7de4bc01e6178213e4487d6ab49b809ba2b0%22%0A LLVM_SHA256 = %22a939c493893b2d27ea87d0d28efc79f33cdee4c56ac5954bc19ca2222a29af9d
%22%0A%0A
|
0b8eec703df52d94ca683cc962110c81951f5900 | Integrate LLVM at llvm/llvm-project@72f89556413f | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "e07a7040d9c6dbdd71e55d1153bfe1357079e511"
LLVM_SHA256 = "004147901d4725b45eaa724b2cb511989eb2d031146f876ba1b4327b5a5e053f"
tfrt_http_archive(
... | Python | 0.000001 | @@ -162,133 +162,133 @@
= %22
-e07a7040d9c6dbdd71e55d1153bfe1357079e511%22%0A LLVM_SHA256 = %22004147901d4725b45eaa724b2cb511989eb2d031146f876ba1b4327b5a5e053f
+72f89556413f9c1fb1fb9138d6d53e13499ce545%22%0A LLVM_SHA256 = %228b2a612f73a8dc54c76a2b40debc5b2464a55c91dac0f3b6c607009ba637311b
%22%0A%0A
|
77abacb3887c35712ac47dd7685cfa2ce33c3695 | Add domain to __init__ | vaporize/__init__.py | vaporize/__init__.py | __title__ = 'vaporize'
__author__ = 'Michael Lavers'
__version__ = '0.1.0'
__license__ = 'MIT'
__copyright__ = 'Copyright 2012 Michael Lavers'
from . import flavor, image, ipgroup, loadbalancer, server
from .core import connect
| Python | 0.000089 | @@ -151,16 +151,24 @@
. import
+ domain,
flavor,
|
5b58b88784771e1e8f39c21872fd109a09eec141 | Integrate LLVM at llvm/llvm-project@f116107f2d93 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "65644125beb76066171ce586e13bdff918140c0e"
LLVM_SHA256 = "3e3afa5504c3de889a56a1678d016300dc6c45611c28a199adb487d4fc50653f"
tf_http_archive(
... | Python | 0.000001 | @@ -160,133 +160,133 @@
= %22
-65644125beb76066171ce586e13bdff918140c0e%22%0A LLVM_SHA256 = %223e3afa5504c3de889a56a1678d016300dc6c45611c28a199adb487d4fc50653f
+f116107f2d9342dabf8f1ccecb3f33f9b85d9b48%22%0A LLVM_SHA256 = %220db5a61f8d1d0435d278fd19c7a0a47dc8170a99fa365993718d3912417b5940
%22%0A%0A
|
c4262eb68366c705aec08fdc0b20b54d58dcdb19 | Integrate LLVM at llvm/llvm-project@caea37b37e6a | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "91d3f73937b603b168a2be40f57a81efcc37da86"
LLVM_SHA256 = "500fe116e7bfc8c50d3ac873211b3700d479d710d9f2ac8171bfa903d085ba5c"
tfrt_http_archive(
... | Python | 0.000001 | @@ -162,133 +162,133 @@
= %22
-91d3f73937b603b168a2be40f57a81efcc37da86%22%0A LLVM_SHA256 = %22500fe116e7bfc8c50d3ac873211b3700d479d710d9f2ac8171bfa903d085ba5c
+caea37b37e6aa8b0c1bb21526ad2d216b46a4b10%22%0A LLVM_SHA256 = %2291c38b69bfb9cd03b7bbe967d7d75ab7c6a8d289378180b1f30948a8432ec39e
%22%0A%0A
|
1a28370b26c23d9d7c9399896ea5eba23bec029f | Integrate LLVM at llvm/llvm-project@4821508d4db7 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "6f258c0fd34cf4001ffa08c61f6e4e0f1254c50f"
LLVM_SHA256 = "9464c454c66b0c33f0e431fd24c5e35cd5db02c4983377b88d386cd0ad94130e"
tfrt_http_archive(
... | Python | 0.000001 | @@ -162,133 +162,133 @@
= %22
-6f258c0fd34cf4001ffa08c61f6e4e0f1254c50f%22%0A LLVM_SHA256 = %229464c454c66b0c33f0e431fd24c5e35cd5db02c4983377b88d386cd0ad94130e
+4821508d4db75a535d02b8938f81fac6de66cc26%22%0A LLVM_SHA256 = %224138bb3f83bfb822f3ce795cd7e3e7a7018709d8af4e7b54194cbd81931cc93c
%22%0A%0A
|
c9d54bd013f60f580942b0b93c94168ec772f49e | Integrate LLVM at llvm/llvm-project@892260d7f352 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "eda9fdc493e5f06c59f29f520255ada23901b3b4"
LLVM_SHA256 = "1db526f68751d8ad0258a7692d7c0ad997e1ed33262fb771f8c5fb1a5a25bb1b"
tf_http_archive(
... | Python | 0.000001 | @@ -160,133 +160,133 @@
= %22
-eda9fdc493e5f06c59f29f520255ada23901b3b4%22%0A LLVM_SHA256 = %221db526f68751d8ad0258a7692d7c0ad997e1ed33262fb771f8c5fb1a5a25bb1b
+892260d7f3526c429047b645f22401635a7df368%22%0A LLVM_SHA256 = %2220c04584b188e4f39e88e607453f62b76faf7430dd770e2a9bf6b56c6c0822b2
%22%0A%0A
|
b163018fa478e792b66da6e5de71f87ad24858b6 | Integrate LLVM at llvm/llvm-project@c6013f71a455 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "43d6991c2a4cc2ac374e68c029634f2b59ffdfdf"
LLVM_SHA256 = "6be97e134eab943941bbb06ad0c714070dc24cb4418a104813c1e9a2ca6655f7"
tf_http_archive(
... | Python | 0.000002 | @@ -160,133 +160,133 @@
= %22
-43d6991c2a4cc2ac374e68c029634f2b59ffdfdf%22%0A LLVM_SHA256 = %226be97e134eab943941bbb06ad0c714070dc24cb4418a104813c1e9a2ca6655f7
+c6013f71a4555f6d9ef9c60e6bc4376ad63f1c47%22%0A LLVM_SHA256 = %22644a1f9db6e55ba28fba1e03fe6c2d28514d47e1e02210b4b281868d7a7af70c
%22%0A%0A
|
2d602aaa83cac1fa3397ceefb39d36dd814d1165 | Integrate LLVM at llvm/llvm-project@93f54fae9dda | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "49cbf4cd85a9ae6b53947fb8cf39ccfb56becc57"
LLVM_SHA256 = "b48235a81cf29ad0e25f5029602eb2dfa092bd0c3a0e4ca785da595415fe29e2"
tfrt_http_archive(
... | Python | 0.000001 | @@ -162,133 +162,133 @@
= %22
-49cbf4cd85a9ae6b53947fb8cf39ccfb56becc57%22%0A LLVM_SHA256 = %22b48235a81cf29ad0e25f5029602eb2dfa092bd0c3a0e4ca785da595415fe29e2
+93f54fae9dda7d5d89711eb97f1ee44de6ce1ff7%22%0A LLVM_SHA256 = %2202e569a27548632ba083addbc9223bc5246e433c9eda72746c947dc17a5b0117
%22%0A%0A
|
d574bf6871219e7c1232d0f39a145878a23b8cd8 | Integrate LLVM at llvm/llvm-project@f79214d1e1fd | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "540a13652fda8b91b62b73fb9ae1e34879e8e36c"
LLVM_SHA256 = "928551015dbc884488d7cda367989bc65f6ec702233cd61148426854d34d7080"
tf_http_archive(
... | Python | 0.000001 | @@ -160,133 +160,133 @@
= %22
-540a13652fda8b91b62b73fb9ae1e34879e8e36c%22%0A LLVM_SHA256 = %22928551015dbc884488d7cda367989bc65f6ec702233cd61148426854d34d7080
+f79214d1e1fd79f684b53a8a1d34efeb37a33a28%22%0A LLVM_SHA256 = %225e36dc179188c453034b47c205704f645b874f33a81899fd4713b0f07b2a229d
%22%0A%0A
|
bcc7475b0028a7d07fd0c2398742f09f61377949 | Integrate LLVM at llvm/llvm-project@1f06398e96d4 | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "6edbdf80cac119f8f30d2ae6fa2972d9e778510b"
LLVM_SHA256 = "dd7ca82116dbfc1ddd7159425965318dfbe7a39e5f150a19880f7f40c6118001"
tfrt_http_archive(
... | Python | 0.000001 | @@ -162,133 +162,133 @@
= %22
-6edbdf80cac119f8f30d2ae6fa2972d9e778510b%22%0A LLVM_SHA256 = %22dd7ca82116dbfc1ddd7159425965318dfbe7a39e5f150a19880f7f40c6118001
+1f06398e96d4508d22f42b760f70eb5d4e7b1dc9%22%0A LLVM_SHA256 = %2284bd02a75966a1af45bf4556484817f9c4621a045686f7d1f32b034dc1c784c0
%22%0A%0A
|
5cd674ec764be72bb3e94c0b56fdf733a4a1c885 | Remove Audio Already Done error | Discord/utilities/errors.py | Discord/utilities/errors.py |
from discord.ext.commands.errors import CommandError
class NotServerOwner(CommandError):
'''Not Server Owner'''
pass
class VoiceNotConnected(CommandError):
'''Voice Not Connected'''
pass
class PermittedVoiceNotConnected(VoiceNotConnected):
'''Permitted, but Voice Not Connected'''
pass
class NotPermittedVoice... | Python | 0 | @@ -797,81 +797,4 @@
ss%0A%0A
-class AudioAlreadyDone(AudioError):%0A%09'''Audio Already Done playing'''%0A%09pass%0A%0A
|
af5e5959737c0556a317181464d13b9d6ffa1185 | Add extra logging for profraw file removal (#3149) | utils/profdata_merge/process.py | utils/profdata_merge/process.py | # utils/profdata_merge/process.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.o... | Python | 0 | @@ -535,16 +535,59 @@
port sys
+%0Aimport time%0Afrom datetime import timedelta
%0A%0Afrom m
@@ -2619,17 +2619,16 @@
vm_cmd)%0A
-%0A
@@ -2632,16 +2632,48 @@
try:%0A
+ start = time.time()%0A
@@ -2709,16 +2709,165 @@
=False)%0A
+ end = time.time()%0A self.repor... |
dd3a8bfa195f07e60d6c7c8c53d86d2a9405bf9d | Update test.py | EntityExtractor/src/test.py | EntityExtractor/src/test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created by Lalitha Madhuri Putchala on Dec 10 2017
"""
import unittest
from entity_main import Entity
from docx import Document
import docx2txt
class TestEntity(unittest.TestCase):
'''The below function verifies the basic sanity functionality of the pr... | Python | 0.000001 | @@ -999,14 +999,12 @@
est.main()%0D%0A
-%0D%0A
|
b6af2fc9e1669910f921d9ba95db64b3cac6f74d | remove vestigial old pollinate call (#517) | conjureup/controllers/newcloud/gui.py | conjureup/controllers/newcloud/gui.py | import json
import os
import os.path as path
from functools import partial
from subprocess import check_output
import petname
from conjureup import async, controllers, juju, utils
from conjureup.api.models import model_info
from conjureup.app_config import app
from conjureup.models.provider import Schema
from conjure... | Python | 0 | @@ -4994,54 +4994,8 @@
ue)%0A
- utils.pollinate(app.session_id, 'CA')%0A
|
c9bf706c0b7394b2bb5b9268d1c699aef97dfb14 | fix __openerp__.py | connector_base_product/__openerp__.py | connector_base_product/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publish... | Python | 0.000069 | @@ -115,53 +115,44 @@
or:
-Guewen Baconnier Copyright 2013 Camptocamp SA
+David BEAL, Copyright Akretion, 2014
%0A#%0A#
@@ -1100,23 +1100,17 @@
': '
-Generic Modules
+Connector
',%0A
@@ -1177,11 +1177,9 @@
====
-==
%0A
+
%0AAdd
@@ -1248,16 +1248,32 @@
ector',%0A
+ 'product',%0A
%5D,%0A 'da
@@ -1307,16 +... |
d58fedc3c5af011a82d8ad1944a16c235b8ced74 | Fix SQL syntax error in migrations | cnxarchive/sql/migrations/20160128110515_mimetype_on_files_table.py | cnxarchive/sql/migrations/20160128110515_mimetype_on_files_table.py | # -*- coding: utf-8 -*-
"""\
- Add a ``media_type`` column to the ``files`` table.
- Move the mimetype value from ``module_files`` to ``files``.
"""
from __future__ import print_function
import sys
def up(cursor):
# Add a ``media_type`` column to the ``files`` table.
cursor.execute("ALTER TABLE files ADD COL... | Python | 0.000001 | @@ -864,32 +864,33 @@
OF file ON files
+
%22%0A
@@ -899,32 +899,33 @@
%22FOR EACH ROW
+
%22%0A
@@ -1008,32 +1008,33 @@
pdate_files_sha1
+
%22%0A
@@ -1071,32 +1071,33 @@
OF file ON files
+
%22%0A
@@ -1106,32 +1106,33 @@
%22FOR EACH ROW
+
%22%0A... |
92d8f60188b6c9df57c1a250ce92efe8755c7c81 | replace slug display in admin with full slug | cms/admin.py | cms/admin.py | from django.contrib import admin
from models import Page
class PageAdmin(admin.ModelAdmin):
model = Page
list_display = ('headline', 'parent', 'slug', 'public')
admin.site.register(Page, PageAdmin)
| Python | 0.000001 | @@ -148,16 +148,25 @@
rent', '
+get_full_
slug', '
|
2627f38256c870ae45d2afc7566bfe86b04a0118 | Add detail.save_file() #11 | toggl2html/converter/detail.py | toggl2html/converter/detail.py | # -*- coding: utf-8 -*-
from jinja2 import Template
# 生成するHTMLのテンプレート
HTML_TEMPLATE = """\
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>詳細レポート: {{ start_date }} - {{ end_date }}</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/cs... | Python | 0.000001 | @@ -2962,24 +2962,270 @@
m,%0A %7D)%0A%0A%0A
+def save_file(file_path, data):%0A %22%22%22%0A %E6%96%87%E5%AD%97%E5%88%97%E3%82%92%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%99%E3%82%8B%E3%80%82%0A :param file_path: %E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%83%91%E3%82%B9%0A :typ... |
b3c0737cb3e27e335960be8d887d6ef56fcff288 | add adaptive threshold filter | sauce/face_capture.py | sauce/face_capture.py | from matplotlib import pyplot as plt
from cv2 import VideoCapture, cvtColor, COLOR_BGR2GRAY, COLOR_BGR2HSV, THRESH_BINARY, flip
from cv2 import threshold as thresh
from numpy import ceil
class plot(object):
"""plot camera feed with various filters"""
def __init__(self, fps=24, cmap="magma"):
"""get camera object... | Python | 0 | @@ -69,16 +69,69 @@
vtColor,
+ flip, adaptiveThreshold, ADAPTIVE_THRESH_GAUSSIAN_C,
COLOR_B
@@ -167,22 +167,16 @@
H_BINARY
-, flip
%0Afrom cv
@@ -726,16 +726,145 @@
R2GRAY)%0A
+%09%09if method == ADAPTIVE_THRESH_GAUSSIAN_C:%0A%09%09%09im = adaptiveThreshold(im, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY, 11, ... |
eaae5839cbbf2636e00c88a229a6a556ccf2be8c | Fix post provisioning. | saylua/provisioner.py | saylua/provisioner.py | from saylua import db
from saylua.models.role import Role
from saylua.utils import is_devserver
from saylua.modules.forums.models.db import Board, BoardCategory, ForumThread, ForumPost
from saylua.models.user import User, DisplayName
from saylua.modules.pets.soulnames import soulname
from saylua.modules.explore.dungeon... | Python | 0 | @@ -2229,16 +2229,17 @@
tually.%22
+,
%0A
@@ -2606,16 +2606,58 @@
%0A %5D%0A%0A
+ users = db.session.query(User).all()%0A%0A
for
@@ -2822,33 +2822,48 @@
author =
-1
+choice(users).id
%0A%0A yi
|
e2aa079c661d586ced614a21a0b39d773cc8a44d | Allow aggregation key to be specified generic loader | alerts/generic_alert_loader.py | alerts/generic_alert_loader.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
#
# Contributors:
# kang@mozilla.com
# TODO: Dont use qu... | Python | 0 | @@ -2274,18 +2274,30 @@
ted(
-'hostname'
+config.aggregation_key
, sa
@@ -3197,28 +3197,22 @@
'%5D%5B'
-likelihood_indicator
+alert_severity
'%5D%0A%0A
|
1f35c115d14147a7fca004de7874ebdb8700be61 | Python 2.6 does not support . in path expression | scalegrease/deploy.py | scalegrease/deploy.py | import logging
import os
from xml.etree import ElementTree
from scalegrease import error
from scalegrease import system
def mvn_download(artifact, tmp_dir, offline):
"""Download artifact from maven repository to local directory.
Maven will by default do local repository caching for us, which we want in orde... | Python | 0.999788 | @@ -2558,17 +2558,16 @@
indall(%22
-.
versioni
|
2838e70c20bb177b85ba0f6b96b80889e6c97de7 | Change form to form(s) in logging statement | corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py | corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from django.core.management.base import BaseCommand
from corehq.apps.users.models import CommCareUser
from corehq.form_processor.interfaces.dbaccessors import FormAccessors
from io import StringIO
from l... | Python | 0.000001 | @@ -1095,17 +1095,19 @@
%7B%7D form
-s
+(s)
for use
|
65c31d2b8d932e0584f93f8f897e7e5f9c6b24c5 | Fix conference submission | cfp/forms.py | cfp/forms.py | import markdown2
import requests
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.forms.widgets import Select
from cfp.models import Profile, Suggestion, token
def parse_handle(handle):
for r in ["http:... | Python | 0.000002 | @@ -2755,16 +2755,25 @@
reated',
+ 'state',
)%0A
|
058728a319db1101caecb2e5e7e6638414b372a7 | Add light lines for reading data values | code/plot.py | code/plot.py | import matplotlib.pyplot as plt
import numpy as np
import random
algos_names = ('SConES', 'MSConESnp', 'MSConES')
num_tasks = 4
colors = ['darkkhaki', 'royalblue', 'white']
def vertical_boxplots(data) :
fig, axes = plt.subplots(ncols=num_tasks, sharey=True)
fig.subplots_adjust(wspace=0)
fig.canvas.se... | Python | 0.000003 | @@ -167,24 +167,713 @@
'white'%5D%0A%0A%0A%0A
+%0A%0A%0Adef add_hlines(axe) : %0A # Add a horizontal grid to the plot, but make it very light in color%0A # so we can use it for reading data values but not be distracting%0A axe.yaxis.grid(True, linestyle='-', which='major', color='lightgrey',%0A ... |
b80eb1c96c7a275794d7953ff5257dfa596213e9 | change geoannotator logic to favor precision | annotator/geoname_annotator.py | annotator/geoname_annotator.py | #!/usr/bin/env python
"""Token Annotator"""
import re
from collections import defaultdict
import pymongo
from annotator import *
from ngram_annotator import NgramAnnotator
from geopy.distance import great_circle
def geoname_matches_original_ngram(geoname, original_ngrams):
if (geoname['name'] in original_ngrams... | Python | 0.000001 | @@ -2531,17 +2531,18 @@
%5D%5B0%5D %3E=
-5
+10
):%0A
@@ -2796,79 +2796,8 @@
xt%0A%0A
- len(resolved_locations_by_name), len(candidates_by_name))%0A%0A
@@ -4135,24 +4135,25 @@
on'%5D %3E 10000
+0
:%0A
@@ -4176,16 +4176,95 @@
re = 10%0A
+ elif candidate%5B'population'%5D %3E ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.