commit
stringlengths
40
40
old_file
stringlengths
4
118
new_file
stringlengths
4
118
old_contents
stringlengths
0
2.94k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
444
message
stringlengths
16
3.45k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
5
43.2k
prompt
stringlengths
17
4.58k
response
stringlengths
1
4.43k
prompt_tagged
stringlengths
58
4.62k
response_tagged
stringlengths
1
4.43k
text
stringlengths
132
7.29k
text_tagged
stringlengths
173
7.33k
32f69883aa5c5f2a86ddd7abf93f99628de45c0c
tests/test_search_grondwaterfilter.py
tests/test_search_grondwaterfilter.py
"""Module grouping tests for the search grondwaterfilter module.""" import pydov from pydov.search.grondwaterfilter import GrondwaterFilterSearch from pydov.types.grondwaterfilter import GrondwaterFilter class TestGrondwaterFilterSearch(object): """Class grouping tests for the pydov.search.GrondwaterFilterSearch...
Add template for filter specific search tests
Add template for filter specific search tests
Python
mit
DOV-Vlaanderen/pydov
Add template for filter specific search tests
"""Module grouping tests for the search grondwaterfilter module.""" import pydov from pydov.search.grondwaterfilter import GrondwaterFilterSearch from pydov.types.grondwaterfilter import GrondwaterFilter class TestGrondwaterFilterSearch(object): """Class grouping tests for the pydov.search.GrondwaterFilterSearch...
<commit_before><commit_msg>Add template for filter specific search tests<commit_after>
"""Module grouping tests for the search grondwaterfilter module.""" import pydov from pydov.search.grondwaterfilter import GrondwaterFilterSearch from pydov.types.grondwaterfilter import GrondwaterFilter class TestGrondwaterFilterSearch(object): """Class grouping tests for the pydov.search.GrondwaterFilterSearch...
Add template for filter specific search tests"""Module grouping tests for the search grondwaterfilter module.""" import pydov from pydov.search.grondwaterfilter import GrondwaterFilterSearch from pydov.types.grondwaterfilter import GrondwaterFilter class TestGrondwaterFilterSearch(object): """Class grouping test...
<commit_before><commit_msg>Add template for filter specific search tests<commit_after>"""Module grouping tests for the search grondwaterfilter module.""" import pydov from pydov.search.grondwaterfilter import GrondwaterFilterSearch from pydov.types.grondwaterfilter import GrondwaterFilter class TestGrondwaterFilterS...
3a4903bd09cd30397ed98734ba7a92ae9cc23697
location.py
location.py
#!/usr/local/python import re import subprocess import sys def main(): latlon = subprocess.check_output(["exiftool", "-GPSLatitude", "-GPSLongitude", sys.argv[1]]) latitude = get_latitude(latlon) longitude = get_longitude(latlon) print "[%f, %f]" % (longitude, latitude) def get_latitude(latlon): lat_rege...
Add python script to take GPS EXIF data and convert for GeoJSON use.
Add python script to take GPS EXIF data and convert for GeoJSON use.
Python
mit
Tanner/Technique-Newsstands-Map
Add python script to take GPS EXIF data and convert for GeoJSON use.
#!/usr/local/python import re import subprocess import sys def main(): latlon = subprocess.check_output(["exiftool", "-GPSLatitude", "-GPSLongitude", sys.argv[1]]) latitude = get_latitude(latlon) longitude = get_longitude(latlon) print "[%f, %f]" % (longitude, latitude) def get_latitude(latlon): lat_rege...
<commit_before><commit_msg>Add python script to take GPS EXIF data and convert for GeoJSON use.<commit_after>
#!/usr/local/python import re import subprocess import sys def main(): latlon = subprocess.check_output(["exiftool", "-GPSLatitude", "-GPSLongitude", sys.argv[1]]) latitude = get_latitude(latlon) longitude = get_longitude(latlon) print "[%f, %f]" % (longitude, latitude) def get_latitude(latlon): lat_rege...
Add python script to take GPS EXIF data and convert for GeoJSON use.#!/usr/local/python import re import subprocess import sys def main(): latlon = subprocess.check_output(["exiftool", "-GPSLatitude", "-GPSLongitude", sys.argv[1]]) latitude = get_latitude(latlon) longitude = get_longitude(latlon) print "[%f...
<commit_before><commit_msg>Add python script to take GPS EXIF data and convert for GeoJSON use.<commit_after>#!/usr/local/python import re import subprocess import sys def main(): latlon = subprocess.check_output(["exiftool", "-GPSLatitude", "-GPSLongitude", sys.argv[1]]) latitude = get_latitude(latlon) longit...
f0f22d018d5dae1a362512da1f8e5290ac755795
examples/python/forum/router_spin.py
examples/python/forum/router_spin.py
import random import json import tornado.ioloop import tornado.httpclient http_client = tornado.httpclient.AsyncHTTPClient() schema_json = json.load(open('example_forum_sharded.json')) schema_json['name'] = 'example_forum' # set the datastore id schema_json['datastores'][0]['datastore']['_id'] = 54 @tornado.gen.co...
Add database provision test script
Add database provision test script This just constantly adds/removes (at random) the database to ensure it doesn't cause problems
Python
mit
jacksontj/dataman
Add database provision test script This just constantly adds/removes (at random) the database to ensure it doesn't cause problems
import random import json import tornado.ioloop import tornado.httpclient http_client = tornado.httpclient.AsyncHTTPClient() schema_json = json.load(open('example_forum_sharded.json')) schema_json['name'] = 'example_forum' # set the datastore id schema_json['datastores'][0]['datastore']['_id'] = 54 @tornado.gen.co...
<commit_before><commit_msg>Add database provision test script This just constantly adds/removes (at random) the database to ensure it doesn't cause problems<commit_after>
import random import json import tornado.ioloop import tornado.httpclient http_client = tornado.httpclient.AsyncHTTPClient() schema_json = json.load(open('example_forum_sharded.json')) schema_json['name'] = 'example_forum' # set the datastore id schema_json['datastores'][0]['datastore']['_id'] = 54 @tornado.gen.co...
Add database provision test script This just constantly adds/removes (at random) the database to ensure it doesn't cause problemsimport random import json import tornado.ioloop import tornado.httpclient http_client = tornado.httpclient.AsyncHTTPClient() schema_json = json.load(open('example_forum_sharded.json')) sc...
<commit_before><commit_msg>Add database provision test script This just constantly adds/removes (at random) the database to ensure it doesn't cause problems<commit_after>import random import json import tornado.ioloop import tornado.httpclient http_client = tornado.httpclient.AsyncHTTPClient() schema_json = json.lo...
c95d472bf5ef9746521cf54c83bb61333c3eafcd
tests/test_eb/test_eb.py
tests/test_eb/test_eb.py
import boto3 from moto import mock_eb @mock_eb def test_application(): # Create Elastic Beanstalk Application eb_client = boto3.client('elasticbeanstalk', region_name='us-east-1') eb_client.create_application( ApplicationName="myapp", ) eb_apps = eb_client.describe_applications() eb_...
Add (failing) test for ElasticBeanstalk
Add (failing) test for ElasticBeanstalk
Python
apache-2.0
william-richard/moto,spulec/moto,william-richard/moto,spulec/moto,william-richard/moto,spulec/moto,spulec/moto,william-richard/moto,william-richard/moto,spulec/moto,william-richard/moto,spulec/moto
Add (failing) test for ElasticBeanstalk
import boto3 from moto import mock_eb @mock_eb def test_application(): # Create Elastic Beanstalk Application eb_client = boto3.client('elasticbeanstalk', region_name='us-east-1') eb_client.create_application( ApplicationName="myapp", ) eb_apps = eb_client.describe_applications() eb_...
<commit_before><commit_msg>Add (failing) test for ElasticBeanstalk<commit_after>
import boto3 from moto import mock_eb @mock_eb def test_application(): # Create Elastic Beanstalk Application eb_client = boto3.client('elasticbeanstalk', region_name='us-east-1') eb_client.create_application( ApplicationName="myapp", ) eb_apps = eb_client.describe_applications() eb_...
Add (failing) test for ElasticBeanstalkimport boto3 from moto import mock_eb @mock_eb def test_application(): # Create Elastic Beanstalk Application eb_client = boto3.client('elasticbeanstalk', region_name='us-east-1') eb_client.create_application( ApplicationName="myapp", ) eb_apps = eb...
<commit_before><commit_msg>Add (failing) test for ElasticBeanstalk<commit_after>import boto3 from moto import mock_eb @mock_eb def test_application(): # Create Elastic Beanstalk Application eb_client = boto3.client('elasticbeanstalk', region_name='us-east-1') eb_client.create_application( Applica...
45db81042b58c72da04193cdcdc6d400b5370c18
convert_quotes_json_to_sqlite.py
convert_quotes_json_to_sqlite.py
#!/usr/bin/env python3 # Convert legacy JSON quotes format to SQLite3 format # It non-destructively reads in "quotes.json" # and writes out a new file "quotes.sqlite3". # It will prompt if "quotes.sqlite3" exists # and will ask if you want to merge the quotes. # "quotes.sqlite3" modifications will not be committed un...
Add conversion script for quotes database
Add conversion script for quotes database Figured I'd keep this around for a while just in case. Maybe remove it in some future cleanup and declare the old format dead.
Python
mit
TAOTheCrab/CrabBot
Add conversion script for quotes database Figured I'd keep this around for a while just in case. Maybe remove it in some future cleanup and declare the old format dead.
#!/usr/bin/env python3 # Convert legacy JSON quotes format to SQLite3 format # It non-destructively reads in "quotes.json" # and writes out a new file "quotes.sqlite3". # It will prompt if "quotes.sqlite3" exists # and will ask if you want to merge the quotes. # "quotes.sqlite3" modifications will not be committed un...
<commit_before><commit_msg>Add conversion script for quotes database Figured I'd keep this around for a while just in case. Maybe remove it in some future cleanup and declare the old format dead.<commit_after>
#!/usr/bin/env python3 # Convert legacy JSON quotes format to SQLite3 format # It non-destructively reads in "quotes.json" # and writes out a new file "quotes.sqlite3". # It will prompt if "quotes.sqlite3" exists # and will ask if you want to merge the quotes. # "quotes.sqlite3" modifications will not be committed un...
Add conversion script for quotes database Figured I'd keep this around for a while just in case. Maybe remove it in some future cleanup and declare the old format dead.#!/usr/bin/env python3 # Convert legacy JSON quotes format to SQLite3 format # It non-destructively reads in "quotes.json" # and writes out a new fil...
<commit_before><commit_msg>Add conversion script for quotes database Figured I'd keep this around for a while just in case. Maybe remove it in some future cleanup and declare the old format dead.<commit_after>#!/usr/bin/env python3 # Convert legacy JSON quotes format to SQLite3 format # It non-destructively reads in...
e0d1c88b8bc37160b93f8a99ee89702a153e803f
testtest/test_allgood.py
testtest/test_allgood.py
# -*- encoding: utf-8 -*- """ """ import unittest import time DELAY = 0.25 class Case1(unittest.TestCase): def test_success(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success1(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success2(self): ...
Add more example in testtest/
Add more example in testtest/
Python
bsd-2-clause
nicolasdespres/hunittest
Add more example in testtest/
# -*- encoding: utf-8 -*- """ """ import unittest import time DELAY = 0.25 class Case1(unittest.TestCase): def test_success(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success1(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success2(self): ...
<commit_before><commit_msg>Add more example in testtest/<commit_after>
# -*- encoding: utf-8 -*- """ """ import unittest import time DELAY = 0.25 class Case1(unittest.TestCase): def test_success(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success1(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success2(self): ...
Add more example in testtest/# -*- encoding: utf-8 -*- """ """ import unittest import time DELAY = 0.25 class Case1(unittest.TestCase): def test_success(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success1(self): time.sleep(DELAY) self.assertEqual(1, 1) de...
<commit_before><commit_msg>Add more example in testtest/<commit_after># -*- encoding: utf-8 -*- """ """ import unittest import time DELAY = 0.25 class Case1(unittest.TestCase): def test_success(self): time.sleep(DELAY) self.assertEqual(1, 1) def test_success1(self): time.sleep(DELA...
a8129cfb7544c5b2f021f8258462ec3b7933b38f
resources/middlewares/body_checker.py
resources/middlewares/body_checker.py
import json import sys import falcon def body_checker(required_params=(), documentation_link=None): def hook(req, resp, resource, params): if req.content_length in (None, 0, ): raise falcon.HTTPBadRequest('Bad request', 'В запросе деолжны быть парамет...
Add util for parsing required params from body.
Add util for parsing required params from body.
Python
cc0-1.0
sketchturnerr/WaifuSim-backend,sketchturnerr/WaifuSim-backend
Add util for parsing required params from body.
import json import sys import falcon def body_checker(required_params=(), documentation_link=None): def hook(req, resp, resource, params): if req.content_length in (None, 0, ): raise falcon.HTTPBadRequest('Bad request', 'В запросе деолжны быть парамет...
<commit_before><commit_msg>Add util for parsing required params from body.<commit_after>
import json import sys import falcon def body_checker(required_params=(), documentation_link=None): def hook(req, resp, resource, params): if req.content_length in (None, 0, ): raise falcon.HTTPBadRequest('Bad request', 'В запросе деолжны быть парамет...
Add util for parsing required params from body.import json import sys import falcon def body_checker(required_params=(), documentation_link=None): def hook(req, resp, resource, params): if req.content_length in (None, 0, ): raise falcon.HTTPBadRequest('Bad request', ...
<commit_before><commit_msg>Add util for parsing required params from body.<commit_after>import json import sys import falcon def body_checker(required_params=(), documentation_link=None): def hook(req, resp, resource, params): if req.content_length in (None, 0, ): raise falcon.HTTPBadReques...
9f0e850f30e9b9c11526054de00a460f0da1b359
website/tests/helpers/test_filters.py
website/tests/helpers/test_filters.py
import pytest import helpers.filters as filters class Model: def __init__(self, value): self.value = value def test_select_filter(): test_objects = [ Model('a'), Model('a'), Model('b'), Model('b'), Model('c'), ] tested_filter = filters.Filter( ...
Add basic tests for filters
Add basic tests for filters
Python
lgpl-2.1
reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualis...
Add basic tests for filters
import pytest import helpers.filters as filters class Model: def __init__(self, value): self.value = value def test_select_filter(): test_objects = [ Model('a'), Model('a'), Model('b'), Model('b'), Model('c'), ] tested_filter = filters.Filter( ...
<commit_before><commit_msg>Add basic tests for filters<commit_after>
import pytest import helpers.filters as filters class Model: def __init__(self, value): self.value = value def test_select_filter(): test_objects = [ Model('a'), Model('a'), Model('b'), Model('b'), Model('c'), ] tested_filter = filters.Filter( ...
Add basic tests for filtersimport pytest import helpers.filters as filters class Model: def __init__(self, value): self.value = value def test_select_filter(): test_objects = [ Model('a'), Model('a'), Model('b'), Model('b'), Model('c'), ] tested_fil...
<commit_before><commit_msg>Add basic tests for filters<commit_after>import pytest import helpers.filters as filters class Model: def __init__(self, value): self.value = value def test_select_filter(): test_objects = [ Model('a'), Model('a'), Model('b'), Model('b'), ...
7576d66b34ea01b336daa7750a1b45a077e15bb2
faker/providers/internet/uk_UA/__init__.py
faker/providers/internet/uk_UA/__init__.py
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as InternetProvider class Provider(InternetProvider): free_email_domains = [ 'email.ua', 'gmail.com', 'gov.ua', 'i.ua', 'meta.ua', 'ukr.net' ] tlds = ['com', 'info', 'net', 'org', 'ua', 'укр']
Add a Ukrainian Internet provider
Add a Ukrainian Internet provider
Python
mit
joke2k/faker,trtd/faker,danhuss/faker,joke2k/faker
Add a Ukrainian Internet provider
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as InternetProvider class Provider(InternetProvider): free_email_domains = [ 'email.ua', 'gmail.com', 'gov.ua', 'i.ua', 'meta.ua', 'ukr.net' ] tlds = ['com', 'info', 'net', 'org', 'ua', 'укр']
<commit_before><commit_msg>Add a Ukrainian Internet provider<commit_after>
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as InternetProvider class Provider(InternetProvider): free_email_domains = [ 'email.ua', 'gmail.com', 'gov.ua', 'i.ua', 'meta.ua', 'ukr.net' ] tlds = ['com', 'info', 'net', 'org', 'ua', 'укр']
Add a Ukrainian Internet provider# coding=utf-8 from __future__ import unicode_literals from .. import Provider as InternetProvider class Provider(InternetProvider): free_email_domains = [ 'email.ua', 'gmail.com', 'gov.ua', 'i.ua', 'meta.ua', 'ukr.net' ] tlds = ['com', 'info', 'net', 'org', 'ua',...
<commit_before><commit_msg>Add a Ukrainian Internet provider<commit_after># coding=utf-8 from __future__ import unicode_literals from .. import Provider as InternetProvider class Provider(InternetProvider): free_email_domains = [ 'email.ua', 'gmail.com', 'gov.ua', 'i.ua', 'meta.ua', 'ukr.net' ] t...
5d665d1511dbef99bbfca6ce735c0db927b0a8b4
randomize-music.py
randomize-music.py
#!/usr/bin/env python import os import subprocess import sys import uuid if __name__ == '__main__': dir_name = sys.argv[1] for file_name in os.listdir(dir_name): rand_name = uuid.uuid4().hex src = os.path.join(dir_name, file_name) subprocess.check_call(['eyeD3', '--artist', rand_name,...
Add script that randomly shuffles a list of songs
Add script that randomly shuffles a list of songs
Python
mit
cataliniacob/misc,cataliniacob/misc
Add script that randomly shuffles a list of songs
#!/usr/bin/env python import os import subprocess import sys import uuid if __name__ == '__main__': dir_name = sys.argv[1] for file_name in os.listdir(dir_name): rand_name = uuid.uuid4().hex src = os.path.join(dir_name, file_name) subprocess.check_call(['eyeD3', '--artist', rand_name,...
<commit_before><commit_msg>Add script that randomly shuffles a list of songs<commit_after>
#!/usr/bin/env python import os import subprocess import sys import uuid if __name__ == '__main__': dir_name = sys.argv[1] for file_name in os.listdir(dir_name): rand_name = uuid.uuid4().hex src = os.path.join(dir_name, file_name) subprocess.check_call(['eyeD3', '--artist', rand_name,...
Add script that randomly shuffles a list of songs#!/usr/bin/env python import os import subprocess import sys import uuid if __name__ == '__main__': dir_name = sys.argv[1] for file_name in os.listdir(dir_name): rand_name = uuid.uuid4().hex src = os.path.join(dir_name, file_name) subpr...
<commit_before><commit_msg>Add script that randomly shuffles a list of songs<commit_after>#!/usr/bin/env python import os import subprocess import sys import uuid if __name__ == '__main__': dir_name = sys.argv[1] for file_name in os.listdir(dir_name): rand_name = uuid.uuid4().hex src = os.pat...
e3e8515de67dd2971385b98fa9276dc54c1e7f4b
perftest.py
perftest.py
""" Simple peformance tests. """ import sys import time import couchdb def main(): print 'sys.version : %r' % (sys.version,) print 'sys.platform : %r' % (sys.platform,) tests = [create_doc, create_bulk_docs] if len(sys.argv) > 1: tests = [test for test in tests if test.__name__ in sys.argv...
Add a very simple performance testing tool.
Add a very simple performance testing tool.
Python
bsd-3-clause
zielmicha/couchdb-python
Add a very simple performance testing tool.
""" Simple peformance tests. """ import sys import time import couchdb def main(): print 'sys.version : %r' % (sys.version,) print 'sys.platform : %r' % (sys.platform,) tests = [create_doc, create_bulk_docs] if len(sys.argv) > 1: tests = [test for test in tests if test.__name__ in sys.argv...
<commit_before><commit_msg>Add a very simple performance testing tool.<commit_after>
""" Simple peformance tests. """ import sys import time import couchdb def main(): print 'sys.version : %r' % (sys.version,) print 'sys.platform : %r' % (sys.platform,) tests = [create_doc, create_bulk_docs] if len(sys.argv) > 1: tests = [test for test in tests if test.__name__ in sys.argv...
Add a very simple performance testing tool.""" Simple peformance tests. """ import sys import time import couchdb def main(): print 'sys.version : %r' % (sys.version,) print 'sys.platform : %r' % (sys.platform,) tests = [create_doc, create_bulk_docs] if len(sys.argv) > 1: tests = [test for...
<commit_before><commit_msg>Add a very simple performance testing tool.<commit_after>""" Simple peformance tests. """ import sys import time import couchdb def main(): print 'sys.version : %r' % (sys.version,) print 'sys.platform : %r' % (sys.platform,) tests = [create_doc, create_bulk_docs] if len...
5b94b839d7aa4e27581874a92d01618ab2c24a79
manoseimas/mps_v2/migrations/0009_auto_20150606_1619.py
manoseimas/mps_v2/migrations/0009_auto_20150606_1619.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mps_v2', '0008_groupranking_mpranking'), ] operations = [ migrations.AlterField( model_name='groupmembership', ...
Add a redundant migration that changes related_name for GroupMembership.
Add a redundant migration that changes related_name for GroupMembership.
Python
agpl-3.0
ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt
Add a redundant migration that changes related_name for GroupMembership.
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mps_v2', '0008_groupranking_mpranking'), ] operations = [ migrations.AlterField( model_name='groupmembership', ...
<commit_before><commit_msg>Add a redundant migration that changes related_name for GroupMembership.<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mps_v2', '0008_groupranking_mpranking'), ] operations = [ migrations.AlterField( model_name='groupmembership', ...
Add a redundant migration that changes related_name for GroupMembership.# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mps_v2', '0008_groupranking_mpranking'), ] operations = [ ...
<commit_before><commit_msg>Add a redundant migration that changes related_name for GroupMembership.<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mps_v2', '0008_groupranking_...
10169d66c91360f562367a00002bac23ec036719
src/sidecar/connection.py
src/sidecar/connection.py
# -*- coding: utf-8 -*- import json import logging import os from sockjs.tornado import SockJSRouter, SockJSConnection from tornado.web import RequestHandler, StaticFileHandler from tornado.web import Application from tornado.ioloop import IOLoop from sidecar.utils import log class WebHandler(RequestHandler): d...
Add basic SockJS server implementation
Add basic SockJS server implementation
Python
apache-2.0
aldanor/sidecar,aldanor/sidecar,aldanor/sidecar
Add basic SockJS server implementation
# -*- coding: utf-8 -*- import json import logging import os from sockjs.tornado import SockJSRouter, SockJSConnection from tornado.web import RequestHandler, StaticFileHandler from tornado.web import Application from tornado.ioloop import IOLoop from sidecar.utils import log class WebHandler(RequestHandler): d...
<commit_before><commit_msg>Add basic SockJS server implementation<commit_after>
# -*- coding: utf-8 -*- import json import logging import os from sockjs.tornado import SockJSRouter, SockJSConnection from tornado.web import RequestHandler, StaticFileHandler from tornado.web import Application from tornado.ioloop import IOLoop from sidecar.utils import log class WebHandler(RequestHandler): d...
Add basic SockJS server implementation# -*- coding: utf-8 -*- import json import logging import os from sockjs.tornado import SockJSRouter, SockJSConnection from tornado.web import RequestHandler, StaticFileHandler from tornado.web import Application from tornado.ioloop import IOLoop from sidecar.utils import log c...
<commit_before><commit_msg>Add basic SockJS server implementation<commit_after># -*- coding: utf-8 -*- import json import logging import os from sockjs.tornado import SockJSRouter, SockJSConnection from tornado.web import RequestHandler, StaticFileHandler from tornado.web import Application from tornado.ioloop import ...
3b32c08772f06046723352731def8cbb5a59263f
scripts/wav2raw.py
scripts/wav2raw.py
#!/usr/bin/env python from array import array import wave import argparse import struct import os def main(): parser = argparse.ArgumentParser( description='Converts input image to raw image and palette data.') parser.add_argument('-f', '--force', action='store_true', help='If output files exist, the...
Convert WAV files to format digestible by Amiga.
Convert WAV files to format digestible by Amiga.
Python
artistic-2.0
cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene
Convert WAV files to format digestible by Amiga.
#!/usr/bin/env python from array import array import wave import argparse import struct import os def main(): parser = argparse.ArgumentParser( description='Converts input image to raw image and palette data.') parser.add_argument('-f', '--force', action='store_true', help='If output files exist, the...
<commit_before><commit_msg>Convert WAV files to format digestible by Amiga.<commit_after>
#!/usr/bin/env python from array import array import wave import argparse import struct import os def main(): parser = argparse.ArgumentParser( description='Converts input image to raw image and palette data.') parser.add_argument('-f', '--force', action='store_true', help='If output files exist, the...
Convert WAV files to format digestible by Amiga.#!/usr/bin/env python from array import array import wave import argparse import struct import os def main(): parser = argparse.ArgumentParser( description='Converts input image to raw image and palette data.') parser.add_argument('-f', '--force', action='sto...
<commit_before><commit_msg>Convert WAV files to format digestible by Amiga.<commit_after>#!/usr/bin/env python from array import array import wave import argparse import struct import os def main(): parser = argparse.ArgumentParser( description='Converts input image to raw image and palette data.') parser....
a79273430fd3f3a4629cfdba6a5db119a3b2c3ba
lintcode/Medium/106_Convert_Sorted_List_to_Balanced_BST.py
lintcode/Medium/106_Convert_Sorted_List_to_Balanced_BST.py
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ class Solution: """ @param head:...
Add solution to lintcode question 106
Add solution to lintcode question 106
Python
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
Add solution to lintcode question 106
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ class Solution: """ @param head:...
<commit_before><commit_msg>Add solution to lintcode question 106<commit_after>
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ class Solution: """ @param head:...
Add solution to lintcode question 106""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ cla...
<commit_before><commit_msg>Add solution to lintcode question 106<commit_after>""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val s...
d290665b9ca99a9748e0935645afa3a56f76fea4
python/getmonotime.py
python/getmonotime.py
import getopt, sys if __name__ == '__main__': sippy_path = None try: opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b') except getopt.GetoptError: usage() for o, a in opts: if o == '-S': sippy_path = a.strip() continue if sippy_path != None: ...
Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters to aid debugging.
Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters to aid debugging.
Python
bsd-2-clause
sippy/b2bua,sippy/b2bua
Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters to aid debugging.
import getopt, sys if __name__ == '__main__': sippy_path = None try: opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b') except getopt.GetoptError: usage() for o, a in opts: if o == '-S': sippy_path = a.strip() continue if sippy_path != None: ...
<commit_before><commit_msg>Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters to aid debugging.<commit_after>
import getopt, sys if __name__ == '__main__': sippy_path = None try: opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b') except getopt.GetoptError: usage() for o, a in opts: if o == '-S': sippy_path = a.strip() continue if sippy_path != None: ...
Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters to aid debugging.import getopt, sys if __name__ == '__main__': sippy_path = None try: opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b') except getopt.GetoptError: usage() for o, a in opts: if o == '-S': ...
<commit_before><commit_msg>Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters to aid debugging.<commit_after>import getopt, sys if __name__ == '__main__': sippy_path = None try: opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b') except getopt.GetoptError: usage() for...
41c99eb2c186082869396c19e0ada2b9f3d0cee2
scripts/util/afos2flatfile.py
scripts/util/afos2flatfile.py
""" Dump what I have stored in the AFOS database to flat files """ import psycopg2 pgconn = psycopg2.connect(database='afos', host='iemdb', user='nobody') cursor = pgconn.cursor() import datetime import subprocess pils = "LSR|FWW|CFW|TCV|RFW|FFA|SVR|TOR|SVS|SMW|MWS|NPW|WCN|WSW|EWW|FLS|FLW|SPS|SEL|SWO|FFW" def saniti...
Add util to dump out archived noaaport files
Add util to dump out archived noaaport files
Python
mit
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
Add util to dump out archived noaaport files
""" Dump what I have stored in the AFOS database to flat files """ import psycopg2 pgconn = psycopg2.connect(database='afos', host='iemdb', user='nobody') cursor = pgconn.cursor() import datetime import subprocess pils = "LSR|FWW|CFW|TCV|RFW|FFA|SVR|TOR|SVS|SMW|MWS|NPW|WCN|WSW|EWW|FLS|FLW|SPS|SEL|SWO|FFW" def saniti...
<commit_before><commit_msg>Add util to dump out archived noaaport files<commit_after>
""" Dump what I have stored in the AFOS database to flat files """ import psycopg2 pgconn = psycopg2.connect(database='afos', host='iemdb', user='nobody') cursor = pgconn.cursor() import datetime import subprocess pils = "LSR|FWW|CFW|TCV|RFW|FFA|SVR|TOR|SVS|SMW|MWS|NPW|WCN|WSW|EWW|FLS|FLW|SPS|SEL|SWO|FFW" def saniti...
Add util to dump out archived noaaport files""" Dump what I have stored in the AFOS database to flat files """ import psycopg2 pgconn = psycopg2.connect(database='afos', host='iemdb', user='nobody') cursor = pgconn.cursor() import datetime import subprocess pils = "LSR|FWW|CFW|TCV|RFW|FFA|SVR|TOR|SVS|SMW|MWS|NPW|WCN|...
<commit_before><commit_msg>Add util to dump out archived noaaport files<commit_after>""" Dump what I have stored in the AFOS database to flat files """ import psycopg2 pgconn = psycopg2.connect(database='afos', host='iemdb', user='nobody') cursor = pgconn.cursor() import datetime import subprocess pils = "LSR|FWW|CFW...
c0d98d5fe5b095dcbe6f01050f7e0addc2b950e8
senlin/tests/tempest/api/clusters/test_cluster_delete_negative.py
senlin/tests/tempest/api/clusters/test_cluster_delete_negative.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Add negative tempest API test for cluster_delete
Add negative tempest API test for cluster_delete This patch adds negative tempest API test for cluster_delete for failure cases of 404(NotFound) and 409(Conflict). Change-Id: I5e0d917499fe897d0c8b46a8b323c9606db545e5
Python
apache-2.0
stackforge/senlin,openstack/senlin,openstack/senlin,openstack/senlin,stackforge/senlin
Add negative tempest API test for cluster_delete This patch adds negative tempest API test for cluster_delete for failure cases of 404(NotFound) and 409(Conflict). Change-Id: I5e0d917499fe897d0c8b46a8b323c9606db545e5
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
<commit_before><commit_msg>Add negative tempest API test for cluster_delete This patch adds negative tempest API test for cluster_delete for failure cases of 404(NotFound) and 409(Conflict). Change-Id: I5e0d917499fe897d0c8b46a8b323c9606db545e5<commit_after>
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Add negative tempest API test for cluster_delete This patch adds negative tempest API test for cluster_delete for failure cases of 404(NotFound) and 409(Conflict). Change-Id: I5e0d917499fe897d0c8b46a8b323c9606db545e5# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except i...
<commit_before><commit_msg>Add negative tempest API test for cluster_delete This patch adds negative tempest API test for cluster_delete for failure cases of 404(NotFound) and 409(Conflict). Change-Id: I5e0d917499fe897d0c8b46a8b323c9606db545e5<commit_after># Licensed under the Apache License, Version 2.0 (the "Licens...
22b897c20ac63a6aea4383f4a4378bca1c3688b2
scripts/spectral-graph-display.py
scripts/spectral-graph-display.py
import numpy as np from scipy import io, sparse, linalg # run this from elegant scipy chapter chem = np.load('chem-network.npy') gap = np.load('gap-network.npy') neuron_types = np.load('neuron-types.npy') neuron_ids = np.load('neurons.npy') A = chem + gap n = A.shape[0] c = (A + A.T) / 2 d = sparse.diags([np.sum(c, ax...
Add script to generate spectral graph
Add script to generate spectral graph This script assumes several data files adapted from http://www.ifp.illinois.edu/~varshney/elegans/ It uses dense matrices and so is unsuitable for large datasets.
Python
mit
jni/spectral-graphs
Add script to generate spectral graph This script assumes several data files adapted from http://www.ifp.illinois.edu/~varshney/elegans/ It uses dense matrices and so is unsuitable for large datasets.
import numpy as np from scipy import io, sparse, linalg # run this from elegant scipy chapter chem = np.load('chem-network.npy') gap = np.load('gap-network.npy') neuron_types = np.load('neuron-types.npy') neuron_ids = np.load('neurons.npy') A = chem + gap n = A.shape[0] c = (A + A.T) / 2 d = sparse.diags([np.sum(c, ax...
<commit_before><commit_msg>Add script to generate spectral graph This script assumes several data files adapted from http://www.ifp.illinois.edu/~varshney/elegans/ It uses dense matrices and so is unsuitable for large datasets.<commit_after>
import numpy as np from scipy import io, sparse, linalg # run this from elegant scipy chapter chem = np.load('chem-network.npy') gap = np.load('gap-network.npy') neuron_types = np.load('neuron-types.npy') neuron_ids = np.load('neurons.npy') A = chem + gap n = A.shape[0] c = (A + A.T) / 2 d = sparse.diags([np.sum(c, ax...
Add script to generate spectral graph This script assumes several data files adapted from http://www.ifp.illinois.edu/~varshney/elegans/ It uses dense matrices and so is unsuitable for large datasets.import numpy as np from scipy import io, sparse, linalg # run this from elegant scipy chapter chem = np.load('chem-ne...
<commit_before><commit_msg>Add script to generate spectral graph This script assumes several data files adapted from http://www.ifp.illinois.edu/~varshney/elegans/ It uses dense matrices and so is unsuitable for large datasets.<commit_after>import numpy as np from scipy import io, sparse, linalg # run this from elega...
162a0cf6f19878f20bd6a7c92aeff2eac2a240c3
tests/CYK/OneRuleTest.py
tests/CYK/OneRuleTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 14:51 :Licence GNUv3 Part of pyparsers """ from unittest import main, TestCase from grammpy import * from pyparsers import cyk class S(Nonterminal): pass class R(Rule): rule=([S], [0, 1]) class OneRuleTest(TestCase): def __init__(self, meth...
Add test of cyk for one rule
Add test of cyk for one rule
Python
mit
PatrikValkovic/grammpy
Add test of cyk for one rule
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 14:51 :Licence GNUv3 Part of pyparsers """ from unittest import main, TestCase from grammpy import * from pyparsers import cyk class S(Nonterminal): pass class R(Rule): rule=([S], [0, 1]) class OneRuleTest(TestCase): def __init__(self, meth...
<commit_before><commit_msg>Add test of cyk for one rule<commit_after>
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 14:51 :Licence GNUv3 Part of pyparsers """ from unittest import main, TestCase from grammpy import * from pyparsers import cyk class S(Nonterminal): pass class R(Rule): rule=([S], [0, 1]) class OneRuleTest(TestCase): def __init__(self, meth...
Add test of cyk for one rule#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 14:51 :Licence GNUv3 Part of pyparsers """ from unittest import main, TestCase from grammpy import * from pyparsers import cyk class S(Nonterminal): pass class R(Rule): rule=([S], [0, 1]) class OneRuleTest(TestCase):...
<commit_before><commit_msg>Add test of cyk for one rule<commit_after>#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 14:51 :Licence GNUv3 Part of pyparsers """ from unittest import main, TestCase from grammpy import * from pyparsers import cyk class S(Nonterminal): pass class R(Rule): rule=([S...
f4812deb2bdba677d77b35ad3a97a9367166f5c2
polling_stations/apps/data_collection/management/commands/import_kingston.py
polling_stations/apps/data_collection/management/commands/import_kingston.py
""" Imports Kingston """ import sys from django.contrib.gis.geos import Point, GEOSGeometry from data_collection.management.commands import BaseKamlImporter class Command(BaseKamlImporter): """ Imports the Polling Station data from Kingston Council """ council_id = 'E09000021' districts_name ...
Add import script for Kingston
Add import script for Kingston
Python
bsd-3-clause
chris48s/UK-Polling-Stations,andylolz/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,andylolz/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,andylolz/UK-Polling-Stations,chris48s/UK-Polling-Stations
Add import script for Kingston
""" Imports Kingston """ import sys from django.contrib.gis.geos import Point, GEOSGeometry from data_collection.management.commands import BaseKamlImporter class Command(BaseKamlImporter): """ Imports the Polling Station data from Kingston Council """ council_id = 'E09000021' districts_name ...
<commit_before><commit_msg>Add import script for Kingston<commit_after>
""" Imports Kingston """ import sys from django.contrib.gis.geos import Point, GEOSGeometry from data_collection.management.commands import BaseKamlImporter class Command(BaseKamlImporter): """ Imports the Polling Station data from Kingston Council """ council_id = 'E09000021' districts_name ...
Add import script for Kingston""" Imports Kingston """ import sys from django.contrib.gis.geos import Point, GEOSGeometry from data_collection.management.commands import BaseKamlImporter class Command(BaseKamlImporter): """ Imports the Polling Station data from Kingston Council """ council_id = '...
<commit_before><commit_msg>Add import script for Kingston<commit_after>""" Imports Kingston """ import sys from django.contrib.gis.geos import Point, GEOSGeometry from data_collection.management.commands import BaseKamlImporter class Command(BaseKamlImporter): """ Imports the Polling Station data from Kingst...
35d34a9fe3bb12cc42ed9c91331687eff883a378
remove-deprecated-json.py
remove-deprecated-json.py
#!/usr/bin/python import argparse import json import sys def main(): ap = argparse.ArgumentParser() ap.add_argument( 'infile', type=argparse.FileType('r'), help='01.org style json to remove deprecrated events from') ap.add_argument( 'outfile', nargs='?', type=argparse.FileTyp...
Add tool to create a json with deprecated events removed
Add tool to create a json with deprecated events removed The new tool takes an input json filename and an optional output filename (default is stdout) and writes the input to the output removing any events that have a "Deprecated":"1".
Python
bsd-3-clause
intel/event-converter-for-linux-perf,intel/event-converter-for-linux-perf
Add tool to create a json with deprecated events removed The new tool takes an input json filename and an optional output filename (default is stdout) and writes the input to the output removing any events that have a "Deprecated":"1".
#!/usr/bin/python import argparse import json import sys def main(): ap = argparse.ArgumentParser() ap.add_argument( 'infile', type=argparse.FileType('r'), help='01.org style json to remove deprecrated events from') ap.add_argument( 'outfile', nargs='?', type=argparse.FileTyp...
<commit_before><commit_msg>Add tool to create a json with deprecated events removed The new tool takes an input json filename and an optional output filename (default is stdout) and writes the input to the output removing any events that have a "Deprecated":"1".<commit_after>
#!/usr/bin/python import argparse import json import sys def main(): ap = argparse.ArgumentParser() ap.add_argument( 'infile', type=argparse.FileType('r'), help='01.org style json to remove deprecrated events from') ap.add_argument( 'outfile', nargs='?', type=argparse.FileTyp...
Add tool to create a json with deprecated events removed The new tool takes an input json filename and an optional output filename (default is stdout) and writes the input to the output removing any events that have a "Deprecated":"1".#!/usr/bin/python import argparse import json import sys def main(): ap = argpar...
<commit_before><commit_msg>Add tool to create a json with deprecated events removed The new tool takes an input json filename and an optional output filename (default is stdout) and writes the input to the output removing any events that have a "Deprecated":"1".<commit_after>#!/usr/bin/python import argparse import j...
47f6859fa11f7cc02f340e96567a0a4a78310b42
whats_fresh/whats_fresh_api/migrations/0002_auto_20141120_2246.py
whats_fresh/whats_fresh_api/migrations/0002_auto_20141120_2246.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.contrib.auth.models import Group def create_group(apps, schema_editor): if Group.objects.filter(name='Data Entry Users').exists(): return else: group = Group.objects.create(name...
Add default group data migration
Add default group data migration refs #17433
Python
apache-2.0
osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api
Add default group data migration refs #17433
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.contrib.auth.models import Group def create_group(apps, schema_editor): if Group.objects.filter(name='Data Entry Users').exists(): return else: group = Group.objects.create(name...
<commit_before><commit_msg>Add default group data migration refs #17433<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.contrib.auth.models import Group def create_group(apps, schema_editor): if Group.objects.filter(name='Data Entry Users').exists(): return else: group = Group.objects.create(name...
Add default group data migration refs #17433# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.contrib.auth.models import Group def create_group(apps, schema_editor): if Group.objects.filter(name='Data Entry Users').exists(): return el...
<commit_before><commit_msg>Add default group data migration refs #17433<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.contrib.auth.models import Group def create_group(apps, schema_editor): if Group.objects.filter(name='Data Entr...
ac7a9cc262890976cefd0c83551f6ea7e2a0e6a3
tests/test_endpoints_check.py
tests/test_endpoints_check.py
# -*- coding: utf-8 -*- import os import sshrc.endpoints.check def test_mainfunc_ok(cliargs_default, templater, mock_get_content): mock_get_content.return_value = """\ Compression yes Host q HostName e Host b HostName lalala """ main = sshrc.endpoints.common.main(sshrc.endpoints.chec...
Add unittests for check app
Add unittests for check app
Python
mit
9seconds/concierge,9seconds/sshrc
Add unittests for check app
# -*- coding: utf-8 -*- import os import sshrc.endpoints.check def test_mainfunc_ok(cliargs_default, templater, mock_get_content): mock_get_content.return_value = """\ Compression yes Host q HostName e Host b HostName lalala """ main = sshrc.endpoints.common.main(sshrc.endpoints.chec...
<commit_before><commit_msg>Add unittests for check app<commit_after>
# -*- coding: utf-8 -*- import os import sshrc.endpoints.check def test_mainfunc_ok(cliargs_default, templater, mock_get_content): mock_get_content.return_value = """\ Compression yes Host q HostName e Host b HostName lalala """ main = sshrc.endpoints.common.main(sshrc.endpoints.chec...
Add unittests for check app# -*- coding: utf-8 -*- import os import sshrc.endpoints.check def test_mainfunc_ok(cliargs_default, templater, mock_get_content): mock_get_content.return_value = """\ Compression yes Host q HostName e Host b HostName lalala """ main = sshrc.endpoints.commo...
<commit_before><commit_msg>Add unittests for check app<commit_after># -*- coding: utf-8 -*- import os import sshrc.endpoints.check def test_mainfunc_ok(cliargs_default, templater, mock_get_content): mock_get_content.return_value = """\ Compression yes Host q HostName e Host b HostName lalala ...
2cf1b0c8080864a46ede994ece3211c1a4a35db6
tools/testr_to_stestr.py
tools/testr_to_stestr.py
#!/usr/bin/env python import os import sys import six if not os.path.isfile('.testr.conf'): print("Testr config file not found") sys.exit(1) testr_conf_file = open('.testr.conf', 'r') config = six.moves.configparser.ConfigParser() config.readfp(testr_conf_file) test_command = config.get('DEFAULT', 'test_co...
Add tool to convert testr.conf to stestr.conf
Add tool to convert testr.conf to stestr.conf Since stestr isn't strictly backwards compatible with testr user intervention will be required to start using stestr as a replacement for testrepository. This commit adds a tools directory and populates it with a naive script that attempts to automate creating a .stestr.co...
Python
apache-2.0
masayukig/stestr,mtreinish/stestr,mtreinish/stestr,masayukig/stestr
Add tool to convert testr.conf to stestr.conf Since stestr isn't strictly backwards compatible with testr user intervention will be required to start using stestr as a replacement for testrepository. This commit adds a tools directory and populates it with a naive script that attempts to automate creating a .stestr.co...
#!/usr/bin/env python import os import sys import six if not os.path.isfile('.testr.conf'): print("Testr config file not found") sys.exit(1) testr_conf_file = open('.testr.conf', 'r') config = six.moves.configparser.ConfigParser() config.readfp(testr_conf_file) test_command = config.get('DEFAULT', 'test_co...
<commit_before><commit_msg>Add tool to convert testr.conf to stestr.conf Since stestr isn't strictly backwards compatible with testr user intervention will be required to start using stestr as a replacement for testrepository. This commit adds a tools directory and populates it with a naive script that attempts to aut...
#!/usr/bin/env python import os import sys import six if not os.path.isfile('.testr.conf'): print("Testr config file not found") sys.exit(1) testr_conf_file = open('.testr.conf', 'r') config = six.moves.configparser.ConfigParser() config.readfp(testr_conf_file) test_command = config.get('DEFAULT', 'test_co...
Add tool to convert testr.conf to stestr.conf Since stestr isn't strictly backwards compatible with testr user intervention will be required to start using stestr as a replacement for testrepository. This commit adds a tools directory and populates it with a naive script that attempts to automate creating a .stestr.co...
<commit_before><commit_msg>Add tool to convert testr.conf to stestr.conf Since stestr isn't strictly backwards compatible with testr user intervention will be required to start using stestr as a replacement for testrepository. This commit adds a tools directory and populates it with a naive script that attempts to aut...
405c3c3a0264d158a878934d6e23078d250aec57
hash.py
hash.py
class HashItem(object): def __init__(self, key, value): self.key = key self.value = value class HashTable(object): def __init__(self, tablesize=1024): self.table = [] for i in range(tablesize): self.table.append(tuple()) t = HashTable(100) t.table[5] = ('hash', 'ha...
Initialize Table and Hash item
Initialize Table and Hash item
Python
mit
nbeck90/data_structures_2
Initialize Table and Hash item
class HashItem(object): def __init__(self, key, value): self.key = key self.value = value class HashTable(object): def __init__(self, tablesize=1024): self.table = [] for i in range(tablesize): self.table.append(tuple()) t = HashTable(100) t.table[5] = ('hash', 'ha...
<commit_before><commit_msg>Initialize Table and Hash item<commit_after>
class HashItem(object): def __init__(self, key, value): self.key = key self.value = value class HashTable(object): def __init__(self, tablesize=1024): self.table = [] for i in range(tablesize): self.table.append(tuple()) t = HashTable(100) t.table[5] = ('hash', 'ha...
Initialize Table and Hash itemclass HashItem(object): def __init__(self, key, value): self.key = key self.value = value class HashTable(object): def __init__(self, tablesize=1024): self.table = [] for i in range(tablesize): self.table.append(tuple()) t = HashTable(...
<commit_before><commit_msg>Initialize Table and Hash item<commit_after>class HashItem(object): def __init__(self, key, value): self.key = key self.value = value class HashTable(object): def __init__(self, tablesize=1024): self.table = [] for i in range(tablesize): s...
af28c1449cf525460de16304c231616873b2ca3d
tests/test_memory_leak.py
tests/test_memory_leak.py
import resource import pytest from .models import TestModel as DirtyMixinModel pytestmark = pytest.mark.django_db def test_rss_usage(): DirtyMixinModel() rss_1 = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss for _ in range(1000): DirtyMixinModel() rss_2 = resource.getrusage(resource.RU...
Add test for detecting memory leaks
Add test for detecting memory leaks
Python
bsd-3-clause
romgar/django-dirtyfields,smn/django-dirtyfields
Add test for detecting memory leaks
import resource import pytest from .models import TestModel as DirtyMixinModel pytestmark = pytest.mark.django_db def test_rss_usage(): DirtyMixinModel() rss_1 = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss for _ in range(1000): DirtyMixinModel() rss_2 = resource.getrusage(resource.RU...
<commit_before><commit_msg>Add test for detecting memory leaks<commit_after>
import resource import pytest from .models import TestModel as DirtyMixinModel pytestmark = pytest.mark.django_db def test_rss_usage(): DirtyMixinModel() rss_1 = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss for _ in range(1000): DirtyMixinModel() rss_2 = resource.getrusage(resource.RU...
Add test for detecting memory leaksimport resource import pytest from .models import TestModel as DirtyMixinModel pytestmark = pytest.mark.django_db def test_rss_usage(): DirtyMixinModel() rss_1 = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss for _ in range(1000): DirtyMixinModel() rss...
<commit_before><commit_msg>Add test for detecting memory leaks<commit_after>import resource import pytest from .models import TestModel as DirtyMixinModel pytestmark = pytest.mark.django_db def test_rss_usage(): DirtyMixinModel() rss_1 = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss for _ in range...
28af79e1f4362db812247911b3cda1831bed75bf
utils/result_analysis.py
utils/result_analysis.py
__author__ = 'quinnosha' """Tools for viewing and analyzing prediction results .. moduleauthor:: Quinn Osha """ from os.path import abspath, dirname, join from utils.data_paths import RESULTS_DIR_PATH def find_lowest_rmse(rmse_file_name): rmse_file_path = join(RESULTS_DIR_PATH, rmse_file_name) read_format ...
Add script to find lowest rmse result values
Add script to find lowest rmse result values
Python
mit
jvanbrug/netflix,jvanbrug/netflix
Add script to find lowest rmse result values
__author__ = 'quinnosha' """Tools for viewing and analyzing prediction results .. moduleauthor:: Quinn Osha """ from os.path import abspath, dirname, join from utils.data_paths import RESULTS_DIR_PATH def find_lowest_rmse(rmse_file_name): rmse_file_path = join(RESULTS_DIR_PATH, rmse_file_name) read_format ...
<commit_before><commit_msg>Add script to find lowest rmse result values<commit_after>
__author__ = 'quinnosha' """Tools for viewing and analyzing prediction results .. moduleauthor:: Quinn Osha """ from os.path import abspath, dirname, join from utils.data_paths import RESULTS_DIR_PATH def find_lowest_rmse(rmse_file_name): rmse_file_path = join(RESULTS_DIR_PATH, rmse_file_name) read_format ...
Add script to find lowest rmse result values__author__ = 'quinnosha' """Tools for viewing and analyzing prediction results .. moduleauthor:: Quinn Osha """ from os.path import abspath, dirname, join from utils.data_paths import RESULTS_DIR_PATH def find_lowest_rmse(rmse_file_name): rmse_file_path = join(RESULT...
<commit_before><commit_msg>Add script to find lowest rmse result values<commit_after>__author__ = 'quinnosha' """Tools for viewing and analyzing prediction results .. moduleauthor:: Quinn Osha """ from os.path import abspath, dirname, join from utils.data_paths import RESULTS_DIR_PATH def find_lowest_rmse(rmse_fil...
203fceedd93a56032f7b78154620f4da89cb4768
sequana/vcf_filter.py
sequana/vcf_filter.py
""" Python script to filter a vcf-file generated by freebayes. """ import sys import vcf class VCF(vcf.Reader): def __init__(self, filename, **kwargs): """ Filter vcf file with a dictionnary. It takes a vcf file as entry. """ try: filin = open(filename, "r") ...
Add script to filter VCF.
Add script to filter VCF.
Python
bsd-3-clause
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
Add script to filter VCF.
""" Python script to filter a vcf-file generated by freebayes. """ import sys import vcf class VCF(vcf.Reader): def __init__(self, filename, **kwargs): """ Filter vcf file with a dictionnary. It takes a vcf file as entry. """ try: filin = open(filename, "r") ...
<commit_before><commit_msg>Add script to filter VCF.<commit_after>
""" Python script to filter a vcf-file generated by freebayes. """ import sys import vcf class VCF(vcf.Reader): def __init__(self, filename, **kwargs): """ Filter vcf file with a dictionnary. It takes a vcf file as entry. """ try: filin = open(filename, "r") ...
Add script to filter VCF.""" Python script to filter a vcf-file generated by freebayes. """ import sys import vcf class VCF(vcf.Reader): def __init__(self, filename, **kwargs): """ Filter vcf file with a dictionnary. It takes a vcf file as entry. """ try: filin ...
<commit_before><commit_msg>Add script to filter VCF.<commit_after>""" Python script to filter a vcf-file generated by freebayes. """ import sys import vcf class VCF(vcf.Reader): def __init__(self, filename, **kwargs): """ Filter vcf file with a dictionnary. It takes a vcf file as entry. ...
9b618c71bb7d8cc0d38c5cbafb40e9775205a544
fluent/tests/test_scanner.py
fluent/tests/test_scanner.py
from djangae.test import TestCase from fluent.scanner import parse_file, DEFAULT_TRANSLATION_GROUP TEST_CONTENT = """{% trans "Test trans string with group" group "public" %} {% trans "Test trans string without group" %} Regular string {% blocktrans group "public" %} Test trans block with group {% endblocktrans %} {...
Add basic test for scanner parsing html block with specified groups correctly
Add basic test for scanner parsing html block with specified groups correctly
Python
mit
potatolondon/fluent-2.0,potatolondon/fluent-2.0
Add basic test for scanner parsing html block with specified groups correctly
from djangae.test import TestCase from fluent.scanner import parse_file, DEFAULT_TRANSLATION_GROUP TEST_CONTENT = """{% trans "Test trans string with group" group "public" %} {% trans "Test trans string without group" %} Regular string {% blocktrans group "public" %} Test trans block with group {% endblocktrans %} {...
<commit_before><commit_msg>Add basic test for scanner parsing html block with specified groups correctly<commit_after>
from djangae.test import TestCase from fluent.scanner import parse_file, DEFAULT_TRANSLATION_GROUP TEST_CONTENT = """{% trans "Test trans string with group" group "public" %} {% trans "Test trans string without group" %} Regular string {% blocktrans group "public" %} Test trans block with group {% endblocktrans %} {...
Add basic test for scanner parsing html block with specified groups correctlyfrom djangae.test import TestCase from fluent.scanner import parse_file, DEFAULT_TRANSLATION_GROUP TEST_CONTENT = """{% trans "Test trans string with group" group "public" %} {% trans "Test trans string without group" %} Regular string {% b...
<commit_before><commit_msg>Add basic test for scanner parsing html block with specified groups correctly<commit_after>from djangae.test import TestCase from fluent.scanner import parse_file, DEFAULT_TRANSLATION_GROUP TEST_CONTENT = """{% trans "Test trans string with group" group "public" %} {% trans "Test trans str...
1874d7c9a0da128ae640ad7bb2fc64a292369c0a
test/test_webservice.py
test/test_webservice.py
import unittest from test_database import make_test_jobs from memory_database import MemoryDatabase from saliweb.backend import WebService, Config, Job class WebServiceTest(unittest.TestCase): """Check WebService class""" def test_init(self): """Check WebService init""" db = MemoryDatabase(Job...
Add basic testing of the WebService class.
Add basic testing of the WebService class.
Python
lgpl-2.1
salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb
Add basic testing of the WebService class.
import unittest from test_database import make_test_jobs from memory_database import MemoryDatabase from saliweb.backend import WebService, Config, Job class WebServiceTest(unittest.TestCase): """Check WebService class""" def test_init(self): """Check WebService init""" db = MemoryDatabase(Job...
<commit_before><commit_msg>Add basic testing of the WebService class.<commit_after>
import unittest from test_database import make_test_jobs from memory_database import MemoryDatabase from saliweb.backend import WebService, Config, Job class WebServiceTest(unittest.TestCase): """Check WebService class""" def test_init(self): """Check WebService init""" db = MemoryDatabase(Job...
Add basic testing of the WebService class.import unittest from test_database import make_test_jobs from memory_database import MemoryDatabase from saliweb.backend import WebService, Config, Job class WebServiceTest(unittest.TestCase): """Check WebService class""" def test_init(self): """Check WebServi...
<commit_before><commit_msg>Add basic testing of the WebService class.<commit_after>import unittest from test_database import make_test_jobs from memory_database import MemoryDatabase from saliweb.backend import WebService, Config, Job class WebServiceTest(unittest.TestCase): """Check WebService class""" def t...
d689ac08e6d0b928d674997aafb383c8bf2a4861
geotrek/common/migrations/0026_auto_20220425_0938.py
geotrek/common/migrations/0026_auto_20220425_0938.py
# Generated by Django 3.1.14 on 2022-04-25 09:38 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('common', '0025_auto_20220425_0850'), ] operations = [ migrations.AlterModelOptions( name='lice...
Add api v2 license, add license accessibility attachment
Add api v2 license, add license accessibility attachment
Python
bsd-2-clause
makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin
Add api v2 license, add license accessibility attachment
# Generated by Django 3.1.14 on 2022-04-25 09:38 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('common', '0025_auto_20220425_0850'), ] operations = [ migrations.AlterModelOptions( name='lice...
<commit_before><commit_msg>Add api v2 license, add license accessibility attachment<commit_after>
# Generated by Django 3.1.14 on 2022-04-25 09:38 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('common', '0025_auto_20220425_0850'), ] operations = [ migrations.AlterModelOptions( name='lice...
Add api v2 license, add license accessibility attachment# Generated by Django 3.1.14 on 2022-04-25 09:38 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('common', '0025_auto_20220425_0850'), ] operations = [ ...
<commit_before><commit_msg>Add api v2 license, add license accessibility attachment<commit_after># Generated by Django 3.1.14 on 2022-04-25 09:38 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('common', '0025_auto_202204...
19ab63c1f5c377a58b3b91ae2c716f6d3ed6b78b
euler036.py
euler036.py
#!/usr/bin/python from math import pow LIMIT = 1000000 palindrome_sum = 0 def is_palindrome(res): return res == res[::-1] def binary(x): res = [] while(x): res.insert(0, x % 2) x //= 2 return res for palindrome in range(1, LIMIT): if(is_palindrome(list(str(palindrome)))): binary_n = binary(palindrome) ...
Add solution for problem 36, after long time...
Add solution for problem 36, after long time...
Python
mit
cifvts/PyEuler
Add solution for problem 36, after long time...
#!/usr/bin/python from math import pow LIMIT = 1000000 palindrome_sum = 0 def is_palindrome(res): return res == res[::-1] def binary(x): res = [] while(x): res.insert(0, x % 2) x //= 2 return res for palindrome in range(1, LIMIT): if(is_palindrome(list(str(palindrome)))): binary_n = binary(palindrome) ...
<commit_before><commit_msg>Add solution for problem 36, after long time...<commit_after>
#!/usr/bin/python from math import pow LIMIT = 1000000 palindrome_sum = 0 def is_palindrome(res): return res == res[::-1] def binary(x): res = [] while(x): res.insert(0, x % 2) x //= 2 return res for palindrome in range(1, LIMIT): if(is_palindrome(list(str(palindrome)))): binary_n = binary(palindrome) ...
Add solution for problem 36, after long time...#!/usr/bin/python from math import pow LIMIT = 1000000 palindrome_sum = 0 def is_palindrome(res): return res == res[::-1] def binary(x): res = [] while(x): res.insert(0, x % 2) x //= 2 return res for palindrome in range(1, LIMIT): if(is_palindrome(list(str(pa...
<commit_before><commit_msg>Add solution for problem 36, after long time...<commit_after>#!/usr/bin/python from math import pow LIMIT = 1000000 palindrome_sum = 0 def is_palindrome(res): return res == res[::-1] def binary(x): res = [] while(x): res.insert(0, x % 2) x //= 2 return res for palindrome in range...
6e4d457244b49c903e706d8deffaf74c4a737990
mail_extractor/mail_extractor.py
mail_extractor/mail_extractor.py
import email import sys import os import argparse import textwrap def make_person_schema(msg, schemaFile): schema = """\ <div itemscope itemtype="http://schema.org/Person"> <span itemprop="email">%s</span> </div>""" % msg['from'] schemaFile.write(textwrap.dedent(schema)) def mails2schema(mailDir, outputDi...
Add a simple mail extractor of eml files. Convert the email to schema format.
Add a simple mail extractor of eml files. Convert the email to schema format.
Python
mit
ptal/people-link
Add a simple mail extractor of eml files. Convert the email to schema format.
import email import sys import os import argparse import textwrap def make_person_schema(msg, schemaFile): schema = """\ <div itemscope itemtype="http://schema.org/Person"> <span itemprop="email">%s</span> </div>""" % msg['from'] schemaFile.write(textwrap.dedent(schema)) def mails2schema(mailDir, outputDi...
<commit_before><commit_msg>Add a simple mail extractor of eml files. Convert the email to schema format.<commit_after>
import email import sys import os import argparse import textwrap def make_person_schema(msg, schemaFile): schema = """\ <div itemscope itemtype="http://schema.org/Person"> <span itemprop="email">%s</span> </div>""" % msg['from'] schemaFile.write(textwrap.dedent(schema)) def mails2schema(mailDir, outputDi...
Add a simple mail extractor of eml files. Convert the email to schema format.import email import sys import os import argparse import textwrap def make_person_schema(msg, schemaFile): schema = """\ <div itemscope itemtype="http://schema.org/Person"> <span itemprop="email">%s</span> </div>""" % msg['from'] ...
<commit_before><commit_msg>Add a simple mail extractor of eml files. Convert the email to schema format.<commit_after>import email import sys import os import argparse import textwrap def make_person_schema(msg, schemaFile): schema = """\ <div itemscope itemtype="http://schema.org/Person"> <span itemprop="emai...
41bc62e8cd9e52f443670f326dad84b39d4d9ca1
tests/test_managers/test_experiment_job.py
tests/test_managers/test_experiment_job.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from unittest import TestCase from polyaxon_cli.managers.experiment_job import ExperimentJobManager from polyaxon_schemas.experiment import ExperimentJobConfig class TestJobManager(TestCase): def test_default_props(self): ...
Add experiment job manager tests
Add experiment job manager tests
Python
apache-2.0
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
Add experiment job manager tests
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from unittest import TestCase from polyaxon_cli.managers.experiment_job import ExperimentJobManager from polyaxon_schemas.experiment import ExperimentJobConfig class TestJobManager(TestCase): def test_default_props(self): ...
<commit_before><commit_msg>Add experiment job manager tests<commit_after>
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from unittest import TestCase from polyaxon_cli.managers.experiment_job import ExperimentJobManager from polyaxon_schemas.experiment import ExperimentJobConfig class TestJobManager(TestCase): def test_default_props(self): ...
Add experiment job manager tests# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from unittest import TestCase from polyaxon_cli.managers.experiment_job import ExperimentJobManager from polyaxon_schemas.experiment import ExperimentJobConfig class TestJobManager(TestCase): ...
<commit_before><commit_msg>Add experiment job manager tests<commit_after># -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from unittest import TestCase from polyaxon_cli.managers.experiment_job import ExperimentJobManager from polyaxon_schemas.experiment import ExperimentJobCon...
caaec1dd39b10ceae04736fd2fb1278d6f74d7cd
tests/testnet/aio/test_jsonrpc.py
tests/testnet/aio/test_jsonrpc.py
# -*- coding: utf-8 -*- import asyncio import pytest import logging from bitshares.aio.asset import Asset logger = logging.getLogger("websockets") logger.setLevel(logging.DEBUG) log = logging.getLogger("grapheneapi") log.setLevel(logging.DEBUG) @pytest.mark.asyncio async def test_parallel_queries(event_loop, bitsh...
Add test for parallel queries
Add test for parallel queries
Python
mit
xeroc/python-bitshares
Add test for parallel queries
# -*- coding: utf-8 -*- import asyncio import pytest import logging from bitshares.aio.asset import Asset logger = logging.getLogger("websockets") logger.setLevel(logging.DEBUG) log = logging.getLogger("grapheneapi") log.setLevel(logging.DEBUG) @pytest.mark.asyncio async def test_parallel_queries(event_loop, bitsh...
<commit_before><commit_msg>Add test for parallel queries<commit_after>
# -*- coding: utf-8 -*- import asyncio import pytest import logging from bitshares.aio.asset import Asset logger = logging.getLogger("websockets") logger.setLevel(logging.DEBUG) log = logging.getLogger("grapheneapi") log.setLevel(logging.DEBUG) @pytest.mark.asyncio async def test_parallel_queries(event_loop, bitsh...
Add test for parallel queries# -*- coding: utf-8 -*- import asyncio import pytest import logging from bitshares.aio.asset import Asset logger = logging.getLogger("websockets") logger.setLevel(logging.DEBUG) log = logging.getLogger("grapheneapi") log.setLevel(logging.DEBUG) @pytest.mark.asyncio async def test_paral...
<commit_before><commit_msg>Add test for parallel queries<commit_after># -*- coding: utf-8 -*- import asyncio import pytest import logging from bitshares.aio.asset import Asset logger = logging.getLogger("websockets") logger.setLevel(logging.DEBUG) log = logging.getLogger("grapheneapi") log.setLevel(logging.DEBUG) ...
8f341dcb684e852b7a920ee930f4714e83bb180f
test_radix_sort.py
test_radix_sort.py
# -*- coding: utf-8 -*- from radix_sort import int_radix, str_radix def test_sorted(): my_list = list(range(100)) new_list = int_radix(my_list) assert new_list == list(range(100)) def test_reverse(): my_list = list(range(100))[::-1] new_list = int_radix(my_list) assert new_list == list(range...
Add tests for Radix sort
Add tests for Radix sort
Python
mit
nbeck90/data_structures_2
Add tests for Radix sort
# -*- coding: utf-8 -*- from radix_sort import int_radix, str_radix def test_sorted(): my_list = list(range(100)) new_list = int_radix(my_list) assert new_list == list(range(100)) def test_reverse(): my_list = list(range(100))[::-1] new_list = int_radix(my_list) assert new_list == list(range...
<commit_before><commit_msg>Add tests for Radix sort<commit_after>
# -*- coding: utf-8 -*- from radix_sort import int_radix, str_radix def test_sorted(): my_list = list(range(100)) new_list = int_radix(my_list) assert new_list == list(range(100)) def test_reverse(): my_list = list(range(100))[::-1] new_list = int_radix(my_list) assert new_list == list(range...
Add tests for Radix sort# -*- coding: utf-8 -*- from radix_sort import int_radix, str_radix def test_sorted(): my_list = list(range(100)) new_list = int_radix(my_list) assert new_list == list(range(100)) def test_reverse(): my_list = list(range(100))[::-1] new_list = int_radix(my_list) asser...
<commit_before><commit_msg>Add tests for Radix sort<commit_after># -*- coding: utf-8 -*- from radix_sort import int_radix, str_radix def test_sorted(): my_list = list(range(100)) new_list = int_radix(my_list) assert new_list == list(range(100)) def test_reverse(): my_list = list(range(100))[::-1] ...
3fd7cda9be34dd0bbf884aae8012096d3962fad3
tests/test_web_urldispatcher.py
tests/test_web_urldispatcher.py
import pytest import tempfile import aiohttp from aiohttp import web import os import shutil import asyncio SERVER_HOST = '127.0.0.1' SERVER_PORT = 8080 # Timeout in seconds for an asynchronous test: ASYNC_TEST_TIMEOUT = 1 class ExceptAsyncTestTimeout(Exception): pass def run_timeout(cor,loop,timeout=ASYNC_TEST_TIM...
Test for accessing the root of a statically served dir.
Test for accessing the root of a statically served dir.
Python
apache-2.0
z2v/aiohttp,esaezgil/aiohttp,AraHaanOrg/aiohttp,elastic-coders/aiohttp,moden-py/aiohttp,vaskalas/aiohttp,panda73111/aiohttp,jashandeep-sohi/aiohttp,elastic-coders/aiohttp,hellysmile/aiohttp,juliatem/aiohttp,panda73111/aiohttp,moden-py/aiohttp,esaezgil/aiohttp,jashandeep-sohi/aiohttp,KeepSafe/aiohttp,singulared/aiohttp,...
Test for accessing the root of a statically served dir.
import pytest import tempfile import aiohttp from aiohttp import web import os import shutil import asyncio SERVER_HOST = '127.0.0.1' SERVER_PORT = 8080 # Timeout in seconds for an asynchronous test: ASYNC_TEST_TIMEOUT = 1 class ExceptAsyncTestTimeout(Exception): pass def run_timeout(cor,loop,timeout=ASYNC_TEST_TIM...
<commit_before><commit_msg>Test for accessing the root of a statically served dir.<commit_after>
import pytest import tempfile import aiohttp from aiohttp import web import os import shutil import asyncio SERVER_HOST = '127.0.0.1' SERVER_PORT = 8080 # Timeout in seconds for an asynchronous test: ASYNC_TEST_TIMEOUT = 1 class ExceptAsyncTestTimeout(Exception): pass def run_timeout(cor,loop,timeout=ASYNC_TEST_TIM...
Test for accessing the root of a statically served dir.import pytest import tempfile import aiohttp from aiohttp import web import os import shutil import asyncio SERVER_HOST = '127.0.0.1' SERVER_PORT = 8080 # Timeout in seconds for an asynchronous test: ASYNC_TEST_TIMEOUT = 1 class ExceptAsyncTestTimeout(Exception)...
<commit_before><commit_msg>Test for accessing the root of a statically served dir.<commit_after>import pytest import tempfile import aiohttp from aiohttp import web import os import shutil import asyncio SERVER_HOST = '127.0.0.1' SERVER_PORT = 8080 # Timeout in seconds for an asynchronous test: ASYNC_TEST_TIMEOUT = 1...
62f6f127a8b74daa74d38850d9b9d9346c7b1144
gpmcc/tests/inference/test_simulate.py
gpmcc/tests/inference/test_simulate.py
# -*- coding: utf-8 -*- # Copyright (c) 2010-2015, MIT Probabilistic Computing Project # # 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/LICENS...
Create separate file for simulate.
Create separate file for simulate.
Python
apache-2.0
probcomp/cgpm,probcomp/cgpm
Create separate file for simulate.
# -*- coding: utf-8 -*- # Copyright (c) 2010-2015, MIT Probabilistic Computing Project # # 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/LICENS...
<commit_before><commit_msg>Create separate file for simulate.<commit_after>
# -*- coding: utf-8 -*- # Copyright (c) 2010-2015, MIT Probabilistic Computing Project # # 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/LICENS...
Create separate file for simulate.# -*- coding: utf-8 -*- # Copyright (c) 2010-2015, MIT Probabilistic Computing Project # # 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 # # htt...
<commit_before><commit_msg>Create separate file for simulate.<commit_after># -*- coding: utf-8 -*- # Copyright (c) 2010-2015, MIT Probabilistic Computing Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
fb61f99e97e0d6f630e9f17132a33e06e4a64d4c
plotpoints.py
plotpoints.py
# Quick hack to visualize non-gridified tSNE placed images # Adapted from https://github.com/ml4a/ml4a-guides/blob/master/notebooks/image-tsne.ipynb import json import matplotlib.pyplot from PIL import Image with open('points.json') as json_file: data = json.load(json_file) arr = [] for tup in data: point =...
Add script for generating a preview image for non-gridified tSNE placed images
Add script for generating a preview image for non-gridified tSNE placed images
Python
apache-2.0
tokee/juxta,tokee/juxta,tokee/juxta
Add script for generating a preview image for non-gridified tSNE placed images
# Quick hack to visualize non-gridified tSNE placed images # Adapted from https://github.com/ml4a/ml4a-guides/blob/master/notebooks/image-tsne.ipynb import json import matplotlib.pyplot from PIL import Image with open('points.json') as json_file: data = json.load(json_file) arr = [] for tup in data: point =...
<commit_before><commit_msg>Add script for generating a preview image for non-gridified tSNE placed images<commit_after>
# Quick hack to visualize non-gridified tSNE placed images # Adapted from https://github.com/ml4a/ml4a-guides/blob/master/notebooks/image-tsne.ipynb import json import matplotlib.pyplot from PIL import Image with open('points.json') as json_file: data = json.load(json_file) arr = [] for tup in data: point =...
Add script for generating a preview image for non-gridified tSNE placed images# Quick hack to visualize non-gridified tSNE placed images # Adapted from https://github.com/ml4a/ml4a-guides/blob/master/notebooks/image-tsne.ipynb import json import matplotlib.pyplot from PIL import Image with open('points.json') as jso...
<commit_before><commit_msg>Add script for generating a preview image for non-gridified tSNE placed images<commit_after># Quick hack to visualize non-gridified tSNE placed images # Adapted from https://github.com/ml4a/ml4a-guides/blob/master/notebooks/image-tsne.ipynb import json import matplotlib.pyplot from PIL impo...
1218583a097575e7befd6eea339e34a0cbfda76f
test_goeslc.py
test_goeslc.py
from sunpy.time import TimeRange from sunpy.lightcurve import GOESLightCurve dt = TimeRange('1981/01/10 00:00', '2014/04/18 23:00') tr_not_found = [] time_ranges = dt.window(60*60*24, 60*60*24) total_days = len(time_ranges) total_fails = 0 # missing files http://umbra.nascom.nasa.gov/goes/fits/2005/go1220051116.fit...
Test for GOES light curve
Test for GOES light curve
Python
apache-2.0
ehsteve/sunpy-tests
Test for GOES light curve
from sunpy.time import TimeRange from sunpy.lightcurve import GOESLightCurve dt = TimeRange('1981/01/10 00:00', '2014/04/18 23:00') tr_not_found = [] time_ranges = dt.window(60*60*24, 60*60*24) total_days = len(time_ranges) total_fails = 0 # missing files http://umbra.nascom.nasa.gov/goes/fits/2005/go1220051116.fit...
<commit_before><commit_msg>Test for GOES light curve<commit_after>
from sunpy.time import TimeRange from sunpy.lightcurve import GOESLightCurve dt = TimeRange('1981/01/10 00:00', '2014/04/18 23:00') tr_not_found = [] time_ranges = dt.window(60*60*24, 60*60*24) total_days = len(time_ranges) total_fails = 0 # missing files http://umbra.nascom.nasa.gov/goes/fits/2005/go1220051116.fit...
Test for GOES light curvefrom sunpy.time import TimeRange from sunpy.lightcurve import GOESLightCurve dt = TimeRange('1981/01/10 00:00', '2014/04/18 23:00') tr_not_found = [] time_ranges = dt.window(60*60*24, 60*60*24) total_days = len(time_ranges) total_fails = 0 # missing files http://umbra.nascom.nasa.gov/goes/f...
<commit_before><commit_msg>Test for GOES light curve<commit_after>from sunpy.time import TimeRange from sunpy.lightcurve import GOESLightCurve dt = TimeRange('1981/01/10 00:00', '2014/04/18 23:00') tr_not_found = [] time_ranges = dt.window(60*60*24, 60*60*24) total_days = len(time_ranges) total_fails = 0 # missing ...
95366beb54dfecc43e6ba3dc651fe5fd12aeb5a5
python/gui.py
python/gui.py
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load '+netgen._netgen_lib_dir...
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load "'+netgen._netgen_lib_di...
Fix spaces in install dir
Fix spaces in install dir
Python
lgpl-2.1
looooo/netgen,live-clones/netgen,looooo/netgen,looooo/netgen,live-clones/netgen,looooo/netgen,live-clones/netgen,looooo/netgen,looooo/netgen,live-clones/netgen,live-clones/netgen,live-clones/netgen
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load '+netgen._netgen_lib_dir...
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load "'+netgen._netgen_lib_di...
<commit_before>import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load '+netgen....
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load "'+netgen._netgen_lib_di...
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load '+netgen._netgen_lib_dir...
<commit_before>import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load '+netgen....
a3d70cd799126f489737b193f6917fe607a03652
wafer/sponsors/migrations/0005_sponsorshippackage_symbol.py
wafer/sponsors/migrations/0005_sponsorshippackage_symbol.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0004_auto_20160813_1328'), ] operations = [ migrations.AddField( model_name='sponsorshippackage', ...
Add migration for sponsor package changes
Add migration for sponsor package changes
Python
isc
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
Add migration for sponsor package changes
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0004_auto_20160813_1328'), ] operations = [ migrations.AddField( model_name='sponsorshippackage', ...
<commit_before><commit_msg>Add migration for sponsor package changes<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0004_auto_20160813_1328'), ] operations = [ migrations.AddField( model_name='sponsorshippackage', ...
Add migration for sponsor package changes# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0004_auto_20160813_1328'), ] operations = [ migrations.AddField( ...
<commit_before><commit_msg>Add migration for sponsor package changes<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0004_auto_20160813_1328'), ] operation...
5e74bfcf03afdc0eaf58c668e063fd41432b6da0
text_filter.py
text_filter.py
from abc import ABCMeta, abstractmethod class TextFilter(object, metaclass=ABCMeta): """ An intertface for text filters Only has one method: apply() which recieves a string as an argument and returns a string. """ @abstractmethod def apply(self, text): """ Recieves a string...
Add text filter and text filter composite (pipeline)
Add text filter and text filter composite (pipeline)
Python
mit
iluxonchik/lyricist
Add text filter and text filter composite (pipeline)
from abc import ABCMeta, abstractmethod class TextFilter(object, metaclass=ABCMeta): """ An intertface for text filters Only has one method: apply() which recieves a string as an argument and returns a string. """ @abstractmethod def apply(self, text): """ Recieves a string...
<commit_before><commit_msg>Add text filter and text filter composite (pipeline)<commit_after>
from abc import ABCMeta, abstractmethod class TextFilter(object, metaclass=ABCMeta): """ An intertface for text filters Only has one method: apply() which recieves a string as an argument and returns a string. """ @abstractmethod def apply(self, text): """ Recieves a string...
Add text filter and text filter composite (pipeline)from abc import ABCMeta, abstractmethod class TextFilter(object, metaclass=ABCMeta): """ An intertface for text filters Only has one method: apply() which recieves a string as an argument and returns a string. """ @abstractmethod ...
<commit_before><commit_msg>Add text filter and text filter composite (pipeline)<commit_after>from abc import ABCMeta, abstractmethod class TextFilter(object, metaclass=ABCMeta): """ An intertface for text filters Only has one method: apply() which recieves a string as an argument and returns a s...
78454dcde6be6da73d99fd77c79b6af21dfe02c1
xml_hidden_extensions_hotfix.py
xml_hidden_extensions_hotfix.py
# The XML package includes a `XML.sublime-settings` file that sets `hidden_extensions` to some # of the extension we want to highlight with our package. # There is currently no other way to override this, so we manually remove these extensions from the # setting with a plugin. # # See also: # https://github.com/subli...
Add plugin to make syntax detection work
Add plugin to make syntax detection work
Python
mit
SublimeText/PackageDev,SublimeText/AAAPackageDev,SublimeText/AAAPackageDev
Add plugin to make syntax detection work
# The XML package includes a `XML.sublime-settings` file that sets `hidden_extensions` to some # of the extension we want to highlight with our package. # There is currently no other way to override this, so we manually remove these extensions from the # setting with a plugin. # # See also: # https://github.com/subli...
<commit_before><commit_msg>Add plugin to make syntax detection work<commit_after>
# The XML package includes a `XML.sublime-settings` file that sets `hidden_extensions` to some # of the extension we want to highlight with our package. # There is currently no other way to override this, so we manually remove these extensions from the # setting with a plugin. # # See also: # https://github.com/subli...
Add plugin to make syntax detection work# The XML package includes a `XML.sublime-settings` file that sets `hidden_extensions` to some # of the extension we want to highlight with our package. # There is currently no other way to override this, so we manually remove these extensions from the # setting with a plugin. # ...
<commit_before><commit_msg>Add plugin to make syntax detection work<commit_after># The XML package includes a `XML.sublime-settings` file that sets `hidden_extensions` to some # of the extension we want to highlight with our package. # There is currently no other way to override this, so we manually remove these extens...
029183cfd855c1fc157df771d1b5a705aec38854
py/minimum-absolute-difference-in-bst.py
py/minimum-absolute-difference-in-bst.py
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def inOrder(self, cur): if cur: self.inOrder(cur.left) if self.prev is not None: ...
Add py solution for 530. Minimum Absolute Difference in BST
Add py solution for 530. Minimum Absolute Difference in BST 530. Minimum Absolute Difference in BST: https://leetcode.com/problems/minimum-absolute-difference-in-bst/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 530. Minimum Absolute Difference in BST 530. Minimum Absolute Difference in BST: https://leetcode.com/problems/minimum-absolute-difference-in-bst/
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def inOrder(self, cur): if cur: self.inOrder(cur.left) if self.prev is not None: ...
<commit_before><commit_msg>Add py solution for 530. Minimum Absolute Difference in BST 530. Minimum Absolute Difference in BST: https://leetcode.com/problems/minimum-absolute-difference-in-bst/<commit_after>
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def inOrder(self, cur): if cur: self.inOrder(cur.left) if self.prev is not None: ...
Add py solution for 530. Minimum Absolute Difference in BST 530. Minimum Absolute Difference in BST: https://leetcode.com/problems/minimum-absolute-difference-in-bst/# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # s...
<commit_before><commit_msg>Add py solution for 530. Minimum Absolute Difference in BST 530. Minimum Absolute Difference in BST: https://leetcode.com/problems/minimum-absolute-difference-in-bst/<commit_after># Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val =...
aa37928593ae84526d56f2c50ba7c21b2be6c5e8
rapidtide/tests/test_mi.py
rapidtide/tests/test_mi.py
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-2019 Blaise Frederick # # 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/LICEN...
Test for mutual information function
Test for mutual information function
Python
apache-2.0
bbfrederick/rapidtide,bbfrederick/rapidtide
Test for mutual information function
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-2019 Blaise Frederick # # 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/LICEN...
<commit_before><commit_msg>Test for mutual information function<commit_after>
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-2019 Blaise Frederick # # 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/LICEN...
Test for mutual information function#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-2019 Blaise Frederick # # 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 # # ...
<commit_before><commit_msg>Test for mutual information function<commit_after>#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-2019 Blaise Frederick # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
68ef5177f0519d1bb889a51974fdd5f075c8b0f0
netbox/utilities/templatetags/perms.py
netbox/utilities/templatetags/perms.py
from django import template register = template.Library() def _check_permission(user, instance, action): return user.has_perm( perm=f'{instance._meta.app_label}.{action}_{instance._meta.model_name}', obj=instance ) @register.filter() def can_view(user, instance): return _check_permissio...
Introduce template filters for checking dynamic permissions
Introduce template filters for checking dynamic permissions
Python
apache-2.0
digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,digitalocean/netbox
Introduce template filters for checking dynamic permissions
from django import template register = template.Library() def _check_permission(user, instance, action): return user.has_perm( perm=f'{instance._meta.app_label}.{action}_{instance._meta.model_name}', obj=instance ) @register.filter() def can_view(user, instance): return _check_permissio...
<commit_before><commit_msg>Introduce template filters for checking dynamic permissions<commit_after>
from django import template register = template.Library() def _check_permission(user, instance, action): return user.has_perm( perm=f'{instance._meta.app_label}.{action}_{instance._meta.model_name}', obj=instance ) @register.filter() def can_view(user, instance): return _check_permissio...
Introduce template filters for checking dynamic permissionsfrom django import template register = template.Library() def _check_permission(user, instance, action): return user.has_perm( perm=f'{instance._meta.app_label}.{action}_{instance._meta.model_name}', obj=instance ) @register.filter(...
<commit_before><commit_msg>Introduce template filters for checking dynamic permissions<commit_after>from django import template register = template.Library() def _check_permission(user, instance, action): return user.has_perm( perm=f'{instance._meta.app_label}.{action}_{instance._meta.model_name}', ...
4c354a4941b15ea90e72483881c95c7f8c496f71
scripts/turn_on_and_off.py
scripts/turn_on_and_off.py
#!/usr/bin/python #Definindo a biblioteca GPIO import RPi.GPIO as GPIO #Definindo a biblioteca TIME import time import sys #Aqui definimos que vamos usar o numero de ordem de Porta, e nao o numero que refere a BOARD. # Para alterar troque GPIO.BCM para GPIO.BOARD GPIO.setmode(GPIO.BCM) # Aqui vamos desativar msg de ...
Create turn on and off script
Create turn on and off script
Python
mit
biorreator/bioreator-api,biorreator/bioreator-api
Create turn on and off script
#!/usr/bin/python #Definindo a biblioteca GPIO import RPi.GPIO as GPIO #Definindo a biblioteca TIME import time import sys #Aqui definimos que vamos usar o numero de ordem de Porta, e nao o numero que refere a BOARD. # Para alterar troque GPIO.BCM para GPIO.BOARD GPIO.setmode(GPIO.BCM) # Aqui vamos desativar msg de ...
<commit_before><commit_msg>Create turn on and off script<commit_after>
#!/usr/bin/python #Definindo a biblioteca GPIO import RPi.GPIO as GPIO #Definindo a biblioteca TIME import time import sys #Aqui definimos que vamos usar o numero de ordem de Porta, e nao o numero que refere a BOARD. # Para alterar troque GPIO.BCM para GPIO.BOARD GPIO.setmode(GPIO.BCM) # Aqui vamos desativar msg de ...
Create turn on and off script#!/usr/bin/python #Definindo a biblioteca GPIO import RPi.GPIO as GPIO #Definindo a biblioteca TIME import time import sys #Aqui definimos que vamos usar o numero de ordem de Porta, e nao o numero que refere a BOARD. # Para alterar troque GPIO.BCM para GPIO.BOARD GPIO.setmode(GPIO.BCM) #...
<commit_before><commit_msg>Create turn on and off script<commit_after>#!/usr/bin/python #Definindo a biblioteca GPIO import RPi.GPIO as GPIO #Definindo a biblioteca TIME import time import sys #Aqui definimos que vamos usar o numero de ordem de Porta, e nao o numero que refere a BOARD. # Para alterar troque GPIO.BCM p...
73321680795cff9b1c680ba20fc6ebf2fb87eeb9
dockci/migrations/0003.py
dockci/migrations/0003.py
""" Migrate version to tag in build models """ import os import shutil import yaml job_dirs = ( filename for filename in os.listdir(os.path.join('data', 'builds')) if os.path.isdir(os.path.join('data', 'builds', filename)) ) for job_dir in job_dirs: build_files = ( filename for filename in ...
Add migration to rename version -> tag field
Add migration to rename version -> tag field
Python
isc
sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,RickyCook/DockCI,sprucedev/DockCI,RickyCook/DockCI
Add migration to rename version -> tag field
""" Migrate version to tag in build models """ import os import shutil import yaml job_dirs = ( filename for filename in os.listdir(os.path.join('data', 'builds')) if os.path.isdir(os.path.join('data', 'builds', filename)) ) for job_dir in job_dirs: build_files = ( filename for filename in ...
<commit_before><commit_msg>Add migration to rename version -> tag field<commit_after>
""" Migrate version to tag in build models """ import os import shutil import yaml job_dirs = ( filename for filename in os.listdir(os.path.join('data', 'builds')) if os.path.isdir(os.path.join('data', 'builds', filename)) ) for job_dir in job_dirs: build_files = ( filename for filename in ...
Add migration to rename version -> tag field""" Migrate version to tag in build models """ import os import shutil import yaml job_dirs = ( filename for filename in os.listdir(os.path.join('data', 'builds')) if os.path.isdir(os.path.join('data', 'builds', filename)) ) for job_dir in job_dirs: build_fi...
<commit_before><commit_msg>Add migration to rename version -> tag field<commit_after>""" Migrate version to tag in build models """ import os import shutil import yaml job_dirs = ( filename for filename in os.listdir(os.path.join('data', 'builds')) if os.path.isdir(os.path.join('data', 'builds', filename)...
5eb33cd8ab278be2f8b4e879ef39dfa5ade3c3d7
pymatbridge/tests/test_set_variable.py
pymatbridge/tests/test_set_variable.py
import pymatbridge as pymat import random as rd import numpy as np import numpy.testing as npt import test_utils as tu class TestArray: # Start a Matlab session before any tests @classmethod def setup_class(cls): cls.mlab = tu.connect_to_matlab() # Tear down the Matlab session after all the t...
Rename test_array and add more variations
Rename test_array and add more variations
Python
bsd-3-clause
jjangsangy/python-matlab-bridge,jjangsangy/python-matlab-bridge,arokem/python-matlab-bridge,arokem/python-matlab-bridge,blink1073/python-matlab-bridge,jjangsangy/python-matlab-bridge,blink1073/python-matlab-bridge,blink1073/python-matlab-bridge,arokem/python-matlab-bridge
Rename test_array and add more variations
import pymatbridge as pymat import random as rd import numpy as np import numpy.testing as npt import test_utils as tu class TestArray: # Start a Matlab session before any tests @classmethod def setup_class(cls): cls.mlab = tu.connect_to_matlab() # Tear down the Matlab session after all the t...
<commit_before><commit_msg>Rename test_array and add more variations<commit_after>
import pymatbridge as pymat import random as rd import numpy as np import numpy.testing as npt import test_utils as tu class TestArray: # Start a Matlab session before any tests @classmethod def setup_class(cls): cls.mlab = tu.connect_to_matlab() # Tear down the Matlab session after all the t...
Rename test_array and add more variationsimport pymatbridge as pymat import random as rd import numpy as np import numpy.testing as npt import test_utils as tu class TestArray: # Start a Matlab session before any tests @classmethod def setup_class(cls): cls.mlab = tu.connect_to_matlab() # Tea...
<commit_before><commit_msg>Rename test_array and add more variations<commit_after>import pymatbridge as pymat import random as rd import numpy as np import numpy.testing as npt import test_utils as tu class TestArray: # Start a Matlab session before any tests @classmethod def setup_class(cls): cls...
11b139e7e4fa42d58157b2c872677fe807127a3d
tree/108.py
tree/108.py
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None #recursive solution class Solution: def sortedArrayToBST(self, nums: List[int]) -> TreeNode: if not nums: return None ...
Convert Sorted Array to Binary Search Tree
Convert Sorted Array to Binary Search Tree
Python
apache-2.0
MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode
Convert Sorted Array to Binary Search Tree
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None #recursive solution class Solution: def sortedArrayToBST(self, nums: List[int]) -> TreeNode: if not nums: return None ...
<commit_before><commit_msg>Convert Sorted Array to Binary Search Tree<commit_after>
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None #recursive solution class Solution: def sortedArrayToBST(self, nums: List[int]) -> TreeNode: if not nums: return None ...
Convert Sorted Array to Binary Search Tree# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None #recursive solution class Solution: def sortedArrayToBST(self, nums: List[int]) -> TreeNode: ...
<commit_before><commit_msg>Convert Sorted Array to Binary Search Tree<commit_after># Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None #recursive solution class Solution: def sortedArrayToBST(self, nums: ...
c5aa8f0c6b631ee7f4d0beefb20c8537ecbcf011
tests/test_c_solutions.py
tests/test_c_solutions.py
import glob import json import os import pytest from helpers import solutions_dir # NOTE: If we make solution_files a fixture instead of a normal attr/function, # then we can't use it in pytest's parametrize solution_files = glob.glob(os.path.join(solutions_dir("c"), "*.c")) @pytest.mark.c def test_c_solutions_ex...
Add separate test file for c
Add separate test file for c
Python
mit
project-lovelace/lovelace-engine,project-lovelace/lovelace-engine,project-lovelace/lovelace-engine
Add separate test file for c
import glob import json import os import pytest from helpers import solutions_dir # NOTE: If we make solution_files a fixture instead of a normal attr/function, # then we can't use it in pytest's parametrize solution_files = glob.glob(os.path.join(solutions_dir("c"), "*.c")) @pytest.mark.c def test_c_solutions_ex...
<commit_before><commit_msg>Add separate test file for c<commit_after>
import glob import json import os import pytest from helpers import solutions_dir # NOTE: If we make solution_files a fixture instead of a normal attr/function, # then we can't use it in pytest's parametrize solution_files = glob.glob(os.path.join(solutions_dir("c"), "*.c")) @pytest.mark.c def test_c_solutions_ex...
Add separate test file for cimport glob import json import os import pytest from helpers import solutions_dir # NOTE: If we make solution_files a fixture instead of a normal attr/function, # then we can't use it in pytest's parametrize solution_files = glob.glob(os.path.join(solutions_dir("c"), "*.c")) @pytest.ma...
<commit_before><commit_msg>Add separate test file for c<commit_after>import glob import json import os import pytest from helpers import solutions_dir # NOTE: If we make solution_files a fixture instead of a normal attr/function, # then we can't use it in pytest's parametrize solution_files = glob.glob(os.path.join...
58d9ac5372d6d013750e570a37f6a425dfc244e1
tests/test_mau_a_vs_an.py
tests/test_mau_a_vs_an.py
from check import Check from proselint.checks import mau_a_vs_an as chk class TestCheck(Check): __test__ = True @property def this_check(self): return chk def test_clean(self): assert self.check( """An apple a day keeps the doctor away.""" ) def test_a_apple...
Add tests for 'a' vs. 'an' rule
Add tests for 'a' vs. 'an' rule Closes #31.
Python
bsd-3-clause
amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,jstewmon/proselint
Add tests for 'a' vs. 'an' rule Closes #31.
from check import Check from proselint.checks import mau_a_vs_an as chk class TestCheck(Check): __test__ = True @property def this_check(self): return chk def test_clean(self): assert self.check( """An apple a day keeps the doctor away.""" ) def test_a_apple...
<commit_before><commit_msg>Add tests for 'a' vs. 'an' rule Closes #31.<commit_after>
from check import Check from proselint.checks import mau_a_vs_an as chk class TestCheck(Check): __test__ = True @property def this_check(self): return chk def test_clean(self): assert self.check( """An apple a day keeps the doctor away.""" ) def test_a_apple...
Add tests for 'a' vs. 'an' rule Closes #31.from check import Check from proselint.checks import mau_a_vs_an as chk class TestCheck(Check): __test__ = True @property def this_check(self): return chk def test_clean(self): assert self.check( """An apple a day keeps the doc...
<commit_before><commit_msg>Add tests for 'a' vs. 'an' rule Closes #31.<commit_after>from check import Check from proselint.checks import mau_a_vs_an as chk class TestCheck(Check): __test__ = True @property def this_check(self): return chk def test_clean(self): assert self.check( ...
8f91a2e8dea6076cdb148b53f6f938faad693ab1
kerrokantasi/migrations/0005_alter_user_first_name.py
kerrokantasi/migrations/0005_alter_user_first_name.py
# Generated by Django 3.2.13 on 2022-06-22 14:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kerrokantasi', '0004_auto_20200225_1349'), ] operations = [ migrations.AlterField( model_name='user', name='first_n...
Add missing migration for User
Add missing migration for User
Python
mit
City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi
Add missing migration for User
# Generated by Django 3.2.13 on 2022-06-22 14:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kerrokantasi', '0004_auto_20200225_1349'), ] operations = [ migrations.AlterField( model_name='user', name='first_n...
<commit_before><commit_msg>Add missing migration for User<commit_after>
# Generated by Django 3.2.13 on 2022-06-22 14:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kerrokantasi', '0004_auto_20200225_1349'), ] operations = [ migrations.AlterField( model_name='user', name='first_n...
Add missing migration for User# Generated by Django 3.2.13 on 2022-06-22 14:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kerrokantasi', '0004_auto_20200225_1349'), ] operations = [ migrations.AlterField( model_name='us...
<commit_before><commit_msg>Add missing migration for User<commit_after># Generated by Django 3.2.13 on 2022-06-22 14:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kerrokantasi', '0004_auto_20200225_1349'), ] operations = [ migratio...
1644f743996c950264a4be58ba0c58b013102828
testing/test_generate_movie.py
testing/test_generate_movie.py
import sys import os sys.path.insert(0, os.path.realpath('.')) import mimetypes from create_movie import generate_movie def test_generate_movie(tmpdir): images_dir = 'images' output_filename = tmpdir.join('out.mp4') generate_movie(images_dir, str(output_filename)) assert (os.path.isfile(str(output_fi...
Add test for generating movie
Add test for generating movie
Python
mit
NGTS/frame-movies,NGTS/frame-movies
Add test for generating movie
import sys import os sys.path.insert(0, os.path.realpath('.')) import mimetypes from create_movie import generate_movie def test_generate_movie(tmpdir): images_dir = 'images' output_filename = tmpdir.join('out.mp4') generate_movie(images_dir, str(output_filename)) assert (os.path.isfile(str(output_fi...
<commit_before><commit_msg>Add test for generating movie<commit_after>
import sys import os sys.path.insert(0, os.path.realpath('.')) import mimetypes from create_movie import generate_movie def test_generate_movie(tmpdir): images_dir = 'images' output_filename = tmpdir.join('out.mp4') generate_movie(images_dir, str(output_filename)) assert (os.path.isfile(str(output_fi...
Add test for generating movieimport sys import os sys.path.insert(0, os.path.realpath('.')) import mimetypes from create_movie import generate_movie def test_generate_movie(tmpdir): images_dir = 'images' output_filename = tmpdir.join('out.mp4') generate_movie(images_dir, str(output_filename)) assert ...
<commit_before><commit_msg>Add test for generating movie<commit_after>import sys import os sys.path.insert(0, os.path.realpath('.')) import mimetypes from create_movie import generate_movie def test_generate_movie(tmpdir): images_dir = 'images' output_filename = tmpdir.join('out.mp4') generate_movie(imag...
e7f75db6e2b1be77ce0382737a4679c15cac7167
website/tests/helpers/test_bioinf.py
website/tests/helpers/test_bioinf.py
import pytest import helpers.bioinf as bioinf def test_complement(): test_sequences = ( ('ACTCGGTAA', 'TGAGCCATT'), ('TGAGCCATT', 'ACTCGGTAA'), ('TTAAGGCC', 'AATTCCGG'), ) for sequence, complement in test_sequences: assert bioinf.complement(sequence) == complement def tes...
Add few tests for bioinf helpers
Add few tests for bioinf helpers
Python
lgpl-2.1
reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-M...
Add few tests for bioinf helpers
import pytest import helpers.bioinf as bioinf def test_complement(): test_sequences = ( ('ACTCGGTAA', 'TGAGCCATT'), ('TGAGCCATT', 'ACTCGGTAA'), ('TTAAGGCC', 'AATTCCGG'), ) for sequence, complement in test_sequences: assert bioinf.complement(sequence) == complement def tes...
<commit_before><commit_msg>Add few tests for bioinf helpers<commit_after>
import pytest import helpers.bioinf as bioinf def test_complement(): test_sequences = ( ('ACTCGGTAA', 'TGAGCCATT'), ('TGAGCCATT', 'ACTCGGTAA'), ('TTAAGGCC', 'AATTCCGG'), ) for sequence, complement in test_sequences: assert bioinf.complement(sequence) == complement def tes...
Add few tests for bioinf helpersimport pytest import helpers.bioinf as bioinf def test_complement(): test_sequences = ( ('ACTCGGTAA', 'TGAGCCATT'), ('TGAGCCATT', 'ACTCGGTAA'), ('TTAAGGCC', 'AATTCCGG'), ) for sequence, complement in test_sequences: assert bioinf.complement(s...
<commit_before><commit_msg>Add few tests for bioinf helpers<commit_after>import pytest import helpers.bioinf as bioinf def test_complement(): test_sequences = ( ('ACTCGGTAA', 'TGAGCCATT'), ('TGAGCCATT', 'ACTCGGTAA'), ('TTAAGGCC', 'AATTCCGG'), ) for sequence, complement in test_sequ...
f381214b4d05fb0c809888ea6362a4125ae3b779
test/Configure/VariantDir2.py
test/Configure/VariantDir2.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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 use, copy, modify, merge, publish, ...
Add test case for configure failure.
Add test case for configure failure. TryRun fails to find the executable when VariantDir is set up from SConscript/SConstruct. git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@4363 fdb21ef1-2011-0410-befe-b5e4ea1792b1
Python
mit
azverkan/scons,azverkan/scons,azverkan/scons,azverkan/scons,azverkan/scons
Add test case for configure failure. TryRun fails to find the executable when VariantDir is set up from SConscript/SConstruct. git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@4363 fdb21ef1-2011-0410-befe-b5e4ea1792b1
#!/usr/bin/env python # # __COPYRIGHT__ # # 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 use, copy, modify, merge, publish, ...
<commit_before><commit_msg>Add test case for configure failure. TryRun fails to find the executable when VariantDir is set up from SConscript/SConstruct. git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@4363 fdb21ef1-2011-0410-befe-b5e4ea1792b1<commit_after>
#!/usr/bin/env python # # __COPYRIGHT__ # # 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 use, copy, modify, merge, publish, ...
Add test case for configure failure. TryRun fails to find the executable when VariantDir is set up from SConscript/SConstruct. git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@4363 fdb21ef1-2011-0410-befe-b5e4ea1792b1#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any ...
<commit_before><commit_msg>Add test case for configure failure. TryRun fails to find the executable when VariantDir is set up from SConscript/SConstruct. git-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@4363 fdb21ef1-2011-0410-befe-b5e4ea1792b1<commit_after>#!/usr/bin/env python # # __COPYRIGHT__ # # Permission i...
0d3e94a4043347d671e7d898e382b11b1a5e1c23
qutip/tests/test_heom.py
qutip/tests/test_heom.py
""" Tests for qutip.nonmarkov.heom. """ from qutip.nonmarkov.heom import ( BathExponent, Bath, BosonicBath, DrudeLorentzBath, DrudeLorentzPadeBath, FermionicBath, HEOMSolver, BosonicHEOMSolver, FermionicHEOMSolver, HSolverDL, ) class TestBathAPI: def test_api(self): ...
Add tests for the heom module API.
Add tests for the heom module API.
Python
bsd-3-clause
qutip/qutip,qutip/qutip,cgranade/qutip,cgranade/qutip
Add tests for the heom module API.
""" Tests for qutip.nonmarkov.heom. """ from qutip.nonmarkov.heom import ( BathExponent, Bath, BosonicBath, DrudeLorentzBath, DrudeLorentzPadeBath, FermionicBath, HEOMSolver, BosonicHEOMSolver, FermionicHEOMSolver, HSolverDL, ) class TestBathAPI: def test_api(self): ...
<commit_before><commit_msg>Add tests for the heom module API.<commit_after>
""" Tests for qutip.nonmarkov.heom. """ from qutip.nonmarkov.heom import ( BathExponent, Bath, BosonicBath, DrudeLorentzBath, DrudeLorentzPadeBath, FermionicBath, HEOMSolver, BosonicHEOMSolver, FermionicHEOMSolver, HSolverDL, ) class TestBathAPI: def test_api(self): ...
Add tests for the heom module API.""" Tests for qutip.nonmarkov.heom. """ from qutip.nonmarkov.heom import ( BathExponent, Bath, BosonicBath, DrudeLorentzBath, DrudeLorentzPadeBath, FermionicBath, HEOMSolver, BosonicHEOMSolver, FermionicHEOMSolver, HSolverDL, ) class TestBathA...
<commit_before><commit_msg>Add tests for the heom module API.<commit_after>""" Tests for qutip.nonmarkov.heom. """ from qutip.nonmarkov.heom import ( BathExponent, Bath, BosonicBath, DrudeLorentzBath, DrudeLorentzPadeBath, FermionicBath, HEOMSolver, BosonicHEOMSolver, FermionicHEOMS...
8a2b6649481e204458b8a3895330e059a3d631c5
tests/unit/test_gitops.py
tests/unit/test_gitops.py
"""Tests for the GitOps deployment strategy.""" from . import pytest_generate_tests # noqa, pylint: disable=unused-import # pylint: disable=too-few-public-methods class TestGitops: """ Tests for verifying generated projects deployed using GitOps. """ scenarios = [ ('Pipeline', { '...
Add tests for GitOps deployment strategy
Add tests for GitOps deployment strategy
Python
apache-2.0
painless-software/painless-continuous-delivery,painless-software/painless-continuous-delivery,painless-software/painless-continuous-delivery,painless-software/painless-continuous-delivery
Add tests for GitOps deployment strategy
"""Tests for the GitOps deployment strategy.""" from . import pytest_generate_tests # noqa, pylint: disable=unused-import # pylint: disable=too-few-public-methods class TestGitops: """ Tests for verifying generated projects deployed using GitOps. """ scenarios = [ ('Pipeline', { '...
<commit_before><commit_msg>Add tests for GitOps deployment strategy<commit_after>
"""Tests for the GitOps deployment strategy.""" from . import pytest_generate_tests # noqa, pylint: disable=unused-import # pylint: disable=too-few-public-methods class TestGitops: """ Tests for verifying generated projects deployed using GitOps. """ scenarios = [ ('Pipeline', { '...
Add tests for GitOps deployment strategy"""Tests for the GitOps deployment strategy.""" from . import pytest_generate_tests # noqa, pylint: disable=unused-import # pylint: disable=too-few-public-methods class TestGitops: """ Tests for verifying generated projects deployed using GitOps. """ scenarios ...
<commit_before><commit_msg>Add tests for GitOps deployment strategy<commit_after>"""Tests for the GitOps deployment strategy.""" from . import pytest_generate_tests # noqa, pylint: disable=unused-import # pylint: disable=too-few-public-methods class TestGitops: """ Tests for verifying generated projects depl...
465f0156a6e92991ed277cd0434cc65f25ef8af8
examples/gto/20-soc_ao_integrals.py
examples/gto/20-soc_ao_integrals.py
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import numpy from pyscf import gto ''' Integrals for spin-orbit coupling ''' mol = gto.M( verbose = 0, atom = 'C 0 0 0; O 0 0 1.5', basis = 'ccpvdz' ) # J Chem Phys, 122, 034107, Eq (2) mat = 0 for atm_id in range(mol.natm): mol.s...
Add example for SOC integrals
Add example for SOC integrals
Python
apache-2.0
gkc1000/pyscf,sunqm/pyscf,sunqm/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf
Add example for SOC integrals
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import numpy from pyscf import gto ''' Integrals for spin-orbit coupling ''' mol = gto.M( verbose = 0, atom = 'C 0 0 0; O 0 0 1.5', basis = 'ccpvdz' ) # J Chem Phys, 122, 034107, Eq (2) mat = 0 for atm_id in range(mol.natm): mol.s...
<commit_before><commit_msg>Add example for SOC integrals<commit_after>
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import numpy from pyscf import gto ''' Integrals for spin-orbit coupling ''' mol = gto.M( verbose = 0, atom = 'C 0 0 0; O 0 0 1.5', basis = 'ccpvdz' ) # J Chem Phys, 122, 034107, Eq (2) mat = 0 for atm_id in range(mol.natm): mol.s...
Add example for SOC integrals#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import numpy from pyscf import gto ''' Integrals for spin-orbit coupling ''' mol = gto.M( verbose = 0, atom = 'C 0 0 0; O 0 0 1.5', basis = 'ccpvdz' ) # J Chem Phys, 122, 034107, Eq (2) mat = 0 for atm_id ...
<commit_before><commit_msg>Add example for SOC integrals<commit_after>#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import numpy from pyscf import gto ''' Integrals for spin-orbit coupling ''' mol = gto.M( verbose = 0, atom = 'C 0 0 0; O 0 0 1.5', basis = 'ccpvdz' ) # J Chem Phys...
1c5a7141e9f80e275acb3f758ca0657b1390fe24
python_scripts/extractor_python_readability_server.py
python_scripts/extractor_python_readability_server.py
#!/usr/bin/python import sys import glob sys.path.append("python_scripts/gen-py") sys.path.append("gen-py/thrift_solr/") from thrift.transport import TSocket from thrift.server import TServer #import thrift_solr import ExtractorService import readability import readability def extract_with_python_readability( r...
Add thrift Python readability server.
Add thrift Python readability server.
Python
agpl-3.0
AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter...
Add thrift Python readability server.
#!/usr/bin/python import sys import glob sys.path.append("python_scripts/gen-py") sys.path.append("gen-py/thrift_solr/") from thrift.transport import TSocket from thrift.server import TServer #import thrift_solr import ExtractorService import readability import readability def extract_with_python_readability( r...
<commit_before><commit_msg>Add thrift Python readability server.<commit_after>
#!/usr/bin/python import sys import glob sys.path.append("python_scripts/gen-py") sys.path.append("gen-py/thrift_solr/") from thrift.transport import TSocket from thrift.server import TServer #import thrift_solr import ExtractorService import readability import readability def extract_with_python_readability( r...
Add thrift Python readability server.#!/usr/bin/python import sys import glob sys.path.append("python_scripts/gen-py") sys.path.append("gen-py/thrift_solr/") from thrift.transport import TSocket from thrift.server import TServer #import thrift_solr import ExtractorService import readability import readability d...
<commit_before><commit_msg>Add thrift Python readability server.<commit_after>#!/usr/bin/python import sys import glob sys.path.append("python_scripts/gen-py") sys.path.append("gen-py/thrift_solr/") from thrift.transport import TSocket from thrift.server import TServer #import thrift_solr import ExtractorService ...
85e0c4d75bf8ccff20eff338242c6e37af1c705c
examples/dwaq_map_to_nc.py
examples/dwaq_map_to_nc.py
#!/usr/bin/env python """ Command-line tool to convert a binary map output to netcdf. """ from __future__ import print_function import argparse import sys,os import numpy as np import stompy.model.delft.io as dio parser = argparse.ArgumentParser(description='Convert D-WAQ binary map output to NetCDF.') parser.add_a...
Add CLI for converting dwaq binary map to nc
Add CLI for converting dwaq binary map to nc
Python
mit
rustychris/stompy,rustychris/stompy
Add CLI for converting dwaq binary map to nc
#!/usr/bin/env python """ Command-line tool to convert a binary map output to netcdf. """ from __future__ import print_function import argparse import sys,os import numpy as np import stompy.model.delft.io as dio parser = argparse.ArgumentParser(description='Convert D-WAQ binary map output to NetCDF.') parser.add_a...
<commit_before><commit_msg>Add CLI for converting dwaq binary map to nc<commit_after>
#!/usr/bin/env python """ Command-line tool to convert a binary map output to netcdf. """ from __future__ import print_function import argparse import sys,os import numpy as np import stompy.model.delft.io as dio parser = argparse.ArgumentParser(description='Convert D-WAQ binary map output to NetCDF.') parser.add_a...
Add CLI for converting dwaq binary map to nc#!/usr/bin/env python """ Command-line tool to convert a binary map output to netcdf. """ from __future__ import print_function import argparse import sys,os import numpy as np import stompy.model.delft.io as dio parser = argparse.ArgumentParser(description='Convert D-WAQ ...
<commit_before><commit_msg>Add CLI for converting dwaq binary map to nc<commit_after>#!/usr/bin/env python """ Command-line tool to convert a binary map output to netcdf. """ from __future__ import print_function import argparse import sys,os import numpy as np import stompy.model.delft.io as dio parser = argparse.A...
cf978fed09339dc31a665fc508516961c52565f2
examples/modelsummaries.py
examples/modelsummaries.py
""" This example: 1. Connects to the current model 2. Starts an AllWatcher 3. Prints all changes received from the AllWatcher 4. Runs forever (kill with Ctrl-C) """ import asyncio import logging from juju import loop from juju.controller import Controller from juju.model import Model async def watch(): control...
Add the model summary example.
Add the model summary example.
Python
apache-2.0
juju/python-libjuju,juju/python-libjuju
Add the model summary example.
""" This example: 1. Connects to the current model 2. Starts an AllWatcher 3. Prints all changes received from the AllWatcher 4. Runs forever (kill with Ctrl-C) """ import asyncio import logging from juju import loop from juju.controller import Controller from juju.model import Model async def watch(): control...
<commit_before><commit_msg>Add the model summary example.<commit_after>
""" This example: 1. Connects to the current model 2. Starts an AllWatcher 3. Prints all changes received from the AllWatcher 4. Runs forever (kill with Ctrl-C) """ import asyncio import logging from juju import loop from juju.controller import Controller from juju.model import Model async def watch(): control...
Add the model summary example.""" This example: 1. Connects to the current model 2. Starts an AllWatcher 3. Prints all changes received from the AllWatcher 4. Runs forever (kill with Ctrl-C) """ import asyncio import logging from juju import loop from juju.controller import Controller from juju.model import Model ...
<commit_before><commit_msg>Add the model summary example.<commit_after>""" This example: 1. Connects to the current model 2. Starts an AllWatcher 3. Prints all changes received from the AllWatcher 4. Runs forever (kill with Ctrl-C) """ import asyncio import logging from juju import loop from juju.controller import C...
4ae010a286f6660fbbad38f6f867c5d185eac784
test.py
test.py
#!/usr/bin/env python import sys; sys.path.insert(0, './src/') import libcask.container cont = libcask.container.Container( name='Example', root_path='/home/dev/cask/containers/example/', pid_path='/home/dev/cask/pid/example', hostname='exampl', ipaddr='10.1.1.1', ipaddr_host='10.1.1.2', en...
Add placeholder CLI interface to libcask.container.Container
Add placeholder CLI interface to libcask.container.Container
Python
mit
ianpreston/cask,ianpreston/cask
Add placeholder CLI interface to libcask.container.Container
#!/usr/bin/env python import sys; sys.path.insert(0, './src/') import libcask.container cont = libcask.container.Container( name='Example', root_path='/home/dev/cask/containers/example/', pid_path='/home/dev/cask/pid/example', hostname='exampl', ipaddr='10.1.1.1', ipaddr_host='10.1.1.2', en...
<commit_before><commit_msg>Add placeholder CLI interface to libcask.container.Container<commit_after>
#!/usr/bin/env python import sys; sys.path.insert(0, './src/') import libcask.container cont = libcask.container.Container( name='Example', root_path='/home/dev/cask/containers/example/', pid_path='/home/dev/cask/pid/example', hostname='exampl', ipaddr='10.1.1.1', ipaddr_host='10.1.1.2', en...
Add placeholder CLI interface to libcask.container.Container#!/usr/bin/env python import sys; sys.path.insert(0, './src/') import libcask.container cont = libcask.container.Container( name='Example', root_path='/home/dev/cask/containers/example/', pid_path='/home/dev/cask/pid/example', hostname='exampl...
<commit_before><commit_msg>Add placeholder CLI interface to libcask.container.Container<commit_after>#!/usr/bin/env python import sys; sys.path.insert(0, './src/') import libcask.container cont = libcask.container.Container( name='Example', root_path='/home/dev/cask/containers/example/', pid_path='/home/de...
099e42bb6264ddb67136d8c6d13926605c2f525c
tube.py
tube.py
from __future__ import unicode_literals import dateutil.parser def get_playlists(client): playlists = [] def process(item): snippet = item['snippet'] p = { 'id': item['id'], 'title': snippet['title'], 'description': snippet['description'], } ...
Add playlist list and playlist video list getters
Add playlist list and playlist video list getters
Python
mit
drkitty/metatube,drkitty/metatube
Add playlist list and playlist video list getters
from __future__ import unicode_literals import dateutil.parser def get_playlists(client): playlists = [] def process(item): snippet = item['snippet'] p = { 'id': item['id'], 'title': snippet['title'], 'description': snippet['description'], } ...
<commit_before><commit_msg>Add playlist list and playlist video list getters<commit_after>
from __future__ import unicode_literals import dateutil.parser def get_playlists(client): playlists = [] def process(item): snippet = item['snippet'] p = { 'id': item['id'], 'title': snippet['title'], 'description': snippet['description'], } ...
Add playlist list and playlist video list gettersfrom __future__ import unicode_literals import dateutil.parser def get_playlists(client): playlists = [] def process(item): snippet = item['snippet'] p = { 'id': item['id'], 'title': snippet['title'], 'descr...
<commit_before><commit_msg>Add playlist list and playlist video list getters<commit_after>from __future__ import unicode_literals import dateutil.parser def get_playlists(client): playlists = [] def process(item): snippet = item['snippet'] p = { 'id': item['id'], 'tit...
ecaaaf3ef2373563a19be39981251b4201a20dc2
chrome_frame/tools/helper_shutdown.py
chrome_frame/tools/helper_shutdown.py
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''This is a simple helper script to shut down the Chrome Frame helper process. It needs the Python Win32 extensions.''' import pywintypes import sys imp...
Add a tiny helper script to shutdown the chrome frame helper process.
Add a tiny helper script to shutdown the chrome frame helper process. BUG=53127 TEST=Run script, chrome_frame_helper.exe is shut down. Review URL: http://codereview.chromium.org/3312010 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@58587 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,yitian134/c...
Add a tiny helper script to shutdown the chrome frame helper process. BUG=53127 TEST=Run script, chrome_frame_helper.exe is shut down. Review URL: http://codereview.chromium.org/3312010 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@58587 0039d316-1c4b-4281-b951-d872f2087c98
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''This is a simple helper script to shut down the Chrome Frame helper process. It needs the Python Win32 extensions.''' import pywintypes import sys imp...
<commit_before><commit_msg>Add a tiny helper script to shutdown the chrome frame helper process. BUG=53127 TEST=Run script, chrome_frame_helper.exe is shut down. Review URL: http://codereview.chromium.org/3312010 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@58587 0039d316-1c4b-4281-b951-d872f2087c98<commit_...
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''This is a simple helper script to shut down the Chrome Frame helper process. It needs the Python Win32 extensions.''' import pywintypes import sys imp...
Add a tiny helper script to shutdown the chrome frame helper process. BUG=53127 TEST=Run script, chrome_frame_helper.exe is shut down. Review URL: http://codereview.chromium.org/3312010 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@58587 0039d316-1c4b-4281-b951-d872f2087c98# Copyright (c) 2010 The Chromium A...
<commit_before><commit_msg>Add a tiny helper script to shutdown the chrome frame helper process. BUG=53127 TEST=Run script, chrome_frame_helper.exe is shut down. Review URL: http://codereview.chromium.org/3312010 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@58587 0039d316-1c4b-4281-b951-d872f2087c98<commit_...
225fb524d67faeaa6d5af837f53c25b232b0b43e
altair/examples/scatter_linked_table.py
altair/examples/scatter_linked_table.py
""" Brushing Scatter Plot to show data on a table --------------------------------- A scatter plot of the cars dataset, with data tables for horsepower, MPG, and origin. The tables update toreflect the selection on the scatter plot. """ # category: scatter plots import altair as alt from vega_datasets import...
Create brushing scatter plot to show data on a table example
Create brushing scatter plot to show data on a table example
Python
bsd-3-clause
altair-viz/altair,jakevdp/altair
Create brushing scatter plot to show data on a table example
""" Brushing Scatter Plot to show data on a table --------------------------------- A scatter plot of the cars dataset, with data tables for horsepower, MPG, and origin. The tables update toreflect the selection on the scatter plot. """ # category: scatter plots import altair as alt from vega_datasets import...
<commit_before><commit_msg>Create brushing scatter plot to show data on a table example<commit_after>
""" Brushing Scatter Plot to show data on a table --------------------------------- A scatter plot of the cars dataset, with data tables for horsepower, MPG, and origin. The tables update toreflect the selection on the scatter plot. """ # category: scatter plots import altair as alt from vega_datasets import...
Create brushing scatter plot to show data on a table example""" Brushing Scatter Plot to show data on a table --------------------------------- A scatter plot of the cars dataset, with data tables for horsepower, MPG, and origin. The tables update toreflect the selection on the scatter plot. """ # category: scat...
<commit_before><commit_msg>Create brushing scatter plot to show data on a table example<commit_after>""" Brushing Scatter Plot to show data on a table --------------------------------- A scatter plot of the cars dataset, with data tables for horsepower, MPG, and origin. The tables update toreflect the selection on...
ba6673615deeb776919ef98fb4f0b3a07fb80801
hackerrank/mini_max_sum.py
hackerrank/mini_max_sum.py
#!/bin/python3 # https://www.hackerrank.com/challenges/mini-max-sum/problem """ The algorithm used to solve this problem is the following: 1. Get the minimum element of the array 2. Get the maximum element of the array 3. Get the sum of all the elements in the array 4. Calculate the min sum -> sum(arr) - max_element ...
Add solution to the problem Mini-Max Sum
Add solution to the problem Mini-Max Sum
Python
mit
julianespinel/training,julianespinel/training,julianespinel/training,julianespinel/trainning,julianespinel/trainning,julianespinel/training
Add solution to the problem Mini-Max Sum
#!/bin/python3 # https://www.hackerrank.com/challenges/mini-max-sum/problem """ The algorithm used to solve this problem is the following: 1. Get the minimum element of the array 2. Get the maximum element of the array 3. Get the sum of all the elements in the array 4. Calculate the min sum -> sum(arr) - max_element ...
<commit_before><commit_msg>Add solution to the problem Mini-Max Sum<commit_after>
#!/bin/python3 # https://www.hackerrank.com/challenges/mini-max-sum/problem """ The algorithm used to solve this problem is the following: 1. Get the minimum element of the array 2. Get the maximum element of the array 3. Get the sum of all the elements in the array 4. Calculate the min sum -> sum(arr) - max_element ...
Add solution to the problem Mini-Max Sum#!/bin/python3 # https://www.hackerrank.com/challenges/mini-max-sum/problem """ The algorithm used to solve this problem is the following: 1. Get the minimum element of the array 2. Get the maximum element of the array 3. Get the sum of all the elements in the array 4. Calculat...
<commit_before><commit_msg>Add solution to the problem Mini-Max Sum<commit_after>#!/bin/python3 # https://www.hackerrank.com/challenges/mini-max-sum/problem """ The algorithm used to solve this problem is the following: 1. Get the minimum element of the array 2. Get the maximum element of the array 3. Get the sum of ...
aa215f1d5e6059517c3f7e13287434fd7e193e26
examples/sector-coupling/battery-electric-vehicle-charging.py
examples/sector-coupling/battery-electric-vehicle-charging.py
## Battery Electric Vehicle Charging # #In this example a battery electric vehicle (BEV) is driven 100 km in the morning and 100 km in the evening, to simulate commuting, and charged during the day by a solar panel at the driver's place of work. The size of the panel is computed by the optimisation. # #The BEV has a ba...
Add Battery Electric Vehicle (BEV) charging example
Add Battery Electric Vehicle (BEV) charging example
Python
mit
PyPSA/PyPSA
Add Battery Electric Vehicle (BEV) charging example
## Battery Electric Vehicle Charging # #In this example a battery electric vehicle (BEV) is driven 100 km in the morning and 100 km in the evening, to simulate commuting, and charged during the day by a solar panel at the driver's place of work. The size of the panel is computed by the optimisation. # #The BEV has a ba...
<commit_before><commit_msg>Add Battery Electric Vehicle (BEV) charging example<commit_after>
## Battery Electric Vehicle Charging # #In this example a battery electric vehicle (BEV) is driven 100 km in the morning and 100 km in the evening, to simulate commuting, and charged during the day by a solar panel at the driver's place of work. The size of the panel is computed by the optimisation. # #The BEV has a ba...
Add Battery Electric Vehicle (BEV) charging example## Battery Electric Vehicle Charging # #In this example a battery electric vehicle (BEV) is driven 100 km in the morning and 100 km in the evening, to simulate commuting, and charged during the day by a solar panel at the driver's place of work. The size of the panel i...
<commit_before><commit_msg>Add Battery Electric Vehicle (BEV) charging example<commit_after>## Battery Electric Vehicle Charging # #In this example a battery electric vehicle (BEV) is driven 100 km in the morning and 100 km in the evening, to simulate commuting, and charged during the day by a solar panel at the driver...
47cb213be2071ad77f75d350ead4cfd7c7dc2d62
py/increasing-triplet-subsequence.py
py/increasing-triplet-subsequence.py
class Solution(object): def increasingTriplet(self, nums): """ :type nums: List[int] :rtype: bool """ first, second = None, None for n in nums: if first is None or n <= first: first = n elif second is None or n <= second: ...
Add py solution for 334. Increasing Triplet Subsequence
Add py solution for 334. Increasing Triplet Subsequence 334. Increasing Triplet Subsequence: https://leetcode.com/problems/increasing-triplet-subsequence/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 334. Increasing Triplet Subsequence 334. Increasing Triplet Subsequence: https://leetcode.com/problems/increasing-triplet-subsequence/
class Solution(object): def increasingTriplet(self, nums): """ :type nums: List[int] :rtype: bool """ first, second = None, None for n in nums: if first is None or n <= first: first = n elif second is None or n <= second: ...
<commit_before><commit_msg>Add py solution for 334. Increasing Triplet Subsequence 334. Increasing Triplet Subsequence: https://leetcode.com/problems/increasing-triplet-subsequence/<commit_after>
class Solution(object): def increasingTriplet(self, nums): """ :type nums: List[int] :rtype: bool """ first, second = None, None for n in nums: if first is None or n <= first: first = n elif second is None or n <= second: ...
Add py solution for 334. Increasing Triplet Subsequence 334. Increasing Triplet Subsequence: https://leetcode.com/problems/increasing-triplet-subsequence/class Solution(object): def increasingTriplet(self, nums): """ :type nums: List[int] :rtype: bool """ first, second = Non...
<commit_before><commit_msg>Add py solution for 334. Increasing Triplet Subsequence 334. Increasing Triplet Subsequence: https://leetcode.com/problems/increasing-triplet-subsequence/<commit_after>class Solution(object): def increasingTriplet(self, nums): """ :type nums: List[int] :rtype: boo...
fc772d73549d9a99188cf0534eba7d2f1e0a52d7
teuthology/test/test_schedule.py
teuthology/test/test_schedule.py
from ..schedule import build_config from ..misc import get_user class TestSchedule(object): basic_args = { '--verbose': False, '--owner': 'OWNER', '--description': 'DESC', '--email': 'EMAIL', '--last-in-suite': True, '--name': 'NAME', '--worker': 'tala', ...
Add a couple tests for teuthology.schedule
Add a couple tests for teuthology.schedule Signed-off-by: Zack Cerza <f801c831581d4150a2793939287636221d62131e@inktank.com>
Python
mit
michaelsevilla/teuthology,ktdreyer/teuthology,robbat2/teuthology,tchaikov/teuthology,zhouyuan/teuthology,tchaikov/teuthology,t-miyamae/teuthology,dmick/teuthology,yghannam/teuthology,yghannam/teuthology,ivotron/teuthology,dmick/teuthology,ceph/teuthology,SUSE/teuthology,robbat2/teuthology,dreamhost/teuthology,SUSE/teut...
Add a couple tests for teuthology.schedule Signed-off-by: Zack Cerza <f801c831581d4150a2793939287636221d62131e@inktank.com>
from ..schedule import build_config from ..misc import get_user class TestSchedule(object): basic_args = { '--verbose': False, '--owner': 'OWNER', '--description': 'DESC', '--email': 'EMAIL', '--last-in-suite': True, '--name': 'NAME', '--worker': 'tala', ...
<commit_before><commit_msg>Add a couple tests for teuthology.schedule Signed-off-by: Zack Cerza <f801c831581d4150a2793939287636221d62131e@inktank.com><commit_after>
from ..schedule import build_config from ..misc import get_user class TestSchedule(object): basic_args = { '--verbose': False, '--owner': 'OWNER', '--description': 'DESC', '--email': 'EMAIL', '--last-in-suite': True, '--name': 'NAME', '--worker': 'tala', ...
Add a couple tests for teuthology.schedule Signed-off-by: Zack Cerza <f801c831581d4150a2793939287636221d62131e@inktank.com>from ..schedule import build_config from ..misc import get_user class TestSchedule(object): basic_args = { '--verbose': False, '--owner': 'OWNER', '--description': 'D...
<commit_before><commit_msg>Add a couple tests for teuthology.schedule Signed-off-by: Zack Cerza <f801c831581d4150a2793939287636221d62131e@inktank.com><commit_after>from ..schedule import build_config from ..misc import get_user class TestSchedule(object): basic_args = { '--verbose': False, '--own...
4812103b4d9be418aecdc64341fb32be7865f113
core/backends/IUnikernelBackend.py
core/backends/IUnikernelBackend.py
from abc import ABCMeta, abstractmethod class IUnikernelBackend(object): """ Interface that must be implemented by every Unikernel Backend. It contains method stubs used by the REST API provider and other components. Redefinition of functions decorated with @asbstractmethod is compulsory. """ ...
Add interface for unikernel backends to implement
Add interface for unikernel backends to implement
Python
apache-2.0
onyb/dune,adyasha/dune,adyasha/dune,adyasha/dune
Add interface for unikernel backends to implement
from abc import ABCMeta, abstractmethod class IUnikernelBackend(object): """ Interface that must be implemented by every Unikernel Backend. It contains method stubs used by the REST API provider and other components. Redefinition of functions decorated with @asbstractmethod is compulsory. """ ...
<commit_before><commit_msg>Add interface for unikernel backends to implement<commit_after>
from abc import ABCMeta, abstractmethod class IUnikernelBackend(object): """ Interface that must be implemented by every Unikernel Backend. It contains method stubs used by the REST API provider and other components. Redefinition of functions decorated with @asbstractmethod is compulsory. """ ...
Add interface for unikernel backends to implementfrom abc import ABCMeta, abstractmethod class IUnikernelBackend(object): """ Interface that must be implemented by every Unikernel Backend. It contains method stubs used by the REST API provider and other components. Redefinition of functions decorated...
<commit_before><commit_msg>Add interface for unikernel backends to implement<commit_after>from abc import ABCMeta, abstractmethod class IUnikernelBackend(object): """ Interface that must be implemented by every Unikernel Backend. It contains method stubs used by the REST API provider and other components....
2f644f8439e63f7e621825e2036701c3bbcf311a
zephyr/management/commands/delete_tutorial_streams.py
zephyr/management/commands/delete_tutorial_streams.py
from django.core.management.base import BaseCommand from zephyr.models import UserProfile, Subscription, Recipient, Message, Stream from django.db.models import Q import datetime import pytz from optparse import make_option class Command(BaseCommand): help = """Delete all inactive tutorial stream subscriptions.""...
Add a management command to clean up lingering tutorial streams.
Add a management command to clean up lingering tutorial streams. We now clean up the stream subscription in more places, but some historical tutorial streams are still around and if an error or page reload happens during the tutorial it'll stick around. (imported from commit 8cf0ebda26bf752c1a23296a4ba85d194bbb3004)
Python
apache-2.0
bowlofstew/zulip,JPJPJPOPOP/zulip,isht3/zulip,qq1012803704/zulip,hj3938/zulip,Frouk/zulip,Gabriel0402/zulip,karamcnair/zulip,he15his/zulip,hengqujushi/zulip,schatt/zulip,paxapy/zulip,mdavid/zulip,bluesea/zulip,jackrzhang/zulip,littledogboy/zulip,niftynei/zulip,isht3/zulip,LAndreas/zulip,amallia/zulip,mahim97/zulip,JPJP...
Add a management command to clean up lingering tutorial streams. We now clean up the stream subscription in more places, but some historical tutorial streams are still around and if an error or page reload happens during the tutorial it'll stick around. (imported from commit 8cf0ebda26bf752c1a23296a4ba85d194bbb3004)
from django.core.management.base import BaseCommand from zephyr.models import UserProfile, Subscription, Recipient, Message, Stream from django.db.models import Q import datetime import pytz from optparse import make_option class Command(BaseCommand): help = """Delete all inactive tutorial stream subscriptions.""...
<commit_before><commit_msg>Add a management command to clean up lingering tutorial streams. We now clean up the stream subscription in more places, but some historical tutorial streams are still around and if an error or page reload happens during the tutorial it'll stick around. (imported from commit 8cf0ebda26bf752...
from django.core.management.base import BaseCommand from zephyr.models import UserProfile, Subscription, Recipient, Message, Stream from django.db.models import Q import datetime import pytz from optparse import make_option class Command(BaseCommand): help = """Delete all inactive tutorial stream subscriptions.""...
Add a management command to clean up lingering tutorial streams. We now clean up the stream subscription in more places, but some historical tutorial streams are still around and if an error or page reload happens during the tutorial it'll stick around. (imported from commit 8cf0ebda26bf752c1a23296a4ba85d194bbb3004)f...
<commit_before><commit_msg>Add a management command to clean up lingering tutorial streams. We now clean up the stream subscription in more places, but some historical tutorial streams are still around and if an error or page reload happens during the tutorial it'll stick around. (imported from commit 8cf0ebda26bf752...
d668f4eb7c8dd033eca66cca18bf01ab5fb52233
blimp/utils/shortcuts.py
blimp/utils/shortcuts.py
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect from django.shortcuts import resolve_url def redirect_with_params(request, to, *args, **kwargs): """ Returns an HttpResponseRedirect to the appropriate URL for the arguments passed. By default issues a temporary redirect; pass...
Implement shortcut method to redirect with params
Implement shortcut method to redirect with params
Python
agpl-3.0
jessamynsmith/boards-backend,jessamynsmith/boards-backend,GetBlimp/boards-backend
Implement shortcut method to redirect with params
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect from django.shortcuts import resolve_url def redirect_with_params(request, to, *args, **kwargs): """ Returns an HttpResponseRedirect to the appropriate URL for the arguments passed. By default issues a temporary redirect; pass...
<commit_before><commit_msg>Implement shortcut method to redirect with params<commit_after>
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect from django.shortcuts import resolve_url def redirect_with_params(request, to, *args, **kwargs): """ Returns an HttpResponseRedirect to the appropriate URL for the arguments passed. By default issues a temporary redirect; pass...
Implement shortcut method to redirect with paramsfrom django.http import HttpResponseRedirect, HttpResponsePermanentRedirect from django.shortcuts import resolve_url def redirect_with_params(request, to, *args, **kwargs): """ Returns an HttpResponseRedirect to the appropriate URL for the arguments passed....
<commit_before><commit_msg>Implement shortcut method to redirect with params<commit_after>from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect from django.shortcuts import resolve_url def redirect_with_params(request, to, *args, **kwargs): """ Returns an HttpResponseRedirect to the appr...
cb8c664f69dd6eede4d6bee48b6d84f3aeaf2218
json_parser/json_parser.py
json_parser/json_parser.py
import json jsonFile = open('output.json', 'r') lines = jsonFile.readlines() # lines[1] since the first line is an empty result # the 2 lines combined do not form a valid json structure, but each line itself is a json structure values = json.loads(lines[1]) transcript = values['result'][0]['alternative'][0]['transcr...
Add json parsing for the curl response (already referenced in the main script)
Add json parsing for the curl response (already referenced in the main script)
Python
mit
Nespa32/sm_project,Nespa32/sm_project,Nespa32/sm_project,Nespa32/sm_project,Nespa32/sm_project
Add json parsing for the curl response (already referenced in the main script)
import json jsonFile = open('output.json', 'r') lines = jsonFile.readlines() # lines[1] since the first line is an empty result # the 2 lines combined do not form a valid json structure, but each line itself is a json structure values = json.loads(lines[1]) transcript = values['result'][0]['alternative'][0]['transcr...
<commit_before><commit_msg>Add json parsing for the curl response (already referenced in the main script)<commit_after>
import json jsonFile = open('output.json', 'r') lines = jsonFile.readlines() # lines[1] since the first line is an empty result # the 2 lines combined do not form a valid json structure, but each line itself is a json structure values = json.loads(lines[1]) transcript = values['result'][0]['alternative'][0]['transcr...
Add json parsing for the curl response (already referenced in the main script)import json jsonFile = open('output.json', 'r') lines = jsonFile.readlines() # lines[1] since the first line is an empty result # the 2 lines combined do not form a valid json structure, but each line itself is a json structure values = jso...
<commit_before><commit_msg>Add json parsing for the curl response (already referenced in the main script)<commit_after>import json jsonFile = open('output.json', 'r') lines = jsonFile.readlines() # lines[1] since the first line is an empty result # the 2 lines combined do not form a valid json structure, but each lin...
22198994d98c3d383fa38513f5de968cb8dcde27
CheckUpdatedVulnerableEntries.py
CheckUpdatedVulnerableEntries.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import json import os import re import sys import requests def getCurrentVersion(package): # https://wiki.archlinux.org/index.php/Official_repositories_web_interface url = "https://www.archlinux.org/packages/search/json/?name=...
Add a tool to detect update in packages with pending issues
Add a tool to detect update in packages with pending issues
Python
mpl-2.0
rgacogne/ArchCVEToJSON
Add a tool to detect update in packages with pending issues
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import json import os import re import sys import requests def getCurrentVersion(package): # https://wiki.archlinux.org/index.php/Official_repositories_web_interface url = "https://www.archlinux.org/packages/search/json/?name=...
<commit_before><commit_msg>Add a tool to detect update in packages with pending issues<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import json import os import re import sys import requests def getCurrentVersion(package): # https://wiki.archlinux.org/index.php/Official_repositories_web_interface url = "https://www.archlinux.org/packages/search/json/?name=...
Add a tool to detect update in packages with pending issues#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import json import os import re import sys import requests def getCurrentVersion(package): # https://wiki.archlinux.org/index.php/Official_repositories_web_interface u...
<commit_before><commit_msg>Add a tool to detect update in packages with pending issues<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import json import os import re import sys import requests def getCurrentVersion(package): # https://wiki.archlinux.org/index.php/...
86f276416ee70470d33ec7f481cf2d69b6956b36
IPython/kernel/tests/test_kernelspec.py
IPython/kernel/tests/test_kernelspec.py
import json import os from os.path import join as pjoin import unittest from IPython.utils.tempdir import TemporaryDirectory from IPython.kernel import kernelspec sample_kernel_json = {'argv':['cat', '{connection_file}'], 'display_name':'Test kernel', 'language':'bash', ...
Add simple tests for kernel spec machinery
Add simple tests for kernel spec machinery
Python
bsd-3-clause
ipython/ipython,ipython/ipython
Add simple tests for kernel spec machinery
import json import os from os.path import join as pjoin import unittest from IPython.utils.tempdir import TemporaryDirectory from IPython.kernel import kernelspec sample_kernel_json = {'argv':['cat', '{connection_file}'], 'display_name':'Test kernel', 'language':'bash', ...
<commit_before><commit_msg>Add simple tests for kernel spec machinery<commit_after>
import json import os from os.path import join as pjoin import unittest from IPython.utils.tempdir import TemporaryDirectory from IPython.kernel import kernelspec sample_kernel_json = {'argv':['cat', '{connection_file}'], 'display_name':'Test kernel', 'language':'bash', ...
Add simple tests for kernel spec machineryimport json import os from os.path import join as pjoin import unittest from IPython.utils.tempdir import TemporaryDirectory from IPython.kernel import kernelspec sample_kernel_json = {'argv':['cat', '{connection_file}'], 'display_name':'Test kernel', ...
<commit_before><commit_msg>Add simple tests for kernel spec machinery<commit_after>import json import os from os.path import join as pjoin import unittest from IPython.utils.tempdir import TemporaryDirectory from IPython.kernel import kernelspec sample_kernel_json = {'argv':['cat', '{connection_file}'], ...
46c64c4612417a16fb8027c39e252f5d4a44378b
mindbender/maya/tests/test_workflow.py
mindbender/maya/tests/test_workflow.py
"""Integration tests These tests include external libraries in order to test the integration between them. """ import os import sys import shutil import tempfile from maya import cmds import pyblish_maya import pyblish.api import pyblish.util from mindbender import api, maya from nose.tools import ( assert_e...
Add initial workflow test. This is an example of how workflow can be automatically tested. In this case, the modeling workflow is tested. If something is done here that isn't valid, and is caught during validation, this test would fail.
Add initial workflow test. This is an example of how workflow can be automatically tested. In this case, the modeling workflow is tested. If something is done here that isn't valid, and is caught during validation, this test would fail. Update this test whenever the modeling workflow changes, and keep an eye out for w...
Python
mit
getavalon/core,MoonShineVFX/core,mindbender-studio/core,MoonShineVFX/core,mindbender-studio/core,getavalon/core
Add initial workflow test. This is an example of how workflow can be automatically tested. In this case, the modeling workflow is tested. If something is done here that isn't valid, and is caught during validation, this test would fail. Update this test whenever the modeling workflow changes, and keep an eye out for w...
"""Integration tests These tests include external libraries in order to test the integration between them. """ import os import sys import shutil import tempfile from maya import cmds import pyblish_maya import pyblish.api import pyblish.util from mindbender import api, maya from nose.tools import ( assert_e...
<commit_before><commit_msg>Add initial workflow test. This is an example of how workflow can be automatically tested. In this case, the modeling workflow is tested. If something is done here that isn't valid, and is caught during validation, this test would fail. Update this test whenever the modeling workflow changes...
"""Integration tests These tests include external libraries in order to test the integration between them. """ import os import sys import shutil import tempfile from maya import cmds import pyblish_maya import pyblish.api import pyblish.util from mindbender import api, maya from nose.tools import ( assert_e...
Add initial workflow test. This is an example of how workflow can be automatically tested. In this case, the modeling workflow is tested. If something is done here that isn't valid, and is caught during validation, this test would fail. Update this test whenever the modeling workflow changes, and keep an eye out for w...
<commit_before><commit_msg>Add initial workflow test. This is an example of how workflow can be automatically tested. In this case, the modeling workflow is tested. If something is done here that isn't valid, and is caught during validation, this test would fail. Update this test whenever the modeling workflow changes...
d42bc4c14ca9a4f819c2ef3dccbfa916b381b959
tests/print_view_controller_hierarchy_test.py
tests/print_view_controller_hierarchy_test.py
import re import unittest from test_utils import import_utils import_utils.prepare_lldb_import_or_exit() import lldb import_utils.prepare_for_scripts_imports() from scripts import print_view_controller_hierarchy class PrintViewControllerHierarchyTest(unittest.TestCase): def testPrintViewControllerHierarchy(self)...
Add the first unit test.
Add the first unit test.
Python
mit
mrhappyasthma/happydebugging,mrhappyasthma/HappyDebugging
Add the first unit test.
import re import unittest from test_utils import import_utils import_utils.prepare_lldb_import_or_exit() import lldb import_utils.prepare_for_scripts_imports() from scripts import print_view_controller_hierarchy class PrintViewControllerHierarchyTest(unittest.TestCase): def testPrintViewControllerHierarchy(self)...
<commit_before><commit_msg>Add the first unit test.<commit_after>
import re import unittest from test_utils import import_utils import_utils.prepare_lldb_import_or_exit() import lldb import_utils.prepare_for_scripts_imports() from scripts import print_view_controller_hierarchy class PrintViewControllerHierarchyTest(unittest.TestCase): def testPrintViewControllerHierarchy(self)...
Add the first unit test.import re import unittest from test_utils import import_utils import_utils.prepare_lldb_import_or_exit() import lldb import_utils.prepare_for_scripts_imports() from scripts import print_view_controller_hierarchy class PrintViewControllerHierarchyTest(unittest.TestCase): def testPrintViewC...
<commit_before><commit_msg>Add the first unit test.<commit_after>import re import unittest from test_utils import import_utils import_utils.prepare_lldb_import_or_exit() import lldb import_utils.prepare_for_scripts_imports() from scripts import print_view_controller_hierarchy class PrintViewControllerHierarchyTest...
fe257b061292df122064765db0f06c49b01b3ed7
ad-hoc-scripts/lift.py
ad-hoc-scripts/lift.py
#! /usr/bin/env python3 import sys import json with open(sys.argv[1]) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-constant", "special-function" ] for term in equajson["unicode-pretty-print"]["terms"]...
Make a script to automatically move to new schema.
Make a script to automatically move to new schema.
Python
mit
nbeaver/equajson
Make a script to automatically move to new schema.
#! /usr/bin/env python3 import sys import json with open(sys.argv[1]) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-constant", "special-function" ] for term in equajson["unicode-pretty-print"]["terms"]...
<commit_before><commit_msg>Make a script to automatically move to new schema.<commit_after>
#! /usr/bin/env python3 import sys import json with open(sys.argv[1]) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-constant", "special-function" ] for term in equajson["unicode-pretty-print"]["terms"]...
Make a script to automatically move to new schema.#! /usr/bin/env python3 import sys import json with open(sys.argv[1]) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-constant", "special-function" ] for...
<commit_before><commit_msg>Make a script to automatically move to new schema.<commit_after>#! /usr/bin/env python3 import sys import json with open(sys.argv[1]) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixe...
c90f64a57b02035c87c000e06025c59736fad9ba
WDL_Pipelines/GATK_from_bam/check_completion_status.py
WDL_Pipelines/GATK_from_bam/check_completion_status.py
#! /usr/bin/python ''' Checks a Google genomics pipeline submission and prints status. ''' import argparse import subprocess import yaml def check_status(code): ''' Checks status with locally installed gsutil (in PATH). ''' script = ' '.join(["gcloud alpha genomics operations describe", ...
Add post-submission status check script.
Add post-submission status check script.
Python
bsd-2-clause
dkdeconti/DFCI-CCCB-GATK-Cloud-pipeline,dkdeconti/DFCI-CCCB-GATK-Cloud-pipeline,dkdeconti/DFCI-CCCB-GATK-Cloud-pipeline
Add post-submission status check script.
#! /usr/bin/python ''' Checks a Google genomics pipeline submission and prints status. ''' import argparse import subprocess import yaml def check_status(code): ''' Checks status with locally installed gsutil (in PATH). ''' script = ' '.join(["gcloud alpha genomics operations describe", ...
<commit_before><commit_msg>Add post-submission status check script.<commit_after>
#! /usr/bin/python ''' Checks a Google genomics pipeline submission and prints status. ''' import argparse import subprocess import yaml def check_status(code): ''' Checks status with locally installed gsutil (in PATH). ''' script = ' '.join(["gcloud alpha genomics operations describe", ...
Add post-submission status check script.#! /usr/bin/python ''' Checks a Google genomics pipeline submission and prints status. ''' import argparse import subprocess import yaml def check_status(code): ''' Checks status with locally installed gsutil (in PATH). ''' script = ' '.join(["gcloud alpha geno...
<commit_before><commit_msg>Add post-submission status check script.<commit_after>#! /usr/bin/python ''' Checks a Google genomics pipeline submission and prints status. ''' import argparse import subprocess import yaml def check_status(code): ''' Checks status with locally installed gsutil (in PATH). ''' ...
52484856bb43401434ad85d44e1a81bccdf4d50c
i8c/tests/test_last_op_branch.py
i8c/tests/test_last_op_branch.py
from i8c.tests import TestCase SOURCE = """\ define test::last_op_is_branch argument bool x argument bool y goto label2 label1: return label2: bne label1 """ class TestFuncWithLastOpBra(TestCase): def test_last_op_is_branch(self): """Check that functions whose last op is a branch wor...
Test synthetic return addition when last op is branch
Test synthetic return addition when last op is branch
Python
lgpl-2.1
gbenson/i8c
Test synthetic return addition when last op is branch
from i8c.tests import TestCase SOURCE = """\ define test::last_op_is_branch argument bool x argument bool y goto label2 label1: return label2: bne label1 """ class TestFuncWithLastOpBra(TestCase): def test_last_op_is_branch(self): """Check that functions whose last op is a branch wor...
<commit_before><commit_msg>Test synthetic return addition when last op is branch<commit_after>
from i8c.tests import TestCase SOURCE = """\ define test::last_op_is_branch argument bool x argument bool y goto label2 label1: return label2: bne label1 """ class TestFuncWithLastOpBra(TestCase): def test_last_op_is_branch(self): """Check that functions whose last op is a branch wor...
Test synthetic return addition when last op is branchfrom i8c.tests import TestCase SOURCE = """\ define test::last_op_is_branch argument bool x argument bool y goto label2 label1: return label2: bne label1 """ class TestFuncWithLastOpBra(TestCase): def test_last_op_is_branch(self): ...
<commit_before><commit_msg>Test synthetic return addition when last op is branch<commit_after>from i8c.tests import TestCase SOURCE = """\ define test::last_op_is_branch argument bool x argument bool y goto label2 label1: return label2: bne label1 """ class TestFuncWithLastOpBra(TestCase): d...
d1663520f019364841f673e929ed8095697b7ab9
test_http1.py
test_http1.py
from echo_client import client def test_ok(): response = client('GET /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line == 'HTTP/1.1 200 OK' def test_405(): response = client('POST /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line ==...
Add tests for HTTP server, step 1
Add tests for HTTP server, step 1
Python
mit
jwarren116/network-tools,jwarren116/network-tools
Add tests for HTTP server, step 1
from echo_client import client def test_ok(): response = client('GET /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line == 'HTTP/1.1 200 OK' def test_405(): response = client('POST /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line ==...
<commit_before><commit_msg>Add tests for HTTP server, step 1<commit_after>
from echo_client import client def test_ok(): response = client('GET /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line == 'HTTP/1.1 200 OK' def test_405(): response = client('POST /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line ==...
Add tests for HTTP server, step 1from echo_client import client def test_ok(): response = client('GET /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line == 'HTTP/1.1 200 OK' def test_405(): response = client('POST /index.html HTTP/1.1').split('\r\n') first_line = res...
<commit_before><commit_msg>Add tests for HTTP server, step 1<commit_after>from echo_client import client def test_ok(): response = client('GET /index.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line == 'HTTP/1.1 200 OK' def test_405(): response = client('POST /index.html HTTP...
4398fd54672d8149e61b9360465d227b85f0ea12
django_auth_policy/management/commands/filter_password_list.py
django_auth_policy/management/commands/filter_password_list.py
from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError from django.conf import settings from django_auth_policy.handlers import PasswordStrengthPolicyHandler class Command(BaseCommand): help = ("Filters a list of password by removing all passwords tha...
Add command which reads password lists and outputs passwords that validate the password policy
Add command which reads password lists and outputs passwords that validate the password policy This comes in handy when disallowing commonly used passwords because it removes all passwords that will never validate anyhow.
Python
bsd-3-clause
Dreamsolution/django-auth-policy,Dreamsolution/django-auth-policy,mcella/django-auth-policy,mcella/django-auth-policy
Add command which reads password lists and outputs passwords that validate the password policy This comes in handy when disallowing commonly used passwords because it removes all passwords that will never validate anyhow.
from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError from django.conf import settings from django_auth_policy.handlers import PasswordStrengthPolicyHandler class Command(BaseCommand): help = ("Filters a list of password by removing all passwords tha...
<commit_before><commit_msg>Add command which reads password lists and outputs passwords that validate the password policy This comes in handy when disallowing commonly used passwords because it removes all passwords that will never validate anyhow.<commit_after>
from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError from django.conf import settings from django_auth_policy.handlers import PasswordStrengthPolicyHandler class Command(BaseCommand): help = ("Filters a list of password by removing all passwords tha...
Add command which reads password lists and outputs passwords that validate the password policy This comes in handy when disallowing commonly used passwords because it removes all passwords that will never validate anyhow.from django.core.management.base import BaseCommand, CommandError from django.core.exceptions impo...
<commit_before><commit_msg>Add command which reads password lists and outputs passwords that validate the password policy This comes in handy when disallowing commonly used passwords because it removes all passwords that will never validate anyhow.<commit_after>from django.core.management.base import BaseCommand, Comm...
8a089a5a8126110ef0b763294a0a14869787146e
examples/long_running_publisher.py
examples/long_running_publisher.py
# -*- coding: utf-8 -*- # pylint: disable=C0111,C0103,R0205 import threading from time import sleep from pika import ConnectionParameters, BlockingConnection, PlainCredentials class Publisher(threading.Thread): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.daemon = Tr...
Add an example of a long running publisher
Add an example of a long running publisher
Python
bsd-3-clause
pika/pika
Add an example of a long running publisher
# -*- coding: utf-8 -*- # pylint: disable=C0111,C0103,R0205 import threading from time import sleep from pika import ConnectionParameters, BlockingConnection, PlainCredentials class Publisher(threading.Thread): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.daemon = Tr...
<commit_before><commit_msg>Add an example of a long running publisher<commit_after>
# -*- coding: utf-8 -*- # pylint: disable=C0111,C0103,R0205 import threading from time import sleep from pika import ConnectionParameters, BlockingConnection, PlainCredentials class Publisher(threading.Thread): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.daemon = Tr...
Add an example of a long running publisher# -*- coding: utf-8 -*- # pylint: disable=C0111,C0103,R0205 import threading from time import sleep from pika import ConnectionParameters, BlockingConnection, PlainCredentials class Publisher(threading.Thread): def __init__(self, *args, **kwargs): super().__init__...
<commit_before><commit_msg>Add an example of a long running publisher<commit_after># -*- coding: utf-8 -*- # pylint: disable=C0111,C0103,R0205 import threading from time import sleep from pika import ConnectionParameters, BlockingConnection, PlainCredentials class Publisher(threading.Thread): def __init__(self, *...
4ba2dc07dcd1394e829fed0168ee64af1bd401ed
pyblogit/api_interface.py
pyblogit/api_interface.py
""" pyblogit.api_interface ~~~~~~~~~~~~~~~~~~~~~~ This modules acts as an interface between pyblogit and various blogging platform apis. """ import gdata.gauth import gdata.blogger.client class BloggerInterface(object): def __init__(self): self._CLIENT_ID = client_id self._CLIENT_SECRET = client...
Add BloggerInterface class to interact with blogger api
Add BloggerInterface class to interact with blogger api
Python
mit
jamalmoir/pyblogit
Add BloggerInterface class to interact with blogger api
""" pyblogit.api_interface ~~~~~~~~~~~~~~~~~~~~~~ This modules acts as an interface between pyblogit and various blogging platform apis. """ import gdata.gauth import gdata.blogger.client class BloggerInterface(object): def __init__(self): self._CLIENT_ID = client_id self._CLIENT_SECRET = client...
<commit_before><commit_msg>Add BloggerInterface class to interact with blogger api<commit_after>
""" pyblogit.api_interface ~~~~~~~~~~~~~~~~~~~~~~ This modules acts as an interface between pyblogit and various blogging platform apis. """ import gdata.gauth import gdata.blogger.client class BloggerInterface(object): def __init__(self): self._CLIENT_ID = client_id self._CLIENT_SECRET = client...
Add BloggerInterface class to interact with blogger api""" pyblogit.api_interface ~~~~~~~~~~~~~~~~~~~~~~ This modules acts as an interface between pyblogit and various blogging platform apis. """ import gdata.gauth import gdata.blogger.client class BloggerInterface(object): def __init__(self): self._CLI...
<commit_before><commit_msg>Add BloggerInterface class to interact with blogger api<commit_after>""" pyblogit.api_interface ~~~~~~~~~~~~~~~~~~~~~~ This modules acts as an interface between pyblogit and various blogging platform apis. """ import gdata.gauth import gdata.blogger.client class BloggerInterface(object): ...
cb9d7a92ca0a1e0202a9a1238a3b3ebd3882129c
stanczyk/util.py
stanczyk/util.py
""" Utilities that don't fit well anywhere else. """ def _getRemote(namespace): """Gets the remote protocol, or raises an error. This is intended to be used by command implementations. This isn't implemented as an argument-injecting decorator, because the console code uses introspection to tell users ...
Move logic for accessing the remote attribute of the namespace (and raising a meaningful error when it doesn't exist) into a separate function
Move logic for accessing the remote attribute of the namespace (and raising a meaningful error when it doesn't exist) into a separate function
Python
isc
crypto101/stanczyk
Move logic for accessing the remote attribute of the namespace (and raising a meaningful error when it doesn't exist) into a separate function
""" Utilities that don't fit well anywhere else. """ def _getRemote(namespace): """Gets the remote protocol, or raises an error. This is intended to be used by command implementations. This isn't implemented as an argument-injecting decorator, because the console code uses introspection to tell users ...
<commit_before><commit_msg>Move logic for accessing the remote attribute of the namespace (and raising a meaningful error when it doesn't exist) into a separate function<commit_after>
""" Utilities that don't fit well anywhere else. """ def _getRemote(namespace): """Gets the remote protocol, or raises an error. This is intended to be used by command implementations. This isn't implemented as an argument-injecting decorator, because the console code uses introspection to tell users ...
Move logic for accessing the remote attribute of the namespace (and raising a meaningful error when it doesn't exist) into a separate function""" Utilities that don't fit well anywhere else. """ def _getRemote(namespace): """Gets the remote protocol, or raises an error. This is intended to be used by command i...
<commit_before><commit_msg>Move logic for accessing the remote attribute of the namespace (and raising a meaningful error when it doesn't exist) into a separate function<commit_after>""" Utilities that don't fit well anywhere else. """ def _getRemote(namespace): """Gets the remote protocol, or raises an error. ...
0dbc2613fc686471be214ef69f245bc279a7e660
http_ping.py
http_ping.py
from locust import HttpLocust, TaskSet, task class HttpPingTasks(TaskSet): @task def ping(self): self.client.get("/") class SayHelloLocust(HttpLocust): task_set = HttpPingTasks min_wait = 100 max_wait = 500
Add simple pinger for basic locust demo
Add simple pinger for basic locust demo
Python
apache-2.0
drednout/locust_on_meetup
Add simple pinger for basic locust demo
from locust import HttpLocust, TaskSet, task class HttpPingTasks(TaskSet): @task def ping(self): self.client.get("/") class SayHelloLocust(HttpLocust): task_set = HttpPingTasks min_wait = 100 max_wait = 500
<commit_before><commit_msg>Add simple pinger for basic locust demo<commit_after>
from locust import HttpLocust, TaskSet, task class HttpPingTasks(TaskSet): @task def ping(self): self.client.get("/") class SayHelloLocust(HttpLocust): task_set = HttpPingTasks min_wait = 100 max_wait = 500
Add simple pinger for basic locust demofrom locust import HttpLocust, TaskSet, task class HttpPingTasks(TaskSet): @task def ping(self): self.client.get("/") class SayHelloLocust(HttpLocust): task_set = HttpPingTasks min_wait = 100 max_wait = 500
<commit_before><commit_msg>Add simple pinger for basic locust demo<commit_after>from locust import HttpLocust, TaskSet, task class HttpPingTasks(TaskSet): @task def ping(self): self.client.get("/") class SayHelloLocust(HttpLocust): task_set = HttpPingTasks min_wait = 100 max_wait = 500
bb9fb35d5a143fcd249780e224699413d26cf841
Gui/change_license.py
Gui/change_license.py
import os opening_dashes = """\ /* -------------------------------------------------------------------------- * """ dashes = """\ * -------------------------------------------------------------------------- * """ opensim_description = """\ * OpenSim is a toolkit for musculoskeletal modeling and simulation. ...
Add script to convert to apache 2.0 license.
Add script to convert to apache 2.0 license.
Python
apache-2.0
opensim-org/opensim-gui,opensim-org/opensim-gui,opensim-org/opensim-gui,opensim-org/opensim-gui
Add script to convert to apache 2.0 license.
import os opening_dashes = """\ /* -------------------------------------------------------------------------- * """ dashes = """\ * -------------------------------------------------------------------------- * """ opensim_description = """\ * OpenSim is a toolkit for musculoskeletal modeling and simulation. ...
<commit_before><commit_msg>Add script to convert to apache 2.0 license.<commit_after>
import os opening_dashes = """\ /* -------------------------------------------------------------------------- * """ dashes = """\ * -------------------------------------------------------------------------- * """ opensim_description = """\ * OpenSim is a toolkit for musculoskeletal modeling and simulation. ...
Add script to convert to apache 2.0 license.import os opening_dashes = """\ /* -------------------------------------------------------------------------- * """ dashes = """\ * -------------------------------------------------------------------------- * """ opensim_description = """\ * OpenSim is a toolkit for muscu...
<commit_before><commit_msg>Add script to convert to apache 2.0 license.<commit_after>import os opening_dashes = """\ /* -------------------------------------------------------------------------- * """ dashes = """\ * -------------------------------------------------------------------------- * """ opensim_description...
3050b09418ab7d807e8f1c136014cd8fb9f61148
dojo/db_migrations/0023_cve_fix_1553.py
dojo/db_migrations/0023_cve_fix_1553.py
# Generated by Django 2.2.4 on 2019-11-18 19:06 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dojo', '0021_auto_20191102_0956'), ] operations = [ migrations.AlterField( model_name='finding', ...
Add correct migration file fo cve-fix-1553
Add correct migration file fo cve-fix-1553
Python
bsd-3-clause
rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo
Add correct migration file fo cve-fix-1553
# Generated by Django 2.2.4 on 2019-11-18 19:06 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dojo', '0021_auto_20191102_0956'), ] operations = [ migrations.AlterField( model_name='finding', ...
<commit_before><commit_msg>Add correct migration file fo cve-fix-1553<commit_after>
# Generated by Django 2.2.4 on 2019-11-18 19:06 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dojo', '0021_auto_20191102_0956'), ] operations = [ migrations.AlterField( model_name='finding', ...
Add correct migration file fo cve-fix-1553# Generated by Django 2.2.4 on 2019-11-18 19:06 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dojo', '0021_auto_20191102_0956'), ] operations = [ migrations.Alter...
<commit_before><commit_msg>Add correct migration file fo cve-fix-1553<commit_after># Generated by Django 2.2.4 on 2019-11-18 19:06 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dojo', '0021_auto_20191102_0956'), ] ...
f4b5ccd3fdacad36cb124245591ea5bfaf4de12e
test/option--.py
test/option--.py
#!/usr/bin/env python __revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__" import TestCmd import os.path import string import sys test = TestCmd.TestCmd(program = 'scons.py', workdir = '', interpreter = 'python') test.write('build.py', r""" import sys f...
Add a test for -- terminating option processing.
Add a test for -- terminating option processing.
Python
mit
andrewyoung1991/scons,andrewyoung1991/scons,timj/scons,andrewyoung1991/scons,timj/scons,andrewyoung1991/scons,andrewyoung1991/scons,timj/scons,andrewyoung1991/scons,Distrotech/scons,Distrotech/scons,andrewyoung1991/scons,timj/scons,timj/scons,andrewyoung1991/scons,timj/scons,Distrotech/scons,timj/scons,Distrotech/scons...
Add a test for -- terminating option processing.
#!/usr/bin/env python __revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__" import TestCmd import os.path import string import sys test = TestCmd.TestCmd(program = 'scons.py', workdir = '', interpreter = 'python') test.write('build.py', r""" import sys f...
<commit_before><commit_msg>Add a test for -- terminating option processing.<commit_after>
#!/usr/bin/env python __revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__" import TestCmd import os.path import string import sys test = TestCmd.TestCmd(program = 'scons.py', workdir = '', interpreter = 'python') test.write('build.py', r""" import sys f...
Add a test for -- terminating option processing.#!/usr/bin/env python __revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__" import TestCmd import os.path import string import sys test = TestCmd.TestCmd(program = 'scons.py', workdir = '', interpreter = 'py...
<commit_before><commit_msg>Add a test for -- terminating option processing.<commit_after>#!/usr/bin/env python __revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__" import TestCmd import os.path import string import sys test = TestCmd.TestCmd(program = 'scons.py', workdir = '',...
0454b3e6463585ea3d643b0a9b5b8782d1dcb7d7
geocoder/mapzen_reverse.py
geocoder/mapzen_reverse.py
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.mapzen import Mapzen from geocoder.location import Location class MapzenReverse(Base): """ Mapzen REST API ======================= API Reference ------------- https://pelias.ma...
Add support for reverse geocoding with Mapzen
Add support for reverse geocoding with Mapzen
Python
mit
akittas/geocoder,DenisCarriere/geocoder
Add support for reverse geocoding with Mapzen
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.mapzen import Mapzen from geocoder.location import Location class MapzenReverse(Base): """ Mapzen REST API ======================= API Reference ------------- https://pelias.ma...
<commit_before><commit_msg>Add support for reverse geocoding with Mapzen<commit_after>
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.mapzen import Mapzen from geocoder.location import Location class MapzenReverse(Base): """ Mapzen REST API ======================= API Reference ------------- https://pelias.ma...
Add support for reverse geocoding with Mapzen#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.mapzen import Mapzen from geocoder.location import Location class MapzenReverse(Base): """ Mapzen REST API ======================= API Refe...
<commit_before><commit_msg>Add support for reverse geocoding with Mapzen<commit_after>#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.mapzen import Mapzen from geocoder.location import Location class MapzenReverse(Base): """ Mapzen REST API ...
78a5dce20f5a1347f9d4e92143d2efbb8e52e61c
bmi_ilamb/tests/test_config.py
bmi_ilamb/tests/test_config.py
import os from nose.tools import (raises, assert_equal, assert_is, assert_is_instance, assert_is_none) from ..config import Configuration from .. import data_dir bmi_ilamb_config = os.path.join(data_dir, 'bmi_ilamb.yaml') def test_configuration_instantiates(): x = Configuration() ass...
Add unit tests for Configuration class
Add unit tests for Configuration class
Python
mit
permamodel/bmi-ilamb
Add unit tests for Configuration class
import os from nose.tools import (raises, assert_equal, assert_is, assert_is_instance, assert_is_none) from ..config import Configuration from .. import data_dir bmi_ilamb_config = os.path.join(data_dir, 'bmi_ilamb.yaml') def test_configuration_instantiates(): x = Configuration() ass...
<commit_before><commit_msg>Add unit tests for Configuration class<commit_after>
import os from nose.tools import (raises, assert_equal, assert_is, assert_is_instance, assert_is_none) from ..config import Configuration from .. import data_dir bmi_ilamb_config = os.path.join(data_dir, 'bmi_ilamb.yaml') def test_configuration_instantiates(): x = Configuration() ass...
Add unit tests for Configuration classimport os from nose.tools import (raises, assert_equal, assert_is, assert_is_instance, assert_is_none) from ..config import Configuration from .. import data_dir bmi_ilamb_config = os.path.join(data_dir, 'bmi_ilamb.yaml') def test_configuration_instantia...
<commit_before><commit_msg>Add unit tests for Configuration class<commit_after>import os from nose.tools import (raises, assert_equal, assert_is, assert_is_instance, assert_is_none) from ..config import Configuration from .. import data_dir bmi_ilamb_config = os.path.join(data_dir, 'bmi_ilamb....
5331cfce73d4a5410191cfaee09bbc777c2fa243
geojsonify.py
geojsonify.py
import json import os for root, dirs, files in os.walk('data'): for name in files: features = [] filepath = os.path.join(root, name) with open(filepath) as f: # check to see if the first line is already geojson-ey first_line = f.readline() if first_line ...
Add a script that makes the output of the scraper be valid GeoJSON
Add a script that makes the output of the scraper be valid GeoJSON
Python
mit
iandees/postboxes
Add a script that makes the output of the scraper be valid GeoJSON
import json import os for root, dirs, files in os.walk('data'): for name in files: features = [] filepath = os.path.join(root, name) with open(filepath) as f: # check to see if the first line is already geojson-ey first_line = f.readline() if first_line ...
<commit_before><commit_msg>Add a script that makes the output of the scraper be valid GeoJSON<commit_after>
import json import os for root, dirs, files in os.walk('data'): for name in files: features = [] filepath = os.path.join(root, name) with open(filepath) as f: # check to see if the first line is already geojson-ey first_line = f.readline() if first_line ...
Add a script that makes the output of the scraper be valid GeoJSONimport json import os for root, dirs, files in os.walk('data'): for name in files: features = [] filepath = os.path.join(root, name) with open(filepath) as f: # check to see if the first line is already geojson-e...
<commit_before><commit_msg>Add a script that makes the output of the scraper be valid GeoJSON<commit_after>import json import os for root, dirs, files in os.walk('data'): for name in files: features = [] filepath = os.path.join(root, name) with open(filepath) as f: # check to s...
adfb3e433d0ce226aaa657c5f2ef0dc5b4d0fe2f
indra/sources/trips/drum_reader.py
indra/sources/trips/drum_reader.py
import sys import random from indra.sources import trips from kqml import KQMLModule, KQMLPerformative, KQMLList class DrumReader(KQMLModule): def __init__(self, **kwargs): super(DrumReader, self).__init__(**kwargs) self.msg_counter = random.randint(1, 100000) self.ready() self.extr...
Implement basic DRUM reader agent
Implement basic DRUM reader agent
Python
bsd-2-clause
sorgerlab/indra,johnbachman/belpy,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,bgyori/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,bgyori/indra,johnbachman/indra,pvtodorov/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy
Implement basic DRUM reader agent
import sys import random from indra.sources import trips from kqml import KQMLModule, KQMLPerformative, KQMLList class DrumReader(KQMLModule): def __init__(self, **kwargs): super(DrumReader, self).__init__(**kwargs) self.msg_counter = random.randint(1, 100000) self.ready() self.extr...
<commit_before><commit_msg>Implement basic DRUM reader agent<commit_after>
import sys import random from indra.sources import trips from kqml import KQMLModule, KQMLPerformative, KQMLList class DrumReader(KQMLModule): def __init__(self, **kwargs): super(DrumReader, self).__init__(**kwargs) self.msg_counter = random.randint(1, 100000) self.ready() self.extr...
Implement basic DRUM reader agentimport sys import random from indra.sources import trips from kqml import KQMLModule, KQMLPerformative, KQMLList class DrumReader(KQMLModule): def __init__(self, **kwargs): super(DrumReader, self).__init__(**kwargs) self.msg_counter = random.randint(1, 100000) ...
<commit_before><commit_msg>Implement basic DRUM reader agent<commit_after>import sys import random from indra.sources import trips from kqml import KQMLModule, KQMLPerformative, KQMLList class DrumReader(KQMLModule): def __init__(self, **kwargs): super(DrumReader, self).__init__(**kwargs) self.msg_...
7dbdae4cbf8e4d78f84c2b8163cd62c7935d3890
bandicoot/tests/generate_regressions.py
bandicoot/tests/generate_regressions.py
import bandicoot as bc from os.path import dirname, abspath, join if __name__ == '__main__': empty_user = bc.User() empty_user.attributes['empty'] = True empty_path = join(dirname(abspath(__file__)), 'samples/empty_user.json') bc.io.to_json(bc.utils.all(empty_user, summary='extended', flatten=True), em...
Add a simple command to generate automatic regressions
Add a simple command to generate automatic regressions
Python
mit
ulfaslak/bandicoot,yvesalexandre/bandicoot,econandrew/bandicoot,econandrew/bandicoot,yvesalexandre/bandicoot,econandrew/bandicoot,ulfaslak/bandicoot,yvesalexandre/bandicoot,ulfaslak/bandicoot
Add a simple command to generate automatic regressions
import bandicoot as bc from os.path import dirname, abspath, join if __name__ == '__main__': empty_user = bc.User() empty_user.attributes['empty'] = True empty_path = join(dirname(abspath(__file__)), 'samples/empty_user.json') bc.io.to_json(bc.utils.all(empty_user, summary='extended', flatten=True), em...
<commit_before><commit_msg>Add a simple command to generate automatic regressions<commit_after>
import bandicoot as bc from os.path import dirname, abspath, join if __name__ == '__main__': empty_user = bc.User() empty_user.attributes['empty'] = True empty_path = join(dirname(abspath(__file__)), 'samples/empty_user.json') bc.io.to_json(bc.utils.all(empty_user, summary='extended', flatten=True), em...
Add a simple command to generate automatic regressionsimport bandicoot as bc from os.path import dirname, abspath, join if __name__ == '__main__': empty_user = bc.User() empty_user.attributes['empty'] = True empty_path = join(dirname(abspath(__file__)), 'samples/empty_user.json') bc.io.to_json(bc.utils...
<commit_before><commit_msg>Add a simple command to generate automatic regressions<commit_after>import bandicoot as bc from os.path import dirname, abspath, join if __name__ == '__main__': empty_user = bc.User() empty_user.attributes['empty'] = True empty_path = join(dirname(abspath(__file__)), 'samples/emp...
e59a870a1e039e12da2097401f925146ecc1a5fb
tests/modules/test_memory.py
tests/modules/test_memory.py
# pylint: disable=C0103,C0111 import mock import unittest import tests.mocks as mocks from bumblebee.input import LEFT_MOUSE from bumblebee.modules.memory import Module class VirtualMemory(object): def __init__(self, percent): self.percent = percent class TestMemoryModule(unittest.TestCase): def se...
Add unit tests for memory module
[tests] Add unit tests for memory module
Python
mit
tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status
[tests] Add unit tests for memory module
# pylint: disable=C0103,C0111 import mock import unittest import tests.mocks as mocks from bumblebee.input import LEFT_MOUSE from bumblebee.modules.memory import Module class VirtualMemory(object): def __init__(self, percent): self.percent = percent class TestMemoryModule(unittest.TestCase): def se...
<commit_before><commit_msg>[tests] Add unit tests for memory module<commit_after>
# pylint: disable=C0103,C0111 import mock import unittest import tests.mocks as mocks from bumblebee.input import LEFT_MOUSE from bumblebee.modules.memory import Module class VirtualMemory(object): def __init__(self, percent): self.percent = percent class TestMemoryModule(unittest.TestCase): def se...
[tests] Add unit tests for memory module# pylint: disable=C0103,C0111 import mock import unittest import tests.mocks as mocks from bumblebee.input import LEFT_MOUSE from bumblebee.modules.memory import Module class VirtualMemory(object): def __init__(self, percent): self.percent = percent class TestMem...
<commit_before><commit_msg>[tests] Add unit tests for memory module<commit_after># pylint: disable=C0103,C0111 import mock import unittest import tests.mocks as mocks from bumblebee.input import LEFT_MOUSE from bumblebee.modules.memory import Module class VirtualMemory(object): def __init__(self, percent): ...
01aedda05cbd6cbe98afa71496c5c09465f0e4e6
tests/test_end_to_end.py
tests/test_end_to_end.py
#!/usr/bin/env python # coding=utf-8 import unittest from click.testing import CliRunner from shub import tool class ShubEndToEndTests(unittest.TestCase): def setUp(self): self.runner = CliRunner() def run_subcmd(self, subcmd): return self.runner.invoke(tool.cli, [subcmd]).output def te...
Add rudimentary end to end tests
Add rudimentary end to end tests Our subcommand tests bypass the click wrappers. I think it's a good idea to have these tests just to have a little more confidence that no silly bugs have gone unnoticed.
Python
bsd-3-clause
scrapinghub/shub
Add rudimentary end to end tests Our subcommand tests bypass the click wrappers. I think it's a good idea to have these tests just to have a little more confidence that no silly bugs have gone unnoticed.
#!/usr/bin/env python # coding=utf-8 import unittest from click.testing import CliRunner from shub import tool class ShubEndToEndTests(unittest.TestCase): def setUp(self): self.runner = CliRunner() def run_subcmd(self, subcmd): return self.runner.invoke(tool.cli, [subcmd]).output def te...
<commit_before><commit_msg>Add rudimentary end to end tests Our subcommand tests bypass the click wrappers. I think it's a good idea to have these tests just to have a little more confidence that no silly bugs have gone unnoticed.<commit_after>
#!/usr/bin/env python # coding=utf-8 import unittest from click.testing import CliRunner from shub import tool class ShubEndToEndTests(unittest.TestCase): def setUp(self): self.runner = CliRunner() def run_subcmd(self, subcmd): return self.runner.invoke(tool.cli, [subcmd]).output def te...
Add rudimentary end to end tests Our subcommand tests bypass the click wrappers. I think it's a good idea to have these tests just to have a little more confidence that no silly bugs have gone unnoticed.#!/usr/bin/env python # coding=utf-8 import unittest from click.testing import CliRunner from shub import tool cl...
<commit_before><commit_msg>Add rudimentary end to end tests Our subcommand tests bypass the click wrappers. I think it's a good idea to have these tests just to have a little more confidence that no silly bugs have gone unnoticed.<commit_after>#!/usr/bin/env python # coding=utf-8 import unittest from click.testing im...
df0cf1ddbf236c6cf70563e6ddeb3b7cece80c92
tests/test_generation.py
tests/test_generation.py
from datetime import date from populous.backends.base import Backend from populous.blueprint import Blueprint from populous.item import Item def test_blueprint_preprocess(mocker): blueprint = Blueprint() blueprint.add_item({'name': 'foo', 'table': 'test'}) blueprint.add_item({'name': 'bar', 'table': 'te...
Add tests for item preprocessing
Add tests for item preprocessing
Python
mit
novafloss/populous
Add tests for item preprocessing
from datetime import date from populous.backends.base import Backend from populous.blueprint import Blueprint from populous.item import Item def test_blueprint_preprocess(mocker): blueprint = Blueprint() blueprint.add_item({'name': 'foo', 'table': 'test'}) blueprint.add_item({'name': 'bar', 'table': 'te...
<commit_before><commit_msg>Add tests for item preprocessing<commit_after>
from datetime import date from populous.backends.base import Backend from populous.blueprint import Blueprint from populous.item import Item def test_blueprint_preprocess(mocker): blueprint = Blueprint() blueprint.add_item({'name': 'foo', 'table': 'test'}) blueprint.add_item({'name': 'bar', 'table': 'te...
Add tests for item preprocessingfrom datetime import date from populous.backends.base import Backend from populous.blueprint import Blueprint from populous.item import Item def test_blueprint_preprocess(mocker): blueprint = Blueprint() blueprint.add_item({'name': 'foo', 'table': 'test'}) blueprint.add_i...
<commit_before><commit_msg>Add tests for item preprocessing<commit_after>from datetime import date from populous.backends.base import Backend from populous.blueprint import Blueprint from populous.item import Item def test_blueprint_preprocess(mocker): blueprint = Blueprint() blueprint.add_item({'name': 'fo...