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 |
|---|---|---|---|---|---|---|---|
31e4da5e782c29d7d0c893a3fc9af48260c50a3a | Save form data to DB on each step | src/ansible/views.py | src/ansible/views.py | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from formtools.wizard.views import SessionWizardView
from ansible.models import Github
def index(request):
return HttpResponse("200")
class PlaybookWizard(SessionWizardView):
def get_form_initial(... | Python | 0 | @@ -193,16 +193,38 @@
t Github
+, Playbook%0Aimport sys%0A
%0A%0Adef in
@@ -269,16 +269,17 @@
%22200%22)%0A%0A
+%0A
class Pl
@@ -624,119 +624,630 @@
def
-done(self, form_list, **kwargs):%0A
+get_form_step_data(self, form):%0A data = %7B%7D%0A if self.get_form_prefix() == '0':%0A gi... |
09726db0fc453cb1ebc7b0cf91d7e8dd5917bcf3 | Update wsgi/myflaskapp.py | wsgi/myflaskapp.py | wsgi/myflaskapp.py | from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
| Python | 0 | @@ -1,8 +1,18 @@
+import os%0A
from fla
@@ -31,84 +31,2571 @@
ask%0A
-app = Flask(__name__)%0A%0A@app.route(%22/%22)%0Adef hello():%0A return %22Hello World!
+from flask import request%0Aimport pymongo%0Aimport json%0Afrom bson import json_util%0Afrom bson import objectid%0Aimport re%0A%0Aapp = Flask(__name__)%0A#... |
39a06577a4909c1aed9a814f8bd7a9c1cfe14436 | Modify the get_translation function to return only the translated word from the dictionary returned by yandex, which consists of code, lang and text | modules/preprocessor/yandex_api.py | modules/preprocessor/yandex_api.py | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
Utilise Yandex Translation Service.
Obtain bilingual semantic human score.
"""
import os
import json
import codecs
import requests
def get_valid_translation(word):
tr_word_2=get_translation(word)
if len(tr_word_2.split()>1):
tr_word_2 = None
re... | Python | 0.000001 | @@ -598,16 +598,27 @@
s).text)
+%5B%22text%22%5D%5B0%5D
%0A%0Adef ya
@@ -1248,27 +1248,16 @@
(word_2)
-%5B%22text%22%5D%5B0%5D
%0A%0A
|
0b3e4c30bcab848ba451929ceffd86d5ab67baac | Remove old plack intra test on port 8082 | docker-wait_until_ready.py | docker-wait_until_ready.py | #!/usr/bin/env python
from __future__ import print_function
# Script to test sanity of koha docker container
# Verifies that Koha OPAC, Intra and SIP Server are reachable
import socket, requests, time, sys
def validateArguments():
if ((len(sys.argv) > 4)):
printUsage()
sys.exit(1)
if ((len(sys.argv) >= 2)):
... | Python | 0 | @@ -2512,52 +2512,8 @@
81%22%0A
-plack_intra_url = %22http://localhost:8082%22%0A
sip_
@@ -2652,59 +2652,8 @@
rl)%0A
-print(%22INFO: plack_intra_url:%5Ct%22, plack_intra_url)%0A
prin
@@ -3096,183 +3096,8 @@
1%0A%0A
-if (kohaStatusCode(plack_intra_url, sleepPeriod, retryPeriod) == 200):%0A%09print(%22INFO: Plack... |
c337711817dec57da8dbf86477665771e877ccd3 | Update index before trying to stash | sgit/stash.py | sgit/stash.py | # coding: utf-8
import time
import sublime
from sublime_plugin import WindowCommand
from .util import noop
from .cmd import GitCmd
from .helpers import GitStashHelper, GitErrorHelper
class GitStashWindowCmd(GitCmd, GitStashHelper, GitErrorHelper):
def pop_or_apply_from_panel(self, action):
repo = self.... | Python | 0 | @@ -1718,16 +1718,112 @@
True%7D)%0A%0A
+ # update the index%0A self.git_exit_code(%5B'update-index', '--refresh'%5D, cwd=repo)%0A%0A
|
f34d0f0e90542ea6fa7066aaf3b8a47b6373565f | version bump for dev | dog_whistle/__version__.py | dog_whistle/__version__.py | __version__ = '0.4.0'
VERSION = tuple(int(x) for x in __version__.split('.'))
| Python | 0 | @@ -14,9 +14,9 @@
'0.
-4
+5
.0'%0A
|
737234eec4a0c043e064c5c238339a90e52e0dc9 | Revert "Made import relative in __main__.py" | multisieve_coreference/__main__.py | multisieve_coreference/__main__.py | from . import resolve_coreference
resolve_coreference.main()
| Python | 0 | @@ -1,14 +1,35 @@
from
-.
+multisieve_coreference
import
|
c5cad64c24acb8492e3afa7b35d689f1829d1c44 | initialize package bundle if not done | engine/src/juliabox/plugins/vol_defpkg/defpkg.py | engine/src/juliabox/plugins/vol_defpkg/defpkg.py | import os
import sh
import threading
import tarfile
from juliabox.jbox_util import ensure_delete, make_sure_path_exists, JBoxCfg
from juliabox.vol import JBoxVol
from juliabox.interactive import SessContainer
class JBoxDefaultPackagesVol(JBoxVol):
provides = [JBoxVol.JBP_PKGBUNDLE]
FS_LOC = None
LOCK = ... | Python | 0.000001 | @@ -2037,32 +2037,248 @@
s%22, user_email)%0A
+ if JBoxDefaultPackagesVol.FS_LOC is None:%0A JBoxDefaultPackagesVol.configure()%0A if JBoxDefaultPackagesVol.CURRENT_BUNDLE is None:%0A JBoxDefaultPackagesVol.refresh_user_home_image()%0A
disk_pat
|
6b204746356bf38abf563674e452aead682e4f5f | Add -k option to only print api-key | st2client/st2client/commands/auth.py | st2client/st2client/commands/auth.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | Python | 0.000001 | @@ -4962,16 +4962,243 @@
ault=%7B%7D)
+%0A self.parser.add_argument('-k', '--only-key', action='store_true', dest='only_key',%0A default=False,%0A help='Only print API Key to the console on creation.')
%0A%0A @r
@@ -5735,140 +5735,8 @@
.')%0A
... |
30a646be24064fbc678f5f3eebbd628e738a192c | Replace NA values with 0.0 where appropriate | pudl/transform/epacems.py | pudl/transform/epacems.py |
"""Routines specific to cleaning up EPA CEMS hourly data."""
import pandas as pd
import numpy as np
###############################################################################
###############################################################################
# DATATABLE TRANSFORM FUNCTIONS
#########################... | Python | 0 | @@ -5596,16 +5596,64 @@
raw_df
+.fillna(%7B'gross_load_mw': 0.0%7D)%0A
.pipe(ad
|
03c4323cf13365204540cf9d06ead88a6a3925b7 | work around script reloading bug in redis-py | sixpack/db.py | sixpack/db.py | import redis
from config import CONFIG as cfg
REDIS = redis.StrictRedis(host=cfg.get('redis_host'), port=cfg.get('redis_port'), db=cfg.get('redis_db'))
DEFAULT_PREFIX = cfg.get('redis_prefix')
def _key(k):
return "{0}:{1}".format(DEFAULT_PREFIX, k)
monotonic_zadd = REDIS.register_script("""
local sequential... | Python | 0 | @@ -15,62 +15,342 @@
rom
-config import CONFIG as cfg%0A%0AREDIS = redis.StrictRedis
+redis.connection import ConnectionPool, PythonParser%0A%0Afrom config import CONFIG as cfg%0A%0A# Because of a bug (https://github.com/andymccurdy/redis-py/issues/318) with%0A# script reloading in %60redis-py, we need to force the %... |
02c39c4ad9c16b1edae7ff9bfc02a10a7d7cf408 | Add more tests. | comtypes/test/test_createwrappers.py | comtypes/test/test_createwrappers.py | import glob
import os
import unittest
import warnings
import comtypes.typeinfo
import comtypes.client
import comtypes.client._generate
from comtypes.test import requires
requires("typelibs")
# filter warnings about interfaces without a base interface; they will
# be skipped in the code generation.
warnings.filterwarn... | Python | 0.000001 | @@ -610,16 +610,54 @@
em32%22)%0A%0A
+progdir = os.environ%5B%22ProgramFiles%22%5D%0A%0A
# This t
@@ -841,32 +841,107 @@
ef setUp(self):%0A
+ %22Do not write the generated files into the comtypes.gen directory%22%0A
comtypes
@@ -1537,32 +1537,238 @@
dd_test(fname)%0A%0A
+for fname in glob.glob(os.pa... |
0a6a0c422cdffe668bec2a9420d9bdd32182a0d8 | use cache if dest exists | zuul/lib/cloner.py | zuul/lib/cloner.py | # Copyright 2014 Antoine "hashar" Musso
# Copyright 2014 Wikimedia Foundation 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
#
# Unle... | Python | 0.000185 | @@ -2559,32 +2559,100 @@
t_url, project)%0A
+ repo_is_cloned = os.path.exists(os.path.join(dest, '.git'))%0A
if (self
@@ -2662,24 +2662,24 @@
che_dir and%0A
-
@@ -2728,28 +2728,22 @@
not
-os.path.exists(dest)
+repo_is_cloned
):%0A
|
b0421ab7cca69862bcacf7922cd1d37276dfdbe3 | convert doctype log settings db.sql calls | frappe/core/doctype/log_settings/log_settings.py | frappe/core/doctype/log_settings/log_settings.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
from frappe.model.document import Document
class LogSettings(Document):
def clear_logs(self):
self.clear_error_logs()
self.clear_activity_logs()
self.clear_email_que... | Python | 0.001157 | @@ -1115,76 +1115,57 @@
ppe.
-db.sql_list(%22select name from %60tabError Log%60 where seen = 0
+get_all(%22Error Log%22, filters=%7B%22seen%22: 0%7D,
limit
- 1%22
+=1
):%0A%09
|
b738606e3620fcfe4edeb6b5b409f46ab0d97c55 | Fix port notification update in L3 plugin | gbpservice/neutron/services/l3_router/l3_apic.py | gbpservice/neutron/services/l3_router/l3_apic.py | # Copyright (c) 2015 Cisco Systems 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 re... | Python | 0.000001 | @@ -4556,35 +4556,26 @@
date(port_id
-, context
)%0A
+
retu
@@ -4951,25 +4951,16 @@
update(p
-, context
)%0A
@@ -5224,25 +5224,16 @@
(port_id
-, context
)%0A
@@ -5536,22 +5536,8 @@
t_id
-, context=None
):%0A
@@ -5556,19 +5556,8 @@
xt =
- context or
n_c
@@ -5742,32 +5742,56 @@
ntext, po... |
20532fefa53dced8c15564e377fde52bb3c443c0 | fix 500 errors on user role…request does not have the attr user | corehq/apps/accounting/decorators.py | corehq/apps/accounting/decorators.py | import json
from corehq import toggles
from corehq.apps.accounting.models import BillingAccountAdmin
from django.contrib import messages
from django.http import Http404, HttpResponse
from django_prbac.decorators import requires_privilege
from django_prbac.exceptions import PermissionDenied
import toggle
def require_b... | Python | 0 | @@ -1438,16 +1438,66 @@
if
+(hasattr(request, 'user')%0A and
toggle.s
@@ -1570,16 +1570,17 @@
sername)
+)
:%0A
|
c99db48154ed327aead8a56211ac5125529f8ea0 | Change merge_and_count to accept 2 array arguments | count-inversions/count_inversions.py | count-inversions/count_inversions.py | from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return 0
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr):
return 0
def main(arr_len):
test_a... | Python | 0 | @@ -269,24 +269,31 @@
nt_split(arr
+1, arr2
):%0A%09return 0
|
0d331f5bd81f25bc92a20da6ed8d99f0c393efb2 | remove redundant adodbapi warning (#19557) | superset/db_engine_specs/__init__.py | superset/db_engine_specs/__init__.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 u... | Python | 0 | @@ -4166,32 +4166,262 @@
DefaultDialect)%0A
+ # adodbapi dialect is removed in SQLA 1.4 and doesn't implement the%0A # %60dbapi%60 method, hence needs to be ignored to avoid logging a warning%0A and attribute.dialect.driver != %22adodbapi%22%0A
):%0A
|
df1b2ad504d422247ac27f551810ab463eaea86e | add changelog to the admin | crate_project/apps/packages/admin.py | crate_project/apps/packages/admin.py | from django.contrib import admin
from packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI
from packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI
from packages.tasks import save_releases
def releases_save(modeladmin, request, queryset):
save_releases.... | Python | 0 | @@ -197,24 +197,35 @@
, ReleaseURI
+, ChangeLog
%0Afrom packag
@@ -2109,16 +2109,262 @@
ase%22%5D%0A%0A%0A
+class ChangeLogAdmin(admin.ModelAdmin):%0A list_display = %5B%22package%22, %22release%22, %22type%22, %22created%22, %22modified%22%5D%0A list_filter = %5B%22type%22, %22created%22, %22modified%22%5D%0A... |
83de7622a497231d2c47c3ac9b83205b25243cfb | fix sort | crowdsourcing/serializers/message.py | crowdsourcing/serializers/message.py | from crowdsourcing import models
from rest_framework import serializers
from django.contrib.auth.models import User
from django.db.models import Q
from crowdsourcing.serializers.dynamic import DynamicFieldsModelSerializer
from crowdsourcing.models import Conversation, Message, ConversationRecipient, UserMessage
from cr... | Python | 0.000013 | @@ -3243,16 +3243,34 @@
user))%0A%0A
+ @staticmethod%0A
def
@@ -3286,22 +3286,16 @@
message(
-self,
obj):%0A
@@ -3357,16 +3357,17 @@
der_by('
+-
created_
|
d91371815d2b8256997eec90aead17425577bc32 | indent the "missing files" list | cs251tk/lib/format_collected_data.py | cs251tk/lib/format_collected_data.py | from textwrap import dedent, indent
import traceback
for_github = False
def em(string):
return '**' + string + '**'
def code(string):
return '`' + string + '`'
def identify_type(filename):
ext = filename.split('.')[-1]
if ext == filename:
return 'text'
elif ext in ['C', 'H', 'cpp', 'hp... | Python | 0.999442 | @@ -2142,16 +2142,23 @@
sting =
+indent(
'%5Cn'.joi
@@ -2192,16 +2192,24 @@
s', %5B%5D))
+, ' '*4)
%0A
|
5863e4bee03751a5d46277c220d6d3bdea4c38c4 | Remove as_matrix following @wkerzendorf | tardis/montecarlo/formal_integral.py | tardis/montecarlo/formal_integral.py | import warnings
import numpy as np
import pandas as pd
from astropy import units as u
from astropy import constants as const
from tardis.montecarlo.montecarlo import formal_integral
from tardis.montecarlo.spectrum import TARDISSpectrum
class IntegrationError(Exception):
pass
class FormalIntegrator(object):
... | Python | 0.999905 | @@ -5184,27 +5184,22 @@
values%5D.
-as_matrix()
+values
%0A%0A
|
553f3a3a1a72f0f0ba60f739fce5d6b22f23cb22 | fix xpath of yandex | searx/engines/yandex.py | searx/engines/yandex.py | """
Yahoo (Web)
@website https://yandex.ru/
@provide-api ?
@using-api no
@results HTML (using search portal)
@stable no (HTML can change)
@parse url, title, content
"""
from urllib import urlencode
from lxml import html
from searx.search import logger
logger = logger.getChild('yandex engi... | Python | 0.000032 | @@ -634,19 +634,18 @@
th = '//
-div
+li
%5B@class=
@@ -658,43 +658,8 @@
item
- serp-item_plain_yes clearfix i-bem
%22%5D'%0A
@@ -750,25 +750,67 @@
@class=%22
-serp-item
+text-container typo typo_text_m typo_line_m organic
__text%22%5D
|
6f01543f7a865a204fc4a4bb8d2f1c5d97ac3984 | converting to patric seed | servers/servers.py | servers/servers.py | '''
A python implementation of the Annotation server, Anno server.
Written by Rob Edwards, Daniel Cuevas, and Genivaldo Gueiros
'''
#Note: this requires requests. See http://www.python-requests.org
# requests is now often installed directly
import requests
import sys
import json
class server:
def __init__(se... | Python | 0.999989 | @@ -370,32 +370,33 @@
r.org/'%0A
+#
self.urlbase = '
@@ -424,33 +424,32 @@
d.org/'%0A
-#
self.urlbase = '
@@ -506,32 +506,33 @@
= None%0A
+#
self.urlcgi = '
@@ -544,16 +544,56 @@
er.cgi'%0A
+ self.urlcgi = '/sap_server.cgi'%0A
@@ -2164,16 +2164,58 @@
rlbase +
+ self.ur... |
6957979016807b900095cbef7d18876e29765ef2 | Update last.fm to the new API spec | services/lastfm.py | services/lastfm.py | import flask
import hashlib
import itertools
import requests
from xml.dom import minidom
import foauth.providers
class LastFM(foauth.providers.OAuth2):
# General info about the provider
name = 'last.fm'
provider_url = 'http://last.fm/'
docs_url = 'http://www.last.fm/api/intro'
category = 'Music'
... | Python | 0 | @@ -1612,19 +1612,57 @@
in, path
+, method='GET', params=None, data=None
):%0A
-
@@ -1807,30 +1807,16 @@
request(
-flask.request.
method,
@@ -1834,145 +1834,77 @@
uth,
-%0A params=flask.request.args,%0A data=flask.request.form or flask.reques... |
e470b3bfa560a5e19ed259278c1e4c9d96d2a5cb | Fix dropping series with ' in name | shana_interface.py | shana_interface.py | from requests import session
from lxml import html as lxmlhtml
from urllib.parse import urljoin
# defines several methods for interacting with your shanaproject mylist because there is no official api.
class ShanaLink:
LOGIN_URL = 'https://www.shanaproject.com/login/'
LIST_URL = 'http://www.shanaproject.com/fo... | Python | 0.000021 | @@ -2087,62 +2087,8 @@
ef%22%0A
- print('dropping series matching:',match_name)%0A
|
71ba73af5b2d9a54f340be901199f4facc2617a6 | Update build_sdk.py | scripts/build_sdk.py | scripts/build_sdk.py | #!/usr/bin/python
import os, sys
from scripting_utils import *
import build_sdk_android as android
import build_sdk_ios as ios
import build_sdk_windows as windows
set_log_tag('BUILD-SDK')
if __name__ != "__main__":
error('Error. Do not import this script, but run it explicitly.')
exit()
# -----... | Python | 0.000001 | @@ -467,10 +467,10 @@
%5D %5Bo
-t
p
+t
iona
|
aa026fb39bd4a053766988383e9374dba20fd7f5 | Use symlinks to avoid weird behavior from removing the CWD while we're in it | scripts/init_tree.py | scripts/init_tree.py | import os
import shutil
def main():
cwd = os.getcwd()
if not cwd.endswith(os.path.join('FRENSIE', 'scripts')):
print 'This script must be run in \"FRENSIE/scipts\"'
return 1
os.chdir('../../')
os.mkdir('frensie_build_tree')
os.renames('FRENSIE', 'frensie_build_tree/FRENSIE')
... | Python | 0 | @@ -175,16 +175,49 @@
ipts%5C%22'%0A
+ print 'Your CWD is', cwd%0A
@@ -225,16 +225,16 @@
eturn 1%0A
-
%0A
@@ -292,16 +292,17 @@
e')%0A
+#
os.renam
@@ -345,16 +345,89 @@
ENSIE')%0A
+ os.symlink(os.path.abspath('FRENSIE'), 'frensie_build_tree/FRENSIE')%0A
os.c
@@ -583,16 +583,24 ... |
6e764cf0a4185adbc543683f2781665d1f7fbd48 | fix on preloading new job page with "undefined" git hash | dashboard/dashboard/pinpoint/handlers/commits.py | dashboard/dashboard/pinpoint/handlers/commits.py | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from dashboard.api import api_request_handler
f... | Python | 0.000047 | @@ -266,16 +266,32 @@
import%0A%0A
+import logging%0A%0A
from das
@@ -718,24 +718,348 @@
'chromium')%0A
+ # crbug/1363418: workaround when start_git_hash is 'undefined'%0A start_git_hash = flask_request.args.get('start_git_hash')%0A if start_git_hash == 'undefined':%0A logging.warning(%0A ... |
116e271c2847b925e9891305e1300dfebe860e8b | Make dooblr actually run under py3. | dooblr/config.py | dooblr/config.py | import logging
import os.path
import yaml
DEFAULT_CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".dooblr", "measurements")
DEFUALT_MAIN_CONFIG = {
"global": {
"config-dir": DEFAULT_CONFIG_DIR,
},
"mqtt": {
"host": "localhost",
"port": 1883,
},
"influxdb": {
"hos... | Python | 0 | @@ -1070,32 +1070,24 @@
self._parse(
-unicode(
config_file.
@@ -1085,33 +1085,32 @@
fig_file.read())
-)
%0A%0A def _parse
@@ -2573,16 +2573,8 @@
rse(
-unicode(
conf
@@ -2588,17 +2588,16 @@
.read())
-)
%0A%0A de
|
a0d600d8da7e80c33043f9620603ce77c8897615 | Allow up to 100kb of data to retrieve | dasbit/plugin/urilookup.py | dasbit/plugin/urilookup.py | import re
import os
import lxml.html
from urllib import urlencode
import treq
from twisted.internet.defer import Deferred
from twisted.web.client import getPage
from twisted.web.client import ResponseDone
from twisted.web.http import PotentialDataLoss
from twisted.internet.protocol import Protocol
from dasbit.core impo... | Python | 0.000003 | @@ -3494,16 +3494,17 @@
first 10
+0
kb shoul
@@ -3816,16 +3816,21 @@
e %3E 1024
+ * 10
0:%0A
|
33a52bc2c66d4a2462da7b6579a1859de7940d01 | Correct download link. Adresses #9 | download_data.py | download_data.py | """Download data relevant to train the KittiSeg model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import sys
import os
import subprocess
import zipfile
from six.moves import urllib
from shutil import copy2
import argparse
logging.... | Python | 0.000013 | @@ -3667,36 +3667,46 @@
d.php?file=data_
-road
+object_image_2
.zip%22%0A
|
cd014901a4453cda1576b2f10ee3fc6235b8c5e5 | update for 1.7 | dpkt/__init__.py | dpkt/__init__.py | # $Id$
"""fast, simple packet creation and parsing."""
__author__ = 'Dug Song <dugsong@monkey.org>'
__copyright__ = 'Copyright (c) 2004 Dug Song'
__license__ = 'BSD'
__url__ = 'http://monkey.org/~dugsong/dpkt/'
__version__ = '1.6'
from dpkt import *
import ah
import aim
import arp
import asn1
import bgp
import cdp
... | Python | 0 | @@ -183,32 +183,27 @@
p://
-monkey.org/~dugsong/dpkt
+dpkt.googlecode.com
/'%0A_
@@ -218,17 +218,17 @@
__ = '1.
-6
+7
'%0A%0Afrom
|
60ad3acbbce1afa2d8fe8775b0c040db62ada7cc | Version bump | ella/__init__.py | ella/__init__.py | VERSION = (3, 0, 3)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
| Python | 0.000001 | @@ -10,17 +10,17 @@
(3, 0,
-3
+4
)%0A%0A__ver
|
0b5675c8940b5b4ffe0e758432c2c724e54f685e | add background and mouse responder methods | ObjectWrapper/GlyphsApp/UI/CanvasView.py | ObjectWrapper/GlyphsApp/UI/CanvasView.py | # -*- coding: utf-8 -*-
from __future__ import print_function
__all__ = ["CanvasView"]
import traceback
from vanilla import Group
from AppKit import NSView
class CanvasView_view(NSView):
def drawRect_(self, rect):
try:
if self._delegate != None:
self._delegate.draw(self)
except:
print(traceback.fo... | Python | 0 | @@ -151,17 +151,38 @@
t NSView
+, NSRectFill, NSColor
%0A
-
%0A%0Aclass
@@ -243,16 +243,110 @@
%0A%09%09try:%0A
+%09%09%09if self._backgroundColor is not None:%0A%09%09%09%09self._backgroundColor.set()%0A%09%09%09%09NSRectFill(rect)%0A
%09%09%09if se
@@ -439,16 +439,580 @@
t_exc())
+%0A%09def mouseDown_(self, ev... |
edb2bfb45c069a1b83f1e9a82c64e2910c4d1fda | add help and show version. | rename_tool.py | rename_tool.py | #!/usr/bin/env python
# encoding:utf-8
"""
A Simple Rename Tool.
version: 0.2
"""
import os
import sys
import getopt
opts = None
args = None
fileList = None
dir = None
def init():
"""
Init and get arguments.
"""
global opts
global args
try:
#dir = sys.argv[1]
opts, args... | Python | 0 | @@ -64,21 +64,8 @@
ol.%0A
-version: 0.2%0A
%22%22%22%0A
@@ -101,16 +101,31 @@
getopt%0A%0A
+version = 0.2%0A%0A
opts = N
@@ -269,39 +269,30 @@
-try:%0A #dir = sys.argv%5B1%5D
+# get options%0A try:
%0A
@@ -342,19 +342,34 @@
%5D, %22
-d:
+hv
%22, %5B%22
-dir=
+--help%22, %22--version
%22%5D)%0... |
c3c8a0506f5c26265cb2bab6cf664d022d56c7ed | fix typo in repair test | repair_test.py | repair_test.py | import time, re
from dtest import Tester
from tools import *
class TestRepair(Tester):
def check_rows_on_node(self, node_to_check, rows, found=[], missings=[], restart=True):
stopped_nodes = []
for node in self.cluster.nodes.values():
if node.is_running() and node is not node_to_check:... | Python | 0.000807 | @@ -690,16 +690,185 @@
ssings:%0A
+ if self.cluster.version() %3E= '1.2':%0A cursor.execute('SELECT c1, c2 FROM cf WHERE key=k%25d' %25 k, consistency_level='ONE')%0A else:%0A
|
1ba11c9a60399d7a103a04ce7f851396258d3918 | Fix spelling in pupa init's template | pupa/cli/commands/init.py | pupa/cli/commands/init.py | import os
import sys
from .base import BaseCommand, CommandError
from opencivicdata.common import JURISDICTION_CLASSIFICATIONS
from opencivicdata.divisions import Division
def prompt(ps, default=''):
return input(ps).strip() or default
CLASS_DICT = {'events': 'Event',
'people': 'Person',
... | Python | 0.000731 | @@ -1843,16 +1843,17 @@
sing thi
+s
format,
@@ -2038,18 +2038,18 @@
he posit
-o
i
+o
n type (
@@ -2057,10 +2057,10 @@
g co
-n
u
+n
cilm
@@ -2319,17 +2319,16 @@
#REQUI
-I
RED: yie
|
9c642cb06a4f3a7cea11d6020752f0eabaebc90c | update dev version after 0.17.0 tag [skip ci] | py/desisurvey/_version.py | py/desisurvey/_version.py | __version__ = '0.17.0'
| Python | 0 | @@ -14,10 +14,18 @@
'0.17.0
+.dev1045
'%0A
|
9118b0326ac1c27e9773cc12fd88fccbea26442b | update dev version after 1.1.1 tag [ci skip] | py/desitarget/_version.py | py/desitarget/_version.py | __version__ = '1.1.1'
| Python | 0 | @@ -13,10 +13,18 @@
= '1.1.1
+.dev5118
'%0A
|
ba662a902384ca2a07316f66407ee703f65a58bd | Update urls | django/website/contacts/auth_urls.py | django/website/contacts/auth_urls.py | from django.conf.urls import patterns, url
from django.contrib.auth.views import (
login, logout_then_login, password_reset_confirm
)
from .views import ResetPassword, change_password
urlpatterns = patterns('',
url(r'login/$', login, name='login'),
url(r'logout/$', logout_then_login, name='logout'),
... | Python | 0.000001 | @@ -201,20 +201,9 @@
s =
-patterns('',
+%5B
%0A
@@ -692,10 +692,10 @@
ange'),%0A
-)
+%5D
%0A
|
69ed2a36ab8531cb22bdc26afcf58780e3889d19 | check service manager using /proc/1/comm | ovs/extensions/services/service.py | ovs/extensions/services/service.py | # Copyright 2015 CloudFounders NV
#
# 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 writ... | Python | 0.000001 | @@ -1306,22 +1306,24 @@
ut('
-init --version
+cat /proc/1/comm
', s
@@ -1433,16 +1433,146 @@
erface!%0A
+ if 'init' in init_info:%0A version_info = check_output('init --version', shell=True)%0A
@@ -1595,35 +1595,42 @@
upstart' in
-init
+version
_info:%0A
+ ... |
761b8e7e471f111b78f36f7aad34e8d89fdc3002 | Make oweb.tests.views.account_delete.test_redirect work | oweb/tests/views/account_delete.py | oweb/tests/views/account_delete.py | """Contains tests for oweb.views.updates.account_delete"""
# Python imports
from unittest import skip
# Django imports
from django.core.urlresolvers import reverse
# app imports
from oweb.tests import OWebViewTests
class OWebViewsAccountDeleteTests(OWebViewTests):
def test_login_required(self):
"""Unauth... | Python | 0.000001 | @@ -161,60 +161,240 @@
rse%0A
-# app imports%0Afrom oweb.tests import OWebViewTests%0A%0A
+from django.test.utils import override_settings%0Afrom django.contrib.auth.models import User%0A# app imports%0Afrom oweb.tests import OWebViewTests%0Afrom oweb.models.account import Account%0A%0A%0A@override_settings(AUTH_USER_... |
25aaca207d1c720d414df2eebca3acc954c5eb88 | Use extensions in view | pybossa_discourse/view.py | pybossa_discourse/view.py | # -*- coding: utf8 -*-
"""Views module for pybossa-discourse."""
from flask import Blueprint, request, url_for, flash, redirect
from flask import current_app as app
from flask.ext.login import current_user
def index():
"""Attempt to sign in via SSO then redirect to Discourse."""
discourse_sso = app.extension... | Python | 0 | @@ -200,16 +200,62 @@
nt_user%0A
+from . import discourse_sso, discourse_client%0A
%0A%0Adef in
@@ -330,63 +330,8 @@
%22%22%22%0A
- discourse_sso = app.extensions%5B'discourse'%5D%5B'sso'%5D%0A
@@ -610,63 +610,8 @@
%22%22%22%0A
- discourse_sso = app.extensions%5B'discourse'%5D%5B'sso'%5D%0A
@@ -11... |
036a71a41e64f9eb08314a285e3c4895af3b410b | Update pylsy_test.py | pylsy/tests/pylsy_test.py | pylsy/tests/pylsy_test.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
from pylsy.pylsy import pylsytable
class PylsyTableTests(unittest.TestCase):
def setUp(self):
attributes = ["name", "age"]
self.table = pylsytable(attributes)
def tearDown(self):
self.table = None
de... | Python | 0 | @@ -17,16 +17,48 @@
f-8 -*-%0A
+import sys%0Asys.path.append('..')
%0Afrom __
|
159b1b78d4e24a89516c8f346f7905e562240d8c | Fix apache link (#7468) | docs/build_version_doc/AddVersion.py | docs/build_version_doc/AddVersion.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 u... | Python | 0 | @@ -3376,16 +3376,50 @@
rMenu%22)%0A
+ outstr = str(content)%0A
@@ -3443,32 +3443,32 @@
navbar_mobile:%0A
-
@@ -3981,24 +3981,770 @@
', '%3E')%0A
+ # Fix link%0A if args.current_version == tag_list%5B0%5D:%0A print(%22Fixing%22 + os.path.jo... |
4a8678d2b8ac5b7609244a38affaf308564a5c1f | Make SVDFile.from_builtin() handle missing or bad svd zip. | pyocd/debug/svd/loader.py | pyocd/debug/svd/loader.py | # pyOCD debugger
# Copyright (c) 2015-2019 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | Python | 0 | @@ -690,32 +690,19 @@
ces%0A
-from zipfile
import
-ZipF
+zipf
ile%0A
@@ -731,16 +731,72 @@
VDParser
+%0Afrom ...utility.compatibility import FileNotFoundError_
%0A%0ALOG =
@@ -1032,24 +1032,41 @@
svd_name):%0A
+ try:%0A
zip_
@@ -1148,14 +1148,26 @@
+
zip =
+zipfile.
ZipF
@@ -1... |
64d8bb7f620c8ce047a442fe8d17092428a0e33b | fix tag | pythainlp/tag/__init__.py | pythainlp/tag/__init__.py | # -*- coding: utf-8 -*-
# TODO ปรับ API ให้เหมือน nltk
from __future__ import absolute_import,division,print_function,unicode_literals
import sys
def pos_tag(text,engine='old'):
"""
ระบบ postaggers
pos_tag(text,engine='old')
engine ที่รองรับ
* old เป็น UnigramTagger
* artagger เป็น RDR POS Tagger
"""
if engin... | Python | 0.000001 | @@ -608,39 +608,45 @@
ps://github.com/
-franziz
+wannaphongcom
/artagger/archiv
@@ -797,15 +797,21 @@
com/
-franziz
+wannaphongcom
/art
|
6c332c1966a807e0633f6b3f5363ad2e0a62f7ef | fix documentation | python/notes/math/ilp4.py | python/notes/math/ilp4.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Author : Thamme Gowda
Date : December 6, 2017
Taken from http://people.brunel.ac.uk/~mastjjb/jeb/or/moreip.html
"""
"""
A project manager in a company is considering a portfolio of 10 large project investments. These investments differ in the estimated long-run profit (... | Python | 0 | @@ -1653,17 +1653,17 @@
rd Form:
-
+%0A
(1) all
@@ -1689,16 +1689,69 @@
alities
+=%3E good for expressing it as a matrix multiplication%0A
(2) only
@@ -1768,17 +1768,19 @@
riables
-(
+=%3E
because
@@ -1811,17 +1811,107 @@
binary!
-)
+%0A(3) Minimization objective =%3E because the quantum annealer minimize... |
75c50c31cc6f7a5075f35d4913acbeb5f41ded50 | fix for error messages | pytracts/message_types.py | pytracts/message_types.py | #!/usr/bin/env python
#
# Copyright 2014 Docalytics Inc, Copyright 2010 Google 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 r... | Python | 0.000001 | @@ -1752,20 +1752,19 @@
ception.
-titl
+nam
e%0A%0A i
|
0e2a5eacdc96161749f41b5bbec238e4c51b8920 | tidy Mol descriptions | qc_schema/dev/molecule.py | qc_schema/dev/molecule.py | """
The json-schema for the Molecule definition
"""
molecule = {
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"symbols": {
"description": "The atom symbol for each atom in the molecule.",
"type": "array",
"items": {
"type": "st... | Python | 0 | @@ -185,19 +185,23 @@
tion%22: %22
-The
+(nat, )
atom sy
@@ -208,37 +208,22 @@
mbol
- for each atom in the molecul
+s in title cas
e.%22,
@@ -387,15 +387,16 @@
%22: %22
-The (3N
+(3 * nat
, )
@@ -599,48 +599,32 @@
%22: %22
-The masses of the atoms in the molecule,
+(nat, ) atom masses %5Bu%5D;
can
@@ -1043,1... |
5aee445745a859dfe2b85f07b4cf88f40e41fb6f | Clarify the patient id regexp. | qipipe/staging/map_ctp.py | qipipe/staging/map_ctp.py | """
TCIA CTP preparation utilities.
"""
import sys, os, re
from .ctp_config import ctp_collection_for
from ..helpers.dicom_helper import iter_dicom_headers
import logging
logger = logging.getLogger(__name__)
__all__ = ['property_filename', 'CTPPatientIdMap']
PROP_FMT = 'QIN-%s-OHSU.ID-LOOKUP.properties'
"""The form... | Python | 0.000359 | @@ -932,57 +932,282 @@
T =
-'(%5Cw+?)(%5Cd+)'%0A %22%22%22The input Patient ID pattern
+re.compile(%22%22%22%0A (%5Ba-zA-Z%5D+) # The study name%0A _? # An optional underscore delimiter%0A (%5Cd+)$ # The patient number%0A %22%22%22, re.VERBOSE)%0A %22%22%22The i... |
3a8e857aa12ac55a5b5e531e72356541a185da56 | Load from different file | opencog/python/pln/examples/relex2logic/evaluation_to_member_example.py | opencog/python/pln/examples/relex2logic/evaluation_to_member_example.py | """
For running evaluation_to_member_agent.py without the cogserver
"""
from __future__ import print_function
from pln.examples.relex2logic import evaluation_to_member_agent
from opencog.atomspace import types, AtomSpace, TruthValue
from opencog.scheme_wrapper import load_scm, scheme_eval, scheme_eval_h, __init__
from... | Python | 0.000001 | @@ -533,16 +533,17 @@
es.scm%22%0A
+#
data = %22
@@ -607,16 +607,86 @@
ber.scm%22
+%0Adata = %22opencog/python/pln/examples/relex2logic/r2l-outpust-test.scm%22
%0A%0Afor it
|
ff7766b737c0868ae2579da49f2e8304f40767ee | version 2.1.53 | targetcli/version.py | targetcli/version.py | '''
This file is part of targetcli.
Copyright (c) 2011-2013 by Datera, 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 applica... | Python | 0 | @@ -618,11 +618,11 @@
= '2.1.5
-2
+3
'%0A
|
7b1b323da3e2fcf79c0bff36d6e0665d1b88e74e | Fix stupid typo... | editorsnotes/auth/utils.py | editorsnotes/auth/utils.py | from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django conf import settings
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.utils.http import urlsafe_base64_encode
def send_activation_email(request, user):
b64uid = urlsafe_base64_encode(str(us... | Python | 0.000031 | @@ -71,17 +71,17 @@
m django
-
+.
conf imp
|
74a4b267d911527a690e5c580981523795591460 | Update docstring | readthedocs/search/api.py | readthedocs/search/api.py | import itertools
import logging
from django.shortcuts import get_object_or_404
from django.utils import timezone
from rest_framework import generics, serializers
from rest_framework.exceptions import ValidationError
from rest_framework.pagination import PageNumberPagination
from readthedocs.api.v2.permissions import ... | Python | 0.000001 | @@ -5175,16 +5175,46 @@
projects
+ the user has permissions over
.%0A%0A
|
9359d64c56c1735544c2e2e77b160bb14048b497 | use polling_district_id | polling_stations/apps/data_collection/management/commands/import_salford.py | polling_stations/apps/data_collection/management/commands/import_salford.py | """
Import Salford
"""
import sys
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseShpImporter
class Command(BaseShpImporter):
"""
Imports the Polling Station data from Salford
"""
council_id = 'E08000006'
districts_name = 'Salford_Polling_Districts... | Python | 0.000075 | @@ -1030,16 +1030,81 @@
location
+,%0A 'polling_district_id': record.polling_district_code
%0A
|
cd48c66406c39ca6dd6bdc6ba7c2be0df623e6ae | Fix return codes for check recipient | src/leap/mx/check_recipient_access.py | src/leap/mx/check_recipient_access.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# check_recipient_access.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | Python | 0.000001 | @@ -1035,16 +1035,143 @@
value):%0A
+ # For more info, see:%0A # http://www.postfix.org/tcp_table.5.html%0A # http://www.postfix.org/access.5.html%0A
@@ -1238,23 +1238,14 @@
te(%22
-NOT FOUND SORRY
+REJECT
%22))%0A
@@ -1274,77 +1274,46 @@
-# We do not send the value in this case%... |
3d53d3fe37e36a8f05a8cae27f8aa138b063fcd6 | add docstrings (#937) | src/main/python/smv/py4j_interface.py | src/main/python/smv/py4j_interface.py | # This file is 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
# distrib... | Python | 0 | @@ -639,24 +639,860 @@
thod_name):%0A
+ %22%22%22Create a method that implements a Java interface for Py4J callback%0A%0A Given the name of a method which needs to be called from Scala code%0A (e.g. SmvModule.doRun), creates a wrapper for the method which returns%0A an appropriate SmvPy4JRespon... |
7f32ca34ec26174e10b5b8de65883b39293c3ed0 | Update assignment5.py | Module-3/assignment5.py | Module-3/assignment5.py | #
# This code is intentionally missing!
# Read the directions on the course lab page!
#
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
from pandas.tools.plotting import parallel_coordinates
# Look pretty...
matplotlib.style.use('ggplot')
wheat_dataset=pd.read_csv('/Users/ADB3HAMADL/Desktop/Ana... | Python | 0 | @@ -1,91 +1,32 @@
-#%0A# This code is intentionally missing!%0A# Read the directions on the course lab page!%0A#
+'''%0Aauthor: Lama Hamadeh%0A'''
%0A%0Aim
@@ -848,28 +848,29 @@
type',alpha= 0.4)%0Aplt.show()
+%0A
|
f16cc2d581de0dbacc5813e85a8d49cdd5d109b1 | Send unqualified hostnames to match other syslog behaviour | sendlog/sendlog/main.py | sendlog/sendlog/main.py | import argparse, ssl, socket, sys, glob, re, os, json, time
from datetime import datetime
from dateutil import tz
TZLOCAL = tz.tzlocal()
class Syslog:
def __init__(self, options):
self.options = options
self.sock = None
self.connect()
self.max_length = options.max_length
def c... | Python | 0 | @@ -933,16 +933,30 @@
etfqdn()
+.split('.')%5B0%5D
, app_na
|
55c61ccd517c41ef0c2237abae204455457e9abc | Fix hard import to soft | seqcluster/libs/read.py | seqcluster/libs/read.py | """functions for explore tool"""
from __future__ import print_function
from collections import defaultdict
import json, itertools
import tempfile, os, contextlib, shutil
from sam2bed import makeBED
import logging
from do import find_cmd, run
import pysam
import pybedtools
from seqcluster.align import pyMatch
logger ... | Python | 0.000023 | @@ -268,16 +268,25 @@
edtools%0A
+try:%0A
from seq
@@ -313,16 +313,33 @@
pyMatch
+%0Aexcept:%0A pass
%0A%0Alogger
|
7888242104e9f14b4e8a926e37aa793a60c36f10 | Implement files.put/files.template | pyinfra/modules/files.py | pyinfra/modules/files.py | # pyinfra
# File: pyinfra/modules/file.py
# Desc: manage files/templates <> server
from pyinfra.api import operation
@operation
def put(local_file, remote_file):
'''[Not implemented] Copy a local file to the remote system.'''
pass
@operation
def template(template_name, remote_file, **data):
'''[Not imp... | Python | 0.000005 | @@ -77,16 +77,77 @@
server%0A%0A
+from cStringIO import StringIO%0A%0Afrom jinja2 import Template%0A%0A
from pyi
@@ -230,26 +230,8 @@
'''
-%5BNot implemented%5D
Copy
@@ -273,20 +273,121 @@
'''%0A
-pass
+# Just load the local file%0A local_file = open(local_file, 'r')%0A%0A return %5B(local_file, remote... |
da24aa8c97713a1ba5b5735aa169f8cf050fe88a | add function(image to csv). | pylearn2/convertImage.py | pylearn2/convertImage.py | #!/usr/bin/env python
# encoding:utf-8
#
# Copyright [2015] [Yoshihiro Tanaka]
# 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 requir... | Python | 0 | @@ -676,16 +676,28 @@
01-22%22%0A%0A
+import numpy
%0Afrom PI
@@ -710,32 +710,17 @@
rt Image
-%0Afrom PIL import
+,
ImageOp
@@ -870,16 +870,49 @@
%22in/%22)%0A%0A
+with open(sys.argv%5B1%5D) as f:%0A
for file
@@ -923,16 +923,20 @@
in ls:%0A
+
inpu
@@ -978,16 +978,20 @@
me)%0A
+
+
resize_... |
9a90ee2d715ffaec7314dca7492cb06c0d966ea3 | fix test | corehq/apps/repeaters/tests/test_dbaccessors.py | corehq/apps/repeaters/tests/test_dbaccessors.py | from datetime import datetime, timedelta
from django.test import TestCase
from corehq.apps.repeaters.dbaccessors import (
get_failure_repeat_record_count,
get_overdue_repeat_record_count,
get_paged_repeat_records,
get_pending_repeat_record_count,
get_repeat_record_count,
get_repeaters_by_domain... | Python | 0.000002 | @@ -2953,17 +2953,17 @@
(count,
-6
+3
)%0A%0A d
|
ea8fe198af7f9f9324fa48456e0d8bc8acf740f5 | Fix gitiles service comment. | dashboard/dashboard/services/gitiles_service.py | dashboard/dashboard/services/gitiles_service.py | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Functions for getting commit information from Gitiles."""
import base64
import json
from google.appengine.api import urlfetch
_DEFAULT_HOSTNAME = 'htt... | Python | 0.000579 | @@ -1922,23 +1922,39 @@
in
-ascending order
+order from newest%0A to oldest
.%0A%0A
|
368306261e2d206d4dfad8f647a7d459462631a4 | Optimize number 37: x in set() faster than x in list() | python/too_slow/no037.py | python/too_slow/no037.py | #!/usr/bin/env python
# The number 3797 has an interesting property. Being prime itself,
# it is possible to continuously remove digits from left to right,
# and remain prime at each stage:
# 3797, 797, 97, and 7.
# Similarly we can work from right to left: 3797, 379, 37, and 3.
# Find the sum of the only eleven pri... | Python | 0.000691 | @@ -453,16 +453,29 @@
rimes.%0A%0A
+import copy%0A%0A
from pyt
@@ -1217,20 +1217,17 @@
primes.a
-ppen
+d
d(candid
@@ -1356,16 +1356,20 @@
rimes =
+set(
sieve(ma
@@ -1376,16 +1376,17 @@
x_n)%5B4:%5D
+)
# We do
@@ -1424,30 +1424,41 @@
or prime in
+copy.copy(
primes
+)
:%0A if
|
3ac8788c9090b5655676b239db826ef5da3544f4 | Update version to 0.11.0 | storage_service/storage_service/__init__.py | storage_service/storage_service/__init__.py | __version__ = '0.10.0'
| Python | 0.000001 | @@ -11,13 +11,13 @@
_ = '0.1
-0
+1
.0'%0A
|
74aa74b6ac911ba8e1101d3ebd555fedca6b5488 | Set start and end date to external config file and bugfix on zip extract process | externaldata/adsbedata/RetrieveHistoricalADSBEdata.py | externaldata/adsbedata/RetrieveHistoricalADSBEdata.py | """
Utilities for downloading historical data in a given AOI.
Python 3.5
"""
import datetime
import io
import logging
import os
import zipfile
import requests
import yaml
from model import aircraft_report
logger = logging.getLogger(__name__)
parent_dir = os.path.dirname(os.path.realpath(__file__))
zip_dir = 'outpu... | Python | 0 | @@ -297,16 +297,43 @@
le__))%0A%0A
+# TODO: Set in config file%0A
zip_dir
@@ -339,15 +339,46 @@
= '
+F:%5C
output'
+%0A%0A# TODO: Set in config file
%0Adat
@@ -1012,16 +1012,33 @@
zip.')%0A
+ try:%0A
@@ -1092,16 +1092,83 @@
t_dir))%0A
+ except:%0A logger.error('Could not... |
0675090877483bcbbfbc7b3d7ef8ed3f97085f8c | Add python_2_unicode_compatible | Project-AENEAS/issues/models.py | Project-AENEAS/issues/models.py | """Mini Issue Tracker program. Originally taken from Paul Bissex's blog post:
http://news.e-scribe.com/230 and snippet: http://djangosnippets.org/snippets/28/
"""
from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.utils.translation import ugettext_lazy ... | Python | 0.999977 | @@ -262,16 +262,78 @@
ettings%0A
+from django.utils.encoding import python_2_unicode_compatible%0A
from dja
@@ -634,16 +634,45 @@
o.')%5D%0A%0A%0A
+@python_2_unicode_compatible%0A
class Ti
@@ -1600,23 +1600,19 @@
def __
-unicode
+str
__(self)
|
e0e2acf6d3a73ac2f7498dbf897c4d2ccbed445a | Update MisalignImgs_Gaussian.py | Python/MisalignImgs_Gaussian.py | Python/MisalignImgs_Gaussian.py | #Misalign (Random-Poisson) a tomography tilt series
#for testing and reconsruction development
#
#developed as part of the tomviz project (www.tomviz.com)
def transform_scalars(dataset):
from tomviz import utils
import numpy as np
#----USER SPECIFIED VARIABLES-----#
TILT_AXIS = [] #S... | Python | 0 | @@ -2100,33 +2100,33 @@
py%5B:,i,:%5D, shift
-2
+1
, axis = 2)%0A
@@ -2110,33 +2110,33 @@
shift1, axis =
-2
+1
)%0A elif T
@@ -2450,33 +2450,33 @@
py%5Bi,:,:%5D, shift
-1
+0
, axis = 1)%0A
@@ -2460,33 +2460,33 @@
shift0, axis =
-1
+0
)%0A da
@@ -2530,17 +2530,17 @@
%5D, shift
-2
+... |
14c2019aa5bf716cab0f2ed2b97bbc32d8c74a81 | Improve parameters of sync_suricate command | geotrek/feedback/management/commands/sync_suricate.py | geotrek/feedback/management/commands/sync_suricate.py | from django.core.management.base import BaseCommand
from geotrek.feedback.parsers import SuricateParser
class Command(BaseCommand):
leave_locale_alone = True
def add_arguments(self, parser):
# parser.add_argument('-l', dest='limit', type=int, help='Limit number of lines to import')
# todo
... | Python | 0.000001 | @@ -361,24 +361,29 @@
--activities
+_only
%22, dest=%22act
@@ -389,16 +389,21 @@
tivities
+_only
%22, help=
@@ -420,16 +420,43 @@
tivities
+ but no statuses nor alerts
%22, defau
@@ -450,35 +450,36 @@
lerts%22, default=
-Tru
+Fals
e%0A )%0A
@@ -522,24 +522,29 @@
%22--statuses
+_only
%22, dest=%22s... |
e78bd17a742961368c4b026be5a447e3d234c870 | Update tensorflow10_def_add_layer.py | tensorflowTUT/tensorflow10_def_add_layer.py | tensorflowTUT/tensorflow10_def_add_layer.py | import tensorflow as tf
def add_layer(inputs, in_size, out_size, activation_function=None):
Weights = tf.Variable(tf.random_normal([in_size, out_size]))
biases = tf.Variable(tf.zeros([1, out_size]) + 0.1)
Wx_plus_b = tf.matmul(inputs, Weights) + biases
if activation_function is None:
outputs =... | Python | 0.000001 | @@ -1,8 +1,223 @@
+# View more python learning tutorial on my Youtube and Youku channel!!!%0A%0A# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg%0A# Youku video tutorial: http://i.youku.com/pythontutorial%0A%0A
import t
|
ff4a977c436f9e9475f12360dbcee24938383a79 | Update FindPotentialFunction2x2.py | FindPotentialFunction2x2.py | FindPotentialFunction2x2.py | import numpy as np
from random import uniform
mat = np.array([[4.0, 0.0],
[2.0, 3.0]])
class SolveEquivalence2x2:
def __init__(self, matrix, dim=2):
self.x = np.zeros(dim)
for i in range(dim):
self.x[i] = matrix[0, i] - matrix[1, i]
def set_epsilon(self, new_... | Python | 0.000009 | @@ -44,67 +44,8 @@
rm%0A%0A
-mat = np.array(%5B%5B4.0, 0.0%5D, %0A %5B2.0, 3.0%5D%5D)%0A%0A
clas
@@ -3748,162 +3748,4 @@
%0A
- def get_brv1(self):%0A print self.brv1%0A %0A def get_brv2(self):%0A print self.brv2%0A %0A def get_bru2(self):%0A print self.bru2 %0... |
c173db723c2aa83a8d8c72dd05de209d300575bb | Add comment about accessor that doesn't yet work because not enough Boost black magic | algorithms/scaling/observation_manager.py | algorithms/scaling/observation_manager.py | #!/usr/bin/env cctbx.python
#
# Copyright (C) (2016) STFC Rutherford Appleton Laboratory, UK.
#
# Author: David Waterman.
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
"""Contains classes used to manage the reflections used during scaling... | Python | 0 | @@ -5775,16 +5775,270 @@
iment)%0A%0A
+ # This currently does not work :-(%0A # TypeError: Please report this error to dials-support@lists.sourceforge.net: No to_python (by-value) converter found for C++ type: scitbx::af::const_ref%3Ccctbx::miller::index%3Cint%3E, scitbx::af::trivial_accessor%3E%0A
om.g
|
44629d5a6d3b76e721aa0cf11041924f5a088d6e | fix output values | robot/robot.py | robot/robot.py | #!/usr/bin/env python3
import wpilib
import ctre
class Robot(wpilib.IterativeRobot):
def robotInit(self):
"""
This function is called upon program startup and
should be used for any initialization code.
"""
left_motor = ctre.CANTalon(0)
right_motor = ctre.CANTalon(... | Python | 0.999997 | @@ -424,18 +424,17 @@
xOutput(
-.5
+2
)%0A%0A
@@ -1299,17 +1299,17 @@
.stick,
-1
+5
, self.s
@@ -1318,21 +1318,27 @@
ck,
-5
+1, True
) #
-1
+5
and
-5
+1
are
@@ -1366,16 +1366,30 @@
ick axes
+, respectively
%0A
@@ -1520,32 +1520,49 @@
er.getXButton():
+ # turn in place
%0A sel
... |
582085629b8dbc8c4adb51ef95648e91aa886d1a | fix version regex | Glance/GlanceURLProvider.py | Glance/GlanceURLProvider.py | #!/usr/bin/python
#
# Copyright 2015 Derek Marcotte
#
# 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 | @@ -974,17 +974,16 @@
0-9%5D+)*)
-%22
', re.I)
|
99553ec68046962cda61c4296e6345180f377780 | fix serialization bug | soil/views.py | soil/views.py | import uuid
from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.core.cache import cache
import logging
from django.shortcuts import render_to_response
from dja... | Python | 0.000001 | @@ -1009,16 +1009,20 @@
stamp%22:
+str(
last_hea
@@ -1021,32 +1021,33 @@
last_heartbeat()
+)
,%0A
|
922ea0fe4e2e8f6e36264de8294b8d95f3dc24d9 | improve method names on tone system | sol/system.py | sol/system.py | #####################################################################################
# #
# sol/system.py #
# ... | Python | 0.000013 | @@ -2058,16 +2058,59 @@
######%0A%0A
+__all__ = %5B'System', 'TwelveToneSystem'%5D%0A%0A%0A
import r
@@ -3301,103 +3301,21 @@
-if isinstance(key, str):%0A return self.stringToPitch(key)%0A return self.stepToP
+return self.p
itch
@@ -3333,15 +3333,9 @@
def
-stepToP
+p
itch
@@ -3341,20 +3341... |
124863060483ba7b6680326f8161d3da22c34c0c | simplify tf2ss codes | tcontrol/model_conversion.py | tcontrol/model_conversion.py | from .transferfunction import TransferFunction
from .statespace import StateSpace
import numpy as np
__all__ = ['tf2ss', 'ss2tf']
def tf2ss(sys_):
"""
Convert transfer function model to state space model.
:param sys_: the system
:type sys_: TransferFunction
:return: corresponded transfer funct... | Python | 0.018971 | @@ -489,17 +489,18 @@
peError(
-%22
+f'
Transfer
@@ -526,19 +526,8 @@
ot %7B
-0%7D%22.format(
type
@@ -532,17 +532,18 @@
pe(sys_)
-)
+%7D'
) from e
@@ -543,16 +543,109 @@
from e%0A
+%0A if not sys_.is_siso:%0A raise ValueError('tf2ss only for siso system right now.')%0A%0A
dt =
@@ -653,17 +653,16... |
b013a84227adf2f25c09519762c2610ea8a500da | Test Unit | HappyDogs/HappyDogs/urls.py | HappyDogs/HappyDogs/urls.py | from django.conf.urls import include, url
urlpatterns = [
url(r'^happy_dogs/', include('HappyDogs.apps.HappyDogs.urls')),
url(r'^rest/happy_dogs/', include('HappyDogs.apps.HappyDogs.rest_urls')),
]
| Python | 0.000001 | @@ -39,23 +39,207 @@
url%0A
-urlpatterns = %5B
+from HappyDogs.apps.HappyDogs.views import happy_dogs_home%0Afrom django.conf import settings%0Afrom django.conf.urls.static import static%0A%0Aurlpatterns = %5B%0A url(r'%5E$', happy_dogs_home , name='index'),
%0A
@@ -382,9 +382,75 @@
ls')),%0A%5D
+ + static(set... |
87570c8b90a769678aeaa18f8e089b54bc181551 | fix nulldummy test | test/functional/feature_nulldummy.py | test/functional/feature_nulldummy.py | #!/usr/bin/env python3
# Copyright (c) 2016-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test NULLDUMMY softfork.
Connect to a single node.
Generate 2 blocks (save the coinbases for later).
G... | Python | 0.000023 | @@ -5770,59 +5770,8 @@
+ 1
-, witness=witness)%0A block.set_base_version(4
)%0A
|
5ae42a15cfe0c99711da4865541eb6e6e45dbd48 | stop http2 test server with error code when failures occur | test/http2_test/http2_test_server.py | test/http2_test/http2_test_server.py | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | Python | 0 | @@ -1574,24 +1574,35 @@
ort logging%0A
+import sys%0A
import twist
@@ -1604,16 +1604,16 @@
twisted%0A
-
import t
@@ -2383,10 +2383,24 @@
tion
-.'
+ (%25s)', testcase
)%0A
@@ -3302,24 +3302,413 @@
rse_args()%0A%0A
+exit_code = 0%0A%0Adef listen(endpoint, test_case):%0A deferred = endpoint.listen(H2Factory(test... |
977d6c00af41b059f5a43677ca3e98f184628484 | fix minor issue. | evojax/algo/cma_wrapper.py | evojax/algo/cma_wrapper.py | # Copyright 2022 The EvoJAX 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 or agreed to in w... | Python | 0 | @@ -1091,14 +1091,8 @@
int
- = 256
,%0A
|
cf4e24ce50c535e91525465c65217f21b89448a6 | add example using unicode | example/general_example.py | example/general_example.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from pysensorbee import SensorBeeAPI
class GeneralExample(object):
def main(self):
api = SensorBeeAPI()
print("Runtime Status:")
print(api.runtime_status())
... | Python | 0.00001 | @@ -1025,13 +1025,44 @@
VAL
-1+2+3
+concat((1+2+3)::string, %22 -%3E %22, %22%E5%85%AD%22)
;'))
|
ec082a531ad2e6dbc3d8ce4de78c76b84d615c38 | update view.py - import render from django shortcuts | example/simplecms/views.py | example/simplecms/views.py | from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from simplecms.models import Page
def page_detail(request, path):
stripped = path.strip('/') if path else ''
stripped = stripped and u'/%s/' % stripped or '/'
try:
pa... | Python | 0 | @@ -64,20 +64,8 @@
nder
-_to_response
%0Afro
|
47badfa8c248e8770466a4e657b95b9702bf3111 | make tests more like standard case/parent case structures | corehq/ex-submodules/casexml/apps/case/tests/test_extract_caseblocks.py | corehq/ex-submodules/casexml/apps/case/tests/test_extract_caseblocks.py | import uuid
from django.test import SimpleTestCase
from casexml.apps.case.const import CASE_ATTR_ID
from casexml.apps.case.xform import extract_case_blocks
class TestExtractCaseBlocks(SimpleTestCase):
def test_simple(self):
block = {CASE_ATTR_ID: uuid.uuid4().hex}
blocks = extract_case_blocks({
... | Python | 0.000055 | @@ -210,22 +210,21 @@
ef test_
-simple
+basic
(self):%0A
@@ -346,36 +346,38 @@
'
-cas
+som
e':
-block
+'stuff'
%0A
@@ -370,32 +370,59 @@
f'%0A %7D
+,%0A 'case': block
%0A %7D)%0A
@@ -666,36 +666,38 @@
'
-cas
+som
e':
-block
+'stuff'
%0A ... |
307c53e9eb49aad69ba243e61d70474c384d185e | Improve background color display of prompt in async_printing.py example | examples/async_printing.py | examples/async_printing.py | #!/usr/bin/env python
# coding=utf-8
"""
A simple example demonstrating an application that asynchronously prints alerts, updates the prompt
and changes the window title
"""
import random
import threading
import time
from typing import List
import cmd2
from cmd2 import ansi
ALERTS = ["Watch as this application prints... | Python | 0 | @@ -5225,16 +5225,25 @@
e_prompt
+.rstrip()
, fg=fg_
@@ -5261,16 +5261,22 @@
g_color)
+ + ' '
%0A%0A de
|
b275b06379fea006e91f45c976d72751595031dc | Comment out string import since it is not used | test/server/test_image_validation.py | test/server/test_image_validation.py | from urlparse import urljoin
from clientlib import (
make_example_shot,
make_random_id,
screenshots_session,
example_images
)
import random
import string
# Hack to make this predictable:
random.seed(0)
def test_invalid_image_url():
with screenshots_session() as user:
shot_id = make_random... | Python | 0 | @@ -149,16 +149,18 @@
random%0A
+#
import s
|
a9abcc15c8f95d59f9ea28a326604164b8afee85 | Add divide by zero check | django/publicmapping/redistricting/templatetags/redistricting_extras.py | django/publicmapping/redistricting/templatetags/redistricting_extras.py | """
Extra tags and templates used in the django
templating system for the redistricting app.
This file is part of The Public Mapping Project
https://github.com/PublicMapping/
License:
Copyright 2010 Micah Altman, Michael McDonald
Licensed under the Apache License, Version 2.0 (the "License");
you may n... | Python | 0.013029 | @@ -4599,16 +4599,40 @@
'value':
+ 0 if not num_items else
total /
|
aefd972c7fb423396f59da03a1d460cd3559d1e1 | Remove unnecesssary comments of old function signatures | duplicate_questions/data/tokenizers/word_tokenizers.py | duplicate_questions/data/tokenizers/word_tokenizers.py | class SpacyWordTokenizer():
"""
A Tokenizer splits strings into word tokens.
"""
def __init__(self):
# Import is here it's slow, and can be unnecessary.
import spacy
self.en_nlp = spacy.load('en')
# def tokenize(self, sentence: str) -> List[str]:
def tokenize(self, sente... | Python | 0.000001 | @@ -235,62 +235,8 @@
')%0A%0A
- # def tokenize(self, sentence: str) -%3E List%5Bstr%5D:%0A
@@ -265,16 +265,16 @@
tence):%0A
+
@@ -350,71 +350,8 @@
)%5D%0A%0A
- # def get_words_for_indexer(self, text: str) -%3E List%5Bstr%5D:%0A
@@ -429,82 +429,8 @@
t)%0A%0A
- # def index_text(self, te... |
586c3fb90bd765ebee1f5e63f94a86144623d9d2 | Update map-sum-pairs.py | Python/map-sum-pairs.py | Python/map-sum-pairs.py | # Time: O(n), n is the length of key
# Space: O(t), t is the number of nodes in trie
class MapSum(object):
def __init__(self):
"""
Initialize your data structure here.
"""
_trie = lambda: collections.defaultdict(_trie)
self.__root = _trie()
def insert(self, key, ... | Python | 0.000001 | @@ -80,16 +80,636 @@
n trie%0A%0A
+# Implement a MapSum class with insert, and sum methods.%0A#%0A# For the method insert, you'll be given a pair of (string, integer).%0A# The string represents the key and the integer represents the value.%0A# If the key already existed, then the original key-value pair will be overri... |
6a833e64c4fdfd321a1e031133cf22aaec2d92a6 | Test format_error | test/test.py | test/test.py | """Test module for pbs client."""
import pbclient
from helpers import *
from mock import patch
from nose.tools import assert_raises
from requests import exceptions
class Test(object):
"""Test class for pbs."""
error = {"action": "GET",
"exception_cls": "NotFound",
"exception_msg": "... | Python | 0.000004 | @@ -1914,28 +1914,340 @@
check_api_error(error)%0A
+%0A @patch('pbclient.find_app')%0A def test_format_error(self, mock):%0A %22%22%22Test format_error works.%22%22%22%0A mock.return_value = %5B'project'%5D%0A assert_raises(SystemExit, format_error, 'pbclient.find_app', %5B'error'%5D)%0... |
50e250ed47d66f43296ff6e2bdd8fe50679681bd | Fix tests | test/test.py | test/test.py | import unittest
import shutit_main
import shutit_global
# In order to dynamically create objects
class Bunch:
"""TODO
"""
def __init__(self, **kwds):
self.__dict__.update(kwds)
# Updating multiple levels of a dict
import collections
def recupdate(d, u):
"""TODO
"""
for k, v in u.iteritems():
if isinstance(v... | Python | 0.000003 | @@ -616,19 +616,20 @@
)%0A%09%09def
-log
+noop
(*args,
@@ -735,19 +735,20 @@
t.log =
-log
+noop
%0A%09%09self.
@@ -766,16 +766,55 @@
= fail%0A
+%09%09self.shutit.get_default_child = noop%0A
%09%09recupd
@@ -850,16 +850,16 @@
ild': %7B%0A
-
%09%09%09%09'tut
@@ -916,16 +916,38 @@
': False
+,%0A%09%09%09%09'i... |
d9c677a35d18a878ef8d253a9453e93da3341e96 | Add extremely basic template for command modules | runTwircBot.py | runTwircBot.py | #!/usr/bin/env python3
from src.TwircBot import TwircBot
import sys
try:
bot = TwircBot(sys.argv[1])
except IndexError:
bot = TwircBot()
bot.print_config()
bot.start()
| Python | 0 | @@ -51,16 +51,60 @@
wircBot%0A
+from src.CommandModule import CommandModule%0A
import s
@@ -185,16 +185,42 @@
cBot()%0A%0A
+module = CommandModule()%0A%0A
bot.prin
@@ -230,16 +230,18 @@
onfig()%0A
+#
bot.star
|
d58015f39451f4efc4a66f77f62e01009c22917b | Fix the windows red build by removing the known_host backup all the time | test/util.py | test/util.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2016 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | Python | 0 | @@ -764,16 +764,24 @@
s import
+ remove,
rename%0A
@@ -1652,24 +1652,120 @@
own_hosts):%0A
+ if isfile(self.known_hosts_backup):%0A remove(self.known_hosts_backup)%0A
@@ -1875,32 +1875,114 @@
_hosts_backup):%0A
+ if isfile(self.known_hosts):%0A remo... |
fa14d14bcd83a630eeffb0b6504612be24754c09 | add catch for windows -- clear() doesn't exist | SimpleCV/Shell/Shell.py | SimpleCV/Shell/Shell.py | #!/usr/bin/python
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# SimpleCV
# a kinder, gentler machine vision python library
#-----------------------------------------------------------------------
# SimpleCV is an interface for Open Source machine
# vision libraries in Python.
# It provide... | Python | 0.000001 | @@ -782,16 +782,32 @@
ort call
+%0Aimport platform
%0A%0A#Load
@@ -942,16 +942,64 @@
lear():%0A
+ if platform.system() == %22Windows%22:%0A return%0A
call(%22
|
ff58728268dd625a60705881a715e996f4895396 | change salt-cp to use pprint | salt/cli/cp.py | salt/cli/cp.py | '''
The cp module is used to execute the logic used by the salt-cp command
line application, salt-cp is NOT intended to broadcast large files, it is
intended to handle text files.
Salt-cp can be used to distribute configuration files
'''
# Import python modules
import os
import sys
# Import third party libs
import ya... | Python | 0.000001 | @@ -281,46 +281,21 @@
sys%0A
-%0A# I
+i
mport
-third party libs%0Aimport yaml
+pprint
%0A%0A#
@@ -2348,23 +2348,21 @@
+p
print
- yaml.dump
+.pprint
(ret
|
d4fe470a12ef7bc2c3bf6113d85c7a62814a6899 | Remove clsname from the Record tuple | src/dynmen/common.py | src/dynmen/common.py | # -*- coding: utf-8 -*-
import logging as _logging
from dynmen import Menu, ValidationError
from collections import (namedtuple as _ntupl,
OrderedDict as _OrderedDict)
from enum import Enum
_logr = _logging.getLogger(__name__)
_logr.addHandler(_logging.NullHandler())
class Default(Enum):
... | Python | 0.000031 | @@ -391,24 +391,16 @@
med info
- clsname
')%0ADefau
@@ -1623,53 +1623,8 @@
'),%0A
- clsname=self.__class__.__name__,%0A
|
9961d687c824625920b408010e2d418db627faab | Add facter matching to salt minion lookups | salt/minion.py | salt/minion.py | '''
Routines to set up a minion
'''
# Import python libs
import os
import distutils.sysconfig
import importlib
import glob
import re
import tempfile
import subprocess
# Import zeromq libs
import zmq
# Import salt libs
import salt.crypt
from salt.crypt import AuthenticationError
import salt.utils
import salt.modules
#... | Python | 0 | @@ -4931,32 +4931,241 @@
%5B'hostname'%5D))%0A%0A
+ def _facter_match(self, tgt):%0A '''%0A Reads in the facter regular expresion match%0A '''%0A comps = tgt.split()%0A return bool(re.match(comps%5B1%5D, self.opts%5B'facter'%5D%5Bcomps%5B0%5D%5D)%0A%0A
def _return_
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.