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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18085ebbf45473046980d182fe285d6663698e72 | src/query_processing/query_processing.py | src/query_processing/query_processing.py | # LING 573 Question Answering System
# Code last updated 4/15/14 by Andrea Kahn
# This code implements a QueryProcessor for the question answering system.
# TODO: A QueryProcessor should be initialized with the Question object, but should it
# have this question as an attribute, or should it have attributes id, type,... | Add skeleton for query-processing module | Add skeleton for query-processing module
| Python | mit | amkahn/question-answering,amkahn/question-answering | Add skeleton for query-processing module | # LING 573 Question Answering System
# Code last updated 4/15/14 by Andrea Kahn
# This code implements a QueryProcessor for the question answering system.
# TODO: A QueryProcessor should be initialized with the Question object, but should it
# have this question as an attribute, or should it have attributes id, type,... | <commit_before><commit_msg>Add skeleton for query-processing module<commit_after> | # LING 573 Question Answering System
# Code last updated 4/15/14 by Andrea Kahn
# This code implements a QueryProcessor for the question answering system.
# TODO: A QueryProcessor should be initialized with the Question object, but should it
# have this question as an attribute, or should it have attributes id, type,... | Add skeleton for query-processing module# LING 573 Question Answering System
# Code last updated 4/15/14 by Andrea Kahn
# This code implements a QueryProcessor for the question answering system.
# TODO: A QueryProcessor should be initialized with the Question object, but should it
# have this question as an attribute... | <commit_before><commit_msg>Add skeleton for query-processing module<commit_after># LING 573 Question Answering System
# Code last updated 4/15/14 by Andrea Kahn
# This code implements a QueryProcessor for the question answering system.
# TODO: A QueryProcessor should be initialized with the Question object, but shoul... | |
87a5419d9717d641bf4c30740d2d431f4fd7a478 | setup.py | setup.py | """Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
"SQLAlchemy"... | """Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
]
entry_poi... | Delete all formal dependencies except 'pyramid'. | Delete all formal dependencies except 'pyramid'.
| Python | mit | Pylons/akhet,hlwsmith/akhet,Pylons/akhet,hlwsmith/akhet,hlwsmith/akhet | """Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
"SQLAlchemy"... | """Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
]
entry_poi... | <commit_before>"""Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
... | """Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
]
entry_poi... | """Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
"SQLAlchemy"... | <commit_before>"""Akhet installation script.
"""
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
... |
7c66155295b439258c829b3d5a7fb38a40612d3e | alembic/versions/35f8b948e98d_delete_hidden_column.py | alembic/versions/35f8b948e98d_delete_hidden_column.py | """Delete hidden column
Revision ID: 35f8b948e98d
Revises: 36fba9f9069d
Create Date: 2015-08-07 10:15:34.608398
"""
# revision identifiers, used by Alembic.
revision = '35f8b948e98d'
down_revision = '36fba9f9069d'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.drop_column('project', 'hidden'... | Add migration for removing hidden column in project | Add migration for removing hidden column in project
| Python | agpl-3.0 | PyBossa/pybossa,PyBossa/pybossa,geotagx/pybossa,geotagx/pybossa,Scifabric/pybossa,Scifabric/pybossa | Add migration for removing hidden column in project | """Delete hidden column
Revision ID: 35f8b948e98d
Revises: 36fba9f9069d
Create Date: 2015-08-07 10:15:34.608398
"""
# revision identifiers, used by Alembic.
revision = '35f8b948e98d'
down_revision = '36fba9f9069d'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.drop_column('project', 'hidden'... | <commit_before><commit_msg>Add migration for removing hidden column in project<commit_after> | """Delete hidden column
Revision ID: 35f8b948e98d
Revises: 36fba9f9069d
Create Date: 2015-08-07 10:15:34.608398
"""
# revision identifiers, used by Alembic.
revision = '35f8b948e98d'
down_revision = '36fba9f9069d'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.drop_column('project', 'hidden'... | Add migration for removing hidden column in project"""Delete hidden column
Revision ID: 35f8b948e98d
Revises: 36fba9f9069d
Create Date: 2015-08-07 10:15:34.608398
"""
# revision identifiers, used by Alembic.
revision = '35f8b948e98d'
down_revision = '36fba9f9069d'
from alembic import op
import sqlalchemy as sa
de... | <commit_before><commit_msg>Add migration for removing hidden column in project<commit_after>"""Delete hidden column
Revision ID: 35f8b948e98d
Revises: 36fba9f9069d
Create Date: 2015-08-07 10:15:34.608398
"""
# revision identifiers, used by Alembic.
revision = '35f8b948e98d'
down_revision = '36fba9f9069d'
from alemb... | |
97e64eae02ef5f850f8b4bd2ad1028f59c8328c7 | Spring2018/src/make_inf_set.py | Spring2018/src/make_inf_set.py | """
Copies files from the original dataset for use with inference.
NOTE: For inference, images need to be in the form:
image{}.jpg where {} should be replaced with 1, 2, etc.
Assumptions:
This code is run from the ci-models directory
The images/labels are placed in data/<class-name>
"""
import os, ran... | Add script to make inference set | Add script to make inference set
| Python | mit | CUFCTL/DLBD,CUFCTL/DLBD | Add script to make inference set | """
Copies files from the original dataset for use with inference.
NOTE: For inference, images need to be in the form:
image{}.jpg where {} should be replaced with 1, 2, etc.
Assumptions:
This code is run from the ci-models directory
The images/labels are placed in data/<class-name>
"""
import os, ran... | <commit_before><commit_msg>Add script to make inference set<commit_after> | """
Copies files from the original dataset for use with inference.
NOTE: For inference, images need to be in the form:
image{}.jpg where {} should be replaced with 1, 2, etc.
Assumptions:
This code is run from the ci-models directory
The images/labels are placed in data/<class-name>
"""
import os, ran... | Add script to make inference set"""
Copies files from the original dataset for use with inference.
NOTE: For inference, images need to be in the form:
image{}.jpg where {} should be replaced with 1, 2, etc.
Assumptions:
This code is run from the ci-models directory
The images/labels are placed in data/... | <commit_before><commit_msg>Add script to make inference set<commit_after>"""
Copies files from the original dataset for use with inference.
NOTE: For inference, images need to be in the form:
image{}.jpg where {} should be replaced with 1, 2, etc.
Assumptions:
This code is run from the ci-models directory
... | |
91e33076e343c04aea8e905a96c07edb2da04700 | pdf_generator/page_number.py | pdf_generator/page_number.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from reportlab.pdfgen.canvas import Canvas
class NumberedCanvasFactory(object):
def __init__(self, x, y, text):
self._x = x
self._y = y
self._text = text
def __call__(self, *args, **kw):
return NumberedCanvas(*args,
... | Store all the state of the canvas | Store all the state of the canvas
| Python | mit | cecedille1/PDF_generator | Store all the state of the canvas | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from reportlab.pdfgen.canvas import Canvas
class NumberedCanvasFactory(object):
def __init__(self, x, y, text):
self._x = x
self._y = y
self._text = text
def __call__(self, *args, **kw):
return NumberedCanvas(*args,
... | <commit_before><commit_msg>Store all the state of the canvas<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from reportlab.pdfgen.canvas import Canvas
class NumberedCanvasFactory(object):
def __init__(self, x, y, text):
self._x = x
self._y = y
self._text = text
def __call__(self, *args, **kw):
return NumberedCanvas(*args,
... | Store all the state of the canvas#!/usr/bin/env python
# -*- coding: utf-8 -*-
from reportlab.pdfgen.canvas import Canvas
class NumberedCanvasFactory(object):
def __init__(self, x, y, text):
self._x = x
self._y = y
self._text = text
def __call__(self, *args, **kw):
return Num... | <commit_before><commit_msg>Store all the state of the canvas<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from reportlab.pdfgen.canvas import Canvas
class NumberedCanvasFactory(object):
def __init__(self, x, y, text):
self._x = x
self._y = y
self._text = text
def __call... | |
026e2b6ffc70fc1732ed6f69aa76d0c1263b0b09 | app/format_json.py | app/format_json.py | import csv
import json
import collections
data = collections.defaultdict(dict)
def main():
with open('en-us.csv', 'rb') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
keys = row[0].split('.')
merge(data, format_dict(keys, row[1]))
f = open('en-us.json', 'w... | Add script to generate JSON with translation data | Add script to generate JSON with translation data
Take the csv with the translation variables and
values and convert it to a json file.
| Python | apache-2.0 | samanehsan/isp,CenterForOpenScience/isp,samanehsan/isp,CenterForOpenScience/isp,samanehsan/isp,CenterForOpenScience/isp | Add script to generate JSON with translation data
Take the csv with the translation variables and
values and convert it to a json file. | import csv
import json
import collections
data = collections.defaultdict(dict)
def main():
with open('en-us.csv', 'rb') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
keys = row[0].split('.')
merge(data, format_dict(keys, row[1]))
f = open('en-us.json', 'w... | <commit_before><commit_msg>Add script to generate JSON with translation data
Take the csv with the translation variables and
values and convert it to a json file.<commit_after> | import csv
import json
import collections
data = collections.defaultdict(dict)
def main():
with open('en-us.csv', 'rb') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
keys = row[0].split('.')
merge(data, format_dict(keys, row[1]))
f = open('en-us.json', 'w... | Add script to generate JSON with translation data
Take the csv with the translation variables and
values and convert it to a json file.import csv
import json
import collections
data = collections.defaultdict(dict)
def main():
with open('en-us.csv', 'rb') as csvfile:
reader = csv.reader(csvfile)
... | <commit_before><commit_msg>Add script to generate JSON with translation data
Take the csv with the translation variables and
values and convert it to a json file.<commit_after>import csv
import json
import collections
data = collections.defaultdict(dict)
def main():
with open('en-us.csv', 'rb') as csvfile:
... | |
fb19d7753073fb51da5a6fa1d458a3c8bca1d6b4 | coltrane/context_processors.py | coltrane/context_processors.py | """
A context processor which adds the value of the
``COMMENTS_MODERATE_AFTER`` setting to each ``RequestContext`` in
which it is applied.
"""
from template_utils.context_processors import settings_processor
comment_moderation = settings_processor('COMMENTS_MODERATE_AFTER')
| Add a context processor for the COMMENTS_MODERATE_AFTER setting | Add a context processor for the COMMENTS_MODERATE_AFTER setting
git-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@69 5f8205a5-902a-0410-8b63-8f478ce83d95
| Python | bsd-3-clause | clones/django-coltrane,mafix/coltrane-blog | Add a context processor for the COMMENTS_MODERATE_AFTER setting
git-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@69 5f8205a5-902a-0410-8b63-8f478ce83d95 | """
A context processor which adds the value of the
``COMMENTS_MODERATE_AFTER`` setting to each ``RequestContext`` in
which it is applied.
"""
from template_utils.context_processors import settings_processor
comment_moderation = settings_processor('COMMENTS_MODERATE_AFTER')
| <commit_before><commit_msg>Add a context processor for the COMMENTS_MODERATE_AFTER setting
git-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@69 5f8205a5-902a-0410-8b63-8f478ce83d95<commit_after> | """
A context processor which adds the value of the
``COMMENTS_MODERATE_AFTER`` setting to each ``RequestContext`` in
which it is applied.
"""
from template_utils.context_processors import settings_processor
comment_moderation = settings_processor('COMMENTS_MODERATE_AFTER')
| Add a context processor for the COMMENTS_MODERATE_AFTER setting
git-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@69 5f8205a5-902a-0410-8b63-8f478ce83d95"""
A context processor which adds the value of the
``COMMENTS_MODERATE_AFTER`` setting to each ``RequestContext`` in
which it is applied.
"""
from template_util... | <commit_before><commit_msg>Add a context processor for the COMMENTS_MODERATE_AFTER setting
git-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@69 5f8205a5-902a-0410-8b63-8f478ce83d95<commit_after>"""
A context processor which adds the value of the
``COMMENTS_MODERATE_AFTER`` setting to each ``RequestContext`` in
whic... | |
512c730f78fae715a3ed9dfe59ef917a5566dcb5 | src/dashboard/src/main/migrations/0048_fix_upload_qubit_setting.py | src/dashboard/src/main/migrations/0048_fix_upload_qubit_setting.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def data_migration(apps, schema_editor):
"""Migration 0032 inadvertently set previously non-existent "Upload DIP to
AtoM" values to 'None'. This fixes that.
"""
apps.get_model('main', 'DashboardSetting').... | Add migration to fix "None" AtoM config issue | Add migration to fix "None" AtoM config issue
Fixes an issue introduced by migration 0032 wherein an AtoM setting that did
not exist in the previous state of the database was inadvertently created with
a value of 'None'. The migration introduced here changes those 'None's
to ''s.
Fixes #879.
| Python | agpl-3.0 | artefactual/archivematica,artefactual/archivematica,artefactual/archivematica,artefactual/archivematica | Add migration to fix "None" AtoM config issue
Fixes an issue introduced by migration 0032 wherein an AtoM setting that did
not exist in the previous state of the database was inadvertently created with
a value of 'None'. The migration introduced here changes those 'None's
to ''s.
Fixes #879. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def data_migration(apps, schema_editor):
"""Migration 0032 inadvertently set previously non-existent "Upload DIP to
AtoM" values to 'None'. This fixes that.
"""
apps.get_model('main', 'DashboardSetting').... | <commit_before><commit_msg>Add migration to fix "None" AtoM config issue
Fixes an issue introduced by migration 0032 wherein an AtoM setting that did
not exist in the previous state of the database was inadvertently created with
a value of 'None'. The migration introduced here changes those 'None's
to ''s.
Fixes #879... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def data_migration(apps, schema_editor):
"""Migration 0032 inadvertently set previously non-existent "Upload DIP to
AtoM" values to 'None'. This fixes that.
"""
apps.get_model('main', 'DashboardSetting').... | Add migration to fix "None" AtoM config issue
Fixes an issue introduced by migration 0032 wherein an AtoM setting that did
not exist in the previous state of the database was inadvertently created with
a value of 'None'. The migration introduced here changes those 'None's
to ''s.
Fixes #879.# -*- coding: utf-8 -*-
fr... | <commit_before><commit_msg>Add migration to fix "None" AtoM config issue
Fixes an issue introduced by migration 0032 wherein an AtoM setting that did
not exist in the previous state of the database was inadvertently created with
a value of 'None'. The migration introduced here changes those 'None's
to ''s.
Fixes #879... | |
1c3141488f13819d76ca179984aed0cadf932d5c | tests/test_grids.py | tests/test_grids.py | #!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.grids import standard_grid, get_cartesian_grid
def test_grids():
L = 10
thetas, phis = standard_grid(L)
# Can't really test much here
assert thetas.size == L
assert phis.size == L**2
grid = ge... | Add a test for grids. | Add a test for grids.
| Python | mit | praveenv253/sht,praveenv253/sht | Add a test for grids. | #!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.grids import standard_grid, get_cartesian_grid
def test_grids():
L = 10
thetas, phis = standard_grid(L)
# Can't really test much here
assert thetas.size == L
assert phis.size == L**2
grid = ge... | <commit_before><commit_msg>Add a test for grids.<commit_after> | #!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.grids import standard_grid, get_cartesian_grid
def test_grids():
L = 10
thetas, phis = standard_grid(L)
# Can't really test much here
assert thetas.size == L
assert phis.size == L**2
grid = ge... | Add a test for grids.#!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.grids import standard_grid, get_cartesian_grid
def test_grids():
L = 10
thetas, phis = standard_grid(L)
# Can't really test much here
assert thetas.size == L
assert phis.size =... | <commit_before><commit_msg>Add a test for grids.<commit_after>#!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.grids import standard_grid, get_cartesian_grid
def test_grids():
L = 10
thetas, phis = standard_grid(L)
# Can't really test much here
asser... | |
a173a4f2922fe0f2b9e9f5162ceb947681c837ae | tests/test_oauth.py | tests/test_oauth.py | from nose.tools import *
from website.oauth.models import ExternalProvider
from website.oauth.models import OAUTH1
from website.oauth.models import OAUTH2
from tests.base import OsfTestCase
class MockOauth2Provider(ExternalProvider):
name = "Mock OAuth 2.0 Provider"
short_name = "mock2"
client_id = 'mo... | Add very basic tests for OAuth | Add very basic tests for OAuth
| Python | apache-2.0 | billyhunt/osf.io,SSJohns/osf.io,Nesiehr/osf.io,cosenal/osf.io,leb2dg/osf.io,Johnetordoff/osf.io,laurenrevere/osf.io,ticklemepierce/osf.io,erinspace/osf.io,brianjgeiger/osf.io,fabianvf/osf.io,Nesiehr/osf.io,samchrisinger/osf.io,abought/osf.io,ticklemepierce/osf.io,TomBaxter/osf.io,danielneis/osf.io,hmoco/osf.io,ZobairAl... | Add very basic tests for OAuth | from nose.tools import *
from website.oauth.models import ExternalProvider
from website.oauth.models import OAUTH1
from website.oauth.models import OAUTH2
from tests.base import OsfTestCase
class MockOauth2Provider(ExternalProvider):
name = "Mock OAuth 2.0 Provider"
short_name = "mock2"
client_id = 'mo... | <commit_before><commit_msg>Add very basic tests for OAuth<commit_after> | from nose.tools import *
from website.oauth.models import ExternalProvider
from website.oauth.models import OAUTH1
from website.oauth.models import OAUTH2
from tests.base import OsfTestCase
class MockOauth2Provider(ExternalProvider):
name = "Mock OAuth 2.0 Provider"
short_name = "mock2"
client_id = 'mo... | Add very basic tests for OAuthfrom nose.tools import *
from website.oauth.models import ExternalProvider
from website.oauth.models import OAUTH1
from website.oauth.models import OAUTH2
from tests.base import OsfTestCase
class MockOauth2Provider(ExternalProvider):
name = "Mock OAuth 2.0 Provider"
short_name ... | <commit_before><commit_msg>Add very basic tests for OAuth<commit_after>from nose.tools import *
from website.oauth.models import ExternalProvider
from website.oauth.models import OAUTH1
from website.oauth.models import OAUTH2
from tests.base import OsfTestCase
class MockOauth2Provider(ExternalProvider):
name = ... | |
443c35be358abc35394a9b3bbde2a79289db818e | tests/test_utils.py | tests/test_utils.py | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2016 Rémi Duraffort
# This file is part of ReactOBus.
#
# ReactOBus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | Test the Pipe base class | Test the Pipe base class
| Python | agpl-3.0 | ivoire/ReactOBus,ivoire/ReactOBus | Test the Pipe base class | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2016 Rémi Duraffort
# This file is part of ReactOBus.
#
# ReactOBus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | <commit_before><commit_msg>Test the Pipe base class<commit_after> | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2016 Rémi Duraffort
# This file is part of ReactOBus.
#
# ReactOBus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | Test the Pipe base class# -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2016 Rémi Duraffort
# This file is part of ReactOBus.
#
# ReactOBus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either ve... | <commit_before><commit_msg>Test the Pipe base class<commit_after># -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2016 Rémi Duraffort
# This file is part of ReactOBus.
#
# ReactOBus is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
... | |
bda9c236c978601ea8c62c60488afaecc03f384f | test/test_relative_relationships.py | test/test_relative_relationships.py | from neomodel import StructuredNode, RelationshipTo, StringProperty
from .test_relationships import Country
class Cat(StructuredNode):
name = StringProperty()
is_from = RelationshipTo('.test_relationships.Country', 'IS_FROM')
def test_relative_relationship():
a = Cat(name='snufkin').save()
assert a
... | Add test for relative imports | Add test for relative imports
| Python | mit | pombredanne/neomodel,fpieper/neomodel,bleib1dj/neomodel,cristigociu/neomodel_dh,robinedwards/neomodel,wcooley/neomodel,andrefsp/neomodel,robinedwards/neomodel,bleib1dj/neomodel | Add test for relative imports | from neomodel import StructuredNode, RelationshipTo, StringProperty
from .test_relationships import Country
class Cat(StructuredNode):
name = StringProperty()
is_from = RelationshipTo('.test_relationships.Country', 'IS_FROM')
def test_relative_relationship():
a = Cat(name='snufkin').save()
assert a
... | <commit_before><commit_msg>Add test for relative imports<commit_after> | from neomodel import StructuredNode, RelationshipTo, StringProperty
from .test_relationships import Country
class Cat(StructuredNode):
name = StringProperty()
is_from = RelationshipTo('.test_relationships.Country', 'IS_FROM')
def test_relative_relationship():
a = Cat(name='snufkin').save()
assert a
... | Add test for relative importsfrom neomodel import StructuredNode, RelationshipTo, StringProperty
from .test_relationships import Country
class Cat(StructuredNode):
name = StringProperty()
is_from = RelationshipTo('.test_relationships.Country', 'IS_FROM')
def test_relative_relationship():
a = Cat(name='s... | <commit_before><commit_msg>Add test for relative imports<commit_after>from neomodel import StructuredNode, RelationshipTo, StringProperty
from .test_relationships import Country
class Cat(StructuredNode):
name = StringProperty()
is_from = RelationshipTo('.test_relationships.Country', 'IS_FROM')
def test_rel... | |
b17b0f82b94aaba1f37b68d0660873a3c4329f8b | tests/test_inventory/test_models.py | tests/test_inventory/test_models.py | import pytest
from labsys.inventory.models import (
Product, StockProduct, Specification, OrderItem, Order, Transaction
)
'''
TODO: Tests
Product
- must know how many there are in stock
- must retrieve its associated specifications
'''
| Add dummy models test file | :memo: Add dummy models test file
| Python | mit | gems-uff/labsys,gems-uff/labsys,gems-uff/labsys | :memo: Add dummy models test file | import pytest
from labsys.inventory.models import (
Product, StockProduct, Specification, OrderItem, Order, Transaction
)
'''
TODO: Tests
Product
- must know how many there are in stock
- must retrieve its associated specifications
'''
| <commit_before><commit_msg>:memo: Add dummy models test file<commit_after> | import pytest
from labsys.inventory.models import (
Product, StockProduct, Specification, OrderItem, Order, Transaction
)
'''
TODO: Tests
Product
- must know how many there are in stock
- must retrieve its associated specifications
'''
| :memo: Add dummy models test fileimport pytest
from labsys.inventory.models import (
Product, StockProduct, Specification, OrderItem, Order, Transaction
)
'''
TODO: Tests
Product
- must know how many there are in stock
- must retrieve its associated specifications
'''
| <commit_before><commit_msg>:memo: Add dummy models test file<commit_after>import pytest
from labsys.inventory.models import (
Product, StockProduct, Specification, OrderItem, Order, Transaction
)
'''
TODO: Tests
Product
- must know how many there are in stock
- must retrieve its associated specifications
'''
| |
5f385913ab06fc288c61d22d98f2f9a903194f8f | data_structures/Stack/Python/Stack.py | data_structures/Stack/Python/Stack.py | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | Add push method and implementation | Add push method and implementation
| Python | cc0-1.0 | manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,Cnidarias/al-go-rithms,Deepak345/al-go-rithms,manikTharaka/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-ri... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | <commit_before># Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | <commit_before># Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
... |
552d88f497557bc449d98b7828b47dbba2ab0150 | insertFrontMatter.py | insertFrontMatter.py | #!/usr/bin/python
import sys, os
def main(argv):
folder = argv[1]
project = argv[2]
# for each file in specified directory
for filename in os.listdir(folder):
# open a file and create a temp file to hold our alternation
oldfile = open(filename)
tmpFile = open("conversionFile.tmp","w+")
# all... | Add initial untested and unfinished front matter adding/converting script | Add initial untested and unfinished front matter adding/converting script
| Python | mit | sensu/sensu-docs,sensu/sensu-docs,sensu/sensu-docs,sensu/sensu-docs,sensu/sensu-docs | Add initial untested and unfinished front matter adding/converting script | #!/usr/bin/python
import sys, os
def main(argv):
folder = argv[1]
project = argv[2]
# for each file in specified directory
for filename in os.listdir(folder):
# open a file and create a temp file to hold our alternation
oldfile = open(filename)
tmpFile = open("conversionFile.tmp","w+")
# all... | <commit_before><commit_msg>Add initial untested and unfinished front matter adding/converting script<commit_after> | #!/usr/bin/python
import sys, os
def main(argv):
folder = argv[1]
project = argv[2]
# for each file in specified directory
for filename in os.listdir(folder):
# open a file and create a temp file to hold our alternation
oldfile = open(filename)
tmpFile = open("conversionFile.tmp","w+")
# all... | Add initial untested and unfinished front matter adding/converting script#!/usr/bin/python
import sys, os
def main(argv):
folder = argv[1]
project = argv[2]
# for each file in specified directory
for filename in os.listdir(folder):
# open a file and create a temp file to hold our alternation
oldfile ... | <commit_before><commit_msg>Add initial untested and unfinished front matter adding/converting script<commit_after>#!/usr/bin/python
import sys, os
def main(argv):
folder = argv[1]
project = argv[2]
# for each file in specified directory
for filename in os.listdir(folder):
# open a file and create a temp f... | |
792072f6e95101395f49f62ca6276eb287cbaf30 | proxy.py | proxy.py | import sys
import socket
import threading
def server_loop(local_host, local_port, remote_host, remote_port,
receive_first):
"""
The proxy is represented by the local host and port. The remote host and
port represent the service's server.
"""
server = socket.socket(socket.AF_INET, s... | Add the main server loop | Add the main server loop
| Python | mit | inakidelamadrid/bhp_exercises | Add the main server loop | import sys
import socket
import threading
def server_loop(local_host, local_port, remote_host, remote_port,
receive_first):
"""
The proxy is represented by the local host and port. The remote host and
port represent the service's server.
"""
server = socket.socket(socket.AF_INET, s... | <commit_before><commit_msg>Add the main server loop<commit_after> | import sys
import socket
import threading
def server_loop(local_host, local_port, remote_host, remote_port,
receive_first):
"""
The proxy is represented by the local host and port. The remote host and
port represent the service's server.
"""
server = socket.socket(socket.AF_INET, s... | Add the main server loopimport sys
import socket
import threading
def server_loop(local_host, local_port, remote_host, remote_port,
receive_first):
"""
The proxy is represented by the local host and port. The remote host and
port represent the service's server.
"""
server = socket.... | <commit_before><commit_msg>Add the main server loop<commit_after>import sys
import socket
import threading
def server_loop(local_host, local_port, remote_host, remote_port,
receive_first):
"""
The proxy is represented by the local host and port. The remote host and
port represent the servi... | |
906741c38d074fec9d304a74c54937db0d569b95 | directinotidy.py | directinotidy.py | from Queue import Queue
from thread import start_new_thread
import inotify.adapters
import filesorter
import dmcutils
import os
__author__ = 'falko'
filesfifo = Queue()
fsort = filesorter
def processQueue():
while True:
newFile = filesfifo.get()
fsort.processFile(newFile)
def startinotify():
... | Add inotify alternative to watchdog | Add inotify alternative to watchdog
Watchdog was not working as expected when used in a networking enviroment.
Inotify is used in directinotify.py to watch a directory for IN_CLOSE_WRITE
| Python | mit | HaBaLeS/digital-mess-cleaner | Add inotify alternative to watchdog
Watchdog was not working as expected when used in a networking enviroment.
Inotify is used in directinotify.py to watch a directory for IN_CLOSE_WRITE | from Queue import Queue
from thread import start_new_thread
import inotify.adapters
import filesorter
import dmcutils
import os
__author__ = 'falko'
filesfifo = Queue()
fsort = filesorter
def processQueue():
while True:
newFile = filesfifo.get()
fsort.processFile(newFile)
def startinotify():
... | <commit_before><commit_msg>Add inotify alternative to watchdog
Watchdog was not working as expected when used in a networking enviroment.
Inotify is used in directinotify.py to watch a directory for IN_CLOSE_WRITE<commit_after> | from Queue import Queue
from thread import start_new_thread
import inotify.adapters
import filesorter
import dmcutils
import os
__author__ = 'falko'
filesfifo = Queue()
fsort = filesorter
def processQueue():
while True:
newFile = filesfifo.get()
fsort.processFile(newFile)
def startinotify():
... | Add inotify alternative to watchdog
Watchdog was not working as expected when used in a networking enviroment.
Inotify is used in directinotify.py to watch a directory for IN_CLOSE_WRITEfrom Queue import Queue
from thread import start_new_thread
import inotify.adapters
import filesorter
import dmcutils
import os
__au... | <commit_before><commit_msg>Add inotify alternative to watchdog
Watchdog was not working as expected when used in a networking enviroment.
Inotify is used in directinotify.py to watch a directory for IN_CLOSE_WRITE<commit_after>from Queue import Queue
from thread import start_new_thread
import inotify.adapters
import f... | |
d55df3a30820b24e16beef1b5c824b8ef32b7d61 | select_files_for_runlumidataset.py | select_files_for_runlumidataset.py | #!/usr/bin/env python
import argparse
from dbs.apis.dbsClient import DbsApi
_PREFIX = 'root://eoscms.cern.ch//eos/cms/'
def getFilesForQuery(args):
global _PREFIX
query = {
'dataset' : args.dataset,
'run_num': args.run,
'lumi_list': [l for l in range(args.ls_min, args.ls_max+1)]
}
api = DbsAp... | Add a script to find files for DS/Run/LS | Add a script to find files for DS/Run/LS
| Python | mit | rovere/utilities,rovere/utilities,rovere/utilities,rovere/utilities | Add a script to find files for DS/Run/LS | #!/usr/bin/env python
import argparse
from dbs.apis.dbsClient import DbsApi
_PREFIX = 'root://eoscms.cern.ch//eos/cms/'
def getFilesForQuery(args):
global _PREFIX
query = {
'dataset' : args.dataset,
'run_num': args.run,
'lumi_list': [l for l in range(args.ls_min, args.ls_max+1)]
}
api = DbsAp... | <commit_before><commit_msg>Add a script to find files for DS/Run/LS<commit_after> | #!/usr/bin/env python
import argparse
from dbs.apis.dbsClient import DbsApi
_PREFIX = 'root://eoscms.cern.ch//eos/cms/'
def getFilesForQuery(args):
global _PREFIX
query = {
'dataset' : args.dataset,
'run_num': args.run,
'lumi_list': [l for l in range(args.ls_min, args.ls_max+1)]
}
api = DbsAp... | Add a script to find files for DS/Run/LS#!/usr/bin/env python
import argparse
from dbs.apis.dbsClient import DbsApi
_PREFIX = 'root://eoscms.cern.ch//eos/cms/'
def getFilesForQuery(args):
global _PREFIX
query = {
'dataset' : args.dataset,
'run_num': args.run,
'lumi_list': [l for l in range(args.ls_m... | <commit_before><commit_msg>Add a script to find files for DS/Run/LS<commit_after>#!/usr/bin/env python
import argparse
from dbs.apis.dbsClient import DbsApi
_PREFIX = 'root://eoscms.cern.ch//eos/cms/'
def getFilesForQuery(args):
global _PREFIX
query = {
'dataset' : args.dataset,
'run_num': args.run,
... | |
bb3bab2b8efb49d8a3ac9070289681d12fb8c7e2 | modules/performanceplatform/files/sensu-elasticsearch.py | modules/performanceplatform/files/sensu-elasticsearch.py | #!/usr/bin/env python
# encoding: utf-8
import datetime
import json
import requests
JSON_REQUEST = {
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
... | Add a version of sensu checking script which works on monitoring-1 | Add a version of sensu checking script which works on monitoring-1
| Python | mit | alphagov/pp-puppet,alphagov/pp-puppet,alphagov/pp-puppet,alphagov/pp-puppet | Add a version of sensu checking script which works on monitoring-1 | #!/usr/bin/env python
# encoding: utf-8
import datetime
import json
import requests
JSON_REQUEST = {
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
... | <commit_before><commit_msg>Add a version of sensu checking script which works on monitoring-1<commit_after> | #!/usr/bin/env python
# encoding: utf-8
import datetime
import json
import requests
JSON_REQUEST = {
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
... | Add a version of sensu checking script which works on monitoring-1#!/usr/bin/env python
# encoding: utf-8
import datetime
import json
import requests
JSON_REQUEST = {
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
... | <commit_before><commit_msg>Add a version of sensu checking script which works on monitoring-1<commit_after>#!/usr/bin/env python
# encoding: utf-8
import datetime
import json
import requests
JSON_REQUEST = {
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
... | |
b5a7dba9339b199b96cbb0e0682b20437f738311 | batchSTSconverter.py | batchSTSconverter.py | from PyQt4 import QtGui
import sys
import pyOmicron as pyO
import re
import numpy as np
app=QtGui.QApplication(sys.argv)
path=QtGui.QFileDialog.getExistingDirectory()
#path=r"C:\Users\scholi\Desktop\15-Oct-2015"
del app
del QtGui
M=pyO.Matrix(path)
STS={}
for i in M.images:
r=re.search(r"--([0-9]+)_([0-9]+).I\(V\)_... | Add a batch STS to ascii exporter | Add a batch STS to ascii exporter
| Python | apache-2.0 | scholi/pyOmicron | Add a batch STS to ascii exporter | from PyQt4 import QtGui
import sys
import pyOmicron as pyO
import re
import numpy as np
app=QtGui.QApplication(sys.argv)
path=QtGui.QFileDialog.getExistingDirectory()
#path=r"C:\Users\scholi\Desktop\15-Oct-2015"
del app
del QtGui
M=pyO.Matrix(path)
STS={}
for i in M.images:
r=re.search(r"--([0-9]+)_([0-9]+).I\(V\)_... | <commit_before><commit_msg>Add a batch STS to ascii exporter<commit_after> | from PyQt4 import QtGui
import sys
import pyOmicron as pyO
import re
import numpy as np
app=QtGui.QApplication(sys.argv)
path=QtGui.QFileDialog.getExistingDirectory()
#path=r"C:\Users\scholi\Desktop\15-Oct-2015"
del app
del QtGui
M=pyO.Matrix(path)
STS={}
for i in M.images:
r=re.search(r"--([0-9]+)_([0-9]+).I\(V\)_... | Add a batch STS to ascii exporterfrom PyQt4 import QtGui
import sys
import pyOmicron as pyO
import re
import numpy as np
app=QtGui.QApplication(sys.argv)
path=QtGui.QFileDialog.getExistingDirectory()
#path=r"C:\Users\scholi\Desktop\15-Oct-2015"
del app
del QtGui
M=pyO.Matrix(path)
STS={}
for i in M.images:
r=re.sea... | <commit_before><commit_msg>Add a batch STS to ascii exporter<commit_after>from PyQt4 import QtGui
import sys
import pyOmicron as pyO
import re
import numpy as np
app=QtGui.QApplication(sys.argv)
path=QtGui.QFileDialog.getExistingDirectory()
#path=r"C:\Users\scholi\Desktop\15-Oct-2015"
del app
del QtGui
M=pyO.Matrix(pa... | |
160049859e40855082f7482421df383a5ed80df4 | examples/fips.py | examples/fips.py | #!/usr/bin/env python3
'''
Suppose you're trying to estimate someone's median household income
based on their current location. Perhaps they posted a photograph on
Twitter that has latitude and longitude in its EXIF data. You might go
to the FCC census block conversions API (https://www.fcc.gov/general
/census-block-co... | Add simple switch/case usage example | Add simple switch/case usage example
| Python | mit | selik/destructure | Add simple switch/case usage example | #!/usr/bin/env python3
'''
Suppose you're trying to estimate someone's median household income
based on their current location. Perhaps they posted a photograph on
Twitter that has latitude and longitude in its EXIF data. You might go
to the FCC census block conversions API (https://www.fcc.gov/general
/census-block-co... | <commit_before><commit_msg>Add simple switch/case usage example<commit_after> | #!/usr/bin/env python3
'''
Suppose you're trying to estimate someone's median household income
based on their current location. Perhaps they posted a photograph on
Twitter that has latitude and longitude in its EXIF data. You might go
to the FCC census block conversions API (https://www.fcc.gov/general
/census-block-co... | Add simple switch/case usage example#!/usr/bin/env python3
'''
Suppose you're trying to estimate someone's median household income
based on their current location. Perhaps they posted a photograph on
Twitter that has latitude and longitude in its EXIF data. You might go
to the FCC census block conversions API (https://... | <commit_before><commit_msg>Add simple switch/case usage example<commit_after>#!/usr/bin/env python3
'''
Suppose you're trying to estimate someone's median household income
based on their current location. Perhaps they posted a photograph on
Twitter that has latitude and longitude in its EXIF data. You might go
to the F... | |
fbc5215199af220fd0dcf6f0911363e5e8fe9190 | data_analysis/filter_news.py | data_analysis/filter_news.py | """Generate year files with news counts
Usage:
filter_news.py <directory> <output>
Options:
-h, --help
"""
from docopt import docopt
from os import listdir
from os.path import isfile, join
import datetime
import pandas as pd
if __name__ == "__main__":
# Parse the command line
args = docopt(__doc__)
# Arra... | Add algorithm to count the news and to produce an output file. | [data_analysis] Add algorithm to count the news and to produce an output file.
| Python | mit | geektoni/Influenza-Like-Illness-Predictor,geektoni/Influenza-Like-Illness-Predictor | [data_analysis] Add algorithm to count the news and to produce an output file. | """Generate year files with news counts
Usage:
filter_news.py <directory> <output>
Options:
-h, --help
"""
from docopt import docopt
from os import listdir
from os.path import isfile, join
import datetime
import pandas as pd
if __name__ == "__main__":
# Parse the command line
args = docopt(__doc__)
# Arra... | <commit_before><commit_msg>[data_analysis] Add algorithm to count the news and to produce an output file.<commit_after> | """Generate year files with news counts
Usage:
filter_news.py <directory> <output>
Options:
-h, --help
"""
from docopt import docopt
from os import listdir
from os.path import isfile, join
import datetime
import pandas as pd
if __name__ == "__main__":
# Parse the command line
args = docopt(__doc__)
# Arra... | [data_analysis] Add algorithm to count the news and to produce an output file."""Generate year files with news counts
Usage:
filter_news.py <directory> <output>
Options:
-h, --help
"""
from docopt import docopt
from os import listdir
from os.path import isfile, join
import datetime
import pandas as pd
if __nam... | <commit_before><commit_msg>[data_analysis] Add algorithm to count the news and to produce an output file.<commit_after>"""Generate year files with news counts
Usage:
filter_news.py <directory> <output>
Options:
-h, --help
"""
from docopt import docopt
from os import listdir
from os.path import isfile, join
impor... | |
514e2b3ce6464bd9a4f926fb9c42789ab82bbbd2 | json_to_db.py | json_to_db.py | import json
import sys
import sqlite3
import os
no_ending = os.path.splitext(sys.argv[1])[0]
file_fields = no_ending.split("_")
currency = file_fields[-2]
asset = file_fields[-1]
table_name = "candles_{}_{}".format(currency.upper(), asset.upper())
conn = sqlite3.connect(no_ending +".db")
data = json.load(open(sys.ar... | Add script for converting json data blob to .db file | Add script for converting json data blob to .db file
| Python | mit | F1LT3R/bitcoin-scraper,F1LT3R/bitcoin-scraper | Add script for converting json data blob to .db file | import json
import sys
import sqlite3
import os
no_ending = os.path.splitext(sys.argv[1])[0]
file_fields = no_ending.split("_")
currency = file_fields[-2]
asset = file_fields[-1]
table_name = "candles_{}_{}".format(currency.upper(), asset.upper())
conn = sqlite3.connect(no_ending +".db")
data = json.load(open(sys.ar... | <commit_before><commit_msg>Add script for converting json data blob to .db file<commit_after> | import json
import sys
import sqlite3
import os
no_ending = os.path.splitext(sys.argv[1])[0]
file_fields = no_ending.split("_")
currency = file_fields[-2]
asset = file_fields[-1]
table_name = "candles_{}_{}".format(currency.upper(), asset.upper())
conn = sqlite3.connect(no_ending +".db")
data = json.load(open(sys.ar... | Add script for converting json data blob to .db fileimport json
import sys
import sqlite3
import os
no_ending = os.path.splitext(sys.argv[1])[0]
file_fields = no_ending.split("_")
currency = file_fields[-2]
asset = file_fields[-1]
table_name = "candles_{}_{}".format(currency.upper(), asset.upper())
conn = sqlite3.co... | <commit_before><commit_msg>Add script for converting json data blob to .db file<commit_after>import json
import sys
import sqlite3
import os
no_ending = os.path.splitext(sys.argv[1])[0]
file_fields = no_ending.split("_")
currency = file_fields[-2]
asset = file_fields[-1]
table_name = "candles_{}_{}".format(currency.... | |
7c6c9a688b33961b2eb904ee94e87ec90154260a | tests/strings/string_format_s_simple.py | tests/strings/string_format_s_simple.py | a = "well"
b = "seems to work"
c = "something else"
# form 0
s = "b=%s" % a
print s
# form 1
s = "b,c,d=%s+%s+%s" % (a, b, c)
print s
| Add a simple test for %s | Add a simple test for %s
| Python | mit | buchuki/pyjaco,chrivers/pyjaco,qsnake/py2js,chrivers/pyjaco,chrivers/pyjaco,buchuki/pyjaco,mattpap/py2js,buchuki/pyjaco,qsnake/py2js,mattpap/py2js | Add a simple test for %s | a = "well"
b = "seems to work"
c = "something else"
# form 0
s = "b=%s" % a
print s
# form 1
s = "b,c,d=%s+%s+%s" % (a, b, c)
print s
| <commit_before><commit_msg>Add a simple test for %s<commit_after> | a = "well"
b = "seems to work"
c = "something else"
# form 0
s = "b=%s" % a
print s
# form 1
s = "b,c,d=%s+%s+%s" % (a, b, c)
print s
| Add a simple test for %sa = "well"
b = "seems to work"
c = "something else"
# form 0
s = "b=%s" % a
print s
# form 1
s = "b,c,d=%s+%s+%s" % (a, b, c)
print s
| <commit_before><commit_msg>Add a simple test for %s<commit_after>a = "well"
b = "seems to work"
c = "something else"
# form 0
s = "b=%s" % a
print s
# form 1
s = "b,c,d=%s+%s+%s" % (a, b, c)
print s
| |
13eeba54bdbac256d6b4cd0f56fb92439303d9cc | misc/solarized-dark-high-contrast.py | misc/solarized-dark-high-contrast.py | #!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to modify\n')
sys.ex... | Add script for converting a solarized dark file to solarized dark high contrast | Add script for converting a solarized dark file to solarized dark high contrast
| Python | mit | bmaupin/solarized-dark-high-contrast,bmaupin/solarized-dark-high-contrast | Add script for converting a solarized dark file to solarized dark high contrast | #!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to modify\n')
sys.ex... | <commit_before><commit_msg>Add script for converting a solarized dark file to solarized dark high contrast<commit_after> | #!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to modify\n')
sys.ex... | Add script for converting a solarized dark file to solarized dark high contrast#!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
... | <commit_before><commit_msg>Add script for converting a solarized dark file to solarized dark high contrast<commit_after>#!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case... | |
25d8fab731e0722d4af0bd711dd5acfb2fe41611 | test/test_seq_conservation.py | test/test_seq_conservation.py | import unittest
import utils
import os
import sys
import shutil
import contextlib
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(TOPDIR, 'lib'))
sys.path.append(TOPDIR)
import seqConservation
@contextlib.contextmanager
def mock_usearch():
"""Make mock usearch ... | Add basic test for usearch clustering. | Add basic test for usearch clustering.
| Python | lgpl-2.1 | salilab/cryptosite,salilab/cryptosite,salilab/cryptosite | Add basic test for usearch clustering. | import unittest
import utils
import os
import sys
import shutil
import contextlib
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(TOPDIR, 'lib'))
sys.path.append(TOPDIR)
import seqConservation
@contextlib.contextmanager
def mock_usearch():
"""Make mock usearch ... | <commit_before><commit_msg>Add basic test for usearch clustering.<commit_after> | import unittest
import utils
import os
import sys
import shutil
import contextlib
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(TOPDIR, 'lib'))
sys.path.append(TOPDIR)
import seqConservation
@contextlib.contextmanager
def mock_usearch():
"""Make mock usearch ... | Add basic test for usearch clustering.import unittest
import utils
import os
import sys
import shutil
import contextlib
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(TOPDIR, 'lib'))
sys.path.append(TOPDIR)
import seqConservation
@contextlib.contextmanager
def moc... | <commit_before><commit_msg>Add basic test for usearch clustering.<commit_after>import unittest
import utils
import os
import sys
import shutil
import contextlib
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(TOPDIR, 'lib'))
sys.path.append(TOPDIR)
import seqConserv... | |
e57fe864a312b6a1f5493c5b4687568bad99949c | numba/cuda/tests/cudapy/test_lang.py | numba/cuda/tests/cudapy/test_lang.py | """
Test basic language features
"""
from __future__ import print_function, absolute_import, division
import numpy as np
from numba import cuda
from numba.cuda.testing import unittest
class TestLang(unittest.TestCase):
def test_enumerate(self):
tup = (1., 2.5, 3.)
@cuda.jit("void(float64[:])")
... | Test new language feature in cuda python | Test new language feature in cuda python
| Python | bsd-2-clause | jriehl/numba,numba/numba,pombredanne/numba,cpcloud/numba,gmarkall/numba,GaZ3ll3/numba,gdementen/numba,seibert/numba,stonebig/numba,GaZ3ll3/numba,stonebig/numba,seibert/numba,ssarangi/numba,gmarkall/numba,pitrou/numba,jriehl/numba,pombredanne/numba,numba/numba,IntelLabs/numba,stuartarchibald/numba,cpcloud/numba,gdemente... | Test new language feature in cuda python | """
Test basic language features
"""
from __future__ import print_function, absolute_import, division
import numpy as np
from numba import cuda
from numba.cuda.testing import unittest
class TestLang(unittest.TestCase):
def test_enumerate(self):
tup = (1., 2.5, 3.)
@cuda.jit("void(float64[:])")
... | <commit_before><commit_msg>Test new language feature in cuda python<commit_after> | """
Test basic language features
"""
from __future__ import print_function, absolute_import, division
import numpy as np
from numba import cuda
from numba.cuda.testing import unittest
class TestLang(unittest.TestCase):
def test_enumerate(self):
tup = (1., 2.5, 3.)
@cuda.jit("void(float64[:])")
... | Test new language feature in cuda python"""
Test basic language features
"""
from __future__ import print_function, absolute_import, division
import numpy as np
from numba import cuda
from numba.cuda.testing import unittest
class TestLang(unittest.TestCase):
def test_enumerate(self):
tup = (1., 2.5, 3.)... | <commit_before><commit_msg>Test new language feature in cuda python<commit_after>"""
Test basic language features
"""
from __future__ import print_function, absolute_import, division
import numpy as np
from numba import cuda
from numba.cuda.testing import unittest
class TestLang(unittest.TestCase):
def test_enu... | |
b6deb0495f1a31801d95e2d59de7ea2731eb8970 | home/bin/h2t.py | home/bin/h2t.py | import argparse
import html2text
import pypandoc
def main():
p = argparse.ArgumentParser()
h = html2text.HTML2Text()
p.add_argument("filename")
filename = p.parse_args().filename
h.ignore_emphasis = True
h.body_width = 0
h.use_automatic_links = False
h.wrap_links = False
h.single_... | Add html to text script | Add html to text script
| Python | mit | dahlbaek/Ubuntu-dotfiles | Add html to text script | import argparse
import html2text
import pypandoc
def main():
p = argparse.ArgumentParser()
h = html2text.HTML2Text()
p.add_argument("filename")
filename = p.parse_args().filename
h.ignore_emphasis = True
h.body_width = 0
h.use_automatic_links = False
h.wrap_links = False
h.single_... | <commit_before><commit_msg>Add html to text script<commit_after> | import argparse
import html2text
import pypandoc
def main():
p = argparse.ArgumentParser()
h = html2text.HTML2Text()
p.add_argument("filename")
filename = p.parse_args().filename
h.ignore_emphasis = True
h.body_width = 0
h.use_automatic_links = False
h.wrap_links = False
h.single_... | Add html to text scriptimport argparse
import html2text
import pypandoc
def main():
p = argparse.ArgumentParser()
h = html2text.HTML2Text()
p.add_argument("filename")
filename = p.parse_args().filename
h.ignore_emphasis = True
h.body_width = 0
h.use_automatic_links = False
h.wrap_link... | <commit_before><commit_msg>Add html to text script<commit_after>import argparse
import html2text
import pypandoc
def main():
p = argparse.ArgumentParser()
h = html2text.HTML2Text()
p.add_argument("filename")
filename = p.parse_args().filename
h.ignore_emphasis = True
h.body_width = 0
h.us... | |
b73fa8f8daaef9130563cfa2f7d0546c6e393d33 | tools/dev/wc-ng/graph-data.py | tools/dev/wc-ng/graph-data.py | #!/usr/bin/env python
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib import pylab
import numpy as np
import csv
import sys
min_rev = 35000
data_reader = csv.reader(open('data.csv'))
data = []
for row in data_reader:
row = row[:-1]
if row[0] == 'Revision':
data.append(row)
... | Add yet another script, this one for doing an area graph of the wc-ng data collected by gather-data.sh. | Add yet another script, this one for doing an area graph of the wc-ng data
collected by gather-data.sh.
* tools/dev/wc-ng/graph-data.py:
New.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@880258 13f79535-47bb-0310-9956-ffa450edef68
| Python | apache-2.0 | YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion | Add yet another script, this one for doing an area graph of the wc-ng data
collected by gather-data.sh.
* tools/dev/wc-ng/graph-data.py:
New.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@880258 13f79535-47bb-0310-9956-ffa450edef68 | #!/usr/bin/env python
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib import pylab
import numpy as np
import csv
import sys
min_rev = 35000
data_reader = csv.reader(open('data.csv'))
data = []
for row in data_reader:
row = row[:-1]
if row[0] == 'Revision':
data.append(row)
... | <commit_before><commit_msg>Add yet another script, this one for doing an area graph of the wc-ng data
collected by gather-data.sh.
* tools/dev/wc-ng/graph-data.py:
New.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@880258 13f79535-47bb-0310-9956-ffa450edef68<commit_after> | #!/usr/bin/env python
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib import pylab
import numpy as np
import csv
import sys
min_rev = 35000
data_reader = csv.reader(open('data.csv'))
data = []
for row in data_reader:
row = row[:-1]
if row[0] == 'Revision':
data.append(row)
... | Add yet another script, this one for doing an area graph of the wc-ng data
collected by gather-data.sh.
* tools/dev/wc-ng/graph-data.py:
New.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@880258 13f79535-47bb-0310-9956-ffa450edef68#!/usr/bin/env python
import matplotlib.mlab as mlab
import matplotlib.pyplo... | <commit_before><commit_msg>Add yet another script, this one for doing an area graph of the wc-ng data
collected by gather-data.sh.
* tools/dev/wc-ng/graph-data.py:
New.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@880258 13f79535-47bb-0310-9956-ffa450edef68<commit_after>#!/usr/bin/env python
import matplo... | |
15916aa477163ce8613aaec61ab2a114018d1071 | tests/compiler/test_inheritance.py | tests/compiler/test_inheritance.py | import pytest
from tests.compiler import compile_snippet, A_INST, B_INST, C_INST, compile_base, A_THING, B_THING
from thinglang.compiler.errors import InvalidReference
from thinglang.compiler.opcodes import OpcodePushMember, OpcodeInstantiate, OpcodeReturn, OpcodePushLocal, \
OpcodePopMember
def test_regular_inh... | Add initial test for inheritance pattern compilation | Add initial test for inheritance pattern compilation
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | Add initial test for inheritance pattern compilation | import pytest
from tests.compiler import compile_snippet, A_INST, B_INST, C_INST, compile_base, A_THING, B_THING
from thinglang.compiler.errors import InvalidReference
from thinglang.compiler.opcodes import OpcodePushMember, OpcodeInstantiate, OpcodeReturn, OpcodePushLocal, \
OpcodePopMember
def test_regular_inh... | <commit_before><commit_msg>Add initial test for inheritance pattern compilation<commit_after> | import pytest
from tests.compiler import compile_snippet, A_INST, B_INST, C_INST, compile_base, A_THING, B_THING
from thinglang.compiler.errors import InvalidReference
from thinglang.compiler.opcodes import OpcodePushMember, OpcodeInstantiate, OpcodeReturn, OpcodePushLocal, \
OpcodePopMember
def test_regular_inh... | Add initial test for inheritance pattern compilationimport pytest
from tests.compiler import compile_snippet, A_INST, B_INST, C_INST, compile_base, A_THING, B_THING
from thinglang.compiler.errors import InvalidReference
from thinglang.compiler.opcodes import OpcodePushMember, OpcodeInstantiate, OpcodeReturn, OpcodePus... | <commit_before><commit_msg>Add initial test for inheritance pattern compilation<commit_after>import pytest
from tests.compiler import compile_snippet, A_INST, B_INST, C_INST, compile_base, A_THING, B_THING
from thinglang.compiler.errors import InvalidReference
from thinglang.compiler.opcodes import OpcodePushMember, O... | |
edab1cbfb3aada1378e1b248075909a2ba717efa | rtei/migrations/0003_rteidocument_file_size.py | rtei/migrations/0003_rteidocument_file_size.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-11 08:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rtei', '0002_auto_20190109_1413'),
]
operations = [
migrations.AddField(
... | Add rteidocument file size migration | Add rteidocument file size migration
(apply 3rd)
| Python | agpl-3.0 | okfn/rtei,okfn/rtei,okfn/rtei,okfn/rtei | Add rteidocument file size migration
(apply 3rd) | # -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-11 08:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rtei', '0002_auto_20190109_1413'),
]
operations = [
migrations.AddField(
... | <commit_before><commit_msg>Add rteidocument file size migration
(apply 3rd)<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-11 08:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rtei', '0002_auto_20190109_1413'),
]
operations = [
migrations.AddField(
... | Add rteidocument file size migration
(apply 3rd)# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-11 08:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rtei', '0002_auto_20190109_1413'),
]
... | <commit_before><commit_msg>Add rteidocument file size migration
(apply 3rd)<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-11 08:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('r... | |
fe5d8c87f976d1d73f26f713919193da21a0ae84 | ntm/memory.py | ntm/memory.py | import theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer
class Memory(InputLayer):
"""
docstring for Memory
"""
def __init__(self, shape,
memory_init=lasagne.init.Constant(0.),
learn_init=True,
**kwargs):
super(Memory, self).__i... | Add Memory component, inheriting from InputLayer | Add Memory component, inheriting from InputLayer
| Python | mit | snipsco/ntm-lasagne | Add Memory component, inheriting from InputLayer | import theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer
class Memory(InputLayer):
"""
docstring for Memory
"""
def __init__(self, shape,
memory_init=lasagne.init.Constant(0.),
learn_init=True,
**kwargs):
super(Memory, self).__i... | <commit_before><commit_msg>Add Memory component, inheriting from InputLayer<commit_after> | import theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer
class Memory(InputLayer):
"""
docstring for Memory
"""
def __init__(self, shape,
memory_init=lasagne.init.Constant(0.),
learn_init=True,
**kwargs):
super(Memory, self).__i... | Add Memory component, inheriting from InputLayerimport theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer
class Memory(InputLayer):
"""
docstring for Memory
"""
def __init__(self, shape,
memory_init=lasagne.init.Constant(0.),
learn_init=True,
... | <commit_before><commit_msg>Add Memory component, inheriting from InputLayer<commit_after>import theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer
class Memory(InputLayer):
"""
docstring for Memory
"""
def __init__(self, shape,
memory_init=lasagne.init.... | |
d7b98f9e77caef34cff9fc7de19ac4980abb9d38 | flaskext/debugtoolbar/utils.py | flaskext/debugtoolbar/utils.py | import os.path
import sys
from flask import current_app
def format_fname(value):
# If the value is not an absolute path, the it is a builtin or
# a relative file (thus a project file).
if not os.path.isabs(value):
if value.startswith(('{', '<')):
return value
if value.startswit... | Add a format_fname function which translates a absolute filename to a filename relative to the sys.path or relative to the project root | Add a format_fname function which translates a absolute filename to a filename relative to the sys.path or relative to the project root | Python | bsd-3-clause | lepture/flask-debugtoolbar,dianchang/flask-debugtoolbar,lepture/flask-debugtoolbar,dianchang/flask-debugtoolbar,dianchang/flask-debugtoolbar | Add a format_fname function which translates a absolute filename to a filename relative to the sys.path or relative to the project root | import os.path
import sys
from flask import current_app
def format_fname(value):
# If the value is not an absolute path, the it is a builtin or
# a relative file (thus a project file).
if not os.path.isabs(value):
if value.startswith(('{', '<')):
return value
if value.startswit... | <commit_before><commit_msg>Add a format_fname function which translates a absolute filename to a filename relative to the sys.path or relative to the project root<commit_after> | import os.path
import sys
from flask import current_app
def format_fname(value):
# If the value is not an absolute path, the it is a builtin or
# a relative file (thus a project file).
if not os.path.isabs(value):
if value.startswith(('{', '<')):
return value
if value.startswit... | Add a format_fname function which translates a absolute filename to a filename relative to the sys.path or relative to the project rootimport os.path
import sys
from flask import current_app
def format_fname(value):
# If the value is not an absolute path, the it is a builtin or
# a relative file (thus a proje... | <commit_before><commit_msg>Add a format_fname function which translates a absolute filename to a filename relative to the sys.path or relative to the project root<commit_after>import os.path
import sys
from flask import current_app
def format_fname(value):
# If the value is not an absolute path, the it is a built... | |
50f837a89a2303d89a7831e0cf5a4afc99eb7026 | foyer/tests/test_xml_writer.py | foyer/tests/test_xml_writer.py | import glob
import itertools as it
import os
import parmed as pmd
from pkg_resources import resource_filename
import pytest
from foyer import Forcefield
from foyer.tests.utils import atomtype
from foyer.xml_writer import write_foyer
def test_write_xml(filename, ff_file):
structure = pmd.loadfile(filename)
forc... | Add nonworking tests for xml writer | Add nonworking tests for xml writer
| Python | mit | iModels/foyer,mosdef-hub/foyer,iModels/foyer,mosdef-hub/foyer | Add nonworking tests for xml writer | import glob
import itertools as it
import os
import parmed as pmd
from pkg_resources import resource_filename
import pytest
from foyer import Forcefield
from foyer.tests.utils import atomtype
from foyer.xml_writer import write_foyer
def test_write_xml(filename, ff_file):
structure = pmd.loadfile(filename)
forc... | <commit_before><commit_msg>Add nonworking tests for xml writer<commit_after> | import glob
import itertools as it
import os
import parmed as pmd
from pkg_resources import resource_filename
import pytest
from foyer import Forcefield
from foyer.tests.utils import atomtype
from foyer.xml_writer import write_foyer
def test_write_xml(filename, ff_file):
structure = pmd.loadfile(filename)
forc... | Add nonworking tests for xml writerimport glob
import itertools as it
import os
import parmed as pmd
from pkg_resources import resource_filename
import pytest
from foyer import Forcefield
from foyer.tests.utils import atomtype
from foyer.xml_writer import write_foyer
def test_write_xml(filename, ff_file):
structu... | <commit_before><commit_msg>Add nonworking tests for xml writer<commit_after>import glob
import itertools as it
import os
import parmed as pmd
from pkg_resources import resource_filename
import pytest
from foyer import Forcefield
from foyer.tests.utils import atomtype
from foyer.xml_writer import write_foyer
def test... | |
1670ec1055ef6c957a319e683104081afd8db718 | python-example/test_check_stickers.py | python-example/test_check_stickers.py | import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@pytest.fixture
def driver(request):
wd = webdriver.Chrome()
wd.implicitly_wait(2)
request.addfinalizer(wd.quit)
return wd
def test_check_stickers(dri... | Check stickers (find elements, locators, wait) | Check stickers (find elements, locators, wait)
| Python | apache-2.0 | eugene-petrash/selenium-webdriver-full-tutorial,eugene-petrash/selenium-webdriver-full-tutorial | Check stickers (find elements, locators, wait) | import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@pytest.fixture
def driver(request):
wd = webdriver.Chrome()
wd.implicitly_wait(2)
request.addfinalizer(wd.quit)
return wd
def test_check_stickers(dri... | <commit_before><commit_msg>Check stickers (find elements, locators, wait)<commit_after> | import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@pytest.fixture
def driver(request):
wd = webdriver.Chrome()
wd.implicitly_wait(2)
request.addfinalizer(wd.quit)
return wd
def test_check_stickers(dri... | Check stickers (find elements, locators, wait)import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@pytest.fixture
def driver(request):
wd = webdriver.Chrome()
wd.implicitly_wait(2)
request.addfinalizer(wd.qui... | <commit_before><commit_msg>Check stickers (find elements, locators, wait)<commit_after>import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@pytest.fixture
def driver(request):
wd = webdriver.Chrome()
wd.implicitl... | |
ced1e16a316fb6f5b22f5da7bb130faf1477b400 | tests/stdout_test.py | tests/stdout_test.py | from nose.tools import *
import beastling.beastxml
import beastling.configuration
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/basic.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
xml.write_file("stdout")
| Test writing XML to stdout (currently failing in py3). | Test writing XML to stdout (currently failing in py3).
| Python | bsd-2-clause | lmaurits/BEASTling | Test writing XML to stdout (currently failing in py3). | from nose.tools import *
import beastling.beastxml
import beastling.configuration
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/basic.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
xml.write_file("stdout")
| <commit_before><commit_msg>Test writing XML to stdout (currently failing in py3).<commit_after> | from nose.tools import *
import beastling.beastxml
import beastling.configuration
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/basic.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
xml.write_file("stdout")
| Test writing XML to stdout (currently failing in py3).from nose.tools import *
import beastling.beastxml
import beastling.configuration
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/basic.conf")
config.process()
xml = beastling.beastxml.BeastXml(config)
... | <commit_before><commit_msg>Test writing XML to stdout (currently failing in py3).<commit_after>from nose.tools import *
import beastling.beastxml
import beastling.configuration
def test_extractor():
config = beastling.configuration.Configuration(configfile="tests/configs/basic.conf")
config.process()
xml ... | |
1fa0385bc8f0fc21233005c611b169fa5b95f993 | tools/diagnose-me.py | tools/diagnose-me.py | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import subprocess
import sys
all_checks = []
d... | Check in a script to diagnose common system configuration problems. | Check in a script to diagnose common system configuration problems.
Review URL: https://chromiumcodereview.appspot.com/9309011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | gavinp/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,ropik/c... | Check in a script to diagnose common system configuration problems.
Review URL: https://chromiumcodereview.appspot.com/9309011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import subprocess
import sys
all_checks = []
d... | <commit_before><commit_msg>Check in a script to diagnose common system configuration problems.
Review URL: https://chromiumcodereview.appspot.com/9309011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import subprocess
import sys
all_checks = []
d... | Check in a script to diagnose common system configuration problems.
Review URL: https://chromiumcodereview.appspot.com/9309011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98#!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this... | <commit_before><commit_msg>Check in a script to diagnose common system configuration problems.
Review URL: https://chromiumcodereview.appspot.com/9309011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>#!/usr/bin/python
# Copyright (c) 2012 The Chromium Au... | |
35b67e00e378df43a657c56bd751e7059ef45c38 | benchexec/tools/witnesslint.py | benchexec/tools/witnesslint.py | import benchexec.result as result
import benchexec.tools.template
class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for the witness checker (witnesslint)
(https://github.com/sosy-lab/sv-witnesses)
"""
def executable(self, tool_locator):
return tool_locator.find_executable("wit... | Add tool info for the witness linter. | Add tool info for the witness linter.
| Python | apache-2.0 | ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec | Add tool info for the witness linter. | import benchexec.result as result
import benchexec.tools.template
class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for the witness checker (witnesslint)
(https://github.com/sosy-lab/sv-witnesses)
"""
def executable(self, tool_locator):
return tool_locator.find_executable("wit... | <commit_before><commit_msg>Add tool info for the witness linter.<commit_after> | import benchexec.result as result
import benchexec.tools.template
class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for the witness checker (witnesslint)
(https://github.com/sosy-lab/sv-witnesses)
"""
def executable(self, tool_locator):
return tool_locator.find_executable("wit... | Add tool info for the witness linter.import benchexec.result as result
import benchexec.tools.template
class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for the witness checker (witnesslint)
(https://github.com/sosy-lab/sv-witnesses)
"""
def executable(self, tool_locator):
ret... | <commit_before><commit_msg>Add tool info for the witness linter.<commit_after>import benchexec.result as result
import benchexec.tools.template
class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for the witness checker (witnesslint)
(https://github.com/sosy-lab/sv-witnesses)
"""
def ex... | |
5a4aeb96b72af43aba5a1d7f143214d4083d151f | examples/pipeline/fix_space_entities.py | examples/pipeline/fix_space_entities.py | '''Demonstrate adding a rule-based component that forces some tokens to not
be entities, before the NER tagger is applied. This is used to hotfix the issue
in https://github.com/explosion/spaCy/issues/2870 , present as of spaCy v2.0.16.
'''
import spacy
from spacy.attrs import ENT_IOB
def fix_space_tags(doc):
ent_... | Add example showing a fix-up rule for space entities | Add example showing a fix-up rule for space entities
| Python | mit | explosion/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,honnibal/spaCy... | Add example showing a fix-up rule for space entities | '''Demonstrate adding a rule-based component that forces some tokens to not
be entities, before the NER tagger is applied. This is used to hotfix the issue
in https://github.com/explosion/spaCy/issues/2870 , present as of spaCy v2.0.16.
'''
import spacy
from spacy.attrs import ENT_IOB
def fix_space_tags(doc):
ent_... | <commit_before><commit_msg>Add example showing a fix-up rule for space entities<commit_after> | '''Demonstrate adding a rule-based component that forces some tokens to not
be entities, before the NER tagger is applied. This is used to hotfix the issue
in https://github.com/explosion/spaCy/issues/2870 , present as of spaCy v2.0.16.
'''
import spacy
from spacy.attrs import ENT_IOB
def fix_space_tags(doc):
ent_... | Add example showing a fix-up rule for space entities'''Demonstrate adding a rule-based component that forces some tokens to not
be entities, before the NER tagger is applied. This is used to hotfix the issue
in https://github.com/explosion/spaCy/issues/2870 , present as of spaCy v2.0.16.
'''
import spacy
from spacy.att... | <commit_before><commit_msg>Add example showing a fix-up rule for space entities<commit_after>'''Demonstrate adding a rule-based component that forces some tokens to not
be entities, before the NER tagger is applied. This is used to hotfix the issue
in https://github.com/explosion/spaCy/issues/2870 , present as of spaCy... | |
9c1cb898a6a85d3bf23782ab349fb45224beee6a | tempest/tests/services/compute/test_keypairs_client.py | tempest/tests/services/compute/test_keypairs_client.py | # Copyright 2015 NEC Corporation. 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 unit test for method list_keypairs | Add unit test for method list_keypairs
This patch adds unit test for keypairs_client.
Specific about method list_keypairs.
Change-Id: I7879280ff4f0211c7ec59c7225183f39978d3d41
| Python | apache-2.0 | sebrandon1/tempest,rakeshmi/tempest,manasi24/tempest,Tesora/tesora-tempest,openstack/tempest,flyingfish007/tempest,izadorozhna/tempest,rakeshmi/tempest,hayderimran7/tempest,tudorvio/tempest,vedujoshi/tempest,alinbalutoiu/tempest,alinbalutoiu/tempest,flyingfish007/tempest,izadorozhna/tempest,manasi24/tempest,zsoltdudas/... | Add unit test for method list_keypairs
This patch adds unit test for keypairs_client.
Specific about method list_keypairs.
Change-Id: I7879280ff4f0211c7ec59c7225183f39978d3d41 | # Copyright 2015 NEC Corporation. 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 unit test for method list_keypairs
This patch adds unit test for keypairs_client.
Specific about method list_keypairs.
Change-Id: I7879280ff4f0211c7ec59c7225183f39978d3d41<commit_after> | # Copyright 2015 NEC Corporation. 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 unit test for method list_keypairs
This patch adds unit test for keypairs_client.
Specific about method list_keypairs.
Change-Id: I7879280ff4f0211c7ec59c7225183f39978d3d41# Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | <commit_before><commit_msg>Add unit test for method list_keypairs
This patch adds unit test for keypairs_client.
Specific about method list_keypairs.
Change-Id: I7879280ff4f0211c7ec59c7225183f39978d3d41<commit_after># Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Vers... | |
faa917acfa0257aeb508ac6ea6393861f955945e | zou/app/utils/emails.py | zou/app/utils/emails.py | from flask_mail import Message
from zou.app import mail
def send_email(subject, body, recipient_email):
"""
Send an email with given subject and body to given recipient.
"""
message = Message(
body=body,
subject=subject,
recipients=[recipient_email]
)
mail.send(message... | Add a email helpers library | Add a email helpers library
| Python | agpl-3.0 | cgwire/zou | Add a email helpers library | from flask_mail import Message
from zou.app import mail
def send_email(subject, body, recipient_email):
"""
Send an email with given subject and body to given recipient.
"""
message = Message(
body=body,
subject=subject,
recipients=[recipient_email]
)
mail.send(message... | <commit_before><commit_msg>Add a email helpers library<commit_after> | from flask_mail import Message
from zou.app import mail
def send_email(subject, body, recipient_email):
"""
Send an email with given subject and body to given recipient.
"""
message = Message(
body=body,
subject=subject,
recipients=[recipient_email]
)
mail.send(message... | Add a email helpers libraryfrom flask_mail import Message
from zou.app import mail
def send_email(subject, body, recipient_email):
"""
Send an email with given subject and body to given recipient.
"""
message = Message(
body=body,
subject=subject,
recipients=[recipient_email]
... | <commit_before><commit_msg>Add a email helpers library<commit_after>from flask_mail import Message
from zou.app import mail
def send_email(subject, body, recipient_email):
"""
Send an email with given subject and body to given recipient.
"""
message = Message(
body=body,
subject=subje... | |
9244a246b5501ae984863dd442f5b2ab10bc437b | lxc-stress.py | lxc-stress.py | #!/usr/bin/env python
import time
NUM_RUNS = 10
def stress_cpu(num_passes=20000):
sum(1/16**k *
(4/(8*k+1) -
2/(8*k+4) -
1/(8*k+5) -
1/(8*k+6)) for k in xrange(num_passes))
start_time = time.time()
for i in xrange(0, NUM_RUNS):
print('Running stress test {}/{}'.format(i +... | Add basic script for stress testing a remote servers CPU | Add basic script for stress testing a remote servers CPU
| Python | mit | ben-rowan/lxc-calibrate | Add basic script for stress testing a remote servers CPU | #!/usr/bin/env python
import time
NUM_RUNS = 10
def stress_cpu(num_passes=20000):
sum(1/16**k *
(4/(8*k+1) -
2/(8*k+4) -
1/(8*k+5) -
1/(8*k+6)) for k in xrange(num_passes))
start_time = time.time()
for i in xrange(0, NUM_RUNS):
print('Running stress test {}/{}'.format(i +... | <commit_before><commit_msg>Add basic script for stress testing a remote servers CPU<commit_after> | #!/usr/bin/env python
import time
NUM_RUNS = 10
def stress_cpu(num_passes=20000):
sum(1/16**k *
(4/(8*k+1) -
2/(8*k+4) -
1/(8*k+5) -
1/(8*k+6)) for k in xrange(num_passes))
start_time = time.time()
for i in xrange(0, NUM_RUNS):
print('Running stress test {}/{}'.format(i +... | Add basic script for stress testing a remote servers CPU#!/usr/bin/env python
import time
NUM_RUNS = 10
def stress_cpu(num_passes=20000):
sum(1/16**k *
(4/(8*k+1) -
2/(8*k+4) -
1/(8*k+5) -
1/(8*k+6)) for k in xrange(num_passes))
start_time = time.time()
for i in xrange(0, NUM... | <commit_before><commit_msg>Add basic script for stress testing a remote servers CPU<commit_after>#!/usr/bin/env python
import time
NUM_RUNS = 10
def stress_cpu(num_passes=20000):
sum(1/16**k *
(4/(8*k+1) -
2/(8*k+4) -
1/(8*k+5) -
1/(8*k+6)) for k in xrange(num_passes))
start_t... | |
498bfbbde87fd94fde0775ab7d366c972b09c1d0 | challenges/232-Palindromes.py | challenges/232-Palindromes.py | import re
def isPalindrome(file):
infile = open(file, 'r')
lines = infile.readlines()
num_lines = int(lines[0])
total_string = "";
for line in lines[1: (num_lines+1)]:
total_string += line
total_string = re.sub('[^a-zA-Z0-9]', '', total_string)
total_string = total_string.lower()... | Add Challenge 232 Palindrome Solution | Add Challenge 232 Palindrome Solution
| Python | mit | JonShepChen/DailyProgrammerChallenges | Add Challenge 232 Palindrome Solution | import re
def isPalindrome(file):
infile = open(file, 'r')
lines = infile.readlines()
num_lines = int(lines[0])
total_string = "";
for line in lines[1: (num_lines+1)]:
total_string += line
total_string = re.sub('[^a-zA-Z0-9]', '', total_string)
total_string = total_string.lower()... | <commit_before><commit_msg>Add Challenge 232 Palindrome Solution<commit_after> | import re
def isPalindrome(file):
infile = open(file, 'r')
lines = infile.readlines()
num_lines = int(lines[0])
total_string = "";
for line in lines[1: (num_lines+1)]:
total_string += line
total_string = re.sub('[^a-zA-Z0-9]', '', total_string)
total_string = total_string.lower()... | Add Challenge 232 Palindrome Solutionimport re
def isPalindrome(file):
infile = open(file, 'r')
lines = infile.readlines()
num_lines = int(lines[0])
total_string = "";
for line in lines[1: (num_lines+1)]:
total_string += line
total_string = re.sub('[^a-zA-Z0-9]', '', total_string)
... | <commit_before><commit_msg>Add Challenge 232 Palindrome Solution<commit_after>import re
def isPalindrome(file):
infile = open(file, 'r')
lines = infile.readlines()
num_lines = int(lines[0])
total_string = "";
for line in lines[1: (num_lines+1)]:
total_string += line
total_string = re... | |
f5c46ea946f487d6ff445020bac55bd7b137088b | test/widgets/test_wttr.py | test/widgets/test_wttr.py | # Copyright (c) 2021 elParaguayo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | Add test for wttr widget | Add test for wttr widget
| Python | mit | qtile/qtile,qtile/qtile,ramnes/qtile,ramnes/qtile | Add test for wttr widget | # Copyright (c) 2021 elParaguayo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | <commit_before><commit_msg>Add test for wttr widget<commit_after> | # Copyright (c) 2021 elParaguayo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | Add test for wttr widget# Copyright (c) 2021 elParaguayo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | <commit_before><commit_msg>Add test for wttr widget<commit_after># Copyright (c) 2021 elParaguayo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | |
71bed1a9a7a0a042d3e0964f06cee900f6d7d9ae | stmhal/boards/STM32F4DISC/staccel.py | stmhal/boards/STM32F4DISC/staccel.py | """
Driver for accelerometer on STM32F4 Discover board.
Assumes it's a LIS302DL MEMS device.
Not currently working.
See:
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.h
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.c
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/STM32F4-Discovery... | Add preliminary driver for ST32F4DISC accelerometer. | stmhal: Add preliminary driver for ST32F4DISC accelerometer.
Written in Python, not currently working. See issue #725.
| Python | mit | torwag/micropython,emfcamp/micropython,jlillest/micropython,PappaPeppar/micropython,rubencabrera/micropython,tralamazza/micropython,Peetz0r/micropython-esp32,SHA2017-badge/micropython-esp32,ruffy91/micropython,SungEun-Steve-Kim/test-mp,infinnovation/micropython,supergis/micropython,xhat/micropython,emfcamp/micropython,... | stmhal: Add preliminary driver for ST32F4DISC accelerometer.
Written in Python, not currently working. See issue #725. | """
Driver for accelerometer on STM32F4 Discover board.
Assumes it's a LIS302DL MEMS device.
Not currently working.
See:
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.h
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.c
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/STM32F4-Discovery... | <commit_before><commit_msg>stmhal: Add preliminary driver for ST32F4DISC accelerometer.
Written in Python, not currently working. See issue #725.<commit_after> | """
Driver for accelerometer on STM32F4 Discover board.
Assumes it's a LIS302DL MEMS device.
Not currently working.
See:
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.h
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.c
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/STM32F4-Discovery... | stmhal: Add preliminary driver for ST32F4DISC accelerometer.
Written in Python, not currently working. See issue #725."""
Driver for accelerometer on STM32F4 Discover board.
Assumes it's a LIS302DL MEMS device.
Not currently working.
See:
STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.h
ST... | <commit_before><commit_msg>stmhal: Add preliminary driver for ST32F4DISC accelerometer.
Written in Python, not currently working. See issue #725.<commit_after>"""
Driver for accelerometer on STM32F4 Discover board.
Assumes it's a LIS302DL MEMS device.
Not currently working.
See:
STM32Cube_FW_F4_V1.1.0/Drivers/... | |
b596be1a82a9024471b4afafc8922292c300f1e9 | systemvm/patches/debian/config/opt/cloud/bin/update_config.py | systemvm/patches/debian/config/opt/cloud/bin/update_config.py | #!/usr/bin/python
import syslog
import sys
# first commandline argument should be the file to process
if ( len(sys.argv) != 2 ):
print "Invalid usage"
sys.exit(1)
json_file = sys.argv[1]
syslog.syslog(sys.argv[0] + " called for file " + json_file)
| Add a placeholder for the trigger file | Add a placeholder for the trigger file
| Python | apache-2.0 | GabrielBrascher/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,resmo/cloudstack,wido/cloudstack,jcshen007/cloudstack,resmo/cloudstack,jcshen007/cloudstack,wido/cloudstack,DaanHoogland/cloudstack,wido/cloudstack,GabrielBrascher/cloudstack,jcshen007/cloudstack,jcshen007/cloudstack,DaanHoogland/cloudstack,resmo/cl... | Add a placeholder for the trigger file | #!/usr/bin/python
import syslog
import sys
# first commandline argument should be the file to process
if ( len(sys.argv) != 2 ):
print "Invalid usage"
sys.exit(1)
json_file = sys.argv[1]
syslog.syslog(sys.argv[0] + " called for file " + json_file)
| <commit_before><commit_msg>Add a placeholder for the trigger file<commit_after> | #!/usr/bin/python
import syslog
import sys
# first commandline argument should be the file to process
if ( len(sys.argv) != 2 ):
print "Invalid usage"
sys.exit(1)
json_file = sys.argv[1]
syslog.syslog(sys.argv[0] + " called for file " + json_file)
| Add a placeholder for the trigger file#!/usr/bin/python
import syslog
import sys
# first commandline argument should be the file to process
if ( len(sys.argv) != 2 ):
print "Invalid usage"
sys.exit(1)
json_file = sys.argv[1]
syslog.syslog(sys.argv[0] + " called for file " + json_file)
| <commit_before><commit_msg>Add a placeholder for the trigger file<commit_after>#!/usr/bin/python
import syslog
import sys
# first commandline argument should be the file to process
if ( len(sys.argv) != 2 ):
print "Invalid usage"
sys.exit(1)
json_file = sys.argv[1]
syslog.syslog(sys.argv[0] + " called for f... | |
962f7f1184803401b9d8cb3423cd574d55bcf9e4 | tools/tree.py | tools/tree.py | import sys
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.topolib import TreeTopo
from mininet.node import RemoteController, OVSKernelSwitch
myTree = TreeTopo(depth=3,fanout=4)
def run( controllers ):
net = Mininet( topo=m... | Add mininet script for test topology | Add mininet script for test topology
| Python | apache-2.0 | sangyun-han/sidekick,sangyun-han/sidekick,sangyun-han/sidekick,sangyun-han/sidekick | Add mininet script for test topology | import sys
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.topolib import TreeTopo
from mininet.node import RemoteController, OVSKernelSwitch
myTree = TreeTopo(depth=3,fanout=4)
def run( controllers ):
net = Mininet( topo=m... | <commit_before><commit_msg>Add mininet script for test topology<commit_after> | import sys
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.topolib import TreeTopo
from mininet.node import RemoteController, OVSKernelSwitch
myTree = TreeTopo(depth=3,fanout=4)
def run( controllers ):
net = Mininet( topo=m... | Add mininet script for test topologyimport sys
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.topolib import TreeTopo
from mininet.node import RemoteController, OVSKernelSwitch
myTree = TreeTopo(depth=3,fanout=4)
def run( cont... | <commit_before><commit_msg>Add mininet script for test topology<commit_after>import sys
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.topolib import TreeTopo
from mininet.node import RemoteController, OVSKernelSwitch
myTree = ... | |
9e27800d4e94b9f13810b9c939bd62ef541f7f12 | AddDataTest.py | AddDataTest.py | __author__ = 'chuqiao'
import script
script.addDataToSolrFromUrl("http://www.elixir-europe.org:8080/events", "http://www.elixir-europe.org:8080/events");
script.addDataToSolrFromUrl("http://localhost/ep/events?state=published&field_type_tid=All", "http://localhost/ep/events"); | Create Add Data Test script | Create Add Data Test script
| Python | mit | elixirhub/events-portal-scraping-scripts | Create Add Data Test script | __author__ = 'chuqiao'
import script
script.addDataToSolrFromUrl("http://www.elixir-europe.org:8080/events", "http://www.elixir-europe.org:8080/events");
script.addDataToSolrFromUrl("http://localhost/ep/events?state=published&field_type_tid=All", "http://localhost/ep/events"); | <commit_before><commit_msg>Create Add Data Test script<commit_after> | __author__ = 'chuqiao'
import script
script.addDataToSolrFromUrl("http://www.elixir-europe.org:8080/events", "http://www.elixir-europe.org:8080/events");
script.addDataToSolrFromUrl("http://localhost/ep/events?state=published&field_type_tid=All", "http://localhost/ep/events"); | Create Add Data Test script__author__ = 'chuqiao'
import script
script.addDataToSolrFromUrl("http://www.elixir-europe.org:8080/events", "http://www.elixir-europe.org:8080/events");
script.addDataToSolrFromUrl("http://localhost/ep/events?state=published&field_type_tid=All", "http://localhost/ep/events"); | <commit_before><commit_msg>Create Add Data Test script<commit_after>__author__ = 'chuqiao'
import script
script.addDataToSolrFromUrl("http://www.elixir-europe.org:8080/events", "http://www.elixir-europe.org:8080/events");
script.addDataToSolrFromUrl("http://localhost/ep/events?state=published&field_type_tid=All", "http... | |
6503a8fc3c9f47b5e33d7ad520ac48b0d452cf70 | pyfr/bases.py | pyfr/bases.py | # -*- coding: utf-8 -*-
import sympy as sy
import numpy as np
import itertools
def lagrange_basis(points, sym):
"""Generates a basis of polynomials, :math:`l_i(x)`, such that
.. math::
l_i(x) =
\begin{cases}
0 & x\neq p_{i}\\
1 & x=p_{i}
\end{cases}
where :math:`p_i` ... | Add a set of functions related to basis-computation. | Add a set of functions related to basis-computation.
| Python | bsd-3-clause | BrianVermeire/PyFR,tjcorona/PyFR,tjcorona/PyFR,tjcorona/PyFR,Aerojspark/PyFR,iyer-arvind/PyFR | Add a set of functions related to basis-computation. | # -*- coding: utf-8 -*-
import sympy as sy
import numpy as np
import itertools
def lagrange_basis(points, sym):
"""Generates a basis of polynomials, :math:`l_i(x)`, such that
.. math::
l_i(x) =
\begin{cases}
0 & x\neq p_{i}\\
1 & x=p_{i}
\end{cases}
where :math:`p_i` ... | <commit_before><commit_msg>Add a set of functions related to basis-computation.<commit_after> | # -*- coding: utf-8 -*-
import sympy as sy
import numpy as np
import itertools
def lagrange_basis(points, sym):
"""Generates a basis of polynomials, :math:`l_i(x)`, such that
.. math::
l_i(x) =
\begin{cases}
0 & x\neq p_{i}\\
1 & x=p_{i}
\end{cases}
where :math:`p_i` ... | Add a set of functions related to basis-computation.# -*- coding: utf-8 -*-
import sympy as sy
import numpy as np
import itertools
def lagrange_basis(points, sym):
"""Generates a basis of polynomials, :math:`l_i(x)`, such that
.. math::
l_i(x) =
\begin{cases}
0 & x\neq p_{i}\\
1... | <commit_before><commit_msg>Add a set of functions related to basis-computation.<commit_after># -*- coding: utf-8 -*-
import sympy as sy
import numpy as np
import itertools
def lagrange_basis(points, sym):
"""Generates a basis of polynomials, :math:`l_i(x)`, such that
.. math::
l_i(x) =
\begin{c... | |
5443ceecfafea3c78a7153eaa2d38febdb54eb3e | tests/test_digest.py | tests/test_digest.py | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestDigest(FlexGetBase):
__yaml__ = """
tasks:
digest 1:
mock:
- title: entry 1
accept_all: yes
digest: aoeu
digest 2:
m... | Add basic test for digest plugin | Add basic test for digest plugin
| Python | mit | antivirtel/Flexget,qvazzler/Flexget,tsnoam/Flexget,Danfocus/Flexget,gazpachoking/Flexget,spencerjanssen/Flexget,malkavi/Flexget,crawln45/Flexget,antivirtel/Flexget,crawln45/Flexget,ZefQ/Flexget,vfrc2/Flexget,tobinjt/Flexget,tobinjt/Flexget,LynxyssCZ/Flexget,tobinjt/Flexget,ibrahimkarahan/Flexget,tarzasai/Flexget,drwyrm... | Add basic test for digest plugin | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestDigest(FlexGetBase):
__yaml__ = """
tasks:
digest 1:
mock:
- title: entry 1
accept_all: yes
digest: aoeu
digest 2:
m... | <commit_before><commit_msg>Add basic test for digest plugin<commit_after> | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestDigest(FlexGetBase):
__yaml__ = """
tasks:
digest 1:
mock:
- title: entry 1
accept_all: yes
digest: aoeu
digest 2:
m... | Add basic test for digest pluginfrom __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestDigest(FlexGetBase):
__yaml__ = """
tasks:
digest 1:
mock:
- title: entry 1
accept_all: yes
digest: aoeu
... | <commit_before><commit_msg>Add basic test for digest plugin<commit_after>from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestDigest(FlexGetBase):
__yaml__ = """
tasks:
digest 1:
mock:
- title: entry 1
a... | |
2a5a735d9440ca9998e80239b41410a35b0c972d | tools/fixup_translations.py | tools/fixup_translations.py | # Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect
# if a translation was added to the source but isn't in a .po. This ensures translators can grab
# complete files to work on.
import git
import sys
import polib
po_filenames = sys.argv[1:]
repo = git.Repo()
NO_TRANSLA... | Add utility to remerge translations | Add utility to remerge translations
| Python | mit | adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython | Add utility to remerge translations | # Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect
# if a translation was added to the source but isn't in a .po. This ensures translators can grab
# complete files to work on.
import git
import sys
import polib
po_filenames = sys.argv[1:]
repo = git.Repo()
NO_TRANSLA... | <commit_before><commit_msg>Add utility to remerge translations<commit_after> | # Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect
# if a translation was added to the source but isn't in a .po. This ensures translators can grab
# complete files to work on.
import git
import sys
import polib
po_filenames = sys.argv[1:]
repo = git.Repo()
NO_TRANSLA... | Add utility to remerge translations# Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect
# if a translation was added to the source but isn't in a .po. This ensures translators can grab
# complete files to work on.
import git
import sys
import polib
po_filenames = sys.arg... | <commit_before><commit_msg>Add utility to remerge translations<commit_after># Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect
# if a translation was added to the source but isn't in a .po. This ensures translators can grab
# complete files to work on.
import git
import... | |
dc818ce216bde42fdf60852e2320aaf3e6e45156 | cli2phone.py | cli2phone.py | #!/usr/bin/env python
"""cli2phone pushes messages from the command line to your android phone.
Requires Android 2.2 or newer, and the chrometophone application installed.
See: http://code.google.com/p/chrometophone/
Usage: cli2phone URL
"""
import sys
import getopt
from auth import Auth
apiVersion = '5'
baseUrl = ... | Add the main interface file. | Add the main interface file.
| Python | mit | sklnd/cli2phone | Add the main interface file. | #!/usr/bin/env python
"""cli2phone pushes messages from the command line to your android phone.
Requires Android 2.2 or newer, and the chrometophone application installed.
See: http://code.google.com/p/chrometophone/
Usage: cli2phone URL
"""
import sys
import getopt
from auth import Auth
apiVersion = '5'
baseUrl = ... | <commit_before><commit_msg>Add the main interface file.<commit_after> | #!/usr/bin/env python
"""cli2phone pushes messages from the command line to your android phone.
Requires Android 2.2 or newer, and the chrometophone application installed.
See: http://code.google.com/p/chrometophone/
Usage: cli2phone URL
"""
import sys
import getopt
from auth import Auth
apiVersion = '5'
baseUrl = ... | Add the main interface file.#!/usr/bin/env python
"""cli2phone pushes messages from the command line to your android phone.
Requires Android 2.2 or newer, and the chrometophone application installed.
See: http://code.google.com/p/chrometophone/
Usage: cli2phone URL
"""
import sys
import getopt
from auth import Auth
... | <commit_before><commit_msg>Add the main interface file.<commit_after>#!/usr/bin/env python
"""cli2phone pushes messages from the command line to your android phone.
Requires Android 2.2 or newer, and the chrometophone application installed.
See: http://code.google.com/p/chrometophone/
Usage: cli2phone URL
"""
import... | |
83ae6c1f17e7f744c81b53d02cfe8f058c5500da | CodeFights/mathPractice.py | CodeFights/mathPractice.py | #!/usr/local/bin/python
# Code Fights Math Practice Problem
from functools import reduce
def mathPractice(numbers):
return reduce(lambda acc, x: (acc + x[1] if x[0] % 2 else acc * x[1]),
enumerate(numbers), 1)
def main():
tests = [
[[1, 2, 3, 4, 5, 6], 71],
[[8, 9], 17],
... | Solve Code Fights math practice problem | Solve Code Fights math practice problem
| Python | mit | HKuz/Test_Code | Solve Code Fights math practice problem | #!/usr/local/bin/python
# Code Fights Math Practice Problem
from functools import reduce
def mathPractice(numbers):
return reduce(lambda acc, x: (acc + x[1] if x[0] % 2 else acc * x[1]),
enumerate(numbers), 1)
def main():
tests = [
[[1, 2, 3, 4, 5, 6], 71],
[[8, 9], 17],
... | <commit_before><commit_msg>Solve Code Fights math practice problem<commit_after> | #!/usr/local/bin/python
# Code Fights Math Practice Problem
from functools import reduce
def mathPractice(numbers):
return reduce(lambda acc, x: (acc + x[1] if x[0] % 2 else acc * x[1]),
enumerate(numbers), 1)
def main():
tests = [
[[1, 2, 3, 4, 5, 6], 71],
[[8, 9], 17],
... | Solve Code Fights math practice problem#!/usr/local/bin/python
# Code Fights Math Practice Problem
from functools import reduce
def mathPractice(numbers):
return reduce(lambda acc, x: (acc + x[1] if x[0] % 2 else acc * x[1]),
enumerate(numbers), 1)
def main():
tests = [
[[1, 2, 3,... | <commit_before><commit_msg>Solve Code Fights math practice problem<commit_after>#!/usr/local/bin/python
# Code Fights Math Practice Problem
from functools import reduce
def mathPractice(numbers):
return reduce(lambda acc, x: (acc + x[1] if x[0] % 2 else acc * x[1]),
enumerate(numbers), 1)
def... | |
4c80716c799f6fd6e8d3f28f840ebf8443973931 | py/partition-equal-subset-sum.py | py/partition-equal-subset-sum.py | class Solution(object):
def canPartition(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
s = sum(nums)
if s % 2 != 0:
return False
possible = [True] + [False] * (s / 2 - 1)
for n in nums:
if n > s / 2:
re... | Add py solution for 416. Partition Equal Subset Sum | Add py solution for 416. Partition Equal Subset Sum
416. Partition Equal Subset Sum: https://leetcode.com/problems/partition-equal-subset-sum/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 416. Partition Equal Subset Sum
416. Partition Equal Subset Sum: https://leetcode.com/problems/partition-equal-subset-sum/ | class Solution(object):
def canPartition(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
s = sum(nums)
if s % 2 != 0:
return False
possible = [True] + [False] * (s / 2 - 1)
for n in nums:
if n > s / 2:
re... | <commit_before><commit_msg>Add py solution for 416. Partition Equal Subset Sum
416. Partition Equal Subset Sum: https://leetcode.com/problems/partition-equal-subset-sum/<commit_after> | class Solution(object):
def canPartition(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
s = sum(nums)
if s % 2 != 0:
return False
possible = [True] + [False] * (s / 2 - 1)
for n in nums:
if n > s / 2:
re... | Add py solution for 416. Partition Equal Subset Sum
416. Partition Equal Subset Sum: https://leetcode.com/problems/partition-equal-subset-sum/class Solution(object):
def canPartition(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
s = sum(nums)
if s % 2 != 0:... | <commit_before><commit_msg>Add py solution for 416. Partition Equal Subset Sum
416. Partition Equal Subset Sum: https://leetcode.com/problems/partition-equal-subset-sum/<commit_after>class Solution(object):
def canPartition(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
... | |
ae4a5a3c1e85383304ea72762b7bcabbb46c2a0d | mcdowell/src/main/python/ch1/ch1.py | mcdowell/src/main/python/ch1/ch1.py | def unique(string):
counter = {}
for c in string:
if c in counter:
counter[c] += 1
else:
counter[c] = 1
print(counter)
for k in counter:
if counter[k] > 1:
return False
else:
return True
def reverse(string):
result = []
for... | Add new Python module for McDowell Chapter 1. | Add new Python module for McDowell Chapter 1.
| Python | mit | jamesewoo/tigeruppercut,jamesewoo/tigeruppercut | Add new Python module for McDowell Chapter 1. | def unique(string):
counter = {}
for c in string:
if c in counter:
counter[c] += 1
else:
counter[c] = 1
print(counter)
for k in counter:
if counter[k] > 1:
return False
else:
return True
def reverse(string):
result = []
for... | <commit_before><commit_msg>Add new Python module for McDowell Chapter 1.<commit_after> | def unique(string):
counter = {}
for c in string:
if c in counter:
counter[c] += 1
else:
counter[c] = 1
print(counter)
for k in counter:
if counter[k] > 1:
return False
else:
return True
def reverse(string):
result = []
for... | Add new Python module for McDowell Chapter 1.def unique(string):
counter = {}
for c in string:
if c in counter:
counter[c] += 1
else:
counter[c] = 1
print(counter)
for k in counter:
if counter[k] > 1:
return False
else:
return True
... | <commit_before><commit_msg>Add new Python module for McDowell Chapter 1.<commit_after>def unique(string):
counter = {}
for c in string:
if c in counter:
counter[c] += 1
else:
counter[c] = 1
print(counter)
for k in counter:
if counter[k] > 1:
re... | |
9179e794ac8633ac498d2d0324e2083e8c6ed509 | iacli/ia_search.py | iacli/ia_search.py | """Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>... Sort sear... | """Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>... Sort sear... | Use `internetarchive.search()` function rather than `internetarchive.Search` class. | Use `internetarchive.search()` function rather than `internetarchive.Search` class.
| Python | agpl-3.0 | JesseWeinstein/internetarchive,dattasaurabh82/internetarchive,jjjake/internetarchive,wumpus/internetarchive,brycedrennan/internetarchive | """Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>... Sort sear... | """Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>... Sort sear... | <commit_before>"""Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>...... | """Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>... Sort sear... | """Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>... Sort sear... | <commit_before>"""Search the Internet Archive using the Archive.org Advanced Search
API <https://archive.org/advancedsearch.php#raw>.
usage:
ia search [--help] <query>... [options...]
options:
-h, --help
-p, --parameters=<key:value>... Parameters to send with your query.
-s, --sort=<field:order>...... |
0cae12bdbde6fa87f65025bc14ee5863f2526c4b | Snippets/edit_raw_table_data.py | Snippets/edit_raw_table_data.py | from fontTools.ttLib import TTFont
from fontTools.ttLib.tables.DefaultTable import DefaultTable
font_path = "myfont.ttf"
output_path = "myfont_patched.ttf"
table_tag = "DSIG"
# Get raw table data from the source font
font = TTFont(font_path)
raw_data = font.getTableData(table_tag)
# Do something with the raw tab... | Add snippet manipulating raw table data | Add snippet manipulating raw table data
| Python | mit | fonttools/fonttools,googlefonts/fonttools | Add snippet manipulating raw table data | from fontTools.ttLib import TTFont
from fontTools.ttLib.tables.DefaultTable import DefaultTable
font_path = "myfont.ttf"
output_path = "myfont_patched.ttf"
table_tag = "DSIG"
# Get raw table data from the source font
font = TTFont(font_path)
raw_data = font.getTableData(table_tag)
# Do something with the raw tab... | <commit_before><commit_msg>Add snippet manipulating raw table data<commit_after> | from fontTools.ttLib import TTFont
from fontTools.ttLib.tables.DefaultTable import DefaultTable
font_path = "myfont.ttf"
output_path = "myfont_patched.ttf"
table_tag = "DSIG"
# Get raw table data from the source font
font = TTFont(font_path)
raw_data = font.getTableData(table_tag)
# Do something with the raw tab... | Add snippet manipulating raw table datafrom fontTools.ttLib import TTFont
from fontTools.ttLib.tables.DefaultTable import DefaultTable
font_path = "myfont.ttf"
output_path = "myfont_patched.ttf"
table_tag = "DSIG"
# Get raw table data from the source font
font = TTFont(font_path)
raw_data = font.getTableData(table... | <commit_before><commit_msg>Add snippet manipulating raw table data<commit_after>from fontTools.ttLib import TTFont
from fontTools.ttLib.tables.DefaultTable import DefaultTable
font_path = "myfont.ttf"
output_path = "myfont_patched.ttf"
table_tag = "DSIG"
# Get raw table data from the source font
font = TTFont(font... | |
f342ce1ee57b0fdc6847d80a7453f575e4301299 | py/partition-to-k-equal-sum-subsets.py | py/partition-to-k-equal-sum-subsets.py | class Solution(object):
def canPartitionKSubsets(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: bool
"""
s = sum(nums)
if s % k != 0:
return False
target = s / k
lnums = len(nums)
fail = set()
nums.so... | Add py solution for 698. Partition to K Equal Sum Subsets | Add py solution for 698. Partition to K Equal Sum Subsets
698. Partition to K Equal Sum Subsets: https://leetcode.com/problems/partition-to-k-equal-sum-subsets/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 698. Partition to K Equal Sum Subsets
698. Partition to K Equal Sum Subsets: https://leetcode.com/problems/partition-to-k-equal-sum-subsets/ | class Solution(object):
def canPartitionKSubsets(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: bool
"""
s = sum(nums)
if s % k != 0:
return False
target = s / k
lnums = len(nums)
fail = set()
nums.so... | <commit_before><commit_msg>Add py solution for 698. Partition to K Equal Sum Subsets
698. Partition to K Equal Sum Subsets: https://leetcode.com/problems/partition-to-k-equal-sum-subsets/<commit_after> | class Solution(object):
def canPartitionKSubsets(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: bool
"""
s = sum(nums)
if s % k != 0:
return False
target = s / k
lnums = len(nums)
fail = set()
nums.so... | Add py solution for 698. Partition to K Equal Sum Subsets
698. Partition to K Equal Sum Subsets: https://leetcode.com/problems/partition-to-k-equal-sum-subsets/class Solution(object):
def canPartitionKSubsets(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: bool
... | <commit_before><commit_msg>Add py solution for 698. Partition to K Equal Sum Subsets
698. Partition to K Equal Sum Subsets: https://leetcode.com/problems/partition-to-k-equal-sum-subsets/<commit_after>class Solution(object):
def canPartitionKSubsets(self, nums, k):
"""
:type nums: List[int]
... | |
0a6eaaee9acdfee7154c9b10f85636e2a776c296 | blueprints/aws_s3_bucket/discover_s3_buckets.py | blueprints/aws_s3_bucket/discover_s3_buckets.py | """
Discover and create S3 Bucket records with some basic identifying attributes.
As all Discovery Plug-ins must do, we define the global `RESOURCE_IDENTIFIER` variable
and return a list of dictionaries from the `discover_resources` function.
"""
import boto3
from botocore.client import ClientError
from common.methods... | Add Discovery Plug-in for AWS S3 Bucket Blueprint | Add Discovery Plug-in for AWS S3 Bucket Blueprint
Provide a Plug-in that Discovers and Syncs any existing S3 Buckets for all configured AWS Resource Handlers. This Plug-in creates the S3 Bucket Resources in CloudBolt with the necessary attributes to support the Teardown Plug-in already provided for this Blueprint.
| Python | apache-2.0 | CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge | Add Discovery Plug-in for AWS S3 Bucket Blueprint
Provide a Plug-in that Discovers and Syncs any existing S3 Buckets for all configured AWS Resource Handlers. This Plug-in creates the S3 Bucket Resources in CloudBolt with the necessary attributes to support the Teardown Plug-in already provided for this Blueprint. | """
Discover and create S3 Bucket records with some basic identifying attributes.
As all Discovery Plug-ins must do, we define the global `RESOURCE_IDENTIFIER` variable
and return a list of dictionaries from the `discover_resources` function.
"""
import boto3
from botocore.client import ClientError
from common.methods... | <commit_before><commit_msg>Add Discovery Plug-in for AWS S3 Bucket Blueprint
Provide a Plug-in that Discovers and Syncs any existing S3 Buckets for all configured AWS Resource Handlers. This Plug-in creates the S3 Bucket Resources in CloudBolt with the necessary attributes to support the Teardown Plug-in already provi... | """
Discover and create S3 Bucket records with some basic identifying attributes.
As all Discovery Plug-ins must do, we define the global `RESOURCE_IDENTIFIER` variable
and return a list of dictionaries from the `discover_resources` function.
"""
import boto3
from botocore.client import ClientError
from common.methods... | Add Discovery Plug-in for AWS S3 Bucket Blueprint
Provide a Plug-in that Discovers and Syncs any existing S3 Buckets for all configured AWS Resource Handlers. This Plug-in creates the S3 Bucket Resources in CloudBolt with the necessary attributes to support the Teardown Plug-in already provided for this Blueprint."""
... | <commit_before><commit_msg>Add Discovery Plug-in for AWS S3 Bucket Blueprint
Provide a Plug-in that Discovers and Syncs any existing S3 Buckets for all configured AWS Resource Handlers. This Plug-in creates the S3 Bucket Resources in CloudBolt with the necessary attributes to support the Teardown Plug-in already provi... | |
7bd32a767490c534685d1b421dcbf7e62deddc06 | send_email.py | send_email.py | import sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("SpyPi@no-reply")
subject = "Motion Detected"
to_email = Email("sendToUser@example.com")
content = Content("text/plain", "We have detected motion from your pi!\n\n... | Send email using sendgrid API | Send email using sendgrid API
| Python | mit | efagerberg/PiCam | Send email using sendgrid API | import sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("SpyPi@no-reply")
subject = "Motion Detected"
to_email = Email("sendToUser@example.com")
content = Content("text/plain", "We have detected motion from your pi!\n\n... | <commit_before><commit_msg>Send email using sendgrid API<commit_after> | import sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("SpyPi@no-reply")
subject = "Motion Detected"
to_email = Email("sendToUser@example.com")
content = Content("text/plain", "We have detected motion from your pi!\n\n... | Send email using sendgrid APIimport sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("SpyPi@no-reply")
subject = "Motion Detected"
to_email = Email("sendToUser@example.com")
content = Content("text/plain", "We have dete... | <commit_before><commit_msg>Send email using sendgrid API<commit_after>import sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("SpyPi@no-reply")
subject = "Motion Detected"
to_email = Email("sendToUser@example.com")
cont... | |
51be58367217bbfc3e677afc79a73edb26ec6665 | problem_37.py | problem_37.py | from problem_35 import is_prime
from time import time
TRUNCATABLE_PRIMES = []
def is_truncatable_prime(num):
for i in ['0', '4', '6', '8']:
if i in str(num):
return False
for i in ['2', '5']:
if i in str(num)[1:]:
return False
if not is_prime(num):
retur... | Add problem 37, truncatable primes | Add problem 37, truncatable primes
| Python | mit | dimkarakostas/project-euler | Add problem 37, truncatable primes | from problem_35 import is_prime
from time import time
TRUNCATABLE_PRIMES = []
def is_truncatable_prime(num):
for i in ['0', '4', '6', '8']:
if i in str(num):
return False
for i in ['2', '5']:
if i in str(num)[1:]:
return False
if not is_prime(num):
retur... | <commit_before><commit_msg>Add problem 37, truncatable primes<commit_after> | from problem_35 import is_prime
from time import time
TRUNCATABLE_PRIMES = []
def is_truncatable_prime(num):
for i in ['0', '4', '6', '8']:
if i in str(num):
return False
for i in ['2', '5']:
if i in str(num)[1:]:
return False
if not is_prime(num):
retur... | Add problem 37, truncatable primesfrom problem_35 import is_prime
from time import time
TRUNCATABLE_PRIMES = []
def is_truncatable_prime(num):
for i in ['0', '4', '6', '8']:
if i in str(num):
return False
for i in ['2', '5']:
if i in str(num)[1:]:
return False
i... | <commit_before><commit_msg>Add problem 37, truncatable primes<commit_after>from problem_35 import is_prime
from time import time
TRUNCATABLE_PRIMES = []
def is_truncatable_prime(num):
for i in ['0', '4', '6', '8']:
if i in str(num):
return False
for i in ['2', '5']:
if i in str(... | |
0d7a51312d35b99c4eb06a349a9050cf5bb72ce1 | genotp.py | genotp.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# $Date$
#
# To the extent possible under law, Roland Smith has waived all copyright and
# related or neighboring rights to genotp.py. This work is published from the
# Netherlands. See http://creativecommons.org/publicdomain/zero/... | Simplify the generation of a one-time pad. | Simplify the generation of a one-time pad.
Renamed genoldpad.py to genotp.py. Removed the genline function; moved its
functionality to the main block.
| Python | mit | rsmith-nl/scripts,rsmith-nl/scripts | Simplify the generation of a one-time pad.
Renamed genoldpad.py to genotp.py. Removed the genline function; moved its
functionality to the main block. | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# $Date$
#
# To the extent possible under law, Roland Smith has waived all copyright and
# related or neighboring rights to genotp.py. This work is published from the
# Netherlands. See http://creativecommons.org/publicdomain/zero/... | <commit_before><commit_msg>Simplify the generation of a one-time pad.
Renamed genoldpad.py to genotp.py. Removed the genline function; moved its
functionality to the main block.<commit_after> | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# $Date$
#
# To the extent possible under law, Roland Smith has waived all copyright and
# related or neighboring rights to genotp.py. This work is published from the
# Netherlands. See http://creativecommons.org/publicdomain/zero/... | Simplify the generation of a one-time pad.
Renamed genoldpad.py to genotp.py. Removed the genline function; moved its
functionality to the main block.#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# $Date$
#
# To the extent possible under law, Roland Smith has waived all copyr... | <commit_before><commit_msg>Simplify the generation of a one-time pad.
Renamed genoldpad.py to genotp.py. Removed the genline function; moved its
functionality to the main block.<commit_after>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# $Date$
#
# To the extent possible und... | |
05d3cb5b44bd828e354c699b5793ecdf6f4501cd | locations/tasks.py | locations/tasks.py | import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all the identity store identities, and ensures that all of
the locations assigned to identities ap... | Add task to sync locations from identity store | Add task to sync locations from identity store
| Python | bsd-3-clause | praekelt/familyconnect-registration,praekelt/familyconnect-registration | Add task to sync locations from identity store | import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all the identity store identities, and ensures that all of
the locations assigned to identities ap... | <commit_before><commit_msg>Add task to sync locations from identity store<commit_after> | import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all the identity store identities, and ensures that all of
the locations assigned to identities ap... | Add task to sync locations from identity storeimport urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all the identity store identities, and ensures that all ... | <commit_before><commit_msg>Add task to sync locations from identity store<commit_after>import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all the identit... | |
2f99b380ec5d725d1d27df584357324ade9e0782 | test_hash.py | test_hash.py | from hash_table import HashTable
import io
import pytest
words = []
with io.open('/usr/share/dict/words', 'r') as word_file:
words = word_file.readlines()
def test_init():
ht = HashTable()
assert len(ht.table) == 1024
ht2 = HashTable(10000)
assert len(ht2.table) == 10000
def test_hash():
... | Add tests for hash table | Add tests for hash table
| Python | mit | jwarren116/data-structures-deux | Add tests for hash table | from hash_table import HashTable
import io
import pytest
words = []
with io.open('/usr/share/dict/words', 'r') as word_file:
words = word_file.readlines()
def test_init():
ht = HashTable()
assert len(ht.table) == 1024
ht2 = HashTable(10000)
assert len(ht2.table) == 10000
def test_hash():
... | <commit_before><commit_msg>Add tests for hash table<commit_after> | from hash_table import HashTable
import io
import pytest
words = []
with io.open('/usr/share/dict/words', 'r') as word_file:
words = word_file.readlines()
def test_init():
ht = HashTable()
assert len(ht.table) == 1024
ht2 = HashTable(10000)
assert len(ht2.table) == 10000
def test_hash():
... | Add tests for hash tablefrom hash_table import HashTable
import io
import pytest
words = []
with io.open('/usr/share/dict/words', 'r') as word_file:
words = word_file.readlines()
def test_init():
ht = HashTable()
assert len(ht.table) == 1024
ht2 = HashTable(10000)
assert len(ht2.table) == 10000... | <commit_before><commit_msg>Add tests for hash table<commit_after>from hash_table import HashTable
import io
import pytest
words = []
with io.open('/usr/share/dict/words', 'r') as word_file:
words = word_file.readlines()
def test_init():
ht = HashTable()
assert len(ht.table) == 1024
ht2 = HashTable(... | |
d42cc110c3da50a62b62acb6585d4eb1d4254d66 | examples/plot_sin_black_background.py | examples/plot_sin_black_background.py | # -*- coding: utf-8 -*-
"""
==================================================
Plotting simple sin function on a black background
==================================================
A simple example of the plot of a sin function on a black background
"""
# Code source: Loïc Estève
# License: BSD 3 clause
import nump... | Add plot with black background | Add plot with black background
in order to show the impact of commit d5a5507cd9d4b2ba4af0bf4cf42bbda043853cb5
| Python | bsd-3-clause | lesteve/sphinx-gallery,Eric89GXL/sphinx-gallery,Titan-C/sphinx-gallery,lesteve/sphinx-gallery,sphinx-gallery/sphinx-gallery,sphinx-gallery/sphinx-gallery,Titan-C/sphinx-gallery,Eric89GXL/sphinx-gallery | Add plot with black background
in order to show the impact of commit d5a5507cd9d4b2ba4af0bf4cf42bbda043853cb5 | # -*- coding: utf-8 -*-
"""
==================================================
Plotting simple sin function on a black background
==================================================
A simple example of the plot of a sin function on a black background
"""
# Code source: Loïc Estève
# License: BSD 3 clause
import nump... | <commit_before><commit_msg>Add plot with black background
in order to show the impact of commit d5a5507cd9d4b2ba4af0bf4cf42bbda043853cb5<commit_after> | # -*- coding: utf-8 -*-
"""
==================================================
Plotting simple sin function on a black background
==================================================
A simple example of the plot of a sin function on a black background
"""
# Code source: Loïc Estève
# License: BSD 3 clause
import nump... | Add plot with black background
in order to show the impact of commit d5a5507cd9d4b2ba4af0bf4cf42bbda043853cb5# -*- coding: utf-8 -*-
"""
==================================================
Plotting simple sin function on a black background
==================================================
A simple example of the plot... | <commit_before><commit_msg>Add plot with black background
in order to show the impact of commit d5a5507cd9d4b2ba4af0bf4cf42bbda043853cb5<commit_after># -*- coding: utf-8 -*-
"""
==================================================
Plotting simple sin function on a black background
=======================================... | |
fde5e4378030a5332f853b0af73ed9a86c384108 | connectors/fix_file_extensions.py | connectors/fix_file_extensions.py | import os
import subprocess
ROOT = 'e:\\'
def main():
total_renames = 0
for dir, dirs, files in os.walk(ROOT):
for f in files:
path = os.path.normpath(os.path.join(dir, f))
without_extension, fileExtension = os.path.splitext(path)
fileExtension = fileExtension.lower().lstrip('.')
... | Add script to fix file extensions from messed up windows import | Add script to fix file extensions from messed up windows import
| Python | mit | chuckhays/smugsync | Add script to fix file extensions from messed up windows import | import os
import subprocess
ROOT = 'e:\\'
def main():
total_renames = 0
for dir, dirs, files in os.walk(ROOT):
for f in files:
path = os.path.normpath(os.path.join(dir, f))
without_extension, fileExtension = os.path.splitext(path)
fileExtension = fileExtension.lower().lstrip('.')
... | <commit_before><commit_msg>Add script to fix file extensions from messed up windows import<commit_after> | import os
import subprocess
ROOT = 'e:\\'
def main():
total_renames = 0
for dir, dirs, files in os.walk(ROOT):
for f in files:
path = os.path.normpath(os.path.join(dir, f))
without_extension, fileExtension = os.path.splitext(path)
fileExtension = fileExtension.lower().lstrip('.')
... | Add script to fix file extensions from messed up windows importimport os
import subprocess
ROOT = 'e:\\'
def main():
total_renames = 0
for dir, dirs, files in os.walk(ROOT):
for f in files:
path = os.path.normpath(os.path.join(dir, f))
without_extension, fileExtension = os.path.splitext(path... | <commit_before><commit_msg>Add script to fix file extensions from messed up windows import<commit_after>import os
import subprocess
ROOT = 'e:\\'
def main():
total_renames = 0
for dir, dirs, files in os.walk(ROOT):
for f in files:
path = os.path.normpath(os.path.join(dir, f))
without_extensi... | |
937c337b35c36a91b7d153ca157b077e38641b0e | phyhlc/__init__.py | phyhlc/__init__.py | # encoding: UTF-8
"""
Physics and High-Level Controls library
.. moduleauthor:: Dylan Maxwell <maxwelld@frib.msu.edu>
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
# Configure the root logger w... | Add new top level package matching the repository name. | Add new top level package matching the repository name.
| Python | bsd-3-clause | archman/phantasy,archman/phantasy | Add new top level package matching the repository name. | # encoding: UTF-8
"""
Physics and High-Level Controls library
.. moduleauthor:: Dylan Maxwell <maxwelld@frib.msu.edu>
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
# Configure the root logger w... | <commit_before><commit_msg>Add new top level package matching the repository name.<commit_after> | # encoding: UTF-8
"""
Physics and High-Level Controls library
.. moduleauthor:: Dylan Maxwell <maxwelld@frib.msu.edu>
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
# Configure the root logger w... | Add new top level package matching the repository name.# encoding: UTF-8
"""
Physics and High-Level Controls library
.. moduleauthor:: Dylan Maxwell <maxwelld@frib.msu.edu>
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_... | <commit_before><commit_msg>Add new top level package matching the repository name.<commit_after># encoding: UTF-8
"""
Physics and High-Level Controls library
.. moduleauthor:: Dylan Maxwell <maxwelld@frib.msu.edu>
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolu... | |
ac36d66d7e25bbc0aa4dcef2ce364ca7aca841ea | lib/bridgedb/test/test_email_dkim.py | lib/bridgedb/test/test_email_dkim.py | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013, Isis Lovecruft
# (c) 2007-2013, The Tor Project, Inc.
# (c) 2007-201... | Add unittests for bridgedb.email.dkim module. | Add unittests for bridgedb.email.dkim module.
| Python | bsd-3-clause | pagea/bridgedb,pagea/bridgedb | Add unittests for bridgedb.email.dkim module. | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013, Isis Lovecruft
# (c) 2007-2013, The Tor Project, Inc.
# (c) 2007-201... | <commit_before><commit_msg>Add unittests for bridgedb.email.dkim module.<commit_after> | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013, Isis Lovecruft
# (c) 2007-2013, The Tor Project, Inc.
# (c) 2007-201... | Add unittests for bridgedb.email.dkim module.# -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013, Isis Lovecruft
# (c) 2007-2013, The... | <commit_before><commit_msg>Add unittests for bridgedb.email.dkim module.<commit_after># -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013, Isis L... | |
e04bdd9bc27c5c19e55cce98d2876403d9c7397d | ooni/tests/test_templates.py | ooni/tests/test_templates.py | from ooni.settings import config
from ooni.templates import httpt
from twisted.internet.error import DNSLookupError
from twisted.internet import reactor, defer
from twisted.trial import unittest
config.logging = False
class TestHTTPT(unittest.TestCase):
def setUp(self):
from twisted.web.resource import ... | Add unittests for the HTTP test template. | Add unittests for the HTTP test template.
| Python | bsd-2-clause | kdmurray91/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,kdmurray91/ooni... | Add unittests for the HTTP test template. | from ooni.settings import config
from ooni.templates import httpt
from twisted.internet.error import DNSLookupError
from twisted.internet import reactor, defer
from twisted.trial import unittest
config.logging = False
class TestHTTPT(unittest.TestCase):
def setUp(self):
from twisted.web.resource import ... | <commit_before><commit_msg>Add unittests for the HTTP test template.<commit_after> | from ooni.settings import config
from ooni.templates import httpt
from twisted.internet.error import DNSLookupError
from twisted.internet import reactor, defer
from twisted.trial import unittest
config.logging = False
class TestHTTPT(unittest.TestCase):
def setUp(self):
from twisted.web.resource import ... | Add unittests for the HTTP test template.from ooni.settings import config
from ooni.templates import httpt
from twisted.internet.error import DNSLookupError
from twisted.internet import reactor, defer
from twisted.trial import unittest
config.logging = False
class TestHTTPT(unittest.TestCase):
def setUp(self):
... | <commit_before><commit_msg>Add unittests for the HTTP test template.<commit_after>from ooni.settings import config
from ooni.templates import httpt
from twisted.internet.error import DNSLookupError
from twisted.internet import reactor, defer
from twisted.trial import unittest
config.logging = False
class TestHTTPT(... | |
e615855f6ea90e63df3eb2ff42f79afa0329ae01 | migrations/versions/dceb6cd3c41e_.py | migrations/versions/dceb6cd3c41e_.py | """Add policycondition table, remove unused condition column from policy table
Revision ID: dceb6cd3c41e
Revises: b9131d0686eb
Create Date: 2019-07-02 12:19:19.646528
"""
# revision identifiers, used by Alembic.
revision = 'dceb6cd3c41e'
down_revision = 'b9131d0686eb'
from alembic import op, context
import sqlalche... | Add migration script for policycondition table | Add migration script for policycondition table
| Python | agpl-3.0 | privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea | Add migration script for policycondition table | """Add policycondition table, remove unused condition column from policy table
Revision ID: dceb6cd3c41e
Revises: b9131d0686eb
Create Date: 2019-07-02 12:19:19.646528
"""
# revision identifiers, used by Alembic.
revision = 'dceb6cd3c41e'
down_revision = 'b9131d0686eb'
from alembic import op, context
import sqlalche... | <commit_before><commit_msg>Add migration script for policycondition table<commit_after> | """Add policycondition table, remove unused condition column from policy table
Revision ID: dceb6cd3c41e
Revises: b9131d0686eb
Create Date: 2019-07-02 12:19:19.646528
"""
# revision identifiers, used by Alembic.
revision = 'dceb6cd3c41e'
down_revision = 'b9131d0686eb'
from alembic import op, context
import sqlalche... | Add migration script for policycondition table"""Add policycondition table, remove unused condition column from policy table
Revision ID: dceb6cd3c41e
Revises: b9131d0686eb
Create Date: 2019-07-02 12:19:19.646528
"""
# revision identifiers, used by Alembic.
revision = 'dceb6cd3c41e'
down_revision = 'b9131d0686eb'
f... | <commit_before><commit_msg>Add migration script for policycondition table<commit_after>"""Add policycondition table, remove unused condition column from policy table
Revision ID: dceb6cd3c41e
Revises: b9131d0686eb
Create Date: 2019-07-02 12:19:19.646528
"""
# revision identifiers, used by Alembic.
revision = 'dceb6c... | |
805c8a597a57c21ad2c3fb32b313450484d1cde7 | Runtime/test_Utils.py | Runtime/test_Utils.py | """Test package for Utils.py."""
import unittest
import Utils
class TestUtils(unittest.TestCase):
"""Test cases for the Utils."""
def test_tree(self):
"""Test the tree method."""
t = Utils.tree()
t["hello"] = 3
t["foo"]["bar"] = 42
self.assertEqual(t["hello"], 3)
... | Add unit test for Utils.py | Add unit test for Utils.py
| Python | mit | lnsp/tea,lnsp/tea | Add unit test for Utils.py | """Test package for Utils.py."""
import unittest
import Utils
class TestUtils(unittest.TestCase):
"""Test cases for the Utils."""
def test_tree(self):
"""Test the tree method."""
t = Utils.tree()
t["hello"] = 3
t["foo"]["bar"] = 42
self.assertEqual(t["hello"], 3)
... | <commit_before><commit_msg>Add unit test for Utils.py<commit_after> | """Test package for Utils.py."""
import unittest
import Utils
class TestUtils(unittest.TestCase):
"""Test cases for the Utils."""
def test_tree(self):
"""Test the tree method."""
t = Utils.tree()
t["hello"] = 3
t["foo"]["bar"] = 42
self.assertEqual(t["hello"], 3)
... | Add unit test for Utils.py"""Test package for Utils.py."""
import unittest
import Utils
class TestUtils(unittest.TestCase):
"""Test cases for the Utils."""
def test_tree(self):
"""Test the tree method."""
t = Utils.tree()
t["hello"] = 3
t["foo"]["bar"] = 42
self.assert... | <commit_before><commit_msg>Add unit test for Utils.py<commit_after>"""Test package for Utils.py."""
import unittest
import Utils
class TestUtils(unittest.TestCase):
"""Test cases for the Utils."""
def test_tree(self):
"""Test the tree method."""
t = Utils.tree()
t["hello"] = 3
... | |
a99a1bad2d7281a172369c8792c05a1c429a3296 | examples/translations/dutch_test_1.py | examples/translations/dutch_test_1.py | # Dutch Language Test
from seleniumbase.translate.dutch import Testgeval
class MijnTestklasse(Testgeval):
def test_voorbeeld_1(self):
self.url_openen("https://nl.wikipedia.org/wiki/Hoofdpagina")
self.controleren_element('a[title*="hoofdpagina gaan"]')
self.controleren_tekst("Welkom op Wik... | Add a SeleniumBase test in Dutch | Add a SeleniumBase test in Dutch
| Python | mit | seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | Add a SeleniumBase test in Dutch | # Dutch Language Test
from seleniumbase.translate.dutch import Testgeval
class MijnTestklasse(Testgeval):
def test_voorbeeld_1(self):
self.url_openen("https://nl.wikipedia.org/wiki/Hoofdpagina")
self.controleren_element('a[title*="hoofdpagina gaan"]')
self.controleren_tekst("Welkom op Wik... | <commit_before><commit_msg>Add a SeleniumBase test in Dutch<commit_after> | # Dutch Language Test
from seleniumbase.translate.dutch import Testgeval
class MijnTestklasse(Testgeval):
def test_voorbeeld_1(self):
self.url_openen("https://nl.wikipedia.org/wiki/Hoofdpagina")
self.controleren_element('a[title*="hoofdpagina gaan"]')
self.controleren_tekst("Welkom op Wik... | Add a SeleniumBase test in Dutch# Dutch Language Test
from seleniumbase.translate.dutch import Testgeval
class MijnTestklasse(Testgeval):
def test_voorbeeld_1(self):
self.url_openen("https://nl.wikipedia.org/wiki/Hoofdpagina")
self.controleren_element('a[title*="hoofdpagina gaan"]')
self.... | <commit_before><commit_msg>Add a SeleniumBase test in Dutch<commit_after># Dutch Language Test
from seleniumbase.translate.dutch import Testgeval
class MijnTestklasse(Testgeval):
def test_voorbeeld_1(self):
self.url_openen("https://nl.wikipedia.org/wiki/Hoofdpagina")
self.controleren_element('a[t... | |
8b2ff178c7a4fdd9af536e3c92a7e5edb05b21e0 | docs/other/fix_notebook_html_colour.py | docs/other/fix_notebook_html_colour.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A script to re-enable colour in .html files produced from IPython notebooks.
Based on a script in a GitHub gist with this copyright notice:
#----------------------------------------------------------------------------
# Copyright (c) 2013 - Damián Avila
#
# Distribu... | Add a script to enable colour in HTML produced from IPython notebooks | Add a script to enable colour in HTML produced from IPython notebooks
| Python | mit | krischer/python-future,PythonCharmers/python-future,michaelpacer/python-future,krischer/python-future,michaelpacer/python-future,QuLogic/python-future,PythonCharmers/python-future,QuLogic/python-future | Add a script to enable colour in HTML produced from IPython notebooks | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A script to re-enable colour in .html files produced from IPython notebooks.
Based on a script in a GitHub gist with this copyright notice:
#----------------------------------------------------------------------------
# Copyright (c) 2013 - Damián Avila
#
# Distribu... | <commit_before><commit_msg>Add a script to enable colour in HTML produced from IPython notebooks<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A script to re-enable colour in .html files produced from IPython notebooks.
Based on a script in a GitHub gist with this copyright notice:
#----------------------------------------------------------------------------
# Copyright (c) 2013 - Damián Avila
#
# Distribu... | Add a script to enable colour in HTML produced from IPython notebooks#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A script to re-enable colour in .html files produced from IPython notebooks.
Based on a script in a GitHub gist with this copyright notice:
#--------------------------------------------------------... | <commit_before><commit_msg>Add a script to enable colour in HTML produced from IPython notebooks<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A script to re-enable colour in .html files produced from IPython notebooks.
Based on a script in a GitHub gist with this copyright notice:
#---------------... | |
0566599ded67ea6337a3ee4a99b592de571d2fa6 | WebSphere/cfgVersionStamp.py | WebSphere/cfgVersionStamp.py | # cfgVersionStamp.py
# Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
#
# History:
# 20140415 Christoph Stoettner Initial Version
print "\nSet Version Stamp in LotusConnections-config.xml to actual Date and Time\n"
path = raw_input( "Path and Folder where config is temporarily stored: " )
... | Add new script for version stamp | Add new script for version stamp
| Python | apache-2.0 | stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting | Add new script for version stamp | # cfgVersionStamp.py
# Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
#
# History:
# 20140415 Christoph Stoettner Initial Version
print "\nSet Version Stamp in LotusConnections-config.xml to actual Date and Time\n"
path = raw_input( "Path and Folder where config is temporarily stored: " )
... | <commit_before><commit_msg>Add new script for version stamp<commit_after> | # cfgVersionStamp.py
# Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
#
# History:
# 20140415 Christoph Stoettner Initial Version
print "\nSet Version Stamp in LotusConnections-config.xml to actual Date and Time\n"
path = raw_input( "Path and Folder where config is temporarily stored: " )
... | Add new script for version stamp# cfgVersionStamp.py
# Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
#
# History:
# 20140415 Christoph Stoettner Initial Version
print "\nSet Version Stamp in LotusConnections-config.xml to actual Date and Time\n"
path = raw_input( "Path and Folder where con... | <commit_before><commit_msg>Add new script for version stamp<commit_after># cfgVersionStamp.py
# Author: Christoph Stoettner
# E-Mail: christoph.stoettner@stoeps.de
#
# History:
# 20140415 Christoph Stoettner Initial Version
print "\nSet Version Stamp in LotusConnections-config.xml to actual Date and Time\n"
pat... | |
7bf5471e0cffadf0cc50b67b590398bb2a413725 | benchmarks/parse.py | benchmarks/parse.py | #!/usr/bin/env python
import json, sys, time
count = int(sys.argv[1])
for n in sys.argv[2:]:
print '%s:' % n
start = time.time()
fp = open(n)
for i in xrange(count):
fp.seek(0)
val = json.load(fp)
end = time.time()
print ' ', end - start
| Add a Python json benchmark. | Add a Python json benchmark.
Alas, it's about 3x faster than us, due to being written in C.
| Python | bsd-3-clause | timmytofu/aeson,lpsmith/aeson | Add a Python json benchmark.
Alas, it's about 3x faster than us, due to being written in C. | #!/usr/bin/env python
import json, sys, time
count = int(sys.argv[1])
for n in sys.argv[2:]:
print '%s:' % n
start = time.time()
fp = open(n)
for i in xrange(count):
fp.seek(0)
val = json.load(fp)
end = time.time()
print ' ', end - start
| <commit_before><commit_msg>Add a Python json benchmark.
Alas, it's about 3x faster than us, due to being written in C.<commit_after> | #!/usr/bin/env python
import json, sys, time
count = int(sys.argv[1])
for n in sys.argv[2:]:
print '%s:' % n
start = time.time()
fp = open(n)
for i in xrange(count):
fp.seek(0)
val = json.load(fp)
end = time.time()
print ' ', end - start
| Add a Python json benchmark.
Alas, it's about 3x faster than us, due to being written in C.#!/usr/bin/env python
import json, sys, time
count = int(sys.argv[1])
for n in sys.argv[2:]:
print '%s:' % n
start = time.time()
fp = open(n)
for i in xrange(count):
fp.seek(0)
val = json.load(... | <commit_before><commit_msg>Add a Python json benchmark.
Alas, it's about 3x faster than us, due to being written in C.<commit_after>#!/usr/bin/env python
import json, sys, time
count = int(sys.argv[1])
for n in sys.argv[2:]:
print '%s:' % n
start = time.time()
fp = open(n)
for i in xrange(count):
... | |
67a76f74ebd535a283da8eebb06c6811e9249ace | mda/db.py | mda/db.py | from sqlalchemy import create_engine
from sqlalchemy_utils.functions import create_database
from docker import Client
from docker.utils import create_host_config
class Database():
def __init__(self):
db_port = 5432
proxy_port = 5432
self.db_name = 'db'
self.proxy_name = 'db_pro... | Create docker Postgresql DB and proxy for testing with SQLAlchemy | Create docker Postgresql DB and proxy for testing with SQLAlchemy
| Python | apache-2.0 | mattmcd/PyAnalysis | Create docker Postgresql DB and proxy for testing with SQLAlchemy | from sqlalchemy import create_engine
from sqlalchemy_utils.functions import create_database
from docker import Client
from docker.utils import create_host_config
class Database():
def __init__(self):
db_port = 5432
proxy_port = 5432
self.db_name = 'db'
self.proxy_name = 'db_pro... | <commit_before><commit_msg>Create docker Postgresql DB and proxy for testing with SQLAlchemy<commit_after> | from sqlalchemy import create_engine
from sqlalchemy_utils.functions import create_database
from docker import Client
from docker.utils import create_host_config
class Database():
def __init__(self):
db_port = 5432
proxy_port = 5432
self.db_name = 'db'
self.proxy_name = 'db_pro... | Create docker Postgresql DB and proxy for testing with SQLAlchemyfrom sqlalchemy import create_engine
from sqlalchemy_utils.functions import create_database
from docker import Client
from docker.utils import create_host_config
class Database():
def __init__(self):
db_port = 5432
proxy_port = 5... | <commit_before><commit_msg>Create docker Postgresql DB and proxy for testing with SQLAlchemy<commit_after>from sqlalchemy import create_engine
from sqlalchemy_utils.functions import create_database
from docker import Client
from docker.utils import create_host_config
class Database():
def __init__(self):
... | |
e3079745f37ff84b1be5511986b30d3ca285c15f | toyplot/qt.py | toyplot/qt.py | # Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
# Note: we prefer PyQt5 only because we've had issues embedding our HTML output
# with specific versions (Qt 4.8.7 on a Mac) of QWebView. Otherw... | Add an experimental backend to display figures in a standalone Qt window. | Add an experimental backend to display figures in a standalone Qt window.
| Python | bsd-3-clause | cmorgan/toyplot,cmorgan/toyplot | Add an experimental backend to display figures in a standalone Qt window. | # Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
# Note: we prefer PyQt5 only because we've had issues embedding our HTML output
# with specific versions (Qt 4.8.7 on a Mac) of QWebView. Otherw... | <commit_before><commit_msg>Add an experimental backend to display figures in a standalone Qt window.<commit_after> | # Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
# Note: we prefer PyQt5 only because we've had issues embedding our HTML output
# with specific versions (Qt 4.8.7 on a Mac) of QWebView. Otherw... | Add an experimental backend to display figures in a standalone Qt window.# Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
# Note: we prefer PyQt5 only because we've had issues embedding our HTML... | <commit_before><commit_msg>Add an experimental backend to display figures in a standalone Qt window.<commit_after># Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
# Note: we prefer PyQt5 only be... | |
c9205c0ef75a34e608594a3ef1b733e8a38fdd1a | command-line-template.py | command-line-template.py | from __future__ import print_function
import os
import sys
import argparse
def main(arguments):
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('infile', help="Input file", type=argparse.FileType('r'))
parser... | Add command line app example | Add command line app example | Python | mit | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | Add command line app example | from __future__ import print_function
import os
import sys
import argparse
def main(arguments):
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('infile', help="Input file", type=argparse.FileType('r'))
parser... | <commit_before><commit_msg>Add command line app example<commit_after> | from __future__ import print_function
import os
import sys
import argparse
def main(arguments):
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('infile', help="Input file", type=argparse.FileType('r'))
parser... | Add command line app examplefrom __future__ import print_function
import os
import sys
import argparse
def main(arguments):
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('infile', help="Input file", type=argpar... | <commit_before><commit_msg>Add command line app example<commit_after>from __future__ import print_function
import os
import sys
import argparse
def main(arguments):
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument... | |
d73902fb9fde6e4dac8ed856bf0bf368d3599134 | test_lxml.py | test_lxml.py | #!/usr/bin/python
import datetime as dt
import numpy as np
import pandas as pd
from lxml import etree
# test the lxml package in comparision to the standard ElementTree pkg
from crocus_forcing_nc import populate_forcing_nc
# try:
# import xml.etree.cElementTree as ET
# except ImportError:
# import xml.etre... | Use lxml instead of ET | Use lxml instead of ET
| Python | mit | kmunve/TSanalysis,kmunve/TSanalysis,kmunve/TSanalysis | Use lxml instead of ET | #!/usr/bin/python
import datetime as dt
import numpy as np
import pandas as pd
from lxml import etree
# test the lxml package in comparision to the standard ElementTree pkg
from crocus_forcing_nc import populate_forcing_nc
# try:
# import xml.etree.cElementTree as ET
# except ImportError:
# import xml.etre... | <commit_before><commit_msg>Use lxml instead of ET<commit_after> | #!/usr/bin/python
import datetime as dt
import numpy as np
import pandas as pd
from lxml import etree
# test the lxml package in comparision to the standard ElementTree pkg
from crocus_forcing_nc import populate_forcing_nc
# try:
# import xml.etree.cElementTree as ET
# except ImportError:
# import xml.etre... | Use lxml instead of ET#!/usr/bin/python
import datetime as dt
import numpy as np
import pandas as pd
from lxml import etree
# test the lxml package in comparision to the standard ElementTree pkg
from crocus_forcing_nc import populate_forcing_nc
# try:
# import xml.etree.cElementTree as ET
# except ImportError:... | <commit_before><commit_msg>Use lxml instead of ET<commit_after>#!/usr/bin/python
import datetime as dt
import numpy as np
import pandas as pd
from lxml import etree
# test the lxml package in comparision to the standard ElementTree pkg
from crocus_forcing_nc import populate_forcing_nc
# try:
# import xml.etree... | |
96616feb46dc8342f742bc63f075477dc1b325e6 | modules/data_generator.py | modules/data_generator.py | from __future__ import print_function
import requests
import json
class Table(object):
def __init__(self, x, y, width, height, name):
self.name = name
self.position_x = x
self.position_y = y
self.width = width
self.height = height
def json(self):
return json.dum... | Add generator for tables plus SLIP room config | Add generator for tables plus SLIP room config
| Python | mit | bleepr/bleepr-manage,bleepr/bleepr-manage | Add generator for tables plus SLIP room config | from __future__ import print_function
import requests
import json
class Table(object):
def __init__(self, x, y, width, height, name):
self.name = name
self.position_x = x
self.position_y = y
self.width = width
self.height = height
def json(self):
return json.dum... | <commit_before><commit_msg>Add generator for tables plus SLIP room config<commit_after> | from __future__ import print_function
import requests
import json
class Table(object):
def __init__(self, x, y, width, height, name):
self.name = name
self.position_x = x
self.position_y = y
self.width = width
self.height = height
def json(self):
return json.dum... | Add generator for tables plus SLIP room configfrom __future__ import print_function
import requests
import json
class Table(object):
def __init__(self, x, y, width, height, name):
self.name = name
self.position_x = x
self.position_y = y
self.width = width
self.height = heigh... | <commit_before><commit_msg>Add generator for tables plus SLIP room config<commit_after>from __future__ import print_function
import requests
import json
class Table(object):
def __init__(self, x, y, width, height, name):
self.name = name
self.position_x = x
self.position_y = y
self.... | |
4ff9ac54cdcc5ed4fb63dfe2b8913c656464b0c7 | pitchfork/context_functions.py | pitchfork/context_functions.py |
import re
def utility_processor():
def unslug(string):
return re.sub('_', ' ', string)
def parse_field_data(value):
choices = re.sub('\r\n', ',', value)
return choices.split(',')
def slugify(data):
temp_string = re.sub(' +', ' ', str(data.strip()))
return re.sub(... | Move utility processors out of init file | Move utility processors out of init file
| Python | apache-2.0 | rackerlabs/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork,oldarmyc/pitchfork,oldarmyc/pitchfork,rackerlabs/pitchfork | Move utility processors out of init file |
import re
def utility_processor():
def unslug(string):
return re.sub('_', ' ', string)
def parse_field_data(value):
choices = re.sub('\r\n', ',', value)
return choices.split(',')
def slugify(data):
temp_string = re.sub(' +', ' ', str(data.strip()))
return re.sub(... | <commit_before><commit_msg>Move utility processors out of init file<commit_after> |
import re
def utility_processor():
def unslug(string):
return re.sub('_', ' ', string)
def parse_field_data(value):
choices = re.sub('\r\n', ',', value)
return choices.split(',')
def slugify(data):
temp_string = re.sub(' +', ' ', str(data.strip()))
return re.sub(... | Move utility processors out of init file
import re
def utility_processor():
def unslug(string):
return re.sub('_', ' ', string)
def parse_field_data(value):
choices = re.sub('\r\n', ',', value)
return choices.split(',')
def slugify(data):
temp_string = re.sub(' +', ' ', s... | <commit_before><commit_msg>Move utility processors out of init file<commit_after>
import re
def utility_processor():
def unslug(string):
return re.sub('_', ' ', string)
def parse_field_data(value):
choices = re.sub('\r\n', ',', value)
return choices.split(',')
def slugify(data):
... | |
e2dd78c608660545529f63f82c7209b2f49eb5a7 | tests/test_compile_samples.py | tests/test_compile_samples.py | import os.path
import pytest
import rain.compiler as C
def ls(*path):
path = os.path.join(*path)
for file in os.listdir(path):
yield os.path.join(path, file)
def lsrn(*path, recurse=False):
for file in ls(*path):
if os.path.isfile(file) and file.endswith('.rn') and not file.endswith('_pkg.rn'):
yi... | Add compilation tests for all samples | tests: Add compilation tests for all samples
| Python | mit | scizzorz/rain,philipdexter/rain,scizzorz/rain,scizzorz/rain,philipdexter/rain,philipdexter/rain,scizzorz/rain,philipdexter/rain | tests: Add compilation tests for all samples | import os.path
import pytest
import rain.compiler as C
def ls(*path):
path = os.path.join(*path)
for file in os.listdir(path):
yield os.path.join(path, file)
def lsrn(*path, recurse=False):
for file in ls(*path):
if os.path.isfile(file) and file.endswith('.rn') and not file.endswith('_pkg.rn'):
yi... | <commit_before><commit_msg>tests: Add compilation tests for all samples<commit_after> | import os.path
import pytest
import rain.compiler as C
def ls(*path):
path = os.path.join(*path)
for file in os.listdir(path):
yield os.path.join(path, file)
def lsrn(*path, recurse=False):
for file in ls(*path):
if os.path.isfile(file) and file.endswith('.rn') and not file.endswith('_pkg.rn'):
yi... | tests: Add compilation tests for all samplesimport os.path
import pytest
import rain.compiler as C
def ls(*path):
path = os.path.join(*path)
for file in os.listdir(path):
yield os.path.join(path, file)
def lsrn(*path, recurse=False):
for file in ls(*path):
if os.path.isfile(file) and file.endswith('.rn'... | <commit_before><commit_msg>tests: Add compilation tests for all samples<commit_after>import os.path
import pytest
import rain.compiler as C
def ls(*path):
path = os.path.join(*path)
for file in os.listdir(path):
yield os.path.join(path, file)
def lsrn(*path, recurse=False):
for file in ls(*path):
if os.... | |
ee44a827787cc66b64b6507601adc374e0b087de | examples/ctf_demo.py | examples/ctf_demo.py | """
This demonstrates the `CtfEditor` widget.
To use: right-click in the window to bring up a context menu. Once you've added
a color or opacity, you can drag them around by just clicking on them. The
colors at the end points are editable, but cannot be removed.
"""
from traits.etsconfig.api import ETSConfig
ETSConf... | Add a demo script for the CtfEditor. | Add a demo script for the CtfEditor.
| Python | bsd-3-clause | dmsurti/ensemble | Add a demo script for the CtfEditor. | """
This demonstrates the `CtfEditor` widget.
To use: right-click in the window to bring up a context menu. Once you've added
a color or opacity, you can drag them around by just clicking on them. The
colors at the end points are editable, but cannot be removed.
"""
from traits.etsconfig.api import ETSConfig
ETSConf... | <commit_before><commit_msg>Add a demo script for the CtfEditor.<commit_after> | """
This demonstrates the `CtfEditor` widget.
To use: right-click in the window to bring up a context menu. Once you've added
a color or opacity, you can drag them around by just clicking on them. The
colors at the end points are editable, but cannot be removed.
"""
from traits.etsconfig.api import ETSConfig
ETSConf... | Add a demo script for the CtfEditor."""
This demonstrates the `CtfEditor` widget.
To use: right-click in the window to bring up a context menu. Once you've added
a color or opacity, you can drag them around by just clicking on them. The
colors at the end points are editable, but cannot be removed.
"""
from traits.et... | <commit_before><commit_msg>Add a demo script for the CtfEditor.<commit_after>"""
This demonstrates the `CtfEditor` widget.
To use: right-click in the window to bring up a context menu. Once you've added
a color or opacity, you can drag them around by just clicking on them. The
colors at the end points are editable, bu... | |
7ce77190028a55bf79f4fe7cbe9c5e7448422a8d | duplicate_questions/data/make_dataset.py | duplicate_questions/data/make_dataset.py | # -*- coding: utf-8 -*-
import os
import click
import logging
from dotenv import find_dotenv, load_dotenv
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.argument('output_filepath', type=click.Path())
def main(input_filepath, output_filepath):
""" Runs data processing scrip... | Add temporary file for dataset creation code | Add temporary file for dataset creation code
| Python | mit | nelson-liu/paraphrase-id-tensorflow,nelson-liu/paraphrase-id-tensorflow | Add temporary file for dataset creation code | # -*- coding: utf-8 -*-
import os
import click
import logging
from dotenv import find_dotenv, load_dotenv
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.argument('output_filepath', type=click.Path())
def main(input_filepath, output_filepath):
""" Runs data processing scrip... | <commit_before><commit_msg>Add temporary file for dataset creation code<commit_after> | # -*- coding: utf-8 -*-
import os
import click
import logging
from dotenv import find_dotenv, load_dotenv
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.argument('output_filepath', type=click.Path())
def main(input_filepath, output_filepath):
""" Runs data processing scrip... | Add temporary file for dataset creation code# -*- coding: utf-8 -*-
import os
import click
import logging
from dotenv import find_dotenv, load_dotenv
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.argument('output_filepath', type=click.Path())
def main(input_filepath, output_f... | <commit_before><commit_msg>Add temporary file for dataset creation code<commit_after># -*- coding: utf-8 -*-
import os
import click
import logging
from dotenv import find_dotenv, load_dotenv
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.argument('output_filepath', type=click.... | |
1ac9e6ccaae2086079f3db8cc7d061e54b0ecc7f | openquake/baselib/utf8.py | openquake/baselib/utf8.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... | Add an UTF-8 helper which overloads print() | Add an UTF-8 helper which overloads print()
| Python | agpl-3.0 | gem/oq-engine,gem/oq-engine,gem/oq-hazardlib,gem/oq-engine,gem/oq-engine,gem/oq-hazardlib,gem/oq-hazardlib,gem/oq-engine | Add an UTF-8 helper which overloads print() | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... | <commit_before><commit_msg>Add an UTF-8 helper which overloads print()<commit_after> | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... | Add an UTF-8 helper which overloads print()# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Fou... | <commit_before><commit_msg>Add an UTF-8 helper which overloads print()<commit_after># -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public Licens... | |
f876c410ab39bd348f79ed2a256c09edd4225c56 | odo/backends/tests/test_dask_array.py | odo/backends/tests/test_dask_array.py | from __future__ import absolute_import, division, print_function
from odo.backends.dask_array import append, Array, merge
from dask.array.core import insert_to_ooc
from dask import core
from odo import convert, into
from odo.utils import tmpfile
import numpy as np
import bcolz
def eq(a, b):
c = a == b
if isi... | Migrate tests for dask array conversions from dask package. | Migrate tests for dask array conversions from dask package.
| Python | bsd-3-clause | Dannnno/odo,Dannnno/odo,ywang007/odo,ContinuumIO/odo,ContinuumIO/odo,ywang007/odo,cpcloud/odo,blaze/odo,cowlicks/odo,blaze/odo,alexmojaki/odo,quantopian/odo,alexmojaki/odo,cpcloud/odo,cowlicks/odo,quantopian/odo | Migrate tests for dask array conversions from dask package. | from __future__ import absolute_import, division, print_function
from odo.backends.dask_array import append, Array, merge
from dask.array.core import insert_to_ooc
from dask import core
from odo import convert, into
from odo.utils import tmpfile
import numpy as np
import bcolz
def eq(a, b):
c = a == b
if isi... | <commit_before><commit_msg>Migrate tests for dask array conversions from dask package.<commit_after> | from __future__ import absolute_import, division, print_function
from odo.backends.dask_array import append, Array, merge
from dask.array.core import insert_to_ooc
from dask import core
from odo import convert, into
from odo.utils import tmpfile
import numpy as np
import bcolz
def eq(a, b):
c = a == b
if isi... | Migrate tests for dask array conversions from dask package.from __future__ import absolute_import, division, print_function
from odo.backends.dask_array import append, Array, merge
from dask.array.core import insert_to_ooc
from dask import core
from odo import convert, into
from odo.utils import tmpfile
import numpy a... | <commit_before><commit_msg>Migrate tests for dask array conversions from dask package.<commit_after>from __future__ import absolute_import, division, print_function
from odo.backends.dask_array import append, Array, merge
from dask.array.core import insert_to_ooc
from dask import core
from odo import convert, into
fro... | |
264bd5630c634fd37343cf5ade506aa3447f4751 | ftfy/test_unicode.py | ftfy/test_unicode.py | # -*- coding: utf-8 -*-
from ftfy import fix_bad_encoding, WINDOWS_1252_GREMLINS
import unicodedata
# Most single-character strings which have been misencoded should be restored.
def test_all_bmp_characters():
for index in xrange(0xa0, 0xfffd):
char = unichr(index)
# Exclude code points that are no... | Move this test from metanl. | Move this test from metanl.
| Python | mit | LuminosoInsight/python-ftfy | Move this test from metanl. | # -*- coding: utf-8 -*-
from ftfy import fix_bad_encoding, WINDOWS_1252_GREMLINS
import unicodedata
# Most single-character strings which have been misencoded should be restored.
def test_all_bmp_characters():
for index in xrange(0xa0, 0xfffd):
char = unichr(index)
# Exclude code points that are no... | <commit_before><commit_msg>Move this test from metanl.<commit_after> | # -*- coding: utf-8 -*-
from ftfy import fix_bad_encoding, WINDOWS_1252_GREMLINS
import unicodedata
# Most single-character strings which have been misencoded should be restored.
def test_all_bmp_characters():
for index in xrange(0xa0, 0xfffd):
char = unichr(index)
# Exclude code points that are no... | Move this test from metanl.# -*- coding: utf-8 -*-
from ftfy import fix_bad_encoding, WINDOWS_1252_GREMLINS
import unicodedata
# Most single-character strings which have been misencoded should be restored.
def test_all_bmp_characters():
for index in xrange(0xa0, 0xfffd):
char = unichr(index)
# Excl... | <commit_before><commit_msg>Move this test from metanl.<commit_after># -*- coding: utf-8 -*-
from ftfy import fix_bad_encoding, WINDOWS_1252_GREMLINS
import unicodedata
# Most single-character strings which have been misencoded should be restored.
def test_all_bmp_characters():
for index in xrange(0xa0, 0xfffd):
... | |
dbfef6d04bdb8031a5f47e27e1370dfa6b797e71 | python/uglyNumberII.py | python/uglyNumberII.py | # https://leetcode.com/problems/ugly-number-ii/
class Solution(object):
def nthUglyNumber(self, n):
"""
:type n: int
:rtype: int
"""
ugly = [1] * n
i2 = i3 = i5 = -1
x = v2 = v3 = v5 = 1
for k in xrange(n):
x = min(v2, v3, v5)
... | Add Problem Ugly Number II | Add Problem Ugly Number II
| Python | mit | guozengxin/myleetcode,guozengxin/myleetcode | Add Problem Ugly Number II | # https://leetcode.com/problems/ugly-number-ii/
class Solution(object):
def nthUglyNumber(self, n):
"""
:type n: int
:rtype: int
"""
ugly = [1] * n
i2 = i3 = i5 = -1
x = v2 = v3 = v5 = 1
for k in xrange(n):
x = min(v2, v3, v5)
... | <commit_before><commit_msg>Add Problem Ugly Number II<commit_after> | # https://leetcode.com/problems/ugly-number-ii/
class Solution(object):
def nthUglyNumber(self, n):
"""
:type n: int
:rtype: int
"""
ugly = [1] * n
i2 = i3 = i5 = -1
x = v2 = v3 = v5 = 1
for k in xrange(n):
x = min(v2, v3, v5)
... | Add Problem Ugly Number II# https://leetcode.com/problems/ugly-number-ii/
class Solution(object):
def nthUglyNumber(self, n):
"""
:type n: int
:rtype: int
"""
ugly = [1] * n
i2 = i3 = i5 = -1
x = v2 = v3 = v5 = 1
for k in xrange(n):
x = mi... | <commit_before><commit_msg>Add Problem Ugly Number II<commit_after># https://leetcode.com/problems/ugly-number-ii/
class Solution(object):
def nthUglyNumber(self, n):
"""
:type n: int
:rtype: int
"""
ugly = [1] * n
i2 = i3 = i5 = -1
x = v2 = v3 = v5 = 1
... | |
46a060666997df718b4072a6ed3ef93dbedb6107 | djangae/settings_base.py | djangae/settings_base.py |
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.backends.appengin... |
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.backends.appengin... | Make sure ALLOWED_HOSTS is correctly set | Make sure ALLOWED_HOSTS is correctly set
| Python | bsd-3-clause | pablorecio/djangae,martinogden/djangae,jscissr/djangae,chargrizzle/djangae,potatolondon/djangae,martinogden/djangae,armirusco/djangae,trik/djangae,asendecka/djangae,leekchan/djangae,stucox/djangae,b-cannon/my_djae,trik/djangae,SiPiggles/djangae,potatolondon/djangae,nealedj/djangae,stucox/djangae,kirberich/djangae,jscis... |
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.backends.appengin... |
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.backends.appengin... | <commit_before>
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.ba... |
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.backends.appengin... |
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.backends.appengin... | <commit_before>
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'
FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024
FILE_UPLOAD_HANDLERS = (
'djangae.storage.BlobstoreFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler',
)
DATABASES = {
'default': {
'ENGINE': 'djangae.db.ba... |
6d65c54483ff572c849aa984c4ff8071c610cfeb | bin/switch-country.py | bin/switch-country.py | #!/usr/bin/env python
# coding=UTF-8
# If you have a standard Mzalendo setup (see below) and need to switch
# between developing for different countries, this script can be
# useful for making that switch simply. It assumes that you have the
# following directory hierarchy, config files and symlinks set up:
#
# .
# ├... | Add a help script to help switching between countries | Add a help script to help switching between countries
This may be useful for people using one copy for
development who have to switch between working on
different countries.
| Python | agpl-3.0 | hzj123/56th,hzj123/56th,mysociety/pombola,patricmutwiri/pombola,ken-muturi/pombola,mysociety/pombola,ken-muturi/pombola,patricmutwiri/pombola,hzj123/56th,geoffkilpin/pombola,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,ken-muturi/pombola,geoffkil... | Add a help script to help switching between countries
This may be useful for people using one copy for
development who have to switch between working on
different countries. | #!/usr/bin/env python
# coding=UTF-8
# If you have a standard Mzalendo setup (see below) and need to switch
# between developing for different countries, this script can be
# useful for making that switch simply. It assumes that you have the
# following directory hierarchy, config files and symlinks set up:
#
# .
# ├... | <commit_before><commit_msg>Add a help script to help switching between countries
This may be useful for people using one copy for
development who have to switch between working on
different countries.<commit_after> | #!/usr/bin/env python
# coding=UTF-8
# If you have a standard Mzalendo setup (see below) and need to switch
# between developing for different countries, this script can be
# useful for making that switch simply. It assumes that you have the
# following directory hierarchy, config files and symlinks set up:
#
# .
# ├... | Add a help script to help switching between countries
This may be useful for people using one copy for
development who have to switch between working on
different countries.#!/usr/bin/env python
# coding=UTF-8
# If you have a standard Mzalendo setup (see below) and need to switch
# between developing for different co... | <commit_before><commit_msg>Add a help script to help switching between countries
This may be useful for people using one copy for
development who have to switch between working on
different countries.<commit_after>#!/usr/bin/env python
# coding=UTF-8
# If you have a standard Mzalendo setup (see below) and need to swi... | |
6eed00668f5510a6d8590ae89befba8814025f31 | sunburnt/json.py | sunburnt/json.py | from __future__ import absolute_import
import json, math
from .schema import SolrResponse, SolrResult
class SunburntJSONEncoder(json.JSONEncoder):
def encode(self, o):
if isinstance(o, SolrResponse):
return self.encode(list(o))
return super(SunburntJSONEncoder, self).encode(o)
... | Add experimental JSON output module | Add experimental JSON output module
| Python | mit | rlskoeser/sunburnt,qmssof/sunburnt,anmar/sunburnt,pixbuffer/sunburnt-spatial,pixbuffer/sunburnt-spatial,tow/sunburnt,rlskoeser/sunburnt,anmar/sunburnt | Add experimental JSON output module | from __future__ import absolute_import
import json, math
from .schema import SolrResponse, SolrResult
class SunburntJSONEncoder(json.JSONEncoder):
def encode(self, o):
if isinstance(o, SolrResponse):
return self.encode(list(o))
return super(SunburntJSONEncoder, self).encode(o)
... | <commit_before><commit_msg>Add experimental JSON output module<commit_after> | from __future__ import absolute_import
import json, math
from .schema import SolrResponse, SolrResult
class SunburntJSONEncoder(json.JSONEncoder):
def encode(self, o):
if isinstance(o, SolrResponse):
return self.encode(list(o))
return super(SunburntJSONEncoder, self).encode(o)
... | Add experimental JSON output modulefrom __future__ import absolute_import
import json, math
from .schema import SolrResponse, SolrResult
class SunburntJSONEncoder(json.JSONEncoder):
def encode(self, o):
if isinstance(o, SolrResponse):
return self.encode(list(o))
return super(Sunburnt... | <commit_before><commit_msg>Add experimental JSON output module<commit_after>from __future__ import absolute_import
import json, math
from .schema import SolrResponse, SolrResult
class SunburntJSONEncoder(json.JSONEncoder):
def encode(self, o):
if isinstance(o, SolrResponse):
return self.enco... | |
cfac2ea76b00620545717667305e78179a8fb390 | fetch_configs/flutter.py | fetch_configs/flutter.py | # Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | Add fetch recipe for the Flutter Engine repository. | Add fetch recipe for the Flutter Engine repository.
Tested with the following
$ mkdir flutter_engine
$ cd flutter_engine
$ fetch flutter
$ cd src
# Confirm the source tree and dependencies are as expected.
BUG=None
TEST=see above
Change-Id: Ie1a6653c3b76354e282688e0db50acc112794426
Reviewed-on: https://chromium-r... | Python | bsd-3-clause | CoherentLabs/depot_tools,CoherentLabs/depot_tools | Add fetch recipe for the Flutter Engine repository.
Tested with the following
$ mkdir flutter_engine
$ cd flutter_engine
$ fetch flutter
$ cd src
# Confirm the source tree and dependencies are as expected.
BUG=None
TEST=see above
Change-Id: Ie1a6653c3b76354e282688e0db50acc112794426
Reviewed-on: https://chromium-r... | # Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | <commit_before><commit_msg>Add fetch recipe for the Flutter Engine repository.
Tested with the following
$ mkdir flutter_engine
$ cd flutter_engine
$ fetch flutter
$ cd src
# Confirm the source tree and dependencies are as expected.
BUG=None
TEST=see above
Change-Id: Ie1a6653c3b76354e282688e0db50acc112794426
Revi... | # Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no... | Add fetch recipe for the Flutter Engine repository.
Tested with the following
$ mkdir flutter_engine
$ cd flutter_engine
$ fetch flutter
$ cd src
# Confirm the source tree and dependencies are as expected.
BUG=None
TEST=see above
Change-Id: Ie1a6653c3b76354e282688e0db50acc112794426
Reviewed-on: https://chromium-r... | <commit_before><commit_msg>Add fetch recipe for the Flutter Engine repository.
Tested with the following
$ mkdir flutter_engine
$ cd flutter_engine
$ fetch flutter
$ cd src
# Confirm the source tree and dependencies are as expected.
BUG=None
TEST=see above
Change-Id: Ie1a6653c3b76354e282688e0db50acc112794426
Revi... | |
0ca43532ea20a2d202c721a371194827c8b74520 | __openerp__.py | __openerp__.py | {
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author': 'Luke Branch',
'depends': ['website', 'website_sale'],
'data': [... | Add module descriptions and dependencies | Add module descriptions and dependencies
{
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author': 'Luke Branch',
'depe... | Python | mit | luistorresm/website_multi_image,luistorresm/website_multi_image,Vauxoo/website_multi_image,yelizariev/website_multi_image,OdooCommunityWidgets/website_multi_image,Vauxoo/website_multi_image,yelizariev/website_multi_image,vauxoo-dev/website_multi_image,OdooCommunityWidgets/website_multi_image,Vauxoo/website_multi_image,... | Add module descriptions and dependencies
{
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author': 'Luke Branch',
'depe... | {
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author': 'Luke Branch',
'depends': ['website', 'website_sale'],
'data': [... | <commit_before><commit_msg>Add module descriptions and dependencies
{
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author'... | {
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author': 'Luke Branch',
'depends': ['website', 'website_sale'],
'data': [... | Add module descriptions and dependencies
{
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author': 'Luke Branch',
'depe... | <commit_before><commit_msg>Add module descriptions and dependencies
{
'name': 'Genesis Product Multi-Image',
'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',
'category': 'Website',
'version': '1.0',
'author'... | |
5c1d725103b1d97c0753d3ae2baf7f0835f995eb | comrade/functional.py | comrade/functional.py | def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_attribute)
return lazy_func
| Add a @lazy decorator for simple lazy methods. | Add a @lazy decorator for simple lazy methods.
| Python | mit | bueda/django-comrade | Add a @lazy decorator for simple lazy methods. | def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_attribute)
return lazy_func
| <commit_before><commit_msg>Add a @lazy decorator for simple lazy methods.<commit_after> | def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_attribute)
return lazy_func
| Add a @lazy decorator for simple lazy methods.def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_att... | <commit_before><commit_msg>Add a @lazy decorator for simple lazy methods.<commit_after>def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs)... | |
353dc990b12647ba784ad06a23dc3e374754081a | openstack/tests/functional/network/v2/test_security_group.py | openstack/tests/functional/network/v2/test_security_group.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add functional tests for security groups | Add functional tests for security groups
Change-Id: I90b29c2e48303867ae2f670643171d113e485cf1
| Python | apache-2.0 | openstack/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-openstacksdk,dtroyer/python-openstacksdk,briancurtin/python-openstacksdk,mtougeron/python-openstacksdk,stackforge/python-openstacksdk,mtougeron/python-openstacksdk,dtroyer/python-openstacksdk,dudymas/python-openstacksdk,briancurtin/python-ope... | Add functional tests for security groups
Change-Id: I90b29c2e48303867ae2f670643171d113e485cf1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before><commit_msg>Add functional tests for security groups
Change-Id: I90b29c2e48303867ae2f670643171d113e485cf1<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add functional tests for security groups
Change-Id: I90b29c2e48303867ae2f670643171d113e485cf1# 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... | <commit_before><commit_msg>Add functional tests for security groups
Change-Id: I90b29c2e48303867ae2f670643171d113e485cf1<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
#
# h... | |
14798847730a8746c1a7bad18a2f9e0fda7e0756 | wagtail/tests/testapp/migrations/0006_sectionedrichtextpage_sectionedrichtextpagesection.py | wagtail/tests/testapp/migrations/0006_sectionedrichtextpage_sectionedrichtextpagesection.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0029_unicode_slugfield_dj19'),
('tests', '0005_customrich... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0028_merge'),
('tests', '0005_customrichblockfieldpage_cu... | Fix test migration for Wagtail 1.5 | Fix test migration for Wagtail 1.5
| Python | bsd-3-clause | nilnvoid/wagtail,kurtrwall/wagtail,gasman/wagtail,zerolab/wagtail,kaedroho/wagtail,kurtrwall/wagtail,torchbox/wagtail,zerolab/wagtail,mikedingjan/wagtail,rsalmaso/wagtail,nilnvoid/wagtail,kaedroho/wagtail,nutztherookie/wagtail,takeflight/wagtail,gasman/wagtail,kaedroho/wagtail,wagtail/wagtail,jnns/wagtail,nimasmi/wagta... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0029_unicode_slugfield_dj19'),
('tests', '0005_customrich... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0028_merge'),
('tests', '0005_customrichblockfieldpage_cu... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0029_unicode_slugfield_dj19'),
('tests', '... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0028_merge'),
('tests', '0005_customrichblockfieldpage_cu... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0029_unicode_slugfield_dj19'),
('tests', '0005_customrich... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0029_unicode_slugfield_dj19'),
('tests', '... |
9491469f5e34e96880e3e62bc26e742c65065a3f | tests/test_init.py | tests/test_init.py | # -*- coding: utf-8 -*-
# Copyright 2009-2016 Jason Stitt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | Add test for initialization that doesn't find library | Add test for initialization that doesn't find library
| Python | mit | countergram/pytidylib | Add test for initialization that doesn't find library | # -*- coding: utf-8 -*-
# Copyright 2009-2016 Jason Stitt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | <commit_before><commit_msg>Add test for initialization that doesn't find library<commit_after> | # -*- coding: utf-8 -*-
# Copyright 2009-2016 Jason Stitt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | Add test for initialization that doesn't find library# -*- coding: utf-8 -*-
# Copyright 2009-2016 Jason Stitt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including... | <commit_before><commit_msg>Add test for initialization that doesn't find library<commit_after># -*- coding: utf-8 -*-
# Copyright 2009-2016 Jason Stitt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in th... | |
834656cc94c13a5aa7f8360e2d399f0b623365f6 | tests/test_init.py | tests/test_init.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
import click
from click.testing import CliRunner
import mock
import yaml
from tldr import cli
class TestInit(unittest.TestCase):
def setUp(self):
self.config_path = path.j... | Add test for `tldr init` | Add test for `tldr init`
| Python | mit | lord63/tldr.py | Add test for `tldr init` | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
import click
from click.testing import CliRunner
import mock
import yaml
from tldr import cli
class TestInit(unittest.TestCase):
def setUp(self):
self.config_path = path.j... | <commit_before><commit_msg>Add test for `tldr init`<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
import click
from click.testing import CliRunner
import mock
import yaml
from tldr import cli
class TestInit(unittest.TestCase):
def setUp(self):
self.config_path = path.j... | Add test for `tldr init`#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
import click
from click.testing import CliRunner
import mock
import yaml
from tldr import cli
class TestInit(unittest.TestCase):
def setUp(self):
s... | <commit_before><commit_msg>Add test for `tldr init`<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
import click
from click.testing import CliRunner
import mock
import yaml
from tldr import cli
class TestInit(unittest.... | |
30334cd42056b5c4bf229798828ff010ec2a8e07 | src/fastimgproto/fixtures/profiling.py | src/fastimgproto/fixtures/profiling.py | from fastimgproto.sourcefind.image import SourceFindImage
from memory_profiler import profile
@profile
def memprof_sourcefindimage(data, detection_n_sigma, analysis_n_sigma):
return SourceFindImage(data = data, detection_n_sigma=5, analysis_n_sigma=3) | Add handy profiled wrapper function | Add handy profiled wrapper function
| Python | apache-2.0 | SKA-ScienceDataProcessor/FastImaging-Python,SKA-ScienceDataProcessor/FastImaging-Python | Add handy profiled wrapper function | from fastimgproto.sourcefind.image import SourceFindImage
from memory_profiler import profile
@profile
def memprof_sourcefindimage(data, detection_n_sigma, analysis_n_sigma):
return SourceFindImage(data = data, detection_n_sigma=5, analysis_n_sigma=3) | <commit_before><commit_msg>Add handy profiled wrapper function<commit_after> | from fastimgproto.sourcefind.image import SourceFindImage
from memory_profiler import profile
@profile
def memprof_sourcefindimage(data, detection_n_sigma, analysis_n_sigma):
return SourceFindImage(data = data, detection_n_sigma=5, analysis_n_sigma=3) | Add handy profiled wrapper functionfrom fastimgproto.sourcefind.image import SourceFindImage
from memory_profiler import profile
@profile
def memprof_sourcefindimage(data, detection_n_sigma, analysis_n_sigma):
return SourceFindImage(data = data, detection_n_sigma=5, analysis_n_sigma=3) | <commit_before><commit_msg>Add handy profiled wrapper function<commit_after>from fastimgproto.sourcefind.image import SourceFindImage
from memory_profiler import profile
@profile
def memprof_sourcefindimage(data, detection_n_sigma, analysis_n_sigma):
return SourceFindImage(data = data, detection_n_sigma=5, analysi... | |
fc51259760c522593218b83b8c10ce4cf3f239db | siphon/__init__.py | siphon/__init__.py | # Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import cdmr # noqa
__all__ = ['catalog', 'cdmr']
| # Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__all__ = ['catalog', 'testing', 'util']
| Remove cdmr main level import. | Remove cdmr main level import.
| Python | bsd-3-clause | MoonRaker/siphon,hyoklee/siphon,Unidata/siphon,dopplershift/siphon,dopplershift/siphon | # Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import cdmr # noqa
__all__ = ['catalog', 'cdmr']
Remove cdmr main level import. | # Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__all__ = ['catalog', 'testing', 'util']
| <commit_before># Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import cdmr # noqa
__all__ = ['catalog', 'cdmr']
<commit_msg>Remove cdmr main level import.<commit_after> | # Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__all__ = ['catalog', 'testing', 'util']
| # Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import cdmr # noqa
__all__ = ['catalog', 'cdmr']
Remove cdmr main level import.# Version import needs to come first so everyone else can pull on i... | <commit_before># Version import needs to come first so everyone else can pull on import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import cdmr # noqa
__all__ = ['catalog', 'cdmr']
<commit_msg>Remove cdmr main level import.<commit_after># Version import needs to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.