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
d31adbfd0485579c94e92b9c2950230d00fdf309
update flaskapp.wsgi
FlaskApp/flaskapp.wsgi
FlaskApp/flaskapp.wsgi
#!/usr/bin/python import sys import logging logging.basicConfig(stream=sys.stderr) sys.path.insert(0,"/var/www/RiotAPIChallenge2.0/FlaskApp/") from FlaskApp import app as application application.secret_key = 'secretkeyhere'
#!/usr/bin/python import sys import logging logging.basicConfig(stream=sys.stderr) sys.path.insert(0,"/var/www/FlaskApp/") from FlaskApp import app as application application.secret_key = 'secretkeyhere'
Python
0.000001
2c64c4fd5a81537d891aadafe01a4da96fcb7ab4
Update ipc_lista1.6.py
lista1/ipc_lista1.6.py
lista1/ipc_lista1.6.py
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio = 0 area = 0 raio = input("Entre com o valor do raio: ")
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio = 0 area = 0 raio = input("Entre com o valor do raio: "
Python
0
1cf097d30d5966456c01e4f2e678213c04f8e334
Update ipc_lista1.6.py
lista1/ipc_lista1.6.py
lista1/ipc_lista1.6.py
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio = 0 area = 0 raio = input("Entre com o valor do raio: ") area = 3.14 * raio*raio print "Valor da
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio = 0 area = 0 raio = input("Entre com o valor do raio: ") area = 3.14 * raio*raio print "Valor
Python
0
8804091fb22ef0a7682ea402ff22750261fc38a7
Update ipc_lista1.6.py
lista1/ipc_lista1.6.py
lista1/ipc_lista1.6.py
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio = 0
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio =
Python
0
c6abbd5b8176943ec02d0a03852e1992f62950a1
Update ipc_lista1.9.py
lista1/ipc_lista1.9.py
lista1/ipc_lista1.9.py
#ipc_lista1.9 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura
#ipc_lista1.9 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça a temperatura em graus Fahrenheit, transforme e mostre
Python
0
89571a6caf877f8ff5ff0b983548b926dec87f8d
Update ipc_lista1.9.py
lista1/ipc_lista1.9.py
lista1/ipc_lista1.9.py
#ipc_lista1.9 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça a temperatura em graus Fahrenheit
#ipc_lista1.9 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que peça a temperatura em graus
Python
0
c5ed4acaeeb03c9935f01e8a1fed84136b5f3e0c
Revert overwritten changes
GEOparse/downloader.py
GEOparse/downloader.py
import os import requests from tqdm import tqdm from ftplib import FTP try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse from .logger import geoparse_logger as logger class Downloader(object): """Downloader class.""" def __init__(self, url, outdir, filename=None...
import os import requests from tqdm import tqdm from ftplib import FTP try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse from .logger import geoparse_logger as logger class Downloader(object): """Downloader class.""" def __init__(self, url, outdir, filename=None...
Python
0.000001
470a3e226619ae08983ba47c11e7a1609a365d85
Fix potential data loss in upgrade. Closes #2512.
trac/upgrades/db13.py
trac/upgrades/db13.py
sql = [ #-- Add ticket_type to 'ticket', remove the unused 'url' column """CREATE TEMP TABLE ticket_old AS SELECT * FROM ticket;""", """DROP TABLE ticket;""", """CREATE TABLE ticket ( id integer PRIMARY KEY, type text, -- the nature of the ticket time ...
sql = [ #-- Add ticket_type to 'ticket', remove the unused 'url' column """CREATE TEMP TABLE ticket_old AS SELECT * FROM ticket;""", """DROP TABLE ticket;""", """CREATE TABLE ticket ( id integer PRIMARY KEY, type text, -- the nature of the ticket time ...
Python
0
d6672e2da113e2fdcfec147619ed03d5410ad014
Fix cleanup at exit in Escalator. Remove socket.
onitu/escalator/server/__main__.py
onitu/escalator/server/__main__.py
import os import signal import argparse import zmq from logbook import Logger from logbook import StderrHandler from logbook.queues import ZeroMQHandler from .databases import Databases from .worker import Worker back_uri = 'inproc://workers' logger = Logger('Escalator') def main(logger): proxy = zmq.devices...
import argparse import zmq from logbook import Logger from logbook import StderrHandler from logbook.queues import ZeroMQHandler from .databases import Databases from .worker import Worker back_uri = 'inproc://workers' logger = Logger('Escalator') def main(logger): proxy = zmq.devices.ThreadDevice( d...
Python
0
da12486a207e1ade8c7b49379613e4aadec23794
add check to see if rename is needed
misc/misc.py
misc/misc.py
import discord from discord.ext import commands from .utils import checks from __main__ import send_cmd_help import asyncio class misc: """Misc commands""" def __init__(self, bot): self.bot = bot @commands.command(hidden=True) async def summon(self): await self.bot.say("Who dares summon me?") async def r...
import discord from discord.ext import commands from .utils import checks from __main__ import send_cmd_help import asyncio class misc: """Misc commands""" def __init__(self, bot): self.bot = bot @commands.command(hidden=True) async def summon(self): await self.bot.say("Who dares summon me?") async def r...
Python
0.000001
2711f6a3ab53a654bc5de6234251d8d7714529ca
Add markers to the plot
mlp/mnist.py
mlp/mnist.py
import numpy as np import matplotlib.pyplot as plt from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import Adam from keras.callbacks import EarlyStopping from keras.utils import np_utils from keras.utils.visualize_util i...
import numpy as np import matplotlib.pyplot as plt from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import Adam from keras.callbacks import EarlyStopping from keras.utils import np_utils from keras.utils.visualize_util i...
Python
0.000001
c69ad06b785c874685def9e10107f266d685948e
fix #5 Pretty awesome
lokingyql/lokingyql.py
lokingyql/lokingyql.py
import requests import errors import pdb class LokingYQL(object): '''Yet another Python Yahoo! Query Language Wrapper ''' default_url = 'https://query.yahooapis.com/v1/public/yql' def __init__(self, table=None, url=default_url, format='json'): self.url = url self.table = table self.format = ...
import requests import errors import pdb class LokingYQL(object): '''Yet another Python Yahoo! Query Language Wrapper ''' default_url = 'https://query.yahooapis.com/v1/public/yql' def __init__(self, table=None, url=default_url, format='json'): self.url = url self.table = table self.format = ...
Python
0
8141a191f063025cb25bd57b48d57a1a475e3c8d
improve consumer trend summaries
munge/spending_import.py
munge/spending_import.py
import os.path import config from csv_util import unicode_csv_reader, import_csv from sa_util import swap_tables, summary, build_view f = 'spending/spending_by_nuts1.csv' fields = [ 'ct_code', 'nuts1_code', 'factor:double precision', ] summary_data = [ { 'name': 's_population_by_nuts1', ...
import os.path import config from csv_util import unicode_csv_reader, import_csv from sa_util import swap_tables, summary, build_view f = 'spending/spending_by_nuts1.csv' fields = [ 'ct_code', 'nuts1_code', 'factor:double precision', ] summary_data = [ { 'name': 's_population_by_nuts1', ...
Python
0.000039
66696feb49da76965b5d413e39e63625358dfe1f
Fix queue import for Python 3
IPython/nbconvert/preprocessors/execute.py
IPython/nbconvert/preprocessors/execute.py
"""Module containing a preprocessor that removes the outputs from code cells""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. #----------------------------------------------------------------------------- # Imports #-----------------------------------------------...
"""Module containing a preprocessor that removes the outputs from code cells""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. #----------------------------------------------------------------------------- # Imports #-----------------------------------------------...
Python
0.000223
ecb00947dc7c8d33f3c759d7ff704b970a4e32ce
Support non-PNG output formats in visualization tool - auto-detect format from file name
lusmu/visualization.py
lusmu/visualization.py
"""Tools for visualizing a lusmu graph Copyright 2013 Eniram Ltd. See the LICENSE file at the top-level directory of this distribution and at https://github.com/akaihola/lusmu/blob/master/LICENSE """ # pylint: disable=W0212 # Allow access to protected members of client classes # pylint: disable=W0142 # ...
"""Tools for visualizing a lusmu graph Copyright 2013 Eniram Ltd. See the LICENSE file at the top-level directory of this distribution and at https://github.com/akaihola/lusmu/blob/master/LICENSE """ # pylint: disable=W0212 # Allow access to protected members of client classes # pylint: disable=W0142 # ...
Python
0
0d32f515b7a7cc31f263c61f8605f730259b8fa9
Update views.py
pdf/views.py
pdf/views.py
""" RenderPDF helper class """ import os import datetime import cStringIO as StringIO import ho.pisa as pisa from cgi import escape import logging from django.conf import settings from django.http import HttpResponse from django.template.loader import get_template from django.template import Context from djan...
""" RenderPDF helper class """ import os import datetime import cStringIO as StringIO import ho.pisa as pisa from cgi import escape from django.conf import settings from django.http import HttpResponse from django.template.loader import get_template from django.template import Context from django.views.generi...
Python
0
e2e279e32b8366293d6cb99bfd8744ab47c6d36d
update stringcleaning app for new rapidsms. also replace '.' with ' ' instead of just deleting them.
lib/rapidsms/contrib/stringcleaning/app.py
lib/rapidsms/contrib/stringcleaning/app.py
import re from rapidsms.apps.base import AppBase class App (AppBase): def parse (self, message): ''' Cleans up messages by removing punctuation, and replacing intended numbers with numerals, for example: original: "hello"., 2lli.o .2.o.i. d.s. 12.1. 'l3oii user4' "o0,oo", o0.oo,"o0. oo", ...
import rapidsms import re class App (rapidsms.App): def parse (self, message): ''' Cleans up messages by removing punctuation, and replacing intended numbers with numerals, for example: original: "hello"., 2lli.o .2.o.i. d.s. 12.1. 'l3oii user4' "o0,oo", o0.oo,"o0. oo", oo0. ooo0" ...
Python
0.000001
81ced1c9642fa8c364ce9a840adecde633c96b42
Remove disable pylint for paginator error and fix syntax
openedx/core/lib/api/paginators.py
openedx/core/lib/api/paginators.py
""" Paginatator methods for edX API implementations.""" from django.http import Http404 from django.core.paginator import Paginator, InvalidPage def paginate_search_results(object_class, search_results, page_size, page): """ Takes edx-search results and returns a Page object populated with db objects for...
""" Paginatator methods for edX API implementations.""" from django.http import Http404 from django.utils.translation import ugettext as _ from django.core.paginator import Paginator, InvalidPage def paginate_search_results(object_class, search_results, page_size, page): """ Takes edx-search results and retu...
Python
0
09967b21638b423faa8d7de8c57cc00cdf6aec49
Update catalytic_potential.py
KaSaAn/scripts/catalytic_potential.py
KaSaAn/scripts/catalytic_potential.py
#!/usr/bin/env python3 import argparse import sys from KaSaAn.functions import get_potential_of_folder def main(args=None): if args is None: args = sys.argv[1:] parser = argparse.ArgumentParser(description='Out of a series of snapshots from a simulation, obtain the catalytic' ...
#!/usr/bin/env python3 import argparse import sys from KaSaAn.functions import get_potential_of_folder def main(args=None): if args is None: args = sys.argv[1:] parser = argparse.ArgumentParser(description='Out of a series of snapshots from a simulation, obtain the catalytic' ...
Python
0
43b090d70cc6707367af0439d0dfda7c3a531524
Fix weird applescript escaping issues Conflicts: cactus/browser.py
cactus/browser.py
cactus/browser.py
import subprocess import platform s1 = """ tell application "Google Chrome" set windowsList to windows as list repeat with currWindow in windowsList set tabsList to currWindow's tabs as list repeat with currTab in tabsList if "%s" is in currTab's URL then execute currTab javascript ...
import subprocess import platform s1 = """ tell application "Google Chrome" set windowsList to windows as list repeat with currWindow in windowsList set tabsList to currWindow's tabs as list repeat with currTab in tabsList if "%s" is in currTab's URL then execute currTab javascript ...
Python
0.000246
c775b159b310afd323945afcb9dba771731a382b
use repr for log serialization if json fails
src/ekklesia_portal/__init__.py
src/ekklesia_portal/__init__.py
import eliot import logging import sys from eliot.stdlib import EliotHandler from eliot.json import EliotJSONEncoder class MyEncoder(EliotJSONEncoder): def default(self, obj): try: return EliotJSONEncoder.default(self, obj) except TypeError: return repr(obj) logging.getLo...
import eliot import logging import sys from eliot.stdlib import EliotHandler logging.getLogger().addHandler(EliotHandler()) logging.getLogger().setLevel(logging.DEBUG) eliot.to_file(sys.stdout) logging.captureWarnings(True) logg = logging.getLogger(__name__) logging.getLogger("parso").setLevel(logging.WARN) logg.in...
Python
0.000001
a3e05e67b4907f6f97462aa958e4f344f92d1e72
add a new compare method
library/module_utils/network/f5/compare.py
library/module_utils/network/f5/compare.py
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type def cmp_simple_list(want, have): if want is None: return None ...
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type def cmp_simple_list(want, have): if want is None: return None ...
Python
0.000001
795e9734cc802caa8847a9a2b22f3f16297462bc
use combined provider in nsi2 provider setup
opennsa/protocols/nsi2/__init__.py
opennsa/protocols/nsi2/__init__.py
""" Various protocol initialization. Author: Henrik Thostrup Jensen <htj@nordu.net> Copyright: NORDUnet (2011-2012) """ from twisted.web import resource, server from opennsa.protocols.shared import resource as soapresource from opennsa.protocols.nsi2 import providerservice, providerclient, provider, \ ...
""" Various protocol initialization. Author: Henrik Thostrup Jensen <htj@nordu.net> Copyright: NORDUnet (2011-2012) """ from twisted.web import resource, server from opennsa.protocols.shared import resource as soapresource from opennsa.protocols.nsi2 import providerservice, providerclient, provider, \ ...
Python
0
fa9bc00d09cfd173b99eaba3eb17bdfc49100a5b
Add explicit name export
dasem/__init__.py
dasem/__init__.py
"""dasem.""" from __future__ import absolute_import from .fullmonty import Word2Vec __all__ = ['Word2Vec']
"""dasem.""" from __future__ import absolute_import from .fullmonty import Word2Vec
Python
0.000024
c1a3d40295a7c4b5f178ae78b49a90c317844371
Replace double quotes with single quotes for flake8 check
timed/reports/tests/test_notify_reviewers_unverified.py
timed/reports/tests/test_notify_reviewers_unverified.py
from datetime import date import pytest from django.core.management import call_command from timed.employment.factories import UserFactory from timed.projects.factories import ProjectFactory, TaskFactory from timed.tracking.factories import ReportFactory @pytest.mark.freeze_time('2017-8-4') def test_notify_reviewer...
from datetime import date import pytest from django.core.management import call_command from timed.employment.factories import UserFactory from timed.projects.factories import ProjectFactory, TaskFactory from timed.tracking.factories import ReportFactory @pytest.mark.freeze_time('2017-8-4') def test_notify_reviewer...
Python
0.000001
32e00001ec29b0fe13f8c9b2c4dbd61232ba348a
Update starting offset
tools/db/copy_nonpartitioned_sentences_to_partitions.py
tools/db/copy_nonpartitioned_sentences_to_partitions.py
#!/usr/bin/env python3 import time from mediawords.db import connect_to_db from mediawords.util.log import create_logger from mediawords.util.process import run_alone log = create_logger(__name__) def copy_nonpartitioned_sentences_to_partitions(): """Gradually copy sentences from "story_sentences_nonpartitione...
#!/usr/bin/env python3 import time from mediawords.db import connect_to_db from mediawords.util.log import create_logger from mediawords.util.process import run_alone log = create_logger(__name__) def copy_nonpartitioned_sentences_to_partitions(): """Gradually copy sentences from "story_sentences_nonpartitione...
Python
0.000001
9337a4debdbe69b522fa74ab8f621655fa2b6783
add live camera script
car/controller.py
car/controller.py
import time import car import os import threading # valide cmd: # Car directions : CAR_F, CAR_B, CAR_L, CAR_R # Car speeds : CAR_U, CAR_D # Camera control : CM_L, CM_R, CM_U, CM_D # Car control : STOP class Controller(object): _car_direction = ['CAR_F', 'CAR_B', 'CAR_L', 'CAR_R'] _car_speed = ['CAR_U', 'CAR_...
import time import car # valide cmd: # Car directions : CAR_F, CAR_B, CAR_L, CAR_R # Car speeds : CAR_U, CAR_D # Camera control : CM_L, CM_R, CM_U, CM_D # Car control : STOP class Controller(object): _car_direction = ['CAR_F', 'CAR_B', 'CAR_L', 'CAR_R'] _car_speed = ['CAR_U', 'CAR_D'] _camera_control = ['...
Python
0.000001
608a0c75cba735e7d4a59fb941cd6e6135f3e7cf
Update reverse URL.
src/epiweb/apps/survey/views.py
src/epiweb/apps/survey/views.py
# -*- coding: utf-8 -*- from django import forms from django.template import Context, loader from django.http import HttpResponse, HttpResponseRedirect from django.db import transaction from django.core.urlresolvers import reverse from django.shortcuts import render_to_response from django.contrib.auth.decorators impo...
# -*- coding: utf-8 -*- from django import forms from django.template import Context, loader from django.http import HttpResponse, HttpResponseRedirect from django.db import transaction from django.core.urlresolvers import reverse from django.shortcuts import render_to_response from django.contrib.auth.decorators impo...
Python
0
99e910f58fa54e9bce2518c6f9752ba1e8dbd6af
Stop tracking call size in bm diff
tools/profiling/microbenchmarks/bm_diff/bm_constants.py
tools/profiling/microbenchmarks/bm_diff/bm_constants.py
#!/usr/bin/env python2.7 # # Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
#!/usr/bin/env python2.7 # # Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
Python
0
3580e26d10aa336282892bcc07c46ae9a57ea926
Make concept into models
src/ocspdash/web/models.py
src/ocspdash/web/models.py
# -*- coding: utf-8 -*- from datetime import datetime from enum import Enum from oscrypto import asymmetric from sqlalchemy import ( Binary, Column, ForeignKey, Boolean, UniqueConstraint, Integer, String, DateTime, Text ) from sqlalchemy.ext.declarative import declarative_base from...
from datetime import datetime from enum import Enum from oscrypto import asymmetric class OCSPResponderStatus(Enum): good = 'good' questionable = 'questionable' bad = 'bad' unknown = 'unknown' class Authority(object): name: str = None number_of_certs: int = None rank: int = None # upda...
Python
0
dcc2821cac0619fc2ca5f486ad30416f3c3cfda9
Replace parsing with Python's ast
ce/expr/parser.py
ce/expr/parser.py
#!/usr/bin/env python # vim: set fileencoding=UTF-8 : import ast from ..semantics import mpq from .common import OPERATORS, ADD_OP, MULTIPLY_OP def try_to_number(s): try: return mpq(s) except (ValueError, TypeError): return s OPERATOR_MAP = { ast.Add: ADD_OP, ast.Mult: MULTIPLY_OP...
#!/usr/bin/env python # vim: set fileencoding=UTF-8 : from ..semantics import mpq from .common import OPERATORS, ADD_OP, MULTIPLY_OP def try_to_number(s): try: return mpq(s) except (ValueError, TypeError): return s def _parse_r(s): s = s.strip() bracket_level = 0 operator_pos =...
Python
0.000004
38fe4ef9df7e09709611bb3aca1aea4f2d42316a
add encode_url_path method to util
pifx/util.py
pifx/util.py
# -*- coding: utf-8 -*- # # Copyright © 2015 Chaoyi Zha <me@cydrobolt.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
# -*- coding: utf-8 -*- # # Copyright © 2015 Chaoyi Zha <me@cydrobolt.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
Python
0.000001
b8e26d2e5b48a77cfd95513ef7b0235747f33003
raise MailConnectionError if connection gets interrupted (instead of MailError)
netsecus/mail_handler.py
netsecus/mail_handler.py
from __future__ import unicode_literals import logging import time import traceback from . import database from . import helper from . import commands from . import submission def mail_main(config): try: mail_run(config) except BaseException as e: on_error(config, e) raise def mail...
from __future__ import unicode_literals import logging import time import traceback from . import database from . import helper from . import commands from . import submission def mail_main(config): try: mail_run(config) except BaseException as e: on_error(config, e) raise def mail...
Python
0
180805e919c73d0540a29ae57b653574e1ff704c
Clean up local.py for OSX notifications
local.py
local.py
from gntp import * import Growl def register_send(self): ''' Resend a GNTP Register message to Growl running on a local OSX Machine ''' print 'Sending Local Registration' #Local growls only need a list of strings notifications=[] defaultNotifications = [] for notice in self.notifications: notifications.app...
import gntp import Growl GNTPParseError = gntp.GNTPParseError GNTPOK = gntp.GNTPOK GNTPError = gntp.GNTPError parse_gntp = gntp.parse_gntp class GNTPRegister(gntp.GNTPRegister): def send(self): print 'Sending Local Registration' #Local growls only need a list of strings notifications=[] defaultNotificatio...
Python
0
cc4b1130958c7db5b68c52f018c3a6c41a8a8513
use new readPlist() and writePlist() functions
Lib/test/test_plistlib.py
Lib/test/test_plistlib.py
# Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os from test import test_support class TestPlistlib(unittest.TestCase): def tearDown(self): try: os.unlink(test_support.TESTFN) except: pass def _create(self): pl = plistlib...
# Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os from test import test_support class TestPlistlib(unittest.TestCase): def tearDown(self): try: os.unlink(test_support.TESTFN) except: pass def _create(self): pl = plistlib...
Python
0
9a73dcfbc77236d11387909c3f97d3712b56fb2a
clean out commented code from old version
juice.py
juice.py
# read from db data and provide analysis
# replace all functionality of the disgusting mess below ''' # read and process raw data, store processed data # using config(?) and io_db, calculate the following and store its end-result data to db: # - raw profitability ("hypothetical") # - competitiveness of orders per typeID per hub # - END-RESULT [DB]: competit...
Python
0
e112a2651357f586bd1b5a6a4378ac46e3407d58
add v1.1.2 (#22081)
var/spack/repos/builtin/packages/py-awkward1/package.py
var/spack/repos/builtin/packages/py-awkward1/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyAwkward1(PythonPackage): """ROOT I/O in pure Python and NumPy.""" git = "https://gi...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyAwkward1(PythonPackage): """ROOT I/O in pure Python and NumPy.""" git = "https://gi...
Python
0
50411f83942ff033b4b55ef72d595e6d3ab9949f
add version 2.9.1 (#25646)
var/spack/repos/builtin/packages/py-psycopg2/package.py
var/spack/repos/builtin/packages/py-psycopg2/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPsycopg2(PythonPackage): """Python interface to PostgreSQL databases""" homepage = ...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPsycopg2(PythonPackage): """Python interface to PostgreSQL databases""" homepage = ...
Python
0
5d5e6a505bf7282fdef4ca3b3555ecf6f3efa137
Update __copyright__
typepy/__version__.py
typepy/__version__.py
# encoding: utf-8 __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2017, {}".format(__author__) __license__ = "MIT License" __version__ = "0.6.5" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2017-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.6.5" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0.000003
39fbd9fabaa9945fe33475afe23c109711679192
Make output more compact
Lib/cu2qu/benchmark.py
Lib/cu2qu/benchmark.py
# Copyright 2015 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 a...
# Copyright 2015 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 a...
Python
0
d3e673069977c392eb292ce8b313f6dba4da4d9f
Fix these to use non-deprecated APIs, i.e. get_content_maintype() and get_content_subtype().
Lib/email/_compat21.py
Lib/email/_compat21.py
# Copyright (C) 2002 Python Software Foundation # Author: barry@zope.com """Module containing compatibility functions for Python 2.1. """ from cStringIO import StringIO from types import StringType, UnicodeType False = 0 True = 1 # This function will become a method of the Message class def walk(self): """Wa...
# Copyright (C) 2002 Python Software Foundation # Author: barry@zope.com """Module containing compatibility functions for Python 2.1. """ from cStringIO import StringIO from types import StringType, UnicodeType False = 0 True = 1 # This function will become a method of the Message class def walk(self): """Wa...
Python
0.000001
364d0a78725539a58862f672f718e4bf966da2f5
add stats-per-day route
plogx/app.py
plogx/app.py
from flask import Flask from flask import render_template from flask.ext.pymongo import PyMongo import database from bson.json_util import dumps from datetime import datetime app = Flask("log_db") mongo = PyMongo(app) app.debug = True @app.route("/") def overview(): return render_template("index.html") @app.rout...
from flask import Flask from flask import render_template from flask.ext.pymongo import PyMongo import database from bson.json_util import dumps from datetime import datetime app = Flask("log_db") mongo = PyMongo(app) app.debug = True @app.route('/') def overview(): return render_template('index.html') @app.rout...
Python
0.000005
602876c2b132664cc1802d467eaf8109a745d613
Add option for margin and strand selection
kufpybiotools/generate_igr_gff.py
kufpybiotools/generate_igr_gff.py
#!/usr/bin/env python __description__ = "" __author__ = "Konrad Foerstner <konrad@foerstner.org>" __copyright__ = "2013 by Konrad Foerstner <konrad@foerstner.org>" __license__ = "ISC license" __email__ = "konrad@foerstner.org" __version__ = "" import argparse import csv import sys sys.path.append(".") from kufpybio.g...
#!/usr/bin/env python __description__ = "" __author__ = "Konrad Foerstner <konrad@foerstner.org>" __copyright__ = "2013 by Konrad Foerstner <konrad@foerstner.org>" __license__ = "ISC license" __email__ = "konrad@foerstner.org" __version__ = "" import argparse import csv import sys sys.path.append(".") from kufpybio.g...
Python
0
4bad79872547f90159e75b34b46e99e54f78b736
Fix error in big comment header.
l10n_ch_hr_payroll/__openerp__.py
l10n_ch_hr_payroll/__openerp__.py
# -*- coding: utf-8 -*- # # File: __openerp__.py # Module: l10n_ch_hr_payroll # # Created by sge@open-net.ch # # Copyright (c) 2014-TODAY Open-Net Ltd. <http://www.open-net.ch> ############################################################################## # # OpenERP, Open Source Management Solution # Copyrig...
# -*- coding: utf-8 -*- # # File: __init__.py # Module: l10n_ch_hr_payroll # # Created by sge@open-net.ch # # Copyright (c) 2014-TODAY Open-Net Ltd. <http://www.open-net.ch> ############################################################################## # # OpenERP, Open Source Management Solution # Copyright ...
Python
0
91e4ab4284490b0a232e2e0bc60df9059a264660
Revise exercise 1 checking
learntools/computer_vision/ex1.py
learntools/computer_vision/ex1.py
from learntools.core import * class Q1(CodingProblem): _var = 'pretrained_base' _hint = "`True` or `False`?" _correct_message = """When doing transfer learning, it's generally not a good idea to retrain the entire base -- at least not without some care. The reason is that the random weights in the head wi...
from learntools.core import * class Q1(CodingProblem): _var = 'pretrained_base' _hint = "`True` or `False`?" _correct_message = """When doing transfer learning, it's generally not a good idea to retrain the entire base -- at least not without some care. The reason is that the random weights in the head wi...
Python
0
5edf75129189fc37ce24ff338821b726b0a7c28a
Revert 2c1ee5f..1620020
Lesson_3_Problem_Set/05-Fixing_Name/name.py
Lesson_3_Problem_Set/05-Fixing_Name/name.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ In this problem set you work with cities infobox data, audit it, come up with a cleaning idea and then clean it up. In the previous quiz you recognized that the "name" value can be an array (or list in Python terms). It would make it easier to process and query the dat...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ In this problem set you work with cities infobox data, audit it, come up with a cleaning idea and then clean it up. In the previous quiz you recognized that the "name" value can be an array (or list in Python terms). It would make it easier to process and query the dat...
Python
0
c91beca414a5216a3fd5f8f5ef1c1643f0aea2f9
Tag the rc release
oct2py/__init__.py
oct2py/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) oct2py developers. # Distributed under the terms of the MIT License. """ Oct2Py is a means to seamlessly call M-files and GNU Octave functions from Python. It manages the Octave session for you, sharing data behind the scenes using MAT files. Usage is as simple as: ....
# -*- coding: utf-8 -*- # Copyright (c) oct2py developers. # Distributed under the terms of the MIT License. """ Oct2Py is a means to seamlessly call M-files and GNU Octave functions from Python. It manages the Octave session for you, sharing data behind the scenes using MAT files. Usage is as simple as: ....
Python
0
35801fdc81c4f5f93862b900bba656cfbbf1652c
Prepare version 0.1.18
djangocms_spa/__init__.py
djangocms_spa/__init__.py
__version__ = '0.1.18'
__version__ = '0.1.17'
Python
0
104e05f326b7138e524296c049a1860c8c8a8cea
document col_to_number
MPropulator/helpers.py
MPropulator/helpers.py
import string def column_range(start, stop, skip_columns=None): """0-indexed function that returns a list of Excel column names, except for skip_columns :param start: column index at which you begin iterating :param stop: column index at which you want to stop iterating :param skip_columns: colum...
import string def column_range(start, stop, skip_columns=None): """0-indexed function that returns a list of Excel column names, except for skip_columns :param start: column index at which you begin iterating :param stop: column index at which you want to stop iterating :param skip_columns: column...
Python
0.000301
c6793f73ba7f86767975ecdc7abdb287265c4733
add taggit app
meinberlin/settings.py
meinberlin/settings.py
""" Django settings for meinberlin project. Generated by 'django-admin startproject' using Django 1.8.17. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build ...
""" Django settings for meinberlin project. Generated by 'django-admin startproject' using Django 1.8.17. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build ...
Python
0.000001
50bc10585dddfbabda31b857b9bb4319110ccb8b
allow bool values in TEST_OUTPUT_VERBOSE for backwards-compatibility
src/xmlrunner/extra/djangotestrunner.py
src/xmlrunner/extra/djangotestrunner.py
# -*- coding: utf-8 -*- """Custom Django test runner that runs the tests using the XMLTestRunner class. This script shows how to use the XMLTestRunner in a Django project. To learn how to configure a custom TestRunner in a Django project, please read the Django docs website. """ from django.conf import settings try:...
# -*- coding: utf-8 -*- """Custom Django test runner that runs the tests using the XMLTestRunner class. This script shows how to use the XMLTestRunner in a Django project. To learn how to configure a custom TestRunner in a Django project, please read the Django docs website. """ from django.conf import settings try:...
Python
0.000176
48a243d48c9eb2a1165ff4cadf26313c6a3659c1
Add back changes which were accidentaly removed in ac123a028f296d49e09dda35efb3bb458fa0d161.
st2common/st2common/cmd/install_pack.py
st2common/st2common/cmd/install_pack.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
aafa325272649f03a3cd02cb82f2362704142b98
Improve exception proceduer
buzz2weibo.py
buzz2weibo.py
#!/usr/bin/python # vim: set fileencoding=utf-8 : # buzz2weibo # Copyright 2011 Sun Zhigang # See LICENSE for details. from config import * from urllib2 import urlopen, URLError from json import load from activity import * from weibopy.auth import OAuthHandler from weibopy.api import API import os, errno WEIBO_APP_K...
#!/usr/bin/python # vim: set fileencoding=utf-8 : # buzz2weibo # Copyright 2011 Sun Zhigang # See LICENSE for details. from config import * from urllib2 import urlopen, URLError from json import load from activity import * from weibopy.auth import OAuthHandler from weibopy.api import API import os, errno WEIBO_APP_K...
Python
0.000015
c00a12fb593e329cc1fc2d3710cd9e89d0abfa16
set production api url
c4r/config.py
c4r/config.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Server parameters baseApiUrl = 'https://cloud4rpi.io:3000/api'
#!/usr/bin/env python # -*- coding: utf-8 -*- # Server parameters baseApiUrl = 'http://stage.cloud4rpi.io:3000/api'
Python
0.000001
920e75491f3aaa74980e11086cfebe911c2def4b
Remove yield from datasets tests
statsmodels/datasets/tests/test_data.py
statsmodels/datasets/tests/test_data.py
import importlib import numpy as np import pandas as pd import nose import pytest import statsmodels.datasets from statsmodels.datasets.utils import Dataset exclude = ['check_internet', 'clear_data_home', 'get_data_home', 'get_rdataset', 'tests', 'utils', 'webuse'] datasets = [] for dataset_name in dir(st...
import numpy as np import pandas as pd import statsmodels.datasets as datasets from statsmodels.datasets import co2 from statsmodels.datasets.utils import Dataset def test_co2_python3(): # this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0 dta = co2.load_pandas() class TestDatasets(object): ...
Python
0
97badc176f4a8ac30eb3932359e2e132e36170c4
Increase the number of workers
docker/gunicorn_config.py
docker/gunicorn_config.py
import multiprocessing from os import getenv bind = '127.0.0.1:8001' workers = multiprocessing.cpu_count() * 3 timeout = 60 threads = multiprocessing.cpu_count() * 3 max_requests = 500 max_requests_jitter = 5 # Read the DEBUG setting from env var try: if getenv('DOCKER_SAL_DEBUG').lower() == 'true': errorlo...
import multiprocessing from os import getenv bind = '127.0.0.1:8001' workers = multiprocessing.cpu_count() * 2 timeout = 60 threads = multiprocessing.cpu_count() * 2 max_requests = 1000 max_requests_jitter = 5 # Read the DEBUG setting from env var try: if getenv('DOCKER_SAL_DEBUG').lower() == 'true': errorl...
Python
0.672158
15090b84e1c7359c49cb45aec4d9b4d492f855ac
Update smb test to include port parameter
tests/scoring_engine/engine/checks/test_smb.py
tests/scoring_engine/engine/checks/test_smb.py
from scoring_engine.engine.basic_check import CHECKS_BIN_PATH from tests.scoring_engine.engine.checks.check_test import CheckTest class TestSMBCheck(CheckTest): check_name = 'SMBCheck' required_properties = ['share', 'file', 'hash'] properties = { 'share': 'ScoringShare', 'file': 'flag.tx...
from scoring_engine.engine.basic_check import CHECKS_BIN_PATH from tests.scoring_engine.engine.checks.check_test import CheckTest class TestSMBCheck(CheckTest): check_name = 'SMBCheck' required_properties = ['share', 'file', 'hash'] properties = { 'share': 'ScoringShare', 'file': 'flag.tx...
Python
0
0ce7fa3100ce3d1626519da3f5395622af0e7fdf
fix for issue 440
tests/window/WINDOW_SET_MOUSE_SYSTEM_CURSOR.py
tests/window/WINDOW_SET_MOUSE_SYSTEM_CURSOR.py
#!/usr/bin/env python '''Test that mouse cursor can be set to a platform-dependent image. Expected behaviour: One window will be opened. Press the left and right arrow keys to cycle through the system mouse cursors. The current cursor selected will be printed to the terminal. Note that not all curs...
#!/usr/bin/env python '''Test that mouse cursor can be set to a platform-dependent image. Expected behaviour: One window will be opened. Press the left and right arrow keys to cycle through the system mouse cursors. The current cursor selected will be printed to the terminal. Note that not all curs...
Python
0
b3889bbdab80fb502c74b99b61cf36bae112ce2c
Add property decorator to getters
node/node.py
node/node.py
from configparser import ConfigParser from driver import BTRFSDriver class Node: """ # Dummy config example [bk1-z3.presslabs.net] ssd = True """ def __init__(self, context): self._conf_path = context['node']['conf_path'] self._driver = BTRFSDriver(context['volume_path']) ...
from configparser import ConfigParser from driver import BTRFSDriver class Node: """ # Dummy config example [bk1-z3.presslabs.net] ssd = True """ def __init__(self, context): self._conf_path = context['node']['conf_path'] self._driver = BTRFSDriver(context['volume_path']) ...
Python
0
af7a2e59b76a5c404e393a6fc1aeca9517018185
Fix peacock crash when filename with unicode exists
python/peacock/ExodusViewer/plugins/ExodusFilterProxyModel.py
python/peacock/ExodusViewer/plugins/ExodusFilterProxyModel.py
#!/usr/bin/env python2 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
#!/usr/bin/env python2 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
Python
0.000002
814b344082fbce471509c54c683470467dd8f814
use env to find python binary
main.pyw
main.pyw
#!/usr/bin/env python3 from tkinter import * from models import * import logging import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) appWindow = Tk() appWindow.title("Virtual Controller") # Set fullscreen [Not necessary when debugging] # appWindow.geometry("{0}x{1}+0+0".format(appWindow.winfo_screenwidth(), appWindow.w...
#!/usr/bin/python3 from tkinter import * from models import * import logging import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) appWindow = Tk() appWindow.title("Virtual Controller") # Set fullscreen [Not necessary when debugging] # appWindow.geometry("{0}x{1}+0+0".format(appWindow.winfo_screenwidth(), appWindow.winfo...
Python
0.000018
59c14e1c0d69309c554ddafa5e168115ba05ddfd
Update the win/lose determination code
match.py
match.py
''' The match monitoring module for SaltBot ''' from bs4 import BeautifulSoup import requests import time from bet import bet_player1 from website import website class Match: def __init__(self): self.id = 0 # TODO: Use SQL to determine this w/ MAX() self.player1 = None self.player2...
''' The match monitoring module for SaltBot ''' from bs4 import BeautifulSoup import requests import time from bet import bet_player1 from website import website class Match: def __init__(self): self.id = 0 # TODO: Use SQL to determine this w/ MAX() self.player1 = None self.player2...
Python
0
67e620716b494f74c9b913b6514463eb4689c590
add OMPL_DEBUG and other convenience function to python bindings
py-bindings/ompl/util/__init__.py
py-bindings/ompl/util/__init__.py
from os.path import abspath, dirname from ompl import dll_loader dll_loader('ompl', dirname(abspath(__file__))) from ompl.util._util import * import inspect def OMPL_DEBUG(text): c = inspect.currentframe().f_back getOutputHandler().log(text, LogLevel.LOG_DEBUG, c.f_code.co_filename, c.f_lineno) def OMPL_INFORM...
from os.path import abspath, dirname from ompl import dll_loader dll_loader('ompl', dirname(abspath(__file__))) from ompl.util._util import *
Python
0
cdf31e64ad2b951c4c8bd0acfb087b541490746c
Add root_path to http.services.Service
py/garage/garage/http/services.py
py/garage/garage/http/services.py
__all__ = [ 'ServiceError', 'EndpointNotFound', 'VersionNotSupported', 'Service', ] import logging import re from http import HTTPStatus from http2 import HttpError from garage import asserts LOG = logging.getLogger(__name__) class ServiceError(Exception): pass class EndpointNotFound(Servic...
__all__ = [ 'ServiceError', 'EndpointNotFound', 'VersionNotSupported', 'Service', ] import logging import re from http import HTTPStatus from http2 import HttpError from garage import asserts LOG = logging.getLogger(__name__) class ServiceError(Exception): pass class EndpointNotFound(Servic...
Python
0.000018
66b6d3648c0a4229048c0f8a63ec410c407f1ba1
Fix unittest
src/pyscaffold/extensions/no_skeleton.py
src/pyscaffold/extensions/no_skeleton.py
# -*- coding: utf-8 -*- """ Extension that omits the creation of file `skeleton.py` """ from ..api import Extension from ..api import helpers class NoSkeleton(Extension): """Omit creation of skeleton.py""" def activate(self, actions): """Activate extension Args: actions (list): l...
# -*- coding: utf-8 -*- """ Extension that omits the creation of file `skeleton.py` """ from ..api import Extension from ..api import helpers class NoSkeleton(Extension): """Omit creation of skeleton.py""" def activate(self, actions): """Activate extension Args: actions (list): l...
Python
0.00002
651e257928fc263d06773f0ca3c5ab63697af844
Add http.services.ServiceHub
py/garage/garage/http/services.py
py/garage/garage/http/services.py
__all__ = [ 'ServiceError', 'EndpointNotFound', 'VersionNotSupported', 'ServiceHub', 'Service', ] import logging import re from collections import namedtuple from http import HTTPStatus from http2 import HttpError from garage import asserts LOG = logging.getLogger(__name__) class ServiceError...
__all__ = [ 'ServiceError', 'EndpointNotFound', 'VersionNotSupported', 'Service', ] import re from collections import namedtuple from http import HTTPStatus from http2 import HttpError from garage import asserts class ServiceError(Exception): pass class EndpointNotFound(ServiceError): pas...
Python
0.000004
0062eeaf558a0eb9e8a736baf16932e56546001f
Fix silly Python indentation issues.
src/query_processing/query_processing.py
src/query_processing/query_processing.py
# LING 573 Question Answering System # Code last updated 4/15/14 by Andrea Kahn # # This code implements a QueryProcessor for the question answering system. import sys import general_classes import nltk # TODO: A QueryProcessor should be initialized with the Question object, but should it # have this question as an ...
# LING 573 Question Answering System # Code last updated 4/15/14 by Andrea Kahn # # This code implements a QueryProcessor for the question answering system. import sys import general_classes import nltk # TODO: A QueryProcessor should be initialized with the Question object, but should it # have this question as an ...
Python
0.000002
c6b47431f75675547d54c3b68c07aad76721e513
fix srfit test
pyiid/tests/test_against_srfit.py
pyiid/tests/test_against_srfit.py
__author__ = 'christopher' from pyiid.tests import * from pyiid.experiments.elasticscatter import ElasticScatter local_test_atoms = setup_atomic_square()[0] * 3 test_data = tuple(product([local_test_atoms], [None])) @known_fail_if(not srfit) def check_fq_against_srfit(): # unpack the atoms and experiment ato...
__author__ = 'christopher' from pyiid.tests import * from pyiid.experiments.elasticscatter import ElasticScatter local_test_atoms = setup_atomic_square()[0] * 3 test_data = tuple(product([local_test_atoms], [None])) def test_fq_against_srfit(): for value in test_data: yield check_fq_against_srfit, value ...
Python
0.000001
205483ef0241ee48821a801a97faa4d19121651a
check buffer, use own exception
pyscreenshot/plugins/gdk3pixbuf.py
pyscreenshot/plugins/gdk3pixbuf.py
# -*- coding: utf-8 -*- """Gdk3-based screenshotting. Adapted from https://stackoverflow.com/a/37768950/81636, but uses buffers directly instead of saving intermediate files (which is slow). """ import sys from PIL import Image from pyscreenshot.plugins.backend import CBackend from pyscreenshot.util import platform_i...
# -*- coding: utf-8 -*- """Gdk3-based screenshotting. Adapted from https://stackoverflow.com/a/37768950/81636, but uses buffers directly instead of saving intermediate files (which is slow). """ import sys from PIL import Image from pyscreenshot.plugins.backend import CBackend from pyscreenshot.util import platform_i...
Python
0
8b34cf20b9cc010d321912433d772ccad8dbdb6f
Update MediaWiki version for i18n_family.py from trunk r8823
pywikibot/families/i18n_family.py
pywikibot/families/i18n_family.py
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # The Wikimedia i18n family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'i18n' self.langs = { 'i18n': 'translatewiki.net', } def version(self...
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # The Wikimedia i18n family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'i18n' self.langs = { 'i18n': 'translatewiki.net', } def version(self...
Python
0.000001
aeeed413830f58c60ab4b05beddf44ab4dba5e36
Update views.py
chat/views.py
chat/views.py
import random import string from django.db import transaction from django.shortcuts import render, redirect import haikunator from .models import Room def about(request): return render(request, "chat/about.html") def new_room(request): """ Randomly create a new room, and redirect to it. """ new_ro...
import random import string from django.db import transaction from django.shortcuts import render, redirect import haikunator from .models import Room def about(request): return render(request, "chat/about.html") def new_room(request): """ Randomly create a new room, and redirect to it. """ new_ro...
Python
0
9e6e2fd1903b8e4deb3b6737d86aadc2627cb4eb
add the `__all__` to `_compat.py`.
flask_storage/_compat.py
flask_storage/_compat.py
import sys try: from urlparse import urljoin import urllib2 as http except ImportError: from urllib.parse import urljoin from urllib import request as http if sys.version_info[0] == 3: string_type = str else: string_type = unicode __all__ = ['urljoin', 'http', 'string_type', 'to_bytes'] def...
import sys try: from urlparse import urljoin import urllib2 as http except ImportError: from urllib.parse import urljoin from urllib import request as http if sys.version_info[0] == 3: string_type = str else: string_type = unicode def to_bytes(text): if isinstance(text, string_type): ...
Python
0
901b3e88704f938dcc090bb93b9818ac7ac994dd
Update ipc_lista1.8.py
lista1/ipc_lista1.8.py
lista1/ipc_lista1.8.py
#ipc_lista1.8 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês. #Calcule e mostre o total do seu salário no referido mês. QntHora = input("Entre com o valor de seu rendimento por hora: ") hT = input("E...
#ipc_lista1.8 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês. #Calcule e mostre o total do seu salário no referido mês. QntHora = input("Entre com o valor de seu rendimento por hora: ") hT = input("E...
Python
0
84f9f45f984cbf0b4192cae49e51333767bb5576
fix runtox.py failure when 'tox' is not available on the current system path
runtox.py
runtox.py
#!/usr/bin/env python import subprocess import sys if __name__ == "__main__": subprocess.call([sys.executable, "-m", "tox", "-i", "ALL=https://devpi.net/hpk/dev/", "--develop",] + sys.argv[1:])
#!/usr/bin/env python import subprocess import sys if __name__ == "__main__": subprocess.call(["tox", "-i", "ALL=https://devpi.net/hpk/dev/", "--develop",] + sys.argv[1:])
Python
0.000003
bc9c43160a58508e412592b0ab9a0d7f3a35c48c
fix regression in folde tests
src/adhocracy/adhocracy/folder/test_init.py
src/adhocracy/adhocracy/folder/test_init.py
import unittest from pyramid import testing class ResourcesAutolNamingFolderUnitTest(unittest.TestCase): def setUp(self): self.config = testing.setUp() def tearDown(self): testing.tearDown() def _makeOne(self, d=None): from . import ResourcesAutolNamingFolder return Res...
import unittest from pyramid import testing class ResourcesAutolNamingFolderUnitTest(unittest.TestCase): def setUp(self): self.config = testing.setUp() def tearDown(self): testing.tearDown() def _makeOne(self, d=None): from . import ResourcesAutolNamingFolder return Res...
Python
0
d6e06d4be5c483bdf4aff8032ff22bee5a49be02
Fix broken test.
backend/sublime/testdata/view_test.py
backend/sublime/testdata/view_test.py
# coding=utf-8 import sys import traceback try: import sublime v = sublime.test_window.new_file() assert v.id() != sublime.test_window.id() assert sublime.test_window.id() == v.window().id() assert v.size() == 0 e = v.begin_edit() v.insert(e, 0, "hellå world") v.end_edit(e) assert v....
# coding=utf-8 import sys import traceback try: import sublime v = sublime.test_window.new_file() assert v.id() != sublime.test_window.id() assert sublime.test_window.id() == v.window().id() assert v.size() == 0 e = v.begin_edit() v.insert(e, 0, "hellå world") v.end_edit(e) assert v....
Python
0
5e4c9f5a82f9a4f505cbb5c11e411ef70bc78db9
Bump version
metakernel/__init__.py
metakernel/__init__.py
from ._metakernel import ( MetaKernel, IPythonKernel, register_ipython_magics, get_metakernel) from . import pexpect from .replwrap import REPLWrapper, u from .process_metakernel import ProcessMetaKernel from .magic import Magic, option from .parser import Parser __all__ = ['Magic', 'MetaKernel', 'option'] __vers...
from ._metakernel import ( MetaKernel, IPythonKernel, register_ipython_magics, get_metakernel) from . import pexpect from .replwrap import REPLWrapper, u from .process_metakernel import ProcessMetaKernel from .magic import Magic, option from .parser import Parser __all__ = ['Magic', 'MetaKernel', 'option'] __vers...
Python
0
d5ec09fe4ad4209c387b1b0da82a412ea83f7658
Change module name
misp_modules/modules/expansion/__init__.py
misp_modules/modules/expansion/__init__.py
from . import _vmray # noqa __all__ = ['vmray_submit', 'bgpranking', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns', 'btc_steroids', 'domaintools', 'eupi', 'farsight_passivedns', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns'...
from . import _vmray # noqa __all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns', 'btc_steroids', 'domaintools', 'eupi', 'farsight_passivedns', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns...
Python
0.00002
ac4058c78889f9500d8d61321fa1e3071280c9d6
add dump
misc/testzookeeper2.py
misc/testzookeeper2.py
''' Created on 2016/9/20 :author: hubo ''' from __future__ import print_function from vlcp.server import main from vlcp.event import Client from vlcp.server.module import Module from vlcp.config import defaultconfig from vlcp.protocol.zookeeper import ZooKeeper, ZooKeeperConnectionStateEvent,\ ZooKeeperWatcherEven...
''' Created on 2016/9/20 :author: hubo ''' from __future__ import print_function from vlcp.server import main from vlcp.event import Client from vlcp.server.module import Module from vlcp.config import defaultconfig from vlcp.protocol.zookeeper import ZooKeeper, ZooKeeperConnectionStateEvent,\ ZooKeeperWatcherEven...
Python
0.000001
48894b2200d3324525ce3f1056fbd4d3420765e2
Make date string sent to Guardian API dynamic.
scrape.py
scrape.py
#!/usr/bin/env python import argparse from datetime import datetime from json import loads from bs4 import BeautifulSoup from ebooklib import epub import requests def get_todays_news(section, api_key): now = datetime.now() api_date = now.strftime('%Y-%m-%d') payload = {'api-key': api_key, ...
#!/usr/bin/env python import argparse from datetime import datetime from json import loads from bs4 import BeautifulSoup from ebooklib import epub import requests def get_todays_news(api_key): payload = {'api-key': api_key, 'section': 'world', 'from-date': '2015-03-22'} r = re...
Python
0
29134a36b3b1d5db12fe4891d1f15191f7f1fa31
make collection paths unique to avoid all sorts of mayhem
src/compas_blender/utilities/collections.py
src/compas_blender/utilities/collections.py
import bpy from typing import List, Text from compas_blender.utilities import delete_objects __all__ = [ "create_collection", "create_collections", "create_collections_from_path", "clear_collection", "clear_collections" ] def collection_path(collection, names=[]): for parent in bpy.data.col...
import bpy from typing import List, Text from compas_blender.utilities import delete_objects __all__ = [ "create_collection", "create_collections", "create_collections_from_path", "clear_collection", "clear_collections" ] def create_collection(name: Text, parent: bpy.types.Collection = None) ->...
Python
0
886396d69f2109f8fcfe2d92e39d73959f406ccf
Add Union type hint
src/poliastro/frames/util.py
src/poliastro/frames/util.py
from typing import Dict, Union from astropy.coordinates.baseframe import BaseCoordinateFrame from poliastro.bodies import ( Body, Earth, Jupiter, Mars, Mercury, Neptune, Saturn, SolarSystemPlanet, Sun, Uranus, Venus, ) from poliastro.constants import J2000 from .ecliptic i...
from typing import Dict from astropy.coordinates.baseframe import BaseCoordinateFrame from poliastro.bodies import ( Body, Earth, Jupiter, Mars, Mercury, Neptune, Saturn, SolarSystemPlanet, Sun, Uranus, Venus, ) from poliastro.constants import J2000 from .ecliptic import G...
Python
0
54fab9c1cb9e2888f7050392d38a94b4f6546741
fix branch reference
get_version.py
get_version.py
"""Return the short version string.""" from mpf._version import __short_version__ print("{}.x".format(__short_version__))
"""Return the short version string.""" from mpf._version import __short_version__ print(__short_version__)
Python
0
97c7a7310771fd682a451d3967f8343f6c8e5c9a
mount.py
gitfs/mount.py
gitfs/mount.py
import argparse import threading from fuse import FUSE from gitfs.utils import Args from gitfs.routes import routes from gitfs.router import Router from gitfs.worker import MergeQueue, MergeWorker, FetchWorker def parse_args(parser): parser.add_argument('remote_url', help='repo to be cloned') parser.add_arg...
import argparse import threading from fuse import FUSE from gitfs.utils import Args from gitfs.routes import routes from gitfs.router import Router from gitfs.worker import MergeQueue, MergeWorker, FetchWorker parser = argparse.ArgumentParser(prog='GitFS') parser.add_argument('remote_url', help='repo to be cloned')...
Python
0.998762
b14c6446ac16798f797f279818ae53adc549323e
Clean up wrap.py a bit
unnaturalcode/wrap.py
unnaturalcode/wrap.py
#!/usr/bin/env python # Copyright 2013 Joshua Charles Campbell, Alex Wilson # # This file is part of UnnaturalCode. # # UnnaturalCode 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, e...
#!/usr/bin/env python # Copyright 2013 Joshua Charles Campbell, Alex Wilson # # This file is part of UnnaturalCode. # # UnnaturalCode 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, e...
Python
0
914a7ae8480875942f6273cf70249f9f9fdf482a
Remove unused and unimplemented `retry_on_decode_error` option from modelzoo.util's `load_graphdef`. The option is no longer needed as loading itself will autodetect Exceptions during loading and retry
lucid/modelzoo/util.py
lucid/modelzoo/util.py
# Copyright 2018 The Lucid Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# Copyright 2018 The Lucid Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
Python
0.000001
da73a9a5c63a3bbeee707dd47cf9a76b03f95819
Update SubnetCalculation.py
Main/SubnetCalculation.py
Main/SubnetCalculation.py
class subnet_calculation(): @staticmethod def verify_IP(start, end, hosts): container = [start, end] startIP = start endIP = end try: hosts = int(hosts) except (TypeError, ValueError) as e: print("cant convert", e) count = 0 validN...
class subnet_calculation(): @staticmethod def verify_IP(start, end, hosts): container = [start, end] startIP = start endIP = end try: hosts = int(hosts) except (TypeError, ValueError) as e: print("cant convert", e) count = 0 validN...
Python
0
75be8ed7040cd43aa0a41cba56da48942972ca42
Add Testts For Models
monkey_pdns/app/tests.py
monkey_pdns/app/tests.py
from django.test import TestCase from django.contrib.auth.models import User from .views import hello from .models import Zone, Sub_Zone, Record, Record_Type class View_hello_tests(TestCase): def test_hello(self): response = self.client.get('/') self.assertEqual(response.status_code, 200) ...
from django.test import TestCase from .views import hello class View_hello_tests(TestCase): def test_hello(self): response = self.client.get('/') self.assertEqual(response.status_code, 200) self.assertContains(response, 'Hello World!')
Python
0
ab819232e0e036709ff6098b2d9f259fc8956ca2
add in sentinel support
update_school_data.py
update_school_data.py
import governorhub import logging import redis from redis.sentinel import Sentinel import os import loggly.handlers from datetime import datetime from similar_schools import update_similar_schools from dfe_data import update_dfe_data logging.basicConfig(level=logging.INFO) # Turn off requests INFO level logging requ...
import governorhub import logging import redis import os import loggly.handlers from datetime import datetime from similar_schools import update_similar_schools from dfe_data import update_dfe_data logging.basicConfig(level=logging.INFO) # Turn off requests INFO level logging requests_log = logging.getLogger("reques...
Python
0
493637ace6881defedee22971f3bc39fe9a5bd0a
Make it compatible with Bob
freesas/test/__init__.py
freesas/test/__init__.py
#!usr/bin/env python # coding: utf-8 __author__ = "Jérôme Kieffer" __license__ = "MIT" __date__ = "15/01/2021" __copyright__ = "2015-2021, ESRF" import sys import unittest from .test_all import suite def run_tests(): """Run test complete test_suite""" mysuite = suite() runner = unittest.TextTestRunner()...
#!usr/bin/env python # coding: utf-8 __author__ = "Jérôme Kieffer" __license__ = "MIT" __date__ = "05/09/2017" __copyright__ = "2015, ESRF" import unittest from .test_all import suite def run(): runner = unittest.TextTestRunner() return runner.run(suite()) if __name__ == '__main__': run()
Python
0.000001
1697e0a20b14c89cf2db209ef03cb1dc551b14a1
Bump version
cider/__init__.py
cider/__init__.py
from .core import Cider __author__ = "Michael Sanders" __version__ = "1.1" __all__ = ["Cider"]
from .core import Cider __author__ = "Michael Sanders" __version__ = "1.0" __all__ = ['Cider']
Python
0
e0a8f8f6765a071ba71191b6e047b861812ec2f9
Update settings.py
utilities/settings.py
utilities/settings.py
import math #Tilt pot setpoints .158 kMaxDown = .800 kMaxUp = kMaxDown - .590 kTop = kMaxUp + .050 kTopShot = .292 kTopShotAtBase = .281 kBottom = kMaxDown - .050 kShootLevel = .646 kShootAtBase = .528 kShootRamp = .400 kLongShot = .600 class Settings(): """Robot mapping. Values that are changed often go here."""...
import math #Tilt pot setpoints .158 kMaxDown = .79 kMaxUp = kMaxDown - .590 kTop = kMaxUp + .050 kTopShot = .292 kTopShotAtBase = .281 kBottom = kMaxDown - .050 kShootLevel = .646 kShootAtBase = .528 kShootRamp = .400 kLongShot = .600 class Settings(): """Robot mapping. Values that are changed often go here.""" ...
Python
0.000001
0f4d44722bf5162922a7ddbfb00fcd042dc3de9d
clean up _restore_cache_key a bit
corehq/ex-submodules/casexml/apps/phone/restore_caching.py
corehq/ex-submodules/casexml/apps/phone/restore_caching.py
import hashlib import logging from casexml.apps.phone.const import RESTORE_CACHE_KEY_PREFIX, ASYNC_RESTORE_CACHE_KEY_PREFIX from dimagi.utils.couch.cache.cache_core import get_redis_default_cache logger = logging.getLogger(__name__) def _restore_cache_key(domain, prefix, user_id, sync_log_id, device_id): # to in...
import hashlib import logging from casexml.apps.phone.const import RESTORE_CACHE_KEY_PREFIX, ASYNC_RESTORE_CACHE_KEY_PREFIX from dimagi.utils.couch.cache.cache_core import get_redis_default_cache logger = logging.getLogger(__name__) def _restore_cache_key(domain, prefix, user_id, version, sync_log_id, device_id): ...
Python
0.000001
555e76a62f0ec955932f95bec444e7c360f23241
use environment variable to set port
server.py
server.py
import os from flask import Flask from flask import jsonify from flask import render_template from flask.ext.cors import CORS from api import api app = Flask(__name__) cors = CORS(app) if __name__ == "__main__": port = os.environ.setdefault("PORT", "5000") app.register_blueprint(api) app.run(debug=True, por...
from flask import Flask from flask import jsonify from flask import render_template from flask.ext.cors import CORS from api import api app = Flask(__name__) cors = CORS(app) if __name__ == "__main__": app.register_blueprint(api) app.run(debug=True, port=5100)
Python
0.000001
828c78566879412c6e2cc6981af9fa1adb5bdcf4
return result files, not just names
server.py
server.py
import config import glob import flask import os import json app = flask.Flask(__name__) @app.route("/versions/") def get_recommended_versions(): return flask.jsonify({"versions" : config.recommended_versions}) @app.route("/results", methods=['GET', 'POST']) def submit_result(): if flask.request.method == "P...
import config import glob import flask import os import json app = flask.Flask(__name__) @app.route("/versions/") def get_recommended_versions(): return flask.jsonify({"versions" : config.recommended_versions}) @app.route("/results", methods=['GET', 'POST']) def submit_result(): if flask.request.method == "P...
Python
0.000001
0fc2cc8aafc1cf778ecc12439becf8482cb47097
resolve imports
setapp.py
setapp.py
import os import cherrypy from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool from app.setutils import Card import webservices.solitairegame import webservices.multiplayergame class SetApp: homepage = '' @cherrypy.expose def index(self): try: return open(self.home...
import os import cherrypy from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool from app.setutils import Card import webservices.solitairegame class SetApp: homepage = '' @cherrypy.expose def index(self): try: return open(self.homepage) except FileNotFoundEr...
Python
0.000021
6b276c384141bd2f2a22523184db349a91849169
Determine supported http methods from the classes.
massa/api.py
massa/api.py
# -*- coding: utf-8 -*- from flask import Blueprint, jsonify, g, request, url_for from flask.views import MethodView from .domain import EntityNotFoundError, InvalidInputError def endpoint(f): def wrapper(*args, **kwargs): try: rv = f(*args, **kwargs) except EntityNotFoundError as e: ...
# -*- coding: utf-8 -*- from flask import Blueprint, jsonify, g, request, url_for from flask.views import MethodView from .domain import EntityNotFoundError, InvalidInputError def endpoint(f): def wrapper(*args, **kwargs): try: rv = f(*args, **kwargs) except EntityNotFoundError as e: ...
Python
0
3cc3c22acbdc84124bade7c6f81af016951cb4cd
Fix typo in stream_spec.
spec/data/stream_spec.py
spec/data/stream_spec.py
import mock from data import stream from spec.mamba import * with description('stream'): with it('instantiates without errors'): expect(calling(stream.Stream)).not_to(raise_error) with it('subscribes without errors'): s = stream.Stream() expect(calling(s.subscribe, mock.Mock())).not_to(raise_error) ...
import mock from data import stream from spec.mamba import * with description('stream'): with it('instantiates without errors'): expect(calling(stream.Stream)).not_to(raise_error) with it('subscribes without errors'): s = stream.Stream() expect(calling(s.subscribe, mock.Mock())).not_to(raise_error) ...
Python
0
014409ba87895f984a453347bcfb729e157d6be0
Use pkg_resources to locate data folder within package
marcottievents/base.py
marcottievents/base.py
import re import sys import logging import pkg_resources from contextlib import contextmanager from sqlalchemy.engine import create_engine from sqlalchemy.orm.session import Session from .version import __version__ from etl.ecsv import CSVExtractor from etl import ETL, MarcottiTransform, MarcottiLoad logger = loggi...
import re import sys import logging from contextlib import contextmanager from sqlalchemy.engine import create_engine from sqlalchemy.orm.session import Session from .version import __version__ from etl.ecsv import CSVExtractor from etl import ETL, MarcottiTransform, MarcottiLoad logger = logging.getLogger(__name__...
Python
0
1f59ad4a5fa14a420c683cfd8713c0eb31a9acec
Bump version number for aio.
rest_framework_swagger/__init__.py
rest_framework_swagger/__init__.py
VERSION = '0.3.5-aio-v1' DEFAULT_SWAGGER_SETTINGS = { 'exclude_namespaces': [], 'api_version': '', 'api_key': '', 'token_type': 'Token', 'enabled_methods': ['get', 'post', 'put', 'patch', 'delete'], 'is_authenticated': False, 'is_superuser': False, 'permission_denied_handler': None, ...
VERSION = '0.3.2' DEFAULT_SWAGGER_SETTINGS = { 'exclude_namespaces': [], 'api_version': '', 'api_key': '', 'token_type': 'Token', 'enabled_methods': ['get', 'post', 'put', 'patch', 'delete'], 'is_authenticated': False, 'is_superuser': False, 'permission_denied_handler': None, 'resou...
Python
0