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 |
|---|---|---|---|---|---|---|---|
fdcc22dbe81bd930fa4764fd17a5b0d9b895bb3c | complete rework of HttpError: now it can set Content-Length | marnadi/http/errors.py | marnadi/http/errors.py | from marnadi.http import descriptors
HTTP_200_OK = '200 OK'
HTTP_404_NOT_FOUND = '404 Not Found'
HTTP_405_METHOD_NOT_ALLOWED = '405 Method Not Allowed'
HTTP_500_INTERNAL_SERVER_ERROR = '500 Internal Server Error'
HTTP_501_NOT_IMPLEMENTED = '501 Not Implemented'
class HttpError(Exception):
status = HTTP_500_IN... | Python | 0 | @@ -1,42 +1,4 @@
-from marnadi.http import descriptors%0A%0A
HTTP
@@ -259,83 +259,68 @@
-status = HTTP_500_INTERNAL_SERVER_ERROR%0A
+@property
%0A
+def
headers
- = descriptors.H
+(self):%0A default_h
eaders
-(
+ = %7B
%0A
@@ -324,17 +324,20 @@
-(
+
'Content
@@ -342,17 +342,17 @@... |
ceb9dd5854186832d55066fa52378aec6160433c | Fix confusing output for migration 0383. | zerver/migrations/0383_revoke_invitations_from_deactivated_users.py | zerver/migrations/0383_revoke_invitations_from_deactivated_users.py | from typing import List
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.utils.timezone import now as timezone_now
def revoke_invitations(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
... | Python | 0 | @@ -2071,50 +2071,128 @@
ds)%0A
- print(f%22Revoking Confirmations for
+%0A if len(confirmation_ids) %3E 0:%0A print(%0A f%22Revoking invitations by deactivated users in
rea
@@ -2225,17 +2225,31 @@
on_ids%7D%22
-)
+%0A )%0A
%0A
|
3d48066c78d693b89cb2daabfd1ebe756862edc5 | Remove dependency check done by Mopidy | mopidy_gmusic/__init__.py | mopidy_gmusic/__init__.py | from __future__ import unicode_literals
import os
from mopidy import config, exceptions, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.di... | Python | 0 | @@ -75,20 +75,8 @@
fig,
- exceptions,
ext
@@ -643,219 +643,8 @@
ma%0A%0A
- def validate_environment(self):%0A try:%0A import gmusicapi # noqa%0A except ImportError as e:%0A raise exceptions.ExtensionError('gmusicapi library not found', e)%0A pass%0A%0A
|
9a3df8a0ec3427d02cc663e2ee9ea97db43c432e | remove unnecessary IMDB import | movies_navigator/utils.py | movies_navigator/utils.py | import os
import sys
import shutil
import platform
import subprocess
import pickle
from imdbpie import Imdb
from movies_navigator.movie import Movie, TYPE_SEEN, TYPE_WATCHLIST
from colorama import init, Fore
init(autoreset=True)
imdb = Imdb()
INFO_FILE = "info.txt"
if sys.version[0] == "3":
raw_input = input
... | Python | 0.015301 | @@ -81,34 +81,8 @@
le%0A%0A
-from imdbpie import Imdb%0A%0A
from
@@ -205,22 +205,8 @@
e)%0A%0A
-imdb = Imdb()%0A
INFO
|
0a7809eda64f7f042100b1aaecae09b9b589f03a | add hash and eq methods. | melody/solver/p_map.py | melody/solver/p_map.py | """
File: p_map.py
Purpose: Wrapper for solver parameter map, that allow a form of replication not found in usual dict structures.
"""
from collections import OrderedDict
from tonalmodel.pitch_scale import PitchScale
from structure.LineGrammar.core.line_grammar_executor import LineGrammarExecutor
from melody.const... | Python | 0 | @@ -6099,8 +6099,203 @@
PMap(d)
+%0A%0A def __hash__(self):%0A return hash(len(self.actors))%0A%0A def __eq__(self, other):%0A if not isinstance(other,PMap):%0A return NotImplemented%0A return self is other
|
47d4002370fa62f360364086301ae68a6ea36441 | add numpy | Python/create_obs_anomalies/ERA-Interim/createobsanom_ts_template.py | Python/create_obs_anomalies/ERA-Interim/createobsanom_ts_template.py | """ Create ERA-Interim daily anomalies.
The file is filled in by generate_obs_ts_anom.ksh.
"""
import os
# Sections of code to run
download_data = 1 # 1, 0. conda acivate ECMWF
create_clim = 0 # 1, 0. conda activate SubX
create_anom = 0 # 1, 0. conda activate SubX
# Inputs
moPath = 'moddir'
ft = 'ftype'
mo = 'mod'
... | Python | 0.004014 | @@ -1975,16 +1975,39 @@
s as pd%0A
+ import numpy as np%0A
%0A%0A da
|
5c3da44d8788349438422f22ee6f657e65708c22 | Use parameters for image width and height | bitbots_common/src/bitbots_common/connector/capsules/head_capsule.py | bitbots_common/src/bitbots_common/connector/capsules/head_capsule.py | import time
import math
import rospy
from humanoid_league_msgs.msg import HeadMode, BallInImage, BallsInImage
import rosparam
from sensor_msgs.msg import JointState, CameraInfo
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
class HeadCapsule:
def __init__(self):
self.config = ros... | Python | 0.000002 | @@ -1561,38 +1561,81 @@
o =
-640, 360 #todo aus parametern!
+self.config%5B%22Camera%22%5D%5B%22imageWidth%22%5D, self.config%5B%22Camera%22%5D%5B%22imageHeight%22%5D
%0A%0A
|
2914fe05e064359a1381febc974982849937ba20 | Upgrade default go to 1.6.3. | contrib/go/src/python/pants/contrib/go/subsystems/go_distribution.py | contrib/go/src/python/pants/contrib/go/subsystems/go_distribution.py | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sub... | Python | 0.000002 | @@ -1271,17 +1271,17 @@
lt='1.6.
-2
+3
',%0A
|
b751c127ce4d6c249d05815803b07e9596bab2bc | Upgrade default go to 1.6. | contrib/go/src/python/pants/contrib/go/subsystems/go_distribution.py | contrib/go/src/python/pants/contrib/go/subsystems/go_distribution.py | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sub... | Python | 0 | @@ -1273,11 +1273,9 @@
='1.
-5.3
+6
',%0A
|
4d2005204470e91d45a05e205873f04887ff6cfb | Add need_azuremgmtcore (#12317) | tools/azure-sdk-tools/packaging_tools/templates/setup.py | tools/azure-sdk-tools/packaging_tools/templates/setup.py | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | Python | 0 | @@ -1223,17 +1223,16 @@
ion.py')
-
%0A
@@ -3118,24 +3118,123 @@
%25- endif %25%7D%0A
+ %7B%25- if need_azuremgmtcore %25%7D%0A 'azure-mgmt-core%3E=1.0.0,%3C2.0.0',%0A %7B%25- endif %25%7D%0A
%5D,%0A e
|
9e8dba575ee43e45e4f343afdecf22e80d0aadcc | raise HTTP NotImplemented instead of returning empty | opie/api/openstack/compute/preemptible_instances.py | opie/api/openstack/compute/preemptible_instances.py | # Copyright 2015 Spanish National Research Council - CSIC
# 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.... | Python | 0 | @@ -920,16 +920,33 @@
emptible
+%0Aimport webob.exc
%0A%0AALIAS
@@ -1133,33 +1133,43 @@
r
-eturn %7B%22preemptible%22: %5B%5D%7D
+aise webob.exc.HTTPNotImplemented()
%0A%0A%0Ac
|
20479ca1bf0636041c4b97633ea39ce2bbf84c2c | Remove some unused variables | IPython/nbconvert/preprocessors/tests/test_svg2pdf.py | IPython/nbconvert/preprocessors/tests/test_svg2pdf.py | """Tests for the svg2pdf preprocessor"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from IPython.testing import decorators as dec
from IPython.nbformat import v4 as nbformat
from .base import PreprocessorTestsBase
from ..svg2pdf import SVG2PDFPreprocessor
c... | Python | 0.000015 | @@ -1519,153 +1519,8 @@
%5D
-%0A %0A slide_metadata = %7B'slideshow' : %7B'slide_type': 'slide'%7D%7D%0A subslide_metadata = %7B'slideshow' : %7B'slide_type': 'subslide'%7D%7D
%0A%0A
|
576b74bdb3e4ddcdcd533be48ff755c4bcb17c3f | Fix width and height parameters for latest images functions | iterm2_tools/images.py | iterm2_tools/images.py | """
Functions for displaying images inline in iTerm2.
See https://iterm2.com/images.html.
"""
from __future__ import print_function, division, absolute_import
import sys
import os
import base64
IMAGE_CODE = '\033]1337;File=name={name};inline={inline};size={size};width={width};height={height}:{base64_img}\a'
def dis... | Python | 0 | @@ -934,16 +934,52 @@
e=inline
+,%0A width=width, height=height
))%0A s
@@ -1043,16 +1043,45 @@
inline=1
+, width='auto', height='auto'
):%0A %22
@@ -1224,16 +1224,347 @@
ed file%22
+%0A%0A width and height are strings, following the format%0A%0A N: N character cells.%0A%0A Npx: N pixels.%0A%... |
ffba01c92c7a1ed423eba883f234e0169ed383b0 | Update jukebar.py | Jukebar/jukebar.py | Jukebar/jukebar.py | """
Was installing pygame and then trying to play the songs with it.
Finished installing hg, next up is to install pygame really and see if it's playing.
sudo pip install hg+http://bitbucket.org/pygame/pygame
Also take a look at pyglet python module for playing mp3.
"""
import os
from random import randint
from time ... | Python | 0 | @@ -498,99 +498,138 @@
gs%22%0A
-%0Adef load_mp3_files():%0A %22%22%22%0A Creates the mp3 list from what is found in the directory
+jukebar_mixer = JukebarMixerWindows()%0A%0A%0Aclass JukebarMixerAbstract(object):%0A %22%22%22%0A Base mixer class with simple mixer actions
.%0A
@@ -638,121 +638,189 @@
%... |
e7bf5e84629daffd2a625759addf4eea8423e115 | Put fill_event in the public API. | dataportal/broker/__init__.py | dataportal/broker/__init__.py | from .simple_broker import (_DataBrokerClass, EventQueue, Header,
LocationError, IntegrityError)
from .handler_registration import register_builtin_handlers
DataBroker = _DataBrokerClass() # singleton, used by pims_readers import below
from .pims_readers import Images, SubtractedImages
reg... | Python | 0 | @@ -116,16 +116,28 @@
ityError
+, fill_event
)%0Afrom .
|
886cd787111f659ee5f54758ca75f208e4a99c2b | Fix plural typo in comment | DebianDevelChanges/mailparsers/accepted_upload.py | DebianDevelChanges/mailparsers/accepted_upload.py | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | Python | 0.999407 | @@ -1831,16 +1831,17 @@
he field
+s
, stop l
|
565fc81ef64065888b36ea91f38743aa70e2a0fc | Make the closedbugs plugin survive when a package does not close any bugs | debexpo/plugins/closedbugs.py | debexpo/plugins/closedbugs.py | # -*- coding: utf-8 -*-
#
# closedbugs.py — closedbugs plugin
#
# This file is part of debexpo - http://debexpo.workaround.org
#
# Copyright © 2008 Jonny Lamb <jonny@debian.org>
# 2011 Arno Töll <debian@toell.net>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy... | Python | 0.000002 | @@ -1831,16 +1831,166 @@
%22%22%22%0A%0A
+ try:%0A self.changes%5B'Closes'%5D%0A except KeyError:%0A log.debug('Package does not close any bugs')%0A return%0A%0A
|
32039b863053934f5c0122f08f9777f59251d4fb | Add audit message to permissions endpoint | resolwe/permissions/mixins.py | resolwe/permissions/mixins.py | """Permissions functions used in Resolwe Viewsets."""
from django.conf import settings
from django.db import models, transaction
from rest_framework import exceptions, serializers, status
from rest_framework.decorators import action
from rest_framework.request import Request
from rest_framework.response import Respons... | Python | 0.000001 | @@ -316,16 +316,71 @@
sponse%0A%0A
+from resolwe.auditlog.auditmanager import AuditManager%0A
from res
@@ -3724,36 +3724,171 @@
-if request.method == %22POST%22:
+audit_manager = AuditManager.global_instance()%0A%0A if request.method == %22POST%22:%0A audit_manager.log_message(%22Permissions u... |
1a01ccb3ac8ca6d476fdc9bf7c72993edab0a1b5 | Version bump for ephemeral play support. (#981) | magenta/version.py | magenta/version.py | # Copyright 2016 Google Inc. 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 ag... | Python | 0 | @@ -804,7 +804,7 @@
0.3.
-4
+5
'%0A
|
6cf8194bc123b5e35650373dfb8cfc1790c35c6c | switch regex engine to re2 | Commands/Sed.py | Commands/Sed.py | # -*- coding: utf-8 -*-
"""
Created on Feb 14, 2014
@author: Tyranic-Moron
"""
import copy
import re
import sre_constants
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from CommandInterface import CommandInterface
from Utils.SignalTimeout import SignalTimeout, TimeoutException
f... | Python | 0.000004 | @@ -86,16 +86,77 @@
rt copy%0A
+try:%0A import re2%0Aexcept ImportError:%0A import re as re2%0A
import r
@@ -1706,32 +1706,33 @@
tch%0A
+#
try:%0A
@@ -1736,16 +1736,17 @@
+#
with Sig
@@ -1768,32 +1768,24 @@
-
-
response = s
@@ -1910,24 +1910,25 @@
... |
75726945934a049c9fc81066996f1670f29ead2c | Improve handling of SKIP_LONG_TESTS build variable. | test/long_test.py | test/long_test.py | import os, unittest
"""This module long_test provides a decorator, @long_test, that you can use to
mark tests which take a lot of wall clock time.
If the system environment variable SKIP_LONG_TESTS is set, tests decorated
with @long_test will not be run.
"""
SKIP_LONG_TESTS = os.getenv('SKIP_LONG_TESTS', None) is no... | Python | 0 | @@ -306,25 +306,35 @@
S',
-None) is not None
+'').lower().startswith('t')
%0A%0Alo
|
f3490a9fc6a21ec6a6bb1af9f77d270b003cf45a | update dit/__init__.py too | dit/__init__.py | dit/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
dit is a Python package for information theory on discrete random variables.
d = discrete
i = information
t = theory
However, the more precise statement (at this point) is that `dit` is a
Python package for sigma-algebras defined on finite sets. Presently,
a few assu... | Python | 0.000001 | @@ -739,8 +739,94 @@
orithms%0A
+import dit.divergences%0Aimport dit.esoteric%0Aimport dit.multivariate%0Aimport dit.shannon%0A
|
1c74da888aeae06f97f07f37b523d7b33d9dd210 | Bump version to 0.9.0 | jarvis_cli/__init__.py | jarvis_cli/__init__.py |
__version__ = '0.8.0'
EVENT_CATEGORIES_TO_DEFAULTS = {
"consumed": 100,
"produced": 100,
"experienced": 100,
"interacted": 80,
"formulated": 80,
"completed": 50,
"detected": 10,
"measured": 5
}
EVENT_CATEGORIES = list(EVENT_CATEGORIES_TO_DEFAULT... | Python | 0.000001 | @@ -11,17 +11,17 @@
__ = '0.
-8
+9
.0'%0A%0AEVE
|
40c6c591792f6601706d350bfb3025b389f978c5 | Update __init__.py | newspaperdemo/__init__.py | newspaperdemo/__init__.py | from flask import Flask, request, render_template, redirect, url_for,jsonify
from newspaper import Article
from xml.etree import ElementTree
app = Flask(__name__)
# Debug logging
import logging
import sys
# Defaults to stdout
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
try:
log.inf... | Python | 0.000072 | @@ -562,25 +562,16 @@
get('url
-_to_clean
')%0A i
|
7b8ca5d757a7ab070818ceea16e91a57b54ba2e9 | Update __init__.py | newspaperdemo/__init__.py | newspaperdemo/__init__.py | from flask import Flask, request, render_template, redirect, url_for,jsonify
from .source import Article
from xml.etree import ElementTree
app = Flask(__name__)
# Debug logging
import logging
import sys
import twitter
# Defaults to stdout
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
try:... | Python | 0.000072 | @@ -1158,16 +1158,8 @@
t =
-unicode(
requ
@@ -1182,54 +1182,8 @@
xt')
-, %22utf-8%22)%0A print(request.args.get('text'))
%0A
|
c0d7cb7d646ae1e843d5910054d37d2e5730fd81 | set right size_ckp | examples/checkpointing/checkpoint.py | examples/checkpointing/checkpoint.py | from pyrevolve import Checkpoint, Operator
from devito import TimeFunction
from devito.tools import flatten
class CheckpointOperator(Operator):
"""Devito's concrete implementation of the ABC pyrevolve.Operator. This class wraps
devito.Operator so it conforms to the pyRevolve API. pyRevolve will call apply
... | Python | 0.000029 | @@ -3108,16 +3108,21 @@
rn sum(%5B
+int((
o.size_a
@@ -3129,16 +3129,34 @@
llocated
+/(o.time_order+1))
*o.time_
@@ -3160,16 +3160,17 @@
me_order
+)
for o i
|
be13ded4e408c95fcfbe2ef63a12e25d3af5017b | Add solution to Lesson2_Problem.03-Processing_All | Lesson_2_Problem_Set/03-Processing_All/process.py | Lesson_2_Problem_Set/03-Processing_All/process.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Let's assume that you combined the code from the previous 2 exercises
# with code from the lesson on how to build requests, and downloaded all the data locally.
# The files are in a directory "data", named after the carrier and airport:
# "{}-{}.html".format(carrier, airp... | Python | 0 | @@ -2011,21 +2011,16 @@
it(%22-%22)%0A
- %0A
with
@@ -2067,17 +2067,16 @@
s html:%0A
-%0A
@@ -2101,17 +2101,561 @@
up(html)
-%0A
+ %0A _table = soup.find(id=%22DataGrid1%22)%0A for _tr in _table.findAll(%22tr%22)%5B1:%5D:%0A _allTd = _tr.findAll(%22td%22)%0A ... |
e8f6a1d37fd01a3c772479b2030631961259b73b | Set maxSpeed back to 255 | test/motortest.py | test/motortest.py | #!/usr/bin/python
# coding=utf-8
import time
import atexit
###### motor stuff
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor
###### LCD stuff
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
# create a default mo... | Python | 0.000584 | @@ -842,13 +842,15 @@
eed
+
= 2
-00
+55
# m
|
e227fcbf0d121cc9b0c7b4b4f228067e759c9057 | Change the keywords of tags | rrd/model/endpoint_counter.py | rrd/model/endpoint_counter.py | #-*- coding:utf-8 -*-
from rrd.store import graph_db_conn as db_conn
class EndpointCounter(object):
def __init__(self, id, endpoint_id, counter, step, type_):
self.id = str(id)
self.endpoint_id = str(endpoint_id)
self.counter = counter
self.step = step
self.type_ = type_
... | Python | 0 | @@ -1842,16 +1842,26 @@
if '
+nqm-agent-
isp' in
@@ -1924,16 +1924,26 @@
args, '
+nqm-agent-
isp')%0A
@@ -1952,16 +1952,26 @@
if '
+nqm-agent-
province
@@ -2039,16 +2039,26 @@
args, '
+nqm-agent-
province
@@ -2072,16 +2072,26 @@
if '
+nqm-agent-
city' in
@@ -2155,16 +2155,26 @@
args, '
+nqm... |
fb6e7aff9a30f0a1efbf7bf28735e985aaf50fe9 | Use xarray support to simplify GINI example | examples/formats/GINI_Water_Vapor.py | examples/formats/GINI_Water_Vapor.py | # Copyright (c) 2015,2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
GINI Water Vapor Imagery
========================
Use MetPy's support for GINI files to read in a water vapor satellite image and plot the
data using CartoPy.
"""
import ca... | Python | 0 | @@ -308,35 +308,8 @@
%22%22%22%0A
-import cartopy.crs as ccrs%0A
impo
@@ -735,17 +735,16 @@
#######%0A
-%0A
# Get a
@@ -849,17 +849,20 @@
the data
-,
+ and
(x, y)
@@ -876,42 +876,142 @@
ates
-, and the projection%0A# informa
+. We use %60metpy.parse_cf%60 to%0A# handle parsing some netCDF Climate and Forecast... |
62fc1c90c252c8ac1371d69951a5c727d0b33ef1 | Clarify docstring about dependencies | salt/modules/introspect.py | salt/modules/introspect.py | # -*- coding: utf-8 -*-
'''
Functions to perform introspection on a minion, and return data in a format
usable by Salt States
'''
import os
def running_service_owners(
exclude=('/dev', '/home', '/media', '/proc', '/run', '/sys/', '/tmp',
'/var')
):
'''
Determine which packages own... | Python | 0.000003 | @@ -2891,16 +2891,230 @@
ructure.
+ By default%0A also returns package dependencies for those services, which means that%0A package definitions must be created outside this function. To drop the%0A package dependencies, set %60%60requires%60%60 to False.
%0A%0A CL
@@ -3176,16 +3176,82 @@
ghstate%0A
+ ... |
4a6d56acef9ab67c41386f32093ea517a8129f37 | Fix failing test for checking get_owner | salt/modules/win_status.py | salt/modules/win_status.py | '''
Module for returning various status data about a minion.
These data can be useful for compiling into stats later.
:depends: - pythoncom
- wmi
'''
import logging
import salt.utils
log = logging.getLogger(__name__)
try:
import pythoncom
import wmi
import salt.utils.winapi
has_requir... | Python | 0.000007 | @@ -1417,26 +1417,222 @@
r =
-process.GetOwner()
+'', '', ''%0A try:%0A domain, error_code, user = process.GetOwner()%0A owner%5B'user'%5D = user.encode('utf-8')%0A owner%5B'user_domain'%5D = domain.encode('utf-8')%0A except Exception as exc:%0A pass
%0A
@@ -2094,17 +2094,16 @@
... |
4fd3a054818fbcdc36655b116a09630e41c94c19 | Improve JSON serialization | minette/models/base.py | minette/models/base.py | """ JSON serialization """
from datetime import datetime
from ..utils import encode_json, decode_json
class JsonSerializable:
"""
Base class for JSON Serializable object
"""
def __init__(self, **kwargs):
pass
def to_dict(self):
"""
Convert this object to dict
Re... | Python | 0.003052 | @@ -1481,24 +1481,34 @@
to_json(self
+, **kwargs
):%0A %22
@@ -1692,16 +1692,26 @@
o_dict()
+, **kwargs
)%0A%0A @
|
af4a5b3c32da2350e32b48c053f9f170eeb00a6f | Increase graph size for real simulations and use mean theta from existing results. | exp/viroscopy/model/HIVModelUtils.py | exp/viroscopy/model/HIVModelUtils.py |
"""
Keep some default parameters for the epidemic model.
"""
import numpy
import logging
from apgl.util import Util
from apgl.util import PathDefaults
from apgl.graph.GraphStatistics import GraphStatistics
from exp.viroscopy.model.HIVGraph import HIVGraph
from exp.viroscopy.model.HIVEpidemicModel import HIVEpide... | Python | 0 | @@ -591,16 +591,290 @@
cmethod%0A
+ def estimatedRealTheta():%0A %22%22%22%0A This is taken from simulated runs using the real data %0A %22%22%22%0A theta = numpy.array(%5B 175.25, 0.8338, 0.4083, 0.0016, 0.0064, 0.0279, 0.0312, 0.0446, 0.0758, 0.4285%5D)%0A return theta %0A %... |
f1d43fdd3bf2bb9aea5fa2a610778e816c0d8d33 | remove .waf if exists at prepare_samples | samples/prepare_samples.py | samples/prepare_samples.py | #!/usr/bin/env python
"""
Prepares for running samples.
It just generates maf.py and copies maf.py and waf to each sample directory.
Please run this script before trying these samples.
"""
import glob
import os
import shutil
import subprocess
if __name__ == '__main__':
os.chdir('..')
subprocess.check_call('.... | Python | 0 | @@ -387,16 +387,110 @@
('*/'):%0A
+ for dotwaf in glob.glob(os.path.join(d, %22.waf-*%22)):%0A shutil.rmtree(dotwaf)%0A
|
0a3a44959c192a0b4e2d9fac9396ebbf8d864949 | Change location of dst repo | manager/dst/dst.py | manager/dst/dst.py | #!/usr/bin/env python
"""usage: dst [--version] [--help]
<command> [<args>...]
options:
-v, --version Print the version and exit
-h, --help Print this help
Available commands:
add Add a bundle
info Print bundle information
list List all available bundles... | Python | 0 | @@ -552,20 +552,8 @@
name
-, expanduser
%0A%0Afr
@@ -1078,27 +1078,17 @@
r =
-expanduser('~/repos
+'/usr/lib
/dat
@@ -1113,17 +1113,16 @@
bundles'
-)
%0A%0A de
@@ -2200,15 +2200,16 @@
'cd
-~/repos
+/usr/lib
/dat
|
d268e93dc5b5622b2ff5064808f6ddd3aee65be0 | Update coco.py | mmdet/datasets/coco.py | mmdet/datasets/coco.py | import numpy as np
from pycocotools.coco import COCO
from .custom import CustomDataset
class CocoDataset(CustomDataset):
CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic_light', 'fire_hydrant',
'stop_sign', 'parking_meter', ... | Python | 0.000005 | @@ -1906,16 +1906,17 @@
nn_info,
+
self.wit
|
4e4b20291a3fbcc9fa5849669f2a23ee275a5dde | add alternative JSON output mode (-j/--json) | sasutils/cli/ses_report.py | sasutils/cli/ses_report.py | #!/usr/bin/python
#
# Copyright (C) 2016
# The Board of Trustees of the Leland Stanford Junior University
# Written by Stephane Thiell <sthiell@stanford.edu>
#
# 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 cop... | Python | 0.000001 | @@ -822,16 +822,28 @@
rgparse%0A
+import json%0A
import l
@@ -1838,22 +1838,22 @@
_group('
-carbon
+output
options
@@ -1882,17 +1882,17 @@
ent(
-%22
+'
--prefix
%22, a
@@ -1887,17 +1887,17 @@
--prefix
-%22
+'
, action
@@ -1901,15 +1901,15 @@
ion=
-%22
+'
store
-%22
+'
, de
@@ -2057,16 +2057,136 @@
ils%22)... |
525cc6aea35264a7fb967905823faed62ac7522c | Drop Py2 and six on salt/beacons/proxy_example.py | salt/beacons/proxy_example.py | salt/beacons/proxy_example.py | # -*- coding: utf-8 -*-
"""
Example beacon to use with salt-proxy
.. code-block:: yaml
beacons:
proxy_example:
endpoint: beacon
"""
# Import Python libs
from __future__ import absolute_import, unicode_literals
import logging
# Import salt libs
import salt.utils.http
from salt.ext.six.moves import... | Python | 0 | @@ -1,28 +1,4 @@
-# -*- coding: utf-8 -*-%0A
%22%22%22%0A
@@ -125,179 +125,45 @@
%22%22%22%0A
-%0A# Import Python libs%0Afrom __future__ import absolute_import, unicode_literals%0A%0Aimport logging%0A%0A# Import salt libs%0Aimport salt.utils.http%0Afrom salt.ext.six.moves import ma
+import logging%0A%0Aimport salt.ut... |
56f3b879996381d7219d4750e43a6b6cacb6bc2a | Make sure we flatten the layer, in case it's a tensor (e.g. pooling layer) | mmfeat/cnn/__init__.py | mmfeat/cnn/__init__.py | '''
Convolutional Neural Network features
'''
from ..base import DataObject
import os, sys, traceback
import cPickle as pickle
from multiprocessing import Pool, Manager
import numpy as np
try:
import caffe
except ImportError:
import warnings
warnings.warn('Could not find Caffe Python bindings. You will ... | Python | 0.000001 | @@ -3591,16 +3591,26 @@
.data%5B0%5D
+.flatten()
%0A
|
121c4eef7c0a39171d45beb1ebd58e12daff6baa | Improve the http_logstash engine | salt/engines/http_logstash.py | salt/engines/http_logstash.py | # -*- coding: utf-8 -*-
'''
HTTP Logstash engine
==========================
An engine that reads messages from the salt event bus and pushes
them onto a logstash endpoint via HTTP requests.
:configuration: Example configuration
.. code-block:: yaml
engines:
- http_logstash:
url: ... | Python | 0.000348 | @@ -185,16 +185,268 @@
uests.%0A%0A
+.. versionchanged:: 2017.7.3%0A%0A.. note::%0A By default, this engine take everything from the Salt bus and exports into%0A Logstash.%0A For a better selection of the events that you want to publish, you can use%0A the %60%60tags%60%60 and %60%60funs%60%60 options.%0A%... |
dad4378bac408d88e48a55e35680e6e86e04195c | patch from @damienpicard in pull #371 | samples/WhoIsRouterForeign.py | samples/WhoIsRouterForeign.py | #!/usr/bin/env python
"""
This sample application has just a network stack, not a full application,
and is a way to create InitializeRoutingTable and WhoIsRouterToNetwork requests.
"""
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.consolelogging import ConfigArgumentParser
from bacpype... | Python | 0 | @@ -855,24 +855,34 @@
(self, *args
+, **kwargs
):%0A i
@@ -930,16 +930,19 @@
__init__
+ %25r
%25r%22, ar
@@ -943,16 +943,24 @@
r%22, args
+, kwargs
)%0A
@@ -999,24 +999,34 @@
(self, *args
+, **kwargs
)%0A%0A def r
@@ -3683,16 +3683,28 @@
+bbmdAddress=
Address(
@@ -3734,16 +3734,24 @@... |
2bcddd5be9c0fbd942d9c66c087cf520745e92f6 | Add fix for Django 1.4 | model_utils/tracker.py | model_utils/tracker.py | from __future__ import unicode_literals
from copy import deepcopy
from django.db import models
from django.core.exceptions import FieldError
from django.db.models.query_utils import DeferredAttribute
class FieldInstanceTracker(object):
def __init__(self, instance, fields, field_map):
self.instance = ins... | Python | 0.000009 | @@ -2929,24 +2929,185 @@
end(field)%0A%0A
+ # Django 1.4%0A model = None%0A if hasattr(field_obj, 'model_ref'):%0A model = field_obj.model_ref()%0A%0A
@@ -3194,20 +3194,21 @@
d_name,
-None
+model
)%0A
|
f193c52acd23a8a6539da9873ccbda27ee6475a5 | Fix IMAGES_EXPIRES default value | scrapy/pipelines/images.py | scrapy/pipelines/images.py | """
Images Pipeline
See documentation in topics/media-pipeline.rst
"""
import functools
import hashlib
import six
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
from PIL import Image
from scrapy.utils.misc import md5sum
from scrapy.utils.python import to_bytes
from... | Python | 0.000619 | @@ -1037,16 +1037,17 @@
PIRES =
+9
0%0A TH
|
a7317482cf8c189400385449fbc039bd18f5285d | add exception for khmer contraints | scripts/MakeDNADatabase.py | scripts/MakeDNADatabase.py | #! /usr/bin/env python
# This script will make a training database of hashes
import os
import sys
# The following is for ease of development (so I don't need to keep re-installing the tool)
try:
from CMash import MinHash as MH
except ImportError:
try:
import MinHash as MH
except ImportError:
sys.path.insert(0, o... | Python | 0.000001 | @@ -2421,16 +2421,196 @@
.k_size%0A
+%09if ksize %3E 31:%0A%09%09raise Exception(%22Unfortunately, ksize must be size 32 or smaller (due to khmer contraints). Please reduce the ksize or use MakeStreamingDNADatabase.py instead.%22)%0A
%09max_h =
|
d62bc64db740b8467aeabb5a88bd46503c0bcd31 | add time command, run twice for testing cache speed | scripts/__travis_test__.py | scripts/__travis_test__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
os.system('python nettacker.py --help')
os.system("python nettacker.py -i 127.0.0.1 -u user1,user2 -p pass1,pass2 -m all -g 21,25,80,443 -t 2 -T 0.1")
| Python | 0 | @@ -51,16 +51,41 @@
ort os%0A%0A
+# Test help menu command%0A
os.syste
@@ -87,16 +87,21 @@
system('
+time
python n
@@ -125,19 +125,302 @@
p')%0A
-os.system(%22
+# Test show version command%0Aos.system('time python nettacker.py --version')%0A# Test all modules command%0Aos.system(%22time python nettacker.py -i 127... |
6addf98a5ce2ca4e61f809664660418351cb8922 | Remove unused convert function from validator | IPython/nbformat/validator.py | IPython/nbformat/validator.py | from __future__ import print_function
#!/usr/bin/env python
# -*- coding: utf8 -*-
import json
import os
from IPython.external.jsonschema import Draft3Validator
import IPython.external.jsonpointer as jsonpointer
from IPython.utils.py3compat import iteritems
from .current import nbformat, nbformat_schema
schema_path ... | Python | 0.000001 | @@ -1949,349 +1949,4 @@
ved%0A
-%0A%0Adef convert(namein, nameout, indent=2):%0A %22%22%22resolve the references of namein, save the result in nameout%22%22%22%0A jsn = None%0A with open(namein) as file:%0A jsn = json.load(file)%0A v = resolve_ref(jsn)%0A x = jsonpointer.resolve_pointer(v, '/note... |
6a8ffecf6b41d8cd82f0811e652fbc49721decfa | reset animated images on play to their start_frame | mpfmc/widgets/image.py | mpfmc/widgets/image.py | from typing import Optional, Union
from kivy.properties import ObjectProperty, NumericProperty, AliasProperty
from kivy.graphics import Rectangle, Color, Rotate, Scale
from mpfmc.uix.widget import Widget
MYPY = False
if MYPY: # pragma: no cover
from mpfmc.core.mc import MpfMc
from mpfmc.assets.image import... | Python | 0 | @@ -4676,20 +4676,17 @@
%5Bint%5D =
-None
+0
):%0A
@@ -4814,16 +4814,68 @@
_frame%0A%0A
+ self._image.image._anim_index = start_frame%0A
|
c5f201bd9abdafa77916c5226225fb2f2129f36c | Update test to catch 500 error we are fixing | ForgeBlog/forgeblog/tests/functional/test_root.py | ForgeBlog/forgeblog/tests/functional/test_root.py | from alluratest.controller import TestController
#---------x---------x---------x---------x---------x---------x---------x
# RootController methods exposed:
# index, new_page, search
# PageController methods exposed:
# index, edit, history, diff, raw, revert, update
# CommentController methods exposed:
# rep... | Python | 0 | @@ -1337,32 +1337,63 @@
st', status=404)
+%0A self.app.get('/blog/')
%0A%0A def test_p
|
41fc2f6506c18df4aaa84320c2ae62db0aacd2ac | Fix bugs in compile_grm build extension | mul_034/build_defs.bzl | mul_034/build_defs.bzl | # Copyright 2017 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 | @@ -1255,16 +1255,17 @@
= src%5B:
+-
len(suff
@@ -1524,16 +1524,26 @@
rcs = %5B%22
+//mul_034:
compile_
|
39ddd32ab8fd9237d7c347389ec06fff6216f89b | Add date-time field in serializer.py | meas/serializer.py | meas/serializer.py | from rest_framework import serializers
from .models import Condition, Entry
class ConditionSerializer(serializers.ModelSerializer):
class Meta:
model = Condition
fields = ('description', 'condition', 'serial', 'uuid')
class EntrySerializer(serializers.ModelSerializer):
class Meta:
... | Python | 0.000001 | @@ -230,16 +230,30 @@
, 'uuid'
+, 'created_at'
)%0A
@@ -402,16 +402,30 @@
, 'unit'
+, 'created_at'
)%0A
|
c902256d43e6b272adf8eb96631f537177a79bb2 | Move readings to a different element | scripts/spltext2netcdf4.py | scripts/spltext2netcdf4.py |
import re
from pprint import pprint
from datetime import datetime
import pytz
import logging
from collections import namedtuple
FORMAT = '%(asctime)s %(message)s'
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter(FORMAT)
handler.setFormatter(formatter)
logger.addHandler(hand... | Python | 0.000001 | @@ -847,33 +847,16 @@
ow/D
-esktop/INVRCRGL/1994/9403
+ownloads
/940
@@ -1697,16 +1697,56 @@
e': date
+,%0A 'readings': dict()
%0A
@@ -2215,32 +2215,44 @@
hpa in dates%5Bd%5D
+%5B'readings'%5D
:%0A
@@ -2266,32 +2266,44 @@
dates%5Bd%5D%5B
+'readings'%5D%5B
hpa%5D =... |
30a4f0f7d60e2b22882baf3b6a96ea19e39d18e1 | Clean up when an exception occurs while updating Elasticsearch | scripts/update_es_index.py | scripts/update_es_index.py | import argparse
import logging
import sys
from copy import deepcopy
from sm.engine import MolecularDB
from sm.engine.isocalc_wrapper import IsocalcWrapper
from sm.engine.util import init_loggers, SMConfig
from sm.engine import DB
from sm.engine import ESExporter, ESIndexManager
def _reindex_all(conf):
es_config ... | Python | 0.000001 | @@ -520,16 +520,29 @@
index)%0A%0A
+ try:%0A
tmp_
@@ -573,24 +573,28 @@
config)%0A
+
+
tmp_es_confi
@@ -617,16 +617,20 @@
_index%0A%0A
+
db =
@@ -645,24 +645,28 @@
%5B'db'%5D)%0A
+
+
es_exp = ESE
@@ -688,24 +688,28 @@
_es_config)%0A
+
rows = d
@@ -757,24 +757,28 @@
... |
0613fe022288a95665412c3c376ca21862e1af29 | Use a real object instead | scripts/version_manager.py | scripts/version_manager.py | #!/usr/bin/env python
import sys
from argparse import ArgumentParser
from collections import Counter
from os.path import (
dirname,
join,
)
class FileVersionInfo(object):
def __init__(
self,
key_name: str,
file_path: str,
magic_line: str,
strip_... | Python | 0.000012 | @@ -972,16 +972,311 @@
esult%0A%0A%0A
+class FileVersionResult(object):%0A def __init__(%0A self,%0A uniform: bool,%0A version_details: dict,%0A version_result: str%0A ):%0A self.uniform = uniform%0A self.version_details = version_details%0A self.v... |
7a79b37a40c407b312bde1c74813fd826fcc5b18 | encode before md5 | secretballot/middleware.py | secretballot/middleware.py | from hashlib import md5
class SecretBallotMiddleware(object):
def process_request(self, request):
request.secretballot_token = self.generate_token(request)
def generate_token(self, request):
raise NotImplementedError
class SecretBallotIpMiddleware(SecretBallotMiddleware):
def generate_t... | Python | 0.998761 | @@ -595,16 +595,31 @@
rn md5(s
+.encode('utf8')
).hexdig
|
a86dc3da4c3b2dc2f67681a5ca788de790d9b3b3 | Fix style | didyoumean/readme_examples.py | didyoumean/readme_examples.py | # -*- coding: utf-8
"""Code to generate examples in README.md."""
from didyoumean import add_suggestions_to_exception
import sys
def get_exception(code):
"""Helper function to run code and get what it throws."""
try:
exec(code)
except:
return sys.exc_info()
return None
def main():
... | Python | 0.000001 | @@ -3218,16 +3218,42 @@
after =
+ %5C%0A
%22No exc
|
1c0708355c7b3653c32e8a49c6ebe02266795b90 | Update `keras` serializer for `tensorflow.contrib` version (#1067) | distributed/protocol/keras.py | distributed/protocol/keras.py | from __future__ import print_function, division, absolute_import
from .serialize import register_serialization, serialize, deserialize
def serialize_keras_model(model):
import keras
if keras.__version__ < '1.2.0':
raise ImportError("Need Keras >= 1.2.0. "
"Try pip install keras --upgr... | Python | 0 | @@ -997,297 +997,209 @@
l%0A%0A%0A
-register_serialization('keras.engine.training.Model', serialize_keras_model,%0A deserialize_keras_model)%0Aregister_serialization('keras.models.Model', serialize_keras_model,%0A deserialize_keras_model)%0Aregister_serialization('keras.mode... |
a86a06caa36f25adbfd1f499c3eb605a2754e50c | Clean up some attribute signature logic. | django_evolution/signature.py | django_evolution/signature.py | from django.db import router
from django.db.models import get_apps, get_models
from django.db.models.fields.related import ForeignKey
from django.conf import global_settings
from django.contrib.contenttypes import generic
from django.utils.datastructures import SortedDict
from django_evolution.db import EvolutionOpera... | Python | 0 | @@ -1341,28 +1341,12 @@
Key)
-:%0A if
+ and
att
@@ -1372,36 +1372,32 @@
-
default = True%0A
@@ -1399,87 +1399,8 @@
rue%0A
- else:%0A default = ATTRIBUTE_DEFAULTS%5Battrib%5D%0A
|
12caafd3586ac99bf3fa00a3cead8bdf4a0720c8 | Fix operations list to only show record if requested | temba/utils/management/commands/migrate_manual.py | temba/utils/management/commands/migrate_manual.py | from __future__ import unicode_literals
import time
from django.core.management.base import BaseCommand, CommandError
from django.core.management.sql import emit_pre_migrate_signal, emit_post_migrate_signal
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.executor import MigrationExecutor... | Python | 0 | @@ -3246,24 +3246,25 @@
G(%22Operation
+s
to perform:
@@ -3300,21 +3300,16 @@
(%22
-Fake and then
+Manually
app
@@ -3323,24 +3323,113 @@
ation %25s
- offline
+%22 %25 migration)%0A if record:%0A self.stdout.write(%22 Record migration %25s as applied
%22 %25 migr
@@ -3493,15 +3493,14 @@
NG(... |
7fe09a5864f8fceb664e3c0b246b5ec3d22fd266 | Add FixedLengthRecordDatasetV2 to the reader list of tf.contrib.distribute | tensorflow/contrib/distribute/python/input_ops.py | tensorflow/contrib/distribute/python/input_ops.py | # Copyright 2018 The TensorFlow Authors. 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 applica... | Python | 0 | @@ -1287,16 +1287,50 @@
Dataset%22
+,%0A %22FixedLengthRecordDatasetV2%22
%0A%5D%0A%0A%0A# p
|
3c077d82881e3dd51eb0b3906e43f9e038346cb6 | Remove `_allowed_symbols`, this is no longer used by the document generation. | tensorflow_federated/python/core/test/__init__.py | tensorflow_federated/python/core/test/__init__.py | # Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Python | 0 | @@ -1293,266 +1293,4 @@
ion%0A
-%0A# Used by doc generation script.%0A_allowed_symbols = %5B%0A %22ReferenceExecutor%22,%0A %22assert_contains_secure_aggregation%22,%0A %22assert_contains_unsecure_aggregation%22,%0A %22assert_not_contains_secure_aggregation%22,%0A %22assert_not_contains_unsecure_aggrega... |
3cf2b7d3c6cf29587c07651a0739ce374851544d | Add speech types to shakespeare loader. | speeches/management/commands/load_shakespeare.py | speeches/management/commands/load_shakespeare.py | from optparse import make_option
from six.moves.urllib.request import urlopen
import xml.etree.ElementTree as etree
from django.core.management.base import BaseCommand, CommandError
from speeches.models import Section, Speech, Speaker
from instances.models import Instance
PLAYS = {
"all_well.xml": "All's Well Th... | Python | 0.000001 | @@ -4050,18 +4050,36 @@
sp.text
+, type='narrative'
)%0A
-
@@ -4103,25 +4103,17 @@
ontinue%0A
-
%0A
+
@@ -4683,25 +4683,17 @@
stance)%0A
-
%0A
+
@@ -5279,17 +5279,9 @@
ext%0A
-
%0A
+
@@ -5318,24 +5318,24 @@
/p%3E' %25 text%0A
-
@@ -5409... |
2fbd23878f185372c3e46221c3c95918d6cbcffa | Update s3_list.py (#18561) | airflow/providers/amazon/aws/operators/s3_list.py | airflow/providers/amazon/aws/operators/s3_list.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Python | 0 | @@ -3389,9 +3389,8 @@
ter
-%7B
%25s)'
|
0c397eccf0f1cdb7eb08b249f6fb1c70ede13555 | Use the gevent support in pymongo. | simhash_db/mongo_client.py | simhash_db/mongo_client.py | #! /usr/bin/env python
'''Our code to connect to the Riak backend'''
import struct
import pymongo
from . import BaseClient
def unsigned_to_signed(integer):
'''Convert an unsigned integer into a signed integer with the same bits'''
return struct.unpack('!q', struct.pack('!Q', integer))[0]
def signed_to_uns... | Python | 0 | @@ -51,12 +51,15 @@
the
-Riak
+MongoDB
bac
@@ -67,16 +67,62 @@
end'''%0A%0A
+from gevent import monkey%0Amonkey.patch_all()%0A%0A
import s
|
68f9e73d336eb973c72d2ba8332467bf83896c04 | Add additional tests | tests/integration_tests/python/test_collection.py | tests/integration_tests/python/test_collection.py | def test_collections(data_builder, as_admin):
session = data_builder.create_session()
acquisition = data_builder.create_acquisition()
# create collection
r = as_admin.post('/collections', json={
'label': 'SciTran/Testing',
'public': True
})
assert r.ok
collection = r.json()[... | Python | 0 | @@ -40,11 +40,20 @@
dmin
+, as_user
):%0A
-
@@ -252,32 +252,8 @@
ing'
-,%0A 'public': True
%0A
@@ -1073,32 +1073,32 @@
assert r.ok%0A
-
assert colle
@@ -1127,24 +1127,1800 @@
lections'%5D%0A%0A
+%0A ###%0A # Test user only sees sessions/acquisitions they have access to%0A ###%0... |
dbe15ca8727f5475815dd669efe914d0ef64bdfd | Revert "Uses subTest to improve error reports" | tests/journey/test_chamber_of_deputies_dataset.py | tests/journey/test_chamber_of_deputies_dataset.py | import os
import glob
import pandas as pd
from datetime import date
from tempfile import mkdtemp
from shutil import rmtree
from unittest import main, TestCase
from serenata_toolbox.chamber_of_deputies.dataset import Dataset
class TestChamberOfDeputiesDataset(TestCase):
def setUp(self):
self.path = mkdtem... | Python | 0 | @@ -2740,75 +2740,77 @@
-with self.subTest():%0A assert(subquota in all_subquotas
+assert(subquota in all_subquotas)%0A%0Aif __name__ == '__main__':%0A main(
)%0A
|
3cc4b08cdb7e5b014d88dd60cda29bb6756044a3 | Add file extension test to query string match tests | tests/lib/query_models/test_query_string_match.py | tests/lib/query_models/test_query_string_match.py | from positive_test_suite import PositiveTestSuite
from negative_test_suite import NegativeTestSuite
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../lib"))
from query_models import QueryStringMatch
hostname_test_regex = 'hostname: /(.*\.)*(groupa|groupb)\.(.*\.)*subdomain\.(.*\.)*.... | Python | 0 | @@ -317,16 +317,61 @@
.)*.*/'%0A
+filename_matcher = 'summary: /.*%5C.(exe%7Csh)/'%0A
%0A%0Aclass
@@ -1737,32 +1737,179 @@
,%0A %5D,
+%0A%0A QueryStringMatch(filename_matcher): %5B%0A %7B'summary': 'test.exe'%7D,%0A %7B'summary': 'test.sh'%7D,%0A %5D,
... |
6a4c21fc577536e440abd03da0103dd9df2be5e7 | Fix an exception that is raised when creating a media item in Google Photos fails #328 (#329) | elodie/plugins/googlephotos/googlephotos.py | elodie/plugins/googlephotos/googlephotos.py | """
Google Photos plugin object.
This plugin will queue imported photos into the plugin's database file.
Using this plugin should have no impact on performance of importing photos.
In order to upload the photos to Google Photos you need to run the following command.
```
./elodie.py batch
```
That command will ex... | Python | 0.000002 | @@ -6001,48 +6001,24 @@
mat(
-resp%5B'newMediaItemResults'%5D%5B0%5D%5B'status'%5D
+json.dumps(resp)
))%0A
|
aa21197462591a89f527ded3938ffe62f7d8cb8f | update hint_shuffling (#5693) | torchvision/prototype/datasets/utils/_internal.py | torchvision/prototype/datasets/utils/_internal.py | import functools
import pathlib
import pickle
from typing import BinaryIO
from typing import (
Sequence,
Callable,
Union,
Any,
Tuple,
TypeVar,
Iterator,
Dict,
IO,
Sized,
)
from typing import cast
import torch
import torch.distributed as dist
import torch.utils.data
from torchdat... | Python | 0 | @@ -719,16 +719,38 @@
rding%22,%0A
+ %22hint_shuffling%22,%0A
%5D%0A%0AK = T
@@ -6391,23 +6391,8 @@
ipe,
- default=False,
buf
@@ -6401,29 +6401,48 @@
r_size=INFINITE_BUFFER_SIZE)
+.set_shuffle(False)
%0A
|
7a805c52a9dac75c11269892164428c57c3be73c | fix wordcount to use proper column names | examples/CloudantPushWithSpark/wordcount.py | examples/CloudantPushWithSpark/wordcount.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 0.000105 | @@ -2603,16 +2603,36 @@
e(counts
+,%5B'letter', 'count'%5D
)%0A%0A #
@@ -3123,26 +3123,4 @@
p()%0A
- sqlContext.stop()%0A
|
be8077367ddfc6018e2162285497a582156685ec | Update package: add info for emacs@26.1 (#8302) | var/spack/repos/builtin/packages/emacs/package.py | var/spack/repos/builtin/packages/emacs/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0.000025 | @@ -1457,16 +1457,72 @@
ar.gz%22%0A%0A
+ version('26.1', '544d2ab5eb142e9ca69adb023d17bf4b')%0A
vers
@@ -1569,16 +1569,16 @@
dbf58')%0A
-
vers
@@ -2095,24 +2095,47 @@
('ncurses')%0A
+ depends_on('pcre')%0A
depends_
@@ -2467,115 +2467,8 @@
ls')
-%0A depends_on('libxpm %5Egettext+libunistring'... |
79751729c9537f7f5ff4f583d3294e2359b7fb7b | Rename variant static to shared (#6543) | var/spack/repos/builtin/packages/hwloc/package.py | var/spack/repos/builtin/packages/hwloc/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 | @@ -2990,21 +2990,21 @@
riant('s
-tatic
+hared
', defau
@@ -2998,36 +2998,35 @@
hared', default=
-Fals
+Tru
e, description=%22
@@ -3032,21 +3032,21 @@
%22Build s
-tatic
+hared
librari
@@ -3690,21 +3690,21 @@
le-s
-tatic
+hared
%22 if '+s
tati
@@ -3699,21 +3699,21 @@
%22 if '+s
-tatic
+hared
' in spe
@@ -373... |
b2f89f81572dc13bdca5d8740181648d0fa28cb8 | add run dependency to xorg-cf-files (#21251) | var/spack/repos/builtin/packages/imake/package.py | var/spack/repos/builtin/packages/imake/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Imake(AutotoolsPackage, XorgPackage):
"""The imake build system."""
homepage = "http:... | Python | 0 | @@ -544,30 +544,269 @@
on('
-pkgconfig', type='build')
+xorg-cf-files', type='run')%0A depends_on('pkgconfig', type='build')%0A%0A def configure_args(self):%0A args = %5B%5D%0A cfgdir = self.spec%5B'xorg-cf-files'%5D.prefix.lib.X11.config%0A args.append('--with-config-dir=%7B0%7D'.format(cfg... |
1df3d651270035ffb0ffa4e1d5b51bb7b20e9907 | add v1.22-3 (#20890) | var/spack/repos/builtin/packages/r-dtw/package.py | var/spack/repos/builtin/packages/r-dtw/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RDtw(RPackage):
"""A comprehensive implementation of dynamic time warping (DTW) algorithms... | Python | 0.000001 | @@ -242,16 +242,53 @@
%0A %22%22%22
+Dynamic Time Warping Algorithms%0A%0A
A compre
@@ -354,18 +354,19 @@
thms
+ in
%0A
-in
R.
+
DTW
@@ -428,20 +428,16 @@
ment
-%0A
between
poi
@@ -432,16 +432,20 @@
between
+%0A
points
@@ -463,16 +463,358 @@
series.
+ Common DTW variants covered i... |
e879c4176d8940e53fd6b749582ec6da60287060 | add version 0.6-2 to r-gmp (#21028) | var/spack/repos/builtin/packages/r-gmp/package.py | var/spack/repos/builtin/packages/r-gmp/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RGmp(RPackage):
"""Multiple Precision Arithmetic (big integers and rationals, prime
... | Python | 0 | @@ -271,16 +271,51 @@
ithmetic
+%0A%0A Multiple Precision Arithmetic
(big in
@@ -345,22 +345,19 @@
rime
-%0A
number
+%0A
tes
@@ -417,15 +417,8 @@
ons%22
-%0A
usi
@@ -425,16 +425,20 @@
ng the C
+%0A
library
@@ -693,16 +693,112 @@
e/gmp%22%0A%0A
+ version('0.6-2', sha256='6bfcb45b3f... |
26f740b25a2d8a5fcddc67f5a0d1dc18ce2c132b | add new versions (#24443) | var/spack/repos/builtin/packages/sleef/package.py | var/spack/repos/builtin/packages/sleef/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Sleef(CMakePackage):
"""SIMD Library for Evaluating Elementary Functions,
vectorized l... | Python | 0 | @@ -296,20 +296,16 @@
nctions,
-%0A
vectori
@@ -346,16 +346,17 @@
= %22http
+s
://sleef
@@ -435,99 +435,1434 @@
gz%22%0A
-%0A version('3.2', sha256='3130c5966e204e6d6a3ace81e543d12b5b21f60897f1c185bfa587c1bd77bee2')
+ git = %22https://github.com/shibatch/sleef.git%22%0A%0A version('master', bran... |
696071e11f655578ef7c24118d9de26785779ae3 | Update filter_blacklist_hashtag_medias.py | examples/filter_blacklist_hashtag_medias.py | examples/filter_blacklist_hashtag_medias.py | """
instabot filters out the media with your set blacklist hashtags
Workflow:
Try to follow a media with your blacklist hashtag in the
description and see how bot filters it out.
"""
import os
import sys
sys.path.append(os.path.join(sys.path[0], '../'))
from instabot import Bot
blacklist_has... | Python | 0.000002 | @@ -348,38 +348,25 @@
r a
-hashtag you want to filter out
+blacklist hashtag
: %22)
|
fc3e492c25fcaf98ba0f48e01422d339541b8f70 | Add coding for python 2.7 | ynr/apps/ynr_refactoring/helpers/popolo_fields.py | ynr/apps/ynr_refactoring/helpers/popolo_fields.py | """
A helper to move away from SimplePopoloField and ComplexPopoloField
models.
"""
class BaseField():
def __init__(self, *args, **kwargs):
self.required = False
for k, v in kwargs.items():
setattr(self, k, v)
def __str__(self):
return self.name
def __eq__(self, other... | Python | 0.000745 | @@ -1,12 +1,36 @@
+# -*- coding: utf-8 -*-%0A
%22%22%22%0AA helper
|
d9c9ce4227c4b2499c5aae9a8c47057a3d306613 | print() is a function in Python 3 | grumpy-tools-src/grumpy_tools/coverparse.py | grumpy-tools-src/grumpy_tools/coverparse.py | #!/usr/bin/env python
# Copyright 2016 Google Inc. 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... | Python | 0.999999 | @@ -694,16 +694,55 @@
ge.%22%22%22%0A%0A
+from __future__ import print_function%0A%0A
import c
@@ -1522,17 +1522,17 @@
print
-
+(
'%7B%7D:%7B%7D'.
@@ -1555,16 +1555,17 @@
lineno)
+)
%0A%0A%0Aif __
|
c5076b39d0a8c8e1d8f1731ba556642cb65613ce | Update Python tests to add PathPoints to Muscles, since a muscle is invalid without at least two path points. | Bindings/Python/tests/test_access_subcomponents.py | Bindings/Python/tests/test_access_subcomponents.py | """
Test that sockets, inputs, and outputs are functional in python.
"""
import os, unittest
import opensim as osim
test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),
'tests')
# Silence warning messages if mesh (.vtp) files cannot be found.
osim.Model.setDebugLevel(0)
cl... | Python | 0 | @@ -1642,16 +1642,51 @@
.Model()
+%0A ground = model.getGround()
%0A%0A
@@ -1762,139 +1762,493 @@
-millardMuscle = osim.Millard2012EquilibriumMuscle(%22Matt%22, 1, 0.5,%0A 0.5, 0)
+thelenMuscle.addNewPathPoint(%22muscle1-point1%22, ground, os... |
28ce152686cb10f40acf2632766a457477e7008b | remove 32 bit python hack | packages/gtk+3.py | packages/gtk+3.py | class GtkPackage (GnomeXzPackage):
def __init__ (self):
GnomeXzPackage.__init__ (self, 'gtk+', version_major = '3.16', version_minor = '2',
configure_flags = [
'--with-gdktarget=quartz',
'--enable-quartz-backend',
'--enable-debug',
'--enable-static',
'--disable-glibtest',
'--disable-intros... | Python | 0 | @@ -1303,188 +1303,8 @@
g'%5D%0A
-%09%09%09%09# The following will only work with bash according to:%0A%09%09%09%09# http://www.gossamer-threads.com/lists/python/python/30602%0A%09%09%09%09os.environ%5B'VERSIONER_PYTHON_PREFER_32_BIT'%5D = 'yes'%0A
%09%09el
|
00c92c618e778b9891283a699ecc2ea6d7a08510 | Update pango to 1.36.8 | packages/pango.py | packages/pango.py | class PangoPackage (GnomeXzPackage):
def __init__ (self):
GnomePackage.__init__ (self,
'pango',
version_major = '1.35',
version_minor = '0',
configure_flags = [
'--without-x',
'--enable-debug'
]
)
self.sources.extend ([
# 1
# Bug 321419 - Allow environment var substitution in Pango ... | Python | 0 | @@ -51,32 +51,34 @@
(self):%0A%09%09Gnome
+Xz
Package.__init__
@@ -120,17 +120,17 @@
r = '1.3
-5
+6
',%0A%09%09%09ve
@@ -144,17 +144,17 @@
inor = '
-0
+8
',%0A%09%09%09co
|
a26e4f7a5a5605c0e39f2ae54708b60013d08c9a | Split out tag regexp so other modules can reference it | pallium/config.py | pallium/config.py |
try:
import json
except ImportError:
import simplejson as json
import re
import socket
from copy import deepcopy
_STR_RE_VALID_TAG = "^[A-Za-z0-9_\-]+$"
_RE_VALID_TAG = re.compile(_STR_RE_VALID_TAG)
DEFAULT_CONFIG_FILE = "/etc/pallium/config.json"
DEFAULT_CONFIG = {
# gmetad server hostname or IP
"serv... | Python | 0.000001 | @@ -142,9 +142,8 @@
= %22
-%5E
%5BA-Z
@@ -157,10 +157,65 @@
%5C-%5D+
-$
%22
+%0A_STR_RE_VALID_TAG_COMPLETE = %22%5E%25s$%22 %25 _STR_RE_VALID_TAG
%0A_RE
@@ -255,16 +255,25 @@
ALID_TAG
+_COMPLETE
)%0A%0ADEFAU
|
5a3672eb16ea57b0757526966b496d71693743ec | Update get_stock() docstring. | pandas_finance.py | pandas_finance.py | #!/usr/bin/env python
import datetime
import scraperwiki
import numpy
import pandas.io.data as web
def get_stock(stock, start, end, service):
"""
Return data frame of finance data for stock.
Takes start and end datetimes.
"""
return web.DataReader(stock, service, start, end)
def parse_finance_... | Python | 0 | @@ -221,32 +221,73 @@
nd end datetimes
+, and service name of 'google' or 'yahoo'
.%0A %22%22%22%0A re
|
a14e4c0c760aef592789412d3e72940defbac140 | Fix bug reported by yoavglazner@gmail.com and tracked in issue #35 | pika/heartbeat.py | pika/heartbeat.py | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distri... | Python | 0 | @@ -4268,16 +4268,17 @@
nection.
+_
send_fra
|
53617b562b5aeb8daef3f2808a3d177c14f88f4b | Bump to version 1.1.12 | pilkit/pkgmeta.py | pilkit/pkgmeta.py | __title__ = 'pilkit'
__author__ = 'Matthew Tretter'
__version__ = '1.1.11'
__license__ = 'BSD'
__all__ = ['__title__', '__author__', '__version__', '__license__']
| Python | 0 | @@ -65,17 +65,17 @@
= '1.1.1
-1
+2
'%0A__lice
|
27f447178b5313ff16a371e4d313ec88b4ff18f1 | add missing multi-arch tags | pip/pep425tags.py | pip/pep425tags.py | """Generate and work with PEP 425 Compatibility Tags."""
import re
import sys
import warnings
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
_osx_arch_pat = re.compile(r'(.+)_(\d+)_(\d+)_(.+)')
def get_abbr_impl()... | Python | 0.000002 | @@ -2221,21 +2221,22 @@
sx-10.9-
-intel
+x86_64
%0A
@@ -2455,65 +2455,379 @@
', '
-x86_64'):%0A actual_arches.append('intel
+ppc'):%0A actual_arches.append('fat')%0A if actual_arch in ('i386', 'x86_64'):%0A actual_arches.append('intel')%0... |
9a1e6ebe4f02327fdc19ddd52fb1b835a39188c0 | Fix pylint violation | planex/install.py | planex/install.py | #!/usr/bin/env python
"""
Installs packages built from the specs in <component-specs-dir>.
"""
import sys
import os
import glob
import subprocess
import shutil
import argparse
from collections import namedtuple
import json
from planex.globals import RPMS_DIR
CONFIG = "install.json"
ExecutionResult = namedtuple(... | Python | 0.000067 | @@ -3876,16 +3876,25 @@
o_rpm =
+rpms_dir.
build_ma
@@ -3895,24 +3895,16 @@
ild_map(
-RPMS_DIR
)%0A%0A f
|
07b193353115b7c144e8986d0621a0dee9da440b | Fix py35 gate | oslo_messaging/tests/functional/zmq/test_startup.py | oslo_messaging/tests/functional/zmq/test_startup.py | # Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 0.000002 | @@ -1129,16 +1129,17 @@
path, %22w
+b
%22, buffe
|
7b81e6c24f18f93a3f861d090d87cbb1cc66a1f1 | fix bootstrap on docker | packages/exhibitor/extra/bootstrap_exhibitor_tls.py | packages/exhibitor/extra/bootstrap_exhibitor_tls.py | #!/opt/mesosphere/bin/python
import os
import socket
import subprocess
import sys
from pathlib import Path
TLS_ARTIFACT_LOCATION = '/var/lib/dcos/exhibitor-tls-artifacts'
CSR_SERVICE_CERT_PATH = '/tmp/root-cert.pem'
PRESHAREDKEY_LOCATION = '/root/.dcoscertstrap_psk'
EXHIBITOR_TLS_TMP_DIR = '/var/lib/dcos/exhibitor/.p... | Python | 0.000001 | @@ -101,16 +101,51 @@
rt Path%0A
+from urllib.parse import urlparse%0A%0A
%0ATLS_ART
@@ -1140,604 +1140,140 @@
-try:%0A protocol, url = bootstrap_url.split('://')%0A except ValueError as exc:%0A message = (%0A 'Failed to calculate %60exhibitor_bootstrap_ca_url%60 from... |
44af5dbd8cabab8f8c1c3b0f689ebe9ba45b4486 | Remove test database rename | core/settings.py | core/settings.py | """
Django settings for billjobs project.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | Python | 0.000001 | @@ -495,77 +495,8 @@
3',%0A
- 'TEST': %7B%0A 'NAME': 'tests.sqlite3'%0A %7D,%0A
|
7e45baa3e2b372d5a81dce656781879c0408bcc1 | Fix overlapping text | doc/examples/plot_equalize.py | doc/examples/plot_equalize.py | """
======================
Histogram Equalization
======================
This examples enhances an image with low contrast, using a method called
*histogram equalization*, which "spreads out the most frequent intensity
values" in an image [1]_. The equalized image has a roughly linear cumulative
distribution function.... | Python | 1 | @@ -719,16 +719,35 @@
htm%0A%0A%22%22%22
+%0A%0Aimport matplotlib
%0Aimport
@@ -861,16 +861,55 @@
osure%0A%0A%0A
+matplotlib.rcParams%5B'font.size'%5D = 8%0A%0A%0A
def plot
@@ -2042,19 +2042,31 @@
ubplots(
-2,
+nrows=2, ncols=
4, figsi
@@ -2072,17 +2072,17 @@
ize=(8,
-4
+5
))%0A%0Aax_i
|
0611d3452d5f752e28bbcb39452a7433bfb4eb5d | remove unused import | chipy_org/urls.py | chipy_org/urls.py | from django.conf import settings
from django.conf.urls import patterns, url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.generic import TemplateView
from chipy_org.apps.contact.views import ChipyContactView
from chipy_org.apps.meetings.... | Python | 0.000001 | @@ -58,18 +58,8 @@
port
- patterns,
url
|
0f8e2337556832889b400b8f570390eca0a51817 | Update license metadata | astroid/__pkginfo__.py | astroid/__pkginfo__.py | # Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2017 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2015 Florian Bruhin <me@the-compiler.org>
# Copyright (c) 2015 Radosław Ga... | Python | 0 | @@ -1746,16 +1746,29 @@
= %22LGPL
+-2.1-or-later
%22%0A%0Aautho
|
c8a60892c7ce1540e0b838b66ef038ef1f2526a7 | Change tell method for skopt (#1055) | pkg/suggestion/v1alpha3/skopt/base_skopt_service.py | pkg/suggestion/v1alpha3/skopt/base_skopt_service.py | import json
import numpy as np
import skopt
import logging
from pkg.suggestion.v1alpha3.internal.search_space import *
from pkg.suggestion.v1alpha3.internal.trial import *
logger = logging.getLogger("BaseSkoptService")
class BaseSkoptService(object):
"""
Refer to https://github.com/scikit-optimize/scikit-op... | Python | 0 | @@ -2226,24 +2226,81 @@
dom_state)%0A%0A
+ skopt_suggested = %5B%5D%0A loss_for_skopt = %5B%5D%0A
for
@@ -2324,39 +2324,40 @@
-skopt_suggested
+trial_assignment
= %5B%5D%0A
@@ -2689,39 +2689,40 @@
-skopt_suggested
+trial_assignment
.append(int(
@@ -2798,39 +... |
ced3b9ab9f9a78acec10b2c0f6527659e9956398 | Use Django's copy of six | haystack/management/commands/clear_index.py | haystack/management/commands/clear_index.py | from __future__ import print_function
from __future__ import unicode_literals
from optparse import make_option
import sys
import six
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Clears out the search index completely."
base_options = (
make_option('--noinput... | Python | 0 | @@ -118,19 +118,8 @@
sys
-%0Aimport six
%0A%0Afr
@@ -168,16 +168,45 @@
Command%0A
+from django.utils import six%0A
%0A%0Aclass
|
e128bc274324e9709a1a918a0a76f8f283c3fdce | Rename class CampfireRoom to Room | camplight.py | camplight.py | """
Campfire API implementation in Python
The API is described at http://developer.37signals.com/campfire/index
"""
__author__ = 'Mathias Lafeldt <mathias.lafeldt@gmail.com>'
__data__ = ['Campfire', 'CampfireRoom']
import urllib2
import simplejson as json
def json_encode(obj={}):
return json.dumps(obj)
def jso... | Python | 0.001785 | @@ -195,24 +195,16 @@
fire', '
-Campfire
Room'%5D%0A%0A
@@ -1774,24 +1774,16 @@
return
-Campfire
Room(sel
@@ -2034,24 +2034,16 @@
%0A%0Aclass
-Campfire
Room(obj
|
f1692c32120d2eb4859f5a6aae35ae5cce4ac134 | Update codeLines.py | Src/codeLines.py | Src/codeLines.py | import os
import re
def main():
fileList = os.listdir()
currentDir = os.getcwd()
print('{}目录下共有{}个文件'.format(currentDir,len(fileList)))
countFileType(fileList)
#统计各种类型文件的数目
def countFileType(lis):
#print('debug0')
d = dict()
d2 = dict()
for num in range(len(lis)):
#print('debug... | Python | 0.000001 | @@ -1395,16 +1395,17 @@
urn 'unk
+n
own'%0A
|
84b569bd6f30d23547593f7a38d77145b25b20e7 | add setting, but doesn't seem to work | src/python/expedient/clearinghouse/commands/management/commands/bootstrap_local_settings.py | src/python/expedient/clearinghouse/commands/management/commands/bootstrap_local_settings.py | '''Command to bootstrap local settings with None values.
Created on Aug 24, 2010
@author: jnaous
'''
from optparse import make_option
import pkg_resources
import os
from django.core.management.base import NoArgsCommand
from django.conf import settings
from expedient.clearinghouse.commands.utils import bootstrap_local... | Python | 0.000001 | @@ -828,16 +828,58 @@
y file%22%0A
+ requires_model_validation = False%0A
%0A def
|
188d6f7884b372fa0bc21f938dae9da386795da7 | Bump release | octave_kernel/__init__.py | octave_kernel/__init__.py | """An Octave kernel for Jupyter"""
__version__ = '0.19.6'
| Python | 0 | @@ -53,7 +53,7 @@
.19.
-6
+7
'%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.