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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6329cb17fdd0c2e0df8c0fe057972169f97c737f | pretty_json.py | pretty_json.py | #!/usr/bin/env python
import json, sys
def main():
nargs = len(sys.argv)
if nargs == 1:
f = sys.stdin
elif nargs == 2:
f = open(sys.argv[1], 'r')
else:
print('Usage: %s file' % sys.argv[0])
return
json.dump(json.load(f), sys.stdout, indent=2)
if __name__ == '__main... | Add script to reformat json files for humans | Add script to reformat json files for humans
I'm often working with json data that is omits newlines and indentation
for consumption by a machine, but I often need to make sense of it
myself as well. This script is a small wrapper around the Python parser
to reformat the json data with newlines and indentation.
| Python | mit | DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk | Add script to reformat json files for humans
I'm often working with json data that is omits newlines and indentation
for consumption by a machine, but I often need to make sense of it
myself as well. This script is a small wrapper around the Python parser
to reformat the json data with newlines and indentation. | #!/usr/bin/env python
import json, sys
def main():
nargs = len(sys.argv)
if nargs == 1:
f = sys.stdin
elif nargs == 2:
f = open(sys.argv[1], 'r')
else:
print('Usage: %s file' % sys.argv[0])
return
json.dump(json.load(f), sys.stdout, indent=2)
if __name__ == '__main... | <commit_before><commit_msg>Add script to reformat json files for humans
I'm often working with json data that is omits newlines and indentation
for consumption by a machine, but I often need to make sense of it
myself as well. This script is a small wrapper around the Python parser
to reformat the json data with newli... | #!/usr/bin/env python
import json, sys
def main():
nargs = len(sys.argv)
if nargs == 1:
f = sys.stdin
elif nargs == 2:
f = open(sys.argv[1], 'r')
else:
print('Usage: %s file' % sys.argv[0])
return
json.dump(json.load(f), sys.stdout, indent=2)
if __name__ == '__main... | Add script to reformat json files for humans
I'm often working with json data that is omits newlines and indentation
for consumption by a machine, but I often need to make sense of it
myself as well. This script is a small wrapper around the Python parser
to reformat the json data with newlines and indentation.#!/usr/... | <commit_before><commit_msg>Add script to reformat json files for humans
I'm often working with json data that is omits newlines and indentation
for consumption by a machine, but I often need to make sense of it
myself as well. This script is a small wrapper around the Python parser
to reformat the json data with newli... | |
5f750b969928c0644712b06eea6d10f6860f567a | oedb_datamodels/versions/1c6e2fb3d3b6_popularity_tracking.py | oedb_datamodels/versions/1c6e2fb3d3b6_popularity_tracking.py | """Add columns to track popularity of tags
Revision ID: 1c6e2fb3d3b6
Revises: 6887c442bbee
Create Date: 2019-04-29 11:30:45.528110
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c6e2fb3d3b6'
down_revision = '6887c442bbee'
branch_labels = None
depends_on = No... | Add tag popularity to alembic | Add tag popularity to alembic
| Python | agpl-3.0 | openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform | Add tag popularity to alembic | """Add columns to track popularity of tags
Revision ID: 1c6e2fb3d3b6
Revises: 6887c442bbee
Create Date: 2019-04-29 11:30:45.528110
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c6e2fb3d3b6'
down_revision = '6887c442bbee'
branch_labels = None
depends_on = No... | <commit_before><commit_msg>Add tag popularity to alembic<commit_after> | """Add columns to track popularity of tags
Revision ID: 1c6e2fb3d3b6
Revises: 6887c442bbee
Create Date: 2019-04-29 11:30:45.528110
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c6e2fb3d3b6'
down_revision = '6887c442bbee'
branch_labels = None
depends_on = No... | Add tag popularity to alembic"""Add columns to track popularity of tags
Revision ID: 1c6e2fb3d3b6
Revises: 6887c442bbee
Create Date: 2019-04-29 11:30:45.528110
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c6e2fb3d3b6'
down_revision = '6887c442bbee'
branch_... | <commit_before><commit_msg>Add tag popularity to alembic<commit_after>"""Add columns to track popularity of tags
Revision ID: 1c6e2fb3d3b6
Revises: 6887c442bbee
Create Date: 2019-04-29 11:30:45.528110
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c6e2fb3d3b... | |
dc546e01bab2f338fff40d38a529d515657ae725 | dot_ipython/private_profile_default/private_startup/private_00-pandas.py | dot_ipython/private_profile_default/private_startup/private_00-pandas.py | import sys
import pandas as pd
pd.options.display.max_columns = 100
pd.options.display.min_rows = 20
pd.options.display.width = None if sys.stdout.isatty() else sys.maxsize
| Add ipython pandas startup script. | Add ipython pandas startup script.
| Python | mit | Li9htmare/dotfiles | Add ipython pandas startup script. | import sys
import pandas as pd
pd.options.display.max_columns = 100
pd.options.display.min_rows = 20
pd.options.display.width = None if sys.stdout.isatty() else sys.maxsize
| <commit_before><commit_msg>Add ipython pandas startup script.<commit_after> | import sys
import pandas as pd
pd.options.display.max_columns = 100
pd.options.display.min_rows = 20
pd.options.display.width = None if sys.stdout.isatty() else sys.maxsize
| Add ipython pandas startup script.import sys
import pandas as pd
pd.options.display.max_columns = 100
pd.options.display.min_rows = 20
pd.options.display.width = None if sys.stdout.isatty() else sys.maxsize
| <commit_before><commit_msg>Add ipython pandas startup script.<commit_after>import sys
import pandas as pd
pd.options.display.max_columns = 100
pd.options.display.min_rows = 20
pd.options.display.width = None if sys.stdout.isatty() else sys.maxsize
| |
d78e84fdcb977e856406e47adcfbeccffad020dc | mysite/extra_translations.py | mysite/extra_translations.py | # This module exists just to list strings for translation to be picked
# up by makemessages.
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_('Standing for re-election')
| Add some strings for translation to be picked up by makemessages | Add some strings for translation to be picked up by makemessages
| Python | agpl-3.0 | neavouli/yournextrepresentative,DemocracyClub/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yo... | Add some strings for translation to be picked up by makemessages | # This module exists just to list strings for translation to be picked
# up by makemessages.
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_('Standing for re-election')
| <commit_before><commit_msg>Add some strings for translation to be picked up by makemessages<commit_after> | # This module exists just to list strings for translation to be picked
# up by makemessages.
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_('Standing for re-election')
| Add some strings for translation to be picked up by makemessages# This module exists just to list strings for translation to be picked
# up by makemessages.
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Ro... | <commit_before><commit_msg>Add some strings for translation to be picked up by makemessages<commit_after># This module exists just to list strings for translation to be picked
# up by makemessages.
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Co... | |
b078084f99a5e7afeee80cfd8b370ed18ef88060 | corehq/apps/reminders/management/commands/find_reminder_usage.py | corehq/apps/reminders/management/commands/find_reminder_usage.py | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import defaultdict
from corehq.apps.reminders.models import CaseReminderHandler, REMINDER_TYPE_KEYWORD_INITIATED
from django.core.management.base import BaseCommand
class DomainResult(object):
def __init__(self):
... | Add script to find old reminder framework usage | Add script to find old reminder framework usage
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add script to find old reminder framework usage | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import defaultdict
from corehq.apps.reminders.models import CaseReminderHandler, REMINDER_TYPE_KEYWORD_INITIATED
from django.core.management.base import BaseCommand
class DomainResult(object):
def __init__(self):
... | <commit_before><commit_msg>Add script to find old reminder framework usage<commit_after> | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import defaultdict
from corehq.apps.reminders.models import CaseReminderHandler, REMINDER_TYPE_KEYWORD_INITIATED
from django.core.management.base import BaseCommand
class DomainResult(object):
def __init__(self):
... | Add script to find old reminder framework usagefrom __future__ import absolute_import
from __future__ import unicode_literals
from collections import defaultdict
from corehq.apps.reminders.models import CaseReminderHandler, REMINDER_TYPE_KEYWORD_INITIATED
from django.core.management.base import BaseCommand
class Doma... | <commit_before><commit_msg>Add script to find old reminder framework usage<commit_after>from __future__ import absolute_import
from __future__ import unicode_literals
from collections import defaultdict
from corehq.apps.reminders.models import CaseReminderHandler, REMINDER_TYPE_KEYWORD_INITIATED
from django.core.manage... | |
bfbfa9179fe58e90b8edd9ce138a99d5cac993cc | test/api/test_build.py | test/api/test_build.py | import mock
from piper.api.build import Build
class TestBuildGet(object):
def setup_method(self, method):
self.build = Build()
self.build.db = mock.Mock()
self.build_id = 871263487612384761243 # ?
def test_found(self):
ret = self.build.get(self.build_id)
assert ret ... | Add tests for Build() API | Add tests for Build() API
| Python | mit | thiderman/piper | Add tests for Build() API | import mock
from piper.api.build import Build
class TestBuildGet(object):
def setup_method(self, method):
self.build = Build()
self.build.db = mock.Mock()
self.build_id = 871263487612384761243 # ?
def test_found(self):
ret = self.build.get(self.build_id)
assert ret ... | <commit_before><commit_msg>Add tests for Build() API<commit_after> | import mock
from piper.api.build import Build
class TestBuildGet(object):
def setup_method(self, method):
self.build = Build()
self.build.db = mock.Mock()
self.build_id = 871263487612384761243 # ?
def test_found(self):
ret = self.build.get(self.build_id)
assert ret ... | Add tests for Build() APIimport mock
from piper.api.build import Build
class TestBuildGet(object):
def setup_method(self, method):
self.build = Build()
self.build.db = mock.Mock()
self.build_id = 871263487612384761243 # ?
def test_found(self):
ret = self.build.get(self.build... | <commit_before><commit_msg>Add tests for Build() API<commit_after>import mock
from piper.api.build import Build
class TestBuildGet(object):
def setup_method(self, method):
self.build = Build()
self.build.db = mock.Mock()
self.build_id = 871263487612384761243 # ?
def test_found(self)... | |
80270e691597b679d4975c807234bd3c4f50eaae | data-analysis/snippet_chart_area_at_each_time_step.py | data-analysis/snippet_chart_area_at_each_time_step.py | # Unneeded charting code that was removed from a jupyter notebook. Stored here as an example for later
# Draws a chart with the total area of multiple protin receptors at each time step
tmpdf = totals65.loc[(totals65['Receptor'].isin(['M1', 'M5', 'M7', 'M22', 'M26'])) &
(totals65['Experiment Step... | Add snippet - chart total area at each time step | Add snippet - chart total area at each time step | Python | mit | daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various | Add snippet - chart total area at each time step | # Unneeded charting code that was removed from a jupyter notebook. Stored here as an example for later
# Draws a chart with the total area of multiple protin receptors at each time step
tmpdf = totals65.loc[(totals65['Receptor'].isin(['M1', 'M5', 'M7', 'M22', 'M26'])) &
(totals65['Experiment Step... | <commit_before><commit_msg>Add snippet - chart total area at each time step<commit_after> | # Unneeded charting code that was removed from a jupyter notebook. Stored here as an example for later
# Draws a chart with the total area of multiple protin receptors at each time step
tmpdf = totals65.loc[(totals65['Receptor'].isin(['M1', 'M5', 'M7', 'M22', 'M26'])) &
(totals65['Experiment Step... | Add snippet - chart total area at each time step# Unneeded charting code that was removed from a jupyter notebook. Stored here as an example for later
# Draws a chart with the total area of multiple protin receptors at each time step
tmpdf = totals65.loc[(totals65['Receptor'].isin(['M1', 'M5', 'M7', 'M22', 'M26'])) & ... | <commit_before><commit_msg>Add snippet - chart total area at each time step<commit_after># Unneeded charting code that was removed from a jupyter notebook. Stored here as an example for later
# Draws a chart with the total area of multiple protin receptors at each time step
tmpdf = totals65.loc[(totals65['Receptor'].i... | |
0e6c2ec976be5381c8f679657afe8c02af28d9fa | FindingLaneLines/ColorSelector.py | FindingLaneLines/ColorSelector.py | # Modify the values of the variables red_threshold, green_threshold,
# and blue_threshold until you are able to retain as much of the lane
# lines as possible, while getting rid of most of the other stuff.
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
def ColorSelector():
# ... | Add script to modify the values of the variables red_threshold, green_threshold, and blue_threshold until you are able to retain as much of the lane lines as possible, while getting rid of most of the other stuff | feat: Add script to modify the values of the variables
red_threshold, green_threshold, and blue_threshold until you are able
to retain as much of the lane lines as possible, while getting rid
of most of the other stuff
| Python | mit | aguijarro/SelfDrivingCar | feat: Add script to modify the values of the variables
red_threshold, green_threshold, and blue_threshold until you are able
to retain as much of the lane lines as possible, while getting rid
of most of the other stuff | # Modify the values of the variables red_threshold, green_threshold,
# and blue_threshold until you are able to retain as much of the lane
# lines as possible, while getting rid of most of the other stuff.
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
def ColorSelector():
# ... | <commit_before><commit_msg>feat: Add script to modify the values of the variables
red_threshold, green_threshold, and blue_threshold until you are able
to retain as much of the lane lines as possible, while getting rid
of most of the other stuff<commit_after> | # Modify the values of the variables red_threshold, green_threshold,
# and blue_threshold until you are able to retain as much of the lane
# lines as possible, while getting rid of most of the other stuff.
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
def ColorSelector():
# ... | feat: Add script to modify the values of the variables
red_threshold, green_threshold, and blue_threshold until you are able
to retain as much of the lane lines as possible, while getting rid
of most of the other stuff# Modify the values of the variables red_threshold, green_threshold,
# and blue_threshold until you ar... | <commit_before><commit_msg>feat: Add script to modify the values of the variables
red_threshold, green_threshold, and blue_threshold until you are able
to retain as much of the lane lines as possible, while getting rid
of most of the other stuff<commit_after># Modify the values of the variables red_threshold, green_thr... | |
ce34a3dbaa824429b91af76ed5882ddffc2d3b2b | examples/happy_birthday.py | examples/happy_birthday.py | """A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday')
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
| """A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday', example="name=HUG&page=1")
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
| Add example argument, for direct url | Add example argument, for direct url
| Python | mit | STANAPO/hug,origingod/hug,jean/hug,MuhammadAlkarouri/hug,philiptzou/hug,jean/hug,giserh/hug,STANAPO/hug,MuhammadAlkarouri/hug,gbn972/hug,yasoob/hug,timothycrosley/hug,philiptzou/hug,yasoob/hug,giserh/hug,timothycrosley/hug,MuhammadAlkarouri/hug,shaunstanislaus/hug,timothycrosley/hug,janusnic/hug,janusnic/hug,alisaifee/... | """A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday')
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
Add example argument, for direct url | """A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday', example="name=HUG&page=1")
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
| <commit_before>"""A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday')
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
<commit_msg>Add example argument, for direct url<co... | """A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday', example="name=HUG&page=1")
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
| """A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday')
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
Add example argument, for direct url"""A basic (single function) A... | <commit_before>"""A basic (single function) API written using Hug"""
import hug
@hug.get('/happy_birthday')
def happy_birthday(name, age:hug.types.number, **kwargs):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!".format(**locals())
<commit_msg>Add example argument, for direct url<co... |
744fffddc5655de6d7630e6c92111b6ce5af46f1 | pombola/south_africa/management/commands/south_africa_sync_everypolitician_uuid.py | pombola/south_africa/management/commands/south_africa_sync_everypolitician_uuid.py | from everypolitician import EveryPolitician
from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
help = "Sync EveryPolitician UUID to Person's identifiers array"
def add_arguments(self, parser):
parser.add_argument('everypolitician_c... | Add management command to sync EveryPolitician UUID | Add management command to sync EveryPolitician UUID
| Python | agpl-3.0 | mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola | Add management command to sync EveryPolitician UUID | from everypolitician import EveryPolitician
from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
help = "Sync EveryPolitician UUID to Person's identifiers array"
def add_arguments(self, parser):
parser.add_argument('everypolitician_c... | <commit_before><commit_msg>Add management command to sync EveryPolitician UUID<commit_after> | from everypolitician import EveryPolitician
from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
help = "Sync EveryPolitician UUID to Person's identifiers array"
def add_arguments(self, parser):
parser.add_argument('everypolitician_c... | Add management command to sync EveryPolitician UUIDfrom everypolitician import EveryPolitician
from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
help = "Sync EveryPolitician UUID to Person's identifiers array"
def add_arguments(self, pars... | <commit_before><commit_msg>Add management command to sync EveryPolitician UUID<commit_after>from everypolitician import EveryPolitician
from django.core.management.base import BaseCommand
from pombola.core.models import Person
class Command(BaseCommand):
help = "Sync EveryPolitician UUID to Person's identifiers... | |
b2c51babee88a53704219cb4c2a639c8e71ad621 | tests/functions_tests/test_copy.py | tests/functions_tests/test_copy.py | import unittest
import numpy
import chainer
from chainer import functions
from chainer import gradient_check
class Copy(unittest.TestCase):
def setUp(self):
self.x_data = numpy.random.uniform(
-1, 1, (10, 5)).astype(numpy.float32)
self.gy = numpy.random.uniform(-1, 1, (10, 5)).astyp... | Add unittest for Copy function | Add unittest for Copy function
| Python | mit | tscohen/chainer,okuta/chainer,tkerola/chainer,keisuke-umezawa/chainer,sou81821/chainer,ktnyt/chainer,aonotas/chainer,truongdq/chainer,jnishi/chainer,keisuke-umezawa/chainer,hvy/chainer,kiyukuta/chainer,keisuke-umezawa/chainer,1986ks/chainer,wkentaro/chainer,laysakura/chainer,niboshi/chainer,kuwa32/chainer,kikusu/chaine... | Add unittest for Copy function | import unittest
import numpy
import chainer
from chainer import functions
from chainer import gradient_check
class Copy(unittest.TestCase):
def setUp(self):
self.x_data = numpy.random.uniform(
-1, 1, (10, 5)).astype(numpy.float32)
self.gy = numpy.random.uniform(-1, 1, (10, 5)).astyp... | <commit_before><commit_msg>Add unittest for Copy function<commit_after> | import unittest
import numpy
import chainer
from chainer import functions
from chainer import gradient_check
class Copy(unittest.TestCase):
def setUp(self):
self.x_data = numpy.random.uniform(
-1, 1, (10, 5)).astype(numpy.float32)
self.gy = numpy.random.uniform(-1, 1, (10, 5)).astyp... | Add unittest for Copy functionimport unittest
import numpy
import chainer
from chainer import functions
from chainer import gradient_check
class Copy(unittest.TestCase):
def setUp(self):
self.x_data = numpy.random.uniform(
-1, 1, (10, 5)).astype(numpy.float32)
self.gy = numpy.random... | <commit_before><commit_msg>Add unittest for Copy function<commit_after>import unittest
import numpy
import chainer
from chainer import functions
from chainer import gradient_check
class Copy(unittest.TestCase):
def setUp(self):
self.x_data = numpy.random.uniform(
-1, 1, (10, 5)).astype(nump... | |
d386e327a2b04392ff98e7df9ff53c50322feec5 | database/lawParsing.py | database/lawParsing.py | # encoding=utf8
import sys
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
tree = etree.parse("BJNR002190897.xml")
root = tree.getroot()
for child in root:
metadaten = child[0]
paragraph = metadaten.find("enbez")
if paragraph is not None:
paragraph = paragraph.text
... | Add basic xml parser for laws | Add basic xml parser for laws
| Python | lgpl-2.1 | Bensk1/jurassist,Bensk1/jurassist | Add basic xml parser for laws | # encoding=utf8
import sys
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
tree = etree.parse("BJNR002190897.xml")
root = tree.getroot()
for child in root:
metadaten = child[0]
paragraph = metadaten.find("enbez")
if paragraph is not None:
paragraph = paragraph.text
... | <commit_before><commit_msg>Add basic xml parser for laws<commit_after> | # encoding=utf8
import sys
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
tree = etree.parse("BJNR002190897.xml")
root = tree.getroot()
for child in root:
metadaten = child[0]
paragraph = metadaten.find("enbez")
if paragraph is not None:
paragraph = paragraph.text
... | Add basic xml parser for laws# encoding=utf8
import sys
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
tree = etree.parse("BJNR002190897.xml")
root = tree.getroot()
for child in root:
metadaten = child[0]
paragraph = metadaten.find("enbez")
if paragraph is not None:
par... | <commit_before><commit_msg>Add basic xml parser for laws<commit_after># encoding=utf8
import sys
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
tree = etree.parse("BJNR002190897.xml")
root = tree.getroot()
for child in root:
metadaten = child[0]
paragraph = metadaten.find("enbez")
... | |
7feb7301b2cefd568fa65ee9907a1a179ea41f1c | tests/basics/op_precedence.py | tests/basics/op_precedence.py | # see https://docs.python.org/3/reference/expressions.html#operator-precedence
# '|' is the least binding numeric operator
# '^'
# OK: 1 | (2 ^ 3) = 1 | 1 = 1
# BAD: (1 | 2) ^ 3 = 3 ^ 3 = 0
print(1 | 2 ^ 3)
# '&'
# OK: 3 ^ (2 & 1) = 3 ^ 0 = 3
# BAD: (3 ^ 2) & 1 = 1 & 1 = 1
print(3 ^ 2 & 1)
# '<<', '>>'
# OK: 2 &... | Add tests for arithmetic operators precedence. | tests/basics: Add tests for arithmetic operators precedence.
| Python | mit | trezor/micropython,deshipu/micropython,AriZuu/micropython,selste/micropython,trezor/micropython,pfalcon/micropython,adafruit/circuitpython,HenrikSolver/micropython,tralamazza/micropython,torwag/micropython,dmazzella/micropython,SHA2017-badge/micropython-esp32,oopy/micropython,TDAbboud/micropython,kerneltask/micropython... | tests/basics: Add tests for arithmetic operators precedence. | # see https://docs.python.org/3/reference/expressions.html#operator-precedence
# '|' is the least binding numeric operator
# '^'
# OK: 1 | (2 ^ 3) = 1 | 1 = 1
# BAD: (1 | 2) ^ 3 = 3 ^ 3 = 0
print(1 | 2 ^ 3)
# '&'
# OK: 3 ^ (2 & 1) = 3 ^ 0 = 3
# BAD: (3 ^ 2) & 1 = 1 & 1 = 1
print(3 ^ 2 & 1)
# '<<', '>>'
# OK: 2 &... | <commit_before><commit_msg>tests/basics: Add tests for arithmetic operators precedence.<commit_after> | # see https://docs.python.org/3/reference/expressions.html#operator-precedence
# '|' is the least binding numeric operator
# '^'
# OK: 1 | (2 ^ 3) = 1 | 1 = 1
# BAD: (1 | 2) ^ 3 = 3 ^ 3 = 0
print(1 | 2 ^ 3)
# '&'
# OK: 3 ^ (2 & 1) = 3 ^ 0 = 3
# BAD: (3 ^ 2) & 1 = 1 & 1 = 1
print(3 ^ 2 & 1)
# '<<', '>>'
# OK: 2 &... | tests/basics: Add tests for arithmetic operators precedence.# see https://docs.python.org/3/reference/expressions.html#operator-precedence
# '|' is the least binding numeric operator
# '^'
# OK: 1 | (2 ^ 3) = 1 | 1 = 1
# BAD: (1 | 2) ^ 3 = 3 ^ 3 = 0
print(1 | 2 ^ 3)
# '&'
# OK: 3 ^ (2 & 1) = 3 ^ 0 = 3
# BAD: (3 ^ ... | <commit_before><commit_msg>tests/basics: Add tests for arithmetic operators precedence.<commit_after># see https://docs.python.org/3/reference/expressions.html#operator-precedence
# '|' is the least binding numeric operator
# '^'
# OK: 1 | (2 ^ 3) = 1 | 1 = 1
# BAD: (1 | 2) ^ 3 = 3 ^ 3 = 0
print(1 | 2 ^ 3)
# '&'
# ... | |
60c1935b3d91f361b072c23889596d4d98ee9ea3 | spreadsheet.py | spreadsheet.py | from database import DeveloperInfo
import csv
import re
def get_names(full_name):
match = re.match(r'(\w+) ([\w ]+)', full_name)
if match is None:
return None
return match.group(1), match.group(2)
def load_roster(db_session, csv_file):
spreadsheet = csv.DictReader(csv_file)
devs = []
... | Add a module for loading Google Sheets | Add a module for loading Google Sheets
| Python | bsd-3-clause | siggame/ng-attendance,siggame/ng-attendance | Add a module for loading Google Sheets | from database import DeveloperInfo
import csv
import re
def get_names(full_name):
match = re.match(r'(\w+) ([\w ]+)', full_name)
if match is None:
return None
return match.group(1), match.group(2)
def load_roster(db_session, csv_file):
spreadsheet = csv.DictReader(csv_file)
devs = []
... | <commit_before><commit_msg>Add a module for loading Google Sheets<commit_after> | from database import DeveloperInfo
import csv
import re
def get_names(full_name):
match = re.match(r'(\w+) ([\w ]+)', full_name)
if match is None:
return None
return match.group(1), match.group(2)
def load_roster(db_session, csv_file):
spreadsheet = csv.DictReader(csv_file)
devs = []
... | Add a module for loading Google Sheetsfrom database import DeveloperInfo
import csv
import re
def get_names(full_name):
match = re.match(r'(\w+) ([\w ]+)', full_name)
if match is None:
return None
return match.group(1), match.group(2)
def load_roster(db_session, csv_file):
spreadsheet = csv.... | <commit_before><commit_msg>Add a module for loading Google Sheets<commit_after>from database import DeveloperInfo
import csv
import re
def get_names(full_name):
match = re.match(r'(\w+) ([\w ]+)', full_name)
if match is None:
return None
return match.group(1), match.group(2)
def load_roster(db_s... | |
78912c9e22e98b4d9330625723b06c866617f14f | wagtail/migrations/0075_populate_latest_revision_and_revision_object_str.py | wagtail/migrations/0075_populate_latest_revision_and_revision_object_str.py | # Generated by Django 4.0.3 on 2022-05-26 13:58
from django.db import migrations, models
from django.db.models.functions import Cast
def populate_latest_revision(apps, schema_editor):
Page = apps.get_model("wagtailcore.Page")
Revision = apps.get_model("wagtailcore.Revision")
latest_revision_id = models.S... | Make migration for backfilling pages' `latest_revision` and revisions' `object_str` | Make migration for backfilling pages' `latest_revision` and revisions' `object_str`
| Python | bsd-3-clause | wagtail/wagtail,rsalmaso/wagtail,thenewguy/wagtail,wagtail/wagtail,zerolab/wagtail,wagtail/wagtail,thenewguy/wagtail,zerolab/wagtail,zerolab/wagtail,wagtail/wagtail,thenewguy/wagtail,rsalmaso/wagtail,thenewguy/wagtail,thenewguy/wagtail,zerolab/wagtail,rsalmaso/wagtail,wagtail/wagtail,rsalmaso/wagtail,rsalmaso/wagtail,z... | Make migration for backfilling pages' `latest_revision` and revisions' `object_str` | # Generated by Django 4.0.3 on 2022-05-26 13:58
from django.db import migrations, models
from django.db.models.functions import Cast
def populate_latest_revision(apps, schema_editor):
Page = apps.get_model("wagtailcore.Page")
Revision = apps.get_model("wagtailcore.Revision")
latest_revision_id = models.S... | <commit_before><commit_msg>Make migration for backfilling pages' `latest_revision` and revisions' `object_str`<commit_after> | # Generated by Django 4.0.3 on 2022-05-26 13:58
from django.db import migrations, models
from django.db.models.functions import Cast
def populate_latest_revision(apps, schema_editor):
Page = apps.get_model("wagtailcore.Page")
Revision = apps.get_model("wagtailcore.Revision")
latest_revision_id = models.S... | Make migration for backfilling pages' `latest_revision` and revisions' `object_str`# Generated by Django 4.0.3 on 2022-05-26 13:58
from django.db import migrations, models
from django.db.models.functions import Cast
def populate_latest_revision(apps, schema_editor):
Page = apps.get_model("wagtailcore.Page")
... | <commit_before><commit_msg>Make migration for backfilling pages' `latest_revision` and revisions' `object_str`<commit_after># Generated by Django 4.0.3 on 2022-05-26 13:58
from django.db import migrations, models
from django.db.models.functions import Cast
def populate_latest_revision(apps, schema_editor):
Page ... | |
eea38231360115a1495948ccf18ddac16fc8630a | src/wellsfargo/tests/api/test_inquiry.py | src/wellsfargo/tests/api/test_inquiry.py | from rest_framework import status
from rest_framework.reverse import reverse
from wellsfargo.tests.base import BaseTest
from wellsfargo.tests import responses
import mock
class CreditLineInquiryTest(BaseTest):
@mock.patch('soap.get_transport')
def test_inquiry_successful(self, get_transport):
get_tra... | Add tests for inquiry API | Add tests for inquiry API
| Python | isc | thelabnyc/django-oscar-wfrs,thelabnyc/django-oscar-wfrs | Add tests for inquiry API | from rest_framework import status
from rest_framework.reverse import reverse
from wellsfargo.tests.base import BaseTest
from wellsfargo.tests import responses
import mock
class CreditLineInquiryTest(BaseTest):
@mock.patch('soap.get_transport')
def test_inquiry_successful(self, get_transport):
get_tra... | <commit_before><commit_msg>Add tests for inquiry API<commit_after> | from rest_framework import status
from rest_framework.reverse import reverse
from wellsfargo.tests.base import BaseTest
from wellsfargo.tests import responses
import mock
class CreditLineInquiryTest(BaseTest):
@mock.patch('soap.get_transport')
def test_inquiry_successful(self, get_transport):
get_tra... | Add tests for inquiry APIfrom rest_framework import status
from rest_framework.reverse import reverse
from wellsfargo.tests.base import BaseTest
from wellsfargo.tests import responses
import mock
class CreditLineInquiryTest(BaseTest):
@mock.patch('soap.get_transport')
def test_inquiry_successful(self, get_tr... | <commit_before><commit_msg>Add tests for inquiry API<commit_after>from rest_framework import status
from rest_framework.reverse import reverse
from wellsfargo.tests.base import BaseTest
from wellsfargo.tests import responses
import mock
class CreditLineInquiryTest(BaseTest):
@mock.patch('soap.get_transport')
... | |
f1af6f813c54198f09d73ee504af23b060d510a2 | pycroft/model/alembic/versions/6f1a37baa574_hosts_and_interfaces.py | pycroft/model/alembic/versions/6f1a37baa574_hosts_and_interfaces.py | """hosts and interfaces
Revision ID: 6f1a37baa574
Revises: cd588620e7d0
Create Date: 2018-09-17 15:38:56.401301
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import table, column, String
import pycroft
# revision identifiers, used by Alembic.
revision = '6f1a37baa574'
down_revision = 'cd588620... | Add alembic script for renaming 'user_mac_change' property | Add alembic script for renaming 'user_mac_change' property
| Python | apache-2.0 | agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft | Add alembic script for renaming 'user_mac_change' property | """hosts and interfaces
Revision ID: 6f1a37baa574
Revises: cd588620e7d0
Create Date: 2018-09-17 15:38:56.401301
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import table, column, String
import pycroft
# revision identifiers, used by Alembic.
revision = '6f1a37baa574'
down_revision = 'cd588620... | <commit_before><commit_msg>Add alembic script for renaming 'user_mac_change' property<commit_after> | """hosts and interfaces
Revision ID: 6f1a37baa574
Revises: cd588620e7d0
Create Date: 2018-09-17 15:38:56.401301
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import table, column, String
import pycroft
# revision identifiers, used by Alembic.
revision = '6f1a37baa574'
down_revision = 'cd588620... | Add alembic script for renaming 'user_mac_change' property"""hosts and interfaces
Revision ID: 6f1a37baa574
Revises: cd588620e7d0
Create Date: 2018-09-17 15:38:56.401301
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import table, column, String
import pycroft
# revision identifiers, used by Al... | <commit_before><commit_msg>Add alembic script for renaming 'user_mac_change' property<commit_after>"""hosts and interfaces
Revision ID: 6f1a37baa574
Revises: cd588620e7d0
Create Date: 2018-09-17 15:38:56.401301
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import table, column, String
import pyc... | |
89e8553502d5b849a013cda58087f57cba9f1de7 | article/migrations/0012_alter_content_field_to_have_verbose_name.py | article/migrations/0012_alter_content_field_to_have_verbose_name.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('article', '0011_alter_content_and_modular_content_fields'),
]
operations = [
migrations.Al... | Add migration for article content field verbose name introduction | Add migration for article content field verbose name introduction
| Python | bsd-3-clause | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | Add migration for article content field verbose name introduction | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('article', '0011_alter_content_and_modular_content_fields'),
]
operations = [
migrations.Al... | <commit_before><commit_msg>Add migration for article content field verbose name introduction<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('article', '0011_alter_content_and_modular_content_fields'),
]
operations = [
migrations.Al... | Add migration for article content field verbose name introduction# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('article', '0011_alter_content_and_modular_... | <commit_before><commit_msg>Add migration for article content field verbose name introduction<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('a... | |
f7d6e4c654414292783207be400f1769de7af892 | Lib/glyphsLib/parser_test.py | Lib/glyphsLib/parser_test.py | # coding=UTF-8
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | Add some simple parser tests | Add some simple parser tests
| Python | apache-2.0 | googlei18n/glyphsLib,googlefonts/glyphsLib | Add some simple parser tests | # coding=UTF-8
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | <commit_before><commit_msg>Add some simple parser tests<commit_after> | # coding=UTF-8
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | Add some simple parser tests# coding=UTF-8
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | <commit_before><commit_msg>Add some simple parser tests<commit_after># coding=UTF-8
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | |
983ec0045f34f480059e5b2736ee5c8f5e84e700 | symposion/speakers/migrations/0005_fix_migrations_accidentally_rolling_back_changes.py | symposion/speakers/migrations/0005_fix_migrations_accidentally_rolling_back_changes.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-01-25 04:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('symposion_speakers', '0004_make_fields_optional'),
]
o... | Fix migration issue by creating new migration. | Fix migration issue by creating new migration.
Both migration #3 and migration #4 in symposion.speakers have not been
applied upstream. Because of this, migration #4 accidentally reverted
the changes made in migration #3.
Because there are currently deployed conference sites with this set of
incorrect migrations, it ... | Python | bsd-3-clause | pydata/symposion,pydata/symposion | Fix migration issue by creating new migration.
Both migration #3 and migration #4 in symposion.speakers have not been
applied upstream. Because of this, migration #4 accidentally reverted
the changes made in migration #3.
Because there are currently deployed conference sites with this set of
incorrect migrations, it ... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-01-25 04:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('symposion_speakers', '0004_make_fields_optional'),
]
o... | <commit_before><commit_msg>Fix migration issue by creating new migration.
Both migration #3 and migration #4 in symposion.speakers have not been
applied upstream. Because of this, migration #4 accidentally reverted
the changes made in migration #3.
Because there are currently deployed conference sites with this set o... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-01-25 04:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('symposion_speakers', '0004_make_fields_optional'),
]
o... | Fix migration issue by creating new migration.
Both migration #3 and migration #4 in symposion.speakers have not been
applied upstream. Because of this, migration #4 accidentally reverted
the changes made in migration #3.
Because there are currently deployed conference sites with this set of
incorrect migrations, it ... | <commit_before><commit_msg>Fix migration issue by creating new migration.
Both migration #3 and migration #4 in symposion.speakers have not been
applied upstream. Because of this, migration #4 accidentally reverted
the changes made in migration #3.
Because there are currently deployed conference sites with this set o... | |
5f15f86f7c85887d17bc900aac8af30546c96096 | rtc_tools/metrics_plotter.py | rtc_tools/metrics_plotter.py | #!/usr/bin/env python
# Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | Add plotter script to plot internal test's stats | Add plotter script to plot internal test's stats
Bug: webrtc:10138
Change-Id: I2b9d55559cf6a123914e5a597a5bf6ea6e2aa4d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152721
Commit-Queue: Artem Titov <[email protected]>
Reviewed-by: Patrik Höglund <b486136ee68458b09c92c86... | Python | bsd-3-clause | ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc | Add plotter script to plot internal test's stats
Bug: webrtc:10138
Change-Id: I2b9d55559cf6a123914e5a597a5bf6ea6e2aa4d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152721
Commit-Queue: Artem Titov <[email protected]>
Reviewed-by: Patrik Höglund <b486136ee68458b09c92c86... | #!/usr/bin/env python
# Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | <commit_before><commit_msg>Add plotter script to plot internal test's stats
Bug: webrtc:10138
Change-Id: I2b9d55559cf6a123914e5a597a5bf6ea6e2aa4d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152721
Commit-Queue: Artem Titov <[email protected]>
Reviewed-by: Patrik Höglu... | #!/usr/bin/env python
# Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | Add plotter script to plot internal test's stats
Bug: webrtc:10138
Change-Id: I2b9d55559cf6a123914e5a597a5bf6ea6e2aa4d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152721
Commit-Queue: Artem Titov <[email protected]>
Reviewed-by: Patrik Höglund <b486136ee68458b09c92c86... | <commit_before><commit_msg>Add plotter script to plot internal test's stats
Bug: webrtc:10138
Change-Id: I2b9d55559cf6a123914e5a597a5bf6ea6e2aa4d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152721
Commit-Queue: Artem Titov <[email protected]>
Reviewed-by: Patrik Höglu... | |
f76a7100deb3e60507ed431feb5678ca97459f4b | lib/php_crud_api_transform.py | lib/php_crud_api_transform.py | def php_crud_api_transform(tables):
def get_objects(tables, table_name, where_index=None, match_value=None):
objects = []
for record in tables[table_name]['records']:
if where_index == None or (record[where_index] == match_value):
object = {}
columns = ta... | Transform algorithm in python 3 | Transform algorithm in python 3 | Python | mit | mevdschee/mysql-crud-api,mvdriel/php-crud-api,mevdschee/mysql-crud-api,mvdriel/php-crud-api,mevdschee/php-crud-api,mevdschee/php-crud-api | Transform algorithm in python 3 | def php_crud_api_transform(tables):
def get_objects(tables, table_name, where_index=None, match_value=None):
objects = []
for record in tables[table_name]['records']:
if where_index == None or (record[where_index] == match_value):
object = {}
columns = ta... | <commit_before><commit_msg>Transform algorithm in python 3<commit_after> | def php_crud_api_transform(tables):
def get_objects(tables, table_name, where_index=None, match_value=None):
objects = []
for record in tables[table_name]['records']:
if where_index == None or (record[where_index] == match_value):
object = {}
columns = ta... | Transform algorithm in python 3def php_crud_api_transform(tables):
def get_objects(tables, table_name, where_index=None, match_value=None):
objects = []
for record in tables[table_name]['records']:
if where_index == None or (record[where_index] == match_value):
object = ... | <commit_before><commit_msg>Transform algorithm in python 3<commit_after>def php_crud_api_transform(tables):
def get_objects(tables, table_name, where_index=None, match_value=None):
objects = []
for record in tables[table_name]['records']:
if where_index == None or (record[where_index] =... | |
e9674f88660e14ce48239771b76310044fc37090 | erpnext/patches/v7_0/remove_old_earning_deduction_doctypes.py | erpnext/patches/v7_0/remove_old_earning_deduction_doctypes.py | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary Structure Deducti... | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary Structure Deducti... | Create columns for custom fields in new table Salary Detail and Component | Create columns for custom fields in new table Salary Detail and Component
| Python | agpl-3.0 | Aptitudetech/ERPNext,njmube/erpnext,geekroot/erpnext,geekroot/erpnext,gsnbng/erpnext,gsnbng/erpnext,geekroot/erpnext,geekroot/erpnext,indictranstech/erpnext,gsnbng/erpnext,indictranstech/erpnext,indictranstech/erpnext,njmube/erpnext,njmube/erpnext,indictranstech/erpnext,gsnbng/erpnext,njmube/erpnext | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary Structure Deducti... | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary Structure Deducti... | <commit_before># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary St... | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary Structure Deducti... | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary Structure Deducti... | <commit_before># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Salary Component"):
for dt in ("Salary Structure Earning", "Salary St... |
0f04271d90646ef696401c702d2478527848ac88 | djangorest_alchemy/routers.py | djangorest_alchemy/routers.py | from rest_framework.routers import DefaultRouter
from rest_framework.routers import Route
class ReadOnlyRouter(DefaultRouter):
"""
A router for read-only APIs, which USES trailing slashes.
"""
routes = [
Route(url=r'^{prefix}{trailing_slash}$',
mapping={'get': 'list'},
... | Add router for read-only APIs | Add router for read-only APIs
| Python | mit | dealertrack/djangorest-alchemy,pombredanne/djangorest-alchemy | Add router for read-only APIs | from rest_framework.routers import DefaultRouter
from rest_framework.routers import Route
class ReadOnlyRouter(DefaultRouter):
"""
A router for read-only APIs, which USES trailing slashes.
"""
routes = [
Route(url=r'^{prefix}{trailing_slash}$',
mapping={'get': 'list'},
... | <commit_before><commit_msg>Add router for read-only APIs<commit_after> | from rest_framework.routers import DefaultRouter
from rest_framework.routers import Route
class ReadOnlyRouter(DefaultRouter):
"""
A router for read-only APIs, which USES trailing slashes.
"""
routes = [
Route(url=r'^{prefix}{trailing_slash}$',
mapping={'get': 'list'},
... | Add router for read-only APIsfrom rest_framework.routers import DefaultRouter
from rest_framework.routers import Route
class ReadOnlyRouter(DefaultRouter):
"""
A router for read-only APIs, which USES trailing slashes.
"""
routes = [
Route(url=r'^{prefix}{trailing_slash}$',
mappin... | <commit_before><commit_msg>Add router for read-only APIs<commit_after>from rest_framework.routers import DefaultRouter
from rest_framework.routers import Route
class ReadOnlyRouter(DefaultRouter):
"""
A router for read-only APIs, which USES trailing slashes.
"""
routes = [
Route(url=r'^{prefix... | |
eace3feab39e7dc44e83680147e6efdaff4ee4d7 | scripts/ecs_clean_cluster.py | scripts/ecs_clean_cluster.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Remove unused Docker containers and images from an ECS cluster.
Usage:
ecs_clean_cluster.py --key=<PRIV_KEY> --cluster=<CLUSTER_NAME>
ecs_clean_cluster.py -h | --help
Options:
--cluster=<CLUSTER_NAME> Name of the ECS cluster to clean.
--key=<PRIV_KEY> ... | Add a script for cleaning our ECS clusters | Add a script for cleaning our ECS clusters
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | Add a script for cleaning our ECS clusters | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Remove unused Docker containers and images from an ECS cluster.
Usage:
ecs_clean_cluster.py --key=<PRIV_KEY> --cluster=<CLUSTER_NAME>
ecs_clean_cluster.py -h | --help
Options:
--cluster=<CLUSTER_NAME> Name of the ECS cluster to clean.
--key=<PRIV_KEY> ... | <commit_before><commit_msg>Add a script for cleaning our ECS clusters<commit_after> | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Remove unused Docker containers and images from an ECS cluster.
Usage:
ecs_clean_cluster.py --key=<PRIV_KEY> --cluster=<CLUSTER_NAME>
ecs_clean_cluster.py -h | --help
Options:
--cluster=<CLUSTER_NAME> Name of the ECS cluster to clean.
--key=<PRIV_KEY> ... | Add a script for cleaning our ECS clusters#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Remove unused Docker containers and images from an ECS cluster.
Usage:
ecs_clean_cluster.py --key=<PRIV_KEY> --cluster=<CLUSTER_NAME>
ecs_clean_cluster.py -h | --help
Options:
--cluster=<CLUSTER_NAME> Name of the ECS... | <commit_before><commit_msg>Add a script for cleaning our ECS clusters<commit_after>#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Remove unused Docker containers and images from an ECS cluster.
Usage:
ecs_clean_cluster.py --key=<PRIV_KEY> --cluster=<CLUSTER_NAME>
ecs_clean_cluster.py -h | --help
Options:
... | |
d32aa1f54cd1224de506564089805576cb3ce286 | json2csv.py | json2csv.py | import json
def main():
input_json = json.load(open("photo_id_to_business_id.json"))
# print the header of output csv file
print 'photo_id,business_id,label'
# for each entry in input json file print one csv row
for i in xrange(len(input_json)):
photo_id = input_json[i]['photo_id'... | Add conversion from json to csv format | Add conversion from json to csv format | Python | mit | aysent/yelp-photo-explorer | Add conversion from json to csv format | import json
def main():
input_json = json.load(open("photo_id_to_business_id.json"))
# print the header of output csv file
print 'photo_id,business_id,label'
# for each entry in input json file print one csv row
for i in xrange(len(input_json)):
photo_id = input_json[i]['photo_id'... | <commit_before><commit_msg>Add conversion from json to csv format<commit_after> | import json
def main():
input_json = json.load(open("photo_id_to_business_id.json"))
# print the header of output csv file
print 'photo_id,business_id,label'
# for each entry in input json file print one csv row
for i in xrange(len(input_json)):
photo_id = input_json[i]['photo_id'... | Add conversion from json to csv formatimport json
def main():
input_json = json.load(open("photo_id_to_business_id.json"))
# print the header of output csv file
print 'photo_id,business_id,label'
# for each entry in input json file print one csv row
for i in xrange(len(input_json)):
... | <commit_before><commit_msg>Add conversion from json to csv format<commit_after>import json
def main():
input_json = json.load(open("photo_id_to_business_id.json"))
# print the header of output csv file
print 'photo_id,business_id,label'
# for each entry in input json file print one csv row
... | |
be946d43536b06f6a6786b2fc2e379571ee30bfd | scorecard/tests/indicators/test_income_adjustments.py | scorecard/tests/indicators/test_income_adjustments.py | from django.test import SimpleTestCase
from ...profile_data.indicators import (
IncomeAdjustments,
)
from collections import defaultdict
class MockAPIData:
references = defaultdict(lambda: "foobar")
def __init__(self, results, years):
self.results = results
self.years = years
class Revenu... | Add working test for minimal income adjustment functionality | Add working test for minimal income adjustment functionality
| Python | mit | Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data | Add working test for minimal income adjustment functionality | from django.test import SimpleTestCase
from ...profile_data.indicators import (
IncomeAdjustments,
)
from collections import defaultdict
class MockAPIData:
references = defaultdict(lambda: "foobar")
def __init__(self, results, years):
self.results = results
self.years = years
class Revenu... | <commit_before><commit_msg>Add working test for minimal income adjustment functionality<commit_after> | from django.test import SimpleTestCase
from ...profile_data.indicators import (
IncomeAdjustments,
)
from collections import defaultdict
class MockAPIData:
references = defaultdict(lambda: "foobar")
def __init__(self, results, years):
self.results = results
self.years = years
class Revenu... | Add working test for minimal income adjustment functionalityfrom django.test import SimpleTestCase
from ...profile_data.indicators import (
IncomeAdjustments,
)
from collections import defaultdict
class MockAPIData:
references = defaultdict(lambda: "foobar")
def __init__(self, results, years):
self... | <commit_before><commit_msg>Add working test for minimal income adjustment functionality<commit_after>from django.test import SimpleTestCase
from ...profile_data.indicators import (
IncomeAdjustments,
)
from collections import defaultdict
class MockAPIData:
references = defaultdict(lambda: "foobar")
def __i... | |
95d719c79999f65f373830127763f79678425f46 | gala-training-crossval-sub.py | gala-training-crossval-sub.py | # IPython log file
from gala import classify
datas = []
labels = []
import numpy as np
list(map(np.shape, labels))
for i in range(3, 4):
data, label = classify.load_training_data_from_disk('training-data-%i.h5' % i, names=['data', 'labels'])
datas.append(data)
labels.append(label[:, 0])
X0 = np.conca... | Add script to test RF performance on gala data | Add script to test RF performance on gala data
| Python | bsd-3-clause | jni/gala-scripts | Add script to test RF performance on gala data | # IPython log file
from gala import classify
datas = []
labels = []
import numpy as np
list(map(np.shape, labels))
for i in range(3, 4):
data, label = classify.load_training_data_from_disk('training-data-%i.h5' % i, names=['data', 'labels'])
datas.append(data)
labels.append(label[:, 0])
X0 = np.conca... | <commit_before><commit_msg>Add script to test RF performance on gala data<commit_after> | # IPython log file
from gala import classify
datas = []
labels = []
import numpy as np
list(map(np.shape, labels))
for i in range(3, 4):
data, label = classify.load_training_data_from_disk('training-data-%i.h5' % i, names=['data', 'labels'])
datas.append(data)
labels.append(label[:, 0])
X0 = np.conca... | Add script to test RF performance on gala data# IPython log file
from gala import classify
datas = []
labels = []
import numpy as np
list(map(np.shape, labels))
for i in range(3, 4):
data, label = classify.load_training_data_from_disk('training-data-%i.h5' % i, names=['data', 'labels'])
datas.append(data)
... | <commit_before><commit_msg>Add script to test RF performance on gala data<commit_after># IPython log file
from gala import classify
datas = []
labels = []
import numpy as np
list(map(np.shape, labels))
for i in range(3, 4):
data, label = classify.load_training_data_from_disk('training-data-%i.h5' % i, names=['dat... | |
c6a98ccdb32e24c8958bf5979b1aa084ba04792a | tests/vtc-from-controlset.py | tests/vtc-from-controlset.py | #!/usr/bin/python
#
# Generate a varnishtest script to validate the preclassified
# U-A strings in the control set.
#
import sys
HEADER="""varnishtest "automatic test of control set"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
s... | Create test case from control set | Create test case from control set
| Python | bsd-2-clause | varnish/varnish-devicedetect,wikp/varnish-devicedetect,varnish/varnish-devicedetect,kevinquinnyo/varnish-devicedetect,wikp/varnish-devicedetect,kevinquinnyo/varnish-devicedetect | Create test case from control set | #!/usr/bin/python
#
# Generate a varnishtest script to validate the preclassified
# U-A strings in the control set.
#
import sys
HEADER="""varnishtest "automatic test of control set"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
s... | <commit_before><commit_msg>Create test case from control set<commit_after> | #!/usr/bin/python
#
# Generate a varnishtest script to validate the preclassified
# U-A strings in the control set.
#
import sys
HEADER="""varnishtest "automatic test of control set"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
s... | Create test case from control set#!/usr/bin/python
#
# Generate a varnishtest script to validate the preclassified
# U-A strings in the control set.
#
import sys
HEADER="""varnishtest "automatic test of control set"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir... | <commit_before><commit_msg>Create test case from control set<commit_after>#!/usr/bin/python
#
# Generate a varnishtest script to validate the preclassified
# U-A strings in the control set.
#
import sys
HEADER="""varnishtest "automatic test of control set"
server s1 {
rxreq
txresp
} -start
varnish v1 -vc... | |
86b04012c3e6e9c0606ac314da6f74a51d5d7cc3 | word_bucket.py | word_bucket.py | #!/usr/bin/env python
import random
import sys
"""
Takes a string containing {sections} to be replaced. Replaces them until no
braces are left in the string.
Optionally takes an argument to use as seed, for assigning results to things.
Argument can be any string, most likely a name.
"""
#string = '{title} of {adj} {... | Save my musings to git. | Save my musings to git.
| Python | apache-2.0 | Qalthos/wordbuckets | Save my musings to git. | #!/usr/bin/env python
import random
import sys
"""
Takes a string containing {sections} to be replaced. Replaces them until no
braces are left in the string.
Optionally takes an argument to use as seed, for assigning results to things.
Argument can be any string, most likely a name.
"""
#string = '{title} of {adj} {... | <commit_before><commit_msg>Save my musings to git.<commit_after> | #!/usr/bin/env python
import random
import sys
"""
Takes a string containing {sections} to be replaced. Replaces them until no
braces are left in the string.
Optionally takes an argument to use as seed, for assigning results to things.
Argument can be any string, most likely a name.
"""
#string = '{title} of {adj} {... | Save my musings to git.#!/usr/bin/env python
import random
import sys
"""
Takes a string containing {sections} to be replaced. Replaces them until no
braces are left in the string.
Optionally takes an argument to use as seed, for assigning results to things.
Argument can be any string, most likely a name.
"""
#strin... | <commit_before><commit_msg>Save my musings to git.<commit_after>#!/usr/bin/env python
import random
import sys
"""
Takes a string containing {sections} to be replaced. Replaces them until no
braces are left in the string.
Optionally takes an argument to use as seed, for assigning results to things.
Argument can be an... | |
89a427994c754fc63d01d7172e77f849039a356a | corehq/apps/domain/management/commands/migrate_domain_countries.py | corehq/apps/domain/management/commands/migrate_domain_countries.py | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... | Change migration to fallback to old country | Change migration to fallback to old country
| Python | bsd-3-clause | dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... | <commit_before>from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(s... | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... | from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(self, *args, **o... | <commit_before>from django.core.management.base import LabelCommand
from django_countries.countries import COUNTRIES
from corehq.apps.domain.models import Domain
class Command(LabelCommand):
help = "Migrates old django domain countries from string to list. Sept 2014."
args = ""
label = ""
def handle(s... |
1a856fa1894a3818a8f9311cef8c469a50fed48a | tests/test_selenium.py | tests/test_selenium.py | """
Setting up functional testing for layout web tool.
"""
import unittest
import urllib
from flask import Flask
from flask_testing import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class TestBase(LiveServerTestCase):
def create_app(self):
app =... | Add functional testing using Selenium Webdriver | Add functional testing using Selenium Webdriver
Setting up the skeleton and initial tests for unit testing of front-end of layout-web-tool
| Python | mit | in-toto/layout-web-tool,in-toto/layout-web-tool,in-toto/layout-web-tool | Add functional testing using Selenium Webdriver
Setting up the skeleton and initial tests for unit testing of front-end of layout-web-tool | """
Setting up functional testing for layout web tool.
"""
import unittest
import urllib
from flask import Flask
from flask_testing import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class TestBase(LiveServerTestCase):
def create_app(self):
app =... | <commit_before><commit_msg>Add functional testing using Selenium Webdriver
Setting up the skeleton and initial tests for unit testing of front-end of layout-web-tool<commit_after> | """
Setting up functional testing for layout web tool.
"""
import unittest
import urllib
from flask import Flask
from flask_testing import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class TestBase(LiveServerTestCase):
def create_app(self):
app =... | Add functional testing using Selenium Webdriver
Setting up the skeleton and initial tests for unit testing of front-end of layout-web-tool"""
Setting up functional testing for layout web tool.
"""
import unittest
import urllib
from flask import Flask
from flask_testing import LiveServerTestCase
from selenium impor... | <commit_before><commit_msg>Add functional testing using Selenium Webdriver
Setting up the skeleton and initial tests for unit testing of front-end of layout-web-tool<commit_after>"""
Setting up functional testing for layout web tool.
"""
import unittest
import urllib
from flask import Flask
from flask_testing impo... | |
11c22561bd0475f9b58befd8bb47068c7c3a652a | api/players/management/commands/update_all_player_mmrs.py | api/players/management/commands/update_all_player_mmrs.py | import time
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from django.utils import timezone
from players.models import Player
class Command(BaseCommand):
def handle(self, *args, **options):
start_date = timezone.now() - ti... | Add management command to update all player MMRs | Add management command to update all player MMRs
| Python | apache-2.0 | prattl/teamfinder,prattl/teamfinder,prattl/teamfinder,prattl/teamfinder | Add management command to update all player MMRs | import time
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from django.utils import timezone
from players.models import Player
class Command(BaseCommand):
def handle(self, *args, **options):
start_date = timezone.now() - ti... | <commit_before><commit_msg>Add management command to update all player MMRs<commit_after> | import time
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from django.utils import timezone
from players.models import Player
class Command(BaseCommand):
def handle(self, *args, **options):
start_date = timezone.now() - ti... | Add management command to update all player MMRsimport time
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from django.utils import timezone
from players.models import Player
class Command(BaseCommand):
def handle(self, *args, **op... | <commit_before><commit_msg>Add management command to update all player MMRs<commit_after>import time
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from django.utils import timezone
from players.models import Player
class Command(BaseC... | |
f5501cee5b1e7410a5d19522d14f1c9e49ad9d96 | tests/test_sorting_and_searching/test_max_subarray.py | tests/test_sorting_and_searching/test_max_subarray.py | import unittest
from aids.sorting_and_searching.max_subarray import max_subarray
class MaxSubArrayTestCase(unittest.TestCase):
'''
Unit tests for max_subarray
'''
def setUp(self):
pass
def test_all_positive(self):
pass
def test_all_negative(self):
pass
def test... | Add unit tests for max_subarray | Add unit tests for max_subarray
| Python | mit | ueg1990/aids | Add unit tests for max_subarray | import unittest
from aids.sorting_and_searching.max_subarray import max_subarray
class MaxSubArrayTestCase(unittest.TestCase):
'''
Unit tests for max_subarray
'''
def setUp(self):
pass
def test_all_positive(self):
pass
def test_all_negative(self):
pass
def test... | <commit_before><commit_msg>Add unit tests for max_subarray<commit_after> | import unittest
from aids.sorting_and_searching.max_subarray import max_subarray
class MaxSubArrayTestCase(unittest.TestCase):
'''
Unit tests for max_subarray
'''
def setUp(self):
pass
def test_all_positive(self):
pass
def test_all_negative(self):
pass
def test... | Add unit tests for max_subarrayimport unittest
from aids.sorting_and_searching.max_subarray import max_subarray
class MaxSubArrayTestCase(unittest.TestCase):
'''
Unit tests for max_subarray
'''
def setUp(self):
pass
def test_all_positive(self):
pass
def test_all_negative(se... | <commit_before><commit_msg>Add unit tests for max_subarray<commit_after>import unittest
from aids.sorting_and_searching.max_subarray import max_subarray
class MaxSubArrayTestCase(unittest.TestCase):
'''
Unit tests for max_subarray
'''
def setUp(self):
pass
def test_all_positive(self):
... | |
1d77b6645e28f1e614502f6bd9bb5458383ecdcf | jacquard/tests/test_config.py | jacquard/tests/test_config.py | import io
import sys
import tempfile
import textwrap
from jacquard.config import load_config
CONFIG_FILE = """
[storage]
engine = dummy
url = dummy
[directory]
engine = dummy
[test_section]
test_key = test_value
"""
def load_test_config(extra=''):
f = io.StringIO(CONFIG_FILE + textwrap.dedent(extra))
retu... | Add tests for config loading | Add tests for config loading
| Python | mit | prophile/jacquard,prophile/jacquard | Add tests for config loading | import io
import sys
import tempfile
import textwrap
from jacquard.config import load_config
CONFIG_FILE = """
[storage]
engine = dummy
url = dummy
[directory]
engine = dummy
[test_section]
test_key = test_value
"""
def load_test_config(extra=''):
f = io.StringIO(CONFIG_FILE + textwrap.dedent(extra))
retu... | <commit_before><commit_msg>Add tests for config loading<commit_after> | import io
import sys
import tempfile
import textwrap
from jacquard.config import load_config
CONFIG_FILE = """
[storage]
engine = dummy
url = dummy
[directory]
engine = dummy
[test_section]
test_key = test_value
"""
def load_test_config(extra=''):
f = io.StringIO(CONFIG_FILE + textwrap.dedent(extra))
retu... | Add tests for config loadingimport io
import sys
import tempfile
import textwrap
from jacquard.config import load_config
CONFIG_FILE = """
[storage]
engine = dummy
url = dummy
[directory]
engine = dummy
[test_section]
test_key = test_value
"""
def load_test_config(extra=''):
f = io.StringIO(CONFIG_FILE + text... | <commit_before><commit_msg>Add tests for config loading<commit_after>import io
import sys
import tempfile
import textwrap
from jacquard.config import load_config
CONFIG_FILE = """
[storage]
engine = dummy
url = dummy
[directory]
engine = dummy
[test_section]
test_key = test_value
"""
def load_test_config(extra=''... | |
966548e142023eaa1326344c62dbce535095f53a | osf/migrations/0042_add_registration_registered_date_desc_index.py | osf/migrations/0042_add_registration_registered_date_desc_index.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 20:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0041_auto_20170308_1932'),
]
operations = [
migrations.RunSQL(
[
... | Add indexes to make the things faster. | Add indexes to make the things faster.
| Python | apache-2.0 | Johnetordoff/osf.io,sloria/osf.io,baylee-d/osf.io,binoculars/osf.io,brianjgeiger/osf.io,baylee-d/osf.io,acshi/osf.io,leb2dg/osf.io,TomBaxter/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,felliott/osf.io,mattclark/osf.io,felliott/osf.io,laurenrevere/osf.io,icereval/osf.io,pattisdr/osf.io,cslzchen/osf.io,CenterForOpenSc... | Add indexes to make the things faster. | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 20:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0041_auto_20170308_1932'),
]
operations = [
migrations.RunSQL(
[
... | <commit_before><commit_msg>Add indexes to make the things faster.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 20:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0041_auto_20170308_1932'),
]
operations = [
migrations.RunSQL(
[
... | Add indexes to make the things faster.# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 20:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0041_auto_20170308_1932'),
]
operations = [
... | <commit_before><commit_msg>Add indexes to make the things faster.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 20:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0041_auto_2017030... | |
791e079bd31184f9ad6cd845bda29a49ffc85d5d | tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py | tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file for invalid nonterminals tests | Add file for invalid nonterminals tests
| Python | mit | PatrikValkovic/grammpy | Add file for invalid nonterminals tests | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add file for invalid nonterminals tests<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file for invalid nonterminals tests#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '_... | <commit_before><commit_msg>Add file for invalid nonterminals tests<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCa... | |
aa0a8d851f51b62e6fb5ee32c1fa95e70230b2ae | ilastik/core/classifiers/classifierRandomForestVariableImportance.py | ilastik/core/classifiers/classifierRandomForestVariableImportance.py | from classifierBase import *
import h5py
class ClassifierRandomForestVariableImportance(ClassifierBase):
#human readable information
name = "RandomForest classifier with variable importance"
description = "Basic RandomForest classifier with computation of variable importance"
author = "HCI, University... | Add variable selection to RF | Add variable selection to RF
| Python | bsd-2-clause | ilastik/ilastik-0.5,ilastik/ilastik-0.5,ilastik/ilastik-0.5 | Add variable selection to RF | from classifierBase import *
import h5py
class ClassifierRandomForestVariableImportance(ClassifierBase):
#human readable information
name = "RandomForest classifier with variable importance"
description = "Basic RandomForest classifier with computation of variable importance"
author = "HCI, University... | <commit_before><commit_msg>Add variable selection to RF<commit_after> | from classifierBase import *
import h5py
class ClassifierRandomForestVariableImportance(ClassifierBase):
#human readable information
name = "RandomForest classifier with variable importance"
description = "Basic RandomForest classifier with computation of variable importance"
author = "HCI, University... | Add variable selection to RFfrom classifierBase import *
import h5py
class ClassifierRandomForestVariableImportance(ClassifierBase):
#human readable information
name = "RandomForest classifier with variable importance"
description = "Basic RandomForest classifier with computation of variable importance"
... | <commit_before><commit_msg>Add variable selection to RF<commit_after>from classifierBase import *
import h5py
class ClassifierRandomForestVariableImportance(ClassifierBase):
#human readable information
name = "RandomForest classifier with variable importance"
description = "Basic RandomForest classifier w... | |
bb0009a7d36b52b92ac988048ed72992c074b20e | tests/test_find.py | tests/test_find.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
from click.testing import CliRunner
import mock
from tldr import cli
class TestFind(unittest.TestCase):
def setUp(self):
self.runner = CliRunner()
with mock.patch(... | Add test for `tldr find {{command}}` | Add test for `tldr find {{command}}`
| Python | mit | lord63/tldr.py | Add test for `tldr find {{command}}` | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
from click.testing import CliRunner
import mock
from tldr import cli
class TestFind(unittest.TestCase):
def setUp(self):
self.runner = CliRunner()
with mock.patch(... | <commit_before><commit_msg>Add test for `tldr find {{command}}`<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
from click.testing import CliRunner
import mock
from tldr import cli
class TestFind(unittest.TestCase):
def setUp(self):
self.runner = CliRunner()
with mock.patch(... | Add test for `tldr find {{command}}`#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
from click.testing import CliRunner
import mock
from tldr import cli
class TestFind(unittest.TestCase):
def setUp(self):
self.runner = ... | <commit_before><commit_msg>Add test for `tldr find {{command}}`<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from os import path
import unittest
from click.testing import CliRunner
import mock
from tldr import cli
class TestFind(unittest.TestCase):
... | |
ffe0ce0c7ba2511ecc59a3a7f356ced8570c17f4 | lambdas/stop_running_tasks.py | lambdas/stop_running_tasks.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Stop all the instances of a running task.
Our applications load config from an S3 bucket at startup. When the S3 config
changes, this Lambda is triggered. We need to stop any running instances
of the application, then the ECS scheduler will restart them and they'll... | Add a Python script that stops all running instances of a task | Add a Python script that stops all running instances of a task
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | Add a Python script that stops all running instances of a task | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Stop all the instances of a running task.
Our applications load config from an S3 bucket at startup. When the S3 config
changes, this Lambda is triggered. We need to stop any running instances
of the application, then the ECS scheduler will restart them and they'll... | <commit_before><commit_msg>Add a Python script that stops all running instances of a task<commit_after> | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Stop all the instances of a running task.
Our applications load config from an S3 bucket at startup. When the S3 config
changes, this Lambda is triggered. We need to stop any running instances
of the application, then the ECS scheduler will restart them and they'll... | Add a Python script that stops all running instances of a task#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Stop all the instances of a running task.
Our applications load config from an S3 bucket at startup. When the S3 config
changes, this Lambda is triggered. We need to stop any running instances
of the app... | <commit_before><commit_msg>Add a Python script that stops all running instances of a task<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Stop all the instances of a running task.
Our applications load config from an S3 bucket at startup. When the S3 config
changes, this Lambda is triggered. We need... | |
228ff64938268e454eb4c66db3ceaf63a4692272 | l10n_it_split_payment/migrations/14.0.1.0.0/pre-move_split_amount.py | l10n_it_split_payment/migrations/14.0.1.0.0/pre-move_split_amount.py | # Copyright 2021 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
openupgrade.add_fields(
env,
[("amount_sp", "account.move", False, "float", False, ... | Move amount_sp to account_move Otherwise the value is recomputed and the following error might occur: Impossibile aggiungere/modificare registrazioni antecedenti o pari alla data di chiusura 24/09/2020. | Move amount_sp to account_move
Otherwise the value is recomputed and the following error might occur:
Impossibile aggiungere/modificare registrazioni antecedenti o pari alla data di chiusura 24/09/2020.
| Python | agpl-3.0 | OCA/l10n-italy,OCA/l10n-italy,OCA/l10n-italy,dcorio/l10n-italy,dcorio/l10n-italy,dcorio/l10n-italy | Move amount_sp to account_move
Otherwise the value is recomputed and the following error might occur:
Impossibile aggiungere/modificare registrazioni antecedenti o pari alla data di chiusura 24/09/2020. | # Copyright 2021 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
openupgrade.add_fields(
env,
[("amount_sp", "account.move", False, "float", False, ... | <commit_before><commit_msg>Move amount_sp to account_move
Otherwise the value is recomputed and the following error might occur:
Impossibile aggiungere/modificare registrazioni antecedenti o pari alla data di chiusura 24/09/2020.<commit_after> | # Copyright 2021 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
openupgrade.add_fields(
env,
[("amount_sp", "account.move", False, "float", False, ... | Move amount_sp to account_move
Otherwise the value is recomputed and the following error might occur:
Impossibile aggiungere/modificare registrazioni antecedenti o pari alla data di chiusura 24/09/2020.# Copyright 2021 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.... | <commit_before><commit_msg>Move amount_sp to account_move
Otherwise the value is recomputed and the following error might occur:
Impossibile aggiungere/modificare registrazioni antecedenti o pari alla data di chiusura 24/09/2020.<commit_after># Copyright 2021 Simone Rubino - Agile Business Group
# License AGPL-3.0 or... | |
1c496de7ce5aeb9e7d322290d8250aa73d32e6cf | museum_site/migrations/0061_file_license.py | museum_site/migrations/0061_file_license.py | # Generated by Django 3.2.4 on 2021-06-11 21:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0060_auto_20210611_0425'),
]
operations = [
migrations.AddField(
model_name='file',
name='license',
... | Add license field to files | Add license field to files
| Python | mit | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | Add license field to files | # Generated by Django 3.2.4 on 2021-06-11 21:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0060_auto_20210611_0425'),
]
operations = [
migrations.AddField(
model_name='file',
name='license',
... | <commit_before><commit_msg>Add license field to files<commit_after> | # Generated by Django 3.2.4 on 2021-06-11 21:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0060_auto_20210611_0425'),
]
operations = [
migrations.AddField(
model_name='file',
name='license',
... | Add license field to files# Generated by Django 3.2.4 on 2021-06-11 21:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0060_auto_20210611_0425'),
]
operations = [
migrations.AddField(
model_name='file',
... | <commit_before><commit_msg>Add license field to files<commit_after># Generated by Django 3.2.4 on 2021-06-11 21:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0060_auto_20210611_0425'),
]
operations = [
migrations.Add... | |
5eea40913683cde09b097cb3069cc6fd85809f23 | lintcode/Easy/109_Triangle.py | lintcode/Easy/109_Triangle.py | class Solution:
"""
@param triangle: a list of lists of integers.
@return: An integer, minimum path sum.
"""
def minimumTotal(self, triangle):
# write your code here
res = triangle[0]
for i in range(1, len(triangle)):
for j in range(len(triangle[i]) - 1, -1, -1):
... | Add solution to lintcode question 109 | Add solution to lintcode question 109
| Python | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Add solution to lintcode question 109 | class Solution:
"""
@param triangle: a list of lists of integers.
@return: An integer, minimum path sum.
"""
def minimumTotal(self, triangle):
# write your code here
res = triangle[0]
for i in range(1, len(triangle)):
for j in range(len(triangle[i]) - 1, -1, -1):
... | <commit_before><commit_msg>Add solution to lintcode question 109<commit_after> | class Solution:
"""
@param triangle: a list of lists of integers.
@return: An integer, minimum path sum.
"""
def minimumTotal(self, triangle):
# write your code here
res = triangle[0]
for i in range(1, len(triangle)):
for j in range(len(triangle[i]) - 1, -1, -1):
... | Add solution to lintcode question 109class Solution:
"""
@param triangle: a list of lists of integers.
@return: An integer, minimum path sum.
"""
def minimumTotal(self, triangle):
# write your code here
res = triangle[0]
for i in range(1, len(triangle)):
for j in ... | <commit_before><commit_msg>Add solution to lintcode question 109<commit_after>class Solution:
"""
@param triangle: a list of lists of integers.
@return: An integer, minimum path sum.
"""
def minimumTotal(self, triangle):
# write your code here
res = triangle[0]
for i in range... | |
d1cafed7ecb9e3fd92a1a7f405bd6832086ff30c | test/integration/ggrc/notifications/test_assignable_notifications.py | test/integration/ggrc/notifications/test_assignable_notifications.py | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
from freezegun import freeze_time
from datetime import datetime
from mock impor... | Add basic tests for request notifications | Add basic tests for request notifications
Test that imported requests get entries in the notifications table.
| Python | apache-2.0 | VinnieJohns/ggrc-core,prasannav7/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,j0gurt/ggrc-core,prasannav7/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,kr41/ggrc-core,plamut/ggrc-core... | Add basic tests for request notifications
Test that imported requests get entries in the notifications table. | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
from freezegun import freeze_time
from datetime import datetime
from mock impor... | <commit_before><commit_msg>Add basic tests for request notifications
Test that imported requests get entries in the notifications table.<commit_after> | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
from freezegun import freeze_time
from datetime import datetime
from mock impor... | Add basic tests for request notifications
Test that imported requests get entries in the notifications table.# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained ... | <commit_before><commit_msg>Add basic tests for request notifications
Test that imported requests get entries in the notifications table.<commit_after># Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created B... | |
c1ebc02200e7b934ae6f1f5a40dc6c513b495a99 | monitor.py | monitor.py | import re
from subprocess import Popen, PIPE, STDOUT
from sys import stdout
p = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE,
stderr=STDOUT, bufsize=1)
c = re.compile(r'KERNEL\[[^]]*\]\s*add\s*(?P<dev_path>\S*)\s*\(block\)')
for line in iter(p.stdout.readline, b''):
m = c.match(lin... | Print inserted block devices' paths | Print inserted block devices' paths
| Python | mit | drkitty/arise | Print inserted block devices' paths | import re
from subprocess import Popen, PIPE, STDOUT
from sys import stdout
p = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE,
stderr=STDOUT, bufsize=1)
c = re.compile(r'KERNEL\[[^]]*\]\s*add\s*(?P<dev_path>\S*)\s*\(block\)')
for line in iter(p.stdout.readline, b''):
m = c.match(lin... | <commit_before><commit_msg>Print inserted block devices' paths<commit_after> | import re
from subprocess import Popen, PIPE, STDOUT
from sys import stdout
p = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE,
stderr=STDOUT, bufsize=1)
c = re.compile(r'KERNEL\[[^]]*\]\s*add\s*(?P<dev_path>\S*)\s*\(block\)')
for line in iter(p.stdout.readline, b''):
m = c.match(lin... | Print inserted block devices' pathsimport re
from subprocess import Popen, PIPE, STDOUT
from sys import stdout
p = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE,
stderr=STDOUT, bufsize=1)
c = re.compile(r'KERNEL\[[^]]*\]\s*add\s*(?P<dev_path>\S*)\s*\(block\)')
for line in iter(p.stdout.... | <commit_before><commit_msg>Print inserted block devices' paths<commit_after>import re
from subprocess import Popen, PIPE, STDOUT
from sys import stdout
p = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE,
stderr=STDOUT, bufsize=1)
c = re.compile(r'KERNEL\[[^]]*\]\s*add\s*(?P<dev_path>\S*)\... | |
ac41939561575f60ed028101d9bf76bef8705829 | parliament/bills/vote_urls.py | parliament/bills/vote_urls.py | from django.conf.urls import *
urlpatterns = patterns('parliament.bills.views',
url(r'^$', 'votes_for_session', name='votes'),
(r'^(?:session/)?(?P<session_id>\d+-\d)/$', 'votes_for_session'),
url(r'^(?P<session_id>\d+-\d)/(?P<number>\d+)/$', 'vote', name='vote'),
(r'^(?P<vote_id>\d+)/$', 'vote_pk_redi... | Add new urls file for votes | Add new urls file for votes
| Python | agpl-3.0 | litui/openparliament,litui/openparliament,rhymeswithcycle/openparliament,twhyte/openparliament,twhyte/openparliament,rhymeswithcycle/openparliament,rhymeswithcycle/openparliament,twhyte/openparliament,litui/openparliament | Add new urls file for votes | from django.conf.urls import *
urlpatterns = patterns('parliament.bills.views',
url(r'^$', 'votes_for_session', name='votes'),
(r'^(?:session/)?(?P<session_id>\d+-\d)/$', 'votes_for_session'),
url(r'^(?P<session_id>\d+-\d)/(?P<number>\d+)/$', 'vote', name='vote'),
(r'^(?P<vote_id>\d+)/$', 'vote_pk_redi... | <commit_before><commit_msg>Add new urls file for votes<commit_after> | from django.conf.urls import *
urlpatterns = patterns('parliament.bills.views',
url(r'^$', 'votes_for_session', name='votes'),
(r'^(?:session/)?(?P<session_id>\d+-\d)/$', 'votes_for_session'),
url(r'^(?P<session_id>\d+-\d)/(?P<number>\d+)/$', 'vote', name='vote'),
(r'^(?P<vote_id>\d+)/$', 'vote_pk_redi... | Add new urls file for votesfrom django.conf.urls import *
urlpatterns = patterns('parliament.bills.views',
url(r'^$', 'votes_for_session', name='votes'),
(r'^(?:session/)?(?P<session_id>\d+-\d)/$', 'votes_for_session'),
url(r'^(?P<session_id>\d+-\d)/(?P<number>\d+)/$', 'vote', name='vote'),
(r'^(?P<vot... | <commit_before><commit_msg>Add new urls file for votes<commit_after>from django.conf.urls import *
urlpatterns = patterns('parliament.bills.views',
url(r'^$', 'votes_for_session', name='votes'),
(r'^(?:session/)?(?P<session_id>\d+-\d)/$', 'votes_for_session'),
url(r'^(?P<session_id>\d+-\d)/(?P<number>\d+)/... | |
37bc3da6fe5bcd8847d2fadc54100c18ab5b7730 | prolog/interpreter/test/test_callable_arg_interface.py | prolog/interpreter/test/test_callable_arg_interface.py | from prolog.interpreter.parsing import parse_file, TermBuilder
from prolog.interpreter.term import Atom, Number, Term
import py
def parse(inp):
t = parse_file(inp)
builder = TermBuilder()
return builder.build(t)
atom = parse('a.')[0]
term = parse('t(a, b, c, d, f).')[0]
def test_atom_get_signature():
... | Refactor translated main to work with new continuations and some minor changes for the translation to work | Refactor translated main to work with new continuations and some minor changes for the translation to work
| Python | mit | cosmoharrigan/pyrolog | Refactor translated main to work with new continuations and some minor changes for the translation to work | from prolog.interpreter.parsing import parse_file, TermBuilder
from prolog.interpreter.term import Atom, Number, Term
import py
def parse(inp):
t = parse_file(inp)
builder = TermBuilder()
return builder.build(t)
atom = parse('a.')[0]
term = parse('t(a, b, c, d, f).')[0]
def test_atom_get_signature():
... | <commit_before><commit_msg>Refactor translated main to work with new continuations and some minor changes for the translation to work<commit_after> | from prolog.interpreter.parsing import parse_file, TermBuilder
from prolog.interpreter.term import Atom, Number, Term
import py
def parse(inp):
t = parse_file(inp)
builder = TermBuilder()
return builder.build(t)
atom = parse('a.')[0]
term = parse('t(a, b, c, d, f).')[0]
def test_atom_get_signature():
... | Refactor translated main to work with new continuations and some minor changes for the translation to workfrom prolog.interpreter.parsing import parse_file, TermBuilder
from prolog.interpreter.term import Atom, Number, Term
import py
def parse(inp):
t = parse_file(inp)
builder = TermBuilder()
return builde... | <commit_before><commit_msg>Refactor translated main to work with new continuations and some minor changes for the translation to work<commit_after>from prolog.interpreter.parsing import parse_file, TermBuilder
from prolog.interpreter.term import Atom, Number, Term
import py
def parse(inp):
t = parse_file(inp)
... | |
d1ad98f58ea6a30269221a0d98c7c6cf544e90ec | get_images.py | get_images.py | from __future__ import with_statement
import urllib2, os, cStringIO
from bs4 import BeautifulSoup
from collections import defaultdict
DATA_DIR = 'data/'
IMG_DIR = 'data/images/'
DATA = 'data/testdata'
INTO_YOU = 'into you'
NOT_INTO_YOU = 'not into you'
VERDICT_STILL_OUT = 'verdict still out'
verdict_map = {"He's into... | Add sketch of script for getting images and verdict data from site | Add sketch of script for getting images and verdict data from site
| Python | mit | hausdorff/i-like-you,hausdorff/i-like-you | Add sketch of script for getting images and verdict data from site | from __future__ import with_statement
import urllib2, os, cStringIO
from bs4 import BeautifulSoup
from collections import defaultdict
DATA_DIR = 'data/'
IMG_DIR = 'data/images/'
DATA = 'data/testdata'
INTO_YOU = 'into you'
NOT_INTO_YOU = 'not into you'
VERDICT_STILL_OUT = 'verdict still out'
verdict_map = {"He's into... | <commit_before><commit_msg>Add sketch of script for getting images and verdict data from site<commit_after> | from __future__ import with_statement
import urllib2, os, cStringIO
from bs4 import BeautifulSoup
from collections import defaultdict
DATA_DIR = 'data/'
IMG_DIR = 'data/images/'
DATA = 'data/testdata'
INTO_YOU = 'into you'
NOT_INTO_YOU = 'not into you'
VERDICT_STILL_OUT = 'verdict still out'
verdict_map = {"He's into... | Add sketch of script for getting images and verdict data from sitefrom __future__ import with_statement
import urllib2, os, cStringIO
from bs4 import BeautifulSoup
from collections import defaultdict
DATA_DIR = 'data/'
IMG_DIR = 'data/images/'
DATA = 'data/testdata'
INTO_YOU = 'into you'
NOT_INTO_YOU = 'not into you'... | <commit_before><commit_msg>Add sketch of script for getting images and verdict data from site<commit_after>from __future__ import with_statement
import urllib2, os, cStringIO
from bs4 import BeautifulSoup
from collections import defaultdict
DATA_DIR = 'data/'
IMG_DIR = 'data/images/'
DATA = 'data/testdata'
INTO_YOU =... | |
a7bdab93801161224922c1324ecfdd16a4fe892f | registrations/test_models.py | registrations/test_models.py | from django.test import TestCase
from registrations.models import Registration
class RegistrationTests(TestCase):
def test_registration_status_external_id(self):
"""
If there is an external ID set, then the returned ID should be the
external ID, otherwise it should be the model's ID.
... | Add tests for the registration status | Add tests for the registration status
| Python | bsd-3-clause | praekeltfoundation/ndoh-hub,praekeltfoundation/ndoh-hub,praekeltfoundation/ndoh-hub | Add tests for the registration status | from django.test import TestCase
from registrations.models import Registration
class RegistrationTests(TestCase):
def test_registration_status_external_id(self):
"""
If there is an external ID set, then the returned ID should be the
external ID, otherwise it should be the model's ID.
... | <commit_before><commit_msg>Add tests for the registration status<commit_after> | from django.test import TestCase
from registrations.models import Registration
class RegistrationTests(TestCase):
def test_registration_status_external_id(self):
"""
If there is an external ID set, then the returned ID should be the
external ID, otherwise it should be the model's ID.
... | Add tests for the registration statusfrom django.test import TestCase
from registrations.models import Registration
class RegistrationTests(TestCase):
def test_registration_status_external_id(self):
"""
If there is an external ID set, then the returned ID should be the
external ID, otherw... | <commit_before><commit_msg>Add tests for the registration status<commit_after>from django.test import TestCase
from registrations.models import Registration
class RegistrationTests(TestCase):
def test_registration_status_external_id(self):
"""
If there is an external ID set, then the returned ID ... | |
8baac989b56dfaf24a0fc3cbb77ed0d842604acc | tools/compare_snack_formants.py | tools/compare_snack_formants.py | # Script to compare Snack formant methods on Windows
# There is a known discrepancy between Snack formants calculated using
# the full Snack Tcl library ('tcl' method) and the Windows standalone
# executable ('exe' method)
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from opensa... | Add script for comparing Snack formant methods on Windows | Add script for comparing Snack formant methods on Windows
This is for making the comparison Snack formant plots in
https://github.com/voicesauce/opensauce-python/issues/27
| Python | apache-2.0 | voicesauce/opensauce-python,voicesauce/opensauce-python,voicesauce/opensauce-python | Add script for comparing Snack formant methods on Windows
This is for making the comparison Snack formant plots in
https://github.com/voicesauce/opensauce-python/issues/27 | # Script to compare Snack formant methods on Windows
# There is a known discrepancy between Snack formants calculated using
# the full Snack Tcl library ('tcl' method) and the Windows standalone
# executable ('exe' method)
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from opensa... | <commit_before><commit_msg>Add script for comparing Snack formant methods on Windows
This is for making the comparison Snack formant plots in
https://github.com/voicesauce/opensauce-python/issues/27<commit_after> | # Script to compare Snack formant methods on Windows
# There is a known discrepancy between Snack formants calculated using
# the full Snack Tcl library ('tcl' method) and the Windows standalone
# executable ('exe' method)
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from opensa... | Add script for comparing Snack formant methods on Windows
This is for making the comparison Snack formant plots in
https://github.com/voicesauce/opensauce-python/issues/27# Script to compare Snack formant methods on Windows
# There is a known discrepancy between Snack formants calculated using
# the full Snack Tcl lib... | <commit_before><commit_msg>Add script for comparing Snack formant methods on Windows
This is for making the comparison Snack formant plots in
https://github.com/voicesauce/opensauce-python/issues/27<commit_after># Script to compare Snack formant methods on Windows
# There is a known discrepancy between Snack formants ... | |
2b22bf1db53a1fa514afcb4361cbc162908416c6 | alembic/versions/a8ad6e7fadd6_reset_current_typeemote_quest.py | alembic/versions/a8ad6e7fadd6_reset_current_typeemote_quest.py | """Reset current typeemote quest
Revision ID: a8ad6e7fadd6
Revises: 5f746af0a82d
Create Date: 2019-06-09 11:04:34.385778
"""
# revision identifiers, used by Alembic.
from pajbot.managers.redis import RedisManager
from pajbot.streamhelper import StreamHelper
revision = "a8ad6e7fadd6"
down_revision = "5f746af0a82d"
b... | Add alembic revision to reset current typeemote quest | Add alembic revision to reset current typeemote quest
| Python | mit | pajlada/pajbot,pajlada/tyggbot,pajlada/tyggbot,pajlada/tyggbot,pajlada/pajbot,pajlada/pajbot,pajlada/tyggbot,pajlada/pajbot | Add alembic revision to reset current typeemote quest | """Reset current typeemote quest
Revision ID: a8ad6e7fadd6
Revises: 5f746af0a82d
Create Date: 2019-06-09 11:04:34.385778
"""
# revision identifiers, used by Alembic.
from pajbot.managers.redis import RedisManager
from pajbot.streamhelper import StreamHelper
revision = "a8ad6e7fadd6"
down_revision = "5f746af0a82d"
b... | <commit_before><commit_msg>Add alembic revision to reset current typeemote quest<commit_after> | """Reset current typeemote quest
Revision ID: a8ad6e7fadd6
Revises: 5f746af0a82d
Create Date: 2019-06-09 11:04:34.385778
"""
# revision identifiers, used by Alembic.
from pajbot.managers.redis import RedisManager
from pajbot.streamhelper import StreamHelper
revision = "a8ad6e7fadd6"
down_revision = "5f746af0a82d"
b... | Add alembic revision to reset current typeemote quest"""Reset current typeemote quest
Revision ID: a8ad6e7fadd6
Revises: 5f746af0a82d
Create Date: 2019-06-09 11:04:34.385778
"""
# revision identifiers, used by Alembic.
from pajbot.managers.redis import RedisManager
from pajbot.streamhelper import StreamHelper
revis... | <commit_before><commit_msg>Add alembic revision to reset current typeemote quest<commit_after>"""Reset current typeemote quest
Revision ID: a8ad6e7fadd6
Revises: 5f746af0a82d
Create Date: 2019-06-09 11:04:34.385778
"""
# revision identifiers, used by Alembic.
from pajbot.managers.redis import RedisManager
from pajbo... | |
7d281b5139faf889de6e05c22e9ddd6c1ed7c05f | sara_flexbe_states/src/sara_flexbe_states/WonderlandClearPeoples.py | sara_flexbe_states/src/sara_flexbe_states/WonderlandClearPeoples.py | #!/usr/bin/env python
# encoding=utf8
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
"""
Created on 09/06/2018
@author: Lucas Maurice
"""
class WonderlandClearPeoples(EventState):
'''
Reset the people list in Wonderland. To use with care !
'''
def __init__(sel... | Create a state for reset peoples in wonderland. | Create a state for reset peoples in wonderland.
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | Create a state for reset peoples in wonderland. | #!/usr/bin/env python
# encoding=utf8
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
"""
Created on 09/06/2018
@author: Lucas Maurice
"""
class WonderlandClearPeoples(EventState):
'''
Reset the people list in Wonderland. To use with care !
'''
def __init__(sel... | <commit_before><commit_msg>Create a state for reset peoples in wonderland.<commit_after> | #!/usr/bin/env python
# encoding=utf8
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
"""
Created on 09/06/2018
@author: Lucas Maurice
"""
class WonderlandClearPeoples(EventState):
'''
Reset the people list in Wonderland. To use with care !
'''
def __init__(sel... | Create a state for reset peoples in wonderland.#!/usr/bin/env python
# encoding=utf8
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
"""
Created on 09/06/2018
@author: Lucas Maurice
"""
class WonderlandClearPeoples(EventState):
'''
Reset the people list in Wonderland. T... | <commit_before><commit_msg>Create a state for reset peoples in wonderland.<commit_after>#!/usr/bin/env python
# encoding=utf8
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
"""
Created on 09/06/2018
@author: Lucas Maurice
"""
class WonderlandClearPeoples(EventState):
'''
... | |
d20a30fce8d9025629688f8c3a8d65a6747ef713 | crawler/management/commands/compare_my_similar_with_google_similar_per_app.py | crawler/management/commands/compare_my_similar_with_google_similar_per_app.py | import logging.config
from operator import or_
from django.core.management.base import BaseCommand
from crawler.models import *
logger = logging.getLogger('crawler.command')
class Command(BaseCommand):
help = 'Generate comparison between google similar app and ours per app'
def handle(self, *args, **optio... | Create command to compare my similar with google similar per app | Create command to compare my similar with google similar per app
| Python | apache-2.0 | bkosawa/admin-recommendation | Create command to compare my similar with google similar per app | import logging.config
from operator import or_
from django.core.management.base import BaseCommand
from crawler.models import *
logger = logging.getLogger('crawler.command')
class Command(BaseCommand):
help = 'Generate comparison between google similar app and ours per app'
def handle(self, *args, **optio... | <commit_before><commit_msg>Create command to compare my similar with google similar per app<commit_after> | import logging.config
from operator import or_
from django.core.management.base import BaseCommand
from crawler.models import *
logger = logging.getLogger('crawler.command')
class Command(BaseCommand):
help = 'Generate comparison between google similar app and ours per app'
def handle(self, *args, **optio... | Create command to compare my similar with google similar per appimport logging.config
from operator import or_
from django.core.management.base import BaseCommand
from crawler.models import *
logger = logging.getLogger('crawler.command')
class Command(BaseCommand):
help = 'Generate comparison between google si... | <commit_before><commit_msg>Create command to compare my similar with google similar per app<commit_after>import logging.config
from operator import or_
from django.core.management.base import BaseCommand
from crawler.models import *
logger = logging.getLogger('crawler.command')
class Command(BaseCommand):
help... | |
c81fcc0a3604c59cbebcbc9618129b1f6b6007c7 | example-scripts/voctolight/voctolight_async_io.py | example-scripts/voctolight/voctolight_async_io.py | import asyncio
from enum import Enum
class Connection(object):
def __init__(self, interpreter):
self.interpreter = interpreter
self.loop = asyncio.get_event_loop()
def __del__(self):
self.loop.close()
def schedule(self, message):
self.loop.create_task(self.connection_future(message, self.inter... | Add prelim. async io version | Add prelim. async io version
| Python | mit | voc/voctomix,voc/voctomix,h01ger/voctomix,h01ger/voctomix | Add prelim. async io version | import asyncio
from enum import Enum
class Connection(object):
def __init__(self, interpreter):
self.interpreter = interpreter
self.loop = asyncio.get_event_loop()
def __del__(self):
self.loop.close()
def schedule(self, message):
self.loop.create_task(self.connection_future(message, self.inter... | <commit_before><commit_msg>Add prelim. async io version<commit_after> | import asyncio
from enum import Enum
class Connection(object):
def __init__(self, interpreter):
self.interpreter = interpreter
self.loop = asyncio.get_event_loop()
def __del__(self):
self.loop.close()
def schedule(self, message):
self.loop.create_task(self.connection_future(message, self.inter... | Add prelim. async io versionimport asyncio
from enum import Enum
class Connection(object):
def __init__(self, interpreter):
self.interpreter = interpreter
self.loop = asyncio.get_event_loop()
def __del__(self):
self.loop.close()
def schedule(self, message):
self.loop.create_task(self.connectio... | <commit_before><commit_msg>Add prelim. async io version<commit_after>import asyncio
from enum import Enum
class Connection(object):
def __init__(self, interpreter):
self.interpreter = interpreter
self.loop = asyncio.get_event_loop()
def __del__(self):
self.loop.close()
def schedule(self, message):... | |
a570c3a079cf7a6d3aa96b898b54b3b92a923c77 | homedisplay/info_transportation/migrations/0012_remove_line_only_show_next.py | homedisplay/info_transportation/migrations/0012_remove_line_only_show_next.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('info_transportation', '0011_line_icon'),
]
operations = [
migrations.RemoveField(
model_name='line',
... | Remove unused field from Line model | Remove unused field from Line model
| Python | bsd-3-clause | ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display | Remove unused field from Line model | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('info_transportation', '0011_line_icon'),
]
operations = [
migrations.RemoveField(
model_name='line',
... | <commit_before><commit_msg>Remove unused field from Line model<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('info_transportation', '0011_line_icon'),
]
operations = [
migrations.RemoveField(
model_name='line',
... | Remove unused field from Line model# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('info_transportation', '0011_line_icon'),
]
operations = [
migrations.RemoveField(
... | <commit_before><commit_msg>Remove unused field from Line model<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('info_transportation', '0011_line_icon'),
]
operations = ... | |
bba016305982967610ee7bd8e08bd45a176dbc7e | alpha-vantage/alphavantage.py | alpha-vantage/alphavantage.py | try:
# Python 3 import
from urllib.request import urlopen
except ImportError:
# Python 2.* import
from urllib2 import urlopen
from simplejson import loads
class AlphaVantage:
"""
This class is in charge of creating a python interface between the Alpha
Vantage restful API and your p... | Create data request function to get json from the API | feat: Create data request function to get json from the API
| Python | mit | RomelTorres/alpha_vantage | feat: Create data request function to get json from the API | try:
# Python 3 import
from urllib.request import urlopen
except ImportError:
# Python 2.* import
from urllib2 import urlopen
from simplejson import loads
class AlphaVantage:
"""
This class is in charge of creating a python interface between the Alpha
Vantage restful API and your p... | <commit_before><commit_msg>feat: Create data request function to get json from the API<commit_after> | try:
# Python 3 import
from urllib.request import urlopen
except ImportError:
# Python 2.* import
from urllib2 import urlopen
from simplejson import loads
class AlphaVantage:
"""
This class is in charge of creating a python interface between the Alpha
Vantage restful API and your p... | feat: Create data request function to get json from the APItry:
# Python 3 import
from urllib.request import urlopen
except ImportError:
# Python 2.* import
from urllib2 import urlopen
from simplejson import loads
class AlphaVantage:
"""
This class is in charge of creating a python interfa... | <commit_before><commit_msg>feat: Create data request function to get json from the API<commit_after>try:
# Python 3 import
from urllib.request import urlopen
except ImportError:
# Python 2.* import
from urllib2 import urlopen
from simplejson import loads
class AlphaVantage:
"""
This class ... | |
ae36703539f3e36a56db6a4f1c082ddbe25a28c4 | regulations/templatetags/to_list.py | regulations/templatetags/to_list.py | """Particularly when displaying bullets, it can be immensely helpful to
construct a list _within_ the template. Django's templates don't provide this
out of the box, so we need a new template tag. Suggestion from:
http://stackoverflow.com/a/34407158"""
from django import template
register = template.Library()
@r... | Add macro for creating a list | Add macro for creating a list
This also allows us to pass a list in as a variable to a template, which, in
turn, allows us to make things like a re-usable landing page search template
for ATF
| Python | cc0-1.0 | tadhg-ohiggins/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,18F/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site,18F/regulations-site,eregs/regulations-site | Add macro for creating a list
This also allows us to pass a list in as a variable to a template, which, in
turn, allows us to make things like a re-usable landing page search template
for ATF | """Particularly when displaying bullets, it can be immensely helpful to
construct a list _within_ the template. Django's templates don't provide this
out of the box, so we need a new template tag. Suggestion from:
http://stackoverflow.com/a/34407158"""
from django import template
register = template.Library()
@r... | <commit_before><commit_msg>Add macro for creating a list
This also allows us to pass a list in as a variable to a template, which, in
turn, allows us to make things like a re-usable landing page search template
for ATF<commit_after> | """Particularly when displaying bullets, it can be immensely helpful to
construct a list _within_ the template. Django's templates don't provide this
out of the box, so we need a new template tag. Suggestion from:
http://stackoverflow.com/a/34407158"""
from django import template
register = template.Library()
@r... | Add macro for creating a list
This also allows us to pass a list in as a variable to a template, which, in
turn, allows us to make things like a re-usable landing page search template
for ATF"""Particularly when displaying bullets, it can be immensely helpful to
construct a list _within_ the template. Django's templat... | <commit_before><commit_msg>Add macro for creating a list
This also allows us to pass a list in as a variable to a template, which, in
turn, allows us to make things like a re-usable landing page search template
for ATF<commit_after>"""Particularly when displaying bullets, it can be immensely helpful to
construct a lis... | |
6932aa2079f0696100cfc304921e947d020f9e15 | librisxl-tools/scripts/lddb_json_shape.py | librisxl-tools/scripts/lddb_json_shape.py | from __future__ import print_function, unicode_literals
import json
import sys
MAX_STATS = 20
def compute_shape(node, index):
if len(node) == 1 and '@id' in node:
count_value('@id', node['@id'], index)
return
rtype = node.get('@type')
shape = index.setdefault(rtype, {})
for k, vs in... | Add script for computing a JSON-LD shape from data | Add script for computing a JSON-LD shape from data
Measures frequency of used properties and classes and creates a shape
representing the shape of a selection of descriptions in LDDB.
| Python | apache-2.0 | libris/librisxl,libris/librisxl,libris/librisxl | Add script for computing a JSON-LD shape from data
Measures frequency of used properties and classes and creates a shape
representing the shape of a selection of descriptions in LDDB. | from __future__ import print_function, unicode_literals
import json
import sys
MAX_STATS = 20
def compute_shape(node, index):
if len(node) == 1 and '@id' in node:
count_value('@id', node['@id'], index)
return
rtype = node.get('@type')
shape = index.setdefault(rtype, {})
for k, vs in... | <commit_before><commit_msg>Add script for computing a JSON-LD shape from data
Measures frequency of used properties and classes and creates a shape
representing the shape of a selection of descriptions in LDDB.<commit_after> | from __future__ import print_function, unicode_literals
import json
import sys
MAX_STATS = 20
def compute_shape(node, index):
if len(node) == 1 and '@id' in node:
count_value('@id', node['@id'], index)
return
rtype = node.get('@type')
shape = index.setdefault(rtype, {})
for k, vs in... | Add script for computing a JSON-LD shape from data
Measures frequency of used properties and classes and creates a shape
representing the shape of a selection of descriptions in LDDB.from __future__ import print_function, unicode_literals
import json
import sys
MAX_STATS = 20
def compute_shape(node, index):
if ... | <commit_before><commit_msg>Add script for computing a JSON-LD shape from data
Measures frequency of used properties and classes and creates a shape
representing the shape of a selection of descriptions in LDDB.<commit_after>from __future__ import print_function, unicode_literals
import json
import sys
MAX_STATS = 20... | |
93e18fe289235c1aa5f14dffbd14a29befc79d54 | zerver/migrations/0371_invalid_characters_in_topics.py | zerver/migrations/0371_invalid_characters_in_topics.py | import unicodedata
from django.db import connection, migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def fix_topics(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
Message = apps.get_model("zerver", "Message"... | Remove disallowed characters from topics. | migrations: Remove disallowed characters from topics.
Following b3c58f454f0dce8a88c696305945bac41f9786bc, we want to clean up
old topics that may contain the disallowed characters. The Message table
is large, so we go in batches, making sure we limit topic fetches and
UPDATE query to no more than BATCH_SIZE Message ro... | Python | apache-2.0 | zulip/zulip,andersk/zulip,zulip/zulip,rht/zulip,eeshangarg/zulip,zulip/zulip,kou/zulip,kou/zulip,eeshangarg/zulip,eeshangarg/zulip,kou/zulip,rht/zulip,eeshangarg/zulip,zulip/zulip,kou/zulip,rht/zulip,andersk/zulip,rht/zulip,rht/zulip,andersk/zulip,eeshangarg/zulip,kou/zulip,andersk/zulip,kou/zulip,rht/zulip,eeshangarg/... | migrations: Remove disallowed characters from topics.
Following b3c58f454f0dce8a88c696305945bac41f9786bc, we want to clean up
old topics that may contain the disallowed characters. The Message table
is large, so we go in batches, making sure we limit topic fetches and
UPDATE query to no more than BATCH_SIZE Message ro... | import unicodedata
from django.db import connection, migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def fix_topics(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
Message = apps.get_model("zerver", "Message"... | <commit_before><commit_msg>migrations: Remove disallowed characters from topics.
Following b3c58f454f0dce8a88c696305945bac41f9786bc, we want to clean up
old topics that may contain the disallowed characters. The Message table
is large, so we go in batches, making sure we limit topic fetches and
UPDATE query to no more... | import unicodedata
from django.db import connection, migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def fix_topics(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
Message = apps.get_model("zerver", "Message"... | migrations: Remove disallowed characters from topics.
Following b3c58f454f0dce8a88c696305945bac41f9786bc, we want to clean up
old topics that may contain the disallowed characters. The Message table
is large, so we go in batches, making sure we limit topic fetches and
UPDATE query to no more than BATCH_SIZE Message ro... | <commit_before><commit_msg>migrations: Remove disallowed characters from topics.
Following b3c58f454f0dce8a88c696305945bac41f9786bc, we want to clean up
old topics that may contain the disallowed characters. The Message table
is large, so we go in batches, making sure we limit topic fetches and
UPDATE query to no more... | |
b8259412ecca837345597209c1aa46872c45cbf3 | samples/admin.py | samples/admin.py | from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample
extra = 1
... | from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample
extra = 1
... | Reduce number of extra fields for prettyness | :art: Reduce number of extra fields for prettyness
| Python | mit | gems-uff/labsys,gems-uff/labsys,gems-uff/labsys,gcrsaldanha/fiocruz,gcrsaldanha/fiocruz | from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample
extra = 1
... | from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample
extra = 1
... | <commit_before>from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample... | from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample
extra = 1
... | from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample
extra = 1
... | <commit_before>from django.contrib import admin
from .models import (
Patient, PatientRegister,
FluVaccine,
Sample, CollectionType,
Symptom, ObservedSymptom
)
class FluVaccineInline(admin.StackedInline):
model = FluVaccine
extra = 1
class SampleInline(admin.StackedInline):
model = Sample... |
f85dfe27437bd5b9931dc01b9da8329b1102de4a | create_tiles.py | create_tiles.py |
import subprocess
src_files = '/g/data/rs0/scenes/ARG25_V0.0/2015-04/LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425/scene01/*.tif'
src_vrt = 'LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425.vrt'
subprocess.call(['gdalbuildvrt', src_vrt, src_files], shell=True).wait()
target_src = 'EPSG:4326'
reprojected_vrt = 'L... | Add a script to reproject and tile an input dataset | Add a script to reproject and tile an input dataset
Very simple at this stage, simply run a series of external gdal
commands from a python script.
| Python | bsd-3-clause | omad/datacube-experiments | Add a script to reproject and tile an input dataset
Very simple at this stage, simply run a series of external gdal
commands from a python script. |
import subprocess
src_files = '/g/data/rs0/scenes/ARG25_V0.0/2015-04/LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425/scene01/*.tif'
src_vrt = 'LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425.vrt'
subprocess.call(['gdalbuildvrt', src_vrt, src_files], shell=True).wait()
target_src = 'EPSG:4326'
reprojected_vrt = 'L... | <commit_before><commit_msg>Add a script to reproject and tile an input dataset
Very simple at this stage, simply run a series of external gdal
commands from a python script.<commit_after> |
import subprocess
src_files = '/g/data/rs0/scenes/ARG25_V0.0/2015-04/LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425/scene01/*.tif'
src_vrt = 'LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425.vrt'
subprocess.call(['gdalbuildvrt', src_vrt, src_files], shell=True).wait()
target_src = 'EPSG:4326'
reprojected_vrt = 'L... | Add a script to reproject and tile an input dataset
Very simple at this stage, simply run a series of external gdal
commands from a python script.
import subprocess
src_files = '/g/data/rs0/scenes/ARG25_V0.0/2015-04/LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425/scene01/*.tif'
src_vrt = 'LS7_ETM_NBAR_P54_GANBAR01-002... | <commit_before><commit_msg>Add a script to reproject and tile an input dataset
Very simple at this stage, simply run a series of external gdal
commands from a python script.<commit_after>
import subprocess
src_files = '/g/data/rs0/scenes/ARG25_V0.0/2015-04/LS7_ETM_NBAR_P54_GANBAR01-002_089_081_20150425/scene01/*.tif'... | |
3ce13307cfaca4ed0e069ed1d1f61f4afd2dca85 | greatbigcrane/job_queue/management/commands/job_processor.py | greatbigcrane/job_queue/management/commands/job_processor.py | import zmq
import time
import json
from django.core.management.base import NoArgsCommand
addr = 'tcp://127.0.0.1:5555'
class Command(NoArgsCommand):
help = "Run the 0MQ based job processor. Accepts jobs from the job server and processes them."
def handle(self, **options):
context = zmq.Context()
... | Move the basic job processor into a django management command as well. | Move the basic job processor into a django management command as well.
| Python | apache-2.0 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | Move the basic job processor into a django management command as well. | import zmq
import time
import json
from django.core.management.base import NoArgsCommand
addr = 'tcp://127.0.0.1:5555'
class Command(NoArgsCommand):
help = "Run the 0MQ based job processor. Accepts jobs from the job server and processes them."
def handle(self, **options):
context = zmq.Context()
... | <commit_before><commit_msg>Move the basic job processor into a django management command as well.<commit_after> | import zmq
import time
import json
from django.core.management.base import NoArgsCommand
addr = 'tcp://127.0.0.1:5555'
class Command(NoArgsCommand):
help = "Run the 0MQ based job processor. Accepts jobs from the job server and processes them."
def handle(self, **options):
context = zmq.Context()
... | Move the basic job processor into a django management command as well.import zmq
import time
import json
from django.core.management.base import NoArgsCommand
addr = 'tcp://127.0.0.1:5555'
class Command(NoArgsCommand):
help = "Run the 0MQ based job processor. Accepts jobs from the job server and processes them."... | <commit_before><commit_msg>Move the basic job processor into a django management command as well.<commit_after>import zmq
import time
import json
from django.core.management.base import NoArgsCommand
addr = 'tcp://127.0.0.1:5555'
class Command(NoArgsCommand):
help = "Run the 0MQ based job processor. Accepts jobs... | |
1b6b9d53d851918f7b12db96d4029e1ab0c0f21e | osf/migrations/0041_auto_20170308_1932.py | osf/migrations/0041_auto_20170308_1932.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 01:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0040_ensure_root_field'),
]
operations = [
migrations.AlterIndexTogether(
... | Add migration for abstractnode index | Add migration for abstractnode index
| Python | apache-2.0 | mfraezz/osf.io,Nesiehr/osf.io,HalcyonChimera/osf.io,hmoco/osf.io,chennan47/osf.io,acshi/osf.io,mattclark/osf.io,saradbowman/osf.io,crcresearch/osf.io,crcresearch/osf.io,chrisseto/osf.io,adlius/osf.io,sloria/osf.io,felliott/osf.io,mfraezz/osf.io,aaxelb/osf.io,acshi/osf.io,CenterForOpenScience/osf.io,Nesiehr/osf.io,caner... | Add migration for abstractnode index | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 01:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0040_ensure_root_field'),
]
operations = [
migrations.AlterIndexTogether(
... | <commit_before><commit_msg>Add migration for abstractnode index<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 01:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0040_ensure_root_field'),
]
operations = [
migrations.AlterIndexTogether(
... | Add migration for abstractnode index# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 01:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0040_ensure_root_field'),
]
operations = [
... | <commit_before><commit_msg>Add migration for abstractnode index<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-09 01:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0040_ensure_root_fi... | |
65de21cddbd215f8744122a4fa7f10a8ce5e5fa1 | ideas/migrations/0001_initial.py | ideas/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-22 03:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Idea',
... | Add new file for idea migrations | Add new file for idea migrations
| Python | mit | neosergio/vote_hackatrix_backend | Add new file for idea migrations | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-22 03:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Idea',
... | <commit_before><commit_msg>Add new file for idea migrations<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-22 03:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Idea',
... | Add new file for idea migrations# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-22 03:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | <commit_before><commit_msg>Add new file for idea migrations<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-22 03:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
... | |
f7bcbafb0b1668c843474fd3a0b4dfd26f230d2a | tools/perf/benchmarks/blink_perf.py | tools/perf/benchmarks/blink_perf.py | # Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test):
tag = 'all'... | # Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test):
tag = 'all'... | Disable web animations benchmark. It is crashing. | Disable web animations benchmark. It is crashing.
BUG=320042
NOTRY=True
[email protected]
Review URL: https://codereview.chromium.org/70233018
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@235452 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | Chilledheart/chromium,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,Pluto-tv/chromium... | # Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test):
tag = 'all'... | # Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test):
tag = 'all'... | <commit_before># Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test)... | # Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test):
tag = 'all'... | # Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test):
tag = 'all'... | <commit_before># Copyright (c) 2013 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test)... |
8db1da8cb9e7ace878d0a8f041ec0d466b1419ef | glacier_test.py | glacier_test.py | #!/usr/bin/env python
# Copyright (c) 2013 Robie Basak
#
# 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 upload with '-' | Add test for upload with '-'
| Python | mit | basak/glacier-cli,mhubig/glacier-cli,basak/glacier-cli,mhubig/glacier-cli | Add test for upload with '-' | #!/usr/bin/env python
# Copyright (c) 2013 Robie Basak
#
# 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 upload with '-'<commit_after> | #!/usr/bin/env python
# Copyright (c) 2013 Robie Basak
#
# 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 upload with '-'#!/usr/bin/env python
# Copyright (c) 2013 Robie Basak
#
# 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 r... | <commit_before><commit_msg>Add test for upload with '-'<commit_after>#!/usr/bin/env python
# Copyright (c) 2013 Robie Basak
#
# 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 restrict... | |
d885ae5d2a2444e70a8b141ae8742d4fd0bd1cb7 | run_faults.py | run_faults.py | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.bas... | Add batch processing of runs | Add batch processing of runs
| Python | mit | mandli/compsyn-geoclaw | Add batch processing of runs | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.bas... | <commit_before><commit_msg>Add batch processing of runs<commit_after> | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.bas... | Add batch processing of runs#!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
... | <commit_before><commit_msg>Add batch processing of runs<commit_after>#!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"... | |
5074752a42348dfe7b8c28152571960efe57f241 | corehq/ex-submodules/phonelog/migrations/0008_devicelog_varchar_index.py | corehq/ex-submodules/phonelog/migrations/0008_devicelog_varchar_index.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-01 18:37
from __future__ import unicode_literals
from django.db import migrations
from corehq.sql_db.operations import HqRunSQL
from corehq.util.django_migrations import add_if_not_exists
class Migration(migrations.Migration):
dependencies = [
... | Revert "Revert "adding varchar_pattern_ops index to devicelog table"" | Revert "Revert "adding varchar_pattern_ops index to devicelog table""
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Revert "Revert "adding varchar_pattern_ops index to devicelog table"" | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-01 18:37
from __future__ import unicode_literals
from django.db import migrations
from corehq.sql_db.operations import HqRunSQL
from corehq.util.django_migrations import add_if_not_exists
class Migration(migrations.Migration):
dependencies = [
... | <commit_before><commit_msg>Revert "Revert "adding varchar_pattern_ops index to devicelog table""<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-01 18:37
from __future__ import unicode_literals
from django.db import migrations
from corehq.sql_db.operations import HqRunSQL
from corehq.util.django_migrations import add_if_not_exists
class Migration(migrations.Migration):
dependencies = [
... | Revert "Revert "adding varchar_pattern_ops index to devicelog table""# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-01 18:37
from __future__ import unicode_literals
from django.db import migrations
from corehq.sql_db.operations import HqRunSQL
from corehq.util.django_migrations import add_if_not_exis... | <commit_before><commit_msg>Revert "Revert "adding varchar_pattern_ops index to devicelog table""<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-01 18:37
from __future__ import unicode_literals
from django.db import migrations
from corehq.sql_db.operations import HqRunSQL
from corehq.util... | |
f032f456a2d601b7db6461ea44916cf7588e0c81 | src/python/SparkSQLTwitter.py | src/python/SparkSQLTwitter.py | # A simple demo for working with SparkSQL and Tweets
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
import json
import sys
if __name__ == "__main__":
conf = SparkConf()
sc = SparkContext()
sqlCtx = SQLContext(sc)
| Add the start of Spark SQL twitter demo in python | Add the start of Spark SQL twitter demo in python
| Python | mit | coursera4ashok/learning-spark,junwucs/learning-spark,kod3r/learning-spark,jaehyuk/learning-spark,diogoaurelio/learning-spark,bhagatsingh/learning-spark,gaoxuesong/learning-spark,NBSW/learning-spark,obinsanni/learning-spark,diogoaurelio/learning-spark,anjuncc/learning-spark-examples,concerned3rdparty/learning-spark,jaeh... | Add the start of Spark SQL twitter demo in python | # A simple demo for working with SparkSQL and Tweets
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
import json
import sys
if __name__ == "__main__":
conf = SparkConf()
sc = SparkContext()
sqlCtx = SQLContext(sc)
| <commit_before><commit_msg>Add the start of Spark SQL twitter demo in python<commit_after> | # A simple demo for working with SparkSQL and Tweets
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
import json
import sys
if __name__ == "__main__":
conf = SparkConf()
sc = SparkContext()
sqlCtx = SQLContext(sc)
| Add the start of Spark SQL twitter demo in python# A simple demo for working with SparkSQL and Tweets
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
import json
import sys
if __name__ == "__main__":
conf = SparkConf()
sc = SparkContext()
sqlCtx = SQLContext(sc)
| <commit_before><commit_msg>Add the start of Spark SQL twitter demo in python<commit_after># A simple demo for working with SparkSQL and Tweets
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
import json
import sys
if __name__ == "__main__":
conf = SparkConf()
sc = SparkContext()
... | |
2eba1fc80263c11a1b2b5ee1707b19e98a7b2980 | apps/submission/tests/test_models.py | apps/submission/tests/test_models.py | from django.test import TestCase
from django.urls import reverse
from apps.core.factories import PIXELER_PASSWORD, PixelerFactory
from .. import models
class SubmissionProcessTestCase(TestCase):
def test_can_create_submission_process(self):
label = 'Candida datasest 0001'
qs = models.Submissio... | Add tests for the SubmissionProcess model | Add tests for the SubmissionProcess model
| Python | bsd-3-clause | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | Add tests for the SubmissionProcess model | from django.test import TestCase
from django.urls import reverse
from apps.core.factories import PIXELER_PASSWORD, PixelerFactory
from .. import models
class SubmissionProcessTestCase(TestCase):
def test_can_create_submission_process(self):
label = 'Candida datasest 0001'
qs = models.Submissio... | <commit_before><commit_msg>Add tests for the SubmissionProcess model<commit_after> | from django.test import TestCase
from django.urls import reverse
from apps.core.factories import PIXELER_PASSWORD, PixelerFactory
from .. import models
class SubmissionProcessTestCase(TestCase):
def test_can_create_submission_process(self):
label = 'Candida datasest 0001'
qs = models.Submissio... | Add tests for the SubmissionProcess modelfrom django.test import TestCase
from django.urls import reverse
from apps.core.factories import PIXELER_PASSWORD, PixelerFactory
from .. import models
class SubmissionProcessTestCase(TestCase):
def test_can_create_submission_process(self):
label = 'Candida data... | <commit_before><commit_msg>Add tests for the SubmissionProcess model<commit_after>from django.test import TestCase
from django.urls import reverse
from apps.core.factories import PIXELER_PASSWORD, PixelerFactory
from .. import models
class SubmissionProcessTestCase(TestCase):
def test_can_create_submission_proc... | |
ffe1e77a21c6b0a515d92f1d67406e01a0316341 | examples/test_chromedriver.py | examples/test_chromedriver.py | """
This test is only for Chrome!
(Verify that your chromedriver is compatible with your version of Chrome.)
"""
import colorama
from seleniumbase import BaseCase
class ChromeTestClass(BaseCase):
def test_chromedriver_matches_chrome(self):
if self.browser != "chrome":
print("\n This test is ... | Add a test to detect if using an out-of-date ChromeDriver | Add a test to detect if using an out-of-date ChromeDriver
| Python | mit | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | Add a test to detect if using an out-of-date ChromeDriver | """
This test is only for Chrome!
(Verify that your chromedriver is compatible with your version of Chrome.)
"""
import colorama
from seleniumbase import BaseCase
class ChromeTestClass(BaseCase):
def test_chromedriver_matches_chrome(self):
if self.browser != "chrome":
print("\n This test is ... | <commit_before><commit_msg>Add a test to detect if using an out-of-date ChromeDriver<commit_after> | """
This test is only for Chrome!
(Verify that your chromedriver is compatible with your version of Chrome.)
"""
import colorama
from seleniumbase import BaseCase
class ChromeTestClass(BaseCase):
def test_chromedriver_matches_chrome(self):
if self.browser != "chrome":
print("\n This test is ... | Add a test to detect if using an out-of-date ChromeDriver"""
This test is only for Chrome!
(Verify that your chromedriver is compatible with your version of Chrome.)
"""
import colorama
from seleniumbase import BaseCase
class ChromeTestClass(BaseCase):
def test_chromedriver_matches_chrome(self):
if self.... | <commit_before><commit_msg>Add a test to detect if using an out-of-date ChromeDriver<commit_after>"""
This test is only for Chrome!
(Verify that your chromedriver is compatible with your version of Chrome.)
"""
import colorama
from seleniumbase import BaseCase
class ChromeTestClass(BaseCase):
def test_chromedriv... | |
268d97d4a655e7081a2c550df8b1e927e5c6c4ab | ibeis/tests/test_ibs_uuid.py | ibeis/tests/test_ibs_uuid.py | #!/usr/bin/env python2.7
# TODO: ADD COPYRIGHT TAG
from __future__ import absolute_import, division, print_function
from ibeis.dev import ibsfuncs
#from itertools import izip
# Python
import multiprocessing
#import numpy as np
from uuid import UUID
# Tools
import utool
from ibeis.control.IBEISControl import IBEISContro... | Test to check if uuids are consistent across machines | Test to check if uuids are consistent across machines
| Python | apache-2.0 | Erotemic/ibeis,Erotemic/ibeis,SU-ECE-17-7/ibeis,SU-ECE-17-7/ibeis,SU-ECE-17-7/ibeis,SU-ECE-17-7/ibeis | Test to check if uuids are consistent across machines | #!/usr/bin/env python2.7
# TODO: ADD COPYRIGHT TAG
from __future__ import absolute_import, division, print_function
from ibeis.dev import ibsfuncs
#from itertools import izip
# Python
import multiprocessing
#import numpy as np
from uuid import UUID
# Tools
import utool
from ibeis.control.IBEISControl import IBEISContro... | <commit_before><commit_msg>Test to check if uuids are consistent across machines<commit_after> | #!/usr/bin/env python2.7
# TODO: ADD COPYRIGHT TAG
from __future__ import absolute_import, division, print_function
from ibeis.dev import ibsfuncs
#from itertools import izip
# Python
import multiprocessing
#import numpy as np
from uuid import UUID
# Tools
import utool
from ibeis.control.IBEISControl import IBEISContro... | Test to check if uuids are consistent across machines#!/usr/bin/env python2.7
# TODO: ADD COPYRIGHT TAG
from __future__ import absolute_import, division, print_function
from ibeis.dev import ibsfuncs
#from itertools import izip
# Python
import multiprocessing
#import numpy as np
from uuid import UUID
# Tools
import uto... | <commit_before><commit_msg>Test to check if uuids are consistent across machines<commit_after>#!/usr/bin/env python2.7
# TODO: ADD COPYRIGHT TAG
from __future__ import absolute_import, division, print_function
from ibeis.dev import ibsfuncs
#from itertools import izip
# Python
import multiprocessing
#import numpy as np... | |
9f9dc6e4e737d0141774e889d587d1b89c65a9ca | tests/unit/fileclient_test.py | tests/unit/fileclient_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Bo Maryniuk <[email protected]>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import patch
from mock import Mock
import ... | Add unit test case for fileclient | Add unit test case for fileclient
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add unit test case for fileclient | # -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Bo Maryniuk <[email protected]>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import patch
from mock import Mock
import ... | <commit_before><commit_msg>Add unit test case for fileclient<commit_after> | # -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Bo Maryniuk <[email protected]>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import patch
from mock import Mock
import ... | Add unit test case for fileclient# -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Bo Maryniuk <[email protected]>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import pa... | <commit_before><commit_msg>Add unit test case for fileclient<commit_after># -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Bo Maryniuk <[email protected]>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_i... | |
b2737b0878aa588a99bae473a240e241463030d4 | zerver/migrations/0421_migrate_pronouns_custom_profile_fields.py | zerver/migrations/0421_migrate_pronouns_custom_profile_fields.py | # Generated by Django 4.1.2 on 2022-10-21 06:31
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def migrate_pronouns_custom_profile_fields(
apps: StateApps, schema_editor: BaseDatabaseSchemaEditor
) -> Non... | Add migration to migrate pronouns custom profile fields. | migrations: Add migration to migrate pronouns custom profile fields.
This commit adds a migration to migrate SHORT_TEXT type profile
fields for pronouns to recently added PRONOUNS type.
| Python | apache-2.0 | zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip | migrations: Add migration to migrate pronouns custom profile fields.
This commit adds a migration to migrate SHORT_TEXT type profile
fields for pronouns to recently added PRONOUNS type. | # Generated by Django 4.1.2 on 2022-10-21 06:31
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def migrate_pronouns_custom_profile_fields(
apps: StateApps, schema_editor: BaseDatabaseSchemaEditor
) -> Non... | <commit_before><commit_msg>migrations: Add migration to migrate pronouns custom profile fields.
This commit adds a migration to migrate SHORT_TEXT type profile
fields for pronouns to recently added PRONOUNS type.<commit_after> | # Generated by Django 4.1.2 on 2022-10-21 06:31
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def migrate_pronouns_custom_profile_fields(
apps: StateApps, schema_editor: BaseDatabaseSchemaEditor
) -> Non... | migrations: Add migration to migrate pronouns custom profile fields.
This commit adds a migration to migrate SHORT_TEXT type profile
fields for pronouns to recently added PRONOUNS type.# Generated by Django 4.1.2 on 2022-10-21 06:31
from django.db import migrations
from django.db.backends.postgresql.schema import Bas... | <commit_before><commit_msg>migrations: Add migration to migrate pronouns custom profile fields.
This commit adds a migration to migrate SHORT_TEXT type profile
fields for pronouns to recently added PRONOUNS type.<commit_after># Generated by Django 4.1.2 on 2022-10-21 06:31
from django.db import migrations
from django... | |
6bb43bd4b1b2d5216fa2ec1c5692849c336353db | contrib/generate-cassandra-thrift.py | contrib/generate-cassandra-thrift.py | #!/usr/bin/env python
import sys
import os
import subprocess
if len(sys.argv) != 3:
print "Usage: generate-cassandra-thrift.py /path/to/bin/thrift cassandra-version"
sys.exit(-1)
thrift_bin = sys.argv[1]
cassandra_version = sys.argv[2]
# Sanity check our location
cur_dir_list = os.listdir( os.getcwd() )
if ... | Add script for generating libgenthrift Cassandra interface files using thrift. | Add script for generating libgenthrift Cassandra interface files using thrift.
| Python | bsd-3-clause | xiaozhou/libcassandra,xiaozhou/libcassandra,xiaozhou/libcassandra,xiaozhou/libcassandra | Add script for generating libgenthrift Cassandra interface files using thrift. | #!/usr/bin/env python
import sys
import os
import subprocess
if len(sys.argv) != 3:
print "Usage: generate-cassandra-thrift.py /path/to/bin/thrift cassandra-version"
sys.exit(-1)
thrift_bin = sys.argv[1]
cassandra_version = sys.argv[2]
# Sanity check our location
cur_dir_list = os.listdir( os.getcwd() )
if ... | <commit_before><commit_msg>Add script for generating libgenthrift Cassandra interface files using thrift.<commit_after> | #!/usr/bin/env python
import sys
import os
import subprocess
if len(sys.argv) != 3:
print "Usage: generate-cassandra-thrift.py /path/to/bin/thrift cassandra-version"
sys.exit(-1)
thrift_bin = sys.argv[1]
cassandra_version = sys.argv[2]
# Sanity check our location
cur_dir_list = os.listdir( os.getcwd() )
if ... | Add script for generating libgenthrift Cassandra interface files using thrift.#!/usr/bin/env python
import sys
import os
import subprocess
if len(sys.argv) != 3:
print "Usage: generate-cassandra-thrift.py /path/to/bin/thrift cassandra-version"
sys.exit(-1)
thrift_bin = sys.argv[1]
cassandra_version = sys.arg... | <commit_before><commit_msg>Add script for generating libgenthrift Cassandra interface files using thrift.<commit_after>#!/usr/bin/env python
import sys
import os
import subprocess
if len(sys.argv) != 3:
print "Usage: generate-cassandra-thrift.py /path/to/bin/thrift cassandra-version"
sys.exit(-1)
thrift_bin ... | |
4b38f9d3760c7e05665436e1e562909db8bfd5d0 | xgb_cv3.py | xgb_cv3.py | # WITH CATEGORICAL VARIABLES CONVERTED TO CON_PROB VARIABLES
# import libraries
import pandas as pd
import xgboost as xgb
import re
# %matplotlib inline
# import logger.py
from logger import logger
logger.info('Start modelling.py')
# load xgb matrix from binary
train = xgb.DMatrix('train_proc_full3.buffer')
logger.... | Add cross validation script for model. | Add cross validation script for model.
| Python | mit | eugeneyan/kaggle_springleaf | Add cross validation script for model. | # WITH CATEGORICAL VARIABLES CONVERTED TO CON_PROB VARIABLES
# import libraries
import pandas as pd
import xgboost as xgb
import re
# %matplotlib inline
# import logger.py
from logger import logger
logger.info('Start modelling.py')
# load xgb matrix from binary
train = xgb.DMatrix('train_proc_full3.buffer')
logger.... | <commit_before><commit_msg>Add cross validation script for model.<commit_after> | # WITH CATEGORICAL VARIABLES CONVERTED TO CON_PROB VARIABLES
# import libraries
import pandas as pd
import xgboost as xgb
import re
# %matplotlib inline
# import logger.py
from logger import logger
logger.info('Start modelling.py')
# load xgb matrix from binary
train = xgb.DMatrix('train_proc_full3.buffer')
logger.... | Add cross validation script for model.# WITH CATEGORICAL VARIABLES CONVERTED TO CON_PROB VARIABLES
# import libraries
import pandas as pd
import xgboost as xgb
import re
# %matplotlib inline
# import logger.py
from logger import logger
logger.info('Start modelling.py')
# load xgb matrix from binary
train = xgb.DMat... | <commit_before><commit_msg>Add cross validation script for model.<commit_after># WITH CATEGORICAL VARIABLES CONVERTED TO CON_PROB VARIABLES
# import libraries
import pandas as pd
import xgboost as xgb
import re
# %matplotlib inline
# import logger.py
from logger import logger
logger.info('Start modelling.py')
# loa... | |
cdb46409e1e5dc8e0766450f98f05278afeba1d4 | molo/core/management/commands/remove_all_featured_articles.py | molo/core/management/commands/remove_all_featured_articles.py | from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from molo.core.models import ArticlePage
class Command(BaseCommand):
def handle(self, **options):
article_pages = ArticlePage.objects.all()
for article in article_pages:
if art... | Add remove all featured_articles management command | Add remove all featured_articles management command
| Python | bsd-2-clause | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | Add remove all featured_articles management command | from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from molo.core.models import ArticlePage
class Command(BaseCommand):
def handle(self, **options):
article_pages = ArticlePage.objects.all()
for article in article_pages:
if art... | <commit_before><commit_msg>Add remove all featured_articles management command<commit_after> | from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from molo.core.models import ArticlePage
class Command(BaseCommand):
def handle(self, **options):
article_pages = ArticlePage.objects.all()
for article in article_pages:
if art... | Add remove all featured_articles management commandfrom __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from molo.core.models import ArticlePage
class Command(BaseCommand):
def handle(self, **options):
article_pages = ArticlePage.objects.all()
... | <commit_before><commit_msg>Add remove all featured_articles management command<commit_after>from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from molo.core.models import ArticlePage
class Command(BaseCommand):
def handle(self, **options):
articl... | |
70d822c9f0ab799ab44e3707ba345782b36fad3f | zvm/zstring.py | zvm/zstring.py | #
# A ZString-to-ASCII Universal Translator.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZStringEndOfString(Exception):
"""No more data left in string."""
class ZStringStream(object):
"""This class takes an address and a ZMemory, and ... | Add an unfinished version of the ZString stream translator. | Add an unfinished version of the ZString stream translator.
* zvm/zstring.py: New file.
| Python | bsd-3-clause | BGCX262/zvm-hg-to-git,BGCX262/zvm-hg-to-git | Add an unfinished version of the ZString stream translator.
* zvm/zstring.py: New file. | #
# A ZString-to-ASCII Universal Translator.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZStringEndOfString(Exception):
"""No more data left in string."""
class ZStringStream(object):
"""This class takes an address and a ZMemory, and ... | <commit_before><commit_msg>Add an unfinished version of the ZString stream translator.
* zvm/zstring.py: New file.<commit_after> | #
# A ZString-to-ASCII Universal Translator.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZStringEndOfString(Exception):
"""No more data left in string."""
class ZStringStream(object):
"""This class takes an address and a ZMemory, and ... | Add an unfinished version of the ZString stream translator.
* zvm/zstring.py: New file.#
# A ZString-to-ASCII Universal Translator.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZStringEndOfString(Exception):
"""No more data left in string.... | <commit_before><commit_msg>Add an unfinished version of the ZString stream translator.
* zvm/zstring.py: New file.<commit_after>#
# A ZString-to-ASCII Universal Translator.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZStringEndOfString(Except... | |
901954e944fad1ea1b9aa3510646814397712757 | d1_libclient_python/src/examples/compare_object_lists.py | d1_libclient_python/src/examples/compare_object_lists.py | #!/usr/bin/env python
import logging
import d1_client.objectlistiterator
import d1_client.mnclient_2_0
import d1_client.cnclient_2_0
import d1_common.const
# Check for discrepancies between MN and CN by comparing object lists
#CN_BASE_URL = d1_common.const.URL_CN_BASE_URL
CN_BASE_URL = 'https://cn-stage.test.dataon... | Add example on how to read and compare ObjectLists | Add example on how to read and compare ObjectLists
| Python | apache-2.0 | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | Add example on how to read and compare ObjectLists | #!/usr/bin/env python
import logging
import d1_client.objectlistiterator
import d1_client.mnclient_2_0
import d1_client.cnclient_2_0
import d1_common.const
# Check for discrepancies between MN and CN by comparing object lists
#CN_BASE_URL = d1_common.const.URL_CN_BASE_URL
CN_BASE_URL = 'https://cn-stage.test.dataon... | <commit_before><commit_msg>Add example on how to read and compare ObjectLists<commit_after> | #!/usr/bin/env python
import logging
import d1_client.objectlistiterator
import d1_client.mnclient_2_0
import d1_client.cnclient_2_0
import d1_common.const
# Check for discrepancies between MN and CN by comparing object lists
#CN_BASE_URL = d1_common.const.URL_CN_BASE_URL
CN_BASE_URL = 'https://cn-stage.test.dataon... | Add example on how to read and compare ObjectLists#!/usr/bin/env python
import logging
import d1_client.objectlistiterator
import d1_client.mnclient_2_0
import d1_client.cnclient_2_0
import d1_common.const
# Check for discrepancies between MN and CN by comparing object lists
#CN_BASE_URL = d1_common.const.URL_CN_BA... | <commit_before><commit_msg>Add example on how to read and compare ObjectLists<commit_after>#!/usr/bin/env python
import logging
import d1_client.objectlistiterator
import d1_client.mnclient_2_0
import d1_client.cnclient_2_0
import d1_common.const
# Check for discrepancies between MN and CN by comparing object lists
... | |
1b7fc6c8037b63f7fca8c99b97ccbb1871ab33c1 | test/targetmachines.py | test/targetmachines.py | from llvm.core import *
from llvm.ee import TargetMachine, EngineBuilder, print_registered_targets
import unittest
class TestTargetMachines(unittest.TestCase):
'''Exercise target machines
Require PTX backend
'''
def test_native(self):
m, _ = self._build_module()
tm = EngineBuilder.new... | Add test for target machines (native + PTX) | Add test for target machines (native + PTX) | Python | bsd-3-clause | llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy | Add test for target machines (native + PTX) | from llvm.core import *
from llvm.ee import TargetMachine, EngineBuilder, print_registered_targets
import unittest
class TestTargetMachines(unittest.TestCase):
'''Exercise target machines
Require PTX backend
'''
def test_native(self):
m, _ = self._build_module()
tm = EngineBuilder.new... | <commit_before><commit_msg>Add test for target machines (native + PTX)<commit_after> | from llvm.core import *
from llvm.ee import TargetMachine, EngineBuilder, print_registered_targets
import unittest
class TestTargetMachines(unittest.TestCase):
'''Exercise target machines
Require PTX backend
'''
def test_native(self):
m, _ = self._build_module()
tm = EngineBuilder.new... | Add test for target machines (native + PTX)from llvm.core import *
from llvm.ee import TargetMachine, EngineBuilder, print_registered_targets
import unittest
class TestTargetMachines(unittest.TestCase):
'''Exercise target machines
Require PTX backend
'''
def test_native(self):
m, _ = self._bui... | <commit_before><commit_msg>Add test for target machines (native + PTX)<commit_after>from llvm.core import *
from llvm.ee import TargetMachine, EngineBuilder, print_registered_targets
import unittest
class TestTargetMachines(unittest.TestCase):
'''Exercise target machines
Require PTX backend
'''
def te... | |
ad1522445128ed70c4cb7991731938ab5c1df75b | tests/vmtests/vmbackedtestcase.py | tests/vmtests/vmbackedtestcase.py |
import os
import unittest
from blivet import Blivet
@unittest.skipUnless(os.environ.get("VM_ENVIRONMENT"), "vm only test")
@unittest.skipUnless(os.geteuid() == 0, "requires root access")
class VMBackedTestCase(unittest.TestCase):
""" A class to encapsulate testing of blivet using block devices.
The ba... | Add a test case for tests running in a virtual machine | Add a test case for tests running in a virtual machine
| Python | lgpl-2.1 | AdamWill/blivet,rvykydal/blivet,rvykydal/blivet,AdamWill/blivet,vojtechtrefny/blivet,jkonecny12/blivet,jkonecny12/blivet,vojtechtrefny/blivet | Add a test case for tests running in a virtual machine |
import os
import unittest
from blivet import Blivet
@unittest.skipUnless(os.environ.get("VM_ENVIRONMENT"), "vm only test")
@unittest.skipUnless(os.geteuid() == 0, "requires root access")
class VMBackedTestCase(unittest.TestCase):
""" A class to encapsulate testing of blivet using block devices.
The ba... | <commit_before><commit_msg>Add a test case for tests running in a virtual machine<commit_after> |
import os
import unittest
from blivet import Blivet
@unittest.skipUnless(os.environ.get("VM_ENVIRONMENT"), "vm only test")
@unittest.skipUnless(os.geteuid() == 0, "requires root access")
class VMBackedTestCase(unittest.TestCase):
""" A class to encapsulate testing of blivet using block devices.
The ba... | Add a test case for tests running in a virtual machine
import os
import unittest
from blivet import Blivet
@unittest.skipUnless(os.environ.get("VM_ENVIRONMENT"), "vm only test")
@unittest.skipUnless(os.geteuid() == 0, "requires root access")
class VMBackedTestCase(unittest.TestCase):
""" A class to encapsulate ... | <commit_before><commit_msg>Add a test case for tests running in a virtual machine<commit_after>
import os
import unittest
from blivet import Blivet
@unittest.skipUnless(os.environ.get("VM_ENVIRONMENT"), "vm only test")
@unittest.skipUnless(os.geteuid() == 0, "requires root access")
class VMBackedTestCase(unittest.Te... | |
31e105ce31dc3a2243c5bfddab3609ef71c1b026 | csunplugged/resources/utils/resource_parameters.py | csunplugged/resources/utils/resource_parameters.py | from lxml import etree
from django.utils.translation import ugettext as _
class ResourceParameter(object):
def __init__(self, name="", description=""):
self.name = name
self.description = description
def html_element(self):
legend = etree.Element('legend')
legend.text = self.de... | Add ResourceParameter class and subclasses to store parameter info | Add ResourceParameter class and subclasses to store parameter info
| Python | mit | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | Add ResourceParameter class and subclasses to store parameter info | from lxml import etree
from django.utils.translation import ugettext as _
class ResourceParameter(object):
def __init__(self, name="", description=""):
self.name = name
self.description = description
def html_element(self):
legend = etree.Element('legend')
legend.text = self.de... | <commit_before><commit_msg>Add ResourceParameter class and subclasses to store parameter info<commit_after> | from lxml import etree
from django.utils.translation import ugettext as _
class ResourceParameter(object):
def __init__(self, name="", description=""):
self.name = name
self.description = description
def html_element(self):
legend = etree.Element('legend')
legend.text = self.de... | Add ResourceParameter class and subclasses to store parameter infofrom lxml import etree
from django.utils.translation import ugettext as _
class ResourceParameter(object):
def __init__(self, name="", description=""):
self.name = name
self.description = description
def html_element(self):
... | <commit_before><commit_msg>Add ResourceParameter class and subclasses to store parameter info<commit_after>from lxml import etree
from django.utils.translation import ugettext as _
class ResourceParameter(object):
def __init__(self, name="", description=""):
self.name = name
self.description = desc... | |
cdcb20d48a06e688e332b8f3964fa4430972eaab | django/website/logframe/tests/test_period_utils.py | django/website/logframe/tests/test_period_utils.py | from ..period_utils import get_month_shift
def test_get_month_shift_handles_december():
new_month, _ = get_month_shift(12, 1)
assert 12 == new_month
| Add test for get_month_shift handling December | Add test for get_month_shift handling December | Python | agpl-3.0 | aptivate/kashana,aptivate/kashana,aptivate/alfie,daniell/kashana,aptivate/alfie,daniell/kashana,aptivate/alfie,aptivate/kashana,daniell/kashana,daniell/kashana,aptivate/kashana,aptivate/alfie | Add test for get_month_shift handling December | from ..period_utils import get_month_shift
def test_get_month_shift_handles_december():
new_month, _ = get_month_shift(12, 1)
assert 12 == new_month
| <commit_before><commit_msg>Add test for get_month_shift handling December<commit_after> | from ..period_utils import get_month_shift
def test_get_month_shift_handles_december():
new_month, _ = get_month_shift(12, 1)
assert 12 == new_month
| Add test for get_month_shift handling Decemberfrom ..period_utils import get_month_shift
def test_get_month_shift_handles_december():
new_month, _ = get_month_shift(12, 1)
assert 12 == new_month
| <commit_before><commit_msg>Add test for get_month_shift handling December<commit_after>from ..period_utils import get_month_shift
def test_get_month_shift_handles_december():
new_month, _ = get_month_shift(12, 1)
assert 12 == new_month
| |
b23ab20a082e35e6e4c8bf9a535b1bbccd71be26 | docs/examples/tests/pylab_figshow.py | docs/examples/tests/pylab_figshow.py | """Manual test for figure.show() in the inline matplotlib backend.
This script should be loaded for interactive use (via %load) into a qtconsole
or notebook initialized with the pylab inline backend.
Expected behavior: only *one* copy of the figure is shown.
For further details:
https://github.com/ipython/ipython... | Add manual test file as per review by @minrk. | Add manual test file as per review by @minrk.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | Add manual test file as per review by @minrk. | """Manual test for figure.show() in the inline matplotlib backend.
This script should be loaded for interactive use (via %load) into a qtconsole
or notebook initialized with the pylab inline backend.
Expected behavior: only *one* copy of the figure is shown.
For further details:
https://github.com/ipython/ipython... | <commit_before><commit_msg>Add manual test file as per review by @minrk.<commit_after> | """Manual test for figure.show() in the inline matplotlib backend.
This script should be loaded for interactive use (via %load) into a qtconsole
or notebook initialized with the pylab inline backend.
Expected behavior: only *one* copy of the figure is shown.
For further details:
https://github.com/ipython/ipython... | Add manual test file as per review by @minrk."""Manual test for figure.show() in the inline matplotlib backend.
This script should be loaded for interactive use (via %load) into a qtconsole
or notebook initialized with the pylab inline backend.
Expected behavior: only *one* copy of the figure is shown.
For furthe... | <commit_before><commit_msg>Add manual test file as per review by @minrk.<commit_after>"""Manual test for figure.show() in the inline matplotlib backend.
This script should be loaded for interactive use (via %load) into a qtconsole
or notebook initialized with the pylab inline backend.
Expected behavior: only *one* ... | |
99469256b4585b5c0056d69e153e7c628f4430c1 | leak_matcher.py | leak_matcher.py | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import re
# If you add a line like this to the ctor for a class:
# printf_stderr("ZZZ C... | Add leak matcher for figuring out which test is leaking objects of a type | Add leak matcher for figuring out which test is leaking objects of a type
| Python | mpl-2.0 | amccreight/mochitest-logs | Add leak matcher for figuring out which test is leaking objects of a type | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import re
# If you add a line like this to the ctor for a class:
# printf_stderr("ZZZ C... | <commit_before><commit_msg>Add leak matcher for figuring out which test is leaking objects of a type<commit_after> | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import re
# If you add a line like this to the ctor for a class:
# printf_stderr("ZZZ C... | Add leak matcher for figuring out which test is leaking objects of a type#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import re
# If y... | <commit_before><commit_msg>Add leak matcher for figuring out which test is leaking objects of a type<commit_after>#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.or... | |
781af46113a8b7c02e0271efccfebb2cc5d3494c | mclearn/aggregators.py | mclearn/aggregators.py | """ Rank aggregators. """
import itertools
import functools
import numpy as np
def borda_count(voters, n_candidates):
""" Borda count rank aggregator.
Parameters
----------
voters : list-like
A list of arrays where each array correponds to a voter's preference.
n_can... | Implement Borda count and Schulze method for ranking | Implement Borda count and Schulze method for ranking
| Python | bsd-3-clause | chengsoonong/mclass-sky,chengsoonong/mclass-sky,chengsoonong/mclass-sky,chengsoonong/mclass-sky,alasdairtran/mclearn,alasdairtran/mclearn,alasdairtran/mclearn,alasdairtran/mclearn | Implement Borda count and Schulze method for ranking | """ Rank aggregators. """
import itertools
import functools
import numpy as np
def borda_count(voters, n_candidates):
""" Borda count rank aggregator.
Parameters
----------
voters : list-like
A list of arrays where each array correponds to a voter's preference.
n_can... | <commit_before><commit_msg>Implement Borda count and Schulze method for ranking<commit_after> | """ Rank aggregators. """
import itertools
import functools
import numpy as np
def borda_count(voters, n_candidates):
""" Borda count rank aggregator.
Parameters
----------
voters : list-like
A list of arrays where each array correponds to a voter's preference.
n_can... | Implement Borda count and Schulze method for ranking""" Rank aggregators. """
import itertools
import functools
import numpy as np
def borda_count(voters, n_candidates):
""" Borda count rank aggregator.
Parameters
----------
voters : list-like
A list of arrays where each arra... | <commit_before><commit_msg>Implement Borda count and Schulze method for ranking<commit_after>""" Rank aggregators. """
import itertools
import functools
import numpy as np
def borda_count(voters, n_candidates):
""" Borda count rank aggregator.
Parameters
----------
voters : list-like
... | |
4df3b93a138cb1de9104f32bcd88a3b359e718be | lighty/utils.py | lighty/utils.py | '''Some utilitary classes usually used to make working with different python
versions and different environment easier:
string_types - basestring for python 2 and str fot python 3
dict_keys - convert dict keys to list
div_operators - operators for division
with_metaclass - metaclasses
'''
import sys
im... | Add missed file from previous commit | Add missed file from previous commit
| Python | bsd-3-clause | GrAndSE/lighty | Add missed file from previous commit | '''Some utilitary classes usually used to make working with different python
versions and different environment easier:
string_types - basestring for python 2 and str fot python 3
dict_keys - convert dict keys to list
div_operators - operators for division
with_metaclass - metaclasses
'''
import sys
im... | <commit_before><commit_msg>Add missed file from previous commit<commit_after> | '''Some utilitary classes usually used to make working with different python
versions and different environment easier:
string_types - basestring for python 2 and str fot python 3
dict_keys - convert dict keys to list
div_operators - operators for division
with_metaclass - metaclasses
'''
import sys
im... | Add missed file from previous commit'''Some utilitary classes usually used to make working with different python
versions and different environment easier:
string_types - basestring for python 2 and str fot python 3
dict_keys - convert dict keys to list
div_operators - operators for division
with_metac... | <commit_before><commit_msg>Add missed file from previous commit<commit_after>'''Some utilitary classes usually used to make working with different python
versions and different environment easier:
string_types - basestring for python 2 and str fot python 3
dict_keys - convert dict keys to list
div_operator... | |
a7e366122096cfe3e31dbd30a6bf1322befe8890 | tests/quotes_in_attributes.py | tests/quotes_in_attributes.py | # coding:utf-8
from base import TestBase
class TestQuotesInAttributes(TestBase):
"""Test for quotes in attributes"""
# for debug
# def tearDown(self):
# pass
text = \
"""
<!-- MarkdownTOC {0} -->
<!-- /MarkdownTOC -->
# foo
## bar
"""
def test_no_quote(self):
"""Allow no quote... | Add test for quotes check in attributes | Add test for quotes check in attributes
| Python | mit | naokazuterada/MarkdownTOC | Add test for quotes check in attributes | # coding:utf-8
from base import TestBase
class TestQuotesInAttributes(TestBase):
"""Test for quotes in attributes"""
# for debug
# def tearDown(self):
# pass
text = \
"""
<!-- MarkdownTOC {0} -->
<!-- /MarkdownTOC -->
# foo
## bar
"""
def test_no_quote(self):
"""Allow no quote... | <commit_before><commit_msg>Add test for quotes check in attributes<commit_after> | # coding:utf-8
from base import TestBase
class TestQuotesInAttributes(TestBase):
"""Test for quotes in attributes"""
# for debug
# def tearDown(self):
# pass
text = \
"""
<!-- MarkdownTOC {0} -->
<!-- /MarkdownTOC -->
# foo
## bar
"""
def test_no_quote(self):
"""Allow no quote... | Add test for quotes check in attributes# coding:utf-8
from base import TestBase
class TestQuotesInAttributes(TestBase):
"""Test for quotes in attributes"""
# for debug
# def tearDown(self):
# pass
text = \
"""
<!-- MarkdownTOC {0} -->
<!-- /MarkdownTOC -->
# foo
## bar
"""
def test_no... | <commit_before><commit_msg>Add test for quotes check in attributes<commit_after># coding:utf-8
from base import TestBase
class TestQuotesInAttributes(TestBase):
"""Test for quotes in attributes"""
# for debug
# def tearDown(self):
# pass
text = \
"""
<!-- MarkdownTOC {0} -->
<!-- /MarkdownT... | |
42f559db432da8fdbd95b20bd5b21c8f6e5721b8 | nlpppln/frog_to_saf.py | nlpppln/frog_to_saf.py | #!/usr/bin/env python
import click
import os
import codecs
import json
from xtas.tasks._frog import parse_frog, frog_to_saf
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_dir', type=click.Path())
def frog2saf(input_dir, output_dir):
if not os.path.exists(outpu... | Add script to convert frog output to saf | Add script to convert frog output to saf
| Python | apache-2.0 | WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln | Add script to convert frog output to saf | #!/usr/bin/env python
import click
import os
import codecs
import json
from xtas.tasks._frog import parse_frog, frog_to_saf
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_dir', type=click.Path())
def frog2saf(input_dir, output_dir):
if not os.path.exists(outpu... | <commit_before><commit_msg>Add script to convert frog output to saf<commit_after> | #!/usr/bin/env python
import click
import os
import codecs
import json
from xtas.tasks._frog import parse_frog, frog_to_saf
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_dir', type=click.Path())
def frog2saf(input_dir, output_dir):
if not os.path.exists(outpu... | Add script to convert frog output to saf#!/usr/bin/env python
import click
import os
import codecs
import json
from xtas.tasks._frog import parse_frog, frog_to_saf
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_dir', type=click.Path())
def frog2saf(input_dir, outp... | <commit_before><commit_msg>Add script to convert frog output to saf<commit_after>#!/usr/bin/env python
import click
import os
import codecs
import json
from xtas.tasks._frog import parse_frog, frog_to_saf
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_dir', type=c... | |
b6de36cec53d26716ff340c0f42ecd36e3488e12 | tools/data/track_proto_to_zip.py | tools/data/track_proto_to_zip.py | #!/usr/bin/env python
import argparse
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../src/'))
sys.path.insert(0, osp.join(this_dir, '../../external/'))
from vdetlib.utils.protocol import proto_load
from tpn.data_io import save_track_proto_to_zip
if __name... | Add a script to convert track_proto to zip file for RNN training. | Add a script to convert track_proto to zip file for RNN training.
| Python | mit | myfavouritekk/TPN | Add a script to convert track_proto to zip file for RNN training. | #!/usr/bin/env python
import argparse
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../src/'))
sys.path.insert(0, osp.join(this_dir, '../../external/'))
from vdetlib.utils.protocol import proto_load
from tpn.data_io import save_track_proto_to_zip
if __name... | <commit_before><commit_msg>Add a script to convert track_proto to zip file for RNN training.<commit_after> | #!/usr/bin/env python
import argparse
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../src/'))
sys.path.insert(0, osp.join(this_dir, '../../external/'))
from vdetlib.utils.protocol import proto_load
from tpn.data_io import save_track_proto_to_zip
if __name... | Add a script to convert track_proto to zip file for RNN training.#!/usr/bin/env python
import argparse
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../src/'))
sys.path.insert(0, osp.join(this_dir, '../../external/'))
from vdetlib.utils.protocol import prot... | <commit_before><commit_msg>Add a script to convert track_proto to zip file for RNN training.<commit_after>#!/usr/bin/env python
import argparse
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../src/'))
sys.path.insert(0, osp.join(this_dir, '../../external/')... | |
daca419af5f75443a09c6897e968c4af158412c1 | tempest/tests/services/compute/test_migrations_client.py | tempest/tests/services/compute/test_migrations_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 tests for migrations_client | Add unit tests for migrations_client
This patch adds unit tests for migrations_client.
Change-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04
| Python | apache-2.0 | vedujoshi/tempest,flyingfish007/tempest,LIS/lis-tempest,cisco-openstack/tempest,openstack/tempest,masayukig/tempest,openstack/tempest,tonyli71/tempest,bigswitch/tempest,sebrandon1/tempest,izadorozhna/tempest,sebrandon1/tempest,bigswitch/tempest,tonyli71/tempest,flyingfish007/tempest,zsoltdudas/lis-tempest,Juniper/tempe... | Add unit tests for migrations_client
This patch adds unit tests for migrations_client.
Change-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04 | # 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 tests for migrations_client
This patch adds unit tests for migrations_client.
Change-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04<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 tests for migrations_client
This patch adds unit tests for migrations_client.
Change-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04# 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 ... | <commit_before><commit_msg>Add unit tests for migrations_client
This patch adds unit tests for migrations_client.
Change-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04<commit_after># Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | |
ac1acad4ba9f31fc306e95668d489424611a681e | lsv_compassion/model/invoice_line.py | lsv_compassion/model/invoice_line.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# The licence is in the file __open... | Add missing file in previous commit. | Add missing file in previous commit.
| Python | agpl-3.0 | eicher31/compassion-switzerland,eicher31/compassion-switzerland,Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switze... | Add missing file in previous commit. | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# The licence is in the file __open... | <commit_before><commit_msg>Add missing file in previous commit.<commit_after> | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# The licence is in the file __open... | Add missing file in previous commit.# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# ... | <commit_before><commit_msg>Add missing file in previous commit.<commit_after># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: ... | |
380429426835f30f6322f1154b9deb96629807cd | tests/data_checks/test_trans_associations.py | tests/data_checks/test_trans_associations.py | # ------------------------------------------------
# built-ins
import unittest
# local
from utils.base import TestPostgapBase
# ------------------------------------------------
class TestTransAssociations(TestPostgapBase):
'''
Consider first association per group only, as chromosomes
being consistent with... | Check for chrom gene_chrom mismatches | Check for chrom gene_chrom mismatches
| Python | apache-2.0 | Ensembl/cttv024,Ensembl/cttv024 | Check for chrom gene_chrom mismatches | # ------------------------------------------------
# built-ins
import unittest
# local
from utils.base import TestPostgapBase
# ------------------------------------------------
class TestTransAssociations(TestPostgapBase):
'''
Consider first association per group only, as chromosomes
being consistent with... | <commit_before><commit_msg>Check for chrom gene_chrom mismatches<commit_after> | # ------------------------------------------------
# built-ins
import unittest
# local
from utils.base import TestPostgapBase
# ------------------------------------------------
class TestTransAssociations(TestPostgapBase):
'''
Consider first association per group only, as chromosomes
being consistent with... | Check for chrom gene_chrom mismatches# ------------------------------------------------
# built-ins
import unittest
# local
from utils.base import TestPostgapBase
# ------------------------------------------------
class TestTransAssociations(TestPostgapBase):
'''
Consider first association per group only, as ... | <commit_before><commit_msg>Check for chrom gene_chrom mismatches<commit_after># ------------------------------------------------
# built-ins
import unittest
# local
from utils.base import TestPostgapBase
# ------------------------------------------------
class TestTransAssociations(TestPostgapBase):
'''
Consi... | |
a5314901f123dac6633bd7e7ece6a4d68805070a | ice_setup/tests/test_paths.py | ice_setup/tests/test_paths.py | import tempfile
import os
import shutil
import pytest
from ice_setup.ice import get_package_source, DirNotFound, VersionNotFound
@pytest.fixture
def pkg_path():
pkg_path = tempfile.mkdtemp()
def fin():
shutil.rmtree(pkg_path)
return pkg_path
class TestGetPackageSource(object):
def test_u... | Add tests for package path building | Add tests for package path building
Unit tests for get_package_source()
Signed-off-by: Travis Rhoden <[email protected]>
| Python | mit | trhoden/ice-setup,ceph/ice-setup,ktdreyer/ice-setup | Add tests for package path building
Unit tests for get_package_source()
Signed-off-by: Travis Rhoden <[email protected]> | import tempfile
import os
import shutil
import pytest
from ice_setup.ice import get_package_source, DirNotFound, VersionNotFound
@pytest.fixture
def pkg_path():
pkg_path = tempfile.mkdtemp()
def fin():
shutil.rmtree(pkg_path)
return pkg_path
class TestGetPackageSource(object):
def test_u... | <commit_before><commit_msg>Add tests for package path building
Unit tests for get_package_source()
Signed-off-by: Travis Rhoden <[email protected]><commit_after> | import tempfile
import os
import shutil
import pytest
from ice_setup.ice import get_package_source, DirNotFound, VersionNotFound
@pytest.fixture
def pkg_path():
pkg_path = tempfile.mkdtemp()
def fin():
shutil.rmtree(pkg_path)
return pkg_path
class TestGetPackageSource(object):
def test_u... | Add tests for package path building
Unit tests for get_package_source()
Signed-off-by: Travis Rhoden <[email protected]>import tempfile
import os
import shutil
import pytest
from ice_setup.ice import get_package_source, DirNotFound, VersionNotFound
@pytest.fixture
def pkg_path():... | <commit_before><commit_msg>Add tests for package path building
Unit tests for get_package_source()
Signed-off-by: Travis Rhoden <[email protected]><commit_after>import tempfile
import os
import shutil
import pytest
from ice_setup.ice import get_package_source, DirNotFound, VersionN... | |
0007289a32262df6ce167f33dd8d30219cce2385 | run.py | run.py | from flask import Flask, request, redirect
import twilio.twiml
from bixiapi import scraper, conf
app = Flask(__name__)
def get_location_info(stations, location, looking_for):
location = str(location).lower()
if location in conf.locations:
for station_id in conf.locations[location]:
try:... | Add Flask server file (Bixi statuses as a service) | Add Flask server file (Bixi statuses as a service)
| Python | mit | dellsystem/bixi-checker,tuxication/bixi-checker | Add Flask server file (Bixi statuses as a service) | from flask import Flask, request, redirect
import twilio.twiml
from bixiapi import scraper, conf
app = Flask(__name__)
def get_location_info(stations, location, looking_for):
location = str(location).lower()
if location in conf.locations:
for station_id in conf.locations[location]:
try:... | <commit_before><commit_msg>Add Flask server file (Bixi statuses as a service)<commit_after> | from flask import Flask, request, redirect
import twilio.twiml
from bixiapi import scraper, conf
app = Flask(__name__)
def get_location_info(stations, location, looking_for):
location = str(location).lower()
if location in conf.locations:
for station_id in conf.locations[location]:
try:... | Add Flask server file (Bixi statuses as a service)from flask import Flask, request, redirect
import twilio.twiml
from bixiapi import scraper, conf
app = Flask(__name__)
def get_location_info(stations, location, looking_for):
location = str(location).lower()
if location in conf.locations:
for statio... | <commit_before><commit_msg>Add Flask server file (Bixi statuses as a service)<commit_after>from flask import Flask, request, redirect
import twilio.twiml
from bixiapi import scraper, conf
app = Flask(__name__)
def get_location_info(stations, location, looking_for):
location = str(location).lower()
if locat... | |
0719c0e51631074dc6ec41c64186c8f23f60dd75 | non_semantic_speech_benchmark/cap12/cka.py | non_semantic_speech_benchmark/cap12/cka.py | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Add CKA utils for use in other projects. | Add CKA utils for use in other projects.
PiperOrigin-RevId: 461504827
| Python | apache-2.0 | google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,... | Add CKA utils for use in other projects.
PiperOrigin-RevId: 461504827 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | <commit_before><commit_msg>Add CKA utils for use in other projects.
PiperOrigin-RevId: 461504827<commit_after> | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Add CKA utils for use in other projects.
PiperOrigin-RevId: 461504827# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | <commit_before><commit_msg>Add CKA utils for use in other projects.
PiperOrigin-RevId: 461504827<commit_after># coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | |
d56629235381aacfcb0c810fd57bc6eb4bb06d24 | ReligiousPhraseMC/holy_twitter.py | ReligiousPhraseMC/holy_twitter.py | """Coordinates the twitter api with the markov chain models"""
def main():
"""The main event loop for the holy twitter bot
It watches for twitter events, and posts randomly generated holy text to twitter.
"""
pass
if __name__ == '__main__':
main()
| Create the main event loop | Create the main event loop
This is the vent loop whihc will monitor twitter, and respond to new
followers, post messages every so often, and hopefully be able to
respond to new direct messages.
| Python | mit | salvor7/MarkovChainBibleBot | Create the main event loop
This is the vent loop whihc will monitor twitter, and respond to new
followers, post messages every so often, and hopefully be able to
respond to new direct messages. | """Coordinates the twitter api with the markov chain models"""
def main():
"""The main event loop for the holy twitter bot
It watches for twitter events, and posts randomly generated holy text to twitter.
"""
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Create the main event loop
This is the vent loop whihc will monitor twitter, and respond to new
followers, post messages every so often, and hopefully be able to
respond to new direct messages.<commit_after> | """Coordinates the twitter api with the markov chain models"""
def main():
"""The main event loop for the holy twitter bot
It watches for twitter events, and posts randomly generated holy text to twitter.
"""
pass
if __name__ == '__main__':
main()
| Create the main event loop
This is the vent loop whihc will monitor twitter, and respond to new
followers, post messages every so often, and hopefully be able to
respond to new direct messages."""Coordinates the twitter api with the markov chain models"""
def main():
"""The main event loop for the holy twitter b... | <commit_before><commit_msg>Create the main event loop
This is the vent loop whihc will monitor twitter, and respond to new
followers, post messages every so often, and hopefully be able to
respond to new direct messages.<commit_after>"""Coordinates the twitter api with the markov chain models"""
def main():
"""T... | |
cb54dc8d1acf5007d15c4a4b0801bedbfbc406e4 | checkapt.py | checkapt.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import apt
class CheckApt(object):
def __init__(self):
self.cache = apt.Cache()
def list_installed(self):
pkgs = [i for i in self.cache if i.is_installed]
return pkgs
def main():
check = CheckApt()
p = check.list_installed()
... | Add check package installed via python apt. | Add check package installed via python apt.
| Python | mit | somat/samber | Add check package installed via python apt. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import apt
class CheckApt(object):
def __init__(self):
self.cache = apt.Cache()
def list_installed(self):
pkgs = [i for i in self.cache if i.is_installed]
return pkgs
def main():
check = CheckApt()
p = check.list_installed()
... | <commit_before><commit_msg>Add check package installed via python apt.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import apt
class CheckApt(object):
def __init__(self):
self.cache = apt.Cache()
def list_installed(self):
pkgs = [i for i in self.cache if i.is_installed]
return pkgs
def main():
check = CheckApt()
p = check.list_installed()
... | Add check package installed via python apt.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import apt
class CheckApt(object):
def __init__(self):
self.cache = apt.Cache()
def list_installed(self):
pkgs = [i for i in self.cache if i.is_installed]
return pkgs
def main():
check = Ch... | <commit_before><commit_msg>Add check package installed via python apt.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import apt
class CheckApt(object):
def __init__(self):
self.cache = apt.Cache()
def list_installed(self):
pkgs = [i for i in self.cache if i.is_installed]
... | |
f00ae3046436f09e62460a8468e031a0c2027e7f | scikits/learn/machine/em/__init__.py | scikits/learn/machine/em/__init__.py | #! /usr/bin/env python
# Last Change: Sun Jul 22 01:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing import NumpyTest
test = NumpyTes... | #! /usr/bin/env python
# Last Change: Sun Sep 07 04:00 PM 2008 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
| Remove deprecated test runned for em machine. | Remove deprecated test runned for em machine.
From: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@271 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8
| Python | bsd-3-clause | xzh86/scikit-learn,Akshay0724/scikit-learn,fyffyt/scikit-learn,jlegendary/scikit-learn,henridwyer/scikit-learn,Djabbz/scikit-learn,shenzebang/scikit-learn,mrshu/scikit-learn,costypetrisor/scikit-learn,jlegendary/scikit-learn,manhhomienbienthuy/scikit-learn,thientu/scikit-learn,marcocaccin/scikit-learn,xavierwu/scikit-l... | #! /usr/bin/env python
# Last Change: Sun Jul 22 01:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing import NumpyTest
test = NumpyTes... | #! /usr/bin/env python
# Last Change: Sun Sep 07 04:00 PM 2008 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
| <commit_before>#! /usr/bin/env python
# Last Change: Sun Jul 22 01:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing import NumpyTest
... | #! /usr/bin/env python
# Last Change: Sun Sep 07 04:00 PM 2008 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
| #! /usr/bin/env python
# Last Change: Sun Jul 22 01:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing import NumpyTest
test = NumpyTes... | <commit_before>#! /usr/bin/env python
# Last Change: Sun Jul 22 01:00 PM 2007 J
from info import __doc__
from gauss_mix import GmParamError, GM
from gmm_em import GmmParamError, GMM, EM
from online_em import OnGMM as _OnGMM
__all__ = filter(lambda s:not s.startswith('_'), dir())
from numpy.testing import NumpyTest
... |
73666cdc83e55aefcf4796c286d5d11fe2cac956 | py/next-greater-element-ii.py | py/next-greater-element-ii.py | class Solution(object):
def nextGreaterElements(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
stack = []
lnum = len(nums)
for i in xrange(lnum - 1, -1, -1):
n = nums[i]
while stack and stack[-1] <= n:
stac... | Add py solution for 503. Next Greater Element II | Add py solution for 503. Next Greater Element II
503. Next Greater Element II: https://leetcode.com/problems/next-greater-element-ii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 503. Next Greater Element II
503. Next Greater Element II: https://leetcode.com/problems/next-greater-element-ii/ | class Solution(object):
def nextGreaterElements(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
stack = []
lnum = len(nums)
for i in xrange(lnum - 1, -1, -1):
n = nums[i]
while stack and stack[-1] <= n:
stac... | <commit_before><commit_msg>Add py solution for 503. Next Greater Element II
503. Next Greater Element II: https://leetcode.com/problems/next-greater-element-ii/<commit_after> | class Solution(object):
def nextGreaterElements(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
stack = []
lnum = len(nums)
for i in xrange(lnum - 1, -1, -1):
n = nums[i]
while stack and stack[-1] <= n:
stac... | Add py solution for 503. Next Greater Element II
503. Next Greater Element II: https://leetcode.com/problems/next-greater-element-ii/class Solution(object):
def nextGreaterElements(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
stack = []
lnum = len(num... | <commit_before><commit_msg>Add py solution for 503. Next Greater Element II
503. Next Greater Element II: https://leetcode.com/problems/next-greater-element-ii/<commit_after>class Solution(object):
def nextGreaterElements(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.