commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
5fa36e781729fbfe5e3343f921e52eebf0062e75 | Switch rackspace env variables to prettyconf | scottwernervt/cloudstorage | tests/settings.py | tests/settings.py | import hashlib
import os
from tempfile import mkdtemp
from time import time
from prettyconf.configuration import Configuration
config = Configuration()
# Append epoch to prevent test runs from clobbering each other.
CONTAINER_PREFIX = 'cloud-storage-test-' + str(int(time()))
SECRET = hashlib.sha1(os.urandom(128)).he... | import hashlib
import os
from tempfile import mkdtemp
from time import time
from prettyconf.configuration import Configuration
config = Configuration()
# Append epoch to prevent test runs from clobbering each other.
CONTAINER_PREFIX = 'cloud-storage-test-' + str(int(time()))
SECRET = hashlib.sha1(os.urandom(128)).he... | mit | Python |
6e3ebff613254c7e13d89cd3599e030947a5072f | fix coverage report | bulkan/robotframework-requests,bulkan/robotframework-requests | tests/unittest/test_calls.py | tests/unittest/test_calls.py | import os
import sys
from unittest import TestCase, mock
from unittest.mock import patch
# I hate it but I can't get the coverage report to work without it, must be before RequestsLibrary import
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../src/')))
import RequestsLibrary
lib = Req... | from unittest import TestCase, mock
from unittest.mock import patch
import RequestsLibrary
lib = RequestsLibrary.RequestsLibrary()
HTTP_LOCAL_SERVER = 'http://localhost:5000'
sess_headers = {'content-type': False}
post_headers = {'Content-Type': 'application/json'}
class TestCalls(TestCase):
@patch('RequestsLibr... | mit | Python |
3dd0ac13a5c2a3e0dc949d60e807b438c36636a9 | Fix for post_process. | cwant/tessagon | core/tessagon.py | core/tessagon.py | from tessagon.core.grid_tile_generator import GridTileGenerator
from tessagon.core.rotate_tile_generator import RotateTileGenerator
class Tessagon:
def __init__(self, **kwargs):
if 'function' in kwargs:
self.f = kwargs['function']
else:
raise ValueError('Must specify a function')
self.tile_c... | from tessagon.core.grid_tile_generator import GridTileGenerator
from tessagon.core.rotate_tile_generator import RotateTileGenerator
class Tessagon:
def __init__(self, **kwargs):
if 'function' in kwargs:
self.f = kwargs['function']
else:
raise ValueError('Must specify a function')
self.tile_c... | apache-2.0 | Python |
d71353d8d1e0778f121c3ec07067d617ab3ce932 | Add run() method to Backend and make start() a wrapper for it. Also set backend.running in backend.start and backend.stop. Whatever code runs in a loop in backend.run() needs to check self.running periodically to make sure it should still be running. | rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy | lib/rapidsms/backends/backend.py | lib/rapidsms/backends/backend.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
class Backend(object):
def __init__ (self, router):
self.router = router
self.running = False
def log(self, level, message):
self.router.log(level, message)
def start(self):
self.running = True
try:
... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
class Backend(object):
def __init__ (self, router):
self.router = router
def log(self, level, message):
self.router.log(level, message)
def start(self):
raise NotImplementedError
def stop(self):
raise NotImple... | bsd-3-clause | Python |
f81bc19a9627225113ff1a3fa2aa0e6446402acb | test that shorten is text/plain (answer no :S) | aa-m-sa/summer-url-py | tests/test_api.py | tests/test_api.py | import unittest
from flask import url_for
import summerurlapp
import appconfig
import types
class SummerApiTestCase(unittest.TestCase):
"""Test that the API works as intended"""
testurl_http1 = "http://random.org"
testurl_bad = "random.org"
def setUp(self):
summerurlapp.app.config.from_objec... | import unittest
from flask import url_for
import summerurlapp
import appconfig
import types
class SummerApiTestCase(unittest.TestCase):
"""Test that the API works as intended"""
testurl_http1 = "http://random.org"
testurl_bad = "random.org"
def setUp(self):
summerurlapp.app.config.from_objec... | mit | Python |
a396332ad66d31ac5caa1fcbf92ed564615fac85 | Use assert_raises in test_cli | rspeer/python-ftfy | tests/test_cli.py | tests/test_cli.py | import subprocess
import os
from nose.tools import eq_, assert_raises
# Get the filename of 'halibote.txt', which contains some mojibake about
# Harry Potter in Chinese
THIS_DIR = os.path.dirname(__file__)
TEST_FILENAME = os.path.join(THIS_DIR, 'halibote.txt')
CORRECT_OUTPUT = '【更新】《哈利波特》石堧卜才新婚娶初戀今痠逝\n'
FAILED_OUTPUT... | import subprocess
import os
from nose.tools import eq_
# Get the filename of 'halibote.txt', which contains some mojibake about
# Harry Potter in Chinese
THIS_DIR = os.path.dirname(__file__)
TEST_FILENAME = os.path.join(THIS_DIR, 'halibote.txt')
CORRECT_OUTPUT = '【更新】《哈利波特》石堧卜才新婚娶初戀今痠逝\n'
FAILED_OUTPUT = '''ftfy erro... | mit | Python |
83dc9b5f80268a5bd23a737d66a219067353f2b7 | change parameter handling | fpbattaglia/ophys_io,fpbattaglia/ophys_io,wonkoderverstaendige/ophys_io,wonkoderverstaendige/ophys_io | test_files.py | test_files.py | #!/usr/bin/env python
# Generate test directories to mess with from a list of filenames.
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input')
parser.add_argument('-t', '--target')
args = parser.parse_args()
base_dir = args.target if args.target else 'testing'... | #!/usr/bin/env python
# Generate test directories to mess with from a list of filenames.
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input')
parser.add_argument('-t', '--target')
args = parser.parse_args()
base_dir = args.target if args.target else 'testing'... | mit | Python |
e94b2593424518632c704f4a440df3bc51cbcd3e | fix failing tests. | core/uricore | tests/test_uri.py | tests/test_uri.py | # encoding: utf-8
import unittest
from resources import URI
from resources import IRI
class TestURISnowman(unittest.TestCase):
def setUp(self):
idna = u"\N{SNOWMAN}".encode('idna')
uri = "http://u:p@www.%s:80/path" % idna
self.uri = URI(uri)
def testFail(self):
self.assertRa... | # encoding: utf-8
import unittest
from resources import URI
from resources import IRI
class TestURISnowman(unittest.TestCase):
def setUp(self):
uri = "http://u:p@" + "www.\N{SNOWMAN}".encode('idna') + ":80/path"
self.uri = URI(uri)
def testFail(self):
self.assertRaises(TypeError, UR... | bsd-2-clause | Python |
4104ea04d75b400e7a2a4d71c259ceb0957f8992 | include the absolute url to the onsite page | crate-archive/crate-site,crateio/crate.pypi,crate-archive/crate-site | crate_project/apps/packages/api.py | crate_project/apps/packages/api.py | from tastypie import fields
from tastypie.resources import ModelResource
from packages.models import Package, Release
class PackageResource(ModelResource):
releases = fields.ToManyField("packages.api.ReleaseResource", "releases")
class Meta:
allowed_methods = ["get"]
include_absolute_url = T... | from tastypie import fields
from tastypie.resources import ModelResource
from packages.models import Package, Release
class PackageResource(ModelResource):
releases = fields.ToManyField("packages.api.ReleaseResource", "releases")
class Meta:
allowed_methods = ["get"]
queryset = Package.objec... | bsd-2-clause | Python |
6bc3e784828c1f339ab4fd5fe3ca6dc80a07bb46 | Enable logs | UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine | crawler/tasks.py | crawler/tasks.py | from __future__ import absolute_import, unicode_literals
from .celery import app
from celery.utils.log import get_task_logger
from .crawler import crawl_url
logger = get_task_logger(__name__)
@app.task(rate_limit="6/s", queue='crawler')
def crawl_url_task(url, value):
crawl_url(url, value)
response, status, ... | from __future__ import absolute_import, unicode_literals
from .celery import app
# from celery.utils.log import get_task_logger
from .crawler import crawl_url
# logger = get_task_logger(__name__)
@app.task(rate_limit="6/s", queue='crawler')
def crawl_url_task(url, value):
crawl_url(url, value)
# response, st... | mit | Python |
89d70f5794969cb8d71201504b8645a8359f5b70 | read config file strings as unicode | edx/credentials,edx/credentials,edx/credentials,edx/credentials | credentials/settings/production.py | credentials/settings/production.py | from os import environ
import yaml
from credentials.settings.base import *
from credentials.settings.utils import get_env_setting, get_logger_config
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
LOGGING = get_logger_config()
# Keep track of the names of settings that represent dicts. Instead of overr... | from os import environ
import yaml
from credentials.settings.base import *
from credentials.settings.utils import get_env_setting, get_logger_config
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
LOGGING = get_logger_config()
# Keep track of the names of settings that represent dicts. Instead of overr... | agpl-3.0 | Python |
8257411a58f03d8a353129f2813cbc516a0e40c6 | Make sure API tests are registered | editorsnotes/editorsnotes,editorsnotes/editorsnotes | editorsnotes/api/tests/__init__.py | editorsnotes/api/tests/__init__.py | from .serializers import *
from .views import *
| agpl-3.0 | Python | |
2982d38d863e6f7654c4939a526d6e783525f8d6 | refactor compare_players | wroberts/cribbage,wroberts/cribbage | cribbage/main.py | cribbage/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
from cribbage.game import Game
from cribbage.randomplayer import RandomCribbagePlayer
from cribbage.simpleplayer import SimpleCribbagePlayer
def compare_players(players, num_games=1000):
stats = [0, 0]
for i i... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
from cribbage.game import Game
from cribbage.randomplayer import RandomCribbagePlayer
from cribbage.simpleplayer import SimpleCribbagePlayer
# ------------------------------------------------------------
# Cribbage Ga... | mit | Python |
0415361dcd6171f0f407ee528fa0761bf1e914b0 | Add proc name to gunicorn conf. | jerivas/mezzanine,tuxinhang1989/mezzanine,joshcartme/mezzanine,dsanders11/mezzanine,orlenko/sfpirg,Cicero-Zhao/mezzanine,dovydas/mezzanine,promil23/mezzanine,gbosh/mezzanine,Kniyl/mezzanine,dsanders11/mezzanine,wrwrwr/mezzanine,christianwgd/mezzanine,agepoly/mezzanine,orlenko/sfpirg,saintbird/mezzanine,scarcry/snm-mezz... | mezzanine/project_template/deploy/gunicorn.conf.py | mezzanine/project_template/deploy/gunicorn.conf.py | import os
bind = "127.0.0.1:%(gunicorn_port)s"
workers = (os.sysconf("SC_NPROCESSORS_ONLN") * 2) + 1
loglevel = "error"
proc_name = "%(proj_name)s"
| import os
bind = "127.0.0.1:%(port)s"
workers = (os.sysconf("SC_NPROCESSORS_ONLN") * 2) + 1
loglevel = "error"
| bsd-2-clause | Python |
56606d3234fbebc504feec201e4a99a3adcd5023 | Fix code for pyflake8 convention | jobiols/management-system,ClearCorp/management-system | mgmtsystem_hazard_risk/models/mgmtsystem_hazard.py | mgmtsystem_hazard_risk/models/mgmtsystem_hazard.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it und... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it und... | agpl-3.0 | Python |
96113152179ca81f24b85c19420fae7078907035 | change to ipn ver | lucky-/django-amazon-buynow | amazon_buttons/views.py | amazon_buttons/views.py | from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from amazon_buttons import models
import datetime
from django.conf import settings
import urllib
from amazon_buttons import buttonconf
from amazon_buttons import _crypt
@csrf_exempt
def ipn_handler(request):
ipn = models.ipn... | from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from amazon_buttons import models
import datetime
from django.conf import settings
import urllib
from amazon_buttons import buttonconf
from amazon_buttons import _crypt
@csrf_exempt
def ipn_handler(request):
ipn = models.ipn... | bsd-3-clause | Python |
859f97e2ba209479b0e882946afdf235ccd9e648 | Fix #1 Busy loop | Ernesto-Alvarez/pig | pigv2/backends/glue.py | pigv2/backends/glue.py | import threading
import ipaddr
import time
#Hub: takes one message from the input queue and replicates it across all output queues
class hub(object):
def __init__(self,input,output):
#Input and output functions (usually q1.get and [q2.put,q3.put....])
self.input = input;
self.output = output;
self.x=threadin... | import threading
import ipaddr
#Hub: takes one message from the input queue and replicates it across all output queues
class hub(object):
def __init__(self,input,output):
#Input and output functions (usually q1.get and [q2.put,q3.put....])
self.input = input;
self.output = output;
self.x=threading.Thread(tar... | lgpl-2.1 | Python |
ce73fe56375bef32a0997bdbe4ab305f232d605e | rename variable | rockers7414/xmusic,rockers7414/xmusic-crawler | daemon/rpcservice/systemservice.py | daemon/rpcservice/systemservice.py | import psutil
import json
from rpcservice.rpcservice import RPCService
from decorator.serialize import json_decorate
from decorator.singleton import singleton
@singleton
@json_decorate
class SystemService(RPCService):
def get_server_status(self):
system_status = {
"cpu": psutil.cpu_percent(... | import psutil
import json
from rpcservice.rpcservice import RPCService
from decorator.serialize import json_decorate
from decorator.singleton import singleton
@singleton
@json_decorate
class SystemService(RPCService):
def get_server_status(self):
cpu_status = {
"cpu": psutil.cpu_percent(),
... | apache-2.0 | Python |
6e8be0bf525d386cfd83ac1c0c3f66475e308234 | fix id tag | skluth/RooUnfold,skluth/RooUnfold,skluth/RooUnfold | examples/RooUnfoldExample.py | examples/RooUnfoldExample.py | # ==============================================================================
# File and Version Information:
# $Id: RooUnfoldExample.py 248 2010-10-04 22:18:19Z T.J.Adye $
#
# Description:
# Simple example usage of the RooUnfold package using toy MC.
#
# Author: Tim Adye <T.J.Adye@rl.ac.uk>
#
# =====... | # ==============================================================================
# File and Version Information:
# $Id: RooUnfoldExample.py 248 2010-10-04 22:18:19Z T.J.Adye $
#
# Description:
# Simple example usage of the RooUnfold package using toy MC.
#
# Author: Tim Adye <T.J.Adye@rl.ac.uk>
#
# ==... | apache-2.0 | Python |
b193a4035a0a77ba2555c41d977cf31975ac3b47 | Disable destructive action challenge for codelab. (#1059) | spinnaker/spinnaker,jtk54/spinnaker,imosquera/spinnaker,duftler/spinnaker,stitchfix/spinnaker,duftler/spinnaker,spinnaker/spinnaker,skim1420/spinnaker,ewiseblatt/spinnaker,jtk54/spinnaker,ewiseblatt/spinnaker,Roshan2017/spinnaker,ewiseblatt/spinnaker,stitchfix/spinnaker,duftler/spinnaker,imosquera/spinnaker,skim1420/sp... | pylib/spinnaker/codelab_config.py | pylib/spinnaker/codelab_config.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | Python |
a766bfa315f7c91f672f59bdd1b606d50467c332 | Bump version. | concordusapps/flask-components | src/flask_components/_version.py | src/flask_components/_version.py | # -*- coding: utf-8 -*-
__version_info__ = (0, 1, 1)
__version__ = '.'.join(map(str, __version_info__))
| # -*- coding: utf-8 -*-
__version_info__ = (0, 1, 0)
__version__ = '.'.join(map(str, __version_info__))
| mit | Python |
f84aa449780f2645a89c3fb015a2235389937ec5 | Clean up mongo fixtures a bit | LiaoPan/blaze,cowlicks/blaze,ChinaQuants/blaze,caseyclements/blaze,nkhuyu/blaze,cpcloud/blaze,ContinuumIO/blaze,scls19fr/blaze,jdmcbr/blaze,xlhtc007/blaze,scls19fr/blaze,caseyclements/blaze,cpcloud/blaze,cowlicks/blaze,ContinuumIO/blaze,jcrist/blaze,jcrist/blaze,maxalbert/blaze,jdmcbr/blaze,dwillmer/blaze,nkhuyu/blaze,... | blaze/tests/test_mongo.py | blaze/tests/test_mongo.py | from __future__ import absolute_import, division, print_function
import pytest
pymongo = pytest.importorskip('pymongo')
try:
pymongo.MongoClient()
except pymongo.errors.ConnectionFailure:
pytest.importorskip('fhskjfdskfhsf')
from datashape import discover, dshape
from blaze import drop, into, create_index
... | from __future__ import absolute_import, division, print_function
import pytest
pymongo = pytest.importorskip('pymongo')
try:
pymongo.MongoClient()
except pymongo.errors.ConnectionFailure:
pytest.importorskip('fhskjfdskfhsf')
from datashape import discover, dshape
from contextlib import contextmanager
from to... | bsd-3-clause | Python |
36408b92a74b8f9963686d215b26de57b429cd6c | Fix test_table.py record syntax. | seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core | blaze/tests/test_table.py | blaze/tests/test_table.py | from blaze import dshape
from blaze import NDTable, Table, NDArray, Array
def test_arrays():
# Assert that the pretty pritner works for all of the
# toplevel structures
expected_ds = dshape('3, int')
a = NDArray([1,2,3])
str(a)
repr(a)
a.datashape._equal(expected_ds)
a = Array([1,2,3... | from blaze import dshape
from blaze import NDTable, Table, NDArray, Array
def test_arrays():
# Assert that the pretty pritner works for all of the
# toplevel structures
expected_ds = dshape('3, int')
a = NDArray([1,2,3])
str(a)
repr(a)
a.datashape._equal(expected_ds)
a = Array([1,2,3... | bsd-2-clause | Python |
3f90d0ec25491eb64f164180139d4baf9ff238a9 | Sort the context list in alphabetical order | libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar | libravatar/context_processors.py | libravatar/context_processors.py | # Copyright (C) 2010 Jonathan Harker <jon@jon.geek.nz>
#
# This file is part of Libravatar
#
# Libravatar 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... | # Copyright (C) 2010 Jonathan Harker <jon@jon.geek.nz>
#
# This file is part of Libravatar
#
# Libravatar 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... | agpl-3.0 | Python |
34dc1c775e4808664dcdb5824b8f2ed5f12e94a1 | add jsonp renderer and route for graph build status | MLR-au/esrc-cnex,MLR-au/esrc-cnex,MLR-au/esrc-cnex | app/app/__init__.py | app/app/__init__.py | from pyramid.config import Configurator
from pyramid.renderers import JSONP
from sqlalchemy import engine_from_config
from .models import (
DBSession,
Base,
)
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
engine = engine_from_config(settings, '... | from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from .models import (
DBSession,
Base,
)
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configur... | bsd-3-clause | Python |
17eb885097da7b2b2418f909e2f23058245be72c | Update spotify example (#276) | balloob/pychromecast,balloob/pychromecast,dominikkarall/pychromecast | examples/spotify_example.py | examples/spotify_example.py | """
Example on how to use the Spotify Controller.
NOTE: You need to install the spotipy and spotify-token dependencies.
This can be done by running the following:
pip install spotify-token
pip install git+https://github.com/plamere/spotipy.git
"""
import logging
import sys
import pychromecast
from pychromecast.contro... | """
Example on how to use the Spotify Controller.
NOTE: You need to install the spotipy and spotify-token dependencies.
This can be done by running the following:
pip install spotify-token
pip install git+https://github.com/plamere/spotipy.git
"""
import pychromecast
from pychromecast.controllers.spotify import Spotif... | mit | Python |
fd460c1b987354b01d306e2e96ab5c74f6b0d06f | add socket close call. | constanthatz/network_tools | echo_server.py | echo_server.py | #!/usr/bin/env python
from __future__ import print_function
import socket
import email.utils
def server_socket_function():
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP)
server_socket.bind(('127.0.0.1', 50000))
server_socket.listen(1)
try:
while True:
... | #!/usr/bin/env python
from __future__ import print_function
import socket
import email.utils
def server_socket_function():
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP)
server_socket.bind(('127.0.0.1', 50000))
server_socket.listen(1)
try:
while True:
... | mit | Python |
add0af524dafa241d7bab64093ed45c857c66c0d | Rename cfg to settings | luigiberrettini/build-deploy-stats | statsSend/teamCity/teamCityStatisticsSender.py | statsSend/teamCity/teamCityStatisticsSender.py | #!/usr/bin/env python3
from dateutil import parser
from statsSend.teamCity.teamCityConnection import TeamCityConnection
from statsSend.teamCity.teamCityUrlBuilder import TeamCityUrlBuilder
from statsSend.teamCity.teamCityProject import TeamCityProject
class TeamCityStatisticsSender:
def __init__(self, settings, ... | #!/usr/bin/env python3
from dateutil import parser
from statsSend.teamCity.teamCityConnection import TeamCityConnection
from statsSend.teamCity.teamCityUrlBuilder import TeamCityUrlBuilder
from statsSend.teamCity.teamCityProject import TeamCityProject
class TeamCityStatisticsSender:
def __init__(self, cfg, repor... | mit | Python |
daba0d7eb4b77e40790624e23938b2ebb6d04fca | fix notify loop | benoitc/pistil,menghan/pistil,menghan/pistil,harrisonfeng/pistil,meebo/pistil | examples/multiworker2.py | examples/multiworker2.py | # -*- coding: utf-8 -
#
# This file is part of pistil released under the MIT license.
# See the NOTICE for more information.
import time
import urllib2
from pistil.arbiter import Arbiter
from pistil.worker import Worker
from pistil.tcp.sync_worker import TcpSyncWorker
from pistil.tcp.arbiter import TcpArbiter
from ... | # -*- coding: utf-8 -
#
# This file is part of pistil released under the MIT license.
# See the NOTICE for more information.
import time
import urllib2
from pistil.arbiter import Arbiter
from pistil.worker import Worker
from pistil.tcp.sync_worker import TcpSyncWorker
from pistil.tcp.arbiter import TcpArbiter
from ... | mit | Python |
878811a673625f9dbe0f41dd0196887f612ecf2e | Set default file extension to empty string | johyphenel/sublime-expand-region,johyphenel/sublime-expand-region,aronwoost/sublime-expand-region | expand_region_handler.py | expand_region_handler.py | import re
try:
import javascript
import html
except:
from . import javascript
from . import html
def expand(string, start, end, extension=""):
if(re.compile("html|htm|xml").search(extension)):
return html.expand(string, start, end)
return javascript.expand(string, start, end) | import re
try:
import javascript
import html
except:
from . import javascript
from . import html
def expand(string, start, end, extension=None):
if(re.compile("html|htm|xml").search(extension)):
return html.expand(string, start, end)
return javascript.expand(string, start, end) | mit | Python |
58d3e0712a35052d0016fa3c3b3ffda1ba56b305 | Add some locks | wbkang/light-control,wbkang/light-control | lightcontrol/server.py | lightcontrol/server.py | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import time
import threading
import logging
from threading import RLock, Lock
from tzlocal import get_localzone
from flask import Flask, render_template, url_for, request, make_response
from lightcontrol.config import lights
from os.path import expanduser
import os.path
i... | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import time
import threading
import logging
from tzlocal import get_localzone
from flask import Flask, render_template, url_for, request, make_response
from lightcontrol.config import lights
from os.path import expanduser
import os.path
import json
logging.basicConfig(le... | mit | Python |
d31adbfd0485579c94e92b9c2950230d00fdf309 | update flaskapp.wsgi | KLachhani/RiotAPIChallenge2.0,KLachhani/RiotAPIChallenge2.0,KLachhani/RiotAPIChallenge2.0,KLachhani/RiotAPIChallenge2.0 | 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'
| mit | Python |
2c64c4fd5a81537d891aadafe01a4da96fcb7ab4 | Update ipc_lista1.6.py | any1m1c/ipc20161 | 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: "
| apache-2.0 | Python |
1cf097d30d5966456c01e4f2e678213c04f8e334 | Update ipc_lista1.6.py | any1m1c/ipc20161 | 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
| apache-2.0 | Python |
8804091fb22ef0a7682ea402ff22750261fc38a7 | Update ipc_lista1.6.py | any1m1c/ipc20161 | 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 =
| apache-2.0 | Python |
c6abbd5b8176943ec02d0a03852e1992f62950a1 | Update ipc_lista1.9.py | any1m1c/ipc20161 | 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
| apache-2.0 | Python |
89571a6caf877f8ff5ff0b983548b926dec87f8d | Update ipc_lista1.9.py | any1m1c/ipc20161 | 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
| apache-2.0 | Python |
d6672e2da113e2fdcfec147619ed03d5410ad014 | Fix cleanup at exit in Escalator. Remove socket. | onitu/onitu,onitu/onitu,onitu/onitu | 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... | mit | Python |
da12486a207e1ade8c7b49379613e4aadec23794 | add check to see if rename is needed | Redball45/RedballMisc-Cogs | 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... | mit | Python |
0d32f515b7a7cc31f263c61f8605f730259b8fa9 | Update views.py | rochapps/django-pdfy | 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... | bsd-3-clause | Python |
fc13e6b523a4ba78835ab54d16f7a6caab0fc73b | Sort total attendance list by yes rsvps in python script. | jimbo00000/meetup-attendance-graph | data/calculate_totals.py | data/calculate_totals.py | # calculate_totals.py
import json
import datetime
from collections import defaultdict
# http://stackoverflow.com/questions/6999726/how-can-i-convert-a-datetime-object-to-milliseconds-since-epoch-unix-time-in-p
def unix_time(dt):
epoch = datetime.datetime.utcfromtimestamp(0)
delta = dt - epoch
return delta... | # calculate_totals.py
import json
import datetime
from collections import defaultdict
# http://stackoverflow.com/questions/6999726/how-can-i-convert-a-datetime-object-to-milliseconds-since-epoch-unix-time-in-p
def unix_time(dt):
epoch = datetime.datetime.utcfromtimestamp(0)
delta = dt - epoch
return delta... | mit | Python |
81ced1c9642fa8c364ce9a840adecde633c96b42 | Remove disable pylint for paginator error and fix syntax | itsjeyd/edx-platform,hamzehd/edx-platform,franosincic/edx-platform,inares/edx-platform,gsehub/edx-platform,Stanford-Online/edx-platform,angelapper/edx-platform,ahmedaljazzar/edx-platform,JioEducation/edx-platform,jolyonb/edx-platform,CourseTalk/edx-platform,ahmadiga/min_edx,caesar2164/edx-platform,tanmaykm/edx-platform... | 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... | agpl-3.0 | Python |
c775b159b310afd323945afcb9dba771731a382b | use repr for log serialization if json fails | dpausp/arguments,dpausp/arguments,dpausp/arguments,dpausp/arguments | 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... | agpl-3.0 | Python |
a3e05e67b4907f6f97462aa958e4f344f92d1e72 | add a new compare method | F5Networks/f5-ansible-modules | 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
... | mit | Python |
795e9734cc802caa8847a9a2b22f3f16297462bc | use combined provider in nsi2 provider setup | NORDUnet/opennsa,jab1982/opennsa,jab1982/opennsa,NORDUnet/opennsa,NORDUnet/opennsa | 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, \
... | bsd-3-clause | Python |
582964f9da6029cd089117496babf9267c41ecd5 | Reduce queries used to lookup config | evewspace/eve-wspace,nyrocron/eve-wspace,hybrid1969/eve-wspace,hybrid1969/eve-wspace,acdervis/eve-wspace,marbindrakon/eve-wspace,Unsettled/eve-wspace,proycon/eve-wspace,mmalyska/eve-wspace,evewspace/eve-wspace,gpapaz/eve-wspace,acdervis/eve-wspace,proycon/eve-wspace,marbindrakon/eve-wspace,Zumochi/eve-wspace,marbindrak... | evewspace/core/utils.py | evewspace/core/utils.py | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | apache-2.0 | Python |
fa9bc00d09cfd173b99eaba3eb17bdfc49100a5b | Add explicit name export | fnielsen/dasem,fnielsen/dasem | 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
| apache-2.0 | Python |
c1a3d40295a7c4b5f178ae78b49a90c317844371 | Replace double quotes with single quotes for flake8 check | adfinis-sygroup/timed-backend,adfinis-sygroup/timed-backend,adfinis-sygroup/timed-backend | 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... | agpl-3.0 | Python |
32e00001ec29b0fe13f8c9b2c4dbd61232ba348a | Update starting offset | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | 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... | agpl-3.0 | Python |
608a0c75cba735e7d4a59fb941cd6e6135f3e7cf | Update reverse URL. | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website | 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... | agpl-3.0 | Python |
99e910f58fa54e9bce2518c6f9752ba1e8dbd6af | Stop tracking call size in bm diff | firebase/grpc,dgquintas/grpc,jtattermusch/grpc,firebase/grpc,ctiller/grpc,pszemus/grpc,grpc/grpc,stanley-cheung/grpc,sreecha/grpc,simonkuang/grpc,firebase/grpc,mehrdada/grpc,chrisdunelm/grpc,mehrdada/grpc,firebase/grpc,jtattermusch/grpc,mehrdada/grpc,chrisdunelm/grpc,donnadionne/grpc,sreecha/grpc,simonkuang/grpc,ncteis... | 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 ... | apache-2.0 | Python |
dcc2821cac0619fc2ca5f486ad30416f3c3cfda9 | Replace parsing with Python's ast | admk/soap | 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 =... | mit | Python |
38fe4ef9df7e09709611bb3aca1aea4f2d42316a | add encode_url_path method to util | cydrobolt/pifx | 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... | apache-2.0 | Python |
180805e919c73d0540a29ae57b653574e1ff704c | Clean up local.py for OSX notifications | kfdm/gntp-regrowl | 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... | mit | Python |
9a73dcfbc77236d11387909c3f97d3712b56fb2a | clean out commented code from old version | oaao/pomegranate-esi | 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... | mit | Python |
e112a2651357f586bd1b5a6a4378ac46e3407d58 | add v1.1.2 (#22081) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | 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... | lgpl-2.1 | Python |
50411f83942ff033b4b55ef72d595e6d3ab9949f | add version 2.9.1 (#25646) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | 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 = ... | lgpl-2.1 | Python |
5d5e6a505bf7282fdef4ca3b3555ecf6f3efa137 | Update __copyright__ | thombashi/typepy | 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"
| mit | Python |
39fbd9fabaa9945fe33475afe23c109711679192 | Make output more compact | googlefonts/fonttools,googlei18n/cu2qu,fonttools/fonttools,googlefonts/cu2qu | 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... | mit | Python |
d3e673069977c392eb292ce8b313f6dba4da4d9f | Fix these to use non-deprecated APIs, i.e. get_content_maintype() and get_content_subtype(). | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | 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... | mit | Python |
364d0a78725539a58862f672f718e4bf966da2f5 | add stats-per-day route | pedesen/plogx,pedesen/plogx | 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... | mit | Python |
602876c2b132664cc1802d467eaf8109a745d613 | Add option for margin and strand selection | konrad/kufpybio | 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... | isc | Python |
4bad79872547f90159e75b34b46e99e54f78b736 | Fix error in big comment header. | cgaspoz/l10n-switzerland,open-net-sarl/l10n-switzerland,cyp-opennet/ons_cyp_github,michl/l10n-switzerland,ndtran/l10n-switzerland,BT-csanchez/l10n-switzerland,BT-aestebanez/l10n-switzerland,open-net-sarl/l10n-switzerland,CompassionCH/l10n-switzerland,cyp-opennet/ons_cyp_github,CompassionCH/l10n-switzerland,BT-ojossen/l... | 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 ... | agpl-3.0 | Python |
5edf75129189fc37ce24ff338821b726b0a7c28a | Revert 2c1ee5f..1620020 | santoshkumarsingh/Data-Wrangling-with-MongoDB,santoshkumarsingh/Data-Wrangling-with-MongoDB,sk-rai/Data-Wrangling-with-MongoDB,sk-rai/Data-Wrangling-with-MongoDB | 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... | agpl-3.0 | Python |
c91beca414a5216a3fd5f8f5ef1c1643f0aea2f9 | Tag the rc release | blink1073/oct2py,blink1073/oct2py | 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:
.... | mit | Python |
35801fdc81c4f5f93862b900bba656cfbbf1652c | Prepare version 0.1.18 | dreipol/djangocms-spa,dreipol/djangocms-spa | djangocms_spa/__init__.py | djangocms_spa/__init__.py | __version__ = '0.1.18'
| __version__ = '0.1.17'
| mit | Python |
104e05f326b7138e524296c049a1860c8c8a8cea | document col_to_number | raymondnoonan/Mpropulator | 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... | mit | Python |
c00a12fb593e329cc1fc2d3710cd9e89d0abfa16 | set production api url | cloud4rpi/cloud4rpi | 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'
| mit | Python |
920e75491f3aaa74980e11086cfebe911c2def4b | Remove yield from datasets tests | josef-pkt/statsmodels,ChadFulton/statsmodels,jseabold/statsmodels,josef-pkt/statsmodels,statsmodels/statsmodels,bashtage/statsmodels,jseabold/statsmodels,bashtage/statsmodels,ChadFulton/statsmodels,statsmodels/statsmodels,jseabold/statsmodels,bashtage/statsmodels,statsmodels/statsmodels,statsmodels/statsmodels,statsmod... | 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):
... | bsd-3-clause | Python |
97badc176f4a8ac30eb3932359e2e132e36170c4 | Increase the number of workers | sheagcraig/sal,chasetb/sal,sheagcraig/sal,erikng/sal,salopensource/sal,salopensource/sal,chasetb/sal,erikng/sal,chasetb/sal,erikng/sal,chasetb/sal,erikng/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,sheagcraig/sal | 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... | apache-2.0 | Python |
15090b84e1c7359c49cb45aec4d9b4d492f855ac | Update smb test to include port parameter | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | 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... | mit | Python |
b3889bbdab80fb502c74b99b61cf36bae112ce2c | Add property decorator to getters | PressLabs/cobalt,PressLabs/cobalt | 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'])
... | apache-2.0 | Python |
af7a2e59b76a5c404e393a6fc1aeca9517018185 | Fix peacock crash when filename with unicode exists | SudiptaBiswas/moose,harterj/moose,andrsd/moose,sapitts/moose,andrsd/moose,permcody/moose,sapitts/moose,dschwen/moose,bwspenc/moose,harterj/moose,bwspenc/moose,dschwen/moose,dschwen/moose,YaqiWang/moose,sapitts/moose,nuclear-wizard/moose,harterj/moose,SudiptaBiswas/moose,nuclear-wizard/moose,lindsayad/moose,lindsayad/mo... | 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... | lgpl-2.1 | Python |
814b344082fbce471509c54c683470467dd8f814 | use env to find python binary | tchapi/pianette,tchapi/pianette,tchapi/pianette,tchapi/pianette | 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... | mit | Python |
59c14e1c0d69309c554ddafa5e168115ba05ddfd | Update the win/lose determination code | Jacobinski/SaltBot | 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... | mit | Python |
67e620716b494f74c9b913b6514463eb4689c590 | add OMPL_DEBUG and other convenience function to python bindings | davetcoleman/ompl,sonny-tarbouriech/ompl,utiasASRL/batch-informed-trees,sonny-tarbouriech/ompl,davetcoleman/ompl,utiasASRL/batch-informed-trees,davetcoleman/ompl,utiasASRL/batch-informed-trees,florianhauer/ompl,utiasASRL/batch-informed-trees,jvgomez/ompl,jvgomez/ompl,florianhauer/ompl,davetcoleman/ompl,florianhauer/omp... | 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 *
| bsd-3-clause | Python |
66b6d3648c0a4229048c0f8a63ec410c407f1ba1 | Fix unittest | cpaulik/pyscaffold,cpaulik/pyscaffold,blue-yonder/pyscaffold,blue-yonder/pyscaffold | 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... | mit | Python |
0062eeaf558a0eb9e8a736baf16932e56546001f | Fix silly Python indentation issues. | amkahn/question-answering,amkahn/question-answering | 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 ... | mit | Python |
c6b47431f75675547d54c3b68c07aad76721e513 | fix srfit test | CJ-Wright/pyIID | 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
... | bsd-3-clause | Python |
8b34cf20b9cc010d321912433d772ccad8dbdb6f | Update MediaWiki version for i18n_family.py from trunk r8823 | legoktm/pywikipedia-rewrite | 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... | mit | Python |
aeeed413830f58c60ab4b05beddf44ab4dba5e36 | Update views.py | cloud-fire/signalnews,cloud-fire/signalnews,cloud-fire/signalnews | 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... | bsd-3-clause | Python |
9e6e2fd1903b8e4deb3b6737d86aadc2627cb4eb | add the `__all__` to `_compat.py`. | lepture/flask-storage,menghan/flask-storage,LiuDeng/flask-storage,fengluo/flask-storage | 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):
... | bsd-3-clause | Python |
901b3e88704f938dcc090bb93b9818ac7ac994dd | Update ipc_lista1.8.py | any1m1c/ipc20161 | 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... | apache-2.0 | Python |
84f9f45f984cbf0b4192cae49e51333767bb5576 | fix runtox.py failure when 'tox' is not available on the current system path | pfctdayelise/pytest,Bachmann1234/pytest,takluyver/pytest,JonathonSonesen/pytest,abusalimov/pytest,mbirtwell/pytest,Carreau/pytest,pytest-dev/pytest,MengJueM/pytest,inirudebwoy/pytest,Carreau/pytest,bukzor/pytest,Akasurde/pytest,davidszotten/pytest,omarkohl/pytest,doordash/pytest,Haibo-Wang-ORG/pytest,nicoddemus/pytest,... | 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:])
| mit | Python |
bc9c43160a58508e412592b0ab9a0d7f3a35c48c | fix regression in folde tests | xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/... | 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... | agpl-3.0 | Python |
d6e06d4be5c483bdf4aff8032ff22bee5a49be02 | Fix broken test. | crr0004/lime,crr0004/lime,farhaanbukhsh/lime,farhaanbukhsh/lime,farhaanbukhsh/lime,crr0004/lime,crr0004/lime,farhaanbukhsh/lime,farhaanbukhsh/lime,crr0004/lime | 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.... | bsd-2-clause | Python |
5e4c9f5a82f9a4f505cbb5c11e411ef70bc78db9 | Bump version | Calysto/metakernel | 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... | bsd-3-clause | Python |
d5ec09fe4ad4209c387b1b0da82a412ea83f7658 | Change module name | amuehlem/misp-modules,MISP/misp-modules,VirusTotal/misp-modules,VirusTotal/misp-modules,amuehlem/misp-modules,VirusTotal/misp-modules,amuehlem/misp-modules,MISP/misp-modules,MISP/misp-modules | 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... | agpl-3.0 | Python |
48894b2200d3324525ce3f1056fbd4d3420765e2 | Make date string sent to Guardian API dynamic. | mattpatey/news-to-epub | 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... | mit | Python |
29134a36b3b1d5db12fe4891d1f15191f7f1fa31 | make collection paths unique to avoid all sorts of mayhem | compas-dev/compas | 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) ->... | mit | Python |
54fab9c1cb9e2888f7050392d38a94b4f6546741 | fix branch reference | missionpinball/mpf,missionpinball/mpf | 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__)
| mit | Python |
b14c6446ac16798f797f279818ae53adc549323e | Clean up wrap.py a bit | orezpraw/unnaturalcode,orezpraw/unnaturalcode,orezpraw/estimate-charm,orezpraw/unnaturalcode,naturalness/unnaturalcode,naturalness/unnaturalcode,naturalness/unnaturalcode,orezpraw/unnaturalcode,orezpraw/unnaturalcode,orezpraw/unnaturalcode,naturalness/unnaturalcode,orezpraw/unnaturalcode,naturalness/unnaturalcode,natur... | 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... | agpl-3.0 | Python |
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 | tensorflow/lucid,tensorflow/lucid,tensorflow/lucid,tensorflow/lucid | 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... | apache-2.0 | Python |
75be8ed7040cd43aa0a41cba56da48942972ca42 | Add Testts For Models | rockwyc992/monkey-pdns,rockwyc992/monkey-pdns | 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!')
| mit | Python |
ab819232e0e036709ff6098b2d9f259fc8956ca2 | add in sentinel support | ortoo/schooldata | 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... | mit | Python |
493637ace6881defedee22971f3bc39fe9a5bd0a | Make it compatible with Bob | kif/freesas,kif/freesas,kif/freesas | 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()
| mit | Python |
1697e0a20b14c89cf2db209ef03cb1dc551b14a1 | Bump version | msanders/cider | 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']
| mit | Python |
e0a8f8f6765a071ba71191b6e047b861812ec2f9 | Update settings.py | DenfeldRobotics4009/2016_Freckles | 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."""
... | bsd-3-clause | Python |
555e76a62f0ec955932f95bec444e7c360f23241 | use environment variable to set port | WeKeyPedia/metrics,WeKeyPedia/metrics,WeKeyPedia/metrics | 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)
| mit | Python |
828c78566879412c6e2cc6981af9fa1adb5bdcf4 | return result files, not just names | iclab/centinel-server,iclab/centinel-server,rpanah/centinel-server,ben-jones/centinel-server,ben-jones/centinel-server,rpanah/centinel-server,ben-jones/centinel-server,rpanah/centinel-server,lianke123321/centinel-server,gsathya/centinel-server,lianke123321/centinel-server,lianke123321/centinel-server,iclab/centinel-ser... | 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... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.