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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e31b050e3a856eb21a995747fc8b3a5a7f2d7d73 | deploy/instance_settings/fffs/instance_settings.py | deploy/instance_settings/fffs/instance_settings.py | # -*- coding: utf-8 -*-
# Prefix of default document collection of this instance
FST_INSTANCE_PREFIX = "fffs"
# Organization authorized to publish these documents.
FST_ORG_NAME = u"Finansinspektionen"
FST_ORG_NAME_POSSESSIVE = u"Finansinspektionens"
# Contact information for ATOM feed
FST_ORG_CONTACT_NAME = u"Jonas ... | Add settings for another instance: fffs | Add settings for another instance: fffs
| Python | bsd-3-clause | rinfo/fst,kamidev/autobuild_fst,rinfo/fst,kamidev/autobuild_fst,rinfo/fst,kamidev/autobuild_fst,kamidev/autobuild_fst,rinfo/fst | Add settings for another instance: fffs | # -*- coding: utf-8 -*-
# Prefix of default document collection of this instance
FST_INSTANCE_PREFIX = "fffs"
# Organization authorized to publish these documents.
FST_ORG_NAME = u"Finansinspektionen"
FST_ORG_NAME_POSSESSIVE = u"Finansinspektionens"
# Contact information for ATOM feed
FST_ORG_CONTACT_NAME = u"Jonas ... | <commit_before><commit_msg>Add settings for another instance: fffs<commit_after> | # -*- coding: utf-8 -*-
# Prefix of default document collection of this instance
FST_INSTANCE_PREFIX = "fffs"
# Organization authorized to publish these documents.
FST_ORG_NAME = u"Finansinspektionen"
FST_ORG_NAME_POSSESSIVE = u"Finansinspektionens"
# Contact information for ATOM feed
FST_ORG_CONTACT_NAME = u"Jonas ... | Add settings for another instance: fffs# -*- coding: utf-8 -*-
# Prefix of default document collection of this instance
FST_INSTANCE_PREFIX = "fffs"
# Organization authorized to publish these documents.
FST_ORG_NAME = u"Finansinspektionen"
FST_ORG_NAME_POSSESSIVE = u"Finansinspektionens"
# Contact information for AT... | <commit_before><commit_msg>Add settings for another instance: fffs<commit_after># -*- coding: utf-8 -*-
# Prefix of default document collection of this instance
FST_INSTANCE_PREFIX = "fffs"
# Organization authorized to publish these documents.
FST_ORG_NAME = u"Finansinspektionen"
FST_ORG_NAME_POSSESSIVE = u"Finansins... | |
266894ae726b9764a0bc0469b8cc2147cba26566 | alignak_backend.py | alignak_backend.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015:
# Frederic Mohier, [email protected]
#
# This file is part of (WebUI).
#
# (WebUI) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foun... | Create file for uWSGI launch | Create file for uWSGI launch
| Python | agpl-3.0 | Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend | Create file for uWSGI launch | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015:
# Frederic Mohier, [email protected]
#
# This file is part of (WebUI).
#
# (WebUI) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foun... | <commit_before><commit_msg>Create file for uWSGI launch<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015:
# Frederic Mohier, [email protected]
#
# This file is part of (WebUI).
#
# (WebUI) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foun... | Create file for uWSGI launch#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015:
# Frederic Mohier, [email protected]
#
# This file is part of (WebUI).
#
# (WebUI) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published... | <commit_before><commit_msg>Create file for uWSGI launch<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015:
# Frederic Mohier, [email protected]
#
# This file is part of (WebUI).
#
# (WebUI) is free software: you can redistribute it and/or modify
# it under the terms of the GNU A... | |
6f50e075d757eb76a1a3da5376430e7bea850e58 | dbaas/maintenance/scripts/update_volume_path.py | dbaas/maintenance/scripts/update_volume_path.py | from backup.models import Volume
from workflow.steps.util.volume_provider import VolumeProviderBase
for vol in Volume.objects.all():
vol_inst = vol.host and vol.host.instances.first()
if not vol_inst:
continue
provider = VolumeProviderBase(vol_inst)
vol_path = provider.get_path(vol)
if not... | Create Script to populate volume_path field | Create Script to populate volume_path field
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | Create Script to populate volume_path field | from backup.models import Volume
from workflow.steps.util.volume_provider import VolumeProviderBase
for vol in Volume.objects.all():
vol_inst = vol.host and vol.host.instances.first()
if not vol_inst:
continue
provider = VolumeProviderBase(vol_inst)
vol_path = provider.get_path(vol)
if not... | <commit_before><commit_msg>Create Script to populate volume_path field<commit_after> | from backup.models import Volume
from workflow.steps.util.volume_provider import VolumeProviderBase
for vol in Volume.objects.all():
vol_inst = vol.host and vol.host.instances.first()
if not vol_inst:
continue
provider = VolumeProviderBase(vol_inst)
vol_path = provider.get_path(vol)
if not... | Create Script to populate volume_path fieldfrom backup.models import Volume
from workflow.steps.util.volume_provider import VolumeProviderBase
for vol in Volume.objects.all():
vol_inst = vol.host and vol.host.instances.first()
if not vol_inst:
continue
provider = VolumeProviderBase(vol_inst)
v... | <commit_before><commit_msg>Create Script to populate volume_path field<commit_after>from backup.models import Volume
from workflow.steps.util.volume_provider import VolumeProviderBase
for vol in Volume.objects.all():
vol_inst = vol.host and vol.host.instances.first()
if not vol_inst:
continue
prov... | |
bf84e7203bfba55f7d9851d6b07e0e93c564b838 | etl/ecsv/base.py | etl/ecsv/base.py | import os
import glob
class BaseCSV(object):
def __init__(self, settings):
self.directory = settings.CSV_DATA_DIR
self.data_files = settings.CSV_FILES
def handles(self):
for data_file in self.data_files:
for filename in glob.glob(os.path.join(self.directory, data_file)):
... | Create BaseCSV class in support of CSV data extraction | Create BaseCSV class in support of CSV data extraction
| Python | mit | soccermetrics/marcotti-events | Create BaseCSV class in support of CSV data extraction | import os
import glob
class BaseCSV(object):
def __init__(self, settings):
self.directory = settings.CSV_DATA_DIR
self.data_files = settings.CSV_FILES
def handles(self):
for data_file in self.data_files:
for filename in glob.glob(os.path.join(self.directory, data_file)):
... | <commit_before><commit_msg>Create BaseCSV class in support of CSV data extraction<commit_after> | import os
import glob
class BaseCSV(object):
def __init__(self, settings):
self.directory = settings.CSV_DATA_DIR
self.data_files = settings.CSV_FILES
def handles(self):
for data_file in self.data_files:
for filename in glob.glob(os.path.join(self.directory, data_file)):
... | Create BaseCSV class in support of CSV data extractionimport os
import glob
class BaseCSV(object):
def __init__(self, settings):
self.directory = settings.CSV_DATA_DIR
self.data_files = settings.CSV_FILES
def handles(self):
for data_file in self.data_files:
for filename i... | <commit_before><commit_msg>Create BaseCSV class in support of CSV data extraction<commit_after>import os
import glob
class BaseCSV(object):
def __init__(self, settings):
self.directory = settings.CSV_DATA_DIR
self.data_files = settings.CSV_FILES
def handles(self):
for data_file in se... | |
c5625e0a9e5d0b715d24bfa40e26ed25a8514f54 | examples/02-plot/plot-cmap.py | examples/02-plot/plot-cmap.py | """
Custom Colormaps
~~~~~~~~~~~~~~~~
Use a custom built colormap when plotting scalar values.
"""
################################################################################
# Any colormap built for ``matplotlib`` is fully compatible with ``vtki``.
# Colormaps are typically specifiedby passing the string name of... | Add example page for custom colormaps (incomplete) | Add example page for custom colormaps (incomplete)
| Python | mit | akaszynski/vtkInterface | Add example page for custom colormaps (incomplete) | """
Custom Colormaps
~~~~~~~~~~~~~~~~
Use a custom built colormap when plotting scalar values.
"""
################################################################################
# Any colormap built for ``matplotlib`` is fully compatible with ``vtki``.
# Colormaps are typically specifiedby passing the string name of... | <commit_before><commit_msg>Add example page for custom colormaps (incomplete)<commit_after> | """
Custom Colormaps
~~~~~~~~~~~~~~~~
Use a custom built colormap when plotting scalar values.
"""
################################################################################
# Any colormap built for ``matplotlib`` is fully compatible with ``vtki``.
# Colormaps are typically specifiedby passing the string name of... | Add example page for custom colormaps (incomplete)"""
Custom Colormaps
~~~~~~~~~~~~~~~~
Use a custom built colormap when plotting scalar values.
"""
################################################################################
# Any colormap built for ``matplotlib`` is fully compatible with ``vtki``.
# Colormaps ar... | <commit_before><commit_msg>Add example page for custom colormaps (incomplete)<commit_after>"""
Custom Colormaps
~~~~~~~~~~~~~~~~
Use a custom built colormap when plotting scalar values.
"""
################################################################################
# Any colormap built for ``matplotlib`` is fully... | |
6e27422695d84e4ca9f63f70411a106825508ebf | python/chunked_read.py | python/chunked_read.py | """Read a binary file in chunks, using 'modern' idiomatic Python."""
import functools
CHUNKSIZE = 42
with open(__file__, 'rb') as handle:
read_chunk = functools.partial(handle.read, CHUNKSIZE)
for i, chunk in enumerate(iter(read_chunk, b'')):
print('{:5d} {!r}'.format(i + 1, chunk))
| Read a binary file in chunks, using 'modern' idiomatic Python | Read a binary file in chunks, using 'modern' idiomatic Python
| Python | unlicense | jhermann/waif,jhermann/waif | Read a binary file in chunks, using 'modern' idiomatic Python | """Read a binary file in chunks, using 'modern' idiomatic Python."""
import functools
CHUNKSIZE = 42
with open(__file__, 'rb') as handle:
read_chunk = functools.partial(handle.read, CHUNKSIZE)
for i, chunk in enumerate(iter(read_chunk, b'')):
print('{:5d} {!r}'.format(i + 1, chunk))
| <commit_before><commit_msg>Read a binary file in chunks, using 'modern' idiomatic Python<commit_after> | """Read a binary file in chunks, using 'modern' idiomatic Python."""
import functools
CHUNKSIZE = 42
with open(__file__, 'rb') as handle:
read_chunk = functools.partial(handle.read, CHUNKSIZE)
for i, chunk in enumerate(iter(read_chunk, b'')):
print('{:5d} {!r}'.format(i + 1, chunk))
| Read a binary file in chunks, using 'modern' idiomatic Python"""Read a binary file in chunks, using 'modern' idiomatic Python."""
import functools
CHUNKSIZE = 42
with open(__file__, 'rb') as handle:
read_chunk = functools.partial(handle.read, CHUNKSIZE)
for i, chunk in enumerate(iter(read_chunk, b'')):
... | <commit_before><commit_msg>Read a binary file in chunks, using 'modern' idiomatic Python<commit_after>"""Read a binary file in chunks, using 'modern' idiomatic Python."""
import functools
CHUNKSIZE = 42
with open(__file__, 'rb') as handle:
read_chunk = functools.partial(handle.read, CHUNKSIZE)
for i, chunk in... | |
a26a8ec3579454ab948519d48a89c5388be4dcae | src/problem/migrations/0007_auto_20180711_1651.py | src/problem/migrations/0007_auto_20180711_1651.py | # Generated by Django 2.0.7 on 2018-07-11 07:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('problem', '0006_auto_201... | Add migration files for ProblemQuestion | Add migration files for ProblemQuestion
| Python | apache-2.0 | PLUS-POSTECH/study.plus.or.kr,PLUS-POSTECH/study.plus.or.kr,PLUS-POSTECH/study.plus.or.kr | Add migration files for ProblemQuestion | # Generated by Django 2.0.7 on 2018-07-11 07:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('problem', '0006_auto_201... | <commit_before><commit_msg>Add migration files for ProblemQuestion<commit_after> | # Generated by Django 2.0.7 on 2018-07-11 07:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('problem', '0006_auto_201... | Add migration files for ProblemQuestion# Generated by Django 2.0.7 on 2018-07-11 07:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MOD... | <commit_before><commit_msg>Add migration files for ProblemQuestion<commit_after># Generated by Django 2.0.7 on 2018-07-11 07:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.sw... | |
300ec4c6116751c173aa304dd884d7bc85a1020f | py/battleships-in-a-board.py | py/battleships-in-a-board.py | class Solution(object):
def countBattleships(self, board):
"""
:type board: List[List[str]]
:rtype: int
"""
ans = 0
for r, row in enumerate(board):
for c, v in enumerate(row):
if v == 'X':
if r > 0 and board[r - 1][c] ==... | Add py solution for 419. Battleships in a Board | Add py solution for 419. Battleships in a Board
419. Battleships in a Board: https://leetcode.com/problems/battleships-in-a-board/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 419. Battleships in a Board
419. Battleships in a Board: https://leetcode.com/problems/battleships-in-a-board/ | class Solution(object):
def countBattleships(self, board):
"""
:type board: List[List[str]]
:rtype: int
"""
ans = 0
for r, row in enumerate(board):
for c, v in enumerate(row):
if v == 'X':
if r > 0 and board[r - 1][c] ==... | <commit_before><commit_msg>Add py solution for 419. Battleships in a Board
419. Battleships in a Board: https://leetcode.com/problems/battleships-in-a-board/<commit_after> | class Solution(object):
def countBattleships(self, board):
"""
:type board: List[List[str]]
:rtype: int
"""
ans = 0
for r, row in enumerate(board):
for c, v in enumerate(row):
if v == 'X':
if r > 0 and board[r - 1][c] ==... | Add py solution for 419. Battleships in a Board
419. Battleships in a Board: https://leetcode.com/problems/battleships-in-a-board/class Solution(object):
def countBattleships(self, board):
"""
:type board: List[List[str]]
:rtype: int
"""
ans = 0
for r, row in enumera... | <commit_before><commit_msg>Add py solution for 419. Battleships in a Board
419. Battleships in a Board: https://leetcode.com/problems/battleships-in-a-board/<commit_after>class Solution(object):
def countBattleships(self, board):
"""
:type board: List[List[str]]
:rtype: int
"""
... | |
dff9ab05d0d3f7f2a8f2e69d1d1e743966dfce51 | vpn-proxy/app/management/commands/reset_tunnels.py | vpn-proxy/app/management/commands/reset_tunnels.py | from django.core.management.base import BaseCommand
from app.models import Tunnel
class Command(BaseCommand):
help = "Create superuser if missing (Non Interactive)."
def add_arguments(self, parser):
parser.add_argument('tunnel', nargs='*', type=int)
def handle(self, *args, **kwargs):
if ... | Add reset tunnels management command | Add reset tunnels management command
| Python | apache-2.0 | pchristos/vpn-proxy,dimrozakis/vpn-proxy,pchristos/vpn-proxy,dimrozakis/vpn-proxy | Add reset tunnels management command | from django.core.management.base import BaseCommand
from app.models import Tunnel
class Command(BaseCommand):
help = "Create superuser if missing (Non Interactive)."
def add_arguments(self, parser):
parser.add_argument('tunnel', nargs='*', type=int)
def handle(self, *args, **kwargs):
if ... | <commit_before><commit_msg>Add reset tunnels management command<commit_after> | from django.core.management.base import BaseCommand
from app.models import Tunnel
class Command(BaseCommand):
help = "Create superuser if missing (Non Interactive)."
def add_arguments(self, parser):
parser.add_argument('tunnel', nargs='*', type=int)
def handle(self, *args, **kwargs):
if ... | Add reset tunnels management commandfrom django.core.management.base import BaseCommand
from app.models import Tunnel
class Command(BaseCommand):
help = "Create superuser if missing (Non Interactive)."
def add_arguments(self, parser):
parser.add_argument('tunnel', nargs='*', type=int)
def handle... | <commit_before><commit_msg>Add reset tunnels management command<commit_after>from django.core.management.base import BaseCommand
from app.models import Tunnel
class Command(BaseCommand):
help = "Create superuser if missing (Non Interactive)."
def add_arguments(self, parser):
parser.add_argument('tunn... | |
ca4048d16760a5dfadb8b7cce751ddd666976800 | src/preprocessing/csvtohdf.py | src/preprocessing/csvtohdf.py | import pandas as pd
import numpy as np
import os
import glob
def csvtohdf(source, destination):
"""Takes a csv file as input and storest it as a hdf5 file in the
destnation path.
The hdf5 file is stored in table format.
"""
try:
data = pd.read_csv(source,index_col = 1,parse_dates=True)
exce... | Add module to save .csv files as HDF5 data structure. | Add module to save .csv files as HDF5 data structure.
| Python | mit | samshara/Stock-Market-Analysis-and-Prediction | Add module to save .csv files as HDF5 data structure. | import pandas as pd
import numpy as np
import os
import glob
def csvtohdf(source, destination):
"""Takes a csv file as input and storest it as a hdf5 file in the
destnation path.
The hdf5 file is stored in table format.
"""
try:
data = pd.read_csv(source,index_col = 1,parse_dates=True)
exce... | <commit_before><commit_msg>Add module to save .csv files as HDF5 data structure.<commit_after> | import pandas as pd
import numpy as np
import os
import glob
def csvtohdf(source, destination):
"""Takes a csv file as input and storest it as a hdf5 file in the
destnation path.
The hdf5 file is stored in table format.
"""
try:
data = pd.read_csv(source,index_col = 1,parse_dates=True)
exce... | Add module to save .csv files as HDF5 data structure.import pandas as pd
import numpy as np
import os
import glob
def csvtohdf(source, destination):
"""Takes a csv file as input and storest it as a hdf5 file in the
destnation path.
The hdf5 file is stored in table format.
"""
try:
data = pd.rea... | <commit_before><commit_msg>Add module to save .csv files as HDF5 data structure.<commit_after>import pandas as pd
import numpy as np
import os
import glob
def csvtohdf(source, destination):
"""Takes a csv file as input and storest it as a hdf5 file in the
destnation path.
The hdf5 file is stored in table f... | |
f9343573e2d1b3f3960c99eb90b5df7aad1573ca | python/problem4.py | python/problem4.py | for i in range(10, 100):
for j in range(i, 100):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
for i in range(100, 1000):
for j in range(i, 1000):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
| Solve problem 4 with python. | Solve problem 4 with python.
| Python | mit | a-suenami/challenge-project-euler,a-suenami/challenge-project-euler | Solve problem 4 with python. | for i in range(10, 100):
for j in range(i, 100):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
for i in range(100, 1000):
for j in range(i, 1000):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
| <commit_before><commit_msg>Solve problem 4 with python.<commit_after> | for i in range(10, 100):
for j in range(i, 100):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
for i in range(100, 1000):
for j in range(i, 1000):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
| Solve problem 4 with python.for i in range(10, 100):
for j in range(i, 100):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
for i in range(100, 1000):
for j in range(i, 1000):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
| <commit_before><commit_msg>Solve problem 4 with python.<commit_after>for i in range(10, 100):
for j in range(i, 100):
n = i * j
if str(n) == str(n)[::-1]:
print "{} x {} = {}".format(i, j, n)
for i in range(100, 1000):
for j in range(i, 1000):
n = i * j
if str(n) == str(n)[::-1]:
print ... | |
beca03a39c647cbbe0ae7c388614fe655384f774 | migrations/versions/0109_drop_old_service_flags.py | migrations/versions/0109_drop_old_service_flags.py | """empty message
Revision ID: 0109_drop_old_service_flags
Revises: 0108_change_logo_not_nullable
Create Date: 2017-07-12 13:35:45.636618
"""
# revision identifiers, used by Alembic.
revision = '0109_drop_old_service_flags'
down_revision = '0108_change_logo_not_nullable'
from alembic import op
import sqlalchemy as s... | Add migration script to drop service flags | Add migration script to drop service flags
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add migration script to drop service flags | """empty message
Revision ID: 0109_drop_old_service_flags
Revises: 0108_change_logo_not_nullable
Create Date: 2017-07-12 13:35:45.636618
"""
# revision identifiers, used by Alembic.
revision = '0109_drop_old_service_flags'
down_revision = '0108_change_logo_not_nullable'
from alembic import op
import sqlalchemy as s... | <commit_before><commit_msg>Add migration script to drop service flags<commit_after> | """empty message
Revision ID: 0109_drop_old_service_flags
Revises: 0108_change_logo_not_nullable
Create Date: 2017-07-12 13:35:45.636618
"""
# revision identifiers, used by Alembic.
revision = '0109_drop_old_service_flags'
down_revision = '0108_change_logo_not_nullable'
from alembic import op
import sqlalchemy as s... | Add migration script to drop service flags"""empty message
Revision ID: 0109_drop_old_service_flags
Revises: 0108_change_logo_not_nullable
Create Date: 2017-07-12 13:35:45.636618
"""
# revision identifiers, used by Alembic.
revision = '0109_drop_old_service_flags'
down_revision = '0108_change_logo_not_nullable'
fro... | <commit_before><commit_msg>Add migration script to drop service flags<commit_after>"""empty message
Revision ID: 0109_drop_old_service_flags
Revises: 0108_change_logo_not_nullable
Create Date: 2017-07-12 13:35:45.636618
"""
# revision identifiers, used by Alembic.
revision = '0109_drop_old_service_flags'
down_revisi... | |
e75c7b2b0ef8b82dc3c3213e97fe154dafea9afd | polling_stations/apps/pollingstations/migrations/0013_customfinders.py | polling_stations/apps/pollingstations/migrations/0013_customfinders.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def create_custom_finders(apps, schema_editor):
CustomFinder = apps.get_model("pollingstations", "CustomFinder")
CustomFinder.objects.update_or_create(
area_code='N07000001',
base_url='http://www... | Add CustomFinders in data migrations | Add CustomFinders in data migrations
I'm not 100% sure this is the best way of doing this in the long term:
Good: CustomFinders are automatically added when migrations are run,
meaning we don't need to figure out a new system for importing them.
They are also checked in to version control, meaning we should have a
g... | Python | bsd-3-clause | DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations | Add CustomFinders in data migrations
I'm not 100% sure this is the best way of doing this in the long term:
Good: CustomFinders are automatically added when migrations are run,
meaning we don't need to figure out a new system for importing them.
They are also checked in to version control, meaning we should have a
g... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def create_custom_finders(apps, schema_editor):
CustomFinder = apps.get_model("pollingstations", "CustomFinder")
CustomFinder.objects.update_or_create(
area_code='N07000001',
base_url='http://www... | <commit_before><commit_msg>Add CustomFinders in data migrations
I'm not 100% sure this is the best way of doing this in the long term:
Good: CustomFinders are automatically added when migrations are run,
meaning we don't need to figure out a new system for importing them.
They are also checked in to version control,... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def create_custom_finders(apps, schema_editor):
CustomFinder = apps.get_model("pollingstations", "CustomFinder")
CustomFinder.objects.update_or_create(
area_code='N07000001',
base_url='http://www... | Add CustomFinders in data migrations
I'm not 100% sure this is the best way of doing this in the long term:
Good: CustomFinders are automatically added when migrations are run,
meaning we don't need to figure out a new system for importing them.
They are also checked in to version control, meaning we should have a
g... | <commit_before><commit_msg>Add CustomFinders in data migrations
I'm not 100% sure this is the best way of doing this in the long term:
Good: CustomFinders are automatically added when migrations are run,
meaning we don't need to figure out a new system for importing them.
They are also checked in to version control,... | |
9e04e3de5ae971fa9075d6e74fd6300abe684632 | bashes/great3.py | bashes/great3.py | import numpy as np
import galsim
def createSource(params):
"""
Returns a GalSim model of the unlensed source specified by params.
"""
# Create the bulge component.
bulge = galsim.Sersic(flux = params['bulge_flux'],
half_light_radius = params['bulge_hlr'],
n = params['bulge_n'])
... | Add module to create GalSim models from GREAT3 truth catalog entries | Add module to create GalSim models from GREAT3 truth catalog entries
| Python | mit | deepzot/bashes,deepzot/bashes | Add module to create GalSim models from GREAT3 truth catalog entries | import numpy as np
import galsim
def createSource(params):
"""
Returns a GalSim model of the unlensed source specified by params.
"""
# Create the bulge component.
bulge = galsim.Sersic(flux = params['bulge_flux'],
half_light_radius = params['bulge_hlr'],
n = params['bulge_n'])
... | <commit_before><commit_msg>Add module to create GalSim models from GREAT3 truth catalog entries<commit_after> | import numpy as np
import galsim
def createSource(params):
"""
Returns a GalSim model of the unlensed source specified by params.
"""
# Create the bulge component.
bulge = galsim.Sersic(flux = params['bulge_flux'],
half_light_radius = params['bulge_hlr'],
n = params['bulge_n'])
... | Add module to create GalSim models from GREAT3 truth catalog entriesimport numpy as np
import galsim
def createSource(params):
"""
Returns a GalSim model of the unlensed source specified by params.
"""
# Create the bulge component.
bulge = galsim.Sersic(flux = params['bulge_flux'],
half_li... | <commit_before><commit_msg>Add module to create GalSim models from GREAT3 truth catalog entries<commit_after>import numpy as np
import galsim
def createSource(params):
"""
Returns a GalSim model of the unlensed source specified by params.
"""
# Create the bulge component.
bulge = galsim.Sersic(flu... | |
070577b8a7d94176df1b789d621ad1e258ee968e | senlin/tests/tempest/api/test_build_info.py | senlin/tests/tempest/api/test_build_info.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 tempest tests for build-info API | Add tempest tests for build-info API
Add tempest tests for build-info API
Change-Id: I74bfe7f74678e1c35404afad11d111a7b47f75fe
| Python | apache-2.0 | openstack/senlin,stackforge/senlin,stackforge/senlin,openstack/senlin,openstack/senlin | Add tempest tests for build-info API
Add tempest tests for build-info API
Change-Id: I74bfe7f74678e1c35404afad11d111a7b47f75fe | # 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 tempest tests for build-info API
Add tempest tests for build-info API
Change-Id: I74bfe7f74678e1c35404afad11d111a7b47f75fe<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 tempest tests for build-info API
Add tempest tests for build-info API
Change-Id: I74bfe7f74678e1c35404afad11d111a7b47f75fe# 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://w... | <commit_before><commit_msg>Add tempest tests for build-info API
Add tempest tests for build-info API
Change-Id: I74bfe7f74678e1c35404afad11d111a7b47f75fe<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... | |
e443527d28d24219c81dc1a2ec1c649de7bb16c7 | examples/lstm_stateful_seq.py | examples/lstm_stateful_seq.py | '''Example script to predict sequence using stateful rnns.
At least 10 epochs are required before the generated text
starts sounding coherent.
'''
import numpy as np
import matplotlib.pyplot as mpl
from keras.models import Sequential
from keras.layers.core import Dense
from keras.layers.recurrent import LSTM
# since... | Add example of stateful LSTM sequence prediction | Add example of stateful LSTM sequence prediction
| Python | mit | relh/keras,keras-team/keras,daviddiazvico/keras,nebw/keras,dolaameng/keras,kuza55/keras,keras-team/keras,DeepGnosis/keras,kemaswill/keras | Add example of stateful LSTM sequence prediction | '''Example script to predict sequence using stateful rnns.
At least 10 epochs are required before the generated text
starts sounding coherent.
'''
import numpy as np
import matplotlib.pyplot as mpl
from keras.models import Sequential
from keras.layers.core import Dense
from keras.layers.recurrent import LSTM
# since... | <commit_before><commit_msg>Add example of stateful LSTM sequence prediction<commit_after> | '''Example script to predict sequence using stateful rnns.
At least 10 epochs are required before the generated text
starts sounding coherent.
'''
import numpy as np
import matplotlib.pyplot as mpl
from keras.models import Sequential
from keras.layers.core import Dense
from keras.layers.recurrent import LSTM
# since... | Add example of stateful LSTM sequence prediction'''Example script to predict sequence using stateful rnns.
At least 10 epochs are required before the generated text
starts sounding coherent.
'''
import numpy as np
import matplotlib.pyplot as mpl
from keras.models import Sequential
from keras.layers.core import Dense
f... | <commit_before><commit_msg>Add example of stateful LSTM sequence prediction<commit_after>'''Example script to predict sequence using stateful rnns.
At least 10 epochs are required before the generated text
starts sounding coherent.
'''
import numpy as np
import matplotlib.pyplot as mpl
from keras.models import Sequent... | |
83e051d35d41830cbf2d0a8104ec173e12688d69 | saleor/cart/migrations/fix_empty_data_in_lines.py | saleor/cart/migrations/fix_empty_data_in_lines.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-06 13:02
from __future__ import unicode_literals
from django.db import migrations
def convert_lines_data(apps, schema_editor):
CartLine = apps.get_model('cart', 'CartLine')
# Iterate over all cart lines, due to wrong JSONField None handling
... | Add cart lines data migration | Add cart lines data migration
| Python | bsd-3-clause | mociepka/saleor,itbabu/saleor,HyperManTT/ECommerceSaleor,car3oon/saleor,KenMutemi/saleor,maferelo/saleor,KenMutemi/saleor,tfroehlich82/saleor,KenMutemi/saleor,car3oon/saleor,itbabu/saleor,mociepka/saleor,UITools/saleor,mociepka/saleor,jreigel/saleor,maferelo/saleor,car3oon/saleor,HyperManTT/ECommerceSaleor,UITools/sale... | Add cart lines data migration | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-06 13:02
from __future__ import unicode_literals
from django.db import migrations
def convert_lines_data(apps, schema_editor):
CartLine = apps.get_model('cart', 'CartLine')
# Iterate over all cart lines, due to wrong JSONField None handling
... | <commit_before><commit_msg>Add cart lines data migration<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-06 13:02
from __future__ import unicode_literals
from django.db import migrations
def convert_lines_data(apps, schema_editor):
CartLine = apps.get_model('cart', 'CartLine')
# Iterate over all cart lines, due to wrong JSONField None handling
... | Add cart lines data migration# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-06 13:02
from __future__ import unicode_literals
from django.db import migrations
def convert_lines_data(apps, schema_editor):
CartLine = apps.get_model('cart', 'CartLine')
# Iterate over all cart lines, due to wrong... | <commit_before><commit_msg>Add cart lines data migration<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-06 13:02
from __future__ import unicode_literals
from django.db import migrations
def convert_lines_data(apps, schema_editor):
CartLine = apps.get_model('cart', 'CartLine')
# ... | |
c17c78ba7dd1b90a0f8b51e8edb40b974ce0b801 | astrobin/management/commands/reset_lite_counters.py | astrobin/management/commands/reset_lite_counters.py | from django.core.management.base import BaseCommand
from paypal.standard.ipn import models
from subscription.models import UserSubscription
class Command(BaseCommand):
def handle(self, *args, **options):
for us in UserSubscription.objects.filter(subscription__name = 'AstroBin Lite'):
profile ... | Add management command to reset Lite counters | Add management command to reset Lite counters
| Python | agpl-3.0 | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | Add management command to reset Lite counters | from django.core.management.base import BaseCommand
from paypal.standard.ipn import models
from subscription.models import UserSubscription
class Command(BaseCommand):
def handle(self, *args, **options):
for us in UserSubscription.objects.filter(subscription__name = 'AstroBin Lite'):
profile ... | <commit_before><commit_msg>Add management command to reset Lite counters<commit_after> | from django.core.management.base import BaseCommand
from paypal.standard.ipn import models
from subscription.models import UserSubscription
class Command(BaseCommand):
def handle(self, *args, **options):
for us in UserSubscription.objects.filter(subscription__name = 'AstroBin Lite'):
profile ... | Add management command to reset Lite countersfrom django.core.management.base import BaseCommand
from paypal.standard.ipn import models
from subscription.models import UserSubscription
class Command(BaseCommand):
def handle(self, *args, **options):
for us in UserSubscription.objects.filter(subscription__... | <commit_before><commit_msg>Add management command to reset Lite counters<commit_after>from django.core.management.base import BaseCommand
from paypal.standard.ipn import models
from subscription.models import UserSubscription
class Command(BaseCommand):
def handle(self, *args, **options):
for us in UserS... | |
963f6ccc97b71473ffeecec47ddc5093eff117f2 | process_my_articles.py | process_my_articles.py | from pocket import Pocket, PocketException
import simplejson
j = simplejson.loads("config.json")
p = Pocket(
consumer_key=j['consumer_key'] #'67605-7d07d07daa10f7fb8dbe2b50',
access_token=j['access_token'] #'15cc0e47-3178-44aa-99dd-9d27a7'
)
# Fetch a list of articles
try:
print(p.retrieve(offset=0, coun... | Add the python script that processes the information | Add the python script that processes the information
| Python | apache-2.0 | fullbright/gary-reporter,fullbright/gary-reporter | Add the python script that processes the information | from pocket import Pocket, PocketException
import simplejson
j = simplejson.loads("config.json")
p = Pocket(
consumer_key=j['consumer_key'] #'67605-7d07d07daa10f7fb8dbe2b50',
access_token=j['access_token'] #'15cc0e47-3178-44aa-99dd-9d27a7'
)
# Fetch a list of articles
try:
print(p.retrieve(offset=0, coun... | <commit_before><commit_msg>Add the python script that processes the information<commit_after> | from pocket import Pocket, PocketException
import simplejson
j = simplejson.loads("config.json")
p = Pocket(
consumer_key=j['consumer_key'] #'67605-7d07d07daa10f7fb8dbe2b50',
access_token=j['access_token'] #'15cc0e47-3178-44aa-99dd-9d27a7'
)
# Fetch a list of articles
try:
print(p.retrieve(offset=0, coun... | Add the python script that processes the informationfrom pocket import Pocket, PocketException
import simplejson
j = simplejson.loads("config.json")
p = Pocket(
consumer_key=j['consumer_key'] #'67605-7d07d07daa10f7fb8dbe2b50',
access_token=j['access_token'] #'15cc0e47-3178-44aa-99dd-9d27a7'
)
# Fetch a list ... | <commit_before><commit_msg>Add the python script that processes the information<commit_after>from pocket import Pocket, PocketException
import simplejson
j = simplejson.loads("config.json")
p = Pocket(
consumer_key=j['consumer_key'] #'67605-7d07d07daa10f7fb8dbe2b50',
access_token=j['access_token'] #'15cc0e47-... | |
f17b28c9f1708d5311e409bf642e6d746715ae2a | experiments/run_all.py | experiments/run_all.py | from pathlib import Path
from subprocess import run
for param_file in Path('.').glob('*.json'):
print(f'Run {param_file.stem}')
run(['python', 'run.py', str(param_file)])
| Add convenience script to run all experiments | Add convenience script to run all experiments
| Python | mit | qobilidop/srcnn,qobilidop/srcnn | Add convenience script to run all experiments | from pathlib import Path
from subprocess import run
for param_file in Path('.').glob('*.json'):
print(f'Run {param_file.stem}')
run(['python', 'run.py', str(param_file)])
| <commit_before><commit_msg>Add convenience script to run all experiments<commit_after> | from pathlib import Path
from subprocess import run
for param_file in Path('.').glob('*.json'):
print(f'Run {param_file.stem}')
run(['python', 'run.py', str(param_file)])
| Add convenience script to run all experimentsfrom pathlib import Path
from subprocess import run
for param_file in Path('.').glob('*.json'):
print(f'Run {param_file.stem}')
run(['python', 'run.py', str(param_file)])
| <commit_before><commit_msg>Add convenience script to run all experiments<commit_after>from pathlib import Path
from subprocess import run
for param_file in Path('.').glob('*.json'):
print(f'Run {param_file.stem}')
run(['python', 'run.py', str(param_file)])
| |
e1dc7eddabc9aa9268fdbb4ecc6922e87ab892f3 | mkt/webapps/migrations/0004_auto_20151120_0650.py | mkt/webapps/migrations/0004_auto_20151120_0650.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mkt.constants.applications
class Migration(migrations.Migration):
dependencies = [
('webapps', '0003_appfeatures_has_udpsocket'),
]
operations = [
migrations.RemoveField(
... | Add missing migration for geodata and addondevicetype changes | Add missing migration for geodata and addondevicetype changes
| Python | bsd-3-clause | washort/zamboni,ingenioustechie/zamboni,mozilla/zamboni,washort/zamboni,diox/zamboni,ddurst/zamboni,ingenioustechie/zamboni,diox/zamboni,mozilla/zamboni,washort/zamboni,jasonthomas/zamboni,ddurst/zamboni,ingenioustechie/zamboni,washort/zamboni,jasonthomas/zamboni,jasonthomas/zamboni,mozilla/zamboni,ddurst/zamboni,mozil... | Add missing migration for geodata and addondevicetype changes | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mkt.constants.applications
class Migration(migrations.Migration):
dependencies = [
('webapps', '0003_appfeatures_has_udpsocket'),
]
operations = [
migrations.RemoveField(
... | <commit_before><commit_msg>Add missing migration for geodata and addondevicetype changes<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mkt.constants.applications
class Migration(migrations.Migration):
dependencies = [
('webapps', '0003_appfeatures_has_udpsocket'),
]
operations = [
migrations.RemoveField(
... | Add missing migration for geodata and addondevicetype changes# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mkt.constants.applications
class Migration(migrations.Migration):
dependencies = [
('webapps', '0003_appfeatures_has_udpsocket'),
... | <commit_before><commit_msg>Add missing migration for geodata and addondevicetype changes<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mkt.constants.applications
class Migration(migrations.Migration):
dependencies = [
('webap... | |
2b56ad0b288378a8ccef388605b36308c4ce6483 | src/ggrc_basic_permissions/migrations/versions/20131211001113_2785a204a673_update_audit_permiss.py | src/ggrc_basic_permissions/migrations/versions/20131211001113_2785a204a673_update_audit_permiss.py |
"""Update audit permissions.
Revision ID: 2785a204a673
Revises: c460b4f8cc3
Create Date: 2013-12-11 00:11:13.431124
"""
# revision identifiers, used by Alembic.
revision = '2785a204a673'
down_revision = 'c460b4f8cc3'
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from sqlalchemy.sql i... | Update audit context permissions for the ProgramReader, ProgramEditor, and ProgramOwner roles. | Update audit context permissions for the ProgramReader, ProgramEditor,
and ProgramOwner roles.
| Python | apache-2.0 | VinnieJohns/ggrc-core,kr41/ggrc-core,VinnieJohns/ggrc-core,hasanalom/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,josthkko/ggrc-core,hyperNURb/ggrc-core,josthkko/ggrc-core,prasannav7/ggrc-core,hasanalom/ggrc-core,prasannav7/ggrc-core,edofic/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,AleksNeSt... | Update audit context permissions for the ProgramReader, ProgramEditor,
and ProgramOwner roles. |
"""Update audit permissions.
Revision ID: 2785a204a673
Revises: c460b4f8cc3
Create Date: 2013-12-11 00:11:13.431124
"""
# revision identifiers, used by Alembic.
revision = '2785a204a673'
down_revision = 'c460b4f8cc3'
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from sqlalchemy.sql i... | <commit_before><commit_msg>Update audit context permissions for the ProgramReader, ProgramEditor,
and ProgramOwner roles.<commit_after> |
"""Update audit permissions.
Revision ID: 2785a204a673
Revises: c460b4f8cc3
Create Date: 2013-12-11 00:11:13.431124
"""
# revision identifiers, used by Alembic.
revision = '2785a204a673'
down_revision = 'c460b4f8cc3'
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from sqlalchemy.sql i... | Update audit context permissions for the ProgramReader, ProgramEditor,
and ProgramOwner roles.
"""Update audit permissions.
Revision ID: 2785a204a673
Revises: c460b4f8cc3
Create Date: 2013-12-11 00:11:13.431124
"""
# revision identifiers, used by Alembic.
revision = '2785a204a673'
down_revision = 'c460b4f8cc3'
impo... | <commit_before><commit_msg>Update audit context permissions for the ProgramReader, ProgramEditor,
and ProgramOwner roles.<commit_after>
"""Update audit permissions.
Revision ID: 2785a204a673
Revises: c460b4f8cc3
Create Date: 2013-12-11 00:11:13.431124
"""
# revision identifiers, used by Alembic.
revision = '2785a204... | |
537fc0f0788a9fb1a3f29a6bab5fc840b90f77da | src/tests/behave/api/features/steps/rpc_capabilities.py | src/tests/behave/api/features/steps/rpc_capabilities.py | import json
import time
import operator
from functools import reduce
from behave import given, then, when, step, use_step_matcher
from src.tests.behave.api.features.common.utils import read_json_from_file
@then(
"the first {service_name} task for the {device_service} device has the output contained in {out_filen... | Add a step to make sure that task output matches expected output from a json file, including when the output is dynamic | Add a step to make sure that task output matches expected output from a json file, including when the output is dynamic
| Python | apache-2.0 | jr0d/mercury,jr0d/mercury | Add a step to make sure that task output matches expected output from a json file, including when the output is dynamic | import json
import time
import operator
from functools import reduce
from behave import given, then, when, step, use_step_matcher
from src.tests.behave.api.features.common.utils import read_json_from_file
@then(
"the first {service_name} task for the {device_service} device has the output contained in {out_filen... | <commit_before><commit_msg>Add a step to make sure that task output matches expected output from a json file, including when the output is dynamic<commit_after> | import json
import time
import operator
from functools import reduce
from behave import given, then, when, step, use_step_matcher
from src.tests.behave.api.features.common.utils import read_json_from_file
@then(
"the first {service_name} task for the {device_service} device has the output contained in {out_filen... | Add a step to make sure that task output matches expected output from a json file, including when the output is dynamicimport json
import time
import operator
from functools import reduce
from behave import given, then, when, step, use_step_matcher
from src.tests.behave.api.features.common.utils import read_json_from_... | <commit_before><commit_msg>Add a step to make sure that task output matches expected output from a json file, including when the output is dynamic<commit_after>import json
import time
import operator
from functools import reduce
from behave import given, then, when, step, use_step_matcher
from src.tests.behave.api.fea... | |
280faf026f4950e0eea8e16bb785d36e30c7bad4 | src/ggrc/migrations/versions/20131116235030_18e1e2aec298_add_options.py | src/ggrc/migrations/versions/20131116235030_18e1e2aec298_add_options.py |
"""Add options
Revision ID: 18e1e2aec298
Revises: 37c5ca51ad36
Create Date: 2013-11-16 23:50:30.637169
"""
# revision identifiers, used by Alembic.
revision = '18e1e2aec298'
down_revision = '37c5ca51ad36'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
import datetime
opti... | Add migration to create and update Option rows | Add migration to create and update Option rows
| Python | apache-2.0 | uskudnik/ggrc-core,uskudnik/ggrc-core,uskudnik/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,hyperNURb/ggrc-core,hasanalom/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,NejcZupec/ggrc-core,kr41/ggrc-core,hyperNURb/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,kr41/ggrc-core,prasannav7/ggr... | Add migration to create and update Option rows |
"""Add options
Revision ID: 18e1e2aec298
Revises: 37c5ca51ad36
Create Date: 2013-11-16 23:50:30.637169
"""
# revision identifiers, used by Alembic.
revision = '18e1e2aec298'
down_revision = '37c5ca51ad36'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
import datetime
opti... | <commit_before><commit_msg>Add migration to create and update Option rows<commit_after> |
"""Add options
Revision ID: 18e1e2aec298
Revises: 37c5ca51ad36
Create Date: 2013-11-16 23:50:30.637169
"""
# revision identifiers, used by Alembic.
revision = '18e1e2aec298'
down_revision = '37c5ca51ad36'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
import datetime
opti... | Add migration to create and update Option rows
"""Add options
Revision ID: 18e1e2aec298
Revises: 37c5ca51ad36
Create Date: 2013-11-16 23:50:30.637169
"""
# revision identifiers, used by Alembic.
revision = '18e1e2aec298'
down_revision = '37c5ca51ad36'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.s... | <commit_before><commit_msg>Add migration to create and update Option rows<commit_after>
"""Add options
Revision ID: 18e1e2aec298
Revises: 37c5ca51ad36
Create Date: 2013-11-16 23:50:30.637169
"""
# revision identifiers, used by Alembic.
revision = '18e1e2aec298'
down_revision = '37c5ca51ad36'
from alembic import op
... | |
86d889edced648192cf21010608075540e5ec868 | py/longest-continuous-increasing-subsequence.py | py/longest-continuous-increasing-subsequence.py | class Solution(object):
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
start = 0
prev = None
m = 0
for i, n in enumerate(nums):
if prev is not None:
if n <= prev:
start = i
... | Add py solution for 674. Longest Continuous Increasing Subsequence | Add py solution for 674. Longest Continuous Increasing Subsequence
674. Longest Continuous Increasing Subsequence: https://leetcode.com/problems/longest-continuous-increasing-subsequence/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 674. Longest Continuous Increasing Subsequence
674. Longest Continuous Increasing Subsequence: https://leetcode.com/problems/longest-continuous-increasing-subsequence/ | class Solution(object):
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
start = 0
prev = None
m = 0
for i, n in enumerate(nums):
if prev is not None:
if n <= prev:
start = i
... | <commit_before><commit_msg>Add py solution for 674. Longest Continuous Increasing Subsequence
674. Longest Continuous Increasing Subsequence: https://leetcode.com/problems/longest-continuous-increasing-subsequence/<commit_after> | class Solution(object):
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
start = 0
prev = None
m = 0
for i, n in enumerate(nums):
if prev is not None:
if n <= prev:
start = i
... | Add py solution for 674. Longest Continuous Increasing Subsequence
674. Longest Continuous Increasing Subsequence: https://leetcode.com/problems/longest-continuous-increasing-subsequence/class Solution(object):
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
... | <commit_before><commit_msg>Add py solution for 674. Longest Continuous Increasing Subsequence
674. Longest Continuous Increasing Subsequence: https://leetcode.com/problems/longest-continuous-increasing-subsequence/<commit_after>class Solution(object):
def findLengthOfLCIS(self, nums):
"""
:type num... | |
a8a850c290b4b09fbdf439e3e41c1bdf35be7f11 | python/src/maximumSubarray/testMaximumSubarray.py | python/src/maximumSubarray/testMaximumSubarray.py | import unittest
from maximumSubarray import Solution
class TestMaximumSubarrayEdgeCases(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def testEmptyArrayReturnsZero(self):
self.assertRaises(ValueError, self.solution.maxSubArray, [])
def testArrayWithSingleEntryReturnsEntr... | Add 5 test cases for maximumSubarray problem. | Add 5 test cases for maximumSubarray problem.
| Python | mit | TheGhostHuCodes/leetCode | Add 5 test cases for maximumSubarray problem. | import unittest
from maximumSubarray import Solution
class TestMaximumSubarrayEdgeCases(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def testEmptyArrayReturnsZero(self):
self.assertRaises(ValueError, self.solution.maxSubArray, [])
def testArrayWithSingleEntryReturnsEntr... | <commit_before><commit_msg>Add 5 test cases for maximumSubarray problem.<commit_after> | import unittest
from maximumSubarray import Solution
class TestMaximumSubarrayEdgeCases(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def testEmptyArrayReturnsZero(self):
self.assertRaises(ValueError, self.solution.maxSubArray, [])
def testArrayWithSingleEntryReturnsEntr... | Add 5 test cases for maximumSubarray problem.import unittest
from maximumSubarray import Solution
class TestMaximumSubarrayEdgeCases(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def testEmptyArrayReturnsZero(self):
self.assertRaises(ValueError, self.solution.maxSubArray, [])... | <commit_before><commit_msg>Add 5 test cases for maximumSubarray problem.<commit_after>import unittest
from maximumSubarray import Solution
class TestMaximumSubarrayEdgeCases(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def testEmptyArrayReturnsZero(self):
self.assertRaises(V... | |
7a7b68b369319b80e7797c5d54b0ab6ba57768c2 | tools/similarweb/add_all_media_to_similarweb_queue.py | tools/similarweb/add_all_media_to_similarweb_queue.py | #!/usr/bin/env python3
from mediawords.db import connect_to_db, DatabaseHandler
from mediawords.job.similarweb.update_audience_data import SimilarWebUpdateAudienceDataJob
from mediawords.util.log import create_logger
log = create_logger(__name__)
def add_all_media_to_similarweb_queue(db: DatabaseHandler):
"""Ad... | Add script that adds all media IDs to SimilarWeb's queue | Add script that adds all media IDs to SimilarWeb's queue
| Python | agpl-3.0 | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | Add script that adds all media IDs to SimilarWeb's queue | #!/usr/bin/env python3
from mediawords.db import connect_to_db, DatabaseHandler
from mediawords.job.similarweb.update_audience_data import SimilarWebUpdateAudienceDataJob
from mediawords.util.log import create_logger
log = create_logger(__name__)
def add_all_media_to_similarweb_queue(db: DatabaseHandler):
"""Ad... | <commit_before><commit_msg>Add script that adds all media IDs to SimilarWeb's queue<commit_after> | #!/usr/bin/env python3
from mediawords.db import connect_to_db, DatabaseHandler
from mediawords.job.similarweb.update_audience_data import SimilarWebUpdateAudienceDataJob
from mediawords.util.log import create_logger
log = create_logger(__name__)
def add_all_media_to_similarweb_queue(db: DatabaseHandler):
"""Ad... | Add script that adds all media IDs to SimilarWeb's queue#!/usr/bin/env python3
from mediawords.db import connect_to_db, DatabaseHandler
from mediawords.job.similarweb.update_audience_data import SimilarWebUpdateAudienceDataJob
from mediawords.util.log import create_logger
log = create_logger(__name__)
def add_all_m... | <commit_before><commit_msg>Add script that adds all media IDs to SimilarWeb's queue<commit_after>#!/usr/bin/env python3
from mediawords.db import connect_to_db, DatabaseHandler
from mediawords.job.similarweb.update_audience_data import SimilarWebUpdateAudienceDataJob
from mediawords.util.log import create_logger
log ... | |
dddcec5d7712750617118843915fbae260eb8ffc | problem_3.py | problem_3.py | # Simple function for primeness test
def is_prime(number):
import math
limit = int(math.sqrt(number)) + 1
if number == 2:
return True
if number % 2 == 0:
return False
for i in range(3, limit, 2):
if number % i == 0:
return False
return True
import math
large_number = 600851475143
lim... | Solve problem 3 in Python | Solve problem 3 in Python
| Python | mit | sirodoht/project-euler,sirodoht/project-euler,sirodoht/project-euler | Solve problem 3 in Python | # Simple function for primeness test
def is_prime(number):
import math
limit = int(math.sqrt(number)) + 1
if number == 2:
return True
if number % 2 == 0:
return False
for i in range(3, limit, 2):
if number % i == 0:
return False
return True
import math
large_number = 600851475143
lim... | <commit_before><commit_msg>Solve problem 3 in Python<commit_after> | # Simple function for primeness test
def is_prime(number):
import math
limit = int(math.sqrt(number)) + 1
if number == 2:
return True
if number % 2 == 0:
return False
for i in range(3, limit, 2):
if number % i == 0:
return False
return True
import math
large_number = 600851475143
lim... | Solve problem 3 in Python# Simple function for primeness test
def is_prime(number):
import math
limit = int(math.sqrt(number)) + 1
if number == 2:
return True
if number % 2 == 0:
return False
for i in range(3, limit, 2):
if number % i == 0:
return False
return True
import math
large_... | <commit_before><commit_msg>Solve problem 3 in Python<commit_after># Simple function for primeness test
def is_prime(number):
import math
limit = int(math.sqrt(number)) + 1
if number == 2:
return True
if number % 2 == 0:
return False
for i in range(3, limit, 2):
if number % i == 0:
return ... | |
cd8653248ae87e50b9d392a1021dc5e63996d79a | distribution/src/main/resources/bin/list-ghe-repos.py | distribution/src/main/resources/bin/list-ghe-repos.py | #!/usr/bin/env python3.7
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | Add script to list repo URLs from GH enterprise. | Add script to list repo URLs from GH enterprise.
| Python | apache-2.0 | chrismattmann/drat,chrismattmann/drat,chrismattmann/drat,chrismattmann/drat,chrismattmann/drat | Add script to list repo URLs from GH enterprise. | #!/usr/bin/env python3.7
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | <commit_before><commit_msg>Add script to list repo URLs from GH enterprise.<commit_after> | #!/usr/bin/env python3.7
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | Add script to list repo URLs from GH enterprise.#!/usr/bin/env python3.7
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You ... | <commit_before><commit_msg>Add script to list repo URLs from GH enterprise.<commit_after>#!/usr/bin/env python3.7
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright owners... | |
acade24d7bc3a460429eea71f694ff5ffbc0a7ac | src/python/pullingFromCSV.py | src/python/pullingFromCSV.py | #!/usr/bin/python
'''
Author : Various Users
Date : 06/11/2015
Description : This will be a a relatively simple document breaking down the city_bash project
'''
##Necessary modules??
import openpyxl
import csv
import os
class CityBash(object):
def __init__(self):
pass
def pull_csv(self):
'''
Pull CSV... | Add src/python directory and put Python script in it | Add src/python directory and put Python script in it
| Python | mit | codeforboston/cornerwise,cityofsomerville/citydash,ejegg/citydash,cityofsomerville/citydash,patilav/citydash,codeforboston/cornerwise,patilav/citydash,ejegg/citydash,wrightgd/citydash,cityofsomerville/cornerwise,cityofsomerville/cornerwise,codeforboston/cornerwise,wrightgd/citydash,ejegg/citydash,patilav/citydash,patil... | Add src/python directory and put Python script in it | #!/usr/bin/python
'''
Author : Various Users
Date : 06/11/2015
Description : This will be a a relatively simple document breaking down the city_bash project
'''
##Necessary modules??
import openpyxl
import csv
import os
class CityBash(object):
def __init__(self):
pass
def pull_csv(self):
'''
Pull CSV... | <commit_before><commit_msg>Add src/python directory and put Python script in it<commit_after> | #!/usr/bin/python
'''
Author : Various Users
Date : 06/11/2015
Description : This will be a a relatively simple document breaking down the city_bash project
'''
##Necessary modules??
import openpyxl
import csv
import os
class CityBash(object):
def __init__(self):
pass
def pull_csv(self):
'''
Pull CSV... | Add src/python directory and put Python script in it#!/usr/bin/python
'''
Author : Various Users
Date : 06/11/2015
Description : This will be a a relatively simple document breaking down the city_bash project
'''
##Necessary modules??
import openpyxl
import csv
import os
class CityBash(object):
def __init__(s... | <commit_before><commit_msg>Add src/python directory and put Python script in it<commit_after>#!/usr/bin/python
'''
Author : Various Users
Date : 06/11/2015
Description : This will be a a relatively simple document breaking down the city_bash project
'''
##Necessary modules??
import openpyxl
import csv
import os
... | |
390df82feffb236820582a74b269b4cd5be5b6d4 | st2actions/tests/test_runner_container_service.py | st2actions/tests/test_runner_container_service.py | try:
import simplejson as json
except ImportError:
import json
import os
from oslo.config import cfg
import unittest2
from st2actions.container.service import RunnerContainerService
class RunnerContainerServiceTest(unittest2.TestCase):
def test_get_entry_point_absolute_path(self):
service = Ru... | Add test cases for runner container service. | Add test cases for runner container service.
| Python | apache-2.0 | Plexxi/st2,Plexxi/st2,tonybaloney/st2,pinterb/st2,armab/st2,armab/st2,pixelrebel/st2,pixelrebel/st2,Itxaka/st2,jtopjian/st2,alfasin/st2,grengojbo/st2,pinterb/st2,tonybaloney/st2,Plexxi/st2,emedvedev/st2,nzlosh/st2,lakshmi-kannan/st2,pixelrebel/st2,StackStorm/st2,alfasin/st2,grengojbo/st2,Plexxi/st2,StackStorm/st2,jtopj... | Add test cases for runner container service. | try:
import simplejson as json
except ImportError:
import json
import os
from oslo.config import cfg
import unittest2
from st2actions.container.service import RunnerContainerService
class RunnerContainerServiceTest(unittest2.TestCase):
def test_get_entry_point_absolute_path(self):
service = Ru... | <commit_before><commit_msg>Add test cases for runner container service.<commit_after> | try:
import simplejson as json
except ImportError:
import json
import os
from oslo.config import cfg
import unittest2
from st2actions.container.service import RunnerContainerService
class RunnerContainerServiceTest(unittest2.TestCase):
def test_get_entry_point_absolute_path(self):
service = Ru... | Add test cases for runner container service.try:
import simplejson as json
except ImportError:
import json
import os
from oslo.config import cfg
import unittest2
from st2actions.container.service import RunnerContainerService
class RunnerContainerServiceTest(unittest2.TestCase):
def test_get_entry_poi... | <commit_before><commit_msg>Add test cases for runner container service.<commit_after>try:
import simplejson as json
except ImportError:
import json
import os
from oslo.config import cfg
import unittest2
from st2actions.container.service import RunnerContainerService
class RunnerContainerServiceTest(unittes... | |
938cd71141285def1403297ab70b3ef949b78b8a | tests/commit/test_ci_installation.py | tests/commit/test_ci_installation.py | from unittest import TestCase
import phi
class TestCIInstallation(TestCase):
def test_detect_tf_torch_jax(self):
backends = phi.detect_backends()
names = [b.name for b in backends]
self.assertIn('PyTorch', names)
self.assertIn('Jax', names)
self.assertIn('TensorFlow', nam... | Test that all backends detected on GitHub Actions | [tests] Test that all backends detected on GitHub Actions
| Python | mit | tum-pbs/PhiFlow,tum-pbs/PhiFlow | [tests] Test that all backends detected on GitHub Actions | from unittest import TestCase
import phi
class TestCIInstallation(TestCase):
def test_detect_tf_torch_jax(self):
backends = phi.detect_backends()
names = [b.name for b in backends]
self.assertIn('PyTorch', names)
self.assertIn('Jax', names)
self.assertIn('TensorFlow', nam... | <commit_before><commit_msg>[tests] Test that all backends detected on GitHub Actions<commit_after> | from unittest import TestCase
import phi
class TestCIInstallation(TestCase):
def test_detect_tf_torch_jax(self):
backends = phi.detect_backends()
names = [b.name for b in backends]
self.assertIn('PyTorch', names)
self.assertIn('Jax', names)
self.assertIn('TensorFlow', nam... | [tests] Test that all backends detected on GitHub Actionsfrom unittest import TestCase
import phi
class TestCIInstallation(TestCase):
def test_detect_tf_torch_jax(self):
backends = phi.detect_backends()
names = [b.name for b in backends]
self.assertIn('PyTorch', names)
self.asser... | <commit_before><commit_msg>[tests] Test that all backends detected on GitHub Actions<commit_after>from unittest import TestCase
import phi
class TestCIInstallation(TestCase):
def test_detect_tf_torch_jax(self):
backends = phi.detect_backends()
names = [b.name for b in backends]
self.asse... | |
783795235e5382737893b5b92c3764785f1f35ea | local_server.py | local_server.py | #!/usr/bin/env python
import sys
import SimpleHTTPServer
import SocketServer
PORT = 8000
if len(sys.argv) > 1:
PORT = int(sys.argv[1])
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
| Work on refining the demo code to add some markers, etc. | Work on refining the demo code to add some markers, etc.
| Python | mit | vrsource/vrs.ux.touch,vrsource/vrs.ux.touch,vrsource/vrs.ux.touch,vrsource/vrs.ux.touch | Work on refining the demo code to add some markers, etc. | #!/usr/bin/env python
import sys
import SimpleHTTPServer
import SocketServer
PORT = 8000
if len(sys.argv) > 1:
PORT = int(sys.argv[1])
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
| <commit_before><commit_msg>Work on refining the demo code to add some markers, etc.<commit_after> | #!/usr/bin/env python
import sys
import SimpleHTTPServer
import SocketServer
PORT = 8000
if len(sys.argv) > 1:
PORT = int(sys.argv[1])
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
| Work on refining the demo code to add some markers, etc.#!/usr/bin/env python
import sys
import SimpleHTTPServer
import SocketServer
PORT = 8000
if len(sys.argv) > 1:
PORT = int(sys.argv[1])
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at ... | <commit_before><commit_msg>Work on refining the demo code to add some markers, etc.<commit_after>#!/usr/bin/env python
import sys
import SimpleHTTPServer
import SocketServer
PORT = 8000
if len(sys.argv) > 1:
PORT = int(sys.argv[1])
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer... | |
4c46a60458ade26497dda43e704cacf0f77a40af | accounts/migrations/0015_create_mit_organization.py | accounts/migrations/0015_create_mit_organization.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-31 18:22
from __future__ import unicode_literals
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations
from accounts.models import Organization
def create_mit_organization(apps, schema_editor, *args, **kwargs)... | Add MIT organization in a migration | Add MIT organization in a migration
| Python | apache-2.0 | CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api,pattisdr/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api | Add MIT organization in a migration | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-31 18:22
from __future__ import unicode_literals
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations
from accounts.models import Organization
def create_mit_organization(apps, schema_editor, *args, **kwargs)... | <commit_before><commit_msg>Add MIT organization in a migration<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-31 18:22
from __future__ import unicode_literals
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations
from accounts.models import Organization
def create_mit_organization(apps, schema_editor, *args, **kwargs)... | Add MIT organization in a migration# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-31 18:22
from __future__ import unicode_literals
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations
from accounts.models import Organization
def create_mit_organization(ap... | <commit_before><commit_msg>Add MIT organization in a migration<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-31 18:22
from __future__ import unicode_literals
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations
from accounts.models import Orga... | |
9b9bc0a737fcaf6ffe0dbcaa9a6c5de9e82720db | nova/tests/functional/regressions/test_bug_1620248.py | nova/tests/functional/regressions/test_bug_1620248.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 regression test for immediate server name update | Add regression test for immediate server name update
This tests a scenario where a user requests an update to the
server before it's scheduled and ensures it succeeds.
Related-Bug: #1620248
Change-Id: I13a9989d7f515ad2356d26b36b65742dbe48d1a8
| Python | apache-2.0 | openstack/nova,phenoxim/nova,mahak/nova,gooddata/openstack-nova,gooddata/openstack-nova,openstack/nova,hanlind/nova,jianghuaw/nova,rajalokan/nova,vmturbo/nova,rajalokan/nova,jianghuaw/nova,vmturbo/nova,mahak/nova,klmitch/nova,sebrandon1/nova,alaski/nova,openstack/nova,sebrandon1/nova,vmturbo/nova,klmitch/nova,jianghuaw... | Add regression test for immediate server name update
This tests a scenario where a user requests an update to the
server before it's scheduled and ensures it succeeds.
Related-Bug: #1620248
Change-Id: I13a9989d7f515ad2356d26b36b65742dbe48d1a8 | # 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 regression test for immediate server name update
This tests a scenario where a user requests an update to the
server before it's scheduled and ensures it succeeds.
Related-Bug: #1620248
Change-Id: I13a9989d7f515ad2356d26b36b65742dbe48d1a8<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 regression test for immediate server name update
This tests a scenario where a user requests an update to the
server before it's scheduled and ensures it succeeds.
Related-Bug: #1620248
Change-Id: I13a9989d7f515ad2356d26b36b65742dbe48d1a8# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | <commit_before><commit_msg>Add regression test for immediate server name update
This tests a scenario where a user requests an update to the
server before it's scheduled and ensures it succeeds.
Related-Bug: #1620248
Change-Id: I13a9989d7f515ad2356d26b36b65742dbe48d1a8<commit_after># Licensed under the Apache Licens... | |
df93e3523a94eff62407bb6b326c3ca2a122644c | corehq/apps/sms/migrations/0049_auto_enable_turnio_ff.py | corehq/apps/sms/migrations/0049_auto_enable_turnio_ff.py | # Generated by Django 2.2.24 on 2021-06-10 09:13
from django.db import migrations
from corehq.messaging.smsbackends.turn.models import SQLTurnWhatsAppBackend
from corehq.toggles import TURN_IO_BACKEND
def auto_enable_turnio_ff_for_certain_domains(apps, schema_editor):
for backend in SQLTurnWhatsAppBackend.active... | Add migration: auto-enable Turn.io for domains using it | Add migration: auto-enable Turn.io for domains using it
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add migration: auto-enable Turn.io for domains using it | # Generated by Django 2.2.24 on 2021-06-10 09:13
from django.db import migrations
from corehq.messaging.smsbackends.turn.models import SQLTurnWhatsAppBackend
from corehq.toggles import TURN_IO_BACKEND
def auto_enable_turnio_ff_for_certain_domains(apps, schema_editor):
for backend in SQLTurnWhatsAppBackend.active... | <commit_before><commit_msg>Add migration: auto-enable Turn.io for domains using it<commit_after> | # Generated by Django 2.2.24 on 2021-06-10 09:13
from django.db import migrations
from corehq.messaging.smsbackends.turn.models import SQLTurnWhatsAppBackend
from corehq.toggles import TURN_IO_BACKEND
def auto_enable_turnio_ff_for_certain_domains(apps, schema_editor):
for backend in SQLTurnWhatsAppBackend.active... | Add migration: auto-enable Turn.io for domains using it# Generated by Django 2.2.24 on 2021-06-10 09:13
from django.db import migrations
from corehq.messaging.smsbackends.turn.models import SQLTurnWhatsAppBackend
from corehq.toggles import TURN_IO_BACKEND
def auto_enable_turnio_ff_for_certain_domains(apps, schema_ed... | <commit_before><commit_msg>Add migration: auto-enable Turn.io for domains using it<commit_after># Generated by Django 2.2.24 on 2021-06-10 09:13
from django.db import migrations
from corehq.messaging.smsbackends.turn.models import SQLTurnWhatsAppBackend
from corehq.toggles import TURN_IO_BACKEND
def auto_enable_turn... | |
f1b09e1a810ea781e0e34cdd08938a8011a3dac8 | test/test_cext.py | test/test_cext.py |
def test_cryptography_path():
"""
Checks that an imported version of cryptography is actually from the
dist/cext folder. We can allow other versions, but for now, we want tests
to fail until we identify the right way to do this.
"""
try:
import cryptography
assert "dist/cext" i... | Add a test case to see that we are using cryptography from the right source | Add a test case to see that we are using cryptography from the right source
| Python | mit | indirectlylit/kolibri,mrpau/kolibri,mrpau/kolibri,lyw07/kolibri,learningequality/kolibri,benjaoming/kolibri,benjaoming/kolibri,lyw07/kolibri,indirectlylit/kolibri,mrpau/kolibri,DXCanas/kolibri,indirectlylit/kolibri,lyw07/kolibri,indirectlylit/kolibri,benjaoming/kolibri,mrpau/kolibri,DXCanas/kolibri,learningequality/kol... | Add a test case to see that we are using cryptography from the right source |
def test_cryptography_path():
"""
Checks that an imported version of cryptography is actually from the
dist/cext folder. We can allow other versions, but for now, we want tests
to fail until we identify the right way to do this.
"""
try:
import cryptography
assert "dist/cext" i... | <commit_before><commit_msg>Add a test case to see that we are using cryptography from the right source<commit_after> |
def test_cryptography_path():
"""
Checks that an imported version of cryptography is actually from the
dist/cext folder. We can allow other versions, but for now, we want tests
to fail until we identify the right way to do this.
"""
try:
import cryptography
assert "dist/cext" i... | Add a test case to see that we are using cryptography from the right source
def test_cryptography_path():
"""
Checks that an imported version of cryptography is actually from the
dist/cext folder. We can allow other versions, but for now, we want tests
to fail until we identify the right way to do this... | <commit_before><commit_msg>Add a test case to see that we are using cryptography from the right source<commit_after>
def test_cryptography_path():
"""
Checks that an imported version of cryptography is actually from the
dist/cext folder. We can allow other versions, but for now, we want tests
to fail u... | |
65b93eb73e25f43f0ebe4eab343084ebb297546f | education/migrations/0016_repair_missing_eav_values.py | education/migrations/0016_repair_missing_eav_values.py | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
import re
from django.conf import settings
from django.db.transaction import commit_on_success
@commit_on_success
class Migration(DataMigration):
def forwards(self, orm):
# Find responses that don't have a st... | Repair responses that should have a numeric value stored, but don't, making sure we don't insert implausibly large values. | Repair responses that should have a numeric value stored, but don't,
making sure we don't insert implausibly large values.
| Python | bsd-3-clause | unicefuganda/edtrac,unicefuganda/edtrac,unicefuganda/edtrac | Repair responses that should have a numeric value stored, but don't,
making sure we don't insert implausibly large values. | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
import re
from django.conf import settings
from django.db.transaction import commit_on_success
@commit_on_success
class Migration(DataMigration):
def forwards(self, orm):
# Find responses that don't have a st... | <commit_before><commit_msg>Repair responses that should have a numeric value stored, but don't,
making sure we don't insert implausibly large values.<commit_after> | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
import re
from django.conf import settings
from django.db.transaction import commit_on_success
@commit_on_success
class Migration(DataMigration):
def forwards(self, orm):
# Find responses that don't have a st... | Repair responses that should have a numeric value stored, but don't,
making sure we don't insert implausibly large values.# -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
import re
from django.conf import settings
from django.db.transaction import commit_on_success
@comm... | <commit_before><commit_msg>Repair responses that should have a numeric value stored, but don't,
making sure we don't insert implausibly large values.<commit_after># -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
import re
from django.conf import settings
from django.db.tr... | |
ec46ad8bd57be797a6bed7ec519cf7962bb6e1da | test_eigenvalue_goedbloed.py | test_eigenvalue_goedbloed.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 16 10:29:40 2014
@author: Jens von der Linden
Tests based on relations in Goedbloed (2010) Principles of MHD.
All equation references are from the book unless ofterwise noted.
"""
import eigenvalue_goedbloed as eigen
from nose.tools import assert_almost_equal, assert_gr... | Add template for testing goedbloed eigenvalue problem | Add template for testing goedbloed eigenvalue problem
| Python | mit | jensv/fluxtubestability,jensv/fluxtubestability | Add template for testing goedbloed eigenvalue problem | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 16 10:29:40 2014
@author: Jens von der Linden
Tests based on relations in Goedbloed (2010) Principles of MHD.
All equation references are from the book unless ofterwise noted.
"""
import eigenvalue_goedbloed as eigen
from nose.tools import assert_almost_equal, assert_gr... | <commit_before><commit_msg>Add template for testing goedbloed eigenvalue problem<commit_after> | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 16 10:29:40 2014
@author: Jens von der Linden
Tests based on relations in Goedbloed (2010) Principles of MHD.
All equation references are from the book unless ofterwise noted.
"""
import eigenvalue_goedbloed as eigen
from nose.tools import assert_almost_equal, assert_gr... | Add template for testing goedbloed eigenvalue problem# -*- coding: utf-8 -*-
"""
Created on Wed Jul 16 10:29:40 2014
@author: Jens von der Linden
Tests based on relations in Goedbloed (2010) Principles of MHD.
All equation references are from the book unless ofterwise noted.
"""
import eigenvalue_goedbloed as eigen
... | <commit_before><commit_msg>Add template for testing goedbloed eigenvalue problem<commit_after># -*- coding: utf-8 -*-
"""
Created on Wed Jul 16 10:29:40 2014
@author: Jens von der Linden
Tests based on relations in Goedbloed (2010) Principles of MHD.
All equation references are from the book unless ofterwise noted.
"... | |
5fdc462be0381a5273008a7a7b702a861bffc1a4 | ceilometer/storage/sqlalchemy/migrate_repo/versions/011_indexes_cleanup.py | ceilometer/storage/sqlalchemy/migrate_repo/versions/011_indexes_cleanup.py | # -*- encoding: utf-8 -*-
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add cleanup migration for indexes. | Add cleanup migration for indexes.
There are a lot of extra indexes in database (for primary key).
bp: ceilometer-db-sync-models-with-migrations
Change-Id: I44d569de81f078aef27451382baf0a3061f38be2
| Python | apache-2.0 | fabian4/ceilometer,cernops/ceilometer,sileht/aodh,redhat-openstack/ceilometer,Juniper/ceilometer,JioCloud/ceilometer,rickerc/ceilometer_audit,m1093782566/openstack_org_ceilometer,rackerlabs/instrumented-ceilometer,ityaptin/ceilometer,eayunstack/ceilometer,r-mibu/ceilometer,fabian4/ceilometer,eayunstack/ceilometer,maths... | Add cleanup migration for indexes.
There are a lot of extra indexes in database (for primary key).
bp: ceilometer-db-sync-models-with-migrations
Change-Id: I44d569de81f078aef27451382baf0a3061f38be2 | # -*- encoding: utf-8 -*-
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before><commit_msg>Add cleanup migration for indexes.
There are a lot of extra indexes in database (for primary key).
bp: ceilometer-db-sync-models-with-migrations
Change-Id: I44d569de81f078aef27451382baf0a3061f38be2<commit_after> | # -*- encoding: utf-8 -*-
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add cleanup migration for indexes.
There are a lot of extra indexes in database (for primary key).
bp: ceilometer-db-sync-models-with-migrations
Change-Id: I44d569de81f078aef27451382baf0a3061f38be2# -*- encoding: utf-8 -*-
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this f... | <commit_before><commit_msg>Add cleanup migration for indexes.
There are a lot of extra indexes in database (for primary key).
bp: ceilometer-db-sync-models-with-migrations
Change-Id: I44d569de81f078aef27451382baf0a3061f38be2<commit_after># -*- encoding: utf-8 -*-
#
#
# Licensed under the Apache License, Version 2.0 ... | |
9a467e294269ed3e222d136f3ca59ef8a6ab96a5 | turbustat/tests/test_mahalanobis.py | turbustat/tests/test_mahalanobis.py | # Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import warnings
from ..statistics import Mahalanobis, Mahalanobis_Distance
from ..statistics.stats_warnings import TurbuStatTestingWarning
from ._testing_data import dataset1
def ... | Add mahalanobis tests to check that the warning is raised | Add mahalanobis tests to check that the warning is raised
| Python | mit | e-koch/TurbuStat,Astroua/TurbuStat | Add mahalanobis tests to check that the warning is raised | # Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import warnings
from ..statistics import Mahalanobis, Mahalanobis_Distance
from ..statistics.stats_warnings import TurbuStatTestingWarning
from ._testing_data import dataset1
def ... | <commit_before><commit_msg>Add mahalanobis tests to check that the warning is raised<commit_after> | # Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import warnings
from ..statistics import Mahalanobis, Mahalanobis_Distance
from ..statistics.stats_warnings import TurbuStatTestingWarning
from ._testing_data import dataset1
def ... | Add mahalanobis tests to check that the warning is raised# Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import warnings
from ..statistics import Mahalanobis, Mahalanobis_Distance
from ..statistics.stats_warnings import TurbuStat... | <commit_before><commit_msg>Add mahalanobis tests to check that the warning is raised<commit_after># Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import warnings
from ..statistics import Mahalanobis, Mahalanobis_Distance
from ..s... | |
45e22595708e9053b27197c8d7a1d4d09c6a4861 | notifications/migrations/0004_auto_20150826_1508.py | notifications/migrations/0004_auto_20150826_1508.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import notifications.models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0003_notification_data'),
]
operations = [
migrations.AlterField(
m... | Add missing migration for Notification model | Add missing migration for Notification model
| Python | bsd-3-clause | philroche/django-notifications,philroche/django-notifications,philroche/django-notifications | Add missing migration for Notification model | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import notifications.models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0003_notification_data'),
]
operations = [
migrations.AlterField(
m... | <commit_before><commit_msg>Add missing migration for Notification model<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import notifications.models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0003_notification_data'),
]
operations = [
migrations.AlterField(
m... | Add missing migration for Notification model# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import notifications.models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0003_notification_data'),
]
operations = [
... | <commit_before><commit_msg>Add missing migration for Notification model<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import notifications.models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0003_notifi... | |
f317ec8026e10fd53ea0c19d2347836d5398f8e4 | begood_sites/management/commands/get_site.py | begood_sites/management/commands/get_site.py | # coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Return the id, domain and name for a site'
def handle(self, ... | Add a management command for getting site information. | Add a management command for getting site information.
| Python | mit | AGoodId/begood-sites | Add a management command for getting site information. | # coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Return the id, domain and name for a site'
def handle(self, ... | <commit_before><commit_msg>Add a management command for getting site information.<commit_after> | # coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Return the id, domain and name for a site'
def handle(self, ... | Add a management command for getting site information.# coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Return th... | <commit_before><commit_msg>Add a management command for getting site information.<commit_after># coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
... | |
2e44dc3c8e3e8751e649728ff5abf541c401a3e7 | wagtail/wagtailsearch/tests/test_page_search.py | wagtail/wagtailsearch/tests/test_page_search.py | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.test import TestCase
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.backends import get_search_backend
class PageSearchTests(object):
# A TestCase with this class mixed in will be dynami... | Add tests for searching on the Page model | Add tests for searching on the Page model
| Python | bsd-3-clause | FlipperPA/wagtail,thenewguy/wagtail,takeflight/wagtail,wagtail/wagtail,thenewguy/wagtail,torchbox/wagtail,jnns/wagtail,mikedingjan/wagtail,jnns/wagtail,nealtodd/wagtail,FlipperPA/wagtail,takeflight/wagtail,FlipperPA/wagtail,rsalmaso/wagtail,rsalmaso/wagtail,takeflight/wagtail,timorieber/wagtail,nimasmi/wagtail,kaedroho... | Add tests for searching on the Page model | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.test import TestCase
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.backends import get_search_backend
class PageSearchTests(object):
# A TestCase with this class mixed in will be dynami... | <commit_before><commit_msg>Add tests for searching on the Page model<commit_after> | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.test import TestCase
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.backends import get_search_backend
class PageSearchTests(object):
# A TestCase with this class mixed in will be dynami... | Add tests for searching on the Page modelfrom __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.test import TestCase
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.backends import get_search_backend
class PageSearchTests(object):
# A TestCas... | <commit_before><commit_msg>Add tests for searching on the Page model<commit_after>from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.test import TestCase
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.backends import get_search_backend
class... | |
7376dcf2222f24bafee9896c7b6631cbede829c8 | bayespy/inference/vmp/nodes/tests/test_dirichlet.py | bayespy/inference/vmp/nodes/tests/test_dirichlet.py | ######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | Add unit tests for Dirichlet node | TST: Add unit tests for Dirichlet node
| Python | mit | jluttine/bayespy,bayespy/bayespy,SalemAmeen/bayespy,fivejjs/bayespy | TST: Add unit tests for Dirichlet node | ######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | <commit_before><commit_msg>TST: Add unit tests for Dirichlet node<commit_after> | ######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | TST: Add unit tests for Dirichlet node######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################... | <commit_before><commit_msg>TST: Add unit tests for Dirichlet node<commit_after>######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
#############... | |
f1f1239a6c33277b492e88e7cb8ebf83b3bef074 | python/example_code/iam/list_users_with_resource.py | python/example_code/iam/list_users_with_resource.py | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | Add example to list IAM users with service resource | Add example to list IAM users with service resource
| Python | apache-2.0 | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a... | Add example to list IAM users with service resource | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | <commit_before><commit_msg>Add example to list IAM users with service resource<commit_after> | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | Add example to list IAM users with service resource# Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.am... | <commit_before><commit_msg>Add example to list IAM users with service resource<commit_after># Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# th... | |
2bb4bc69e88431f4f89ad63243a1f3dc59ee2b29 | pbs/create_db.py | pbs/create_db.py | #!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 20-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 2018
# license :
#===========================================... | Add script to run PBS jobs to collect all data to fragment database | Add script to run PBS jobs to collect all data to fragment database
| Python | bsd-3-clause | DrrDom/crem,DrrDom/crem | Add script to run PBS jobs to collect all data to fragment database | #!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 20-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 2018
# license :
#===========================================... | <commit_before><commit_msg>Add script to run PBS jobs to collect all data to fragment database<commit_after> | #!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 20-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 2018
# license :
#===========================================... | Add script to run PBS jobs to collect all data to fragment database#!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 20-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 201... | <commit_before><commit_msg>Add script to run PBS jobs to collect all data to fragment database<commit_after>#!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 20-08-2018
# version :
# python_version : ... | |
fefd4db49bf5590a1d95eb59ae6de9a63131f5ef | mutation/mutation_results.py | mutation/mutation_results.py | import matplotlib.pyplot as plt
import numpy
class Result:
def __init__(self, mut_type, schemes, results):
self.mut_type = mut_type
self.schemes = schemes
self.results = results
def __repr__(self):
return "result - " + str(self.mut_type) + "-" + str(self.results)
class Mutati... | Add script for parsing mutation results. | Add script for parsing mutation results.
| Python | mit | levilucio/SyVOLT,levilucio/SyVOLT | Add script for parsing mutation results. | import matplotlib.pyplot as plt
import numpy
class Result:
def __init__(self, mut_type, schemes, results):
self.mut_type = mut_type
self.schemes = schemes
self.results = results
def __repr__(self):
return "result - " + str(self.mut_type) + "-" + str(self.results)
class Mutati... | <commit_before><commit_msg>Add script for parsing mutation results.<commit_after> | import matplotlib.pyplot as plt
import numpy
class Result:
def __init__(self, mut_type, schemes, results):
self.mut_type = mut_type
self.schemes = schemes
self.results = results
def __repr__(self):
return "result - " + str(self.mut_type) + "-" + str(self.results)
class Mutati... | Add script for parsing mutation results.import matplotlib.pyplot as plt
import numpy
class Result:
def __init__(self, mut_type, schemes, results):
self.mut_type = mut_type
self.schemes = schemes
self.results = results
def __repr__(self):
return "result - " + str(self.mut_type)... | <commit_before><commit_msg>Add script for parsing mutation results.<commit_after>import matplotlib.pyplot as plt
import numpy
class Result:
def __init__(self, mut_type, schemes, results):
self.mut_type = mut_type
self.schemes = schemes
self.results = results
def __repr__(self):
... | |
7079614f35de60def5f4e1cc1cb17cf3e5b4d9c6 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | #!/usr/bin/env python
from distutils.core import setup
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the official Facebook JavaScript SDK, which '
'is the canonical way to implement Facebook... | Change way README is imported. | Change way README is imported.
The custom read function is unnecessary since only one file is being
accessed. Removing it reduces the amount of code.
| Python | apache-2.0 | Aloomaio/facebook-sdk,mobolic/facebook-sdk | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | #!/usr/bin/env python
from distutils.core import setup
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the official Facebook JavaScript SDK, which '
'is the canonical way to implement Facebook... | <commit_before>#!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Grap... | #!/usr/bin/env python
from distutils.core import setup
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the official Facebook JavaScript SDK, which '
'is the canonical way to implement Facebook... | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | <commit_before>#!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Grap... |
b14d8021dc936be4bb2d8684f1268f8422953fac | dump-classes.py | dump-classes.py | #!/usr/bin/python
from subprocess import call
import glob
import os
import sys
import fileinput
import re
destination_path = 'Multiplex/FrameworkHeaders/'
def dump_all_frameworks():
# 3 different directories contain all of the frameworks a plugin may interface with.
# They're located at {APP_DIR}/Contents/
shared_... | Add class dump automation script | Add class dump automation script
| Python | mit | kolinkrewinkel/Multiplex,kolinkrewinkel/Multiplex,kolinkrewinkel/Multiplex | Add class dump automation script | #!/usr/bin/python
from subprocess import call
import glob
import os
import sys
import fileinput
import re
destination_path = 'Multiplex/FrameworkHeaders/'
def dump_all_frameworks():
# 3 different directories contain all of the frameworks a plugin may interface with.
# They're located at {APP_DIR}/Contents/
shared_... | <commit_before><commit_msg>Add class dump automation script<commit_after> | #!/usr/bin/python
from subprocess import call
import glob
import os
import sys
import fileinput
import re
destination_path = 'Multiplex/FrameworkHeaders/'
def dump_all_frameworks():
# 3 different directories contain all of the frameworks a plugin may interface with.
# They're located at {APP_DIR}/Contents/
shared_... | Add class dump automation script#!/usr/bin/python
from subprocess import call
import glob
import os
import sys
import fileinput
import re
destination_path = 'Multiplex/FrameworkHeaders/'
def dump_all_frameworks():
# 3 different directories contain all of the frameworks a plugin may interface with.
# They're located... | <commit_before><commit_msg>Add class dump automation script<commit_after>#!/usr/bin/python
from subprocess import call
import glob
import os
import sys
import fileinput
import re
destination_path = 'Multiplex/FrameworkHeaders/'
def dump_all_frameworks():
# 3 different directories contain all of the frameworks a plug... | |
333908ed1a01fba4429f417df012b5db5c75b1b4 | slurp.py | slurp.py | #!/usr/bin/env python
def log(msg):
print("[+] %s" % msg)
import os
import sys
import bz2
from groundstation.station import Station
from groundstation.node import Node
from groundstation.objects.update_object import UpdateObject
def main():
myself = Node()
station = Station.from_env(myself)
filenam... | Add a script for dumping data into the graphdb | Add a script for dumping data into the graphdb
| Python | mit | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | Add a script for dumping data into the graphdb | #!/usr/bin/env python
def log(msg):
print("[+] %s" % msg)
import os
import sys
import bz2
from groundstation.station import Station
from groundstation.node import Node
from groundstation.objects.update_object import UpdateObject
def main():
myself = Node()
station = Station.from_env(myself)
filenam... | <commit_before><commit_msg>Add a script for dumping data into the graphdb<commit_after> | #!/usr/bin/env python
def log(msg):
print("[+] %s" % msg)
import os
import sys
import bz2
from groundstation.station import Station
from groundstation.node import Node
from groundstation.objects.update_object import UpdateObject
def main():
myself = Node()
station = Station.from_env(myself)
filenam... | Add a script for dumping data into the graphdb#!/usr/bin/env python
def log(msg):
print("[+] %s" % msg)
import os
import sys
import bz2
from groundstation.station import Station
from groundstation.node import Node
from groundstation.objects.update_object import UpdateObject
def main():
myself = Node()
... | <commit_before><commit_msg>Add a script for dumping data into the graphdb<commit_after>#!/usr/bin/env python
def log(msg):
print("[+] %s" % msg)
import os
import sys
import bz2
from groundstation.station import Station
from groundstation.node import Node
from groundstation.objects.update_object import UpdateObj... | |
4a6eb49a2fd93c22b7e7491d1b225f0dd3b2e078 | ielex/lexicon/migrations/0092_set_cjc_reliabilities_high.py | ielex/lexicon/migrations/0092_set_cjc_reliabilities_high.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
'''
I accidentially deleted a citation in production.
This migration adds it again.
'''
# Models to work with:
CognateJudgementCitation = apps.get_model(
... | Set CognateJudgementCitation reliabilities to high | Set CognateJudgementCitation reliabilities to high
- This only affects CognateJudgementCitations that link to Lexemes
that belong to Meanings from the `Jena200` list and belong to Languages from the `Current` list.
- Relates to #229
| Python | bsd-2-clause | lingdb/CoBL-public,lingdb/CoBL-public,lingdb/CoBL-public,lingdb/CoBL-public | Set CognateJudgementCitation reliabilities to high
- This only affects CognateJudgementCitations that link to Lexemes
that belong to Meanings from the `Jena200` list and belong to Languages from the `Current` list.
- Relates to #229 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
'''
I accidentially deleted a citation in production.
This migration adds it again.
'''
# Models to work with:
CognateJudgementCitation = apps.get_model(
... | <commit_before><commit_msg>Set CognateJudgementCitation reliabilities to high
- This only affects CognateJudgementCitations that link to Lexemes
that belong to Meanings from the `Jena200` list and belong to Languages from the `Current` list.
- Relates to #229<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
'''
I accidentially deleted a citation in production.
This migration adds it again.
'''
# Models to work with:
CognateJudgementCitation = apps.get_model(
... | Set CognateJudgementCitation reliabilities to high
- This only affects CognateJudgementCitations that link to Lexemes
that belong to Meanings from the `Jena200` list and belong to Languages from the `Current` list.
- Relates to #229# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import... | <commit_before><commit_msg>Set CognateJudgementCitation reliabilities to high
- This only affects CognateJudgementCitations that link to Lexemes
that belong to Meanings from the `Jena200` list and belong to Languages from the `Current` list.
- Relates to #229<commit_after># -*- coding: utf-8 -*-
from __future__ impo... | |
2bf24460f0ffc1b1c99c110bd552e1c0e59d6d87 | byceps/services/shop/order/ordered_articles_service.py | byceps/services/shop/order/ordered_articles_service.py | """
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
from ..article.mod... | """
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
from ..article.mod... | Return `OrderItemTuple`s rather than order item database entities from service | Return `OrderItemTuple`s rather than order item database entities from service
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps | """
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
from ..article.mod... | """
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
from ..article.mod... | <commit_before>"""
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
fro... | """
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
from ..article.mod... | """
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
from ..article.mod... | <commit_before>"""
byceps.services.shop.order.ordered_articles_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import Counter
from typing import Dict, Sequence
from ....database import db
fro... |
e77af0365a977191f00250887e8f8945ab460b5a | backend/breach/migrations/0015_auto_20160511_1740.py | backend/breach/migrations/0015_auto_20160511_1740.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-11 17:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('breach', '0014_auto_20160504_1753'),
]
operations = [
migrations.AddField(
... | Add migration for methods, realtimeurl | Add migration for methods, realtimeurl
| Python | mit | dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,dionyziz/rupture,esarafianou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,esarafianou/rupture,esarafianou/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,dimkarakostas/rupture,e... | Add migration for methods, realtimeurl | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-11 17:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('breach', '0014_auto_20160504_1753'),
]
operations = [
migrations.AddField(
... | <commit_before><commit_msg>Add migration for methods, realtimeurl<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-11 17:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('breach', '0014_auto_20160504_1753'),
]
operations = [
migrations.AddField(
... | Add migration for methods, realtimeurl# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-11 17:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('breach', '0014_auto_20160504_1753'),
]
operati... | <commit_before><commit_msg>Add migration for methods, realtimeurl<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-11 17:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('breach', '0014... | |
474c2ec9fcea87e4020b3ee5f161d938ce2b558e | nurseconnect/models.py | nurseconnect/models.py | from django.db import models
from molo.profiles.models import UserProfile as MoloUserProfile
class UserProfile(MoloUserProfile):
"""
NurseConnect requires a few modifications to the standard way Profiles are
handled by molo.profiles. This model serves to implement these.
"""
clinic_code = models.... | Create UserProfile model for NurseConnect | Create UserProfile model for NurseConnect
| Python | bsd-2-clause | praekelt/nurseconnect,praekelt/nurseconnect,praekelt/nurseconnect | Create UserProfile model for NurseConnect | from django.db import models
from molo.profiles.models import UserProfile as MoloUserProfile
class UserProfile(MoloUserProfile):
"""
NurseConnect requires a few modifications to the standard way Profiles are
handled by molo.profiles. This model serves to implement these.
"""
clinic_code = models.... | <commit_before><commit_msg>Create UserProfile model for NurseConnect<commit_after> | from django.db import models
from molo.profiles.models import UserProfile as MoloUserProfile
class UserProfile(MoloUserProfile):
"""
NurseConnect requires a few modifications to the standard way Profiles are
handled by molo.profiles. This model serves to implement these.
"""
clinic_code = models.... | Create UserProfile model for NurseConnectfrom django.db import models
from molo.profiles.models import UserProfile as MoloUserProfile
class UserProfile(MoloUserProfile):
"""
NurseConnect requires a few modifications to the standard way Profiles are
handled by molo.profiles. This model serves to implement... | <commit_before><commit_msg>Create UserProfile model for NurseConnect<commit_after>from django.db import models
from molo.profiles.models import UserProfile as MoloUserProfile
class UserProfile(MoloUserProfile):
"""
NurseConnect requires a few modifications to the standard way Profiles are
handled by molo... | |
119bcb37d04e80f49bbb8bcf44b6ea4a937388b8 | dbaas/workflow/steps/util/deploy/restart_td_agent.py | dbaas/workflow/steps/util/deploy/restart_td_agent.py | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import exec_remote_command
from dbaas_cloudstack.models import HostAttr as CS_HostAttr
from workflow.steps.util.base import BaseStep
from workflow.steps.util import test_bash_script_error
from workflow.steps.util import td_agent_script
from wo... | Add td agent restarts tep | Add td agent restarts tep
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | Add td agent restarts tep | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import exec_remote_command
from dbaas_cloudstack.models import HostAttr as CS_HostAttr
from workflow.steps.util.base import BaseStep
from workflow.steps.util import test_bash_script_error
from workflow.steps.util import td_agent_script
from wo... | <commit_before><commit_msg>Add td agent restarts tep<commit_after> | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import exec_remote_command
from dbaas_cloudstack.models import HostAttr as CS_HostAttr
from workflow.steps.util.base import BaseStep
from workflow.steps.util import test_bash_script_error
from workflow.steps.util import td_agent_script
from wo... | Add td agent restarts tep# -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import exec_remote_command
from dbaas_cloudstack.models import HostAttr as CS_HostAttr
from workflow.steps.util.base import BaseStep
from workflow.steps.util import test_bash_script_error
from workflow.steps.util impor... | <commit_before><commit_msg>Add td agent restarts tep<commit_after># -*- coding: utf-8 -*-
import logging
from util import full_stack
from util import exec_remote_command
from dbaas_cloudstack.models import HostAttr as CS_HostAttr
from workflow.steps.util.base import BaseStep
from workflow.steps.util import test_bash_sc... | |
ca7b91c3fea848c050b7d1e9099327e4f8ffcc31 | Collapse_Capture_Intervals.py | Collapse_Capture_Intervals.py | #!/usr/bin/env python
"""Collapse smaller consecutive intervals into larger ones. Allows a minimum
distance intervals are spaced for them to be consecutive."""
import sys
intervals = sys.argv[1]
def collapse_intervals(regions, dist, minsize=150):
"""Takes a list of tuples describing intervals, and collapses con... | Add script to generate BED intervals from filtered coverage data | Add script to generate BED intervals from filtered coverage data
| Python | unlicense | TomJKono/Misc_Utils,TomJKono/Misc_Utils,TomJKono/Misc_Utils | Add script to generate BED intervals from filtered coverage data | #!/usr/bin/env python
"""Collapse smaller consecutive intervals into larger ones. Allows a minimum
distance intervals are spaced for them to be consecutive."""
import sys
intervals = sys.argv[1]
def collapse_intervals(regions, dist, minsize=150):
"""Takes a list of tuples describing intervals, and collapses con... | <commit_before><commit_msg>Add script to generate BED intervals from filtered coverage data<commit_after> | #!/usr/bin/env python
"""Collapse smaller consecutive intervals into larger ones. Allows a minimum
distance intervals are spaced for them to be consecutive."""
import sys
intervals = sys.argv[1]
def collapse_intervals(regions, dist, minsize=150):
"""Takes a list of tuples describing intervals, and collapses con... | Add script to generate BED intervals from filtered coverage data#!/usr/bin/env python
"""Collapse smaller consecutive intervals into larger ones. Allows a minimum
distance intervals are spaced for them to be consecutive."""
import sys
intervals = sys.argv[1]
def collapse_intervals(regions, dist, minsize=150):
"... | <commit_before><commit_msg>Add script to generate BED intervals from filtered coverage data<commit_after>#!/usr/bin/env python
"""Collapse smaller consecutive intervals into larger ones. Allows a minimum
distance intervals are spaced for them to be consecutive."""
import sys
intervals = sys.argv[1]
def collapse_int... | |
6edd1b4856956436a9a6844a29856681e1df6248 | leetcode/287-Find-the-Duplicate-Number/FindtheDupNum_001.py | leetcode/287-Find-the-Duplicate-Number/FindtheDupNum_001.py | class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
l, r = 1, len(nums) - 1
while l < r:
m = l + (r - l) / 2
cnt = 0
for num in nums:
if num <= m:
cnt ... | Add the bin search py version of FindtheDupNum | Add the bin search py version of FindtheDupNum | Python | mit | Chasego/codirit,cc13ny/algo,cc13ny/Allin,Chasego/codirit,Chasego/cod,Chasego/codirit,cc13ny/algo,Chasego/cod,cc13ny/Allin,Chasego/codirit,Chasego/codi,Chasego/cod,Chasego/codi,Chasego/cod,cc13ny/Allin,Chasego/codi,Chasego/codi,cc13ny/algo,Chasego/codi,cc13ny/algo,Chasego/codirit,Chasego/cod,cc13ny/Allin,cc13ny/algo,cc1... | Add the bin search py version of FindtheDupNum | class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
l, r = 1, len(nums) - 1
while l < r:
m = l + (r - l) / 2
cnt = 0
for num in nums:
if num <= m:
cnt ... | <commit_before><commit_msg>Add the bin search py version of FindtheDupNum<commit_after> | class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
l, r = 1, len(nums) - 1
while l < r:
m = l + (r - l) / 2
cnt = 0
for num in nums:
if num <= m:
cnt ... | Add the bin search py version of FindtheDupNumclass Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
l, r = 1, len(nums) - 1
while l < r:
m = l + (r - l) / 2
cnt = 0
for num in nums:
... | <commit_before><commit_msg>Add the bin search py version of FindtheDupNum<commit_after>class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
l, r = 1, len(nums) - 1
while l < r:
m = l + (r - l) / 2
cnt... | |
adc87e9c16e453acd6f5dd74ea4ec3b61458bb73 | cinch/tests/lexer_tests.py | cinch/tests/lexer_tests.py | from unittest import TestCase
from cinch.lexer import lex
class TestLexer(TestCase):
def test_lex(self):
# noqa -- this is formatted like real code
source = """
if ( 4 ) {
avariable = 1 + 1
anothervariable = a - 314
}
"""
# n... | Add tests for the lexer | Add tests for the lexer
| Python | mit | tschuy/cinch-lang,iankronquist/cinch-lang | Add tests for the lexer | from unittest import TestCase
from cinch.lexer import lex
class TestLexer(TestCase):
def test_lex(self):
# noqa -- this is formatted like real code
source = """
if ( 4 ) {
avariable = 1 + 1
anothervariable = a - 314
}
"""
# n... | <commit_before><commit_msg>Add tests for the lexer<commit_after> | from unittest import TestCase
from cinch.lexer import lex
class TestLexer(TestCase):
def test_lex(self):
# noqa -- this is formatted like real code
source = """
if ( 4 ) {
avariable = 1 + 1
anothervariable = a - 314
}
"""
# n... | Add tests for the lexerfrom unittest import TestCase
from cinch.lexer import lex
class TestLexer(TestCase):
def test_lex(self):
# noqa -- this is formatted like real code
source = """
if ( 4 ) {
avariable = 1 + 1
anothervariable = a - 314
}
... | <commit_before><commit_msg>Add tests for the lexer<commit_after>from unittest import TestCase
from cinch.lexer import lex
class TestLexer(TestCase):
def test_lex(self):
# noqa -- this is formatted like real code
source = """
if ( 4 ) {
avariable = 1 + 1
... | |
258a244ad088f1f827e41f091c6fbc51ad44f27b | src/visualize_model.py | src/visualize_model.py | import argparse
from keras.utils import plot_model
from prep import prep_data
from model import get_model
ap = argparse.ArgumentParser()
ap.add_argument('--dataset', type=str, default='./data')
ap.add_argument('--x_length', type=int, default=15)
ap.add_argument('--y_length', type=int, default=20)
ap.add_argument('-... | Add script for visualizing model | Add script for visualizing model
| Python | mit | vdragan1993/python-coder | Add script for visualizing model | import argparse
from keras.utils import plot_model
from prep import prep_data
from model import get_model
ap = argparse.ArgumentParser()
ap.add_argument('--dataset', type=str, default='./data')
ap.add_argument('--x_length', type=int, default=15)
ap.add_argument('--y_length', type=int, default=20)
ap.add_argument('-... | <commit_before><commit_msg>Add script for visualizing model<commit_after> | import argparse
from keras.utils import plot_model
from prep import prep_data
from model import get_model
ap = argparse.ArgumentParser()
ap.add_argument('--dataset', type=str, default='./data')
ap.add_argument('--x_length', type=int, default=15)
ap.add_argument('--y_length', type=int, default=20)
ap.add_argument('-... | Add script for visualizing modelimport argparse
from keras.utils import plot_model
from prep import prep_data
from model import get_model
ap = argparse.ArgumentParser()
ap.add_argument('--dataset', type=str, default='./data')
ap.add_argument('--x_length', type=int, default=15)
ap.add_argument('--y_length', type=int... | <commit_before><commit_msg>Add script for visualizing model<commit_after>import argparse
from keras.utils import plot_model
from prep import prep_data
from model import get_model
ap = argparse.ArgumentParser()
ap.add_argument('--dataset', type=str, default='./data')
ap.add_argument('--x_length', type=int, default=1... | |
84fa2d2a5a1ff4aa0dca33a76677283d33dcf337 | test/mock-connector.py | test/mock-connector.py | #!/usr/bin/python3
#
# This file is part of the KNOT Project
#
# Copyright (c) 2019, CESAR. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versi... | Add mock script to test messages in amqp | Add mock script to test messages in amqp
This patch adds support to receive and send unregistered
messages.
| Python | lgpl-2.1 | CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source | Add mock script to test messages in amqp
This patch adds support to receive and send unregistered
messages. | #!/usr/bin/python3
#
# This file is part of the KNOT Project
#
# Copyright (c) 2019, CESAR. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versi... | <commit_before><commit_msg>Add mock script to test messages in amqp
This patch adds support to receive and send unregistered
messages.<commit_after> | #!/usr/bin/python3
#
# This file is part of the KNOT Project
#
# Copyright (c) 2019, CESAR. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versi... | Add mock script to test messages in amqp
This patch adds support to receive and send unregistered
messages.#!/usr/bin/python3
#
# This file is part of the KNOT Project
#
# Copyright (c) 2019, CESAR. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms... | <commit_before><commit_msg>Add mock script to test messages in amqp
This patch adds support to receive and send unregistered
messages.<commit_after>#!/usr/bin/python3
#
# This file is part of the KNOT Project
#
# Copyright (c) 2019, CESAR. All rights reserved.
#
# This library is free software; you can redistribut... | |
5191055f0cc071ff4dc0a8ea42e598809c519be4 | magnum/db/sqlalchemy/alembic/versions/3b6c4c42adb4_add_unique_constraints.py | magnum/db/sqlalchemy/alembic/versions/3b6c4c42adb4_add_unique_constraints.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
# d... | Add unique column constraints to db | Add unique column constraints to db
Unique constraints are not being set on the database but they are
defined in the schema. This db upgrade adds the unique constraints.
Change-Id: I0dd1c2190bf7b68e1e0c8c71fbb123d2c82cc0d3
Closes-Bug: 1451761
| Python | apache-2.0 | ChengTiesheng/magnum,hongbin/magnum,eshijia/magnum,Tennyson53/magnum,dimtruck/magnum,eshijia/SUR,ArchiFleKs/magnum,dimtruck/magnum,Tennyson53/magnum,ddepaoli3/magnum,LaynePeng/magnum,ChengTiesheng/magnum,ramielrowe/magnum,mjbrewer/testindex,Tennyson53/SUR,mjbrewer/testindex,ffantast/magnum,annegentle/magnum,ddepaoli3/m... | Add unique column constraints to db
Unique constraints are not being set on the database but they are
defined in the schema. This db upgrade adds the unique constraints.
Change-Id: I0dd1c2190bf7b68e1e0c8c71fbb123d2c82cc0d3
Closes-Bug: 1451761 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before><commit_msg>Add unique column constraints to db
Unique constraints are not being set on the database but they are
defined in the schema. This db upgrade adds the unique constraints.
Change-Id: I0dd1c2190bf7b68e1e0c8c71fbb123d2c82cc0d3
Closes-Bug: 1451761<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
# d... | Add unique column constraints to db
Unique constraints are not being set on the database but they are
defined in the schema. This db upgrade adds the unique constraints.
Change-Id: I0dd1c2190bf7b68e1e0c8c71fbb123d2c82cc0d3
Closes-Bug: 1451761# Licensed under the Apache License, Version 2.0 (the "License"); you may... | <commit_before><commit_msg>Add unique column constraints to db
Unique constraints are not being set on the database but they are
defined in the schema. This db upgrade adds the unique constraints.
Change-Id: I0dd1c2190bf7b68e1e0c8c71fbb123d2c82cc0d3
Closes-Bug: 1451761<commit_after># Licensed under the Apache Lice... | |
d362aad24282f158aee4c8178f2f32a757658e11 | py/delete-operation-for-two-strings.py | py/delete-operation-for-two-strings.py | class Solution(object):
def minDistance(self, word1, word2):
"""
:type word1: str
:type word2: str
:rtype: int
"""
prev = [0] * (len(word2) + 1)
for i, c1 in enumerate(word1, 1):
nxt = [0] * (len(word2) + 1)
for j, c2 in enumerate(word2... | Add py solution for 583. Delete Operation for Two Strings | Add py solution for 583. Delete Operation for Two Strings
583. Delete Operation for Two Strings: https://leetcode.com/problems/delete-operation-for-two-strings/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 583. Delete Operation for Two Strings
583. Delete Operation for Two Strings: https://leetcode.com/problems/delete-operation-for-two-strings/ | class Solution(object):
def minDistance(self, word1, word2):
"""
:type word1: str
:type word2: str
:rtype: int
"""
prev = [0] * (len(word2) + 1)
for i, c1 in enumerate(word1, 1):
nxt = [0] * (len(word2) + 1)
for j, c2 in enumerate(word2... | <commit_before><commit_msg>Add py solution for 583. Delete Operation for Two Strings
583. Delete Operation for Two Strings: https://leetcode.com/problems/delete-operation-for-two-strings/<commit_after> | class Solution(object):
def minDistance(self, word1, word2):
"""
:type word1: str
:type word2: str
:rtype: int
"""
prev = [0] * (len(word2) + 1)
for i, c1 in enumerate(word1, 1):
nxt = [0] * (len(word2) + 1)
for j, c2 in enumerate(word2... | Add py solution for 583. Delete Operation for Two Strings
583. Delete Operation for Two Strings: https://leetcode.com/problems/delete-operation-for-two-strings/class Solution(object):
def minDistance(self, word1, word2):
"""
:type word1: str
:type word2: str
:rtype: int
"""
... | <commit_before><commit_msg>Add py solution for 583. Delete Operation for Two Strings
583. Delete Operation for Two Strings: https://leetcode.com/problems/delete-operation-for-two-strings/<commit_after>class Solution(object):
def minDistance(self, word1, word2):
"""
:type word1: str
:type wo... | |
51eed338654bfa7c6ebd96cc4e1edb8759bd1bc5 | recipes/msgf_plus/msgf_plus.py | recipes/msgf_plus/msgf_plus.py | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
#
# Program Parameters
#
import os
import... | Add script to launch ms-gf | Add script to launch ms-gf
| Python | mit | shenwei356/bioconda-recipes,xguse/bioconda-recipes,bioconda/recipes,HassanAmr/bioconda-recipes,saketkc/bioconda-recipes,omicsnut/bioconda-recipes,zachcp/bioconda-recipes,Luobiny/bioconda-recipes,rob-p/bioconda-recipes,ostrokach/bioconda-recipes,rvalieris/bioconda-recipes,gregvonkuster/bioconda-recipes,peterjc/bioconda-... | Add script to launch ms-gf | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
#
# Program Parameters
#
import os
import... | <commit_before><commit_msg>Add script to launch ms-gf<commit_after> | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
#
# Program Parameters
#
import os
import... | Add script to launch ms-gf#!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
#
# Program Par... | <commit_before><commit_msg>Add script to launch ms-gf<commit_after>#!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-sto... | |
0b90b70d9a87995536d22d9f99f65d82d62e0f8e | tests/test_commands.py | tests/test_commands.py | import unittest
from unittest.mock import MagicMock
from phial.commands import help_command
class TestHelpCommand(unittest.TestCase):
def test_help_command(self):
bot = MagicMock()
command = MagicMock()
command._help = "Test description"
bot.commands = {"test_pattern": command}
... | Add test for help command | Add test for help command
| Python | mit | sedders123/phial | Add test for help command | import unittest
from unittest.mock import MagicMock
from phial.commands import help_command
class TestHelpCommand(unittest.TestCase):
def test_help_command(self):
bot = MagicMock()
command = MagicMock()
command._help = "Test description"
bot.commands = {"test_pattern": command}
... | <commit_before><commit_msg>Add test for help command<commit_after> | import unittest
from unittest.mock import MagicMock
from phial.commands import help_command
class TestHelpCommand(unittest.TestCase):
def test_help_command(self):
bot = MagicMock()
command = MagicMock()
command._help = "Test description"
bot.commands = {"test_pattern": command}
... | Add test for help commandimport unittest
from unittest.mock import MagicMock
from phial.commands import help_command
class TestHelpCommand(unittest.TestCase):
def test_help_command(self):
bot = MagicMock()
command = MagicMock()
command._help = "Test description"
bot.commands = {"te... | <commit_before><commit_msg>Add test for help command<commit_after>import unittest
from unittest.mock import MagicMock
from phial.commands import help_command
class TestHelpCommand(unittest.TestCase):
def test_help_command(self):
bot = MagicMock()
command = MagicMock()
command._help = "Test... | |
20680dbc1cd270c5d46e7ceb4eb57ee81417e519 | map_client.py | map_client.py | #!/usr/bin/env python
"""
Use with timeit module as follows::
python -m timeit -n 10 'import map_client; map_client.main()'
Adjust -n 10 for the number of times you want to run the main() method.
"""
import multiprocessing
import os
import sys
import socket
def run(port):
proc_num = os.getpid()
cs =... | Add pure python multi-process client | Add pure python multi-process client
Avoid using bash to spawn our worker processes,
since it can lose them and cleaning them up is
quite annoying.
| Python | apache-2.0 | locke105/drunken-tribble,locke105/drunken-tribble | Add pure python multi-process client
Avoid using bash to spawn our worker processes,
since it can lose them and cleaning them up is
quite annoying. | #!/usr/bin/env python
"""
Use with timeit module as follows::
python -m timeit -n 10 'import map_client; map_client.main()'
Adjust -n 10 for the number of times you want to run the main() method.
"""
import multiprocessing
import os
import sys
import socket
def run(port):
proc_num = os.getpid()
cs =... | <commit_before><commit_msg>Add pure python multi-process client
Avoid using bash to spawn our worker processes,
since it can lose them and cleaning them up is
quite annoying.<commit_after> | #!/usr/bin/env python
"""
Use with timeit module as follows::
python -m timeit -n 10 'import map_client; map_client.main()'
Adjust -n 10 for the number of times you want to run the main() method.
"""
import multiprocessing
import os
import sys
import socket
def run(port):
proc_num = os.getpid()
cs =... | Add pure python multi-process client
Avoid using bash to spawn our worker processes,
since it can lose them and cleaning them up is
quite annoying.#!/usr/bin/env python
"""
Use with timeit module as follows::
python -m timeit -n 10 'import map_client; map_client.main()'
Adjust -n 10 for the number of times you ... | <commit_before><commit_msg>Add pure python multi-process client
Avoid using bash to spawn our worker processes,
since it can lose them and cleaning them up is
quite annoying.<commit_after>#!/usr/bin/env python
"""
Use with timeit module as follows::
python -m timeit -n 10 'import map_client; map_client.main()'
... | |
fbe442ad7541a10fba461347c8dcecdc3cab8a26 | examples/image_segmentation.py | examples/image_segmentation.py | """
===========================================
Semantic Image Segmentation on Pascal VOC
===========================================
This example demonstrates learning a superpixel CRF
for semantic image segmentation.
To run the experiment, please download the pre-processed data from:
The data consists of superpixels... | Add pascal image segmentation example | Add pascal image segmentation example
| Python | bsd-2-clause | wattlebird/pystruct,massmutual/pystruct,amueller/pystruct,massmutual/pystruct,wattlebird/pystruct,d-mittal/pystruct,pystruct/pystruct,amueller/pystruct,d-mittal/pystruct,pystruct/pystruct | Add pascal image segmentation example | """
===========================================
Semantic Image Segmentation on Pascal VOC
===========================================
This example demonstrates learning a superpixel CRF
for semantic image segmentation.
To run the experiment, please download the pre-processed data from:
The data consists of superpixels... | <commit_before><commit_msg>Add pascal image segmentation example<commit_after> | """
===========================================
Semantic Image Segmentation on Pascal VOC
===========================================
This example demonstrates learning a superpixel CRF
for semantic image segmentation.
To run the experiment, please download the pre-processed data from:
The data consists of superpixels... | Add pascal image segmentation example"""
===========================================
Semantic Image Segmentation on Pascal VOC
===========================================
This example demonstrates learning a superpixel CRF
for semantic image segmentation.
To run the experiment, please download the pre-processed data fr... | <commit_before><commit_msg>Add pascal image segmentation example<commit_after>"""
===========================================
Semantic Image Segmentation on Pascal VOC
===========================================
This example demonstrates learning a superpixel CRF
for semantic image segmentation.
To run the experiment, ... | |
5016d3d088852b0396044f53493eaa14cee00d23 | tm_set.py | tm_set.py | '''
Created on Mar 1, 2015
@author: namezys
Set time machine backup disable flag
'''
import os
from argparse import ArgumentParser
from tm_police.ctrl import enable_tm
from tm_police.ctrl import disable_tm
DESCR = """Set or reset time machine disable flag"""
def main():
parser = ArgumentParser(description=DE... | Add script for disable/enable tm backup | Add script for disable/enable tm backup
| Python | bsd-2-clause | namezys/tm_police | Add script for disable/enable tm backup | '''
Created on Mar 1, 2015
@author: namezys
Set time machine backup disable flag
'''
import os
from argparse import ArgumentParser
from tm_police.ctrl import enable_tm
from tm_police.ctrl import disable_tm
DESCR = """Set or reset time machine disable flag"""
def main():
parser = ArgumentParser(description=DE... | <commit_before><commit_msg>Add script for disable/enable tm backup<commit_after> | '''
Created on Mar 1, 2015
@author: namezys
Set time machine backup disable flag
'''
import os
from argparse import ArgumentParser
from tm_police.ctrl import enable_tm
from tm_police.ctrl import disable_tm
DESCR = """Set or reset time machine disable flag"""
def main():
parser = ArgumentParser(description=DE... | Add script for disable/enable tm backup'''
Created on Mar 1, 2015
@author: namezys
Set time machine backup disable flag
'''
import os
from argparse import ArgumentParser
from tm_police.ctrl import enable_tm
from tm_police.ctrl import disable_tm
DESCR = """Set or reset time machine disable flag"""
def main():
... | <commit_before><commit_msg>Add script for disable/enable tm backup<commit_after>'''
Created on Mar 1, 2015
@author: namezys
Set time machine backup disable flag
'''
import os
from argparse import ArgumentParser
from tm_police.ctrl import enable_tm
from tm_police.ctrl import disable_tm
DESCR = """Set or reset time ... | |
716091f26af29f308c830c172398ff1c6815accf | scripts/status_consistency.py | scripts/status_consistency.py | from app import geo
from app.firebase import db
from app.constants import locationsTable, venuesTable, GPS_LOCATIONS
# The casing of tripadvisor is not consistent across our Firebase scripts
TA_PROVIDER = "tripadvisor"
TA_DETAILS = "tripAdvisor"
dryRun = True
"""
Script to fix error states in the status table (e.g.... | Add script for making status consistent. | Add script for making status consistent.
| Python | mpl-2.0 | liuche/prox-server | Add script for making status consistent. | from app import geo
from app.firebase import db
from app.constants import locationsTable, venuesTable, GPS_LOCATIONS
# The casing of tripadvisor is not consistent across our Firebase scripts
TA_PROVIDER = "tripadvisor"
TA_DETAILS = "tripAdvisor"
dryRun = True
"""
Script to fix error states in the status table (e.g.... | <commit_before><commit_msg>Add script for making status consistent.<commit_after> | from app import geo
from app.firebase import db
from app.constants import locationsTable, venuesTable, GPS_LOCATIONS
# The casing of tripadvisor is not consistent across our Firebase scripts
TA_PROVIDER = "tripadvisor"
TA_DETAILS = "tripAdvisor"
dryRun = True
"""
Script to fix error states in the status table (e.g.... | Add script for making status consistent.from app import geo
from app.firebase import db
from app.constants import locationsTable, venuesTable, GPS_LOCATIONS
# The casing of tripadvisor is not consistent across our Firebase scripts
TA_PROVIDER = "tripadvisor"
TA_DETAILS = "tripAdvisor"
dryRun = True
"""
Script to fi... | <commit_before><commit_msg>Add script for making status consistent.<commit_after>from app import geo
from app.firebase import db
from app.constants import locationsTable, venuesTable, GPS_LOCATIONS
# The casing of tripadvisor is not consistent across our Firebase scripts
TA_PROVIDER = "tripadvisor"
TA_DETAILS = "trip... | |
00b1b343fe46140b6562a3b32fa3f5c5131ea8cf | client/examples/intelligentmining.py | client/examples/intelligentmining.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from botchallenge import Robot
from botchallenge import BlockType
from botchallenge import Dir
import random
USERNAME = "rafi0t" # Put your minecraft username here
SERVER = "localhost" # Put the address of the minecraft server here
robot = Robot(USERNAME, SERVER)
ele... | Add preliminary version of the intelligent miner robot | Add preliminary version of the intelligent miner robot
| Python | mit | Rafiot/botchallenge,Rafiot/botchallenge,Rafiot/botchallenge,Rafiot/botchallenge | Add preliminary version of the intelligent miner robot | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from botchallenge import Robot
from botchallenge import BlockType
from botchallenge import Dir
import random
USERNAME = "rafi0t" # Put your minecraft username here
SERVER = "localhost" # Put the address of the minecraft server here
robot = Robot(USERNAME, SERVER)
ele... | <commit_before><commit_msg>Add preliminary version of the intelligent miner robot<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from botchallenge import Robot
from botchallenge import BlockType
from botchallenge import Dir
import random
USERNAME = "rafi0t" # Put your minecraft username here
SERVER = "localhost" # Put the address of the minecraft server here
robot = Robot(USERNAME, SERVER)
ele... | Add preliminary version of the intelligent miner robot#!/usr/bin/env python
# -*- coding: utf-8 -*-
from botchallenge import Robot
from botchallenge import BlockType
from botchallenge import Dir
import random
USERNAME = "rafi0t" # Put your minecraft username here
SERVER = "localhost" # Put the address of the mine... | <commit_before><commit_msg>Add preliminary version of the intelligent miner robot<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from botchallenge import Robot
from botchallenge import BlockType
from botchallenge import Dir
import random
USERNAME = "rafi0t" # Put your minecraft username here
SERVER = "... | |
d1f354e389f97b3a13191065b3d4f585798efaa3 | tests/cupy_tests/core_tests/test_ndarray_owndata.py | tests/cupy_tests/core_tests/test_ndarray_owndata.py | import unittest
from cupy import core
from cupy import testing
@testing.gpu
class TestArrayOwndata(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.a = core.ndarray(())
def test_original_array(self):
self.assertTrue(self.a.flags.owndata)
def test_view_arra... | Add test for OWNDATA flag | Add test for OWNDATA flag
| Python | mit | kiyukuta/chainer,ktnyt/chainer,keisuke-umezawa/chainer,hvy/chainer,wkentaro/chainer,pfnet/chainer,jnishi/chainer,cupy/cupy,jnishi/chainer,ysekky/chainer,wkentaro/chainer,hvy/chainer,chainer/chainer,wkentaro/chainer,tkerola/chainer,aonotas/chainer,ktnyt/chainer,ktnyt/chainer,jnishi/chainer,niboshi/chainer,okuta/chainer,... | Add test for OWNDATA flag | import unittest
from cupy import core
from cupy import testing
@testing.gpu
class TestArrayOwndata(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.a = core.ndarray(())
def test_original_array(self):
self.assertTrue(self.a.flags.owndata)
def test_view_arra... | <commit_before><commit_msg>Add test for OWNDATA flag<commit_after> | import unittest
from cupy import core
from cupy import testing
@testing.gpu
class TestArrayOwndata(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.a = core.ndarray(())
def test_original_array(self):
self.assertTrue(self.a.flags.owndata)
def test_view_arra... | Add test for OWNDATA flagimport unittest
from cupy import core
from cupy import testing
@testing.gpu
class TestArrayOwndata(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.a = core.ndarray(())
def test_original_array(self):
self.assertTrue(self.a.flags.owndata... | <commit_before><commit_msg>Add test for OWNDATA flag<commit_after>import unittest
from cupy import core
from cupy import testing
@testing.gpu
class TestArrayOwndata(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.a = core.ndarray(())
def test_original_array(self):
... | |
06e7dbb230790127d965b3090994211adef7ad5e | tests/unit/python/foglamp/tasks/purge/test_purge.py | tests/unit/python/foglamp/tasks/purge/test_purge.py | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import asyncio
from unittest.mock import patch, call
import pytest
from foglamp.common.storage_client.storage_client import StorageClient
from foglamp.common.statistics import Statistics
from foglamp.tasks.purge.purge import ... | Test added for unit write_statistics | Test added for unit write_statistics
| Python | apache-2.0 | foglamp/FogLAMP,foglamp/FogLAMP,foglamp/FogLAMP,foglamp/FogLAMP | Test added for unit write_statistics | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import asyncio
from unittest.mock import patch, call
import pytest
from foglamp.common.storage_client.storage_client import StorageClient
from foglamp.common.statistics import Statistics
from foglamp.tasks.purge.purge import ... | <commit_before><commit_msg>Test added for unit write_statistics<commit_after> | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import asyncio
from unittest.mock import patch, call
import pytest
from foglamp.common.storage_client.storage_client import StorageClient
from foglamp.common.statistics import Statistics
from foglamp.tasks.purge.purge import ... | Test added for unit write_statistics# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import asyncio
from unittest.mock import patch, call
import pytest
from foglamp.common.storage_client.storage_client import StorageClient
from foglamp.common.statistics import Statistics
fr... | <commit_before><commit_msg>Test added for unit write_statistics<commit_after># -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import asyncio
from unittest.mock import patch, call
import pytest
from foglamp.common.storage_client.storage_client import StorageClient
from fogla... | |
a645f5c2991bcdf3ff8581a9fa3afe456004320f | casepro/cases/migrations/0043_case_user_assignee.py | casepro/cases/migrations/0043_case_user_assignee.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('cases', ... | Add migration for user_assignee Case field | Add migration for user_assignee Case field
| Python | bsd-3-clause | praekelt/casepro,praekelt/casepro,rapidpro/casepro,xkmato/casepro,praekelt/casepro,rapidpro/casepro,xkmato/casepro,rapidpro/casepro | Add migration for user_assignee Case field | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('cases', ... | <commit_before><commit_msg>Add migration for user_assignee Case field<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('cases', ... | Add migration for user_assignee Case field# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(set... | <commit_before><commit_msg>Add migration for user_assignee Case field<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
... | |
81ed84afcc4a2cb38abaf48ca06c58b3352a6008 | scheduler/migrations/0039_delete_workdone.py | scheduler/migrations/0039_delete_workdone.py | # Generated by Django 2.2.3 on 2022-03-12 09:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scheduler', '0038_protect_deletion'),
]
operations = [
migrations.DeleteModel(
name='WorkDone',
),
]
| Add missing migration for model WorkDone | Add missing migration for model WorkDone
| Python | agpl-3.0 | coders4help/volunteer_planner,pitpalme/volunteer_planner,pitpalme/volunteer_planner,volunteer-planner/volunteer_planner,volunteer-planner/volunteer_planner,christophmeissner/volunteer_planner,coders4help/volunteer_planner,coders4help/volunteer_planner,christophmeissner/volunteer_planner,coders4help/volunteer_planner,vo... | Add missing migration for model WorkDone | # Generated by Django 2.2.3 on 2022-03-12 09:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scheduler', '0038_protect_deletion'),
]
operations = [
migrations.DeleteModel(
name='WorkDone',
),
]
| <commit_before><commit_msg>Add missing migration for model WorkDone<commit_after> | # Generated by Django 2.2.3 on 2022-03-12 09:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scheduler', '0038_protect_deletion'),
]
operations = [
migrations.DeleteModel(
name='WorkDone',
),
]
| Add missing migration for model WorkDone# Generated by Django 2.2.3 on 2022-03-12 09:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scheduler', '0038_protect_deletion'),
]
operations = [
migrations.DeleteModel(
name='WorkDone',
... | <commit_before><commit_msg>Add missing migration for model WorkDone<commit_after># Generated by Django 2.2.3 on 2022-03-12 09:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scheduler', '0038_protect_deletion'),
]
operations = [
migrations.D... | |
95bf6837719533b5621faf57753bf99778995e5f | contrib/conflict_resolution/resolve_interactively.py | contrib/conflict_resolution/resolve_interactively.py | #!/usr/bin/env python3
"""Ask user to resolve a vdirsyncer sync conflict interactively.
Needs a way to ask the user.
The use of https://apps.kde.org/kdialog/ for GNU/Linix is hardcoded.
Depends on python>3.5 and KDialog.
Usage:
Ensure the file executable and use it in the vdirsyncer.conf file, e.g.
conflict_res... | Add contrib script to resolve conflicts | Add contrib script to resolve conflicts
Asks the user when two iCalender objects conflict during a sync,
which one to take.
| Python | mit | untitaker/vdirsyncer,untitaker/vdirsyncer,untitaker/vdirsyncer | Add contrib script to resolve conflicts
Asks the user when two iCalender objects conflict during a sync,
which one to take. | #!/usr/bin/env python3
"""Ask user to resolve a vdirsyncer sync conflict interactively.
Needs a way to ask the user.
The use of https://apps.kde.org/kdialog/ for GNU/Linix is hardcoded.
Depends on python>3.5 and KDialog.
Usage:
Ensure the file executable and use it in the vdirsyncer.conf file, e.g.
conflict_res... | <commit_before><commit_msg>Add contrib script to resolve conflicts
Asks the user when two iCalender objects conflict during a sync,
which one to take.<commit_after> | #!/usr/bin/env python3
"""Ask user to resolve a vdirsyncer sync conflict interactively.
Needs a way to ask the user.
The use of https://apps.kde.org/kdialog/ for GNU/Linix is hardcoded.
Depends on python>3.5 and KDialog.
Usage:
Ensure the file executable and use it in the vdirsyncer.conf file, e.g.
conflict_res... | Add contrib script to resolve conflicts
Asks the user when two iCalender objects conflict during a sync,
which one to take.#!/usr/bin/env python3
"""Ask user to resolve a vdirsyncer sync conflict interactively.
Needs a way to ask the user.
The use of https://apps.kde.org/kdialog/ for GNU/Linix is hardcoded.
Depends ... | <commit_before><commit_msg>Add contrib script to resolve conflicts
Asks the user when two iCalender objects conflict during a sync,
which one to take.<commit_after>#!/usr/bin/env python3
"""Ask user to resolve a vdirsyncer sync conflict interactively.
Needs a way to ask the user.
The use of https://apps.kde.org/kdial... | |
6b5774d671e311e7d3b107248937285ace0c4eb4 | Luna/Model.py | Luna/Model.py | #!/usr/bin/env python
#This is free and unencumbered software released into the public domain.
#
#Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
#software, either in source code form or as a compiled binary, for any purpose,
#commercial or non-commercial, and by any means.
#
#In jurisd... | Add model with observer pattern | Add model with observer pattern
Intended for classes that contain model data, this new module will
define some structural things to implement a model-view-presenter
pattern.
| Python | cc0-1.0 | Ghostkeeper/Luna | Add model with observer pattern
Intended for classes that contain model data, this new module will
define some structural things to implement a model-view-presenter
pattern. | #!/usr/bin/env python
#This is free and unencumbered software released into the public domain.
#
#Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
#software, either in source code form or as a compiled binary, for any purpose,
#commercial or non-commercial, and by any means.
#
#In jurisd... | <commit_before><commit_msg>Add model with observer pattern
Intended for classes that contain model data, this new module will
define some structural things to implement a model-view-presenter
pattern.<commit_after> | #!/usr/bin/env python
#This is free and unencumbered software released into the public domain.
#
#Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
#software, either in source code form or as a compiled binary, for any purpose,
#commercial or non-commercial, and by any means.
#
#In jurisd... | Add model with observer pattern
Intended for classes that contain model data, this new module will
define some structural things to implement a model-view-presenter
pattern.#!/usr/bin/env python
#This is free and unencumbered software released into the public domain.
#
#Anyone is free to copy, modify, publish, use, c... | <commit_before><commit_msg>Add model with observer pattern
Intended for classes that contain model data, this new module will
define some structural things to implement a model-view-presenter
pattern.<commit_after>#!/usr/bin/env python
#This is free and unencumbered software released into the public domain.
#
#Anyone... | |
897ef3903de2b7b67780409c3280700aabe14c0f | search/binary_search/python/recursive_binary_search.py | search/binary_search/python/recursive_binary_search.py | # recursive binary search
# return, if present, the position of the searched element
# returns -1 if the element is not present
def recursive_binary_search(n, e, i, j):
if i > j:
return -1
half = (i+j)/2
if e == n[half]:
return half
elif e < n[half]:
return binary_search(n, e, ... | Add recursive binary search in python | Add recursive binary search in python
| Python | cc0-1.0 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | Add recursive binary search in python | # recursive binary search
# return, if present, the position of the searched element
# returns -1 if the element is not present
def recursive_binary_search(n, e, i, j):
if i > j:
return -1
half = (i+j)/2
if e == n[half]:
return half
elif e < n[half]:
return binary_search(n, e, ... | <commit_before><commit_msg>Add recursive binary search in python<commit_after> | # recursive binary search
# return, if present, the position of the searched element
# returns -1 if the element is not present
def recursive_binary_search(n, e, i, j):
if i > j:
return -1
half = (i+j)/2
if e == n[half]:
return half
elif e < n[half]:
return binary_search(n, e, ... | Add recursive binary search in python# recursive binary search
# return, if present, the position of the searched element
# returns -1 if the element is not present
def recursive_binary_search(n, e, i, j):
if i > j:
return -1
half = (i+j)/2
if e == n[half]:
return half
elif e < n[half... | <commit_before><commit_msg>Add recursive binary search in python<commit_after># recursive binary search
# return, if present, the position of the searched element
# returns -1 if the element is not present
def recursive_binary_search(n, e, i, j):
if i > j:
return -1
half = (i+j)/2
if e == n[half]... | |
67e62a9ee88ff432f641e5c6ea9bc2244264f7ad | seahub/api2/authentication.py | seahub/api2/authentication.py | from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
HTTP header, pr... | from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
HTTP header, pr... | Fix for if token is valid format, but user with that token does not exist | Fix for if token is valid format, but user with that token does not exist
| Python | apache-2.0 | Chilledheart/seahub,madflow/seahub,madflow/seahub,madflow/seahub,madflow/seahub,madflow/seahub,Chilledheart/seahub,miurahr/seahub,cloudcopy/seahub,Chilledheart/seahub,miurahr/seahub,cloudcopy/seahub,Chilledheart/seahub,cloudcopy/seahub,miurahr/seahub,cloudcopy/seahub,Chilledheart/seahub,miurahr/seahub | from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
HTTP header, pr... | from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
HTTP header, pr... | <commit_before>from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
... | from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
HTTP header, pr... | from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
HTTP header, pr... | <commit_before>from rest_framework.authentication import BaseAuthentication
from models import Token
from seahub.base.accounts import User
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
... |
49416a5bc0ddbf166f3a835ac1f612390d19971b | scripts/unittest/script/22-frozen_modules.py | scripts/unittest/script/22-frozen_modules.py | def unittest(data_path, temp_path):
import ulinalg
from vec import distance
m = ulinalg.ones(1, 10)
d = distance.euclidean((0, 0, 0), (0, 1, 0))
return (abs(1.0-d) < 0.01) and (abs(10.0 - sum(m)) < 0.01)
| Add unit-test to test frozen modules. | Add unit-test to test frozen modules.
| Python | mit | openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv | Add unit-test to test frozen modules. | def unittest(data_path, temp_path):
import ulinalg
from vec import distance
m = ulinalg.ones(1, 10)
d = distance.euclidean((0, 0, 0), (0, 1, 0))
return (abs(1.0-d) < 0.01) and (abs(10.0 - sum(m)) < 0.01)
| <commit_before><commit_msg>Add unit-test to test frozen modules.<commit_after> | def unittest(data_path, temp_path):
import ulinalg
from vec import distance
m = ulinalg.ones(1, 10)
d = distance.euclidean((0, 0, 0), (0, 1, 0))
return (abs(1.0-d) < 0.01) and (abs(10.0 - sum(m)) < 0.01)
| Add unit-test to test frozen modules.def unittest(data_path, temp_path):
import ulinalg
from vec import distance
m = ulinalg.ones(1, 10)
d = distance.euclidean((0, 0, 0), (0, 1, 0))
return (abs(1.0-d) < 0.01) and (abs(10.0 - sum(m)) < 0.01)
| <commit_before><commit_msg>Add unit-test to test frozen modules.<commit_after>def unittest(data_path, temp_path):
import ulinalg
from vec import distance
m = ulinalg.ones(1, 10)
d = distance.euclidean((0, 0, 0), (0, 1, 0))
return (abs(1.0-d) < 0.01) and (abs(10.0 - sum(m)) < 0.01)
| |
93751683a1ac19667f2a221ead5142f9bc0a8d32 | sara_flexbe_states/src/sara_flexbe_states/WonderlandGetPersonByRecognitionId.py | sara_flexbe_states/src/sara_flexbe_states/WonderlandGetPersonByRecognitionId.py | #!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
from sara_msgs.msg import Entity
"""
Created on 15/05/2018
@author: Lucas Maurice
"""
class WonderlandGetPersonByRecognitionId(EventState):
'''
Find a person by ID.
>#... | Create a state for get a person by face recognition ID | Create a state for get a person by face recognition ID
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | Create a state for get a person by face recognition ID | #!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
from sara_msgs.msg import Entity
"""
Created on 15/05/2018
@author: Lucas Maurice
"""
class WonderlandGetPersonByRecognitionId(EventState):
'''
Find a person by ID.
>#... | <commit_before><commit_msg>Create a state for get a person by face recognition ID<commit_after> | #!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
from sara_msgs.msg import Entity
"""
Created on 15/05/2018
@author: Lucas Maurice
"""
class WonderlandGetPersonByRecognitionId(EventState):
'''
Find a person by ID.
>#... | Create a state for get a person by face recognition ID#!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
from sara_msgs.msg import Entity
"""
Created on 15/05/2018
@author: Lucas Maurice
"""
class WonderlandGetPersonByRecognitionI... | <commit_before><commit_msg>Create a state for get a person by face recognition ID<commit_after>#!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState
from rospy import logerr, loginfo
from sara_msgs.msg import Entity
"""
Created on 15/05/2018
@author: Lucas Maurice
"""
... | |
6ff8e6a1662497943584c84462ceda78420d6581 | inonemonth/challenges/tests/test_github_utils.py | inonemonth/challenges/tests/test_github_utils.py | import unittest
import django.test
class GithubUtilsTestCase(django.test.TestCase):
def test_get_api_repo_branch_url(self):
self.assertEqual("", "https://api.github.com/repos/RobrechtDR/asiakas/branches/master")
def test_get_repo_and_branch_from_repo_path(self):
self.assertEqual("", ("asiakas... | Write tests for github utils | Write tests for github utils
| Python | mit | robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth | Write tests for github utils | import unittest
import django.test
class GithubUtilsTestCase(django.test.TestCase):
def test_get_api_repo_branch_url(self):
self.assertEqual("", "https://api.github.com/repos/RobrechtDR/asiakas/branches/master")
def test_get_repo_and_branch_from_repo_path(self):
self.assertEqual("", ("asiakas... | <commit_before><commit_msg>Write tests for github utils<commit_after> | import unittest
import django.test
class GithubUtilsTestCase(django.test.TestCase):
def test_get_api_repo_branch_url(self):
self.assertEqual("", "https://api.github.com/repos/RobrechtDR/asiakas/branches/master")
def test_get_repo_and_branch_from_repo_path(self):
self.assertEqual("", ("asiakas... | Write tests for github utilsimport unittest
import django.test
class GithubUtilsTestCase(django.test.TestCase):
def test_get_api_repo_branch_url(self):
self.assertEqual("", "https://api.github.com/repos/RobrechtDR/asiakas/branches/master")
def test_get_repo_and_branch_from_repo_path(self):
se... | <commit_before><commit_msg>Write tests for github utils<commit_after>import unittest
import django.test
class GithubUtilsTestCase(django.test.TestCase):
def test_get_api_repo_branch_url(self):
self.assertEqual("", "https://api.github.com/repos/RobrechtDR/asiakas/branches/master")
def test_get_repo_an... | |
d6d2b064df47c6f61755caaaa446f150a5342060 | bag_graph.py | bag_graph.py | import bag_engine
'''Generate .dot graph file. Format
digraph G {
1 [label = "room name #1"];
2 [label = "room name #2"];
1 -> 2 [label = "door going from room 1 to room 2"];
}
'''
def create_graph(graph):
room_num = 1
room_name_to_number = {}
for room in graph.keys():
room_name_to_number[... | Add code to generate .dot file from room data | Add code to generate .dot file from room data
| Python | apache-2.0 | kkrugler/bitney-adventure,kkrugler/bitney-adventure | Add code to generate .dot file from room data | import bag_engine
'''Generate .dot graph file. Format
digraph G {
1 [label = "room name #1"];
2 [label = "room name #2"];
1 -> 2 [label = "door going from room 1 to room 2"];
}
'''
def create_graph(graph):
room_num = 1
room_name_to_number = {}
for room in graph.keys():
room_name_to_number[... | <commit_before><commit_msg>Add code to generate .dot file from room data<commit_after> | import bag_engine
'''Generate .dot graph file. Format
digraph G {
1 [label = "room name #1"];
2 [label = "room name #2"];
1 -> 2 [label = "door going from room 1 to room 2"];
}
'''
def create_graph(graph):
room_num = 1
room_name_to_number = {}
for room in graph.keys():
room_name_to_number[... | Add code to generate .dot file from room dataimport bag_engine
'''Generate .dot graph file. Format
digraph G {
1 [label = "room name #1"];
2 [label = "room name #2"];
1 -> 2 [label = "door going from room 1 to room 2"];
}
'''
def create_graph(graph):
room_num = 1
room_name_to_number = {}
for room ... | <commit_before><commit_msg>Add code to generate .dot file from room data<commit_after>import bag_engine
'''Generate .dot graph file. Format
digraph G {
1 [label = "room name #1"];
2 [label = "room name #2"];
1 -> 2 [label = "door going from room 1 to room 2"];
}
'''
def create_graph(graph):
room_num = 1
... | |
5d0bed8673306456e517ce042d07bfe627a25758 | analytics/management/commands/clear_analytics_tables.py | analytics/management/commands/clear_analytics_tables.py | from __future__ import absolute_import
from __future__ import print_function
import sys
from argparse import ArgumentParser
from django.db import connection
from django.core.management.base import BaseCommand
from typing import Any
CLEAR_QUERY = """
DELETE FROM ONLY analytics_installationcount;
DELETE FROM ONLY ana... | Add script to clear analytics tables. | Add script to clear analytics tables.
| Python | apache-2.0 | calvinleenyc/zulip,synicalsyntax/zulip,andersk/zulip,Diptanshu8/zulip,arpith/zulip,Juanvulcano/zulip,christi3k/zulip,dhcrzf/zulip,amyliu345/zulip,jainayush975/zulip,krtkmj/zulip,brainwane/zulip,verma-varsha/zulip,samatdav/zulip,hackerkid/zulip,rht/zulip,mohsenSy/zulip,jainayush975/zulip,sharmaeklavya2/zulip,cosmicAsymm... | Add script to clear analytics tables. | from __future__ import absolute_import
from __future__ import print_function
import sys
from argparse import ArgumentParser
from django.db import connection
from django.core.management.base import BaseCommand
from typing import Any
CLEAR_QUERY = """
DELETE FROM ONLY analytics_installationcount;
DELETE FROM ONLY ana... | <commit_before><commit_msg>Add script to clear analytics tables.<commit_after> | from __future__ import absolute_import
from __future__ import print_function
import sys
from argparse import ArgumentParser
from django.db import connection
from django.core.management.base import BaseCommand
from typing import Any
CLEAR_QUERY = """
DELETE FROM ONLY analytics_installationcount;
DELETE FROM ONLY ana... | Add script to clear analytics tables.from __future__ import absolute_import
from __future__ import print_function
import sys
from argparse import ArgumentParser
from django.db import connection
from django.core.management.base import BaseCommand
from typing import Any
CLEAR_QUERY = """
DELETE FROM ONLY analytics_in... | <commit_before><commit_msg>Add script to clear analytics tables.<commit_after>from __future__ import absolute_import
from __future__ import print_function
import sys
from argparse import ArgumentParser
from django.db import connection
from django.core.management.base import BaseCommand
from typing import Any
CLEAR_... | |
2ec55af2c3d97140fe0db64a237c6d927beccaa9 | statsmodels/tsa/statespace/tests/test_prediction.py | statsmodels/tsa/statespace/tests/test_prediction.py | """
Tests for prediction of state space models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import #, print_function
import numpy as np
import pandas as pd
import warnings
from statsmodels.tsa.statespace import sarimax
from numpy.testing import assert_equal, assert_allcl... | Add (failing) test for predict dates. | TST: Add (failing) test for predict dates. | Python | bsd-3-clause | bashtage/statsmodels,josef-pkt/statsmodels,josef-pkt/statsmodels,ChadFulton/statsmodels,phobson/statsmodels,yl565/statsmodels,yl565/statsmodels,bashtage/statsmodels,bashtage/statsmodels,ChadFulton/statsmodels,yl565/statsmodels,ChadFulton/statsmodels,phobson/statsmodels,phobson/statsmodels,statsmodels/statsmodels,josef-... | TST: Add (failing) test for predict dates. | """
Tests for prediction of state space models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import #, print_function
import numpy as np
import pandas as pd
import warnings
from statsmodels.tsa.statespace import sarimax
from numpy.testing import assert_equal, assert_allcl... | <commit_before><commit_msg>TST: Add (failing) test for predict dates.<commit_after> | """
Tests for prediction of state space models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import #, print_function
import numpy as np
import pandas as pd
import warnings
from statsmodels.tsa.statespace import sarimax
from numpy.testing import assert_equal, assert_allcl... | TST: Add (failing) test for predict dates."""
Tests for prediction of state space models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import #, print_function
import numpy as np
import pandas as pd
import warnings
from statsmodels.tsa.statespace import sarimax
from numpy... | <commit_before><commit_msg>TST: Add (failing) test for predict dates.<commit_after>"""
Tests for prediction of state space models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import #, print_function
import numpy as np
import pandas as pd
import warnings
from statsmodels... | |
4059a0073ef676fba4df47f69b469baf4cef15b1 | tests/services/authorization/test_role_to_user_assignment.py | tests/services/authorization/test_role_to_user_assignment.py | """
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.authorization import service
from testfixtures.user import create_user
from tests.base import AbstractAppTestCase
class RoleToUserAssignmentTestCase(AbstractAppTestCase):
def setUp(self):
... | Test (de)assignment of roles to users | Test (de)assignment of roles to users
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | Test (de)assignment of roles to users | """
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.authorization import service
from testfixtures.user import create_user
from tests.base import AbstractAppTestCase
class RoleToUserAssignmentTestCase(AbstractAppTestCase):
def setUp(self):
... | <commit_before><commit_msg>Test (de)assignment of roles to users<commit_after> | """
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.authorization import service
from testfixtures.user import create_user
from tests.base import AbstractAppTestCase
class RoleToUserAssignmentTestCase(AbstractAppTestCase):
def setUp(self):
... | Test (de)assignment of roles to users"""
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.authorization import service
from testfixtures.user import create_user
from tests.base import AbstractAppTestCase
class RoleToUserAssignmentTestCase(Abstract... | <commit_before><commit_msg>Test (de)assignment of roles to users<commit_after>"""
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.authorization import service
from testfixtures.user import create_user
from tests.base import AbstractAppTestCase
cl... | |
430ac9869481fa4be378a13caeb6ca642c5f22f7 | src/utilities.py | src/utilities.py | from __future__ import division
import numpy as np
class DiffKernel(object):
"""
A fake kernel that can be used to predict differences two function values.
Given a gp based on measurements, we aim to predict the difference between
the function values at two different test points, X1 and X2; that is,... | Add fake kernel to predict function differences using GPy | Add fake kernel to predict function differences using GPy
| Python | mit | befelix/SafeMDP,befelix/SafeMDP | Add fake kernel to predict function differences using GPy | from __future__ import division
import numpy as np
class DiffKernel(object):
"""
A fake kernel that can be used to predict differences two function values.
Given a gp based on measurements, we aim to predict the difference between
the function values at two different test points, X1 and X2; that is,... | <commit_before><commit_msg>Add fake kernel to predict function differences using GPy<commit_after> | from __future__ import division
import numpy as np
class DiffKernel(object):
"""
A fake kernel that can be used to predict differences two function values.
Given a gp based on measurements, we aim to predict the difference between
the function values at two different test points, X1 and X2; that is,... | Add fake kernel to predict function differences using GPyfrom __future__ import division
import numpy as np
class DiffKernel(object):
"""
A fake kernel that can be used to predict differences two function values.
Given a gp based on measurements, we aim to predict the difference between
the function... | <commit_before><commit_msg>Add fake kernel to predict function differences using GPy<commit_after>from __future__ import division
import numpy as np
class DiffKernel(object):
"""
A fake kernel that can be used to predict differences two function values.
Given a gp based on measurements, we aim to predic... | |
d82546916e00410565cd919d173ef7359e08ef71 | test/test_cfg.py | test/test_cfg.py | import locale
import unittest
from datetime import datetime
from cfg import parse_cfg_date, _fix_locale, pretty_date
class TestDateHandling(unittest.TestCase):
def test_date_parsing(self):
test_date = "2015-01-02 18:06"
parsed = parse_cfg_date(test_date)
self.assertEquals(parsed, datetime(... | Add unittests for date stuff. | Add unittests for date stuff.
| Python | bsd-3-clause | janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system | Add unittests for date stuff. | import locale
import unittest
from datetime import datetime
from cfg import parse_cfg_date, _fix_locale, pretty_date
class TestDateHandling(unittest.TestCase):
def test_date_parsing(self):
test_date = "2015-01-02 18:06"
parsed = parse_cfg_date(test_date)
self.assertEquals(parsed, datetime(... | <commit_before><commit_msg>Add unittests for date stuff.<commit_after> | import locale
import unittest
from datetime import datetime
from cfg import parse_cfg_date, _fix_locale, pretty_date
class TestDateHandling(unittest.TestCase):
def test_date_parsing(self):
test_date = "2015-01-02 18:06"
parsed = parse_cfg_date(test_date)
self.assertEquals(parsed, datetime(... | Add unittests for date stuff.import locale
import unittest
from datetime import datetime
from cfg import parse_cfg_date, _fix_locale, pretty_date
class TestDateHandling(unittest.TestCase):
def test_date_parsing(self):
test_date = "2015-01-02 18:06"
parsed = parse_cfg_date(test_date)
self.a... | <commit_before><commit_msg>Add unittests for date stuff.<commit_after>import locale
import unittest
from datetime import datetime
from cfg import parse_cfg_date, _fix_locale, pretty_date
class TestDateHandling(unittest.TestCase):
def test_date_parsing(self):
test_date = "2015-01-02 18:06"
parsed =... | |
064578b33fd4a58ce427dd4547deb3859ab56ebb | corehq/blobs/migrations/0007_blobmeta_migrated_check.py | corehq/blobs/migrations/0007_blobmeta_migrated_check.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-05 00:21
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import sys
import traceback
from django.core.management import call_command
from django.db import connections, migrations
from... | Add blob metadata migration check | Add blob metadata migration check | Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add blob metadata migration check | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-05 00:21
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import sys
import traceback
from django.core.management import call_command
from django.db import connections, migrations
from... | <commit_before><commit_msg>Add blob metadata migration check<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-05 00:21
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import sys
import traceback
from django.core.management import call_command
from django.db import connections, migrations
from... | Add blob metadata migration check# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-05 00:21
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import sys
import traceback
from django.core.management import call_command
from django.db imp... | <commit_before><commit_msg>Add blob metadata migration check<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-05 00:21
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import sys
import traceback
from django.core.manageme... | |
7397c321644c6f14dbb69c2d082d19fc977625e8 | waffle/migrations/0002_auto_20161201_0958.py | waffle/migrations/0002_auto_20161201_0958.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-01 09:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waffle', '0001_initial'),
]
operations = [
migrations.AlterField(
... | Add missing migration for switch model | Add missing migration for switch model
| Python | bsd-3-clause | rsalmaso/django-waffle,rodgomes/django-waffle,willkg/django-waffle,rsalmaso/django-waffle,rodgomes/django-waffle,willkg/django-waffle,rodgomes/django-waffle,rsalmaso/django-waffle,rsalmaso/django-waffle,rodgomes/django-waffle | Add missing migration for switch model | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-01 09:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waffle', '0001_initial'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add missing migration for switch model<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-01 09:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waffle', '0001_initial'),
]
operations = [
migrations.AlterField(
... | Add missing migration for switch model# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-01 09:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waffle', '0001_initial'),
]
operations = [
... | <commit_before><commit_msg>Add missing migration for switch model<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-01 09:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waffle', '000... | |
f5ab12540c21fdfe5497b16d3f05c57fb021fbc9 | misc/bad_points.py | misc/bad_points.py | from laspy.file import File
import numpy as np
import argparse
parser = argparse.ArgumentParser(description="""Accept the path to a .LAS file,
and print a list of point records
with invalid (X,Y,Z) information.""")
parse... | Add script to find bad point indices. | Add script to find bad point indices.
| Python | bsd-2-clause | silyko/laspy,blazbratanic/laspy,blazbratanic/laspy,silyko/laspy | Add script to find bad point indices. | from laspy.file import File
import numpy as np
import argparse
parser = argparse.ArgumentParser(description="""Accept the path to a .LAS file,
and print a list of point records
with invalid (X,Y,Z) information.""")
parse... | <commit_before><commit_msg>Add script to find bad point indices.<commit_after> | from laspy.file import File
import numpy as np
import argparse
parser = argparse.ArgumentParser(description="""Accept the path to a .LAS file,
and print a list of point records
with invalid (X,Y,Z) information.""")
parse... | Add script to find bad point indices.from laspy.file import File
import numpy as np
import argparse
parser = argparse.ArgumentParser(description="""Accept the path to a .LAS file,
and print a list of point records
with in... | <commit_before><commit_msg>Add script to find bad point indices.<commit_after>from laspy.file import File
import numpy as np
import argparse
parser = argparse.ArgumentParser(description="""Accept the path to a .LAS file,
and print a list of point records
... | |
ef8f941b2b2dc082c7c47a9e304ff0d44173629a | src/sentry/api/decorators.py | src/sentry/api/decorators.py | from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey)
def sudo_required(func):
@wraps(func)
def wrappe... | from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey, ApiToken
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey) or \
isinstance(request.auth, ApiToken)
... | Add sudo support for auth tokens | Add sudo support for auth tokens
This fixes #3525
| Python | bsd-3-clause | fotinakis/sentry,zenefits/sentry,ifduyue/sentry,JamesMura/sentry,beeftornado/sentry,jean/sentry,BuildingLink/sentry,zenefits/sentry,ifduyue/sentry,JackDanger/sentry,mvaled/sentry,BuildingLink/sentry,fotinakis/sentry,JackDanger/sentry,looker/sentry,alexm92/sentry,mitsuhiko/sentry,looker/sentry,gencer/sentry,beeftornado/... | from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey)
def sudo_required(func):
@wraps(func)
def wrappe... | from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey, ApiToken
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey) or \
isinstance(request.auth, ApiToken)
... | <commit_before>from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey)
def sudo_required(func):
@wraps(func)... | from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey, ApiToken
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey) or \
isinstance(request.auth, ApiToken)
... | from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey)
def sudo_required(func):
@wraps(func)
def wrappe... | <commit_before>from __future__ import absolute_import
import json
from django.http import HttpResponse
from functools import wraps
from sentry.models import ApiKey
def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey)
def sudo_required(func):
@wraps(func)... |
49db72b01d1782a58497fbef53ca018ebeb76170 | kaggle/titanic/categorical_and_scaler_prediction.py | kaggle/titanic/categorical_and_scaler_prediction.py | import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
| Read in train data to dataframe | Read in train data to dataframe
| Python | mit | noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit | Read in train data to dataframe | import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Read in train data to dataframe<commit_after> | import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
| Read in train data to dataframeimport pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Read in train data to dataframe<commit_after>import pandas
def main():
train_all = pandas.DataFrame.from_csv('train.csv')
train = train_all[['Survived', 'Sex', 'Fare']]
print(train)
if __name__ == '__main__':
main()
| |
cb347b9fdb7b71bd2cc100547bd171336f7ac272 | delete-sessions.py | delete-sessions.py | """Deletes old sessions to clear up space."""
import datetime
import os
import sys
import time
def get_files(path):
"""Returns the absolute paths of all files under a path."""
for walk_information in os.walk("data/sessions/data/container_file/"):
directory_name, _, file_names = walk_information
... | Add script to delete old sessions | Add script to delete old sessions
| Python | mit | bskari/park-stamper,bskari/park-stamper,bskari/park-stamper | Add script to delete old sessions | """Deletes old sessions to clear up space."""
import datetime
import os
import sys
import time
def get_files(path):
"""Returns the absolute paths of all files under a path."""
for walk_information in os.walk("data/sessions/data/container_file/"):
directory_name, _, file_names = walk_information
... | <commit_before><commit_msg>Add script to delete old sessions<commit_after> | """Deletes old sessions to clear up space."""
import datetime
import os
import sys
import time
def get_files(path):
"""Returns the absolute paths of all files under a path."""
for walk_information in os.walk("data/sessions/data/container_file/"):
directory_name, _, file_names = walk_information
... | Add script to delete old sessions"""Deletes old sessions to clear up space."""
import datetime
import os
import sys
import time
def get_files(path):
"""Returns the absolute paths of all files under a path."""
for walk_information in os.walk("data/sessions/data/container_file/"):
directory_name, _, fi... | <commit_before><commit_msg>Add script to delete old sessions<commit_after>"""Deletes old sessions to clear up space."""
import datetime
import os
import sys
import time
def get_files(path):
"""Returns the absolute paths of all files under a path."""
for walk_information in os.walk("data/sessions/data/contain... | |
f89aa0cb546311200514c20f41a60954522d0711 | mzalendo/kenya/management/commands/kenya_adwords_csv.py | mzalendo/kenya/management/commands/kenya_adwords_csv.py | import csv
import os
import sys
from optparse import make_option
from core.models import Position
from django.core.management.base import NoArgsCommand
data_directory = os.path.join(sys.path[0], 'kenya', '2013-election-data')
class Command(NoArgsCommand):
help = 'Generate a CSV file with all candiates for gener... | Add a command to generate a CSV file candidates for Google AdWords | Add a command to generate a CSV file candidates for Google AdWords
This is for issue #585 - as I understand it, this wouldn't
be used directly but is helpful for creating AdWords en masse.
| Python | agpl-3.0 | geoffkilpin/pombola,ken-muturi/pombola,hzj123/56th,ken-muturi/pombola,hzj123/56th,patricmutwiri/pombola,geoffkilpin/pombola,mysociety/pombola,hzj123/56th,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,ken-muturi/pombola,hzj123/56th,patricmutwiri/pombola,mysociety/pombola... | Add a command to generate a CSV file candidates for Google AdWords
This is for issue #585 - as I understand it, this wouldn't
be used directly but is helpful for creating AdWords en masse. | import csv
import os
import sys
from optparse import make_option
from core.models import Position
from django.core.management.base import NoArgsCommand
data_directory = os.path.join(sys.path[0], 'kenya', '2013-election-data')
class Command(NoArgsCommand):
help = 'Generate a CSV file with all candiates for gener... | <commit_before><commit_msg>Add a command to generate a CSV file candidates for Google AdWords
This is for issue #585 - as I understand it, this wouldn't
be used directly but is helpful for creating AdWords en masse.<commit_after> | import csv
import os
import sys
from optparse import make_option
from core.models import Position
from django.core.management.base import NoArgsCommand
data_directory = os.path.join(sys.path[0], 'kenya', '2013-election-data')
class Command(NoArgsCommand):
help = 'Generate a CSV file with all candiates for gener... | Add a command to generate a CSV file candidates for Google AdWords
This is for issue #585 - as I understand it, this wouldn't
be used directly but is helpful for creating AdWords en masse.import csv
import os
import sys
from optparse import make_option
from core.models import Position
from django.core.management.base... | <commit_before><commit_msg>Add a command to generate a CSV file candidates for Google AdWords
This is for issue #585 - as I understand it, this wouldn't
be used directly but is helpful for creating AdWords en masse.<commit_after>import csv
import os
import sys
from optparse import make_option
from core.models import ... | |
0fd68b4ac82bf867365c9cc5e0a129dbb51d8247 | teamstats/migrations/0002_auto_20180828_1937.py | teamstats/migrations/0002_auto_20180828_1937.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-28 16:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teamstats', '0001_initial'),
]
operations = [
migrations.AlterField(
... | Add migrations for media files | Add migrations for media files
| Python | agpl-3.0 | jluttine/django-sportsteam,jluttine/django-sportsteam,jluttine/django-sportsteam,jluttine/django-sportsteam | Add migrations for media files | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-28 16:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teamstats', '0001_initial'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add migrations for media files<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-28 16:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teamstats', '0001_initial'),
]
operations = [
migrations.AlterField(
... | Add migrations for media files# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-28 16:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teamstats', '0001_initial'),
]
operations = [
... | <commit_before><commit_msg>Add migrations for media files<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-28 16:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teamstats', '0001_in... | |
ad1dd9066f04f0dda10a1c991480ba506d53676a | benchmarks/benchmarks/bench_array_coercion.py | benchmarks/benchmarks/bench_array_coercion.py | from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class ArrayCoercionSmall(Benchmark):
# More detailed benchmarks for array coercion,
# some basic benchmarks are in `bench_core.py`.
params = [[range(3), [1], 1, np.array([5], dtype=np.int64)... | Add benchmark for small array coercions | BENCH: Add benchmark for small array coercions
Note that since the benchmarks are so fast, the actual results
are diluted behind one more python function call.
| Python | bsd-3-clause | seberg/numpy,anntzer/numpy,endolith/numpy,abalkin/numpy,grlee77/numpy,mattip/numpy,simongibbons/numpy,pbrod/numpy,endolith/numpy,numpy/numpy,mattip/numpy,madphysicist/numpy,jakirkham/numpy,rgommers/numpy,grlee77/numpy,pdebuyl/numpy,anntzer/numpy,rgommers/numpy,jakirkham/numpy,charris/numpy,simongibbons/numpy,grlee77/nu... | BENCH: Add benchmark for small array coercions
Note that since the benchmarks are so fast, the actual results
are diluted behind one more python function call. | from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class ArrayCoercionSmall(Benchmark):
# More detailed benchmarks for array coercion,
# some basic benchmarks are in `bench_core.py`.
params = [[range(3), [1], 1, np.array([5], dtype=np.int64)... | <commit_before><commit_msg>BENCH: Add benchmark for small array coercions
Note that since the benchmarks are so fast, the actual results
are diluted behind one more python function call.<commit_after> | from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class ArrayCoercionSmall(Benchmark):
# More detailed benchmarks for array coercion,
# some basic benchmarks are in `bench_core.py`.
params = [[range(3), [1], 1, np.array([5], dtype=np.int64)... | BENCH: Add benchmark for small array coercions
Note that since the benchmarks are so fast, the actual results
are diluted behind one more python function call.from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class ArrayCoercionSmall(Benchmark):
#... | <commit_before><commit_msg>BENCH: Add benchmark for small array coercions
Note that since the benchmarks are so fast, the actual results
are diluted behind one more python function call.<commit_after>from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
c... | |
640057f8c821fe7bf5e7968f4a7ff5039d0e9317 | test/unit/ggrc/converters/test_import_helper.py | test/unit/ggrc/converters/test_import_helper.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
import unittest
from ggrc import app # noqa
from ggrc import converters
from g... | Add tests for correct column handlers | Add tests for correct column handlers
| Python | apache-2.0 | prasannav7/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,jmakov/ggrc-core,jmakov/ggrc-core,AleksNeStu/ggrc-core,jmakov/ggrc-core,AleksNeStu/ggrc-c... | Add tests for correct column handlers | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
import unittest
from ggrc import app # noqa
from ggrc import converters
from g... | <commit_before><commit_msg>Add tests for correct column handlers<commit_after> | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
import unittest
from ggrc import app # noqa
from ggrc import converters
from g... | Add tests for correct column handlers# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
import unittest
from ggrc import app # no... | <commit_before><commit_msg>Add tests for correct column handlers<commit_after># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
im... | |
c52bcf13f4759554eebaef8c6a573217226655ef | tests/test_injectorplugin.py | tests/test_injectorplugin.py | import pytest
from fanstatic import Library, Resource, NeededResources
from fanstatic.injector import InjectorPlugin
from fanstatic.registry import InjectorRegistry
from fanstatic import make_injector
from fanstatic import ConfigurationError
from fanstatic.injector import TopBottomInjector
class TopInjector(Injector... | Add some tests for the injector registry | Add some tests for the injector registry
| Python | bsd-3-clause | fanstatic/fanstatic,fanstatic/fanstatic | Add some tests for the injector registry | import pytest
from fanstatic import Library, Resource, NeededResources
from fanstatic.injector import InjectorPlugin
from fanstatic.registry import InjectorRegistry
from fanstatic import make_injector
from fanstatic import ConfigurationError
from fanstatic.injector import TopBottomInjector
class TopInjector(Injector... | <commit_before><commit_msg>Add some tests for the injector registry<commit_after> | import pytest
from fanstatic import Library, Resource, NeededResources
from fanstatic.injector import InjectorPlugin
from fanstatic.registry import InjectorRegistry
from fanstatic import make_injector
from fanstatic import ConfigurationError
from fanstatic.injector import TopBottomInjector
class TopInjector(Injector... | Add some tests for the injector registryimport pytest
from fanstatic import Library, Resource, NeededResources
from fanstatic.injector import InjectorPlugin
from fanstatic.registry import InjectorRegistry
from fanstatic import make_injector
from fanstatic import ConfigurationError
from fanstatic.injector import TopBot... | <commit_before><commit_msg>Add some tests for the injector registry<commit_after>import pytest
from fanstatic import Library, Resource, NeededResources
from fanstatic.injector import InjectorPlugin
from fanstatic.registry import InjectorRegistry
from fanstatic import make_injector
from fanstatic import ConfigurationEr... | |
cef9eb64e9d1cbb87ef1328997334266f599c936 | pylearn2/scripts/tests/test_train.py | pylearn2/scripts/tests/test_train.py | """
A unit test for the train.py script
"""
import os
import pylearn2
from pylearn2.scripts.train import train
def test_train_cmd():
"""
Calls the train.py script with a short YAML file
to see if it trains without error
"""
train(os.path.join(pylearn2.__path__[0],
"scripts/... | Add unit test for train.py | Add unit test for train.py
| Python | bsd-3-clause | junbochen/pylearn2,kose-y/pylearn2,ddboline/pylearn2,fyffyt/pylearn2,lisa-lab/pylearn2,se4u/pylearn2,w1kke/pylearn2,pombredanne/pylearn2,lamblin/pylearn2,jamessergeant/pylearn2,junbochen/pylearn2,daemonmaker/pylearn2,jeremyfix/pylearn2,jeremyfix/pylearn2,hantek/pylearn2,bartvm/pylearn2,fyffyt/pylearn2,hantek/pylearn2,a... | Add unit test for train.py | """
A unit test for the train.py script
"""
import os
import pylearn2
from pylearn2.scripts.train import train
def test_train_cmd():
"""
Calls the train.py script with a short YAML file
to see if it trains without error
"""
train(os.path.join(pylearn2.__path__[0],
"scripts/... | <commit_before><commit_msg>Add unit test for train.py<commit_after> | """
A unit test for the train.py script
"""
import os
import pylearn2
from pylearn2.scripts.train import train
def test_train_cmd():
"""
Calls the train.py script with a short YAML file
to see if it trains without error
"""
train(os.path.join(pylearn2.__path__[0],
"scripts/... | Add unit test for train.py"""
A unit test for the train.py script
"""
import os
import pylearn2
from pylearn2.scripts.train import train
def test_train_cmd():
"""
Calls the train.py script with a short YAML file
to see if it trains without error
"""
train(os.path.join(pylearn2.__path__[0],
... | <commit_before><commit_msg>Add unit test for train.py<commit_after>"""
A unit test for the train.py script
"""
import os
import pylearn2
from pylearn2.scripts.train import train
def test_train_cmd():
"""
Calls the train.py script with a short YAML file
to see if it trains without error
"""
train(... | |
836b483e06f1221f35d543e534ddfab6020b06ed | bounce.py | bounce.py | import curses
import random
def bounce(stdscr):
curses.curs_set(0)
height, width = stdscr.getmaxyx()
ypos, xpos = random.randrange(0, height - 1), random.randrange(0, width - 1)
ydir, xdir = 1, 1
stdscr.addstr(height//2, width//2, "Type a character")
stdscr.nodelay(1)
c = None
while Tru... | Add a bouncing character example | Add a bouncing character example
| Python | mit | asmeurer/curses_tests | Add a bouncing character example | import curses
import random
def bounce(stdscr):
curses.curs_set(0)
height, width = stdscr.getmaxyx()
ypos, xpos = random.randrange(0, height - 1), random.randrange(0, width - 1)
ydir, xdir = 1, 1
stdscr.addstr(height//2, width//2, "Type a character")
stdscr.nodelay(1)
c = None
while Tru... | <commit_before><commit_msg>Add a bouncing character example<commit_after> | import curses
import random
def bounce(stdscr):
curses.curs_set(0)
height, width = stdscr.getmaxyx()
ypos, xpos = random.randrange(0, height - 1), random.randrange(0, width - 1)
ydir, xdir = 1, 1
stdscr.addstr(height//2, width//2, "Type a character")
stdscr.nodelay(1)
c = None
while Tru... | Add a bouncing character exampleimport curses
import random
def bounce(stdscr):
curses.curs_set(0)
height, width = stdscr.getmaxyx()
ypos, xpos = random.randrange(0, height - 1), random.randrange(0, width - 1)
ydir, xdir = 1, 1
stdscr.addstr(height//2, width//2, "Type a character")
stdscr.nodel... | <commit_before><commit_msg>Add a bouncing character example<commit_after>import curses
import random
def bounce(stdscr):
curses.curs_set(0)
height, width = stdscr.getmaxyx()
ypos, xpos = random.randrange(0, height - 1), random.randrange(0, width - 1)
ydir, xdir = 1, 1
stdscr.addstr(height//2, width... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.