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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dd4035fc8dcb5b582ca154670b77d719a11f44cf | src/webapp/dummy_data.py | src/webapp/dummy_data.py | from math import sqrt
from random import random
import database as db
from database.model import Team, Members, Location
def make_dummy_data(num_teams, confirmed=True):
for idx in range(num_teams):
team = Team(name="Team %d" % idx,
confirmed=confirmed)
db.session.add(team)
... | Add a function to insert dummy data in the database | Add a function to insert dummy data in the database
| Python | bsd-3-clause | janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system | Add a function to insert dummy data in the database | from math import sqrt
from random import random
import database as db
from database.model import Team, Members, Location
def make_dummy_data(num_teams, confirmed=True):
for idx in range(num_teams):
team = Team(name="Team %d" % idx,
confirmed=confirmed)
db.session.add(team)
... | <commit_before><commit_msg>Add a function to insert dummy data in the database<commit_after> | from math import sqrt
from random import random
import database as db
from database.model import Team, Members, Location
def make_dummy_data(num_teams, confirmed=True):
for idx in range(num_teams):
team = Team(name="Team %d" % idx,
confirmed=confirmed)
db.session.add(team)
... | Add a function to insert dummy data in the databasefrom math import sqrt
from random import random
import database as db
from database.model import Team, Members, Location
def make_dummy_data(num_teams, confirmed=True):
for idx in range(num_teams):
team = Team(name="Team %d" % idx,
con... | <commit_before><commit_msg>Add a function to insert dummy data in the database<commit_after>from math import sqrt
from random import random
import database as db
from database.model import Team, Members, Location
def make_dummy_data(num_teams, confirmed=True):
for idx in range(num_teams):
team = Team(name... | |
82e2da1363441177216b0c230232aa061f18714e | alembic/versions/7c9bbf3a039a_game_stats_stat_id.py | alembic/versions/7c9bbf3a039a_game_stats_stat_id.py | revision = '7c9bbf3a039a'
down_revision = '89c5cb66426d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
conn = alembic.context.get_context().bind
meta = sqlalchemy.MetaData(bind=conn)
meta.reflect()
game_stats = meta.tables["game_stats"]
shows = meta.tables["shows"]
cons... | Update the foreign key on `game_stats.stat_id` to reference `stats.id` instead of `shows.id` | Update the foreign key on `game_stats.stat_id` to reference `stats.id` instead of `shows.id`
Closes #250.
| Python | apache-2.0 | andreasots/lrrbot,mrphlip/lrrbot,andreasots/lrrbot,andreasots/lrrbot,mrphlip/lrrbot,mrphlip/lrrbot | Update the foreign key on `game_stats.stat_id` to reference `stats.id` instead of `shows.id`
Closes #250. | revision = '7c9bbf3a039a'
down_revision = '89c5cb66426d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
conn = alembic.context.get_context().bind
meta = sqlalchemy.MetaData(bind=conn)
meta.reflect()
game_stats = meta.tables["game_stats"]
shows = meta.tables["shows"]
cons... | <commit_before><commit_msg>Update the foreign key on `game_stats.stat_id` to reference `stats.id` instead of `shows.id`
Closes #250.<commit_after> | revision = '7c9bbf3a039a'
down_revision = '89c5cb66426d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
conn = alembic.context.get_context().bind
meta = sqlalchemy.MetaData(bind=conn)
meta.reflect()
game_stats = meta.tables["game_stats"]
shows = meta.tables["shows"]
cons... | Update the foreign key on `game_stats.stat_id` to reference `stats.id` instead of `shows.id`
Closes #250.revision = '7c9bbf3a039a'
down_revision = '89c5cb66426d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
conn = alembic.context.get_context().bind
meta = sqlalchemy.MetaDa... | <commit_before><commit_msg>Update the foreign key on `game_stats.stat_id` to reference `stats.id` instead of `shows.id`
Closes #250.<commit_after>revision = '7c9bbf3a039a'
down_revision = '89c5cb66426d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
conn = alembic.context.get... | |
58316a5823e2e136b2b5687d4aef323ad8a86cee | senlin/tests/functional/drivers/openstack/sdk.py | senlin/tests/functional/drivers/openstack/sdk.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | Add to_dict() method for faked resource | Add to_dict() method for faked resource
When testing node_get with details, we expect the profile to return a
resource that has a to_dict() method. The existing faked resource
doesn't support this yet. This patch fixes it.
Change-Id: I52e0dad74a1140f8233280ff10a9c14ff1760f72
| Python | apache-2.0 | stackforge/senlin,openstack/senlin,openstack/senlin,openstack/senlin,tengqm/senlin-container,stackforge/senlin,tengqm/senlin-container | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
68e79e2c45d173d950f203e11a95452fc40b2b8e | tests/grammar_creation_test/RulesCopyTest.py | tests/grammar_creation_test/RulesCopyTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 18:45
:Licence GNUv3
Part of grammpy
"""
from copy import deepcopy
from unittest import TestCase, main
from grammpy import *
class RulesAddingTest(TestCase):
def test_copyOfSingleRule(self):
class A(Nonterminal): pass
class B(... | Add tests of deep copy | Add tests of deep copy
| Python | mit | PatrikValkovic/grammpy | Add tests of deep copy | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 18:45
:Licence GNUv3
Part of grammpy
"""
from copy import deepcopy
from unittest import TestCase, main
from grammpy import *
class RulesAddingTest(TestCase):
def test_copyOfSingleRule(self):
class A(Nonterminal): pass
class B(... | <commit_before><commit_msg>Add tests of deep copy<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 18:45
:Licence GNUv3
Part of grammpy
"""
from copy import deepcopy
from unittest import TestCase, main
from grammpy import *
class RulesAddingTest(TestCase):
def test_copyOfSingleRule(self):
class A(Nonterminal): pass
class B(... | Add tests of deep copy#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 18:45
:Licence GNUv3
Part of grammpy
"""
from copy import deepcopy
from unittest import TestCase, main
from grammpy import *
class RulesAddingTest(TestCase):
def test_copyOfSingleRule(self):
class A(Nonterminal):... | <commit_before><commit_msg>Add tests of deep copy<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 18:45
:Licence GNUv3
Part of grammpy
"""
from copy import deepcopy
from unittest import TestCase, main
from grammpy import *
class RulesAddingTest(TestCase):
def test_copyOfSingle... | |
aeca35135975dbfe9bc807181252754cc08a1f16 | paasta_tools/firewall.py | paasta_tools/firewall.py | #!/usr/bin/env python2.7
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import shlex
import subprocess
class ChainDoesNotExist(Exception):
pass
def ensure_chain(chain, rules):
"""Idempotently ensure a chain exists and has a set of rules.
This function creates... | Add some simple iptables managing functions | Add some simple iptables managing functions
The most important of these is `ensure_chain` for creating and managing
the rules on an entire chain.
| Python | apache-2.0 | somic/paasta,somic/paasta,Yelp/paasta,Yelp/paasta | Add some simple iptables managing functions
The most important of these is `ensure_chain` for creating and managing
the rules on an entire chain. | #!/usr/bin/env python2.7
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import shlex
import subprocess
class ChainDoesNotExist(Exception):
pass
def ensure_chain(chain, rules):
"""Idempotently ensure a chain exists and has a set of rules.
This function creates... | <commit_before><commit_msg>Add some simple iptables managing functions
The most important of these is `ensure_chain` for creating and managing
the rules on an entire chain.<commit_after> | #!/usr/bin/env python2.7
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import shlex
import subprocess
class ChainDoesNotExist(Exception):
pass
def ensure_chain(chain, rules):
"""Idempotently ensure a chain exists and has a set of rules.
This function creates... | Add some simple iptables managing functions
The most important of these is `ensure_chain` for creating and managing
the rules on an entire chain.#!/usr/bin/env python2.7
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import shlex
import subprocess
class ChainDoesNotExist(E... | <commit_before><commit_msg>Add some simple iptables managing functions
The most important of these is `ensure_chain` for creating and managing
the rules on an entire chain.<commit_after>#!/usr/bin/env python2.7
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import shlex
impo... | |
1f50ebe397b692356dc4b34c646685badae85223 | nipype/algorithms/tests/test_auto_Overlap.py | nipype/algorithms/tests/test_auto_Overlap.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
mas... | Test Overlap not included before | Test Overlap not included before
| Python | bsd-3-clause | gerddie/nipype,blakedewey/nipype,mick-d/nipype,wanderine/nipype,mick-d/nipype,dgellis90/nipype,JohnGriffiths/nipype,pearsonlab/nipype,mick-d/nipype,pearsonlab/nipype,arokem/nipype,iglpdc/nipype,blakedewey/nipype,carolFrohlich/nipype,carolFrohlich/nipype,sgiavasis/nipype,arokem/nipype,iglpdc/nipype,carolFrohlich/nipype,... | Test Overlap not included before | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
mas... | <commit_before><commit_msg>Test Overlap not included before<commit_after> | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
mas... | Test Overlap not included before# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | <commit_before><commit_msg>Test Overlap not included before<commit_after># AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
... | |
1b7c3b829569acc163f98a93ced6f232c8ab0045 | users/migrations/0002_user_protected.py | users/migrations/0002_user_protected.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='protected',
... | Add migrations for protected attribute | Add migrations for protected attribute
| Python | mit | jonathanstallings/cf-django,jonathanstallings/cf-django,jonathanstallings/cf-django | Add migrations for protected attribute | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='protected',
... | <commit_before><commit_msg>Add migrations for protected attribute<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='protected',
... | Add migrations for protected attribute# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name=... | <commit_before><commit_msg>Add migrations for protected attribute<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
mig... | |
1ca2f6fa7f07bd043b2d27f5313fa7218700a502 | zephyr/management/commands/reset_colors.py | zephyr/management/commands/reset_colors.py | from django.core.management.base import BaseCommand
from zephyr.models import StreamColor, UserProfile, Subscription, Recipient
class Command(BaseCommand):
help = """Reset all colors for a person to the default grey"""
def handle(self, *args, **options):
if not args:
self.print_help("pytho... | Add a management command to reset your stream colors to the default. | Add a management command to reset your stream colors to the default.
(imported from commit f6891ad40088bf34686a7d8a2d910a9a0f3be7c2)
| Python | apache-2.0 | suxinde2009/zulip,eastlhu/zulip,dattatreya303/zulip,zulip/zulip,nicholasbs/zulip,ikasumiwt/zulip,jphilipsen05/zulip,babbage/zulip,dxq-git/zulip,udxxabp/zulip,calvinleenyc/zulip,zhaoweigg/zulip,armooo/zulip,jonesgithub/zulip,pradiptad/zulip,levixie/zulip,paxapy/zulip,wangdeshui/zulip,LAndreas/zulip,PaulPetring/zulip,May... | Add a management command to reset your stream colors to the default.
(imported from commit f6891ad40088bf34686a7d8a2d910a9a0f3be7c2) | from django.core.management.base import BaseCommand
from zephyr.models import StreamColor, UserProfile, Subscription, Recipient
class Command(BaseCommand):
help = """Reset all colors for a person to the default grey"""
def handle(self, *args, **options):
if not args:
self.print_help("pytho... | <commit_before><commit_msg>Add a management command to reset your stream colors to the default.
(imported from commit f6891ad40088bf34686a7d8a2d910a9a0f3be7c2)<commit_after> | from django.core.management.base import BaseCommand
from zephyr.models import StreamColor, UserProfile, Subscription, Recipient
class Command(BaseCommand):
help = """Reset all colors for a person to the default grey"""
def handle(self, *args, **options):
if not args:
self.print_help("pytho... | Add a management command to reset your stream colors to the default.
(imported from commit f6891ad40088bf34686a7d8a2d910a9a0f3be7c2)from django.core.management.base import BaseCommand
from zephyr.models import StreamColor, UserProfile, Subscription, Recipient
class Command(BaseCommand):
help = """Reset all colors... | <commit_before><commit_msg>Add a management command to reset your stream colors to the default.
(imported from commit f6891ad40088bf34686a7d8a2d910a9a0f3be7c2)<commit_after>from django.core.management.base import BaseCommand
from zephyr.models import StreamColor, UserProfile, Subscription, Recipient
class Command(Bas... | |
8e65780c50dd97eb9453f6f1d9dc4b74ba4c8e3f | backend/simulator/random_series_functions.py | backend/simulator/random_series_functions.py | import numpy as np
from simulator.series_functions import SinSeries, ConstantSeries
class RandomSinSeries(SinSeries):
AMPLITUDE_LOW = 1.0
AMPLITUDE_HIGH = 10.0
FREQUENCY_LOW = 0.1
FREQUENCY_HIGH = 2.0
def __init__(self, create_ts, update_period):
amplitude = np.random.uniform(self.AMPLITU... | Add random versions of series_functions | Add random versions of series_functions
| Python | mit | qiubit/luminis,qiubit/luminis,qiubit/luminis,qiubit/luminis | Add random versions of series_functions | import numpy as np
from simulator.series_functions import SinSeries, ConstantSeries
class RandomSinSeries(SinSeries):
AMPLITUDE_LOW = 1.0
AMPLITUDE_HIGH = 10.0
FREQUENCY_LOW = 0.1
FREQUENCY_HIGH = 2.0
def __init__(self, create_ts, update_period):
amplitude = np.random.uniform(self.AMPLITU... | <commit_before><commit_msg>Add random versions of series_functions<commit_after> | import numpy as np
from simulator.series_functions import SinSeries, ConstantSeries
class RandomSinSeries(SinSeries):
AMPLITUDE_LOW = 1.0
AMPLITUDE_HIGH = 10.0
FREQUENCY_LOW = 0.1
FREQUENCY_HIGH = 2.0
def __init__(self, create_ts, update_period):
amplitude = np.random.uniform(self.AMPLITU... | Add random versions of series_functionsimport numpy as np
from simulator.series_functions import SinSeries, ConstantSeries
class RandomSinSeries(SinSeries):
AMPLITUDE_LOW = 1.0
AMPLITUDE_HIGH = 10.0
FREQUENCY_LOW = 0.1
FREQUENCY_HIGH = 2.0
def __init__(self, create_ts, update_period):
amp... | <commit_before><commit_msg>Add random versions of series_functions<commit_after>import numpy as np
from simulator.series_functions import SinSeries, ConstantSeries
class RandomSinSeries(SinSeries):
AMPLITUDE_LOW = 1.0
AMPLITUDE_HIGH = 10.0
FREQUENCY_LOW = 0.1
FREQUENCY_HIGH = 2.0
def __init__(sel... | |
a3c5becc0e2268714228c0a9db613cbfa46de7f7 | calaccess_raw/migrations/0014_auto_20170421_1821.py | calaccess_raw/migrations/0014_auto_20170421_1821.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-21 18:21
from __future__ import unicode_literals
import calaccess_raw.annotations
import calaccess_raw.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_raw', '0013_auto_20161123_2219'... | Add migration for RawDataVersion/File options, rcptcd.tran_type field options | Add migration for RawDataVersion/File options, rcptcd.tran_type field options
| Python | mit | california-civic-data-coalition/django-calaccess-raw-data | Add migration for RawDataVersion/File options, rcptcd.tran_type field options | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-21 18:21
from __future__ import unicode_literals
import calaccess_raw.annotations
import calaccess_raw.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_raw', '0013_auto_20161123_2219'... | <commit_before><commit_msg>Add migration for RawDataVersion/File options, rcptcd.tran_type field options<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-21 18:21
from __future__ import unicode_literals
import calaccess_raw.annotations
import calaccess_raw.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_raw', '0013_auto_20161123_2219'... | Add migration for RawDataVersion/File options, rcptcd.tran_type field options# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-21 18:21
from __future__ import unicode_literals
import calaccess_raw.annotations
import calaccess_raw.fields
from django.db import migrations
class Migration(migrations.Migratio... | <commit_before><commit_msg>Add migration for RawDataVersion/File options, rcptcd.tran_type field options<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-21 18:21
from __future__ import unicode_literals
import calaccess_raw.annotations
import calaccess_raw.fields
from django.db import migrati... | |
5bb96cd91809669b200d8a97ef80a6dcb6787781 | scripts/anonscrobbles.py | scripts/anonscrobbles.py | #!/usr/bin/env python
import random
s = open("scrobbledump.sql", "r")
o = open("scrobbles.anonymous.sql", "w")
datasection = False
usermap = {}
#track, artist, "time", mbid, album, source, rating, length, stid, userid, track_tsv, artist_tsv
for line in s.readlines():
if line.rstrip() == "\.":
datasection = False
... | Add hacky script for anonymising dumps of the Scrobbles table whilst still maintaining internal consistency | Add hacky script for anonymising dumps of the Scrobbles table whilst still maintaining internal consistency | Python | agpl-3.0 | foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm | Add hacky script for anonymising dumps of the Scrobbles table whilst still maintaining internal consistency | #!/usr/bin/env python
import random
s = open("scrobbledump.sql", "r")
o = open("scrobbles.anonymous.sql", "w")
datasection = False
usermap = {}
#track, artist, "time", mbid, album, source, rating, length, stid, userid, track_tsv, artist_tsv
for line in s.readlines():
if line.rstrip() == "\.":
datasection = False
... | <commit_before><commit_msg>Add hacky script for anonymising dumps of the Scrobbles table whilst still maintaining internal consistency<commit_after> | #!/usr/bin/env python
import random
s = open("scrobbledump.sql", "r")
o = open("scrobbles.anonymous.sql", "w")
datasection = False
usermap = {}
#track, artist, "time", mbid, album, source, rating, length, stid, userid, track_tsv, artist_tsv
for line in s.readlines():
if line.rstrip() == "\.":
datasection = False
... | Add hacky script for anonymising dumps of the Scrobbles table whilst still maintaining internal consistency#!/usr/bin/env python
import random
s = open("scrobbledump.sql", "r")
o = open("scrobbles.anonymous.sql", "w")
datasection = False
usermap = {}
#track, artist, "time", mbid, album, source, rating, length, stid, ... | <commit_before><commit_msg>Add hacky script for anonymising dumps of the Scrobbles table whilst still maintaining internal consistency<commit_after>#!/usr/bin/env python
import random
s = open("scrobbledump.sql", "r")
o = open("scrobbles.anonymous.sql", "w")
datasection = False
usermap = {}
#track, artist, "time", mb... | |
7da0a22a6533dc93da23dfa5025cb5172496c97f | sorbic/utils/traverse.py | sorbic/utils/traverse.py | # -*- coding: utf-8 -*-
'''
Traversal algorithms, used to traverse data stuctures such as can be found in
datbase documents
'''
DEFAULT_TARGET_DELIM = ':'
def traverse_dict_and_list(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM):
'''
Traverse a dict or list using a colon-delimited (or otherwise deli... | Add traversal lib to utils | Add traversal lib to utils
| Python | apache-2.0 | thatch45/sorbic,s0undt3ch/sorbic | Add traversal lib to utils | # -*- coding: utf-8 -*-
'''
Traversal algorithms, used to traverse data stuctures such as can be found in
datbase documents
'''
DEFAULT_TARGET_DELIM = ':'
def traverse_dict_and_list(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM):
'''
Traverse a dict or list using a colon-delimited (or otherwise deli... | <commit_before><commit_msg>Add traversal lib to utils<commit_after> | # -*- coding: utf-8 -*-
'''
Traversal algorithms, used to traverse data stuctures such as can be found in
datbase documents
'''
DEFAULT_TARGET_DELIM = ':'
def traverse_dict_and_list(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM):
'''
Traverse a dict or list using a colon-delimited (or otherwise deli... | Add traversal lib to utils# -*- coding: utf-8 -*-
'''
Traversal algorithms, used to traverse data stuctures such as can be found in
datbase documents
'''
DEFAULT_TARGET_DELIM = ':'
def traverse_dict_and_list(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM):
'''
Traverse a dict or list using a colon-de... | <commit_before><commit_msg>Add traversal lib to utils<commit_after># -*- coding: utf-8 -*-
'''
Traversal algorithms, used to traverse data stuctures such as can be found in
datbase documents
'''
DEFAULT_TARGET_DELIM = ':'
def traverse_dict_and_list(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM):
'''
... | |
4b50f0c57a99fbe5bff4202c0a22ad55b923dd6c | simulations/replayLog.py | simulations/replayLog.py | import pickle
import logging
from parseMaildir import Email
logging.basicConfig(level=logging.INFO) # Set to .DEBUG for gory details
# Parse the pickles generated by parseMaildir.py
parsedLogsFolder = 'Enron/parsing/'
social = pickle.load(open(parsedLogsFolder + "social.pkl", "rb"))
log = pickle.load(open(parsedLog... | Add simulation script for ClaimChain in Autocrypt mode | Add simulation script for ClaimChain in Autocrypt mode
| Python | mit | gdanezis/claimchain-core | Add simulation script for ClaimChain in Autocrypt mode | import pickle
import logging
from parseMaildir import Email
logging.basicConfig(level=logging.INFO) # Set to .DEBUG for gory details
# Parse the pickles generated by parseMaildir.py
parsedLogsFolder = 'Enron/parsing/'
social = pickle.load(open(parsedLogsFolder + "social.pkl", "rb"))
log = pickle.load(open(parsedLog... | <commit_before><commit_msg>Add simulation script for ClaimChain in Autocrypt mode<commit_after> | import pickle
import logging
from parseMaildir import Email
logging.basicConfig(level=logging.INFO) # Set to .DEBUG for gory details
# Parse the pickles generated by parseMaildir.py
parsedLogsFolder = 'Enron/parsing/'
social = pickle.load(open(parsedLogsFolder + "social.pkl", "rb"))
log = pickle.load(open(parsedLog... | Add simulation script for ClaimChain in Autocrypt modeimport pickle
import logging
from parseMaildir import Email
logging.basicConfig(level=logging.INFO) # Set to .DEBUG for gory details
# Parse the pickles generated by parseMaildir.py
parsedLogsFolder = 'Enron/parsing/'
social = pickle.load(open(parsedLogsFolder +... | <commit_before><commit_msg>Add simulation script for ClaimChain in Autocrypt mode<commit_after>import pickle
import logging
from parseMaildir import Email
logging.basicConfig(level=logging.INFO) # Set to .DEBUG for gory details
# Parse the pickles generated by parseMaildir.py
parsedLogsFolder = 'Enron/parsing/'
soc... | |
6dd0130e64d04d66d5325c1e76995056ceacf453 | PyGitUp/tests/test_faster_fastforwarded.py | PyGitUp/tests/test_faster_fastforwarded.py | # System imports
import os
from os.path import join
from git import *
from nose.tools import *
from PyGitUp.tests import basepath, init_master, update_file
test_name = 'faster-forwarded'
repo_path = join(basepath, test_name + os.sep)
def setup():
global master, repo
master_path, master = init_master(test_n... | Add test for faster fastforwarded | Add test for faster fastforwarded
| Python | mit | msiemens/PyGitUp | Add test for faster fastforwarded | # System imports
import os
from os.path import join
from git import *
from nose.tools import *
from PyGitUp.tests import basepath, init_master, update_file
test_name = 'faster-forwarded'
repo_path = join(basepath, test_name + os.sep)
def setup():
global master, repo
master_path, master = init_master(test_n... | <commit_before><commit_msg>Add test for faster fastforwarded<commit_after> | # System imports
import os
from os.path import join
from git import *
from nose.tools import *
from PyGitUp.tests import basepath, init_master, update_file
test_name = 'faster-forwarded'
repo_path = join(basepath, test_name + os.sep)
def setup():
global master, repo
master_path, master = init_master(test_n... | Add test for faster fastforwarded# System imports
import os
from os.path import join
from git import *
from nose.tools import *
from PyGitUp.tests import basepath, init_master, update_file
test_name = 'faster-forwarded'
repo_path = join(basepath, test_name + os.sep)
def setup():
global master, repo
master_... | <commit_before><commit_msg>Add test for faster fastforwarded<commit_after># System imports
import os
from os.path import join
from git import *
from nose.tools import *
from PyGitUp.tests import basepath, init_master, update_file
test_name = 'faster-forwarded'
repo_path = join(basepath, test_name + os.sep)
def set... | |
e44ae7f701a75f2c61546493fab485194cabbf71 | netadmin/networks/utils.py | netadmin/networks/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Amit Pal <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, ei... | Define IPv4_validation and IPv6_validation method | Define IPv4_validation and IPv6_validation method
| Python | agpl-3.0 | umitproject/network-admin,umitproject/network-admin | Define IPv4_validation and IPv6_validation method | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Amit Pal <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, ei... | <commit_before><commit_msg>Define IPv4_validation and IPv6_validation method<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Amit Pal <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, ei... | Define IPv4_validation and IPv6_validation method#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Amit Pal <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | <commit_before><commit_msg>Define IPv4_validation and IPv6_validation method<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Amit Pal <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | |
518f9bff28585aa1eeb12b9b12d95e32fb257725 | src/district_distance.py | src/district_distance.py |
# coding: utf-8
# In[79]:
import math
import operator
import json
from geopy.distance import great_circle
# In[90]:
class Order_districts():
def get_district_info():
# -- get names and coordinates from csv file
with open('coordinates.json') as coord_file:
district_dict = j... | Return the districts name by distance given coordinates | Return the districts name by distance given coordinates
| Python | apache-2.0 | ldolberg/the_port_ors_hdx,ldolberg/the_port_ors_hdx | Return the districts name by distance given coordinates |
# coding: utf-8
# In[79]:
import math
import operator
import json
from geopy.distance import great_circle
# In[90]:
class Order_districts():
def get_district_info():
# -- get names and coordinates from csv file
with open('coordinates.json') as coord_file:
district_dict = j... | <commit_before><commit_msg>Return the districts name by distance given coordinates<commit_after> |
# coding: utf-8
# In[79]:
import math
import operator
import json
from geopy.distance import great_circle
# In[90]:
class Order_districts():
def get_district_info():
# -- get names and coordinates from csv file
with open('coordinates.json') as coord_file:
district_dict = j... | Return the districts name by distance given coordinates
# coding: utf-8
# In[79]:
import math
import operator
import json
from geopy.distance import great_circle
# In[90]:
class Order_districts():
def get_district_info():
# -- get names and coordinates from csv file
with open('coordinates.... | <commit_before><commit_msg>Return the districts name by distance given coordinates<commit_after>
# coding: utf-8
# In[79]:
import math
import operator
import json
from geopy.distance import great_circle
# In[90]:
class Order_districts():
def get_district_info():
# -- get names and coordinates from... | |
0d0d32feab4527f78ef4dbdb1cd890aa72851b18 | bioagents/resources/trips_ont_manager.py | bioagents/resources/trips_ont_manager.py | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trips_ontology.init... | Implement TRIPS ontology manager with trips_isa | Implement TRIPS ontology manager with trips_isa
| Python | bsd-2-clause | sorgerlab/bioagents,bgyori/bioagents | Implement TRIPS ontology manager with trips_isa | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trips_ontology.init... | <commit_before><commit_msg>Implement TRIPS ontology manager with trips_isa<commit_after> | import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http://trips.ihmc.us/relations/'
trips_ontology.init... | Implement TRIPS ontology manager with trips_isaimport os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)
trips_ontology.relations_prefix = 'http:... | <commit_before><commit_msg>Implement TRIPS ontology manager with trips_isa<commit_after>import os
from indra.preassembler.hierarchy_manager import HierarchyManager
# Make a TRIPS ontology
_fname = os.path.join(os.path.dirname(__file__), 'trips_ontology.rdf')
trips_ontology = HierarchyManager(_fname, uri_as_name=False)... | |
336f78f4a997051ea70100d291c2206475bd86de | pocean/tests/test_cf.py | pocean/tests/test_cf.py | #!python
# coding=utf-8
import unittest
from pocean.cf import CFDataset
from pocean.dsg import OrthogonalMultidimensionalTimeseries as omt
import logging
from pocean import logger as L
L.level = logging.INFO
L.handlers = [logging.StreamHandler()]
class TestCFDatasetLoad(unittest.TestCase):
def test_load_url(se... | Add a test for loading file over a URL (dap) | Add a test for loading file over a URL (dap)
| Python | mit | pyoceans/pocean-core,pyoceans/pocean-core | Add a test for loading file over a URL (dap) | #!python
# coding=utf-8
import unittest
from pocean.cf import CFDataset
from pocean.dsg import OrthogonalMultidimensionalTimeseries as omt
import logging
from pocean import logger as L
L.level = logging.INFO
L.handlers = [logging.StreamHandler()]
class TestCFDatasetLoad(unittest.TestCase):
def test_load_url(se... | <commit_before><commit_msg>Add a test for loading file over a URL (dap)<commit_after> | #!python
# coding=utf-8
import unittest
from pocean.cf import CFDataset
from pocean.dsg import OrthogonalMultidimensionalTimeseries as omt
import logging
from pocean import logger as L
L.level = logging.INFO
L.handlers = [logging.StreamHandler()]
class TestCFDatasetLoad(unittest.TestCase):
def test_load_url(se... | Add a test for loading file over a URL (dap)#!python
# coding=utf-8
import unittest
from pocean.cf import CFDataset
from pocean.dsg import OrthogonalMultidimensionalTimeseries as omt
import logging
from pocean import logger as L
L.level = logging.INFO
L.handlers = [logging.StreamHandler()]
class TestCFDatasetLoad(u... | <commit_before><commit_msg>Add a test for loading file over a URL (dap)<commit_after>#!python
# coding=utf-8
import unittest
from pocean.cf import CFDataset
from pocean.dsg import OrthogonalMultidimensionalTimeseries as omt
import logging
from pocean import logger as L
L.level = logging.INFO
L.handlers = [logging.Str... | |
4ff82aaee04666a5ccc2b56602c03f3226220fcb | scripts/runner.py | scripts/runner.py | #!/usr/bin/env python3
import sys
import os
import logging
import subprocess
# get the root handler to update his behavior (No prefix, no endline)
logger = logging.getLogger()
def logged_call(command, verbose=False):
"""
A logged version of subprocess.call. Do not wait the end of the
process to start lo... | Add some methods to log system calls | Add some methods to log system calls
| Python | agpl-3.0 | bonsai-team/matam,bonsai-team/matam,ppericard/matamog,ppericard/matamog,ppericard/matam,ppericard/matam,bonsai-team/matam,bonsai-team/matam,ppericard/matam,ppericard/matamog,ppericard/matamog | Add some methods to log system calls | #!/usr/bin/env python3
import sys
import os
import logging
import subprocess
# get the root handler to update his behavior (No prefix, no endline)
logger = logging.getLogger()
def logged_call(command, verbose=False):
"""
A logged version of subprocess.call. Do not wait the end of the
process to start lo... | <commit_before><commit_msg>Add some methods to log system calls<commit_after> | #!/usr/bin/env python3
import sys
import os
import logging
import subprocess
# get the root handler to update his behavior (No prefix, no endline)
logger = logging.getLogger()
def logged_call(command, verbose=False):
"""
A logged version of subprocess.call. Do not wait the end of the
process to start lo... | Add some methods to log system calls#!/usr/bin/env python3
import sys
import os
import logging
import subprocess
# get the root handler to update his behavior (No prefix, no endline)
logger = logging.getLogger()
def logged_call(command, verbose=False):
"""
A logged version of subprocess.call. Do not wait th... | <commit_before><commit_msg>Add some methods to log system calls<commit_after>#!/usr/bin/env python3
import sys
import os
import logging
import subprocess
# get the root handler to update his behavior (No prefix, no endline)
logger = logging.getLogger()
def logged_call(command, verbose=False):
"""
A logged v... | |
80ab7462ca9379b2dce9a10519bb986f8725b268 | tasks.py | tasks.py | import os
import subprocess
import currint
from invoke import task
VERSION_FILE = os.path.join(os.path.dirname(currint.__file__), "__init__.py")
def _write_to_version_file(version):
with open(VERSION_FILE, 'r') as version_read:
output = []
for line in version_read:
if line.startswith... | Add invoke file for releases | Add invoke file for releases
| Python | apache-2.0 | eventbrite/currint,ebmshenfield/currint | Add invoke file for releases | import os
import subprocess
import currint
from invoke import task
VERSION_FILE = os.path.join(os.path.dirname(currint.__file__), "__init__.py")
def _write_to_version_file(version):
with open(VERSION_FILE, 'r') as version_read:
output = []
for line in version_read:
if line.startswith... | <commit_before><commit_msg>Add invoke file for releases<commit_after> | import os
import subprocess
import currint
from invoke import task
VERSION_FILE = os.path.join(os.path.dirname(currint.__file__), "__init__.py")
def _write_to_version_file(version):
with open(VERSION_FILE, 'r') as version_read:
output = []
for line in version_read:
if line.startswith... | Add invoke file for releasesimport os
import subprocess
import currint
from invoke import task
VERSION_FILE = os.path.join(os.path.dirname(currint.__file__), "__init__.py")
def _write_to_version_file(version):
with open(VERSION_FILE, 'r') as version_read:
output = []
for line in version_read:
... | <commit_before><commit_msg>Add invoke file for releases<commit_after>import os
import subprocess
import currint
from invoke import task
VERSION_FILE = os.path.join(os.path.dirname(currint.__file__), "__init__.py")
def _write_to_version_file(version):
with open(VERSION_FILE, 'r') as version_read:
output ... | |
689dfc738c37358935a2c3882215c6bc225682c5 | setup.py | setup.py | import os
import subprocess
def main():
root_path = os.path.dirname(__file__)
cmd = ['cmake',
'-G', 'Visual Studio 15 2017 Win64',
root_path]
subprocess.call(cmd)
if __name__ == '__main__':
main()
| Add script to generate cmake files | Add script to generate cmake files
| Python | unknown | fizixx/nucleus,tiaanl/nucleus | Add script to generate cmake files | import os
import subprocess
def main():
root_path = os.path.dirname(__file__)
cmd = ['cmake',
'-G', 'Visual Studio 15 2017 Win64',
root_path]
subprocess.call(cmd)
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add script to generate cmake files<commit_after> | import os
import subprocess
def main():
root_path = os.path.dirname(__file__)
cmd = ['cmake',
'-G', 'Visual Studio 15 2017 Win64',
root_path]
subprocess.call(cmd)
if __name__ == '__main__':
main()
| Add script to generate cmake filesimport os
import subprocess
def main():
root_path = os.path.dirname(__file__)
cmd = ['cmake',
'-G', 'Visual Studio 15 2017 Win64',
root_path]
subprocess.call(cmd)
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add script to generate cmake files<commit_after>import os
import subprocess
def main():
root_path = os.path.dirname(__file__)
cmd = ['cmake',
'-G', 'Visual Studio 15 2017 Win64',
root_path]
subprocess.call(cmd)
if __name__ == '__main__':
main()
| |
1d8beff18749d3eefe5c1df87650469982584159 | tests.py | tests.py | from os import walk
import os
import unittest
class MdTestCase(unittest.TestCase):
def test_articles(self):
for (dirpath, dirnames, filenames) in walk("md"):
for x in filenames:
path = dirpath + os.path.sep + x
htmlpath = path.replace("md" + os.path.... | Add test unit to check for matching md -> page | Add test unit to check for matching md -> page
| Python | mit | PotteriesHackspace/knowledgebase,PotteriesHackspace/knowledgebase | Add test unit to check for matching md -> page | from os import walk
import os
import unittest
class MdTestCase(unittest.TestCase):
def test_articles(self):
for (dirpath, dirnames, filenames) in walk("md"):
for x in filenames:
path = dirpath + os.path.sep + x
htmlpath = path.replace("md" + os.path.... | <commit_before><commit_msg>Add test unit to check for matching md -> page<commit_after> | from os import walk
import os
import unittest
class MdTestCase(unittest.TestCase):
def test_articles(self):
for (dirpath, dirnames, filenames) in walk("md"):
for x in filenames:
path = dirpath + os.path.sep + x
htmlpath = path.replace("md" + os.path.... | Add test unit to check for matching md -> pagefrom os import walk
import os
import unittest
class MdTestCase(unittest.TestCase):
def test_articles(self):
for (dirpath, dirnames, filenames) in walk("md"):
for x in filenames:
path = dirpath + os.path.sep + x
... | <commit_before><commit_msg>Add test unit to check for matching md -> page<commit_after>from os import walk
import os
import unittest
class MdTestCase(unittest.TestCase):
def test_articles(self):
for (dirpath, dirnames, filenames) in walk("md"):
for x in filenames:
path ... | |
88c0b490bcbba1191e8878aa421c3d32002cea0e | cms/test_utils/project/placeholderapp/migrations_django/0004_auto_20150415_1913.py | cms/test_utils/project/placeholderapp/migrations_django/0004_auto_20150415_1913.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('placeholderapp', '0003_example1_publish'),
]
operations = [
migrations.AlterModelOptions(
name='multilingualexam... | Update translations (for internal test project, cms itself has none) | Update translations (for internal test project, cms itself has none)
| Python | bsd-3-clause | SmithsonianEnterprises/django-cms,SmithsonianEnterprises/django-cms,dhorelik/django-cms,sznekol/django-cms,chmberl/django-cms,liuyisiyisi/django-cms,josjevv/django-cms,irudayarajisawa/django-cms,evildmp/django-cms,evildmp/django-cms,robmagee/django-cms,jeffreylu9/django-cms,stefanfoulis/django-cms,frnhr/django-cms,inti... | Update translations (for internal test project, cms itself has none) | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('placeholderapp', '0003_example1_publish'),
]
operations = [
migrations.AlterModelOptions(
name='multilingualexam... | <commit_before><commit_msg>Update translations (for internal test project, cms itself has none)<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('placeholderapp', '0003_example1_publish'),
]
operations = [
migrations.AlterModelOptions(
name='multilingualexam... | Update translations (for internal test project, cms itself has none)# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('placeholderapp', '0003_example1_publish'),
]
operations = [
... | <commit_before><commit_msg>Update translations (for internal test project, cms itself has none)<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('placeholderapp', '0003_example1_... | |
0401f8bfb47710f97ae9c665c2476e22e05b18d0 | src/tests/test_connection.py | src/tests/test_connection.py | # -*- coding: utf-8
import json
import random
import string
import tornado.gen
import tornado.testing
import tornado.web
import tornado.websocket
from sidecar.connection import Connection
class AsyncSockJSClient(object):
def __init__(self, ws):
self.ws = ws
def send(self, data):
self.ws.wri... | Implement async test framework for the server | Implement async test framework for the server
| Python | apache-2.0 | aldanor/sidecar,aldanor/sidecar,aldanor/sidecar | Implement async test framework for the server | # -*- coding: utf-8
import json
import random
import string
import tornado.gen
import tornado.testing
import tornado.web
import tornado.websocket
from sidecar.connection import Connection
class AsyncSockJSClient(object):
def __init__(self, ws):
self.ws = ws
def send(self, data):
self.ws.wri... | <commit_before><commit_msg>Implement async test framework for the server<commit_after> | # -*- coding: utf-8
import json
import random
import string
import tornado.gen
import tornado.testing
import tornado.web
import tornado.websocket
from sidecar.connection import Connection
class AsyncSockJSClient(object):
def __init__(self, ws):
self.ws = ws
def send(self, data):
self.ws.wri... | Implement async test framework for the server# -*- coding: utf-8
import json
import random
import string
import tornado.gen
import tornado.testing
import tornado.web
import tornado.websocket
from sidecar.connection import Connection
class AsyncSockJSClient(object):
def __init__(self, ws):
self.ws = ws
... | <commit_before><commit_msg>Implement async test framework for the server<commit_after># -*- coding: utf-8
import json
import random
import string
import tornado.gen
import tornado.testing
import tornado.web
import tornado.websocket
from sidecar.connection import Connection
class AsyncSockJSClient(object):
def _... | |
df556cb5f17dc05ca04c7f2bdd59637d39b06c52 | setup.py | setup.py | from setuptools import setup
setup(name='fileup',
version=0.1,
description='Easily upload files to an FTP-server and get back the url.',
url='https://github.com/basnijholt/fileup',
author='Bas Nijholt',
license='BSD 3-clause',
py_modules=["fileup"],
entry_points={'console_scri... | Make fileup installable and callable with 'fu fname_here.py' | Make fileup installable and callable with 'fu fname_here.py'
| Python | bsd-3-clause | basnijholt/fileup | Make fileup installable and callable with 'fu fname_here.py' | from setuptools import setup
setup(name='fileup',
version=0.1,
description='Easily upload files to an FTP-server and get back the url.',
url='https://github.com/basnijholt/fileup',
author='Bas Nijholt',
license='BSD 3-clause',
py_modules=["fileup"],
entry_points={'console_scri... | <commit_before><commit_msg>Make fileup installable and callable with 'fu fname_here.py'<commit_after> | from setuptools import setup
setup(name='fileup',
version=0.1,
description='Easily upload files to an FTP-server and get back the url.',
url='https://github.com/basnijholt/fileup',
author='Bas Nijholt',
license='BSD 3-clause',
py_modules=["fileup"],
entry_points={'console_scri... | Make fileup installable and callable with 'fu fname_here.py'from setuptools import setup
setup(name='fileup',
version=0.1,
description='Easily upload files to an FTP-server and get back the url.',
url='https://github.com/basnijholt/fileup',
author='Bas Nijholt',
license='BSD 3-clause',
... | <commit_before><commit_msg>Make fileup installable and callable with 'fu fname_here.py'<commit_after>from setuptools import setup
setup(name='fileup',
version=0.1,
description='Easily upload files to an FTP-server and get back the url.',
url='https://github.com/basnijholt/fileup',
author='Bas N... | |
661c89f9342de4ec15137fed45e9be54864f8864 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/dcramer/django-u... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/dcramer/django-u... | Include uuid module as req (for older python versions) and mark zip_safe as False | Include uuid module as req (for older python versions) and mark zip_safe as False
| Python | bsd-3-clause | nebstrebor/django-shortuuidfield,mriveralee/django-shortuuidfield,kracekumar/django-uuidfield,dcramer/django-uuidfield | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/dcramer/django-u... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/dcramer/django-u... | <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/d... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/dcramer/django-u... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/dcramer/django-u... | <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-uuidfield',
version=".".join(map(str, __import__('uuidfield').__version__)),
author='David Cramer',
author_email='[email protected]',
description='UUIDField in Django',
url='http://github.com/d... |
21d97ca9417142400d4ca89757ed312bf1066922 | setup.py | setup.py | #!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptools import setup... | #!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptools import setup... | Add a [yaml] extra installer | Add a [yaml] extra installer
| Python | bsd-2-clause | mattrobenolt/jinja2-cli,ralexander-phi/jinja2-cli | #!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptools import setup... | #!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptools import setup... | <commit_before>#!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptoo... | #!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptools import setup... | #!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptools import setup... | <commit_before>#!/usr/bin/env python
"""
jinja2-cli
==========
.. code:: shell
$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
"""
from setuptoo... |
fc21078f0e9327800637a74d4127c666f88c9a88 | test/global_variables/TestGlobalVariables.py | test/global_variables/TestGlobalVariables.py | """Show global variables and check that they do indeed have global scopes."""
import os, time
import lldb
import unittest
main = False
class TestClassTypes(unittest.TestCase):
def setUp(self):
global main
# Save old working directory.
self.oldcwd = os.getcwd()
# Change current w... | Add a test to show global variables and to verify that they do display as having global scopes. | Add a test to show global variables and to verify that they do display as having
global scopes.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107522 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb | Add a test to show global variables and to verify that they do display as having
global scopes.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107522 91177308-0d34-0410-b5e6-96231b3b80d8 | """Show global variables and check that they do indeed have global scopes."""
import os, time
import lldb
import unittest
main = False
class TestClassTypes(unittest.TestCase):
def setUp(self):
global main
# Save old working directory.
self.oldcwd = os.getcwd()
# Change current w... | <commit_before><commit_msg>Add a test to show global variables and to verify that they do display as having
global scopes.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107522 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after> | """Show global variables and check that they do indeed have global scopes."""
import os, time
import lldb
import unittest
main = False
class TestClassTypes(unittest.TestCase):
def setUp(self):
global main
# Save old working directory.
self.oldcwd = os.getcwd()
# Change current w... | Add a test to show global variables and to verify that they do display as having
global scopes.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107522 91177308-0d34-0410-b5e6-96231b3b80d8"""Show global variables and check that they do indeed have global scopes."""
import os, time
import lldb
import unittest
ma... | <commit_before><commit_msg>Add a test to show global variables and to verify that they do display as having
global scopes.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107522 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>"""Show global variables and check that they do indeed have global scopes."""
import... | |
af6a1dd34fe9323a30da2c1d998aee687c2b46e1 | people/migrations/0005_auto_20160507_1207.py | people/migrations/0005_auto_20160507_1207.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-07 10:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0004_auto_20150402_1740'),
]
operations = [
migrations.AlterField(... | Add a migration for the `people` app | Add a migration for the `people` app
| Python | bsd-3-clause | WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web | Add a migration for the `people` app | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-07 10:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0004_auto_20150402_1740'),
]
operations = [
migrations.AlterField(... | <commit_before><commit_msg>Add a migration for the `people` app<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-07 10:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0004_auto_20150402_1740'),
]
operations = [
migrations.AlterField(... | Add a migration for the `people` app# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-07 10:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0004_auto_20150402_1740'),
]
operation... | <commit_before><commit_msg>Add a migration for the `people` app<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-07 10:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0004_a... | |
af80e03af16a36a393d2bf060ae6aac3622370dc | sbgnpdschema/src/doc/generate_documentation.py | sbgnpdschema/src/doc/generate_documentation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import os
import libxml2
import libxslt
def generate_documentation(src_file, destination_file, stylesheet_file):
stylesheet_args = dict()
style = libxslt.parseStylesheetFile(stylesheet_file)
document = libxml2.parseFile(src_file)
result =... | Add a Python based documentation generator, which requires libxml2 and libxlst. | Add a Python based documentation generator, which requires libxml2 and libxlst.
| Python | lgpl-2.1 | dc-atlas/bcml,dc-atlas/bcml,dc-atlas/bcml,dc-atlas/bcml | Add a Python based documentation generator, which requires libxml2 and libxlst. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import os
import libxml2
import libxslt
def generate_documentation(src_file, destination_file, stylesheet_file):
stylesheet_args = dict()
style = libxslt.parseStylesheetFile(stylesheet_file)
document = libxml2.parseFile(src_file)
result =... | <commit_before><commit_msg>Add a Python based documentation generator, which requires libxml2 and libxlst.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import os
import libxml2
import libxslt
def generate_documentation(src_file, destination_file, stylesheet_file):
stylesheet_args = dict()
style = libxslt.parseStylesheetFile(stylesheet_file)
document = libxml2.parseFile(src_file)
result =... | Add a Python based documentation generator, which requires libxml2 and libxlst.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import os
import libxml2
import libxslt
def generate_documentation(src_file, destination_file, stylesheet_file):
stylesheet_args = dict()
style = libxslt.parseStyleshe... | <commit_before><commit_msg>Add a Python based documentation generator, which requires libxml2 and libxlst.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import os
import libxml2
import libxslt
def generate_documentation(src_file, destination_file, stylesheet_file):
stylesheet_args =... | |
1b5342f23a8f7d994d82fbf9971c0515ae9c14fe | events/management/commands/event_send_reminder.py | events/management/commands/event_send_reminder.py | import json
import urllib2
import time
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
from events.models import Event, Session, Registration
from post_office import mail
class Command(BaseCommand):
help = "Send confirmation emails."
... | Add script for sending reminders | Add script for sending reminders
| Python | agpl-3.0 | enjaz/enjaz,enjaz/enjaz,enjaz/enjaz,enjaz/enjaz,osamak/student-portal,osamak/student-portal,osamak/student-portal,osamak/student-portal,osamak/student-portal,enjaz/enjaz | Add script for sending reminders | import json
import urllib2
import time
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
from events.models import Event, Session, Registration
from post_office import mail
class Command(BaseCommand):
help = "Send confirmation emails."
... | <commit_before><commit_msg>Add script for sending reminders<commit_after> | import json
import urllib2
import time
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
from events.models import Event, Session, Registration
from post_office import mail
class Command(BaseCommand):
help = "Send confirmation emails."
... | Add script for sending remindersimport json
import urllib2
import time
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
from events.models import Event, Session, Registration
from post_office import mail
class Command(BaseCommand):
help = "... | <commit_before><commit_msg>Add script for sending reminders<commit_after>import json
import urllib2
import time
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
from events.models import Event, Session, Registration
from post_office import mail
... | |
90f02b8fd7c62be0fbda1e917ee2dea64ec1a47d | test/command_line/test_reciprocal_lattice_viewer.py | test/command_line/test_reciprocal_lattice_viewer.py | def test_gltbx_is_available():
"""
This is not a real test for dials.rlv, which is slightly difficult to write.
However, one common error mode is that the gltbx libraries are not available
because they were not built earlier. This will reliably cause dials.rlv to
fail even thought the build setup wa... | Add a "test" for dials.reciprocal_lattice_viewer | Add a "test" for dials.reciprocal_lattice_viewer
| Python | bsd-3-clause | dials/dials,dials/dials,dials/dials,dials/dials,dials/dials | Add a "test" for dials.reciprocal_lattice_viewer | def test_gltbx_is_available():
"""
This is not a real test for dials.rlv, which is slightly difficult to write.
However, one common error mode is that the gltbx libraries are not available
because they were not built earlier. This will reliably cause dials.rlv to
fail even thought the build setup wa... | <commit_before><commit_msg>Add a "test" for dials.reciprocal_lattice_viewer<commit_after> | def test_gltbx_is_available():
"""
This is not a real test for dials.rlv, which is slightly difficult to write.
However, one common error mode is that the gltbx libraries are not available
because they were not built earlier. This will reliably cause dials.rlv to
fail even thought the build setup wa... | Add a "test" for dials.reciprocal_lattice_viewerdef test_gltbx_is_available():
"""
This is not a real test for dials.rlv, which is slightly difficult to write.
However, one common error mode is that the gltbx libraries are not available
because they were not built earlier. This will reliably cause dials... | <commit_before><commit_msg>Add a "test" for dials.reciprocal_lattice_viewer<commit_after>def test_gltbx_is_available():
"""
This is not a real test for dials.rlv, which is slightly difficult to write.
However, one common error mode is that the gltbx libraries are not available
because they were not buil... | |
46c60ace0c48254c67b121d3dda705a49b9da542 | apps/core/migrations/0006_auto_20171017_1257.py | apps/core/migrations/0006_auto_20171017_1257.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-17 12:57
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0005_strain_reference'),
]
oper... | Add migration for Strain.reference TreeForeignKey | Add migration for Strain.reference TreeForeignKey
| Python | bsd-3-clause | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | Add migration for Strain.reference TreeForeignKey | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-17 12:57
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0005_strain_reference'),
]
oper... | <commit_before><commit_msg>Add migration for Strain.reference TreeForeignKey<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-17 12:57
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0005_strain_reference'),
]
oper... | Add migration for Strain.reference TreeForeignKey# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-17 12:57
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
(... | <commit_before><commit_msg>Add migration for Strain.reference TreeForeignKey<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-17 12:57
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Mi... | |
17950b2dc3d652e5be5c9be90fcb6512edabe480 | sandpit/find-outliers.py | sandpit/find-outliers.py | #!python3
import statistics
#
# Explanation from: http://www.wikihow.com/Calculate-Outliers
#
numbers = [1.0, 2.0, 2.3, 3.0, 3.2, 4.0, 100.0, 4.5, 5.11, 6.0, 8.0]
#~ numbers = [71.0, 70.0, 73.0, 70.0, 70.0, 69.0, 70.0, 72.0, 71.0, 300.0, 71.0, 69.0]
numbers_in_order = sorted(numbers)
print("Numbers:", numbers_in_orde... | Add a demo of finding outliers, to be used in the sensor code (since we sometimes get out-of-the-way returns) | Add a demo of finding outliers, to be used in the sensor code (since we sometimes get out-of-the-way returns)
| Python | mit | westpark/robotics | Add a demo of finding outliers, to be used in the sensor code (since we sometimes get out-of-the-way returns) | #!python3
import statistics
#
# Explanation from: http://www.wikihow.com/Calculate-Outliers
#
numbers = [1.0, 2.0, 2.3, 3.0, 3.2, 4.0, 100.0, 4.5, 5.11, 6.0, 8.0]
#~ numbers = [71.0, 70.0, 73.0, 70.0, 70.0, 69.0, 70.0, 72.0, 71.0, 300.0, 71.0, 69.0]
numbers_in_order = sorted(numbers)
print("Numbers:", numbers_in_orde... | <commit_before><commit_msg>Add a demo of finding outliers, to be used in the sensor code (since we sometimes get out-of-the-way returns)<commit_after> | #!python3
import statistics
#
# Explanation from: http://www.wikihow.com/Calculate-Outliers
#
numbers = [1.0, 2.0, 2.3, 3.0, 3.2, 4.0, 100.0, 4.5, 5.11, 6.0, 8.0]
#~ numbers = [71.0, 70.0, 73.0, 70.0, 70.0, 69.0, 70.0, 72.0, 71.0, 300.0, 71.0, 69.0]
numbers_in_order = sorted(numbers)
print("Numbers:", numbers_in_orde... | Add a demo of finding outliers, to be used in the sensor code (since we sometimes get out-of-the-way returns)#!python3
import statistics
#
# Explanation from: http://www.wikihow.com/Calculate-Outliers
#
numbers = [1.0, 2.0, 2.3, 3.0, 3.2, 4.0, 100.0, 4.5, 5.11, 6.0, 8.0]
#~ numbers = [71.0, 70.0, 73.0, 70.0, 70.0, 69... | <commit_before><commit_msg>Add a demo of finding outliers, to be used in the sensor code (since we sometimes get out-of-the-way returns)<commit_after>#!python3
import statistics
#
# Explanation from: http://www.wikihow.com/Calculate-Outliers
#
numbers = [1.0, 2.0, 2.3, 3.0, 3.2, 4.0, 100.0, 4.5, 5.11, 6.0, 8.0]
#~ nu... | |
316e3f29dcb38e18273cd123924a36e4302e7740 | stdnum/us/ptin.py | stdnum/us/ptin.py | # ptin.py - functions for handling PTINs
#
# Copyright (C) 2013 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) ... | Add a United States PTIN module | Add a United States PTIN module
A Preparer Tax Identification Number (PTIN) is United States
identification number for tax return preparers. It is an eight-digit
number prefixed with a capital P.
| Python | lgpl-2.1 | t0mk/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum,dchoruzy/python-stdnum,tonyseek/python-stdnum,holvi/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum | Add a United States PTIN module
A Preparer Tax Identification Number (PTIN) is United States
identification number for tax return preparers. It is an eight-digit
number prefixed with a capital P. | # ptin.py - functions for handling PTINs
#
# Copyright (C) 2013 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) ... | <commit_before><commit_msg>Add a United States PTIN module
A Preparer Tax Identification Number (PTIN) is United States
identification number for tax return preparers. It is an eight-digit
number prefixed with a capital P.<commit_after> | # ptin.py - functions for handling PTINs
#
# Copyright (C) 2013 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) ... | Add a United States PTIN module
A Preparer Tax Identification Number (PTIN) is United States
identification number for tax return preparers. It is an eight-digit
number prefixed with a capital P.# ptin.py - functions for handling PTINs
#
# Copyright (C) 2013 Arthur de Jong
#
# This library is free software; you can r... | <commit_before><commit_msg>Add a United States PTIN module
A Preparer Tax Identification Number (PTIN) is United States
identification number for tax return preparers. It is an eight-digit
number prefixed with a capital P.<commit_after># ptin.py - functions for handling PTINs
#
# Copyright (C) 2013 Arthur de Jong
#
#... | |
6d69afd55b3dbff580c570044d58101ddf4ea04a | talkoohakemisto/migrations/versions/63875fc6ebe_create_voluntary_work_table.py | talkoohakemisto/migrations/versions/63875fc6ebe_create_voluntary_work_table.py | """Create `voluntary_work` table
Revision ID: 63875fc6ebe
Revises: 7d1ccd9c523
Create Date: 2014-02-09 13:49:24.946138
"""
# revision identifiers, used by Alembic.
revision = '63875fc6ebe'
down_revision = '7d1ccd9c523'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'vol... | Add migration to create voluntary_work table | Add migration to create voluntary_work table
| Python | mit | talkoopaiva/talkoohakemisto-api | Add migration to create voluntary_work table | """Create `voluntary_work` table
Revision ID: 63875fc6ebe
Revises: 7d1ccd9c523
Create Date: 2014-02-09 13:49:24.946138
"""
# revision identifiers, used by Alembic.
revision = '63875fc6ebe'
down_revision = '7d1ccd9c523'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'vol... | <commit_before><commit_msg>Add migration to create voluntary_work table<commit_after> | """Create `voluntary_work` table
Revision ID: 63875fc6ebe
Revises: 7d1ccd9c523
Create Date: 2014-02-09 13:49:24.946138
"""
# revision identifiers, used by Alembic.
revision = '63875fc6ebe'
down_revision = '7d1ccd9c523'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'vol... | Add migration to create voluntary_work table"""Create `voluntary_work` table
Revision ID: 63875fc6ebe
Revises: 7d1ccd9c523
Create Date: 2014-02-09 13:49:24.946138
"""
# revision identifiers, used by Alembic.
revision = '63875fc6ebe'
down_revision = '7d1ccd9c523'
from alembic import op
import sqlalchemy as sa
def ... | <commit_before><commit_msg>Add migration to create voluntary_work table<commit_after>"""Create `voluntary_work` table
Revision ID: 63875fc6ebe
Revises: 7d1ccd9c523
Create Date: 2014-02-09 13:49:24.946138
"""
# revision identifiers, used by Alembic.
revision = '63875fc6ebe'
down_revision = '7d1ccd9c523'
from alembic... | |
92842c10ca9782047435bb1710c2943aa0a362f2 | cloud-builder/generate_dependency_health_svg.py | cloud-builder/generate_dependency_health_svg.py | """Generates a SVG by parsing json report.
Task dependencyUpdates generates a json report. This script parses that file and
generates a SVG showing percentage of up-to-date dependencies.
Usage:
> python generate_dependency_health_svg.py <path_to_json_report> <output_svg_path>
"""
import json
from sys import argv
TE... | Create python script to generate svg from json reports | Create python script to generate svg from json reports
| Python | apache-2.0 | google/ground-android,google/ground-android,google/ground-android | Create python script to generate svg from json reports | """Generates a SVG by parsing json report.
Task dependencyUpdates generates a json report. This script parses that file and
generates a SVG showing percentage of up-to-date dependencies.
Usage:
> python generate_dependency_health_svg.py <path_to_json_report> <output_svg_path>
"""
import json
from sys import argv
TE... | <commit_before><commit_msg>Create python script to generate svg from json reports<commit_after> | """Generates a SVG by parsing json report.
Task dependencyUpdates generates a json report. This script parses that file and
generates a SVG showing percentage of up-to-date dependencies.
Usage:
> python generate_dependency_health_svg.py <path_to_json_report> <output_svg_path>
"""
import json
from sys import argv
TE... | Create python script to generate svg from json reports"""Generates a SVG by parsing json report.
Task dependencyUpdates generates a json report. This script parses that file and
generates a SVG showing percentage of up-to-date dependencies.
Usage:
> python generate_dependency_health_svg.py <path_to_json_report> <outp... | <commit_before><commit_msg>Create python script to generate svg from json reports<commit_after>"""Generates a SVG by parsing json report.
Task dependencyUpdates generates a json report. This script parses that file and
generates a SVG showing percentage of up-to-date dependencies.
Usage:
> python generate_dependency_... | |
94bbfda63c7734c43e5771a92a69e6ce15d29c24 | src/hades/common/exc.py | src/hades/common/exc.py | import functools
import logging
import os
import sys
import typing as t
from contextlib import contextmanager
from logging import Logger
RESTART_PREVENTING_EXCEPTIONS = frozenset(
(os.EX_CONFIG, os.EX_USAGE, os.EX_UNAVAILABLE)
)
class HadesSetupError(Exception):
preferred_exit_code = os.EX_UNAVAILABLE
... | Introduce HadesSetupError and HadesUsageError for restart prevention | Introduce HadesSetupError and HadesUsageError for restart prevention
| Python | mit | agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades | Introduce HadesSetupError and HadesUsageError for restart prevention | import functools
import logging
import os
import sys
import typing as t
from contextlib import contextmanager
from logging import Logger
RESTART_PREVENTING_EXCEPTIONS = frozenset(
(os.EX_CONFIG, os.EX_USAGE, os.EX_UNAVAILABLE)
)
class HadesSetupError(Exception):
preferred_exit_code = os.EX_UNAVAILABLE
... | <commit_before><commit_msg>Introduce HadesSetupError and HadesUsageError for restart prevention<commit_after> | import functools
import logging
import os
import sys
import typing as t
from contextlib import contextmanager
from logging import Logger
RESTART_PREVENTING_EXCEPTIONS = frozenset(
(os.EX_CONFIG, os.EX_USAGE, os.EX_UNAVAILABLE)
)
class HadesSetupError(Exception):
preferred_exit_code = os.EX_UNAVAILABLE
... | Introduce HadesSetupError and HadesUsageError for restart preventionimport functools
import logging
import os
import sys
import typing as t
from contextlib import contextmanager
from logging import Logger
RESTART_PREVENTING_EXCEPTIONS = frozenset(
(os.EX_CONFIG, os.EX_USAGE, os.EX_UNAVAILABLE)
)
class HadesSetu... | <commit_before><commit_msg>Introduce HadesSetupError and HadesUsageError for restart prevention<commit_after>import functools
import logging
import os
import sys
import typing as t
from contextlib import contextmanager
from logging import Logger
RESTART_PREVENTING_EXCEPTIONS = frozenset(
(os.EX_CONFIG, os.EX_USAG... | |
a4f1a827847ec8bc129bb885660a9182886237c2 | src/scripts/get_arxiv.py | src/scripts/get_arxiv.py | import sys
import os
import bs4
import urllib2
import urllib
BASE_URL = "http://arxiv.org"
HEP_URL = 'http://arxiv.org/abs/hep-th/%d'
# TODO: Change prints to logs
def get_pdf(paper_id, save_dir):
try:
paper_page = urllib2.urlopen(HEP_URL % paper_id)
soup = bs4.BeautifulSoup(paper_page.read().dec... | Add script to download paper from arxiv | Add script to download paper from arxiv
| Python | mit | PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project | Add script to download paper from arxiv | import sys
import os
import bs4
import urllib2
import urllib
BASE_URL = "http://arxiv.org"
HEP_URL = 'http://arxiv.org/abs/hep-th/%d'
# TODO: Change prints to logs
def get_pdf(paper_id, save_dir):
try:
paper_page = urllib2.urlopen(HEP_URL % paper_id)
soup = bs4.BeautifulSoup(paper_page.read().dec... | <commit_before><commit_msg>Add script to download paper from arxiv<commit_after> | import sys
import os
import bs4
import urllib2
import urllib
BASE_URL = "http://arxiv.org"
HEP_URL = 'http://arxiv.org/abs/hep-th/%d'
# TODO: Change prints to logs
def get_pdf(paper_id, save_dir):
try:
paper_page = urllib2.urlopen(HEP_URL % paper_id)
soup = bs4.BeautifulSoup(paper_page.read().dec... | Add script to download paper from arxivimport sys
import os
import bs4
import urllib2
import urllib
BASE_URL = "http://arxiv.org"
HEP_URL = 'http://arxiv.org/abs/hep-th/%d'
# TODO: Change prints to logs
def get_pdf(paper_id, save_dir):
try:
paper_page = urllib2.urlopen(HEP_URL % paper_id)
soup = ... | <commit_before><commit_msg>Add script to download paper from arxiv<commit_after>import sys
import os
import bs4
import urllib2
import urllib
BASE_URL = "http://arxiv.org"
HEP_URL = 'http://arxiv.org/abs/hep-th/%d'
# TODO: Change prints to logs
def get_pdf(paper_id, save_dir):
try:
paper_page = urllib2.ur... | |
99f408bcc62958310400a20e1074b51361ed43ca | tests/test_migrations.py | tests/test_migrations.py | """
Tests that migrations are not missing
"""
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import pytest
from django.core.management import call_command
def test_no_missing_migrations():
"""Check no model changes have been made since the last `./manage.py makemigration... | Add test for missing migrations | Add test for missing migrations
gh-122
| Python | bsd-2-clause | bennylope/django-organizations,st8st8/django-organizations,bennylope/django-organizations,st8st8/django-organizations | Add test for missing migrations
gh-122 | """
Tests that migrations are not missing
"""
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import pytest
from django.core.management import call_command
def test_no_missing_migrations():
"""Check no model changes have been made since the last `./manage.py makemigration... | <commit_before><commit_msg>Add test for missing migrations
gh-122<commit_after> | """
Tests that migrations are not missing
"""
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import pytest
from django.core.management import call_command
def test_no_missing_migrations():
"""Check no model changes have been made since the last `./manage.py makemigration... | Add test for missing migrations
gh-122"""
Tests that migrations are not missing
"""
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import pytest
from django.core.management import call_command
def test_no_missing_migrations():
"""Check no model changes have been made si... | <commit_before><commit_msg>Add test for missing migrations
gh-122<commit_after>"""
Tests that migrations are not missing
"""
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import pytest
from django.core.management import call_command
def test_no_missing_migrations():
""... | |
920b4c2cee3ec37b115a190f5dbae0d2e56ec26a | array_split/split_plot.py | array_split/split_plot.py | """
========================================
The :mod:`array_split.split_plot` Module
========================================
Uses :mod:`matplotlib` to plot a split.
Classes and Functions
=====================
.. autosummary::
:toctree: generated/
SplitPlotter - Plots a split.
plot - Plots split shapes.
... | Add skeleton for plotting split. | Add skeleton for plotting split.
| Python | mit | array-split/array_split | Add skeleton for plotting split. | """
========================================
The :mod:`array_split.split_plot` Module
========================================
Uses :mod:`matplotlib` to plot a split.
Classes and Functions
=====================
.. autosummary::
:toctree: generated/
SplitPlotter - Plots a split.
plot - Plots split shapes.
... | <commit_before><commit_msg>Add skeleton for plotting split.<commit_after> | """
========================================
The :mod:`array_split.split_plot` Module
========================================
Uses :mod:`matplotlib` to plot a split.
Classes and Functions
=====================
.. autosummary::
:toctree: generated/
SplitPlotter - Plots a split.
plot - Plots split shapes.
... | Add skeleton for plotting split."""
========================================
The :mod:`array_split.split_plot` Module
========================================
Uses :mod:`matplotlib` to plot a split.
Classes and Functions
=====================
.. autosummary::
:toctree: generated/
SplitPlotter - Plots a split.... | <commit_before><commit_msg>Add skeleton for plotting split.<commit_after>"""
========================================
The :mod:`array_split.split_plot` Module
========================================
Uses :mod:`matplotlib` to plot a split.
Classes and Functions
=====================
.. autosummary::
:toctree: gen... | |
a80527aa7883bfff0e7b36acdf9025fe7b1a423d | test/tvla_test.py | test/tvla_test.py | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from .cmd import Args
from .repo import RepoCmd
class TvlaCmd(RepoCmd):
def __init__(self, args: Args):
# Insert (relative) path to TVLA before the given argu... | Add first, simple TVLA command test | Add first, simple TVLA command test
Signed-off-by: Andreas Kurth <[email protected]>
| Python | apache-2.0 | lowRISC/ot-sca,lowRISC/ot-sca | Add first, simple TVLA command test
Signed-off-by: Andreas Kurth <[email protected]> | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from .cmd import Args
from .repo import RepoCmd
class TvlaCmd(RepoCmd):
def __init__(self, args: Args):
# Insert (relative) path to TVLA before the given argu... | <commit_before><commit_msg>Add first, simple TVLA command test
Signed-off-by: Andreas Kurth <[email protected]><commit_after> | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from .cmd import Args
from .repo import RepoCmd
class TvlaCmd(RepoCmd):
def __init__(self, args: Args):
# Insert (relative) path to TVLA before the given argu... | Add first, simple TVLA command test
Signed-off-by: Andreas Kurth <[email protected]># Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from .cmd import Args
from .repo import RepoCmd
cl... | <commit_before><commit_msg>Add first, simple TVLA command test
Signed-off-by: Andreas Kurth <[email protected]><commit_after># Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from .cmd i... | |
9a845da08d897f4a6b5a3105f6d9001a4f09b45e | salt/modules/bluez.py | salt/modules/bluez.py | '''
Support for Bluetooth (using Bluez in Linux)
'''
import salt.utils
import salt.modules.service
def __virtual__():
'''
Only load the module if bluetooth is installed
'''
if salt.utils.which('bluetoothd'):
return 'bluetooth'
return False
def version():
'''
Return Bluez version... | Add basic bluetooth support for salt | Add basic bluetooth support for salt
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add basic bluetooth support for salt | '''
Support for Bluetooth (using Bluez in Linux)
'''
import salt.utils
import salt.modules.service
def __virtual__():
'''
Only load the module if bluetooth is installed
'''
if salt.utils.which('bluetoothd'):
return 'bluetooth'
return False
def version():
'''
Return Bluez version... | <commit_before><commit_msg>Add basic bluetooth support for salt<commit_after> | '''
Support for Bluetooth (using Bluez in Linux)
'''
import salt.utils
import salt.modules.service
def __virtual__():
'''
Only load the module if bluetooth is installed
'''
if salt.utils.which('bluetoothd'):
return 'bluetooth'
return False
def version():
'''
Return Bluez version... | Add basic bluetooth support for salt'''
Support for Bluetooth (using Bluez in Linux)
'''
import salt.utils
import salt.modules.service
def __virtual__():
'''
Only load the module if bluetooth is installed
'''
if salt.utils.which('bluetoothd'):
return 'bluetooth'
return False
def version... | <commit_before><commit_msg>Add basic bluetooth support for salt<commit_after>'''
Support for Bluetooth (using Bluez in Linux)
'''
import salt.utils
import salt.modules.service
def __virtual__():
'''
Only load the module if bluetooth is installed
'''
if salt.utils.which('bluetoothd'):
return '... | |
b58f1ae369ae47f12494f816f0eeb69973e6baf8 | test/test_utils.py | test/test_utils.py | # coding=utf-8
from u2flib_host.utils import (
u2str,
websafe_encode,
websafe_decode,
H,
)
def test_u2str():
data1 = {
u'greeting_en': u'Hello world',
u'greeting_se': u'Hallå världen',
u'recursive': {
'plaintext': [u'foo', 'bar', u'BΛZ'],
},
}
a... | Add unit tests for u2flib_host.utils | Add unit tests for u2flib_host.utils
| Python | bsd-2-clause | Yubico/python-u2flib-host,moreati/python-u2flib-host | Add unit tests for u2flib_host.utils | # coding=utf-8
from u2flib_host.utils import (
u2str,
websafe_encode,
websafe_decode,
H,
)
def test_u2str():
data1 = {
u'greeting_en': u'Hello world',
u'greeting_se': u'Hallå världen',
u'recursive': {
'plaintext': [u'foo', 'bar', u'BΛZ'],
},
}
a... | <commit_before><commit_msg>Add unit tests for u2flib_host.utils<commit_after> | # coding=utf-8
from u2flib_host.utils import (
u2str,
websafe_encode,
websafe_decode,
H,
)
def test_u2str():
data1 = {
u'greeting_en': u'Hello world',
u'greeting_se': u'Hallå världen',
u'recursive': {
'plaintext': [u'foo', 'bar', u'BΛZ'],
},
}
a... | Add unit tests for u2flib_host.utils# coding=utf-8
from u2flib_host.utils import (
u2str,
websafe_encode,
websafe_decode,
H,
)
def test_u2str():
data1 = {
u'greeting_en': u'Hello world',
u'greeting_se': u'Hallå världen',
u'recursive': {
'plaintext': [u'foo', 'b... | <commit_before><commit_msg>Add unit tests for u2flib_host.utils<commit_after># coding=utf-8
from u2flib_host.utils import (
u2str,
websafe_encode,
websafe_decode,
H,
)
def test_u2str():
data1 = {
u'greeting_en': u'Hello world',
u'greeting_se': u'Hallå världen',
u'recursive... | |
50e1e8d6fa24b0cbf7330411ce4d87b9cb351f54 | benchexec/tools/deagle.py | benchexec/tools/deagle.py | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.result as result
import benchexec.util as util
import benchexec.tools.tem... | Add a tool info module for Deagle | Add a tool info module for Deagle
| Python | apache-2.0 | ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec | Add a tool info module for Deagle | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.result as result
import benchexec.util as util
import benchexec.tools.tem... | <commit_before><commit_msg>Add a tool info module for Deagle<commit_after> | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.result as result
import benchexec.util as util
import benchexec.tools.tem... | Add a tool info module for Deagle# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.result as result
import benchexec.util a... | <commit_before><commit_msg>Add a tool info module for Deagle<commit_after># This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec... | |
f6c287e5c75cd255952a70f5445ab9ece2c80612 | merge.py | merge.py | # Merge addresses into buildings they intersect with
from fiona import collection
from rtree import index
from shapely.geometry import asShape, Point, LineString
from shapely import speedups
def merge(buildingIn, addressIn):
addresses = []
with collection(addressIn, "r") as input:
for address in inpu... | Break out merging addresses and buildings. | Break out merging addresses and buildings.
| Python | bsd-3-clause | osmlab/nycbuildings,osmlab/nycbuildings,osmlab/nycbuildings | Break out merging addresses and buildings. | # Merge addresses into buildings they intersect with
from fiona import collection
from rtree import index
from shapely.geometry import asShape, Point, LineString
from shapely import speedups
def merge(buildingIn, addressIn):
addresses = []
with collection(addressIn, "r") as input:
for address in inpu... | <commit_before><commit_msg>Break out merging addresses and buildings.<commit_after> | # Merge addresses into buildings they intersect with
from fiona import collection
from rtree import index
from shapely.geometry import asShape, Point, LineString
from shapely import speedups
def merge(buildingIn, addressIn):
addresses = []
with collection(addressIn, "r") as input:
for address in inpu... | Break out merging addresses and buildings.# Merge addresses into buildings they intersect with
from fiona import collection
from rtree import index
from shapely.geometry import asShape, Point, LineString
from shapely import speedups
def merge(buildingIn, addressIn):
addresses = []
with collection(addressIn, ... | <commit_before><commit_msg>Break out merging addresses and buildings.<commit_after># Merge addresses into buildings they intersect with
from fiona import collection
from rtree import index
from shapely.geometry import asShape, Point, LineString
from shapely import speedups
def merge(buildingIn, addressIn):
addres... | |
72cbe12890173e41db1ff01c241cb7f1fba58858 | astrobin/management/commands/export_emails.py | astrobin/management/commands/export_emails.py | import csv
from django.core.management.base import BaseCommand
from astrobin.models import UserProfile
class Command(BaseCommand):
help = "Export all user emails to a CSV file"
def handle(self, *args, **options):
profiles = UserProfile.objects.exclude(user__email = None)
header = [['username'... | Add management command to export all user meails | Add management command to export all user meails
| Python | agpl-3.0 | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | Add management command to export all user meails | import csv
from django.core.management.base import BaseCommand
from astrobin.models import UserProfile
class Command(BaseCommand):
help = "Export all user emails to a CSV file"
def handle(self, *args, **options):
profiles = UserProfile.objects.exclude(user__email = None)
header = [['username'... | <commit_before><commit_msg>Add management command to export all user meails<commit_after> | import csv
from django.core.management.base import BaseCommand
from astrobin.models import UserProfile
class Command(BaseCommand):
help = "Export all user emails to a CSV file"
def handle(self, *args, **options):
profiles = UserProfile.objects.exclude(user__email = None)
header = [['username'... | Add management command to export all user meailsimport csv
from django.core.management.base import BaseCommand
from astrobin.models import UserProfile
class Command(BaseCommand):
help = "Export all user emails to a CSV file"
def handle(self, *args, **options):
profiles = UserProfile.objects.exclude(u... | <commit_before><commit_msg>Add management command to export all user meails<commit_after>import csv
from django.core.management.base import BaseCommand
from astrobin.models import UserProfile
class Command(BaseCommand):
help = "Export all user emails to a CSV file"
def handle(self, *args, **options):
... | |
e7de5db51760e7874d2462c85449b869720da935 | tests/run_tests.py | tests/run_tests.py | """Run all unit tests."""
import glob
import os
import sys
import unittest
def main():
test_dir = os.path.dirname(os.path.abspath(__file__))
test_files = glob.glob(os.path.join(test_dir, 'test_*.py'))
test_names = [os.path.basename(f)[:-3] for f in test_files]
sys.path.insert(0, os.path.join(test_dir... | Add script to run all tests | Add script to run all tests
| Python | bsd-3-clause | benhoyt/symplate | Add script to run all tests | """Run all unit tests."""
import glob
import os
import sys
import unittest
def main():
test_dir = os.path.dirname(os.path.abspath(__file__))
test_files = glob.glob(os.path.join(test_dir, 'test_*.py'))
test_names = [os.path.basename(f)[:-3] for f in test_files]
sys.path.insert(0, os.path.join(test_dir... | <commit_before><commit_msg>Add script to run all tests<commit_after> | """Run all unit tests."""
import glob
import os
import sys
import unittest
def main():
test_dir = os.path.dirname(os.path.abspath(__file__))
test_files = glob.glob(os.path.join(test_dir, 'test_*.py'))
test_names = [os.path.basename(f)[:-3] for f in test_files]
sys.path.insert(0, os.path.join(test_dir... | Add script to run all tests"""Run all unit tests."""
import glob
import os
import sys
import unittest
def main():
test_dir = os.path.dirname(os.path.abspath(__file__))
test_files = glob.glob(os.path.join(test_dir, 'test_*.py'))
test_names = [os.path.basename(f)[:-3] for f in test_files]
sys.path.inse... | <commit_before><commit_msg>Add script to run all tests<commit_after>"""Run all unit tests."""
import glob
import os
import sys
import unittest
def main():
test_dir = os.path.dirname(os.path.abspath(__file__))
test_files = glob.glob(os.path.join(test_dir, 'test_*.py'))
test_names = [os.path.basename(f)[:-3... | |
668aa9aa7adf10f19290c198cf892323309bb389 | tests/test_init.py | tests/test_init.py | from mock import Mock
import ubersmith
def it_sets_default_request_handler(monkeypatch):
set_handler_mock = Mock()
monkeypatch.setattr(ubersmith, 'set_default_request_handler',
set_handler_mock)
ubersmith.init('X-base_url', 'X-username', 'X-password', 'X-verify')
handler = set... | Add coverage for init function. | Add coverage for init function.
| Python | mit | hivelocity/python-ubersmith,jasonkeene/python-ubersmith,jasonkeene/python-ubersmith,hivelocity/python-ubersmith | Add coverage for init function. | from mock import Mock
import ubersmith
def it_sets_default_request_handler(monkeypatch):
set_handler_mock = Mock()
monkeypatch.setattr(ubersmith, 'set_default_request_handler',
set_handler_mock)
ubersmith.init('X-base_url', 'X-username', 'X-password', 'X-verify')
handler = set... | <commit_before><commit_msg>Add coverage for init function.<commit_after> | from mock import Mock
import ubersmith
def it_sets_default_request_handler(monkeypatch):
set_handler_mock = Mock()
monkeypatch.setattr(ubersmith, 'set_default_request_handler',
set_handler_mock)
ubersmith.init('X-base_url', 'X-username', 'X-password', 'X-verify')
handler = set... | Add coverage for init function.from mock import Mock
import ubersmith
def it_sets_default_request_handler(monkeypatch):
set_handler_mock = Mock()
monkeypatch.setattr(ubersmith, 'set_default_request_handler',
set_handler_mock)
ubersmith.init('X-base_url', 'X-username', 'X-password'... | <commit_before><commit_msg>Add coverage for init function.<commit_after>from mock import Mock
import ubersmith
def it_sets_default_request_handler(monkeypatch):
set_handler_mock = Mock()
monkeypatch.setattr(ubersmith, 'set_default_request_handler',
set_handler_mock)
ubersmith.init... | |
205a7f2c44bf831c58bc82bbff8f332d375acc46 | tests/unit/test_inode.py | tests/unit/test_inode.py | from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
import time
prefix = '.'
for i in range(0, 3):
if os.path.isdir(os.path.join(prefix, 'pycdlib')):
sys.path.insert(0, pre... | Add unit tests for inode. | Add unit tests for inode.
Signed-off-by: Chris Lalancette <[email protected]>
| Python | lgpl-2.1 | clalancette/pycdlib,clalancette/pyiso | Add unit tests for inode.
Signed-off-by: Chris Lalancette <[email protected]> | from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
import time
prefix = '.'
for i in range(0, 3):
if os.path.isdir(os.path.join(prefix, 'pycdlib')):
sys.path.insert(0, pre... | <commit_before><commit_msg>Add unit tests for inode.
Signed-off-by: Chris Lalancette <[email protected]><commit_after> | from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
import time
prefix = '.'
for i in range(0, 3):
if os.path.isdir(os.path.join(prefix, 'pycdlib')):
sys.path.insert(0, pre... | Add unit tests for inode.
Signed-off-by: Chris Lalancette <[email protected]>from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
import time
pr... | <commit_before><commit_msg>Add unit tests for inode.
Signed-off-by: Chris Lalancette <[email protected]><commit_after>from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io imp... | |
ccc4e66aad6ca02ecb85d048f343b299d077ccea | plots/plot-jacobian-matrix.py | plots/plot-jacobian-matrix.py | import climate
import lmj.cubes
import lmj.plot
import numpy as np
@lmj.cubes.utils.pickled
def jacobian(root, pattern, frames):
trial = list(lmj.cubes.Experiment(root).trials_matching(pattern))[0]
trial.load()
return trial.jacobian(frames)
def main(root, pattern='68/*block03/*trial00', frames=10, frame... | Add script for displaying jacobian as a matrix. | Add script for displaying jacobian as a matrix.
| Python | mit | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | Add script for displaying jacobian as a matrix. | import climate
import lmj.cubes
import lmj.plot
import numpy as np
@lmj.cubes.utils.pickled
def jacobian(root, pattern, frames):
trial = list(lmj.cubes.Experiment(root).trials_matching(pattern))[0]
trial.load()
return trial.jacobian(frames)
def main(root, pattern='68/*block03/*trial00', frames=10, frame... | <commit_before><commit_msg>Add script for displaying jacobian as a matrix.<commit_after> | import climate
import lmj.cubes
import lmj.plot
import numpy as np
@lmj.cubes.utils.pickled
def jacobian(root, pattern, frames):
trial = list(lmj.cubes.Experiment(root).trials_matching(pattern))[0]
trial.load()
return trial.jacobian(frames)
def main(root, pattern='68/*block03/*trial00', frames=10, frame... | Add script for displaying jacobian as a matrix.import climate
import lmj.cubes
import lmj.plot
import numpy as np
@lmj.cubes.utils.pickled
def jacobian(root, pattern, frames):
trial = list(lmj.cubes.Experiment(root).trials_matching(pattern))[0]
trial.load()
return trial.jacobian(frames)
def main(root, p... | <commit_before><commit_msg>Add script for displaying jacobian as a matrix.<commit_after>import climate
import lmj.cubes
import lmj.plot
import numpy as np
@lmj.cubes.utils.pickled
def jacobian(root, pattern, frames):
trial = list(lmj.cubes.Experiment(root).trials_matching(pattern))[0]
trial.load()
return ... | |
4129e3325fddb10c4edc0ab70c25bff4de75ed32 | setup.py | setup.py | try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://github.com/jorgeb... | try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://github.com/jorgeb... | Move Pillow to the last version | Move Pillow to the last version
| Python | bsd-3-clause | WillsB3/glue,beni55/glue,dext0r/glue,jorgebastida/glue,dext0r/glue,zhiqinyigu/glue,WillsB3/glue,zhiqinyigu/glue,beni55/glue,jorgebastida/glue | try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://github.com/jorgeb... | try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://github.com/jorgeb... | <commit_before>try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://gi... | try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://github.com/jorgeb... | try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://github.com/jorgeb... | <commit_before>try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}
setup(
name='glue',
version='0.2.6.1',
url='http://gi... |
b2f94ebfb2c2549322b2ffb1da91cdba361461f1 | mezzanine/core/sitemaps.py | mezzanine/core/sitemaps.py |
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.models import BlogPost
class DisplayableSitem... |
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
from mezzanine.utils.urls import home_slug
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.mod... | Add homepage url to sitemap.xml | Add homepage url to sitemap.xml
| Python | bsd-2-clause | frankier/mezzanine,tuxinhang1989/mezzanine,Cajoline/mezzanine,sjuxax/mezzanine,orlenko/plei,SoLoHiC/mezzanine,jerivas/mezzanine,promil23/mezzanine,PegasusWang/mezzanine,dsanders11/mezzanine,readevalprint/mezzanine,joshcartme/mezzanine,sjdines/mezzanine,SoLoHiC/mezzanine,Skytorn86/mezzanine,jerivas/mezzanine,dsanders11/... |
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.models import BlogPost
class DisplayableSitem... |
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
from mezzanine.utils.urls import home_slug
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.mod... | <commit_before>
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.models import BlogPost
class D... |
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
from mezzanine.utils.urls import home_slug
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.mod... |
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.models import BlogPost
class DisplayableSitem... | <commit_before>
from django.contrib.sitemaps import Sitemap
from django.db.models import get_models
from mezzanine.conf import settings
from mezzanine.core.models import Displayable
blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS
if blog_installed:
from mezzanine.blog.models import BlogPost
class D... |
f75a0938f34912d47d844da467931e9a18a47b9f | setup.py | setup.py | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | Upgrade taskcluster client for nice slugids | Upgrade taskcluster client for nice slugids
This fixes e.g. this failure:
* https://tools.taskcluster.net/task-inspector/#2AAxnGTzSeGLTX_Hwp_PVg/
due to the TaskGroupId starting with a '-', by upgrading taskcluster
client. From version 0.0.26 of python taskcluster client onwards, 'nice'
slugs are returned that start... | Python | mpl-2.0 | mozilla/funsize,rail/funsize,rail/funsize,mozilla/funsize | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | <commit_before>from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_p... | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | <commit_before>from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_p... |
4dbf364177da4f06b366a68b1458ec55c8c1895f | docs/usage_example.py | docs/usage_example.py | from pandarus import *
import geopandas as gpd
import rasterio
import os
import json
from pprint import pprint
# Get filepaths of data used in tests
grid_fp = os.path.join('..', 'tests', 'data', 'grid.geojson')
points_fp = os.path.join('..', 'tests', 'data', 'points.geojson')
square_fp = os.path.join('..', 'tests', 'd... | Add usage example as a python file | Add usage example as a python file
| Python | bsd-3-clause | cmutel/pandarus | Add usage example as a python file | from pandarus import *
import geopandas as gpd
import rasterio
import os
import json
from pprint import pprint
# Get filepaths of data used in tests
grid_fp = os.path.join('..', 'tests', 'data', 'grid.geojson')
points_fp = os.path.join('..', 'tests', 'data', 'points.geojson')
square_fp = os.path.join('..', 'tests', 'd... | <commit_before><commit_msg>Add usage example as a python file<commit_after> | from pandarus import *
import geopandas as gpd
import rasterio
import os
import json
from pprint import pprint
# Get filepaths of data used in tests
grid_fp = os.path.join('..', 'tests', 'data', 'grid.geojson')
points_fp = os.path.join('..', 'tests', 'data', 'points.geojson')
square_fp = os.path.join('..', 'tests', 'd... | Add usage example as a python filefrom pandarus import *
import geopandas as gpd
import rasterio
import os
import json
from pprint import pprint
# Get filepaths of data used in tests
grid_fp = os.path.join('..', 'tests', 'data', 'grid.geojson')
points_fp = os.path.join('..', 'tests', 'data', 'points.geojson')
square_f... | <commit_before><commit_msg>Add usage example as a python file<commit_after>from pandarus import *
import geopandas as gpd
import rasterio
import os
import json
from pprint import pprint
# Get filepaths of data used in tests
grid_fp = os.path.join('..', 'tests', 'data', 'grid.geojson')
points_fp = os.path.join('..', 't... | |
7d090b22eb1f4aa841207a3940ce485b8539af5c | tests/test_provider_mbta.py | tests/test_provider_mbta.py | import busbus
from busbus.provider.mbta import MBTAProvider
from .conftest import mock_gtfs_zip
import arrow
import pytest
import responses
@pytest.fixture(scope='module')
@responses.activate
def mbta_provider(engine):
responses.add(responses.GET, MBTAProvider.gtfs_url,
body=mock_gtfs_zip('mbta... | Add MBTA provider test cases | Add MBTA provider test cases
| Python | mit | spaceboats/busbus | Add MBTA provider test cases | import busbus
from busbus.provider.mbta import MBTAProvider
from .conftest import mock_gtfs_zip
import arrow
import pytest
import responses
@pytest.fixture(scope='module')
@responses.activate
def mbta_provider(engine):
responses.add(responses.GET, MBTAProvider.gtfs_url,
body=mock_gtfs_zip('mbta... | <commit_before><commit_msg>Add MBTA provider test cases<commit_after> | import busbus
from busbus.provider.mbta import MBTAProvider
from .conftest import mock_gtfs_zip
import arrow
import pytest
import responses
@pytest.fixture(scope='module')
@responses.activate
def mbta_provider(engine):
responses.add(responses.GET, MBTAProvider.gtfs_url,
body=mock_gtfs_zip('mbta... | Add MBTA provider test casesimport busbus
from busbus.provider.mbta import MBTAProvider
from .conftest import mock_gtfs_zip
import arrow
import pytest
import responses
@pytest.fixture(scope='module')
@responses.activate
def mbta_provider(engine):
responses.add(responses.GET, MBTAProvider.gtfs_url,
... | <commit_before><commit_msg>Add MBTA provider test cases<commit_after>import busbus
from busbus.provider.mbta import MBTAProvider
from .conftest import mock_gtfs_zip
import arrow
import pytest
import responses
@pytest.fixture(scope='module')
@responses.activate
def mbta_provider(engine):
responses.add(responses.G... | |
c36a088ad0d56f2a4dbff85bc33922ab95fbc184 | test_board_pytest.py | test_board_pytest.py | from board import Board
def test_addPiece():
print("Testing adding a piece.")
board = Board(5,5)
board.addPiece(0, 1)
assert board.boardMatrix.item(0,4) == 1
| Add test for adding piece to board. | Add test for adding piece to board.
| Python | mit | isaacarvestad/four-in-a-row | Add test for adding piece to board. | from board import Board
def test_addPiece():
print("Testing adding a piece.")
board = Board(5,5)
board.addPiece(0, 1)
assert board.boardMatrix.item(0,4) == 1
| <commit_before><commit_msg>Add test for adding piece to board.<commit_after> | from board import Board
def test_addPiece():
print("Testing adding a piece.")
board = Board(5,5)
board.addPiece(0, 1)
assert board.boardMatrix.item(0,4) == 1
| Add test for adding piece to board.from board import Board
def test_addPiece():
print("Testing adding a piece.")
board = Board(5,5)
board.addPiece(0, 1)
assert board.boardMatrix.item(0,4) == 1
| <commit_before><commit_msg>Add test for adding piece to board.<commit_after>from board import Board
def test_addPiece():
print("Testing adding a piece.")
board = Board(5,5)
board.addPiece(0, 1)
assert board.boardMatrix.item(0,4) == 1
| |
71c8debf81eb85f4ae1de8e58f7fb2bdd0b8b6e4 | coex/direct.py | coex/direct.py | """Analyze direct (grand canonical) simulations."""
from __future__ import division
import os.path
import numpy as np
from scipy.optimize import fsolve
from coex.read import read_lnpi
def transform(distribution, amount):
"""Perform linear transformation on a probability distribution.
Args:
distrib... | Add analysis code for GC simulations. | Add analysis code for GC simulations.
| Python | bsd-2-clause | adamrall/coex | Add analysis code for GC simulations. | """Analyze direct (grand canonical) simulations."""
from __future__ import division
import os.path
import numpy as np
from scipy.optimize import fsolve
from coex.read import read_lnpi
def transform(distribution, amount):
"""Perform linear transformation on a probability distribution.
Args:
distrib... | <commit_before><commit_msg>Add analysis code for GC simulations.<commit_after> | """Analyze direct (grand canonical) simulations."""
from __future__ import division
import os.path
import numpy as np
from scipy.optimize import fsolve
from coex.read import read_lnpi
def transform(distribution, amount):
"""Perform linear transformation on a probability distribution.
Args:
distrib... | Add analysis code for GC simulations."""Analyze direct (grand canonical) simulations."""
from __future__ import division
import os.path
import numpy as np
from scipy.optimize import fsolve
from coex.read import read_lnpi
def transform(distribution, amount):
"""Perform linear transformation on a probability dis... | <commit_before><commit_msg>Add analysis code for GC simulations.<commit_after>"""Analyze direct (grand canonical) simulations."""
from __future__ import division
import os.path
import numpy as np
from scipy.optimize import fsolve
from coex.read import read_lnpi
def transform(distribution, amount):
"""Perform l... | |
eaf87158eab3e4ebceafca3569b2828593040882 | tests/Levitt1971-Fig5.py | tests/Levitt1971-Fig5.py | from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, CORRECT, CORRECT, INCORRECT, CORRECT, INCORRECT,
INCORRECT, CORRECT, INCORRECT, CORRECT, CORRECT, CORRECT, ... | Test case from Levitt figure 4 | Test case from Levitt figure 4
| Python | mit | codles/UpDownMethods | Test case from Levitt figure 4 | from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, CORRECT, CORRECT, INCORRECT, CORRECT, INCORRECT,
INCORRECT, CORRECT, INCORRECT, CORRECT, CORRECT, CORRECT, ... | <commit_before><commit_msg>Test case from Levitt figure 4<commit_after> | from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, CORRECT, CORRECT, INCORRECT, CORRECT, INCORRECT,
INCORRECT, CORRECT, INCORRECT, CORRECT, CORRECT, CORRECT, ... | Test case from Levitt figure 4from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, CORRECT, CORRECT, INCORRECT, CORRECT, INCORRECT,
INCORRECT, CORRECT, INCORREC... | <commit_before><commit_msg>Test case from Levitt figure 4<commit_after>from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, CORRECT, CORRECT, INCORRECT, CORRECT, INCORRECT,
... | |
a58e618712bdd0ef29df39a2104c9d24e3d0dfcb | packager/core/repo_tools.py | packager/core/repo_tools.py | import os, shutil
import urllib
import zipfile
import tempfile
def download(repo, dest="."):
'''
Downloads a zip archive of the given repository to the current
directory.
'''
url = "https://github.com/{0}/archive/master.zip".format(repo)
print(url)
local_file = os.path.join(dest, os.path.b... | Add tools for getting models and tools repos | Add tools for getting models and tools repos
These are patterned on @mcflugen's "components.py" --
https://github.com/csdms/wmt/blob/master/server/wmt/installer/components
.py.
| Python | mit | csdms/packagebuilder | Add tools for getting models and tools repos
These are patterned on @mcflugen's "components.py" --
https://github.com/csdms/wmt/blob/master/server/wmt/installer/components
.py. | import os, shutil
import urllib
import zipfile
import tempfile
def download(repo, dest="."):
'''
Downloads a zip archive of the given repository to the current
directory.
'''
url = "https://github.com/{0}/archive/master.zip".format(repo)
print(url)
local_file = os.path.join(dest, os.path.b... | <commit_before><commit_msg>Add tools for getting models and tools repos
These are patterned on @mcflugen's "components.py" --
https://github.com/csdms/wmt/blob/master/server/wmt/installer/components
.py.<commit_after> | import os, shutil
import urllib
import zipfile
import tempfile
def download(repo, dest="."):
'''
Downloads a zip archive of the given repository to the current
directory.
'''
url = "https://github.com/{0}/archive/master.zip".format(repo)
print(url)
local_file = os.path.join(dest, os.path.b... | Add tools for getting models and tools repos
These are patterned on @mcflugen's "components.py" --
https://github.com/csdms/wmt/blob/master/server/wmt/installer/components
.py.import os, shutil
import urllib
import zipfile
import tempfile
def download(repo, dest="."):
'''
Downloads a zip archive of the given ... | <commit_before><commit_msg>Add tools for getting models and tools repos
These are patterned on @mcflugen's "components.py" --
https://github.com/csdms/wmt/blob/master/server/wmt/installer/components
.py.<commit_after>import os, shutil
import urllib
import zipfile
import tempfile
def download(repo, dest="."):
'''
... | |
cbbc1f163335cd1572509bcacaff691be90ba5be | tests/flights_to_test.py | tests/flights_to_test.py | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicInst... | Add tests for Flights To | Add tests for Flights To
| Python | mit | Jamil/sabre_dev_studio | Add tests for Flights To | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicInst... | <commit_before><commit_msg>Add tests for Flights To<commit_after> | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicInst... | Add tests for Flights Toimport unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
... | <commit_before><commit_msg>Add tests for Flights To<commit_after>import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id"... | |
d93d3988da51f94a4979d8a4879d54bc89b0ba01 | sympy/printing/tests/test_numpy.py | sympy/printing/tests/test_numpy.py | from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+.
See gh-9... | Add test for NumPyPrinter regression | Add test for NumPyPrinter regression
| Python | bsd-3-clause | skirpichev/omg,diofant/diofant | Add test for NumPyPrinter regression | from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+.
See gh-9... | <commit_before><commit_msg>Add test for NumPyPrinter regression<commit_after> | from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+.
See gh-9... | Add test for NumPyPrinter regressionfrom sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not n... | <commit_before><commit_msg>Add test for NumPyPrinter regression<commit_after>from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking co... | |
47925d50b209373ff37666d703943f3252735fac | tools/wrap_natives.py | tools/wrap_natives.py | #!/usr/bin/env python
#
# Copyright (c) 2014 Zeex
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of co... | Add script for generating native wrappers | Add script for generating native wrappers
The script helps you see what arguments are passed to native functions
in [stack] trace. It takes an include file as input and outputs code
similar to:
stock _print(const string[]) {
return print(string);
}
for each native function. Variable arguments ("...") are not suppor... | Python | bsd-2-clause | Zeex/samp-plugin-crashdetect,Zeex/samp-plugin-crashdetect,Zeex/samp-plugin-crashdetect | Add script for generating native wrappers
The script helps you see what arguments are passed to native functions
in [stack] trace. It takes an include file as input and outputs code
similar to:
stock _print(const string[]) {
return print(string);
}
for each native function. Variable arguments ("...") are not suppor... | #!/usr/bin/env python
#
# Copyright (c) 2014 Zeex
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of co... | <commit_before><commit_msg>Add script for generating native wrappers
The script helps you see what arguments are passed to native functions
in [stack] trace. It takes an include file as input and outputs code
similar to:
stock _print(const string[]) {
return print(string);
}
for each native function. Variable argum... | #!/usr/bin/env python
#
# Copyright (c) 2014 Zeex
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of co... | Add script for generating native wrappers
The script helps you see what arguments are passed to native functions
in [stack] trace. It takes an include file as input and outputs code
similar to:
stock _print(const string[]) {
return print(string);
}
for each native function. Variable arguments ("...") are not suppor... | <commit_before><commit_msg>Add script for generating native wrappers
The script helps you see what arguments are passed to native functions
in [stack] trace. It takes an include file as input and outputs code
similar to:
stock _print(const string[]) {
return print(string);
}
for each native function. Variable argum... | |
728580099f0538a13e85a8cdb9c09af2915c9fc4 | examples/nyc_boros.py | examples/nyc_boros.py | """
Generate example images for GeoPandas documentation.
TODO: autogenerate these from docs themselves
Kelsey Jordahl
Time-stamp: <Sun Jul 7 17:31:12 IST 2013>
"""
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry import Point
from geopandas import GeoSeries, GeoDataFrame
np.random.seed(1)
DP... | Add script to generate NYC examples | Add script to generate NYC examples
| Python | bsd-3-clause | jwass/geopandas,maxalbert/geopandas,jdmcbr/geopandas,snario/geopandas,perrygeo/geopandas,jdmcbr/geopandas,geopandas/geopandas,fonnesbeck/geopandas,jorisvandenbossche/geopandas,geopandas/geopandas,koldunovn/geopandas,micahcochran/geopandas,jorisvandenbossche/geopandas,jwass/geopandas,scw/geopandas,jorisvandenbossche/geo... | Add script to generate NYC examples | """
Generate example images for GeoPandas documentation.
TODO: autogenerate these from docs themselves
Kelsey Jordahl
Time-stamp: <Sun Jul 7 17:31:12 IST 2013>
"""
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry import Point
from geopandas import GeoSeries, GeoDataFrame
np.random.seed(1)
DP... | <commit_before><commit_msg>Add script to generate NYC examples<commit_after> | """
Generate example images for GeoPandas documentation.
TODO: autogenerate these from docs themselves
Kelsey Jordahl
Time-stamp: <Sun Jul 7 17:31:12 IST 2013>
"""
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry import Point
from geopandas import GeoSeries, GeoDataFrame
np.random.seed(1)
DP... | Add script to generate NYC examples"""
Generate example images for GeoPandas documentation.
TODO: autogenerate these from docs themselves
Kelsey Jordahl
Time-stamp: <Sun Jul 7 17:31:12 IST 2013>
"""
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry import Point
from geopandas import GeoSeries,... | <commit_before><commit_msg>Add script to generate NYC examples<commit_after>"""
Generate example images for GeoPandas documentation.
TODO: autogenerate these from docs themselves
Kelsey Jordahl
Time-stamp: <Sun Jul 7 17:31:12 IST 2013>
"""
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry impo... | |
87cca84b6750a3176b86df2786a9b78f7647c062 | plugins/hello/hello_test.py | plugins/hello/hello_test.py | from p1tr.test import *
class HelloTest(PluginTestCase):
@test
def hello_test(self):
for data in self.dummy_data:
self.assertEqual(self.plugin.hello(data.server, data.channel,
data.nick, data.params),
'Hello, %s!' % data.nick.split('!')[0])
| Add test case for hello plugin | Add test case for hello plugin
| Python | mit | howard/p1tr-tng,howard/p1tr-tng | Add test case for hello plugin | from p1tr.test import *
class HelloTest(PluginTestCase):
@test
def hello_test(self):
for data in self.dummy_data:
self.assertEqual(self.plugin.hello(data.server, data.channel,
data.nick, data.params),
'Hello, %s!' % data.nick.split('!')[0])
| <commit_before><commit_msg>Add test case for hello plugin<commit_after> | from p1tr.test import *
class HelloTest(PluginTestCase):
@test
def hello_test(self):
for data in self.dummy_data:
self.assertEqual(self.plugin.hello(data.server, data.channel,
data.nick, data.params),
'Hello, %s!' % data.nick.split('!')[0])
| Add test case for hello pluginfrom p1tr.test import *
class HelloTest(PluginTestCase):
@test
def hello_test(self):
for data in self.dummy_data:
self.assertEqual(self.plugin.hello(data.server, data.channel,
data.nick, data.params),
'Hello, %s!' % ... | <commit_before><commit_msg>Add test case for hello plugin<commit_after>from p1tr.test import *
class HelloTest(PluginTestCase):
@test
def hello_test(self):
for data in self.dummy_data:
self.assertEqual(self.plugin.hello(data.server, data.channel,
data.nick, data.par... | |
caea65165c5443252763b1efaf60210b6f59f1cd | migrations/versions/0117_international_sms_notify.py | migrations/versions/0117_international_sms_notify.py | """empty message
Revision ID: 0117_international_sms_notify
Revises: 0116_another_letter_org
Create Date: 2017-08-29 14:09:41.042061
"""
# revision identifiers, used by Alembic.
revision = '0117_international_sms_notify'
down_revision = '0116_another_letter_org'
from alembic import op
from datetime import datetime
... | Allow Notify service to send international sms | Allow Notify service to send international sms
Right now Notify restricts you to registering with a UK mobile number.
This is because when we built the user registration stuff we couldn’t
send to international mobiles.
However we can send to international mobile numbers, and it’s totally
reasonable to expect employee... | Python | mit | alphagov/notifications-api,alphagov/notifications-api | Allow Notify service to send international sms
Right now Notify restricts you to registering with a UK mobile number.
This is because when we built the user registration stuff we couldn’t
send to international mobiles.
However we can send to international mobile numbers, and it’s totally
reasonable to expect employee... | """empty message
Revision ID: 0117_international_sms_notify
Revises: 0116_another_letter_org
Create Date: 2017-08-29 14:09:41.042061
"""
# revision identifiers, used by Alembic.
revision = '0117_international_sms_notify'
down_revision = '0116_another_letter_org'
from alembic import op
from datetime import datetime
... | <commit_before><commit_msg>Allow Notify service to send international sms
Right now Notify restricts you to registering with a UK mobile number.
This is because when we built the user registration stuff we couldn’t
send to international mobiles.
However we can send to international mobile numbers, and it’s totally
re... | """empty message
Revision ID: 0117_international_sms_notify
Revises: 0116_another_letter_org
Create Date: 2017-08-29 14:09:41.042061
"""
# revision identifiers, used by Alembic.
revision = '0117_international_sms_notify'
down_revision = '0116_another_letter_org'
from alembic import op
from datetime import datetime
... | Allow Notify service to send international sms
Right now Notify restricts you to registering with a UK mobile number.
This is because when we built the user registration stuff we couldn’t
send to international mobiles.
However we can send to international mobile numbers, and it’s totally
reasonable to expect employee... | <commit_before><commit_msg>Allow Notify service to send international sms
Right now Notify restricts you to registering with a UK mobile number.
This is because when we built the user registration stuff we couldn’t
send to international mobiles.
However we can send to international mobile numbers, and it’s totally
re... | |
c340e6bebcfac3265e67b6bdb333874e5942e4af | cronjob.py | cronjob.py | import re
from parsers import Parse
class CronJob(object):
def __init__(self, line):
# matches five fields separated by whitespace and then everything else
# (the command)
match = re.match(r'^(\S*)\s+(\S*)\s+(\S*)\s+(\S*)\s+(\S*)\s+(.*)$', line);
self.minutes = Parse.minutes(match.... | Add CronJob class; appears to turn cron-job line into proper data (no weekday/month name aliasing yet) | Add CronJob class; appears to turn cron-job line into proper data (no weekday/month name aliasing yet)
| Python | mit | ChrisTM/next-crons | Add CronJob class; appears to turn cron-job line into proper data (no weekday/month name aliasing yet) | import re
from parsers import Parse
class CronJob(object):
def __init__(self, line):
# matches five fields separated by whitespace and then everything else
# (the command)
match = re.match(r'^(\S*)\s+(\S*)\s+(\S*)\s+(\S*)\s+(\S*)\s+(.*)$', line);
self.minutes = Parse.minutes(match.... | <commit_before><commit_msg>Add CronJob class; appears to turn cron-job line into proper data (no weekday/month name aliasing yet)<commit_after> | import re
from parsers import Parse
class CronJob(object):
def __init__(self, line):
# matches five fields separated by whitespace and then everything else
# (the command)
match = re.match(r'^(\S*)\s+(\S*)\s+(\S*)\s+(\S*)\s+(\S*)\s+(.*)$', line);
self.minutes = Parse.minutes(match.... | Add CronJob class; appears to turn cron-job line into proper data (no weekday/month name aliasing yet)import re
from parsers import Parse
class CronJob(object):
def __init__(self, line):
# matches five fields separated by whitespace and then everything else
# (the command)
match = re.match(... | <commit_before><commit_msg>Add CronJob class; appears to turn cron-job line into proper data (no weekday/month name aliasing yet)<commit_after>import re
from parsers import Parse
class CronJob(object):
def __init__(self, line):
# matches five fields separated by whitespace and then everything else
... | |
f4a04d62de2e83c146caf5237e72967185560ba2 | regulations/management/commands/setup_cors.py | regulations/management/commands/setup_cors.py | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=settings.ATTACHM... | Add command for S3 CORS configuration. | Add command for S3 CORS configuration.
To be run on app startup or manually.
[Resolves https://github.com/eregs/notice-and-comment/issues/57]
| Python | cc0-1.0 | 18F/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,18F/regulations-site,18F/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site | Add command for S3 CORS configuration.
To be run on app startup or manually.
[Resolves https://github.com/eregs/notice-and-comment/issues/57] | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=settings.ATTACHM... | <commit_before><commit_msg>Add command for S3 CORS configuration.
To be run on app startup or manually.
[Resolves https://github.com/eregs/notice-and-comment/issues/57]<commit_after> | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=settings.ATTACHM... | Add command for S3 CORS configuration.
To be run on app startup or manually.
[Resolves https://github.com/eregs/notice-and-comment/issues/57]import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comm... | <commit_before><commit_msg>Add command for S3 CORS configuration.
To be run on app startup or manually.
[Resolves https://github.com/eregs/notice-and-comment/issues/57]<commit_after>import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help... | |
51c9706c5243d5edc416da097309673cfa0ee495 | data-wrangling/csv2lua.py | data-wrangling/csv2lua.py | # Convert a CSV file to a Lua table script that can be imported using `dofile`.
import csv
def csv2lua(in_file, out_file, global_name):
fp_in = open(in_file, 'r')
rows = list(csv.reader(fp_in))
fp_in.close()
headers = rows[0]
lua_rows = []
for row in rows[1:]:
cells = []
print... | Add a conversion script to turn CSV into Lua table. | Add a conversion script to turn CSV into Lua table.
| Python | mit | silky/frequensea,silky/frequensea,fdb/frequensea,silky/frequensea,fdb/frequensea,fdb/frequensea,silky/frequensea,fdb/frequensea,fdb/frequensea,silky/frequensea | Add a conversion script to turn CSV into Lua table. | # Convert a CSV file to a Lua table script that can be imported using `dofile`.
import csv
def csv2lua(in_file, out_file, global_name):
fp_in = open(in_file, 'r')
rows = list(csv.reader(fp_in))
fp_in.close()
headers = rows[0]
lua_rows = []
for row in rows[1:]:
cells = []
print... | <commit_before><commit_msg>Add a conversion script to turn CSV into Lua table.<commit_after> | # Convert a CSV file to a Lua table script that can be imported using `dofile`.
import csv
def csv2lua(in_file, out_file, global_name):
fp_in = open(in_file, 'r')
rows = list(csv.reader(fp_in))
fp_in.close()
headers = rows[0]
lua_rows = []
for row in rows[1:]:
cells = []
print... | Add a conversion script to turn CSV into Lua table.# Convert a CSV file to a Lua table script that can be imported using `dofile`.
import csv
def csv2lua(in_file, out_file, global_name):
fp_in = open(in_file, 'r')
rows = list(csv.reader(fp_in))
fp_in.close()
headers = rows[0]
lua_rows = []
fo... | <commit_before><commit_msg>Add a conversion script to turn CSV into Lua table.<commit_after># Convert a CSV file to a Lua table script that can be imported using `dofile`.
import csv
def csv2lua(in_file, out_file, global_name):
fp_in = open(in_file, 'r')
rows = list(csv.reader(fp_in))
fp_in.close()
h... | |
4b9996463765fa9bdb18e223cce6e64ffe8810ff | fabfile.py | fabfile.py | from fabric.operations import local
def runserver():
local("java -jar stagger/stagger.jar -modelfile models/swedish.bin -server 127.0.0.1 9000")
def tag(filename):
local("python stagger/scripts/tagtcp.py 127.0.0.1 9000 %s" % filename)
| Add commands to run tagger server and tag using python. | Add commands to run tagger server and tag using python.
| Python | mit | EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger | Add commands to run tagger server and tag using python. | from fabric.operations import local
def runserver():
local("java -jar stagger/stagger.jar -modelfile models/swedish.bin -server 127.0.0.1 9000")
def tag(filename):
local("python stagger/scripts/tagtcp.py 127.0.0.1 9000 %s" % filename)
| <commit_before><commit_msg>Add commands to run tagger server and tag using python.<commit_after> | from fabric.operations import local
def runserver():
local("java -jar stagger/stagger.jar -modelfile models/swedish.bin -server 127.0.0.1 9000")
def tag(filename):
local("python stagger/scripts/tagtcp.py 127.0.0.1 9000 %s" % filename)
| Add commands to run tagger server and tag using python.from fabric.operations import local
def runserver():
local("java -jar stagger/stagger.jar -modelfile models/swedish.bin -server 127.0.0.1 9000")
def tag(filename):
local("python stagger/scripts/tagtcp.py 127.0.0.1 9000 %s" % filename)
| <commit_before><commit_msg>Add commands to run tagger server and tag using python.<commit_after>from fabric.operations import local
def runserver():
local("java -jar stagger/stagger.jar -modelfile models/swedish.bin -server 127.0.0.1 9000")
def tag(filename):
local("python stagger/scripts/tagtcp.py 127.0.0.1 ... | |
74a78fc5a48ce834390590031d3d054214609ec0 | djangocms_blog/cms_app.py | djangocms_blog/cms_app.py | # -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _, get_language
from .menu import BlogCategoryMenu
class BlogApp(CMSApp):
name = _('Blog')
urls = ['djangocms_blog.urls']
app_name = 'djangocms_blog'
... | # -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from cms.menu_bases import CMSAttachMenu
from menus.base import NavigationNode
from menus.menu_pool import menu_pool
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _, get... | Attach category menu to CMSApp | Attach category menu to CMSApp
| Python | bsd-3-clause | motleytech/djangocms-blog,vnavascues/djangocms-blog,mistalaba/djangocms-blog,marty3d/djangocms-blog,EnglishConnection/djangocms-blog,jedie/djangocms-blog,kriwil/djangocms-blog,skirsdeda/djangocms-blog,nephila/djangocms-blog,mistalaba/djangocms-blog,sephii/djangocms-blog,dapeng0802/djangocms-blog,nephila/djangocms-blog,... | # -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _, get_language
from .menu import BlogCategoryMenu
class BlogApp(CMSApp):
name = _('Blog')
urls = ['djangocms_blog.urls']
app_name = 'djangocms_blog'
... | # -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from cms.menu_bases import CMSAttachMenu
from menus.base import NavigationNode
from menus.menu_pool import menu_pool
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _, get... | <commit_before># -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _, get_language
from .menu import BlogCategoryMenu
class BlogApp(CMSApp):
name = _('Blog')
urls = ['djangocms_blog.urls']
app_name = 'djang... | # -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from cms.menu_bases import CMSAttachMenu
from menus.base import NavigationNode
from menus.menu_pool import menu_pool
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _, get... | # -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _, get_language
from .menu import BlogCategoryMenu
class BlogApp(CMSApp):
name = _('Blog')
urls = ['djangocms_blog.urls']
app_name = 'djangocms_blog'
... | <commit_before># -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _, get_language
from .menu import BlogCategoryMenu
class BlogApp(CMSApp):
name = _('Blog')
urls = ['djangocms_blog.urls']
app_name = 'djang... |
9e0985fec5bf119708c14e2e4d2bbb099eeab4f7 | Transformations.py | Transformations.py | from pkgutil import iter_modules
from pathlib import Path
from importlib import import_module
from transformations.SentenceTransformation import SentenceTransformation
def load(module, class_name):
my_class_py = getattr(module, class_name)
my_class = getattr(my_class_py, class_name)
return my_class()
c... | Load sub-classes without using explicit names | Load sub-classes without using explicit names
| Python | mit | GEM-benchmark/NL-Augmenter | Load sub-classes without using explicit names | from pkgutil import iter_modules
from pathlib import Path
from importlib import import_module
from transformations.SentenceTransformation import SentenceTransformation
def load(module, class_name):
my_class_py = getattr(module, class_name)
my_class = getattr(my_class_py, class_name)
return my_class()
c... | <commit_before><commit_msg>Load sub-classes without using explicit names<commit_after> | from pkgutil import iter_modules
from pathlib import Path
from importlib import import_module
from transformations.SentenceTransformation import SentenceTransformation
def load(module, class_name):
my_class_py = getattr(module, class_name)
my_class = getattr(my_class_py, class_name)
return my_class()
c... | Load sub-classes without using explicit namesfrom pkgutil import iter_modules
from pathlib import Path
from importlib import import_module
from transformations.SentenceTransformation import SentenceTransformation
def load(module, class_name):
my_class_py = getattr(module, class_name)
my_class = getattr(my_cl... | <commit_before><commit_msg>Load sub-classes without using explicit names<commit_after>from pkgutil import iter_modules
from pathlib import Path
from importlib import import_module
from transformations.SentenceTransformation import SentenceTransformation
def load(module, class_name):
my_class_py = getattr(module,... | |
acaf9980766a3ded7894dec32df09e9f73f626bf | test/test_expressions.py | test/test_expressions.py | import genson
def test_unary():
g = genson.loads('{ "p" : sin(-1) } ')
assert( g['p'].args[0] == -1)
g = genson.loads('{ "p" : sin(+1) } ')
assert( g['p'].args[0] == 1)
def test_binary():
g = genson.loads('{ "p" : gaussian(1+1,1) } ')
assert( g['p'].mean == 2)
assert( g['p'].stdev == 1... | Add tests for genson expression | Add tests for genson expression
| Python | mit | davidcox/genson | Add tests for genson expression | import genson
def test_unary():
g = genson.loads('{ "p" : sin(-1) } ')
assert( g['p'].args[0] == -1)
g = genson.loads('{ "p" : sin(+1) } ')
assert( g['p'].args[0] == 1)
def test_binary():
g = genson.loads('{ "p" : gaussian(1+1,1) } ')
assert( g['p'].mean == 2)
assert( g['p'].stdev == 1... | <commit_before><commit_msg>Add tests for genson expression<commit_after> | import genson
def test_unary():
g = genson.loads('{ "p" : sin(-1) } ')
assert( g['p'].args[0] == -1)
g = genson.loads('{ "p" : sin(+1) } ')
assert( g['p'].args[0] == 1)
def test_binary():
g = genson.loads('{ "p" : gaussian(1+1,1) } ')
assert( g['p'].mean == 2)
assert( g['p'].stdev == 1... | Add tests for genson expressionimport genson
def test_unary():
g = genson.loads('{ "p" : sin(-1) } ')
assert( g['p'].args[0] == -1)
g = genson.loads('{ "p" : sin(+1) } ')
assert( g['p'].args[0] == 1)
def test_binary():
g = genson.loads('{ "p" : gaussian(1+1,1) } ')
assert( g['p'].mean == 2... | <commit_before><commit_msg>Add tests for genson expression<commit_after>import genson
def test_unary():
g = genson.loads('{ "p" : sin(-1) } ')
assert( g['p'].args[0] == -1)
g = genson.loads('{ "p" : sin(+1) } ')
assert( g['p'].args[0] == 1)
def test_binary():
g = genson.loads('{ "p" : gaussian... | |
0cefbaa9355887ab1a03008f434ecb315bbe32ba | test/statements/import6.py | test/statements/import6.py | from __future__ import generator_stop
from : keyword.control.flow.python, source.python
: source.python
__future__ : source.python, support.variable.magic.python
: source.python
import : keyword.control.import.python, source.python
: source.python
generato... | Add a test for "from __future__ import .." | Add a test for "from __future__ import .."
| Python | mit | MagicStack/MagicPython,MagicStack/MagicPython,MagicStack/MagicPython | Add a test for "from __future__ import .." | from __future__ import generator_stop
from : keyword.control.flow.python, source.python
: source.python
__future__ : source.python, support.variable.magic.python
: source.python
import : keyword.control.import.python, source.python
: source.python
generato... | <commit_before><commit_msg>Add a test for "from __future__ import .."<commit_after> | from __future__ import generator_stop
from : keyword.control.flow.python, source.python
: source.python
__future__ : source.python, support.variable.magic.python
: source.python
import : keyword.control.import.python, source.python
: source.python
generato... | Add a test for "from __future__ import .."from __future__ import generator_stop
from : keyword.control.flow.python, source.python
: source.python
__future__ : source.python, support.variable.magic.python
: source.python
import : keyword.control.import.python, source.pyt... | <commit_before><commit_msg>Add a test for "from __future__ import .."<commit_after>from __future__ import generator_stop
from : keyword.control.flow.python, source.python
: source.python
__future__ : source.python, support.variable.magic.python
: source.python
import : ... | |
92e0616c7158f0e38b3dab8b5f347e8eef6d899c | balance_newlines.py | balance_newlines.py | #!/usr/bin/env python
import sys
def main():
def width(lines):
return max(map(len, [' '.join(l) for l in lines]))
lines = [x.split(' ') for x in sys.stdin.read().strip().split('\n')]
print >>sys.stderr, 'Before - max width:', width(lines)
making_progress = True
while making_progress:
... | Add python script to balance the line length in some text | Add python script to balance the line length in some text
Useful to find the optimal newline placement in titles that have
wrapped to balance the line length, for instance:
"This is a long long title that is just ever so slightly longer than one
line."
Becomes:
"This is a long long title that is just
ever so slight... | Python | mit | DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk | Add python script to balance the line length in some text
Useful to find the optimal newline placement in titles that have
wrapped to balance the line length, for instance:
"This is a long long title that is just ever so slightly longer than one
line."
Becomes:
"This is a long long title that is just
ever so slight... | #!/usr/bin/env python
import sys
def main():
def width(lines):
return max(map(len, [' '.join(l) for l in lines]))
lines = [x.split(' ') for x in sys.stdin.read().strip().split('\n')]
print >>sys.stderr, 'Before - max width:', width(lines)
making_progress = True
while making_progress:
... | <commit_before><commit_msg>Add python script to balance the line length in some text
Useful to find the optimal newline placement in titles that have
wrapped to balance the line length, for instance:
"This is a long long title that is just ever so slightly longer than one
line."
Becomes:
"This is a long long title ... | #!/usr/bin/env python
import sys
def main():
def width(lines):
return max(map(len, [' '.join(l) for l in lines]))
lines = [x.split(' ') for x in sys.stdin.read().strip().split('\n')]
print >>sys.stderr, 'Before - max width:', width(lines)
making_progress = True
while making_progress:
... | Add python script to balance the line length in some text
Useful to find the optimal newline placement in titles that have
wrapped to balance the line length, for instance:
"This is a long long title that is just ever so slightly longer than one
line."
Becomes:
"This is a long long title that is just
ever so slight... | <commit_before><commit_msg>Add python script to balance the line length in some text
Useful to find the optimal newline placement in titles that have
wrapped to balance the line length, for instance:
"This is a long long title that is just ever so slightly longer than one
line."
Becomes:
"This is a long long title ... | |
cd7e5f0b5107be3d64e80ed840eb7c32c96a19da | tests/functional/registration/test_discovery.py | tests/functional/registration/test_discovery.py | """
Test discovering of registered languages and generators.
"""
import subprocess
def test_list_languages_cli():
"""
Test list-languages command.
"""
output = subprocess.check_output(['textx', 'list-languages'],
stderr=subprocess.STDOUT)
assert b'flow-dsl' in ... | Add initial tests for discovery | Add initial tests for discovery
| Python | mit | igordejanovic/textX,igordejanovic/textX,igordejanovic/textX | Add initial tests for discovery | """
Test discovering of registered languages and generators.
"""
import subprocess
def test_list_languages_cli():
"""
Test list-languages command.
"""
output = subprocess.check_output(['textx', 'list-languages'],
stderr=subprocess.STDOUT)
assert b'flow-dsl' in ... | <commit_before><commit_msg>Add initial tests for discovery<commit_after> | """
Test discovering of registered languages and generators.
"""
import subprocess
def test_list_languages_cli():
"""
Test list-languages command.
"""
output = subprocess.check_output(['textx', 'list-languages'],
stderr=subprocess.STDOUT)
assert b'flow-dsl' in ... | Add initial tests for discovery"""
Test discovering of registered languages and generators.
"""
import subprocess
def test_list_languages_cli():
"""
Test list-languages command.
"""
output = subprocess.check_output(['textx', 'list-languages'],
stderr=subprocess.STD... | <commit_before><commit_msg>Add initial tests for discovery<commit_after>"""
Test discovering of registered languages and generators.
"""
import subprocess
def test_list_languages_cli():
"""
Test list-languages command.
"""
output = subprocess.check_output(['textx', 'list-languages'],
... | |
bb8150d7174ae9329fe3a2fcc1937bb72d3e9ddf | liwc2es.py | liwc2es.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to put a folia xml file in ElasticSearch.
"""
import codecs
import os
import time
from datetime import datetime
from elasticsearch import Elasticsearch, client
from lxml import etree
from bs4 import BeautifulSoup
from emotools.plays import extract_character_name, ... | Add script to save liwc categories + words to elasticsearch | Add script to save liwc categories + words to elasticsearch
Added a script that saves the liwc categories + their words to
elasticsearch. The liwc dictionary is saved in the type entitycategory,
with fields 'name', 'words'. This data is saved in order to be able to
get an overview of all words that belong to a certain... | Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add script to save liwc categories + words to elasticsearch
Added a script that saves the liwc categories + their words to
elasticsearch. The liwc dictionary is saved in the type entitycategory,
with fields 'name', 'words'. This data is saved in order to be able to
get an overview of all words that belong to a certain... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to put a folia xml file in ElasticSearch.
"""
import codecs
import os
import time
from datetime import datetime
from elasticsearch import Elasticsearch, client
from lxml import etree
from bs4 import BeautifulSoup
from emotools.plays import extract_character_name, ... | <commit_before><commit_msg>Add script to save liwc categories + words to elasticsearch
Added a script that saves the liwc categories + their words to
elasticsearch. The liwc dictionary is saved in the type entitycategory,
with fields 'name', 'words'. This data is saved in order to be able to
get an overview of all wor... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to put a folia xml file in ElasticSearch.
"""
import codecs
import os
import time
from datetime import datetime
from elasticsearch import Elasticsearch, client
from lxml import etree
from bs4 import BeautifulSoup
from emotools.plays import extract_character_name, ... | Add script to save liwc categories + words to elasticsearch
Added a script that saves the liwc categories + their words to
elasticsearch. The liwc dictionary is saved in the type entitycategory,
with fields 'name', 'words'. This data is saved in order to be able to
get an overview of all words that belong to a certain... | <commit_before><commit_msg>Add script to save liwc categories + words to elasticsearch
Added a script that saves the liwc categories + their words to
elasticsearch. The liwc dictionary is saved in the type entitycategory,
with fields 'name', 'words'. This data is saved in order to be able to
get an overview of all wor... | |
8aff9f37380444e929f54ebbb7679e4692d14a82 | get-waagent.py | get-waagent.py | #!/usr/bin/env python
#
# Windows Azure Linux Agent setup.py
#
# Copyright 2013 Microsoft Corporation
#
# 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/LI... | Add 'one script to go' support | Add 'one script to go' support
| Python | apache-2.0 | rjschwei/WALinuxAgent,hglkrijger/WALinuxAgent,nathanleclaire/WALinuxAgent,hglkrijger/WALinuxAgent,rjschwei/WALinuxAgent,Azure/WALinuxAgent,nathanleclaire/WALinuxAgent,andyliuliming/WALinuxAgent,Azure/WALinuxAgent,andyliuliming/WALinuxAgent | Add 'one script to go' support | #!/usr/bin/env python
#
# Windows Azure Linux Agent setup.py
#
# Copyright 2013 Microsoft Corporation
#
# 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/LI... | <commit_before><commit_msg>Add 'one script to go' support<commit_after> | #!/usr/bin/env python
#
# Windows Azure Linux Agent setup.py
#
# Copyright 2013 Microsoft Corporation
#
# 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/LI... | Add 'one script to go' support#!/usr/bin/env python
#
# Windows Azure Linux Agent setup.py
#
# Copyright 2013 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... | <commit_before><commit_msg>Add 'one script to go' support<commit_after>#!/usr/bin/env python
#
# Windows Azure Linux Agent setup.py
#
# Copyright 2013 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | |
896880f84dcf6615fe33123dd1e6fe24bc1a7896 | tests/manual/check_model_utils.py | tests/manual/check_model_utils.py | from __future__ import absolute_import
from __future__ import print_function
from keras.models import Sequential, Graph
from keras.layers.core import Layer, Activation, Dense, Flatten, Reshape, Merge
from keras.layers.convolutional import Convolution2D, MaxPooling2D
import keras.utils.model_utils as model_utils
print(... | Add a test script for model_utils | Add a test script for model_utils | Python | mit | harshhemani/keras,cheng6076/keras,marchick209/keras,untom/keras,daviddiazvico/keras,printedheart/keras,Cadene/keras,dolaameng/keras,gavinmh/keras,Smerity/keras,jalexvig/keras,MagicSen/keras,zhmz90/keras,tencrance/keras,iamtrask/keras,nt/keras,iScienceLuvr/keras,mikekestemont/keras,rodrigob/keras,imcomking/Convolutional... | Add a test script for model_utils | from __future__ import absolute_import
from __future__ import print_function
from keras.models import Sequential, Graph
from keras.layers.core import Layer, Activation, Dense, Flatten, Reshape, Merge
from keras.layers.convolutional import Convolution2D, MaxPooling2D
import keras.utils.model_utils as model_utils
print(... | <commit_before><commit_msg>Add a test script for model_utils<commit_after> | from __future__ import absolute_import
from __future__ import print_function
from keras.models import Sequential, Graph
from keras.layers.core import Layer, Activation, Dense, Flatten, Reshape, Merge
from keras.layers.convolutional import Convolution2D, MaxPooling2D
import keras.utils.model_utils as model_utils
print(... | Add a test script for model_utilsfrom __future__ import absolute_import
from __future__ import print_function
from keras.models import Sequential, Graph
from keras.layers.core import Layer, Activation, Dense, Flatten, Reshape, Merge
from keras.layers.convolutional import Convolution2D, MaxPooling2D
import keras.utils.m... | <commit_before><commit_msg>Add a test script for model_utils<commit_after>from __future__ import absolute_import
from __future__ import print_function
from keras.models import Sequential, Graph
from keras.layers.core import Layer, Activation, Dense, Flatten, Reshape, Merge
from keras.layers.convolutional import Convolu... | |
ab64c3b060a55f1ddcceed3613628a7ba88113bc | testing/test_storm_c.py | testing/test_storm_c.py | #! /usr/bin/env python
#
# Tests for the C version of `storm`.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper ([email protected])
from nose.tools import *
import os
import shutil
from subprocess import call
# Global
start_dir = os.getcwd()
data_dir = os.path.join(start_dir, 'testing', 'data')
c_dir = os.path... | Add unit tests for C version of | Add unit tests for C version of
| Python | mit | mdpiper/storm,csdms-contrib/storm,csdms-contrib/storm,mdpiper/storm | Add unit tests for C version of | #! /usr/bin/env python
#
# Tests for the C version of `storm`.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper ([email protected])
from nose.tools import *
import os
import shutil
from subprocess import call
# Global
start_dir = os.getcwd()
data_dir = os.path.join(start_dir, 'testing', 'data')
c_dir = os.path... | <commit_before><commit_msg>Add unit tests for C version of<commit_after> | #! /usr/bin/env python
#
# Tests for the C version of `storm`.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper ([email protected])
from nose.tools import *
import os
import shutil
from subprocess import call
# Global
start_dir = os.getcwd()
data_dir = os.path.join(start_dir, 'testing', 'data')
c_dir = os.path... | Add unit tests for C version of#! /usr/bin/env python
#
# Tests for the C version of `storm`.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper ([email protected])
from nose.tools import *
import os
import shutil
from subprocess import call
# Global
start_dir = os.getcwd()
data_dir = os.path.join(start_dir, 'te... | <commit_before><commit_msg>Add unit tests for C version of<commit_after>#! /usr/bin/env python
#
# Tests for the C version of `storm`.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper ([email protected])
from nose.tools import *
import os
import shutil
from subprocess import call
# Global
start_dir = os.getcwd... | |
f8ee77368da560d1becb6738ef4d8aca9d7e9ba8 | annotation_statistics.py | annotation_statistics.py | """Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annotation_statistics.py <dir containing the folia files with
EmbodiedEmotions annotations>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools.bs4_helpers import sentence, not... | Add script to calculate annotation statistics | Add script to calculate annotation statistics
Added a script that counts the number of annotated entities and
emotional vs. non-emotional sentences.
| Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add script to calculate annotation statistics
Added a script that counts the number of annotated entities and
emotional vs. non-emotional sentences. | """Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annotation_statistics.py <dir containing the folia files with
EmbodiedEmotions annotations>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools.bs4_helpers import sentence, not... | <commit_before><commit_msg>Add script to calculate annotation statistics
Added a script that counts the number of annotated entities and
emotional vs. non-emotional sentences.<commit_after> | """Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annotation_statistics.py <dir containing the folia files with
EmbodiedEmotions annotations>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools.bs4_helpers import sentence, not... | Add script to calculate annotation statistics
Added a script that counts the number of annotated entities and
emotional vs. non-emotional sentences."""Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annotation_statistics.py <dir containing the f... | <commit_before><commit_msg>Add script to calculate annotation statistics
Added a script that counts the number of annotated entities and
emotional vs. non-emotional sentences.<commit_after>"""Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annot... | |
df719f08efdbbadc5694454ffceed21c7c54e8c7 | tests/test_config_gauge.py | tests/test_config_gauge.py | #!/usr/bin/env python3
"""Test config parsing"""
import logging
import os
import shutil
import tempfile
import unittest
from faucet import config_parser as cp
LOGNAME = '/dev/null'
class TestGaugeConfig(unittest.TestCase):
"""Test gauge.yaml config parsing."""
DEFAULT_FAUCET_CONFIG = """
dps:
dp1:
... | Add unit tests for gauge config | Add unit tests for gauge config
Add test coverage for https://github.com/faucetsdn/faucet/issues/1441
| Python | apache-2.0 | anarkiwi/faucet,gizmoguy/faucet,shivarammysore/faucet,wackerly/faucet,faucetsdn/faucet,trungdtbk/faucet,mwutzke/faucet,mwutzke/faucet,trentindav/faucet,wackerly/faucet,shivarammysore/faucet,trentindav/faucet,gizmoguy/faucet,REANNZ/faucet,REANNZ/faucet,anarkiwi/faucet,faucetsdn/faucet,trungdtbk/faucet | Add unit tests for gauge config
Add test coverage for https://github.com/faucetsdn/faucet/issues/1441 | #!/usr/bin/env python3
"""Test config parsing"""
import logging
import os
import shutil
import tempfile
import unittest
from faucet import config_parser as cp
LOGNAME = '/dev/null'
class TestGaugeConfig(unittest.TestCase):
"""Test gauge.yaml config parsing."""
DEFAULT_FAUCET_CONFIG = """
dps:
dp1:
... | <commit_before><commit_msg>Add unit tests for gauge config
Add test coverage for https://github.com/faucetsdn/faucet/issues/1441<commit_after> | #!/usr/bin/env python3
"""Test config parsing"""
import logging
import os
import shutil
import tempfile
import unittest
from faucet import config_parser as cp
LOGNAME = '/dev/null'
class TestGaugeConfig(unittest.TestCase):
"""Test gauge.yaml config parsing."""
DEFAULT_FAUCET_CONFIG = """
dps:
dp1:
... | Add unit tests for gauge config
Add test coverage for https://github.com/faucetsdn/faucet/issues/1441#!/usr/bin/env python3
"""Test config parsing"""
import logging
import os
import shutil
import tempfile
import unittest
from faucet import config_parser as cp
LOGNAME = '/dev/null'
class TestGaugeConfig(unitte... | <commit_before><commit_msg>Add unit tests for gauge config
Add test coverage for https://github.com/faucetsdn/faucet/issues/1441<commit_after>#!/usr/bin/env python3
"""Test config parsing"""
import logging
import os
import shutil
import tempfile
import unittest
from faucet import config_parser as cp
LOGNAME = '... | |
65074a6edb390aaf01aab018f166540d583ee86a | clubs/migrations/0010_add_missing_colleges.py | clubs/migrations/0010_add_missing_colleges.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_colleges(apps, schema_editor):
College = apps.get_model('clubs', 'College')
# Variables are named: <city_code>_<college_code>_<gender_code>.
College.objects.create(city='R', section='NG', name=... | Add new and missing colleges. | Add new and missing colleges.
| Python | agpl-3.0 | osamak/student-portal,osamak/student-portal,enjaz/enjaz,enjaz/enjaz,osamak/student-portal,enjaz/enjaz,enjaz/enjaz,osamak/student-portal,enjaz/enjaz,osamak/student-portal | Add new and missing colleges. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_colleges(apps, schema_editor):
College = apps.get_model('clubs', 'College')
# Variables are named: <city_code>_<college_code>_<gender_code>.
College.objects.create(city='R', section='NG', name=... | <commit_before><commit_msg>Add new and missing colleges.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_colleges(apps, schema_editor):
College = apps.get_model('clubs', 'College')
# Variables are named: <city_code>_<college_code>_<gender_code>.
College.objects.create(city='R', section='NG', name=... | Add new and missing colleges.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_colleges(apps, schema_editor):
College = apps.get_model('clubs', 'College')
# Variables are named: <city_code>_<college_code>_<gender_code>.
College.objects.create(... | <commit_before><commit_msg>Add new and missing colleges.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_colleges(apps, schema_editor):
College = apps.get_model('clubs', 'College')
# Variables are named: <city_code>_<college_code>_<... | |
8cabf2cb2922979bf5dede4e1084978e82df092e | apps/submission/forms.py | apps/submission/forms.py | from django import forms
from django.utils.translation import ugettext as _
from apps.core.models import Tag
from .models import SubmissionProcess
class SubmissionTagsForm(forms.ModelForm):
def _get_tags():
return [(t.name, t.name) for t in Tag.objects.all()]
experiment_tags = forms.ChoiceField(
... | Add draft submission tags form | Add draft submission tags form
| Python | bsd-3-clause | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | Add draft submission tags form | from django import forms
from django.utils.translation import ugettext as _
from apps.core.models import Tag
from .models import SubmissionProcess
class SubmissionTagsForm(forms.ModelForm):
def _get_tags():
return [(t.name, t.name) for t in Tag.objects.all()]
experiment_tags = forms.ChoiceField(
... | <commit_before><commit_msg>Add draft submission tags form<commit_after> | from django import forms
from django.utils.translation import ugettext as _
from apps.core.models import Tag
from .models import SubmissionProcess
class SubmissionTagsForm(forms.ModelForm):
def _get_tags():
return [(t.name, t.name) for t in Tag.objects.all()]
experiment_tags = forms.ChoiceField(
... | Add draft submission tags formfrom django import forms
from django.utils.translation import ugettext as _
from apps.core.models import Tag
from .models import SubmissionProcess
class SubmissionTagsForm(forms.ModelForm):
def _get_tags():
return [(t.name, t.name) for t in Tag.objects.all()]
experimen... | <commit_before><commit_msg>Add draft submission tags form<commit_after>from django import forms
from django.utils.translation import ugettext as _
from apps.core.models import Tag
from .models import SubmissionProcess
class SubmissionTagsForm(forms.ModelForm):
def _get_tags():
return [(t.name, t.name) f... | |
1d78e83150373a1417b0aad517e7bf178e3ab633 | tests/chainer_tests/optimizers_tests/test_optimizers.py | tests/chainer_tests/optimizers_tests/test_optimizers.py | import unittest
import six
import chainer
from chainer import optimizers
from chainer import testing
@testing.parameterize(*testing.product({
'impl': [
optimizers.AdaDelta,
optimizers.AdaGrad,
optimizers.Adam,
optimizers.MomentumSGD,
optimizers.NesterovAG,
optimiz... | Add a test of using non-default hyperparameter for each optimizer implementation | Add a test of using non-default hyperparameter for each optimizer implementation
| Python | mit | okuta/chainer,hvy/chainer,chainer/chainer,rezoo/chainer,wkentaro/chainer,wkentaro/chainer,jnishi/chainer,niboshi/chainer,niboshi/chainer,chainer/chainer,keisuke-umezawa/chainer,okuta/chainer,kiyukuta/chainer,okuta/chainer,niboshi/chainer,wkentaro/chainer,wkentaro/chainer,chainer/chainer,okuta/chainer,jnishi/chainer,hvy... | Add a test of using non-default hyperparameter for each optimizer implementation | import unittest
import six
import chainer
from chainer import optimizers
from chainer import testing
@testing.parameterize(*testing.product({
'impl': [
optimizers.AdaDelta,
optimizers.AdaGrad,
optimizers.Adam,
optimizers.MomentumSGD,
optimizers.NesterovAG,
optimiz... | <commit_before><commit_msg>Add a test of using non-default hyperparameter for each optimizer implementation<commit_after> | import unittest
import six
import chainer
from chainer import optimizers
from chainer import testing
@testing.parameterize(*testing.product({
'impl': [
optimizers.AdaDelta,
optimizers.AdaGrad,
optimizers.Adam,
optimizers.MomentumSGD,
optimizers.NesterovAG,
optimiz... | Add a test of using non-default hyperparameter for each optimizer implementationimport unittest
import six
import chainer
from chainer import optimizers
from chainer import testing
@testing.parameterize(*testing.product({
'impl': [
optimizers.AdaDelta,
optimizers.AdaGrad,
optimizers.Adam... | <commit_before><commit_msg>Add a test of using non-default hyperparameter for each optimizer implementation<commit_after>import unittest
import six
import chainer
from chainer import optimizers
from chainer import testing
@testing.parameterize(*testing.product({
'impl': [
optimizers.AdaDelta,
op... | |
94459df7f3abc81c2b66e4ea8bf60eebf387de31 | votes/urls.py | votes/urls.py | from django.conf.urls import include, url
from django.views.generic import TemplateView
from votes.views import VoteView
urlpatterns = [
url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view()),
]
| Add URL scheme for votes app | Add URL scheme for votes app
| Python | mit | kuboschek/jay,kuboschek/jay,kuboschek/jay,OpenJUB/jay,OpenJUB/jay,OpenJUB/jay | Add URL scheme for votes app | from django.conf.urls import include, url
from django.views.generic import TemplateView
from votes.views import VoteView
urlpatterns = [
url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view()),
]
| <commit_before><commit_msg>Add URL scheme for votes app<commit_after> | from django.conf.urls import include, url
from django.views.generic import TemplateView
from votes.views import VoteView
urlpatterns = [
url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view()),
]
| Add URL scheme for votes appfrom django.conf.urls import include, url
from django.views.generic import TemplateView
from votes.views import VoteView
urlpatterns = [
url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view()),
]
| <commit_before><commit_msg>Add URL scheme for votes app<commit_after>from django.conf.urls import include, url
from django.views.generic import TemplateView
from votes.views import VoteView
urlpatterns = [
url(r'^(?P<vote_name>[\w-]+)$', VoteView.as_view()),
]
| |
3715583d29374ca8a1d041319385f56431f4e477 | zephyr/management/commands/expunge_db.py | zephyr/management/commands/expunge_db.py | from django.core.management.base import BaseCommand
from zephyr.retention_policy import get_UserMessages_to_expunge
from zephyr.models import Message
class Command(BaseCommand):
help = ('Expunge old UserMessages and Messages from the database, '
+ 'according to the retention policy.')... | Implement a command to expunge old UserMessages and Messages from the database | Implement a command to expunge old UserMessages and Messages from the database
(imported from commit a4873dfa8737c483411d12f30daaebebebf859f9)
| Python | apache-2.0 | grave-w-grave/zulip,wavelets/zulip,kou/zulip,krtkmj/zulip,alliejones/zulip,tiansiyuan/zulip,jimmy54/zulip,Cheppers/zulip,brockwhittaker/zulip,dnmfarrell/zulip,AZtheAsian/zulip,arpitpanwar/zulip,Galexrt/zulip,jonesgithub/zulip,dxq-git/zulip,proliming/zulip,arpitpanwar/zulip,niftynei/zulip,Gabriel0402/zulip,showell/zulip... | Implement a command to expunge old UserMessages and Messages from the database
(imported from commit a4873dfa8737c483411d12f30daaebebebf859f9) | from django.core.management.base import BaseCommand
from zephyr.retention_policy import get_UserMessages_to_expunge
from zephyr.models import Message
class Command(BaseCommand):
help = ('Expunge old UserMessages and Messages from the database, '
+ 'according to the retention policy.')... | <commit_before><commit_msg>Implement a command to expunge old UserMessages and Messages from the database
(imported from commit a4873dfa8737c483411d12f30daaebebebf859f9)<commit_after> | from django.core.management.base import BaseCommand
from zephyr.retention_policy import get_UserMessages_to_expunge
from zephyr.models import Message
class Command(BaseCommand):
help = ('Expunge old UserMessages and Messages from the database, '
+ 'according to the retention policy.')... | Implement a command to expunge old UserMessages and Messages from the database
(imported from commit a4873dfa8737c483411d12f30daaebebebf859f9)from django.core.management.base import BaseCommand
from zephyr.retention_policy import get_UserMessages_to_expunge
from zephyr.models import Message
class Co... | <commit_before><commit_msg>Implement a command to expunge old UserMessages and Messages from the database
(imported from commit a4873dfa8737c483411d12f30daaebebebf859f9)<commit_after>from django.core.management.base import BaseCommand
from zephyr.retention_policy import get_UserMessages_to_expunge
from zephyr.mode... | |
523e818a9391151ce6f236ae44d558d2ee779851 | pcm2wav.py | pcm2wav.py | #!/usr/bin/env python
import re
import os
import sys
import wave
if len(sys.argv) != 2:
print "Usage:%s pcm file" % (sys.argv[0])
print "A wave will be created use same name. For example, input file is a.pcm, a.wav will be generated"
sys.exit(1)
if not os.path.isfile(sys.argv[1]):
print "input param ... | Convert pcm files to wav files. | Convert pcm files to wav files.
| Python | mit | JeffpanUK/NuPyTools,JeffpanUK/NuPyTools | Convert pcm files to wav files. | #!/usr/bin/env python
import re
import os
import sys
import wave
if len(sys.argv) != 2:
print "Usage:%s pcm file" % (sys.argv[0])
print "A wave will be created use same name. For example, input file is a.pcm, a.wav will be generated"
sys.exit(1)
if not os.path.isfile(sys.argv[1]):
print "input param ... | <commit_before><commit_msg>Convert pcm files to wav files.<commit_after> | #!/usr/bin/env python
import re
import os
import sys
import wave
if len(sys.argv) != 2:
print "Usage:%s pcm file" % (sys.argv[0])
print "A wave will be created use same name. For example, input file is a.pcm, a.wav will be generated"
sys.exit(1)
if not os.path.isfile(sys.argv[1]):
print "input param ... | Convert pcm files to wav files.#!/usr/bin/env python
import re
import os
import sys
import wave
if len(sys.argv) != 2:
print "Usage:%s pcm file" % (sys.argv[0])
print "A wave will be created use same name. For example, input file is a.pcm, a.wav will be generated"
sys.exit(1)
if not os.path.isfile(sys.ar... | <commit_before><commit_msg>Convert pcm files to wav files.<commit_after>#!/usr/bin/env python
import re
import os
import sys
import wave
if len(sys.argv) != 2:
print "Usage:%s pcm file" % (sys.argv[0])
print "A wave will be created use same name. For example, input file is a.pcm, a.wav will be generated"
... | |
188d59f6a37cd5b8420bdcf93a5c5dd51493d95d | tests/test_pipeline_genome.py | tests/test_pipeline_genome.py | """
.. Copyright 2017 EMBL-European Bioinformatics Institute
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 applic... | Test the pipeline code for genome indexing | Test the pipeline code for genome indexing
| Python | apache-2.0 | Multiscale-Genomics/mg-process-fastq,Multiscale-Genomics/mg-process-fastq,Multiscale-Genomics/mg-process-fastq | Test the pipeline code for genome indexing | """
.. Copyright 2017 EMBL-European Bioinformatics Institute
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 applic... | <commit_before><commit_msg>Test the pipeline code for genome indexing<commit_after> | """
.. Copyright 2017 EMBL-European Bioinformatics Institute
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 applic... | Test the pipeline code for genome indexing"""
.. Copyright 2017 EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses... | <commit_before><commit_msg>Test the pipeline code for genome indexing<commit_after>"""
.. Copyright 2017 EMBL-European Bioinformatics Institute
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 ... | |
5260bc673c7fb12c208ab44e6d6044be3f0357ef | wdim/server/__init__.py | wdim/server/__init__.py | import os
import asyncio
import logging
import tornado.web
import tornado.httpserver
import tornado.platform.asyncio
from tornado.options import define
from tornado.options import options
import asyncio_mongo
from wdim.server.api import v1
logger = logging.getLogger(__name__)
define('debug', default=True, help='D... | Use asyncio_mongo for the server | Use asyncio_mongo for the server
| Python | mit | chrisseto/Still | Use asyncio_mongo for the server | import os
import asyncio
import logging
import tornado.web
import tornado.httpserver
import tornado.platform.asyncio
from tornado.options import define
from tornado.options import options
import asyncio_mongo
from wdim.server.api import v1
logger = logging.getLogger(__name__)
define('debug', default=True, help='D... | <commit_before><commit_msg>Use asyncio_mongo for the server<commit_after> | import os
import asyncio
import logging
import tornado.web
import tornado.httpserver
import tornado.platform.asyncio
from tornado.options import define
from tornado.options import options
import asyncio_mongo
from wdim.server.api import v1
logger = logging.getLogger(__name__)
define('debug', default=True, help='D... | Use asyncio_mongo for the serverimport os
import asyncio
import logging
import tornado.web
import tornado.httpserver
import tornado.platform.asyncio
from tornado.options import define
from tornado.options import options
import asyncio_mongo
from wdim.server.api import v1
logger = logging.getLogger(__name__)
defin... | <commit_before><commit_msg>Use asyncio_mongo for the server<commit_after>import os
import asyncio
import logging
import tornado.web
import tornado.httpserver
import tornado.platform.asyncio
from tornado.options import define
from tornado.options import options
import asyncio_mongo
from wdim.server.api import v1
lo... | |
374c1e31c5ce417221bc55da0eb1ffcb023e8493 | slope_vs_dist/npz2pkl.py | slope_vs_dist/npz2pkl.py | """
Load all the results and configuration data from directories containing
multiple .npz files and save them in a pickle. Strict data structure is
assumed, as created from DataGenTaskFarmMC.py.
"""
from __future__ import print_function
import os
import sys
import pickle
import numpy as np
import time
directories = s... | Load npz files and dump them to a pickle | Load npz files and dump them to a pickle
| Python | apache-2.0 | achilleas-k/brian-scripts,achilleas-k/brian-scripts | Load npz files and dump them to a pickle | """
Load all the results and configuration data from directories containing
multiple .npz files and save them in a pickle. Strict data structure is
assumed, as created from DataGenTaskFarmMC.py.
"""
from __future__ import print_function
import os
import sys
import pickle
import numpy as np
import time
directories = s... | <commit_before><commit_msg>Load npz files and dump them to a pickle<commit_after> | """
Load all the results and configuration data from directories containing
multiple .npz files and save them in a pickle. Strict data structure is
assumed, as created from DataGenTaskFarmMC.py.
"""
from __future__ import print_function
import os
import sys
import pickle
import numpy as np
import time
directories = s... | Load npz files and dump them to a pickle"""
Load all the results and configuration data from directories containing
multiple .npz files and save them in a pickle. Strict data structure is
assumed, as created from DataGenTaskFarmMC.py.
"""
from __future__ import print_function
import os
import sys
import pickle
import ... | <commit_before><commit_msg>Load npz files and dump them to a pickle<commit_after>"""
Load all the results and configuration data from directories containing
multiple .npz files and save them in a pickle. Strict data structure is
assumed, as created from DataGenTaskFarmMC.py.
"""
from __future__ import print_function
i... | |
7e242c02dd9b1bcd1d0281153fb2591d2846fc60 | tests/integration/test_old_report_redirect.py | tests/integration/test_old_report_redirect.py | """Test old search links work.
e.g: /report?q=dnstwister.report goes to /search/dnstwister.report
"""
def test_redirect(webapp):
"""Test we can redirect."""
response = webapp.get('/report?q=dnstwister.report')
assert response.status_code == 302
assert response.headers['location'] == 'http://localhos... | Test of the old bookmarked links being redirected | Test of the old bookmarked links being redirected
| Python | unlicense | thisismyrobot/dnstwister,thisismyrobot/dnstwister,thisismyrobot/dnstwister | Test of the old bookmarked links being redirected | """Test old search links work.
e.g: /report?q=dnstwister.report goes to /search/dnstwister.report
"""
def test_redirect(webapp):
"""Test we can redirect."""
response = webapp.get('/report?q=dnstwister.report')
assert response.status_code == 302
assert response.headers['location'] == 'http://localhos... | <commit_before><commit_msg>Test of the old bookmarked links being redirected<commit_after> | """Test old search links work.
e.g: /report?q=dnstwister.report goes to /search/dnstwister.report
"""
def test_redirect(webapp):
"""Test we can redirect."""
response = webapp.get('/report?q=dnstwister.report')
assert response.status_code == 302
assert response.headers['location'] == 'http://localhos... | Test of the old bookmarked links being redirected"""Test old search links work.
e.g: /report?q=dnstwister.report goes to /search/dnstwister.report
"""
def test_redirect(webapp):
"""Test we can redirect."""
response = webapp.get('/report?q=dnstwister.report')
assert response.status_code == 302
assert... | <commit_before><commit_msg>Test of the old bookmarked links being redirected<commit_after>"""Test old search links work.
e.g: /report?q=dnstwister.report goes to /search/dnstwister.report
"""
def test_redirect(webapp):
"""Test we can redirect."""
response = webapp.get('/report?q=dnstwister.report')
asse... | |
d7387869c4500c4ddf8df728007cbc1f09dc767f | migrations/versions/0341_new_letter_rates.py | migrations/versions/0341_new_letter_rates.py | """
Revision ID: 0341_new_letter_rates
Revises: 0340_stub_training_broadcasts
Create Date: 2021-01-27 11:58:21.393227
"""
import itertools
import uuid
from datetime import datetime
from alembic import op
from sqlalchemy.sql import text
from app.models import LetterRate
revision = '0341_new_letter_rates'
down_revi... | Add February 2021 letter rates | Add February 2021 letter rates
All rates are changing, so we add an end date for the current rates and
insert new rates for every post_class, sheet count and crown status.
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add February 2021 letter rates
All rates are changing, so we add an end date for the current rates and
insert new rates for every post_class, sheet count and crown status. | """
Revision ID: 0341_new_letter_rates
Revises: 0340_stub_training_broadcasts
Create Date: 2021-01-27 11:58:21.393227
"""
import itertools
import uuid
from datetime import datetime
from alembic import op
from sqlalchemy.sql import text
from app.models import LetterRate
revision = '0341_new_letter_rates'
down_revi... | <commit_before><commit_msg>Add February 2021 letter rates
All rates are changing, so we add an end date for the current rates and
insert new rates for every post_class, sheet count and crown status.<commit_after> | """
Revision ID: 0341_new_letter_rates
Revises: 0340_stub_training_broadcasts
Create Date: 2021-01-27 11:58:21.393227
"""
import itertools
import uuid
from datetime import datetime
from alembic import op
from sqlalchemy.sql import text
from app.models import LetterRate
revision = '0341_new_letter_rates'
down_revi... | Add February 2021 letter rates
All rates are changing, so we add an end date for the current rates and
insert new rates for every post_class, sheet count and crown status."""
Revision ID: 0341_new_letter_rates
Revises: 0340_stub_training_broadcasts
Create Date: 2021-01-27 11:58:21.393227
"""
import itertools
import ... | <commit_before><commit_msg>Add February 2021 letter rates
All rates are changing, so we add an end date for the current rates and
insert new rates for every post_class, sheet count and crown status.<commit_after>"""
Revision ID: 0341_new_letter_rates
Revises: 0340_stub_training_broadcasts
Create Date: 2021-01-27 11:5... | |
55a75d62bfd77c9df817e8a600a89bc4f9594f9c | Lib/ejm_rcparams.py | Lib/ejm_rcparams.py | import numpy as np
import matplotlib
from matplotlib import rcParams
from matplotlib.backends.backend_pgf import FigureCanvasPgf
matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf)
rcParams['axes.labelsize'] = 10
rcParams['xtick.labelsize'] = 9
rcParams['ytick.labelsize'] = 9
rcParams['legend.fontsize'] =... | Add module to set up plots for journally output | Add module to set up plots for journally output
| Python | bsd-3-clause | eddiejessup/ciabatta | Add module to set up plots for journally output | import numpy as np
import matplotlib
from matplotlib import rcParams
from matplotlib.backends.backend_pgf import FigureCanvasPgf
matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf)
rcParams['axes.labelsize'] = 10
rcParams['xtick.labelsize'] = 9
rcParams['ytick.labelsize'] = 9
rcParams['legend.fontsize'] =... | <commit_before><commit_msg>Add module to set up plots for journally output<commit_after> | import numpy as np
import matplotlib
from matplotlib import rcParams
from matplotlib.backends.backend_pgf import FigureCanvasPgf
matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf)
rcParams['axes.labelsize'] = 10
rcParams['xtick.labelsize'] = 9
rcParams['ytick.labelsize'] = 9
rcParams['legend.fontsize'] =... | Add module to set up plots for journally outputimport numpy as np
import matplotlib
from matplotlib import rcParams
from matplotlib.backends.backend_pgf import FigureCanvasPgf
matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf)
rcParams['axes.labelsize'] = 10
rcParams['xtick.labelsize'] = 9
rcParams['ytic... | <commit_before><commit_msg>Add module to set up plots for journally output<commit_after>import numpy as np
import matplotlib
from matplotlib import rcParams
from matplotlib.backends.backend_pgf import FigureCanvasPgf
matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf)
rcParams['axes.labelsize'] = 10
rcPar... | |
96c339ba26d2a09576eee19ad62e5d03d5fa8a0f | process_pic.py | process_pic.py | from pic import Picture
from path import Path
import argparse, json
parser = argparse.ArgumentParser(
description=
"Process the picture or the directory, given the json config file")
parser.add_argument("path", help="Path for the picture or the directory")
parser.add_argument(
"-n",
"--nb_faces",
ty... | Add a script to use the pic.py module | Add a script to use the pic.py module
| Python | mit | Dixneuf19/fuzzy-octo-disco | Add a script to use the pic.py module | from pic import Picture
from path import Path
import argparse, json
parser = argparse.ArgumentParser(
description=
"Process the picture or the directory, given the json config file")
parser.add_argument("path", help="Path for the picture or the directory")
parser.add_argument(
"-n",
"--nb_faces",
ty... | <commit_before><commit_msg>Add a script to use the pic.py module<commit_after> | from pic import Picture
from path import Path
import argparse, json
parser = argparse.ArgumentParser(
description=
"Process the picture or the directory, given the json config file")
parser.add_argument("path", help="Path for the picture or the directory")
parser.add_argument(
"-n",
"--nb_faces",
ty... | Add a script to use the pic.py modulefrom pic import Picture
from path import Path
import argparse, json
parser = argparse.ArgumentParser(
description=
"Process the picture or the directory, given the json config file")
parser.add_argument("path", help="Path for the picture or the directory")
parser.add_argumen... | <commit_before><commit_msg>Add a script to use the pic.py module<commit_after>from pic import Picture
from path import Path
import argparse, json
parser = argparse.ArgumentParser(
description=
"Process the picture or the directory, given the json config file")
parser.add_argument("path", help="Path for the pict... | |
191170a6b1db2dd9a6c71482d0d7bf171b4c4c9a | download.py | download.py | #!/usr/bin/env python
import json
import sys
import urllib2
def get_url(url):
req = urllib2.Request(url)
return urllib2.urlopen(req).fp.read()
def download_url(url, file_name):
with open(file_name, 'w') as f:
f.write(get_url(url))
DROPBOX_BASE_URL = 'https://dl.dropboxusercontent.com'
def get_dro... | Add support for Dropbox and Google Drive | Add support for Dropbox and Google Drive
| Python | mit | tomshen/cloud-download | Add support for Dropbox and Google Drive | #!/usr/bin/env python
import json
import sys
import urllib2
def get_url(url):
req = urllib2.Request(url)
return urllib2.urlopen(req).fp.read()
def download_url(url, file_name):
with open(file_name, 'w') as f:
f.write(get_url(url))
DROPBOX_BASE_URL = 'https://dl.dropboxusercontent.com'
def get_dro... | <commit_before><commit_msg>Add support for Dropbox and Google Drive<commit_after> | #!/usr/bin/env python
import json
import sys
import urllib2
def get_url(url):
req = urllib2.Request(url)
return urllib2.urlopen(req).fp.read()
def download_url(url, file_name):
with open(file_name, 'w') as f:
f.write(get_url(url))
DROPBOX_BASE_URL = 'https://dl.dropboxusercontent.com'
def get_dro... | Add support for Dropbox and Google Drive#!/usr/bin/env python
import json
import sys
import urllib2
def get_url(url):
req = urllib2.Request(url)
return urllib2.urlopen(req).fp.read()
def download_url(url, file_name):
with open(file_name, 'w') as f:
f.write(get_url(url))
DROPBOX_BASE_URL = 'https:... | <commit_before><commit_msg>Add support for Dropbox and Google Drive<commit_after>#!/usr/bin/env python
import json
import sys
import urllib2
def get_url(url):
req = urllib2.Request(url)
return urllib2.urlopen(req).fp.read()
def download_url(url, file_name):
with open(file_name, 'w') as f:
f.write(... | |
651b523fa8f8aba9a7d05b697eb4287cdc52e5ed | lintcode/Medium/184_Largest_Num.py | lintcode/Medium/184_Largest_Num.py | class Solution:
#@param num: A list of non negative integers
#@return: A string
def largestNumber(self, num):
# write your code here
def quickSort(arr):
if (len(arr) <= 1):
return arr
mid = str(arr[0])
smaller = filter(lambda a: str(a) + mi... | Add solution to lintcode question 184 | Add solution to lintcode question 184
| Python | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Add solution to lintcode question 184 | class Solution:
#@param num: A list of non negative integers
#@return: A string
def largestNumber(self, num):
# write your code here
def quickSort(arr):
if (len(arr) <= 1):
return arr
mid = str(arr[0])
smaller = filter(lambda a: str(a) + mi... | <commit_before><commit_msg>Add solution to lintcode question 184<commit_after> | class Solution:
#@param num: A list of non negative integers
#@return: A string
def largestNumber(self, num):
# write your code here
def quickSort(arr):
if (len(arr) <= 1):
return arr
mid = str(arr[0])
smaller = filter(lambda a: str(a) + mi... | Add solution to lintcode question 184class Solution:
#@param num: A list of non negative integers
#@return: A string
def largestNumber(self, num):
# write your code here
def quickSort(arr):
if (len(arr) <= 1):
return arr
mid = str(arr[0])
s... | <commit_before><commit_msg>Add solution to lintcode question 184<commit_after>class Solution:
#@param num: A list of non negative integers
#@return: A string
def largestNumber(self, num):
# write your code here
def quickSort(arr):
if (len(arr) <= 1):
return arr
... | |
1c695ee438c348140354a323a99bd5e186905140 | tempest/tests/services/compute/test_aggregates_client.py | tempest/tests/services/compute/test_aggregates_client.py | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | Add unit test for method list_aggregates | Add unit test for method list_aggregates
This patch adds unit test for aggregates_client.
Specific about method list_aggregates.
Change-Id: If66b8f8688432e6bd28c7ab6a4d0551675ef5114
| Python | apache-2.0 | pczerkas/tempest,alinbalutoiu/tempest,zsoltdudas/lis-tempest,varunarya10/tempest,JioCloud/tempest,cisco-openstack/tempest,vedujoshi/tempest,xbezdick/tempest,flyingfish007/tempest,pandeyop/tempest,pczerkas/tempest,manasi24/tempest,tonyli71/tempest,sebrandon1/tempest,roopali8/tempest,akash1808/tempest,varunarya10/tempest... | Add unit test for method list_aggregates
This patch adds unit test for aggregates_client.
Specific about method list_aggregates.
Change-Id: If66b8f8688432e6bd28c7ab6a4d0551675ef5114 | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | <commit_before><commit_msg>Add unit test for method list_aggregates
This patch adds unit test for aggregates_client.
Specific about method list_aggregates.
Change-Id: If66b8f8688432e6bd28c7ab6a4d0551675ef5114<commit_after> | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | Add unit test for method list_aggregates
This patch adds unit test for aggregates_client.
Specific about method list_aggregates.
Change-Id: If66b8f8688432e6bd28c7ab6a4d0551675ef5114# Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | <commit_before><commit_msg>Add unit test for method list_aggregates
This patch adds unit test for aggregates_client.
Specific about method list_aggregates.
Change-Id: If66b8f8688432e6bd28c7ab6a4d0551675ef5114<commit_after># Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License... | |
a4b0ecd0c1a3287d97fed6ae9418032698c1cfe0 | read_launch_plists.py | read_launch_plists.py | #!/usr/bin/env python
#
# This script reads system launch daemons and agents.
#
# Python 3.4 is required to read binary plists, or convert them first with,
# find /System/Library/Launch* -type f -exec sudo plutil -convert xml1 {} \;
import glob
import os
import plistlib
header ='filename,label,program,runatload,comme... | Add script for reading plists. | Add script for reading plists.
| Python | mit | drduh/OS-X-Yosemite-Security-and-Privacy-Guide,ScheerMT/OS-X-Yosemite-Security-and-Privacy-Guide,drduh/macOS-Security-and-Privacy-Guide,drduh/OS-X-Security-and-Privacy-Guide,DeadLion/macOS-Security-and-Privacy-Guide | Add script for reading plists. | #!/usr/bin/env python
#
# This script reads system launch daemons and agents.
#
# Python 3.4 is required to read binary plists, or convert them first with,
# find /System/Library/Launch* -type f -exec sudo plutil -convert xml1 {} \;
import glob
import os
import plistlib
header ='filename,label,program,runatload,comme... | <commit_before><commit_msg>Add script for reading plists.<commit_after> | #!/usr/bin/env python
#
# This script reads system launch daemons and agents.
#
# Python 3.4 is required to read binary plists, or convert them first with,
# find /System/Library/Launch* -type f -exec sudo plutil -convert xml1 {} \;
import glob
import os
import plistlib
header ='filename,label,program,runatload,comme... | Add script for reading plists.#!/usr/bin/env python
#
# This script reads system launch daemons and agents.
#
# Python 3.4 is required to read binary plists, or convert them first with,
# find /System/Library/Launch* -type f -exec sudo plutil -convert xml1 {} \;
import glob
import os
import plistlib
header ='filename... | <commit_before><commit_msg>Add script for reading plists.<commit_after>#!/usr/bin/env python
#
# This script reads system launch daemons and agents.
#
# Python 3.4 is required to read binary plists, or convert them first with,
# find /System/Library/Launch* -type f -exec sudo plutil -convert xml1 {} \;
import glob
imp... | |
8a43d4d603a3bbad0c2f368c6c1d327a6c09b793 | src/python/gcld3_test.py | src/python/gcld3_test.py | """Tests for gcld3."""
import gcld3
import unittest
class NnetLanguageIdentifierTest(unittest.TestCase):
def testLangIdentification(self):
detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)
sample = "This text is written in English."
result = detector.FindLanguage(text=sample... | Add a python unit test | Add a python unit test
| Python | apache-2.0 | google/cld3,google/cld3 | Add a python unit test | """Tests for gcld3."""
import gcld3
import unittest
class NnetLanguageIdentifierTest(unittest.TestCase):
def testLangIdentification(self):
detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)
sample = "This text is written in English."
result = detector.FindLanguage(text=sample... | <commit_before><commit_msg>Add a python unit test<commit_after> | """Tests for gcld3."""
import gcld3
import unittest
class NnetLanguageIdentifierTest(unittest.TestCase):
def testLangIdentification(self):
detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)
sample = "This text is written in English."
result = detector.FindLanguage(text=sample... | Add a python unit test"""Tests for gcld3."""
import gcld3
import unittest
class NnetLanguageIdentifierTest(unittest.TestCase):
def testLangIdentification(self):
detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)
sample = "This text is written in English."
result = detector.Fi... | <commit_before><commit_msg>Add a python unit test<commit_after>"""Tests for gcld3."""
import gcld3
import unittest
class NnetLanguageIdentifierTest(unittest.TestCase):
def testLangIdentification(self):
detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)
sample = "This text is writ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.