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
56d0f20de569deb359e172bee7bf245a398c3430
setting_seq_len.py
setting_seq_len.py
import tensorflow as tf import numpy as np tf.set_random_seed(765) np.random.seed(765) tf.reset_default_graph() n_inputs = 3 n_neurons = 5 n_steps = 2 X = tf.placeholder(tf.float32, [None, n_steps, n_inputs]) seq_length = tf.placeholder(tf.int32, [None]) basic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)...
Add code for setting sequence length for RNN
Add code for setting sequence length for RNN In some cases, sequence length may differ (sentences, sound) This small example shows how to manually deal seq of different lengths.
Python
mit
KT12/hands_on_machine_learning
Add code for setting sequence length for RNN In some cases, sequence length may differ (sentences, sound) This small example shows how to manually deal seq of different lengths.
import tensorflow as tf import numpy as np tf.set_random_seed(765) np.random.seed(765) tf.reset_default_graph() n_inputs = 3 n_neurons = 5 n_steps = 2 X = tf.placeholder(tf.float32, [None, n_steps, n_inputs]) seq_length = tf.placeholder(tf.int32, [None]) basic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)...
<commit_before><commit_msg>Add code for setting sequence length for RNN In some cases, sequence length may differ (sentences, sound) This small example shows how to manually deal seq of different lengths.<commit_after>
import tensorflow as tf import numpy as np tf.set_random_seed(765) np.random.seed(765) tf.reset_default_graph() n_inputs = 3 n_neurons = 5 n_steps = 2 X = tf.placeholder(tf.float32, [None, n_steps, n_inputs]) seq_length = tf.placeholder(tf.int32, [None]) basic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)...
Add code for setting sequence length for RNN In some cases, sequence length may differ (sentences, sound) This small example shows how to manually deal seq of different lengths.import tensorflow as tf import numpy as np tf.set_random_seed(765) np.random.seed(765) tf.reset_default_graph() n_inputs = 3 n_neurons = 5 n...
<commit_before><commit_msg>Add code for setting sequence length for RNN In some cases, sequence length may differ (sentences, sound) This small example shows how to manually deal seq of different lengths.<commit_after>import tensorflow as tf import numpy as np tf.set_random_seed(765) np.random.seed(765) tf.reset_defa...
033bcb02dbd0e4c7c89ddd350c2fa0ca247f59ee
tests/disabled_test_animals.py
tests/disabled_test_animals.py
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 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/LICENSE-2.0 # Unles...
Add the animals testing harness.
Add the animals testing harness.
Python
apache-2.0
probcomp/cgpm,probcomp/cgpm
Add the animals testing harness.
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 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/LICENSE-2.0 # Unles...
<commit_before><commit_msg>Add the animals testing harness.<commit_after>
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 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/LICENSE-2.0 # Unles...
Add the animals testing harness.# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 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.o...
<commit_before><commit_msg>Add the animals testing harness.<commit_after># -*- coding: utf-8 -*- # Copyright (c) 2015-2016 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...
8e744f67457222a143505f303c0254e43706d3f8
tests/aggregate/test_join_table_inheritance.py
tests/aggregate/test_join_table_inheritance.py
from decimal import Decimal import sqlalchemy as sa from sqlalchemy_utils.aggregates import aggregated from tests import TestCase class TestLazyEvaluatedSelectExpressionsForAggregates(TestCase): dns = 'postgres://postgres@localhost/sqlalchemy_utils_test' def create_models(self): class Catalog(self.Ba...
Add tests for aggregates with inheritance
Add tests for aggregates with inheritance
Python
bsd-3-clause
joshfriend/sqlalchemy-utils,marrybird/sqlalchemy-utils,konstantinoskostis/sqlalchemy-utils,rmoorman/sqlalchemy-utils,tonyseek/sqlalchemy-utils,joshfriend/sqlalchemy-utils,tonyseek/sqlalchemy-utils,cheungpat/sqlalchemy-utils,spoqa/sqlalchemy-utils,JackWink/sqlalchemy-utils
Add tests for aggregates with inheritance
from decimal import Decimal import sqlalchemy as sa from sqlalchemy_utils.aggregates import aggregated from tests import TestCase class TestLazyEvaluatedSelectExpressionsForAggregates(TestCase): dns = 'postgres://postgres@localhost/sqlalchemy_utils_test' def create_models(self): class Catalog(self.Ba...
<commit_before><commit_msg>Add tests for aggregates with inheritance<commit_after>
from decimal import Decimal import sqlalchemy as sa from sqlalchemy_utils.aggregates import aggregated from tests import TestCase class TestLazyEvaluatedSelectExpressionsForAggregates(TestCase): dns = 'postgres://postgres@localhost/sqlalchemy_utils_test' def create_models(self): class Catalog(self.Ba...
Add tests for aggregates with inheritancefrom decimal import Decimal import sqlalchemy as sa from sqlalchemy_utils.aggregates import aggregated from tests import TestCase class TestLazyEvaluatedSelectExpressionsForAggregates(TestCase): dns = 'postgres://postgres@localhost/sqlalchemy_utils_test' def create_mo...
<commit_before><commit_msg>Add tests for aggregates with inheritance<commit_after>from decimal import Decimal import sqlalchemy as sa from sqlalchemy_utils.aggregates import aggregated from tests import TestCase class TestLazyEvaluatedSelectExpressionsForAggregates(TestCase): dns = 'postgres://postgres@localhost/...
54a3be9039292f33d8d29a749353a92fca6cc1c9
tests/__init__.py
tests/__init__.py
#TODO: REMOVE COMMENTS ONCE BELOW TESTS ARE CONVERTED TO THE UNITTEST FRAMEWORK #from .test_dataset import * from .test_pandas_dataset import * #from .test_great_expectations import * #from .test_util import *
Add default module for tests to support automatically running all unit tests, with associated scaffold for when other tests are converted.
Add default module for tests to support automatically running all unit tests, with associated scaffold for when other tests are converted.
Python
apache-2.0
great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations
Add default module for tests to support automatically running all unit tests, with associated scaffold for when other tests are converted.
#TODO: REMOVE COMMENTS ONCE BELOW TESTS ARE CONVERTED TO THE UNITTEST FRAMEWORK #from .test_dataset import * from .test_pandas_dataset import * #from .test_great_expectations import * #from .test_util import *
<commit_before><commit_msg>Add default module for tests to support automatically running all unit tests, with associated scaffold for when other tests are converted.<commit_after>
#TODO: REMOVE COMMENTS ONCE BELOW TESTS ARE CONVERTED TO THE UNITTEST FRAMEWORK #from .test_dataset import * from .test_pandas_dataset import * #from .test_great_expectations import * #from .test_util import *
Add default module for tests to support automatically running all unit tests, with associated scaffold for when other tests are converted.#TODO: REMOVE COMMENTS ONCE BELOW TESTS ARE CONVERTED TO THE UNITTEST FRAMEWORK #from .test_dataset import * from .test_pandas_dataset import * #from .test_great_expectations import...
<commit_before><commit_msg>Add default module for tests to support automatically running all unit tests, with associated scaffold for when other tests are converted.<commit_after>#TODO: REMOVE COMMENTS ONCE BELOW TESTS ARE CONVERTED TO THE UNITTEST FRAMEWORK #from .test_dataset import * from .test_pandas_dataset impor...
c047804ec995884794afc26fd57872becbe8686f
tests/test_git.py
tests/test_git.py
from subprocess import check_call from valohai_cli.git import get_current_commit def test_get_current_commit(tmpdir): dir = str(tmpdir) check_call('git init', cwd=dir, shell=True) check_call('git config user.name Robot', cwd=dir, shell=True) check_call('git config user.email [email protected]', cwd=d...
Add a test for get_current_commit
Add a test for get_current_commit
Python
mit
valohai/valohai-cli
Add a test for get_current_commit
from subprocess import check_call from valohai_cli.git import get_current_commit def test_get_current_commit(tmpdir): dir = str(tmpdir) check_call('git init', cwd=dir, shell=True) check_call('git config user.name Robot', cwd=dir, shell=True) check_call('git config user.email [email protected]', cwd=d...
<commit_before><commit_msg>Add a test for get_current_commit<commit_after>
from subprocess import check_call from valohai_cli.git import get_current_commit def test_get_current_commit(tmpdir): dir = str(tmpdir) check_call('git init', cwd=dir, shell=True) check_call('git config user.name Robot', cwd=dir, shell=True) check_call('git config user.email [email protected]', cwd=d...
Add a test for get_current_commitfrom subprocess import check_call from valohai_cli.git import get_current_commit def test_get_current_commit(tmpdir): dir = str(tmpdir) check_call('git init', cwd=dir, shell=True) check_call('git config user.name Robot', cwd=dir, shell=True) check_call('git config use...
<commit_before><commit_msg>Add a test for get_current_commit<commit_after>from subprocess import check_call from valohai_cli.git import get_current_commit def test_get_current_commit(tmpdir): dir = str(tmpdir) check_call('git init', cwd=dir, shell=True) check_call('git config user.name Robot', cwd=dir, s...
1c2e7d773efa8e015bfa964fefe4c50c3cd9ac46
src/lib/arcgis_data_source.py
src/lib/arcgis_data_source.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Add ArcGIS data source util
Add ArcGIS data source util
Python
apache-2.0
GoogleCloudPlatform/covid-19-open-data,GoogleCloudPlatform/covid-19-open-data
Add ArcGIS data source util
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
<commit_before><commit_msg>Add ArcGIS data source util<commit_after>
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Add ArcGIS data source util# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
<commit_before><commit_msg>Add ArcGIS data source util<commit_after># Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
396d8f6774ad4d75e15ae13481c04e9c9241204d
writer/kafka_sample_writer.py
writer/kafka_sample_writer.py
from kafka import KafkaClient, create_message from kafka.protocol import KafkaProtocol from kafka.common import ProduceRequest import random import logging class KafkaSampleWriter(object): """ KafkaSampleWriter can be used to write sample messages into Kafka for benchmark purposes """ def __init__...
Add kafka writer for benchmarks
Add kafka writer for benchmarks
Python
apache-2.0
mre/kafka-influxdb,mre/kafka-influxdb
Add kafka writer for benchmarks
from kafka import KafkaClient, create_message from kafka.protocol import KafkaProtocol from kafka.common import ProduceRequest import random import logging class KafkaSampleWriter(object): """ KafkaSampleWriter can be used to write sample messages into Kafka for benchmark purposes """ def __init__...
<commit_before><commit_msg>Add kafka writer for benchmarks<commit_after>
from kafka import KafkaClient, create_message from kafka.protocol import KafkaProtocol from kafka.common import ProduceRequest import random import logging class KafkaSampleWriter(object): """ KafkaSampleWriter can be used to write sample messages into Kafka for benchmark purposes """ def __init__...
Add kafka writer for benchmarksfrom kafka import KafkaClient, create_message from kafka.protocol import KafkaProtocol from kafka.common import ProduceRequest import random import logging class KafkaSampleWriter(object): """ KafkaSampleWriter can be used to write sample messages into Kafka for benchmark pur...
<commit_before><commit_msg>Add kafka writer for benchmarks<commit_after>from kafka import KafkaClient, create_message from kafka.protocol import KafkaProtocol from kafka.common import ProduceRequest import random import logging class KafkaSampleWriter(object): """ KafkaSampleWriter can be used to write sample ...
31357d68a7d0fa473ef518e28f239cd2a8b1cb5d
seaborn/tests/test_miscplot.py
seaborn/tests/test_miscplot.py
import nose.tools as nt import numpy.testing as npt import matplotlib.pyplot as plt from .. import miscplot as misc from seaborn import color_palette class TestPalPlot(object): """Test the function that visualizes a color palette.""" def test_palplot_size(self): pal4 = color_palette("husl", 4) ...
Add simple test for palplot
Add simple test for palplot
Python
bsd-3-clause
bsipocz/seaborn,ashhher3/seaborn,petebachant/seaborn,wrobstory/seaborn,mia1rab/seaborn,parantapa/seaborn,mwaskom/seaborn,ebothmann/seaborn,q1ang/seaborn,nileracecrew/seaborn,mclevey/seaborn,anntzer/seaborn,ischwabacher/seaborn,cwu2011/seaborn,dotsdl/seaborn,sauliusl/seaborn,clarkfitzg/seaborn,lukauskas/seaborn,aashish2...
Add simple test for palplot
import nose.tools as nt import numpy.testing as npt import matplotlib.pyplot as plt from .. import miscplot as misc from seaborn import color_palette class TestPalPlot(object): """Test the function that visualizes a color palette.""" def test_palplot_size(self): pal4 = color_palette("husl", 4) ...
<commit_before><commit_msg>Add simple test for palplot<commit_after>
import nose.tools as nt import numpy.testing as npt import matplotlib.pyplot as plt from .. import miscplot as misc from seaborn import color_palette class TestPalPlot(object): """Test the function that visualizes a color palette.""" def test_palplot_size(self): pal4 = color_palette("husl", 4) ...
Add simple test for palplotimport nose.tools as nt import numpy.testing as npt import matplotlib.pyplot as plt from .. import miscplot as misc from seaborn import color_palette class TestPalPlot(object): """Test the function that visualizes a color palette.""" def test_palplot_size(self): pal4 = col...
<commit_before><commit_msg>Add simple test for palplot<commit_after>import nose.tools as nt import numpy.testing as npt import matplotlib.pyplot as plt from .. import miscplot as misc from seaborn import color_palette class TestPalPlot(object): """Test the function that visualizes a color palette.""" def tes...
a09bfa5ca64c52df68581849e1a96efe79dfc2ee
astropy/io/fits/tests/test_fitsdiff_openfile.py
astropy/io/fits/tests/test_fitsdiff_openfile.py
import pytest from astropy.io import fits import numpy as np from pathlib import Path def test_fitsdiff_openfile(tmpdir): """Make sure that failing FITSDiff doesn't leave open files""" path1 = str(tmpdir.join("file1.fits")) path2 = str(tmpdir.join("file2.fits")) hdulist = fits.HDUList([fits.PrimaryHDU...
Add test showing --open-files error when FITSDiff raises AssertionError
Add test showing --open-files error when FITSDiff raises AssertionError
Python
bsd-3-clause
pllim/astropy,dhomeier/astropy,aleksandr-bakanov/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,saimn/astropy,larrybradley/astropy,mhvk/astropy,pllim/astropy,larrybradley/astropy,lpsinger/astropy,larrybradley/astropy,dhomeier/astropy,lpsinger/astropy,astropy/astropy,astropy/astropy,saimn/astropy,dhomeier/as...
Add test showing --open-files error when FITSDiff raises AssertionError
import pytest from astropy.io import fits import numpy as np from pathlib import Path def test_fitsdiff_openfile(tmpdir): """Make sure that failing FITSDiff doesn't leave open files""" path1 = str(tmpdir.join("file1.fits")) path2 = str(tmpdir.join("file2.fits")) hdulist = fits.HDUList([fits.PrimaryHDU...
<commit_before><commit_msg>Add test showing --open-files error when FITSDiff raises AssertionError<commit_after>
import pytest from astropy.io import fits import numpy as np from pathlib import Path def test_fitsdiff_openfile(tmpdir): """Make sure that failing FITSDiff doesn't leave open files""" path1 = str(tmpdir.join("file1.fits")) path2 = str(tmpdir.join("file2.fits")) hdulist = fits.HDUList([fits.PrimaryHDU...
Add test showing --open-files error when FITSDiff raises AssertionErrorimport pytest from astropy.io import fits import numpy as np from pathlib import Path def test_fitsdiff_openfile(tmpdir): """Make sure that failing FITSDiff doesn't leave open files""" path1 = str(tmpdir.join("file1.fits")) path2 = str(...
<commit_before><commit_msg>Add test showing --open-files error when FITSDiff raises AssertionError<commit_after>import pytest from astropy.io import fits import numpy as np from pathlib import Path def test_fitsdiff_openfile(tmpdir): """Make sure that failing FITSDiff doesn't leave open files""" path1 = str(tm...
e1ea5c1c3f1279aca22341bd83b3f73acf50d332
DataWrangling/CaseStudy/tags.py
DataWrangling/CaseStudy/tags.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.cElementTree as ET import pprint import re import os """ Your task is to explore the data a bit more. Before you process the data and add it into your database, you should check the "k" value for each "<tag>" and see if there are any potential problems. We...
Add a script which check the <k> value for each <tag> and see if there are any potential problems
feat: Add a script which check the <k> value for each <tag> and see if there are any potential problems
Python
mit
aguijarro/DataSciencePython
feat: Add a script which check the <k> value for each <tag> and see if there are any potential problems
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.cElementTree as ET import pprint import re import os """ Your task is to explore the data a bit more. Before you process the data and add it into your database, you should check the "k" value for each "<tag>" and see if there are any potential problems. We...
<commit_before><commit_msg>feat: Add a script which check the <k> value for each <tag> and see if there are any potential problems<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.cElementTree as ET import pprint import re import os """ Your task is to explore the data a bit more. Before you process the data and add it into your database, you should check the "k" value for each "<tag>" and see if there are any potential problems. We...
feat: Add a script which check the <k> value for each <tag> and see if there are any potential problems#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.cElementTree as ET import pprint import re import os """ Your task is to explore the data a bit more. Before you process the data and add it into your dat...
<commit_before><commit_msg>feat: Add a script which check the <k> value for each <tag> and see if there are any potential problems<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.cElementTree as ET import pprint import re import os """ Your task is to explore the data a bit more. Before you ...
b3fbc81bf4c00d23042cebc34503c6cf6937db22
test/dunyatest.py
test/dunyatest.py
import unittest from compmusic.dunya.conn import _make_url class DunyaTest(unittest.TestCase): def test_unicode(self): params = {"first": "%^grt"} url = _make_url("path", **params) self.assertEqual(url, 'http://dunya.compmusic.upf.edu/path?first=%25%5Egrt')
Add test for conn._make_url. Test if url is encoded properly
Add test for conn._make_url. Test if url is encoded properly
Python
agpl-3.0
MTG/pycompmusic
Add test for conn._make_url. Test if url is encoded properly
import unittest from compmusic.dunya.conn import _make_url class DunyaTest(unittest.TestCase): def test_unicode(self): params = {"first": "%^grt"} url = _make_url("path", **params) self.assertEqual(url, 'http://dunya.compmusic.upf.edu/path?first=%25%5Egrt')
<commit_before><commit_msg>Add test for conn._make_url. Test if url is encoded properly<commit_after>
import unittest from compmusic.dunya.conn import _make_url class DunyaTest(unittest.TestCase): def test_unicode(self): params = {"first": "%^grt"} url = _make_url("path", **params) self.assertEqual(url, 'http://dunya.compmusic.upf.edu/path?first=%25%5Egrt')
Add test for conn._make_url. Test if url is encoded properlyimport unittest from compmusic.dunya.conn import _make_url class DunyaTest(unittest.TestCase): def test_unicode(self): params = {"first": "%^grt"} url = _make_url("path", **params) self.assertEqual(url, 'http://dunya.compmusic.up...
<commit_before><commit_msg>Add test for conn._make_url. Test if url is encoded properly<commit_after>import unittest from compmusic.dunya.conn import _make_url class DunyaTest(unittest.TestCase): def test_unicode(self): params = {"first": "%^grt"} url = _make_url("path", **params) self.as...
749ab21acc35bd93eb402dc95cc6e8729165a4b8
elections/2008/shapes/coords.py
elections/2008/shapes/coords.py
#!/usr/bin/env python import math def geoToPixel( point, zoom, tilesize=256 ): lng = point[0] if lng > 180.0: lng -= 360.0 lng = lng / 360.0 + 0.5 lat = point[1] lat = 0.5 - ( math.log( math.tan( ( math.pi / 4.0 ) + ( lat * math.pi / 360.0 ) ) ) / math.pi / 2.0 ); scale = ( 1 << zoom ) * tilesize return [ i...
Add geographic coordinte to pixel coordinate converter
Add geographic coordinte to pixel coordinate converter
Python
apache-2.0
cureHsu/js-v2-samples,cureHsu/js-v2-samples,feeilk1991/promenad,feeilk1991/promenad,stephenmcd/js-v2-samples,feeilk1991/promenad,googlearchive/js-v2-samples,bawg/js-v2-samples,alexander0205/js-v2-samples,googlearchive/js-v2-samples,cureHsu/js-v2-samples,googlearchive/js-v2-samples,cureHsu/js-v2-samples,feeilk1991/prome...
Add geographic coordinte to pixel coordinate converter
#!/usr/bin/env python import math def geoToPixel( point, zoom, tilesize=256 ): lng = point[0] if lng > 180.0: lng -= 360.0 lng = lng / 360.0 + 0.5 lat = point[1] lat = 0.5 - ( math.log( math.tan( ( math.pi / 4.0 ) + ( lat * math.pi / 360.0 ) ) ) / math.pi / 2.0 ); scale = ( 1 << zoom ) * tilesize return [ i...
<commit_before><commit_msg>Add geographic coordinte to pixel coordinate converter<commit_after>
#!/usr/bin/env python import math def geoToPixel( point, zoom, tilesize=256 ): lng = point[0] if lng > 180.0: lng -= 360.0 lng = lng / 360.0 + 0.5 lat = point[1] lat = 0.5 - ( math.log( math.tan( ( math.pi / 4.0 ) + ( lat * math.pi / 360.0 ) ) ) / math.pi / 2.0 ); scale = ( 1 << zoom ) * tilesize return [ i...
Add geographic coordinte to pixel coordinate converter#!/usr/bin/env python import math def geoToPixel( point, zoom, tilesize=256 ): lng = point[0] if lng > 180.0: lng -= 360.0 lng = lng / 360.0 + 0.5 lat = point[1] lat = 0.5 - ( math.log( math.tan( ( math.pi / 4.0 ) + ( lat * math.pi / 360.0 ) ) ) / math.pi / ...
<commit_before><commit_msg>Add geographic coordinte to pixel coordinate converter<commit_after>#!/usr/bin/env python import math def geoToPixel( point, zoom, tilesize=256 ): lng = point[0] if lng > 180.0: lng -= 360.0 lng = lng / 360.0 + 0.5 lat = point[1] lat = 0.5 - ( math.log( math.tan( ( math.pi / 4.0 ) + (...
cff64915aaaee0aff3cec7b918cd4a008b327912
chipy_org/urls.py
chipy_org/urls.py
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
Set for zero or one slash
Set for zero or one slash
Python
mit
bharathelangovan/chipy.org,agfor/chipy.org,brianray/chipy.org,brianray/chipy.org,agfor/chipy.org,chicagopython/chipy.org,tanyaschlusser/chipy.org,tanyaschlusser/chipy.org,bharathelangovan/chipy.org,agfor/chipy.org,chicagopython/chipy.org,tanyaschlusser/chipy.org,brianray/chipy.org,chicagopython/chipy.org,bharathelangov...
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
<commit_before>from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpa...
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
<commit_before>from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpa...
60353a2ee3c54b68d83c6e5b55ef298388f81a5c
mcdowell/src/main/python/ch1/arrays.py
mcdowell/src/main/python/ch1/arrays.py
def unique(string): counter = {} for c in string: if c in counter: return False else: counter[c] = 1 else: return True def reverse(string): result = [] for i in range(len(string)): result.append(string[-(i+1)]) return "".join(result) def ...
Rename module and add replace_spaces.
Rename module and add replace_spaces.
Python
mit
jamesewoo/tigeruppercut,jamesewoo/tigeruppercut
Rename module and add replace_spaces.
def unique(string): counter = {} for c in string: if c in counter: return False else: counter[c] = 1 else: return True def reverse(string): result = [] for i in range(len(string)): result.append(string[-(i+1)]) return "".join(result) def ...
<commit_before><commit_msg>Rename module and add replace_spaces.<commit_after>
def unique(string): counter = {} for c in string: if c in counter: return False else: counter[c] = 1 else: return True def reverse(string): result = [] for i in range(len(string)): result.append(string[-(i+1)]) return "".join(result) def ...
Rename module and add replace_spaces.def unique(string): counter = {} for c in string: if c in counter: return False else: counter[c] = 1 else: return True def reverse(string): result = [] for i in range(len(string)): result.append(string[-(i+...
<commit_before><commit_msg>Rename module and add replace_spaces.<commit_after>def unique(string): counter = {} for c in string: if c in counter: return False else: counter[c] = 1 else: return True def reverse(string): result = [] for i in range(len(st...
f406a955784adf14583c3855e175fddeffc94250
fixlib/couch.py
fixlib/couch.py
import fix42 import couchdb import copy class Store(object): def __init__(self, *args): self.db = couchdb.Server(args[0])[args[1]] self._last = None @property def last(self): if self._last is not None: return self._last cur = self.db.view('seq/in', descending=True, limit=1) inc = cur.rows[0].key if...
Move CouchDB-based Store into separate module.
Move CouchDB-based Store into separate module.
Python
bsd-3-clause
djc/fixlib,jvirtanen/fixlib
Move CouchDB-based Store into separate module.
import fix42 import couchdb import copy class Store(object): def __init__(self, *args): self.db = couchdb.Server(args[0])[args[1]] self._last = None @property def last(self): if self._last is not None: return self._last cur = self.db.view('seq/in', descending=True, limit=1) inc = cur.rows[0].key if...
<commit_before><commit_msg>Move CouchDB-based Store into separate module.<commit_after>
import fix42 import couchdb import copy class Store(object): def __init__(self, *args): self.db = couchdb.Server(args[0])[args[1]] self._last = None @property def last(self): if self._last is not None: return self._last cur = self.db.view('seq/in', descending=True, limit=1) inc = cur.rows[0].key if...
Move CouchDB-based Store into separate module.import fix42 import couchdb import copy class Store(object): def __init__(self, *args): self.db = couchdb.Server(args[0])[args[1]] self._last = None @property def last(self): if self._last is not None: return self._last cur = self.db.view('seq/in', descen...
<commit_before><commit_msg>Move CouchDB-based Store into separate module.<commit_after>import fix42 import couchdb import copy class Store(object): def __init__(self, *args): self.db = couchdb.Server(args[0])[args[1]] self._last = None @property def last(self): if self._last is not None: return self._l...
e2b86299738a726b5bec0a2441426ed4651d9a26
dmoj/executors/JAVA10.py
dmoj/executors/JAVA10.py
from dmoj.executors.java_executor import JavacExecutor class Executor(JavacExecutor): compiler = 'javac10' vm = 'java10' name = 'JAVA10' jvm_regex = r'java-10-|openjdk10' test_program = '''\ import java.io.IOException; interface IORunnable { public void run() throws IOException; } public cl...
Add Java 10 (EAP) executor support
Add Java 10 (EAP) executor support
Python
agpl-3.0
DMOJ/judge,DMOJ/judge,DMOJ/judge
Add Java 10 (EAP) executor support
from dmoj.executors.java_executor import JavacExecutor class Executor(JavacExecutor): compiler = 'javac10' vm = 'java10' name = 'JAVA10' jvm_regex = r'java-10-|openjdk10' test_program = '''\ import java.io.IOException; interface IORunnable { public void run() throws IOException; } public cl...
<commit_before><commit_msg>Add Java 10 (EAP) executor support<commit_after>
from dmoj.executors.java_executor import JavacExecutor class Executor(JavacExecutor): compiler = 'javac10' vm = 'java10' name = 'JAVA10' jvm_regex = r'java-10-|openjdk10' test_program = '''\ import java.io.IOException; interface IORunnable { public void run() throws IOException; } public cl...
Add Java 10 (EAP) executor supportfrom dmoj.executors.java_executor import JavacExecutor class Executor(JavacExecutor): compiler = 'javac10' vm = 'java10' name = 'JAVA10' jvm_regex = r'java-10-|openjdk10' test_program = '''\ import java.io.IOException; interface IORunnable { public void run(...
<commit_before><commit_msg>Add Java 10 (EAP) executor support<commit_after>from dmoj.executors.java_executor import JavacExecutor class Executor(JavacExecutor): compiler = 'javac10' vm = 'java10' name = 'JAVA10' jvm_regex = r'java-10-|openjdk10' test_program = '''\ import java.io.IOException; in...
01cb4195bffaeb0ab264fd8d9ee390492312ef15
Problems/spiralMatrix.py
Problems/spiralMatrix.py
#!/Applications/anaconda/envs/Python3/bin def main(): # Test suite matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] spiral = spiral_order(matrix) print(spiral) def spiral_order(matrix): ''' Given an mxn matrix, returns the elements in spiral order Input: list of m...
Add spiral order of matrix problem
Add spiral order of matrix problem
Python
mit
HKuz/Test_Code
Add spiral order of matrix problem
#!/Applications/anaconda/envs/Python3/bin def main(): # Test suite matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] spiral = spiral_order(matrix) print(spiral) def spiral_order(matrix): ''' Given an mxn matrix, returns the elements in spiral order Input: list of m...
<commit_before><commit_msg>Add spiral order of matrix problem<commit_after>
#!/Applications/anaconda/envs/Python3/bin def main(): # Test suite matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] spiral = spiral_order(matrix) print(spiral) def spiral_order(matrix): ''' Given an mxn matrix, returns the elements in spiral order Input: list of m...
Add spiral order of matrix problem#!/Applications/anaconda/envs/Python3/bin def main(): # Test suite matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] spiral = spiral_order(matrix) print(spiral) def spiral_order(matrix): ''' Given an mxn matrix, returns the elements in...
<commit_before><commit_msg>Add spiral order of matrix problem<commit_after>#!/Applications/anaconda/envs/Python3/bin def main(): # Test suite matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] spiral = spiral_order(matrix) print(spiral) def spiral_order(matrix): ''' Giv...
da1bb3a29b9c3da41bf6479563118922bec7f9ba
tests/test_grid.py
tests/test_grid.py
from parcels import Grid import numpy as np import pytest @pytest.mark.parametrize('xdim', [100, 200]) @pytest.mark.parametrize('ydim', [100, 200]) def test_grid_from_data(xdim, ydim): lon = np.linspace(0., 1., xdim, dtype=np.float32) lat = np.linspace(0., 1., ydim, dtype=np.float32) depth = np.zeros(1, d...
Add a baseline test for creating grids from data
Grid: Add a baseline test for creating grids from data
Python
mit
OceanPARCELS/parcels,OceanPARCELS/parcels
Grid: Add a baseline test for creating grids from data
from parcels import Grid import numpy as np import pytest @pytest.mark.parametrize('xdim', [100, 200]) @pytest.mark.parametrize('ydim', [100, 200]) def test_grid_from_data(xdim, ydim): lon = np.linspace(0., 1., xdim, dtype=np.float32) lat = np.linspace(0., 1., ydim, dtype=np.float32) depth = np.zeros(1, d...
<commit_before><commit_msg>Grid: Add a baseline test for creating grids from data<commit_after>
from parcels import Grid import numpy as np import pytest @pytest.mark.parametrize('xdim', [100, 200]) @pytest.mark.parametrize('ydim', [100, 200]) def test_grid_from_data(xdim, ydim): lon = np.linspace(0., 1., xdim, dtype=np.float32) lat = np.linspace(0., 1., ydim, dtype=np.float32) depth = np.zeros(1, d...
Grid: Add a baseline test for creating grids from datafrom parcels import Grid import numpy as np import pytest @pytest.mark.parametrize('xdim', [100, 200]) @pytest.mark.parametrize('ydim', [100, 200]) def test_grid_from_data(xdim, ydim): lon = np.linspace(0., 1., xdim, dtype=np.float32) lat = np.linspace(0.,...
<commit_before><commit_msg>Grid: Add a baseline test for creating grids from data<commit_after>from parcels import Grid import numpy as np import pytest @pytest.mark.parametrize('xdim', [100, 200]) @pytest.mark.parametrize('ydim', [100, 200]) def test_grid_from_data(xdim, ydim): lon = np.linspace(0., 1., xdim, dt...
a3a377818e5521487cca1b08a4cc6adcdc7deef6
soft/python_test/mqttReceiver.py
soft/python_test/mqttReceiver.py
# -*- coding: utf-8 -*- """ Created on Tue Nov 10 20:30:02 2015 @author: piotr at nicecircuits.com """ # -*- coding: utf-8 -*- from __future__ import print_function # compatibility with python 2 and 3 __author__ = 'piotr' import paho.mqtt.client as mqtt import serial, time, re, logging, numpy server = "test.mosquitto...
Add MQTT receiver python script
Add MQTT receiver python script
Python
cc0-1.0
NiceCircuits/DrOctopus,NiceCircuits/DrOctopus,NiceCircuits/DrOctopus,NiceCircuits/DrOctopus
Add MQTT receiver python script
# -*- coding: utf-8 -*- """ Created on Tue Nov 10 20:30:02 2015 @author: piotr at nicecircuits.com """ # -*- coding: utf-8 -*- from __future__ import print_function # compatibility with python 2 and 3 __author__ = 'piotr' import paho.mqtt.client as mqtt import serial, time, re, logging, numpy server = "test.mosquitto...
<commit_before><commit_msg>Add MQTT receiver python script<commit_after>
# -*- coding: utf-8 -*- """ Created on Tue Nov 10 20:30:02 2015 @author: piotr at nicecircuits.com """ # -*- coding: utf-8 -*- from __future__ import print_function # compatibility with python 2 and 3 __author__ = 'piotr' import paho.mqtt.client as mqtt import serial, time, re, logging, numpy server = "test.mosquitto...
Add MQTT receiver python script# -*- coding: utf-8 -*- """ Created on Tue Nov 10 20:30:02 2015 @author: piotr at nicecircuits.com """ # -*- coding: utf-8 -*- from __future__ import print_function # compatibility with python 2 and 3 __author__ = 'piotr' import paho.mqtt.client as mqtt import serial, time, re, logging,...
<commit_before><commit_msg>Add MQTT receiver python script<commit_after># -*- coding: utf-8 -*- """ Created on Tue Nov 10 20:30:02 2015 @author: piotr at nicecircuits.com """ # -*- coding: utf-8 -*- from __future__ import print_function # compatibility with python 2 and 3 __author__ = 'piotr' import paho.mqtt.client ...
787be359bb09d770c218d37c1f4f989cabb8cf1f
chainerrl/misc/reward_filter.py
chainerrl/misc/reward_filter.py
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() class NormalizedRewardFilter(object): def __init__(self, tau=1e-3, scale=1, eps=1e-1): ...
Add reward filters to use average rewards
Add reward filters to use average rewards
Python
mit
toslunar/chainerrl,toslunar/chainerrl
Add reward filters to use average rewards
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() class NormalizedRewardFilter(object): def __init__(self, tau=1e-3, scale=1, eps=1e-1): ...
<commit_before><commit_msg>Add reward filters to use average rewards<commit_after>
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() class NormalizedRewardFilter(object): def __init__(self, tau=1e-3, scale=1, eps=1e-1): ...
Add reward filters to use average rewardsfrom __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() class NormalizedRewardFilter(object): def __init__(s...
<commit_before><commit_msg>Add reward filters to use average rewards<commit_after>from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() class Normalized...
e099786cfd080cc2616fcd22a62954b71740528b
tests/test_main.py
tests/test_main.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 the Li...
Test the CLI interface of fenrir
Test the CLI interface of fenrir
Python
apache-2.0
dstufft/fenrir,dstufft/fenrir
Test the CLI interface of fenrir
# 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 the Li...
<commit_before><commit_msg>Test the CLI interface of fenrir<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 the Li...
Test the CLI interface of fenrir# 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, sof...
<commit_before><commit_msg>Test the CLI interface of fenrir<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 ap...
abf6af81b5f97ca6b6bb479adb1abfdf502d2a9b
utils/solve-all.py
utils/solve-all.py
import os import subprocess import sys import time paths = [] for path, dirs, files in os.walk('puzzles'): for file in files: paths.append(os.path.join(path, file)) for path in paths: for method in ['human', 'hybrid']: start = time.time() try: output = subprocess.check_outp...
Add a wrapper to solve all puzzles in ./puzzles and print out timings (timeout after a minute)
Add a wrapper to solve all puzzles in ./puzzles and print out timings (timeout after a minute)
Python
bsd-3-clause
jpverkamp/takuzu
Add a wrapper to solve all puzzles in ./puzzles and print out timings (timeout after a minute)
import os import subprocess import sys import time paths = [] for path, dirs, files in os.walk('puzzles'): for file in files: paths.append(os.path.join(path, file)) for path in paths: for method in ['human', 'hybrid']: start = time.time() try: output = subprocess.check_outp...
<commit_before><commit_msg>Add a wrapper to solve all puzzles in ./puzzles and print out timings (timeout after a minute)<commit_after>
import os import subprocess import sys import time paths = [] for path, dirs, files in os.walk('puzzles'): for file in files: paths.append(os.path.join(path, file)) for path in paths: for method in ['human', 'hybrid']: start = time.time() try: output = subprocess.check_outp...
Add a wrapper to solve all puzzles in ./puzzles and print out timings (timeout after a minute)import os import subprocess import sys import time paths = [] for path, dirs, files in os.walk('puzzles'): for file in files: paths.append(os.path.join(path, file)) for path in paths: for method in ['human', ...
<commit_before><commit_msg>Add a wrapper to solve all puzzles in ./puzzles and print out timings (timeout after a minute)<commit_after>import os import subprocess import sys import time paths = [] for path, dirs, files in os.walk('puzzles'): for file in files: paths.append(os.path.join(path, file)) for pa...
7fcc89f131753432fe42c0b3c373d3008353ba39
tools/novasetup.py
tools/novasetup.py
# Still some problems... import time import shutil from configobj import ConfigObj NOVA_API_CONF = "/etc/nova/api-paste.ini" OS_API_SEC = "composite:openstack_compute_api_v2" DR_FILTER_TARGET_KEY = "keystone_nolimit" DR_FILTER_TARGET_KEY_VALUE = "compute_req_id faultwrap sizelimit " \ "au...
Add a tools to config nova paste, not finished
Add a tools to config nova paste, not finished
Python
apache-2.0
fs714/drfilter
Add a tools to config nova paste, not finished
# Still some problems... import time import shutil from configobj import ConfigObj NOVA_API_CONF = "/etc/nova/api-paste.ini" OS_API_SEC = "composite:openstack_compute_api_v2" DR_FILTER_TARGET_KEY = "keystone_nolimit" DR_FILTER_TARGET_KEY_VALUE = "compute_req_id faultwrap sizelimit " \ "au...
<commit_before><commit_msg>Add a tools to config nova paste, not finished<commit_after>
# Still some problems... import time import shutil from configobj import ConfigObj NOVA_API_CONF = "/etc/nova/api-paste.ini" OS_API_SEC = "composite:openstack_compute_api_v2" DR_FILTER_TARGET_KEY = "keystone_nolimit" DR_FILTER_TARGET_KEY_VALUE = "compute_req_id faultwrap sizelimit " \ "au...
Add a tools to config nova paste, not finished# Still some problems... import time import shutil from configobj import ConfigObj NOVA_API_CONF = "/etc/nova/api-paste.ini" OS_API_SEC = "composite:openstack_compute_api_v2" DR_FILTER_TARGET_KEY = "keystone_nolimit" DR_FILTER_TARGET_KEY_VALUE = "compute_req_id faultwrap ...
<commit_before><commit_msg>Add a tools to config nova paste, not finished<commit_after># Still some problems... import time import shutil from configobj import ConfigObj NOVA_API_CONF = "/etc/nova/api-paste.ini" OS_API_SEC = "composite:openstack_compute_api_v2" DR_FILTER_TARGET_KEY = "keystone_nolimit" DR_FILTER_TARG...
edf2c0d777672568b2223fdbd6858f9c9a34ee44
DataWrangling/scraping_web2.py
DataWrangling/scraping_web2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script to get information from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=2 about carrier and airports """ from bs4 import BeautifulSoup import requests import urllib2 def extract_data(url, s): # Extract data from a html source from a URL r = s.g...
Create file to get information from a particular URL to get data about airplanes and carriers.
feat: Create file to get information from a particular URL to get data about airplanes and carriers.
Python
mit
aguijarro/DataSciencePython
feat: Create file to get information from a particular URL to get data about airplanes and carriers.
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script to get information from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=2 about carrier and airports """ from bs4 import BeautifulSoup import requests import urllib2 def extract_data(url, s): # Extract data from a html source from a URL r = s.g...
<commit_before><commit_msg>feat: Create file to get information from a particular URL to get data about airplanes and carriers.<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script to get information from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=2 about carrier and airports """ from bs4 import BeautifulSoup import requests import urllib2 def extract_data(url, s): # Extract data from a html source from a URL r = s.g...
feat: Create file to get information from a particular URL to get data about airplanes and carriers.#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script to get information from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=2 about carrier and airports """ from bs4 import BeautifulSoup import requests impo...
<commit_before><commit_msg>feat: Create file to get information from a particular URL to get data about airplanes and carriers.<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script to get information from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=2 about carrier and airports """ from bs4 ...
a239a0b213009c61a7f21f673f8698c3227048e2
tools/write_frames_linux_64.py
tools/write_frames_linux_64.py
#!/usr/bin/env python import os import sys import json import r2pipe from getopt import getopt, GetoptError r2 = None def write_frame(frame_no, lvl_prefix): lvl_path = os.path.join(lvl_prefix, "%d.lvl" % frame_no) print "writing frame %d from %s..." % (frame_no, lvl_path) lvl_frame = json.load(fp = open(...
Add a script to write frame changes to the executable.
Add a script to write frame changes to the executable.
Python
bsd-2-clause
snickerbockers/freedom_editor
Add a script to write frame changes to the executable.
#!/usr/bin/env python import os import sys import json import r2pipe from getopt import getopt, GetoptError r2 = None def write_frame(frame_no, lvl_prefix): lvl_path = os.path.join(lvl_prefix, "%d.lvl" % frame_no) print "writing frame %d from %s..." % (frame_no, lvl_path) lvl_frame = json.load(fp = open(...
<commit_before><commit_msg>Add a script to write frame changes to the executable.<commit_after>
#!/usr/bin/env python import os import sys import json import r2pipe from getopt import getopt, GetoptError r2 = None def write_frame(frame_no, lvl_prefix): lvl_path = os.path.join(lvl_prefix, "%d.lvl" % frame_no) print "writing frame %d from %s..." % (frame_no, lvl_path) lvl_frame = json.load(fp = open(...
Add a script to write frame changes to the executable.#!/usr/bin/env python import os import sys import json import r2pipe from getopt import getopt, GetoptError r2 = None def write_frame(frame_no, lvl_prefix): lvl_path = os.path.join(lvl_prefix, "%d.lvl" % frame_no) print "writing frame %d from %s..." % (fr...
<commit_before><commit_msg>Add a script to write frame changes to the executable.<commit_after>#!/usr/bin/env python import os import sys import json import r2pipe from getopt import getopt, GetoptError r2 = None def write_frame(frame_no, lvl_prefix): lvl_path = os.path.join(lvl_prefix, "%d.lvl" % frame_no) ...
e4e13c5be054707ea08cf18da36f5b01f745c818
mezzanine/twitter/__init__.py
mezzanine/twitter/__init__.py
""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_TYPE_LIST = "lis...
""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_TYPE_LIST = "lis...
Fix error raised when twitter lib is installed, but mezzanine.twitter is removed from INSTALLED_APPS.
Fix error raised when twitter lib is installed, but mezzanine.twitter is removed from INSTALLED_APPS.
Python
bsd-2-clause
damnfine/mezzanine,frankchin/mezzanine,mush42/mezzanine,promil23/mezzanine,ZeroXn/mezzanine,Kniyl/mezzanine,viaregio/mezzanine,damnfine/mezzanine,douglaskastle/mezzanine,nikolas/mezzanine,ZeroXn/mezzanine,readevalprint/mezzanine,promil23/mezzanine,Skytorn86/mezzanine,webounty/mezzanine,frankier/mezzanine,frankier/mezza...
""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_TYPE_LIST = "lis...
""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_TYPE_LIST = "lis...
<commit_before>""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_T...
""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_TYPE_LIST = "lis...
""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_TYPE_LIST = "lis...
<commit_before>""" Provides models and utilities for displaying different types of Twitter feeds. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from mezzanine import __version__ # Constants/choices for the different query types. QUERY_TYPE_USER = "user" QUERY_T...
72b17165cbe2d9a46d2c66abf4919321f02c07c6
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration --------------------------...
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration --------------------------...
Update intersphinx mapping to Django 1.8
Update intersphinx mapping to Django 1.8
Python
mit
bittner/django-analytical,machtfit/django-analytical,apocquet/django-analytical,jcassee/django-analytical,ericdwang/django-analytical,pjdelport/django-analytical,ChristosChristofidis/django-analytical
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration --------------------------...
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration --------------------------...
<commit_before># -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration -----------...
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration --------------------------...
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration --------------------------...
<commit_before># -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing # directory. import sys, os sys.path.append(os.path.join(os.path.abspath('.'), '_ext')) sys.path.append(os.path.dirname(os.path.abspath('.'))) import analytical # -- General configuration -----------...
761c5e18abca2ac5baf837d9da66cf2f5bb04c01
typhon/tests/files/test_utils.py
typhon/tests/files/test_utils.py
from tempfile import NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filename, "w") as file: file.write(self.data) def check_file(self, filename): ...
Add tests for compression and decompression functions
Add tests for compression and decompression functions
Python
mit
atmtools/typhon,atmtools/typhon
Add tests for compression and decompression functions
from tempfile import NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filename, "w") as file: file.write(self.data) def check_file(self, filename): ...
<commit_before><commit_msg>Add tests for compression and decompression functions<commit_after>
from tempfile import NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filename, "w") as file: file.write(self.data) def check_file(self, filename): ...
Add tests for compression and decompression functionsfrom tempfile import NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filename, "w") as file: file.write(s...
<commit_before><commit_msg>Add tests for compression and decompression functions<commit_after>from tempfile import NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filenam...
b3b340764c2f98e9e6393c9e259a7dd7b697167b
oslo/vmware/constants.py
oslo/vmware/constants.py
# Copyright (c) 2014 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
Add constant for ESX datacenter path (HTTP access)
Add constant for ESX datacenter path (HTTP access) This patch adds a constant.py file to store the constants needed in the VMware ecosystem. A new constant is added for the ESX datacenter path when using http access to datastores. Change-Id: Ie5b84b3cc3913ab57f7ab487349557781cc4157a
Python
apache-2.0
openstack/oslo.vmware
Add constant for ESX datacenter path (HTTP access) This patch adds a constant.py file to store the constants needed in the VMware ecosystem. A new constant is added for the ESX datacenter path when using http access to datastores. Change-Id: Ie5b84b3cc3913ab57f7ab487349557781cc4157a
# Copyright (c) 2014 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
<commit_before><commit_msg>Add constant for ESX datacenter path (HTTP access) This patch adds a constant.py file to store the constants needed in the VMware ecosystem. A new constant is added for the ESX datacenter path when using http access to datastores. Change-Id: Ie5b84b3cc3913ab57f7ab487349557781cc4157a<commit_...
# Copyright (c) 2014 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
Add constant for ESX datacenter path (HTTP access) This patch adds a constant.py file to store the constants needed in the VMware ecosystem. A new constant is added for the ESX datacenter path when using http access to datastores. Change-Id: Ie5b84b3cc3913ab57f7ab487349557781cc4157a# Copyright (c) 2014 VMware, Inc. #...
<commit_before><commit_msg>Add constant for ESX datacenter path (HTTP access) This patch adds a constant.py file to store the constants needed in the VMware ecosystem. A new constant is added for the ESX datacenter path when using http access to datastores. Change-Id: Ie5b84b3cc3913ab57f7ab487349557781cc4157a<commit_...
69ad33e03263a7bcb4323460302e2716c34891e3
st2common/tests/unit/test_logging_middleware.py
st2common/tests/unit/test_logging_middleware.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Add a test case for masking secret values in API log messages.
Add a test case for masking secret values in API log messages.
Python
apache-2.0
nzlosh/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,StackStorm/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2
Add a test case for masking secret values in API log messages.
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
<commit_before><commit_msg>Add a test case for masking secret values in API log messages.<commit_after>
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Add a test case for masking secret values in API log messages.# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apa...
<commit_before><commit_msg>Add a test case for masking secret values in API log messages.<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The AS...
c5dd440383935fb4996ca08b76928ed8d84d0fb9
events/templatetags/humantime.py
events/templatetags/humantime.py
# -*- encoding:utf-8 -*- # Template tag from django.template.defaultfilters import stringfilter from datetime import datetime, timedelta from django import template register = template.Library() @register.filter def event_time(start, end): today = datetime.today () result = "" if start == today: ...
Add a template tag filter to properly format the time of events
Add a template tag filter to properly format the time of events
Python
agpl-3.0
vcorreze/agendaEteAccoord,vcorreze/agendaEteAccoord,mlhamel/agendadulibre,mlhamel/agendadulibre,mlhamel/agendadulibre,vcorreze/agendaEteAccoord
Add a template tag filter to properly format the time of events
# -*- encoding:utf-8 -*- # Template tag from django.template.defaultfilters import stringfilter from datetime import datetime, timedelta from django import template register = template.Library() @register.filter def event_time(start, end): today = datetime.today () result = "" if start == today: ...
<commit_before><commit_msg>Add a template tag filter to properly format the time of events<commit_after>
# -*- encoding:utf-8 -*- # Template tag from django.template.defaultfilters import stringfilter from datetime import datetime, timedelta from django import template register = template.Library() @register.filter def event_time(start, end): today = datetime.today () result = "" if start == today: ...
Add a template tag filter to properly format the time of events# -*- encoding:utf-8 -*- # Template tag from django.template.defaultfilters import stringfilter from datetime import datetime, timedelta from django import template register = template.Library() @register.filter def event_time(start, end): today = dat...
<commit_before><commit_msg>Add a template tag filter to properly format the time of events<commit_after># -*- encoding:utf-8 -*- # Template tag from django.template.defaultfilters import stringfilter from datetime import datetime, timedelta from django import template register = template.Library() @register.filter de...
fa3c5c4c80bcf8596013df7636ed7a1e19972c99
polyfit_distributions.py
polyfit_distributions.py
import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 samples = 1000 X = [np.random.zipf(1.2, samples), np...
Build curves for a single zipfian distribution and then 3 combined
Build curves for a single zipfian distribution and then 3 combined
Python
mit
noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit
Build curves for a single zipfian distribution and then 3 combined
import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 samples = 1000 X = [np.random.zipf(1.2, samples), np...
<commit_before><commit_msg>Build curves for a single zipfian distribution and then 3 combined<commit_after>
import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 samples = 1000 X = [np.random.zipf(1.2, samples), np...
Build curves for a single zipfian distribution and then 3 combinedimport numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 ...
<commit_before><commit_msg>Build curves for a single zipfian distribution and then 3 combined<commit_after>import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn)...
8c17a1eb43da7171da9085c2c6e92815460057f3
accelerator/migrations/0014_expert_profile_expert_category_alter_verbose_name.py
accelerator/migrations/0014_expert_profile_expert_category_alter_verbose_name.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-11-25 17:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('accelerator', '0013_remov...
Add migration for altered field
[AC-7272] Add migration for altered field
Python
mit
masschallenge/django-accelerator,masschallenge/django-accelerator
[AC-7272] Add migration for altered field
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-11-25 17:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('accelerator', '0013_remov...
<commit_before><commit_msg>[AC-7272] Add migration for altered field<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-11-25 17:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('accelerator', '0013_remov...
[AC-7272] Add migration for altered field# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-11-25 17:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencie...
<commit_before><commit_msg>[AC-7272] Add migration for altered field<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-11-25 17:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migratio...
f732ab01373e73fe8f707e88f8ba60f4610fc0d4
polling_stations/apps/data_collection/management/commands/import_denbighshire.py
polling_stations/apps/data_collection/management/commands/import_denbighshire.py
""" Import Denbighshire """ from time import sleep from django.contrib.gis.geos import Point from data_collection.management.commands import BaseAddressCsvImporter from data_finder.helpers import geocode class Command(BaseAddressCsvImporter): """ Imports the Polling Station data from Denbighshire """ c...
Add import script for Denbighshire
Add import script for Denbighshire
Python
bsd-3-clause
chris48s/UK-Polling-Stations,andylolz/UK-Polling-Stations,chris48s/UK-Polling-Stations,andylolz/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,andylolz/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations
Add import script for Denbighshire
""" Import Denbighshire """ from time import sleep from django.contrib.gis.geos import Point from data_collection.management.commands import BaseAddressCsvImporter from data_finder.helpers import geocode class Command(BaseAddressCsvImporter): """ Imports the Polling Station data from Denbighshire """ c...
<commit_before><commit_msg>Add import script for Denbighshire<commit_after>
""" Import Denbighshire """ from time import sleep from django.contrib.gis.geos import Point from data_collection.management.commands import BaseAddressCsvImporter from data_finder.helpers import geocode class Command(BaseAddressCsvImporter): """ Imports the Polling Station data from Denbighshire """ c...
Add import script for Denbighshire""" Import Denbighshire """ from time import sleep from django.contrib.gis.geos import Point from data_collection.management.commands import BaseAddressCsvImporter from data_finder.helpers import geocode class Command(BaseAddressCsvImporter): """ Imports the Polling Station da...
<commit_before><commit_msg>Add import script for Denbighshire<commit_after>""" Import Denbighshire """ from time import sleep from django.contrib.gis.geos import Point from data_collection.management.commands import BaseAddressCsvImporter from data_finder.helpers import geocode class Command(BaseAddressCsvImporter): ...
76ae560be419ac350d79db08772d6b7f5722754b
python/sparktestingbase/test/simple_streaming_test.py
python/sparktestingbase/test/simple_streaming_test.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Add a second trivial streaming test to make sure our re-useing the spark context is ok
Add a second trivial streaming test to make sure our re-useing the spark context is ok
Python
apache-2.0
holdenk/spark-testing-base,holdenk/spark-testing-base,ponkin/spark-testing-base,joychugh/spark-testing-base,MiguelPeralvo/spark-testing-base,snithish/spark-testing-base,samklr/spark-testing-base,ghl3/spark-testing-base,MiguelPeralvo/spark-testing-base,MiguelPeralvo/spark-testing-base,jnadler/spark-testing-base,eyeem/sp...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
<commit_before># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License");...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
<commit_before># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License");...
f306b2145d5bff7a3d399e14b60274c58c3bf098
scripts/tests/test_box_migrate_to_external_account.py
scripts/tests/test_box_migrate_to_external_account.py
from nose.tools import * from scripts.box.migrate_to_external_account import do_migration, get_targets from framework.auth import Auth from tests.base import OsfTestCase from tests.factories import ProjectFactory, UserFactory from website.addons.box.model import BoxUserSettings from website.addons.box.tests.factori...
Add test for box migration script
Add test for box migration script
Python
apache-2.0
KAsante95/osf.io,aaxelb/osf.io,Nesiehr/osf.io,emetsger/osf.io,Nesiehr/osf.io,chrisseto/osf.io,Nesiehr/osf.io,saradbowman/osf.io,SSJohns/osf.io,binoculars/osf.io,mluo613/osf.io,leb2dg/osf.io,wearpants/osf.io,HalcyonChimera/osf.io,amyshi188/osf.io,kch8qx/osf.io,acshi/osf.io,saradbowman/osf.io,haoyuchen1992/osf.io,CenterF...
Add test for box migration script
from nose.tools import * from scripts.box.migrate_to_external_account import do_migration, get_targets from framework.auth import Auth from tests.base import OsfTestCase from tests.factories import ProjectFactory, UserFactory from website.addons.box.model import BoxUserSettings from website.addons.box.tests.factori...
<commit_before><commit_msg>Add test for box migration script<commit_after>
from nose.tools import * from scripts.box.migrate_to_external_account import do_migration, get_targets from framework.auth import Auth from tests.base import OsfTestCase from tests.factories import ProjectFactory, UserFactory from website.addons.box.model import BoxUserSettings from website.addons.box.tests.factori...
Add test for box migration scriptfrom nose.tools import * from scripts.box.migrate_to_external_account import do_migration, get_targets from framework.auth import Auth from tests.base import OsfTestCase from tests.factories import ProjectFactory, UserFactory from website.addons.box.model import BoxUserSettings from...
<commit_before><commit_msg>Add test for box migration script<commit_after>from nose.tools import * from scripts.box.migrate_to_external_account import do_migration, get_targets from framework.auth import Auth from tests.base import OsfTestCase from tests.factories import ProjectFactory, UserFactory from website.add...
5eb7a643de51c972b585410b88b4c5f54bf3362a
patterns/creational/facade2.py
patterns/creational/facade2.py
import abc class Shape(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def draw(self): pass class Rectangle(Shape): def __init__(self): super(Rectangle, self).__init__() def draw(self): print 'Drawing Rectangle...' class Square(Shape): def __init__(self): ...
Create a new example of shape using Facade pattern
Create a new example of shape using Facade pattern
Python
mit
rolandovillca/python_basis,rolandovillca/python_introduction_basic,rolandovillca/python_basic_introduction,rolandovillca/python_basic_concepts
Create a new example of shape using Facade pattern
import abc class Shape(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def draw(self): pass class Rectangle(Shape): def __init__(self): super(Rectangle, self).__init__() def draw(self): print 'Drawing Rectangle...' class Square(Shape): def __init__(self): ...
<commit_before><commit_msg>Create a new example of shape using Facade pattern<commit_after>
import abc class Shape(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def draw(self): pass class Rectangle(Shape): def __init__(self): super(Rectangle, self).__init__() def draw(self): print 'Drawing Rectangle...' class Square(Shape): def __init__(self): ...
Create a new example of shape using Facade patternimport abc class Shape(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def draw(self): pass class Rectangle(Shape): def __init__(self): super(Rectangle, self).__init__() def draw(self): print 'Drawing Rectangle.....
<commit_before><commit_msg>Create a new example of shape using Facade pattern<commit_after>import abc class Shape(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def draw(self): pass class Rectangle(Shape): def __init__(self): super(Rectangle, self).__init__() def draw(...
681871b7b7271d8431e8d92a29d8ab02e9d9ba0d
contrib/linux/tests/test_action_dig.py
contrib/linux/tests/test_action_dig.py
#!/usr/bin/env python # Copyright 2020 The StackStorm Developers # # 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 app...
Add initial tests for linux.dig action
Add initial tests for linux.dig action
Python
apache-2.0
StackStorm/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2
Add initial tests for linux.dig action
#!/usr/bin/env python # Copyright 2020 The StackStorm Developers # # 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 app...
<commit_before><commit_msg>Add initial tests for linux.dig action<commit_after>
#!/usr/bin/env python # Copyright 2020 The StackStorm Developers # # 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 app...
Add initial tests for linux.dig action#!/usr/bin/env python # Copyright 2020 The StackStorm Developers # # 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/...
<commit_before><commit_msg>Add initial tests for linux.dig action<commit_after>#!/usr/bin/env python # Copyright 2020 The StackStorm Developers # # 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 a...
0224af7414bdfff6b4bd3118ba50cfc08ed60215
py/expression-add-operators.py
py/expression-add-operators.py
from collections import defaultdict class Solution(object): def dfs_ans(self, ans, depth, lans, ans_list): if depth == lans: yield ''.join(ans_list) else: if isinstance(ans[depth], set): for x in ans[depth]: ans_list.append(x) ...
Add py solution for 282. Expression Add Operators
Add py solution for 282. Expression Add Operators 282. Expression Add Operators: https://leetcode.com/problems/expression-add-operators/ Way too ugly...
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 282. Expression Add Operators 282. Expression Add Operators: https://leetcode.com/problems/expression-add-operators/ Way too ugly...
from collections import defaultdict class Solution(object): def dfs_ans(self, ans, depth, lans, ans_list): if depth == lans: yield ''.join(ans_list) else: if isinstance(ans[depth], set): for x in ans[depth]: ans_list.append(x) ...
<commit_before><commit_msg>Add py solution for 282. Expression Add Operators 282. Expression Add Operators: https://leetcode.com/problems/expression-add-operators/ Way too ugly...<commit_after>
from collections import defaultdict class Solution(object): def dfs_ans(self, ans, depth, lans, ans_list): if depth == lans: yield ''.join(ans_list) else: if isinstance(ans[depth], set): for x in ans[depth]: ans_list.append(x) ...
Add py solution for 282. Expression Add Operators 282. Expression Add Operators: https://leetcode.com/problems/expression-add-operators/ Way too ugly...from collections import defaultdict class Solution(object): def dfs_ans(self, ans, depth, lans, ans_list): if depth == lans: yield ''.join(ans...
<commit_before><commit_msg>Add py solution for 282. Expression Add Operators 282. Expression Add Operators: https://leetcode.com/problems/expression-add-operators/ Way too ugly...<commit_after>from collections import defaultdict class Solution(object): def dfs_ans(self, ans, depth, lans, ans_list): if dep...
192871bcf6fe0881a0b0aface4306cb6ec93710e
test/benchmarks/stepping/TestRunHooksThenSteppings.py
test/benchmarks/stepping/TestRunHooksThenSteppings.py
"""Test lldb's stepping speed.""" import os, sys import unittest2 import lldb import pexpect from lldbbench import * class RunHooksThenSteppingsBench(BenchBase): mydir = os.path.join("benchmarks", "stepping") def setUp(self): BenchBase.setUp(self) self.stepping_avg = None @benchmarks_te...
Add a more generic stepping benchmark, which uses the '-k' option of the test driver to be able to specify the runhook(s) to bring the debug session to a certain state before running the benchmarking logic. An example,
Add a more generic stepping benchmark, which uses the '-k' option of the test driver to be able to specify the runhook(s) to bring the debug session to a certain state before running the benchmarking logic. An example, ./dotest.py -v -t +b -k 'process attach -n Mail' -k 'thread backtrace all' -p TestRunHooksThenStepp...
Python
apache-2.0
apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb
Add a more generic stepping benchmark, which uses the '-k' option of the test driver to be able to specify the runhook(s) to bring the debug session to a certain state before running the benchmarking logic. An example, ./dotest.py -v -t +b -k 'process attach -n Mail' -k 'thread backtrace all' -p TestRunHooksThenStepp...
"""Test lldb's stepping speed.""" import os, sys import unittest2 import lldb import pexpect from lldbbench import * class RunHooksThenSteppingsBench(BenchBase): mydir = os.path.join("benchmarks", "stepping") def setUp(self): BenchBase.setUp(self) self.stepping_avg = None @benchmarks_te...
<commit_before><commit_msg>Add a more generic stepping benchmark, which uses the '-k' option of the test driver to be able to specify the runhook(s) to bring the debug session to a certain state before running the benchmarking logic. An example, ./dotest.py -v -t +b -k 'process attach -n Mail' -k 'thread backtrace al...
"""Test lldb's stepping speed.""" import os, sys import unittest2 import lldb import pexpect from lldbbench import * class RunHooksThenSteppingsBench(BenchBase): mydir = os.path.join("benchmarks", "stepping") def setUp(self): BenchBase.setUp(self) self.stepping_avg = None @benchmarks_te...
Add a more generic stepping benchmark, which uses the '-k' option of the test driver to be able to specify the runhook(s) to bring the debug session to a certain state before running the benchmarking logic. An example, ./dotest.py -v -t +b -k 'process attach -n Mail' -k 'thread backtrace all' -p TestRunHooksThenStepp...
<commit_before><commit_msg>Add a more generic stepping benchmark, which uses the '-k' option of the test driver to be able to specify the runhook(s) to bring the debug session to a certain state before running the benchmarking logic. An example, ./dotest.py -v -t +b -k 'process attach -n Mail' -k 'thread backtrace al...
dd0ee85ef6e36d3e384ac5d20924acb4fd5f3108
tests/commands/logs_test.py
tests/commands/logs_test.py
from mock import patch from ..utils import DustyTestCase from dusty.commands.logs import tail_container_logs class TestLogsCommands(DustyTestCase): @patch('dusty.commands.logs.exec_docker') @patch('dusty.commands.logs.get_dusty_containers') def test_tail_container_logs(self, fake_get_containers, fake_exec...
Add tests for the log command
Add tests for the log command
Python
mit
gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty
Add tests for the log command
from mock import patch from ..utils import DustyTestCase from dusty.commands.logs import tail_container_logs class TestLogsCommands(DustyTestCase): @patch('dusty.commands.logs.exec_docker') @patch('dusty.commands.logs.get_dusty_containers') def test_tail_container_logs(self, fake_get_containers, fake_exec...
<commit_before><commit_msg>Add tests for the log command<commit_after>
from mock import patch from ..utils import DustyTestCase from dusty.commands.logs import tail_container_logs class TestLogsCommands(DustyTestCase): @patch('dusty.commands.logs.exec_docker') @patch('dusty.commands.logs.get_dusty_containers') def test_tail_container_logs(self, fake_get_containers, fake_exec...
Add tests for the log commandfrom mock import patch from ..utils import DustyTestCase from dusty.commands.logs import tail_container_logs class TestLogsCommands(DustyTestCase): @patch('dusty.commands.logs.exec_docker') @patch('dusty.commands.logs.get_dusty_containers') def test_tail_container_logs(self, f...
<commit_before><commit_msg>Add tests for the log command<commit_after>from mock import patch from ..utils import DustyTestCase from dusty.commands.logs import tail_container_logs class TestLogsCommands(DustyTestCase): @patch('dusty.commands.logs.exec_docker') @patch('dusty.commands.logs.get_dusty_containers')...
0c39e2f5774b78ca5025e8ffe0fbde4ab2e86abf
tests/test_summary_class.py
tests/test_summary_class.py
# coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Test text-based summary reporter for coverage.py""" import collections import unittest import os.path try: from cStringIO import StringIO exc...
Add unit-level test for the SummaryReporter Tests configuration of the report method of SummaryReader
Add unit-level test for the SummaryReporter Tests configuration of the report method of SummaryReader
Python
apache-2.0
hugovk/coveragepy,hugovk/coveragepy,blueyed/coveragepy,blueyed/coveragepy,blueyed/coveragepy,nedbat/coveragepy,hugovk/coveragepy,nedbat/coveragepy,nedbat/coveragepy,blueyed/coveragepy,nedbat/coveragepy,blueyed/coveragepy,nedbat/coveragepy,hugovk/coveragepy,hugovk/coveragepy
Add unit-level test for the SummaryReporter Tests configuration of the report method of SummaryReader
# coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Test text-based summary reporter for coverage.py""" import collections import unittest import os.path try: from cStringIO import StringIO exc...
<commit_before><commit_msg>Add unit-level test for the SummaryReporter Tests configuration of the report method of SummaryReader<commit_after>
# coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Test text-based summary reporter for coverage.py""" import collections import unittest import os.path try: from cStringIO import StringIO exc...
Add unit-level test for the SummaryReporter Tests configuration of the report method of SummaryReader# coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Test text-based summary reporter for coverage...
<commit_before><commit_msg>Add unit-level test for the SummaryReporter Tests configuration of the report method of SummaryReader<commit_after># coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Test...
f132b8f2697ec2dc27529f9f633830566d73d663
tests/test_reset.py
tests/test_reset.py
#!/usr/bin/python import sys import pycurl saw_error = 1 def main(): global saw_error pycurl.global_init(pycurl.GLOBAL_DEFAULT) outf = file("/dev/null", "rb+") cm = pycurl.CurlMulti() # Set multi handle's options cm.setopt(pycurl.M_PIPELINING, 1) eh = pycur...
Test for reset fixes refcount bug
Test for reset fixes refcount bug
Python
lgpl-2.1
jcharum/pycurl,ninemoreminutes/pycurl,ninemoreminutes/pycurl,jcharum/pycurl,jcharum/pycurl,ninemoreminutes/pycurl,ninemoreminutes/pycurl
Test for reset fixes refcount bug
#!/usr/bin/python import sys import pycurl saw_error = 1 def main(): global saw_error pycurl.global_init(pycurl.GLOBAL_DEFAULT) outf = file("/dev/null", "rb+") cm = pycurl.CurlMulti() # Set multi handle's options cm.setopt(pycurl.M_PIPELINING, 1) eh = pycur...
<commit_before><commit_msg>Test for reset fixes refcount bug<commit_after>
#!/usr/bin/python import sys import pycurl saw_error = 1 def main(): global saw_error pycurl.global_init(pycurl.GLOBAL_DEFAULT) outf = file("/dev/null", "rb+") cm = pycurl.CurlMulti() # Set multi handle's options cm.setopt(pycurl.M_PIPELINING, 1) eh = pycur...
Test for reset fixes refcount bug#!/usr/bin/python import sys import pycurl saw_error = 1 def main(): global saw_error pycurl.global_init(pycurl.GLOBAL_DEFAULT) outf = file("/dev/null", "rb+") cm = pycurl.CurlMulti() # Set multi handle's options cm.setopt(pycurl.M_P...
<commit_before><commit_msg>Test for reset fixes refcount bug<commit_after>#!/usr/bin/python import sys import pycurl saw_error = 1 def main(): global saw_error pycurl.global_init(pycurl.GLOBAL_DEFAULT) outf = file("/dev/null", "rb+") cm = pycurl.CurlMulti() # Set multi hand...
b8db80eb446e20376cd24fda39f3bf2485e36371
tests/test_utils.py
tests/test_utils.py
def test_fact_mjd_conversion(): from aux2mongodb.utils import fact_mjd_to_datetime timestamp = fact_mjd_to_datetime(16801.33) assert timestamp.year == 2016 assert timestamp.month == 1 assert timestamp.day == 1 assert timestamp.hour == 7 assert timestamp.minute == 55
Add test for date conversion
Add test for date conversion
Python
mit
fact-project/aux2mongodb
Add test for date conversion
def test_fact_mjd_conversion(): from aux2mongodb.utils import fact_mjd_to_datetime timestamp = fact_mjd_to_datetime(16801.33) assert timestamp.year == 2016 assert timestamp.month == 1 assert timestamp.day == 1 assert timestamp.hour == 7 assert timestamp.minute == 55
<commit_before><commit_msg>Add test for date conversion<commit_after>
def test_fact_mjd_conversion(): from aux2mongodb.utils import fact_mjd_to_datetime timestamp = fact_mjd_to_datetime(16801.33) assert timestamp.year == 2016 assert timestamp.month == 1 assert timestamp.day == 1 assert timestamp.hour == 7 assert timestamp.minute == 55
Add test for date conversiondef test_fact_mjd_conversion(): from aux2mongodb.utils import fact_mjd_to_datetime timestamp = fact_mjd_to_datetime(16801.33) assert timestamp.year == 2016 assert timestamp.month == 1 assert timestamp.day == 1 assert timestamp.hour == 7 assert timestamp.minute ==...
<commit_before><commit_msg>Add test for date conversion<commit_after>def test_fact_mjd_conversion(): from aux2mongodb.utils import fact_mjd_to_datetime timestamp = fact_mjd_to_datetime(16801.33) assert timestamp.year == 2016 assert timestamp.month == 1 assert timestamp.day == 1 assert timestamp...
2af220f9d0a9d49c69d54ce1985ec586af9e473b
tools/stats/track_recall.py
tools/stats/track_recall.py
#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('vid_file') parser.add_argument('annot_file') pa...
Add a script to calculate track recalls.
Add a script to calculate track recalls.
Python
mit
myfavouritekk/TPN
Add a script to calculate track recalls.
#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('vid_file') parser.add_argument('annot_file') pa...
<commit_before><commit_msg>Add a script to calculate track recalls.<commit_after>
#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('vid_file') parser.add_argument('annot_file') pa...
Add a script to calculate track recalls.#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('vid_file') ...
<commit_before><commit_msg>Add a script to calculate track recalls.<commit_after>#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser()...
58870974c218a2b4dfc0a53c17af50138d90a8b2
send_email_using_smtp.py
send_email_using_smtp.py
from email.mime.text import MIMEText from smtplib import SMTP import logging #from settings import EMAIL_FROM, EMAIL_MSG, EMAIL_TO, SERVER EMAIL_FROM = '[email protected]' EMAIL_MSG = 'Hi friend!' EMAIL_SUBJECT = 'Hi' EMAIL_TO = '[email protected]' SERVER = 'smtp.example.com' if __name__ == '__main__': msg = MIMETex...
Add send email using SMTP example
Add send email using SMTP example
Python
mit
MattMS/Python_3_examples
Add send email using SMTP example
from email.mime.text import MIMEText from smtplib import SMTP import logging #from settings import EMAIL_FROM, EMAIL_MSG, EMAIL_TO, SERVER EMAIL_FROM = '[email protected]' EMAIL_MSG = 'Hi friend!' EMAIL_SUBJECT = 'Hi' EMAIL_TO = '[email protected]' SERVER = 'smtp.example.com' if __name__ == '__main__': msg = MIMETex...
<commit_before><commit_msg>Add send email using SMTP example<commit_after>
from email.mime.text import MIMEText from smtplib import SMTP import logging #from settings import EMAIL_FROM, EMAIL_MSG, EMAIL_TO, SERVER EMAIL_FROM = '[email protected]' EMAIL_MSG = 'Hi friend!' EMAIL_SUBJECT = 'Hi' EMAIL_TO = '[email protected]' SERVER = 'smtp.example.com' if __name__ == '__main__': msg = MIMETex...
Add send email using SMTP examplefrom email.mime.text import MIMEText from smtplib import SMTP import logging #from settings import EMAIL_FROM, EMAIL_MSG, EMAIL_TO, SERVER EMAIL_FROM = '[email protected]' EMAIL_MSG = 'Hi friend!' EMAIL_SUBJECT = 'Hi' EMAIL_TO = '[email protected]' SERVER = 'smtp.example.com' if __nam...
<commit_before><commit_msg>Add send email using SMTP example<commit_after>from email.mime.text import MIMEText from smtplib import SMTP import logging #from settings import EMAIL_FROM, EMAIL_MSG, EMAIL_TO, SERVER EMAIL_FROM = '[email protected]' EMAIL_MSG = 'Hi friend!' EMAIL_SUBJECT = 'Hi' EMAIL_TO = '[email protected]...
5725fc0c5cd8acc22e332be10e43e32de601bc95
scripts/get_bank_registry_pl.py
scripts/get_bank_registry_pl.py
import json import csv import requests URL = "https://ewib.nbp.pl/plewibnra?dokNazwa=plewibnra.txt" def process(): registry = [] with requests.get(URL, stream=True) as txtfile: for row in txtfile.iter_lines(): if len(row.decode("latin1").split("\t")) != 33: continue ...
Create script to generate PL bank registry
Create script to generate PL bank registry
Python
mit
figo-connect/schwifty
Create script to generate PL bank registry
import json import csv import requests URL = "https://ewib.nbp.pl/plewibnra?dokNazwa=plewibnra.txt" def process(): registry = [] with requests.get(URL, stream=True) as txtfile: for row in txtfile.iter_lines(): if len(row.decode("latin1").split("\t")) != 33: continue ...
<commit_before><commit_msg>Create script to generate PL bank registry<commit_after>
import json import csv import requests URL = "https://ewib.nbp.pl/plewibnra?dokNazwa=plewibnra.txt" def process(): registry = [] with requests.get(URL, stream=True) as txtfile: for row in txtfile.iter_lines(): if len(row.decode("latin1").split("\t")) != 33: continue ...
Create script to generate PL bank registryimport json import csv import requests URL = "https://ewib.nbp.pl/plewibnra?dokNazwa=plewibnra.txt" def process(): registry = [] with requests.get(URL, stream=True) as txtfile: for row in txtfile.iter_lines(): if len(row.decode("latin1").split("\t...
<commit_before><commit_msg>Create script to generate PL bank registry<commit_after>import json import csv import requests URL = "https://ewib.nbp.pl/plewibnra?dokNazwa=plewibnra.txt" def process(): registry = [] with requests.get(URL, stream=True) as txtfile: for row in txtfile.iter_lines(): ...
4ab4bfedbecd70be183b1785562b3b8a97f8c50a
tests/learn/dl/test_models.py
tests/learn/dl/test_models.py
import sys import pytest from numpy.testing import assert_equal import torch sys.path.append("../../../") from pycroscopy.learn import models @pytest.mark.parametrize("dim, size", [(1, [8]), (2, [8, 8]), (3, [8, 8, 8])]) def test_autoencoder_output(dim, size): input_dim = (1, *size) x = torch.randn(2, *inpu...
Add tests for autoencoder models
Add tests for autoencoder models
Python
mit
pycroscopy/pycroscopy
Add tests for autoencoder models
import sys import pytest from numpy.testing import assert_equal import torch sys.path.append("../../../") from pycroscopy.learn import models @pytest.mark.parametrize("dim, size", [(1, [8]), (2, [8, 8]), (3, [8, 8, 8])]) def test_autoencoder_output(dim, size): input_dim = (1, *size) x = torch.randn(2, *inpu...
<commit_before><commit_msg>Add tests for autoencoder models<commit_after>
import sys import pytest from numpy.testing import assert_equal import torch sys.path.append("../../../") from pycroscopy.learn import models @pytest.mark.parametrize("dim, size", [(1, [8]), (2, [8, 8]), (3, [8, 8, 8])]) def test_autoencoder_output(dim, size): input_dim = (1, *size) x = torch.randn(2, *inpu...
Add tests for autoencoder modelsimport sys import pytest from numpy.testing import assert_equal import torch sys.path.append("../../../") from pycroscopy.learn import models @pytest.mark.parametrize("dim, size", [(1, [8]), (2, [8, 8]), (3, [8, 8, 8])]) def test_autoencoder_output(dim, size): input_dim = (1, *si...
<commit_before><commit_msg>Add tests for autoencoder models<commit_after>import sys import pytest from numpy.testing import assert_equal import torch sys.path.append("../../../") from pycroscopy.learn import models @pytest.mark.parametrize("dim, size", [(1, [8]), (2, [8, 8]), (3, [8, 8, 8])]) def test_autoencoder_o...
470998b97ea5c6cf5ed37ab4e6fd4dcf72e2888a
interface_import.py
interface_import.py
__version__ = '0.9' __author__ = 'Remi Batist' # Importing interface-settings from pre-defined csv-file # used row format shown in the example below # csv delimiter ' ; ' # interface description linktype permitvlan pvid # GigabitEthernet1/0/21 server-1 access ...
Set interface-config from pre-defined csv-file
Set interface-config from pre-defined csv-file
Python
mit
rbatist/HPN-Scripting,networkingdvi/HPN-Scripting
Set interface-config from pre-defined csv-file
__version__ = '0.9' __author__ = 'Remi Batist' # Importing interface-settings from pre-defined csv-file # used row format shown in the example below # csv delimiter ' ; ' # interface description linktype permitvlan pvid # GigabitEthernet1/0/21 server-1 access ...
<commit_before><commit_msg>Set interface-config from pre-defined csv-file<commit_after>
__version__ = '0.9' __author__ = 'Remi Batist' # Importing interface-settings from pre-defined csv-file # used row format shown in the example below # csv delimiter ' ; ' # interface description linktype permitvlan pvid # GigabitEthernet1/0/21 server-1 access ...
Set interface-config from pre-defined csv-file __version__ = '0.9' __author__ = 'Remi Batist' # Importing interface-settings from pre-defined csv-file # used row format shown in the example below # csv delimiter ' ; ' # interface description linktype permitvlan pvid # GigabitEthernet1/0...
<commit_before><commit_msg>Set interface-config from pre-defined csv-file<commit_after> __version__ = '0.9' __author__ = 'Remi Batist' # Importing interface-settings from pre-defined csv-file # used row format shown in the example below # csv delimiter ' ; ' # interface description linktype ...
b1fdbd1d256c7cac8c5e79f05af5e514974d3ef2
tests/test_web_application.py
tests/test_web_application.py
import asyncio import pytest from aiohttp import web, log from unittest import mock def test_app_ctor(loop): app = web.Application(loop=loop) assert loop is app.loop assert app.logger is log.web_logger def test_app_call(loop): app = web.Application(loop=loop) assert app is app() def test_app_...
Convert web.Application tests to pytest style
Convert web.Application tests to pytest style
Python
apache-2.0
mind1master/aiohttp,decentfox/aiohttp,panda73111/aiohttp,rutsky/aiohttp,arthurdarcet/aiohttp,Eyepea/aiohttp,alex-eri/aiohttp-1,singulared/aiohttp,elastic-coders/aiohttp,mind1master/aiohttp,esaezgil/aiohttp,arthurdarcet/aiohttp,vaskalas/aiohttp,z2v/aiohttp,esaezgil/aiohttp,Insoleet/aiohttp,elastic-coders/aiohttp,jettify...
Convert web.Application tests to pytest style
import asyncio import pytest from aiohttp import web, log from unittest import mock def test_app_ctor(loop): app = web.Application(loop=loop) assert loop is app.loop assert app.logger is log.web_logger def test_app_call(loop): app = web.Application(loop=loop) assert app is app() def test_app_...
<commit_before><commit_msg>Convert web.Application tests to pytest style<commit_after>
import asyncio import pytest from aiohttp import web, log from unittest import mock def test_app_ctor(loop): app = web.Application(loop=loop) assert loop is app.loop assert app.logger is log.web_logger def test_app_call(loop): app = web.Application(loop=loop) assert app is app() def test_app_...
Convert web.Application tests to pytest styleimport asyncio import pytest from aiohttp import web, log from unittest import mock def test_app_ctor(loop): app = web.Application(loop=loop) assert loop is app.loop assert app.logger is log.web_logger def test_app_call(loop): app = web.Application(loop=...
<commit_before><commit_msg>Convert web.Application tests to pytest style<commit_after>import asyncio import pytest from aiohttp import web, log from unittest import mock def test_app_ctor(loop): app = web.Application(loop=loop) assert loop is app.loop assert app.logger is log.web_logger def test_app_ca...
8782bf61d97000a9267929ee54a158a78e41372c
examples/plt2xyz.py
examples/plt2xyz.py
#!/usr/bin/env python """ usage: plt2xyz.py PLTFILE > outfile.xyz Dumps an XYZ point cloud from a compiled Compass plot file, with the assumption that all "hidden" shots are splays which represent the cave's walls. If the project is tied to realworld UTM coordinates, then X, Y, and Z will be in meters. If no UTM zone...
Add example script which converts a Compass .PLT plot file with splay shots to an XYZ pointcloud.
Add example script which converts a Compass .PLT plot file with splay shots to an XYZ pointcloud.
Python
mit
riggsd/davies
Add example script which converts a Compass .PLT plot file with splay shots to an XYZ pointcloud.
#!/usr/bin/env python """ usage: plt2xyz.py PLTFILE > outfile.xyz Dumps an XYZ point cloud from a compiled Compass plot file, with the assumption that all "hidden" shots are splays which represent the cave's walls. If the project is tied to realworld UTM coordinates, then X, Y, and Z will be in meters. If no UTM zone...
<commit_before><commit_msg>Add example script which converts a Compass .PLT plot file with splay shots to an XYZ pointcloud.<commit_after>
#!/usr/bin/env python """ usage: plt2xyz.py PLTFILE > outfile.xyz Dumps an XYZ point cloud from a compiled Compass plot file, with the assumption that all "hidden" shots are splays which represent the cave's walls. If the project is tied to realworld UTM coordinates, then X, Y, and Z will be in meters. If no UTM zone...
Add example script which converts a Compass .PLT plot file with splay shots to an XYZ pointcloud.#!/usr/bin/env python """ usage: plt2xyz.py PLTFILE > outfile.xyz Dumps an XYZ point cloud from a compiled Compass plot file, with the assumption that all "hidden" shots are splays which represent the cave's walls. If the...
<commit_before><commit_msg>Add example script which converts a Compass .PLT plot file with splay shots to an XYZ pointcloud.<commit_after>#!/usr/bin/env python """ usage: plt2xyz.py PLTFILE > outfile.xyz Dumps an XYZ point cloud from a compiled Compass plot file, with the assumption that all "hidden" shots are splays ...
e1cd24cf2f7133a6ad766d580cd728b4997b141d
COURSE/ML/lab2/lab2_vedio.py
COURSE/ML/lab2/lab2_vedio.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import pandas as pd from sklearn.preprocessing import normalize from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.metrics import confusion_matrix from sklearn.model_selection import KFold from scipy.spatial.distance import cosine as Cos d...
Add ML lab2 vedio version
Add ML lab2 vedio version
Python
mit
calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming
Add ML lab2 vedio version
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import pandas as pd from sklearn.preprocessing import normalize from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.metrics import confusion_matrix from sklearn.model_selection import KFold from scipy.spatial.distance import cosine as Cos d...
<commit_before><commit_msg>Add ML lab2 vedio version<commit_after>
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import pandas as pd from sklearn.preprocessing import normalize from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.metrics import confusion_matrix from sklearn.model_selection import KFold from scipy.spatial.distance import cosine as Cos d...
Add ML lab2 vedio version#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import pandas as pd from sklearn.preprocessing import normalize from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.metrics import confusion_matrix from sklearn.model_selection import KFold from scipy.spatial.distanc...
<commit_before><commit_msg>Add ML lab2 vedio version<commit_after>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import pandas as pd from sklearn.preprocessing import normalize from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.metrics import confusion_matrix from sklearn.model_selectio...
e81c421e1ef2afe896ec035e8af137415eeeab46
geoPrint.py
geoPrint.py
#!/usr/bin/env python import pygeoip, dpkt, socket, optparse gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat') tgt = '173.255.226.98' #Could be added as an argument def banner(): print "#### IP to Physical Address Map p131 ####" pirnt "" def printRecort(tgt): #By itself can print the Lon/Lat of an IP address...
DEBUG AND TEST. This one had a lot of typos
DEBUG AND TEST. This one had a lot of typos
Python
mit
n1cfury/ViolentPython
DEBUG AND TEST. This one had a lot of typos
#!/usr/bin/env python import pygeoip, dpkt, socket, optparse gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat') tgt = '173.255.226.98' #Could be added as an argument def banner(): print "#### IP to Physical Address Map p131 ####" pirnt "" def printRecort(tgt): #By itself can print the Lon/Lat of an IP address...
<commit_before><commit_msg>DEBUG AND TEST. This one had a lot of typos<commit_after>
#!/usr/bin/env python import pygeoip, dpkt, socket, optparse gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat') tgt = '173.255.226.98' #Could be added as an argument def banner(): print "#### IP to Physical Address Map p131 ####" pirnt "" def printRecort(tgt): #By itself can print the Lon/Lat of an IP address...
DEBUG AND TEST. This one had a lot of typos#!/usr/bin/env python import pygeoip, dpkt, socket, optparse gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat') tgt = '173.255.226.98' #Could be added as an argument def banner(): print "#### IP to Physical Address Map p131 ####" pirnt "" def printRecort(tgt): #By i...
<commit_before><commit_msg>DEBUG AND TEST. This one had a lot of typos<commit_after>#!/usr/bin/env python import pygeoip, dpkt, socket, optparse gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat') tgt = '173.255.226.98' #Could be added as an argument def banner(): print "#### IP to Physical Address Map p131 ####...
78120151788b95d01ccf1e0e919572287e598758
openforcefield/tests/test_io.py
openforcefield/tests/test_io.py
#!/usr/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test classes and function in module openforcefield.typing.engines.smirnoff.io. """...
Add tests quantity from string parsing
Add tests quantity from string parsing
Python
mit
openforcefield/openff-toolkit,open-forcefield-group/openforcefield,openforcefield/openff-toolkit,open-forcefield-group/openforcefield,open-forcefield-group/openforcefield
Add tests quantity from string parsing
#!/usr/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test classes and function in module openforcefield.typing.engines.smirnoff.io. """...
<commit_before><commit_msg>Add tests quantity from string parsing<commit_after>
#!/usr/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test classes and function in module openforcefield.typing.engines.smirnoff.io. """...
Add tests quantity from string parsing#!/usr/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test classes and function in module openforce...
<commit_before><commit_msg>Add tests quantity from string parsing<commit_after>#!/usr/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test...
138c6263a3b3a3c24f5fe6b4f300542c74228448
src/btc_inference_cae.py
src/btc_inference_cae.py
import os import numpy as np import tensorflow as tf from btc_settings import * from btc_train import BTCTrain import matplotlib.pyplot as plt from btc_cae_parameters import get_parameters class BTCInferenceCAE(BTCTrain): def __init__(self, paras, input_path, model_path): super().__init__(paras) ...
Add script to do inferencer of autoencoder model
Add script to do inferencer of autoencoder model
Python
mit
quqixun/BrainTumorClassification,quqixun/BrainTumorClassification
Add script to do inferencer of autoencoder model
import os import numpy as np import tensorflow as tf from btc_settings import * from btc_train import BTCTrain import matplotlib.pyplot as plt from btc_cae_parameters import get_parameters class BTCInferenceCAE(BTCTrain): def __init__(self, paras, input_path, model_path): super().__init__(paras) ...
<commit_before><commit_msg>Add script to do inferencer of autoencoder model<commit_after>
import os import numpy as np import tensorflow as tf from btc_settings import * from btc_train import BTCTrain import matplotlib.pyplot as plt from btc_cae_parameters import get_parameters class BTCInferenceCAE(BTCTrain): def __init__(self, paras, input_path, model_path): super().__init__(paras) ...
Add script to do inferencer of autoencoder modelimport os import numpy as np import tensorflow as tf from btc_settings import * from btc_train import BTCTrain import matplotlib.pyplot as plt from btc_cae_parameters import get_parameters class BTCInferenceCAE(BTCTrain): def __init__(self, paras, input_path, model...
<commit_before><commit_msg>Add script to do inferencer of autoencoder model<commit_after>import os import numpy as np import tensorflow as tf from btc_settings import * from btc_train import BTCTrain import matplotlib.pyplot as plt from btc_cae_parameters import get_parameters class BTCInferenceCAE(BTCTrain): de...
980598a458d738186abf0d702535a42f121d8c85
PatternCreate/pattern_create.py
PatternCreate/pattern_create.py
import sys, string, re arguments = [] textString = [] program = True number = ['a','a','a'] def get_pattern(stuff): first = "abcdefghijklmnopqrstuvwxyz0123456789" next = "bcdefghijklmnopqrstuvwxyz0123456789a" table = string.maketrans(first, next) textString.append("".join(number)) for run in range...
Add Exploit Dev Pattern Create
Add Exploit Dev Pattern Create
Python
cc0-1.0
JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology
Add Exploit Dev Pattern Create
import sys, string, re arguments = [] textString = [] program = True number = ['a','a','a'] def get_pattern(stuff): first = "abcdefghijklmnopqrstuvwxyz0123456789" next = "bcdefghijklmnopqrstuvwxyz0123456789a" table = string.maketrans(first, next) textString.append("".join(number)) for run in range...
<commit_before><commit_msg>Add Exploit Dev Pattern Create<commit_after>
import sys, string, re arguments = [] textString = [] program = True number = ['a','a','a'] def get_pattern(stuff): first = "abcdefghijklmnopqrstuvwxyz0123456789" next = "bcdefghijklmnopqrstuvwxyz0123456789a" table = string.maketrans(first, next) textString.append("".join(number)) for run in range...
Add Exploit Dev Pattern Createimport sys, string, re arguments = [] textString = [] program = True number = ['a','a','a'] def get_pattern(stuff): first = "abcdefghijklmnopqrstuvwxyz0123456789" next = "bcdefghijklmnopqrstuvwxyz0123456789a" table = string.maketrans(first, next) textString.append("".jo...
<commit_before><commit_msg>Add Exploit Dev Pattern Create<commit_after>import sys, string, re arguments = [] textString = [] program = True number = ['a','a','a'] def get_pattern(stuff): first = "abcdefghijklmnopqrstuvwxyz0123456789" next = "bcdefghijklmnopqrstuvwxyz0123456789a" table = string.maketrans(...
d2a25e14c9f09139f7d7279465afc34f321902c6
smartpy/__init__.py
smartpy/__init__.py
from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer import tasks.tasks as tasks
from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer from .tasks import tasks
Use relative import to import tasks
Use relative import to import tasks
Python
bsd-3-clause
MarcCote/smartlearner,SMART-Lab/smartlearner,SMART-Lab/smartpy,havaeimo/smartlearner,ASalvail/smartlearner
from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer import tasks.tasks as tasks Use relative import to import tasks
from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer from .tasks import tasks
<commit_before>from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer import tasks.tasks as tasks <commit_msg>Use relative import to import tasks<commit_after>
from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer from .tasks import tasks
from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer import tasks.tasks as tasks Use relative import to import tasksfrom .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer from .tasks import tasks
<commit_before>from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer import tasks.tasks as tasks <commit_msg>Use relative import to import tasks<commit_after>from .interfaces.model import Model from .interfaces.dataset import Dataset from .trainer import Trainer from...
0244217c57686d53e7a0aebef4d0dd328cf809da
trunk/examples/mesonet_oban.py
trunk/examples/mesonet_oban.py
import scipy.constants as sconsts import matplotlib.pyplot as plt from matplotlib.mlab import griddata from mpl_toolkits.basemap import Basemap from metpy import read_mesonet_data, dewpoint, get_wind_components from metpy.constants import C2F from metpy.cbook import append_fields from metpy.vis import station_plot from...
Add an example showing how to use some of the oban functions.
Add an example showing how to use some of the oban functions. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@295 150532fb-1d5b-0410-a8ab-efec50f980d4
Python
bsd-3-clause
deeplycloudy/MetPy,jrleeman/MetPy,jrleeman/MetPy,ahaberlie/MetPy,dopplershift/MetPy,ahill818/MetPy,ahaberlie/MetPy,Unidata/MetPy,Unidata/MetPy,dopplershift/MetPy,ShawnMurd/MetPy
Add an example showing how to use some of the oban functions. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@295 150532fb-1d5b-0410-a8ab-efec50f980d4
import scipy.constants as sconsts import matplotlib.pyplot as plt from matplotlib.mlab import griddata from mpl_toolkits.basemap import Basemap from metpy import read_mesonet_data, dewpoint, get_wind_components from metpy.constants import C2F from metpy.cbook import append_fields from metpy.vis import station_plot from...
<commit_before><commit_msg>Add an example showing how to use some of the oban functions. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@295 150532fb-1d5b-0410-a8ab-efec50f980d4<commit_after>
import scipy.constants as sconsts import matplotlib.pyplot as plt from matplotlib.mlab import griddata from mpl_toolkits.basemap import Basemap from metpy import read_mesonet_data, dewpoint, get_wind_components from metpy.constants import C2F from metpy.cbook import append_fields from metpy.vis import station_plot from...
Add an example showing how to use some of the oban functions. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@295 150532fb-1d5b-0410-a8ab-efec50f980d4import scipy.constants as sconsts import matplotlib.pyplot as plt from matplotlib.mlab import griddata from mpl_toolkits.basemap import Basemap from metpy import re...
<commit_before><commit_msg>Add an example showing how to use some of the oban functions. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@295 150532fb-1d5b-0410-a8ab-efec50f980d4<commit_after>import scipy.constants as sconsts import matplotlib.pyplot as plt from matplotlib.mlab import griddata from mpl_toolkits.ba...
c9d0b1522da83305dcfdfc82c28f2032162c0998
tests/test_compat.py
tests/test_compat.py
import pytest from attr._compat import metadata_proxy @pytest.fixture(name="mp") def _mp(): return metadata_proxy({"x": 42, "y": "foo"}) class TestMetadataProxy: """ Ensure properties of metadata_proxy independently of hypothesis strategies. """ def test_repr(self, mp): """ rep...
Test metadata_proxy properties independently from hypothesis strategies
Test metadata_proxy properties independently from hypothesis strategies Occasionally they fail to cover all bases and break our coverage job on Python 2.7. Signed-off-by: Hynek Schlawack <[email protected]>
Python
mit
python-attrs/attrs
Test metadata_proxy properties independently from hypothesis strategies Occasionally they fail to cover all bases and break our coverage job on Python 2.7. Signed-off-by: Hynek Schlawack <[email protected]>
import pytest from attr._compat import metadata_proxy @pytest.fixture(name="mp") def _mp(): return metadata_proxy({"x": 42, "y": "foo"}) class TestMetadataProxy: """ Ensure properties of metadata_proxy independently of hypothesis strategies. """ def test_repr(self, mp): """ rep...
<commit_before><commit_msg>Test metadata_proxy properties independently from hypothesis strategies Occasionally they fail to cover all bases and break our coverage job on Python 2.7. Signed-off-by: Hynek Schlawack <[email protected]><commit_after>
import pytest from attr._compat import metadata_proxy @pytest.fixture(name="mp") def _mp(): return metadata_proxy({"x": 42, "y": "foo"}) class TestMetadataProxy: """ Ensure properties of metadata_proxy independently of hypothesis strategies. """ def test_repr(self, mp): """ rep...
Test metadata_proxy properties independently from hypothesis strategies Occasionally they fail to cover all bases and break our coverage job on Python 2.7. Signed-off-by: Hynek Schlawack <[email protected]>import pytest from attr._compat import metadata_proxy @pytest.fixture(name="mp")...
<commit_before><commit_msg>Test metadata_proxy properties independently from hypothesis strategies Occasionally they fail to cover all bases and break our coverage job on Python 2.7. Signed-off-by: Hynek Schlawack <[email protected]><commit_after>import pytest from attr._compat import me...
af9f12cec4f187cac079360b4860c056cca014ef
tilezilla/db/_api.py
tilezilla/db/_api.py
from tilezilla.db.sqlite.tables import Base, TileSpec, Tile if __name__ == '__main__': from tilezilla import tilespec, products, stores from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker # engine = create_engine('sqlite:///:memory:', echo=True) engine = create_engine('sqli...
Add demo code for later
Add demo code for later
Python
bsd-3-clause
ceholden/landsat_tiles,ceholden/landsat_tiles,ceholden/landsat_tile,ceholden/landsat_tile,ceholden/tilezilla
Add demo code for later
from tilezilla.db.sqlite.tables import Base, TileSpec, Tile if __name__ == '__main__': from tilezilla import tilespec, products, stores from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker # engine = create_engine('sqlite:///:memory:', echo=True) engine = create_engine('sqli...
<commit_before><commit_msg>Add demo code for later<commit_after>
from tilezilla.db.sqlite.tables import Base, TileSpec, Tile if __name__ == '__main__': from tilezilla import tilespec, products, stores from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker # engine = create_engine('sqlite:///:memory:', echo=True) engine = create_engine('sqli...
Add demo code for laterfrom tilezilla.db.sqlite.tables import Base, TileSpec, Tile if __name__ == '__main__': from tilezilla import tilespec, products, stores from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker # engine = create_engine('sqlite:///:memory:', echo=True) engin...
<commit_before><commit_msg>Add demo code for later<commit_after>from tilezilla.db.sqlite.tables import Base, TileSpec, Tile if __name__ == '__main__': from tilezilla import tilespec, products, stores from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker # engine = create_engine('...
1d7c57d2d9346b396f836e39c188c2c0a2a1797b
tests/test_authtkt.py
tests/test_authtkt.py
import unittest from yocommon.util import configure import authtkt class AuthTktTests(unittest.TestCase): def setUp(self): self.secret = 'hmac secret' self.crypto_secret = 'top secret' self.cookie = ( 'MjQ4MWQ3ODEzNGI2MjE3N2I4OGQ4MDRjNTZkY2YxZGU1MWRkNjY3NjEyMzQ1Njc4O' ...
Add tests (Inspired by yocommon)
Add tests (Inspired by yocommon)
Python
mit
yola/auth_tkt
Add tests (Inspired by yocommon)
import unittest from yocommon.util import configure import authtkt class AuthTktTests(unittest.TestCase): def setUp(self): self.secret = 'hmac secret' self.crypto_secret = 'top secret' self.cookie = ( 'MjQ4MWQ3ODEzNGI2MjE3N2I4OGQ4MDRjNTZkY2YxZGU1MWRkNjY3NjEyMzQ1Njc4O' ...
<commit_before><commit_msg>Add tests (Inspired by yocommon)<commit_after>
import unittest from yocommon.util import configure import authtkt class AuthTktTests(unittest.TestCase): def setUp(self): self.secret = 'hmac secret' self.crypto_secret = 'top secret' self.cookie = ( 'MjQ4MWQ3ODEzNGI2MjE3N2I4OGQ4MDRjNTZkY2YxZGU1MWRkNjY3NjEyMzQ1Njc4O' ...
Add tests (Inspired by yocommon)import unittest from yocommon.util import configure import authtkt class AuthTktTests(unittest.TestCase): def setUp(self): self.secret = 'hmac secret' self.crypto_secret = 'top secret' self.cookie = ( 'MjQ4MWQ3ODEzNGI2MjE3N2I4OGQ4MDRjNTZkY2YxZG...
<commit_before><commit_msg>Add tests (Inspired by yocommon)<commit_after>import unittest from yocommon.util import configure import authtkt class AuthTktTests(unittest.TestCase): def setUp(self): self.secret = 'hmac secret' self.crypto_secret = 'top secret' self.cookie = ( 'M...
5dd8284d9f8b3891de74f22685270b058051c3f0
tests/test_inherit.py
tests/test_inherit.py
# -*- coding: utf-8 -*- """ Tests for inheritance in RegexLexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest from pygments.lexer import RegexLexer, inherit from pygments.token import ...
Add test for RegexLexer inheritance (fails with current code).
Add test for RegexLexer inheritance (fails with current code).
Python
bsd-2-clause
aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygmen...
Add test for RegexLexer inheritance (fails with current code).
# -*- coding: utf-8 -*- """ Tests for inheritance in RegexLexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest from pygments.lexer import RegexLexer, inherit from pygments.token import ...
<commit_before><commit_msg>Add test for RegexLexer inheritance (fails with current code).<commit_after>
# -*- coding: utf-8 -*- """ Tests for inheritance in RegexLexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest from pygments.lexer import RegexLexer, inherit from pygments.token import ...
Add test for RegexLexer inheritance (fails with current code).# -*- coding: utf-8 -*- """ Tests for inheritance in RegexLexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest from pygment...
<commit_before><commit_msg>Add test for RegexLexer inheritance (fails with current code).<commit_after># -*- coding: utf-8 -*- """ Tests for inheritance in RegexLexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for de...
b52db04e4f57e805b3ff9a1b9a5ae61eb1a152d0
rx-tests/rx-async-test-with-closure.py
rx-tests/rx-async-test-with-closure.py
#!/usr/bin/env python3 ''' Process two different streams in parallel, retrieving them from the module's scope ''' import rx import asyncio from concurrent.futures import ThreadPoolExecutor from functools import partial import APIReaderTwitter as Twitter try: import json except ImportError: import si...
Add example of processing two different streams in separate threads retrieving the streams from the module's global scope.
Add example of processing two different streams in separate threads retrieving the streams from the module's global scope.
Python
mit
Pysellus/streaming-api-test,Pysellus/streaming-api-test
Add example of processing two different streams in separate threads retrieving the streams from the module's global scope.
#!/usr/bin/env python3 ''' Process two different streams in parallel, retrieving them from the module's scope ''' import rx import asyncio from concurrent.futures import ThreadPoolExecutor from functools import partial import APIReaderTwitter as Twitter try: import json except ImportError: import si...
<commit_before><commit_msg>Add example of processing two different streams in separate threads retrieving the streams from the module's global scope.<commit_after>
#!/usr/bin/env python3 ''' Process two different streams in parallel, retrieving them from the module's scope ''' import rx import asyncio from concurrent.futures import ThreadPoolExecutor from functools import partial import APIReaderTwitter as Twitter try: import json except ImportError: import si...
Add example of processing two different streams in separate threads retrieving the streams from the module's global scope.#!/usr/bin/env python3 ''' Process two different streams in parallel, retrieving them from the module's scope ''' import rx import asyncio from concurrent.futures import ThreadPoolExecutor...
<commit_before><commit_msg>Add example of processing two different streams in separate threads retrieving the streams from the module's global scope.<commit_after>#!/usr/bin/env python3 ''' Process two different streams in parallel, retrieving them from the module's scope ''' import rx import asyncio from con...
658d92bf118a70f6aa50cc20f78468f7895e077a
examples/expose-application.py
examples/expose-application.py
""" This example: 1. Connects to the current model. 2. Deploys a charm and waits until it reports itself active. 3. Demonstrates exposing application endpoints to space and CIDR combinations. 3. Demonstrates unexposing application endpoints. NOTE: this test must be run against a 2.9 controller. """ from juju import l...
Add example for the expose/unexpose methods
Add example for the expose/unexpose methods
Python
apache-2.0
juju/python-libjuju,juju/python-libjuju
Add example for the expose/unexpose methods
""" This example: 1. Connects to the current model. 2. Deploys a charm and waits until it reports itself active. 3. Demonstrates exposing application endpoints to space and CIDR combinations. 3. Demonstrates unexposing application endpoints. NOTE: this test must be run against a 2.9 controller. """ from juju import l...
<commit_before><commit_msg>Add example for the expose/unexpose methods<commit_after>
""" This example: 1. Connects to the current model. 2. Deploys a charm and waits until it reports itself active. 3. Demonstrates exposing application endpoints to space and CIDR combinations. 3. Demonstrates unexposing application endpoints. NOTE: this test must be run against a 2.9 controller. """ from juju import l...
Add example for the expose/unexpose methods""" This example: 1. Connects to the current model. 2. Deploys a charm and waits until it reports itself active. 3. Demonstrates exposing application endpoints to space and CIDR combinations. 3. Demonstrates unexposing application endpoints. NOTE: this test must be run again...
<commit_before><commit_msg>Add example for the expose/unexpose methods<commit_after>""" This example: 1. Connects to the current model. 2. Deploys a charm and waits until it reports itself active. 3. Demonstrates exposing application endpoints to space and CIDR combinations. 3. Demonstrates unexposing application endp...
abd7c37bee88841ccddf057a430f72f0313eb19c
maediprojects/query/finances.py
maediprojects/query/finances.py
from maediprojects import db, models from sqlalchemy import * import datetime def isostring_date(value): # Returns a date object from a string of format YYYY-MM-DD return datetime.datetime.strptime(value, "%Y-%m-%d") def isostring_year(value): # Returns a date object from a string of format YYYY retur...
Add ability to create and update financial data
Add ability to create and update financial data
Python
agpl-3.0
markbrough/maedi-projects,markbrough/maedi-projects,markbrough/maedi-projects
Add ability to create and update financial data
from maediprojects import db, models from sqlalchemy import * import datetime def isostring_date(value): # Returns a date object from a string of format YYYY-MM-DD return datetime.datetime.strptime(value, "%Y-%m-%d") def isostring_year(value): # Returns a date object from a string of format YYYY retur...
<commit_before><commit_msg>Add ability to create and update financial data<commit_after>
from maediprojects import db, models from sqlalchemy import * import datetime def isostring_date(value): # Returns a date object from a string of format YYYY-MM-DD return datetime.datetime.strptime(value, "%Y-%m-%d") def isostring_year(value): # Returns a date object from a string of format YYYY retur...
Add ability to create and update financial datafrom maediprojects import db, models from sqlalchemy import * import datetime def isostring_date(value): # Returns a date object from a string of format YYYY-MM-DD return datetime.datetime.strptime(value, "%Y-%m-%d") def isostring_year(value): # Returns a dat...
<commit_before><commit_msg>Add ability to create and update financial data<commit_after>from maediprojects import db, models from sqlalchemy import * import datetime def isostring_date(value): # Returns a date object from a string of format YYYY-MM-DD return datetime.datetime.strptime(value, "%Y-%m-%d") def i...
c603dc219d47ef255ef30447526e9c8dff82a5db
blues/python.py
blues/python.py
""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run, info from refa...
""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run, info from refa...
Make pip log world writable
Make pip log world writable
Python
mit
adisbladis/blues,jocke-l/blues,gelbander/blues,jocke-l/blues,Sportamore/blues,gelbander/blues,chrippa/blues,andreif/blues,gelbander/blues,5monkeys/blues,Sportamore/blues,chrippa/blues,adisbladis/blues,andreif/blues,adisbladis/blues,5monkeys/blues,jocke-l/blues,Sportamore/blues,andreif/blues,5monkeys/blues,chrippa/blues
""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run, info from refa...
""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run, info from refa...
<commit_before>""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run,...
""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run, info from refa...
""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run, info from refa...
<commit_before>""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run,...
67f4631faecf672ecc472adb95cabeec53e950eb
git.py
git.py
from subprocess import check_output def get_sha(): """Determines Git SHA of current working directory.""" return check_output(["git", "log","-n1","--pretty=oneline"]).split(' ')[0]
Add Git SHA read util
Add Git SHA read util
Python
bsd-2-clause
Multifarious/fabulous
Add Git SHA read util
from subprocess import check_output def get_sha(): """Determines Git SHA of current working directory.""" return check_output(["git", "log","-n1","--pretty=oneline"]).split(' ')[0]
<commit_before><commit_msg>Add Git SHA read util<commit_after>
from subprocess import check_output def get_sha(): """Determines Git SHA of current working directory.""" return check_output(["git", "log","-n1","--pretty=oneline"]).split(' ')[0]
Add Git SHA read utilfrom subprocess import check_output def get_sha(): """Determines Git SHA of current working directory.""" return check_output(["git", "log","-n1","--pretty=oneline"]).split(' ')[0]
<commit_before><commit_msg>Add Git SHA read util<commit_after>from subprocess import check_output def get_sha(): """Determines Git SHA of current working directory.""" return check_output(["git", "log","-n1","--pretty=oneline"]).split(' ')[0]
3228bf3dd1a32694b42f4d08a5c6f0e63bf5128a
all_reports_smell_search_final.py
all_reports_smell_search_final.py
from map import mapping # walk through the os and get all files # read each file in tern and go through line by line # print lines that contain smell and the report name from os import listdir import nltk.data import json SMELL_WORDS = ['smell', 'stench', 'stink', 'odour', 'sniff', 'effluvium'] REPORTS_DIR = '/Users/...
Add script to datamine the reports via NLTK
Add script to datamine the reports via NLTK
Python
apache-2.0
Smelly-London/Smelly-London,Smelly-London/Smelly-London,Smelly-London/datavisualisation,Smelly-London/Smelly-London,Smelly-London/datavisualisation,Smelly-London/Smelly-London
Add script to datamine the reports via NLTK
from map import mapping # walk through the os and get all files # read each file in tern and go through line by line # print lines that contain smell and the report name from os import listdir import nltk.data import json SMELL_WORDS = ['smell', 'stench', 'stink', 'odour', 'sniff', 'effluvium'] REPORTS_DIR = '/Users/...
<commit_before><commit_msg>Add script to datamine the reports via NLTK<commit_after>
from map import mapping # walk through the os and get all files # read each file in tern and go through line by line # print lines that contain smell and the report name from os import listdir import nltk.data import json SMELL_WORDS = ['smell', 'stench', 'stink', 'odour', 'sniff', 'effluvium'] REPORTS_DIR = '/Users/...
Add script to datamine the reports via NLTK from map import mapping # walk through the os and get all files # read each file in tern and go through line by line # print lines that contain smell and the report name from os import listdir import nltk.data import json SMELL_WORDS = ['smell', 'stench', 'stink', 'odour', '...
<commit_before><commit_msg>Add script to datamine the reports via NLTK<commit_after> from map import mapping # walk through the os and get all files # read each file in tern and go through line by line # print lines that contain smell and the report name from os import listdir import nltk.data import json SMELL_WORDS ...
21c5e1f52b4f50b146e480f68d10da73cf5306d3
backend/scripts/addusertoproj.py
backend/scripts/addusertoproj.py
#!/usr/bin/env python import rethinkdb as r from optparse import OptionParser import sys class Access(object): def __init__(self, user_id, project_id, project_name): self.user_id = user_id self.project_id = project_id self.project_name = project_name self.dataset = "" self...
Add script to add a user to a project
Add script to add a user to a project
Python
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
Add script to add a user to a project
#!/usr/bin/env python import rethinkdb as r from optparse import OptionParser import sys class Access(object): def __init__(self, user_id, project_id, project_name): self.user_id = user_id self.project_id = project_id self.project_name = project_name self.dataset = "" self...
<commit_before><commit_msg>Add script to add a user to a project<commit_after>
#!/usr/bin/env python import rethinkdb as r from optparse import OptionParser import sys class Access(object): def __init__(self, user_id, project_id, project_name): self.user_id = user_id self.project_id = project_id self.project_name = project_name self.dataset = "" self...
Add script to add a user to a project#!/usr/bin/env python import rethinkdb as r from optparse import OptionParser import sys class Access(object): def __init__(self, user_id, project_id, project_name): self.user_id = user_id self.project_id = project_id self.project_name = project_name ...
<commit_before><commit_msg>Add script to add a user to a project<commit_after>#!/usr/bin/env python import rethinkdb as r from optparse import OptionParser import sys class Access(object): def __init__(self, user_id, project_id, project_name): self.user_id = user_id self.project_id = project_id ...
a2120c11eb50553ea74fd615a446e0bd2db07ea0
tests/python/email_processor.py
tests/python/email_processor.py
import email import imaplib import os import sys class EmailProcessor(): mail = None def __init__(self, user, password, host='mail.mega.co.nz', port=993): self.mail = imaplib.IMAP4_SSL(host, port) self.mail.login(user, password) self.mail.select('Inbox') def get_validation_link_f...
Add Python script used to retrieve confirmation links from emails
Add Python script used to retrieve confirmation links from emails
Python
bsd-2-clause
meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk
Add Python script used to retrieve confirmation links from emails
import email import imaplib import os import sys class EmailProcessor(): mail = None def __init__(self, user, password, host='mail.mega.co.nz', port=993): self.mail = imaplib.IMAP4_SSL(host, port) self.mail.login(user, password) self.mail.select('Inbox') def get_validation_link_f...
<commit_before><commit_msg>Add Python script used to retrieve confirmation links from emails<commit_after>
import email import imaplib import os import sys class EmailProcessor(): mail = None def __init__(self, user, password, host='mail.mega.co.nz', port=993): self.mail = imaplib.IMAP4_SSL(host, port) self.mail.login(user, password) self.mail.select('Inbox') def get_validation_link_f...
Add Python script used to retrieve confirmation links from emailsimport email import imaplib import os import sys class EmailProcessor(): mail = None def __init__(self, user, password, host='mail.mega.co.nz', port=993): self.mail = imaplib.IMAP4_SSL(host, port) self.mail.login(user, password)...
<commit_before><commit_msg>Add Python script used to retrieve confirmation links from emails<commit_after>import email import imaplib import os import sys class EmailProcessor(): mail = None def __init__(self, user, password, host='mail.mega.co.nz', port=993): self.mail = imaplib.IMAP4_SSL(host, port...
6548c29e87945e22b002bc25323983319cca914c
normandy/recipes/migrations/0014_auto_20190228_1128.py
normandy/recipes/migrations/0014_auto_20190228_1128.py
# Generated by Django 2.0.13 on 2019-02-28 11:28 import json from urllib.parse import unquote_plus from django.db import migrations def remove_signatures(apps, schema_editor): Recipe = apps.get_model("recipes", "Recipe") Action = apps.get_model("recipes", "Action") Signature = apps.get_model("recipes",...
Add migration to add extension ID to addon study recipes
Add migration to add extension ID to addon study recipes
Python
mpl-2.0
mozilla/normandy,mozilla/normandy,mozilla/normandy,mozilla/normandy
Add migration to add extension ID to addon study recipes
# Generated by Django 2.0.13 on 2019-02-28 11:28 import json from urllib.parse import unquote_plus from django.db import migrations def remove_signatures(apps, schema_editor): Recipe = apps.get_model("recipes", "Recipe") Action = apps.get_model("recipes", "Action") Signature = apps.get_model("recipes",...
<commit_before><commit_msg>Add migration to add extension ID to addon study recipes<commit_after>
# Generated by Django 2.0.13 on 2019-02-28 11:28 import json from urllib.parse import unquote_plus from django.db import migrations def remove_signatures(apps, schema_editor): Recipe = apps.get_model("recipes", "Recipe") Action = apps.get_model("recipes", "Action") Signature = apps.get_model("recipes",...
Add migration to add extension ID to addon study recipes# Generated by Django 2.0.13 on 2019-02-28 11:28 import json from urllib.parse import unquote_plus from django.db import migrations def remove_signatures(apps, schema_editor): Recipe = apps.get_model("recipes", "Recipe") Action = apps.get_model("recip...
<commit_before><commit_msg>Add migration to add extension ID to addon study recipes<commit_after># Generated by Django 2.0.13 on 2019-02-28 11:28 import json from urllib.parse import unquote_plus from django.db import migrations def remove_signatures(apps, schema_editor): Recipe = apps.get_model("recipes", "Re...
f42052078a08a9707e2030a3352a03f80a6485b2
calexicon/internal/gregorian.py
calexicon/internal/gregorian.py
def is_gregorian_leap_year(y): if (y % 400) == 0: return True if (y % 100) == 0: return False if (y % 4) == 0: return True return False # pragma: no cover def days_in_month(year, month): if month == 2 and is_gregorian_leap_year(year): return 29 return [None, 31,...
Create days_in_month fn in new internal module.
Create days_in_month fn in new internal module.
Python
apache-2.0
jwg4/qual,jwg4/calexicon
Create days_in_month fn in new internal module.
def is_gregorian_leap_year(y): if (y % 400) == 0: return True if (y % 100) == 0: return False if (y % 4) == 0: return True return False # pragma: no cover def days_in_month(year, month): if month == 2 and is_gregorian_leap_year(year): return 29 return [None, 31,...
<commit_before><commit_msg>Create days_in_month fn in new internal module.<commit_after>
def is_gregorian_leap_year(y): if (y % 400) == 0: return True if (y % 100) == 0: return False if (y % 4) == 0: return True return False # pragma: no cover def days_in_month(year, month): if month == 2 and is_gregorian_leap_year(year): return 29 return [None, 31,...
Create days_in_month fn in new internal module.def is_gregorian_leap_year(y): if (y % 400) == 0: return True if (y % 100) == 0: return False if (y % 4) == 0: return True return False # pragma: no cover def days_in_month(year, month): if month == 2 and is_gregorian_leap_year...
<commit_before><commit_msg>Create days_in_month fn in new internal module.<commit_after>def is_gregorian_leap_year(y): if (y % 400) == 0: return True if (y % 100) == 0: return False if (y % 4) == 0: return True return False # pragma: no cover def days_in_month(year, month): ...
a831393edb8493ecf6185fb52b58a9053d810ead
dissemin/tcp.py
dissemin/tcp.py
# -*- encoding: utf-8 -*- from __future__ import unicode_literals def orcid_base_domain(request): from django.conf import settings return {'ORCID_BASE_DOMAIN':settings.ORCID_BASE_DOMAIN}
Add missing template context processor
Add missing template context processor
Python
agpl-3.0
dissemin/dissemin,wetneb/dissemin,wetneb/dissemin,dissemin/dissemin,dissemin/dissemin,dissemin/dissemin,wetneb/dissemin,dissemin/dissemin,wetneb/dissemin
Add missing template context processor
# -*- encoding: utf-8 -*- from __future__ import unicode_literals def orcid_base_domain(request): from django.conf import settings return {'ORCID_BASE_DOMAIN':settings.ORCID_BASE_DOMAIN}
<commit_before><commit_msg>Add missing template context processor<commit_after>
# -*- encoding: utf-8 -*- from __future__ import unicode_literals def orcid_base_domain(request): from django.conf import settings return {'ORCID_BASE_DOMAIN':settings.ORCID_BASE_DOMAIN}
Add missing template context processor# -*- encoding: utf-8 -*- from __future__ import unicode_literals def orcid_base_domain(request): from django.conf import settings return {'ORCID_BASE_DOMAIN':settings.ORCID_BASE_DOMAIN}
<commit_before><commit_msg>Add missing template context processor<commit_after># -*- encoding: utf-8 -*- from __future__ import unicode_literals def orcid_base_domain(request): from django.conf import settings return {'ORCID_BASE_DOMAIN':settings.ORCID_BASE_DOMAIN}
ff7c952e991d6bb6b47d02ec5fc9b66584187cc2
fake_player_data.py
fake_player_data.py
"""Generate fake data for testing purposes.""" from faker import Faker from random import randint from GoPlayer import Player from pprint import pprint fake = Faker() names = [fake.name() for x in range(49)] ids = [x for x in range(49)] ranks = [randint(-30, 7) for x in range(49)] player_info = list(zip(names, ids,...
Create fake data for testing
Create fake data for testing
Python
mit
unyth/tournament_graph
Create fake data for testing
"""Generate fake data for testing purposes.""" from faker import Faker from random import randint from GoPlayer import Player from pprint import pprint fake = Faker() names = [fake.name() for x in range(49)] ids = [x for x in range(49)] ranks = [randint(-30, 7) for x in range(49)] player_info = list(zip(names, ids,...
<commit_before><commit_msg>Create fake data for testing<commit_after>
"""Generate fake data for testing purposes.""" from faker import Faker from random import randint from GoPlayer import Player from pprint import pprint fake = Faker() names = [fake.name() for x in range(49)] ids = [x for x in range(49)] ranks = [randint(-30, 7) for x in range(49)] player_info = list(zip(names, ids,...
Create fake data for testing"""Generate fake data for testing purposes.""" from faker import Faker from random import randint from GoPlayer import Player from pprint import pprint fake = Faker() names = [fake.name() for x in range(49)] ids = [x for x in range(49)] ranks = [randint(-30, 7) for x in range(49)] player...
<commit_before><commit_msg>Create fake data for testing<commit_after>"""Generate fake data for testing purposes.""" from faker import Faker from random import randint from GoPlayer import Player from pprint import pprint fake = Faker() names = [fake.name() for x in range(49)] ids = [x for x in range(49)] ranks = [ra...
4ae806af174f7d64acfa7c802507863e2650de72
workflow/Workflow.py
workflow/Workflow.py
from git import * def prefix(): # TODO: Extract to common class if other workflow providers installed return "issue/" def __findRepo(): return Repo(".") def createBranchName(issueName, desc): branchName = prefix() + str(issueName) if (desc != None): branchName += "/" + str(desc) retu...
Add a script to implement the workflow pieces.
Add a script to implement the workflow pieces.
Python
apache-2.0
bable5/git-workflow
Add a script to implement the workflow pieces.
from git import * def prefix(): # TODO: Extract to common class if other workflow providers installed return "issue/" def __findRepo(): return Repo(".") def createBranchName(issueName, desc): branchName = prefix() + str(issueName) if (desc != None): branchName += "/" + str(desc) retu...
<commit_before><commit_msg>Add a script to implement the workflow pieces.<commit_after>
from git import * def prefix(): # TODO: Extract to common class if other workflow providers installed return "issue/" def __findRepo(): return Repo(".") def createBranchName(issueName, desc): branchName = prefix() + str(issueName) if (desc != None): branchName += "/" + str(desc) retu...
Add a script to implement the workflow pieces.from git import * def prefix(): # TODO: Extract to common class if other workflow providers installed return "issue/" def __findRepo(): return Repo(".") def createBranchName(issueName, desc): branchName = prefix() + str(issueName) if (desc != None): ...
<commit_before><commit_msg>Add a script to implement the workflow pieces.<commit_after>from git import * def prefix(): # TODO: Extract to common class if other workflow providers installed return "issue/" def __findRepo(): return Repo(".") def createBranchName(issueName, desc): branchName = prefix() ...
b86ab8d1e7eb8f0329fea2146aefe56b9726920a
testing/models/test_campaign.py
testing/models/test_campaign.py
import pytest from k2catalogue import models @pytest.fixture def campaign(): return models.Campaign(id=5) def test_campaign_repr(campaign): assert repr(campaign) == '<Campaign: 5>'
Add test for campaign repr
Add test for campaign repr
Python
mit
mindriot101/k2catalogue
Add test for campaign repr
import pytest from k2catalogue import models @pytest.fixture def campaign(): return models.Campaign(id=5) def test_campaign_repr(campaign): assert repr(campaign) == '<Campaign: 5>'
<commit_before><commit_msg>Add test for campaign repr<commit_after>
import pytest from k2catalogue import models @pytest.fixture def campaign(): return models.Campaign(id=5) def test_campaign_repr(campaign): assert repr(campaign) == '<Campaign: 5>'
Add test for campaign reprimport pytest from k2catalogue import models @pytest.fixture def campaign(): return models.Campaign(id=5) def test_campaign_repr(campaign): assert repr(campaign) == '<Campaign: 5>'
<commit_before><commit_msg>Add test for campaign repr<commit_after>import pytest from k2catalogue import models @pytest.fixture def campaign(): return models.Campaign(id=5) def test_campaign_repr(campaign): assert repr(campaign) == '<Campaign: 5>'
52640eb2053e155c7f33468c0e6c74512b062b0b
event-schemas/check_examples.py
event-schemas/check_examples.py
#! /usr/bin/env python import sys import json import os def import_error(module, package, debian, error): sys.stderr.write(( "Error importing %(module)s: %(error)r\n" "To install %(module)s run:\n" " pip install %(package)s\n" "or on Debian run:\n" " sudo apt-get install...
Add a python script for checking that the examples match the event schema.
Add a python script for checking that the examples match the event schema. Does the same checks as check.sh, but is a *lot* faster making it suitable for using as a pre-commit hook. I don't suggest replacing check.sh since it's good to check that the schema works with multiple implementations of jsonschema.
Python
apache-2.0
matrix-org/matrix-doc,matrix-org/matrix-doc,matrix-org/matrix-doc,matrix-org/matrix-doc
Add a python script for checking that the examples match the event schema. Does the same checks as check.sh, but is a *lot* faster making it suitable for using as a pre-commit hook. I don't suggest replacing check.sh since it's good to check that the schema works with multiple implementations of jsonschema.
#! /usr/bin/env python import sys import json import os def import_error(module, package, debian, error): sys.stderr.write(( "Error importing %(module)s: %(error)r\n" "To install %(module)s run:\n" " pip install %(package)s\n" "or on Debian run:\n" " sudo apt-get install...
<commit_before><commit_msg>Add a python script for checking that the examples match the event schema. Does the same checks as check.sh, but is a *lot* faster making it suitable for using as a pre-commit hook. I don't suggest replacing check.sh since it's good to check that the schema works with multiple implementatio...
#! /usr/bin/env python import sys import json import os def import_error(module, package, debian, error): sys.stderr.write(( "Error importing %(module)s: %(error)r\n" "To install %(module)s run:\n" " pip install %(package)s\n" "or on Debian run:\n" " sudo apt-get install...
Add a python script for checking that the examples match the event schema. Does the same checks as check.sh, but is a *lot* faster making it suitable for using as a pre-commit hook. I don't suggest replacing check.sh since it's good to check that the schema works with multiple implementations of jsonschema.#! /usr/bi...
<commit_before><commit_msg>Add a python script for checking that the examples match the event schema. Does the same checks as check.sh, but is a *lot* faster making it suitable for using as a pre-commit hook. I don't suggest replacing check.sh since it's good to check that the schema works with multiple implementatio...
c2c38ec799721b5f8c671e69b59448450da76964
shop/cms_menus.py
shop/cms_menus.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from menus.menu_pool import menu_pool class CatalogMenu(CMSAttachMenu): name = _("Catalog Menu") def get_nod...
Add CatalogMenu allowing to use the CMS menu system for products
Add CatalogMenu allowing to use the CMS menu system for products
Python
bsd-3-clause
divio/django-shop,nimbis/django-shop,divio/django-shop,nimbis/django-shop,awesto/django-shop,divio/django-shop,nimbis/django-shop,nimbis/django-shop,awesto/django-shop,awesto/django-shop
Add CatalogMenu allowing to use the CMS menu system for products
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from menus.menu_pool import menu_pool class CatalogMenu(CMSAttachMenu): name = _("Catalog Menu") def get_nod...
<commit_before><commit_msg>Add CatalogMenu allowing to use the CMS menu system for products<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from menus.menu_pool import menu_pool class CatalogMenu(CMSAttachMenu): name = _("Catalog Menu") def get_nod...
Add CatalogMenu allowing to use the CMS menu system for products# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from menus.menu_pool import menu_pool class CatalogMe...
<commit_before><commit_msg>Add CatalogMenu allowing to use the CMS menu system for products<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from menus.men...
16f6f63d0d4b7362445d7aafdd6b664412ab7076
dic_reader_2D.py
dic_reader_2D.py
# -*- coding: utf-8 -*- """ Created on Sun Dec 13 12:50:28 2015 @author: [email protected] @author: [email protected] @author: [email protected] """ import csv import numpy as np class dic_reader_2D(): def __init__(self,path): self.data = [] self.read(path) self.sortdata() def r...
Add the reder for two dimensional dic csv
Add the reder for two dimensional dic csv
Python
mit
lm2-poly/peridynamics_1D,lm2-poly/peridynamics_1D,ilyasst/peridynamics_1D
Add the reder for two dimensional dic csv
# -*- coding: utf-8 -*- """ Created on Sun Dec 13 12:50:28 2015 @author: [email protected] @author: [email protected] @author: [email protected] """ import csv import numpy as np class dic_reader_2D(): def __init__(self,path): self.data = [] self.read(path) self.sortdata() def r...
<commit_before><commit_msg>Add the reder for two dimensional dic csv<commit_after>
# -*- coding: utf-8 -*- """ Created on Sun Dec 13 12:50:28 2015 @author: [email protected] @author: [email protected] @author: [email protected] """ import csv import numpy as np class dic_reader_2D(): def __init__(self,path): self.data = [] self.read(path) self.sortdata() def r...
Add the reder for two dimensional dic csv# -*- coding: utf-8 -*- """ Created on Sun Dec 13 12:50:28 2015 @author: [email protected] @author: [email protected] @author: [email protected] """ import csv import numpy as np class dic_reader_2D(): def __init__(self,path): self.data = [] self....
<commit_before><commit_msg>Add the reder for two dimensional dic csv<commit_after># -*- coding: utf-8 -*- """ Created on Sun Dec 13 12:50:28 2015 @author: [email protected] @author: [email protected] @author: [email protected] """ import csv import numpy as np class dic_reader_2D(): def __init__...
88b77d2bedda3b08eb55ef163de577e775c6bb26
tools/experimental_ssh_eventlet.py
tools/experimental_ssh_eventlet.py
#!/usr/bin/python import eventlet from eventlet.green import socket import libssh2 import time import os import random def monitor(hostname, username, id): print '%s %s %d' % (hostname, username, id) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, 22)) session = lib...
Add an experimental ssh monitoring script.
Add an experimental ssh monitoring script. Signed-off-by: Angus Salkeld <[email protected]>
Python
apache-2.0
gonzolino/heat,jasondunsmore/heat,steveb/heat-cfntools,miguelgrinberg/heat,miguelgrinberg/heat,rickerc/heat_audit,dragorosson/heat,jasondunsmore/heat,cwolferh/heat-scratch,NeCTAR-RC/heat,rdo-management/heat,srznew/heat,rh-s/heat,NeCTAR-RC/heat,citrix-openstack-build/heat,dragorosson/heat,maestro-hybrid-cloud/heat,steve...
Add an experimental ssh monitoring script. Signed-off-by: Angus Salkeld <[email protected]>
#!/usr/bin/python import eventlet from eventlet.green import socket import libssh2 import time import os import random def monitor(hostname, username, id): print '%s %s %d' % (hostname, username, id) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, 22)) session = lib...
<commit_before><commit_msg>Add an experimental ssh monitoring script. Signed-off-by: Angus Salkeld <[email protected]><commit_after>
#!/usr/bin/python import eventlet from eventlet.green import socket import libssh2 import time import os import random def monitor(hostname, username, id): print '%s %s %d' % (hostname, username, id) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, 22)) session = lib...
Add an experimental ssh monitoring script. Signed-off-by: Angus Salkeld <[email protected]>#!/usr/bin/python import eventlet from eventlet.green import socket import libssh2 import time import os import random def monitor(hostname, username, id): print '%s %s %d' % (hostname, ...
<commit_before><commit_msg>Add an experimental ssh monitoring script. Signed-off-by: Angus Salkeld <[email protected]><commit_after>#!/usr/bin/python import eventlet from eventlet.green import socket import libssh2 import time import os import random def monitor(hostname, username,...
cc240f959156f4b9facc6a954019efa98d8cff86
array/989.py
array/989.py
class Solution: def addToArrayForm(self, A: List[int], K: int) -> List[int]: num = int(''.join(str(x) for x in A)) + K return ([int(x) for x in str(num)])
Add to Array-Form of Integer
Add to Array-Form of Integer
Python
apache-2.0
MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode
Add to Array-Form of Integer
class Solution: def addToArrayForm(self, A: List[int], K: int) -> List[int]: num = int(''.join(str(x) for x in A)) + K return ([int(x) for x in str(num)])
<commit_before><commit_msg>Add to Array-Form of Integer<commit_after>
class Solution: def addToArrayForm(self, A: List[int], K: int) -> List[int]: num = int(''.join(str(x) for x in A)) + K return ([int(x) for x in str(num)])
Add to Array-Form of Integerclass Solution: def addToArrayForm(self, A: List[int], K: int) -> List[int]: num = int(''.join(str(x) for x in A)) + K return ([int(x) for x in str(num)])
<commit_before><commit_msg>Add to Array-Form of Integer<commit_after>class Solution: def addToArrayForm(self, A: List[int], K: int) -> List[int]: num = int(''.join(str(x) for x in A)) + K return ([int(x) for x in str(num)])
b05cb7b5b8f507f63c9f1c43db43a29a3acf59c9
physics/ccg_haar.py
physics/ccg_haar.py
# encoding: utf-8 """Routines for sampling from the Haar measures of the classical compact groups. Algorithms taken from http://arxiv.org/abs/math-ph/0609050. TODO Symplectic groups are missing """ from __future__ import division, print_function import numpy as np from scipy.linalg import qr, eigvals def goe(dim, ...
Add the random matrix module
Add the random matrix module
Python
unlicense
dseuss/pythonlibs
Add the random matrix module
# encoding: utf-8 """Routines for sampling from the Haar measures of the classical compact groups. Algorithms taken from http://arxiv.org/abs/math-ph/0609050. TODO Symplectic groups are missing """ from __future__ import division, print_function import numpy as np from scipy.linalg import qr, eigvals def goe(dim, ...
<commit_before><commit_msg>Add the random matrix module<commit_after>
# encoding: utf-8 """Routines for sampling from the Haar measures of the classical compact groups. Algorithms taken from http://arxiv.org/abs/math-ph/0609050. TODO Symplectic groups are missing """ from __future__ import division, print_function import numpy as np from scipy.linalg import qr, eigvals def goe(dim, ...
Add the random matrix module # encoding: utf-8 """Routines for sampling from the Haar measures of the classical compact groups. Algorithms taken from http://arxiv.org/abs/math-ph/0609050. TODO Symplectic groups are missing """ from __future__ import division, print_function import numpy as np from scipy.linalg import...
<commit_before><commit_msg>Add the random matrix module<commit_after> # encoding: utf-8 """Routines for sampling from the Haar measures of the classical compact groups. Algorithms taken from http://arxiv.org/abs/math-ph/0609050. TODO Symplectic groups are missing """ from __future__ import division, print_function im...
993424c053e9a1da9011bd4a8835e95ad881e903
alerts/open_port_violation.py
alerts/open_port_violation.py
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation # # Contributors: # Jonathan Claudius [email protected]...
Add open port violation alert
Add open port violation alert
Python
mpl-2.0
mozilla/MozDef,jeffbryner/MozDef,jeffbryner/MozDef,ameihm0912/MozDef,mpurzynski/MozDef,ameihm0912/MozDef,mpurzynski/MozDef,mpurzynski/MozDef,mpurzynski/MozDef,ameihm0912/MozDef,Phrozyn/MozDef,mozilla/MozDef,Phrozyn/MozDef,jeffbryner/MozDef,gdestuynder/MozDef,ameihm0912/MozDef,gdestuynder/MozDef,mozilla/MozDef,gdestuynd...
Add open port violation alert
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation # # Contributors: # Jonathan Claudius [email protected]...
<commit_before><commit_msg>Add open port violation alert<commit_after>
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation # # Contributors: # Jonathan Claudius [email protected]...
Add open port violation alert#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation # # Contributors: # Jonathan...
<commit_before><commit_msg>Add open port violation alert<commit_after>#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla...
82464394910d46a24e0ba3cd015530ee85d68bab
examples/save_jpeg_using_pil.py
examples/save_jpeg_using_pil.py
# Usage: python examples/save_jpeg_using_pil.py src.CR2 dest.jpg # Requires PIL (pip install pillow) import sys from PIL import Image from rawkit.raw import Raw src = sys.argv[1] dest = sys.argv[2] with Raw(filename=src) as raw: rgb_buffer = raw.to_buffer() # Convert the buffer from [r, g, b, r...] to [(r,...
Add example saving jpg using pillow
Add example saving jpg using pillow
Python
mit
photoshell/rawkit
Add example saving jpg using pillow
# Usage: python examples/save_jpeg_using_pil.py src.CR2 dest.jpg # Requires PIL (pip install pillow) import sys from PIL import Image from rawkit.raw import Raw src = sys.argv[1] dest = sys.argv[2] with Raw(filename=src) as raw: rgb_buffer = raw.to_buffer() # Convert the buffer from [r, g, b, r...] to [(r,...
<commit_before><commit_msg>Add example saving jpg using pillow<commit_after>
# Usage: python examples/save_jpeg_using_pil.py src.CR2 dest.jpg # Requires PIL (pip install pillow) import sys from PIL import Image from rawkit.raw import Raw src = sys.argv[1] dest = sys.argv[2] with Raw(filename=src) as raw: rgb_buffer = raw.to_buffer() # Convert the buffer from [r, g, b, r...] to [(r,...
Add example saving jpg using pillow# Usage: python examples/save_jpeg_using_pil.py src.CR2 dest.jpg # Requires PIL (pip install pillow) import sys from PIL import Image from rawkit.raw import Raw src = sys.argv[1] dest = sys.argv[2] with Raw(filename=src) as raw: rgb_buffer = raw.to_buffer() # Convert the ...
<commit_before><commit_msg>Add example saving jpg using pillow<commit_after># Usage: python examples/save_jpeg_using_pil.py src.CR2 dest.jpg # Requires PIL (pip install pillow) import sys from PIL import Image from rawkit.raw import Raw src = sys.argv[1] dest = sys.argv[2] with Raw(filename=src) as raw: rgb_buf...
8bd7e0a8f1b3bd69faf454dd8a779fd5b4d4acbd
heat/tests/test_cli.py
heat/tests/test_cli.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
Add test to simply run a few binaries
Add test to simply run a few binaries This is not really a unit test, but it's so fast that I think it could be considered as such. And it would be nice to gate on such blatant breakage. Change-Id: I8ff4ca27a912c30bd962168418ac44217ea9e54d Signed-off-by: Jeff Peeler <[email protected]...
Python
apache-2.0
varunarya10/heat,dragorosson/heat,rh-s/heat,jasondunsmore/heat,Triv90/Heat,ntt-sic/heat,citrix-openstack-build/heat,pratikmallya/heat,redhat-openstack/heat,pshchelo/heat,Triv90/Heat,openstack/heat,maestro-hybrid-cloud/heat,dims/heat,rickerc/heat_audit,rh-s/heat,miguelgrinberg/heat,cwolferh/heat-scratch,srznew/heat,Triv...
Add test to simply run a few binaries This is not really a unit test, but it's so fast that I think it could be considered as such. And it would be nice to gate on such blatant breakage. Change-Id: I8ff4ca27a912c30bd962168418ac44217ea9e54d Signed-off-by: Jeff Peeler <[email protected]...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
<commit_before><commit_msg>Add test to simply run a few binaries This is not really a unit test, but it's so fast that I think it could be considered as such. And it would be nice to gate on such blatant breakage. Change-Id: I8ff4ca27a912c30bd962168418ac44217ea9e54d Signed-off-by: Jeff Peeler <d776211e63e47e40d00501f...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
Add test to simply run a few binaries This is not really a unit test, but it's so fast that I think it could be considered as such. And it would be nice to gate on such blatant breakage. Change-Id: I8ff4ca27a912c30bd962168418ac44217ea9e54d Signed-off-by: Jeff Peeler <[email protected]...
<commit_before><commit_msg>Add test to simply run a few binaries This is not really a unit test, but it's so fast that I think it could be considered as such. And it would be nice to gate on such blatant breakage. Change-Id: I8ff4ca27a912c30bd962168418ac44217ea9e54d Signed-off-by: Jeff Peeler <d776211e63e47e40d00501f...
2a343aa13fb000ffb56173e77207fe14c3bbe85c
mezzanine/accounts/models.py
mezzanine/accounts/models.py
from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE", None): # This w...
from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname, get_profile_for_user from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE"...
Use get_profile_for_user() in profile signal handler
Use get_profile_for_user() in profile signal handler
Python
bsd-2-clause
joshcartme/mezzanine,vladir/mezzanine,industrydive/mezzanine,SoLoHiC/mezzanine,sjdines/mezzanine,dustinrb/mezzanine,spookylukey/mezzanine,damnfine/mezzanine,sjdines/mezzanine,frankchin/mezzanine,dsanders11/mezzanine,biomassives/mezzanine,frankchin/mezzanine,agepoly/mezzanine,wyzex/mezzanine,dsanders11/mezzanine,emile20...
from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE", None): # This w...
from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname, get_profile_for_user from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE"...
<commit_before>from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE", None)...
from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname, get_profile_for_user from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE"...
from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE", None): # This w...
<commit_before>from django.db import DatabaseError, connection from django.db.models.signals import post_save from mezzanine.accounts import get_profile_user_fieldname from mezzanine.conf import settings from mezzanine.utils.models import lazy_model_ops __all__ = () if getattr(settings, "AUTH_PROFILE_MODULE", None)...
16d6dd8f3f2359a3a5d83eac9d2812560ab2d6bf
microcosm_pubsub/handlers.py
microcosm_pubsub/handlers.py
""" Handler base classes. """ from abc import ABCMeta from inflection import humanize from requests import get class URIHandler(object): """ Base handler for URI-driven events. As a general rule, we want PubSub events to convey the URI of a resource that was created (because resources are ideally i...
Add a base handler for URI-oriented pubsub messages
Add a base handler for URI-oriented pubsub messages
Python
apache-2.0
globality-corp/microcosm-pubsub,globality-corp/microcosm-pubsub
Add a base handler for URI-oriented pubsub messages
""" Handler base classes. """ from abc import ABCMeta from inflection import humanize from requests import get class URIHandler(object): """ Base handler for URI-driven events. As a general rule, we want PubSub events to convey the URI of a resource that was created (because resources are ideally i...
<commit_before><commit_msg>Add a base handler for URI-oriented pubsub messages<commit_after>
""" Handler base classes. """ from abc import ABCMeta from inflection import humanize from requests import get class URIHandler(object): """ Base handler for URI-driven events. As a general rule, we want PubSub events to convey the URI of a resource that was created (because resources are ideally i...
Add a base handler for URI-oriented pubsub messages""" Handler base classes. """ from abc import ABCMeta from inflection import humanize from requests import get class URIHandler(object): """ Base handler for URI-driven events. As a general rule, we want PubSub events to convey the URI of a resource th...
<commit_before><commit_msg>Add a base handler for URI-oriented pubsub messages<commit_after>""" Handler base classes. """ from abc import ABCMeta from inflection import humanize from requests import get class URIHandler(object): """ Base handler for URI-driven events. As a general rule, we want PubSub ...
df4601af8ce70e48ffd4362556c2b07e4a6f53db
nettests/experimental/script.py
nettests/experimental/script.py
from ooni import nettest from ooni.utils import log from twisted.internet import defer, protocol, reactor from twisted.python import usage import os def which(program): def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.split(program) if fpath: ...
Add Dominic Hamon's nettest for running tests written with other interpreters.
Add Dominic Hamon's nettest for running tests written with other interpreters. * Fixes #8011.
Python
bsd-2-clause
kdmurray91/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,kd...
Add Dominic Hamon's nettest for running tests written with other interpreters. * Fixes #8011.
from ooni import nettest from ooni.utils import log from twisted.internet import defer, protocol, reactor from twisted.python import usage import os def which(program): def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.split(program) if fpath: ...
<commit_before><commit_msg>Add Dominic Hamon's nettest for running tests written with other interpreters. * Fixes #8011.<commit_after>
from ooni import nettest from ooni.utils import log from twisted.internet import defer, protocol, reactor from twisted.python import usage import os def which(program): def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.split(program) if fpath: ...
Add Dominic Hamon's nettest for running tests written with other interpreters. * Fixes #8011.from ooni import nettest from ooni.utils import log from twisted.internet import defer, protocol, reactor from twisted.python import usage import os def which(program): def is_exe(fpath): return os.path.isfile(...
<commit_before><commit_msg>Add Dominic Hamon's nettest for running tests written with other interpreters. * Fixes #8011.<commit_after>from ooni import nettest from ooni.utils import log from twisted.internet import defer, protocol, reactor from twisted.python import usage import os def which(program): def is_e...
3c4a91171c3588a918415801f39442a5733dcfd4
tests/test_rst.py
tests/test_rst.py
# -*- coding: utf-8 -*- import sys import os import pytest sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src/epicslide")) import rst class TestRst(object): def test_pygments(self): p = rst.Pygments('') print p.__dict__ print p.run() assert False def html_pa...
Structure for the Rst test
Structure for the Rst test
Python
apache-2.0
netantho/epicslide,netantho/epicslide
Structure for the Rst test
# -*- coding: utf-8 -*- import sys import os import pytest sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src/epicslide")) import rst class TestRst(object): def test_pygments(self): p = rst.Pygments('') print p.__dict__ print p.run() assert False def html_pa...
<commit_before><commit_msg>Structure for the Rst test<commit_after>
# -*- coding: utf-8 -*- import sys import os import pytest sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src/epicslide")) import rst class TestRst(object): def test_pygments(self): p = rst.Pygments('') print p.__dict__ print p.run() assert False def html_pa...
Structure for the Rst test# -*- coding: utf-8 -*- import sys import os import pytest sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src/epicslide")) import rst class TestRst(object): def test_pygments(self): p = rst.Pygments('') print p.__dict__ print p.run() ass...
<commit_before><commit_msg>Structure for the Rst test<commit_after># -*- coding: utf-8 -*- import sys import os import pytest sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src/epicslide")) import rst class TestRst(object): def test_pygments(self): p = rst.Pygments('') print p._...
88021ff39f63a6d4616028a8a7e5226e1e706e93
cmsplugin_zinnia/cms_toolbar.py
cmsplugin_zinnia/cms_toolbar.py
"""Toolbar extensions for CMS""" from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool class ZinniaToolbar(CMSToolbar): def populate(self): zinnia_menu = self.toolbar.get_or_c...
Add a toolbar for Zinnia
Add a toolbar for Zinnia
Python
bsd-3-clause
bittner/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia
Add a toolbar for Zinnia
"""Toolbar extensions for CMS""" from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool class ZinniaToolbar(CMSToolbar): def populate(self): zinnia_menu = self.toolbar.get_or_c...
<commit_before><commit_msg>Add a toolbar for Zinnia<commit_after>
"""Toolbar extensions for CMS""" from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool class ZinniaToolbar(CMSToolbar): def populate(self): zinnia_menu = self.toolbar.get_or_c...
Add a toolbar for Zinnia"""Toolbar extensions for CMS""" from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool class ZinniaToolbar(CMSToolbar): def populate(self): zinnia_menu...
<commit_before><commit_msg>Add a toolbar for Zinnia<commit_after>"""Toolbar extensions for CMS""" from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool class ZinniaToolbar(CMSToolbar): ...
4d774d2707779885384dafa00be7bc0617133989
src/ocspdash/custom_columns.py
src/ocspdash/custom_columns.py
from sqlalchemy.types import TypeDecorator, BINARY from sqlalchemy.dialects.postgresql import UUID import uuid class UUID(TypeDecorator): """Platform-independent UUID type. Uses Postgresql's UUID type, otherwise uses BINARY(16). Based on http://docs.sqlalchemy.org/en/rel_0_9/core/custom_types.html?hi...
Create a custom UUID column type
Create a custom UUID column type
Python
mit
scolby33/OCSPdash,scolby33/OCSPdash,scolby33/OCSPdash
Create a custom UUID column type
from sqlalchemy.types import TypeDecorator, BINARY from sqlalchemy.dialects.postgresql import UUID import uuid class UUID(TypeDecorator): """Platform-independent UUID type. Uses Postgresql's UUID type, otherwise uses BINARY(16). Based on http://docs.sqlalchemy.org/en/rel_0_9/core/custom_types.html?hi...
<commit_before><commit_msg>Create a custom UUID column type<commit_after>
from sqlalchemy.types import TypeDecorator, BINARY from sqlalchemy.dialects.postgresql import UUID import uuid class UUID(TypeDecorator): """Platform-independent UUID type. Uses Postgresql's UUID type, otherwise uses BINARY(16). Based on http://docs.sqlalchemy.org/en/rel_0_9/core/custom_types.html?hi...
Create a custom UUID column typefrom sqlalchemy.types import TypeDecorator, BINARY from sqlalchemy.dialects.postgresql import UUID import uuid class UUID(TypeDecorator): """Platform-independent UUID type. Uses Postgresql's UUID type, otherwise uses BINARY(16). Based on http://docs.sqlalchemy.org/en/r...
<commit_before><commit_msg>Create a custom UUID column type<commit_after>from sqlalchemy.types import TypeDecorator, BINARY from sqlalchemy.dialects.postgresql import UUID import uuid class UUID(TypeDecorator): """Platform-independent UUID type. Uses Postgresql's UUID type, otherwise uses BINARY(16). ...
4a1ea1545c6428f3695c001ef9960ea696d20a36
test_utilities/src/d1_test/instance_generator/sciobj.py
test_utilities/src/d1_test/instance_generator/sciobj.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import re import StringIO import d1_common.xml import d1_test.d1_test_case import d1_test.instance_generator.identifier import d1_test.instance_generator.system_metadata def generate_reproducible(client, pid=None, option_dict=None): """Generate science o...
Add instance generator for complete reproducible objects
Add instance generator for complete reproducible objects
Python
apache-2.0
DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python
Add instance generator for complete reproducible objects
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import re import StringIO import d1_common.xml import d1_test.d1_test_case import d1_test.instance_generator.identifier import d1_test.instance_generator.system_metadata def generate_reproducible(client, pid=None, option_dict=None): """Generate science o...
<commit_before><commit_msg>Add instance generator for complete reproducible objects<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import re import StringIO import d1_common.xml import d1_test.d1_test_case import d1_test.instance_generator.identifier import d1_test.instance_generator.system_metadata def generate_reproducible(client, pid=None, option_dict=None): """Generate science o...
Add instance generator for complete reproducible objects#!/usr/bin/env python # -*- coding: utf-8 -*- import random import re import StringIO import d1_common.xml import d1_test.d1_test_case import d1_test.instance_generator.identifier import d1_test.instance_generator.system_metadata def generate_reproducible(clie...
<commit_before><commit_msg>Add instance generator for complete reproducible objects<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- import random import re import StringIO import d1_common.xml import d1_test.d1_test_case import d1_test.instance_generator.identifier import d1_test.instance_generator.system_...
96731d45f56a6fd2d6a11aa3e2f595c84e52cb37
tests/test_core_lexer.py
tests/test_core_lexer.py
# -*- coding: utf-8 -*- import sshrc.core.lexer as lexer import pytest @pytest.mark.parametrize("input_, output_", ( ("", ""), (" ", ""), (" #", ""), ("# ", ""), (" # dsfsdfsdf sdfsdfsd", ""), (" a", " a"), (" a# sdfsfdf", " a"), (" a # sdfsfsd x xxxxxxx # sdfs...
Add tests for cleaning line
Add tests for cleaning line
Python
mit
9seconds/concierge,9seconds/sshrc
Add tests for cleaning line
# -*- coding: utf-8 -*- import sshrc.core.lexer as lexer import pytest @pytest.mark.parametrize("input_, output_", ( ("", ""), (" ", ""), (" #", ""), ("# ", ""), (" # dsfsdfsdf sdfsdfsd", ""), (" a", " a"), (" a# sdfsfdf", " a"), (" a # sdfsfsd x xxxxxxx # sdfs...
<commit_before><commit_msg>Add tests for cleaning line<commit_after>
# -*- coding: utf-8 -*- import sshrc.core.lexer as lexer import pytest @pytest.mark.parametrize("input_, output_", ( ("", ""), (" ", ""), (" #", ""), ("# ", ""), (" # dsfsdfsdf sdfsdfsd", ""), (" a", " a"), (" a# sdfsfdf", " a"), (" a # sdfsfsd x xxxxxxx # sdfs...
Add tests for cleaning line# -*- coding: utf-8 -*- import sshrc.core.lexer as lexer import pytest @pytest.mark.parametrize("input_, output_", ( ("", ""), (" ", ""), (" #", ""), ("# ", ""), (" # dsfsdfsdf sdfsdfsd", ""), (" a", " a"), (" a# sdfsfdf", " a"), (" a ...
<commit_before><commit_msg>Add tests for cleaning line<commit_after># -*- coding: utf-8 -*- import sshrc.core.lexer as lexer import pytest @pytest.mark.parametrize("input_, output_", ( ("", ""), (" ", ""), (" #", ""), ("# ", ""), (" # dsfsdfsdf sdfsdfsd", ""), (" a", " a"...
32cb1273be3ee0f5ec9a831287c8a5116dc07d24
tests/test_versioning.py
tests/test_versioning.py
# -*- coding: utf-8 -*- # import unittest from nose import tools from kitchen.versioning import version_tuple_to_string # Note: Using nose's generator tests for this so we can't subclass # unittest.TestCase class TestVersionTuple(object): ver_to_tuple = {'1': ((1,),), '1.0': ((1, 0),), '1....
Test for the new versioning sub package
Test for the new versioning sub package
Python
lgpl-2.1
fedora-infra/kitchen,fedora-infra/kitchen
Test for the new versioning sub package
# -*- coding: utf-8 -*- # import unittest from nose import tools from kitchen.versioning import version_tuple_to_string # Note: Using nose's generator tests for this so we can't subclass # unittest.TestCase class TestVersionTuple(object): ver_to_tuple = {'1': ((1,),), '1.0': ((1, 0),), '1....
<commit_before><commit_msg>Test for the new versioning sub package<commit_after>
# -*- coding: utf-8 -*- # import unittest from nose import tools from kitchen.versioning import version_tuple_to_string # Note: Using nose's generator tests for this so we can't subclass # unittest.TestCase class TestVersionTuple(object): ver_to_tuple = {'1': ((1,),), '1.0': ((1, 0),), '1....
Test for the new versioning sub package# -*- coding: utf-8 -*- # import unittest from nose import tools from kitchen.versioning import version_tuple_to_string # Note: Using nose's generator tests for this so we can't subclass # unittest.TestCase class TestVersionTuple(object): ver_to_tuple = {'1': ((1,),), ...
<commit_before><commit_msg>Test for the new versioning sub package<commit_after># -*- coding: utf-8 -*- # import unittest from nose import tools from kitchen.versioning import version_tuple_to_string # Note: Using nose's generator tests for this so we can't subclass # unittest.TestCase class TestVersionTuple(object):...
9aafdd8f00b96105e86d23c1936da620d0540cbe
python/twitter_status_ids.py
python/twitter_status_ids.py
import sys from datetime import datetime # use like: # twilight stream --filter "locations=-180,-90,180,90" | grep --line-buffered -v '^{"delete":' | jq --unbuffered -r .id_str | gstdbuf -o0 head -1000 | python -u /Users/chbrown/github/sandbox/python/twitter_status_ids.py TWEPOCH = 1288834974657 while True: line...
Add python script that converts Twitter IDs to timestamps
Add python script that converts Twitter IDs to timestamps
Python
mit
chbrown/sandbox,chbrown/sandbox,chbrown/sandbox,chbrown/sandbox,chbrown/sandbox,chbrown/sandbox,chbrown/sandbox,chbrown/sandbox,chbrown/sandbox,chbrown/sandbox
Add python script that converts Twitter IDs to timestamps
import sys from datetime import datetime # use like: # twilight stream --filter "locations=-180,-90,180,90" | grep --line-buffered -v '^{"delete":' | jq --unbuffered -r .id_str | gstdbuf -o0 head -1000 | python -u /Users/chbrown/github/sandbox/python/twitter_status_ids.py TWEPOCH = 1288834974657 while True: line...
<commit_before><commit_msg>Add python script that converts Twitter IDs to timestamps<commit_after>
import sys from datetime import datetime # use like: # twilight stream --filter "locations=-180,-90,180,90" | grep --line-buffered -v '^{"delete":' | jq --unbuffered -r .id_str | gstdbuf -o0 head -1000 | python -u /Users/chbrown/github/sandbox/python/twitter_status_ids.py TWEPOCH = 1288834974657 while True: line...
Add python script that converts Twitter IDs to timestampsimport sys from datetime import datetime # use like: # twilight stream --filter "locations=-180,-90,180,90" | grep --line-buffered -v '^{"delete":' | jq --unbuffered -r .id_str | gstdbuf -o0 head -1000 | python -u /Users/chbrown/github/sandbox/python/twitter_sta...
<commit_before><commit_msg>Add python script that converts Twitter IDs to timestamps<commit_after>import sys from datetime import datetime # use like: # twilight stream --filter "locations=-180,-90,180,90" | grep --line-buffered -v '^{"delete":' | jq --unbuffered -r .id_str | gstdbuf -o0 head -1000 | python -u /Users/...
594b0e28d840de323fd98a5a2f3acd543d94fec2
integration-test/192-shield-text-ref.py
integration-test/192-shield-text-ref.py
# US 101, "James Lick Freeway" # http://www.openstreetmap.org/way/27183379 # http://www.openstreetmap.org/relation/108619 assert_has_feature( 16, 10484, 25334, 'roads', { 'kind': 'highway', 'network': 'US:US', 'id': 27183379, 'shield_text': '101' }) # I-77, I-81, US-11 & US-52 all in one road West Virgin...
Add test case for networks and network sorting.
Add test case for networks and network sorting.
Python
mit
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
Add test case for networks and network sorting.
# US 101, "James Lick Freeway" # http://www.openstreetmap.org/way/27183379 # http://www.openstreetmap.org/relation/108619 assert_has_feature( 16, 10484, 25334, 'roads', { 'kind': 'highway', 'network': 'US:US', 'id': 27183379, 'shield_text': '101' }) # I-77, I-81, US-11 & US-52 all in one road West Virgin...
<commit_before><commit_msg>Add test case for networks and network sorting.<commit_after>
# US 101, "James Lick Freeway" # http://www.openstreetmap.org/way/27183379 # http://www.openstreetmap.org/relation/108619 assert_has_feature( 16, 10484, 25334, 'roads', { 'kind': 'highway', 'network': 'US:US', 'id': 27183379, 'shield_text': '101' }) # I-77, I-81, US-11 & US-52 all in one road West Virgin...
Add test case for networks and network sorting.# US 101, "James Lick Freeway" # http://www.openstreetmap.org/way/27183379 # http://www.openstreetmap.org/relation/108619 assert_has_feature( 16, 10484, 25334, 'roads', { 'kind': 'highway', 'network': 'US:US', 'id': 27183379, 'shield_text': '101' }) # I-77, ...
<commit_before><commit_msg>Add test case for networks and network sorting.<commit_after># US 101, "James Lick Freeway" # http://www.openstreetmap.org/way/27183379 # http://www.openstreetmap.org/relation/108619 assert_has_feature( 16, 10484, 25334, 'roads', { 'kind': 'highway', 'network': 'US:US', 'id': 27183379...
4bd22be3c6b0d2a63fdf6d7a393d790025d16515
examples/unsuported_semantics.py
examples/unsuported_semantics.py
# Note: Display the list of unsuported semantics from operator import itemgetter from triton import * unsuportedSemantics = dict() def cbefore(instruction): if len(instruction.symbolicElements) == 0: mnemonic = opcodeToString(instruction.opcode) if mnemonic in unsuportedSemantics: ...
Add an example which lists the unsuported semantics - useful
Add an example which lists the unsuported semantics - useful
Python
apache-2.0
JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton
Add an example which lists the unsuported semantics - useful
# Note: Display the list of unsuported semantics from operator import itemgetter from triton import * unsuportedSemantics = dict() def cbefore(instruction): if len(instruction.symbolicElements) == 0: mnemonic = opcodeToString(instruction.opcode) if mnemonic in unsuportedSemantics: ...
<commit_before><commit_msg>Add an example which lists the unsuported semantics - useful<commit_after>
# Note: Display the list of unsuported semantics from operator import itemgetter from triton import * unsuportedSemantics = dict() def cbefore(instruction): if len(instruction.symbolicElements) == 0: mnemonic = opcodeToString(instruction.opcode) if mnemonic in unsuportedSemantics: ...
Add an example which lists the unsuported semantics - useful # Note: Display the list of unsuported semantics from operator import itemgetter from triton import * unsuportedSemantics = dict() def cbefore(instruction): if len(instruction.symbolicElements) == 0: mnemonic = opcodeToString(instructio...
<commit_before><commit_msg>Add an example which lists the unsuported semantics - useful<commit_after> # Note: Display the list of unsuported semantics from operator import itemgetter from triton import * unsuportedSemantics = dict() def cbefore(instruction): if len(instruction.symbolicElements) == 0: ...
14c48e8d8e44b0f3ff4f0a9d6dbeab9ae38201ab
test_bug.py
test_bug.py
code = '''from __future__ import unicode_literals from webtest import Upload def test_create_break(testapp, session): sid = session['id'] resp = testapp.post( '/sessions/{}/files'.format(sid), dict( file=Upload('foobar.py', b'print 123'), ), status=201, ) ...
Add test to demonstrage the bug
Add test to demonstrage the bug
Python
mit
victorlin/py.test-source-deindenting-bug-demo
Add test to demonstrage the bug
code = '''from __future__ import unicode_literals from webtest import Upload def test_create_break(testapp, session): sid = session['id'] resp = testapp.post( '/sessions/{}/files'.format(sid), dict( file=Upload('foobar.py', b'print 123'), ), status=201, ) ...
<commit_before><commit_msg>Add test to demonstrage the bug<commit_after>
code = '''from __future__ import unicode_literals from webtest import Upload def test_create_break(testapp, session): sid = session['id'] resp = testapp.post( '/sessions/{}/files'.format(sid), dict( file=Upload('foobar.py', b'print 123'), ), status=201, ) ...
Add test to demonstrage the bugcode = '''from __future__ import unicode_literals from webtest import Upload def test_create_break(testapp, session): sid = session['id'] resp = testapp.post( '/sessions/{}/files'.format(sid), dict( file=Upload('foobar.py', b'print 123'), ),...
<commit_before><commit_msg>Add test to demonstrage the bug<commit_after>code = '''from __future__ import unicode_literals from webtest import Upload def test_create_break(testapp, session): sid = session['id'] resp = testapp.post( '/sessions/{}/files'.format(sid), dict( file=Uplo...
b0451e622be57fade28ed431c4f9031093db3777
tests/test_cellom2tif.py
tests/test_cellom2tif.py
from cellom2tif import cellom2tif def test_start(): cellom2tif.start() assert cellom2tif.VM_STARTED def test_done(): cellom2tif.done() assert cellom2tif.VM_KILLED
Test individual functions in cellom2tif.py
Test individual functions in cellom2tif.py
Python
bsd-3-clause
jni/cellom2tif
Test individual functions in cellom2tif.py
from cellom2tif import cellom2tif def test_start(): cellom2tif.start() assert cellom2tif.VM_STARTED def test_done(): cellom2tif.done() assert cellom2tif.VM_KILLED
<commit_before><commit_msg>Test individual functions in cellom2tif.py<commit_after>
from cellom2tif import cellom2tif def test_start(): cellom2tif.start() assert cellom2tif.VM_STARTED def test_done(): cellom2tif.done() assert cellom2tif.VM_KILLED
Test individual functions in cellom2tif.pyfrom cellom2tif import cellom2tif def test_start(): cellom2tif.start() assert cellom2tif.VM_STARTED def test_done(): cellom2tif.done() assert cellom2tif.VM_KILLED
<commit_before><commit_msg>Test individual functions in cellom2tif.py<commit_after>from cellom2tif import cellom2tif def test_start(): cellom2tif.start() assert cellom2tif.VM_STARTED def test_done(): cellom2tif.done() assert cellom2tif.VM_KILLED
014e9eaa4ccc29d025f3910870789ad23d454ae3
tools/aa_bench_to_csv.py
tools/aa_bench_to_csv.py
#!/usr/bin/env python3 import sys import os import argparse import json def read_stat_file(path): with open(path, 'r') as f: json_data = f.read() parsed = json.loads(json_data) return parsed def main(): parser = argparse.ArgumentParser(description = 'Converts a sweep file to CSV.') ...
Add a script to convert AA bench runs to CSV.
Add a script to convert AA bench runs to CSV.
Python
mit
Themaister/Granite,Themaister/Granite,Themaister/Granite,Themaister/Granite,Themaister/Granite,Themaister/Granite
Add a script to convert AA bench runs to CSV.
#!/usr/bin/env python3 import sys import os import argparse import json def read_stat_file(path): with open(path, 'r') as f: json_data = f.read() parsed = json.loads(json_data) return parsed def main(): parser = argparse.ArgumentParser(description = 'Converts a sweep file to CSV.') ...
<commit_before><commit_msg>Add a script to convert AA bench runs to CSV.<commit_after>
#!/usr/bin/env python3 import sys import os import argparse import json def read_stat_file(path): with open(path, 'r') as f: json_data = f.read() parsed = json.loads(json_data) return parsed def main(): parser = argparse.ArgumentParser(description = 'Converts a sweep file to CSV.') ...
Add a script to convert AA bench runs to CSV.#!/usr/bin/env python3 import sys import os import argparse import json def read_stat_file(path): with open(path, 'r') as f: json_data = f.read() parsed = json.loads(json_data) return parsed def main(): parser = argparse.ArgumentParser(desc...
<commit_before><commit_msg>Add a script to convert AA bench runs to CSV.<commit_after>#!/usr/bin/env python3 import sys import os import argparse import json def read_stat_file(path): with open(path, 'r') as f: json_data = f.read() parsed = json.loads(json_data) return parsed def main(): ...