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 |
|---|---|---|---|---|---|---|---|---|
2cc620504033a76d47b71e59b2d34c40b96a9618 | Update A_General_Temperature.py | Herpinemmanuel/Oceanography | Cas_1/Temperature/A_General_Temperature.py | Cas_1/Temperature/A_General_Temperature.py | import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from xmitgcm import open_mdsdataset
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
plt.ion()
dir1 = '/homedata/bderembl/runmit/test_southatlgyre'
ds1 = open_mdsdataset(dir1,iters='all',prefix=['T'])
nt = 0
nz... | import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from xmitgcm import open_mdsdataset
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
plt.ion()
dir1 = '/homedata/bderembl/runmit/test_southatlgyre'
ds1 = open_mdsdataset(dir1,iters='all',prefix=['T'])
nt = 0
nz... | mit | Python |
2426af7bb3b2b844bebb96ca851fdcc41f1bfb52 | Add "distribution" stylesheet tag, remove styling of URLs | xtaran/debian-devel-changes-bot,lamby/debian-devel-changes-bot,sebastinas/debian-devel-changes-bot,lamby/debian-devel-changes-bot,lamby/debian-devel-changes-bot,xtaran/debian-devel-changes-bot | DebianDevelChangesBot/utils/irc_colours.py | DebianDevelChangesBot/utils/irc_colours.py | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | agpl-3.0 | Python |
6014c6478ee22a67e2e048ce35fdb2f7b8fa3f1a | Update server.py | kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework,kimjinyong/i2nsf-framework | Hackathon-108/SecurityController/server.py | Hackathon-108/SecurityController/server.py | #!/usr/bin/python
#-*- coding:utf-8 -*-
import API.DFAAPI as DFA
import API.CFGAPI as CFG
import API.converter as converter
import API.socketAPI as socketAPI
import socket
import threading
# construct DFA based Data Extractor
consumer = DFA.dfa_construction('DataModel/cfi_dm.txt')
consumer_dfa = consumer[0]
consumer_... | #!/usr/bin/python
#-*- coding:utf-8 -*-
import API.DFAAPI as DFA
import API.CFGAPI as CFG
import API.converter as converter
import API.socketAPI as socketAPI
import socket
import threading
# construct DFA based Data Extractor
consumer = DFA.dfa_construction('DataModel/cfi_dm.txt')
consumer_dfa = consumer[0]
consumer_... | apache-2.0 | Python |
57ef5e4411c4d1ba98e4ded38b07f681069fbf75 | Update script comment | keith/terminal-notifier-weechat | terminal_notifier.py | terminal_notifier.py | # This weechat plugin sends OS X notifications for weechat messages
#
# Install terminal-notifier, no other configuration needed.
#
# History:
# 10-04-2015
# Version 1.0.0: initial release
import distutils.spawn
import os
import pipes
import weechat
def notify(data, signal, signal_data):
command = ("terminal-not... | import distutils.spawn
import os
import pipes
import weechat
def notify(data, signal, signal_data):
command = ("terminal-notifier -message %s -title WeeChat -sound Hero"
% pipes.quote(signal_data))
exit_code = os.system(command)
if exit_code == 0:
return weechat.WEECHAT_RC_ERROR
... | mit | Python |
79539427bf22cffc0f9cbfd2e40039435c2dc2e2 | test mnist with 4 layers now | lbkchen/deep-learning,lbkchen/deep-learning | tf/mnist_sda.py | tf/mnist_sda.py | """
Example testing SDA model on MNIST digits.
"""
from final_sda import get_batch_generator, SDAutoencoder
from softmax import test_model_gen, test_model
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
def get_mnist_b... | """
Example testing SDA model on MNIST digits.
"""
from final_sda import get_batch_generator, SDAutoencoder
from softmax import test_model_gen, test_model
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
def get_mnist_b... | mit | Python |
da13f2b783e847e8861e559344d55637d6129e6c | Add git ID to amalgamated headers. | nemequ/simde,nemequ/simde,nemequ/simde | amalgamate.py | amalgamate.py | #!/usr/bin/python3
# amalgamate.py
# Written by Evan Nemerson <evan@nemerson.com>
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to
# the public domain worldwide. This software is distributed without
# any warranty.
#
# For details... | #!/usr/bin/python3
# amalgamate.py
# Written by Evan Nemerson <evan@nemerson.com>
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to
# the public domain worldwide. This software is distributed without
# any warranty.
#
# For details... | mit | Python |
927f1384f8777d0d79f4fea7c1c8c40b2eef1b4a | Load applications via default factory on server start. | smira/fmspy | twisted/plugins/fmspy_plugin.py | twisted/plugins/fmspy_plugin.py | # FMSPy - Copyright (c) 2009 Andrey Smirnov.
#
# See COPYRIGHT for details.
"""
FMSPy Twisted plugin.
"""
import sys
from zope.interface import implements
from twisted.application.service import IServiceMaker
from twisted.application import internet
from twisted.python import usage, log
from twisted.plugin import I... | # FMSPy - Copyright (c) 2009 Andrey Smirnov.
#
# See COPYRIGHT for details.
"""
FMSPy Twisted plugin.
"""
from zope.interface import implements
from twisted.application.service import IServiceMaker
from twisted.application import internet
from twisted.python import usage
from twisted.plugin import IPlugin
class Opt... | mit | Python |
050f16b9c6603f5c4769f1434e25da885e17ba57 | Update solve.py | mikepound/mazesolving | solve.py | solve.py | from PIL import Image
import time
from mazes import Maze
from factory import SolverFactory
Image.MAX_IMAGE_PIXELS = None
# Read command line arguments - the python argparse class is convenient here.
import argparse
def solve(factory, method, input_file, output_file):
# Load Image
print ("Loading Image")
i... | from PIL import Image
import time
from mazes import Maze
from factory import SolverFactory
# Read command line arguments - the python argparse class is convenient here.
import argparse
def solve(factory, method, input_file, output_file):
# Load Image
print ("Loading Image")
im = Image.open(input_file)
... | unlicense | Python |
b5c5e745be733a90ac4a1cfaaf73b0d82647c9a5 | Use O(k) space. | fossilet/leetcode,fossilet/leetcode,deput/leetcode,deput/leetcode | rotate_array.py | rotate_array.py | """
https://oj.leetcode.com/problems/rotate-array/
Rotate an array of n elements to the right by k steps.
For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].
Note:
Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem.
"""
cla... | """
https://oj.leetcode.com/problems/rotate-array/
Rotate an array of n elements to the right by k steps.
For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].
Note:
Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem.
"""
cla... | mit | Python |
efed8d5da0ba76e05c07e17cd4801a4ba48d115d | Add test for #13 | ekzhu/SetSimilaritySearch | tests/search_test.py | tests/search_test.py | import unittest
from SetSimilaritySearch import SearchIndex
class TestSearchIndex(unittest.TestCase):
def test_jaccard(self):
sets = [[1, 2, 3], [3, 4, 5], [2, 3, 4], [5, 6, 7]]
index = SearchIndex(
sets, similarity_func_name="jaccard", similarity_threshold=0.1
)
resul... | import unittest
from SetSimilaritySearch import SearchIndex
class TestSearchIndex(unittest.TestCase):
def test_jaccard(self):
sets = [[1, 2, 3], [3, 4, 5], [2, 3, 4], [5, 6, 7]]
index = SearchIndex(
sets, similarity_func_name="jaccard", similarity_threshold=0.1
)
resul... | apache-2.0 | Python |
4dc9330ec75639adf3f44e105fb651080ad638bf | add shebang line | manifesti/hs-reader | testi.py | testi.py | #!/usr/bin/python3
from bs4 import BeautifulSoup, Tag
import urllib3
import re
import os
import webbrowser
# get user input, load imports and download the article
url = input("Anna artikkelin osoite: ")
conn = urllib3.PoolManager()
pageconn = conn.request('GET', url)
pagedata = pageconn.data
soup = BeautifulSoup(page... | from bs4 import BeautifulSoup, Tag
import urllib3
import re
import os
import webbrowser
# get user input, load imports and download the article
#!/usr/bin/python3
url = input("Anna artikkelin osoite: ")
conn = urllib3.PoolManager()
pageconn = conn.request('GET', url)
pagedata = pageconn.data
soup = BeautifulSoup(page... | mit | Python |
043a1111fdf11ee6fbc28f06009d2f1ed319f7ad | use getattr | lnmds/jose,Mstrodl/jose,Mstrodl/jose | ext/josemath.py | ext/josemath.py | #!/usr/bin/env python3
import discord
import asyncio
import sys
sys.path.append("..")
import jauxiliar as jaux
import joseerror as je
import joseconfig as jconfig
import wolframalpha
wac = wolframalpha.Client(jconfig.WOLFRAMALPHA_APP_ID)
class JoseMath(jaux.Auxiliar):
def __init__(self, cl):
jaux.Auxilia... | #!/usr/bin/env python3
import discord
import asyncio
import sys
sys.path.append("..")
import jauxiliar as jaux
import joseerror as je
import joseconfig as jconfig
import wolframalpha
wac = wolframalpha.Client(jconfig.WOLFRAMALPHA_APP_ID)
class JoseMath(jaux.Auxiliar):
def __init__(self, cl):
jaux.Auxilia... | mit | Python |
46c951acc938762fae08b43acf1905d81dc93ed7 | Fix patch bank attribute | PedalPi/PluginsManager | pluginsmanager/model/patch.py | pluginsmanager/model/patch.py | from pluginsmanager.util.observable_list import ObservableList
from pluginsmanager.model.update_type import UpdateType
from unittest.mock import MagicMock
class Patch(object):
"""
Patch is a pedalboard representation: your structure contains
:class:`Effect` and :class:`Connection`.
:param string nam... | from pluginsmanager.util.observable_list import ObservableList
from pluginsmanager.model.update_type import UpdateType
from unittest.mock import MagicMock
class Patch(object):
"""
Patch is a pedalboard representation: your structure contains
:class:`Effect` and :class:`Connection`.
:param string nam... | apache-2.0 | Python |
9cf8c4ff10e7163ae5df480cba7e4625f190edd4 | change version to 1.0.10 | amplify-education/data_kennel,amplify-education/data_kennel | data_kennel/version.py | data_kennel/version.py | """Place of record for the package version"""
__version__ = "1.0.10"
__git_hash__ = "GIT_HASH"
| """Place of record for the package version"""
__version__ = "1.0.92"
__git_hash__ = "GIT_HASH"
| mit | Python |
4c11bad3cc1c3095dd91322cfc231d3b8798cadf | Add proxy support | jf-guillou/wapt-scripts | waptrepo.py | waptrepo.py | # -*- coding: utf-8 -*-
import waptpackage
import os
REPOS = {
'tis': {'url': 'https://wapt.tranquil.it/wapt', 'repo': None},
'smp': {'url': 'https://wapt.lesfourmisduweb.org/wapt', 'repo': None}
}
def get_local_repo():
"""Get local package repository and load index"""
repo = waptpackage.WaptLocalRep... | # -*- coding: utf-8 -*-
import waptpackage
REPOS = {
'tis': {'url': 'https://wapt.tranquil.it/wapt', 'repo': None},
'smp': {'url': 'https://wapt.lesfourmisduweb.org/wapt', 'repo': None}
}
def get_local_repo():
"""Get local package repository and load index"""
repo = waptpackage.WaptLocalRepo()
re... | mit | Python |
7439f3c963dbae98060893ab908d2599c7ac8a87 | store deepcopies of values | svenkreiss/databench,svenkreiss/databench,svenkreiss/databench,svenkreiss/databench | databench/datastore.py | databench/datastore.py | import copy
import logging
from collections import defaultdict
log = logging.getLogger(__name__)
class Datastore(object):
store = defaultdict(dict)
on_change_cb = defaultdict(list)
def __init__(self, domain):
self.domain = domain
def on_change(self, cb):
Datastore.on_change_cb[self.... | from collections import defaultdict
class Datastore(object):
store = defaultdict(dict)
on_change_cb = defaultdict(list)
def __init__(self, domain):
self.domain = domain
def on_change(self, cb):
Datastore.on_change_cb[self.domain].append(cb)
return self
def __setitem__(se... | mit | Python |
d5252478e0661db336525ca7298b0e0d2d0b0e07 | bump version | data-8/datascience,dsten/datascience | datascience/version.py | datascience/version.py | __version__ = '0.9.4'
| __version__ = '0.9.3'
| bsd-3-clause | Python |
212eb38a76be41d4866fcc356eeba333e30b283b | Allow strand lines without query names. Auto-adjust read-ahead window. | mdshw5/strandex | strandex.py | strandex.py | import os.path
import re
import sys
import argparse
import random
from six.moves import range
pattern = re.compile(r'(@.+)[\n\r]+.+[\n\r]+\+.*?[\n\r].+[\n\r]')
def run(args):
file_size = os.path.getsize(args.fastq.name)
random.seed(args.seed)
n = 0
ahead = 4096
step = file_size // args.nreads
... | import os.path
from six.moves import range
import re
import sys
import argparse
pattern = re.compile(r'@.+[\n\r]+.+[\n\r]+\+.+[\n\r].+[\n\r]')
def run(args):
file_size = os.path.getsize(args.fastq.name)
step = file_size // args.nreads
assert step > 0
last_record = ''
for i in range(0, file_size, s... | mit | Python |
04f7f28ef3123452d8eb06ab1f3cbfa6dded8be4 | Remove no longer needed references for keeping pep8 happy | praekelt/go-metrics-api,praekelt/go-metrics-api | go_metrics/metrics/tests/test_dummy.py | go_metrics/metrics/tests/test_dummy.py | from twisted.trial.unittest import TestCase
from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend
class TestFixtures(TestCase):
def test_add(self):
fixtures = Fixtures()
fixtures.add(foo='bar', result={'baz': 'quux'})
self.assertEqual(fixtures.items, [{
'fo... | from twisted.trial.unittest import TestCase
from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend
DummyBackend, DummyMetrics
class TestFixtures(TestCase):
def test_add(self):
fixtures = Fixtures()
fixtures.add(foo='bar', result={'baz': 'quux'})
self.assertEqual(fixture... | bsd-3-clause | Python |
65a9ab620d6f6ec1adce1a241fc288e24b010ce9 | fix test | sacrud/ps_alchemy | tests/test_common.py | tests/test_common.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 uralbash <root@uralbash.ru>
#
# Distributed under terms of the MIT license.
import colander
import sqlalchemy
from sqlalchemy import Column, String, Integer
from sacrud_deform import SacrudForm
from ps_alchemy.views import preprocessi... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 uralbash <root@uralbash.ru>
#
# Distributed under terms of the MIT license.
import colander
import sqlalchemy
from sqlalchemy import Column, String, Integer
from sacrud_deform import SacrudForm
from ps_alchemy.views import preprocessi... | mit | Python |
0a3a1247563e3ae26e08164d2fba7f1f16ae8c5e | cover "Invalid option value" for config | dataversioncontrol/dvc,efiop/dvc,dmpetrov/dataversioncontrol,efiop/dvc,dataversioncontrol/dvc,dmpetrov/dataversioncontrol | tests/test_config.py | tests/test_config.py | import configobj
from dvc.main import main
from tests.basic_env import TestDvc
class TestConfigCLI(TestDvc):
def _contains(self, section, field, value, local=False):
if local:
fname = self.dvc.config.config_local_file
else:
fname = self.dvc.config.config_file
conf... | import configobj
from dvc.main import main
from tests.basic_env import TestDvc
class TestConfigCLI(TestDvc):
def _contains(self, section, field, value, local=False):
if local:
fname = self.dvc.config.config_local_file
else:
fname = self.dvc.config.config_file
conf... | apache-2.0 | Python |
7738f2245cc24d68a84f3bbe4a06f6272f8efc75 | Add better add() function | pixbuffer/sunburnt-spatial,rlskoeser/sunburnt,anmar/sunburnt,anmar/sunburnt,rlskoeser/sunburnt,tow/sunburnt,pixbuffer/sunburnt-spatial,qmssof/sunburnt | sunburnt.py | sunburnt.py | from __future__ import absolute_import
import cgi
import urllib
import httplib2
from lxml.builder import ElementMaker
from lxml import etree
import simplejson
h = httplib2.Http(".cache")
E = ElementMaker()
def force_unicode(s):
if isinstance(s, unicode):
return s
else:
return s.encode('utf-8... | from __future__ import absolute_import
import cgi
import urllib
import httplib2
import simplejson
h = httplib2.Http(".cache")
class SolrException(Exception):
pass
class SolrConnection(object):
def __init__(self, url):
self.url = url.rstrip("/") + "/"
self.update_url = self.url + "update/"
... | mit | Python |
097db8d96c5e50730a2bc70745d51daa77a91758 | Add new entity test for external ID str | jakelever/kindred,jakelever/kindred | tests/test_entity.py | tests/test_entity.py | import kindred
def test_entity_str():
e1 = kindred.Entity(entityType="drug",text="Erlotinib",position=[(0,9)],sourceEntityID=None)
e2 = kindred.Entity(entityType="drug",text="Erlotinib",position=[(0,9)],sourceEntityID="T16")
expected1 = "<Entity drug:'Erlotinib' id=%d sourceid=None [(0, 9)]>" % e1.entityID
expect... | import kindred
def test_entity_str():
e1 = kindred.Entity(entityType="drug",text="Erlotinib",position=[(0,9)],sourceEntityID=None)
e2 = kindred.Entity(entityType="drug",text="Erlotinib",position=[(0,9)],sourceEntityID="T16")
expected1 = "<Entity drug:'Erlotinib' id=%d sourceid=None [(0, 9)]>" % e1.entityID
expect... | mit | Python |
3d7f9630a5a86511367f9c4cd5361c5c9af66cee | Add tests for ImportableModuleFilter._skip() | sphinx-contrib/spelling,sphinx-contrib/spelling | tests/test_filter.py | tests/test_filter.py | #
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Tests for filters.
"""
import pytest
from enchant.tokenize import get_tokenizer
from sphinxcontrib.spelling import filters
def test_builtin_unicode():
f = filters.PythonBuiltinsFilter(None)
assert not f._skip('passé')
def test_builtin_regula... | #
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Tests for filters.
"""
from enchant.tokenize import get_tokenizer
from sphinxcontrib.spelling import filters
def test_builtin_unicode():
f = filters.PythonBuiltinsFilter(None)
assert not f._skip('passé')
def test_builtin_regular():
f = f... | bsd-2-clause | Python |
d40dfd3ea5afa563b76efa48cab5b3781ab34e5b | make JacobiElem more complete | piyueh/SEM-Toolbox | utils/elems/one_d/JacobiElem.py | utils/elems/one_d/JacobiElem.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Pi-Yueh Chuang <pychuang@gwu.edu>
#
# Distributed under terms of the MIT license.
"""Definition of standard element of p-type Jacobi polynomials expansions"""
import numpy
from utils.poly import Polynomial
from utils.poly import Jac... | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Pi-Yueh Chuang <pychuang@gwu.edu>
#
# Distributed under terms of the MIT license.
"""Definition of element using Jacobi polynomials as expansions"""
import numpy
from utils.poly import Polynomial
from utils.poly import Jacobi
from u... | mit | Python |
ee823b46170bc1618e5ae5545018eacc3ddd74ce | remove dead code | ninchat/ninchat-python | tests/test_gevent.py | tests/test_gevent.py | # Copyright (c) 2013, Somia Reality Oy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | # Copyright (c) 2013, Somia Reality Oy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | bsd-2-clause | Python |
c64390a436cdb6e1dbf52e2ff5ff189009bbbc56 | Add multidimensional sphere point generator | fu-berlin-swp-2014/center-points,fu-berlin-swp-2014/center-points | tests/test_helper.py | tests/test_helper.py | import math
import numpy as np
from math import pi, ceil
def random_sphere_points(n_points, dim):
assert dim == 3
# @see http://en.wikipedia.org/wiki/Spherical_coordinate_system
r = 1
theta = np.random.rand(n_points) * 2 * math.pi
phi = np.random.rand(n_points) * 2 * math.pi
x = r * np.sin(... | import math
import numpy as np
from math import pi, cos, sin
def random_sphere_points(n_points, dim):
assert dim == 3
# @see http://en.wikipedia.org/wiki/Spherical_coordinate_system
r = 1
theta = np.random.rand(n_points) * 2 * math.pi
phi = np.random.rand(n_points) * 2 * math.pi
x = r * np.... | mit | Python |
20b08fa71de4366f4948eb485bb5b94c6fc5ff2a | set argument to info_read | jcharum/pycurl,jcharum/pycurl,jcharum/pycurl,m13253/pycurl-python3,ninemoreminutes/pycurl,ninemoreminutes/pycurl,ninemoreminutes/pycurl,ninemoreminutes/pycurl,m13253/pycurl-python3,m13253/pycurl-python3 | tests/test_multi6.py | tests/test_multi6.py | #! /usr/bin/env python
# vi:ts=4:et
# $Id: test_multi6.py,v 1.2 2002/11/20 14:53:41 kjetilja Exp $
import sys, select, time
import pycurl
c1 = pycurl.Curl()
c2 = pycurl.Curl()
c3 = pycurl.Curl()
c1.setopt(c1.URL, 'http://www.python.org')
c2.setopt(c2.URL, 'http://curl.haxx.se')
c3.setopt(c3.URL, 'http://slashdot.org'... | #! /usr/bin/env python
# vi:ts=4:et
# $Id: test_multi6.py,v 1.1 2002/11/19 11:49:05 kjetilja Exp $
import sys, select, time
import pycurl
c1 = pycurl.Curl()
c2 = pycurl.Curl()
c3 = pycurl.Curl()
c1.setopt(c1.URL, 'http://www.python.org')
c2.setopt(c2.URL, 'http://curl.haxx.se')
c3.setopt(c3.URL, 'http://slashdot.org'... | lgpl-2.1 | Python |
8fc5e85adf5320a96b5ac94cbd4e9815da5ad852 | Work in progress.Minimal tests | AndersonMasese/Myshop,AndersonMasese/Myshop,AndersonMasese/Myshop | tests/test_myshop.py | tests/test_myshop.py | import unittest
import urllib
from flask_testing import LiveServerTestCase
from flask_testing import TestCase
from flask import Flask
from Designs.main import *
class Myshop(TestCase):
'''class defining tests for the myshop application'''
render_templates = False
def create_app(self):
app==Flask(... | import unittest
from Designs.main import *
class Myshop(unittest.TestCase):
'''class defining tests for the myshop application'''
def test_add_shopping_list_item(self):
self.assertEqual(add_shopping_list_item(),render_template('add_shopping_list_item.html',records=records)
) | mit | Python |
ee452c1f1b223c2ff6850b16c1ef7440f7970a33 | add mget test | keakon/redis-shard,zhihu/redis-shard | tests/test_normal.py | tests/test_normal.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
from redis_shard.shard import RedisShardAPI
from .config import servers
class TestShard(unittest.TestCase):
def setUp(self):
self.client = RedisShardAPI(servers)
self.clear_db()
def tearDown(self):
pass
def clear_db(self)... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
from redis_shard.shard import RedisShardAPI
from .config import servers
class TestShard(unittest.TestCase):
def setUp(self):
self.client = RedisShardAPI(servers)
self.clear_db()
def tearDown(self):
pass
def clear_db(self)... | bsd-2-clause | Python |
6c7dc47e67ae99cabd00e63269b549504e162279 | adjust TimedPlugin test to be less unreliable | 20c/vodka,20c/vodka | tests/test_plugin.py | tests/test_plugin.py | import unittest
import time
import vodka.plugins
import vodka.data
import vodka.storage
import vodka
@vodka.plugin.register("test")
class PluginA(vodka.plugins.PluginBase):
pass
@vodka.plugin.register("timed_test")
class TimedPlugin(vodka.plugins.TimedPlugin):
def init(self):
self.counter = 0
... | import unittest
import time
import vodka.plugins
import vodka.data
import vodka.storage
import vodka
@vodka.plugin.register("test")
class PluginA(vodka.plugins.PluginBase):
pass
@vodka.plugin.register("timed_test")
class TimedPlugin(vodka.plugins.TimedPlugin):
def init(self):
self.counter = 0
... | apache-2.0 | Python |
823e767f52bc6e3bf78a91950e9407a1acf811d2 | Refactor test case into two classes | HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library | tests/test_server.py | tests/test_server.py | import os
import unittest
import tempfile
# Local modules
import library.server as server
class ServerTestCase(unittest.TestCase):
@classmethod
def setUp(self):
self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp()
server.app.config['TESTING'] = True
self.app = server.app.te... | import os
import unittest
import tempfile
# Local modules
import library.server as server
class ServerTestCase(unittest.TestCase):
@classmethod
def setUp(self):
self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp()
server.app.config['TESTING'] = True
self.app = server.app.te... | mit | Python |
ec1bfa05d76a236095a1284751f4a6fca4c32ce2 | fix bug | arrti/proxypool,arrti/proxypool | tests/test_server.py | tests/test_server.py | from multiprocessing import Process
from time import sleep
import pytest
import requests
import proxypool.proxy_server as proxy_server
from proxypool.config import HOST, PORT, SSL_ON, CA_CRT
@pytest.fixture
def api(db):
db.put_list(['127.0.0.1:80', '127.0.0.1:443', '127.0.0.1:1080'])
proxy_server.conn = db ... | from multiprocessing import Process
from time import sleep
import pytest
import requests
import proxypool.proxy_server as proxy_server
from proxypool.config import HOST, PORT, SSL_ON, CA_CRT
@pytest.fixture
def api(db):
db.put_list(['127.0.0.1:80', '127.0.0.1:443', '127.0.0.1:1080'])
proxy_server.conn = db ... | apache-2.0 | Python |
05c15b6e1fcc969a1d7b91dd2c462f6e3a7eee71 | test checks get_music Ok. It checks the len of values included on MIDI files. since getvalue returns them. If music proccess is verified, get_music must verify only it's creation | DataSounds/DataSounds | tests/test_sounds.py | tests/test_sounds.py | #!/usr/bin/env python
import numpy as np
from DataSounds.sounds import build_scale, note_number, note_name, get_music
def test_build_scale_major():
scale = build_scale('C', 'major', 1)
assert scale == 'c d e f g a b'.split()
def test_build_scale_minor():
scale = build_scale('A', 'minor', 1)
asser... | #!/usr/bin/env python
import numpy as np
from DataSounds.sounds import build_scale, note_number, note_name, get_music
def test_build_scale_major():
scale = build_scale('C', 'major', 1)
assert scale == 'c d e f g a b'.split()
def test_build_scale_minor():
scale = build_scale('A', 'minor', 1)
asser... | bsd-3-clause | Python |
a6910918039759628c67ec8394819ef71b34b7c1 | Handle exceptions in threads. | serathius/elasticsearch-raven,pozytywnie/elasticsearch-raven,socialwifi/elasticsearch-raven | elasticsearch_raven/udp_server.py | elasticsearch_raven/udp_server.py | import argparse
import datetime
import os
import queue
import socket
import sys
import threading
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.transport import SentryMessage
def run_server():
args = _parse_args()
sock = get_socket(args.ip, args.port)
if sock:
... | import argparse
import datetime
import os
import queue
import socket
import sys
import threading
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.transport import SentryMessage
def run_server():
args = _parse_args()
sock = get_socket(args.ip, args.port)
if sock:
... | mit | Python |
249afcb4e94f08c29c93ed5b7c5291bfe864c51c | Update referee.py | jtokaz/checkio-mission-compare-functions,jtokaz/checkio-mission-compare-functions,jtokaz/checkio-mission-compare-functions | verification/referee.py | verification/referee.py | """
CheckiOReferee is a base referee for checking you code.
arguments:
tests -- the dict contains tests in the specific structure.
You can find an example in tests.py.
cover_code -- is a wrapper for the user function and additional operations before give data
in the user func... | """
CheckiOReferee is a base referee for checking you code.
arguments:
tests -- the dict contains tests in the specific structure.
You can find an example in tests.py.
cover_code -- is a wrapper for the user function and additional operations before give data
in the user func... | mit | Python |
0cf0896668074a60372f5c89fb9c26ee049c187a | Add exemplar GeoJSONGeolocationPair | maxalbert/tohu | tests/v4/conftest.py | tests/v4/conftest.py | import os
from .context import tohu
from tohu.v4.primitive_generators import *
from tohu.v4.derived_generators import *
__all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_DERIVED_GENERATORS']
def add(x, y):
return x + y
here = os.path.abspath(os.path.dirname(__file__))
geojson_filename... | from .context import tohu
from tohu.v4.primitive_generators import *
from tohu.v4.derived_generators import *
__all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_DERIVED_GENERATORS']
def add(x, y):
return x + y
EXEMPLAR_PRIMITIVE_GENERATORS = [
Boolean(p=0.3),
Constant("quux"),
... | mit | Python |
b3076c26424b93f7aec473f91c28d09551cc2f59 | Clarify the phrasing of a unit test. | sussman/zvm,sussman/zvm | tests/zscii_tests.py | tests/zscii_tests.py | #
# Unit tests for the zscii class.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
from unittest import TestCase
from zvm.zscii import Zscii
class BitFieldTests(TestCase):
def testCreateVersions(self):
"""Test that all ZM versions can be cr... | #
# Unit tests for the zscii class.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
from unittest import TestCase
from zvm.zscii import Zscii
class BitFieldTests(TestCase):
def testCreateVersions(self):
"""Test that all ZM versions can be cr... | bsd-3-clause | Python |
68dc0185af3875085a7799120f0bb47ad037aa4d | Fix the ZSCII unicode tests by converting the correct ASCII code. | BGCX262/zvm-hg-to-git,BGCX262/zvm-hg-to-git | tests/zscii_tests.py | tests/zscii_tests.py | #
# Unit tests for the zscii class.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
from unittest import TestCase
from zvm import zstring
from zvm import zmemory
def make_zmemory():
# We use Graham Nelson's 'curses' game for our unittests.
story... | #
# Unit tests for the zscii class.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
from unittest import TestCase
from zvm import zstring
from zvm import zmemory
def make_zmemory():
# We use Graham Nelson's 'curses' game for our unittests.
story... | bsd-3-clause | Python |
c145d48c9f54051c4a1436ee1ea60121b18db46a | Adjust purchase_info template tags | josesanch/django-oscar,django-oscar/django-oscar,elliotthill/django-oscar,amirrpp/django-oscar,rocopartners/django-oscar,monikasulik/django-oscar,john-parton/django-oscar,taedori81/django-oscar,dongguangming/django-oscar,django-oscar/django-oscar,eddiep1101/django-oscar,kapari/django-oscar,vovanbo/django-oscar,DrOctogo... | oscar/templatetags/purchase_info_tags.py | oscar/templatetags/purchase_info_tags.py | from django import template
register = template.Library()
@register.tag
def purchase_info_for_product(parse, token):
"""
Template tag for fetching the appropriate ``PurchaseInfo`` instance for a
product and returning it to the context
"""
tokens = token.split_contents()
if len(tokens) != 5 o... | from django import template
register = template.Library()
@register.tag(name="purchase_info_for_product")
def do_product_purchase_info(parse, token):
"""
Template tag for fetching the appropriate ``PurchaseInfo`` instance for a
product and returning it to the context
"""
tokens = token.split_con... | bsd-3-clause | Python |
a92397bb2218f174a2df0b5090dd31bde2164561 | Enable context provider for TraceErrorsMiddleware | lucius-feng/tg2,lucius-feng/tg2 | tg/error.py | tg/error.py | import logging
from paste.deploy.converters import asbool
log = logging.getLogger(__name__)
def _turbogears_backlash_context(environ):
tgl = environ.get('tg.locals')
return {'request':getattr(tgl, 'request', None)}
def ErrorHandler(app, global_conf, **errorware):
"""ErrorHandler Toggle
If debug ... | import logging
from paste.deploy.converters import asbool
log = logging.getLogger(__name__)
def _turbogears_backlash_context(environ):
tgl = environ.get('tg.locals')
return {'request':getattr(tgl, 'request', None)}
def ErrorHandler(app, global_conf, **errorware):
"""ErrorHandler Toggle
If debug ... | mit | Python |
9cbbd55ed1c25cf0ed92d9e03d9cc11142f1bffa | Update urls for django 1.10.5 | colbypalmer/cp-blog,colbypalmer/cp-blog | blog/urls.py | blog/urls.py | from django.conf.urls import url
from blog.feeds import LatestEntriesRssFeed, LatestEntriesAtomFeed
urlpatterns = [
url(r'^$', 'blog.views.blog_list', name='blog'),
url(r'^rss/$', LatestEntriesRssFeed(), name='blog_rss'),
url(r'^atom/$', LatestEntriesAtomFeed(), name='blog_atom'),
url(r'^tags/$', 'blog... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from blog.feeds import LatestEntriesRssFeed, LatestEntriesAtomFeed
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'blog.views.blog_list', name='blog'),
url(r'^rss/$', LatestEn... | mit | Python |
f3a87cccc1dc34086864dd074cc497a2a7499040 | Arrange the appearance. 体裁を整えました。完全に動くようになりました。 | TT375S/TestScheduleGetter,TT375S/TestScheduleGetter | files/search.py | files/search.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
args = sys.argv
timetable = "timetable.txt"
A_schedule = "d_FA.txt"
C_schedules = ["d_FC_kikan.txt", "d_FC_sensin.txt", "d_FC_souzou.txt"]
#受講している授業の一覧を引数で指定
if len(args) > 1 :
timetable = args[1]
for i in range(3):
C_schedules[i] = args[i+2]
f_timeTable = op... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
args = sys.argv
timetable = "timetable.txt"
A_schedule = "d_FA.txt"
C_schedules = ["d_FC_kikan.txt", "d_FC_sensin.txt", "d_FC_souzou.txt"]
if len(args) > 1 :
timetable = args[1]
for i in range(3):
C_schedules[i] = args[i+2]
f_timeTable = open(timetable)
f_s... | mit | Python |
426f89372c608155bb139c4c7617539a1d514a2c | fix bug | RyouZhang/noir,RyouZhang/nori | demo/service/loader.py | demo/service/loader.py | import os
def import_service(service_name):
services = os.getenv('SERVICES', None)
if services is not None:
services = [s.strip() for s in services.split(',')]
valid_services = [service.replace(service_name, '').split('.')[1] for service in services if service.startswith(service_name) and ... | import os
def import_service(service_name):
services = os.getenv('SERVICES', None)
if services is not None:
services = [s.strip() for s in services.split(',')]
valid_services = [service.replace(service_name, '').split('.')[1] for service in services if service.startswith(service_name)]
... | mit | Python |
c422e1aa7937241f7a56558d92f7b793bab4a847 | Optimise gametrailers.py | CJ-Jackson/django-mediaembedder | mediaembedder/services/gametrailers.py | mediaembedder/services/gametrailers.py | services = []
def gametrailers(self):
id = self.match.group('gametrailers_id')
width = 640
height = 360
if self.width:
width = self.width
if self.height:
height = self.height
return self.render('gametrailers.html', {'id': id, 'width': width, 'height': height})
services.append({... | services = []
def gametrailers(self):
id = self.match.group('gametrailers_id')
if self.width:
width = self.width
else:
width = 640
if self.height:
height = self.height
else:
height = 360
return self.render('gametrailers.html', {'id': id, 'width': width, 'height':... | mit | Python |
8112ddd38efcab9ed767a4bddcecb507c72e9324 | Tag new release: 2.6.4 | Floobits/floobits-sublime,Floobits/floobits-sublime | floo/version.py | floo/version.py | PLUGIN_VERSION = '2.6.4'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| PLUGIN_VERSION = '2.6.3'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| apache-2.0 | Python |
e6976008f02a8265ad280a6658565a38cde880b2 | Add more tests | LaurEars/codegrapher | tests.py | tests.py | import ast
from parsing.parser import FileVisitor
def test_import_visitor():
function_string = '''import ast'''
parsed_function = ast.parse(function_string, filename='parsed_function.py')
visitor = FileVisitor()
visitor.visit(parsed_function)
assert 'ast' in visitor.modules
assert 'ast' in vis... | import ast
from parsing.parser import FileVisitor
def test_import_visitor():
function_string = '''import ast'''
parsed_function = ast.parse(function_string, filename='parsed_function.py')
visitor = FileVisitor()
visitor.visit(parsed_function)
assert 'ast' in visitor.modules
assert 'ast' in vis... | mit | Python |
a66af19c215af0ae4fcffaf92b5a00a05475042e | Move to web.py | MrWhoami/WhoamiBangumi,MrWhoami/WhoamiBangumi | index.wsgi | index.wsgi | import os
import sae
import web
urls = (
'/', 'Hello'
)
app_root = os.path.dirname(__file__)
templates_root = os.path.join(app_root, 'templates')
render = web.template.render(templates_root)
class Hello:
def GET(self):
return render.hello()
app = web.application(urls, globals()).wsgifunc()
applica... | import sae
def app(environ, start_response):
status = '200 OK'
response_headers = [('Content-type', 'text/plain')]
start_response(status, response_headers)
return ['Hello, world!']
application = sae.create_wsgi_app(app)
| mit | Python |
0e9b6cf0fb03bdd029a87d4d94269c06d4d82832 | Add test for editting page | plumdog/mainstay_wiki | tests.py | tests.py | from django.test import TestCase
from django.contrib.auth.models import User
from mainstay.test_utils import MainstayTest
from .models import Page
class WikiTestCase(MainstayTest):
fixtures = MainstayTest.fixtures + ['wiki_pages']
def test_user_loaded(self):
user = User.objects.get()
self.as... | from django.test import TestCase
from django.contrib.auth.models import User
from mainstay.test_utils import MainstayTest
from .models import Page
class WikiTestCase(MainstayTest):
fixtures = MainstayTest.fixtures + ['wiki_pages']
def test_user_loaded(self):
user = User.objects.get()
self.as... | mit | Python |
0d40e1da382003e65c0e5c743619598a6abcd407 | Test logcmd. | whilp/redispatcher | tests.py | tests.py | import logging
import logging.handlers
import unittest
import redispatcher
from redispatcher import fmtcmd, logcmd, wirecmd
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record): pass
log = logging.getLogger(__name__)
log.addHandler(... | import logging
import unittest
import redispatcher
from redispatcher import fmtcmd, wirecmd
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record): pass
log = logging.getLogger(__name__)
log.addHandler(NullHandler())
class BaseTest(u... | isc | Python |
25dd48bd0bdaab2626a8602d9acd67d90a5343f4 | add more tests for ports selecting | bak1an/wsgitestcase | tests.py | tests.py | import requests
import socket
from wsgitestcase import WsgiTestCase, WsgiThread
from wsgitestcase import get_cool_unittest
from werkzeug.wrappers import Request, Response
unittest = get_cool_unittest()
@Request.application
def goodbye_app(request):
return Response("goodbye world")
class TestSimpleServer(WsgiT... | import requests
import socket
from wsgitestcase import WsgiTestCase, WsgiThread
from wsgitestcase import get_cool_unittest
from werkzeug.wrappers import Request, Response
unittest = get_cool_unittest()
@Request.application
def goodbye_app(request):
return Response("goodbye world")
class TestSimpleServer(WsgiT... | mit | Python |
f1bbae84efb028da1f8a86d11a7ee7f4d47dc551 | Update worker. | severb/flowy | flowy/worker.py | flowy/worker.py | class SingleThreadedWorker(object):
def __init__(self, client):
self._client = client
self._registry = {}
def register(self, task_id, task_factory):
self._registry[task_id] = task_factory
def poll_next_task(self):
return self._client.poll_next_task(self)
def make_task(... | class SingleThreadedWorker(object):
def __init__(self, client):
self._client = client
self._registry = {}
def register(self, task_id, task_factory):
self._registry[task_id] = task_factory
def poll_next_task(self):
return self._client.poll_next_task(self)
def make_task(... | mit | Python |
d51c7a94d9c658f36c6c7eb4731d8a1f56ea1dd5 | Bump version | thombashi/subprocrunner,thombashi/subprocrunner | subprocrunner/__version__.py | subprocrunner/__version__.py | __author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016, {}".format(__author__)
__license__ = "MIT License"
__version__ = "1.2.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| __author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016, {}".format(__author__)
__license__ = "MIT License"
__version__ = "1.2.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
1ad0ca50d1f4c61513bea33a4ffd999406c69600 | Merge remote-tracking branch 'origin/development' into AC-7469 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0019_add_deferred_user_role.py | accelerator/migrations/0019_add_deferred_user_role.py | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | mit | Python |
4f4bef9fe8d509ffec668b6e1c6469cfc98deb70 | support iter_documents on forms | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/form_processor/document_stores.py | corehq/form_processor/document_stores.py | from corehq.blobs import Error as BlobError
from corehq.form_processor.exceptions import CaseNotFound, XFormNotFound
from corehq.form_processor.interfaces.dbaccessors import FormAccessors, CaseAccessors
from pillowtop.dao.exceptions import DocumentNotFoundError
from pillowtop.dao.interface import ReadOnlyDocumentStore
... | from corehq.blobs import Error as BlobError
from corehq.form_processor.exceptions import CaseNotFound, XFormNotFound
from corehq.form_processor.interfaces.dbaccessors import FormAccessors, CaseAccessors
from pillowtop.dao.exceptions import DocumentNotFoundError
from pillowtop.dao.interface import ReadOnlyDocumentStore
... | bsd-3-clause | Python |
30b7b7bf134d994bdade087aec99068c34cecf2f | Bump version to 1.7.9 | artefactual/archivematica-fpr-admin,artefactual/archivematica-fpr-admin,artefactual/archivematica-fpr-admin,artefactual/archivematica-fpr-admin | fpr/__init__.py | fpr/__init__.py | """
:mod:`fpr` -- Format Policy Registry
.. module:: fpr
:platform: Unix
:synopsis: Allow interaction with the Format Policy Registry
.. moduleauthor:: Joseph Perry <joseph@artefactual.com>
.. moduleauthor:: Justin Simpson <jsimpson@artefactual.com>
"""
__version__ = '1.7.9'
| """
:mod:`fpr` -- Format Policy Registry
.. module:: fpr
:platform: Unix
:synopsis: Allow interaction with the Format Policy Registry
.. moduleauthor:: Joseph Perry <joseph@artefactual.com>
.. moduleauthor:: Justin Simpson <jsimpson@artefactual.com>
"""
__version__ = '1.7.8'
| agpl-3.0 | Python |
7515e3ad73311ec29342ea163c2d8d5ca9557532 | Update git.py | vadimkantorov/wigwam | wigs/git.py | wigs/git.py | class git(Wig):
tarball_uri = 'https://github.com/git/git/archive/v$RELEASE_VERSION$.tar.gz'
last_release_version = 'v2.10.1'
git_uri = 'https://github.com/git/git'
def setup(self):
self.before_configure += [S.make(['configure'])]
self.configure_flags += ['--without-tcltk']
| class git(Wig):
tarball_uri = 'https://github.com/git/git/archive/v$RELEASE_VERSION$.tar.gz'
last_release_version = 'v2.10.1'
git_uri = 'https://github.com/git/git'
def setup(self):
self.before_configure += [S.make(['configure'])]
| mit | Python |
9c84fe1144cc5ccec5fc9cfcdf7c5adf8cfdf15c | Add override class for ID="ol" AKA Oracle Linux Server, a clone of CentOS/RHEL. | stweil/letsencrypt,stweil/letsencrypt,lmcro/letsencrypt,letsencrypt/letsencrypt,letsencrypt/letsencrypt,lmcro/letsencrypt | certbot-apache/certbot_apache/entrypoint.py | certbot-apache/certbot_apache/entrypoint.py | """ Entry point for Apache Plugin """
from certbot import util
from certbot_apache import configurator
from certbot_apache import override_arch
from certbot_apache import override_darwin
from certbot_apache import override_debian
from certbot_apache import override_centos
from certbot_apache import override_gentoo
fro... | """ Entry point for Apache Plugin """
from certbot import util
from certbot_apache import configurator
from certbot_apache import override_arch
from certbot_apache import override_darwin
from certbot_apache import override_debian
from certbot_apache import override_centos
from certbot_apache import override_gentoo
fro... | apache-2.0 | Python |
709cca509e19db11ce07256c16159897c3eb7ce0 | use java helper for templates (#113) | googleapis/java-shared-config,googleapis/java-shared-config | synth.py | synth.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
dacac27d3383f4b431aff4549f13f1f625aac393 | use `npm ci` instead of `npm install` (#134) | googleapis/nodejs-datastore,googleapis/nodejs-datastore,googleapis/nodejs-datastore | synth.py | synth.py | import synthtool as s
import synthtool.gcp as gcp
import logging
from pathlib import Path
import subprocess
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
# tasks has two product names, and a poorly named artman yaml
version = 'v1'
library = gapic.node_library(
'datastore', version,
c... | import synthtool as s
import synthtool.gcp as gcp
import logging
from pathlib import Path
import subprocess
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
# tasks has two product names, and a poorly named artman yaml
version = 'v1'
library = gapic.node_library(
'datastore', version,
c... | apache-2.0 | Python |
566ae25e3b29fb756a9818f5b1b69410c1edfebb | set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#402) | googleapis/nodejs-language,googleapis/nodejs-language | synth.py | synth.py | import synthtool as s
import synthtool.gcp as gcp
import logging
import subprocess
logging.basicConfig(level=logging.DEBUG)
AUTOSYNTH_MULTIPLE_COMMITS = True
gapic = gcp.GAPICMicrogenerator()
# tasks has two product names, and a poorly named artman yaml
for version in ['v1', 'v1beta2']:
library = gapic.typescri... | import synthtool as s
import synthtool.gcp as gcp
import logging
import subprocess
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICMicrogenerator()
# tasks has two product names, and a poorly named artman yaml
for version in ['v1', 'v1beta2']:
library = gapic.typescript_library(
'language',
... | apache-2.0 | Python |
e7d6a94b256981853c33568ab896e7b259dca628 | Migrate python-scheduler synth.py from artman to bazel (#13) | googleapis/python-scheduler,googleapis/python-scheduler | synth.py | synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
2359af5d1ed8c209f7ed8438d02d8ce52566a222 | Use open() with "wb" flag instead of "xb" | ko-zu/psl | publicsuffixlist/update.py | publicsuffixlist/update.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 ko-zu <causeless@gmail.com>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import os
from publics... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 ko-zu <causeless@gmail.com>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import os
from publics... | mpl-2.0 | Python |
f947b45f9eae011d036915191c4879af8978ee7e | Update Python | qpython-android/QPython3-core,qpython-android/QPython3-core,qpython-android/QPython3-core,qpython-android/QPython3-core,qpython-android/QPython3-core,qpython-android/QPython3-core,qpython-android/QPython3-core,qpython-android/QPython3-core | pybuild/packages/python.py | pybuild/packages/python.py | from .. import env
from ..source import GitSource
from ..package import Package
from ..patch import LocalPatch, RemotePatch
from ..util import target_arch
class Python(Package):
source = GitSource('https://github.com/qpython-android/cpython/', branch='qpyc-3.7.0')
patches = [
# https://bugs.python.org... | from .. import env
from ..source import GitSource
from ..package import Package
from ..patch import LocalPatch, RemotePatch
from ..util import target_arch
class Python(Package):
source = GitSource('https://github.com/qpython-android/cpython/', branch='qpyc-3.6.4')
patches = [
# https://bugs.python.org... | apache-2.0 | Python |
e5d88beba41de18ebab33e0770ddd8bb5174491e | Fix a bug in the quadrules. | tjcorona/PyFR,tjcorona/PyFR,iyer-arvind/PyFR,BrianVermeire/PyFR,tjcorona/PyFR,Aerojspark/PyFR | pyfr/quadrules/__init__.py | pyfr/quadrules/__init__.py | # -*- coding: utf-8 -*-
import re
from pyfr.quadrules.base import BaseQuadRule, BaseTabulatedQuadRule
from pyfr.quadrules.line import BaseLineQuadRule
from pyfr.util import subclass_map
def get_quadrule(basecls, rule, npts):
# See if rule looks like the name of a scheme
if re.match(r'[a-zA-Z0-9\-+_]+$', rul... | # -*- coding: utf-8 -*-
import re
from pyfr.quadrules.base import BaseQuadRule, BaseTabulatedQuadRule
from pyfr.quadrules.line import BaseLineQuadRule
from pyfr.quadrules.tri import BaseTriQuadRule
from pyfr.util import subclass_map
def get_quadrule(basecls, rule, npts):
# See if rule looks like the name of a s... | bsd-3-clause | Python |
010de29acb284250667b393f9e1ba7b34b53aaf5 | Add View as a first class member of pygametemplate | AndyDeany/pygame-template | pygametemplate/__init__.py | pygametemplate/__init__.py | """pygametemplate module for making creating games with Pygame easier."""
from __future__ import absolute_import
__version__ = "0.2.0"
__author__ = "Andrew Dean"
from pygametemplate.game import Game
from pygametemplate.view import View
| """pygametemplate module for making creating games with Pygame easier."""
from __future__ import absolute_import
__version__ = "0.2.0"
__author__ = "Andrew Dean"
from pygametemplate.game import Game
| mit | Python |
e8c63b23011ca56fc617f3499ff08be384983cc6 | add dynamic RTM event handling | ndethore/todaybot | todaybot.py | todaybot.py | import sys
import os
import time
import yaml
import traceback
from slackclient import SlackClient
outputs = []
class SlackBot(object):
def __init__(self, token):
self.last_ping = 0
self.token = token
self.bot_plugins = []
self.slack_client = None
def connect(self):
""... | import sys
import os
import time
import yaml
from slackclient import SlackClient
outputs = []
class SlackBot(object):
def __init__(self, token):
self.last_ping = 0
self.token = token
self.bot_plugins = []
self.slack_client = None
def connect(self):
"""Convenience meth... | mit | Python |
c39c60de325f5ce827de423abc646bd8662c80fb | Package data objects should return None for missing attributes. | mcyprian/pyp2rpm,henrysher/spec4pypi,MichaelMraka/pyp2rpm,pombredanne/pyp2rpm,yuokada/pyp2rpm,fedora-python/pyp2rpm,joequant/pyp2rpm | pyp2rpmlib/package_data.py | pyp2rpmlib/package_data.py | class PackageData(object):
def __init__(self, local_file, name, version):
self.local_file = local_file
self.name = name
self.version = version
def __getattr__(self, name):
if name in self.__dict__:
return self.__dict__[name]
return None
class PypiData(Packa... | class PackageData(object):
def __init__(self, local_file, name, version):
self.local_file = local_file
self.name = name
self.version = version
class PypiData(PackageData):
def __init__(self, local_file, name, version, md5, url):
super(PackageData, self).__init__(local_file, name... | mit | Python |
476a8c35b54ec5bb8fc9bb90c258452edd9ffce7 | Fix the dependency versions | CartoDB/crankshaft,CartoDB/crankshaft | python/crankshaft/setup.py | python/crankshaft/setup.py |
"""
CartoDB Spatial Analysis Python Library
See:
https://github.com/CartoDB/crankshaft
"""
from setuptools import setup, find_packages
setup(
name='crankshaft',
version='0.0.01',
description='CartoDB Spatial Analysis Python Library',
url='https://github.com/CartoDB/crankshaft',
author='Data S... |
"""
CartoDB Spatial Analysis Python Library
See:
https://github.com/CartoDB/crankshaft
"""
from setuptools import setup, find_packages
REQUIRES = ['pysal','numpy']
setup(
name='crankshaft',
version='0.0.01',
description='CartoDB Spatial Analysis Python Library',
url='https://github.com/CartoDB/cr... | bsd-3-clause | Python |
778164fee688e75a829f796cb3319ad7f3fbf131 | Update version | ingresso-group/pyticketswitch | pyticketswitch/__init__.py | pyticketswitch/__init__.py | __version__ = '1.8.5'
from interface_objects import * # NOQA
from util import auto_date_to_slug, slug_to_auto_date # NOQA
| __version__ = '1.8.4'
from interface_objects import * # NOQA
from util import auto_date_to_slug, slug_to_auto_date # NOQA
| mit | Python |
7f38276fddc3d94f791d29d3bcbff4bfc9d4ee98 | Add exception test cases for TupleDataset | okuta/chainer,cupy/cupy,hvy/chainer,keisuke-umezawa/chainer,niboshi/chainer,anaruse/chainer,ronekko/chainer,keisuke-umezawa/chainer,jnishi/chainer,chainer/chainer,hvy/chainer,keisuke-umezawa/chainer,ktnyt/chainer,kikusu/chainer,okuta/chainer,delta2323/chainer,niboshi/chainer,niboshi/chainer,rezoo/chainer,wkentaro/chain... | tests/chainer_tests/datasets_tests/test_tuple_dataset.py | tests/chainer_tests/datasets_tests/test_tuple_dataset.py | import unittest
import numpy
from chainer import cuda
from chainer import datasets
from chainer import testing
from chainer.testing import attr
class TestTupleDataset(unittest.TestCase):
def setUp(self):
self.x0 = numpy.random.rand(3, 4)
self.x1 = numpy.random.rand(3, 5)
self.z0 = numpy... | import unittest
import numpy
from chainer import cuda
from chainer import datasets
from chainer import testing
from chainer.testing import attr
class TestTupleDataset(unittest.TestCase):
def setUp(self):
self.x0 = numpy.random.rand(3, 4)
self.x1 = numpy.random.rand(3, 5)
def check_tuple_da... | mit | Python |
f81fb615dd4e160fbb9602c811f093e7e2c890c0 | fix docker command | danimtb/dasshio | .ci/build.py | .ci/build.py | #! /usr/bin/env python
import os
def run(cmd, message=None):
msg = message or cmd
print("\n%s\n" % msg)
ret = os.system(cmd)
if ret != 0:
raise Exception("Error running: %s" % msg)
travis_tag = os.getenv("TRAVIS_TAG")
travis_commmit = os.getenv("TRAVIS_COMMIT")
github_url = os.getenv("GITHUB_... | #! /usr/bin/env python
import os
def run(cmd, message=None):
msg = message or cmd
print("\n%s\n" % msg)
ret = os.system(cmd)
if ret != 0:
raise Exception("Error running: %s" % msg)
travis_tag = os.getenv("TRAVIS_TAG")
travis_commmit = os.getenv("TRAVIS_COMMIT")
github_url = os.getenv("GITHUB_... | apache-2.0 | Python |
fc9e9c5384f9133b7e35d867838ecb43b67a6c40 | Set a dummy log handler in case the `log_type` is not specified or not known. Fixes #3148. | rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac | trac/log.py | trac/log.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2006 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this ... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2006 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this ... | bsd-3-clause | Python |
2aa5fc04b8704b62fa9471aedd2dda8a1f6532cf | Add row.__init__ | jhogan/epiphany-py,jhogan/commonpy | table.py | table.py | # vim: set et ts=4 sw=4 fdm=marker
"""
MIT License
Copyright (c) 2016 Jesse Hogan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to u... | # vim: set et ts=4 sw=4 fdm=marker
"""
MIT License
Copyright (c) 2016 Jesse Hogan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to u... | mit | Python |
1f5c37ee327989ca148f5c870f8551048eaa8698 | Fix the probelm of pos_invoice report | sve-odoo/odoo,rowemoore/odoo,andreparames/odoo,BT-ojossen/odoo,cdrooom/odoo,nhomar/odoo,OpenUpgrade-dev/OpenUpgrade,guerrerocarlos/odoo,rgeleta/odoo,dkubiak789/odoo,Endika/odoo,shaufi/odoo,stonegithubs/odoo,ujjwalwahi/odoo,stephen144/odoo,Elico-Corp/odoo_OCB,mvaled/OpenUpgrade,xujb/odoo,draugiskisprendimai/odoo,synconi... | addons/point_of_sale/report/pos_invoice.py | addons/point_of_sale/report/pos_invoice.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 | Python |
2f286d4357f7abd97a1407e512e65aa26b4706cc | remove dirty tags | shrkw/jkk-notifier,shrkw/jkk-notifier,shrkw/jkk-notifier | jkk/scr.py | jkk/scr.py | #!/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import sys
import re
import pymongo
from .mailer import send_search_result
from .mongo import get_collection
from .searcher import Searcher
import logging
from .logger import handler
logger = logging.... | #!/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import sys
import re
import pymongo
from .mailer import send_search_result
from .mongo import get_collection
from .searcher import Searcher
import logging
from .logger import handler
logger = logging.... | mit | Python |
3d565d0565f015ca2b309668ff7aa156c2576bee | Rename unit test methods for consistency #18 | kyuridenamida/ToolsForAtCoder,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenamida/atcoder-tools,kyuridenam... | tools/tester_test.py | tools/tester_test.py | import unittest
from unittest.mock import patch
from tester import is_executable_file
class TestTester(unittest.TestCase):
@patch('os.access', return_value=True)
@patch('pathlib.Path.is_file', return_value=True)
def test_is_executable_file(self, os_mock, is_file_mock):
self.assertTrue(is_executa... | import unittest
from unittest.mock import patch
from tester import is_executable_file
class TestTester(unittest.TestCase):
@patch('os.access', return_value=True)
@patch('pathlib.Path.is_file', return_value=True)
def test_is_executable_file(self, os_mock, is_file_mock):
self.assertTrue(is_executa... | mit | Python |
e149a514bb76c38eb3cc3a7af7de7ab570ea5306 | Use call_soon_threadsafe() for Tasks | Charcoal-SE/SmokeDetector,Charcoal-SE/SmokeDetector | tasks.py | tasks.py | # coding=utf-8
import asyncio
import threading
class Tasks:
loop = asyncio.new_event_loop()
@classmethod
def _run(cls):
asyncio.set_event_loop(cls.loop)
try:
cls.loop.run_forever()
finally:
cls.loop.close()
@classmethod
def do(cls, func, *args, **... | # coding=utf-8
import asyncio
import threading
class Tasks:
loop = asyncio.new_event_loop()
@classmethod
def _run(cls):
asyncio.set_event_loop(cls.loop)
try:
cls.loop.run_forever()
finally:
cls.loop.close()
@classmethod
def do(cls, func, *args, **... | apache-2.0 | Python |
371f3ea3f78b98c84401adf8fcb0a6533d2814ae | Update run.py | DEV3L/python-flask-example,DEV3L/python-flask-example | wsgi/run.py | wsgi/run.py | from flask import Flask
app = Flask(__name__)
# Create our index or root / route
@app.route("/")
@app.route("/index")
def index():
return "Python - Hello World! v1.1 - Hi Candace"
@app.route("/nick")
def nick():
return "Nick's secret route"
if __name__ == "__main__":
app.run() # debug="True")
| from flask import Flask
app = Flask(__name__)
# Create our index or root / route
@app.route("/")
@app.route("/index")
def index():
return "Python - Hello World! v1.1 - Hi Candace"
@app.route("/nick")
def index():
return "Nick's secret route"
if __name__ == "__main__":
app.run() # debug="True")
| mit | Python |
16091eebd0242782715600df9f6db9596f5797fe | Drop the deprecated way of specifying url patterns | ludwiktrammer/django-tagging-autocomplete | tagging_autocomplete/urls.py | tagging_autocomplete/urls.py | from django.conf.urls import url
urlpatterns = [
'tagging_autocomplete.views',
url(r'^list$', 'list_tags', name='tagging_autocomplete-list'),
]
| from django.conf.urls import patterns, url
urlpatterns = patterns(
'tagging_autocomplete.views',
url(r'^list$', 'list_tags', name='tagging_autocomplete-list'),
)
| mit | Python |
6318e940d40f15eb570a8325391172d1fc9570ba | update tasks.py syntax | lsaffre/commondata-ee | tasks.py | tasks.py | from atelier.invlib import setup_from_tasks
ns = setup_from_tasks(globals(), "commondata.ee",
revision_control_system='git'
)
| from atelier.invlib import setup_from_tasks
ns = setup_from_tasks(globals(), "commondata.ee")
ns.configure({
'revision_control_system' : 'git',
# 'doc_trees' : []
})
| bsd-2-clause | Python |
84d0c5fb79e7746720f418d6473400ff087a1e45 | Update tasks file according to the new invoke concept #357 | lsaffre/atelier,khchine5/atelier,khchine5/atelier,lsaffre/atelier | tasks.py | tasks.py | from atelier.tasks import ns, setup_from_tasks
setup_from_tasks(globals(), "atelier")
ns.configure({'revision_control_system': 'git'})
| #from atelier import
from atelier.tasks import ns, setup_from_tasks
setup_from_tasks(globals(), "atelier")
revision_control_system = 'git'
| bsd-2-clause | Python |
f37239f32cee650cbcd0bbb46342d011fa6ac4a4 | enhance debug output | rsbohn/flier | src/flier/__init__.py | src/flier/__init__.py | import urllib2
from urllib import urlencode
import json
debug=False
def first_flight():
print "Hello from Python."
sky = "http://cs.kobj.net"
class Endpoint(object):
domain = 'flier'
eid = 0
channel = 1
def signal_event(self, event_name, args={}):
response = self.post(
"/sky/e... | import urllib2
from urllib import urlencode
import json
debug=False
def first_flight():
print "Hello from Python."
sky = "http://cs.kobj.net"
class Endpoint(object):
domain = 'flier'
eid = 0
channel = 1
def signal_event(self, event_name, args={}):
response = self.post(
"/sky/e... | bsd-2-clause | Python |
c3a0e8733e799e3c49e5ab6b9a8e32f365553f97 | bump to 2.0.0 | efiop/dvc,dmpetrov/dataversioncontrol,efiop/dvc,dmpetrov/dataversioncontrol | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "2.0.0"
def _generate_version(base_version):
"""Generate a version ... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "2.0.0a4"
def _generate_version(base_version):
"""Generate a versio... | apache-2.0 | Python |
5bb2cfb0e536dcc5defdb803241c24679e6b7a2f | Add relative_error function to util | ergs/transmutagen,ergs/transmutagen | transmutagen/util.py | transmutagen/util.py | import difflib
def diff_strs(a, b):
"""
Print a colored character-by-character diff of a and b.
Requires colorama to be installed.
Differing characters from the a string are printed in red and those from
the b string are printed in green.
Note that this can be slow for large strings (more th... | import difflib
def diff_strs(a, b):
"""
Print a colored character-by-character diff of a and b.
Requires colorama to be installed.
Differing characters from the a string are printed in red and those from
the b string are printed in green.
Note that this can be slow for large strings (more th... | bsd-3-clause | Python |
397099cc8e2628a548c66957168dfab3de7f7f59 | Add test for loading script. | erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online | estudios_socioeconomicos/tests.py | estudios_socioeconomicos/tests.py | from django.test import TestCase
from .models import Pregunta, Seccion, Subseccion
from .load import load_data
class TestLoadPreguntas(TestCase):
""" Suite to test the script to load questions.
"""
def test_load_preguntas(self):
""" Test that the script to load questions works properly.
... | # from django.test import TestCase
# Create your tests here.
| mit | Python |
d4a339ee8fea6e93f37c2f165fd445a74836b38b | Update python.py | StatisKit/StatisKit,StatisKit/StatisKit | conda/python-dev/python.py | conda/python-dev/python.py | import sysconfig
from SCons.Script import AddOption, GetOption
from path import path
def generate(env, **kwargs):
"""Add Builders and construction variables to the Environment."""
if not 'python' in env['TOOLS'][:-1]:
env.Tool('system')
AddOption('--python-version',
dest = '... | import sysconfig
from SCons.Script import AddOption, GetOption
from path import path
def generate(env, **kwargs):
"""Add Builders and construction variables to the Environment."""
if not 'python' in env['TOOLS'][:-1]:
env.Tool('system')
AddOption('--python-version',
dest = '... | apache-2.0 | Python |
f516c6617bb8e28cdd754a130adedc80ff8e24aa | Update package.py | tangent-opensource/hdBlackbird,tangent-opensource/hdBlackbird,tangent-opensource/hdBlackbird | package.py | package.py | # -*- coding: utf-8 -*-
name = 'hdcycles'
version = '0.11.2'
authors = [
'benjamin.skinner',
]
requires = [
'cycles-1.13.0-ta.1.9.4',
]
variants = [
['platform-windows', 'arch-x64', 'os-windows-10', 'usd-20.05-ta.1.2'],
['platform-windows', 'arch-x64', 'os-windows-10', 'usd-20.11'],
['platform-... | # -*- coding: utf-8 -*-
name = 'hdcycles'
version = '0.11.1'
authors = [
'benjamin.skinner',
]
requires = [
'cycles-1.13.0-ta.1.9.4',
]
variants = [
['platform-windows', 'arch-x64', 'os-windows-10', 'usd-20.05-ta.1.2'],
['platform-windows', 'arch-x64', 'os-windows-10', 'usd-20.11'],
['platform-... | apache-2.0 | Python |
cb11cd23b14ad35bb8e87151df634b1195446393 | add handlers only once | tek/amino | tryp/logging.py | tryp/logging.py | import logging
import sys
from pathlib import Path # type: ignore
from lazy import lazy # type: ignore
import tryp
log = tryp_root_logger = logging.getLogger('tryp')
def tryp_logger(name: str):
return tryp_root_logger.getChild(name)
_stdout_logging_initialized = False
def tryp_stdout_logging():
global... | import logging
import sys
from pathlib import Path # type: ignore
from lazy import lazy # type: ignore
import tryp
log = tryp_root_logger = logging.getLogger('tryp')
def tryp_logger(name: str):
return tryp_root_logger.getChild(name)
def tryp_stdout_logging():
tryp_root_logger.addHandler(logging.StreamH... | mit | Python |
2b580890363ef846d05cdcc7989306dca15bf96e | add yconvert.py | imminfo/ymir,imminfo/ymir,imminfo/ymir,imminfo/ymir | yconvert.py | yconvert.py | import os
import sys
from pyymir import *
DIRNAME = os.path.dirname(sys.argv[0])
DIRNAME = DIRNAME if DIRNAME else "./"
if __name__ == "__main__":
ap = default_ymir_ap()
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--input", nargs = "+", help = "input file (text or gzipped) or a folder with inp... | apache-2.0 | Python | |
a783f51cdfd044648168d6bb56e105503da0eaa3 | Add get_cardinal_category test | rolepoint/pyseeyou | test/test_locales.py | test/test_locales.py | import pytest
from pyseeyou.locales import get_parts_of_num, lookup_closest_locale, get_cardinal_category
def test_get_parts_of_num():
assert get_parts_of_num('1') == (1, 1, 0, 0, 0, 0)
assert get_parts_of_num('1.0') == (1.0, 1, 1, 0, 0, 0)
assert get_parts_of_num('1.00') == (1.00, 1, 2, 0, 0, 0)
asse... | import pytest
from pyseeyou.locales import get_parts_of_num, lookup_closest_locale
def test_get_parts_of_num():
assert get_parts_of_num('1') == (1, 1, 0, 0, 0, 0)
assert get_parts_of_num('1.0') == (1.0, 1, 1, 0, 0, 0)
assert get_parts_of_num('1.00') == (1.00, 1, 2, 0, 0, 0)
assert get_parts_of_num('1.... | mit | Python |
5a764e0b91db628efd20d63d70c5ed688695f8b1 | Add basic functional DB /api route | starcalibre/MNIST3D,starcalibre/MNIST3D,starcalibre/MNIST3D | app/routes.py | app/routes.py | from app import app
from app.models import Digit
from flask import redirect, render_template, request, jsonify
@app.route('/')
def index():
return render_template('index.html')
# api route
# parameters
#
# id: id to query, will return all otherwise
# select: one value per item in the query
# limit: limit, obvious... | from app import app
from flask import redirect, render_template
@app.route('/')
def index():
return render_template('index.html')
# default 'catch all' route
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def catch_all(path):
return redirect('/')
| mit | Python |
e6d9524d6e29077cfb805cbafd99caf2b080a1c6 | Fix velocity_capsule description and drag formula | HyperloopTeam/Hyperloop,paulopperman/Hyperloop,whiplash01/Hyperloop,whiplash01/Hyperloop,UwHyperloop/Hyperloop,UwHyperloop/Hyperloop,HyperloopTeam/Hyperloop,paulopperman/Hyperloop,kishenr12/Hyperloop,kishenr12/Hyperloop | src/hyperloop/aero.py | src/hyperloop/aero.py | from openmdao.main.api import Component
from openmdao.lib.datatypes.api import Float
#put inside pod
class Aero(Component):
"""Place holder for real aerodynamic calculations of the capsule"""
#Inputs
coef_drag = Float(1, iotype="in", desc="capsule drag coefficient")
area_capsule = Float(18000, iotype... | from openmdao.main.api import Component
from openmdao.lib.datatypes.api import Float
#put inside pod
class Aero(Component):
"""Place holder for real aerodynamic calculations of the capsule"""
#Inputs
coef_drag = Float(1, iotype="in", desc="capsule drag coefficient")
area_capsule = Float(18000, iotype... | apache-2.0 | Python |
3f3629f72a0d1bf30ce4b2c5f71a9ccd1475ef30 | Add new dev version | LeBarbouze/tunacell | tunacell/__init__.py | tunacell/__init__.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# version to be used in setup and docs
__version__ = '0.0.9dev'
# API level classes
from tunacell.base.experiment import Experiment
from tunacell.base.observable import Observable
from tunacell.filters.main import FilterSet
from tunacell.base.parser import Parser | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# version to be used in setup and docs
__version__ = '0.0.8a1'
# API level classes
from tunacell.base.experiment import Experiment
from tunacell.base.observable import Observable
from tunacell.filters.main import FilterSet
from tunacell.base.parser import Parser | mit | Python |
0973bdd2ac4f9b1fa58bdcccde1b7add601a1232 | add utility function to verify hashes of extracted against the hashes of files in the archives. | groutr/conda-tools,groutr/conda-tools | conda_tools/cache_utils.py | conda_tools/cache_utils.py | """
Utility functions that map information from caches onto environments
"""
import os
import hashlib
from .cache import correlated_cache
from .config import config
def _linked_environments(package, environments):
""""
Determine what package is linked to which environments
This function is wrapped by ... | """
Utility functions that map information from caches onto environments
"""
import os
from .config import config
from .cache import PackageInfo
from .environment import environments
def _linked_environments(package, environments):
""""
Determine what package is linked to which environments
This functi... | bsd-3-clause | Python |
6a977c6b055d25caa74283dcdb90d3aa5547b7d7 | bump version | w1z2g3/crossbar,w1z2g3/crossbar,NinjaMSP/crossbar,w1z2g3/crossbar,erhuabushuo/crossbar,w1z2g3/crossbar,w1z2g3/crossbar,RaitoBezarius/crossbar,GoodgameStudios/crossbar,GoodgameStudios/crossbar,w1z2g3/crossbar,RaitoBezarius/crossbar,erhuabushuo/crossbar,w1z2g3/crossbar,erhuabushuo/crossbar,RaitoBezarius/crossbar,erhuabus... | crossbar/crossbar/__init__.py | crossbar/crossbar/__init__.py | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License, version 3,
## as published by the Free Software Founda... | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License, version 3,
## as published by the Free Software Founda... | agpl-3.0 | Python |
a6be60eb409e0ab3e4942844ee429c82b1928fe6 | Add wait time to allow glove to be fitted | thomasweng15/cs473-baxter-project | cs473_baxter/scripts/glove.py | cs473_baxter/scripts/glove.py | #!/usr/bin/env python
import argparse
import rospy
import baxter_interface
class Glove():
def __init__(self, gripper):
rospy.init_node("cs473_gripper")
self.gripper = baxter_interface.Gripper(gripper)
# Verify robot is enabled
print "Getting robot state..."
self._rs = baxter_interface.RobotEnable()
s... | #!/usr/bin/env python
import argparse
import rospy
import baxter_interface
class Glove():
def __init__(self, gripper):
self.gripper = Gripper(gripper)
# Verify robot is enabled
print "Getting robot state..."
self._rs = baxter_interface.RobotEnable()
self._init_state = self._rs.state().enabled
print "E... | mit | Python |
01889c2def073f12981ada43c11f5c742277ad20 | Fix server initialization import. | kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend | app/server.py | app/server.py | #!/usr/bin/env python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the ho... | #!/usr/bin/env python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the ho... | lgpl-2.1 | Python |
e7713efaebe75a66d48fb5dba262c8724d8dee11 | Add unit test for DonationsParser.get_js | Commonists/DonationsLogParser,Commonists/DonationsLogParser | test_daily_parser.py | test_daily_parser.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
from daily_parser import url_from_args, DonationsParser
class TestDailyParser(unittest.TestCase):
"""Testing methods from daily_parser."""
def test_url_from_args(self):
output = url_from_args(2014, 1)
expecte... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
from daily_parser import url_from_args, DonationsParser
class TestDailyParser(unittest.TestCase):
"""Testing methods from daily_parser."""
def test_url_from_args(self):
output = url_from_args(2014, 1)
expecte... | mit | Python |
acdb461f9a767af167a8c9218220276586f91994 | Fix #2446 | vuolter/pyload,vuolter/pyload,vuolter/pyload | module/plugins/accounts/EuroshareEu.py | module/plugins/accounts/EuroshareEu.py | # -*- coding: utf-8 -*-
import re
import time
import urlparse
from module.plugins.internal.Account import Account
from module.plugins.internal.misc import parse_html_form
class EuroshareEu(Account):
__name__ = "EuroshareEu"
__type__ = "account"
__version__ = "0.10"
__status__ = "testing"
... | # -*- coding: utf-8 -*-
import re
import time
from module.plugins.internal.Account import Account
class EuroshareEu(Account):
__name__ = "EuroshareEu"
__type__ = "account"
__version__ = "0.09"
__status__ = "testing"
__description__ = """Euroshare.eu account plugin"""
__license__ ... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.