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 |
|---|---|---|---|---|---|---|---|
dd26c0cc4e253fa52fd834a5667f1c4cbb9266bf | Fix .ycm_extra_conf.py for tests subdir | libmue/.ycm_extra_conf.py | libmue/.ycm_extra_conf.py | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | Python | 0 | @@ -2449,16 +2449,68 @@
boost',%0A
+'-I%25s' %25 os.path.dirname(os.path.abspath(__file__))%0A
%5D%0A%0A# Set
|
d5c9240078ea4d4d914dc6df1bd89224954190c7 | Fix list_boxes returning box names not db names | libs/webbox/webbox_pg2.py | libs/webbox/webbox_pg2.py |
import logging, urllib2, uuid, rdflib, os, traceback, mimetypes, shutil, json
import psycopg2
from txpostgres import txpostgres
from twisted.internet.defer import Deferred
from time import strftime
## webbox to txpostgres bridge
POSTGRES_DB = "postgres" # default db fallback if db name is none
WBPREFIX = "wb_"
de... | Python | 0.999436 | @@ -948,16 +948,61 @@
= row%5B0%5D
+%5Blen(WBPREFIX):%5D # strip wb_ prefix from name
%0A
|
6b32ddf59db6b2bb1865d37e9e41c9b2308a7e69 | add version info | offset/__init__.py | offset/__init__.py | # -*- coding: utf-8 -
#
# This file is part of offset. See the NOTICE for more information.
# scheduler functions
from .core import go, run, gosched, maintask
# channel functions
from .core.chan import makechan, select, default
# exceptions
from .core.exc import PanicError
| Python | 0 | @@ -86,16 +86,97 @@
ation.%0A%0A
+version_info = (0, 1, 0)%0A__version__ = %22.%22.join(%5Bstr(v) for v in version_info%5D)%0A%0A
# schedu
|
6a2bbb047319c8bf1654988d99711a9c3bd88e06 | Fix print statement in commit abfc379b698f5fc9a4 forgot brackets! sigh! python3, took a bit to figure out that this was the culprit | workflows/common/python/model_runner.py | workflows/common/python/model_runner.py |
# MODEL RUNNER PY
# Currently only supports NT3_TC1 # Not true? -Justin 2018/02/28
# See __main__ section for usage
import sys
import json
import os
import numpy as np
import importlib
import runner_utils
import log_tools
import math
logger = None
print("MODEL RUNNER...")
sys.path.append(os.getenv("BENCHMARKS_ROOT... | Python | 0.000058 | @@ -466,24 +466,25 @@
:%0A print
+(
%22model_name%22
@@ -491,24 +491,25 @@
, model_name
+)
%0A if fram
@@ -722,16 +722,17 @@
print
+(
%22module_
@@ -750,16 +750,17 @@
ule_name
+)
%0A
|
ba704afe6d449a294679061fd966d1385db082f3 | allow user to select vm host | web3/apps/vms/forms.py | web3/apps/vms/forms.py | import uuid
import re
from django import forms
from django.core.cache import cache
from ..users.models import User
from ..sites.models import Site
from .models import VirtualMachine
from .helpers import call_api
from raven.contrib.django.raven_compat.models import client
class VirtualMachineForm(forms.ModelForm):
... | Python | 0 | @@ -176,16 +176,36 @@
lMachine
+, VirtualMachineHost
%0Afrom .h
@@ -833,16 +833,108 @@
=False))
+%0A host = forms.ModelChoiceField(required=True, queryset=VirtualMachineHost.objects.all())
%0A%0A de
@@ -3984,10 +3984,18 @@
, %22site%22
+, %22host%22
%5D%0A
|
02c329c9806ef24a4b2e633440ef79440a266419 | add ALT alleles for Watson and Crick | mapping_varcall/merge_watson_crick.py | mapping_varcall/merge_watson_crick.py | #!/usr/bin/env pypy
"""pypy only merge watson and crick calls to custom format"""
import argparse
import gzip
def parse_args():
"""Parse command line arguments"""
parser = argparse.ArgumentParser(description='Process input files')
parser.add_argument('-w', '--watson', type=str, default=None,
... | Python | 0.998675 | @@ -810,16 +810,63 @@
ne%5B3%5D%5D +
+ %5Bwatson_line%5B4%5D%5B:-3%5D%5D + %5Bcrick_line%5B4%5D%5B:-3%5D%5D +
%5B''%5D*le
@@ -1828,17 +1828,17 @@
e%5Bindex+
-3
+5
%5D += '%25s
|
a0e244e8f13a26aeb14db41b04dcedb4a9f6ace4 | Use argparse for arguments | monitor.py | monitor.py | #!/usr/bin/env python
import sys
from pathlib import Path
import time
from multiprocessing import Pool
from functools import partial
import transfer
def get_new_files(folder, init_filelist=None):
folder = Path(folder)
if init_filelist is None:
init_filelist = []
return [f for f in folder.glob('*... | Python | 0.000008 | @@ -126,16 +126,44 @@
partial
+%0Afrom textwrap import dedent
%0A%0Aimport
@@ -2378,50 +2378,76 @@
)%0A%0A%0A
-def help():%0A msg
+if __name__ == '__main__':%0A import argparse%0A descr
= %22%22%22
+%5C
%0A
-monitor.py%0A%0A
@@ -2518,16 +2518,20 @@
DF5%0A
+
+
if a met
@@ -2593,16 +25... |
dbc839a431d827e4f203c68b47b8d1f0821c697c | Revert "Temporarily enable the selection of the method and number of cores to use" | reproject/high_level.py | reproject/high_level.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from astropy.io.fits import PrimaryHDU, ImageHDU, Header
from astropy.wcs import WCS
__all__ = ['reproject']
ORDER = {}
ORDER... | Python | 0 | @@ -498,36 +498,8 @@
ear'
-,method='default',nproc=None
):%0A
@@ -3035,36 +3035,8 @@
rder
-, method=method, nproc=nproc
)%0A
@@ -3226,36 +3226,8 @@
_out
-, method=method, nproc=nproc
)%0A
|
197fbb2793ccba85a00711d39fcd3af4fe4bc66e | Correct precipitation probability | weather_pred/main.py | weather_pred/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-u
"""
Purpose : Get weather predition using https://developer.forecast.io/ and
the pip install python-forecastio python wrapper
Requirements
------------
* pip install python-forecastio
"""
import os
import forecastio
import datetime
import time
import RPi.GPIO as GPIO
... | Python | 0.000306 | @@ -2027,10 +2027,11 @@
%5D %3E
-7
0
+.7
:%0A
|
42e2b2f5faf085c03dcc0040266589b795b40b88 | Encrypt only if there are receipients | weecrypt.py | weecrypt.py | #!/usr/bin/env python2
import weechat
import subprocess
weechat.register("weecrypt", "shak-mar", "0.1", "None",
"asymmetric encryption for weechat using gpg", "", "")
# Only the traffic on whitelisted channels will be en- and decrypted
channel_whitelist = ["#yourchannel"]
buffers = {}
# GPG Identif... | Python | 0.000008 | @@ -1394,16 +1394,89 @@
ick%5D%5D)%0A%0A
+ # Only encrypt if there are receipients%0A if len(command) %3E 3:%0A
# Ru
@@ -1512,16 +1512,20 @@
output%0A
+
p =
@@ -1550,16 +1550,20 @@
ommand,%0A
+
@@ -1622,24 +1622,28 @@
ocess.PIPE)%0A
+
encoded,
@@ -1679,24 +1679,28 @@... |
242acb878fbfad2b70f9c64b360bdc8db7a9e340 | Clean up setup/teardown | tests/test_dependency_node.py | tests/test_dependency_node.py | from scripts import dependency_node
from tempfile import mkdtemp
import shutil
import os
import glob
class TestDependencyNode:
def setup(self):
self.node = dependency_node.DependencyNode('org.joda', 'joda-money', '0.11', '1')
os.chdir(os.path.abspath('./tests'))
def teardown(self):
os.... | Python | 0.000001 | @@ -134,16 +134,22 @@
ef setup
+_class
(self):%0A
@@ -282,16 +282,66 @@
tests'))
+%0A self.tempDirectoryPath = mkdtemp(dir=%22.%22)
%0A%0A de
@@ -350,16 +350,22 @@
teardown
+_class
(self):%0A
@@ -391,16 +391,62 @@
.pardir)
+%0A shutil.rmtree(self.tempDirectoryPath)
%0A%0A de
@@ -716,58 +716,... |
a6dc0197c3fecc78ea8a6466495ea807a2c4bfa0 | Use only participant name (close #1) | meals/views.py | meals/views.py | from django.shortcuts import render, redirect
from meals.models import Meal, Wbw_list, Participant, Participation, Bystander
from meals.forms import MealForm, WbwListsForm, ParticipationForm, BystanderForm
from django.conf import settings
from django.contrib import messages
from django.utils.timezone import localtime
f... | Python | 0 | @@ -5809,16 +5809,21 @@
'%5D%5B7:%5D,
+next(
tr.td.sp
@@ -5825,20 +5825,25 @@
td.span.
-text
+children)
) for tr
|
21bd1ce0e0c0d7596272de7ad09b43480c3dfe1a | Allow specifying variables in the output yaml file the merged sha and the merged repo | tubular/scripts/merge_approved_prs.py | tubular/scripts/merge_approved_prs.py | #! /usr/bin/env python3
"""
Command-line script to trigger a jenkins job
"""
import logging
import sys
import click
import click_log
import yaml
from tubular import github_api # pylint: disable=wrong-import-position
def find_approved_prs(target_repo, source_repo, target_base_branch, source_base_branch):
"""
... | Python | 0 | @@ -2432,24 +2432,442 @@
ository%22,%0A)%0A
+@click.option(%0A u'--repo-variable',%0A help=u%22The name of the variable to add to the results yaml file. This variable will %22%0A u%22contain the url of the repository which has the --sha-variable in it.%22%0A)%0A@click.option(%0A u'--sha-variable',%0A ... |
39752d715a996d5b0c72ed6eafe79299480d9a1e | Raise NameError on double-registration | roushagent/modules/output_manager.py | roushagent/modules/output_manager.py | #!/usr/bin/env python
import os
import logging
LOG = logging.getLogger('output')
# output modules recieve an input action, and return an output
# result. Generally they take the form of actions to perform.
#
# output plugins *must* export a "name" value. In addition,
# they *must* export a "setup" function, which ... | Python | 0 | @@ -3554,16 +3554,136 @@
config)%0A
+ except NameError as e:%0A LOG.warning(%22Failed to run setup on %25s: %25s%22 %25(shortpath, e))%0A
|
b6b023d521fdc47174e56ca53290711944e216eb | Rename stage method/class/obj to match with previous example. | motion3.py | motion3.py | """Multiple process image processing using mid-stage result."""
import datetime
import sys
import cv2
import numpy as np
import mpipe
import util
import iproc
DEVICE = int(sys.argv[1])
WIDTH = int(sys.argv[2])
HEIGHT = int(sys.argv[3])
DURATION = float(sys.argv[4]) # In seconds.
# Create the OpenCV video ca... | Python | 0 | @@ -5,20 +5,16 @@
ulti
-ple
process
imag
@@ -13,24 +13,24 @@
ess
-image processing
+motion detection
usi
@@ -1997,25 +1997,24 @@
,%0A )%0A
-%0A
return i
@@ -2024,24 +2024,20 @@
e%0A%0Adef s
-howImage
+tep4
(image):
@@ -2164,33 +2164,12 @@
tage
-s
+1
=
-list()%0Astages.append(
mpip
@@ -2189,... |
c0a8378f25c7ce29a1d64dccf50a5358984a3766 | add limit to tumbleposts | tumbledore/templatetags/tumbledore.py | tumbledore/templatetags/tumbledore.py | from django import template
from django.utils.safestring import mark_safe
from django.template.base import FilterExpression
from django.template.defaulttags import ForNode
models = __import__('tumbledore', None, None, [], 2).models
register = template.Library()
DEFAULT_NUMBER_OF_POSTS = 5
@register.tag(name='tumble... | Python | 0 | @@ -989,20 +989,16 @@
o_tumble
-log_
posts(pa
@@ -2063,24 +2063,115 @@
'order_by'%5D%0A
+ if 'limit' in kwargs:%0A limit = int(kwargs%5B'limit'%5D)%0A del kwargs%5B'limit'%5D%0A
object_l
@@ -2291,16 +2291,72 @@
rder_by)
+%0A if limit:%0A object_list = object_list%5B:limit%5D
%0A%0A ... |
a0c0fded5831cc082461e2c3729036272eecd785 | Tweak random sampling factor. | mail.py | mail.py | import imaplib
import logging
import random
import cache
import messageinfo
import stringscanner
MAILBOX_GMAIL_ALL_MAIL = "[Gmail]/All Mail"
MAILBOX_GMAIL_PREFIX = "[Gmail]"
class Mail(object):
def __init__(self, server, use_ssl, username, password,
record=False, replay=False, max_messages=-1, random_subset... | Python | 0 | @@ -2922,17 +2922,17 @@
fetch *
-4
+3
0%0A
|
5415c3b9c142177554bc38fc02d3a2dcc4129f03 | Fix formatting of test server address | tests/fakeaur/server.py | tests/fakeaur/server.py | #!/usr/bin/env python
import gzip
import http.server
import io
import json
import os.path
import sys
import tarfile
import tempfile
import urllib.parse
DBROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'db')
AUR_SERVER_VERSION = 5
class FakeAurHandler(http.server.BaseHTTPRequestHandler):
def ... | Python | 0.000074 | @@ -4192,12 +4192,10 @@
p://
-%5B
%7B%7D
-%5D
:%7B%7D'
@@ -4314,20 +4314,11 @@
g on
- %7B%7D'.format(
+',
endp
@@ -4322,17 +4322,16 @@
ndpoint)
-)
%0A%0A tr
|
7f89483fdf54d32daa2d75ebefdb5dadcb17493c | test fixes | tests/test_primer_designer.py | tests/test_primer_designer.py | from FluGibson.primer_designer import PrimerDesigner
import os
from Bio.SeqRecord import SeqRecord
import pytest
# Get the directory of this test file.
package_directory = os.path.dirname(os.path.abspath(__file__))
os.chdir(os.path.join(package_directory, 'test_data'))
p = PrimerDesigner()
p.read_sequences('victoria... | Python | 0.000001 | @@ -1025,32 +1025,83 @@
if i %3E= 1:%0A
+ sequence = p.node%5Bn%5D%5B'object'%5D.seq%0A
@@ -1126,21 +1126,24 @@
in str(
-n.
seq
+uence
)%0A
@@ -1161,32 +1161,34 @@
%0A
+ #
assert str(prim
@@ -1224,16 +1224,156 @@
0%5D.seq)%0A
+ predecess... |
51973c1fbd7c1c5480d783a0f03bd269882f7bba | Add identify command. | twisted/plugins/automatron_control.py | twisted/plugins/automatron_control.py | from twisted.internet import defer
from zope.interface import classProvides, implements
from automatron.command import IAutomatronCommandHandler
from automatron.plugin import IAutomatronPluginFactory, STOP
class AutomatronControlPlugin(object):
classProvides(IAutomatronPluginFactory)
implements(IAutomatronCom... | Python | 0 | @@ -687,24 +687,70 @@
2, 'say'),%0A
+ 'identify': ('%5Bchannel%5D', 0, 1, None)%0A
%7D%0A%0A d
@@ -2226,8 +2226,1126 @@
essage)%0A
+%0A @defer.inlineCallbacks%0A def _on_command_identify(self, client, user, channel=None):%0A nickname = client.parse_user(user)%5B0%5D%0A username, us... |
3dec4c83ba34c7ab34c00ffa44bbfd2aac707975 | PEP PEP PEP | opps/core/middleware.py | opps/core/middleware.py | # -*- coding: utf-8 -*-
import re
from django.contrib.sites.models import Site
from django.contrib.sites.models import get_current_site
from django.conf import settings
from opps.channels.models import Channel
class URLMiddleware(object):
def process_request(self, request):
"""
if the requested ... | Python | 0.999839 | @@ -499,16 +499,60 @@
id %3E 1:%0A
+ prefix = %22_%7B0%7D%22.format(site.id)%0A
@@ -602,38 +602,22 @@
LCONF +
-%22_%7B0%7D%22.format(site.id)
+prefix
%0A%0A%0Aclass
|
391a09d5ac1517a33cb1a25993638f3e4ea62ad9 | update reg state unit tests | tests/unit/states/reg_test.py | tests/unit/states/reg_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch
)
fro... | Python | 0 | @@ -2898,16 +2898,41 @@
version'
+%0A vdata = '0.15.3'
%0A%0A
@@ -3089,32 +3089,37 @@
mock_read
+_true
= MagicMock(sid
@@ -3119,228 +3119,141 @@
ock(
-side_effect=%5B%7B'success': False%7D,%0A %7B'success': False%7D,%0A ... |
34899c3d105c51d01a5452c885830264d5c22e16 | Add test coverage for utils.http (#2370) | tests/unit/utils/test_http.py | tests/unit/utils/test_http.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | Python | 0 | @@ -2787,8 +2787,224 @@
mes=%5B%5D)%0A
+%0A def test_scheme_not_required(self):%0A assert is_valid_uri(%22//example.com%22, require_scheme=False)%0A%0A def test_authority_not_required(self):%0A assert is_valid_uri(%22http://%22, require_authority=False)%0A
|
ce79eab03262eb8de3e0e44dc2a67f0a56aac2d6 | Use harfbuzz msvc freetype. | win/sdl2.py | win/sdl2.py | from __future__ import absolute_import, print_function
from os import walk
from .common import *
__version__ = '0.4.2'
sdl2_ver = '2.0.14'
sdl2_mixer_ver = '2.0.4'
sdl2_ttf_ver = '2.0.15'
sdl2_image_ver = '2.0.5'
def get_sdl2(cache, build_path, arch, package, output, download_only=False):
data = []
paths =... | Python | 0 | @@ -110,17 +110,17 @@
= '0.4.
-2
+3
'%0A%0Asdl2_
|
33ebf6441153b53d39b26cda7c096401b10e70c3 | Fix test | tests/unit/viz/test_source.py | tests/unit/viz/test_source.py | import pytest
import numpy as np
import pandas as pd
import geopandas as gpd
from cartoframes.auth import Credentials
from cartoframes.viz.source import Source
from cartoframes.io.managers.context_manager import ContextManager
POINT = {
"type": "Feature",
"geometry": {
"type": "Point",
"coordi... | Python | 0.000004 | @@ -1684,20 +1684,18 @@
nates%22:
-None
+%5B%5D
%0A %7D,%0A
|
e45971c740b8b723901b9c56bb56cb84f581834c | fix import. Dbref isn't in pymongo package anymore | mongokit/__init__.py | mongokit/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2010, Nicolas Clairon
# 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 abov... | Python | 0 | @@ -1648,23 +1648,20 @@
%22%0A%0Afrom
-pymongo
+bson
.dbref i
|
e87d68fb0f7094c38dc931c9062f13015a725980 | normalize the PK values | localtv/search_indexes.py | localtv/search_indexes.py | from haystack import indexes
from haystack import site
from localtv.models import Video, VIDEO_STATUS_ACTIVE
class VideoIndex(indexes.SearchIndex):
text = indexes.CharField(document=True, use_template=True)
feed = indexes.IntegerField(model_attr='feed__pk', null=True)
search = indexes.IntegerField(model_a... | Python | 0.000001 | @@ -861,16 +861,31 @@
ttr='pk'
+, normalize=int
):%0A
@@ -895,16 +895,26 @@
return %5B
+normalize(
getattr(
@@ -923,16 +923,33 @@
l, attr)
+)%0A
for rel
@@ -1073,16 +1073,25 @@
, 'name'
+, unicode
)%0A%0A d
|
f79d0dda2f78566b6f04f4f221aba9f61c551d45 | set secureHost = siteHost if secureHost is None (fix bug 600) | mint/config.py | mint/config.py | #
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
import sys
import mint
from conary import conarycfg
from conary.conarycfg import ConfigFile
from conary.conarycfg import CfgString, CfgDict, CfgBool
from urlparse import urlsplit
templatePath = os.path.dirname(sys.modules['mint'].__file__)
... | Python | 0.000002 | @@ -4185,19 +4185,26 @@
ot self.
-SSL
+secureHost
:%0A
|
1580b8dcc4413b43ff6263d3ac4581196b887f27 | Add custom action to re-send confirmation emails | ticketshop/ticketapp/admin.py | ticketshop/ticketapp/admin.py | from django.contrib import admin
from .models import TicketPurchase, Ticket, TicketType, Coupon
# ~~~ Ticket purchase ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class TicketInline(admin.TabularInline):
"""
This is used to displayed the purchased ticket inline in the
page showing the details o... | Python | 0 | @@ -26,16 +26,53 @@
t admin%0A
+from django.contrib import messages%0A%0A
from .mo
@@ -125,16 +125,59 @@
, Coupon
+%0Afrom .mails import send_confirmation_email
%0A%0A# ~~~
@@ -798,16 +798,580 @@
paid%22%0A%0A
+%0Adef resend_confirmation(modeladmin, request, queryset):%0A %22%22%22%0A Custom admin action t... |
42d965e3c021c65c24fbe0ff6972bd678d851a28 | Remove duplicate datetime clause from OPALSerializer | opal/core/views.py | opal/core/views.py | """
Re-usable view components
"""
import functools
import json
import datetime
from django.utils.dateformat import format
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.core.serializers.json import DjangoJS... | Python | 0.000005 | @@ -980,235 +980,8 @@
)%0A
- elif isinstance(o, datetime.datetime):%0A return format(%0A datetime.datetime.combine(%0A o, datetime.datetime.min.time()%0A ), settings.DATETIME_FORMAT%0A )%0A
|
076f8c7d4cb39f386675469333cc17933960dfbb | fix bug when modifying an act. | calebasse/actes/views.py | calebasse/actes/views.py | # -*- coding: utf-8 -*-
import datetime
from django.http import HttpResponseRedirect, HttpResponse
from django.db.models import Q
from django.views.generic.edit import ModelFormMixin
from django.shortcuts import redirect
from calebasse.cbv import ListView, UpdateView, FormView, DeleteView
from calebasse.agenda.views... | Python | 0 | @@ -4229,16 +4229,28 @@
type =
+self.object.
act_type
@@ -4274,16 +4274,22 @@
.object.
+event.
save()%0A
|
4ad56b8b0f4a54a99dfe99ef5c24baf79c7031f8 | remove process forking for now | openrunlog/main.py | openrunlog/main.py |
import env
import futures
import sys
import mongoengine
import os
import setproctitle
from tornado import web, ioloop, process
from tornado.options import define, options, parse_command_line
import tornadoredis
import tornadotinyfeedback
import home
import login
import dashboard
import data
import racelog
import runs... | Python | 0 | @@ -2455,137 +2455,8 @@
=3)%0A
-application.tf = tornadotinyfeedback.Client('openrunlog')%0Aapplication.redis = tornadoredis.Client()%0A%0Aapplication.redis.connect()%0A
%0A%0Aif
@@ -2712,145 +2712,201 @@
-if not config%5B'debug'%5D:%0A process.fork_processes(process.cpu_count()*2 + 1)%0A application.... |
273c6de3fc48b0c3e5829343d8a349c98c1ea9c9 | Call out new members without 2FA | missing_2fa.py | missing_2fa.py | #!/usr/bin/env python
"""
Check for admins or any member without 2FA enabled.
List contact information if available for members out of compliance.
"""
import argparse
import logging
from client import get_github3_client
BAD_TEAM = '2fa_disabled'
logger = logging.getLogger(__name__)
def get_user_email(gh, us... | Python | 0 | @@ -1338,16 +1338,61 @@
to_add:%0A
+ print(%22 %7B%7D is new%22.format(login))%0A
|
98973cd1599c5b0c286a235b41223015316532d1 | Remove JSON from comments after transformation | tag_recognition.py | tag_recognition.py | import argparse
import sys
import json
import os
import copy
from pptx import Presentation
from PIL import Image, ImageChops
import regex
TEMP_LOGO_FILE = "temp_logo.png"
def uniq(items):
return list(set(items))
def is_json(text):
try:
json.loads(text)
except ValueError:
return False
... | Python | 0 | @@ -1072,24 +1072,223 @@
all_tags)%0A%0A%0A
+def remove_json_from_comment(text):%0A json_list = find_json_in_string(text)%0A if json_list:%0A for json_block in json_list:%0A text = text.replace(json_block, %22%22)%0A return text%0A%0A%0A
def trim(ima
@@ -4596,16 +4596,88 @@
, slide)
+%0A ... |
d8e3c6b02d7fca6f3a1851fe6ae13428dac97e31 | use READ COMMITTED isolation level | opmuse/database.py | opmuse/database.py | import cherrypy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
Base = declarative_base()
def get_session():
url = cherrypy.config['opmuse']['database.url']
return sessionmaker(bind=create_engine(url))()
clas... | Python | 0 | @@ -727,16 +727,86 @@
cho=echo
+,%0A isolation_level=%22READ COMMITTED%22
)%0A
|
8818b06f222e7f6cee09370741978ebfc8e98600 | Fix missing tornado import | salt/netapi/rest_tornado/__init__.py | salt/netapi/rest_tornado/__init__.py | # encoding: utf-8
# Import python libs
from __future__ import absolute_import, print_function
import hashlib
import logging
import os
# Import salt libs
import salt.auth
from salt.utils.versions import StrictVersion as _StrictVersion
__virtualname__ = os.path.abspath(__file__).rsplit('/')[-2] or 'rest_tornado'
logg... | Python | 0.014547 | @@ -3922,24 +3922,54 @@
= ssl_opts%0A%0A
+ import tornado.httpserver%0A
http_ser
|
f2241e27a77f7bdae908a4a5db2766389850fdf9 | bump to 0.12.1 | orator/__init__.py | orator/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.12.0'
from .orm import Model, SoftDeletes, Collection, accessor, mutator, scope # noqa
from .database_manager import DatabaseManager # noqa
from .query.expression import QueryExpression # noqa
from .schema import Schema # noqa
from .pagination import Paginator, LengthAwarePagi... | Python | 0.000011 | @@ -38,17 +38,17 @@
= '0.12.
-0
+1
'%0A%0Afrom
|
c72f02deb0d78f87330c799933d8bc49151dd2cb | Remove some unneeded test setup code. | tests/reporter_tests.py | tests/reporter_tests.py | from mock import Mock, patch
from concurrent import futures
from tests import cases
from lighthouse.service import Service
from lighthouse.discovery import Discovery
from lighthouse.reporter import Reporter
class ReporterTests(cases.WatcherTestCase):
def setUp(self):
super(ReporterTests, self).setUp()
... | Python | 0 | @@ -25,39 +25,8 @@
atch
-%0Afrom concurrent import futures
%0A%0Afr
@@ -222,624 +222,8 @@
):%0A%0A
- def setUp(self):%0A super(ReporterTests, self).setUp()%0A%0A futures_patcher = patch(%22lighthouse.configs.watcher.futures%22)%0A mock_futures = futures_patcher.start()%0A%0A self.addCl... |
8376dd781118681bfa30f6cdf1e6d7906d5c3abb | change invocation to drop users_list | tests/test_announcer.py | tests/test_announcer.py | import os
import time
import unittest
import mock
import announcer
from tests.test_destalinator import MockValidator
import tests.fixtures as fixtures
import tests.mocks as mocks
class AnnouncerAnnounceTest(unittest.TestCase):
def setUp(self):
slacker_obj = mocks.mocked_slacker_object(channels_list=fixtu... | Python | 0 | @@ -329,35 +329,8 @@
nels
-, users_list=fixtures.users
)%0A
|
9cce5e4f913cdbfafc0b5c79ae52f76e3148317f | Exclude events with no rating from top ranking | web/tracker/views.py | web/tracker/views.py | from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.views.generic import (CreateView, DetailView, ListView,
TemplateView, UpdateView)
import datetime as dt
import json
from . import models, forms
from ... | Python | 0.000003 | @@ -5148,20 +5148,35 @@
.events.
-all(
+exclude(rating=None
).annota
|
0f68dc6b7b35aa22e08517a80cf5f4b672f88eca | Add tests for version upgrade | tests/test_bootstrap.py | tests/test_bootstrap.py | """
tests.test_bootstrap
~~~~~~~~~~~~~~~~~~~~
Tests bootstrap.
"""
# pylint: disable=too-many-public-methods,protected-access
import tempfile
import unittest
from unittest import mock
from homeassistant import bootstrap
import homeassistant.util.dt as dt_util
from tests.common import mock_detect_location_info
clas... | Python | 0 | @@ -120,16 +120,26 @@
-access%0A
+import os%0A
import t
@@ -146,16 +146,16 @@
empfile%0A
-
import u
@@ -214,16 +214,22 @@
t import
+ core,
bootstr
@@ -231,16 +231,60 @@
otstrap%0A
+from homeassistant.const import __version__%0A
import h
@@ -1159,16 +1159,16 @@
nents),%0A
-
@@ -1220,8 +1220,1396 @@
... |
cc6b3185fb2e0c92b5886cd7d53ee2cd903554c4 | add a construct test case | tests/test_construct.py | tests/test_construct.py | import unittest
import construct as Con
from construct import ConstructError, FormatFieldError
from distance.bytes import DstBytes, Magic, Section
from distance.construct import C, BaseConstructFragment, ExposeConstructFields
from tests.common import write_read, check_exceptions
test_section = Section(Magic[2], 0x1... | Python | 0.000738 | @@ -1812,16 +1812,310 @@
s(res)%0A%0A
+ def test_write_read_changed(self):%0A frag = TestFragment(self.dbytes)%0A frag.first_string = %22new string%22%0A res, rdb = write_read(frag)%0A self.assertEqual(frag.first_string, %22new string%22)%0A self.assertEqual(frag.second_uint, 64)%... |
932edca06dd726d227db6c092b7f733f94d63f60 | Add correct datastore CSV download The URL for the production datastore is added following a fix made in https://github.com/IATI/IATI-Datastore/commit/30177c556ccacdc5fe6a2967b272ecef8aa9dee1 | tests/test_datastore.py | tests/test_datastore.py | import pytest
from web_test_base import *
class TestIATIDatastore(WebTestBase):
requests_to_load = {
'Datastore Homepage': {
'url': 'http://datastore.iatistandard.org/'
},
'Datastore download: csv': {
'url': 'http://dev.datastore.iatistandard.org/api/1/access/activit... | Python | 0.000112 | @@ -266,12 +266,8 @@
p://
-dev.
data
|
cd4a2718f96ee539f4315966442203809d5a244d | Remove print statements from tests | tests/test_graph_api.py | tests/test_graph_api.py | """Tests for facepy.GraphAPI."""
import json
import random
from facepy import GraphAPI
import requests
# Permanent access token for a test user of the Facepy Test Application (application id 160327664029652)
TEST_ACCESS_TOKEN = '160327664029652|71c2bc094b012a6f7f37ece4.0-100002387854815|gmGJg6Sc2nBzssDrCXL_w49bDO8'
... | Python | 0.000004 | @@ -1064,50 +1064,8 @@
ict)
-%0A print %22test_signed_request() passed.%22
%0A%0Ade
@@ -1114,29 +1114,25 @@
CESS_TOKEN)%0A
-
%0A
+
assert i
@@ -1220,40 +1220,8 @@
tr)%0A
- print %22test_get() passed.%22%0A%0A
%0Adef
@@ -1234,21 +1234,17 @@
post():%0A
-
%0A
+
grap
@@ -1267,37 +1267,33 @@
... |
f4cb1181909f9279a51cbf1be363e676d3397b40 | simplify isinstance check to oneline | modules/rpm.py | modules/rpm.py | # Copyright 2015 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to ... | Python | 0.000003 | @@ -1386,32 +1386,33 @@
tance(compiler,
+(
compilers.GnuCCo
@@ -1421,54 +1421,8 @@
iler
-) or %5C%0A isinstance(compiler
, co
@@ -1436,32 +1436,33 @@
.GnuCPPCompiler)
+)
:%0A
|
75f236f8fd0ba368197da3070002b60233a01d49 | Test routines to the BED writer added | tests/test_track_bed.py | tests/test_track_bed.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 by Gaik Tamazian
# gaik (dot) tamazian (at) gmail (dot) com
import os
import logging
import unittest
from chromosomer.track.bed import BedRecord
from chromosomer.track.bed import Reader
path = os.path.dirname(__file__)
os.chdir(path)
class TestBedR... | Python | 0 | @@ -248,17 +248,84 @@
Reader%0A
+from chromosomer.track.bed import Writer%0Afrom itertools import izip
%0A
-
path = o
@@ -929,119 +929,949 @@
d)%0A%0A
-suite = unittest.TestLoader().loadTestsFromTestCase(TestBedReader)%0Aunittest.TextTestRunner(verbosity=2).run(suite
+%0Aclass TestBedWriter(unittest.TestCase):%0A ... |
69f45f0f490d854335eed03198754fbb65fc9110 | Improve importation form wording | td_biblio/forms.py | td_biblio/forms.py | from operator import methodcaller
from django import forms
from django.core.validators import RegexValidator
from django.utils.translation import ugettext_lazy as _
DOI_REGEX = '(10[.][0-9]{4,}(?:[.][0-9]+)*/(?:(?!["&\'<>])\S)+)'
doi_validator = RegexValidator(
DOI_REGEX,
_("One (or more) DOI is not valid"),... | Python | 0.000073 | @@ -852,25 +852,11 @@
_(%22P
-ubMed identifiers
+MID
%22),%0A
@@ -999,34 +999,98 @@
help_text=_(
-%22C
+%0A %22Paste a list of PubMed Identifiers %22%0A %22(c
omma separated o
@@ -1095,33 +1095,43 @@
or one per line
-%22
+)%22%0A
),%0A requi
@@ -1198,40 +1198,10 @@
_(%22... |
d5705f0e1d4dfba570f312248402456c86eebee9 | Remove test objects from tfx api docs. | tfx/tools/build_docs.py | tfx/tools/build_docs.py | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0 | @@ -2056,16 +2056,670 @@
FLAGS%0A%0A%0A
+def ignore_test_objects(path, parent, children):%0A %22%22%22Removes all %22test%22 modules. These are not part of the public api.%0A%0A Arguments:%0A path: A tuple of name parts forming the attribute-lookup path to this%0A object. For %60tf.keras.layers.Dense%60 path... |
59d962be9b12897906c32d7035115bec17243d90 | Fix for multiple monitors | main.py | main.py | #!/usr/bin/python
#-*- coding: utf-8 -*-
import locale
import os
import re
import sys
import urllib
import urllib2
from bs4 import BeautifulSoup
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Notify', '0.7')
from gi.repository import Gio
from gi.repository import Gtk
from gi.repository import Notify
... | Python | 0 | @@ -2073,66 +2073,377 @@
-return r'%25sx%25s' %25 (screen.get_width(), screen.get_height()
+monitors = %5B%5D%0A nmons = screen.get_n_monitors()%0A if nmons == 1:%0A %09return r'%25sx%25s' %25 (screen.get_width(), screen.get_height())%0A else:%0A %09maxw = 0%0A %09maxh = 0%0A %09for m in rang... |
088a248a2276e46bcf58abc0873913680724534e | make the server visible to the internet | main.py | main.py | from flask import Flask
app = Flask(__name__)
@app.route('/')
def main():
return 'ok'
if __name__ == '__main__':
app.run()
| Python | 0.000001 | @@ -124,10 +124,45 @@
app.
-run(
+debug = True%0A app.run(host='0.0.0.0'
)%0A
|
7e116e3279b03e7e1b8dadb0a6f73873572660f4 | add download flag | main.py | main.py | import os
import json
import boto3
import click
import logging
from copy import copy
from collections import OrderedDict
from datetime import date, timedelta
from elasticsearch import Elasticsearch, RequestError
from reader import csv_reader
logger = logging.getLogger('landsat8.meta')
bucket_name = os.getenv('BUCKETN... | Python | 0 | @@ -5220,16 +5220,301 @@
disk')%0A
+@click.option('--download', is_flag=True,%0A help='Sets the updater to download the metadata file first instead of streaming it')%0A@click.option('--download-folder', default=None,%0A help='The folder to save the downloaded metadata to. Defaults to a temp ... |
70501501fe5208199837bde7902521523f2168c5 | Add more checks in Link View | main.py | main.py | #!bin/python
#Imports
from flask import *
from random import randint
import os
#Globals
app = Flask(__name__)
TITLE = "ShorTor"
LINK_ID_LENGTH = 8
LINK_ID_CHARSET = "abcdefghijklmnopqrstuvwxyz1234567890"
VERSION = "0.2.1"
#Router
@app.route('/')
def index():
return render_template("index.html", title=TITLE, version... | Python | 0 | @@ -2266,16 +2266,97 @@
D%22, 400%0A
+%09if(not isInCSet(privkey, LINK_ID_CHARSET)):%0A%09%09return %22Invalid Private Key%22, 400%0A
%09return
|
3a6b65125ddaaf97348d41082a70505ce99d8edc | Add route for setting max cache age to 0 | main.py | main.py | from flask import Flask, render_template
from os import listdir
from os.path import isfile, join
import twitter as tw
import image_overlay as ilay
import band_name as bn
app = Flask(__name__)
app.debug = True
names_made=0
page_info = {}
page_info['business_name'] = u"Band Name Generator"
page_info['desciption'] = u"G... | Python | 0.000001 | @@ -1543,16 +1543,347 @@
_info)%0A%0A
+@app.after_request%0Adef add_header(response):%0A %22%22%22%0A Add headers to both force latest IE rendering engine or Chrome Frame,%0A and also to cache the rendered page for 10 minutes.%0A %22%22%22%0A response.headers%5B'X-UA-Compatible'%5D = 'IE=Edge,chrome=1'%... |
59ba6a03afbcb91dbca1f639febaf7eee3283109 | Add minor updates. | main.py | main.py | #!/usr/bin/python3
from time import time
import pandas as pd
from scipy.stats import kendalltau
from algorithms.EM import em
from algorithms.PageRank import page_rank
from algorithms.borda_ordering import borda_ordering
from algorithms.random_circle_removal import random_circle_removal
from utils.gradings import get... | Python | 0 | @@ -639,29 +639,36 @@
('n,
-
k,
-
rep
-, algo,
+etition,algorithm,
time,
-
dist
@@ -672,17 +672,16 @@
istance,
-
ranking%5C
|
32e35c6b41b751e84fef6093da00da498876ae91 | Add Parse features | main.py | main.py | import requests
import yaml
import re
config = yaml.load(open("./config.yml"))
def get_cookies():
rx_lt = 'value="[a-zA-Z0-9\-]*"'
rx_lt = re.compile(rx_lt)
request = requests.get("https://cas-sso.reseau-ges.fr/login")
cookies = request.cookies
lt = rx_lt.findall(request.content)[2]
return co... | Python | 0 | @@ -1,16 +1,182 @@
+from pyPdf import PdfFileWriter, PdfFileReader%0Afrom os import rename, listdir, path, makedirs%0Afrom datetime import datetime, date%0Aimport arrow%0Aimport glob%0Aimport sys%0A
import requests%0A
@@ -224,16 +224,17 @@
(open(%22.
+.
/config.
@@ -238,24 +238,274 @@
ig.yml%22))%0A%0A%0A
+def chan... |
9e666e97b07d7c08e434791a061086010da6e6eb | Add ability to get the latest TwoHeadlines tweet | main.py | main.py | # -*- utf-8 -*-
import config
import requests
from base64 import b64encode
def get_access_token():
token = config.twitter_key + ':' + config.twitter_secret
h = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Authorization': b'Basic ' + b64encode(bytes(token, 'utf8'))}
print(... | Python | 0 | @@ -1,13 +1,21 @@
# -*-
+ coding:
utf-8 -
@@ -550,52 +550,486 @@
def
-main():%0A bearer_token = get_access_token(
+get_latest_tweet(token):%0A parameters = %7B'screen_name': 'TwoHeadlines',%0A 'count': 1,%0A 'trim_user': True%7D%0A%0A headers = %7B'Authorization': 'Bearer... |
760a3280015a9bb9b6fdbbeda7ace5048708b892 | set default run to lunar_dqn | main.py | main.py | from rl.experiment import run
if __name__ == '__main__':
run('dev_dqn', times=2, param_selection=True)
# run('dqn', times=2, param_selection=False)
# run('lunar_dqn', times=1, param_selection=False)
# run('DevCartPole-v0_DQN_HighLowMemoryWithForgetting_BoltzmannPolicy_NoPreProcessor_2017-01-21_191023_e... | Python | 0.000002 | @@ -54,16 +54,18 @@
__':%0A
+ #
run('de
@@ -99,24 +99,24 @@
ction=True)%0A
-
# run('d
@@ -151,26 +151,24 @@
n=False)%0A
- #
run('lunar_
@@ -179,17 +179,17 @@
, times=
-1
+3
, param_
@@ -194,28 +194,27 @@
m_selection=
-Fals
+Tru
e)%0A # run
@@ -328,24 +328,24 @@
_only=True)%0A
-
# run('l
@... |
4083361f6f680fa59ce07ba3613a5d865bc2ca82 | add head for menu which shows name of program. it is implemented by print_head() in main.py | main.py | main.py | __author__ = "vishvendra singh"
__version__ = 0.1
import sys
import os
import urllib
import basic_functions as bf
import dlsub
def print_msg(msg):
os.system("clear")
print "msg: "+msg
cli_menu()
def cli_menu():
print "1. add folder to watch"
print "2. remove folder"
print "3. downloading s... | Python | 0.000002 | @@ -152,25 +152,19 @@
-os.system(%22clear%22
+print_head(
)%0A
@@ -2548,16 +2548,118 @@
False%0A%0A%0A
+def print_head():%0A msg = %22Subtitle-Automate%22.center(40, %22=%22)%0A os.system(%22clear%22)%0A print msg%0A%0A
if __nam
@@ -2691,32 +2691,53 @@
start_check():%0A
+ print_head()%0A
... |
5e0ba9a8233ba97fece09012a22b31b32a73a612 | Fix import | main.py | main.py | from bson import json_util
from flask import Flask, request, Response, render_template, send_from_directory
from flask_login import LoginManager, UserMixin, login_user
from flask_pymongo import PyMongo
from werkzeug.security import generate_password_hash, check_password_hash
from werkzeug import secure_filename
import ... | Python | 0.000002 | @@ -282,16 +282,22 @@
werkzeug
+.utils
import
|
2dec070daca154b26b880147d29ba80af99dd5ee | Fix is_worker_running | main.py | main.py | from crawler import tasks
from crawler.db import db_mongodb as db
from time import sleep
from celery.app.control import Control
from crawler.celery import app
# Temporal solution
db.insert_url("http://www.inf.upol.cz")
def is_worker_running():
inspect = app.control.inspect()
active = inspect.active()
s... | Python | 0.00538 | @@ -351,10 +351,8 @@
%0A
- #
res
@@ -379,29 +379,27 @@
rved()%0A%0A
-print
+if
(len(active.
@@ -410,20 +410,15 @@
s())
-)%0A print(
+ - 1 +
len(
@@ -439,37 +439,8 @@
s())
-)%0A%0A if len(active.items())
- 1
@@ -438,39 +438,38 @@
ms()) - 1 + len(
-schedul
+reserv
ed.items()) - 1
@@ -467,16 +4... |
7ef70ed9bd1a2e16ff046e8d805d88dab439e9d7 | Use ThreadPoolExecutor to send statistics in parallel | main.py | main.py | #!/usr/bin/env python3
import asyncio
from configuration.settings import Settings
from reporting.shellReporter import ShellReporter
from reporting.zabbixReporter import ZabbixReporter
from statsSend.teamCity.teamCityStatisticsSender import TeamCityStatisticsSender
from statsSend.jenkins.jenkinsStatisticsSender import... | Python | 0 | @@ -33,16 +33,67 @@
syncio%0A%0A
+from concurrent.futures import ThreadPoolExecutor%0A%0A
from con
@@ -1516,168 +1516,113 @@
-loop = asyncio.get_event_loop()%0A to_future_send = lambda sender: asyncio.ensure_future(sender.send())%0A future_send_list = list(map(to_future_send,
+with ThreadPoolExecu... |
8fa83766404002259ad8eafb583a5e3b189bb069 | Remove cruft. | nfsnapi.py | nfsnapi.py | #!/usr/bin/env python
"""A dynamic-DNS thing for NearlyFreeSpeech.NET-managed domains.
This file was written by Damien Dart, <damiendart@pobox.com>. This is
free and unencumbered software released into the public domain. For more
information, please refer to the accompanying "UNLICENCE" file.
"""
import hashlib
impo... | Python | 0 | @@ -1,305 +1,4 @@
-#!/usr/bin/env python%0A%0A%22%22%22A dynamic-DNS thing for NearlyFreeSpeech.NET-managed domains.%0A%0AThis file was written by Damien Dart, %3Cdamiendart@pobox.com%3E. This is%0Afree and unencumbered software released into the public domain. For more%0Ainformation, please refer to the accompanying %... |
f9f5977fdaa6ca09bdaeacaa5c1777fea1657ebb | print out only in main | novelan.py | novelan.py | #!/usr/bin/python3
import socket
import struct
from collections import namedtuple
class novelan:
__host = "0.0.0.0"
__port = 8888
__sock = None
def __init__(self, host, port=8888):
self.__host = host
self.__port = port
def __connect(self):
self.__sock = socket.socket(soc... | Python | 0.000028 | @@ -129,20 +129,18 @@
_port =
-8888
+0
%0A __s
@@ -2773,20 +2773,14 @@
-statusdict =
+return
sta
@@ -2796,79 +2796,8 @@
ct()
-%0A for key in statusdict:%0A print(key, statusdict%5Bkey%5D)
%0A%0A
@@ -3211,19 +3211,14 @@
-paramdict =
+return
par
@@ -3238,77 +3238,8 @@
t()%0A
... |
1986a377d7cec330124915766a507a17d36b62ef | work around a pip caching issue | noxfile.py | noxfile.py |
import os
import sys
import nox
import nox_poetry
sys.path.append('.')
from noxutil import get_versions
CURRENT_PYTHON = (('pypy' if hasattr(sys, 'pypy_version_info') else '')
+ f'{sys.version_info.major}.{sys.version_info.minor}')
nox.options.sessions = ['check', 'check_docs',
... | Python | 0.000002 | @@ -2316,16 +2316,180 @@
es=%5B%5D):%0A
+ # work around https://github.com/pypa/pip/issues/4183%0A session.run(%22pip%22, %22cache%22, %22--verbose%22, %22remove%22, %22rinohtype%22,%0A success_codes=%5B0, 1%5D)%0A
sess
|
698bdb824cadde73122a6389a35a907b5c59d424 | reorder log messages | main.py | main.py | import asyncio
import logging
import sys
from time import mktime
import aiohttp
import feedparser
import yaml
from raven import Client
from wallabag_api.wallabag import Wallabag
import github_stars
logger = logging.getLogger()
logger.handlers = []
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(messag... | Python | 0.000011 | @@ -1997,31 +1997,17 @@
er.info(
-sitetitle + %22:
+%22
Download
@@ -2010,25 +2010,39 @@
loading feed
-%22
+: %22 + sitetitle
)%0A rss =
@@ -2095,36 +2095,36 @@
nfo(
-sitetitle + %22: Parsing feed%22
+%22Parsing feed: %22 + sitetitle
)%0A
@@ -2168,31 +2168,17 @@
r.debug(
-sitetitle + %22:
+%22
finished
... |
6c55089b4ab4769a9ae35ffc193dcb4c51a03390 | Fix scheduling bug | main.py | main.py | import threading
import time
import datetime
import logging
from grabber import GGGGobblerBot
import db
import ErrorHandling
import msgcfg
import gobOauth
import settings
def main():
# connect using oauth to reddit
reddit = gobOauth.get_refreshable_instance()
# setup logging
logger = logging.getLogge... | Python | 0.000001 | @@ -1292,70 +1292,8 @@
w()%0A
- prevHour = now.replace(microsecond=0, second=0, minute=0)%0A
@@ -1409,13 +1409,12 @@
/ n)
-)
+ 1
+)
*n -
|
55b9090f76218b481d966c13bf96c7f2fa1af243 | Add study_163 | mooc.py | mooc.py | # -*- coding: utf-8 -*-
"""MOOC 课程下载"""
import os
import sys
import re
import json
import argparse
def store_cookies(file_name):
"""存储并返回 Cookie 字典"""
def cookie_to_json():
"""将分号分隔的 Cookie 转为字典"""
cookies_dict = {}
raw_cookies = input('> ')
for cookie in raw_cookies.split(... | Python | 0 | @@ -2393,32 +2393,237 @@
onfig, cookies)%0A
+ elif re.match(r'https?://study.163.com/course/', args.url):%0A from mooc import study_163%0A cookies = store_cookies('study_163_mooc.json')%0A study_163.start(args.url, config, cookies)%0A
elif re.matc
|
620182c6cad11907751146a5c66a19478aad0c18 | Update SVM.py | ml/GLM/SVM.py | ml/GLM/SVM.py | from math import log,e
from ..numc import *
from .lr import LR
from .LogisticRegr import LogisticRegression
""" trying to implement linear kernel using SVC """
class SVM():
def fit(self,X,Y):
LR.fit(self,X,Y)
return self
def hypo(self,it):
res= 1/(1+e**(-LR.hyp(self,it)))
return res
def cost1(self):
cos1... | Python | 0.000001 | @@ -655,11 +655,8 @@
ts=0
-111
%0A%09%09%09
|
0263938ab9c987055529dec39bb600dec2ad58e2 | Work in progress | persona.py | persona.py | #!python3
"""persona"""
import html.parser
import math
import sys
import time
import urllib.request
from collections import deque
from random import randint
from urllib.parse import urljoin
from urllib.request import urlopen
PERSONA = 'persona'
PERSONAS = {
'geek': {
'browse': {
'seeds': [
... | Python | 0.000003 | @@ -2234,16 +2234,41 @@
'utf-8'%0A
+ try:%0A
@@ -2303,37 +2303,16 @@
.read()%0A
- try:%0A
|
211fadd16c8fb63c61c0e6378e2d9607d61f932c | Bump version to 8.0.0a2 | resolwe/__about__.py | resolwe/__about__.py | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | Python | 0 | @@ -484,17 +484,17 @@
'8.0.0a
-1
+2
'%0A%0A__aut
|
7e74eb64697b410f38e7039b9a26b6cdd36275c6 | add doctest | stardatetime/conversion.py | stardatetime/conversion.py | from datetime import date
def earth_date_to_star_date(earth_year, earth_month, earth_day):
star_year = (earth_year - 2323) * 1000
first_date_of_year = date(year=earth_year, month=1, day=1)
earth_date = date(year=earth_year, month=earth_month, day=earth_day)
days_elapsed_in_year = earth_date - first_da... | Python | 0 | @@ -86,16 +86,242 @@
h_day):%0A
+ %22%22%22Converts an Earth date to a star date.%0A%0A %3E%3E%3E earth_date_to_star_date(2323, 1, 1)%0A 0.0%0A %3E%3E%3E earth_date_to_star_date(2015, 1, 1)%0A -308000.0%0A %3E%3E%3E earth_date_to_star_date(2014, 12, 31)%0A -308002.7%0A %22%22%22%0A%0A
star... |
178736aa0d9c44fe7cb94cbbf1597b256e091773 | Fix error if no organisation is selected | meinberlin/apps/newsletters/emails.py | meinberlin/apps/newsletters/emails.py | from email.mime.image import MIMEImage
from django.apps import apps
from django.conf import settings
from django.contrib import auth
from django.contrib.staticfiles import finders
from meinberlin.apps.contrib.emails import Email
Organisation = apps.get_model(settings.A4_ORGANISATIONS_MODEL)
User = auth.get_user_mode... | Python | 0.000001 | @@ -1172,32 +1172,49 @@
on'%5D%0A if
+organisation and
organisation.log
|
79a8ada9f4d0f7f9134d7697d57a5250fd51f5b0 | add tags to score | morss/readabilite.py | morss/readabilite.py | import lxml.etree
import lxml.html
import re
def parse(data, encoding=None):
if encoding:
parser = lxml.html.HTMLParser(remove_blank_text=True, remove_comments=True, encoding=encoding)
else:
parser = lxml.html.HTMLParser(remove_blank_text=True, remove_comments=True)
return lxml.html.froms... | Python | 0 | @@ -980,21 +980,16 @@
r', 'ad-
-break
', 'ageg
@@ -1264,16 +1264,24 @@
'widget'
+, 'hide'
%5D), re.I
@@ -1477,16 +1477,29 @@
', 'par'
+, 'editorial'
%5D), re.I
@@ -1608,16 +1608,45 @@
'style'
+, 'form', 'input', 'textarea'
%5D%0A%0Aattri
|
c26111a037af3d840b68bbe6d8f98b8af3d958ca | Support interaction over stdin/out. | standalone.py | standalone.py | #!/usr/bin/python
import config, webui, BaseHTTPServer, urllib
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
config = config.Config("config.ini")
def set_content_type(self, content_type):
self.send_header('Content-Type', content_type)
def run(self):
for scriptname in ('/mir... | Python | 0 | @@ -55,16 +55,29 @@
, urllib
+, sys, getopt
%0A%0Aclass
@@ -759,32 +759,33 @@
nv = %7B%7D%0A
+#
env%5B'SERVER_SOFT
@@ -815,32 +815,33 @@
tring()%0A
+#
env%5B'SERVER_NAME
@@ -865,24 +865,83 @@
server_name%0A
+ #env%5B'SERVER_PORT'%5D = str(self.server.server_port)%0A
env%5B
@@ -10... |
94625711fe2503dd8a2efbe367ec3d494810bf80 | Remove rogue print | menpo/image/test/image_masked_test.py | menpo/image/test/image_masked_test.py | import numpy as np
from numpy.testing import assert_allclose
from menpo.shape import PointCloud
from menpo.image import MaskedImage, BooleanImage
def test_constrain_mask_to_landmarks():
img = MaskedImage.init_blank((10, 10))
img.landmarks['box'] = PointCloud(np.array([[0.0, 0.0], [5.0, 0.0],
... | Python | 0.000009 | @@ -531,41 +531,8 @@
rue%0A
- print img.mask, example_mask%0A
|
eb5edde2be5995c3c705533c60bf4ae5bd48c124 | Remove debug log | ckanext/localimp/plugin.py | ckanext/localimp/plugin.py | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from logging import getLogger
import ckanext.localimp.lib.uploader
import os
import cgi
import pprint
import pathlib2
log = getLogger(__name__)
class LocalimpPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer, inherit=Tr... | Python | 0.000002 | @@ -1575,16 +1575,17 @@
_file')%0A
+%0A
@@ -1590,234 +1590,48 @@
#
-Package%0A# map.connect('new_resource', '/dataset/new_resource/%7Bid%7D',%0A# controller='ckanext.localimp.controllers.package_override:PackageContributeOverride',%0A# action='new_resource')%0... |
d44e4562a60a404fe7930996a198facbc0edd638 | remove foreground for now | kvirt/kbmc.py | kvirt/kbmc.py | import argparse
import sys
from kvirt.config import Kconfig
from kvirt.common import pprint
import pyghmi.ipmi.bmc as bmc
class KBmc(bmc.Bmc):
def __init__(self, authdata, port, name, foreground, client):
super(KBmc, self).__init__(authdata, port)
self.bootdevice = 'default'
self.k = Kcon... | Python | 0 | @@ -187,20 +187,8 @@
ame,
- foreground,
cli
@@ -2558,24 +2558,26 @@
o 6230')%0A
+ #
parser.add_
@@ -2828,52 +2828,8 @@
ame,
- foreground=args.foreground,%0A
cli
|
768f4c8eba43e77c25aac6732c96ed73c7484c0b | add basic logging | zephymap.py | zephymap.py | #!/usr/bin/python
import ConfigParser, os.path
import sys
from emailhandler import EmailHandler
import zephyr
import time
import getpass
from threading import Thread
class EmailThread(Thread):
def __init__(self, handler, interval=20):
Thread.__init__(self)
self.handler = handler
self.inter... | Python | 0 | @@ -159,16 +159,31 @@
t Thread
+%0Aimport logging
%0A%0Aclass
@@ -520,16 +520,86 @@
%22zephyr%22
+%0Alogger = logging.getLogger(%22zephymap%22)%0Alogger.setLevel(logging.DEBUG)
%0A%0Adef lo
@@ -878,20 +878,16 @@
%22.*%22%7D)%0A
-
%0A # b
@@ -904,16 +904,51 @@
ad read%0A
+ logger.info(%22Loading confi... |
2810780806628074a803fe92cb31e56751ba08d7 | add long cache headers to the geojson resource | mixed_beverages/apps/lazy_geo/urls.py | mixed_beverages/apps/lazy_geo/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^data.geojson$', views.MarkerList.as_view(), name='geo'),
]
| Python | 0 | @@ -30,28 +30,124 @@
url%0A
-%0Afrom . import views
+from django.views.decorators.cache import cache_control%0A%0Afrom . import views%0A%0AONE_DAY = 86400%0AONE_WEEK = ONE_DAY * 7
%0A%0A%0Au
@@ -187,17 +187,57 @@
ojson$',
-
+%0A cache_control(max_age=ONE_WEEK)(
views.Ma
@@ -254,17 +254,26 @@
s_view()
-,
+)... |
0e750e67eda80a134bc7bedb4ea50ee8811f2d1f | Add shebang | screencasts/hello-weave/highlight.py | screencasts/hello-weave/highlight.py | import json
prompt = 'ilya@weave-01:~$ '
highlight = [
('weave-01', 'red'),
('weave-02', 'red'),
('docker', 'red'),
('run', 'red'),
('--name', 'red'),
('hello', 'red'),
('netcat', 'red'),
('-lk', 'red'),
('1234', 'red'),
('sudo curl -s -L git.io/weave -o /usr/local/bin/weave', ... | Python | 0.998868 | @@ -1,8 +1,31 @@
+#!/usr/bin/env python3%0A
import j
|
c471f5ddfeaf6ce808d4a31bc5b534f82dbbafe0 | Allow merging processes to be run in foreground. | lobster/ui.py | lobster/ui.py | from argparse import ArgumentParser
import os
from lobster.cmssw.plotting import plot
from lobster.cmssw.publish import publish
from lobster.core import kill, cleanup, run
def boil():
parser = ArgumentParser(description='A job submission tool for CMS')
subparsers = parser.add_subparsers(title='commands')
... | Python | 0 | @@ -2498,29 +2498,135 @@
r_merge.
-set_defaults(
+add_argument('-f', '--foreground', action='store_true', default=False,%0A help='do not daemonize; run in the
foregrou
@@ -2627,22 +2627,25 @@
reground
-=False
+ instead'
)%0A pa
|
c45bc3e57f0c0fce9990488d13766875e33787a9 | add ability to load students from DB | students/views/students.py | students/views/students.py | from django.shortcuts import render
from django.http import HttpResponse
def students_list(request):
students = (
{'id': 1,
'first_name': 'Віталій',
'last_name': 'Подоба',
'ticket': 235,
'image': 'img/image1.jpg'},
{'id': 2,
'first_name': 'Андрій',
... | Python | 0 | @@ -67,16 +67,46 @@
sponse%0A%0A
+from ..models import Student%0A%0A
%0Adef stu
@@ -145,448 +145,28 @@
s =
-(%0A %7B'id': 1,%0A 'first_name': '%D0%92%D1%96%D1%82%D0%B0%D0%BB%D1%96%D0%B9',%0A 'last_name': '%D0%9F%D0%BE%D0%B4%D0%BE%D0%B1%D0%B0',%0A 'ticket': 235,%0A 'image': 'im... |
dd5f6a7088ea9cbd392a00e03e4b00e116ebb7a4 | Use `os.rename` directly instead of via `shutil.move` | json_store/json_store.py | json_store/json_store.py | # encoding: utf-8
"""A JSON store to use in place of shelve. Unicode keys, FTW!
This is for small stores. Everything is in memory and sync() always writes
everything out to disk.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import shutil
from tempfile import NamedTempor... | Python | 0 | @@ -271,22 +271,8 @@
os%0A
-import shutil%0A
from
@@ -2624,18 +2624,16 @@
-shutil.mov
+os.renam
e(fp
|
e2918e8c5b320a36d2bb801a839fc4095ea9f019 | Remove some unused types. | lang/types.py | lang/types.py | import ast
class Type(object):
def __eq__(self, other):
return self.__class__ == other.__class__
class base(object):
byval = False
iface = False
attribs = {}
methods = {}
type = Type()
@property
def name(self):
return self.__class__.__name__
@property
def ir(self):
return '%' + self.name
def ... | Python | 0 | @@ -2333,78 +2333,8 @@
ue%0A%0A
-class i64(base):%0A%09ir = 'i64'%0A%09bits = 64%0A%09signed = True%0A%09byval = True%0A%0A
clas
@@ -2477,184 +2477,8 @@
ue%0A%0A
-class IStr(base):%0A%09ir = '%25IStr.wrap'%0A%09iface = True%0A%09vttype = '%25IStr'%0A%09impl = '@IStr'%0A%0Aclass IBool(base):%0A%09ir = '%25IBool.wrap'... |
4bd88c81a0ca52d8dc9b4a228e3a74d8d51bf65e | Implement equality checking with default values | inflist.py | inflist.py | """
Provide services for automatically extending lists.
inflist provides a list subclass to allow for automagically extending lists.
InfList represents a list that allows extending indefinitely without any fuss.
Indexing a non-assigned thing works as expected; first, normal lookup is tried
like normal lists. If that f... | Python | 0.000001 | @@ -1681,16 +1681,702 @@
value)%0A%0A
+ def __eq__(self, other):%0A %22%22%22%0A Override the default list comparison operation to a more %22natural%22 one.%0A%0A Two lists (infinite or not) are equal if an infinite list can be%0A extended to a list equal to the other. For example,%0A%0A... |
efd43c2e70df25b52c28d02e8536194b1808f650 | truncate messages | lib/screen.py | lib/screen.py | import asyncio
import curses
from curses.textpad import Textbox
import signal
import math
DOWN = 1
UP = -1
class SlackScreen:
rows = 0
cols = 0
last_log_length = 0
log_length = 0
msgpad = None
def __init__(self, window, slack_manager):
self.slack_manager = slack_manager
self... | Python | 0.999993 | @@ -2933,16 +2933,110 @@
color))%0A
+%0A if len(msg) %3E self.logwin_width:%0A msg = msg%5B0:self.logwin_width%5D%0A%0A
|
f6052ec923fbe4270a3733aeb8d4a9d5727ef80f | Add support for porn.24video.net (closes #23779, closes #23784) | youtube_dl/extractor/twentyfourvideo.py | youtube_dl/extractor/twentyfourvideo.py | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
int_or_none,
xpath_attr,
xpath_element,
)
class TwentyFourVideoIE(InfoExtractor):
IE_NAME = '24video'
_VALID_URL = r'''(?x)
https?://
... | Python | 0 | @@ -389,16 +389,17 @@
ww%7Cporno
+?
)%5C.)?24v
@@ -1982,24 +1982,132 @@
ing': True,%0A
+ %7D, %7B%0A 'url': 'https://porn.24video.net/video/2640421-vsya-takay',%0A 'only_matching': True,%0A
%7D%5D%0A%0A
|
f9d6a73972b24f7c055223439d5c6c7f864afb31 | Add purchases to supplier schema | nbs/schema.py | nbs/schema.py | # -*- coding: utf-8 -*-
from marshmallow import Schema, fields
from nbs.models import Supplier
class _RefEntitySchema(Schema):
id = fields.Integer()
entity = fields.Nested('EntitySchema')
class AddressSchema(_RefEntitySchema):
type = fields.String(attribute='address_type')
city = fields.String()
... | Python | 0 | @@ -2456,16 +2456,146 @@
'type'))
+%0A purchases = fields.Nested('PurchaseDocumentSchema', many=True,%0A only=('id', 'status', 'amount'))
%0A%0A de
@@ -2924,16 +2924,70 @@
splay')%0A
+ amount = fields.Decimal(places=2, as_string=True)%0A
issu
@@ -3142,10 +3142,10 @@
sup
-... |
ebf10809eebaf19185868868b98c463c3845540d | make it possible to load snbt files | nbtlib/cli.py | nbtlib/cli.py | from json import dumps as json_dumps
from pprint import pprint
from argparse import ArgumentParser, ArgumentTypeError
from nbtlib import nbt, parse_nbt, serialize_tag, InvalidLiteral, Path
from nbtlib.tag import Compound, find_tag
# Validation helper
def nbt_data(literal):
try:
nbt_data = parse_nbt(li... | Python | 0 | @@ -808,32 +808,108 @@
a from a file%22)%0A
+group.add_argument(%22-s%22, action=%22store_true%22, help=%22read snbt from a file%22)%0A
group.add_argume
@@ -2004,16 +2004,26 @@
f args.r
+ or args.s
:%0A
@@ -2113,16 +2113,40 @@
eorder,%0A
+ args.s,%0A
@@ -2583,16 +2583,22 @@
teorder,... |
55046769da91be6ec0b268d8eb77e6680650755f | Update object_detect_inference.py | examples/tensorflow/inference/object-detect/object_detect_inference.py | examples/tensorflow/inference/object-detect/object_detect_inference.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from PIL import Image
import numpy as np
import tensorflow as tf
from uai.arch.tf_model import TFAiUcloudModel
import os
import sys
import tensorflow as tf
from collections import defaultdict
from... | Python | 0.000003 | @@ -4240,20 +4240,19 @@
%09%09%09%0D%0A%09%09%09
-pets
+obj
_in_imag
@@ -4586,96 +4586,36 @@
%09%09%09%09
-print(str(res_list))%0D%0A%09%09%09%09%09pets_in_image.append(res_list)%0D%0A%09%09%09%09%09print(str(pets_in_image)
+obj_in_image.append(res_list
)%0D%0A%09
@@ -4631,12 +4631,11 @@
end(
-pets
+obj
_in_
@@ -... |
704252f82f4b3a673b237fa91c346e45823056e7 | add latex for R_sun and L_sun, switch order with solRad | astropy/units/astrophys.py | astropy/units/astrophys.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package defines the astrophysics-specific units. They are also
available in the `astropy.units` namespace.
The `mag` unit is provided for compatibility with the FITS unit string
standard. However, it is not very useful ... | Python | 0 | @@ -1130,23 +1130,23 @@
t(%5B'
-solRad', 'R_sun
+R_sun', 'solRad
'%5D,
@@ -1211,16 +1211,74 @@
radius%22
+,%0A format=%7B'latex': r'R_%7B%5Codot%7D', 'unicode': 'R%E2%8A%99'%7D
)%0Adef_un
@@ -1671,24 +1671,24 @@
t(%5B'
-solMass', 'M_sun
+M_sun', 'solMass
'%5D,
@@ -2657,23 +2657,23 @@
t(%5B'
-solLum', ... |
726a70dd6e1508e8522060dff400c33918d3c13c | Set non-debug logging to WARNING level | mppsolar/__init__.py | mppsolar/__init__.py | # !/usr/bin/python
import logging
from argparse import ArgumentParser
# import mppcommands
from .mpputils import mppUtils
log = logging.getLogger('MPP-Solar')
def main():
parser = ArgumentParser(description='MPP Solar Command Utility')
parser.add_argument('-c', '--command', help='Command to run', default='Q... | Python | 0.000001 | @@ -1055,172 +1055,37 @@
-# Turn on debug if needed%0A if(args.enableDebug):%0A log.setLevel(logging.DEBUG)%0A ch = logging.StreamHandler()%0A ch.setLevel(logging.DEBUG)%0A
+ch = logging.StreamHandler()%0A
@@ -1130,20 +1130,16 @@
andlers%0A
-
form
@@ -1235,20 +1235,16 @... |
7f639d77caa3120745ab1a42c517d396664c17f9 | bump version to 0.4.33 | riboSeed/_version.py | riboSeed/_version.py | __version__ = '0.4.32'
| Python | 0 | @@ -17,7 +17,7 @@
.4.3
-2
+3
'%0A
|
fd36f3c8af92b2bee7ccd7e28dbaea02ccad9d54 | Add a test to check that the jti changes between _get_claims calls. | atlassian_jwt_auth/test.py | atlassian_jwt_auth/test.py | import datetime
import unittest
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from .key import KeyIdentifier
from .signer import JWTAuthSigner
class TestKeyModule(unittest.TestCase):
""... | Python | 0.000001 | @@ -1250,16 +1250,184 @@
RS256'%0A%0A
+ def get_example_jwt_auth_signer(self):%0A %22%22%22 returns an example jwt_auth_signer instance. %22%22%22%0A return JWTAuthSigner('issuer', 'key_id', key=self.key)%0A%0A
def
@@ -2310,16 +2310,591 @@
laims)%0A%0A
+ def test_jti_changes(self):%0A ... |
fd905b25b81419c3896d1177edd05709a5a78ad5 | Fix missing variable | mopidy/backends/libspotify/library.py | mopidy/backends/libspotify/library.py | import logging
import multiprocessing
from spotify import Link, SpotifyError
from mopidy.backends.base import BaseLibraryController
from mopidy.backends.libspotify import ENCODING
from mopidy.backends.libspotify.translator import LibspotifyTranslator
logger = logging.getLogger('mopidy.backends.libspotify.library')
... | Python | 0.998703 | @@ -886,14 +886,8 @@
s',
-track.
uri,
|
802811e43524a93d3adb138a8159fc47775dc2bb | Return all tracks in stored playlists upon empty search query | mopidy/backends/libspotify/library.py | mopidy/backends/libspotify/library.py | import logging
import multiprocessing
from spotify import Link
from mopidy.backends.base import BaseLibraryController
from mopidy.backends.libspotify import ENCODING
from mopidy.backends.libspotify.translator import LibspotifyTranslator
logger = logging.getLogger('mopidy.backends.libspotify.library')
class Libspoti... | Python | 0.000031 | @@ -231,16 +231,51 @@
anslator
+%0Afrom mopidy.models import Playlist
%0A%0Alogger
@@ -852,32 +852,384 @@
self, **query):%0A
+ if not query:%0A # Since we can't search for the entire Spotify library, we return%0A # all tracks in the stored playlists when the query is empty.%0A ... |
1d574be747dbed9fa2d43ccee107117b6ac78f10 | Make seed work. | rl_toolbox/runner.py | rl_toolbox/runner.py | import os
import time
import gym
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.multiprocessing as mp
from .util import Recoder
class Runner(object):
def __init__(
self,
env_name,
agent_fn,
policy_fn,
record_data=False,
... | Python | 0.000001 | @@ -731,24 +731,25 @@
(self.seed)%0A
+%0A
if m
@@ -2705,16 +2705,49 @@
l = 10%0A%0A
+ torch.manual_seed(seed)%0A%0A
|
5bc73b250ae75ce1299dd1999b3f9d66dfd6de21 | Fix or ignore type errors generated by the next release of pytype. | morph_net/tools/structure_exporter.py | morph_net/tools/structure_exporter.py | """Helper module for calculating the live activation counts."""
from __future__ import absolute_import
from __future__ import division
# [internal] enable type annotations
from __future__ import print_function
import json
import os
from morph_net.framework import op_regularizer_manager as orm
import numpy as np
impor... | Python | 0.000001 | @@ -4850,16 +4850,51 @@
ounts(f)
+ # pytype: disable=wrong-arg-types
%0A wit
@@ -4993,16 +4993,51 @@
ounts(f)
+ # pytype: disable=wrong-arg-types
%0A%0A%0A# TOD
|
ee86a23b0a30aa1fff521bdada5ead02cfd04bce | Remove device type | kairbnb/preprocessing.py | kairbnb/preprocessing.py | """Utils used in the preprocessing stage."""
import pandas as pd
import numpy as np
from datetime import datetime
import holidays
from xgboost.sklearn import XGBClassifier
def one_hot_encoding(data, categorical_features):
"""Encode a list of categorical features using a one-hot scheme.
Parameters
------... | Python | 0.000001 | @@ -3649,21 +3649,17 @@
-for
column
- in
+s =
%5B'a
@@ -3696,19 +3696,21 @@
_detail'
-, '
+%5D #
device_t
@@ -3712,18 +3712,42 @@
ice_type
-'%5D
+%0A for column in columns
:%0A
|
c4522ef2659e0f50bd240f9a3407721bc8ad6177 | add default post and pages | initial.py | initial.py | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | Python | 0 | @@ -2782,17 +2782,16 @@
.add(a)%0A
-%0A
db.sessi
@@ -2801,16 +2801,447 @@
commit()
+%0A%0A# Pre-load initial post%0Aa = Posts(adminuser,'Hello World!','/hello-world/','This is the first post! You can delete this post and add more vi /admin/!','','')%0Adb.session.add(a)%0Adb.session.commit()%0A%0A# Pre-load initial p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.