commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
6722b8494a847ca62f77874f41ee47abc08c2a09
Move the images to the left
flumotion/component/converters/overlay/genimg.py
flumotion/component/converters/overlay/genimg.py
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # flumotion/component/converters/overlay/genimg.py: overlay image generator # # Flumotion - a streaming media server # Copyright (C) 2004 Fluendo (www.fluendo.com) # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU ...
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # flumotion/component/converters/overlay/genimg.py: overlay image generator # # Flumotion - a streaming media server # Copyright (C) 2004 Fluendo (www.fluendo.com) # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU ...
Python
0.000003
f66cee94d2ae4ba12cc8d56c40be0d2e07f69a5a
Tag 0.0.2
swingtix/bookkeeper/__init__.py
swingtix/bookkeeper/__init__.py
__VERSION__='0.0.1.1-29-gdc751f0M'
__VERSION__='0.0.1.1'
Python
0.000002
88a7b3251d96513111e20282e840d5e0f68aa9c8
Remove unused import
InvenTree/label/apps.py
InvenTree/label/apps.py
import os import shutil import logging from django.apps import AppConfig from django.conf import settings logger = logging.getLogger(__name__) class LabelConfig(AppConfig): name = 'label' def ready(self): """ This function is called whenever the label app is loaded """ sel...
import os import shutil import logging from django.db.utils import IntegrityError from django.apps import AppConfig from django.conf import settings logger = logging.getLogger(__name__) class LabelConfig(AppConfig): name = 'label' def ready(self): """ This function is called whenever the l...
Python
0.000001
101dae4f5a12605a791b0f81fb2ff599cbf2facb
Return early
mir/dlsite/cmd/dlorg.py
mir/dlsite/cmd/dlorg.py
# Copyright (C) 2016, 2017 Allen Li # # 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 wr...
# Copyright (C) 2016, 2017 Allen Li # # 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 wr...
Python
0.000233
6035ef056f6ca028828faad68a0a0954e581300e
Set L=4 to try other topology
ext/viro_constant.py
ext/viro_constant.py
# Manually set L L = 4 # OPERATIONS VIRO_DATA_OP = 0x0000 VIRO_DATA = 0x0802 VIRO_CONTROL = 0x0803 RDV_PUBLISH = 0x1000 RDV_QUERY = 0x2000 RDV_REPLY = 0x3000 DISCOVERY_ECHO_REQUEST = 0x4000 DISCOVERY_ECHO_REPLY = 0x5000 GW_WITHDRAW = ...
# Manually set L L = 3 # OPERATIONS VIRO_DATA_OP = 0x0000 VIRO_DATA = 0x0802 VIRO_CONTROL = 0x0803 RDV_PUBLISH = 0x1000 RDV_QUERY = 0x2000 RDV_REPLY = 0x3000 DISCOVERY_ECHO_REQUEST = 0x4000 DISCOVERY_ECHO_REPLY = 0x5000 GW_WITHDRAW = ...
Python
0.000002
fd1a6abb003832919eea99fce05e06188889527c
Change the urls import line. Fix #6
cerberos/urls.py
cerberos/urls.py
# -*- coding: utf-8 -*- from django.conf.urls import * from cerberos.views import * urlpatterns = patterns('', )
# -*- coding: utf-8 -*- from django.conf.urls.defaults import * from cerberos.views import * urlpatterns = patterns('', )
Python
0.000657
95778ca8d83a7c3b4c87cfd5b89b470abfc58f6a
support to assign version and additional filter
check_version.py
check_version.py
#!/usr/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hop...
#!/usr/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hop...
Python
0
bdcdeaea6eb760d91690439da43d72ef0673df48
change replace statement
fabfile/instagram.py
fabfile/instagram.py
#!/usr/bin/env python import csv import json from fabric.api import task import requests FIELDNAMES = ['date', 'username', 'caption', 'instagram_url', 'image', 'image_url', 'embed_code', 'approved'] class Photo(object): def __init__(self, **kwargs): for field in FIELDNAMES: if kwargs[field]...
#!/usr/bin/env python import csv import json from fabric.api import task import requests FIELDNAMES = ['date', 'username', 'caption', 'instagram_url', 'image', 'image_url', 'embed_code', 'approved'] class Photo(object): def __init__(self, **kwargs): for field in FIELDNAMES: if kwargs[field]...
Python
0.000266
54282a1b7c2ea707506078483cf806e9521f264c
update version number
fabsetup/_version.py
fabsetup/_version.py
__version__ = "0.7.7"
__version__ = "0.7.6"
Python
0.000002
a0ac28b8d55654e6da02b96cb7c85270a3267f3d
Add links for development_status and maintainers keys
template/module/__manifest__.py
template/module/__manifest__.py
# -*- coding: utf-8 -*- # Copyright <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Module name", "summary": "Module summary", "version": "11.0.1.0.0", # see https://odoo-community.org/page/development-status "development_status": "Alpha|Beta|Product...
# -*- coding: utf-8 -*- # Copyright <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Module name", "summary": "Module summary", "version": "11.0.1.0.0", "development_status": "Alpha|Beta|Production/Stable|Mature", "category": "Uncategorized", "web...
Python
0
7f63e544c914ae4f08436f64d679d6965937a43c
fix login
login.py
login.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Yuande Liu <miracle (at) gmail.com> from settings import USERNAME, PASSWORD import requests import lxml.html requests.adapters.DEFAULT_RETRIES = 3 def get_session(): """.. :py:method:: """ if not hasattr(get_session, 'session'): session = req...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Yuande Liu <miracle (at) gmail.com> from settings import USERNAME, PASSWORD import requests import lxml.html requests.adapters.DEFAULT_RETRIES = 3 def get_session(): """.. :py:method:: """ if not hasattr(get_session, 'session'): session = req...
Python
0.000002
d45a0d97b978c18bb0a40e4cec6d3dab6ec2d566
fix loading crystal.json
test/command_line/tst_refine.py
test/command_line/tst_refine.py
#!/usr/bin/env cctbx.python # # Copyright (C) (2013) 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. # """ Test command line program dials.refine by running a job with save...
#!/usr/bin/env cctbx.python # # Copyright (C) (2013) 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. # """ Test command line program dials.refine by running a job with save...
Python
0.000001
eca33ec2a4307009b049e001e49329496bb0ce93
Update test_ethiopia.py
test/countries/test_ethiopia.py
test/countries/test_ethiopia.py
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Author: ryanss <ryanssdev@icl...
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Author: ryanss <ryanssdev@icl...
Python
0.000001
e318497949a340b3b821efbc4492c8605441fa47
reformat code
flask_praetorian/constants.py
flask_praetorian/constants.py
import pendulum import enum from os.path import dirname, abspath DEFAULT_JWT_PLACES = ['header', 'cookie'] DEFAULT_JWT_COOKIE_NAME = 'access_token' DEFAULT_JWT_HEADER_NAME = 'Authorization' DEFAULT_JWT_HEADER_TYPE = 'Bearer' DEFAULT_JWT_ACCESS_LIFESPAN = pendulum.duration(minutes=15) DEFAULT_JWT_REFRESH_LIFESPAN = pe...
import pendulum import enum from os.path import dirname, abspath DEFAULT_JWT_PLACES = [ 'header', 'cookie' ] DEFAULT_JWT_COOKIE_NAME = 'access_token' DEFAULT_JWT_HEADER_NAME = 'Authorization' DEFAULT_JWT_HEADER_TYPE = 'Bearer' DEFAULT_JWT_ACCESS_LIFESPAN = pendulum.duration(minutes=15) DEFAULT_JWT_REFRESH_LIFESPA...
Python
0.999729
3024d4628044a22d9fc1ec0032351d1da0d4ed1a
make code more concise and fix spelling
h5py/_hl/vds.py
h5py/_hl/vds.py
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. """ High-level interface for creating HDF5 virtu...
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. """ High-level interface for creating HDF5 virtu...
Python
0.000123
6410dd998d8b65674941b3f4d217d27a8084ec25
fix commit getter
hal/cvs/gits.py
hal/cvs/gits.py
#!/usr/bin/env python # coding: utf-8 """ Handles main models in git repository """ from git import Repo from unidiff import PatchSet from hal.cvs.versioning import Version class Diff: """ Git diff result """ ADD = 'added' DEL = 'removed' def __init__(self, diff): """ :param diff...
#!/usr/bin/env python # coding: utf-8 """ Handles main models in git repository """ from git import Repo from unidiff import PatchSet from hal.cvs.versioning import Version class Diff: """ Git diff result """ ADD = 'added' DEL = 'removed' def __init__(self, diff): """ :param diff...
Python
0.000001
0ff88a6f75072b8bed822799b5ecf5b4d3412c66
fix params
firebase/__init__.py
firebase/__init__.py
import requests import urlparse #for urlparse and urljoin import os #for os.path.dirname import json #for dumps class Firebase(): ROOT_URL = '' #no trailing slash def __init__(self, root_url, auth_token=None): self.ROOT_URL = root_url.rstrip('/') self.auth_token = auth_token #These meth...
import requests import urlparse #for urlparse and urljoin import os #for os.path.dirname import json #for dumps class Firebase(): ROOT_URL = '' #no trailing slash def __init__(self, root_url, auth_token=None): self.ROOT_URL = root_url.rstrip('/') self.auth_token = auth_token #These meth...
Python
0.000004
3109bd9a1d01e926e4fce3373db93db8a2d091e0
Update 4.8_subtree.py
CrackingCodingInterview/4.8_subtree.py
CrackingCodingInterview/4.8_subtree.py
""" is a a subtree of b both are bst """ class Node: 02 ... 03 def compare_trees(self, node): 04 """ 05 Compare 2 trees 06 07 @param node tree's root node to compare to 08 @returns True if the tree passed is identical to this tree 09 """ def compare_trees(self...
""" is a a subtree of b both are bst """
Python
0
42cefe67849fd97c52210ba750077238d938fe6a
Fix TZ issue in order_by_score
drum/links/utils.py
drum/links/utils.py
from __future__ import division, unicode_literals from re import sub, split from django.conf import settings from django.utils.timezone import now def order_by_score(queryset, score_fields, date_field, reverse=True): """ Take some queryset (links or comments) and order them by score, which is basically ...
from __future__ import division, unicode_literals from re import sub, split from django.conf import settings from django.utils.timezone import now def order_by_score(queryset, score_fields, date_field, reverse=True): """ Take some queryset (links or comments) and order them by score, which is basically ...
Python
0
a38f2690ddcc72d24ab152b0c4c21ae51db7afa0
Update evaluate_task.py
docker/evaluate_task.py
docker/evaluate_task.py
# Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
# Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
Python
0.000007
e675431d8d2930ae4a110feb94990a75308695cb
Change startup sequence
svr_record.py
svr_record.py
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words # reader_worker = reader.run class svr_interface(): def __init__(self): self.current = 0 self.words = ['d...
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words # reader_worker = reader.run class svr_interface(): def __init__(self): self.current = 0 self.words = ['d...
Python
0.000032
610915acda146b7a241403b38f2a85cd579ae7d9
Update sliding-puzzle.py
Python/sliding-puzzle.py
Python/sliding-puzzle.py
# Time: O((m * n) * (m * n)!) # Space: O((m * n) * (m * n)!) # A* Search Algorithm class Solution(object): def slidingPuzzle(self, board): """ :type board: List[List[int]] :rtype: int """ def dot(p1, p2): return p1[0]*p2[0]+p1[1]*p2[1] def heuri...
# Time: O((m * n) * (m * n)! * log((m * n)!)) # Space: O((m * n) * (m * n)!) # A* Search Algorithm class Solution(object): def slidingPuzzle(self, board): """ :type board: List[List[int]] :rtype: int """ def heuristic_estimate(board, R, C, expected): result = 0 ...
Python
0
10a510dc3234860c697945c8c37393a9b5790b6c
Update lims.py
access/lims.py
access/lims.py
#!/usr/bin/python #Script that connects to the MySQL database and parses data from an html table #Import the mysql.connector library/module import sys import time import glob import re import os import requests from xml.etree import ElementTree def readconfig(): configfile = os.getenv('HOME') + '/.scilifelabrc' pa...
#!/usr/bin/python #Script that connects to the MySQL database and parses data from an html table #Import the mysql.connector library/module import sys import time import glob import re import os import requests from xml.etree import ElementTree def readconfig(): configfile = os.getenv('HOME') + '/.scilifelabrc' pa...
Python
0
c2c21fabd144ec25fa46fefdfe7c460a39aa2454
Update lims.py
access/lims.py
access/lims.py
#!/usr/bin/python #Script that connects to the MySQL database and parses data from an html table #Import the mysql.connector library/module import sys import time import glob import re import os import requests from xml.etree import ElementTree def readconfig(): configfile = os.getenv('HOME') + '/.scilifelabrc' pa...
#!/usr/bin/python #Script that connects to the MySQL database and parses data from an html table #Import the mysql.connector library/module import sys import time import glob import re import os import requests from xml.etree import ElementTree def readconfig(): configfile = os.getenv('HOME') + '/.scilifelabrc' pa...
Python
0
17157a4eb9d4aa934da89892f4f42f851902b44c
fix missing return in celery SiteRouter :rage1:
frappe/celery_app.py
frappe/celery_app.py
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, absolute_import from celery import Celery # initiate logger from celery.utils.log import get_task_logger task_logger = get_task_logger(__name__) from datetime import timedel...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, absolute_import from celery import Celery # initiate logger from celery.utils.log import get_task_logger task_logger = get_task_logger(__name__) from datetime import timedel...
Python
0
619b51a579801b8ae211cb062b00149c19af11a7
Make manage task more general
admin/tasks.py
admin/tasks.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os from invoke import task, run from tasks.utils import pip_install from website import settings HERE = os.path.dirname(os.path.abspath(__file__)) WHEELHOUSE_PATH = os.environ.get('WHEELHOUSE') @task() def manage(cmd_str): """Take command st...
# -*- coding: utf-8 -*- from __future__ import absolute_import import os from invoke import task, run from tasks.utils import pip_install from website import settings HERE = os.path.dirname(os.path.abspath(__file__)) WHEELHOUSE_PATH = os.environ.get('WHEELHOUSE') @task() def manage(cmd_str, target=''): """Take...
Python
0.000954
50a2ac8e5aeee2c4435707a72c22092e28ecf5ba
Update zeromq_server.py
examples/zeromq_server.py
examples/zeromq_server.py
from jsonrpcserver import Success, method, dispatch import zmq socket = zmq.Context().socket(zmq.REP) @method def ping(): return Success("pong") if __name__ == "__main__": socket.bind("tcp://*:5000") while True: request = socket.recv().decode() socket.send_string(dispatch(request))
import zmq from jsonrpcserver import Success, method, dispatch socket = zmq.Context().socket(zmq.REP) @method def ping(): return Success("pong") if __name__ == "__main__": socket.bind("tcp://*:5000") while True: request = socket.recv().decode() socket.send_string(dispatch(request))
Python
0.000001
80a5609b35baecfe8d208b9abec36b25c10bb609
Revert "minor date fix"
generic/reporting/reports.py
generic/reporting/reports.py
import datetime, time from generic.reporting.forms import DateRangeForm class Column(object): report = None order = 0 title = None chart_title = None chart_subtitle = None chart_yaxis = None def get_title(self): return self.title def set_report(self, report): self.repo...
import datetime, time from generic.reporting.forms import DateRangeForm class Column(object): report = None order = 0 title = None chart_title = None chart_subtitle = None chart_yaxis = None def get_title(self): return self.title def set_report(self, report): self.repo...
Python
0
709e9dddf94e8afa43d908e92f7c7d6bc0817e46
remove commented line
humid_temp.py
humid_temp.py
import weather_utils import Adafruit_DHT def get_data(): humidity, temp_c = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 4) temp_f = weather_utils.c_to_f(temp_c) return { 'temp_f': temp_f, 'temp_c': temp_c, 'humidity': humidity, 'dewptf': weather_utils.dewpoint_f(temp_f, humi...
# import Adafruit_Python_DHT import weather_utils import Adafruit_DHT def get_data(): humidity, temp_c = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 4) temp_f = weather_utils.c_to_f(temp_c) return { 'temp_f': temp_f, 'temp_c': temp_c, 'humidity': humidity, 'dewptf': weather_...
Python
0
b359d2418210499573705015f057a79d71899da7
Fix for empty raw-data option (#109)
alertaclient/commands/cmd_send.py
alertaclient/commands/cmd_send.py
import sys import click @click.command('send', short_help='Send an alert') @click.option('--resource', '-r', metavar='RESOURCE', required=True, help='Resource under alarm') @click.option('--event', '-e', metavar='EVENT', required=True, help='Event name') @click.option('--environment', '-E', metavar='ENVIRONMENT', h...
import sys import click @click.command('send', short_help='Send an alert') @click.option('--resource', '-r', metavar='RESOURCE', required=True, help='Resource under alarm') @click.option('--event', '-e', metavar='EVENT', required=True, help='Event name') @click.option('--environment', '-E', metavar='ENVIRONMENT', h...
Python
0.000001
c06e904588503768331a580d8766bf4a47f83574
add option "-k" to limit tests in test-install command (#2635)
allennlp/commands/test_install.py
allennlp/commands/test_install.py
""" The ``test-install`` subcommand verifies an installation by running the unit tests. .. code-block:: bash $ allennlp test-install --help usage: allennlp test-install [-h] [--run-all] [--include-package INCLUDE_PACKAGE] Test that installation works by running the unit t...
""" The ``test-install`` subcommand verifies an installation by running the unit tests. .. code-block:: bash $ allennlp test-install --help usage: allennlp test-install [-h] [--run-all] [--include-package INCLUDE_PACKAGE] Test that installation works by running the unit t...
Python
0
c7c39f9c32ca6f52ba60335ebbaa2b960e74fa8f
handle conversion better
twtoolbox/streaming.py
twtoolbox/streaming.py
# Twitter Toolbox for Python # Copyright 2016 Hugo Hromic # # 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 ...
# Twitter Toolbox for Python # Copyright 2016 Hugo Hromic # # 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 ...
Python
0
411b95793ff5e73e14949aabc3466a9f39336267
Figure out what's in that resp
micro.py
micro.py
#!/usr/bin/env python from __future__ import division from flask import Flask, render_template, url_for, session, request, g, \ redirect, flash from flaskext.oauth import OAuth import os #setup code app = Flask(__name__) app.secret_key = 'pagerduty' oauth = OAuth() facebook = oauth.remote_app('facebook', ba...
#!/usr/bin/env python from __future__ import division from flask import Flask, render_template, url_for, session, request, g, \ redirect, flash from flaskext.oauth import OAuth import os #setup code app = Flask(__name__) app.secret_key = 'pagerduty' oauth = OAuth() facebook = oauth.remote_app('facebook', ba...
Python
0.99993
5a0c6904c23a84d1ee931e3ef82f297197141222
add twitter and flags
light.py
light.py
#!/usr/bin/python """ light.py Read analog values from the photoresistor ======= run with: sudo ./light.py Copyright 2014 David P. Bradway (dpb6@duke.edu) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the...
#!/usr/bin/python """ light.py Read analog values from the photoresistor ======= run with: sudo ./light.py Copyright 2014 David P. Bradway (dpb6@duke.edu) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the...
Python
0
e6b3a02376f832ee1bf79905ececfc76933197fc
Fix client
client/client.py
client/client.py
import socket import os import json import time class Client(): def __init__(self): abs_prefix = os.path.join(os.path.dirname(__file__), "../client") with open(abs_prefix + '/config.json','r') as f: conf = json.load(f) self.port = conf["port"] self.host = conf["h...
import socket import os import json import time class Client(): def __init__(self): abs_prefix = os.path.join(os.path.dirname(__file__), "../data") with open(abs_prefix + '/config.json','r') as f: conf = json.load(f) self.port = conf["port"] self.host = conf["hos...
Python
0.000001
d4d4a065323d61073eb80a4f7f04d2902a33e4fe
fix ntb publish service get_filename for events
server/ntb/publish/ntb_publish_service.py
server/ntb/publish/ntb_publish_service.py
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2016 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2016 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
Python
0
936e6427c48ebbf16a12fb3afa0f48ad6c397046
fix feature input to hb-view
Lib/diffenator/utils.py
Lib/diffenator/utils.py
import subprocess from PIL import Image from fontTools.varLib.mutator import instantiateVariableFont try: from StringIO import StringIO except ImportError: # py3 workaround from io import BytesIO as StringIO def render_string(font, string, features=None, pt_size=128): """Use Harfbuzz to render a string""...
import subprocess from PIL import Image from fontTools.varLib.mutator import instantiateVariableFont try: from StringIO import StringIO except ImportError: # py3 workaround from io import BytesIO as StringIO def render_string(font, string, features=None, pt_size=128): """Use Harfbuzz to render a string""...
Python
0
1d51a59a6e1406852a081585e252afab892e9756
Handle cases where the states don't exist when getting dialogue config's states
go/apps/dialogue/vumi_app.py
go/apps/dialogue/vumi_app.py
# -*- test-case-name: go.apps.dialogue.tests.test_vumi_app -*- import pkg_resources import json from vumi.application.sandbox import SandboxResource from go.apps.jsbox.vumi_app import JsBoxConfig, JsBoxApplication def determine_endpoints(poll): names = set( s['channel_type'] for s in poll.get('...
# -*- test-case-name: go.apps.dialogue.tests.test_vumi_app -*- import pkg_resources import json from vumi.application.sandbox import SandboxResource from go.apps.jsbox.vumi_app import JsBoxConfig, JsBoxApplication def determine_endpoints(poll): names = set( s['channel_type'] for s in poll['stat...
Python
0.000002
7bce0c3e1c2cc0ca8f37916ad88abd0f91ba2c38
Update Keras.py
tanh/Keras.py
tanh/Keras.py
from keras.datasets import mnist from keras.initializers import RandomUniform from keras.layers import Dense from keras.models import Sequential from keras.optimizers import SGD from keras.utils import to_categorical batch_size = 128 epochs = 30 learning_rate = 0.5 (x_train, y_train), (x_test, y_test) = mn...
from keras.datasets import mnist from keras.initializers import RandomUniform from keras.layers import Dense from keras.models import Sequential from keras.optimizers import SGD from keras.utils import to_categorical batch_size = 128 epochs = 30 learning_rate = 0.5 (x_train, y_train), (x_test, y_test) = mn...
Python
0
ac545eb8b21ed1bfadc5649fc84e58da10a35846
Change `compose` to return a string instead of a generator
tinysrt.py
tinysrt.py
#!/usr/bin/env python '''A tiny library for parsing, modifying, and composing SRT files.''' import functools import re from datetime import timedelta from itertools import groupby SUBTITLE_PATTERN = r'(\d+)\n(\d+:\d+:\d+,\d+) --> (\d+:\d+:\d+,\d+)\n(.+?)\n\n' SUBTITLE_REGEX = re.compile(SUBTITLE_PATTERN, re.MULTILI...
#!/usr/bin/env python '''A tiny library for parsing, modifying, and composing SRT files.''' import functools import re from datetime import timedelta from itertools import groupby SUBTITLE_PATTERN = r'(\d+)\n(\d+:\d+:\d+,\d+) --> (\d+:\d+:\d+,\d+)\n(.+?)\n\n' SUBTITLE_REGEX = re.compile(SUBTITLE_PATTERN, re.MULTILI...
Python
0
7977939caa8b521bd99112a3d368e343db3169cd
Fix a bug about losing the owner of a password when doing a modification on the password
yithlibraryserver/views.py
yithlibraryserver/views.py
import json import bson from pyramid.httpexceptions import HTTPBadRequest from pyramid.view import view_config, view_defaults from yithlibraryserver.errors import password_not_found, invalid_password_id from yithlibraryserver.utils import jsonable from yithlibraryserver.validation import validate_password @view_de...
import json import bson from pyramid.httpexceptions import HTTPBadRequest from pyramid.view import view_config, view_defaults from yithlibraryserver.errors import password_not_found, invalid_password_id from yithlibraryserver.utils import jsonable from yithlibraryserver.validation import validate_password @view_de...
Python
0.000006
fa99e3eb8504016fee706347fe162c2692b74c70
Support concurrent loops.
gearman/client.py
gearman/client.py
""" Gearman client implementation. """ import sys import struct from collections import deque from twisted.internet import defer from twisted.protocols import stateful from twisted.python import log from constants import * __all__ = ['GearmanProtocol', 'GearmanWorker'] class GearmanProtocol(stateful.StatefulProto...
""" Gearman client implementation. """ import sys import struct from collections import deque from twisted.internet import defer from twisted.protocols import stateful from twisted.python import log from constants import * __all__ = ['GearmanProtocol', 'GearmanWorker'] class GearmanProtocol(stateful.StatefulProto...
Python
0
4063d94b405a41ead8d5c3df5a1d27dd1dba140f
remove config for warmup
gae/tap/warmup.py
gae/tap/warmup.py
# -*- coding: utf-8 -*- from functools import wraps import os import sys import webapp2 # Search Path def execute_once(func): @wraps(func) def inner(_result=[None], *argv, **kwargv): if _result[0] is None: _result[0] = func(*argv, **kwargv) if _result[0] is None: raise ValueError("The ...
# -*- coding: utf-8 -*- from functools import wraps import os import sys from google.appengine.api import lib_config import webapp2 # Config class ConfigDefaults(object): IS_TEST = "unittest" in sys.modules.keys() SITE_PACKAGES = "site-packages" config = lib_config.register("warmup", ConfigDefaults.__dict__) ...
Python
0.000001
3dfac1e6ef418e180d4967aba921ff527ff31e6b
Update ittr_multiplayer.py
nose_ittr/ittr_multiplayer.py
nose_ittr/ittr_multiplayer.py
__author__ = 'Sergey Ragatsky' __version__ = '0.0.2' import re import logging from types import FunctionType from itertools import product logger = logging.getLogger(__name__) def ittr(*args, **kwargs): """ Decorator that adds iteration attributes to test method """ def update_attr(func): # ...
__author__ = 'Sergey Ragatsky' __version__ = '0.0.2' import re import logging from types import FunctionType from itertools import product logger = logging.getLogger(__name__) def ittr(*args, **kwargs): """ Decorator that adds iteration attributes to test method """ def update_attr(func): # ...
Python
0.000001
d2466f376a19389a8cdc3aeaa070a30edb406b10
store 'curve_type' in layer's lib
Lib/ufo2ft/filters/cubicToQuadratic.py
Lib/ufo2ft/filters/cubicToQuadratic.py
from __future__ import ( print_function, division, absolute_import, unicode_literals) from ufo2ft.constants import DEFAULT_LAYER_NAME from ufo2ft.filters import BaseFilter from cu2qu.ufo import DEFAULT_MAX_ERR, CURVE_TYPE_LIB_KEY from cu2qu.pens import Cu2QuPointPen import logging logger = logging.getLogger(__n...
from __future__ import ( print_function, division, absolute_import, unicode_literals) from ufo2ft.filters import BaseFilter from cu2qu.ufo import DEFAULT_MAX_ERR, CURVE_TYPE_LIB_KEY from cu2qu.pens import Cu2QuPointPen import logging logger = logging.getLogger(__name__) class CubicToQuadraticFilter(BaseFilter...
Python
0
b842d9f553fe5c4cbf8273c2c11362b85c0ffbf5
Change _get_tests to static method.
health_monitor/models.py
health_monitor/models.py
""" Copyright 2017 Gracenote 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...
""" Copyright 2017 Gracenote 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
2ee4f2d423cf1b3dba9ceed3cd31db91ee0ce86d
Fix variable referenced before assignment
nsone/rest/transport/basic.py
nsone/rest/transport/basic.py
# # Copyright (c) 2014 NSONE, Inc. # # License under The MIT License (MIT). See LICENSE in project root. # from __future__ import absolute_import from nsone.rest.transport.base import TransportBase from nsone.rest.errors import ResourceException, RateLimitException, \ AuthException try: from urllib.request im...
# # Copyright (c) 2014 NSONE, Inc. # # License under The MIT License (MIT). See LICENSE in project root. # from __future__ import absolute_import from nsone.rest.transport.base import TransportBase from nsone.rest.errors import ResourceException, RateLimitException, \ AuthException try: from urllib.request im...
Python
0.002868
5f663eb971542d252186dbf9345ca458dca93c16
fix file not exist during render file
tpl/tpl.py
tpl/tpl.py
# -*- coding:utf-8 -*- import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import jinja2 from tpl import path from tpl import errors class Template(object): IGNORE_FILES = [ 'construct.sh', 'construct.py' ] def __init__(self, tpl_dir): ...
# -*- coding:utf-8 -*- import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import jinja2 from tpl import path from tpl import errors class Template(object): IGNORE_FILES = [ 'construct.sh', 'construct.py' ] def __init__(self, tpl_dir): ...
Python
0.000001
7b385ca9897ab8a7b25966cc54324a4b42596f7d
fix case of no saved lists or items
lists.py
lists.py
# manage list functions import os import redis import json r = redis.from_url(os.environ.get("REDIS_URL")) def getLists(): savedLists = r.get('lists') if savedLists == None: lists = [] else: lists = json.loads(savedLists) savedItems = r.get('items') if savedItems == None: i...
# manage list functions import os import redis import json r = redis.from_url(os.environ.get("REDIS_URL")) def getLists(): lists = [] items = [] lists = json.loads(r.get('lists')) items = json.loads(r.get('items')) return True def putLists() r.put('lists', json.dumps(lists)) r.pub('items'...
Python
0.00001
2a08d3154992b5f0633d7cd2ca1bbfc7ecd63f69
Fix to allow version number to be imported without dependencies being installed.
email_extras/__init__.py
email_extras/__init__.py
from email_extras.settings import USE_GNUPG __version__ = "0.1.0" if USE_GNUPG: try: import gnupg except ImportError: try: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured, "Could not import gnupg" except ImportError: ...
from django.core.exceptions import ImproperlyConfigured from email_extras.settings import USE_GNUPG __version__ = "0.1.0" if USE_GNUPG: try: import gnupg except ImportError: raise ImproperlyConfigured, "Could not import gnupg"
Python
0
b39518482da1d3e064cdbc34490e4a9924f6d5f1
Add a test for vectorized call
quantecon/tests/test_ecdf.py
quantecon/tests/test_ecdf.py
""" Tests for ecdf.py """ import unittest import numpy as np from quantecon import ECDF class TestECDF(unittest.TestCase): @classmethod def setUpClass(cls): cls.obs = np.random.rand(40) # observations defining dist cls.ecdf = ECDF(cls.obs) def test_call_high(self): "ecdf: x abo...
""" Tests for ecdf.py """ import unittest import numpy as np from quantecon import ECDF class TestECDF(unittest.TestCase): @classmethod def setUpClass(cls): cls.obs = np.random.rand(40) # observations defining dist cls.ecdf = ECDF(cls.obs) def test_call_high(self): "ecdf: x abo...
Python
0
e36192babd239366d51d1ea7cdfab94c06791fe7
Test assertElementPresents return function
functional_tests/test_base.py
functional_tests/test_base.py
# -*- coding: utf-8 -*- from .base import FunctionalTestCase import unittest from unittest import mock class TestBaseFuctionalTest(unittest.TestCase): def test_assertelementpresent_can_find_string(self): e = [mock.Mock(text='test')] ft = FunctionalTestCase() ft.assertElementPresent(e, 'tes...
# -*- coding: utf-8 -*- from .base import FunctionalTestCase import unittest from unittest import mock class TestBaseFuctionalTest(unittest.TestCase): def test_assertelementpresent_can_find_string(self): e = [mock.Mock(text='test')] ft = FunctionalTestCase() ft.assertElementPresent(e, 'tes...
Python
0.000002
472c22a83e9e3982e5b6705757f79fba3b32f3e6
Set path dependency with context to development and deployment
hooks/common.py
hooks/common.py
import os import sys import urllib2 # Add charmhelpers to the system path. try: sys.path.insert(0, os.path.abspath(os.path.join(os.environ['CHARM_DIR'], 'lib'))) except: sys.path.insert(0, os.path.abspath(os.path.join('..', 'lib'))) from charmhelpers.core.h...
import os import sys import urllib2 # Add charmhelpers to the system path. sys.path.insert(0, os.path.abspath(os.path.join('..', 'lib'))) from charmhelpers.core.hookenv import ( log, config, ) from charmhelpers.core.host import ( mkdir, ) from charmhelpers.fetch import ( apt_install, apt_update, ...
Python
0
a2b6cef1fc6dee679407d61312a23f96c3e99cda
Use a plain list of url instances for the tests urls too
oauth2_provider/tests/urls.py
oauth2_provider/tests/urls.py
from django.conf.urls import include, url from django.contrib import admin admin.autodiscover() urlpatterns = ( url(r'^admin/', include(admin.site.urls)), url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')), )
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns( '', url(r'^admin/', include(admin.site.urls)), url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')), )
Python
0
aaf243646eccebea2e1d764d7de58c40c279830c
test info
hostend/main.py
hostend/main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys sys.path.append('..') from tornado.web import Application import tornado.ioloop import tornado.options import tornado.httpserver import tornado.autoreload from tornado.options import define, options from hostend.controller...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys sys.path.append('..') from tornado.web import Application import tornado.ioloop import tornado.options import tornado.httpserver import tornado.autoreload from tornado.options import define, options from hostend.controller...
Python
0.000001
0fbfef27d35cea23ad0e20fd2c9df3e8a4a046cb
Fix GCF region tags (#1827)
functions/log/main.py
functions/log/main.py
# Copyright 2018 Google LLC # # 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, s...
# Copyright 2018 Google LLC # # 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, s...
Python
0
8d56c42dd3a721a477fa1333c1d979f4002e7cc1
Simplify importer paths after dockerization
labonneboite/importer/conf/lbbdev.py
labonneboite/importer/conf/lbbdev.py
import os # --- importer input directory of DPAE and ETABLISSEMENT exports INPUT_SOURCE_FOLDER = '/srv/lbb/data' # --- job 1/8 & 2/8 : check_etablissements & extract_etablissements JENKINS_ETAB_PROPERTIES_FILENAME = os.path.join(os.environ["WORKSPACE"], "properties.jenkins") MINIMUM_OFFICES_TO_BE_EXTRACTED_PER_DEPART...
import os # --- importer input directory of DPAE and ETABLISSEMENT exports INPUT_SOURCE_FOLDER = '/srv/lbb/data' # --- job 1/8 & 2/8 : check_etablissements & extract_etablissements JENKINS_ETAB_PROPERTIES_FILENAME = os.path.join(os.environ["WORKSPACE"], "properties.jenkins") MINIMUM_OFFICES_TO_BE_EXTRACTED_PER_DEPART...
Python
0.000009
f1c270f2145cf1f48a0207696cb4f6e9592af357
Correct db `NAME`, use in-memory database for testing
NTHU_Course/settings/testing_sqlite.py
NTHU_Course/settings/testing_sqlite.py
''' A configuration for testing in travis CI with sqlite3 ''' from .default import * # noqa DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # https://docs.djangoproject.com/en/1.10/topics/testing/overview/#the-test-database # django uses in memory database for testing ...
''' A configuration for testing in travis CI with sqlite3 ''' from .default import * # noqa DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # https://docs.djangoproject.com/en/1.10/topics/testing/overview/#the-test-database # django uses in memory database for testing ...
Python
0.000001
34f3d762f608c3ea3fd12cded38dc3853d36545f
Update vouchers.py
2014-2015/B4-vouchers/vouchers.py
2014-2015/B4-vouchers/vouchers.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2014 Fabian M. # # 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...
vouchers = [1, 2, 3, 5, 8, 9, 18, 19, 46, 154, 313] def main(): for b in range(1, max(vouchers)): # Amount can be created with one voucher. if b in vouchers: continue bins = [] ws = sorted(vouchers, reverse=True) for w in ws: for x in bins: if sum(x) + w <= b: x.append(w) w = None b...
Python
0
241376f76d4175c98c8226998832b8054697504c
Fix xpath expression for tomorrows forecast
app/jobs/yr.py
app/jobs/yr.py
#!/usr/bin/env python import requests from datetime import datetime, timedelta from jobs import AbstractJob from lxml import etree class Yr(AbstractJob): def __init__(self, conf): self.url = conf['url'] self.interval = conf['interval'] def _parse_tree(self, tree, tabular_xpath=None): ...
#!/usr/bin/env python import requests from jobs import AbstractJob from lxml import etree class Yr(AbstractJob): def __init__(self, conf): self.url = conf['url'] self.interval = conf['interval'] def _parse_tree(self, tree, tabular_xpath=None): if tabular_xpath is None: t...
Python
0.000131
b6b522bbdde24f0e6eab0e7a91830171bcac63a5
Add logout url
genevieve/urls.py
genevieve/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.auth import views as auth_views from .views import UserCreateView admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', in...
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.auth import views as auth_views from .views import UserCreateView admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', in...
Python
0.000003
ba2161f6adf5a0e0782e322371d7071ca79d02e3
Update tornado for mypy
gidgethub/tornado.py
gidgethub/tornado.py
from typing import Mapping, Optional, Tuple from tornado import gen from tornado import httpclient from . import abc as gh_abc class GitHubAPI(gh_abc.GitHubAPI): async def _request(self, method: str, url: str, headers: Mapping[str, str], body: bytes = b'') -> Tuple[int, Mapping[str, str]...
from typing import Mapping, Optional, Tuple from tornado import gen from tornado import httpclient from . import abc as gh_abc class GitHubAPI(gh_abc.GitHubAPI): async def _request(self, method: str, url: str, headers: Mapping, body: bytes = b'') -> Tuple[int, Mapping, bytes]: ""...
Python
0
ad56d5aa6b2359098c4ed6bf9cd37cb58613a372
Update github3.repos.tag for consistency
github3/repos/tag.py
github3/repos/tag.py
# -*- coding: utf-8 -*- """This module contains the RepoTag object for GitHub's tag API.""" from __future__ import unicode_literals from . import commit from .. import models class RepoTag(models.GitHubCore): """Representation of a tag made on a GitHub repository. .. note:: This is distinct from :c...
# -*- coding: utf-8 -*- """ github3.repos.tag ================= This module contains the RepoTag object for GitHub's tag API. """ from __future__ import unicode_literals from ..models import GitHubCore class RepoTag(GitHubCore): """The :class:`RepoTag <RepoTag>` object. This stores the information represen...
Python
0
73f3c743139927a049c5e733f98e1fcb8125721a
Update release version
gdaltools/metadata.py
gdaltools/metadata.py
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'pygdaltools' project = 'pygdaltools' project_no_spaces = project.replace(' ', '') version = '0.3' description = """Python wrapper for Gdal/OGR command line ...
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'pygdaltools' project = 'pygdaltools' project_no_spaces = project.replace(' ', '') version = '0.2' description = """Python wrapper for Gdal/OGR command line ...
Python
0
2c0dbf04f04b686cac79e40791c3ed298618dd07
add more info on process
gen-gallery-images.py
gen-gallery-images.py
'''Generates small and medium gallery images from a set of large originals. Some maps will be tall, some wide, some square so we want to simply maintain the ratio and resize down to a set maximum. Original images need to be downloaded to the large image path below. They are accessible in this Dropbox folder https://...
'''Generates small and medium gallery images from a set of large originals. Some maps will be tall, some wide, some square so we want to simply maintain the ratio and resize down to a set maximum. Original images need to be downloaded to the large path below. They are accessible in this Dropbox folder https://www.dr...
Python
0
2fcca753e2877d21e158d5e4a3923e1d22e61608
Add mask A to causal atrous conv1d (WIP)
eva/layers/causal_atrous_convolution1d.py
eva/layers/causal_atrous_convolution1d.py
import keras.backend as K from keras.layers import AtrousConvolution1D from keras.utils.np_utils import conv_output_length class CausalAtrousConvolution1D(AtrousConvolution1D): def __init__(self, *args, mask_type='B', **kwargs): super().__init__(*args, **kwargs) if self.border_mode != 'valid': ...
import keras.backend as K from keras.layers import AtrousConvolution1D from keras.utils.np_utils import conv_output_length class CausalAtrousConvolution1D(AtrousConvolution1D): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if self.border_mode != 'valid': raise V...
Python
0
56de128ac7462a297505ec4b207d07c1af613c9b
connect annotations to api
ui/app/api/__init__.py
ui/app/api/__init__.py
from flask import Blueprint api = Blueprint('api', __name__) # # end-points to create # query from . import query # services from . import services # spans from . import spans # annotations from . import annotations # # traces # services # annotations # dependencies # pin from . import pin
from flask import Blueprint api = Blueprint('api', __name__) # # end-points to create # query from . import query # services from . import services # spans from . import spans # # traces # services # annotations # dependencies # pin from . import pin
Python
0.000001
c5b00edd9b8acbe594e43ecce093cd1c695b8b01
Use user ID instead of username to get messages even with username changes
getalltextfromuser.py
getalltextfromuser.py
#!/usr/bin/env python3 """ A program to extract all text sent by a particular user from a Telegram chat log which is in json form """ import argparse from json import loads def main(): parser = argparse.ArgumentParser( description="Extract raw text sent by a user from a json telegram chat log") parser...
#!/usr/bin/env python3 """ A program to extract all text sent by a particular user from a Telegram chat log which is in json form """ import argparse from json import loads def main(): parser = argparse.ArgumentParser( description="Extract raw text sent by a user from a json telegram chat log") parser...
Python
0
48b227f0019fb28a5b96874f62662fee79998fe5
Add a TODO for diamondash metric snapshot request auth in diamondash proxy view
go/dashboard/views.py
go/dashboard/views.py
from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django.views.decorators.csrf import csrf_exempt from go.dashboard import client @login_required @csrf_exempt @require_http_methods(['GET']) def diamondash_...
from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django.views.decorators.csrf import csrf_exempt from go.dashboard import client @login_required @csrf_exempt @require_http_methods(['GET']) def diamondash_...
Python
0
e7d6f5fbd21819ba0c5d3b5e952331b2eabe32e8
move ballsearch para to config
gpbo/core/__init__.py
gpbo/core/__init__.py
from collections import defaultdict debugoutput=defaultdict(lambda :False) debugoutput['path']='dbout' from .optimize import * from .optutils import * from .acquisitions import * from .reccomenders import * from .config import * from .GPdc import * from .ESutils import * from .choosers import *
from collections import defaultdict debugoutput=defaultdict(lambda :False) debugoutput['path']='dbout' from .optimize import * from .optutils import * from .acquisitions import * from .reccomenders import * from .config import * from .GPdc import * from .ESutils import * from .choosers import *
Python
0
c937d19b263070f380fcbc75dfe60d15840fe477
Drop call to 'service' wrapper in 'vyos-config-mdns-repeater.py'
src/conf-mode/vyos-config-mdns-repeater.py
src/conf-mode/vyos-config-mdns-repeater.py
#!/usr/bin/env python3 # # Copyright (C) 2017 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as # published by the Free Software Foundation. # # This program is distributed in the hope t...
#!/usr/bin/env python3 # # Copyright (C) 2017 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as # published by the Free Software Foundation. # # This program is distributed in the hope t...
Python
0
e964df34a7f1f7dc85da21429b2978b01034140f
Fix typo
i2v/__init__.py
i2v/__init__.py
from i2v.base import Illustration2VecBase caffe_available = False chainer_available = False try: from i2v.caffe_i2v import CaffeI2V, make_i2v_with_caffe caffe_available = True except ImportError: pass try: from i2v.chainer_i2v import ChainerI2V, make_i2v_with_chainer chainer_available = True exce...
from i2v.base import Illustration2VecBase caffe_available = False chainer_available = False try: from i2v.caffe_i2v import CaffeI2V, make_i2v_with_caffe caffe_available = True except ImportError: pass try: from i2v.chainer_i2v import ChainerI2V, make_i2v_with_chainer caffe_available = True except...
Python
0.999999
40c3ed631a962d0a986a7d3752ad1247ded75a33
Fix save dir of listing files
parsers/transparence-sante/crawl_details.py
parsers/transparence-sante/crawl_details.py
# -*- coding: utf-8 -*- import os, sys from crawler import TSCrawler from parse import parse_listing from utils import info from settings import EXTRACT_DETAIL_DIR import threading import logging import time import Queue from plan_crawl import get_all_tasks logging.basicConfig(level=logging.DEBUG, ...
# -*- coding: utf-8 -*- import os, sys from crawler import TSCrawler from parse import parse_listing from utils import info from settings import EXTRACT_DETAIL_DIR import threading import logging import time import Queue from plan_crawl import get_all_tasks logging.basicConfig(level=logging.DEBUG, ...
Python
0
5d32ee0e41aee95f30f972eef3d1abcf9de50a0c
Kill unused var
untz_manager/__main__.py
untz_manager/__main__.py
"""Main entry point for untz.""" from concurrent.futures import ThreadPoolExecutor import logging import os from .encoder import apply_gain, encode_file from .utils import get_args, preflight_checks, recursive_file_search ARGS = get_args() LOGGER = logging.getLogger(__name__) def _encode_on_filter(file_entry): ...
"""Main entry point for untz.""" from concurrent.futures import ThreadPoolExecutor import logging import os from .encoder import apply_gain, encode_file from .utils import get_args, preflight_checks, recursive_file_search ARGS = get_args() LOGGER = logging.getLogger(__name__) threads = [] # pylint: disable=C0103 de...
Python
0
ae4da4d5d6af27ddab376cb41067f21b053fcf5e
make tokenz lazy
goethe/corpora.py
goethe/corpora.py
import os from . import util import itertools as it class Corpus: def __init__(self, path, limit=None): """Pass path to corpus. Expects following structure: path/to/my/corpus corpus.txt corpus.tokens.txt """ self.path = os.path.normpath(path) self.lim...
import os from . import util import itertools as it class Corpus: def __init__(self, path, limit=None): """Pass path to corpus. Expects following structure: path/to/my/corpus corpus.txt corpus.tokens.txt """ self.path = os.path.normpath(path) self.lim...
Python
0.001279
c6fe6e7ae212dab3b8cc4615355f782664dc2d05
raise invalid error in relations if unable to get rid or rtype
drfjsonapi/relations.py
drfjsonapi/relations.py
""" drfjsonapi.relations ~~~~~~~~~~~~~~~~~~~~ DRF relationship fields to assist with a JSON API spec compliant API. """ from django.utils.translation import ugettext_lazy as _ from rest_framework.relations import SlugRelatedField class JsonApiRelatedField(SlugRelatedField): """ JSON API related ...
""" drfjsonapi.relations ~~~~~~~~~~~~~~~~~~~~ DRF relationship fields to assist with a JSON API spec compliant API. """ from django.utils.translation import ugettext_lazy as _ from rest_framework.relations import SlugRelatedField class JsonApiRelatedField(SlugRelatedField): """ JSON API related ...
Python
0
6b8b2ebfd17cd96a08511a31d2f1159981b5c7cd
Update drakar.py
apps/drakar.py
apps/drakar.py
import os import sys import platform from os.path import isfile, isdir, join DRAKAR_PATH = os.environ.get('DRAKAR', '/mnt/drakar') if not isdir(DRAKAR_PATH): raise OSError("No such directory: '{}'".format(DRAKAR_PATH)) SYSTEM = sys.platform + '-' + platform.machine() sources = { 'linux2-x86_64/processing-2....
import os import sys import platform from os.path import isfile, isdir, join DRAKAR_PATH = os.environ.get('DRAKAR', '/mnt/drakar') if not isdir(DRAKAR_PATH): raise OSError("No such directory: '{}'".format(DRAKAR_PATH)) SYSTEM = sys.platform + '-' + platform.machine() sources = { 'linux2-x86_64/processing-2....
Python
0
c2e36c0c59e728e246f20aacbc5f6f368ca274b7
add comment
usr/sbin/traverse_dir.py
usr/sbin/traverse_dir.py
#!/usr/bin/env python ############################################################################### # Copyright (c) 2015 Jamis Hoo # Project: # Filename: traverse_dir.py # Version: 1.0 # Author: Jamis Hoo # E-mail: hoojamis@gmail.com # Date: Aug 3, 2015 # Time: 14:06:02 # Description: ##########...
#!/usr/bin/env python ############################################################################### # Copyright (c) 2015 Jamis Hoo # Project: # Filename: traverse_dir.py # Version: 1.0 # Author: Jamis Hoo # E-mail: hoojamis@gmail.com # Date: Aug 3, 2015 # Time: 14:06:02 # Description: ##########...
Python
0
1c02294073c855fab8d6fc0965f3584b0ac0137b
clean up example file
examples/example.py
examples/example.py
#!/usr/bin/env python3 import matplotlib.pyplot as plt from oemof import db from dingo.core import NetworkDingo from dingo.tools import config as cfg_dingo plt.close('all') cfg_dingo.load_config('config_db_tables') cfg_dingo.load_config('config_calc') cfg_dingo.load_config('config_files') cfg_dingo.load_config('con...
#!/usr/bin/env python3 import matplotlib.pyplot as plt from oemof import db conn = db.connection(section='oedb') from dingo.core import NetworkDingo from dingo.tools import config as cfg_dingo from dingo.tools.debug import compare_graphs plt.close('all') cfg_dingo.load_config('config_db_tables') cfg_dingo.load_confi...
Python
0.000002
2645ac98fd2698bcfbf4a23cdb6c9583e6b31a50
create test user from python updated
src/apps/flow_manager/createdb.py
src/apps/flow_manager/createdb.py
import requests import json dbhost = "localhost" dbport = "5984" dbuser = "root" dbpass = "asm123" database = "faucet" userdatabase = "users" username = "testflowmgr@faucetsdn.org" password = "testflowmgr" role = "1" data = {"username": username, "password": password, "role": role} createdb = requests.put("http://"+db...
import requests dbhost = "localhost" dbport = "5984" dbuser = "root" dbpass = "asm123" database = "faucet" userdatabase = "users" username = "testflowmgr@faucetsdn.org" password = "testflowmgr" role = "1" data = {"username": username, "password": password, "role": role} # createdb = requests.put("http://"+dbuser+":"+d...
Python
0.000001
f6a5ad0d2107b60899f5abaf2dbce65beae34a59
Drop remaining "OrderedDict" usages.
utilities/export_todo.py
utilities/export_todo.py
#!/usr/bin/env python """ Export TODOs ============ """ from __future__ import annotations import codecs import os __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colo...
#!/usr/bin/env python """ Export TODOs ============ """ from __future__ import annotations import codecs import os from collections import OrderedDict __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers"...
Python
0
547ee3fb5db9ebb0bed0443d865ec76f44904b9e
Add url_shortener.views.render_preview function
url_shortener/views.py
url_shortener/views.py
# -*- coding: utf-8 -*- from flask import session, redirect, url_for, flash, render_template from . import app from .forms import ShortenedUrlForm from .models import ShortenedUrl, register @app.route('/', methods=['GET', 'POST']) def shorten_url(): '''Display form and handle request for url shortening If s...
# -*- coding: utf-8 -*- from flask import session, redirect, url_for, flash, render_template from . import app from .forms import ShortenedUrlForm from .models import ShortenedUrl, register @app.route('/', methods=['GET', 'POST']) def shorten_url(): '''Display form and handle request for url shortening If s...
Python
0.000004
561e7905de823e5c2ff2f4822d4051d9a7635dfc
Fix checking whether the heap contains the node when e.g. calling .pop().
idiokit/heap.py
idiokit/heap.py
class HeapError(Exception): pass class Heap(object): def __init__(self, iterable=()): self._heap = list() for value in iterable: self.push(value) def _get(self, node): if not self._heap: raise HeapError("empty heap") if node is None: n...
class HeapError(Exception): pass class Heap(object): def __init__(self, iterable=()): self._heap = list() for value in iterable: self.push(value) def _get(self, node): if not self._heap: raise HeapError("empty heap") if node is None: n...
Python
0
78ac11eed6a98d11cfafcef6757fd91b8bdb7b8e
make UI work
PasswordConverter/PasswordConverter.py
PasswordConverter/PasswordConverter.py
import tkinter as tk import tkinter.font as tkFont from tkinter import ttk, tix import hashlib import base64 class tolist_frozenset(frozenset): def __init__(self, obj): frozenset.__init__(obj) def s2l(self): return list(self) def s2t(self): return tuple(self) def __s...
import tkinter as tk import tkinter.font as tkFont from tkinter import ttk, tix import hashlib, base64 STICKY_ALL = (tix.N, tix.W, tix.S, tix.E) STICKY_HORIZONTAL = (tix.W, tix.E) STICKY_VERTICAL = (tix.N, tix.S) class PasswordConverter(ttk.Frame): def __init__(self, **kwargs): return super().__init__(**...
Python
0.00001
b95fa25a5d3a00d8d1113f2d61defee69215374b
add tests for submitted graderoster
course_grader/test/dao/test_graderoster.py
course_grader/test/dao/test_graderoster.py
from django.test import TestCase from django.utils import timezone from uw_pws.util import fdao_pws_override from uw_sws.util import fdao_sws_override from course_grader.dao.person import PWS from course_grader.dao.section import get_section_by_label from course_grader.dao.graderoster import graderoster_for_section fro...
from django.test import TestCase from uw_pws.util import fdao_pws_override from uw_sws.util import fdao_sws_override from course_grader.dao.person import PWS from course_grader.dao.section import get_section_by_label from course_grader.dao.graderoster import graderoster_for_section from course_grader.exceptions import ...
Python
0
69df5ba1baf92238e98065d60dac73d2214787d3
Fix usage of biobank_identifier parameter
import-imput.py
import-imput.py
from pymongo import MongoClient import csv import re import argparse def categorize_float(value): if value <= 0.001: return "[0,0.001]" elif value <= 0.01: return "(0.001,0.01]" elif value <= 0.1: return "(0.01,0.1]" elif value <= 0.2: return "(0.1,0.2]" elif value ...
from pymongo import MongoClient import csv import re import argparse def categorize_float(value): if value <= 0.001: return "[0,0.001]" elif value <= 0.01: return "(0.001,0.01]" elif value <= 0.1: return "(0.01,0.1]" elif value <= 0.2: return "(0.1,0.2]" elif value ...
Python
0.00005
d166563f648d409f7039ce2df1149a8cb15b13ab
add sub-package: plot
gdpy3/__init__.py
gdpy3/__init__.py
__name__ = "gdpy3" __doc__ = "gdpy3: Gyrokinetic Toroidal Code Data Processing tools" __author__ = "shmilee" __version__ = "0.0.1" __status__ = "alpha" __license__ = "MIT" __email__ = "shmilee.zju@gmail.com" __all__ = ['convert', 'plot', 'read']
__name__ = "gdpy3" __doc__ = "gdpy3: Gyrokinetic Toroidal Code Data Processing tools" __author__ = "shmilee" __version__ = "0.0.1" __status__ = "alpha" __license__ = "MIT" __email__ = "shmilee.zju@gmail.com" __all__ = ['convert', 'read']
Python
0.999514
f276c840f2981ec2951e07c7b847f82811db0745
Remove unnecessary None handling
openstack/database/v1/user.py
openstack/database/v1/user.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Python
0.000062
d1596872f11f95e406a6a3a97222e499abf4f222
update plot_ts
examples/plot_ts.py
examples/plot_ts.py
""" ====================== Plotting a time series ====================== Plotting a time series. """ import numpy as np from scipy.stats import norm import matplotlib.pyplot as plt # Parameters n_samples = 100 n_features = 48 rng = np.random.RandomState(41) delta = 0.5 dt = 1 # Generate a toy dataset X = (norm.rvs(...
""" ====================== Plotting a time series ====================== An example plot of `pyts.visualization.plot_ts` """ import numpy as np from scipy.stats import norm from pyts.visualization import plot_ts # Parameters n_samples = 100 n_features = 48 rng = np.random.RandomState(41) delta = 0.5 dt = 1 # Genera...
Python
0.000001
c9762ec881fc041eafb0b8906242cefcdbc4bf7f
Add UsageRecord class
accloudtant/__main__.py
accloudtant/__main__.py
import csv class UsageRecord(object): def __init__(self, data): self._data = data def __getitem__(self, key): return self._data[key] def area(entry): if entry[" UsageType"].startswith("EUC1-"): return "EU (Frankfurt)" def is_data_transfer(entry): if "DataTransfer" in entry...
import csv def area(entry): if entry[" UsageType"].startswith("EUC1-"): return "EU (Frankfurt)" def is_data_transfer(entry): if "DataTransfer" in entry[" UsageType"] or "CloudFront" in entry[" UsageType"]: return True return False def get_areas(entries, resource_areas): areas = {} ...
Python
0
78deea6602671917c5cc78de8ed20e6825179948
add PATCH support
coyote_framework/requests/requestdriver.py
coyote_framework/requests/requestdriver.py
""" Wrapper for python's "requests" library that has options to maintain session and keep a history of responses in a queue """ import requests from collections import deque class RequestDriver(object): GET = 'GET' POST = 'POST' PUT = 'PUT' PATCH = 'PATCH' DELETE = 'DELETE' session = None ...
""" Wrapper for python's "requests" library that has options to maintain session and keep a history of responses in a queue """ import requests from collections import deque class RequestDriver(object): GET = 'GET' POST = 'POST' PUT = 'PUT' DELETE = 'DELETE' session = None responses = deque...
Python
0
28e64a576a25b7fb41997da8ecfb4472d9adee38
simplify main greenlet caching
greenhouse/compat.py
greenhouse/compat.py
import os import sys try: from greenlet import greenlet, GreenletExit except ImportError, error: try: from py.magic import greenlet GreenletExit = greenlet.GreenletExit except ImportError: # suggest standalone greenlet, not the old py.magic.greenlet raise error __all__ = ["...
import os import sys try: from greenlet import greenlet, GreenletExit except ImportError, error: try: from py.magic import greenlet GreenletExit = greenlet.GreenletExit except ImportError: # suggest standalone greenlet, not the old py.magic.greenlet raise error __all__ = ["...
Python
0.000269
da8aa20292e0df938f0e49884b21f08034b9f441
fix typo
google_auth/authentication.py
google_auth/authentication.py
# -*- coding: utf-8 -*- import requests import httplib2 from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth import get_user_model from django.utils.timezone import make_aware from rest_framework import exceptions, authentication, HTTP_HEADER_ENCODING from rest_framework.a...
# -*- coding: utf-8 -*- import requests import httplib2 from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth import get_user_model from django.utils.timezone import make_aware from rest_framework import exceptions, authentication, HTTP_HEADER_ENCODING from rest_framework.a...
Python
0.999991
38989bf6e449bf2ada1ac4729564d9feacbc7b90
use parseargs for cli processing
activity/activitylog.py
activity/activitylog.py
from peewee import * from pprint import pprint from copy import copy import sys, os, inspect import optparse import argparse db = SqliteDatabase('activitylog.db') ################ # Model classes ################ class BaseModel(Model): is_abstract = BooleanField(default=False) class Meta: database ...
from peewee import * from pprint import pprint from copy import copy import sys, getopt, os, inspect db = SqliteDatabase('activitylog.db') ################ # Model classes ################ class BaseModel(Model): is_abstract = BooleanField(default=False) class Meta: database = db class NamedModel(B...
Python
0
4565c961eca6f0d904d010cbdbf3d42fe2a6080b
Add persistence test
test/rlite.py
test/rlite.py
# coding=utf-8 from unittest import * import os.path import sys import hirlite class RliteTest(TestCase): def setUp(self): self.rlite = hirlite.Rlite() def test_none(self): self.assertEquals(None, self.rlite.command('get', 'hello')) def test_ok(self): self.assertEquals(True, sel...
# coding=utf-8 from unittest import * import hirlite import sys class RliteTest(TestCase): def setUp(self): self.rlite = hirlite.Rlite() def test_none(self): self.assertEquals(None, self.rlite.command('get', 'hello')) def test_ok(self): self.assertEquals(True, self.rlite.command(...
Python
0.00001
b451a8546d52ab80186938219a99853f3fb7ff31
Add more in Tk GUI tool, to fix in the layout.
HearthStone/HearthStone/gui_tools/tkgui.py
HearthStone/HearthStone/gui_tools/tkgui.py
#! /usr/bin/python # -*- coding: utf-8 -*- from functools import wraps from tkinter import * from tkinter.ttk import * from ..game_events import GameBegin, GameEnd, TurnEnd, SummonMinion __author__ = 'fyabc' class GameWindow(Frame): """The Tk game window. """ # [NOTE] Some rules of the variable's nam...
#! /usr/bin/python # -*- coding: utf-8 -*- import tkinter as tk __author__ = 'fyabc' class GameWindow(tk.Frame): def __init__(self, game, master=None): super(GameWindow, self).__init__(master=master, borderwidth=30) self.pack(fill=tk.BOTH) self.game = game ######## # Me...
Python
0
18428461f230d7d57056bd1a6a0fc2a66cedb5f1
increment version
grizli/version.py
grizli/version.py
# git describe --tags __version__ = "0.8.0-14-g548f692"
# git describe --tags __version__ = "0.8.0-10-g15486e6"
Python
0.000004
b66c987170d8d0b6b83d25f4214208b9251c644c
Document error handling
code/document.py
code/document.py
from boto.s3.key import Key import socket import sys import xmltodict from collections import OrderedDict import gzip class Document(object): """ This class represents a subtitle file. """ def __init__(self, key, label): self.label = label self.key = key self.parsed_xml = self...
from boto.s3.key import Key import socket import sys import xmltodict from collections import OrderedDict import gzip class Document(object): """ This class represents a subtitle file. """ def __init__(self, key, label): self.label = label self.key = key self.parsed_xml = self...
Python
0.000001
ac6c75bc2247e08bbcc77c931130d2c01615762b
Use a consistent object description for test models
versions_tests/models.py
versions_tests/models.py
from django.db.models import CharField from versions.models import Versionable, VersionedManyToManyField, VersionedForeignKey def versionable_description(obj): return "<" + str(obj.__class__.__name__) + " object: " + str( obj.name) + " {valid: [" + obj.version_start_date.isoformat() + " | " + ( ...
from django.db.models import CharField from versions.models import Versionable, VersionedManyToManyField, VersionedForeignKey ############################################ # The following model is used for: # - CreationTest # - DeletionTest # - CurrentVersionTest # - VersionedQuerySetTest # - VersionNavigationTest # ...
Python
0.000013
68eaa885e15b98bc05376d9ddca6926258be2c46
make header fields with dates (e.g. last-modified) comparable
httoop/header/conditional.py
httoop/header/conditional.py
# -*- coding: utf-8 -*- from httoop.header.element import HeaderElement class _DateComparable(object): from httoop.date import Date def sanitize(self): self.value = self.Date.parse(self.value) class ETag(HeaderElement): pass class LastModified(_DateComparable, HeaderElement): __name__ = 'Last-Modified' cl...
# -*- coding: utf-8 -*- from httoop.header.element import HeaderElement class ETag(HeaderElement): pass class LastModified(HeaderElement): __name__ = 'Last-Modified' class IfMatch(HeaderElement): __name__ = 'If-Match' class IfModifiedSince(HeaderElement): __name__ = 'If-Modified-Since' class IfNoneMatch(...
Python
0