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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1786ebacb85b2ddce816fb21b80285d991761695 | poyo/_nodes.py | poyo/_nodes.py | # -*- coding: utf-8 -*-
class TreeElement(object):
"""Helper class to identify internal classes."""
def __init__(self, **kwargs):
pass
class ContainerMixin(object):
"""Mixin that can hold TreeElement instances.
Containers can be called to return a dict representation.
"""
def __init... | Implement classes to be used by the deserializer | Implement classes to be used by the deserializer
| Python | mit | hackebrot/poyo | Implement classes to be used by the deserializer | # -*- coding: utf-8 -*-
class TreeElement(object):
"""Helper class to identify internal classes."""
def __init__(self, **kwargs):
pass
class ContainerMixin(object):
"""Mixin that can hold TreeElement instances.
Containers can be called to return a dict representation.
"""
def __init... | <commit_before><commit_msg>Implement classes to be used by the deserializer<commit_after> | # -*- coding: utf-8 -*-
class TreeElement(object):
"""Helper class to identify internal classes."""
def __init__(self, **kwargs):
pass
class ContainerMixin(object):
"""Mixin that can hold TreeElement instances.
Containers can be called to return a dict representation.
"""
def __init... | Implement classes to be used by the deserializer# -*- coding: utf-8 -*-
class TreeElement(object):
"""Helper class to identify internal classes."""
def __init__(self, **kwargs):
pass
class ContainerMixin(object):
"""Mixin that can hold TreeElement instances.
Containers can be called to retu... | <commit_before><commit_msg>Implement classes to be used by the deserializer<commit_after># -*- coding: utf-8 -*-
class TreeElement(object):
"""Helper class to identify internal classes."""
def __init__(self, **kwargs):
pass
class ContainerMixin(object):
"""Mixin that can hold TreeElement instanc... | |
d187c51ccd9dc1676b6f16eddecee6dce752d668 | distarray/tests/test_client.py | distarray/tests/test_client.py | import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestClient(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def testCreateDAC(self):
'''Can we create a plain vanilla context?'''
dac = ... | import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestDistArrayContext(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def test_create_DAC(self):
'''Can we create a plain vanilla context?'''
... | Make class test-class name more specific | Make class test-class name more specific
... to make room for more client tests. | Python | bsd-3-clause | RaoUmer/distarray,enthought/distarray,RaoUmer/distarray,enthought/distarray | import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestClient(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def testCreateDAC(self):
'''Can we create a plain vanilla context?'''
dac = ... | import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestDistArrayContext(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def test_create_DAC(self):
'''Can we create a plain vanilla context?'''
... | <commit_before>import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestClient(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def testCreateDAC(self):
'''Can we create a plain vanilla context?'''... | import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestDistArrayContext(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def test_create_DAC(self):
'''Can we create a plain vanilla context?'''
... | import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestClient(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def testCreateDAC(self):
'''Can we create a plain vanilla context?'''
dac = ... | <commit_before>import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestClient(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def testCreateDAC(self):
'''Can we create a plain vanilla context?'''... |
28944376472130d53a05f7473e7213c917207cd4 | apartments/models.py | apartments/models.py | from sqlalchemy import create_engine, Column, DateTime, Float, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Listing(Base):
__tablename__ = 'listings'
id = Column(Integer, primary_key=True)
craigslist_id = Column(Integer, unique=True)
name =... | Add model representing a listing | Add model representing a listing
| Python | mit | rlucioni/craigbot,rlucioni/craigbot,rlucioni/apartments | Add model representing a listing | from sqlalchemy import create_engine, Column, DateTime, Float, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Listing(Base):
__tablename__ = 'listings'
id = Column(Integer, primary_key=True)
craigslist_id = Column(Integer, unique=True)
name =... | <commit_before><commit_msg>Add model representing a listing<commit_after> | from sqlalchemy import create_engine, Column, DateTime, Float, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Listing(Base):
__tablename__ = 'listings'
id = Column(Integer, primary_key=True)
craigslist_id = Column(Integer, unique=True)
name =... | Add model representing a listingfrom sqlalchemy import create_engine, Column, DateTime, Float, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Listing(Base):
__tablename__ = 'listings'
id = Column(Integer, primary_key=True)
craigslist_id = Column(I... | <commit_before><commit_msg>Add model representing a listing<commit_after>from sqlalchemy import create_engine, Column, DateTime, Float, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Listing(Base):
__tablename__ = 'listings'
id = Column(Integer, prima... | |
38cbc73f70a9ca896a29d7fa2e000388bbf40d88 | DilipadTopicModelling/experiment_get_results.py | DilipadTopicModelling/experiment_get_results.py | import logging
import os
import pandas as pd
from CPTCorpus import CPTCorpus
from CPT_Gibbs import GibbsSampler
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO)
# select experiment to get parameters from
nTopics = 100
start = 80
end = 199
alpha = 50.... | Add script to generate data from an experiment | Add script to generate data from an experiment
Added a script that generates csv files of estimations of theta,
phi_topic and phi_opinion and saves them to disk.
| Python | apache-2.0 | NLeSC/cptm,NLeSC/cptm | Add script to generate data from an experiment
Added a script that generates csv files of estimations of theta,
phi_topic and phi_opinion and saves them to disk. | import logging
import os
import pandas as pd
from CPTCorpus import CPTCorpus
from CPT_Gibbs import GibbsSampler
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO)
# select experiment to get parameters from
nTopics = 100
start = 80
end = 199
alpha = 50.... | <commit_before><commit_msg>Add script to generate data from an experiment
Added a script that generates csv files of estimations of theta,
phi_topic and phi_opinion and saves them to disk.<commit_after> | import logging
import os
import pandas as pd
from CPTCorpus import CPTCorpus
from CPT_Gibbs import GibbsSampler
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO)
# select experiment to get parameters from
nTopics = 100
start = 80
end = 199
alpha = 50.... | Add script to generate data from an experiment
Added a script that generates csv files of estimations of theta,
phi_topic and phi_opinion and saves them to disk.import logging
import os
import pandas as pd
from CPTCorpus import CPTCorpus
from CPT_Gibbs import GibbsSampler
logger = logging.getLogger(__name__)
logging... | <commit_before><commit_msg>Add script to generate data from an experiment
Added a script that generates csv files of estimations of theta,
phi_topic and phi_opinion and saves them to disk.<commit_after>import logging
import os
import pandas as pd
from CPTCorpus import CPTCorpus
from CPT_Gibbs import GibbsSampler
log... | |
656d94c0375f6a96cc3a9d4b3227d8f19afe3dea | control/systems/main.py | control/systems/main.py | import numpy as np
Kt = 1.41/89.0
Kv = 5840.0/3.0
G = 10.0
J = 4.0*(2.54**2.0)/2.0 # 4 kg on a 1 inch pully
R = 12.0/89.0
A = np.asarray([[0, 1],
[0, -(Kt*Kv)/((G**2)*J*R)]])
B = np.asarray([[0],
[Kt/(G*J*R)]])
| Add lemon drop elevator model | Add lemon drop elevator model
| Python | mit | WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox | Add lemon drop elevator model | import numpy as np
Kt = 1.41/89.0
Kv = 5840.0/3.0
G = 10.0
J = 4.0*(2.54**2.0)/2.0 # 4 kg on a 1 inch pully
R = 12.0/89.0
A = np.asarray([[0, 1],
[0, -(Kt*Kv)/((G**2)*J*R)]])
B = np.asarray([[0],
[Kt/(G*J*R)]])
| <commit_before><commit_msg>Add lemon drop elevator model<commit_after> | import numpy as np
Kt = 1.41/89.0
Kv = 5840.0/3.0
G = 10.0
J = 4.0*(2.54**2.0)/2.0 # 4 kg on a 1 inch pully
R = 12.0/89.0
A = np.asarray([[0, 1],
[0, -(Kt*Kv)/((G**2)*J*R)]])
B = np.asarray([[0],
[Kt/(G*J*R)]])
| Add lemon drop elevator modelimport numpy as np
Kt = 1.41/89.0
Kv = 5840.0/3.0
G = 10.0
J = 4.0*(2.54**2.0)/2.0 # 4 kg on a 1 inch pully
R = 12.0/89.0
A = np.asarray([[0, 1],
[0, -(Kt*Kv)/((G**2)*J*R)]])
B = np.asarray([[0],
[Kt/(G*J*R)]])
| <commit_before><commit_msg>Add lemon drop elevator model<commit_after>import numpy as np
Kt = 1.41/89.0
Kv = 5840.0/3.0
G = 10.0
J = 4.0*(2.54**2.0)/2.0 # 4 kg on a 1 inch pully
R = 12.0/89.0
A = np.asarray([[0, 1],
[0, -(Kt*Kv)/((G**2)*J*R)]])
B = np.asarray([[0],
[Kt/(G*J*R)]])
| |
3fd4244dbfd33bbf2fa369d81756e82b1cf1c467 | src/mmw/apps/modeling/migrations/0041_clear_nlcd2019_gwlfe_results.py | src/mmw/apps/modeling/migrations/0041_clear_nlcd2019_gwlfe_results.py | # Generated by Django 3.2.13 on 2022-10-17 13:47
from django.db import migrations
def clear_nlcd2019_gwlfe_results(apps, schema_editor):
"""
Clear the results for all scenarios belonging to GWLF-E projects made after
the release of 1.33.0, which had incorrectly aligned NLCD19 2019 on
2022-01-17:
... | Clear out unaligned NLCD19 GWLF-E results | Clear out unaligned NLCD19 GWLF-E results
Adds a migration that clears out all stored results for GWLF-E
projects created on or after 2022-01-17, which is when 1.33.0
was released with incorrectly aligned NLCD19 layers, which had
also been made the default. Thus, every project made after then
had slighly incorrect res... | Python | apache-2.0 | WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed | Clear out unaligned NLCD19 GWLF-E results
Adds a migration that clears out all stored results for GWLF-E
projects created on or after 2022-01-17, which is when 1.33.0
was released with incorrectly aligned NLCD19 layers, which had
also been made the default. Thus, every project made after then
had slighly incorrect res... | # Generated by Django 3.2.13 on 2022-10-17 13:47
from django.db import migrations
def clear_nlcd2019_gwlfe_results(apps, schema_editor):
"""
Clear the results for all scenarios belonging to GWLF-E projects made after
the release of 1.33.0, which had incorrectly aligned NLCD19 2019 on
2022-01-17:
... | <commit_before><commit_msg>Clear out unaligned NLCD19 GWLF-E results
Adds a migration that clears out all stored results for GWLF-E
projects created on or after 2022-01-17, which is when 1.33.0
was released with incorrectly aligned NLCD19 layers, which had
also been made the default. Thus, every project made after the... | # Generated by Django 3.2.13 on 2022-10-17 13:47
from django.db import migrations
def clear_nlcd2019_gwlfe_results(apps, schema_editor):
"""
Clear the results for all scenarios belonging to GWLF-E projects made after
the release of 1.33.0, which had incorrectly aligned NLCD19 2019 on
2022-01-17:
... | Clear out unaligned NLCD19 GWLF-E results
Adds a migration that clears out all stored results for GWLF-E
projects created on or after 2022-01-17, which is when 1.33.0
was released with incorrectly aligned NLCD19 layers, which had
also been made the default. Thus, every project made after then
had slighly incorrect res... | <commit_before><commit_msg>Clear out unaligned NLCD19 GWLF-E results
Adds a migration that clears out all stored results for GWLF-E
projects created on or after 2022-01-17, which is when 1.33.0
was released with incorrectly aligned NLCD19 layers, which had
also been made the default. Thus, every project made after the... | |
2cb7e09df0a8ec6fda707cccd1e9f8f00e15083c | migrations/versions/9ef49beab95_.py | migrations/versions/9ef49beab95_.py | """empty message
Revision ID: 9ef49beab95
Revises: 4b7b5a7ddc5c
Create Date: 2016-02-07 15:00:45.614000
"""
# revision identifiers, used by Alembic.
revision = '9ef49beab95'
down_revision = '4b7b5a7ddc5c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | Adjust the sorting of restaurants. | Adjust the sorting of restaurants.
| Python | mit | clementlefevre/hunger-game,clementlefevre/hunger-game,clementlefevre/hunger-game | Adjust the sorting of restaurants. | """empty message
Revision ID: 9ef49beab95
Revises: 4b7b5a7ddc5c
Create Date: 2016-02-07 15:00:45.614000
"""
# revision identifiers, used by Alembic.
revision = '9ef49beab95'
down_revision = '4b7b5a7ddc5c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | <commit_before><commit_msg>Adjust the sorting of restaurants.<commit_after> | """empty message
Revision ID: 9ef49beab95
Revises: 4b7b5a7ddc5c
Create Date: 2016-02-07 15:00:45.614000
"""
# revision identifiers, used by Alembic.
revision = '9ef49beab95'
down_revision = '4b7b5a7ddc5c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | Adjust the sorting of restaurants."""empty message
Revision ID: 9ef49beab95
Revises: 4b7b5a7ddc5c
Create Date: 2016-02-07 15:00:45.614000
"""
# revision identifiers, used by Alembic.
revision = '9ef49beab95'
down_revision = '4b7b5a7ddc5c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### comma... | <commit_before><commit_msg>Adjust the sorting of restaurants.<commit_after>"""empty message
Revision ID: 9ef49beab95
Revises: 4b7b5a7ddc5c
Create Date: 2016-02-07 15:00:45.614000
"""
# revision identifiers, used by Alembic.
revision = '9ef49beab95'
down_revision = '4b7b5a7ddc5c'
from alembic import op
import sqlalc... | |
ed20a93e917cfdddc5cd49cc6446b6e80fb4573d | makam/migrations/0007_auto_20150812_1615.py | makam/migrations/0007_auto_20150812_1615.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('makam', '0006_auto_20150727_1631'),
]
operations = [
migrations.AlterField(
m... | Migrate symbtr uuid field to django type | Migrate symbtr uuid field to django type
| Python | agpl-3.0 | MTG/dunya,MTG/dunya,MTG/dunya,MTG/dunya | Migrate symbtr uuid field to django type | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('makam', '0006_auto_20150727_1631'),
]
operations = [
migrations.AlterField(
m... | <commit_before><commit_msg>Migrate symbtr uuid field to django type<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('makam', '0006_auto_20150727_1631'),
]
operations = [
migrations.AlterField(
m... | Migrate symbtr uuid field to django type# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('makam', '0006_auto_20150727_1631'),
]
operations = [
... | <commit_before><commit_msg>Migrate symbtr uuid field to django type<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('makam', '0006_auto_201507... | |
52c50ca6e4c5d2ee75300617c5da118fb1136e76 | mplstyles/plots.py | mplstyles/plots.py | from matplotlib import cm
import matplotlib.pyplot as plt
from mplstyles import cmap as colormap
import numpy as np
def contour_image(x,y,Z,cmap=None,vmax=None,vmin=None,interpolation='nearest',contour_labelsize=9,contour_opts={},imshow_opts={},clegendlabels=[],label=False):
ax = plt.gca()
x_delta = float((x[-1]-x... | Add custom plot style contour_image. | Add custom plot style contour_image.
| Python | mit | matthewwardrop/python-mplstyles,matthewwardrop/python-mplkit,matthewwardrop/python-mplstyles,matthewwardrop/python-mplkit | Add custom plot style contour_image. | from matplotlib import cm
import matplotlib.pyplot as plt
from mplstyles import cmap as colormap
import numpy as np
def contour_image(x,y,Z,cmap=None,vmax=None,vmin=None,interpolation='nearest',contour_labelsize=9,contour_opts={},imshow_opts={},clegendlabels=[],label=False):
ax = plt.gca()
x_delta = float((x[-1]-x... | <commit_before><commit_msg>Add custom plot style contour_image.<commit_after> | from matplotlib import cm
import matplotlib.pyplot as plt
from mplstyles import cmap as colormap
import numpy as np
def contour_image(x,y,Z,cmap=None,vmax=None,vmin=None,interpolation='nearest',contour_labelsize=9,contour_opts={},imshow_opts={},clegendlabels=[],label=False):
ax = plt.gca()
x_delta = float((x[-1]-x... | Add custom plot style contour_image.from matplotlib import cm
import matplotlib.pyplot as plt
from mplstyles import cmap as colormap
import numpy as np
def contour_image(x,y,Z,cmap=None,vmax=None,vmin=None,interpolation='nearest',contour_labelsize=9,contour_opts={},imshow_opts={},clegendlabels=[],label=False):
ax = p... | <commit_before><commit_msg>Add custom plot style contour_image.<commit_after>from matplotlib import cm
import matplotlib.pyplot as plt
from mplstyles import cmap as colormap
import numpy as np
def contour_image(x,y,Z,cmap=None,vmax=None,vmin=None,interpolation='nearest',contour_labelsize=9,contour_opts={},imshow_opts=... | |
45b789010409e4e2e2afc88cb776c8b70e7768ec | dakota/tests/test_dakota_base.py | dakota/tests/test_dakota_base.py | #!/usr/bin/env python
#
# Tests for dakota.dakota_base module.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper (mark.piper@colorado.edu)
import os
import filecmp
from nose.tools import *
from dakota.dakota_base import DakotaBase
# Fixtures -------------------------------------------------------------
def setup_mo... | Add unit test for DakotaBase | Add unit test for DakotaBase
Still need to determine how to test its non-abstract methods.
| Python | mit | csdms/dakota,csdms/dakota | Add unit test for DakotaBase
Still need to determine how to test its non-abstract methods. | #!/usr/bin/env python
#
# Tests for dakota.dakota_base module.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper (mark.piper@colorado.edu)
import os
import filecmp
from nose.tools import *
from dakota.dakota_base import DakotaBase
# Fixtures -------------------------------------------------------------
def setup_mo... | <commit_before><commit_msg>Add unit test for DakotaBase
Still need to determine how to test its non-abstract methods.<commit_after> | #!/usr/bin/env python
#
# Tests for dakota.dakota_base module.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper (mark.piper@colorado.edu)
import os
import filecmp
from nose.tools import *
from dakota.dakota_base import DakotaBase
# Fixtures -------------------------------------------------------------
def setup_mo... | Add unit test for DakotaBase
Still need to determine how to test its non-abstract methods.#!/usr/bin/env python
#
# Tests for dakota.dakota_base module.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper (mark.piper@colorado.edu)
import os
import filecmp
from nose.tools import *
from dakota.dakota_base import DakotaBa... | <commit_before><commit_msg>Add unit test for DakotaBase
Still need to determine how to test its non-abstract methods.<commit_after>#!/usr/bin/env python
#
# Tests for dakota.dakota_base module.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper (mark.piper@colorado.edu)
import os
import filecmp
from nose.tools import ... | |
0ca7d4a20c8a65e45ddb7c61ca72c0e6c464a80e | migrations/versions/0296_template_redacted_fix.py | migrations/versions/0296_template_redacted_fix.py | """
Revision ID: 0296_template_redacted_fix
Revises: 0295_api_key_constraint
Create Date: 2019-06-07 17:02:14.350064
"""
from alembic import op
revision = '0296_template_redacted_fix'
down_revision = '0295_api_key_constraint'
def upgrade():
op.execute("""
INSERT INTO template_redacted (template_id, re... | Create template_redacted entry for templates created by migration | Create template_redacted entry for templates created by migration
So that we can edit those templates
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Create template_redacted entry for templates created by migration
So that we can edit those templates | """
Revision ID: 0296_template_redacted_fix
Revises: 0295_api_key_constraint
Create Date: 2019-06-07 17:02:14.350064
"""
from alembic import op
revision = '0296_template_redacted_fix'
down_revision = '0295_api_key_constraint'
def upgrade():
op.execute("""
INSERT INTO template_redacted (template_id, re... | <commit_before><commit_msg>Create template_redacted entry for templates created by migration
So that we can edit those templates<commit_after> | """
Revision ID: 0296_template_redacted_fix
Revises: 0295_api_key_constraint
Create Date: 2019-06-07 17:02:14.350064
"""
from alembic import op
revision = '0296_template_redacted_fix'
down_revision = '0295_api_key_constraint'
def upgrade():
op.execute("""
INSERT INTO template_redacted (template_id, re... | Create template_redacted entry for templates created by migration
So that we can edit those templates"""
Revision ID: 0296_template_redacted_fix
Revises: 0295_api_key_constraint
Create Date: 2019-06-07 17:02:14.350064
"""
from alembic import op
revision = '0296_template_redacted_fix'
down_revision = '0295_api_key_... | <commit_before><commit_msg>Create template_redacted entry for templates created by migration
So that we can edit those templates<commit_after>"""
Revision ID: 0296_template_redacted_fix
Revises: 0295_api_key_constraint
Create Date: 2019-06-07 17:02:14.350064
"""
from alembic import op
revision = '0296_template_red... | |
2611476df6f362cd59e4aad38a243fc8f6cbf8a8 | devincachu/purger.py | devincachu/purger.py | # -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all()
for p in... | # -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all()
for p in... | Purge da página de palestra quando salva palestrante | Purge da página de palestra quando salva palestrante
| Python | bsd-2-clause | devincachu/devincachu-2013,devincachu/devincachu-2013,devincachu/devincachu-2014,devincachu/devincachu-2014,devincachu/devincachu-2014,devincachu/devincachu-2013,devincachu/devincachu-2013 | # -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all()
for p in... | # -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all()
for p in... | <commit_before># -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all... | # -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all()
for p in... | # -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all()
for p in... | <commit_before># -*- coding: utf-8 -*-
import roan
from django.contrib.flatpages import models
from palestras import models as pmodels
def connect():
flatpages = models.FlatPage.objects.all()
for f in flatpages:
roan.purge(f.url).on_save(models.FlatPage)
palestras = pmodels.Palestra.objects.all... |
cdd1f3410b8ae304485f7992ac6048e1277cffe1 | parsedatetime/pdt_locales/__init__.py | parsedatetime/pdt_locales/__init__.py | # -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
try:
import PyICU as pyicu
except:
pyicu = None
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_US import *
from .es im... | # -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
import os
try:
import PyICU as pyicu
except:
pyicu = None
import yaml
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_... | Add local locale from file | Add local locale from file
| Python | apache-2.0 | phoebebright/parsedatetime,bear/parsedatetime,idpaterson/parsedatetime | # -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
try:
import PyICU as pyicu
except:
pyicu = None
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_US import *
from .es im... | # -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
import os
try:
import PyICU as pyicu
except:
pyicu = None
import yaml
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_... | <commit_before># -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
try:
import PyICU as pyicu
except:
pyicu = None
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_US impor... | # -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
import os
try:
import PyICU as pyicu
except:
pyicu = None
import yaml
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_... | # -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
try:
import PyICU as pyicu
except:
pyicu = None
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_US import *
from .es im... | <commit_before># -*- encoding: utf-8 -*-
"""
pdt_locales
All of the included locale classes shipped with pdt.
"""
try:
import PyICU as pyicu
except:
pyicu = None
def lcase(x):
return x.lower()
from .base import pdtLocale_base, pdtLocale_icu
from .de_DE import *
from .en_AU import *
from .en_US impor... |
b3889f8ff6d66963d4253d6796c3bb20dc9adbb7 | scripts/my_Param.py | scripts/my_Param.py | #=================================================
# Observation
#-------------------------------------------------
sstObsPath = '/clim_obs/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/130122_HadISST_sst.nc'
tauxObsPath = '/clim_obs/obs/atm/mo/tauu/ERAINT/tauu_ERAINT_198901-200911.nc'
sstNameObs = 'sst'
tauxNameObs = 'tauu... | Add external driver and parameter file | Add external driver and parameter file
| Python | bsd-3-clause | eguil/ENSO_metrics,eguil/ENSO_metrics | Add external driver and parameter file | #=================================================
# Observation
#-------------------------------------------------
sstObsPath = '/clim_obs/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/130122_HadISST_sst.nc'
tauxObsPath = '/clim_obs/obs/atm/mo/tauu/ERAINT/tauu_ERAINT_198901-200911.nc'
sstNameObs = 'sst'
tauxNameObs = 'tauu... | <commit_before><commit_msg>Add external driver and parameter file<commit_after> | #=================================================
# Observation
#-------------------------------------------------
sstObsPath = '/clim_obs/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/130122_HadISST_sst.nc'
tauxObsPath = '/clim_obs/obs/atm/mo/tauu/ERAINT/tauu_ERAINT_198901-200911.nc'
sstNameObs = 'sst'
tauxNameObs = 'tauu... | Add external driver and parameter file#=================================================
# Observation
#-------------------------------------------------
sstObsPath = '/clim_obs/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/130122_HadISST_sst.nc'
tauxObsPath = '/clim_obs/obs/atm/mo/tauu/ERAINT/tauu_ERAINT_198901-200911.nc'
... | <commit_before><commit_msg>Add external driver and parameter file<commit_after>#=================================================
# Observation
#-------------------------------------------------
sstObsPath = '/clim_obs/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/130122_HadISST_sst.nc'
tauxObsPath = '/clim_obs/obs/atm/mo/ta... | |
4ff6b846311a0f7bd6cfcf2e661a7c53061406fe | glaciercmd/command_vault_info.py | glaciercmd/command_vault_info.py | import boto
class CommandVaultInfo(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret'))
try:
vault = glacier_connection.get_vault(args[2])
pr... | Add command to print vault info | Add command to print vault info
| Python | mit | carsonmcdonald/glacier-cmd | Add command to print vault info | import boto
class CommandVaultInfo(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret'))
try:
vault = glacier_connection.get_vault(args[2])
pr... | <commit_before><commit_msg>Add command to print vault info<commit_after> | import boto
class CommandVaultInfo(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret'))
try:
vault = glacier_connection.get_vault(args[2])
pr... | Add command to print vault infoimport boto
class CommandVaultInfo(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret'))
try:
vault = glacier_connect... | <commit_before><commit_msg>Add command to print vault info<commit_after>import boto
class CommandVaultInfo(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret')... | |
582ebd448508625ed2c9f362aaafc3fc46e60df0 | functest/tests/unit/features/test_security_scan.py | functest/tests/unit/features/test_security_scan.py | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for security_scan | Add unit tests for security_scan
Change-Id: Idda799c01408aa9afd09d573e23f42e011f3fafb
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com>
| Python | apache-2.0 | opnfv/functest,opnfv/functest,mywulin/functest,mywulin/functest | Add unit tests for security_scan
Change-Id: Idda799c01408aa9afd09d573e23f42e011f3fafb
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | <commit_before><commit_msg>Add unit tests for security_scan
Change-Id: Idda799c01408aa9afd09d573e23f42e011f3fafb
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com><commit_after> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for security_scan
Change-Id: Idda799c01408aa9afd09d573e23f42e011f3fafb
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made availa... | <commit_before><commit_msg>Add unit tests for security_scan
Change-Id: Idda799c01408aa9afd09d573e23f42e011f3fafb
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com><commit_after>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the... | |
2ca07d4a8893196bbf304bcdac16688505e6123a | shopify/webhooks/management/commands/webhookregister.py | shopify/webhooks/management/commands/webhookregister.py | from django.core.management.base import NoArgsCommand
from webhooks.models import Webhook
class Command(NoArgsCommand):
help = 'Register all created Shopify webhooks'
def handle_noargs(self, **options):
Webhook.objects.register()
| Add a management command to register webhooks | Add a management command to register webhooks
| Python | bsd-3-clause | CorbanU/corban-shopify,CorbanU/corban-shopify | Add a management command to register webhooks | from django.core.management.base import NoArgsCommand
from webhooks.models import Webhook
class Command(NoArgsCommand):
help = 'Register all created Shopify webhooks'
def handle_noargs(self, **options):
Webhook.objects.register()
| <commit_before><commit_msg>Add a management command to register webhooks<commit_after> | from django.core.management.base import NoArgsCommand
from webhooks.models import Webhook
class Command(NoArgsCommand):
help = 'Register all created Shopify webhooks'
def handle_noargs(self, **options):
Webhook.objects.register()
| Add a management command to register webhooksfrom django.core.management.base import NoArgsCommand
from webhooks.models import Webhook
class Command(NoArgsCommand):
help = 'Register all created Shopify webhooks'
def handle_noargs(self, **options):
Webhook.objects.register()
| <commit_before><commit_msg>Add a management command to register webhooks<commit_after>from django.core.management.base import NoArgsCommand
from webhooks.models import Webhook
class Command(NoArgsCommand):
help = 'Register all created Shopify webhooks'
def handle_noargs(self, **options):
Webhook.obj... | |
ee859881af0633d4d2d88015c907cfa856516dbe | lintcode/000-000-Two-Sum-II/TwoSumII.py | lintcode/000-000-Two-Sum-II/TwoSumII.py | class Solution:
# @param nums, an array of integer
# @param target, an integer
# @return an integer
def twoSum2(self, nums, target):
# Write your code here
nums.sort()
i, j = 0, len(nums) - 1
res = 0
while i < j:
if nums[i] + nums[j] <= target:
... | Create TwoSum II for Lint | Create TwoSum II for Lint
| Python | mit | Chasego/codi,Chasego/codi,cc13ny/Allin,cc13ny/algo,Chasego/cod,cc13ny/algo,Chasego/codirit,Chasego/cod,cc13ny/Allin,Chasego/codirit,Chasego/codi,Chasego/codirit,cc13ny/Allin,Chasego/codi,Chasego/codi,Chasego/codirit,cc13ny/algo,Chasego/cod,cc13ny/Allin,cc13ny/algo,Chasego/codirit,cc13ny/algo,cc13ny/Allin,Chasego/cod,Ch... | Create TwoSum II for Lint | class Solution:
# @param nums, an array of integer
# @param target, an integer
# @return an integer
def twoSum2(self, nums, target):
# Write your code here
nums.sort()
i, j = 0, len(nums) - 1
res = 0
while i < j:
if nums[i] + nums[j] <= target:
... | <commit_before><commit_msg>Create TwoSum II for Lint<commit_after> | class Solution:
# @param nums, an array of integer
# @param target, an integer
# @return an integer
def twoSum2(self, nums, target):
# Write your code here
nums.sort()
i, j = 0, len(nums) - 1
res = 0
while i < j:
if nums[i] + nums[j] <= target:
... | Create TwoSum II for Lintclass Solution:
# @param nums, an array of integer
# @param target, an integer
# @return an integer
def twoSum2(self, nums, target):
# Write your code here
nums.sort()
i, j = 0, len(nums) - 1
res = 0
while i < j:
if nums[i] + n... | <commit_before><commit_msg>Create TwoSum II for Lint<commit_after>class Solution:
# @param nums, an array of integer
# @param target, an integer
# @return an integer
def twoSum2(self, nums, target):
# Write your code here
nums.sort()
i, j = 0, len(nums) - 1
res = 0
... | |
52e8a378d8a31989c9d93ef83eabbe6df339f915 | src/waldur_mastermind/marketplace/migrations/0083_offering_component.py | src/waldur_mastermind/marketplace/migrations/0083_offering_component.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from waldur_mastermind.marketplace_openstack import STORAGE_TYPE, RAM_TYPE, CORES_TYPE, PACKAGE_TYPE
def create_category_components(apps, schema_editor):
CATEGORY_TITLE = 'Private clouds'
Category = apps.get_mo... | Add data migration to add category components for VPC. | Add data migration to add category components for VPC.
| Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur | Add data migration to add category components for VPC. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from waldur_mastermind.marketplace_openstack import STORAGE_TYPE, RAM_TYPE, CORES_TYPE, PACKAGE_TYPE
def create_category_components(apps, schema_editor):
CATEGORY_TITLE = 'Private clouds'
Category = apps.get_mo... | <commit_before><commit_msg>Add data migration to add category components for VPC.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from waldur_mastermind.marketplace_openstack import STORAGE_TYPE, RAM_TYPE, CORES_TYPE, PACKAGE_TYPE
def create_category_components(apps, schema_editor):
CATEGORY_TITLE = 'Private clouds'
Category = apps.get_mo... | Add data migration to add category components for VPC.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from waldur_mastermind.marketplace_openstack import STORAGE_TYPE, RAM_TYPE, CORES_TYPE, PACKAGE_TYPE
def create_category_components(apps, schema_editor):
CATEGOR... | <commit_before><commit_msg>Add data migration to add category components for VPC.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from waldur_mastermind.marketplace_openstack import STORAGE_TYPE, RAM_TYPE, CORES_TYPE, PACKAGE_TYPE
def create_category_com... | |
1c81643eaed91b4171a4e68699d930e5ef3688db | senlin/tests/tempest/api/policies/test_policy_validate_negative.py | senlin/tests/tempest/api/policies/test_policy_validate_negative.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add negative API tests for policy validation | Add negative API tests for policy validation
Add negative API tests for policy validation
Change-Id: I0363bfd2165893b713059dc9db5ab9e632522091
| Python | apache-2.0 | openstack/senlin,openstack/senlin,stackforge/senlin,stackforge/senlin,openstack/senlin | Add negative API tests for policy validation
Add negative API tests for policy validation
Change-Id: I0363bfd2165893b713059dc9db5ab9e632522091 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before><commit_msg>Add negative API tests for policy validation
Add negative API tests for policy validation
Change-Id: I0363bfd2165893b713059dc9db5ab9e632522091<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add negative API tests for policy validation
Add negative API tests for policy validation
Change-Id: I0363bfd2165893b713059dc9db5ab9e632522091# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#... | <commit_before><commit_msg>Add negative API tests for policy validation
Add negative API tests for policy validation
Change-Id: I0363bfd2165893b713059dc9db5ab9e632522091<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | |
f040351dd3397ba7297b69b2468b2b37589c0d8f | games/management/commands/get_installer_urls.py | games/management/commands/get_installer_urls.py | import json
from collections import defaultdict
from django.core.management.base import BaseCommand
from common.util import load_yaml
from games import models
class Command(BaseCommand):
def handle(self, *args, **kwargs):
self.stdout.write("Installer stats\n")
installers = models.Installer.object... | Add task to get stats about files | Add task to get stats about files
| Python | agpl-3.0 | lutris/website,lutris/website,lutris/website,lutris/website | Add task to get stats about files | import json
from collections import defaultdict
from django.core.management.base import BaseCommand
from common.util import load_yaml
from games import models
class Command(BaseCommand):
def handle(self, *args, **kwargs):
self.stdout.write("Installer stats\n")
installers = models.Installer.object... | <commit_before><commit_msg>Add task to get stats about files<commit_after> | import json
from collections import defaultdict
from django.core.management.base import BaseCommand
from common.util import load_yaml
from games import models
class Command(BaseCommand):
def handle(self, *args, **kwargs):
self.stdout.write("Installer stats\n")
installers = models.Installer.object... | Add task to get stats about filesimport json
from collections import defaultdict
from django.core.management.base import BaseCommand
from common.util import load_yaml
from games import models
class Command(BaseCommand):
def handle(self, *args, **kwargs):
self.stdout.write("Installer stats\n")
ins... | <commit_before><commit_msg>Add task to get stats about files<commit_after>import json
from collections import defaultdict
from django.core.management.base import BaseCommand
from common.util import load_yaml
from games import models
class Command(BaseCommand):
def handle(self, *args, **kwargs):
self.stdo... | |
463502a251111199da130e508929a35b2f126f4e | bookmarks/models.py | bookmarks/models.py | from sqlalchemy import Column, Integer, String
from bookmarks.database import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String(50), unique=True, nullable=False)
name = Column(String(120))
email = Column(String(256), unique=True, nullabl... | Add columns to User model | Add columns to User model
| Python | apache-2.0 | byanofsky/bookmarks,byanofsky/bookmarks,byanofsky/bookmarks | Add columns to User model | from sqlalchemy import Column, Integer, String
from bookmarks.database import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String(50), unique=True, nullable=False)
name = Column(String(120))
email = Column(String(256), unique=True, nullabl... | <commit_before><commit_msg>Add columns to User model<commit_after> | from sqlalchemy import Column, Integer, String
from bookmarks.database import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String(50), unique=True, nullable=False)
name = Column(String(120))
email = Column(String(256), unique=True, nullabl... | Add columns to User modelfrom sqlalchemy import Column, Integer, String
from bookmarks.database import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String(50), unique=True, nullable=False)
name = Column(String(120))
email = Column(String(2... | <commit_before><commit_msg>Add columns to User model<commit_after>from sqlalchemy import Column, Integer, String
from bookmarks.database import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String(50), unique=True, nullable=False)
name = Column... | |
bb11ab050fe9a7bb0ffe83419eb0e87390f7deac | hopsutil/tensorboard.py | hopsutil/tensorboard.py | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import hdfs
def register(logdir):
#find free p... | Add registration method for TB | Add registration method for TB
| Python | apache-2.0 | hopshadoop/hops-util-py,hopshadoop/hops-util-py | Add registration method for TB | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import hdfs
def register(logdir):
#find free p... | <commit_before><commit_msg>Add registration method for TB<commit_after> | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import hdfs
def register(logdir):
#find free p... | Add registration method for TB"""
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import hdfs
def regis... | <commit_before><commit_msg>Add registration method for TB<commit_after>"""
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import su... | |
24788b106b9cdd70e7240dc3eccac82fba290c85 | tests/util/test_yaml.py | tests/util/test_yaml.py | """Test Home Assistant yaml loader."""
import io
import unittest
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.StringIO(conf) as f:... | """Test Home Assistant yaml loader."""
import io
import unittest
import os
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.StringIO(c... | Add test for yaml enviroment | Add test for yaml enviroment
| Python | mit | lukas-hetzenecker/home-assistant,LinuxChristian/home-assistant,molobrakos/home-assistant,sffjunkie/home-assistant,titilambert/home-assistant,ewandor/home-assistant,emilhetty/home-assistant,mikaelboman/home-assistant,nkgilley/home-assistant,robbiet480/home-assistant,jawilson/home-assistant,molobrakos/home-assistant,devd... | """Test Home Assistant yaml loader."""
import io
import unittest
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.StringIO(conf) as f:... | """Test Home Assistant yaml loader."""
import io
import unittest
import os
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.StringIO(c... | <commit_before>"""Test Home Assistant yaml loader."""
import io
import unittest
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.Strin... | """Test Home Assistant yaml loader."""
import io
import unittest
import os
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.StringIO(c... | """Test Home Assistant yaml loader."""
import io
import unittest
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.StringIO(conf) as f:... | <commit_before>"""Test Home Assistant yaml loader."""
import io
import unittest
from homeassistant.util import yaml
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
"""Test simple list."""
conf = "config:\n - simple\n - list"
with io.Strin... |
96f224a6b80720a88fefc8530aea113f975ef110 | new_layout.py | new_layout.py | import sublime, sublime_plugin
class NewLayoutCommand(sublime_plugin.TextCommand):
def run(self, edit, **args):
self.view.window().run_command("set_layout", args)
self.view.window().run_command("focus_group", { "group": 0 })
self.view.window().run_command("move_to_group", { "group": 1 } )
| Add new layout window command | Add new layout window command
| Python | mit | shaochuan/sublime-plugins | Add new layout window command | import sublime, sublime_plugin
class NewLayoutCommand(sublime_plugin.TextCommand):
def run(self, edit, **args):
self.view.window().run_command("set_layout", args)
self.view.window().run_command("focus_group", { "group": 0 })
self.view.window().run_command("move_to_group", { "group": 1 } )
| <commit_before><commit_msg>Add new layout window command<commit_after> | import sublime, sublime_plugin
class NewLayoutCommand(sublime_plugin.TextCommand):
def run(self, edit, **args):
self.view.window().run_command("set_layout", args)
self.view.window().run_command("focus_group", { "group": 0 })
self.view.window().run_command("move_to_group", { "group": 1 } )
| Add new layout window commandimport sublime, sublime_plugin
class NewLayoutCommand(sublime_plugin.TextCommand):
def run(self, edit, **args):
self.view.window().run_command("set_layout", args)
self.view.window().run_command("focus_group", { "group": 0 })
self.view.window().run_command("move_to_group", { "... | <commit_before><commit_msg>Add new layout window command<commit_after>import sublime, sublime_plugin
class NewLayoutCommand(sublime_plugin.TextCommand):
def run(self, edit, **args):
self.view.window().run_command("set_layout", args)
self.view.window().run_command("focus_group", { "group": 0 })
self.view.... | |
325465d18e963400b427f259547d4292a47368c9 | oneflow/settings/snippets/common_development.py | oneflow/settings/snippets/common_development.py | #
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000/, everything i... | #
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000/, everything i... | Use Django nose for tests. | Use Django nose for tests. | Python | agpl-3.0 | 1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow | #
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000/, everything i... | #
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000/, everything i... | <commit_before>#
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000... | #
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000/, everything i... | #
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000/, everything i... | <commit_before>#
# Include your development machines hostnames here.
#
# NOTE: this is not strictly needed, as Django doesn't enforce
# the check if DEBUG==True. But Just in case you wanted to disable
# it temporarily, this could be a good thing to have your hostname
# here.
#
# If you connect via http://localhost:8000... |
8eeb4c2db613c1354c38696ac6691cf79f66a383 | locations/spiders/brookdale.py | locations/spiders/brookdale.py | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
URL = 'https://www.brookdale.com/bin/brookdale/community-search?care_type_category=resident&loc=&finrpt=&state='
US_STATES = (
"AL", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"ID", "IL", "IN", "IA", "KS"... | Add spider for Brookdale Senior Living | Add spider for Brookdale Senior Living
| Python | mit | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | Add spider for Brookdale Senior Living | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
URL = 'https://www.brookdale.com/bin/brookdale/community-search?care_type_category=resident&loc=&finrpt=&state='
US_STATES = (
"AL", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"ID", "IL", "IN", "IA", "KS"... | <commit_before><commit_msg>Add spider for Brookdale Senior Living<commit_after> | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
URL = 'https://www.brookdale.com/bin/brookdale/community-search?care_type_category=resident&loc=&finrpt=&state='
US_STATES = (
"AL", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"ID", "IL", "IN", "IA", "KS"... | Add spider for Brookdale Senior Living# -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
URL = 'https://www.brookdale.com/bin/brookdale/community-search?care_type_category=resident&loc=&finrpt=&state='
US_STATES = (
"AL", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA... | <commit_before><commit_msg>Add spider for Brookdale Senior Living<commit_after># -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
URL = 'https://www.brookdale.com/bin/brookdale/community-search?care_type_category=resident&loc=&finrpt=&state='
US_STATES = (
"AL", "AZ"... | |
0403d6f78189be3f3b22f068dad1db0c53687ef7 | ptch/__init__.py | ptch/__init__.py | # -*- coding: utf-8 -*-
"""
PTCH files are a container format for Blizzard patch files.
They begin with a 72 byte header containing some metadata, immediately
followed by a RLE-packed BSDIFF40.
The original BSDIFF40 format is compressed with bzip2 instead of RLE.
"""
#from hashlib import md5
from struct import unpack
... | Add ptch module and base PatchFile class. This class can unpack RLE-compressed patchfiles. | ptch: Add ptch module and base PatchFile class. This class can unpack RLE-compressed patchfiles.
| Python | cc0-1.0 | jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow | ptch: Add ptch module and base PatchFile class. This class can unpack RLE-compressed patchfiles. | # -*- coding: utf-8 -*-
"""
PTCH files are a container format for Blizzard patch files.
They begin with a 72 byte header containing some metadata, immediately
followed by a RLE-packed BSDIFF40.
The original BSDIFF40 format is compressed with bzip2 instead of RLE.
"""
#from hashlib import md5
from struct import unpack
... | <commit_before><commit_msg>ptch: Add ptch module and base PatchFile class. This class can unpack RLE-compressed patchfiles.<commit_after> | # -*- coding: utf-8 -*-
"""
PTCH files are a container format for Blizzard patch files.
They begin with a 72 byte header containing some metadata, immediately
followed by a RLE-packed BSDIFF40.
The original BSDIFF40 format is compressed with bzip2 instead of RLE.
"""
#from hashlib import md5
from struct import unpack
... | ptch: Add ptch module and base PatchFile class. This class can unpack RLE-compressed patchfiles.# -*- coding: utf-8 -*-
"""
PTCH files are a container format for Blizzard patch files.
They begin with a 72 byte header containing some metadata, immediately
followed by a RLE-packed BSDIFF40.
The original BSDIFF40 format i... | <commit_before><commit_msg>ptch: Add ptch module and base PatchFile class. This class can unpack RLE-compressed patchfiles.<commit_after># -*- coding: utf-8 -*-
"""
PTCH files are a container format for Blizzard patch files.
They begin with a 72 byte header containing some metadata, immediately
followed by a RLE-packed... | |
841e8fe236eab35b803cb9d8bec201306ce4642e | util/repeat_rum_file.py | util/repeat_rum_file.py | from rum_mapping_stats import aln_iter
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--times', type=int)
parser.add_argument('--max-seq', type=int)
parser.add_argument('rum_file', type=file)
args = parser.parse_args()
alns = list(aln_iter(args.rum_file))
for t in range(args.tim... | Add script to generate big RUM_* files | Add script to generate big RUM_* files
| Python | mit | itmat/rum,itmat/rum,itmat/rum | Add script to generate big RUM_* files | from rum_mapping_stats import aln_iter
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--times', type=int)
parser.add_argument('--max-seq', type=int)
parser.add_argument('rum_file', type=file)
args = parser.parse_args()
alns = list(aln_iter(args.rum_file))
for t in range(args.tim... | <commit_before><commit_msg>Add script to generate big RUM_* files<commit_after> | from rum_mapping_stats import aln_iter
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--times', type=int)
parser.add_argument('--max-seq', type=int)
parser.add_argument('rum_file', type=file)
args = parser.parse_args()
alns = list(aln_iter(args.rum_file))
for t in range(args.tim... | Add script to generate big RUM_* filesfrom rum_mapping_stats import aln_iter
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--times', type=int)
parser.add_argument('--max-seq', type=int)
parser.add_argument('rum_file', type=file)
args = parser.parse_args()
alns = list(aln_iter(ar... | <commit_before><commit_msg>Add script to generate big RUM_* files<commit_after>from rum_mapping_stats import aln_iter
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--times', type=int)
parser.add_argument('--max-seq', type=int)
parser.add_argument('rum_file', type=file)
args = par... | |
7060b82030d719cdcbdcecdb5eb7d34b405aa805 | platforms/migrations/0003_auto_20150718_0050.py | platforms/migrations/0003_auto_20150718_0050.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('platforms', '0002_auto_20150718_0042'),
]
operations = [
migrations.AlterField(
model_na... | Make the migration for previous commit | Make the migration for previous commit
| Python | agpl-3.0 | Turupawn/website,lutris/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,lutris/website,Turupawn/website | Make the migration for previous commit | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('platforms', '0002_auto_20150718_0042'),
]
operations = [
migrations.AlterField(
model_na... | <commit_before><commit_msg>Make the migration for previous commit<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('platforms', '0002_auto_20150718_0042'),
]
operations = [
migrations.AlterField(
model_na... | Make the migration for previous commit# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('platforms', '0002_auto_20150718_0042'),
]
operations = [
migra... | <commit_before><commit_msg>Make the migration for previous commit<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('platforms', '0002_auto_20150718_0042')... | |
49b1de4a68133e618723f96f2dc922b311bdd982 | util/encode_raw.py | util/encode_raw.py | #!/usr/bin/env python
# Converts raw RGB565 video to MP4/AVI
from sys import argv, exit
from array import array
from subprocess import call
buf=None
TMP_FILE = "/tmp/video.raw"
if (len(argv) != 4):
print("Usage: encode_raw input.raw output.avi fps")
exit(1)
with open(argv[1], "rb") as f:
buf = array("H"... | Add Script to encode raw RGB565 | Add Script to encode raw RGB565
* Encodes RGB565 raw stream to MP4/AVI
| Python | mit | SmartArduino/openmv,SmartArduino/openmv,iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,tianzhihen/openmv,kwagyeman/openmv,SmartArduino/openmv,openmv/openmv,openmv/openmv,tianzhihen/openmv,iabdalkader/openmv,kwagyeman/openmv,tianzhihen/openmv,iabdalkader/openmv,iabdalkader/openmv,SmartArduino/openmv,openmv/openmv,... | Add Script to encode raw RGB565
* Encodes RGB565 raw stream to MP4/AVI | #!/usr/bin/env python
# Converts raw RGB565 video to MP4/AVI
from sys import argv, exit
from array import array
from subprocess import call
buf=None
TMP_FILE = "/tmp/video.raw"
if (len(argv) != 4):
print("Usage: encode_raw input.raw output.avi fps")
exit(1)
with open(argv[1], "rb") as f:
buf = array("H"... | <commit_before><commit_msg>Add Script to encode raw RGB565
* Encodes RGB565 raw stream to MP4/AVI<commit_after> | #!/usr/bin/env python
# Converts raw RGB565 video to MP4/AVI
from sys import argv, exit
from array import array
from subprocess import call
buf=None
TMP_FILE = "/tmp/video.raw"
if (len(argv) != 4):
print("Usage: encode_raw input.raw output.avi fps")
exit(1)
with open(argv[1], "rb") as f:
buf = array("H"... | Add Script to encode raw RGB565
* Encodes RGB565 raw stream to MP4/AVI#!/usr/bin/env python
# Converts raw RGB565 video to MP4/AVI
from sys import argv, exit
from array import array
from subprocess import call
buf=None
TMP_FILE = "/tmp/video.raw"
if (len(argv) != 4):
print("Usage: encode_raw input.raw output.av... | <commit_before><commit_msg>Add Script to encode raw RGB565
* Encodes RGB565 raw stream to MP4/AVI<commit_after>#!/usr/bin/env python
# Converts raw RGB565 video to MP4/AVI
from sys import argv, exit
from array import array
from subprocess import call
buf=None
TMP_FILE = "/tmp/video.raw"
if (len(argv) != 4):
pri... | |
74354263acb3399295e7fde18d6aeed4b7bb7397 | what_transcode/tests.py | what_transcode/tests.py | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from what_transcode.utils import get_mp3_ids
class UtilsTests(TestCase):
def test_get_mp3_ids(se... | Fix maybe all flake8 errors. Add first test. | Fix maybe all flake8 errors. Add first test.
| Python | mit | grandmasterchef/WhatManager2,MADindustries/WhatManager2,grandmasterchef/WhatManager2,karamanolev/WhatManager2,davols/WhatManager2,MADindustries/WhatManager2,karamanolev/WhatManager2,MADindustries/WhatManager2,grandmasterchef/WhatManager2,davols/WhatManager2,MADindustries/WhatManager2,karamanolev/WhatManager2,grandmaste... | Fix maybe all flake8 errors. Add first test. | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from what_transcode.utils import get_mp3_ids
class UtilsTests(TestCase):
def test_get_mp3_ids(se... | <commit_before><commit_msg>Fix maybe all flake8 errors. Add first test.<commit_after> | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from what_transcode.utils import get_mp3_ids
class UtilsTests(TestCase):
def test_get_mp3_ids(se... | Fix maybe all flake8 errors. Add first test."""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from what_transcode.utils import get_mp3_ids
class Utils... | <commit_before><commit_msg>Fix maybe all flake8 errors. Add first test.<commit_after>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from what_transco... | |
cb9166c4564c4e763e1214355dc76cbe6d466258 | books/migrations/0009_auto_20141127_1718.py | books/migrations/0009_auto_20141127_1718.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_sections(apps, schema_editor):
# Don't just use books.models.Section, that could be out of date
Section = apps.get_model('books', 'Section')
FRONT_MATTER_CHOICES = [
#('db_value', 'hum... | Add data migration for section | Add data migration for section
| Python | mit | supermitch/simple-author | Add data migration for section | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_sections(apps, schema_editor):
# Don't just use books.models.Section, that could be out of date
Section = apps.get_model('books', 'Section')
FRONT_MATTER_CHOICES = [
#('db_value', 'hum... | <commit_before><commit_msg>Add data migration for section<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_sections(apps, schema_editor):
# Don't just use books.models.Section, that could be out of date
Section = apps.get_model('books', 'Section')
FRONT_MATTER_CHOICES = [
#('db_value', 'hum... | Add data migration for section# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_sections(apps, schema_editor):
# Don't just use books.models.Section, that could be out of date
Section = apps.get_model('books', 'Section')
FRONT_MATTER_CHOICES... | <commit_before><commit_msg>Add data migration for section<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_sections(apps, schema_editor):
# Don't just use books.models.Section, that could be out of date
Section = apps.get_model('boo... | |
ebd62eac70d5589b0b7f593009024868f981e658 | calvin/actorstore/systemactors/std/ClassicDelay.py | calvin/actorstore/systemactors/std/ClassicDelay.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | Add actor with behavior similar to old-style Delay | Add actor with behavior similar to old-style Delay
| Python | apache-2.0 | les69/calvin-base,EricssonResearch/calvin-base,les69/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base,les69/calvin-base,EricssonResearch/calvin-base,les69/calvin-base | Add actor with behavior similar to old-style Delay | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before><commit_msg>Add actor with behavior similar to old-style Delay<commit_after> | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | Add actor with behavior similar to old-style Delay# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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/licen... | <commit_before><commit_msg>Add actor with behavior similar to old-style Delay<commit_after># -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 Licen... | |
e363aac46c9a5b607c7b32bcc5546c5a2728d750 | climate_data/migrations/0029_auto_20170628_1527.py | climate_data/migrations/0029_auto_20170628_1527.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-28 15:27
from __future__ import unicode_literals
from django.db import migrations
from datetime import timedelta
# noinspection PyUnusedLocal
def add_message_id_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_mod... | Add migration which fixes missing message IDs. | Add migration which fixes missing message IDs.
| Python | apache-2.0 | qubs/data-centre,qubs/data-centre,qubs/climate-data-api,qubs/climate-data-api | Add migration which fixes missing message IDs. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-28 15:27
from __future__ import unicode_literals
from django.db import migrations
from datetime import timedelta
# noinspection PyUnusedLocal
def add_message_id_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_mod... | <commit_before><commit_msg>Add migration which fixes missing message IDs.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-28 15:27
from __future__ import unicode_literals
from django.db import migrations
from datetime import timedelta
# noinspection PyUnusedLocal
def add_message_id_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_mod... | Add migration which fixes missing message IDs.# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-28 15:27
from __future__ import unicode_literals
from django.db import migrations
from datetime import timedelta
# noinspection PyUnusedLocal
def add_message_id_to_reading(apps, schema_editor):
# noinsp... | <commit_before><commit_msg>Add migration which fixes missing message IDs.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-28 15:27
from __future__ import unicode_literals
from django.db import migrations
from datetime import timedelta
# noinspection PyUnusedLocal
def add_message_id_to_r... | |
840bc57e7120ae67e84c1c7bca94cfef34c8d2a8 | scripts/add_missing_identifiers_to_preprints.py | scripts/add_missing_identifiers_to_preprints.py | import sys
import time
import logging
from scripts import utils as script_utils
from django.db import transaction
from website.app import setup_django
from website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers
setup_django()
logger = logging.getLogger(__name__)
def add_identifiers_to_pre... | Copy old script from @erinspace which added identifiers to existing preprints. | Copy old script from @erinspace which added identifiers to existing preprints.
| Python | apache-2.0 | erinspace/osf.io,chennan47/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,felliott/osf.io,baylee-d/osf.io,saradbowman/osf.io,leb2dg/osf.io,caseyrollins/osf.io,sloria/osf.io,Johnetordoff/osf.io,TomBaxter/osf.io,crcresearch/osf.io,mattclark/osf.io,brianjgeiger/osf.io,aaxelb/osf.io,felliott/osf.io,mfraezz/osf.io,adlius/osf.io... | Copy old script from @erinspace which added identifiers to existing preprints. | import sys
import time
import logging
from scripts import utils as script_utils
from django.db import transaction
from website.app import setup_django
from website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers
setup_django()
logger = logging.getLogger(__name__)
def add_identifiers_to_pre... | <commit_before><commit_msg>Copy old script from @erinspace which added identifiers to existing preprints.<commit_after> | import sys
import time
import logging
from scripts import utils as script_utils
from django.db import transaction
from website.app import setup_django
from website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers
setup_django()
logger = logging.getLogger(__name__)
def add_identifiers_to_pre... | Copy old script from @erinspace which added identifiers to existing preprints.import sys
import time
import logging
from scripts import utils as script_utils
from django.db import transaction
from website.app import setup_django
from website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers
se... | <commit_before><commit_msg>Copy old script from @erinspace which added identifiers to existing preprints.<commit_after>import sys
import time
import logging
from scripts import utils as script_utils
from django.db import transaction
from website.app import setup_django
from website.identifiers.utils import request_ide... | |
a02a46752d954c29a65bf8bc5b88fa3545315175 | lib/svtplay_dl/tests/utils.py | lib/svtplay_dl/tests/utils.py | #!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# pylint: disable-msg=C0103
from __future__ import absolute_import
import unittest
import svtplay_dl.utils
class timestrTest(unittest.TestCase):
def ... | Add unit tests for timestr() | Add unit tests for timestr()
| Python | mit | OakNinja/svtplay-dl,qnorsten/svtplay-dl,dalgr/svtplay-dl,iwconfig/svtplay-dl,dalgr/svtplay-dl,leakim/svtplay-dl,selepo/svtplay-dl,spaam/svtplay-dl,olof/svtplay-dl,leakim/svtplay-dl,OakNinja/svtplay-dl,qnorsten/svtplay-dl,selepo/svtplay-dl,iwconfig/svtplay-dl,olof/svtplay-dl,spaam/svtplay-dl,OakNinja/svtplay-dl,leakim/s... | Add unit tests for timestr() | #!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# pylint: disable-msg=C0103
from __future__ import absolute_import
import unittest
import svtplay_dl.utils
class timestrTest(unittest.TestCase):
def ... | <commit_before><commit_msg>Add unit tests for timestr()<commit_after> | #!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# pylint: disable-msg=C0103
from __future__ import absolute_import
import unittest
import svtplay_dl.utils
class timestrTest(unittest.TestCase):
def ... | Add unit tests for timestr()#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# pylint: disable-msg=C0103
from __future__ import absolute_import
import unittest
import svtplay_dl.utils
class timestrTest(... | <commit_before><commit_msg>Add unit tests for timestr()<commit_after>#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# pylint: disable-msg=C0103
from __future__ import absolute_import
import unittest
im... | |
a1039c2e38243b64d2027621aa87ee020636f23b | tests/test_views.py | tests/test_views.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import website
import unittest
import tempfile
class FPOTestCase(unittest.TestCase):
def test_homepage(self):
self.app = website.app.test_client()
resp = self.app.get('/')
self.as... | Add initial test for routes. | Add initial test for routes.
| Python | mit | jonathanchu/fpo,jonathanchu/fpo | Add initial test for routes. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import website
import unittest
import tempfile
class FPOTestCase(unittest.TestCase):
def test_homepage(self):
self.app = website.app.test_client()
resp = self.app.get('/')
self.as... | <commit_before><commit_msg>Add initial test for routes.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import website
import unittest
import tempfile
class FPOTestCase(unittest.TestCase):
def test_homepage(self):
self.app = website.app.test_client()
resp = self.app.get('/')
self.as... | Add initial test for routes.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import website
import unittest
import tempfile
class FPOTestCase(unittest.TestCase):
def test_homepage(self):
self.app = website.app.test_client()
resp = self.... | <commit_before><commit_msg>Add initial test for routes.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import website
import unittest
import tempfile
class FPOTestCase(unittest.TestCase):
def test_homepage(self):
self.app = websi... | |
278920272efd7ab959d7cad5b5f7d6c17935c7e6 | problem_35.py | problem_35.py | from math import sqrt
from time import time
PRIME_STATUS = {}
def is_prime(n):
if n == 2:
return True
if n % 2 == 0 or n <= 1:
return False
for i in range(3, int(sqrt(n))+1, 2):
if n % i == 0:
return False
return True
def check_prime_circles(num):
circles = [... | Add problem 35, circular primes | Add problem 35, circular primes
| Python | mit | dimkarakostas/project-euler | Add problem 35, circular primes | from math import sqrt
from time import time
PRIME_STATUS = {}
def is_prime(n):
if n == 2:
return True
if n % 2 == 0 or n <= 1:
return False
for i in range(3, int(sqrt(n))+1, 2):
if n % i == 0:
return False
return True
def check_prime_circles(num):
circles = [... | <commit_before><commit_msg>Add problem 35, circular primes<commit_after> | from math import sqrt
from time import time
PRIME_STATUS = {}
def is_prime(n):
if n == 2:
return True
if n % 2 == 0 or n <= 1:
return False
for i in range(3, int(sqrt(n))+1, 2):
if n % i == 0:
return False
return True
def check_prime_circles(num):
circles = [... | Add problem 35, circular primesfrom math import sqrt
from time import time
PRIME_STATUS = {}
def is_prime(n):
if n == 2:
return True
if n % 2 == 0 or n <= 1:
return False
for i in range(3, int(sqrt(n))+1, 2):
if n % i == 0:
return False
return True
def check_prim... | <commit_before><commit_msg>Add problem 35, circular primes<commit_after>from math import sqrt
from time import time
PRIME_STATUS = {}
def is_prime(n):
if n == 2:
return True
if n % 2 == 0 or n <= 1:
return False
for i in range(3, int(sqrt(n))+1, 2):
if n % i == 0:
retu... | |
dad430fd56b8be22bd1a3b9773f9948c3e305883 | stringlike/test/lazy_tests.py | stringlike/test/lazy_tests.py | import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from stringlike.lazy import LazyString, CachedLazyString
from unittest import main, TestCase
class TestLazyString(TestCase):
def test_equality(self):
self.assertEqual(LazyString(lambda: 'abc'), ... | Add unit tests for lazy strings | Add unit tests for lazy strings
| Python | mit | CovenantEyes/py_stringlike | Add unit tests for lazy strings | import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from stringlike.lazy import LazyString, CachedLazyString
from unittest import main, TestCase
class TestLazyString(TestCase):
def test_equality(self):
self.assertEqual(LazyString(lambda: 'abc'), ... | <commit_before><commit_msg>Add unit tests for lazy strings<commit_after> | import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from stringlike.lazy import LazyString, CachedLazyString
from unittest import main, TestCase
class TestLazyString(TestCase):
def test_equality(self):
self.assertEqual(LazyString(lambda: 'abc'), ... | Add unit tests for lazy stringsimport sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from stringlike.lazy import LazyString, CachedLazyString
from unittest import main, TestCase
class TestLazyString(TestCase):
def test_equality(self):
self.assertEq... | <commit_before><commit_msg>Add unit tests for lazy strings<commit_after>import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from stringlike.lazy import LazyString, CachedLazyString
from unittest import main, TestCase
class TestLazyString(TestCase):
def t... | |
e7b6aef4db85c777463d2335107145b60b678ae2 | examples/tour_examples/maps_introjs_tour.py | examples/tour_examples/maps_introjs_tour.py | from seleniumbase import BaseCase
class MyTourClass(BaseCase):
def test_google_maps_tour(self):
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
self.wait_for_element("#searchboxinput")
self.wait_for_element("#minimap")
self.wait_for_element("#zoom")
s... | Create a new tour example | Create a new tour example
| Python | mit | seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | Create a new tour example | from seleniumbase import BaseCase
class MyTourClass(BaseCase):
def test_google_maps_tour(self):
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
self.wait_for_element("#searchboxinput")
self.wait_for_element("#minimap")
self.wait_for_element("#zoom")
s... | <commit_before><commit_msg>Create a new tour example<commit_after> | from seleniumbase import BaseCase
class MyTourClass(BaseCase):
def test_google_maps_tour(self):
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
self.wait_for_element("#searchboxinput")
self.wait_for_element("#minimap")
self.wait_for_element("#zoom")
s... | Create a new tour examplefrom seleniumbase import BaseCase
class MyTourClass(BaseCase):
def test_google_maps_tour(self):
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
self.wait_for_element("#searchboxinput")
self.wait_for_element("#minimap")
self.wait_for_el... | <commit_before><commit_msg>Create a new tour example<commit_after>from seleniumbase import BaseCase
class MyTourClass(BaseCase):
def test_google_maps_tour(self):
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
self.wait_for_element("#searchboxinput")
self.wait_for_ele... | |
d93916b1927f0ae099cee3cf93619d3113db147b | examples/anomaly_detection.py | examples/anomaly_detection.py | import math
from peewee import *
db = SqliteDatabase(':memory:')
class Reg(Model):
key = TextField()
value = IntegerField()
class Meta:
database = db
db.create_tables([Reg])
# Create a user-defined aggregate function suitable for computing the standard
# deviation of a series.
@db.aggregate('... | Add small example of basic anomaly detection w/peewee. | Add small example of basic anomaly detection w/peewee.
| Python | mit | coleifer/peewee,coleifer/peewee,coleifer/peewee | Add small example of basic anomaly detection w/peewee. | import math
from peewee import *
db = SqliteDatabase(':memory:')
class Reg(Model):
key = TextField()
value = IntegerField()
class Meta:
database = db
db.create_tables([Reg])
# Create a user-defined aggregate function suitable for computing the standard
# deviation of a series.
@db.aggregate('... | <commit_before><commit_msg>Add small example of basic anomaly detection w/peewee.<commit_after> | import math
from peewee import *
db = SqliteDatabase(':memory:')
class Reg(Model):
key = TextField()
value = IntegerField()
class Meta:
database = db
db.create_tables([Reg])
# Create a user-defined aggregate function suitable for computing the standard
# deviation of a series.
@db.aggregate('... | Add small example of basic anomaly detection w/peewee.import math
from peewee import *
db = SqliteDatabase(':memory:')
class Reg(Model):
key = TextField()
value = IntegerField()
class Meta:
database = db
db.create_tables([Reg])
# Create a user-defined aggregate function suitable for computing... | <commit_before><commit_msg>Add small example of basic anomaly detection w/peewee.<commit_after>import math
from peewee import *
db = SqliteDatabase(':memory:')
class Reg(Model):
key = TextField()
value = IntegerField()
class Meta:
database = db
db.create_tables([Reg])
# Create a user-defined ... | |
10ccc510deab5c97ce8a6c5ee57232c5e399986e | decision_tree.py | decision_tree.py | import pandas as pd
from sklearn import tree
# X = [[0, 1], [1, 1]]
# Y = [0, 1]
#clf = tree.DecisionTreeClassifier()
#clf = clf.fit(X, Y)
data = pd.read_excel('/home/andre/sandbox/jhu-immuno/journal.pcbi.1003266.s001-2.XLS')
resp_cols = [ 'MHC' ]
data['y'] = data.Immunogenicity.map({'non-immunogenic': 0, 'immunoge... | Add decision tree classifier attempt. | Add decision tree classifier attempt.
| Python | mit | andretadeu/jhu-immuno,andretadeu/jhu-immuno | Add decision tree classifier attempt. | import pandas as pd
from sklearn import tree
# X = [[0, 1], [1, 1]]
# Y = [0, 1]
#clf = tree.DecisionTreeClassifier()
#clf = clf.fit(X, Y)
data = pd.read_excel('/home/andre/sandbox/jhu-immuno/journal.pcbi.1003266.s001-2.XLS')
resp_cols = [ 'MHC' ]
data['y'] = data.Immunogenicity.map({'non-immunogenic': 0, 'immunoge... | <commit_before><commit_msg>Add decision tree classifier attempt.<commit_after> | import pandas as pd
from sklearn import tree
# X = [[0, 1], [1, 1]]
# Y = [0, 1]
#clf = tree.DecisionTreeClassifier()
#clf = clf.fit(X, Y)
data = pd.read_excel('/home/andre/sandbox/jhu-immuno/journal.pcbi.1003266.s001-2.XLS')
resp_cols = [ 'MHC' ]
data['y'] = data.Immunogenicity.map({'non-immunogenic': 0, 'immunoge... | Add decision tree classifier attempt.import pandas as pd
from sklearn import tree
# X = [[0, 1], [1, 1]]
# Y = [0, 1]
#clf = tree.DecisionTreeClassifier()
#clf = clf.fit(X, Y)
data = pd.read_excel('/home/andre/sandbox/jhu-immuno/journal.pcbi.1003266.s001-2.XLS')
resp_cols = [ 'MHC' ]
data['y'] = data.Immunogenicity... | <commit_before><commit_msg>Add decision tree classifier attempt.<commit_after>import pandas as pd
from sklearn import tree
# X = [[0, 1], [1, 1]]
# Y = [0, 1]
#clf = tree.DecisionTreeClassifier()
#clf = clf.fit(X, Y)
data = pd.read_excel('/home/andre/sandbox/jhu-immuno/journal.pcbi.1003266.s001-2.XLS')
resp_cols = [... | |
8adfedd0c30fab796fccac6ec58c09e644a91b2f | shuffle_fastq.py | shuffle_fastq.py | # shuffles the sequences in a fastq file
import os
import random
from Bio import SeqIO
import fileinput
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--fq1", required="True")
parser.add_argument("--fq2", required="True")
args = parser.pars... | Add script to shuffle paired fastq sequences. | Add script to shuffle paired fastq sequences.
| Python | mit | roryk/junkdrawer,roryk/junkdrawer | Add script to shuffle paired fastq sequences. | # shuffles the sequences in a fastq file
import os
import random
from Bio import SeqIO
import fileinput
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--fq1", required="True")
parser.add_argument("--fq2", required="True")
args = parser.pars... | <commit_before><commit_msg>Add script to shuffle paired fastq sequences.<commit_after> | # shuffles the sequences in a fastq file
import os
import random
from Bio import SeqIO
import fileinput
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--fq1", required="True")
parser.add_argument("--fq2", required="True")
args = parser.pars... | Add script to shuffle paired fastq sequences.# shuffles the sequences in a fastq file
import os
import random
from Bio import SeqIO
import fileinput
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--fq1", required="True")
parser.add_argument("--... | <commit_before><commit_msg>Add script to shuffle paired fastq sequences.<commit_after># shuffles the sequences in a fastq file
import os
import random
from Bio import SeqIO
import fileinput
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--fq1", req... | |
ffb5caf83055e734baf711366b6779ecb24a013c | addons/adobe/clone.py | addons/adobe/clone.py | #!/usr/bin/env python
from PIL import Image, ImageEnhance
import PIL.ImageOps
import fnmatch
import shutil
import os
def globPath(path, pattern):
result = []
for root, subdirs, files in os.walk(path):
for filename in files:
if fnmatch.fnmatch(filename, pattern):
result.appen... | Add script to generate other adobe themes | Add script to generate other adobe themes
| Python | mit | Geequlim/godot-themes | Add script to generate other adobe themes | #!/usr/bin/env python
from PIL import Image, ImageEnhance
import PIL.ImageOps
import fnmatch
import shutil
import os
def globPath(path, pattern):
result = []
for root, subdirs, files in os.walk(path):
for filename in files:
if fnmatch.fnmatch(filename, pattern):
result.appen... | <commit_before><commit_msg>Add script to generate other adobe themes<commit_after> | #!/usr/bin/env python
from PIL import Image, ImageEnhance
import PIL.ImageOps
import fnmatch
import shutil
import os
def globPath(path, pattern):
result = []
for root, subdirs, files in os.walk(path):
for filename in files:
if fnmatch.fnmatch(filename, pattern):
result.appen... | Add script to generate other adobe themes#!/usr/bin/env python
from PIL import Image, ImageEnhance
import PIL.ImageOps
import fnmatch
import shutil
import os
def globPath(path, pattern):
result = []
for root, subdirs, files in os.walk(path):
for filename in files:
if fnmatch.fnmatch(filenam... | <commit_before><commit_msg>Add script to generate other adobe themes<commit_after>#!/usr/bin/env python
from PIL import Image, ImageEnhance
import PIL.ImageOps
import fnmatch
import shutil
import os
def globPath(path, pattern):
result = []
for root, subdirs, files in os.walk(path):
for filename in file... | |
c5ecaef62d788b69446181c6ba495cb273bf98ef | altair/examples/scatter_with_rolling_mean.py | altair/examples/scatter_with_rolling_mean.py | """
Scatter Plot with Rolling Mean
------------------------------
A scatter plot with a rolling mean overlay. In this example a 30 day window
is used to calculate the mean of the maximum temperature around each date.
"""
# category: scatter plots
import altair as alt
from vega_datasets import data
source = data.seatt... | Add rolling mean scatter plot example | Add rolling mean scatter plot example
| Python | bsd-3-clause | altair-viz/altair,jakevdp/altair | Add rolling mean scatter plot example | """
Scatter Plot with Rolling Mean
------------------------------
A scatter plot with a rolling mean overlay. In this example a 30 day window
is used to calculate the mean of the maximum temperature around each date.
"""
# category: scatter plots
import altair as alt
from vega_datasets import data
source = data.seatt... | <commit_before><commit_msg>Add rolling mean scatter plot example<commit_after> | """
Scatter Plot with Rolling Mean
------------------------------
A scatter plot with a rolling mean overlay. In this example a 30 day window
is used to calculate the mean of the maximum temperature around each date.
"""
# category: scatter plots
import altair as alt
from vega_datasets import data
source = data.seatt... | Add rolling mean scatter plot example"""
Scatter Plot with Rolling Mean
------------------------------
A scatter plot with a rolling mean overlay. In this example a 30 day window
is used to calculate the mean of the maximum temperature around each date.
"""
# category: scatter plots
import altair as alt
from vega_data... | <commit_before><commit_msg>Add rolling mean scatter plot example<commit_after>"""
Scatter Plot with Rolling Mean
------------------------------
A scatter plot with a rolling mean overlay. In this example a 30 day window
is used to calculate the mean of the maximum temperature around each date.
"""
# category: scatter p... | |
b3f91806b525ddef50d541f937bed539f9bae20a | mezzanine/project_template/deploy/live_settings.py | mezzanine/project_template/deploy/live_settings.py |
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"USER": "%(proj_na... |
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"USER": "%(proj_na... | Use cache backend for sessions in deployed settings. | Use cache backend for sessions in deployed settings.
| Python | bsd-2-clause | Kniyl/mezzanine,webounty/mezzanine,spookylukey/mezzanine,theclanks/mezzanine,batpad/mezzanine,sjdines/mezzanine,dovydas/mezzanine,readevalprint/mezzanine,eino-makitalo/mezzanine,industrydive/mezzanine,joshcartme/mezzanine,Cajoline/mezzanine,frankier/mezzanine,PegasusWang/mezzanine,biomassives/mezzanine,Skytorn86/mezzan... |
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"USER": "%(proj_na... |
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"USER": "%(proj_na... | <commit_before>
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"US... |
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"USER": "%(proj_na... |
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"USER": "%(proj_na... | <commit_before>
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
"US... |
62545500553443863d61d9e5ecc80307c745a227 | migrate/20110917T143029-remove-value-dimensions.py | migrate/20110917T143029-remove-value-dimensions.py | import logging
from openspending.lib import cubes
from openspending import migration, model, mongo
log = logging.getLogger(__name__)
def up():
group_args = ({'dataset':1}, {}, {'num': 0},
'function (x, acc) { acc.num += 1 }')
before = mongo.db.dimension.group(*group_args)
dims = model.... | Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary | Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary
| Python | agpl-3.0 | CivicVision/datahub,openspending/spendb,johnjohndoe/spendb,USStateDept/FPA_Core,spendb/spendb,johnjohndoe/spendb,openspending/spendb,nathanhilbert/FPA_Core,pudo/spendb,openspending/spendb,nathanhilbert/FPA_Core,spendb/spendb,CivicVision/datahub,pudo/spendb,USStateDept/FPA_Core,pudo/spendb,nathanhilbert/FPA_Core,USState... | Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary | import logging
from openspending.lib import cubes
from openspending import migration, model, mongo
log = logging.getLogger(__name__)
def up():
group_args = ({'dataset':1}, {}, {'num': 0},
'function (x, acc) { acc.num += 1 }')
before = mongo.db.dimension.group(*group_args)
dims = model.... | <commit_before><commit_msg>Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary<commit_after> | import logging
from openspending.lib import cubes
from openspending import migration, model, mongo
log = logging.getLogger(__name__)
def up():
group_args = ({'dataset':1}, {}, {'num': 0},
'function (x, acc) { acc.num += 1 }')
before = mongo.db.dimension.group(*group_args)
dims = model.... | Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessaryimport logging
from openspending.lib import cubes
from openspending import migration, model, mongo
log = logging.getLogger(__name__)
def up():
group_args = ({'dataset':1}, {}, {'num': 0},
... | <commit_before><commit_msg>Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary<commit_after>import logging
from openspending.lib import cubes
from openspending import migration, model, mongo
log = logging.getLogger(__name__)
def up():
group_args = ({'... | |
c599b5d470cf80b964af1b261a11540516e120df | galpy/potential_src/DehnenSmoothWrapperPotential.py | galpy/potential_src/DehnenSmoothWrapperPotential.py | ###############################################################################
# DehnenSmoothWrapperPotential.py: Wrapper to smoothly grow a potential
###############################################################################
from galpy.potential_src.WrapperPotential import SimpleWrapperPotential
class DehnenSm... | Add Dehnen smoothing as a wrapper | Add Dehnen smoothing as a wrapper
| Python | bsd-3-clause | jobovy/galpy,jobovy/galpy,jobovy/galpy,jobovy/galpy | Add Dehnen smoothing as a wrapper | ###############################################################################
# DehnenSmoothWrapperPotential.py: Wrapper to smoothly grow a potential
###############################################################################
from galpy.potential_src.WrapperPotential import SimpleWrapperPotential
class DehnenSm... | <commit_before><commit_msg>Add Dehnen smoothing as a wrapper<commit_after> | ###############################################################################
# DehnenSmoothWrapperPotential.py: Wrapper to smoothly grow a potential
###############################################################################
from galpy.potential_src.WrapperPotential import SimpleWrapperPotential
class DehnenSm... | Add Dehnen smoothing as a wrapper###############################################################################
# DehnenSmoothWrapperPotential.py: Wrapper to smoothly grow a potential
###############################################################################
from galpy.potential_src.WrapperPotential import Simp... | <commit_before><commit_msg>Add Dehnen smoothing as a wrapper<commit_after>###############################################################################
# DehnenSmoothWrapperPotential.py: Wrapper to smoothly grow a potential
###############################################################################
from galpy.p... | |
bb7bb2e12d3ccbb55f0b0e6db5d0cb79c3ea8079 | km_api/know_me/migrations/0013_remove_profileitem_media_resource.py | km_api/know_me/migrations/0013_remove_profileitem_media_resource.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 14:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('know_me', '0012_emergencyitem'),
]
operations = [
migrations.RemoveField(
... | Add missing migration for profile items. | Add missing migration for profile items.
When we moved profile item image content into a separate model, we
missed this migration when rebasing.
| Python | apache-2.0 | knowmetools/km-api,knowmetools/km-api,knowmetools/km-api,knowmetools/km-api | Add missing migration for profile items.
When we moved profile item image content into a separate model, we
missed this migration when rebasing. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 14:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('know_me', '0012_emergencyitem'),
]
operations = [
migrations.RemoveField(
... | <commit_before><commit_msg>Add missing migration for profile items.
When we moved profile item image content into a separate model, we
missed this migration when rebasing.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 14:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('know_me', '0012_emergencyitem'),
]
operations = [
migrations.RemoveField(
... | Add missing migration for profile items.
When we moved profile item image content into a separate model, we
missed this migration when rebasing.# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 14:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations... | <commit_before><commit_msg>Add missing migration for profile items.
When we moved profile item image content into a separate model, we
missed this migration when rebasing.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 14:16
from __future__ import unicode_literals
from django.db impor... | |
26fcbefee171f8d56504a7eba121027f0c5be8b5 | lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py | lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grades', '0012_computegradessetting'),
]
operations = [
migrations.CreateModel(
name='PersistentSubsectionGradeO... | Add migration for new overrides table | Add migration for new overrides table
| Python | agpl-3.0 | Lektorium-LLC/edx-platform,CredoReference/edx-platform,arbrandes/edx-platform,msegado/edx-platform,pabloborrego93/edx-platform,edx-solutions/edx-platform,TeachAtTUM/edx-platform,gsehub/edx-platform,TeachAtTUM/edx-platform,proversity-org/edx-platform,Lektorium-LLC/edx-platform,stvstnfrd/edx-platform,proversity-org/edx-p... | Add migration for new overrides table | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grades', '0012_computegradessetting'),
]
operations = [
migrations.CreateModel(
name='PersistentSubsectionGradeO... | <commit_before><commit_msg>Add migration for new overrides table<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grades', '0012_computegradessetting'),
]
operations = [
migrations.CreateModel(
name='PersistentSubsectionGradeO... | Add migration for new overrides table# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grades', '0012_computegradessetting'),
]
operations = [
migrations.CreateModel(
... | <commit_before><commit_msg>Add migration for new overrides table<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grades', '0012_computegradessetting'),
]
operations = ... | |
aff827e9cc02bcee6cf8687e1dff65f39daaf6c6 | workshops/test/test_landing_page.py | workshops/test/test_landing_page.py | from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import patch
from datetime import date
class FakeDate(date):
"A fake replacement for date that can be mocked for testing."
pass
@classmethod
def today(cls):
return cls(2013, 12, 7)
@patch('workshops.models... | Add a failing test to the landing page to check for upcoming events. | Add a failing test to the landing page to check for upcoming events.
| Python | mit | shapiromatron/amy,pbanaszkiewicz/amy,swcarpentry/amy,vahtras/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,wking/swc-amy,vahtras/amy,shapiromatron/amy,swcarpentry/amy,swcarpentry/amy,wking/swc-amy,wking/swc-amy,shapiromatron/amy,vahtras/amy,wking/swc-amy | Add a failing test to the landing page to check for upcoming events. | from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import patch
from datetime import date
class FakeDate(date):
"A fake replacement for date that can be mocked for testing."
pass
@classmethod
def today(cls):
return cls(2013, 12, 7)
@patch('workshops.models... | <commit_before><commit_msg>Add a failing test to the landing page to check for upcoming events.<commit_after> | from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import patch
from datetime import date
class FakeDate(date):
"A fake replacement for date that can be mocked for testing."
pass
@classmethod
def today(cls):
return cls(2013, 12, 7)
@patch('workshops.models... | Add a failing test to the landing page to check for upcoming events.from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import patch
from datetime import date
class FakeDate(date):
"A fake replacement for date that can be mocked for testing."
pass
@classmethod
def t... | <commit_before><commit_msg>Add a failing test to the landing page to check for upcoming events.<commit_after>from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import patch
from datetime import date
class FakeDate(date):
"A fake replacement for date that can be mocked for testi... | |
ea26478495d5aec6925e32c9a87245bf2e1e4bc8 | rps/errors.py | rps/errors.py | gestures = ["rock", "paper", "scissors"]
def verify_move(player_move):
if player_move not in gestures:
raise Exception("Wrong input!")
return player_move
# let's catch an exception
try:
player_move = verify_move(input("[rock,paper,scissors]: "))
print("The move was correct.")
except Exception:... | Add script demonstrating raising and catching Exceptions. | Add script demonstrating raising and catching Exceptions.
| Python | mit | kubkon/ee106-additional-material | Add script demonstrating raising and catching Exceptions. | gestures = ["rock", "paper", "scissors"]
def verify_move(player_move):
if player_move not in gestures:
raise Exception("Wrong input!")
return player_move
# let's catch an exception
try:
player_move = verify_move(input("[rock,paper,scissors]: "))
print("The move was correct.")
except Exception:... | <commit_before><commit_msg>Add script demonstrating raising and catching Exceptions.<commit_after> | gestures = ["rock", "paper", "scissors"]
def verify_move(player_move):
if player_move not in gestures:
raise Exception("Wrong input!")
return player_move
# let's catch an exception
try:
player_move = verify_move(input("[rock,paper,scissors]: "))
print("The move was correct.")
except Exception:... | Add script demonstrating raising and catching Exceptions.gestures = ["rock", "paper", "scissors"]
def verify_move(player_move):
if player_move not in gestures:
raise Exception("Wrong input!")
return player_move
# let's catch an exception
try:
player_move = verify_move(input("[rock,paper,scissors]:... | <commit_before><commit_msg>Add script demonstrating raising and catching Exceptions.<commit_after>gestures = ["rock", "paper", "scissors"]
def verify_move(player_move):
if player_move not in gestures:
raise Exception("Wrong input!")
return player_move
# let's catch an exception
try:
player_move = ... | |
947c9ef100686fa1ec0acaa10bc49bf6c785665b | ffflash/container.py | ffflash/container.py | from os import path
from ffflash import RELEASE, log, now, timeout
from ffflash.lib.clock import epoch_repr
from ffflash.lib.data import merge_dicts
from ffflash.lib.files import read_json_file, write_json_file
class Container:
def __init__(self, spec, filename):
self._spec = spec
self._location ... | Use unified class for json output | Use unified class for json output
| Python | bsd-3-clause | spookey/ffflash,spookey/ffflash | Use unified class for json output | from os import path
from ffflash import RELEASE, log, now, timeout
from ffflash.lib.clock import epoch_repr
from ffflash.lib.data import merge_dicts
from ffflash.lib.files import read_json_file, write_json_file
class Container:
def __init__(self, spec, filename):
self._spec = spec
self._location ... | <commit_before><commit_msg>Use unified class for json output<commit_after> | from os import path
from ffflash import RELEASE, log, now, timeout
from ffflash.lib.clock import epoch_repr
from ffflash.lib.data import merge_dicts
from ffflash.lib.files import read_json_file, write_json_file
class Container:
def __init__(self, spec, filename):
self._spec = spec
self._location ... | Use unified class for json outputfrom os import path
from ffflash import RELEASE, log, now, timeout
from ffflash.lib.clock import epoch_repr
from ffflash.lib.data import merge_dicts
from ffflash.lib.files import read_json_file, write_json_file
class Container:
def __init__(self, spec, filename):
self._sp... | <commit_before><commit_msg>Use unified class for json output<commit_after>from os import path
from ffflash import RELEASE, log, now, timeout
from ffflash.lib.clock import epoch_repr
from ffflash.lib.data import merge_dicts
from ffflash.lib.files import read_json_file, write_json_file
class Container:
def __init_... | |
c206969facfc0e46d7ec4d3f60ce2e6a07956dbd | 14B-088/HI/analysis/run_filfinder.py | 14B-088/HI/analysis/run_filfinder.py |
from fil_finder import fil_finder_2D
from basics import BubbleFinder2D
from spectral_cube.lower_dimensional_structures import Projection
from astropy.io import fits
from radio_beam import Beam
from astropy.wcs import WCS
import astropy.units as u
import matplotlib.pyplot as p
'''
Filaments in M33? Why not?
'''
mom0_... | Use filfinder to get the average radial width of features in the moment 0 | Use filfinder to get the average radial width of features in the moment 0
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband | Use filfinder to get the average radial width of features in the moment 0 |
from fil_finder import fil_finder_2D
from basics import BubbleFinder2D
from spectral_cube.lower_dimensional_structures import Projection
from astropy.io import fits
from radio_beam import Beam
from astropy.wcs import WCS
import astropy.units as u
import matplotlib.pyplot as p
'''
Filaments in M33? Why not?
'''
mom0_... | <commit_before><commit_msg>Use filfinder to get the average radial width of features in the moment 0<commit_after> |
from fil_finder import fil_finder_2D
from basics import BubbleFinder2D
from spectral_cube.lower_dimensional_structures import Projection
from astropy.io import fits
from radio_beam import Beam
from astropy.wcs import WCS
import astropy.units as u
import matplotlib.pyplot as p
'''
Filaments in M33? Why not?
'''
mom0_... | Use filfinder to get the average radial width of features in the moment 0
from fil_finder import fil_finder_2D
from basics import BubbleFinder2D
from spectral_cube.lower_dimensional_structures import Projection
from astropy.io import fits
from radio_beam import Beam
from astropy.wcs import WCS
import astropy.units as u... | <commit_before><commit_msg>Use filfinder to get the average radial width of features in the moment 0<commit_after>
from fil_finder import fil_finder_2D
from basics import BubbleFinder2D
from spectral_cube.lower_dimensional_structures import Projection
from astropy.io import fits
from radio_beam import Beam
from astropy... | |
da5fed886d519b271a120820668d21518872f52c | remove_duplicates_from_sorted_array.py | remove_duplicates_from_sorted_array.py | '''
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
For example,
Given input array A = [1,1,2],
Your function should return length = 2, and A is now [... | Remove Duplicates from Sorted Array problem | Remove Duplicates from Sorted Array problem
| Python | apache-2.0 | zsmountain/leetcode,zsmountain/leetcode,zsmountain/leetcode | Remove Duplicates from Sorted Array problem | '''
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
For example,
Given input array A = [1,1,2],
Your function should return length = 2, and A is now [... | <commit_before><commit_msg>Remove Duplicates from Sorted Array problem<commit_after> | '''
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
For example,
Given input array A = [1,1,2],
Your function should return length = 2, and A is now [... | Remove Duplicates from Sorted Array problem'''
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
For example,
Given input array A = [1,1,2],
Your functi... | <commit_before><commit_msg>Remove Duplicates from Sorted Array problem<commit_after>'''
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
For example,
Gi... | |
207116ee7ba8d8da521f497997da90066831a551 | django3_codemods/replace_unicode_with_str.py | django3_codemods/replace_unicode_with_str.py | import sys
from bowler import Query
(
Query(sys.argv[1])
.select_function("__unicode__")
.rename('__str__')
.idiff()
),
(
Query(sys.argv[1])
.select_method("__unicode__")
.is_call()
.rename('__str__')
.idiff()
)
| Add codemod to replace __unicode__ with __str__ | Add codemod to replace __unicode__ with __str__
| Python | apache-2.0 | edx/repo-tools,edx/repo-tools | Add codemod to replace __unicode__ with __str__ | import sys
from bowler import Query
(
Query(sys.argv[1])
.select_function("__unicode__")
.rename('__str__')
.idiff()
),
(
Query(sys.argv[1])
.select_method("__unicode__")
.is_call()
.rename('__str__')
.idiff()
)
| <commit_before><commit_msg>Add codemod to replace __unicode__ with __str__<commit_after> | import sys
from bowler import Query
(
Query(sys.argv[1])
.select_function("__unicode__")
.rename('__str__')
.idiff()
),
(
Query(sys.argv[1])
.select_method("__unicode__")
.is_call()
.rename('__str__')
.idiff()
)
| Add codemod to replace __unicode__ with __str__import sys
from bowler import Query
(
Query(sys.argv[1])
.select_function("__unicode__")
.rename('__str__')
.idiff()
),
(
Query(sys.argv[1])
.select_method("__unicode__")
.is_call()
.rename('__str__')
.idiff()
)
| <commit_before><commit_msg>Add codemod to replace __unicode__ with __str__<commit_after>import sys
from bowler import Query
(
Query(sys.argv[1])
.select_function("__unicode__")
.rename('__str__')
.idiff()
),
(
Query(sys.argv[1])
.select_method("__unicode__")
.is_call()
.rename('__str_... | |
2d1624f088431e5f71214988499f732695a82b16 | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.15.0rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.15.0rc4"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| Bump version 0.15.0rc3 --> 0.15.0rc4 | Bump version 0.15.0rc3 --> 0.15.0rc4
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io>
| Python | mit | lbryio/lbry,lbryio/lbry,zestyr/lbry,lbryio/lbry,zestyr/lbry,zestyr/lbry | import logging
__version__ = "0.15.0rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
Bump version 0.15.0rc3 --> 0.15.0rc4
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io> | import logging
__version__ = "0.15.0rc4"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| <commit_before>import logging
__version__ = "0.15.0rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
<commit_msg>Bump version 0.15.0rc3 --> 0.15.0rc4
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io><commit_after> | import logging
__version__ = "0.15.0rc4"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.15.0rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
Bump version 0.15.0rc3 --> 0.15.0rc4
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io>import logging
__version__ = "0.15.0rc4"
version = tuple(_... | <commit_before>import logging
__version__ = "0.15.0rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
<commit_msg>Bump version 0.15.0rc3 --> 0.15.0rc4
Signed-off-by: Jack Robison <40884020c67726395ea162083a125620dc32cdab@lbry.io><commit_after>import logging
__... |
4764b5248cf91042a12ce6aef77a04c37360eb4f | pyglab/pyglab.py | pyglab/pyglab.py | import requests
class Pyglab(object):
def __init__(self, token):
self.token = token
self.headers = {'PRIVATE-TOKEN', token}
self.user = None
def sudo(self, user):
"""Permanently set a different username. Returns the old username."""
previous_user = self.user
s... | Add initial shell of Pyglab class. | Add initial shell of Pyglab class.
| Python | mit | sloede/pyglab,sloede/pyglab | Add initial shell of Pyglab class. | import requests
class Pyglab(object):
def __init__(self, token):
self.token = token
self.headers = {'PRIVATE-TOKEN', token}
self.user = None
def sudo(self, user):
"""Permanently set a different username. Returns the old username."""
previous_user = self.user
s... | <commit_before><commit_msg>Add initial shell of Pyglab class.<commit_after> | import requests
class Pyglab(object):
def __init__(self, token):
self.token = token
self.headers = {'PRIVATE-TOKEN', token}
self.user = None
def sudo(self, user):
"""Permanently set a different username. Returns the old username."""
previous_user = self.user
s... | Add initial shell of Pyglab class.import requests
class Pyglab(object):
def __init__(self, token):
self.token = token
self.headers = {'PRIVATE-TOKEN', token}
self.user = None
def sudo(self, user):
"""Permanently set a different username. Returns the old username."""
p... | <commit_before><commit_msg>Add initial shell of Pyglab class.<commit_after>import requests
class Pyglab(object):
def __init__(self, token):
self.token = token
self.headers = {'PRIVATE-TOKEN', token}
self.user = None
def sudo(self, user):
"""Permanently set a different username... | |
70e04b20c5d78b41546aa4ea1a1e2fd82af7527f | comrade/http/__init__.py | comrade/http/__init__.py | from django.core.serializers import json, serialize
from django.db.models.query import QuerySet
from django.http import HttpResponse
from django.utils import simplejson
class HttpJsonResponse(HttpResponse):
def __init__(self, object, status=None):
if isinstance(object, QuerySet):
content = seri... | Add JSON HttpResponse that does the encoding for you. | Add JSON HttpResponse that does the encoding for you.
| Python | mit | bueda/django-comrade | Add JSON HttpResponse that does the encoding for you. | from django.core.serializers import json, serialize
from django.db.models.query import QuerySet
from django.http import HttpResponse
from django.utils import simplejson
class HttpJsonResponse(HttpResponse):
def __init__(self, object, status=None):
if isinstance(object, QuerySet):
content = seri... | <commit_before><commit_msg>Add JSON HttpResponse that does the encoding for you.<commit_after> | from django.core.serializers import json, serialize
from django.db.models.query import QuerySet
from django.http import HttpResponse
from django.utils import simplejson
class HttpJsonResponse(HttpResponse):
def __init__(self, object, status=None):
if isinstance(object, QuerySet):
content = seri... | Add JSON HttpResponse that does the encoding for you.from django.core.serializers import json, serialize
from django.db.models.query import QuerySet
from django.http import HttpResponse
from django.utils import simplejson
class HttpJsonResponse(HttpResponse):
def __init__(self, object, status=None):
if isi... | <commit_before><commit_msg>Add JSON HttpResponse that does the encoding for you.<commit_after>from django.core.serializers import json, serialize
from django.db.models.query import QuerySet
from django.http import HttpResponse
from django.utils import simplejson
class HttpJsonResponse(HttpResponse):
def __init__(s... | |
6ad081e91e337e1627b70674109f45ba35248f8c | zou/migrations/versions/e839d6603c09_add_person_id_to_shot_history.py | zou/migrations/versions/e839d6603c09_add_person_id_to_shot_history.py | """add person id to shot history
Revision ID: e839d6603c09
Revises: 346250b5304c
Create Date: 2020-12-14 12:00:19.045783
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
import sqlalchemy_utils
import uuid
# revision identifiers, used by Alembic.
revision = 'e839d6603c09'
down_revision = '3... | Add missing migration file to the repo | [qa] Add missing migration file to the repo
| Python | agpl-3.0 | cgwire/zou | [qa] Add missing migration file to the repo | """add person id to shot history
Revision ID: e839d6603c09
Revises: 346250b5304c
Create Date: 2020-12-14 12:00:19.045783
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
import sqlalchemy_utils
import uuid
# revision identifiers, used by Alembic.
revision = 'e839d6603c09'
down_revision = '3... | <commit_before><commit_msg>[qa] Add missing migration file to the repo<commit_after> | """add person id to shot history
Revision ID: e839d6603c09
Revises: 346250b5304c
Create Date: 2020-12-14 12:00:19.045783
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
import sqlalchemy_utils
import uuid
# revision identifiers, used by Alembic.
revision = 'e839d6603c09'
down_revision = '3... | [qa] Add missing migration file to the repo"""add person id to shot history
Revision ID: e839d6603c09
Revises: 346250b5304c
Create Date: 2020-12-14 12:00:19.045783
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
import sqlalchemy_utils
import uuid
# revision identifiers, used by Alembic.
r... | <commit_before><commit_msg>[qa] Add missing migration file to the repo<commit_after>"""add person id to shot history
Revision ID: e839d6603c09
Revises: 346250b5304c
Create Date: 2020-12-14 12:00:19.045783
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
import sqlalchemy_utils
import uuid
#... | |
c25cebf31648466111cb3d576e0a398bb4220ccf | sabnzbd/test_cleanupfilename.py | sabnzbd/test_cleanupfilename.py | import unittest
from cleanupfilename import rename
class TestRename(unittest.TestCase):
files = []
dirs = []
def setUp(self):
self.files = [('filename-sample.x264.mp4', 'filename.mp4'),
('filename.mp4', 'filename.mp4')]
self.dirs = [('filename sample mp4', 'filename'... | Add test for sabnzbd cleanupfilename.py | Add test for sabnzbd cleanupfilename.py
| Python | bsd-3-clause | FreekKalter/linux-scripts,FreekKalter/linux-scripts,FreekKalter/linux-scripts,FreekKalter/linux-scripts | Add test for sabnzbd cleanupfilename.py | import unittest
from cleanupfilename import rename
class TestRename(unittest.TestCase):
files = []
dirs = []
def setUp(self):
self.files = [('filename-sample.x264.mp4', 'filename.mp4'),
('filename.mp4', 'filename.mp4')]
self.dirs = [('filename sample mp4', 'filename'... | <commit_before><commit_msg>Add test for sabnzbd cleanupfilename.py<commit_after> | import unittest
from cleanupfilename import rename
class TestRename(unittest.TestCase):
files = []
dirs = []
def setUp(self):
self.files = [('filename-sample.x264.mp4', 'filename.mp4'),
('filename.mp4', 'filename.mp4')]
self.dirs = [('filename sample mp4', 'filename'... | Add test for sabnzbd cleanupfilename.pyimport unittest
from cleanupfilename import rename
class TestRename(unittest.TestCase):
files = []
dirs = []
def setUp(self):
self.files = [('filename-sample.x264.mp4', 'filename.mp4'),
('filename.mp4', 'filename.mp4')]
self.dir... | <commit_before><commit_msg>Add test for sabnzbd cleanupfilename.py<commit_after>import unittest
from cleanupfilename import rename
class TestRename(unittest.TestCase):
files = []
dirs = []
def setUp(self):
self.files = [('filename-sample.x264.mp4', 'filename.mp4'),
('filenam... | |
31bb487a2f75268cb0b60ef4539935df83b68a84 | quiz/3-radixsort.py | quiz/3-radixsort.py | #!/usr/bin/env python3
def make_arr(text):
return text.strip().split(' ')
def print_arr(arr):
for t in arr:
print(t, end=' ')
print()
def solve_q1(arr, time):
for t in range(len(arr[0]) - 1, time - 1, -1):
arr = sorted(arr, key=lambda x: x[t])
return arr
def msd_radix_sort(ar... | Add auto solver for "W3-Radix Sorts". | Add auto solver for "W3-Radix Sorts".
| Python | mit | hghwng/mooc-algs2,hghwng/mooc-algs2 | Add auto solver for "W3-Radix Sorts". | #!/usr/bin/env python3
def make_arr(text):
return text.strip().split(' ')
def print_arr(arr):
for t in arr:
print(t, end=' ')
print()
def solve_q1(arr, time):
for t in range(len(arr[0]) - 1, time - 1, -1):
arr = sorted(arr, key=lambda x: x[t])
return arr
def msd_radix_sort(ar... | <commit_before><commit_msg>Add auto solver for "W3-Radix Sorts".<commit_after> | #!/usr/bin/env python3
def make_arr(text):
return text.strip().split(' ')
def print_arr(arr):
for t in arr:
print(t, end=' ')
print()
def solve_q1(arr, time):
for t in range(len(arr[0]) - 1, time - 1, -1):
arr = sorted(arr, key=lambda x: x[t])
return arr
def msd_radix_sort(ar... | Add auto solver for "W3-Radix Sorts".#!/usr/bin/env python3
def make_arr(text):
return text.strip().split(' ')
def print_arr(arr):
for t in arr:
print(t, end=' ')
print()
def solve_q1(arr, time):
for t in range(len(arr[0]) - 1, time - 1, -1):
arr = sorted(arr, key=lambda x: x[t])
... | <commit_before><commit_msg>Add auto solver for "W3-Radix Sorts".<commit_after>#!/usr/bin/env python3
def make_arr(text):
return text.strip().split(' ')
def print_arr(arr):
for t in arr:
print(t, end=' ')
print()
def solve_q1(arr, time):
for t in range(len(arr[0]) - 1, time - 1, -1):
... | |
896270bcd99b26e4128fd35dd3821a59807ae850 | doc/model/model_decla.py | doc/model/model_decla.py | #autogenerated by sqlautocode
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation
engine = create_engine('mysql://monty:passwd@localhost/test_dia')
DeclarativeBase = declarative_base()
metadata = DeclarativeBase.metadata
metadata.bind = engine
class Me... | Add the model.py file declarative generated from mysql. | Add the model.py file declarative generated from mysql.
| Python | mit | mteule/StationMeteo,mteule/StationMeteo | Add the model.py file declarative generated from mysql. | #autogenerated by sqlautocode
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation
engine = create_engine('mysql://monty:passwd@localhost/test_dia')
DeclarativeBase = declarative_base()
metadata = DeclarativeBase.metadata
metadata.bind = engine
class Me... | <commit_before><commit_msg>Add the model.py file declarative generated from mysql.<commit_after> | #autogenerated by sqlautocode
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation
engine = create_engine('mysql://monty:passwd@localhost/test_dia')
DeclarativeBase = declarative_base()
metadata = DeclarativeBase.metadata
metadata.bind = engine
class Me... | Add the model.py file declarative generated from mysql.#autogenerated by sqlautocode
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation
engine = create_engine('mysql://monty:passwd@localhost/test_dia')
DeclarativeBase = declarative_base()
metadata = De... | <commit_before><commit_msg>Add the model.py file declarative generated from mysql.<commit_after>#autogenerated by sqlautocode
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation
engine = create_engine('mysql://monty:passwd@localhost/test_dia')
Declarati... | |
7aab44f006a6412d8f169c3f9a801f41a6ea0a95 | migrations/versions/880_remove_invalid_draft_dos2_brief_dates_again.py | migrations/versions/880_remove_invalid_draft_dos2_brief_dates_again.py | """Remove dates from draft dos2 briefs.
This is identical to the previous migration but will be run again to cover any draft briefs with invalid
dates that could have appeared during the previous API rollout process (after the previous migration but before
the code propogated fully to the ec2 instances).
Revision ID: ... | Remove start dates for the second time from draft dos2 briefs | Remove start dates for the second time from draft dos2 briefs
This is identical to the previous migration but will be run again
to cover any draft briefs with invalid dates that could have
appeared during the previous API rollout process (after the previous
migration but before the code propogated fully to the ec2 ins... | Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | Remove start dates for the second time from draft dos2 briefs
This is identical to the previous migration but will be run again
to cover any draft briefs with invalid dates that could have
appeared during the previous API rollout process (after the previous
migration but before the code propogated fully to the ec2 ins... | """Remove dates from draft dos2 briefs.
This is identical to the previous migration but will be run again to cover any draft briefs with invalid
dates that could have appeared during the previous API rollout process (after the previous migration but before
the code propogated fully to the ec2 instances).
Revision ID: ... | <commit_before><commit_msg>Remove start dates for the second time from draft dos2 briefs
This is identical to the previous migration but will be run again
to cover any draft briefs with invalid dates that could have
appeared during the previous API rollout process (after the previous
migration but before the code prop... | """Remove dates from draft dos2 briefs.
This is identical to the previous migration but will be run again to cover any draft briefs with invalid
dates that could have appeared during the previous API rollout process (after the previous migration but before
the code propogated fully to the ec2 instances).
Revision ID: ... | Remove start dates for the second time from draft dos2 briefs
This is identical to the previous migration but will be run again
to cover any draft briefs with invalid dates that could have
appeared during the previous API rollout process (after the previous
migration but before the code propogated fully to the ec2 ins... | <commit_before><commit_msg>Remove start dates for the second time from draft dos2 briefs
This is identical to the previous migration but will be run again
to cover any draft briefs with invalid dates that could have
appeared during the previous API rollout process (after the previous
migration but before the code prop... | |
3ebae0f57ae3396213eb28b6fc7a23ff3e3c4980 | uml-to-cpp.py | uml-to-cpp.py | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
# check if file isn't too bonkers
#uml = [] # pull UML into memory as s... | Create file and add pseudocode | Create file and add pseudocode
| Python | mit | BranSeals/uml-to-cpp | Create file and add pseudocode | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
# check if file isn't too bonkers
#uml = [] # pull UML into memory as s... | <commit_before><commit_msg>Create file and add pseudocode<commit_after> | # Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
# check if file isn't too bonkers
#uml = [] # pull UML into memory as s... | Create file and add pseudocode# Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
# check if file isn't too bonkers
#uml = ... | <commit_before><commit_msg>Create file and add pseudocode<commit_after># Copyright (C) 2017 Bran Seals. All rights reserved.
# Created: 2017-06-05
print("== UML to CPP ==")
print("Create or modify C++ header and implementation files by plaintext UML.")
#print("Enter a UML filename: ") # file import currently disabled
... | |
e2ed635fb3289a5b45f5f15cd1eb543d87fb93d7 | wafer/talks/tests/test_review_views.py | wafer/talks/tests/test_review_views.py | """Tests for wafer.talk review form behaviour."""
from django.test import Client, TestCase
from django.urls import reverse
from reversion import revisions
from reversion.models import Version
from wafer.talks.models import (SUBMITTED, UNDER_CONSIDERATION,
ReviewAspect, Review)
from wa... | Add test for posting a review through the view | Add test for posting a review through the view
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | Add test for posting a review through the view | """Tests for wafer.talk review form behaviour."""
from django.test import Client, TestCase
from django.urls import reverse
from reversion import revisions
from reversion.models import Version
from wafer.talks.models import (SUBMITTED, UNDER_CONSIDERATION,
ReviewAspect, Review)
from wa... | <commit_before><commit_msg>Add test for posting a review through the view<commit_after> | """Tests for wafer.talk review form behaviour."""
from django.test import Client, TestCase
from django.urls import reverse
from reversion import revisions
from reversion.models import Version
from wafer.talks.models import (SUBMITTED, UNDER_CONSIDERATION,
ReviewAspect, Review)
from wa... | Add test for posting a review through the view"""Tests for wafer.talk review form behaviour."""
from django.test import Client, TestCase
from django.urls import reverse
from reversion import revisions
from reversion.models import Version
from wafer.talks.models import (SUBMITTED, UNDER_CONSIDERATION,
... | <commit_before><commit_msg>Add test for posting a review through the view<commit_after>"""Tests for wafer.talk review form behaviour."""
from django.test import Client, TestCase
from django.urls import reverse
from reversion import revisions
from reversion.models import Version
from wafer.talks.models import (SUBMIT... | |
466410249867b3eadbe5e2b59c46c95ecd288c6c | python_scripts/solr_query_fetch_all.py | python_scripts/solr_query_fetch_all.py | #!/usr/bin/python
import requests
import ipdb
import time
import csv
import sys
import pysolr
def fetch_all( solr, query ) :
documents = []
num_matching_documents = solr.search( query ).hits
start = 0
rows = num_matching_documents
sys.stderr.write( ' starting fetch for ' + query )
while ( le... | Add script for word counts | Add script for word counts
| Python | agpl-3.0 | berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter... | Add script for word counts | #!/usr/bin/python
import requests
import ipdb
import time
import csv
import sys
import pysolr
def fetch_all( solr, query ) :
documents = []
num_matching_documents = solr.search( query ).hits
start = 0
rows = num_matching_documents
sys.stderr.write( ' starting fetch for ' + query )
while ( le... | <commit_before><commit_msg>Add script for word counts<commit_after> | #!/usr/bin/python
import requests
import ipdb
import time
import csv
import sys
import pysolr
def fetch_all( solr, query ) :
documents = []
num_matching_documents = solr.search( query ).hits
start = 0
rows = num_matching_documents
sys.stderr.write( ' starting fetch for ' + query )
while ( le... | Add script for word counts#!/usr/bin/python
import requests
import ipdb
import time
import csv
import sys
import pysolr
def fetch_all( solr, query ) :
documents = []
num_matching_documents = solr.search( query ).hits
start = 0
rows = num_matching_documents
sys.stderr.write( ' starting fetch for ... | <commit_before><commit_msg>Add script for word counts<commit_after>#!/usr/bin/python
import requests
import ipdb
import time
import csv
import sys
import pysolr
def fetch_all( solr, query ) :
documents = []
num_matching_documents = solr.search( query ).hits
start = 0
rows = num_matching_documents
... | |
7182af317116db7eb3f7a278b3487ad91a3b3331 | high-res-slider.py | high-res-slider.py | import functools
import numpy as np
import dask.array as da
from magicgui.widgets import Slider, Container
import napari
# stack = ... # your dask array
# stack2 = stack[::2, ::2, ::2]
# stack4 = stack2[::2, ::2, ::2]
# 👆 quick and easy multiscale pyramid, don't do this really
# see https://github.com/dask/dask-imag... | Add example for a clunky 3D high resolution loupe for napari | Add example for a clunky 3D high resolution loupe for napari
| Python | bsd-3-clause | jni/useful-histories | Add example for a clunky 3D high resolution loupe for napari | import functools
import numpy as np
import dask.array as da
from magicgui.widgets import Slider, Container
import napari
# stack = ... # your dask array
# stack2 = stack[::2, ::2, ::2]
# stack4 = stack2[::2, ::2, ::2]
# 👆 quick and easy multiscale pyramid, don't do this really
# see https://github.com/dask/dask-imag... | <commit_before><commit_msg>Add example for a clunky 3D high resolution loupe for napari<commit_after> | import functools
import numpy as np
import dask.array as da
from magicgui.widgets import Slider, Container
import napari
# stack = ... # your dask array
# stack2 = stack[::2, ::2, ::2]
# stack4 = stack2[::2, ::2, ::2]
# 👆 quick and easy multiscale pyramid, don't do this really
# see https://github.com/dask/dask-imag... | Add example for a clunky 3D high resolution loupe for napariimport functools
import numpy as np
import dask.array as da
from magicgui.widgets import Slider, Container
import napari
# stack = ... # your dask array
# stack2 = stack[::2, ::2, ::2]
# stack4 = stack2[::2, ::2, ::2]
# 👆 quick and easy multiscale pyramid, ... | <commit_before><commit_msg>Add example for a clunky 3D high resolution loupe for napari<commit_after>import functools
import numpy as np
import dask.array as da
from magicgui.widgets import Slider, Container
import napari
# stack = ... # your dask array
# stack2 = stack[::2, ::2, ::2]
# stack4 = stack2[::2, ::2, ::2]... | |
72f32099411644a3fed6103430f7dd78fb0929a5 | konstrukteur/ContentParser.py | konstrukteur/ContentParser.py | #
# Konstrukteur - Static website generator
# Copyright 2013 Sebastian Fastner
#
import glob, os
from jasy.core import Console
import konstrukteur.Language
import konstrukteur.Util
class ContentParser:
""" Content parser class for Konstrukteur """
def __init__(self, extensions, fixJasyCommands, defaultLanguage):
... | Add new content parser class (based upon code in Konstruktuer) | Add new content parser class (based upon code in Konstruktuer)
| Python | mit | fastner/konstrukteur,fastner/konstrukteur,fastner/konstrukteur | Add new content parser class (based upon code in Konstruktuer) | #
# Konstrukteur - Static website generator
# Copyright 2013 Sebastian Fastner
#
import glob, os
from jasy.core import Console
import konstrukteur.Language
import konstrukteur.Util
class ContentParser:
""" Content parser class for Konstrukteur """
def __init__(self, extensions, fixJasyCommands, defaultLanguage):
... | <commit_before><commit_msg>Add new content parser class (based upon code in Konstruktuer)<commit_after> | #
# Konstrukteur - Static website generator
# Copyright 2013 Sebastian Fastner
#
import glob, os
from jasy.core import Console
import konstrukteur.Language
import konstrukteur.Util
class ContentParser:
""" Content parser class for Konstrukteur """
def __init__(self, extensions, fixJasyCommands, defaultLanguage):
... | Add new content parser class (based upon code in Konstruktuer)#
# Konstrukteur - Static website generator
# Copyright 2013 Sebastian Fastner
#
import glob, os
from jasy.core import Console
import konstrukteur.Language
import konstrukteur.Util
class ContentParser:
""" Content parser class for Konstrukteur """
def ... | <commit_before><commit_msg>Add new content parser class (based upon code in Konstruktuer)<commit_after>#
# Konstrukteur - Static website generator
# Copyright 2013 Sebastian Fastner
#
import glob, os
from jasy.core import Console
import konstrukteur.Language
import konstrukteur.Util
class ContentParser:
""" Content ... | |
8939e873f4ea61169f9384eded5b8c603cfde988 | crypto/PRESUBMIT.py | crypto/PRESUBMIT.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromium presubmit script for src/net.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit ... | Add crypto pre-submit that will add the openssl builder to the default try-bot list. | Add crypto pre-submit that will add the openssl builder to the default try-bot list.
BUG=None
TEST=git try should run a linux_redux try job too.
Review URL: http://codereview.chromium.org/9235031
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@119094 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | ropik/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,adobe/chromium,ropik/chr... | Add crypto pre-submit that will add the openssl builder to the default try-bot list.
BUG=None
TEST=git try should run a linux_redux try job too.
Review URL: http://codereview.chromium.org/9235031
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@119094 0039d316-1c4b-4281-b951-d872f2087c98 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromium presubmit script for src/net.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit ... | <commit_before><commit_msg>Add crypto pre-submit that will add the openssl builder to the default try-bot list.
BUG=None
TEST=git try should run a linux_redux try job too.
Review URL: http://codereview.chromium.org/9235031
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@119094 0039d316-1c4b-4281-b951-d872f2087... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromium presubmit script for src/net.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit ... | Add crypto pre-submit that will add the openssl builder to the default try-bot list.
BUG=None
TEST=git try should run a linux_redux try job too.
Review URL: http://codereview.chromium.org/9235031
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@119094 0039d316-1c4b-4281-b951-d872f2087c98# Copyright (c) 2012 The... | <commit_before><commit_msg>Add crypto pre-submit that will add the openssl builder to the default try-bot list.
BUG=None
TEST=git try should run a linux_redux try job too.
Review URL: http://codereview.chromium.org/9235031
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@119094 0039d316-1c4b-4281-b951-d872f2087... | |
50d05aabc2eb1d5bcb20d457dd05d2882b983afa | install_and_run.py | install_and_run.py | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add installation script for profiler. | Add installation script for profiler.
| Python | apache-2.0 | tensorflow/profiler,tensorflow/profiler,tensorflow/profiler,tensorflow/profiler,tensorflow/profiler | Add installation script for profiler. | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before><commit_msg>Add installation script for profiler.<commit_after> | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add installation script for profiler.# Copyright 2020 The TensorFlow Authors. 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/LICEN... | <commit_before><commit_msg>Add installation script for profiler.<commit_after># Copyright 2020 The TensorFlow Authors. 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
#
#... | |
734967196c8f0577b218802c16d9eab31c9e9054 | problem_36.py | problem_36.py | from time import time
def is_palindrome(s):
for idx in range(len(s)/2):
if s[idx] != s[-1*idx - 1]:
return False
return True
def main():
palindrom_nums = [num for num in range(int(1e6)) if is_palindrome(str(num)) and is_palindrome(str(bin(num))[2:])]
print 'Palindroms:', palindro... | Add problem 36, palindrome binaries | Add problem 36, palindrome binaries
| Python | mit | dimkarakostas/project-euler | Add problem 36, palindrome binaries | from time import time
def is_palindrome(s):
for idx in range(len(s)/2):
if s[idx] != s[-1*idx - 1]:
return False
return True
def main():
palindrom_nums = [num for num in range(int(1e6)) if is_palindrome(str(num)) and is_palindrome(str(bin(num))[2:])]
print 'Palindroms:', palindro... | <commit_before><commit_msg>Add problem 36, palindrome binaries<commit_after> | from time import time
def is_palindrome(s):
for idx in range(len(s)/2):
if s[idx] != s[-1*idx - 1]:
return False
return True
def main():
palindrom_nums = [num for num in range(int(1e6)) if is_palindrome(str(num)) and is_palindrome(str(bin(num))[2:])]
print 'Palindroms:', palindro... | Add problem 36, palindrome binariesfrom time import time
def is_palindrome(s):
for idx in range(len(s)/2):
if s[idx] != s[-1*idx - 1]:
return False
return True
def main():
palindrom_nums = [num for num in range(int(1e6)) if is_palindrome(str(num)) and is_palindrome(str(bin(num))[2:])... | <commit_before><commit_msg>Add problem 36, palindrome binaries<commit_after>from time import time
def is_palindrome(s):
for idx in range(len(s)/2):
if s[idx] != s[-1*idx - 1]:
return False
return True
def main():
palindrom_nums = [num for num in range(int(1e6)) if is_palindrome(str(n... | |
8fddde260af6ea1e6de8491dd99dca671634327c | test/operator/utility_test.py | test/operator/utility_test.py | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | Add test for the matrix representation function. | TST: Add test for the matrix representation function.
Add a small test in R3 for the matrix representation function, to see
that one gets the same matrix back.
| Python | mpl-2.0 | odlgroup/odl,odlgroup/odl,kohr-h/odl,kohr-h/odl,aringh/odl,aringh/odl | TST: Add test for the matrix representation function.
Add a small test in R3 for the matrix representation function, to see
that one gets the same matrix back. | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | <commit_before><commit_msg>TST: Add test for the matrix representation function.
Add a small test in R3 for the matrix representation function, to see
that one gets the same matrix back.<commit_after> | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | TST: Add test for the matrix representation function.
Add a small test in R3 for the matrix representation function, to see
that one gets the same matrix back.# Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the te... | <commit_before><commit_msg>TST: Add test for the matrix representation function.
Add a small test in R3 for the matrix representation function, to see
that one gets the same matrix back.<commit_after># Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redist... | |
8b92e55fa202723f7859cd1ea22e835e5c693807 | Instanssi/kompomaatti/misc/awesometime.py | Instanssi/kompomaatti/misc/awesometime.py | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
def todayhelper():
today = datetime.today()
return datetime(day=today.day, year=today.year, month=today.month)
def format_single_helper(t):
now = datetime.now()
today = todayhelper()
tomorrow = today + timedelta(days=1)
the_day_... | Add some time handling functions | Add some time handling functions
| Python | mit | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | Add some time handling functions | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
def todayhelper():
today = datetime.today()
return datetime(day=today.day, year=today.year, month=today.month)
def format_single_helper(t):
now = datetime.now()
today = todayhelper()
tomorrow = today + timedelta(days=1)
the_day_... | <commit_before><commit_msg>Add some time handling functions<commit_after> | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
def todayhelper():
today = datetime.today()
return datetime(day=today.day, year=today.year, month=today.month)
def format_single_helper(t):
now = datetime.now()
today = todayhelper()
tomorrow = today + timedelta(days=1)
the_day_... | Add some time handling functions# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
def todayhelper():
today = datetime.today()
return datetime(day=today.day, year=today.year, month=today.month)
def format_single_helper(t):
now = datetime.now()
today = todayhelper()
tomorrow = today ... | <commit_before><commit_msg>Add some time handling functions<commit_after># -*- coding: utf-8 -*-
from datetime import datetime, timedelta
def todayhelper():
today = datetime.today()
return datetime(day=today.day, year=today.year, month=today.month)
def format_single_helper(t):
now = datetime.now()
to... | |
bca4a0a0dda95306fe126191166e733c7ccea3ee | nodeconductor/backup/perms.py | nodeconductor/backup/perms.py | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('backup.BackupSchedule', StaffPermissionLogic(any_permission=True)),
('backup.Backup', StaffPermissionLogic(any_permission=True)),
)
| Add staff permissions for backup models | Add staff permissions for backup models
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | Add staff permissions for backup models | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('backup.BackupSchedule', StaffPermissionLogic(any_permission=True)),
('backup.Backup', StaffPermissionLogic(any_permission=True)),
)
| <commit_before><commit_msg>Add staff permissions for backup models<commit_after> | from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('backup.BackupSchedule', StaffPermissionLogic(any_permission=True)),
('backup.Backup', StaffPermissionLogic(any_permission=True)),
)
| Add staff permissions for backup modelsfrom nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('backup.BackupSchedule', StaffPermissionLogic(any_permission=True)),
('backup.Backup', StaffPermissionLogic(any_permission=True)),
)
| <commit_before><commit_msg>Add staff permissions for backup models<commit_after>from nodeconductor.core.permissions import StaffPermissionLogic
PERMISSION_LOGICS = (
('backup.BackupSchedule', StaffPermissionLogic(any_permission=True)),
('backup.Backup', StaffPermissionLogic(any_permission=True)),
)
| |
2fda10a83aa5a4d3080a0ce8751e28a18fc9a3e0 | examples/two_point.py | examples/two_point.py | """
Demonstrates plotting multiple linear features with a single ``ax.pole`` call.
The real purpose of this example is to serve as an implicit regression test for
some oddities in the way axes grid lines are handled in matplotlib and
mplstereonet. A 2-vertex line can sometimes be confused for an axes grid line,
and t... | Add two-point example to serve as a regression test for gridline/plot distinguishing | Add two-point example to serve as a regression test for gridline/plot distinguishing
| Python | mit | joferkington/mplstereonet | Add two-point example to serve as a regression test for gridline/plot distinguishing | """
Demonstrates plotting multiple linear features with a single ``ax.pole`` call.
The real purpose of this example is to serve as an implicit regression test for
some oddities in the way axes grid lines are handled in matplotlib and
mplstereonet. A 2-vertex line can sometimes be confused for an axes grid line,
and t... | <commit_before><commit_msg>Add two-point example to serve as a regression test for gridline/plot distinguishing<commit_after> | """
Demonstrates plotting multiple linear features with a single ``ax.pole`` call.
The real purpose of this example is to serve as an implicit regression test for
some oddities in the way axes grid lines are handled in matplotlib and
mplstereonet. A 2-vertex line can sometimes be confused for an axes grid line,
and t... | Add two-point example to serve as a regression test for gridline/plot distinguishing"""
Demonstrates plotting multiple linear features with a single ``ax.pole`` call.
The real purpose of this example is to serve as an implicit regression test for
some oddities in the way axes grid lines are handled in matplotlib and
m... | <commit_before><commit_msg>Add two-point example to serve as a regression test for gridline/plot distinguishing<commit_after>"""
Demonstrates plotting multiple linear features with a single ``ax.pole`` call.
The real purpose of this example is to serve as an implicit regression test for
some oddities in the way axes g... | |
ee85acb7f9f3af91db3bfb4bf766636883f07685 | opal/tests/test_core_views.py | opal/tests/test_core_views.py | """
Unittests for opal.core.views
"""
from opal.core import test
from opal.core import views
class SerializerTestCase(test.OpalTestCase):
def test_serializer_default_will_super(self):
s = views.OpalSerializer()
with self.assertRaises(TypeError):
s.default(None)
| Add an extra test for the OpalSerializer | Add an extra test for the OpalSerializer
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | Add an extra test for the OpalSerializer | """
Unittests for opal.core.views
"""
from opal.core import test
from opal.core import views
class SerializerTestCase(test.OpalTestCase):
def test_serializer_default_will_super(self):
s = views.OpalSerializer()
with self.assertRaises(TypeError):
s.default(None)
| <commit_before><commit_msg>Add an extra test for the OpalSerializer<commit_after> | """
Unittests for opal.core.views
"""
from opal.core import test
from opal.core import views
class SerializerTestCase(test.OpalTestCase):
def test_serializer_default_will_super(self):
s = views.OpalSerializer()
with self.assertRaises(TypeError):
s.default(None)
| Add an extra test for the OpalSerializer"""
Unittests for opal.core.views
"""
from opal.core import test
from opal.core import views
class SerializerTestCase(test.OpalTestCase):
def test_serializer_default_will_super(self):
s = views.OpalSerializer()
with self.assertRaises(TypeError):
... | <commit_before><commit_msg>Add an extra test for the OpalSerializer<commit_after>"""
Unittests for opal.core.views
"""
from opal.core import test
from opal.core import views
class SerializerTestCase(test.OpalTestCase):
def test_serializer_default_will_super(self):
s = views.OpalSerializer()
with ... | |
a0a2017e05af986cd0a7207c429e7dc5e8b3fcd2 | tests/test_solver_variable.py | tests/test_solver_variable.py | from gaphas.solver import Variable
def test_equality():
v = Variable(3)
w = Variable(3)
o = Variable(2)
assert v == 3
assert 3 == v
assert v == w
assert not v == o
assert v != 2
assert 2 != v
assert not 3 != v
assert v != o
def test_add_to_variable():
v = Variable(3... | Add missing tests for Variable | Add missing tests for Variable
| Python | lgpl-2.1 | amolenaar/gaphas | Add missing tests for Variable | from gaphas.solver import Variable
def test_equality():
v = Variable(3)
w = Variable(3)
o = Variable(2)
assert v == 3
assert 3 == v
assert v == w
assert not v == o
assert v != 2
assert 2 != v
assert not 3 != v
assert v != o
def test_add_to_variable():
v = Variable(3... | <commit_before><commit_msg>Add missing tests for Variable<commit_after> | from gaphas.solver import Variable
def test_equality():
v = Variable(3)
w = Variable(3)
o = Variable(2)
assert v == 3
assert 3 == v
assert v == w
assert not v == o
assert v != 2
assert 2 != v
assert not 3 != v
assert v != o
def test_add_to_variable():
v = Variable(3... | Add missing tests for Variablefrom gaphas.solver import Variable
def test_equality():
v = Variable(3)
w = Variable(3)
o = Variable(2)
assert v == 3
assert 3 == v
assert v == w
assert not v == o
assert v != 2
assert 2 != v
assert not 3 != v
assert v != o
def test_add_to_... | <commit_before><commit_msg>Add missing tests for Variable<commit_after>from gaphas.solver import Variable
def test_equality():
v = Variable(3)
w = Variable(3)
o = Variable(2)
assert v == 3
assert 3 == v
assert v == w
assert not v == o
assert v != 2
assert 2 != v
assert not 3 ... | |
e87982d03edeb7c16d3c183309adfff4be50d168 | gui/qt.py | gui/qt.py | from lib.version import AMON_VERSION
from lib.keybase import KeybaseUser
from lib.gmail import GmailUser
from lib.addresses import AddressBook
import lib.gpg as gpg
import sys
import logging
import json
from PyQt4 import QtGui
class Amon(QtGui.QMainWindow):
def __init__(self):
super(Amon, self).__init__(... | Add Qt4 file to start on creating a Qt-based GUI | Add Qt4 file to start on creating a Qt-based GUI
| Python | unlicense | CodingAnarchy/Amon | Add Qt4 file to start on creating a Qt-based GUI | from lib.version import AMON_VERSION
from lib.keybase import KeybaseUser
from lib.gmail import GmailUser
from lib.addresses import AddressBook
import lib.gpg as gpg
import sys
import logging
import json
from PyQt4 import QtGui
class Amon(QtGui.QMainWindow):
def __init__(self):
super(Amon, self).__init__(... | <commit_before><commit_msg>Add Qt4 file to start on creating a Qt-based GUI<commit_after> | from lib.version import AMON_VERSION
from lib.keybase import KeybaseUser
from lib.gmail import GmailUser
from lib.addresses import AddressBook
import lib.gpg as gpg
import sys
import logging
import json
from PyQt4 import QtGui
class Amon(QtGui.QMainWindow):
def __init__(self):
super(Amon, self).__init__(... | Add Qt4 file to start on creating a Qt-based GUIfrom lib.version import AMON_VERSION
from lib.keybase import KeybaseUser
from lib.gmail import GmailUser
from lib.addresses import AddressBook
import lib.gpg as gpg
import sys
import logging
import json
from PyQt4 import QtGui
class Amon(QtGui.QMainWindow):
def __i... | <commit_before><commit_msg>Add Qt4 file to start on creating a Qt-based GUI<commit_after>from lib.version import AMON_VERSION
from lib.keybase import KeybaseUser
from lib.gmail import GmailUser
from lib.addresses import AddressBook
import lib.gpg as gpg
import sys
import logging
import json
from PyQt4 import QtGui
c... | |
8ae3e44b0a43f382c98194b9caa097b62de899ef | nlpppln/save_ner_data.py | nlpppln/save_ner_data.py | #!/usr/bin/env python
import click
import os
import codecs
import json
import pandas as pd
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_file', type=click.Path())
def nerstats(input_dir, output_file):
output_dir = os.path.dirname(output_file)
if not os.pat... | Add script to save ner data to a csv file | Add script to save ner data to a csv file
| Python | apache-2.0 | WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln | Add script to save ner data to a csv file | #!/usr/bin/env python
import click
import os
import codecs
import json
import pandas as pd
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_file', type=click.Path())
def nerstats(input_dir, output_file):
output_dir = os.path.dirname(output_file)
if not os.pat... | <commit_before><commit_msg>Add script to save ner data to a csv file<commit_after> | #!/usr/bin/env python
import click
import os
import codecs
import json
import pandas as pd
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_file', type=click.Path())
def nerstats(input_dir, output_file):
output_dir = os.path.dirname(output_file)
if not os.pat... | Add script to save ner data to a csv file#!/usr/bin/env python
import click
import os
import codecs
import json
import pandas as pd
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_file', type=click.Path())
def nerstats(input_dir, output_file):
output_dir = os.pa... | <commit_before><commit_msg>Add script to save ner data to a csv file<commit_after>#!/usr/bin/env python
import click
import os
import codecs
import json
import pandas as pd
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_file', type=click.Path())
def nerstats(input_... | |
59de1a12d44245b69ade0d4703c98bf772681751 | user_management/models/tests/test_admin_forms.py | user_management/models/tests/test_admin_forms.py | from django.core.exceptions import ValidationError
from django.test import TestCase
from .. import admin_forms
from . factories import UserFactory
class UserCreationFormTest(TestCase):
def test_clean_email(self):
email = 'test@example.com'
form = admin_forms.UserCreationForm()
form.clean... | Add tests for User admin_forms | Add tests for User admin_forms
| Python | bsd-2-clause | incuna/django-user-management,incuna/django-user-management | Add tests for User admin_forms | from django.core.exceptions import ValidationError
from django.test import TestCase
from .. import admin_forms
from . factories import UserFactory
class UserCreationFormTest(TestCase):
def test_clean_email(self):
email = 'test@example.com'
form = admin_forms.UserCreationForm()
form.clean... | <commit_before><commit_msg>Add tests for User admin_forms<commit_after> | from django.core.exceptions import ValidationError
from django.test import TestCase
from .. import admin_forms
from . factories import UserFactory
class UserCreationFormTest(TestCase):
def test_clean_email(self):
email = 'test@example.com'
form = admin_forms.UserCreationForm()
form.clean... | Add tests for User admin_formsfrom django.core.exceptions import ValidationError
from django.test import TestCase
from .. import admin_forms
from . factories import UserFactory
class UserCreationFormTest(TestCase):
def test_clean_email(self):
email = 'test@example.com'
form = admin_forms.UserCre... | <commit_before><commit_msg>Add tests for User admin_forms<commit_after>from django.core.exceptions import ValidationError
from django.test import TestCase
from .. import admin_forms
from . factories import UserFactory
class UserCreationFormTest(TestCase):
def test_clean_email(self):
email = 'test@example... | |
bae50495106ce5c9cb39143a58e0e73a4e823d29 | loader.py | loader.py | from __future__ import print_function, absolute_import, unicode_literals, division
from stackable.stack import Stack
from stackable.utils import StackablePickler
from stackable.network import StackableSocket, StackablePacketAssembler
from sys import modules
from types import ModuleType
class DispatchLoader(object):
d... | Implement DispatchLoader (metapath import hook) | Implement DispatchLoader (metapath import hook)
| Python | mit | joushou/dispatch,joushou/dispatch | Implement DispatchLoader (metapath import hook) | from __future__ import print_function, absolute_import, unicode_literals, division
from stackable.stack import Stack
from stackable.utils import StackablePickler
from stackable.network import StackableSocket, StackablePacketAssembler
from sys import modules
from types import ModuleType
class DispatchLoader(object):
d... | <commit_before><commit_msg>Implement DispatchLoader (metapath import hook)<commit_after> | from __future__ import print_function, absolute_import, unicode_literals, division
from stackable.stack import Stack
from stackable.utils import StackablePickler
from stackable.network import StackableSocket, StackablePacketAssembler
from sys import modules
from types import ModuleType
class DispatchLoader(object):
d... | Implement DispatchLoader (metapath import hook)from __future__ import print_function, absolute_import, unicode_literals, division
from stackable.stack import Stack
from stackable.utils import StackablePickler
from stackable.network import StackableSocket, StackablePacketAssembler
from sys import modules
from types impo... | <commit_before><commit_msg>Implement DispatchLoader (metapath import hook)<commit_after>from __future__ import print_function, absolute_import, unicode_literals, division
from stackable.stack import Stack
from stackable.utils import StackablePickler
from stackable.network import StackableSocket, StackablePacketAssemble... | |
5d795253180ef11117ae27447fa597fa15b40734 | tests/test_graph.py | tests/test_graph.py | import os
from click.testing import CliRunner
from cli.script import cli
def get_graph_code():
return '''
from copy import deepcopy as dc
class StringCopier(object):
def __init__(self):
self.copied_strings = set()
def copy(self):
string1 = 'this'
string2 = dc(string1)
s... | Add testing for graphing code | Add testing for graphing code
| Python | mit | LaurEars/codegrapher | Add testing for graphing code | import os
from click.testing import CliRunner
from cli.script import cli
def get_graph_code():
return '''
from copy import deepcopy as dc
class StringCopier(object):
def __init__(self):
self.copied_strings = set()
def copy(self):
string1 = 'this'
string2 = dc(string1)
s... | <commit_before><commit_msg>Add testing for graphing code<commit_after> | import os
from click.testing import CliRunner
from cli.script import cli
def get_graph_code():
return '''
from copy import deepcopy as dc
class StringCopier(object):
def __init__(self):
self.copied_strings = set()
def copy(self):
string1 = 'this'
string2 = dc(string1)
s... | Add testing for graphing codeimport os
from click.testing import CliRunner
from cli.script import cli
def get_graph_code():
return '''
from copy import deepcopy as dc
class StringCopier(object):
def __init__(self):
self.copied_strings = set()
def copy(self):
string1 = 'this'
st... | <commit_before><commit_msg>Add testing for graphing code<commit_after>import os
from click.testing import CliRunner
from cli.script import cli
def get_graph_code():
return '''
from copy import deepcopy as dc
class StringCopier(object):
def __init__(self):
self.copied_strings = set()
def copy(s... | |
5ae58621bd766aeaa6f1838397b045039568887c | platesolve.py | platesolve.py | import babeldix
import sys
import operator
# Print solutions in order of increasing score
for plate in sys.argv[1:]:
solns = babeldix.Plates.get_solutions(plate)
for (soln,score) in sorted(solns.items(), key=operator.itemgetter(1)):
print '{0:s} {1:d} {2:s}'.format(plate,score,soln)
| Add driver to find plate solutions | Add driver to find plate solutions
| Python | mit | dkirkby/babeldix | Add driver to find plate solutions | import babeldix
import sys
import operator
# Print solutions in order of increasing score
for plate in sys.argv[1:]:
solns = babeldix.Plates.get_solutions(plate)
for (soln,score) in sorted(solns.items(), key=operator.itemgetter(1)):
print '{0:s} {1:d} {2:s}'.format(plate,score,soln)
| <commit_before><commit_msg>Add driver to find plate solutions<commit_after> | import babeldix
import sys
import operator
# Print solutions in order of increasing score
for plate in sys.argv[1:]:
solns = babeldix.Plates.get_solutions(plate)
for (soln,score) in sorted(solns.items(), key=operator.itemgetter(1)):
print '{0:s} {1:d} {2:s}'.format(plate,score,soln)
| Add driver to find plate solutionsimport babeldix
import sys
import operator
# Print solutions in order of increasing score
for plate in sys.argv[1:]:
solns = babeldix.Plates.get_solutions(plate)
for (soln,score) in sorted(solns.items(), key=operator.itemgetter(1)):
print '{0:s} {1:d} {2:s}'.format(p... | <commit_before><commit_msg>Add driver to find plate solutions<commit_after>import babeldix
import sys
import operator
# Print solutions in order of increasing score
for plate in sys.argv[1:]:
solns = babeldix.Plates.get_solutions(plate)
for (soln,score) in sorted(solns.items(), key=operator.itemgetter(1)):
... | |
c1bfe92878edc3f9598a6d97046775cb8d9b0aa0 | depot/migrations/0009_auto_20170330_1342.py | depot/migrations/0009_auto_20170330_1342.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-30 13:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('depot', '0008_auto_20170330_0855'),
]
operations = [
migrations.AlterField(... | Make migration for item-visibility change | Make migration for item-visibility change
| Python | agpl-3.0 | verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool | Make migration for item-visibility change | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-30 13:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('depot', '0008_auto_20170330_0855'),
]
operations = [
migrations.AlterField(... | <commit_before><commit_msg>Make migration for item-visibility change<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-30 13:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('depot', '0008_auto_20170330_0855'),
]
operations = [
migrations.AlterField(... | Make migration for item-visibility change# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-30 13:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('depot', '0008_auto_20170330_0855'),
]
oper... | <commit_before><commit_msg>Make migration for item-visibility change<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-30 13:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('depot', '0... | |
0e53f398bf2cf885393865ec1f899308bb56625b | examples/create_a_view_low_level.py | examples/create_a_view_low_level.py | """
A low level example:
This is how JenkinsAPI creates views
"""
import requests
import json
url = 'http://localhost:8080/newView'
str_view_name = "ddsfddfd"
params = {}# {'name': str_view_name}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = {
"mode": "hudson.model.ListView",
#"Submit"... | Add a low-level example for creating views. | Add a low-level example for creating views.
| Python | mit | mistermocha/jenkinsapi,imsardine/jenkinsapi,mistermocha/jenkinsapi,JohnLZeller/jenkinsapi,JohnLZeller/jenkinsapi,aerickson/jenkinsapi,zaro0508/jenkinsapi,imsardine/jenkinsapi,zaro0508/jenkinsapi,jduan/jenkinsapi,domenkozar/jenkinsapi,mistermocha/jenkinsapi,jduan/jenkinsapi,salimfadhley/jenkinsapi,salimfadhley/jenkinsap... | Add a low-level example for creating views. | """
A low level example:
This is how JenkinsAPI creates views
"""
import requests
import json
url = 'http://localhost:8080/newView'
str_view_name = "ddsfddfd"
params = {}# {'name': str_view_name}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = {
"mode": "hudson.model.ListView",
#"Submit"... | <commit_before><commit_msg>Add a low-level example for creating views.<commit_after> | """
A low level example:
This is how JenkinsAPI creates views
"""
import requests
import json
url = 'http://localhost:8080/newView'
str_view_name = "ddsfddfd"
params = {}# {'name': str_view_name}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = {
"mode": "hudson.model.ListView",
#"Submit"... | Add a low-level example for creating views."""
A low level example:
This is how JenkinsAPI creates views
"""
import requests
import json
url = 'http://localhost:8080/newView'
str_view_name = "ddsfddfd"
params = {}# {'name': str_view_name}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = {
"mo... | <commit_before><commit_msg>Add a low-level example for creating views.<commit_after>"""
A low level example:
This is how JenkinsAPI creates views
"""
import requests
import json
url = 'http://localhost:8080/newView'
str_view_name = "ddsfddfd"
params = {}# {'name': str_view_name}
headers = {'Content-Type': 'application... | |
4c73cad398d5dac85b264187f709a860f356b311 | smipyping/_mysqldbmixin.py | smipyping/_mysqldbmixin.py | #!/usr/bin/env python
# (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | Add new file with mixin for mysql | Add new file with mixin for mysql
| Python | mit | KSchopmeyer/smipyping,KSchopmeyer/smipyping,KSchopmeyer/smipyping,KSchopmeyer/smipyping,KSchopmeyer/smipyping | Add new file with mixin for mysql | #!/usr/bin/env python
# (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | <commit_before><commit_msg>Add new file with mixin for mysql<commit_after> | #!/usr/bin/env python
# (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | Add new file with mixin for mysql#!/usr/bin/env python
# (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apac... | <commit_before><commit_msg>Add new file with mixin for mysql<commit_after>#!/usr/bin/env python
# (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | |
c57c672aae98fb5b280f70b68ac27fc2d94a243f | tests/estimator/classifier/RandomForestClassifier/RandomForestClassifierGoTest.py | tests/estimator/classifier/RandomForestClassifier/RandomForestClassifierGoTest.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from sklearn.ensemble import RandomForestClassifier
from tests.estimator.classifier.Classifier import Classifier
from tests.language.Go import Go
class RandomForestClassifierGoTest(Go, Classifier, TestCase):
def setUp(self):
super(RandomForestClass... | Add test class to cover the RandomForestClassifier in Go | Add test class to cover the RandomForestClassifier in Go
| Python | bsd-3-clause | nok/sklearn-porter | Add test class to cover the RandomForestClassifier in Go | # -*- coding: utf-8 -*-
from unittest import TestCase
from sklearn.ensemble import RandomForestClassifier
from tests.estimator.classifier.Classifier import Classifier
from tests.language.Go import Go
class RandomForestClassifierGoTest(Go, Classifier, TestCase):
def setUp(self):
super(RandomForestClass... | <commit_before><commit_msg>Add test class to cover the RandomForestClassifier in Go<commit_after> | # -*- coding: utf-8 -*-
from unittest import TestCase
from sklearn.ensemble import RandomForestClassifier
from tests.estimator.classifier.Classifier import Classifier
from tests.language.Go import Go
class RandomForestClassifierGoTest(Go, Classifier, TestCase):
def setUp(self):
super(RandomForestClass... | Add test class to cover the RandomForestClassifier in Go# -*- coding: utf-8 -*-
from unittest import TestCase
from sklearn.ensemble import RandomForestClassifier
from tests.estimator.classifier.Classifier import Classifier
from tests.language.Go import Go
class RandomForestClassifierGoTest(Go, Classifier, TestCase... | <commit_before><commit_msg>Add test class to cover the RandomForestClassifier in Go<commit_after># -*- coding: utf-8 -*-
from unittest import TestCase
from sklearn.ensemble import RandomForestClassifier
from tests.estimator.classifier.Classifier import Classifier
from tests.language.Go import Go
class RandomForest... | |
ab99f855f708dec213c9eea1489643c01526e0b0 | lib/bridgedb/test/test_parse_versions.py | lib/bridgedb/test/test_parse_versions.py | # -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2014, The Tor Proje... | Add unittests for bridgedb.parse.versions module. | Add unittests for bridgedb.parse.versions module.
| Python | bsd-3-clause | pagea/bridgedb,pagea/bridgedb | Add unittests for bridgedb.parse.versions module. | # -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2014, The Tor Proje... | <commit_before><commit_msg>Add unittests for bridgedb.parse.versions module.<commit_after> | # -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2014, The Tor Proje... | Add unittests for bridgedb.parse.versions module.# -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see A... | <commit_before><commit_msg>Add unittests for bridgedb.parse.versions module.<commit_after># -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torp... | |
1a4db50c848a3e7bb1323ae9e6b26c884187c575 | training/level-1-the-zen-of-python/dragon-warrior/fibonacci/rwharris-nd_fibonacci.py | training/level-1-the-zen-of-python/dragon-warrior/fibonacci/rwharris-nd_fibonacci.py | def even_fibonacci_sum(a:int,b:int,max:int) -> int:
temp = 0
sum = 0
while (b <= max):
if (b%2 == 0):
sum += b
temp = a + b
a = b
b = temp
print(sum)
even_fibonacci_sum(1,2,4000000) | Add my fibonacci sequence homework. | Add my fibonacci sequence homework.
| Python | artistic-2.0 | bigfatpanda-training/pandas-practical-python-primer,bigfatpanda-training/pandas-practical-python-primer | Add my fibonacci sequence homework. | def even_fibonacci_sum(a:int,b:int,max:int) -> int:
temp = 0
sum = 0
while (b <= max):
if (b%2 == 0):
sum += b
temp = a + b
a = b
b = temp
print(sum)
even_fibonacci_sum(1,2,4000000) | <commit_before><commit_msg>Add my fibonacci sequence homework.<commit_after> | def even_fibonacci_sum(a:int,b:int,max:int) -> int:
temp = 0
sum = 0
while (b <= max):
if (b%2 == 0):
sum += b
temp = a + b
a = b
b = temp
print(sum)
even_fibonacci_sum(1,2,4000000) | Add my fibonacci sequence homework.def even_fibonacci_sum(a:int,b:int,max:int) -> int:
temp = 0
sum = 0
while (b <= max):
if (b%2 == 0):
sum += b
temp = a + b
a = b
b = temp
print(sum)
even_fibonacci_sum(1,2,4000000) | <commit_before><commit_msg>Add my fibonacci sequence homework.<commit_after>def even_fibonacci_sum(a:int,b:int,max:int) -> int:
temp = 0
sum = 0
while (b <= max):
if (b%2 == 0):
sum += b
temp = a + b
a = b
b = temp
print(sum)
even_fibonacci_sum... | |
f14c483283984b793f1209255e059d7b9deb414c | migrations/versions/8081a5906af_.py | migrations/versions/8081a5906af_.py | """empty message
Revision ID: 8081a5906af
Revises: 575d8824e34c
Create Date: 2015-08-25 18:04:56.738898
"""
# revision identifiers, used by Alembic.
revision = '8081a5906af'
down_revision = '575d8824e34c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | Add in the db migration | Add in the db migration
| Python | mit | MaxPresman/cfapi,smalley/cfapi,smalley/cfapi,codeforamerica/cfapi,codeforamerica/cfapi,MaxPresman/cfapi,MaxPresman/cfapi,smalley/cfapi | Add in the db migration | """empty message
Revision ID: 8081a5906af
Revises: 575d8824e34c
Create Date: 2015-08-25 18:04:56.738898
"""
# revision identifiers, used by Alembic.
revision = '8081a5906af'
down_revision = '575d8824e34c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | <commit_before><commit_msg>Add in the db migration<commit_after> | """empty message
Revision ID: 8081a5906af
Revises: 575d8824e34c
Create Date: 2015-08-25 18:04:56.738898
"""
# revision identifiers, used by Alembic.
revision = '8081a5906af'
down_revision = '575d8824e34c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | Add in the db migration"""empty message
Revision ID: 8081a5906af
Revises: 575d8824e34c
Create Date: 2015-08-25 18:04:56.738898
"""
# revision identifiers, used by Alembic.
revision = '8081a5906af'
down_revision = '575d8824e34c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto ge... | <commit_before><commit_msg>Add in the db migration<commit_after>"""empty message
Revision ID: 8081a5906af
Revises: 575d8824e34c
Create Date: 2015-08-25 18:04:56.738898
"""
# revision identifiers, used by Alembic.
revision = '8081a5906af'
down_revision = '575d8824e34c'
from alembic import op
import sqlalchemy as sa
... | |
a4bc16a375dc30e37034993bd07d3014f3b936e1 | migrations/versions/201610041721_8b5ab7da2d5_fix_corrupt_abstract_field_data.py | migrations/versions/201610041721_8b5ab7da2d5_fix_corrupt_abstract_field_data.py | """Fix corrupt abstract field data
Revision ID: 8b5ab7da2d5
Revises: 52d970fb6a74
Create Date: 2016-10-04 17:21:19.186125
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '8b5ab7da2d5'
down_revision = '52d970fb6a74'
def upgrade():
# We don't want any dicts... | Fix corrupt abstract field data | Fix corrupt abstract field data
| Python | mit | pferreir/indico,mic4ael/indico,ThiefMaster/indico,mvidalgarcia/indico,DirkHoffmann/indico,indico/indico,DirkHoffmann/indico,mvidalgarcia/indico,indico/indico,pferreir/indico,indico/indico,ThiefMaster/indico,OmeGak/indico,DirkHoffmann/indico,indico/indico,mic4ael/indico,mic4ael/indico,mic4ael/indico,ThiefMaster/indico,O... | Fix corrupt abstract field data | """Fix corrupt abstract field data
Revision ID: 8b5ab7da2d5
Revises: 52d970fb6a74
Create Date: 2016-10-04 17:21:19.186125
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '8b5ab7da2d5'
down_revision = '52d970fb6a74'
def upgrade():
# We don't want any dicts... | <commit_before><commit_msg>Fix corrupt abstract field data<commit_after> | """Fix corrupt abstract field data
Revision ID: 8b5ab7da2d5
Revises: 52d970fb6a74
Create Date: 2016-10-04 17:21:19.186125
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '8b5ab7da2d5'
down_revision = '52d970fb6a74'
def upgrade():
# We don't want any dicts... | Fix corrupt abstract field data"""Fix corrupt abstract field data
Revision ID: 8b5ab7da2d5
Revises: 52d970fb6a74
Create Date: 2016-10-04 17:21:19.186125
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '8b5ab7da2d5'
down_revision = '52d970fb6a74'
def upgrade()... | <commit_before><commit_msg>Fix corrupt abstract field data<commit_after>"""Fix corrupt abstract field data
Revision ID: 8b5ab7da2d5
Revises: 52d970fb6a74
Create Date: 2016-10-04 17:21:19.186125
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '8b5ab7da2d5'
down_... | |
ef745ed086ebd8e77e158c89b577c77296630320 | Python/118_Pascals_Triangle.py | Python/118_Pascals_Triangle.py | class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
res = [[1],[1,1]]
if numRows == 0:
return []
elif numRows == 1:
return [[1]]
else:
old = [1,1]
for i in xrange(n... | Add solution for 118 pascals triangle | Add solution for 118 pascals triangle
| Python | mit | comicxmz001/LeetCode,comicxmz001/LeetCode | Add solution for 118 pascals triangle | class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
res = [[1],[1,1]]
if numRows == 0:
return []
elif numRows == 1:
return [[1]]
else:
old = [1,1]
for i in xrange(n... | <commit_before><commit_msg>Add solution for 118 pascals triangle<commit_after> | class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
res = [[1],[1,1]]
if numRows == 0:
return []
elif numRows == 1:
return [[1]]
else:
old = [1,1]
for i in xrange(n... | Add solution for 118 pascals triangleclass Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
res = [[1],[1,1]]
if numRows == 0:
return []
elif numRows == 1:
return [[1]]
else:
o... | <commit_before><commit_msg>Add solution for 118 pascals triangle<commit_after>class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
res = [[1],[1,1]]
if numRows == 0:
return []
elif numRows == 1:
... | |
a8b524318d7f9d4406193d610b2bb3ef8e56e147 | examples/frameless_drag_region.py | examples/frameless_drag_region.py | import webview
'''
This example demonstrates a user-provided "drag region" to move a frameless window
around, whilst maintaining normal mouse down/move events elsewhere. This roughly
replicates `-webkit-drag-region`.
'''
html = '''
<head>
<style type="text/css">
.pywebview-drag-region {
width:... | Add frameless drag region example. | Add frameless drag region example.
| Python | bsd-3-clause | r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview | Add frameless drag region example. | import webview
'''
This example demonstrates a user-provided "drag region" to move a frameless window
around, whilst maintaining normal mouse down/move events elsewhere. This roughly
replicates `-webkit-drag-region`.
'''
html = '''
<head>
<style type="text/css">
.pywebview-drag-region {
width:... | <commit_before><commit_msg>Add frameless drag region example.<commit_after> | import webview
'''
This example demonstrates a user-provided "drag region" to move a frameless window
around, whilst maintaining normal mouse down/move events elsewhere. This roughly
replicates `-webkit-drag-region`.
'''
html = '''
<head>
<style type="text/css">
.pywebview-drag-region {
width:... | Add frameless drag region example.import webview
'''
This example demonstrates a user-provided "drag region" to move a frameless window
around, whilst maintaining normal mouse down/move events elsewhere. This roughly
replicates `-webkit-drag-region`.
'''
html = '''
<head>
<style type="text/css">
.pywebvie... | <commit_before><commit_msg>Add frameless drag region example.<commit_after>import webview
'''
This example demonstrates a user-provided "drag region" to move a frameless window
around, whilst maintaining normal mouse down/move events elsewhere. This roughly
replicates `-webkit-drag-region`.
'''
html = '''
<head>
... | |
2a1b46740c4cf14f7db4f344431aced9bf06d1e7 | scripts/sync_for_real.py | scripts/sync_for_real.py | #!/usr/bin/env python3
import subprocess
import sys
from time import time
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def main():
nr_fast = 3
while nr_fast > 0:
eprint('syncing... ', end='', flush=True)
start_t = time()
subprocess.Popen('/usr/bin/sync',... | Add a little program that calls sync until is is done | Add a little program that calls sync until is is done
| Python | unlicense | paolobolzoni/useful-conf,paolobolzoni/useful-conf,paolobolzoni/useful-conf | Add a little program that calls sync until is is done | #!/usr/bin/env python3
import subprocess
import sys
from time import time
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def main():
nr_fast = 3
while nr_fast > 0:
eprint('syncing... ', end='', flush=True)
start_t = time()
subprocess.Popen('/usr/bin/sync',... | <commit_before><commit_msg>Add a little program that calls sync until is is done<commit_after> | #!/usr/bin/env python3
import subprocess
import sys
from time import time
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def main():
nr_fast = 3
while nr_fast > 0:
eprint('syncing... ', end='', flush=True)
start_t = time()
subprocess.Popen('/usr/bin/sync',... | Add a little program that calls sync until is is done#!/usr/bin/env python3
import subprocess
import sys
from time import time
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def main():
nr_fast = 3
while nr_fast > 0:
eprint('syncing... ', end='', flush=True)
start... | <commit_before><commit_msg>Add a little program that calls sync until is is done<commit_after>#!/usr/bin/env python3
import subprocess
import sys
from time import time
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def main():
nr_fast = 3
while nr_fast > 0:
eprint('syncin... | |
91bb7506bd20ed22b8787e7a8b9975cc07e97175 | owners_client.py | owners_client.py | # Copyright (c) 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class OwnersClient(object):
"""Interact with OWNERS files in a repository.
This class allows you to interact with OWNERS files in a repository both... | Add owners client to depot_tools. | [depot_tools][owners] Add owners client to depot_tools.
Add an owners API that will be used by Depot Tools to
interact with OWNERS files.
The API will be implemented using both owners.py and the
Gerrit Code-Owners plugin REST API. All Depot Tools code
will be modified to use this API.
Change-Id: I7cf059a0895dbae105a... | Python | bsd-3-clause | CoherentLabs/depot_tools,CoherentLabs/depot_tools | [depot_tools][owners] Add owners client to depot_tools.
Add an owners API that will be used by Depot Tools to
interact with OWNERS files.
The API will be implemented using both owners.py and the
Gerrit Code-Owners plugin REST API. All Depot Tools code
will be modified to use this API.
Change-Id: I7cf059a0895dbae105a... | # Copyright (c) 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class OwnersClient(object):
"""Interact with OWNERS files in a repository.
This class allows you to interact with OWNERS files in a repository both... | <commit_before><commit_msg>[depot_tools][owners] Add owners client to depot_tools.
Add an owners API that will be used by Depot Tools to
interact with OWNERS files.
The API will be implemented using both owners.py and the
Gerrit Code-Owners plugin REST API. All Depot Tools code
will be modified to use this API.
Chan... | # Copyright (c) 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class OwnersClient(object):
"""Interact with OWNERS files in a repository.
This class allows you to interact with OWNERS files in a repository both... | [depot_tools][owners] Add owners client to depot_tools.
Add an owners API that will be used by Depot Tools to
interact with OWNERS files.
The API will be implemented using both owners.py and the
Gerrit Code-Owners plugin REST API. All Depot Tools code
will be modified to use this API.
Change-Id: I7cf059a0895dbae105a... | <commit_before><commit_msg>[depot_tools][owners] Add owners client to depot_tools.
Add an owners API that will be used by Depot Tools to
interact with OWNERS files.
The API will be implemented using both owners.py and the
Gerrit Code-Owners plugin REST API. All Depot Tools code
will be modified to use this API.
Chan... | |
1be4e6f97b3d062c4fa07f70b05305bf32593fd4 | dotbriefs/tests/test_smudge.py | dotbriefs/tests/test_smudge.py | import unittest
from dotbriefs.smudge import SmudgeTemplate
class TestCleanSecret(unittest.TestCase):
def setUp(self):
self.secrets = {}
self.secrets['password'] = 's3cr3t'
self.secrets['question'] = 'h1dd3n 4g3nd4'
self.template = []
self.template.append(SmudgeTemplate('... | Add test cases for smudge | Add test cases for smudge
| Python | bsd-3-clause | oohlaf/dotsecrets | Add test cases for smudge | import unittest
from dotbriefs.smudge import SmudgeTemplate
class TestCleanSecret(unittest.TestCase):
def setUp(self):
self.secrets = {}
self.secrets['password'] = 's3cr3t'
self.secrets['question'] = 'h1dd3n 4g3nd4'
self.template = []
self.template.append(SmudgeTemplate('... | <commit_before><commit_msg>Add test cases for smudge<commit_after> | import unittest
from dotbriefs.smudge import SmudgeTemplate
class TestCleanSecret(unittest.TestCase):
def setUp(self):
self.secrets = {}
self.secrets['password'] = 's3cr3t'
self.secrets['question'] = 'h1dd3n 4g3nd4'
self.template = []
self.template.append(SmudgeTemplate('... | Add test cases for smudgeimport unittest
from dotbriefs.smudge import SmudgeTemplate
class TestCleanSecret(unittest.TestCase):
def setUp(self):
self.secrets = {}
self.secrets['password'] = 's3cr3t'
self.secrets['question'] = 'h1dd3n 4g3nd4'
self.template = []
self.templat... | <commit_before><commit_msg>Add test cases for smudge<commit_after>import unittest
from dotbriefs.smudge import SmudgeTemplate
class TestCleanSecret(unittest.TestCase):
def setUp(self):
self.secrets = {}
self.secrets['password'] = 's3cr3t'
self.secrets['question'] = 'h1dd3n 4g3nd4'
... | |
254239102955bb8916aab98530251b5cdd79ce50 | cypher/siggen.py | cypher/siggen.py | #!/usr/bin/env python
import argparse
import subprocess
import os
import shutil
import sys
from util import write_signature
parser = argparse.ArgumentParser()
parser.add_argument(
"-l",
"--language",
help="Source code language.",
required=True
)
TEMP_DIR = os.path.join(os.getcwd(), "cypher", "temp")
... | Add script to write base signatures | Add script to write base signatures
| Python | mit | jdkato/codetype,jdkato/codetype | Add script to write base signatures | #!/usr/bin/env python
import argparse
import subprocess
import os
import shutil
import sys
from util import write_signature
parser = argparse.ArgumentParser()
parser.add_argument(
"-l",
"--language",
help="Source code language.",
required=True
)
TEMP_DIR = os.path.join(os.getcwd(), "cypher", "temp")
... | <commit_before><commit_msg>Add script to write base signatures<commit_after> | #!/usr/bin/env python
import argparse
import subprocess
import os
import shutil
import sys
from util import write_signature
parser = argparse.ArgumentParser()
parser.add_argument(
"-l",
"--language",
help="Source code language.",
required=True
)
TEMP_DIR = os.path.join(os.getcwd(), "cypher", "temp")
... | Add script to write base signatures#!/usr/bin/env python
import argparse
import subprocess
import os
import shutil
import sys
from util import write_signature
parser = argparse.ArgumentParser()
parser.add_argument(
"-l",
"--language",
help="Source code language.",
required=True
)
TEMP_DIR = os.path.j... | <commit_before><commit_msg>Add script to write base signatures<commit_after>#!/usr/bin/env python
import argparse
import subprocess
import os
import shutil
import sys
from util import write_signature
parser = argparse.ArgumentParser()
parser.add_argument(
"-l",
"--language",
help="Source code language.",
... | |
19b13f0fb9b86ec99025bd1baf2c4d5fe757f809 | tests/test_tests.py | tests/test_tests.py | import pytest
def test_BeautifulSoup_methods_are_overridden(
client_request,
mock_get_service_and_organisation_counts,
):
client_request.logout()
page = client_request.get("main.index", _test_page_title=False)
with pytest.raises(AttributeError) as exception:
page.find("h1")
assert st... | Add a test to make sure exception is raised | Add a test to make sure exception is raised
None of our code should be raising this exception, so it’s possible it
could stop working without us knowing about it.
This commit adds a tests to alert us if the override ever does silently
stop working (for example because of a change in `BeautifulSoup`)
| Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | Add a test to make sure exception is raised
None of our code should be raising this exception, so it’s possible it
could stop working without us knowing about it.
This commit adds a tests to alert us if the override ever does silently
stop working (for example because of a change in `BeautifulSoup`) | import pytest
def test_BeautifulSoup_methods_are_overridden(
client_request,
mock_get_service_and_organisation_counts,
):
client_request.logout()
page = client_request.get("main.index", _test_page_title=False)
with pytest.raises(AttributeError) as exception:
page.find("h1")
assert st... | <commit_before><commit_msg>Add a test to make sure exception is raised
None of our code should be raising this exception, so it’s possible it
could stop working without us knowing about it.
This commit adds a tests to alert us if the override ever does silently
stop working (for example because of a change in `Beauti... | import pytest
def test_BeautifulSoup_methods_are_overridden(
client_request,
mock_get_service_and_organisation_counts,
):
client_request.logout()
page = client_request.get("main.index", _test_page_title=False)
with pytest.raises(AttributeError) as exception:
page.find("h1")
assert st... | Add a test to make sure exception is raised
None of our code should be raising this exception, so it’s possible it
could stop working without us knowing about it.
This commit adds a tests to alert us if the override ever does silently
stop working (for example because of a change in `BeautifulSoup`)import pytest
de... | <commit_before><commit_msg>Add a test to make sure exception is raised
None of our code should be raising this exception, so it’s possible it
could stop working without us knowing about it.
This commit adds a tests to alert us if the override ever does silently
stop working (for example because of a change in `Beauti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.