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 |
|---|---|---|---|---|---|---|---|
1b625ee89032e65e3510286d47a810a893f71e82 | Fix a bug in how getPlatform is accessed | TUI/Main.py | TUI/Main.py | #!/usr/bin/env python
"""Telescope User Interface.
This is the main routine that calls everything else.
2003-02-27 ROwen First version with history.
Modified to use the new Hub authorization
2003-03-20 ROwen Added DIS
2003-03-25 ROwen Moved TCC widgets into TCC subdirectory;
modified t... | Python | 0.001122 | @@ -4938,16 +4938,60 @@
.Models%0A
+from TUI.Models.TUIModel import getPlatform%0A
import T
@@ -6262,21 +6262,8 @@
r =
-TUI.TUIModel.
getP
|
d48a85f62d982af3fc16dd921ac13a28640e39d7 | version bump | cbsyst/__init__.py | cbsyst/__init__.py | from cbsyst.cbsyst import *
from cbsyst.helpers import data_out, Bunch
__version__ = '0.3.7'
| Python | 0.000001 | @@ -87,7 +87,11 @@
0.3.
-7
+8-dev
'%0A
|
cf67c8fc98048014cf2dfce7b2f4fa437ed92500 | Check if user object is set before calling is_authenticated on it. | session_csrf/__init__.py | session_csrf/__init__.py | """CSRF protection without cookies."""
import functools
import hashlib
from django.conf import settings
from django.core.cache import cache
from django.middleware import csrf as django_csrf
from django.utils import crypto
from django.utils.cache import patch_vary_headers
ANON_COOKIE = getattr(settings, 'ANON_COOKIE'... | Python | 0 | @@ -1737,32 +1737,61 @@
turn%0A if
+hasattr(request, 'user') and
request.user.is_
@@ -3025,16 +3025,46 @@
and not
+(hasattr(request, 'user') and
request.
@@ -3087,16 +3087,17 @@
cated())
+)
:%0A
@@ -4898,16 +4898,45 @@
= not (
+hasattr(request, 'user') and
request.
@@ -4958,19 +4958,25 @@
ic... |
d52c4340a62802bcd0fcbd68516c5ac66fb10436 | Update function name used in the streamtester | ftfy/streamtester/__init__.py | ftfy/streamtester/__init__.py | """
This file defines a general method for evaluating ftfy using data that arrives
in a stream. A concrete implementation of it is found in `twitter_tester.py`.
"""
from __future__ import print_function, unicode_literals
from ftfy.fixes import fix_text_encoding
from ftfy.chardata import possible_encoding
class Stream... | Python | 0 | @@ -237,29 +237,24 @@
import fix_
-text_
encoding%0Afro
@@ -859,29 +859,24 @@
fixed = fix_
-text_
encoding(tex
|
cd9b16dd5bd9ae41fb8cf7a3f8a2b02dfeb227bf | set db for me | gamechat/gamechat/settings.py | gamechat/gamechat/settings.py | """
Django settings for gamechat project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | Python | 0 | @@ -1775,16 +1775,18 @@
abases%0A%0A
+#
DATABASE
@@ -1791,16 +1791,18 @@
SES = %7B%0A
+#
'def
@@ -1832,24 +1832,25 @@
config(%0A
+#
default=
@@ -1841,16 +1841,17 @@
+
default=
@@ -1905,14 +1905,18 @@
db'%0A
+#
)%0A
+#
%7D%0A%0AE
@@ -2169,18 +2169,30 @@
ite123'%0A
-#
+DATABAS... |
7a786fd031c3faa057256abc5d9cb47618041696 | Configure max build age on the monitoring side | checks.d/veneur.py | checks.d/veneur.py | import datetime
from urlparse import urljoin
import requests
# project
from checks import AgentCheck
class Veneur(AgentCheck):
VERSION_METRIC_NAME = 'veneur.deployed_version'
BUILDAGE_METRIC_NAME = 'veneur.build_age'
MAX_AGE_CHECK_NAME = 'veneur.build_age.fresh'
# Check that the build is no more th... | Python | 0 | @@ -226,154 +226,8 @@
e'%0A%0A
- MAX_AGE_CHECK_NAME = 'veneur.build_age.fresh'%0A%0A # Check that the build is no more than one week old%0A MAX_DEPLOYMENT_INTERVAL = 604800%0A%0A%0A
@@ -616,336 +616,8 @@
te%0A%0A
- if tdelta.seconds %3E self.MAX_DEPLOYMENT_INTERVAL:%0A self.se... |
15a1cf906ae01a842e92442b59984953517c28c7 | Fix bind_addr check in testing module | cheroot/testing.py | cheroot/testing.py | """Pytest fixtures and other helpers for doing testing by end-users."""
from contextlib import closing
import errno
import socket
import threading
import time
import pytest
from six.moves import http_client
import cheroot.server
from cheroot.test import webtest
import cheroot.wsgi
EPHEMERAL_PORT = 0
NO_INTERFACE = ... | Python | 0.000001 | @@ -3411,37 +3411,136 @@
-host, port = server.bind_addr
+if isinstance(server.bind_addr, tuple):%0A host, port = server.bind_addr%0A else:%0A host, port = server.bind_addr, 0
%0A%0A
|
b2311319bc61f6e84943e801348e3b55b00d410f | remove unnecessary sys.path hack | chroot/__init__.py | chroot/__init__.py |
__version__ = '0.9.6'
import os
from os.path import abspath, normpath, join, exists, basename
import sys
# pylint: disable=E0611
# python-3.3 not yet supported in pylint
if sys.hexversion >= 0x03030000:
from socket import sethostname
# make sure that we are in sys.path
if abspath(normpath(join(__file__, '../..'... | Python | 0.000001 | @@ -239,172 +239,8 @@
me%0A%0A
-# make sure that we are in sys.path%0Aif abspath(normpath(join(__file__, '../..'))) not in sys.path:%0A sys.path.append(abspath(normpath(join(__file__, '../..'))))%0A%0A
from
|
ef6e0b681c1c7812e9d11fcd2fffd36468c00513 | Create custom field : SearchButtonField (#77) | cineapp/widgets.py | cineapp/widgets.py | # -*- coding: utf-8 -*-
from wtforms import fields, widgets
# Define wtforms widget and field
class CKTextAreaWidget(widgets.TextArea):
def __call__(self, field, **kwargs):
kwargs.setdefault('class_', 'ckeditor')
html_string = super(CKTextAreaWidget, self).__call__(field, **kwargs)
html_st... | Python | 0 | @@ -558,8 +558,754 @@
idget()%0A
+%0A# Widget which returns a complete search bar with a glyphicon button%0Aclass SearchButtonWidget(widgets.SubmitInput):%0A%0A html_params = staticmethod(widgets.html_params)%0A input_type = 'submit'%0A%0A def __call__(self, field, **kwargs):%0A kwargs.setdefault('id',... |
b54a3fa45cca86fddcd6130e67a306d93a079fff | update Config File parsing to new API | Samples/Python/sample.py | Samples/Python/sample.py | import Ogre
import OgreRTShader
class SGResolver(Ogre.MaterialManager_Listener):
def __init__(self, shadergen):
Ogre.MaterialManager_Listener.__init__(self)
self.shadergen = shadergen
def handleSchemeNotFound(self, idx, name, mat, lod_idx, rend):
if name != OgreRTShader.cvar.ShaderGene... | Python | 0 | @@ -860,78 +860,98 @@
sec
- in (%22Essential%22, %22Popular%22):%0A for kind in (%22Zip%22, %22FileSystem%22
+, settings in cfg.getSettingsBySection().items():%0A for kind, loc in settings.items(
):%0A
@@ -965,26 +965,67 @@
-for loc in
+rgm.addResourceLocation(loc, kind, sec)%0A%0A arch =
c... |
f5161f202dab424bd0e77688dd8a1e687e0f4df0 | disable locking for now | vizier/mqttinterface.py | vizier/mqttinterface.py | import paho.mqtt.client as mqtt
import queue
import threading
import logging
# CountDownLatch for some MQTT client checking
class _CountDownLatch():
"""This class handles some synchronization behind starting the paho MQTT client
Attributes:
_cv (threading.Condition): Condition variable for waiting on... | Python | 0 | @@ -3506,32 +3506,33 @@
%22%22%22%0A%0A
+#
with self.lock:%0A
@@ -3523,36 +3523,32 @@
with self.lock:%0A
-
self.cal
@@ -3582,20 +3582,16 @@
lback%7D)%0A
-
@@ -4423,32 +4423,34 @@
%22%22%22%0A%0A
+ #
with self.lock:
@@ -4442,36 +4442,32 @@
with self.lock:%0A
- ... |
1ed92c2577cdf8bfcf30310037dc2e802b665f26 | jimmy files needs to return unjimmied file if ok | Wrappers/Shelx/Shelxc.py | Wrappers/Shelx/Shelxc.py | #!/usr/bin/env python
# Shelxc.py
# Copyright (C) 2006 CCLRC, Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# 16th November 2006
#
# A wrapper for SHELXC from the SHELX phasing package. SHELXC prepares
# the data for su... | Python | 0.999797 | @@ -2167,32 +2167,37 @@
return
+ file
%0A%0A sh
|
3348796c4af9f1b5c7a6c619e7ae98379fea328d | Version file update | great_expectations/version.py | great_expectations/version.py | import os
import subprocess
import logging
logger = logging.getLogger(__name__)
tag = "0.8.0a1"
git_directory = os.environ.get("GE_DEV_DIR")
def get_git_describe_string():
return subprocess.check_output(["git", "describe"]).decode().strip()
def get_git_revision_hash():
return subprocess.check_output(['git... | Python | 0.000001 | @@ -871,9 +871,8 @@
_ = tag%0A
-%0A
|
01ec4fd2e294bcb524c6724d6727da7b1a882f0d | Exit code 2 for normal not running remote status | guild/commands/remote_impl.py | guild/commands/remote_impl.py | # Copyright 2017-2018 TensorHub, 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 agreed to in writ... | Python | 0 | @@ -1521,16 +1521,29 @@
i.error(
+%0A
%22remote
@@ -1586,16 +1586,43 @@
name, e)
+,%0A exit_status=2
)%0A ex
|
859d5ce6553b7651f05f27adec28e8c4330ca9bb | Add id of node generating the supervisor event | handler/supervisor_to_serf.py | handler/supervisor_to_serf.py | #!/usr/bin/env python
import json
import sys
from utils import serf_event
def write_stdout(s):
sys.stdout.write(s)
sys.stdout.flush()
def write_stderr(s):
sys.stderr.write(s)
sys.stderr.flush()
def main():
while True:
write_stdout('READY\n') # transition from ACKNOWLEDGED to READY
... | Python | 0.000001 | @@ -626,16 +626,74 @@
tname'%5D%0A
+ data_dict%5B'node'%5D = serf('info')%5B'agent'%5D%5B'name'%5D%0A
@@ -708,15 +708,18 @@
nt('
-myevent
+supervisor
', j
|
20bc11aab936e96109c6d5407b22b0c40e256a54 | total score should never be negative | pranger/front/views.py | pranger/front/views.py | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from collections import defaultdict
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from braces.views import ... | Python | 0.999999 | @@ -2398,16 +2398,93 @@
eg = -6%0A
+ total = sum_neg + sum_pos%0A if total %3C 0%0A total = 0%0A
@@ -2542,33 +2542,21 @@
total':
-sum_neg + sum_pos
+total
%7D%0A%0A%0Aclas
|
2b0acfcd5a1fd5529ed8abf0af32fd986f3f4534 | Add Uses and Provides classes to metadata module | wmtmetadata/metadata.py | wmtmetadata/metadata.py | """Create the metadata files describing a WMT component."""
import os
import warnings
import json
from wmtmetadata.utils import commonpath
indent = 2
class MetadataBase(object):
def __init__(self, component):
self.filename = None
self.data = None
self.api = component['api']
sel... | Python | 0 | @@ -64,16 +64,41 @@
port os%0A
+import re%0Aimport fnmatch%0A
import w
@@ -117,16 +117,28 @@
rt json%0A
+import yaml%0A
from wmt
@@ -170,16 +170,53 @@
monpath%0A
+from wmtmetadata import metadata_dir%0A
%0A%0Aindent
@@ -587,16 +587,394 @@
%5B'uses'%5D
+%0A self.component_config_file = os.path.join(metadat... |
e3916e6403b8933d9d8896b7289321c45b9990d2 | Refactor if clause to check for string in list | wqflask/wqflask/docs.py | wqflask/wqflask/docs.py | import codecs
from flask import g
from wqflask.database import database_connection
class Docs:
def __init__(self, entry, start_vars={}):
results = None
with database_connection() as conn, conn.cursor() as cursor:
cursor.execute("SELECT Docs.title, CAST(Docs.content AS BINARY) "
... | Python | 0 | @@ -1169,17 +1169,16 @@
%22%5C%5C'%22)%0A
-%0A
try:
@@ -1202,33 +1202,37 @@
r_session.record
-%5B
+.get(
'user_email_addr
@@ -1227,37 +1227,38 @@
r_email_address'
-%5D ==
+) in %5B
%22zachary.a.sloan
@@ -1272,58 +1272,9 @@
com%22
- or g.user_session.record%5B'user_email_address'%5D ==
+,
%22la
@@ -1285,3... |
db38dc62a19ccb0979b22a89a00ca38236fbf098 | Use maxsplits to only examine a single event at a time | sseclient.py | sseclient.py | import codecs
import re
import time
import warnings
import six
import requests
# Technically, we should support streams that mix line endings. This regex,
# however, assumes that a system will provide consistent line endings.
end_of_field = re.compile(r'\r\n\r\n|\r\r|\n\n')
class SSEClient(object):
def __init... | Python | 0.000032 | @@ -2289,16 +2289,17 @@
_chunk)%0A
+%0A
@@ -2732,38 +2732,144 @@
-s
+# S
plit
-= re.split(end_of_field,
+the complete event (up to the end_of_field) into event_string,%0A # and retain anything after the current complete event in
sel
@@ -2873,17 +2873,16 @@
self.buf
-)
%0A
@@ -2886,8... |
895dd0343867e81a5129c1aa2c07c431b645d0f2 | version 0.5.0 | api/info.py | api/info.py | from collections import OrderedDict
from rest_framework import viewsets, mixins, response, reverse
NAME = 'vsemionov.notes.api'
VERSION = '0.4.3'
class InfoViewSet(mixins.ListModelMixin,
viewsets.GenericViewSet):
view_name = 'Info'
@staticmethod
def _get_user_url(request):
ret... | Python | 0.000002 | @@ -140,11 +140,11 @@
'0.
-4.3
+5.0
'%0A%0A%0A
|
cee5e2aae5144fd1280240e069895049fe34de96 | Update osmfilter.py | osm-atlas-get/osmfilter.py | osm-atlas-get/osmfilter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#interface for osmconvert+osmfilter
def get_args():
p = argparse.ArgumentParser(description='Filter pbf file using osmfilter')
p.add_argument('--filter', help='filter string', type=str)
p.add_argument('--debug', '-d', help='debug mode', action='store_true')
... | Python | 0.000001 | @@ -77,16 +77,43 @@
filter%0A%0A
+import tempfile%0Aimport os%0A%0A
def get_
@@ -558,39 +558,189 @@
m_unfiltered
-_filename = 'a'
+ = tempfile.NamedTemporaryFile(suffix=%22.o5m%22)%0A o5m_filtered = tempfile.NamedTemporaryFile(suffix=%22.o5m%22)%0A o5m_unfiltered_filename = o5m_unfiltered.name
%0A ... |
e24f7cbbc1495ccefeeb4c17d78b3afcc93208e1 | Remove the @skip decorator for the whole class: | test/forward/TestForwardDeclaration.py | test/forward/TestForwardDeclaration.py | """Test that forward declaration of a data structure gets resolved correctly."""
import os, time
import unittest2
import lldb
from lldbtest import *
@unittest2.skip("rdar://problem/8641483 ./dotest.py -v -t -w forward seg faults")
class ForwardDeclarationTestCase(TestBase):
mydir = "forward"
@unittest2.skip... | Python | 0.001719 | @@ -148,90 +148,8 @@
*%0A%0A
-@unittest2.skip(%22rdar://problem/8641483 ./dotest.py -v -t -w forward seg faults%22)%0A
clas
@@ -493,24 +493,92 @@
laration()%0A%0A
+ # rdar://problem/8648070%0A # 'expression *bar_ptr' seg faults%0A
# rdar:/
@@ -594,16 +594,16 @@
8546815%0A
-
# '.
@@ -689,23 +689,71 ... |
d4465950937f961d477041e1ff21cd9c24bceada | fix typos | km3modules/hits.py | km3modules/hits.py | """Hit processing classes.
This module defines 2 base classes: HitStatistics (e.g. to count n_doms)
and HitSelector (e.g. FirstHits).
"""
import numpy as np
import pandas as pd # noqa
from scipy.stats import trimboth
from km3pipe.dataclasses import HitSeries
from km3pipe import Module
class HitStatistics(Module... | Python | 0.999974 | @@ -1739,24 +1739,16 @@
efault='
-Selected
Hits'%0A
@@ -1960,32 +1960,24 @@
y_out') or '
-Selected
Hits'%0A%0A d
@@ -2428,38 +2428,38 @@
ies.
-from_table(hits, event_id=None
+deserialise(hits, fmt='pandas'
)%0A%0A
@@ -4273,18 +4273,23 @@
lo =
-df
+pd_hits
.quantil
@@ -4334,10 +4334,15 @@
i =
-df
+pd... |
fc3be727f7ab6a05da3d4e456482205ebb66b41a | Fix typo in parameter name | flocker/node/agents/functional/test_ebs.py | flocker/node/agents/functional/test_ebs.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for ``flocker.node.agents.ebs`` using an EC2 cluster.
"""
from uuid import uuid4
from bitmath import Byte
from boto.exception import EC2ResponseError
from twisted.trial.unittest import SkipTest
from eliot.testing import LoggedMessag... | Python | 0.000558 | @@ -5892,17 +5892,16 @@
ataset_i
-s
d=uuid4(
|
665943c0736cd83662bc8bebe072045f163b28c9 | Revise func docstrring | alg_insertion_sort.py | alg_insertion_sort.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def insertion_sort(nums):
"""Insertion Sort algortihm.
Time complexity: O(n^2).
Space complexity: O(1).
"""
# Starting at pos i >= 1, swap (num[j-1], num[j]), for j=i,i-1,...,1,
# if o... | Python | 0.000013 | @@ -147,17 +147,17 @@
sertion
-S
+s
ort algo
|
7ee2bae6ef9fa083cc83e04e283dc9789d513870 | Make Ctrl-C correctly abort `smugcli login`. | smugcli/smugmug_oauth.py | smugcli/smugmug_oauth.py | # SumgMug OAuth client
import bottle
import rauth
import requests
import requests_oauthlib
import socket
import subprocess
import threading
from urllib import parse
import webbrowser
from wsgiref.simple_server import make_server
OAUTH_ORIGIN = 'https://secure.smugmug.com'
REQUEST_TOKEN_URL = OAUTH_ORIGIN + '/services... | Python | 0 | @@ -63,33 +63,31 @@
ests
-%0Aimport requests_oauthlib
+_oauthlib%0Aimport signal
%0Aimp
@@ -115,16 +115,27 @@
process%0A
+import sys%0A
import t
@@ -189,54 +189,8 @@
wser
-%0Afrom wsgiref.simple_server import make_server
%0A%0AOA
@@ -838,19 +838,16 @@
port
-%7D%0A app =
+, 'app':
bot
@@ -858,24 +858,34 @@
... |
61759cc90d5c95c5877d1ec8b538279c16101437 | add star back in | clastic/routing.py | clastic/routing.py | # -*- coding: utf-8 -*-
import re
BINDING = re.compile(r'\<(?P<name>[A-Za-z_]\w*)(?P<op>[?+:]*)(?P<type>\w+)*\>')
TYPES = {'int': int, 'float': float, 'unicode': unicode, 'str': unicode}
_path_seg_tmpl = '(?P<%s>(/[\w%%\d])%s)'
_OP_ARITY_MAP = {'': False, # whether or not an op is "multi"
'?': Fals... | Python | 0.000002 | @@ -88,16 +88,17 @@
%3Cop%3E%5B?+:
+*
%5D*)(?P%3Ct
@@ -3315,16 +3315,172 @@
rint d%0A%0A
+ d = rp.match_url('/a/b/1/thing/')%0A print d%0A%0A rp = RoutePattern('/a/b/%3Ct:int%3E/thing/%3Cdas*int%3E')%0A d = rp.match_url('/a/b/1/thing/')%0A print d%0A%0A
%0Aif __na
|
1b47086e3ef45b6e668ed330ac017badc0afae96 | Add opbeat contrib | defprogramming/settings.py | defprogramming/settings.py | # Django settings for defprogramming project.
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
ADMINS = ()
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db/development.sqlite3'),
}
}
TIME_ZONE = 'America/Chic... | Python | 0 | @@ -1673,16 +1673,45 @@
edusa',%0A
+ 'opbeat.contrib.django',%0A
)%0A%0AMEDUS
|
9bb587c6650c0de64c1ec582c6b3f73e38e300c9 | Correct max lines on log clipping | changes/listeners/mail.py | changes/listeners/mail.py | from __future__ import absolute_import, print_function
from flask import current_app, render_template
from flask_mail import Message, sanitize_address
from changes.config import db, mail
from changes.constants import Result, Status
from changes.models import Build, TestGroup, ProjectOption, LogSource, LogChunk
def ... | Python | 0.000001 | @@ -2953,12 +2953,12 @@
s()%5B
-:
-25
+:
%5D)%0A%0A
|
22029728795a850d1b57824c6a91ddd5378f9760 | fix some typos | robj/__init__.py | robj/__init__.py | #
# Copyright (c) 2010 rPath, Inc.
#
# This program is distributed under the terms of the MIT License as found
# in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licenses/mit-license.php.
#
# This program is distributed in the hope that it will be useful, b... | Python | 0.999999 | @@ -533,16 +533,17 @@
ly inten
+d
ed for u
@@ -561,16 +561,17 @@
th provi
+d
ed REST
|
1b6b7de39dcb80ff083bd21c6665c0dcaa5200fa | Update last_api_activity in Tooltron add_card_event view. | robocrm/views.py | robocrm/views.py | from django.http import HttpResponse
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.contrib.auth import authenticate, login
from api.models import APIRequest
from django.views.decorators.http import require_POST
from projects.models import Project
from .models import *
def roboauth... | Python | 0 | @@ -278,16 +278,50 @@
Project%0A
+from django.utils import timezone%0A
from .mo
@@ -1213,17 +1213,21 @@
POST
-%5B
+.get(
'tstart'
%5D #
@@ -1222,17 +1222,17 @@
'tstart'
-%5D
+)
# TODO:
@@ -1273,16 +1273,20 @@
POST
-%5B
+.get(
'tend'
-%5D
+)
%0A u
@@ -1302,25 +1302,29 @@
request.POST
-%5B
+.get(
'user_id'... |
1d1f5003a6493cbd8556b4f16d5a591d1cc2ace2 | Update VersionOneAgent3.py | PlatformAgents/com/cognizant/devops/platformagents/agents/alm/versionone/VersionOneAgent3.py | PlatformAgents/com/cognizant/devops/platformagents/agents/alm/versionone/VersionOneAgent3.py | #-------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
# Copyright 2017 Cognizant Technology Solutions
#
# 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 ... | Python | 0 | @@ -981,16 +981,17 @@
aseAgent
+3
import
|
bd548cc863754533b8a5d6cff21455c91061fbce | Changing the action keys to lowercase | rofi/shutdown.py | rofi/shutdown.py | #!/usr/bin/env python3
import glob
import logging
import os
import sys
from rofi import Rofi
CURRENT_SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0]
LOG_FORMAT = ('[%(asctime)s PID %(process)s '
'%(filename)s:%(lineno)s - %(funcName)s()] '
'%(levelname)s -> \n'
... | Python | 0.999994 | @@ -532,16 +532,16 @@
('
-S
+s
witch
-U
+u
ser'
@@ -578,17 +578,17 @@
,%0A ('
-L
+l
ogoff',
@@ -610,17 +610,17 @@
,%0A ('
-S
+s
hutdown'
@@ -659,17 +659,17 @@
,%0A ('
-R
+r
estart',
@@ -916,54 +916,8 @@
list
-,%0A rofi_args=%5B'-i'%5D # case insensitive
%0A
@@ -1239,13 +1239,11 @@
%7... |
ad4b65346c5b38313ef9385984ffd28a329c7376 | fix event loop | shadowsocks/eventloop.py | shadowsocks/eventloop.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | Python | 0.000019 | @@ -4566,25 +4566,10 @@
f =
-defaultdict(list)
+%7B%7D
%0A%0A
@@ -4792,18 +4792,12 @@
%5Bfd%5D
-.append(f)
+ = f
%0A
@@ -4891,128 +4891,32 @@
-a = self._fd_to_f%5Bfd%5D%0A if len(a) %3C= 1:%0A self._fd_to_f%5Bfd%5D = None%0A else:%0A a.remove(f)
+self._fd_to_f%5Bfd%5D... |
ea1189790a3a0941c669a981d5a351de57a1b5ce | Use the oc.NWChemJsonReader() class. | docker/nwchem/src/run.py | docker/nwchem/src/run.py | import os
import subprocess
import jinja2
import json
import openchemistry as oc
def run_calculation(geometry_file, output_file, params, scratch_dir):
# Read in the geometry from the geometry file
# This container expects the geometry file to be in .xyz format
with open(geometry_file) as f:
xyz_st... | Python | 0 | @@ -1587,20 +1587,16 @@
s%0A %7D%0A
-
%0A con
@@ -2621,12 +2621,18 @@
oc.
-Psi4
+NWChemJson
Read
|
2a984234d6bef4667af9549459e1fd85fb213626 | Bump version to v1.14.20 | client/__init__.py | client/__init__.py | __version__ = 'v1.14.19'
FILE_NAME = 'ok'
import os
import sys
sys.path.insert(0, '')
# Add directory in which the ok.zip is stored to sys.path.
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
| Python | 0 | @@ -18,10 +18,10 @@
.14.
-19
+20
'%0A%0AF
|
6832112d69d8751229ca25f8269abcc6d82a3732 | fix config filename | kuyruk/__main__.py | kuyruk/__main__.py | from __future__ import absolute_import
import os
import ast
import logging
import argparse
from kuyruk import __version__, requeue, manager
from kuyruk.worker import Worker
from kuyruk.master import Master
from kuyruk.config import Config
logger = logging.getLogger(__name__)
def worker(config, args):
w = Worker(... | Python | 0.000031 | @@ -1778,70 +1778,8 @@
rgs)
-%0A if args.delete_config:%0A os.unlink(config.filename)
%0A%0A
@@ -2726,16 +2726,75 @@
value)%0A%0A
+ if args.delete_config:%0A os.unlink(args.config)%0A%0A
retu
|
8a6b644d35c771b0ec5a756d1f36a24a429b5def | Raise an exception on undefined template variables if in debug mode | antxetamedia/settings.py | antxetamedia/settings.py | import os
from django.utils.six import text_type
from django.template.base import TemplateSyntaxError
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'd2w#o#(!antcw5e%(#p5*pu(x=zhw60^byh$)ps+4#e8m#-fj!'
# SECURIT... | Python | 0.000001 | @@ -1881,13 +1881,12 @@
r
-eturn
+aise
Tem
|
c13f78f358b3befe71539804abc80df9179b6bfa | bump to v1.7.6 | client/__init__.py | client/__init__.py | __version__ = 'v1.7.5'
FILE_NAME = 'ok'
import os
import sys
sys.path.insert(0, '')
# Add directory in which the ok.zip is stored to sys.path.
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
| Python | 0.000001 | @@ -17,9 +17,9 @@
1.7.
-5
+6
'%0A%0AF
|
7687be07369281723bb331e9113bf5cd2ca1bc3b | fix import | analyzerdam/sqlDAM.py | analyzerdam/sqlDAM.py | '''
Created on Nov 9, 2011
@author: ppa
'''
import sys
import logging
from sqlalchemy import Column, Integer, String, Float, Sequence, create_engine, and_
from sqlalchemy.orm import sessionmaker, scoped_session
from pyStock.models import Quote, Tick
from pyStock import Base
from analyzerdam.baseDAM impo... | Python | 0.000001 | @@ -301,19 +301,12 @@
yzer
+.
dam
-.baseDAM
imp
|
bfce2efa821d83b83468858a068c9de7d96acab1 | Make connect to heat match python-heatclient shell method | dib.py | dib.py | #!/usr/bin/env python
import json
import yaml
import os
import heatclient.client
import keystoneclient.v2_0.client
import uuid
def parse(template):
return yaml.safe_load(template)
def get_identity_client(username, password, tenant_name):
auth_url = os.environ['OS_AUTH_URL']
return keystoneclient.v2_0.cl... | Python | 0.000002 | @@ -54,26 +54,53 @@
os%0A
+from keystoneclient.v2_0
import
-heat
client
-.
+ as ks_
clie
@@ -109,36 +109,65 @@
%0Aimport
-keystoneclient.v2_0.
+heatclient%0Afrom heatclient import client as heat_
client%0Ai
@@ -240,69 +240,149 @@
e)%0A%0A
-def get_identity_client(username, password, tenant_name):%0A
+keys... |
b67fff75b01c2fc8fff7f019991e658b8cb39561 | Fix chipseq resource logic when peak calling is not requested. | bcbio/chipseq/peaks.py | bcbio/chipseq/peaks.py | """High level parallel SNP and indel calling using multiple variant callers.
"""
import os
import copy
from bcbio.log import logger
from bcbio import bam, utils
from bcbio.pipeline import config_utils
from bcbio.pipeline import datadict as dd
from bcbio.chipseq import macs2
from bcbio.provenance import do
from bcbio.d... | Python | 0 | @@ -3984,16 +3984,17 @@
f mult %3C
+=
0:%0A
@@ -4033,12 +4033,20 @@
return m
-ult
+ax(mult, 1)
%0A
|
0872bb820c75a522c3947c372b0ebd63b9086c54 | [clamav] TCP port connection must be an integer | misp_modules/modules/expansion/clamav.py | misp_modules/modules/expansion/clamav.py | import base64
import io
import json
import logging
import sys
import zipfile
import clamd
from typing import Optional
from pymisp import MISPEvent, MISPObject
log = logging.getLogger("clamav")
log.setLevel(logging.DEBUG)
sh = logging.StreamHandler(sys.stdout)
sh.setLevel(logging.DEBUG)
fmt = logging.Formatter(
"%(... | Python | 0.999322 | @@ -1592,13 +1592,18 @@
st,
+int(
port)
+)
%0A
|
d9ee5286e3134a71a1e2f19f24c01fe4c30bdf6a | add domains | misp_modules/modules/expansion/onyphe.py | misp_modules/modules/expansion/onyphe.py | import json
# -*- coding: utf-8 -*-
import json
try:
from onyphe import Onyphe
except ImportError:
print("pyonyphe module not installed.")
misperrors = {'error': 'Error'}
mispattributes = {'input': ['ip-src', 'ip-dst', 'hostname', 'domains'], 'output': ['hostname', 'domain', 'ip-src', 'ip-dst','url']}
# poss... | Python | 0.000001 | @@ -1640,24 +1640,75 @@
s_list = %5B%5D%0A
+ domains_resolver = %5B%5D%0A domains_forward = %5B%5D%0A
for r in
@@ -1727,16 +1727,16 @@
ults'%5D:%0A
-
@@ -1986,28 +1986,343 @@
os_
-list.append(r%5B'os'%5D)
+target = r%5B'os'%5D%0A if os_target != 'Unknown':%0A os_list.a... |
76133ace8bcd48a3226cdcd15f8e7103f295f4b7 | Update yeti.py | misp_modules/modules/expansion/yeti.py | misp_modules/modules/expansion/yeti.py | import json
try:
import pyeti
except ImportError:
print("pyeti module not installed.")
from pymisp import MISPEvent, MISPObject
misperrors = {'error': 'Error'}
mispattributes = {'input': ['ip-src', 'ip-dst', 'hostname', 'domain'],
'format': 'misp_standard'
}
# possible mo... | Python | 0 | @@ -2400,66 +2400,9 @@
sp)%0A
- print('Event MISP %25s' %25 self.misp_event.to_json())
+%0A
%0A
@@ -2549,16 +2549,51 @@
ject')%7D%0A
+ print('results '%25 results)%0A
|
6e229622ff3bfce3750e4fe14bbd0d5b5d5a8d80 | Fix typo | metafunctions/tests/test_concurrent.py | metafunctions/tests/test_concurrent.py | import operator
import os
from unittest import mock
import functools
import colors
from metafunctions.tests.util import BaseTestCase
from metafunctions.util import node
from metafunctions.util import bind_call_state
from metafunctions.util import highlight_current_function
from metafunctions.util import concurrent
fr... | Python | 0.999999 | @@ -5404,25 +5404,24 @@
test_unpickl
-e
able_excepti
|
76b087986aa90967918ec52b459a857c11743203 | Update patterns | module/plugins/hoster/ZippyshareCom.py | module/plugins/hoster/ZippyshareCom.py | # -*- coding: utf-8 -*-
import re
from os import path
from urllib import unquote
from urlparse import urljoin
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class ZippyshareCom(SimpleHoster):
__name__ = "ZippyshareCom"
__type__ = "hoster"
__version__ = "0.60"
_... | Python | 0 | @@ -589,19 +589,22 @@
r'(%22
-/%5Bdi%5D/%5Cd+/%22
+%5Cd%7B6,%7D/%22%5B %5D*%5C+
.+?%22
@@ -1248,16 +1248,218 @@
try:%0A
+ m = re.search(r'%5C+%5B %5D*%5C((%5Cd+)%5B %5D*%5C%25%5B %5D*(%5Cd+)%5B %5D*%5C+%5B %5D*(%5Cd+)%5B %5D*%5C%25%5B %5D*(%5Cd+)%5C)%5B %5D*%5C+', self.html)%0A if m:%0A ... |
da5b65005b2b241708d3a3f4d26756e7d90fe40d | Update DepositfilesCom.py | module/plugins/hoster/DepositfilesCom.py | module/plugins/hoster/DepositfilesCom.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from urllib import unquote
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
class DepositfilesCom(SimpleHoster):
__name__ = "DepositfilesCom"
__type__ = "hoster"
... | Python | 0 | @@ -336,16 +336,18 @@
= r%22http
+s?
://%5B%5Cw%5C.
|
3ce75ad5f3e0178394e9d496327c2e11bb74c6ac | save schedule to SQL | app/data.py | app/data.py | from .models import Settings
from app import db
def get_query(db_model):
try:
q = db.session.query(db_model).order_by(db_model.index.desc()).first()
except AttributeError:
try:
q = db.session.query(db_model).order_by(db_model.index.desc()).first()
except AttributeError:
... | Python | 0 | @@ -927,12 +927,68 @@
on.commit()%0A
+%0Adef parse_timetable(input_json):%0A %0A%0A%0A return None
|
e77bc141c8e2564509f093059e61cfb98be79e56 | Add module docstring to __init__ | lamana/__init__.py | lamana/__init__.py | # -----------------------------------------------------------------------------
import lamana.input_
import lamana.distributions
import lamana.constructs
import lamana.theories
import lamana.output_
#from lamana.models import *
#import lamana.ratios
#import lamana.predictions
#import lamana.gamuts
__title__ = 'lamana... | Python | 0.000001 | @@ -73,16 +73,134 @@
-------%0A
+'''The main init file that stores the package version number.'''%0A# __version__ is used by find_version() in setup.py%0A%0A
import l
|
2cd901a3975691eb06f695f5e352c0bc46c923a0 | Bump version to 0.4.11 | lamana/__init__.py | lamana/__init__.py | # -----------------------------------------------------------------------------
import lamana.input_
import lamana.distributions
import lamana.constructs
import lamana.theories
import lamana.output_
#from lamana.models import *
#import lamana.ratios
#import lamana.predictions
#import lamana.gamuts
__title__ = 'lamana... | Python | 0 | @@ -417,12 +417,8 @@
4.11
--dev
'%0A__
|
ef6596637df513fd3c59b1d45916a41a4e82506f | Update yeti.py | misp_modules/modules/expansion/yeti.py | misp_modules/modules/expansion/yeti.py | import json
try:
import pyeti
except ImportError:
print("pyeti module not installed.")
from pymisp import MISPEvent, MISPObject
misperrors = {'error': 'Error'}
mispattributes = {'input': ['ip-src', 'ip-dst', 'hostname', 'domain'],
'format': 'misp_standard'
}
# possible mo... | Python | 0 | @@ -2449,18 +2449,16 @@
- #
object_
@@ -2513,18 +2513,16 @@
- #
if obje
@@ -2549,10 +2549,8 @@
- #
@@ -4077,21 +4077,28 @@
tribute(
-'url'
+obj_relation
, obj_to
|
edaaaf23bc13996bf571946128f206013045efbb | Resolve comilation issue for darwin-framework-tool on M1 (#21761) | scripts/build/build_darwin_framework.py | scripts/build/build_darwin_framework.py | #!/usr/bin/env -S python3 -B
# Copyright (c) 2022 Project Matter 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 ... | Python | 0 | @@ -669,16 +669,32 @@
, Popen%0A
+import platform%0A
%0A%0Adef ru
@@ -1330,16 +1330,25 @@
mand = %5B
+%0A
'xcodebu
@@ -1352,16 +1352,24 @@
ebuild',
+%0A
'-schem
@@ -1371,16 +1371,24 @@
scheme',
+%0A
args.ta
@@ -1396,16 +1396,32 @@
get,
- '-sdk',
+%0A '-sdk',%0A
'ma
@@ -1... |
35d39957d1a4fd847509384dab429092a39715e3 | Load pre-trained GloVe | distance.py | distance.py | # coding: utf-8
# Author: Hussein AL-NATSHEH <hussein.al-natsheh@ish-lyon.cnrs.fr>
# License: BSD 3 clause
# 2016
import pandas as pd
import argparse
import numpy as np
def load_data(dataset, verbose=0):
if dataset == "sts":
#Load STS data (combined 2012-2014 and cleaned)
data = pd.read_csv('data/sts_gs_all.csv... | Python | 0 | @@ -219,13 +219,13 @@
==
-%22sts%22
+'sts'
:%0A%09%09
@@ -554,16 +554,269 @@
n X, y%0A%0A
+def load_glove(filepath, verbose=0):%0A%09data = pd.read_csv(filepath, sep=' ', compression='gzip', skiprows=9, index_col=0, header=None, encoding='utf-8')%0A%09if verbose == 2:%0A%09%09print data.shape%0A%09%09print data.he... |
d15432dda3a06c08ad36901a72c6301f958b72e0 | Update OneFichierCom.py | module/plugins/hoster/OneFichierCom.py | module/plugins/hoster/OneFichierCom.py | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class OneFichierCom(SimpleHoster):
__name__ = "OneFichierCom"
__type__ = "hoster"
__version__ = "0.86"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)... | Python | 0 | @@ -227,17 +227,17 @@
_ = %220.8
-6
+7
%22%0A __
|
d258bbe78be9cdf8ca2251add74a903f054b032a | add login/logout views. closes #7 | app/urls.py | app/urls.py | """testP URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | Python | 0.000219 | @@ -716,29 +716,55 @@
rom
-register import views
+django.contrib.auth import views as auth_views%0A
%0A%0Aur
@@ -815,16 +815,496 @@
.urls),%0A
+ # Auth views. Look at this in order to see who to use%0A # https://docs.djangoproject.com/en/1.10/topics/auth/default/%0A%0A url(r'%5Eaccounts/login/$', auth_view... |
c136d416c2cb53449e1c175412eeaa46a2f78db1 | Fix syntax error in email service | zou/app/utils/emails.py | zou/app/utils/emails.py | from flask_mail import Message
from zou.app import mail, app
def send_email(subject, body, recipient_email, html=None):
"""
Send an email with given subject and body to given recipient.
"""
if html is None:
html = body
with app.app_context():
message = Message(
sender=... | Python | 0.001263 | @@ -347,16 +347,17 @@
re.com%3E%22
+,
%0A
|
d3adfcbcf281f00aa454d4d8e45f6d5502495bde | Add get_absolute_url to UserSerializer | api/users/serializers.py | api/users/serializers.py | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, Link
class UserSerializer(JSONAPISerializer):
id = ser.CharField(read_only=True, source='_id')
fullname = ser.CharField()
date_registered = ser.DateTimeField(read_only=True)
links = LinksFie... | Python | 0 | @@ -522,16 +522,82 @@
users'%0A%0A
+ def absolute_url(self, obj):%0A return obj.absolute_url%0A%0A
def
|
4b3f79ae5e30de867941d363d1f186d3c2494b4b | Remove obsolete token code. | api_sample/http_utils.py | api_sample/http_utils.py | # Copyright 2014 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 ... | Python | 0.000011 | @@ -2985,349 +2985,8 @@
.'%5D%0A
- # When requesting tokens for a specific client_id, if no tokens%0A # are found, the API server responds with an unexpected 500 error.%0A # Notice that specific case and fail a little more gracefully.%0A elif (response.status == 500 and%0A message == 'No tokens ex... |
45689b8b2d91310e4002a63253009fddae947bb3 | Bump copyright year in sphinx docs | doc/conf.py | doc/conf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from pycommand import __version__ as pycommand_version
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'pycommand'
copyright = '2013, Benjamin Althues'
ve... | Python | 0 | @@ -51,76 +51,17 @@
ort
-os%0Aimport sys%0Afrom pycommand import __version__ as pycommand_version
+pycommand
%0A%0Aex
@@ -232,16 +232,21 @@
= '2013
+-2015
, Benjam
@@ -276,24 +276,26 @@
ycommand
+._
_version
%0Arelease
@@ -286,16 +286,18 @@
_version
+__
%0Arelease
@@ -308,24 +308,26 @@
ycommand
+._
_versio... |
60b9dcdd06e67653f5a177fd7f4cfb82e9fc4be3 | Add 🔥 and ❄️ emojis for "hot" and "cold" statuses fix #16 | database.py | database.py | import logging
import shortener
import timeago
import datetime
from google.appengine.ext import ndb
from google.appengine.api import memcache
from helper import development
from apis.telegram import send_message
class StoryPost(ndb.Model):
title = ndb.StringProperty()
text = ndb.TextProperty()
message = ndb.T... | Python | 0.001821 | @@ -1,12 +1,29 @@
+# coding: utf-8%0A%0A
import loggi
@@ -225,16 +225,94 @@
essage%0A%0A
+TWO_HOURS = datetime.timedelta(hours=2)%0ATWO_DAYS = datetime.timedelta(days=2)%0A
%0Aclass S
@@ -2340,24 +2340,312 @@
published)%0A%0A
+ # Add %F0%9F%94%A5 emoji if story is hot and gained required score in less than 2 hou... |
cae93790520765d85ed990e44b8733b44ca5eace | Modify the OpsCenter startup script to generate an SSH keypair and push the public key to the GCP project metadata using gCloud | datastax.py | datastax.py | import yaml
def GenerateFirewall(context):
name = 'opscenterfirewall-' + context.env['name']
firewalls = [
{
'name': name,
'type': 'compute.v1.firewall',
'properties': {
'sourceRanges': [
'0.0.0.0/0'
],
... | Python | 0 | @@ -1679,73 +1679,160 @@
'''
-%7C
%0A
-#!/bin/bash%0A mkdir -p /mnt/data%0A chmod 777 /mnt/data%0A
+ #!/bin/bash%0A mkdir -p /mnt/data%0A chmod 777 /mnt/data%0A
@@ -1949,39 +1949,83 @@
nt/data%0A
-apt-ge... |
931614b081b5e6461e6706e3fde884fcfc889f55 | Update docs copyright notice | doc/conf.py | doc/conf.py | # -*- coding: utf-8 -*-
#
# Motor documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
import sys, os
sys.path[0:0] = [os.path.abspath('..')]
from pymongo import version as pymongo_version
import motor
# -- General configuration -------------------... | Python | 0 | @@ -1044,16 +1044,24 @@
= u'2016
+-present
MongoDB
|
173fcbb828f69530bace267bcd084f083a81d7e3 | Update copyright year | doc/conf.py | doc/conf.py | # -*- coding: utf-8 -*-
#
# Moulder documentation build configuration file, created by
# sphinx-quickstart on Sun Dec 14 11:15:19 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklea... | Python | 0.000001 | @@ -1464,17 +1464,17 @@
2009-202
-0
+1
, Sali L
|
858132382c57d181d5865162c8ff87db656d4de9 | split up functions better | artsy-dl.py | artsy-dl.py | #!/usr/bin/env python -tt
###########################################################
## ##
## artsy-dl.py ##
## ##
## Author: Tony Fischetti ... | Python | 0.000078 | @@ -2115,28 +2115,27 @@
out%0Adef get_
-good
+new
_filename(ar
@@ -2438,189 +2438,180 @@
e%0A%0A%0A
-%0Adef main(
+@cop_out%0Adef download_image(link
):%0A
-tre
+old_filenam
e =
+w
get
-_tree(THE_URL
+.download(link
)%0A
-%0A
-artist = get_artist(tree)%0A title, date = get_title_and_date(tree)%0A ... |
37f1c32cc1e6a81d103c018c91ae79359ee0d892 | Modify get_works_detail method | etl.py | etl.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup as bs
import re
from dao import DAO
import datetime
class ETL:
def __init__(self):
self.dao = DAO()
def get_monthly_ranking(self):
count = 0
ranking = []
intervals = ["1_20", "21_40", "41_... | Python | 0.000001 | @@ -2667,24 +2667,21 @@
-cover_ur
+detai
l = self
@@ -2691,21 +2691,22 @@
t_works_
-cover
+detail
(title_u
@@ -2707,16 +2707,28 @@
itle_url
+, actress_id
)%0A
@@ -2736,24 +2736,21 @@
if
-cover_ur
+detai
l is Non
@@ -2832,44 +2832,14 @@
end(
-%7B%22id%22: actress_id, %22img%22: cover_url%7D... |
7502dca0df5c7c3ea247b3bf63b2d60e7cad74ce | Remove redundant text search dictionary | anthology/database.py | anthology/database.py | """MongoDB backend"""
from pymongo import MongoClient, ASCENDING
from bson import ObjectId
class DatabaseError(Exception):
"""Raised for unrecoverable database errors"""
pass
def connection():
"""Return MongoClient connection object.
pymongo.MongoClient has it's own instance caching/connection poo... | Python | 0.999238 | @@ -1289,196 +1289,8 @@
rm:%0A
- search = %7B'$text': %7B%0A '$search': search_term,%0A '$language': 'none',%0A '$caseSensitive': False,%0A '$diacriticSensitive': False%0A %7D%7D%0A%0A
|
69912ea520a35f8c35a62d7a3c6efe1a9367f03f | Fix typo | ckanext/mapactiontheme/tests/test_admin_controller.py | ckanext/mapactiontheme/tests/test_admin_controller.py | from ckan.plugins.toolkit import config
import ckan.tests.helpers as helpers
import ckan.tests.factories as factories
from ckan.plugins import load
class TestCustomAdminController(helpers.FunctionalTestBase):
def setup(self):
super(TestCustomAdminController, self).setup()
self.admin = factories.Use... | Python | 0.999999 | @@ -1869,16 +1869,17 @@
ut a log
+g
ed in us
|
3ae496284e86815304736196bd66052fbfc9b81d | Support 'I Want you' | YoClient.py | YoClient.py | #!/usr/bin/env python
import httplib
import urllib
class YoClient:
Host = 'api.justyo.co'
Port = 80
NoticeAPI = '/yo/'
BroadcastAPI = '/yoall/'
Headers = {'Cache-Control': 'no-cache',
'Content-Type': 'application/x-www-form-urlencoded'}
#Proxy ... | Python | 0 | @@ -1662,16 +1662,338 @@
status%0A%0A
+%0Aclass IWantYo(YoClient):%0A%0A _imageGenratorUrl = 'http://www.hetemeel.com/unclesamshow.php'%0A%0A def setLink(self, text):%0A YoClient.setLink(self, self._genrateUrl(text))%0A%0A def _genrateUrl(self, text):%0A return %22%25s?%25s%22 %25 (self._imageGe... |
1c837e69d08fd30727e7c7756bb263d56ea5593c | store year, month and date always as integers | __init__.py | __init__.py |
# http://sourceforge.net/mailarchive/message.php?msg_id=25355232
# http://dret.net/bibconvert/tex2unicode
#from citeproc import
import re
from lxml import objectify
from warnings import warn
from . import csl
from ..util import set_xml_catalog
from ..warnings import PyteWarning
class CustomDict(dict):
def __... | Python | 0.000248 | @@ -2859,16 +2859,80 @@
month')%0A
+ args = %7Bkey: int(value) for key, value in args.items()%7D%0A
|
9ccbc97652db1b7e6c7888b783722eee9f438104 | make cbpro visible to tests | __init__.py | __init__.py | Python | 0 | @@ -0,0 +1,116 @@
+# for tests%0Afrom cbpro.authenticated_client import AuthenticatedClient%0Afrom cbpro.public_client import PublicClient%0A
| |
22d466a0f7010976f8cc340f77cc33e325ea6946 | Add route to add a photo to an user | sigma_core/views/user.py | sigma_core/views/user.py | # -*- coding: utf-8 -*-
import random
import string
from django.core.mail import send_mail
from django.http import Http404
from rest_framework import viewsets, decorators, status
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated, AllowAny
from dry_rest_permissions.gen... | Python | 0 | @@ -116,16 +116,69 @@
Http404
+%0Afrom django.views.decorators.csrf import csrf_exempt
%0A%0Afrom r
@@ -226,16 +226,25 @@
, status
+, parsers
%0Afrom re
@@ -778,16 +778,49 @@
%0A%22%22%22%0A%7D%0A%0A
+# TODO: use DetailSerializerMixin
%0Aclass U
@@ -5005,28 +5005,984 @@
status=status.HTTP_200_OK)%0A
+%0A @d... |
020015cccceb3c2391c4764ee2ec29dfc5c461c6 | Update plugin's register functions to return the object instance instead of performing the registration themselves | __init__.py | __init__.py | from . import LayerView
def getMetaData():
return { "name": "LayerView", "type": "View" }
def register(app):
app.getController().addView("LayerView", LayerView.LayerView())
| Python | 0 | @@ -117,48 +117,14 @@
-app.getController().addView(%22LayerView%22,
+return
Lay
@@ -141,10 +141,9 @@
erView()
-)
%0A
|
90656a3b4eedac9ae87dbdb5485994c58c2f78d9 | add pydq | __init__.py | __init__.py | # -*- coding: utf-8 -*-
import six
__title__ = 'requests'
__version__ = '0.0.1'
__author__ = 'Pyiner'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2015 Pyiner'
__all__ = ['DataQuery']
class DataQuery(object):
def __init__(self, data):
self.data = data
@staticmethod
def item_exist(item,... | Python | 0.000268 | @@ -46,16 +46,12 @@
= '
-requests
+pydq
'%0A__
|
b186ed26e3250d8b02c94f5bb3b394c35986bcf6 | Remove an import which snuck in but does not belong. | __init__.py | __init__.py | """
Spyral, an awesome library for making games.
"""
__version__ = '0.1.1'
__license__ = 'MIT'
__author__ = 'Robert Deaton'
import compat
import memoize
import point
import camera
import sprite
import scene
import _lib
import event
import animator
import animation
import pygame
import image
import color
import rect
... | Python | 0 | @@ -331,20 +331,8 @@
nal%0A
-import font%0A
impo
|
c4a4c9333c874b38c121ce1181c12e7ed5aacc88 | Add __init__.py | __init__.py | __init__.py | from ShellGraphics import * | Python | 0.006636 | @@ -2,14 +2,14 @@
rom
-S
+s
hell
-G
+g
raph
|
7bee2061fc0609205bb81dc781efbcd833ca74bb | Add save() interface on Workbook | Workbook.py | Workbook.py | import Worksheet
class Workbook(object):
def __init__(self, encoding='utf-8'):
self._worksheets = []
self._encoding = encoding
def add_sheet(self, worksheet):
self._worksheets.append(worksheet)
def new_sheet(self, sheet_name):
worksheet = Worksheet.Worksheet(sheet_name, self)
self._worksheets.append(w... | Python | 0.000001 | @@ -9,16 +9,42 @@
orksheet
+%0Afrom Writer import Writer
%0A%0Aclass
@@ -151,16 +151,52 @@
encoding
+%0A self._writer = Writer(self)
%0A%0A%09def a
@@ -498,8 +498,89 @@
(i, ws)%0A
+%0A def save(self, output_filename):%0A self._writer.save(output_filename)%0A
|
1ba0a6f93683a0e8f020abe5f34624db33c3a470 | Update the package version | __init__.py | __init__.py | '''Utility classes and functions for creating Alfred workflows'''
__version__ = '20130909.0'
from .alfred import Workflow, WorkflowInfo, Item, JsonFile, LINE
from .keychain import Keychain
| Python | 0 | @@ -81,18 +81,18 @@
'201309
-09
+13
.0'%0A%0Afro
|
9963de82cac9374f6a634b935d08a5499df97964 | Add RouteCollection cache | __init__.py | __init__.py | # -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
from __future__ import absolute_import;
import os.path;
import sys;
if sys.ve... | Python | 0 | @@ -5655,16 +5655,36 @@
a, list)
+ or metadata is None
;%0A%0A
|
8df7fecb367d27d59402797ecfb9c13ba4f438b7 | Fix reference to DEFAULT_USER_INTERFACE | __main__.py | __main__.py | #!/usr/bin/env python
#This is free and unencumbered software released into the public domain.
#
#Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
#software, either in source code form or as a compiled binary, for any purpose,
#commercial or non-commercial, and by any means.
#
#In jurisd... | Python | 0 | @@ -2470,16 +2470,21 @@
DEFAULT_
+USER_
INTERFAC
|
16280da485c5563a8ec187928a61c8ca5512a530 | fix set_final() method | fst.py | fst.py | import copy
import re
class State:
"""
State Class
"""
def __init__(self, id=''):
self.id = id
self.final = False
self.trans_map = {}
self.final_output = set()
def is_final(self):
return self.final
def set_final(self, final):
self.final = final... | Python | 0.000008 | @@ -317,36 +317,8 @@
inal
-%0A self.trans_map = %7B%7D
%0A%0A
|
0f7a2e05beab5f2d759bdaacdc34b6569dfd368d | Fix plugin name | __init__.py | __init__.py | from maya import cmds
import logging
import json
import imp
import os
# level = logging.DEBUG
level = logging.ERROR
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(level)
handler.setLevel(level)
def loadConfig():
""" Load config ... | Python | 0.000001 | @@ -2281,17 +2281,17 @@
dswith(%22
-r
+R
ush.py%22)
@@ -3753,33 +3753,33 @@
s.unloadPlugin(%22
-r
+R
ush.py%22)%0D%0A
@@ -3805,17 +3805,17 @@
Plugin(%22
-r
+R
ush.py%22)
|
c764c7ade8e9407136b2b855a74538d76392b955 | Allow all hosts | nonhumanuser/settings.py | nonhumanuser/settings.py | """
Django settings for nonhumanuser project.
Generated by 'django-admin startproject' using Django 1.9.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import ... | Python | 0 | @@ -4492,46 +4492,4 @@
om'%0A
-%0AALLOWED_HOSTS = %5B'www.nonhumanuser.com'%5D%0A
|
0b1b1ef6d3af248021125135b7534b3870517890 | Add tasks urls | task/urls.py | task/urls.py | Python | 0.000018 | @@ -0,0 +1,171 @@
+from django.conf.urls import include, url%0Afrom views import *%0Afrom rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token%0A%0Aurlpatterns = %5B%0A%5D
| |
42bd66cd7e272746f0bb2add6817cb935ea17898 | add blanks line - pep8 | nosdeputes/update_mps.py | nosdeputes/update_mps.py | import sys
import time
from json import load
from urllib2 import urlopen, HTTPError
from django.db import transaction
from memopol2.utils import get_or_create
from reps.models import Email, WebSite
from mps.models import MP
def update_personal_informations(_mp, mp):
_mp.full_name = mp["nom"]
_mp.last_name = ... | Python | 0.000006 | @@ -407,16 +407,17 @@
sion%22%5D%0A%0A
+%0A
def get_
@@ -595,24 +595,25 @@
ative_ptr)%0A%0A
+%0A
def get_new_
@@ -751,16 +751,17 @@
e_ptr)%0A%0A
+%0A
def set_
|
450fd3f082000eb2bb1774caf32a5c7cd5793ecc | manage http error for nosdeputes.fr | nosdeputes/update_mps.py | nosdeputes/update_mps.py | import sys
from json import load
from urllib2 import urlopen
from memopol2.utils import get_or_create
from reps.models import Email, WebSite
from mps.models import MP
def update_personal_informations(_mp, mp):
_mp.full_name = mp["nom"]
_mp.last_name = mp["nom_de_famille"]
_mp.an_webpage = mp["url_an"]
... | Python | 0 | @@ -4,16 +4,28 @@
ort sys%0A
+import time%0A
from jso
@@ -65,16 +65,27 @@
urlopen
+, HTTPError
%0A%0Afrom m
@@ -1138,32 +1138,49 @@
%0A a += 1%0A
+ try:%0A
mp = loa
@@ -1225,24 +1225,494 @@
)%5B%22depute%22%5D%0A
+ except HTTPError:%0A try:%0A print %22... |
85610d7e69abe8f75c9f64ede243dfaeb97b5601 | Update spider.py | script/spider.py | script/spider.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import thread, time, cv2
import numpy as np
from gpiozero import Motor, PWMLED
# Eyelib can be managed by following variables:
# blinking : If True start a blink animation (1 cycle)
# blinkspd : Speed of blinking
# eye : Eye image
# lid : Lid base image
import ... | Python | 0.000001 | @@ -259,16 +259,203 @@
linking%0A
+# eyeangle :Ddirection of view%0A# eyedistance : Distance of pupil from center%0A# eyelid : Lid aperture (0=full open, 100=full close)%0A# autoblink : If True blinking is automatic%0A
# eye
|
95a486b1b6658201ff6a3d1a1cd9dae7eb0f30a9 | Test merge | genome_browser_utils/build_new_database.py | genome_browser_utils/build_new_database.py | #!/usr/bin/python
import MySQLdb
import re
import os
import csv
import sys
def generate_sql_dict_from_csv(naming_csv):
transactions = []
with open(naming_csv, 'rb') as f:
reader = csv.reader(f)
print "reading headers..."
header = reader.next()
for rownum, row in enumerate(reade... | Python | 0.000001 | @@ -395,16 +395,29 @@
it(%22;%22)%0A
+%3C%3C%3C%3C%3C%3C%3C HEAD%0A
%09 pri
@@ -866,16 +866,631 @@
ow%5B7%5D %7D%0A
+=======%0A splitName = proc_row%5B1%5D.split()%0A name = splitName%5B0%5D%5B:3%5D.lower() + splitName%5B1%5D%5B0%5D.upper() + splitName%5B1%5D%5B1:3%5D.lower() + str(435)%0A ... |
f37f556ed497cf9c69f780290465610216ed6f5c | refactor ProfileViewTestCase: add setUp inherited by super class | english_diary/profiles/tests/test_views.py | english_diary/profiles/tests/test_views.py | from django.test import Client
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
import datetime
from core.tests.base import BaseTestCase
from profiles.utils import set_expiration_date
class ProfileViewTestCase(BaseTestCase):
def test_verify_user_verification_key(self):... | Python | 0.000001 | @@ -277,48 +277,69 @@
def
-test_verify_user_verification_key(self):
+setUp(self):%0A super(ProfileViewTestCase, self).setUp()
%0A
@@ -335,32 +335,37 @@
setUp()%0A
+self.
client = Client(
@@ -357,32 +357,82 @@
lient = Client()
+%0A%0A def test_verify_user_verification_key(self):
%0A re... |
013b33c8e8e788a2567449846a050b45ebdd4011 | Improve sbl bot. Fix parser to properly parse netblocks as well as all ip addresses. | abusehelper/contrib/spamhaus/sbl.py | abusehelper/contrib/spamhaus/sbl.py | import idiokit
from abusehelper.core import cymruwhois, bot, events
class SpamhausSblBot(bot.PollingBot):
use_cymru_whois = bot.BoolParam(default=True)
sbl_filepath = bot.Param("Filename of Spamhaus SBL file")
@idiokit.stream
def poll(self):
skip_chars = ["#", ":", "$"]
self.log.info(... | Python | 0 | @@ -210,24 +210,969 @@
SBL file%22)%0A%0A
+ def _event(self):%0A event = events.Event()%0A event.add(%22feed%22, %22spamhaus block list%22)%0A event.add(%22type%22, %22spambot%22)%0A return event%0A%0A @idiokit.stream%0A def _cymru_augment(self, event, key):%0A if self.use_c... |
ce45df98d7fbd9b2679d20ac21a188a18295b667 | remove debug print | 3rdParty/V8/v5.7.0.0/gypfiles/gyp_v8.py | 3rdParty/V8/v5.7.0.0/gypfiles/gyp_v8.py | # Copyright 2013 the V8 project authors. 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 conditi... | Python | 0.000008 | @@ -2336,38 +2336,8 @@
e)%0A%0A
-print(%22x%22*80)%0Aprint(sys.argv)%0A
sys.
|
0ec01e1c5770c87faa5300b80c3b9d6bcb0df41b | Make sure to return python values, not lxml objects | tcxparser.py | tcxparser.py | "Simple parser for Garmin TCX files."
from lxml import objectify
__version__ = '0.3.0'
class TcxParser:
def __init__(self, tcx_file):
tree = objectify.parse(tcx_file)
self.root = tree.getroot()
self.activity = self.root.Activities.Activity
@property
def latitude(self):
... | Python | 0 | @@ -81,9 +81,9 @@
'0.
-3
+4
.0'%0A
@@ -371,32 +371,38 @@
.LatitudeDegrees
+.pyval
%0A%0A @property%0A
@@ -501,16 +501,22 @@
eDegrees
+.pyval
%0A%0A @p
@@ -710,16 +710,22 @@
-1%5D.Time
+.pyval
%0A%0A @p
@@ -828,16 +828,22 @@
ceMeters
+.pyval
%0A%0A @p
|
0e4b650f49cbfc44027d2b86c42c43abfc6dc494 | allow extending acknowledgments, closes #47 | django_datawatch/models.py | django_datawatch/models.py | # -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from dateutil import relativedelta
from django.utils import timezone
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from d... | Python | 0 | @@ -2680,16 +2680,228 @@
=True):%0A
+ # calculate end of requested acknowledgement%0A acknowledged_until = timezone.now() + relativedelta.relativedelta(days=days)%0A%0A # check that we're not accidentally overriding the current setup%0A
@@ -2961,20 +2961,32 @@
ritical)
- and
+:%0A ... |
c8d781d24f647264357c6919b1568fb5d37dbcf5 | use ADMIN_DATABASE instead of FRONTEND_DATABASE since the latter should not need write privileges to the database | dbmanage.py | dbmanage.py | #!/usr/bin/env python
"""
Imposter - Another weblog app
Copyright (c) 2010 by Jochem Kossen <jochem.kossen@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the abov... | Python | 0.000001 | @@ -1736,15 +1736,8 @@
nfig
- as cfg
%0A%0Ade
@@ -1837,35 +1837,35 @@
ontrol(url=c
-fg.FRONTEND
+onfig.ADMIN
_DATABASE, r
@@ -1977,27 +1977,27 @@
de(url=c
-fg.FRONTEND
+onfig.ADMIN
_DATABAS
@@ -2103,19 +2103,19 @@
DB(c
-fg.FRONTEND
+onfig.ADMIN
_DAT
@@ -2383,17 +2383,20 @@
ashify(c
-f
+onfi
g.SECRET
|
3ea8c93f34667effafb888f4ed350d80ba343c03 | Convert seconds to an int before waiting for it. | lettuce_webdriver/css_selector_steps.py | lettuce_webdriver/css_selector_steps.py | import time
from lettuce import step
from lettuce import world
from lettuce_webdriver.util import assert_true
from lettuce_webdriver.util import assert_false
from selenium.common.exceptions import WebDriverException
import logging
log = logging.getLogger(__name__)
def wait_for_elem(browser, sel, timeout=15):
s... | Python | 0.003539 | @@ -1897,24 +1897,28 @@
lector,
+int(
seconds)
%0A ass
@@ -1909,16 +1909,17 @@
seconds)
+)
%0A ass
|
3f18e4891b64c45fbda9ae88e9b508b5bc2cb03a | Add infinite loop; Add env vars | temp2dash.py | temp2dash.py | import json
import requests
import sys
from temperusb import TemperHandler
URL="http://dashing:3030/widgets/inside"
SCALE=1.0
OFFSET=-3.0
th = TemperHandler()
devs = th.get_devices()
if len(devs) != 1:
print "Expected exactly one TEMPer device, found %d" % len(devs)
sys.exit(1)
dev = devs[0]
dev.set_calibr... | Python | 0.000001 | @@ -5,16 +5,26 @@
rt json%0A
+import os%0A
import r
@@ -42,16 +42,45 @@
ort sys%0A
+import time%0Aimport traceback%0A
from tem
@@ -112,72 +112,199 @@
er%0A%0A
-%0A
URL
-=%22http://dashing:3030/widgets/inside%22%0ASCALE=1.0%0AOFFSET=-3.0%0A
+ = os.environ%5B'DASHING_URL'%5D%0ASCALE = float(os.environ%5B'TEMP_SCALE... |
b6bb16516e44580396a700d91fc2435fc575d422 | remove debug code | dbt/main.py | dbt/main.py |
from dbt.logger import getLogger
import argparse
import os.path
import sys
import re
import dbt.version
import dbt.project as project
import dbt.task.run as run_task
import dbt.task.compile as compile_task
import dbt.task.debug as debug_task
import dbt.task.clean as clean_task
import dbt.task.deps as deps_task
impor... | Python | 0.02323 | @@ -1103,85 +1103,8 @@
ck()
-%0A else:%0A dbt.tracking.set_profiles_dir(parsed.profiles_dir)
%0A%0A
|
285ca0f2a469d0d11baad1120a5b0b1d0074aef3 | Update dbworker.py (#2) | dbworker.py | dbworker.py | # -*- coding: utf-8 -*-
from tinydb import TinyDB, Query
from tinydb.operations import increment, decrement
from texts import strings
from config import db_file
from utils import get_language
DEFAULT_WORD_COUNT = 3
DEFAULT_PREFIX_SUFFIX = True
DEFAULT_SEPARATOR = True
db = TinyDB(db_file)
def get_settings_text(us... | Python | 0 | @@ -830,19 +830,12 @@
urn
-True if len
+bool
(db.
@@ -873,23 +873,8 @@
id))
- %3E 0 else False
%0A%0A%0Ad
|
991c6bc16388e4470193462c4ce63468b22ca79a | Remove __author__ | __init__.py | __init__.py | from ioc import *
__author__ = "Wes Alvaro"
__copyright__ = "Copyright 2013 Google Inc."
__license__ = "MIT, see LICENSE"
| Python | 0.00012 | @@ -16,34 +16,8 @@
*%0A%0A
-__author__ = %22Wes Alvaro%22%0A
__co
|
19e12f1e492272bf4a69e0bc99106e78788b9c14 | Add PEP8 line terminator before EOF | __init__.py | __init__.py | from extract import * | Python | 0.000004 | @@ -14,8 +14,9 @@
import *
+%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.