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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4587ca62906c668d17356b12c96c89a302f6df4f | examples/text_diff_reporter_example.py | examples/text_diff_reporter_example.py | from approvaltests import Approvals
from approvaltests.TextDiffReporter import TextDiffReporter
import os
import unittest
class Test(unittest.TestCase):
def test(self):
# This environment variable should be set somewhere outside of the test
# but is here to make the example clearer.
os.env... | Add an example of how to use the TextDiffReporter. | Add an example of how to use the TextDiffReporter.
| Python | apache-2.0 | approvals/ApprovalTests.Python,approvals/ApprovalTests.Python,approvals/ApprovalTests.Python,tdpreece/ApprovalTests.Python | Add an example of how to use the TextDiffReporter. | from approvaltests import Approvals
from approvaltests.TextDiffReporter import TextDiffReporter
import os
import unittest
class Test(unittest.TestCase):
def test(self):
# This environment variable should be set somewhere outside of the test
# but is here to make the example clearer.
os.env... | <commit_before><commit_msg>Add an example of how to use the TextDiffReporter.<commit_after> | from approvaltests import Approvals
from approvaltests.TextDiffReporter import TextDiffReporter
import os
import unittest
class Test(unittest.TestCase):
def test(self):
# This environment variable should be set somewhere outside of the test
# but is here to make the example clearer.
os.env... | Add an example of how to use the TextDiffReporter.from approvaltests import Approvals
from approvaltests.TextDiffReporter import TextDiffReporter
import os
import unittest
class Test(unittest.TestCase):
def test(self):
# This environment variable should be set somewhere outside of the test
# but i... | <commit_before><commit_msg>Add an example of how to use the TextDiffReporter.<commit_after>from approvaltests import Approvals
from approvaltests.TextDiffReporter import TextDiffReporter
import os
import unittest
class Test(unittest.TestCase):
def test(self):
# This environment variable should be set some... | |
6844f4e3c526ad10df7777c6cef79c32a78b7f23 | datapipe/denoising/cdf/__init__.py | datapipe/denoising/cdf/__init__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | Simplify the usage of CDF files. | Simplify the usage of CDF files.
| Python | mit | jdhp-sap/sap-cta-data-pipeline,jdhp-sap/sap-cta-data-pipeline,jdhp-sap/data-pipeline-standalone-scripts,jdhp-sap/data-pipeline-standalone-scripts | Simplify the usage of CDF files. | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | <commit_before><commit_msg>Simplify the usage of CDF files.<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | Simplify the usage of CDF files.#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and as... | <commit_before><commit_msg>Simplify the usage of CDF files.<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person o... | |
eac58dcfede3b17163ca625813f55dbaf1d72d38 | tests/test-icon-layout.py | tests/test-icon-layout.py | #!/usr/bin/python
import pygtk
pygtk.require('2.0')
from sugar.session.UITestSession import UITestSession
session = UITestSession()
session.start()
import sys
import random
import gtk
import goocanvas
from view.home.IconLayout import IconLayout
from sugar.canvas import IconColor
from sugar.canvas.IconItem import I... | Add test for icon layout | Add test for icon layout
| Python | lgpl-2.1 | puneetgkaur/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit,tchx84/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,gusDuarte/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit-gtk3,godiard/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,Da... | Add test for icon layout | #!/usr/bin/python
import pygtk
pygtk.require('2.0')
from sugar.session.UITestSession import UITestSession
session = UITestSession()
session.start()
import sys
import random
import gtk
import goocanvas
from view.home.IconLayout import IconLayout
from sugar.canvas import IconColor
from sugar.canvas.IconItem import I... | <commit_before><commit_msg>Add test for icon layout<commit_after> | #!/usr/bin/python
import pygtk
pygtk.require('2.0')
from sugar.session.UITestSession import UITestSession
session = UITestSession()
session.start()
import sys
import random
import gtk
import goocanvas
from view.home.IconLayout import IconLayout
from sugar.canvas import IconColor
from sugar.canvas.IconItem import I... | Add test for icon layout#!/usr/bin/python
import pygtk
pygtk.require('2.0')
from sugar.session.UITestSession import UITestSession
session = UITestSession()
session.start()
import sys
import random
import gtk
import goocanvas
from view.home.IconLayout import IconLayout
from sugar.canvas import IconColor
from sugar.... | <commit_before><commit_msg>Add test for icon layout<commit_after>#!/usr/bin/python
import pygtk
pygtk.require('2.0')
from sugar.session.UITestSession import UITestSession
session = UITestSession()
session.start()
import sys
import random
import gtk
import goocanvas
from view.home.IconLayout import IconLayout
from ... | |
3bfc26205ea6ebc36a54991472e8c495430af0d3 | test/test_git_utilities.py | test/test_git_utilities.py | """Test group class"""
import unittest
from clowder.utility.git_utilities import (
git_ref_type,
git_truncate_ref
)
class GroupTest(unittest.TestCase):
"""group test subclass"""
def setUp(self):
self.branch_ref = 'refs/heads/master'
self.tag_ref = 'refs/tags/v1.0'
self.sha_ref =... | Add unit tests for git_utilities | Add unit tests for git_utilities
| Python | mit | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder | Add unit tests for git_utilities | """Test group class"""
import unittest
from clowder.utility.git_utilities import (
git_ref_type,
git_truncate_ref
)
class GroupTest(unittest.TestCase):
"""group test subclass"""
def setUp(self):
self.branch_ref = 'refs/heads/master'
self.tag_ref = 'refs/tags/v1.0'
self.sha_ref =... | <commit_before><commit_msg>Add unit tests for git_utilities<commit_after> | """Test group class"""
import unittest
from clowder.utility.git_utilities import (
git_ref_type,
git_truncate_ref
)
class GroupTest(unittest.TestCase):
"""group test subclass"""
def setUp(self):
self.branch_ref = 'refs/heads/master'
self.tag_ref = 'refs/tags/v1.0'
self.sha_ref =... | Add unit tests for git_utilities"""Test group class"""
import unittest
from clowder.utility.git_utilities import (
git_ref_type,
git_truncate_ref
)
class GroupTest(unittest.TestCase):
"""group test subclass"""
def setUp(self):
self.branch_ref = 'refs/heads/master'
self.tag_ref = 'refs/t... | <commit_before><commit_msg>Add unit tests for git_utilities<commit_after>"""Test group class"""
import unittest
from clowder.utility.git_utilities import (
git_ref_type,
git_truncate_ref
)
class GroupTest(unittest.TestCase):
"""group test subclass"""
def setUp(self):
self.branch_ref = 'refs/hea... | |
ab158de23187fd0ca838d7f89c2be81cab0cb0a2 | tools/compare_resample.py | tools/compare_resample.py | # Script to plot original wav file against wav file resampled at 16 kHz
# Licensed under Apache v2 (see LICENSE)
from __future__ import division
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from numpy.random import randint
from scipy.signal import resample
# Problems doing th... | Add script to check resampling of wav files | Add script to check resampling of wav files
| Python | apache-2.0 | voicesauce/opensauce-python,voicesauce/opensauce-python,voicesauce/opensauce-python | Add script to check resampling of wav files | # Script to plot original wav file against wav file resampled at 16 kHz
# Licensed under Apache v2 (see LICENSE)
from __future__ import division
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from numpy.random import randint
from scipy.signal import resample
# Problems doing th... | <commit_before><commit_msg>Add script to check resampling of wav files<commit_after> | # Script to plot original wav file against wav file resampled at 16 kHz
# Licensed under Apache v2 (see LICENSE)
from __future__ import division
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from numpy.random import randint
from scipy.signal import resample
# Problems doing th... | Add script to check resampling of wav files# Script to plot original wav file against wav file resampled at 16 kHz
# Licensed under Apache v2 (see LICENSE)
from __future__ import division
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from numpy.random import randint
from scipy.... | <commit_before><commit_msg>Add script to check resampling of wav files<commit_after># Script to plot original wav file against wav file resampled at 16 kHz
# Licensed under Apache v2 (see LICENSE)
from __future__ import division
import sys
import os
import glob
import numpy as np
import matplotlib.pyplot as plt
fro... | |
10b163de791495f89367be979a724cce95f4915d | logger/pattern.py | logger/pattern.py | #!/usr/bin/env python3
"""Patterns and parsers for various purposes."""
__all__ = ["FormatSpecifierParser"]
import re
class FormatSpecifierParser:
"""Parser for the format specifiers used in the Interpolater."""
parse_format_spec = re.compile(
r"""
\A
(?:
(?P<fill>.)?
(?P<align... | Add first draft of FormatSpecifierParser | Add first draft of FormatSpecifierParser
| Python | bsd-2-clause | Vgr255/logging | Add first draft of FormatSpecifierParser | #!/usr/bin/env python3
"""Patterns and parsers for various purposes."""
__all__ = ["FormatSpecifierParser"]
import re
class FormatSpecifierParser:
"""Parser for the format specifiers used in the Interpolater."""
parse_format_spec = re.compile(
r"""
\A
(?:
(?P<fill>.)?
(?P<align... | <commit_before><commit_msg>Add first draft of FormatSpecifierParser<commit_after> | #!/usr/bin/env python3
"""Patterns and parsers for various purposes."""
__all__ = ["FormatSpecifierParser"]
import re
class FormatSpecifierParser:
"""Parser for the format specifiers used in the Interpolater."""
parse_format_spec = re.compile(
r"""
\A
(?:
(?P<fill>.)?
(?P<align... | Add first draft of FormatSpecifierParser#!/usr/bin/env python3
"""Patterns and parsers for various purposes."""
__all__ = ["FormatSpecifierParser"]
import re
class FormatSpecifierParser:
"""Parser for the format specifiers used in the Interpolater."""
parse_format_spec = re.compile(
r"""
\A
(?... | <commit_before><commit_msg>Add first draft of FormatSpecifierParser<commit_after>#!/usr/bin/env python3
"""Patterns and parsers for various purposes."""
__all__ = ["FormatSpecifierParser"]
import re
class FormatSpecifierParser:
"""Parser for the format specifiers used in the Interpolater."""
parse_format_s... | |
5ca652d1f04a629c78ee3345c79dbded898a83dd | tests/test_cli.py | tests/test_cli.py | from click.testing import CliRunner
from webstore_deployer.deployer import init
def test_init():
runner = CliRunner()
result = runner.invoke(init, ['testing_client_ID'])
assert result.exit_code == 0
assert result.output.find('testing_client_ID') != -1
assert result.output.find('testing_client_IDn... | Add basic test for init | Add basic test for init
| Python | mit | melkamar/webstore-manager,melkamar/webstore-manager | Add basic test for init | from click.testing import CliRunner
from webstore_deployer.deployer import init
def test_init():
runner = CliRunner()
result = runner.invoke(init, ['testing_client_ID'])
assert result.exit_code == 0
assert result.output.find('testing_client_ID') != -1
assert result.output.find('testing_client_IDn... | <commit_before><commit_msg>Add basic test for init<commit_after> | from click.testing import CliRunner
from webstore_deployer.deployer import init
def test_init():
runner = CliRunner()
result = runner.invoke(init, ['testing_client_ID'])
assert result.exit_code == 0
assert result.output.find('testing_client_ID') != -1
assert result.output.find('testing_client_IDn... | Add basic test for initfrom click.testing import CliRunner
from webstore_deployer.deployer import init
def test_init():
runner = CliRunner()
result = runner.invoke(init, ['testing_client_ID'])
assert result.exit_code == 0
assert result.output.find('testing_client_ID') != -1
assert result.output.f... | <commit_before><commit_msg>Add basic test for init<commit_after>from click.testing import CliRunner
from webstore_deployer.deployer import init
def test_init():
runner = CliRunner()
result = runner.invoke(init, ['testing_client_ID'])
assert result.exit_code == 0
assert result.output.find('testing_cli... | |
e07c2f1c27e3d10e0a660e1434e66d8b26ad0810 | openedx/core/djangoapps/schedules/migrations/0009_schedule_copy_column_values.py | openedx/core/djangoapps/schedules/migrations/0009_schedule_copy_column_values.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-24 20:52
from __future__ import unicode_literals
from django.db import migrations, transaction
def copy_column_value_forwards(apps, schema_editor):
"""
Copy the start field into start_date field
This table has around 25 million rows, we'll... | Copy values from old to new field in Schedules Model | Copy values from old to new field in Schedules Model
| Python | agpl-3.0 | appsembler/edx-platform,msegado/edx-platform,EDUlib/edx-platform,arbrandes/edx-platform,eduNEXT/edunext-platform,stvstnfrd/edx-platform,EDUlib/edx-platform,edx-solutions/edx-platform,edx/edx-platform,appsembler/edx-platform,edx-solutions/edx-platform,appsembler/edx-platform,EDUlib/edx-platform,msegado/edx-platform,apps... | Copy values from old to new field in Schedules Model | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-24 20:52
from __future__ import unicode_literals
from django.db import migrations, transaction
def copy_column_value_forwards(apps, schema_editor):
"""
Copy the start field into start_date field
This table has around 25 million rows, we'll... | <commit_before><commit_msg>Copy values from old to new field in Schedules Model<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-24 20:52
from __future__ import unicode_literals
from django.db import migrations, transaction
def copy_column_value_forwards(apps, schema_editor):
"""
Copy the start field into start_date field
This table has around 25 million rows, we'll... | Copy values from old to new field in Schedules Model# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-24 20:52
from __future__ import unicode_literals
from django.db import migrations, transaction
def copy_column_value_forwards(apps, schema_editor):
"""
Copy the start field into start_date fie... | <commit_before><commit_msg>Copy values from old to new field in Schedules Model<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-24 20:52
from __future__ import unicode_literals
from django.db import migrations, transaction
def copy_column_value_forwards(apps, schema_editor):
"""
... | |
0d7e851f4acb609b55c162b772e41293b7f00b17 | syntacticframes_project/syntacticframes/migrations/0002_auto_20140929_1135.py | syntacticframes_project/syntacticframes/migrations/0002_auto_20140929_1135.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('syntacticframes', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='levinclass',
... | Add migration for Levin class order | Add migration for Levin class order
| Python | mit | aymara/verbenet-editor,aymara/verbenet-editor,aymara/verbenet-editor | Add migration for Levin class order | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('syntacticframes', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='levinclass',
... | <commit_before><commit_msg>Add migration for Levin class order<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('syntacticframes', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='levinclass',
... | Add migration for Levin class order# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('syntacticframes', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | <commit_before><commit_msg>Add migration for Levin class order<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('syntacticframes', '0001_initial'),
]
operations = [
... | |
9e5ec6fc67c863dea2de26ce742f0940ad43562c | Communication/benchPrototypeAPI.py | Communication/benchPrototypeAPI.py | import sys
sys.path.append('/home/bat/Python-Arduino-Proto-API-v2/arduino')
import time
locations = ['/dev/ttyACM0','/dev/ttyACM1','/dev/ttyACM2','/dev/ttyACM3','/dev/ttyACM4','/dev/ttyACM5','/dev/ttyUSB0','/dev/ttyUSB1','/dev/ttyUSB2','/dev/ttyUSB3','/dev/ttyS0','/dev/ttyS1','/dev/ttyS2','/dev/ttyS3']
from firmata im... | Add a script to benchmark python to arduino libraries | Add a script to benchmark python to arduino libraries
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Add a script to benchmark python to arduino libraries | import sys
sys.path.append('/home/bat/Python-Arduino-Proto-API-v2/arduino')
import time
locations = ['/dev/ttyACM0','/dev/ttyACM1','/dev/ttyACM2','/dev/ttyACM3','/dev/ttyACM4','/dev/ttyACM5','/dev/ttyUSB0','/dev/ttyUSB1','/dev/ttyUSB2','/dev/ttyUSB3','/dev/ttyS0','/dev/ttyS1','/dev/ttyS2','/dev/ttyS3']
from firmata im... | <commit_before><commit_msg>Add a script to benchmark python to arduino libraries<commit_after> | import sys
sys.path.append('/home/bat/Python-Arduino-Proto-API-v2/arduino')
import time
locations = ['/dev/ttyACM0','/dev/ttyACM1','/dev/ttyACM2','/dev/ttyACM3','/dev/ttyACM4','/dev/ttyACM5','/dev/ttyUSB0','/dev/ttyUSB1','/dev/ttyUSB2','/dev/ttyUSB3','/dev/ttyS0','/dev/ttyS1','/dev/ttyS2','/dev/ttyS3']
from firmata im... | Add a script to benchmark python to arduino librariesimport sys
sys.path.append('/home/bat/Python-Arduino-Proto-API-v2/arduino')
import time
locations = ['/dev/ttyACM0','/dev/ttyACM1','/dev/ttyACM2','/dev/ttyACM3','/dev/ttyACM4','/dev/ttyACM5','/dev/ttyUSB0','/dev/ttyUSB1','/dev/ttyUSB2','/dev/ttyUSB3','/dev/ttyS0','/... | <commit_before><commit_msg>Add a script to benchmark python to arduino libraries<commit_after>import sys
sys.path.append('/home/bat/Python-Arduino-Proto-API-v2/arduino')
import time
locations = ['/dev/ttyACM0','/dev/ttyACM1','/dev/ttyACM2','/dev/ttyACM3','/dev/ttyACM4','/dev/ttyACM5','/dev/ttyUSB0','/dev/ttyUSB1','/de... | |
b8dd154c6f5d808d4b8916266fa43ca54c37851e | pybloom/hashfilter.py | pybloom/hashfilter.py | import time
class HashFilter(object):
'''
Plain Hash Filter for testing purposes
'''
def __init__(self, expiration):
self.expiration = expiration
self.unique_items = {}
def add(self, key):
if key in self.unique_items:
timestamp = time.time()
self.uni... | Add plain hash filter for testing | Add plain hash filter for testing
| Python | mit | Parsely/python-bloomfilter | Add plain hash filter for testing | import time
class HashFilter(object):
'''
Plain Hash Filter for testing purposes
'''
def __init__(self, expiration):
self.expiration = expiration
self.unique_items = {}
def add(self, key):
if key in self.unique_items:
timestamp = time.time()
self.uni... | <commit_before><commit_msg>Add plain hash filter for testing<commit_after> | import time
class HashFilter(object):
'''
Plain Hash Filter for testing purposes
'''
def __init__(self, expiration):
self.expiration = expiration
self.unique_items = {}
def add(self, key):
if key in self.unique_items:
timestamp = time.time()
self.uni... | Add plain hash filter for testingimport time
class HashFilter(object):
'''
Plain Hash Filter for testing purposes
'''
def __init__(self, expiration):
self.expiration = expiration
self.unique_items = {}
def add(self, key):
if key in self.unique_items:
timestamp =... | <commit_before><commit_msg>Add plain hash filter for testing<commit_after>import time
class HashFilter(object):
'''
Plain Hash Filter for testing purposes
'''
def __init__(self, expiration):
self.expiration = expiration
self.unique_items = {}
def add(self, key):
if key in s... | |
ad7c88acd0ff74f4dbd2d751d07c63abbbb9db44 | script_example.py | script_example.py | ## This is an example of how to set up a script to run against a database, should you need to do so.
## It should have everything you need to get started
from uber.config import c
from uber.models import Attendee, initialize_db, Session
with Session() as session:
initialize_db()
session = Session().session | Add example script This will give future-me a jumping off point for writing scripts to run against the DB for special cases. | Add example script
This will give future-me a jumping off point for writing scripts to run against the DB for special cases.
| Python | agpl-3.0 | magfest/ubersystem,magfest/ubersystem,magfest/ubersystem,magfest/ubersystem | Add example script
This will give future-me a jumping off point for writing scripts to run against the DB for special cases. | ## This is an example of how to set up a script to run against a database, should you need to do so.
## It should have everything you need to get started
from uber.config import c
from uber.models import Attendee, initialize_db, Session
with Session() as session:
initialize_db()
session = Session().session | <commit_before><commit_msg>Add example script
This will give future-me a jumping off point for writing scripts to run against the DB for special cases.<commit_after> | ## This is an example of how to set up a script to run against a database, should you need to do so.
## It should have everything you need to get started
from uber.config import c
from uber.models import Attendee, initialize_db, Session
with Session() as session:
initialize_db()
session = Session().session | Add example script
This will give future-me a jumping off point for writing scripts to run against the DB for special cases.## This is an example of how to set up a script to run against a database, should you need to do so.
## It should have everything you need to get started
from uber.config import c
from uber.model... | <commit_before><commit_msg>Add example script
This will give future-me a jumping off point for writing scripts to run against the DB for special cases.<commit_after>## This is an example of how to set up a script to run against a database, should you need to do so.
## It should have everything you need to get started
... | |
b8d824b5355bcabd6a1bdcf7d8af39076ce75bb6 | examples/workspace_renumber.py | examples/workspace_renumber.py | #!/usr/bin/env python3
import i3ipc
# make connection to i3 ipc
i3 = i3ipc.Connection()
# check if workspaces are all in order
def workspaces_ordered(i3conn):
last_workspace_number = 0
for i in sorted(i3conn.get_workspaces(), key=lambda x: x['num']):
if i['num'] != last_workspace_number+1:
... | Add script that makes sure workspace numbers are always in consecutive order by moving windows on out of order workspaces to the appropriate workspace | Add script that makes sure workspace numbers are always in consecutive
order by moving windows on out of order workspaces to the appropriate
workspace
| Python | bsd-3-clause | acrisci/i3ipc-python | Add script that makes sure workspace numbers are always in consecutive
order by moving windows on out of order workspaces to the appropriate
workspace | #!/usr/bin/env python3
import i3ipc
# make connection to i3 ipc
i3 = i3ipc.Connection()
# check if workspaces are all in order
def workspaces_ordered(i3conn):
last_workspace_number = 0
for i in sorted(i3conn.get_workspaces(), key=lambda x: x['num']):
if i['num'] != last_workspace_number+1:
... | <commit_before><commit_msg>Add script that makes sure workspace numbers are always in consecutive
order by moving windows on out of order workspaces to the appropriate
workspace<commit_after> | #!/usr/bin/env python3
import i3ipc
# make connection to i3 ipc
i3 = i3ipc.Connection()
# check if workspaces are all in order
def workspaces_ordered(i3conn):
last_workspace_number = 0
for i in sorted(i3conn.get_workspaces(), key=lambda x: x['num']):
if i['num'] != last_workspace_number+1:
... | Add script that makes sure workspace numbers are always in consecutive
order by moving windows on out of order workspaces to the appropriate
workspace#!/usr/bin/env python3
import i3ipc
# make connection to i3 ipc
i3 = i3ipc.Connection()
# check if workspaces are all in order
def workspaces_ordered(i3conn):
las... | <commit_before><commit_msg>Add script that makes sure workspace numbers are always in consecutive
order by moving windows on out of order workspaces to the appropriate
workspace<commit_after>#!/usr/bin/env python3
import i3ipc
# make connection to i3 ipc
i3 = i3ipc.Connection()
# check if workspaces are all in orde... | |
bf16ff8622049a29e2013266d7bb2ac7f5c3a84d | designate/backend/impl_powerdns/migrate_repo/versions/017_records_drop_duped_index.py | designate/backend/impl_powerdns/migrate_repo/versions/017_records_drop_duped_index.py | # Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# 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 re... | Remove duplicated index on table 'records' of pDNS backend | Remove duplicated index on table 'records' of pDNS backend
Remove duplicated index `rec_name_index` on table 'records' of pDNS backend.
Change-Id: I9e8723b464522a588f0e0ef6ff261b71609b0726
Closes-Bug: 1446980
| Python | apache-2.0 | grahamhayes/designate,tonyli71/designate,cneill/designate-testing,tonyli71/designate,kiall/designate-py3,ionrock/designate,kiall/designate-py3,openstack/designate,kiall/designate-py3,cneill/designate,muraliselva10/designate,cneill/designate-testing,kiall/designate-py3,muraliselva10/designate,muraliselva10/designate,ope... | Remove duplicated index on table 'records' of pDNS backend
Remove duplicated index `rec_name_index` on table 'records' of pDNS backend.
Change-Id: I9e8723b464522a588f0e0ef6ff261b71609b0726
Closes-Bug: 1446980 | # Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# 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 re... | <commit_before><commit_msg>Remove duplicated index on table 'records' of pDNS backend
Remove duplicated index `rec_name_index` on table 'records' of pDNS backend.
Change-Id: I9e8723b464522a588f0e0ef6ff261b71609b0726
Closes-Bug: 1446980<commit_after> | # Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# 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 re... | Remove duplicated index on table 'records' of pDNS backend
Remove duplicated index `rec_name_index` on table 'records' of pDNS backend.
Change-Id: I9e8723b464522a588f0e0ef6ff261b71609b0726
Closes-Bug: 1446980# Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <[email protected]>
#
# Licensed under the Apache Li... | <commit_before><commit_msg>Remove duplicated index on table 'records' of pDNS backend
Remove duplicated index `rec_name_index` on table 'records' of pDNS backend.
Change-Id: I9e8723b464522a588f0e0ef6ff261b71609b0726
Closes-Bug: 1446980<commit_after># Copyright 2015 NetEase, Inc.
#
# Author: Zhang Gengyuan <stanzgy@gm... | |
6156181b6635a7dd6cdd8f699a2e5570cb42e89c | website/tests/views/test_pathway.py | website/tests/views/test_pathway.py | from database import db
from models import Pathway, Gene, GeneList, GeneListEntry
from view_testing import ViewTest
def create_pathways():
# not necessarily true ;)
genes = [Gene(name=name) for name in 'KRAS NRAS AKAP13 NF1 BCR'.split()]
significant_genes = [Gene(name=name) for name in 'TP53 AKT1 TXN GPI... | Add tests for pathways details and significant pathways | Add tests for pathways details and significant pathways
| Python | lgpl-2.1 | reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/Visual... | Add tests for pathways details and significant pathways | from database import db
from models import Pathway, Gene, GeneList, GeneListEntry
from view_testing import ViewTest
def create_pathways():
# not necessarily true ;)
genes = [Gene(name=name) for name in 'KRAS NRAS AKAP13 NF1 BCR'.split()]
significant_genes = [Gene(name=name) for name in 'TP53 AKT1 TXN GPI... | <commit_before><commit_msg>Add tests for pathways details and significant pathways<commit_after> | from database import db
from models import Pathway, Gene, GeneList, GeneListEntry
from view_testing import ViewTest
def create_pathways():
# not necessarily true ;)
genes = [Gene(name=name) for name in 'KRAS NRAS AKAP13 NF1 BCR'.split()]
significant_genes = [Gene(name=name) for name in 'TP53 AKT1 TXN GPI... | Add tests for pathways details and significant pathwaysfrom database import db
from models import Pathway, Gene, GeneList, GeneListEntry
from view_testing import ViewTest
def create_pathways():
# not necessarily true ;)
genes = [Gene(name=name) for name in 'KRAS NRAS AKAP13 NF1 BCR'.split()]
significant_... | <commit_before><commit_msg>Add tests for pathways details and significant pathways<commit_after>from database import db
from models import Pathway, Gene, GeneList, GeneListEntry
from view_testing import ViewTest
def create_pathways():
# not necessarily true ;)
genes = [Gene(name=name) for name in 'KRAS NRAS ... | |
63cd90c4179f0b68c1af0a174e30b25906e6319e | taiga/projects/management/commands/change_project_slug.py | taiga/projects/management/commands/change_project_slug.py | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <[email protected]>
# Copyright (C) 2014-2016 Jesús Espino <[email protected]>
# Copyright (C) 2014-2016 David Barragán <[email protected]>
# Copyright (C) 2014-2016 Alejandro Alonso <[email protected]>
# This program is free software: you can r... | Create command to change project slug | Create command to change project slug
| Python | agpl-3.0 | taigaio/taiga-back,taigaio/taiga-back,dayatz/taiga-back,dayatz/taiga-back,taigaio/taiga-back,dayatz/taiga-back | Create command to change project slug | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <[email protected]>
# Copyright (C) 2014-2016 Jesús Espino <[email protected]>
# Copyright (C) 2014-2016 David Barragán <[email protected]>
# Copyright (C) 2014-2016 Alejandro Alonso <[email protected]>
# This program is free software: you can r... | <commit_before><commit_msg>Create command to change project slug<commit_after> | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <[email protected]>
# Copyright (C) 2014-2016 Jesús Espino <[email protected]>
# Copyright (C) 2014-2016 David Barragán <[email protected]>
# Copyright (C) 2014-2016 Alejandro Alonso <[email protected]>
# This program is free software: you can r... | Create command to change project slug# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <[email protected]>
# Copyright (C) 2014-2016 Jesús Espino <[email protected]>
# Copyright (C) 2014-2016 David Barragán <[email protected]>
# Copyright (C) 2014-2016 Alejandro Alonso <[email protected]>
# Thi... | <commit_before><commit_msg>Create command to change project slug<commit_after># -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <[email protected]>
# Copyright (C) 2014-2016 Jesús Espino <[email protected]>
# Copyright (C) 2014-2016 David Barragán <[email protected]>
# Copyright (C) 2014-2016 Alejandro Alo... | |
512f98053fbc8df5ac08312e950ef3042fa5a864 | reverse_complement.py | reverse_complement.py | import sys
from argparse import ArgumentParser, FileType
from Bio.Seq import Seq
def reverse_complement(seq):
return str(Seq(seq.strip()).reverse_complement())
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("infile", nargs="?", type=FileType('r'), default=sys.stdin)
args = pa... | Add script to reverse complement a set of sequences. | Add script to reverse complement a set of sequences.
| Python | mit | roryk/junkdrawer,roryk/junkdrawer | Add script to reverse complement a set of sequences. | import sys
from argparse import ArgumentParser, FileType
from Bio.Seq import Seq
def reverse_complement(seq):
return str(Seq(seq.strip()).reverse_complement())
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("infile", nargs="?", type=FileType('r'), default=sys.stdin)
args = pa... | <commit_before><commit_msg>Add script to reverse complement a set of sequences.<commit_after> | import sys
from argparse import ArgumentParser, FileType
from Bio.Seq import Seq
def reverse_complement(seq):
return str(Seq(seq.strip()).reverse_complement())
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("infile", nargs="?", type=FileType('r'), default=sys.stdin)
args = pa... | Add script to reverse complement a set of sequences.import sys
from argparse import ArgumentParser, FileType
from Bio.Seq import Seq
def reverse_complement(seq):
return str(Seq(seq.strip()).reverse_complement())
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("infile", nargs="?", ... | <commit_before><commit_msg>Add script to reverse complement a set of sequences.<commit_after>import sys
from argparse import ArgumentParser, FileType
from Bio.Seq import Seq
def reverse_complement(seq):
return str(Seq(seq.strip()).reverse_complement())
if __name__ == "__main__":
parser = ArgumentParser()
... | |
e7bceb26566265c19009a5be68e3fe744a38176b | TWLight/applications/migrations/0022_auto_20181209_1315.py | TWLight/applications/migrations/0022_auto_20181209_1315.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-09 13:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0021_application_hidden'),
]
operations = [
migrations.Alt... | Add migration for previous commit | Add migration for previous commit
| Python | mit | WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight | Add migration for previous commit | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-09 13:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0021_application_hidden'),
]
operations = [
migrations.Alt... | <commit_before><commit_msg>Add migration for previous commit<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-09 13:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0021_application_hidden'),
]
operations = [
migrations.Alt... | Add migration for previous commit# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-09 13:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0021_application_hidden'),
]
oper... | <commit_before><commit_msg>Add migration for previous commit<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-09 13:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0... | |
93ba1d34e51a9b959b63e77eae78845dd86203ed | camera-capture-test.py | camera-capture-test.py | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Application to capture images synchronously
# from two AVT Manta cameras with the Vimba SDK
#
# External dependencies
import collections, cv2, time
import Vimba
# Number of images saved
image_count = 0
# Frame per second counter
counter = 0
fps_counter = 0
fps_bu... | Test to use the new Vimba module. | Test to use the new Vimba module.
| Python | mit | microy/VisionToolkit,microy/StereoVision,microy/VisionToolkit,microy/PyStereoVisionToolkit,microy/PyStereoVisionToolkit,microy/StereoVision | Test to use the new Vimba module. | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Application to capture images synchronously
# from two AVT Manta cameras with the Vimba SDK
#
# External dependencies
import collections, cv2, time
import Vimba
# Number of images saved
image_count = 0
# Frame per second counter
counter = 0
fps_counter = 0
fps_bu... | <commit_before><commit_msg>Test to use the new Vimba module.<commit_after> | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Application to capture images synchronously
# from two AVT Manta cameras with the Vimba SDK
#
# External dependencies
import collections, cv2, time
import Vimba
# Number of images saved
image_count = 0
# Frame per second counter
counter = 0
fps_counter = 0
fps_bu... | Test to use the new Vimba module.#! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Application to capture images synchronously
# from two AVT Manta cameras with the Vimba SDK
#
# External dependencies
import collections, cv2, time
import Vimba
# Number of images saved
image_count = 0
# Frame per second counter
c... | <commit_before><commit_msg>Test to use the new Vimba module.<commit_after>#! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Application to capture images synchronously
# from two AVT Manta cameras with the Vimba SDK
#
# External dependencies
import collections, cv2, time
import Vimba
# Number of images saved
imag... | |
03a4dde5c9abebec27ac4ce38b2bfefd5c661274 | classify_body_parts.py | classify_body_parts.py | """Find known body parts in sentences with predicted label 'Lichaamsdeel'.
Extended body parts are saved to new text files.
Usage: python classify_body_parts.py <json file with body part mapping> <dir
with input texts> <dir for output texts>
"""
import os
import codecs
import argparse
import json
from count_labels im... | Add script to expand body parts | Add script to expand body parts
The script looks for words indicating body parts in sentences with
predicted label Lichaamsdeel and adds the appropriate body part terms to
the labels per sentence. The results are written to text files in a new
directory.
| Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add script to expand body parts
The script looks for words indicating body parts in sentences with
predicted label Lichaamsdeel and adds the appropriate body part terms to
the labels per sentence. The results are written to text files in a new
directory. | """Find known body parts in sentences with predicted label 'Lichaamsdeel'.
Extended body parts are saved to new text files.
Usage: python classify_body_parts.py <json file with body part mapping> <dir
with input texts> <dir for output texts>
"""
import os
import codecs
import argparse
import json
from count_labels im... | <commit_before><commit_msg>Add script to expand body parts
The script looks for words indicating body parts in sentences with
predicted label Lichaamsdeel and adds the appropriate body part terms to
the labels per sentence. The results are written to text files in a new
directory.<commit_after> | """Find known body parts in sentences with predicted label 'Lichaamsdeel'.
Extended body parts are saved to new text files.
Usage: python classify_body_parts.py <json file with body part mapping> <dir
with input texts> <dir for output texts>
"""
import os
import codecs
import argparse
import json
from count_labels im... | Add script to expand body parts
The script looks for words indicating body parts in sentences with
predicted label Lichaamsdeel and adds the appropriate body part terms to
the labels per sentence. The results are written to text files in a new
directory."""Find known body parts in sentences with predicted label 'Licha... | <commit_before><commit_msg>Add script to expand body parts
The script looks for words indicating body parts in sentences with
predicted label Lichaamsdeel and adds the appropriate body part terms to
the labels per sentence. The results are written to text files in a new
directory.<commit_after>"""Find known body parts... | |
fca3c0d7ce33dde19191f6c193344ee888b9c97a | geotrek/land/tests/test_models.py | geotrek/land/tests/test_models.py | from django.test import TestCase
from geotrek.land.models import LandType, PhysicalType
class TestModelLand(TestCase):
def test_physicaltype_value_no_structure(self):
pt = PhysicalType.objects.create(name='PhysicalType_1', structure=None)
self.assertEqual(str(pt), 'PhysicalType_1')
def test_... | Add tests model land values | Add tests model land values
| Python | bsd-2-clause | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | Add tests model land values | from django.test import TestCase
from geotrek.land.models import LandType, PhysicalType
class TestModelLand(TestCase):
def test_physicaltype_value_no_structure(self):
pt = PhysicalType.objects.create(name='PhysicalType_1', structure=None)
self.assertEqual(str(pt), 'PhysicalType_1')
def test_... | <commit_before><commit_msg>Add tests model land values<commit_after> | from django.test import TestCase
from geotrek.land.models import LandType, PhysicalType
class TestModelLand(TestCase):
def test_physicaltype_value_no_structure(self):
pt = PhysicalType.objects.create(name='PhysicalType_1', structure=None)
self.assertEqual(str(pt), 'PhysicalType_1')
def test_... | Add tests model land valuesfrom django.test import TestCase
from geotrek.land.models import LandType, PhysicalType
class TestModelLand(TestCase):
def test_physicaltype_value_no_structure(self):
pt = PhysicalType.objects.create(name='PhysicalType_1', structure=None)
self.assertEqual(str(pt), 'Phys... | <commit_before><commit_msg>Add tests model land values<commit_after>from django.test import TestCase
from geotrek.land.models import LandType, PhysicalType
class TestModelLand(TestCase):
def test_physicaltype_value_no_structure(self):
pt = PhysicalType.objects.create(name='PhysicalType_1', structure=None... | |
f18e08afb49724c01d84e36779eb6662631c5485 | hoomd/md/pytest/test_integrate.py | hoomd/md/pytest/test_integrate.py | import pytest
import hoomd
import hoomd.md as md
def make_simulation(simulation_factory, two_particle_snapshot_factory):
def sim_factory(particle_types=['A'], dimensions=3, d=1, L=20):
return simulation_factory(
two_particle_snapshot_factory(particle_types, dimensions, d, L))
return sim... | Add basic integrator attaching/detaching tests | Add basic integrator attaching/detaching tests
| Python | bsd-3-clause | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | Add basic integrator attaching/detaching tests | import pytest
import hoomd
import hoomd.md as md
def make_simulation(simulation_factory, two_particle_snapshot_factory):
def sim_factory(particle_types=['A'], dimensions=3, d=1, L=20):
return simulation_factory(
two_particle_snapshot_factory(particle_types, dimensions, d, L))
return sim... | <commit_before><commit_msg>Add basic integrator attaching/detaching tests<commit_after> | import pytest
import hoomd
import hoomd.md as md
def make_simulation(simulation_factory, two_particle_snapshot_factory):
def sim_factory(particle_types=['A'], dimensions=3, d=1, L=20):
return simulation_factory(
two_particle_snapshot_factory(particle_types, dimensions, d, L))
return sim... | Add basic integrator attaching/detaching testsimport pytest
import hoomd
import hoomd.md as md
def make_simulation(simulation_factory, two_particle_snapshot_factory):
def sim_factory(particle_types=['A'], dimensions=3, d=1, L=20):
return simulation_factory(
two_particle_snapshot_factory(part... | <commit_before><commit_msg>Add basic integrator attaching/detaching tests<commit_after>import pytest
import hoomd
import hoomd.md as md
def make_simulation(simulation_factory, two_particle_snapshot_factory):
def sim_factory(particle_types=['A'], dimensions=3, d=1, L=20):
return simulation_factory(
... | |
cc358ae9d62e2a0fd6ebca99c410d0c2ce517d87 | aospy/test/test_timedate.py | aospy/test/test_timedate.py | #!/usr/bin/env python
"""Test suite for aospy.utils module."""
import sys
import unittest
import numpy as np
import xarray as xr
from datetime import datetime
from aospy.timedate import TimeManager
class AospyTimeManagerTestCase(unittest.TestCase):
def setUp(self):
# self.tm = TimeManager()
pass
... | TEST Added tests of TimeManager | TEST Added tests of TimeManager
| Python | apache-2.0 | spencerahill/aospy,spencerkclark/aospy | TEST Added tests of TimeManager | #!/usr/bin/env python
"""Test suite for aospy.utils module."""
import sys
import unittest
import numpy as np
import xarray as xr
from datetime import datetime
from aospy.timedate import TimeManager
class AospyTimeManagerTestCase(unittest.TestCase):
def setUp(self):
# self.tm = TimeManager()
pass
... | <commit_before><commit_msg>TEST Added tests of TimeManager<commit_after> | #!/usr/bin/env python
"""Test suite for aospy.utils module."""
import sys
import unittest
import numpy as np
import xarray as xr
from datetime import datetime
from aospy.timedate import TimeManager
class AospyTimeManagerTestCase(unittest.TestCase):
def setUp(self):
# self.tm = TimeManager()
pass
... | TEST Added tests of TimeManager#!/usr/bin/env python
"""Test suite for aospy.utils module."""
import sys
import unittest
import numpy as np
import xarray as xr
from datetime import datetime
from aospy.timedate import TimeManager
class AospyTimeManagerTestCase(unittest.TestCase):
def setUp(self):
# self.t... | <commit_before><commit_msg>TEST Added tests of TimeManager<commit_after>#!/usr/bin/env python
"""Test suite for aospy.utils module."""
import sys
import unittest
import numpy as np
import xarray as xr
from datetime import datetime
from aospy.timedate import TimeManager
class AospyTimeManagerTestCase(unittest.TestCa... | |
ba09a243a37db3ef8b587f92d258a60047a4c2c7 | python/rds_desired_instance_type-triggered.py | python/rds_desired_instance_type-triggered.py | #
# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)
#
# Ensure all RDS DB Instances are of a Given Type
# Description: Checks that all RDS DB instances are of the type specified
#
# Trigger Type: Change Triggered
# Scope of Changes: RDS::DBInstance
# Requir... | Add RDS instance Type Config Rule. | Add RDS instance Type Config Rule.
Requirements: comma separated DBInstance Class named "DBInstance" as Key on Rule parameters. | Python | cc0-1.0 | awslabs/aws-config-rules,awslabs/aws-config-rules,awslabs/aws-config-rules | Add RDS instance Type Config Rule.
Requirements: comma separated DBInstance Class named "DBInstance" as Key on Rule parameters. | #
# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)
#
# Ensure all RDS DB Instances are of a Given Type
# Description: Checks that all RDS DB instances are of the type specified
#
# Trigger Type: Change Triggered
# Scope of Changes: RDS::DBInstance
# Requir... | <commit_before><commit_msg>Add RDS instance Type Config Rule.
Requirements: comma separated DBInstance Class named "DBInstance" as Key on Rule parameters.<commit_after> | #
# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)
#
# Ensure all RDS DB Instances are of a Given Type
# Description: Checks that all RDS DB instances are of the type specified
#
# Trigger Type: Change Triggered
# Scope of Changes: RDS::DBInstance
# Requir... | Add RDS instance Type Config Rule.
Requirements: comma separated DBInstance Class named "DBInstance" as Key on Rule parameters.#
# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)
#
# Ensure all RDS DB Instances are of a Given Type
# Description: Checks tha... | <commit_before><commit_msg>Add RDS instance Type Config Rule.
Requirements: comma separated DBInstance Class named "DBInstance" as Key on Rule parameters.<commit_after>#
# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)
#
# Ensure all RDS DB Instances are ... | |
b463737daffac786354bee8c49bd11dbed3a8064 | examples/arlo-adjustbrightness.py | examples/arlo-adjustbrightness.py | from Arlo import Arlo
USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oAuth token.
arlo = Arlo(USERNAME, PASSWORD)
# At this point ... | Add example script for adjusting live camera feed brightness. | Add example script for adjusting live camera feed brightness.
| Python | apache-2.0 | jeffreydwalter/arlo | Add example script for adjusting live camera feed brightness. | from Arlo import Arlo
USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oAuth token.
arlo = Arlo(USERNAME, PASSWORD)
# At this point ... | <commit_before><commit_msg>Add example script for adjusting live camera feed brightness.<commit_after> | from Arlo import Arlo
USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oAuth token.
arlo = Arlo(USERNAME, PASSWORD)
# At this point ... | Add example script for adjusting live camera feed brightness.from Arlo import Arlo
USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oA... | <commit_before><commit_msg>Add example script for adjusting live camera feed brightness.<commit_after>from Arlo import Arlo
USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent suc... | |
4084fba3d438da4a4133dfafec985d8dd4191a3a | examples/demo/basic/scatter_1d.py | examples/demo/basic/scatter_1d.py | """
Scatter plot with auxilliary 1d plots
Shows a scatter plot of a set of random points,
with auxilliary 1d plots of the data.
"""
# Major library imports
from numpy import sort
from numpy.random import random, randint
# Enthought library imports
from enable.api import Component, ComponentEditor
from traits.api im... | Add example showing 1d scatter plots. | Add example showing 1d scatter plots.
| Python | bsd-3-clause | tommy-u/chaco,tommy-u/chaco,tommy-u/chaco | Add example showing 1d scatter plots. | """
Scatter plot with auxilliary 1d plots
Shows a scatter plot of a set of random points,
with auxilliary 1d plots of the data.
"""
# Major library imports
from numpy import sort
from numpy.random import random, randint
# Enthought library imports
from enable.api import Component, ComponentEditor
from traits.api im... | <commit_before><commit_msg>Add example showing 1d scatter plots.<commit_after> | """
Scatter plot with auxilliary 1d plots
Shows a scatter plot of a set of random points,
with auxilliary 1d plots of the data.
"""
# Major library imports
from numpy import sort
from numpy.random import random, randint
# Enthought library imports
from enable.api import Component, ComponentEditor
from traits.api im... | Add example showing 1d scatter plots."""
Scatter plot with auxilliary 1d plots
Shows a scatter plot of a set of random points,
with auxilliary 1d plots of the data.
"""
# Major library imports
from numpy import sort
from numpy.random import random, randint
# Enthought library imports
from enable.api import Componen... | <commit_before><commit_msg>Add example showing 1d scatter plots.<commit_after>"""
Scatter plot with auxilliary 1d plots
Shows a scatter plot of a set of random points,
with auxilliary 1d plots of the data.
"""
# Major library imports
from numpy import sort
from numpy.random import random, randint
# Enthought librar... | |
4b6a9d9a7aa45271d2f5e001f06a2fde115bf677 | migrations/versions/2d257d93329_remove_booksales_tables.py | migrations/versions/2d257d93329_remove_booksales_tables.py | """Remove booksales tables
Revision ID: 2d257d93329
Revises: 3ee07cd6b53
Create Date: 2016-04-09 13:04:55.562530
"""
# revision identifiers, used by Alembic.
revision = '2d257d93329'
down_revision = '3ee07cd6b53'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
... | Add a migration to remove booksales tables | Add a migration to remove booksales tables
| Python | mit | viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct | Add a migration to remove booksales tables | """Remove booksales tables
Revision ID: 2d257d93329
Revises: 3ee07cd6b53
Create Date: 2016-04-09 13:04:55.562530
"""
# revision identifiers, used by Alembic.
revision = '2d257d93329'
down_revision = '3ee07cd6b53'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
... | <commit_before><commit_msg>Add a migration to remove booksales tables<commit_after> | """Remove booksales tables
Revision ID: 2d257d93329
Revises: 3ee07cd6b53
Create Date: 2016-04-09 13:04:55.562530
"""
# revision identifiers, used by Alembic.
revision = '2d257d93329'
down_revision = '3ee07cd6b53'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
... | Add a migration to remove booksales tables"""Remove booksales tables
Revision ID: 2d257d93329
Revises: 3ee07cd6b53
Create Date: 2016-04-09 13:04:55.562530
"""
# revision identifiers, used by Alembic.
revision = '2d257d93329'
down_revision = '3ee07cd6b53'
from alembic import op
import sqlalchemy as sa
from sqlalchem... | <commit_before><commit_msg>Add a migration to remove booksales tables<commit_after>"""Remove booksales tables
Revision ID: 2d257d93329
Revises: 3ee07cd6b53
Create Date: 2016-04-09 13:04:55.562530
"""
# revision identifiers, used by Alembic.
revision = '2d257d93329'
down_revision = '3ee07cd6b53'
from alembic import ... | |
c0f410237bf97585de1e42a37e54e30775c40d33 | installscanners/installscanners.py | installscanners/installscanners.py |
import subprocess
SCANNER_INSTALLATION_INSTRUCTIONS = {
"safesql":"github.com/stripe/safesql",
"gas":"github.com/GoASTScanner/gas"
}
GO_CMD = "go"
class InstallGOScanners:
'''Install the scanners as ne... | Install scanners that are not installed based on user selection | Install scanners that are not installed based on user selection
| Python | mit | gaurabb/pygosec | Install scanners that are not installed based on user selection |
import subprocess
SCANNER_INSTALLATION_INSTRUCTIONS = {
"safesql":"github.com/stripe/safesql",
"gas":"github.com/GoASTScanner/gas"
}
GO_CMD = "go"
class InstallGOScanners:
'''Install the scanners as ne... | <commit_before><commit_msg>Install scanners that are not installed based on user selection<commit_after> |
import subprocess
SCANNER_INSTALLATION_INSTRUCTIONS = {
"safesql":"github.com/stripe/safesql",
"gas":"github.com/GoASTScanner/gas"
}
GO_CMD = "go"
class InstallGOScanners:
'''Install the scanners as ne... | Install scanners that are not installed based on user selection
import subprocess
SCANNER_INSTALLATION_INSTRUCTIONS = {
"safesql":"github.com/stripe/safesql",
"gas":"github.com/GoASTScanner/gas"
}
GO_CMD = "g... | <commit_before><commit_msg>Install scanners that are not installed based on user selection<commit_after>
import subprocess
SCANNER_INSTALLATION_INSTRUCTIONS = {
"safesql":"github.com/stripe/safesql",
"gas":"github.com/GoASTScanner/gas"
... | |
002c5c2523a1f5da665a58c5b574d743c2b25218 | python/testData/inspections/PyStringFormatInspection/IndexElementWithPackedDictLiteralInsideDictLiteralArg.py | python/testData/inspections/PyStringFormatInspection/IndexElementWithPackedDictLiteralInsideDictLiteralArg.py | # "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}}) | "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}}) | Fix test: uncomment test commented by mistake | Fix test: uncomment test commented by mistake
| Python | apache-2.0 | vvv1559/intellij-community,allotria/intellij-community,semonte/intellij-community,da1z/intellij-community,suncycheng/intellij-community,asedunov/intellij-community,suncycheng/intellij-community,ThiagoGarciaAlves/intellij-community,ThiagoGarciaAlves/intellij-community,apixandru/intellij-community,FHannes/intellij-commun... | # "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}})Fix test: uncomment test commented by mistake | "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}}) | <commit_before># "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}})<commit_msg>Fix test: uncomment test commented by mistake<commit_after> | "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}}) | # "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}})Fix test: uncomment test commented by mistake"{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}}) | <commit_before># "{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"</warning>.format(d={2: a, **{1: b}})<commit_msg>Fix test: uncomment test commented by mistake<commit_after>"{d[1]}".format(d={2: a, **{1: b}})
<warning descr="Too few arguments for format string">"{d[3]}"<... |
d07d19a2d88762d9483dad07a432329759e51e67 | stack/database.py | stack/database.py | from troposphere import (
rds,
Ref,
AWS_STACK_NAME,
)
from .template import template
from .vpc import (
container_a_subnet,
container_b_subnet,
)
db_subnet_group = rds.DBSubnetGroup(
"DatabaseSubnetGroup",
template=template,
DBSubnetGroupDescription="Subnets available for the RDS DB I... | Add a multi AZ PostgreSQL `RDS` instance bound to container subnets | Add a multi AZ PostgreSQL `RDS` instance bound to container subnets
| Python | mit | caktus/aws-web-stacks,tobiasmcnulty/aws-container-basics | Add a multi AZ PostgreSQL `RDS` instance bound to container subnets | from troposphere import (
rds,
Ref,
AWS_STACK_NAME,
)
from .template import template
from .vpc import (
container_a_subnet,
container_b_subnet,
)
db_subnet_group = rds.DBSubnetGroup(
"DatabaseSubnetGroup",
template=template,
DBSubnetGroupDescription="Subnets available for the RDS DB I... | <commit_before><commit_msg>Add a multi AZ PostgreSQL `RDS` instance bound to container subnets<commit_after> | from troposphere import (
rds,
Ref,
AWS_STACK_NAME,
)
from .template import template
from .vpc import (
container_a_subnet,
container_b_subnet,
)
db_subnet_group = rds.DBSubnetGroup(
"DatabaseSubnetGroup",
template=template,
DBSubnetGroupDescription="Subnets available for the RDS DB I... | Add a multi AZ PostgreSQL `RDS` instance bound to container subnetsfrom troposphere import (
rds,
Ref,
AWS_STACK_NAME,
)
from .template import template
from .vpc import (
container_a_subnet,
container_b_subnet,
)
db_subnet_group = rds.DBSubnetGroup(
"DatabaseSubnetGroup",
template=templat... | <commit_before><commit_msg>Add a multi AZ PostgreSQL `RDS` instance bound to container subnets<commit_after>from troposphere import (
rds,
Ref,
AWS_STACK_NAME,
)
from .template import template
from .vpc import (
container_a_subnet,
container_b_subnet,
)
db_subnet_group = rds.DBSubnetGroup(
"D... | |
19cdcd64c2172e4ef5877e2f331b03671091c1e2 | tests/test_connect.py | tests/test_connect.py | import pytest
from pypuppetdb.errors import UnsupportedVersionError
from pypuppetdb import connect
pytestmark = pytest.mark.unit
def test_connect_unknown_api_version():
with pytest.raises(UnsupportedVersionError):
connect(api_version=1)
| Add a basic test for connect(). | tests: Add a basic test for connect().
| Python | apache-2.0 | voxpupuli/pypuppetdb,puppet-community/pypuppetdb,vicinus/pypuppetdb,dforste/pypuppetdb,amwilson/pypuppetdb,jcastillocano/pypuppetdb,jcastillocano/pypuppetdb,jorik041/pypuppetdb | tests: Add a basic test for connect(). | import pytest
from pypuppetdb.errors import UnsupportedVersionError
from pypuppetdb import connect
pytestmark = pytest.mark.unit
def test_connect_unknown_api_version():
with pytest.raises(UnsupportedVersionError):
connect(api_version=1)
| <commit_before><commit_msg>tests: Add a basic test for connect().<commit_after> | import pytest
from pypuppetdb.errors import UnsupportedVersionError
from pypuppetdb import connect
pytestmark = pytest.mark.unit
def test_connect_unknown_api_version():
with pytest.raises(UnsupportedVersionError):
connect(api_version=1)
| tests: Add a basic test for connect().import pytest
from pypuppetdb.errors import UnsupportedVersionError
from pypuppetdb import connect
pytestmark = pytest.mark.unit
def test_connect_unknown_api_version():
with pytest.raises(UnsupportedVersionError):
connect(api_version=1)
| <commit_before><commit_msg>tests: Add a basic test for connect().<commit_after>import pytest
from pypuppetdb.errors import UnsupportedVersionError
from pypuppetdb import connect
pytestmark = pytest.mark.unit
def test_connect_unknown_api_version():
with pytest.raises(UnsupportedVersionError):
connect(api_... | |
3cefb683ee51fb9821a7a47013ca18db5429b4a9 | tests/test_jupyter.py | tests/test_jupyter.py | import mock
import pytest
try:
import ipywidgets
except ImportError:
ipywidgets = None
@pytest.mark.skipif(ipywidgets is None, reason='ipywidgets is not installed')
class TestExperimentWidget(object):
@pytest.fixture
def exp(self):
from dallinger.experiment import Experiment
return Ex... | Add tests for jupyter widget | Add tests for jupyter widget
| Python | mit | Dallinger/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger | Add tests for jupyter widget | import mock
import pytest
try:
import ipywidgets
except ImportError:
ipywidgets = None
@pytest.mark.skipif(ipywidgets is None, reason='ipywidgets is not installed')
class TestExperimentWidget(object):
@pytest.fixture
def exp(self):
from dallinger.experiment import Experiment
return Ex... | <commit_before><commit_msg>Add tests for jupyter widget<commit_after> | import mock
import pytest
try:
import ipywidgets
except ImportError:
ipywidgets = None
@pytest.mark.skipif(ipywidgets is None, reason='ipywidgets is not installed')
class TestExperimentWidget(object):
@pytest.fixture
def exp(self):
from dallinger.experiment import Experiment
return Ex... | Add tests for jupyter widgetimport mock
import pytest
try:
import ipywidgets
except ImportError:
ipywidgets = None
@pytest.mark.skipif(ipywidgets is None, reason='ipywidgets is not installed')
class TestExperimentWidget(object):
@pytest.fixture
def exp(self):
from dallinger.experiment import ... | <commit_before><commit_msg>Add tests for jupyter widget<commit_after>import mock
import pytest
try:
import ipywidgets
except ImportError:
ipywidgets = None
@pytest.mark.skipif(ipywidgets is None, reason='ipywidgets is not installed')
class TestExperimentWidget(object):
@pytest.fixture
def exp(self):
... | |
e6ddd127f906f383fedcdecd9b0eaefb55aba54c | tests/conftest.py | tests/conftest.py | from pytest import Item
def pytest_assertion_pass(item: Item,
lineno: int,
orig: str,
expl: str) -> None:
'''
Log every assertion, in case we later need to audit a run.
Excessive in most cases.
Use with pytest -rP.
'''... | Add optional actual asserted values logging | Add optional actual asserted values logging
| Python | isc | pilona/RPN,pilona/RPN | Add optional actual asserted values logging | from pytest import Item
def pytest_assertion_pass(item: Item,
lineno: int,
orig: str,
expl: str) -> None:
'''
Log every assertion, in case we later need to audit a run.
Excessive in most cases.
Use with pytest -rP.
'''... | <commit_before><commit_msg>Add optional actual asserted values logging<commit_after> | from pytest import Item
def pytest_assertion_pass(item: Item,
lineno: int,
orig: str,
expl: str) -> None:
'''
Log every assertion, in case we later need to audit a run.
Excessive in most cases.
Use with pytest -rP.
'''... | Add optional actual asserted values loggingfrom pytest import Item
def pytest_assertion_pass(item: Item,
lineno: int,
orig: str,
expl: str) -> None:
'''
Log every assertion, in case we later need to audit a run.
Excessive in mo... | <commit_before><commit_msg>Add optional actual asserted values logging<commit_after>from pytest import Item
def pytest_assertion_pass(item: Item,
lineno: int,
orig: str,
expl: str) -> None:
'''
Log every assertion, in case we later ... | |
8458efcd6acec59971271d3b0391732022c66412 | metpy/plots/tests/test_skewt.py | metpy/plots/tests/test_skewt.py | import tempfile
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from metpy.plots.skewt import * # noqa
# TODO: Need at some point to do image-based comparison, but that's a lot to
# bite off right now
class TestSkewT(object):
def test_api(self):... | Add API test for SkewT. | Add API test for SkewT.
This does no checking for the output being correct, but at least checks
that the code doesn't fire an exception on normal use.
| Python | bsd-3-clause | Unidata/MetPy,ahaberlie/MetPy,ahill818/MetPy,dopplershift/MetPy,jrleeman/MetPy,ShawnMurd/MetPy,deeplycloudy/MetPy,dopplershift/MetPy,ahaberlie/MetPy,jrleeman/MetPy,Unidata/MetPy | Add API test for SkewT.
This does no checking for the output being correct, but at least checks
that the code doesn't fire an exception on normal use. | import tempfile
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from metpy.plots.skewt import * # noqa
# TODO: Need at some point to do image-based comparison, but that's a lot to
# bite off right now
class TestSkewT(object):
def test_api(self):... | <commit_before><commit_msg>Add API test for SkewT.
This does no checking for the output being correct, but at least checks
that the code doesn't fire an exception on normal use.<commit_after> | import tempfile
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from metpy.plots.skewt import * # noqa
# TODO: Need at some point to do image-based comparison, but that's a lot to
# bite off right now
class TestSkewT(object):
def test_api(self):... | Add API test for SkewT.
This does no checking for the output being correct, but at least checks
that the code doesn't fire an exception on normal use.import tempfile
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from metpy.plots.skewt import * # no... | <commit_before><commit_msg>Add API test for SkewT.
This does no checking for the output being correct, but at least checks
that the code doesn't fire an exception on normal use.<commit_after>import tempfile
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvas... | |
bfcab239099e2e2ad28dde3cab886e0081664868 | unlock/admin/hello.py | unlock/admin/hello.py | from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/hitmehard")
def ttol():
import pyaudio
import unlock
# yous a do your business here...
return str(dir(unlock))
if __name__ == "__main__":
app.run() | Put together a basic flask for Dante. The start of the admin page. | Put together a basic flask for Dante. The start of the admin page.
| Python | bsd-3-clause | NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock | Put together a basic flask for Dante. The start of the admin page. | from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/hitmehard")
def ttol():
import pyaudio
import unlock
# yous a do your business here...
return str(dir(unlock))
if __name__ == "__main__":
app.run() | <commit_before><commit_msg>Put together a basic flask for Dante. The start of the admin page.<commit_after> | from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/hitmehard")
def ttol():
import pyaudio
import unlock
# yous a do your business here...
return str(dir(unlock))
if __name__ == "__main__":
app.run() | Put together a basic flask for Dante. The start of the admin page.from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/hitmehard")
def ttol():
import pyaudio
import unlock
# yous a do your business here...
return str(dir(unlock))
if __name__ == "__... | <commit_before><commit_msg>Put together a basic flask for Dante. The start of the admin page.<commit_after>from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/hitmehard")
def ttol():
import pyaudio
import unlock
# yous a do your business here...
retur... | |
eccf9607fae71c4fe955f1b71b1090882b6bae82 | sage-equations.py | sage-equations.py | #!/usr/bin/python
#
# Write equations needed to feed into sage in alpha-numeric form
#
# Cahlen Humphreys (2015)
fo = open("anf.txt", "wb")
ptext = "01100010100101110000101011100011"
ctext = "01101000110010010100101001111001"
key = "00110100110111111001011000011100"
ptextl = list(ptext)
ctextl = list(ctext)
keyl = ... | Write equations for sage to convert to CNF | Write equations for sage to convert to CNF | Python | mit | cahlen/keeloq-python | Write equations for sage to convert to CNF | #!/usr/bin/python
#
# Write equations needed to feed into sage in alpha-numeric form
#
# Cahlen Humphreys (2015)
fo = open("anf.txt", "wb")
ptext = "01100010100101110000101011100011"
ctext = "01101000110010010100101001111001"
key = "00110100110111111001011000011100"
ptextl = list(ptext)
ctextl = list(ctext)
keyl = ... | <commit_before><commit_msg>Write equations for sage to convert to CNF<commit_after> | #!/usr/bin/python
#
# Write equations needed to feed into sage in alpha-numeric form
#
# Cahlen Humphreys (2015)
fo = open("anf.txt", "wb")
ptext = "01100010100101110000101011100011"
ctext = "01101000110010010100101001111001"
key = "00110100110111111001011000011100"
ptextl = list(ptext)
ctextl = list(ctext)
keyl = ... | Write equations for sage to convert to CNF#!/usr/bin/python
#
# Write equations needed to feed into sage in alpha-numeric form
#
# Cahlen Humphreys (2015)
fo = open("anf.txt", "wb")
ptext = "01100010100101110000101011100011"
ctext = "01101000110010010100101001111001"
key = "00110100110111111001011000011100"
ptextl ... | <commit_before><commit_msg>Write equations for sage to convert to CNF<commit_after>#!/usr/bin/python
#
# Write equations needed to feed into sage in alpha-numeric form
#
# Cahlen Humphreys (2015)
fo = open("anf.txt", "wb")
ptext = "01100010100101110000101011100011"
ctext = "01101000110010010100101001111001"
key = "0... | |
3e50ff3074f1734db165ad9a601aa8177f97a068 | linkedin_scraper/spiders/search.py | linkedin_scraper/spiders/search.py | import scrapy
class SearchSpider(scrapy.Spider):
name = 'search'
allowed_domains = ['linkedin.com']
start_urls = ['http://linkedin.com/']
def parse(self, response):
pass
| Add SearchSpider generated by `scrapy genspider` command | Add SearchSpider generated by `scrapy genspider` command
| Python | mit | nihn/linkedin-scraper,nihn/linkedin-scraper | Add SearchSpider generated by `scrapy genspider` command | import scrapy
class SearchSpider(scrapy.Spider):
name = 'search'
allowed_domains = ['linkedin.com']
start_urls = ['http://linkedin.com/']
def parse(self, response):
pass
| <commit_before><commit_msg>Add SearchSpider generated by `scrapy genspider` command<commit_after> | import scrapy
class SearchSpider(scrapy.Spider):
name = 'search'
allowed_domains = ['linkedin.com']
start_urls = ['http://linkedin.com/']
def parse(self, response):
pass
| Add SearchSpider generated by `scrapy genspider` commandimport scrapy
class SearchSpider(scrapy.Spider):
name = 'search'
allowed_domains = ['linkedin.com']
start_urls = ['http://linkedin.com/']
def parse(self, response):
pass
| <commit_before><commit_msg>Add SearchSpider generated by `scrapy genspider` command<commit_after>import scrapy
class SearchSpider(scrapy.Spider):
name = 'search'
allowed_domains = ['linkedin.com']
start_urls = ['http://linkedin.com/']
def parse(self, response):
pass
| |
602676fbdde3fc7bdf8203159a96215cc91dc340 | src/ig.py | src/ig.py | from scipy import stats
from math import log2
import numpy as np
def majority_value(binary_targets):
mode = stats.mode(binary_targets)
return tuple(map(lambda x: x[0], mode))
def entropy(binary_targets):
size, _ = binary_targets.shape
_, mode_size = majority_value(binary_targets)
majority_propo... | Implement information gain related functions (untested). | Implement information gain related functions (untested).
| Python | mit | MLNotWar/decision-trees-algorithm,MLNotWar/decision-trees-algorithm | Implement information gain related functions (untested). | from scipy import stats
from math import log2
import numpy as np
def majority_value(binary_targets):
mode = stats.mode(binary_targets)
return tuple(map(lambda x: x[0], mode))
def entropy(binary_targets):
size, _ = binary_targets.shape
_, mode_size = majority_value(binary_targets)
majority_propo... | <commit_before><commit_msg>Implement information gain related functions (untested).<commit_after> | from scipy import stats
from math import log2
import numpy as np
def majority_value(binary_targets):
mode = stats.mode(binary_targets)
return tuple(map(lambda x: x[0], mode))
def entropy(binary_targets):
size, _ = binary_targets.shape
_, mode_size = majority_value(binary_targets)
majority_propo... | Implement information gain related functions (untested).from scipy import stats
from math import log2
import numpy as np
def majority_value(binary_targets):
mode = stats.mode(binary_targets)
return tuple(map(lambda x: x[0], mode))
def entropy(binary_targets):
size, _ = binary_targets.shape
_, mode_s... | <commit_before><commit_msg>Implement information gain related functions (untested).<commit_after>from scipy import stats
from math import log2
import numpy as np
def majority_value(binary_targets):
mode = stats.mode(binary_targets)
return tuple(map(lambda x: x[0], mode))
def entropy(binary_targets):
siz... | |
e5b112169653322eaf6d7e8a7816753f919bf0f9 | skia/PRESUBMIT.py | skia/PRESUBMIT.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for skia/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API... | Add extra bots to the default set of try bots for changes in skia/ | skia: Add extra bots to the default set of try bots for changes in skia/
This adds linux_layout_rel, win_gpu, linux_gpu, mac_gpu, and
mac_gpu_retina to the default set of bots to run on patches that touch
skia/ when doing "git cl try".
This has no effect on the commit queue bot set which is maintained
elsewhere by th... | Python | bsd-3-clause | Jonekee/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,dednal/chromium.src,dednal/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chro... | skia: Add extra bots to the default set of try bots for changes in skia/
This adds linux_layout_rel, win_gpu, linux_gpu, mac_gpu, and
mac_gpu_retina to the default set of bots to run on patches that touch
skia/ when doing "git cl try".
This has no effect on the commit queue bot set which is maintained
elsewhere by th... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for skia/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API... | <commit_before><commit_msg>skia: Add extra bots to the default set of try bots for changes in skia/
This adds linux_layout_rel, win_gpu, linux_gpu, mac_gpu, and
mac_gpu_retina to the default set of bots to run on patches that touch
skia/ when doing "git cl try".
This has no effect on the commit queue bot set which is... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for skia/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API... | skia: Add extra bots to the default set of try bots for changes in skia/
This adds linux_layout_rel, win_gpu, linux_gpu, mac_gpu, and
mac_gpu_retina to the default set of bots to run on patches that touch
skia/ when doing "git cl try".
This has no effect on the commit queue bot set which is maintained
elsewhere by th... | <commit_before><commit_msg>skia: Add extra bots to the default set of try bots for changes in skia/
This adds linux_layout_rel, win_gpu, linux_gpu, mac_gpu, and
mac_gpu_retina to the default set of bots to run on patches that touch
skia/ when doing "git cl try".
This has no effect on the commit queue bot set which is... | |
edf9101eae52ce0a3f87b8f233e3f8ba1dcbbee0 | src/helper_sql.py | src/helper_sql.py | import shared
def sqlQuery(sqlStatement, *args):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(sqlStatement)
if args == ():
shared.sqlSubmitQueue.put('')
else:
shared.sqlSubmitQueue.put(args)
queryreturn = shared.sqlReturnQueue.get()
shared.sqlLock.release()
retu... | Move duplicated sql code into helper | Move duplicated sql code into helper
| Python | mit | Erkan-Yilmaz/PyBitmessage,debguy0x/PyBitmessage,domob1812/PyBitmessage,tigerbunny/bitmessage,hb9kns/PyBitmessage,timothyparez/PyBitmessage,bmng-dev/PyBitmessage,tigerbunny/bitmessage,mailchuck/PyBitmessage,lightrabbit/PyBitmessage,gnu3ra/PyBitmessage,hb9kns/PyBitmessage,xeddmc/PyBitmessage,rzr/PyBitmessage,torifier/PyB... | Move duplicated sql code into helper | import shared
def sqlQuery(sqlStatement, *args):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(sqlStatement)
if args == ():
shared.sqlSubmitQueue.put('')
else:
shared.sqlSubmitQueue.put(args)
queryreturn = shared.sqlReturnQueue.get()
shared.sqlLock.release()
retu... | <commit_before><commit_msg>Move duplicated sql code into helper<commit_after> | import shared
def sqlQuery(sqlStatement, *args):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(sqlStatement)
if args == ():
shared.sqlSubmitQueue.put('')
else:
shared.sqlSubmitQueue.put(args)
queryreturn = shared.sqlReturnQueue.get()
shared.sqlLock.release()
retu... | Move duplicated sql code into helperimport shared
def sqlQuery(sqlStatement, *args):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(sqlStatement)
if args == ():
shared.sqlSubmitQueue.put('')
else:
shared.sqlSubmitQueue.put(args)
queryreturn = shared.sqlReturnQueue.get()
... | <commit_before><commit_msg>Move duplicated sql code into helper<commit_after>import shared
def sqlQuery(sqlStatement, *args):
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put(sqlStatement)
if args == ():
shared.sqlSubmitQueue.put('')
else:
shared.sqlSubmitQueue.put(args)
que... | |
74acd01d0997924944fdf4c9d7833c08b42c7004 | phylogenetics/exttools/taxonomy.py | phylogenetics/exttools/taxonomy.py | """Ping the NCBI Taxonomy web service and retrieve data about a sequence.
Stupidly simple module... probably needs more intelligent/safe parsing of data.
"""
import re
import requests
def query(keyword, type="name", **kwargs):
"""Send a query to retrieve taxonomic data about a set of sequences.
"""
main_u... | Add module for pulling taxonomic data from BLAST | Add module for pulling taxonomic data from BLAST
| Python | unlicense | Zsailer/phylogenetics,Zsailer/phylo_tools_2 | Add module for pulling taxonomic data from BLAST | """Ping the NCBI Taxonomy web service and retrieve data about a sequence.
Stupidly simple module... probably needs more intelligent/safe parsing of data.
"""
import re
import requests
def query(keyword, type="name", **kwargs):
"""Send a query to retrieve taxonomic data about a set of sequences.
"""
main_u... | <commit_before><commit_msg>Add module for pulling taxonomic data from BLAST<commit_after> | """Ping the NCBI Taxonomy web service and retrieve data about a sequence.
Stupidly simple module... probably needs more intelligent/safe parsing of data.
"""
import re
import requests
def query(keyword, type="name", **kwargs):
"""Send a query to retrieve taxonomic data about a set of sequences.
"""
main_u... | Add module for pulling taxonomic data from BLAST"""Ping the NCBI Taxonomy web service and retrieve data about a sequence.
Stupidly simple module... probably needs more intelligent/safe parsing of data.
"""
import re
import requests
def query(keyword, type="name", **kwargs):
"""Send a query to retrieve taxonomic d... | <commit_before><commit_msg>Add module for pulling taxonomic data from BLAST<commit_after>"""Ping the NCBI Taxonomy web service and retrieve data about a sequence.
Stupidly simple module... probably needs more intelligent/safe parsing of data.
"""
import re
import requests
def query(keyword, type="name", **kwargs):
... | |
191e041239378583040596f8fe08b37e95ebd31c | osf/migrations/0117_set_is_root.py | osf/migrations/0117_set_is_root.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-11 18:05
from __future__ import unicode_literals
from django.db import migrations
def set_is_root(state, *args, **kwargs):
OsfStorageFolder = state.get_model('osf', 'osfstoragefolder')
OsfStorageFolder.objects.filter(nodesettings__isnull=False,... | Set is_root=True for old folders set as root_node for existing NodeSettings | Set is_root=True for old folders set as root_node for existing NodeSettings
[#PLAT-578]
| Python | apache-2.0 | mfraezz/osf.io,felliott/osf.io,saradbowman/osf.io,mattclark/osf.io,brianjgeiger/osf.io,pattisdr/osf.io,mattclark/osf.io,felliott/osf.io,HalcyonChimera/osf.io,erinspace/osf.io,Johnetordoff/osf.io,caseyrollins/osf.io,felliott/osf.io,brianjgeiger/osf.io,mfraezz/osf.io,adlius/osf.io,cslzchen/osf.io,caseyrollins/osf.io,bayl... | Set is_root=True for old folders set as root_node for existing NodeSettings
[#PLAT-578] | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-11 18:05
from __future__ import unicode_literals
from django.db import migrations
def set_is_root(state, *args, **kwargs):
OsfStorageFolder = state.get_model('osf', 'osfstoragefolder')
OsfStorageFolder.objects.filter(nodesettings__isnull=False,... | <commit_before><commit_msg>Set is_root=True for old folders set as root_node for existing NodeSettings
[#PLAT-578]<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-11 18:05
from __future__ import unicode_literals
from django.db import migrations
def set_is_root(state, *args, **kwargs):
OsfStorageFolder = state.get_model('osf', 'osfstoragefolder')
OsfStorageFolder.objects.filter(nodesettings__isnull=False,... | Set is_root=True for old folders set as root_node for existing NodeSettings
[#PLAT-578]# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-11 18:05
from __future__ import unicode_literals
from django.db import migrations
def set_is_root(state, *args, **kwargs):
OsfStorageFolder = state.get_model('o... | <commit_before><commit_msg>Set is_root=True for old folders set as root_node for existing NodeSettings
[#PLAT-578]<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-11 18:05
from __future__ import unicode_literals
from django.db import migrations
def set_is_root(state, *args, **kwargs):
... | |
71c47c8374cf6c5f53cdfbb71763f165bcd6c013 | oneflow/base/tests/__init__.py | oneflow/base/tests/__init__.py | # -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TEST_DB)
def con... | # -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TEST_DB)
def con... | Make the test MongoDB database TZ aware like the production one, else some date comparisons fail, whereas they succeed in production. | Make the test MongoDB database TZ aware like the production one, else some date comparisons fail, whereas they succeed in production.
| Python | agpl-3.0 | 1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow | # -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TEST_DB)
def con... | # -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TEST_DB)
def con... | <commit_before># -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TES... | # -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TEST_DB)
def con... | # -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TEST_DB)
def con... | <commit_before># -*- coding: utf-8 -*-
import redis
from mongoengine.connection import connect, disconnect
from django.conf import settings
TEST_REDIS = redis.StrictRedis(host=settings.REDIS_TEST_HOST,
port=settings.REDIS_TEST_PORT,
db=settings.REDIS_TES... |
23c368e149d1cdb49f67a92d020f5eabc8527dd0 | base.py | base.py | import abc
from PyQt5 import QtWidgets
class BaseWidgetView(QtWidgets.QWidget):
__metaclass__ = abc.ABCMeta
def notify(self, kwargs):
u"""
Name based notification with callable() validation
"""
func_name = kwargs.pop('func')
func = getattr(self, func_name)
if no... | Refactor of controllers and views into heritage from abstract classes | Refactor of controllers and views into heritage from abstract classes
| Python | mit | PereBal/advanced-algorithms | Refactor of controllers and views into heritage from abstract classes | import abc
from PyQt5 import QtWidgets
class BaseWidgetView(QtWidgets.QWidget):
__metaclass__ = abc.ABCMeta
def notify(self, kwargs):
u"""
Name based notification with callable() validation
"""
func_name = kwargs.pop('func')
func = getattr(self, func_name)
if no... | <commit_before><commit_msg>Refactor of controllers and views into heritage from abstract classes<commit_after> | import abc
from PyQt5 import QtWidgets
class BaseWidgetView(QtWidgets.QWidget):
__metaclass__ = abc.ABCMeta
def notify(self, kwargs):
u"""
Name based notification with callable() validation
"""
func_name = kwargs.pop('func')
func = getattr(self, func_name)
if no... | Refactor of controllers and views into heritage from abstract classesimport abc
from PyQt5 import QtWidgets
class BaseWidgetView(QtWidgets.QWidget):
__metaclass__ = abc.ABCMeta
def notify(self, kwargs):
u"""
Name based notification with callable() validation
"""
func_name = kwar... | <commit_before><commit_msg>Refactor of controllers and views into heritage from abstract classes<commit_after>import abc
from PyQt5 import QtWidgets
class BaseWidgetView(QtWidgets.QWidget):
__metaclass__ = abc.ABCMeta
def notify(self, kwargs):
u"""
Name based notification with callable() valida... | |
cf5a47dde195152a3f414e20e075694c7bf5e70e | examples/concurrent.py | examples/concurrent.py | try:
import _path
except NameError:
pass
import spyral
import sys
SIZE = (600, 600)
BG_COLOR = (0, 0, 0)
class StupidSprite(spyral.Sprite, spyral.Actor):
def __init__(self, camera):
spyral.Sprite.__init__(self, camera)
spyral.Actor.__init__(self)
self.image = spyral.Im... | Add a simple actor example. | Add a simple actor example.
Signed-off-by: Robert Deaton <[email protected]>
| Python | lgpl-2.1 | platipy/spyral | Add a simple actor example.
Signed-off-by: Robert Deaton <[email protected]> | try:
import _path
except NameError:
pass
import spyral
import sys
SIZE = (600, 600)
BG_COLOR = (0, 0, 0)
class StupidSprite(spyral.Sprite, spyral.Actor):
def __init__(self, camera):
spyral.Sprite.__init__(self, camera)
spyral.Actor.__init__(self)
self.image = spyral.Im... | <commit_before><commit_msg>Add a simple actor example.
Signed-off-by: Robert Deaton <[email protected]><commit_after> | try:
import _path
except NameError:
pass
import spyral
import sys
SIZE = (600, 600)
BG_COLOR = (0, 0, 0)
class StupidSprite(spyral.Sprite, spyral.Actor):
def __init__(self, camera):
spyral.Sprite.__init__(self, camera)
spyral.Actor.__init__(self)
self.image = spyral.Im... | Add a simple actor example.
Signed-off-by: Robert Deaton <[email protected]>try:
import _path
except NameError:
pass
import spyral
import sys
SIZE = (600, 600)
BG_COLOR = (0, 0, 0)
class StupidSprite(spyral.Sprite, spyral.Actor):
def __init__(self, camera):
spy... | <commit_before><commit_msg>Add a simple actor example.
Signed-off-by: Robert Deaton <[email protected]><commit_after>try:
import _path
except NameError:
pass
import spyral
import sys
SIZE = (600, 600)
BG_COLOR = (0, 0, 0)
class StupidSprite(spyral.Sprite, spyral.Actor):
... | |
6c7f0006fd6324c544eda48fb9d7dd1316d39e7a | samples/forms.py | samples/forms.py | import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSymptom,
)
class Ad... | import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSymptom,
)
class Ad... | Change Vaccine was_applied widget to RadioSelect | :rocket: Change Vaccine was_applied widget to RadioSelect
| Python | mit | gems-uff/labsys,gcrsaldanha/fiocruz,gcrsaldanha/fiocruz,gems-uff/labsys,gems-uff/labsys | import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSymptom,
)
class Ad... | import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSymptom,
)
class Ad... | <commit_before>import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSympto... | import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSymptom,
)
class Ad... | import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSymptom,
)
class Ad... | <commit_before>import datetime #for checking renewal date range.
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import (Patient, AdmissionNote, FluVaccine,
CollectionType, CollectedSample,
Symptom, ObservedSympto... |
6523578278f93a549b37ca448d7e5140337c1e8d | contentcuration/contentcuration/migrations/0103_auto_20190905_0408.py | contentcuration/contentcuration/migrations/0103_auto_20190905_0408.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-09-05 04:08
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0102_auto_20190904_1627'),
]
operations = ... | Add migration for le-utils update. | Add migration for le-utils update.
| Python | mit | DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation | Add migration for le-utils update. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-09-05 04:08
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0102_auto_20190904_1627'),
]
operations = ... | <commit_before><commit_msg>Add migration for le-utils update.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-09-05 04:08
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0102_auto_20190904_1627'),
]
operations = ... | Add migration for le-utils update.# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-09-05 04:08
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0102_auto_2019090... | <commit_before><commit_msg>Add migration for le-utils update.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-09-05 04:08
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
... | |
0bd2d9c3bcbb1471208d2d05a6fb50137d6ad89b | sli/config/scripts/index-misses.py | sli/config/scripts/index-misses.py | # use sli
# db.system.profile.drop()
# db.createCollection("system.profile", {capped:true, size:1024000000});
# db.setProfilingLevel(2)
#
# mongodump --db sli --collection system.profile
# bsondump dump/sli/system.profile.bson > system.profile.json
# python index-misses.py system.profile.json
import sys
import json
im... | Add script to analyze mongo profile and determine index misses. | Add script to analyze mongo profile and determine index misses.
| Python | apache-2.0 | inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service | Add script to analyze mongo profile and determine index misses. | # use sli
# db.system.profile.drop()
# db.createCollection("system.profile", {capped:true, size:1024000000});
# db.setProfilingLevel(2)
#
# mongodump --db sli --collection system.profile
# bsondump dump/sli/system.profile.bson > system.profile.json
# python index-misses.py system.profile.json
import sys
import json
im... | <commit_before><commit_msg>Add script to analyze mongo profile and determine index misses.<commit_after> | # use sli
# db.system.profile.drop()
# db.createCollection("system.profile", {capped:true, size:1024000000});
# db.setProfilingLevel(2)
#
# mongodump --db sli --collection system.profile
# bsondump dump/sli/system.profile.bson > system.profile.json
# python index-misses.py system.profile.json
import sys
import json
im... | Add script to analyze mongo profile and determine index misses.# use sli
# db.system.profile.drop()
# db.createCollection("system.profile", {capped:true, size:1024000000});
# db.setProfilingLevel(2)
#
# mongodump --db sli --collection system.profile
# bsondump dump/sli/system.profile.bson > system.profile.json
# python... | <commit_before><commit_msg>Add script to analyze mongo profile and determine index misses.<commit_after># use sli
# db.system.profile.drop()
# db.createCollection("system.profile", {capped:true, size:1024000000});
# db.setProfilingLevel(2)
#
# mongodump --db sli --collection system.profile
# bsondump dump/sli/system.pr... | |
2c83148a2de978382875e6b474c0b3d899a7c5dc | swift/__init__.py | swift/__init__.py | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | Switch trunk to 1.4.3 development | Switch trunk to 1.4.3 development | Python | apache-2.0 | mja054/swift_plugin,clayg/swift,notmyname/swift,clayg/swift,thiagodasilva/swift,Triv90/SwiftUml,aerwin3/swift,nadeemsyed/swift,Khushbu27/Tutorial,nadeemsyed/swift,tsli/test,ceph/swift,notmyname/swift,dpgoetz/swift,revoer/keystone-8.0.0,revoer/keystone-8.0.0,eatbyte/Swift,aerwin3/swift,SUSE/swift,tsli/test,thiagodasilva... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | <commit_before>import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
r... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | <commit_before>import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
r... |
7930fd15a3077764be4b7f1ab7953dba1a97905e | event/example/linkevent.py | event/example/linkevent.py | #! /usr/local/bin/python
import sys
import time
sys.path.append("/usr/testbed/lib")
from tbevent import *
server = "event-server"
port = None
keyfile = "/proj/emulab-ops/exp/one-node/tbdata/eventkey"
# Construct a regular client. Do this only once.
ec = EventClient(server=server, port=port, url=None, keyfile... | Add an example of sending a link event written in python. | Add an example of sending a link event written in python.
| Python | agpl-3.0 | nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome | Add an example of sending a link event written in python. | #! /usr/local/bin/python
import sys
import time
sys.path.append("/usr/testbed/lib")
from tbevent import *
server = "event-server"
port = None
keyfile = "/proj/emulab-ops/exp/one-node/tbdata/eventkey"
# Construct a regular client. Do this only once.
ec = EventClient(server=server, port=port, url=None, keyfile... | <commit_before><commit_msg>Add an example of sending a link event written in python.<commit_after> | #! /usr/local/bin/python
import sys
import time
sys.path.append("/usr/testbed/lib")
from tbevent import *
server = "event-server"
port = None
keyfile = "/proj/emulab-ops/exp/one-node/tbdata/eventkey"
# Construct a regular client. Do this only once.
ec = EventClient(server=server, port=port, url=None, keyfile... | Add an example of sending a link event written in python.#! /usr/local/bin/python
import sys
import time
sys.path.append("/usr/testbed/lib")
from tbevent import *
server = "event-server"
port = None
keyfile = "/proj/emulab-ops/exp/one-node/tbdata/eventkey"
# Construct a regular client. Do this only once.
ec ... | <commit_before><commit_msg>Add an example of sending a link event written in python.<commit_after>#! /usr/local/bin/python
import sys
import time
sys.path.append("/usr/testbed/lib")
from tbevent import *
server = "event-server"
port = None
keyfile = "/proj/emulab-ops/exp/one-node/tbdata/eventkey"
# Construct... | |
90d4128a13029ca56901e901d381d6fadfd376f5 | tools/json2csv.py | tools/json2csv.py | #!/usr/bin/env python
from pathlib import Path
from collections import defaultdict
import json
import numpy as np
import pandas as pd
def get_parser():
"""Build parser object"""
from argparse import ArgumentParser
from argparse import RawTextHelpFormatter
parser = ArgumentParser(description='MRIQ... | Add a script to generate csv files | [ENH] Add a script to generate csv files
First, convert bson to json using mongodb's tool. Second, use this
script to generate csv tables.
| Python | apache-2.0 | poldracklab/mriqcwebapi | [ENH] Add a script to generate csv files
First, convert bson to json using mongodb's tool. Second, use this
script to generate csv tables. | #!/usr/bin/env python
from pathlib import Path
from collections import defaultdict
import json
import numpy as np
import pandas as pd
def get_parser():
"""Build parser object"""
from argparse import ArgumentParser
from argparse import RawTextHelpFormatter
parser = ArgumentParser(description='MRIQ... | <commit_before><commit_msg>[ENH] Add a script to generate csv files
First, convert bson to json using mongodb's tool. Second, use this
script to generate csv tables.<commit_after> | #!/usr/bin/env python
from pathlib import Path
from collections import defaultdict
import json
import numpy as np
import pandas as pd
def get_parser():
"""Build parser object"""
from argparse import ArgumentParser
from argparse import RawTextHelpFormatter
parser = ArgumentParser(description='MRIQ... | [ENH] Add a script to generate csv files
First, convert bson to json using mongodb's tool. Second, use this
script to generate csv tables.#!/usr/bin/env python
from pathlib import Path
from collections import defaultdict
import json
import numpy as np
import pandas as pd
def get_parser():
"""Build parser object"... | <commit_before><commit_msg>[ENH] Add a script to generate csv files
First, convert bson to json using mongodb's tool. Second, use this
script to generate csv tables.<commit_after>#!/usr/bin/env python
from pathlib import Path
from collections import defaultdict
import json
import numpy as np
import pandas as pd
def ... | |
54551601b9b89e41760110dbf6351f94db633f95 | startup/GafferOSL/oslHideShaders.py | startup/GafferOSL/oslHideShaders.py | ##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | Hide deprecated shaders used by old OSLObject | Hide deprecated shaders used by old OSLObject
| Python | bsd-3-clause | hradec/gaffer,hradec/gaffer,GafferHQ/gaffer,appleseedhq/gaffer,johnhaddon/gaffer,boberfly/gaffer,johnhaddon/gaffer,andrewkaufman/gaffer,hradec/gaffer,GafferHQ/gaffer,andrewkaufman/gaffer,lucienfostier/gaffer,ImageEngine/gaffer,appleseedhq/gaffer,lucienfostier/gaffer,hradec/gaffer,lucienfostier/gaffer,andrewkaufman/gaff... | Hide deprecated shaders used by old OSLObject | ##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | <commit_before><commit_msg>Hide deprecated shaders used by old OSLObject<commit_after> | ##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | Hide deprecated shaders used by old OSLObject##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followin... | <commit_before><commit_msg>Hide deprecated shaders used by old OSLObject<commit_after>##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,... | |
ca08020793926adad524ddab6ccb5dee8d3e2cc5 | tw-cover-comp.py | tw-cover-comp.py | #!/usr/bin/env python3
import sys
from PIL import Image
COVER_HEIGHT = 480
BORDER_WIDTH = 10
BACKGROUND_COLOR = (39, 46, 111, 0)
def gather_covers(input_files):
'''Given a list of files, return a list of resized RGB images'''
result = []
for input_file in sys.argv[1:]:
img = Image.open(input_f... | Add script to create cover composite images for Twitter posts | Add script to create cover composite images for Twitter posts
| Python | mit | Backlist/backlist-workflows | Add script to create cover composite images for Twitter posts | #!/usr/bin/env python3
import sys
from PIL import Image
COVER_HEIGHT = 480
BORDER_WIDTH = 10
BACKGROUND_COLOR = (39, 46, 111, 0)
def gather_covers(input_files):
'''Given a list of files, return a list of resized RGB images'''
result = []
for input_file in sys.argv[1:]:
img = Image.open(input_f... | <commit_before><commit_msg>Add script to create cover composite images for Twitter posts<commit_after> | #!/usr/bin/env python3
import sys
from PIL import Image
COVER_HEIGHT = 480
BORDER_WIDTH = 10
BACKGROUND_COLOR = (39, 46, 111, 0)
def gather_covers(input_files):
'''Given a list of files, return a list of resized RGB images'''
result = []
for input_file in sys.argv[1:]:
img = Image.open(input_f... | Add script to create cover composite images for Twitter posts#!/usr/bin/env python3
import sys
from PIL import Image
COVER_HEIGHT = 480
BORDER_WIDTH = 10
BACKGROUND_COLOR = (39, 46, 111, 0)
def gather_covers(input_files):
'''Given a list of files, return a list of resized RGB images'''
result = []
for... | <commit_before><commit_msg>Add script to create cover composite images for Twitter posts<commit_after>#!/usr/bin/env python3
import sys
from PIL import Image
COVER_HEIGHT = 480
BORDER_WIDTH = 10
BACKGROUND_COLOR = (39, 46, 111, 0)
def gather_covers(input_files):
'''Given a list of files, return a list of resiz... | |
082f515391f116728c892389d594521520fe2f1a | firecares/firestation/migrations/0014_auto_20150901_1052.py | firecares/firestation/migrations/0014_auto_20150901_1052.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('firestation', '0013_populationclass0quartile_populationclass1quartile_populationclass2quartile_populationclass3... | Add migration to fix misspelling in verbose name. | Add migration to fix misspelling in verbose name.
| Python | mit | HunterConnelly/firecares,garnertb/firecares,garnertb/firecares,ROGUE-JCTD/vida,meilinger/firecares,ROGUE-JCTD/vida,ROGUE-JCTD/vida,meilinger/firecares,FireCARES/firecares,ROGUE-JCTD/vida,garnertb/firecares,ROGUE-JCTD/vida,HunterConnelly/firecares,HunterConnelly/firecares,FireCARES/firecares,FireCARES/firecares,meilinge... | Add migration to fix misspelling in verbose name. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('firestation', '0013_populationclass0quartile_populationclass1quartile_populationclass2quartile_populationclass3... | <commit_before><commit_msg>Add migration to fix misspelling in verbose name.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('firestation', '0013_populationclass0quartile_populationclass1quartile_populationclass2quartile_populationclass3... | Add migration to fix misspelling in verbose name.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('firestation', '0013_populationclass0quartile_populationclass1q... | <commit_before><commit_msg>Add migration to fix misspelling in verbose name.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('firestation', '0013_p... | |
c35bee6ee578dd2bdd2673887eaac81d4c5c87c0 | jsonmat2h5.py | jsonmat2h5.py | import json
import h5py
import numpy as np
import scipy.io
jdata = json.load(open("flickr8k/dataset.json"))
features_struct = scipy.io.loadmat('flickr8k/vgg_feats.mat')['feats']
h5output = h5py.File("flickr8k.h5", "w")
# The HDF5 file will contain a top-level group for each split
train = h5output.create_group("train... | Convert a JSON dataset file and a MATLAB visual features file into a single H5 file. | Convert a JSON dataset file and a MATLAB visual features file into a single H5 file.
| Python | bsd-3-clause | elliottd/GroundedTranslation,elliottd/GroundedTranslation,elliottd/GroundedTranslation | Convert a JSON dataset file and a MATLAB visual features file into a single H5 file. | import json
import h5py
import numpy as np
import scipy.io
jdata = json.load(open("flickr8k/dataset.json"))
features_struct = scipy.io.loadmat('flickr8k/vgg_feats.mat')['feats']
h5output = h5py.File("flickr8k.h5", "w")
# The HDF5 file will contain a top-level group for each split
train = h5output.create_group("train... | <commit_before><commit_msg>Convert a JSON dataset file and a MATLAB visual features file into a single H5 file.<commit_after> | import json
import h5py
import numpy as np
import scipy.io
jdata = json.load(open("flickr8k/dataset.json"))
features_struct = scipy.io.loadmat('flickr8k/vgg_feats.mat')['feats']
h5output = h5py.File("flickr8k.h5", "w")
# The HDF5 file will contain a top-level group for each split
train = h5output.create_group("train... | Convert a JSON dataset file and a MATLAB visual features file into a single H5 file.import json
import h5py
import numpy as np
import scipy.io
jdata = json.load(open("flickr8k/dataset.json"))
features_struct = scipy.io.loadmat('flickr8k/vgg_feats.mat')['feats']
h5output = h5py.File("flickr8k.h5", "w")
# The HDF5 fil... | <commit_before><commit_msg>Convert a JSON dataset file and a MATLAB visual features file into a single H5 file.<commit_after>import json
import h5py
import numpy as np
import scipy.io
jdata = json.load(open("flickr8k/dataset.json"))
features_struct = scipy.io.loadmat('flickr8k/vgg_feats.mat')['feats']
h5output = h5py... | |
0f174aac0b8fc99e7c7666f4a2958ae048ef62cb | py/maximum-length-of-pair-chain.py | py/maximum-length-of-pair-chain.py | class Solution(object):
def findLongestChain(self, pairs):
"""
:type pairs: List[List[int]]
:rtype: int
"""
pairs.sort()
LIS = []
for p in pairs:
L, U = -1, len(LIS)
while L + 1 < U:
mid = (L + U) / 2
if ... | Add py solution for 646. Maximum Length of Pair Chain | Add py solution for 646. Maximum Length of Pair Chain
646. Maximum Length of Pair Chain: https://leetcode.com/problems/maximum-length-of-pair-chain/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 646. Maximum Length of Pair Chain
646. Maximum Length of Pair Chain: https://leetcode.com/problems/maximum-length-of-pair-chain/ | class Solution(object):
def findLongestChain(self, pairs):
"""
:type pairs: List[List[int]]
:rtype: int
"""
pairs.sort()
LIS = []
for p in pairs:
L, U = -1, len(LIS)
while L + 1 < U:
mid = (L + U) / 2
if ... | <commit_before><commit_msg>Add py solution for 646. Maximum Length of Pair Chain
646. Maximum Length of Pair Chain: https://leetcode.com/problems/maximum-length-of-pair-chain/<commit_after> | class Solution(object):
def findLongestChain(self, pairs):
"""
:type pairs: List[List[int]]
:rtype: int
"""
pairs.sort()
LIS = []
for p in pairs:
L, U = -1, len(LIS)
while L + 1 < U:
mid = (L + U) / 2
if ... | Add py solution for 646. Maximum Length of Pair Chain
646. Maximum Length of Pair Chain: https://leetcode.com/problems/maximum-length-of-pair-chain/class Solution(object):
def findLongestChain(self, pairs):
"""
:type pairs: List[List[int]]
:rtype: int
"""
pairs.sort()
... | <commit_before><commit_msg>Add py solution for 646. Maximum Length of Pair Chain
646. Maximum Length of Pair Chain: https://leetcode.com/problems/maximum-length-of-pair-chain/<commit_after>class Solution(object):
def findLongestChain(self, pairs):
"""
:type pairs: List[List[int]]
:rtype: in... | |
6dd32078aa461488872745bcbc7c43cd3988ed53 | tests/api/benchmark/test_order.py | tests/api/benchmark/test_order.py | import pytest
from tests.api.utils import get_graphql_content
@pytest.mark.django_db
@pytest.mark.count_queries(autouse=False)
def test_user_order_details(user_api_client, order_with_lines, count_queries):
query = """
fragment OrderPrice on TaxedMoney {
gross {
amount
cu... | Add test for order history view | Add test for order history view
| Python | bsd-3-clause | mociepka/saleor,mociepka/saleor,mociepka/saleor | Add test for order history view | import pytest
from tests.api.utils import get_graphql_content
@pytest.mark.django_db
@pytest.mark.count_queries(autouse=False)
def test_user_order_details(user_api_client, order_with_lines, count_queries):
query = """
fragment OrderPrice on TaxedMoney {
gross {
amount
cu... | <commit_before><commit_msg>Add test for order history view<commit_after> | import pytest
from tests.api.utils import get_graphql_content
@pytest.mark.django_db
@pytest.mark.count_queries(autouse=False)
def test_user_order_details(user_api_client, order_with_lines, count_queries):
query = """
fragment OrderPrice on TaxedMoney {
gross {
amount
cu... | Add test for order history viewimport pytest
from tests.api.utils import get_graphql_content
@pytest.mark.django_db
@pytest.mark.count_queries(autouse=False)
def test_user_order_details(user_api_client, order_with_lines, count_queries):
query = """
fragment OrderPrice on TaxedMoney {
gross {
... | <commit_before><commit_msg>Add test for order history view<commit_after>import pytest
from tests.api.utils import get_graphql_content
@pytest.mark.django_db
@pytest.mark.count_queries(autouse=False)
def test_user_order_details(user_api_client, order_with_lines, count_queries):
query = """
fragment OrderP... | |
d009c998007fe3bd4a8d3134499e3fde99513381 | pyimgaug/test2.py | pyimgaug/test2.py | from __future__ import print_function, division
import augmenters2 as iaa
import parameters as iap
#from skimage import
import numpy as np
import time
def main():
seq = iaa.Sequence([iaa.Fliplr(0.5), iaa.Flipud(0.5)])
imgs = np.zeros((1, 2, 2, 1), dtype=np.uint8)
imgs[0, 0, :, 0] = 255
imgs[0, 1, 1, 0]... | Refactor tests for current version | Refactor tests for current version
| Python | mit | aleju/ImageAugmenter,nektor211/imgaug,aleju/imgaug,aleju/imgaug | Refactor tests for current version | from __future__ import print_function, division
import augmenters2 as iaa
import parameters as iap
#from skimage import
import numpy as np
import time
def main():
seq = iaa.Sequence([iaa.Fliplr(0.5), iaa.Flipud(0.5)])
imgs = np.zeros((1, 2, 2, 1), dtype=np.uint8)
imgs[0, 0, :, 0] = 255
imgs[0, 1, 1, 0]... | <commit_before><commit_msg>Refactor tests for current version<commit_after> | from __future__ import print_function, division
import augmenters2 as iaa
import parameters as iap
#from skimage import
import numpy as np
import time
def main():
seq = iaa.Sequence([iaa.Fliplr(0.5), iaa.Flipud(0.5)])
imgs = np.zeros((1, 2, 2, 1), dtype=np.uint8)
imgs[0, 0, :, 0] = 255
imgs[0, 1, 1, 0]... | Refactor tests for current versionfrom __future__ import print_function, division
import augmenters2 as iaa
import parameters as iap
#from skimage import
import numpy as np
import time
def main():
seq = iaa.Sequence([iaa.Fliplr(0.5), iaa.Flipud(0.5)])
imgs = np.zeros((1, 2, 2, 1), dtype=np.uint8)
imgs[0, 0... | <commit_before><commit_msg>Refactor tests for current version<commit_after>from __future__ import print_function, division
import augmenters2 as iaa
import parameters as iap
#from skimage import
import numpy as np
import time
def main():
seq = iaa.Sequence([iaa.Fliplr(0.5), iaa.Flipud(0.5)])
imgs = np.zeros((1... | |
fff7b3bd57fe94d7ac450da89d9a241ddc5c2f06 | ipmi_syncexample.py | ipmi_syncexample.py | #!/usr/bin/env python
from ipmi_command import ipmi_command
import os
import sys
password=os.environ['IPMIPASSWORD']
os.environ['IPMIPASSWORD']=""
if (len(sys.argv) < 3):
print "Usage:"
print " IPMIPASSWORD=password %s bmc username <cmd> <optarg>"%sys.argv[0]
sys.exit(1)
bmc=sys.argv[1]
userid=sys.argv[2]
c... | Add an example chunk of code showing how to code in a synchronous way to the python library | Add an example chunk of code showing how to code in a synchronous way to the python library
| Python | apache-2.0 | stackforge/pyghmi,benoit-canet/pyghmi,openstack/pyghmi,openstack/pyghmi | Add an example chunk of code showing how to code in a synchronous way to the python library | #!/usr/bin/env python
from ipmi_command import ipmi_command
import os
import sys
password=os.environ['IPMIPASSWORD']
os.environ['IPMIPASSWORD']=""
if (len(sys.argv) < 3):
print "Usage:"
print " IPMIPASSWORD=password %s bmc username <cmd> <optarg>"%sys.argv[0]
sys.exit(1)
bmc=sys.argv[1]
userid=sys.argv[2]
c... | <commit_before><commit_msg>Add an example chunk of code showing how to code in a synchronous way to the python library<commit_after> | #!/usr/bin/env python
from ipmi_command import ipmi_command
import os
import sys
password=os.environ['IPMIPASSWORD']
os.environ['IPMIPASSWORD']=""
if (len(sys.argv) < 3):
print "Usage:"
print " IPMIPASSWORD=password %s bmc username <cmd> <optarg>"%sys.argv[0]
sys.exit(1)
bmc=sys.argv[1]
userid=sys.argv[2]
c... | Add an example chunk of code showing how to code in a synchronous way to the python library#!/usr/bin/env python
from ipmi_command import ipmi_command
import os
import sys
password=os.environ['IPMIPASSWORD']
os.environ['IPMIPASSWORD']=""
if (len(sys.argv) < 3):
print "Usage:"
print " IPMIPASSWORD=password %s bm... | <commit_before><commit_msg>Add an example chunk of code showing how to code in a synchronous way to the python library<commit_after>#!/usr/bin/env python
from ipmi_command import ipmi_command
import os
import sys
password=os.environ['IPMIPASSWORD']
os.environ['IPMIPASSWORD']=""
if (len(sys.argv) < 3):
print "Usage:... | |
59da29fac5e232fce0d4bf15704c976175527750 | src/users/migrations/0010_cocrecord.py | src/users/migrations/0010_cocrecord.py | # Generated by Django 3.0.2 on 2020-02-23 12:28
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20160227_1656'),
]
operations = [
mi... | Add migration file for the model of CoC record | Add migration file for the model of CoC record
| Python | mit | pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016 | Add migration file for the model of CoC record | # Generated by Django 3.0.2 on 2020-02-23 12:28
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20160227_1656'),
]
operations = [
mi... | <commit_before><commit_msg>Add migration file for the model of CoC record<commit_after> | # Generated by Django 3.0.2 on 2020-02-23 12:28
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20160227_1656'),
]
operations = [
mi... | Add migration file for the model of CoC record# Generated by Django 3.0.2 on 2020-02-23 12:28
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_2016022... | <commit_before><commit_msg>Add migration file for the model of CoC record<commit_after># Generated by Django 3.0.2 on 2020-02-23 12:28
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies... | |
18327e959a2e6c5cadbe63a7071bba8df478276a | tests/startsymbol_tests/SettingTest.py | tests/startsymbol_tests/SettingTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 10.08.2017 23:00
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
class SettingTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file fot test of start symbol setting | Add file fot test of start symbol setting
| Python | mit | PatrikValkovic/grammpy | Add file fot test of start symbol setting | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 10.08.2017 23:00
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
class SettingTest(TestCase):
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add file fot test of start symbol setting<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 10.08.2017 23:00
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
class SettingTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file fot test of start symbol setting#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 10.08.2017 23:00
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
class SettingTest(TestCase):
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add file fot test of start symbol setting<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 10.08.2017 23:00
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
class SettingTest(TestCase):
pass
if __name__ == '__main__'... | |
f771a1fa3bc7cdaeb2ef5e09d3a01701b166a009 | atoman/filtering/filters/tests/test_species.py | atoman/filtering/filters/tests/test_species.py |
"""
Unit tests for the species filter
"""
import unittest
import numpy as np
from ....system import lattice
from .. import speciesFilter
from .. import base
################################################################################
class TestSpeciesFilter(unittest.TestCase):
"""
Test species filter... | Add test for species filter. | Add test for species filter.
| Python | mit | chrisdjscott/Atoman,chrisdjscott/Atoman,chrisdjscott/Atoman,chrisdjscott/Atoman,chrisdjscott/Atoman | Add test for species filter. |
"""
Unit tests for the species filter
"""
import unittest
import numpy as np
from ....system import lattice
from .. import speciesFilter
from .. import base
################################################################################
class TestSpeciesFilter(unittest.TestCase):
"""
Test species filter... | <commit_before><commit_msg>Add test for species filter.<commit_after> |
"""
Unit tests for the species filter
"""
import unittest
import numpy as np
from ....system import lattice
from .. import speciesFilter
from .. import base
################################################################################
class TestSpeciesFilter(unittest.TestCase):
"""
Test species filter... | Add test for species filter.
"""
Unit tests for the species filter
"""
import unittest
import numpy as np
from ....system import lattice
from .. import speciesFilter
from .. import base
################################################################################
class TestSpeciesFilter(unittest.TestCase):
... | <commit_before><commit_msg>Add test for species filter.<commit_after>
"""
Unit tests for the species filter
"""
import unittest
import numpy as np
from ....system import lattice
from .. import speciesFilter
from .. import base
################################################################################
class ... | |
875ef1e4b07944b9f18d65253d1a7380bb8023e1 | jsonify.py | jsonify.py | """Convert files to json."""
def to_json(file):
"""Convert ini to JSON like thing."""
ini = open(file, 'r')
ini = ini.readlines()
settings_file = open('settings.json', 'w')
settings_file.write("{")
# import pdb; pdb.set_trace()
for line in ini:
if '[' == line[0]:
settin... | Add josnify file. Correct format, needs tweaks | Add josnify file. Correct format, needs tweaks
| Python | mpl-2.0 | flegald/Gameini,flegald/Gameini,flegald/Gameini | Add josnify file. Correct format, needs tweaks | """Convert files to json."""
def to_json(file):
"""Convert ini to JSON like thing."""
ini = open(file, 'r')
ini = ini.readlines()
settings_file = open('settings.json', 'w')
settings_file.write("{")
# import pdb; pdb.set_trace()
for line in ini:
if '[' == line[0]:
settin... | <commit_before><commit_msg>Add josnify file. Correct format, needs tweaks<commit_after> | """Convert files to json."""
def to_json(file):
"""Convert ini to JSON like thing."""
ini = open(file, 'r')
ini = ini.readlines()
settings_file = open('settings.json', 'w')
settings_file.write("{")
# import pdb; pdb.set_trace()
for line in ini:
if '[' == line[0]:
settin... | Add josnify file. Correct format, needs tweaks"""Convert files to json."""
def to_json(file):
"""Convert ini to JSON like thing."""
ini = open(file, 'r')
ini = ini.readlines()
settings_file = open('settings.json', 'w')
settings_file.write("{")
# import pdb; pdb.set_trace()
for line in ini:... | <commit_before><commit_msg>Add josnify file. Correct format, needs tweaks<commit_after>"""Convert files to json."""
def to_json(file):
"""Convert ini to JSON like thing."""
ini = open(file, 'r')
ini = ini.readlines()
settings_file = open('settings.json', 'w')
settings_file.write("{")
# import ... | |
d0a7b697ab1517e071c70d5904f96f85fe12ac89 | mainapp/management/commands/repair-file-index.py | mainapp/management/commands/repair-file-index.py | from typing import Set
from django.core.management.base import BaseCommand
from mainapp.functions.minio import minio_client, minio_file_bucket
from mainapp.models import File
class Command(BaseCommand):
help = "Marks files as missing in the database that are deleted in minio"
def handle(self, *args, **opti... | Add command to repair the file index | Add command to repair the file index
| Python | mit | meine-stadt-transparent/meine-stadt-transparent,meine-stadt-transparent/meine-stadt-transparent,meine-stadt-transparent/meine-stadt-transparent,meine-stadt-transparent/meine-stadt-transparent | Add command to repair the file index | from typing import Set
from django.core.management.base import BaseCommand
from mainapp.functions.minio import minio_client, minio_file_bucket
from mainapp.models import File
class Command(BaseCommand):
help = "Marks files as missing in the database that are deleted in minio"
def handle(self, *args, **opti... | <commit_before><commit_msg>Add command to repair the file index<commit_after> | from typing import Set
from django.core.management.base import BaseCommand
from mainapp.functions.minio import minio_client, minio_file_bucket
from mainapp.models import File
class Command(BaseCommand):
help = "Marks files as missing in the database that are deleted in minio"
def handle(self, *args, **opti... | Add command to repair the file indexfrom typing import Set
from django.core.management.base import BaseCommand
from mainapp.functions.minio import minio_client, minio_file_bucket
from mainapp.models import File
class Command(BaseCommand):
help = "Marks files as missing in the database that are deleted in minio"... | <commit_before><commit_msg>Add command to repair the file index<commit_after>from typing import Set
from django.core.management.base import BaseCommand
from mainapp.functions.minio import minio_client, minio_file_bucket
from mainapp.models import File
class Command(BaseCommand):
help = "Marks files as missing i... | |
e561c1354d2f9a550f2b27bb88d8e4d0f3f76203 | common/djangoapps/student/management/commands/recover_truncated_anonymous_ids.py | common/djangoapps/student/management/commands/recover_truncated_anonymous_ids.py | """
Generate sql commands to fix truncated anonymous student ids in the ORA database
"""
import sys
from django.core.management.base import NoArgsCommand
from student.models import AnonymousUserId, anonymous_id_for_user
class Command(NoArgsCommand):
help = __doc__
def handle_noargs(self, **options):
... | Add managemant command to generate sql to clean up tp truncated student ids in ORA db | Add managemant command to generate sql to clean up tp truncated student ids in ORA db
| Python | agpl-3.0 | openfun/edx-platform,synergeticsedx/deployment-wipro,shashank971/edx-platform,bigdatauniversity/edx-platform,shabab12/edx-platform,philanthropy-u/edx-platform,openfun/edx-platform,motion2015/edx-platform,ubc/edx-platform,jolyonb/edx-platform,cognitiveclass/edx-platform,ferabra/edx-platform,jswope00/griffinx,proversity-... | Add managemant command to generate sql to clean up tp truncated student ids in ORA db | """
Generate sql commands to fix truncated anonymous student ids in the ORA database
"""
import sys
from django.core.management.base import NoArgsCommand
from student.models import AnonymousUserId, anonymous_id_for_user
class Command(NoArgsCommand):
help = __doc__
def handle_noargs(self, **options):
... | <commit_before><commit_msg>Add managemant command to generate sql to clean up tp truncated student ids in ORA db<commit_after> | """
Generate sql commands to fix truncated anonymous student ids in the ORA database
"""
import sys
from django.core.management.base import NoArgsCommand
from student.models import AnonymousUserId, anonymous_id_for_user
class Command(NoArgsCommand):
help = __doc__
def handle_noargs(self, **options):
... | Add managemant command to generate sql to clean up tp truncated student ids in ORA db"""
Generate sql commands to fix truncated anonymous student ids in the ORA database
"""
import sys
from django.core.management.base import NoArgsCommand
from student.models import AnonymousUserId, anonymous_id_for_user
class Comma... | <commit_before><commit_msg>Add managemant command to generate sql to clean up tp truncated student ids in ORA db<commit_after>"""
Generate sql commands to fix truncated anonymous student ids in the ORA database
"""
import sys
from django.core.management.base import NoArgsCommand
from student.models import AnonymousUs... | |
be8b7c89160f4aa8b0415f673629cd80d97a13f0 | robCRSdkt.py | robCRSdkt.py | import numpy as np
def robCRSdkt(robot, pos):
T = np.eye(4)
pos = np.array(pos) / 180.0 * np.pi
for i in range(6):
tz = np.eye(4)
tz[2,3] = robot.d[i]
rz = np.eye(4)
o = -robot.offset[i]
rz[:2, :2] = np.array([[np.cos(o+pos[i]), -np.sin(o+pos[i])],
... | Create direct kinematic function for CRS robot. | Create direct kinematic function for CRS robot.
| Python | mit | petroolg/robo-spline | Create direct kinematic function for CRS robot. | import numpy as np
def robCRSdkt(robot, pos):
T = np.eye(4)
pos = np.array(pos) / 180.0 * np.pi
for i in range(6):
tz = np.eye(4)
tz[2,3] = robot.d[i]
rz = np.eye(4)
o = -robot.offset[i]
rz[:2, :2] = np.array([[np.cos(o+pos[i]), -np.sin(o+pos[i])],
... | <commit_before><commit_msg>Create direct kinematic function for CRS robot.<commit_after> | import numpy as np
def robCRSdkt(robot, pos):
T = np.eye(4)
pos = np.array(pos) / 180.0 * np.pi
for i in range(6):
tz = np.eye(4)
tz[2,3] = robot.d[i]
rz = np.eye(4)
o = -robot.offset[i]
rz[:2, :2] = np.array([[np.cos(o+pos[i]), -np.sin(o+pos[i])],
... | Create direct kinematic function for CRS robot.import numpy as np
def robCRSdkt(robot, pos):
T = np.eye(4)
pos = np.array(pos) / 180.0 * np.pi
for i in range(6):
tz = np.eye(4)
tz[2,3] = robot.d[i]
rz = np.eye(4)
o = -robot.offset[i]
rz[:2, :2] = np.array([[np.cos(o... | <commit_before><commit_msg>Create direct kinematic function for CRS robot.<commit_after>import numpy as np
def robCRSdkt(robot, pos):
T = np.eye(4)
pos = np.array(pos) / 180.0 * np.pi
for i in range(6):
tz = np.eye(4)
tz[2,3] = robot.d[i]
rz = np.eye(4)
o = -robot.offset[i]... | |
3443496bac4b313b1d4603086eb434459a092238 | tools/convertPunchCardToToml.py | tools/convertPunchCardToToml.py | import argparse
def parseDay(weekDay, sunday):
daysOfTheWeek = {'S': 'saturday', 'S2': 'sunday', 'M': 'monday', 'T': 'tuesday',
'W': 'wednesday', 'R': 'thursday', 'F': 'friday'}
splitDay = weekDay.split(',')
if sunday:
day = 'S2'
splitDay.pop(0)
else:
day... | Create tools directory and add convert tool | Create tools directory and add convert tool
| Python | mit | NLSteveO/PunchCard,NLSteveO/PunchCard | Create tools directory and add convert tool | import argparse
def parseDay(weekDay, sunday):
daysOfTheWeek = {'S': 'saturday', 'S2': 'sunday', 'M': 'monday', 'T': 'tuesday',
'W': 'wednesday', 'R': 'thursday', 'F': 'friday'}
splitDay = weekDay.split(',')
if sunday:
day = 'S2'
splitDay.pop(0)
else:
day... | <commit_before><commit_msg>Create tools directory and add convert tool<commit_after> | import argparse
def parseDay(weekDay, sunday):
daysOfTheWeek = {'S': 'saturday', 'S2': 'sunday', 'M': 'monday', 'T': 'tuesday',
'W': 'wednesday', 'R': 'thursday', 'F': 'friday'}
splitDay = weekDay.split(',')
if sunday:
day = 'S2'
splitDay.pop(0)
else:
day... | Create tools directory and add convert toolimport argparse
def parseDay(weekDay, sunday):
daysOfTheWeek = {'S': 'saturday', 'S2': 'sunday', 'M': 'monday', 'T': 'tuesday',
'W': 'wednesday', 'R': 'thursday', 'F': 'friday'}
splitDay = weekDay.split(',')
if sunday:
day = 'S2'
... | <commit_before><commit_msg>Create tools directory and add convert tool<commit_after>import argparse
def parseDay(weekDay, sunday):
daysOfTheWeek = {'S': 'saturday', 'S2': 'sunday', 'M': 'monday', 'T': 'tuesday',
'W': 'wednesday', 'R': 'thursday', 'F': 'friday'}
splitDay = weekDay.split('... | |
5d0738f256339844acfb633e3c4277f6ea17ac30 | cleaning_scripts/remove_leading_slashes_212.py | cleaning_scripts/remove_leading_slashes_212.py | # This software and any associated files are copyright 2010 Brian Carver and
# Michael Lissner.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | Fix script for cases with leading slashes. | Fix script for cases with leading slashes.
| Python | agpl-3.0 | brianwc/courtlistener,wmbutler/courtlistener,Andr3iC/courtlistener,voutilad/courtlistener,brianwc/courtlistener,wmbutler/courtlistener,brianwc/courtlistener,Andr3iC/courtlistener,shashi792/courtlistener,wmbutler/courtlistener,wmbutler/courtlistener,shashi792/courtlistener,wmbutler/courtlistener,voutilad/courtlistener,A... | Fix script for cases with leading slashes. | # This software and any associated files are copyright 2010 Brian Carver and
# Michael Lissner.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | <commit_before><commit_msg>Fix script for cases with leading slashes.<commit_after> | # This software and any associated files are copyright 2010 Brian Carver and
# Michael Lissner.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | Fix script for cases with leading slashes.# This software and any associated files are copyright 2010 Brian Carver and
# Michael Lissner.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation,... | <commit_before><commit_msg>Fix script for cases with leading slashes.<commit_after># This software and any associated files are copyright 2010 Brian Carver and
# Michael Lissner.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as pub... | |
4eeab8ad7c1d4cdbda68222f94b23a62337570c6 | pywikibot/families/commons_family.py | pywikibot/families/commons_family.py | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia.org',
... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia.org',
... | Add Wikidata as shared data repository for Commons. | Add Wikidata as shared data repository for Commons.
Change-Id: Ie79e3157d016fc74e400ddc618c04f2d1d39f17d
| Python | mit | TridevGuha/pywikibot-core,darthbhyrava/pywikibot-local,xZise/pywikibot-core,wikimedia/pywikibot-core,hasteur/g13bot_tools_new,Darkdadaah/pywikibot-core,hasteur/g13bot_tools_new,happy5214/pywikibot-core,magul/pywikibot-core,wikimedia/pywikibot-core,PersianWikipedia/pywikibot-core,npdoty/pywikibot,trishnaguha/pywikibot-c... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia.org',
... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia.org',
... | <commit_before># -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia.org',
... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia.org',
... | <commit_before># -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'commons'
self.langs = {
'commons': 'commons.wikimedia... |
47699ec789c4a8cf47d07a9ea2955bf220c14e69 | tests/test_vector2_substraction.py | tests/test_vector2_substraction.py | import pytest
from ppb_vector import Vector2
def test_substraction_vectors():
test_vector1 = Vector2(0, 1)
test_vector2 = Vector2(0, 1)
result = test_vector1 - test_vector2
assert result == Vector2(0, 0)
def test_substraction_vector_tuple():
test_vector = Vector2(4, 6)
test_tuple = (1, 1)
... | Add vector2 substraction unit tests | Add vector2 substraction unit tests
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | Add vector2 substraction unit tests | import pytest
from ppb_vector import Vector2
def test_substraction_vectors():
test_vector1 = Vector2(0, 1)
test_vector2 = Vector2(0, 1)
result = test_vector1 - test_vector2
assert result == Vector2(0, 0)
def test_substraction_vector_tuple():
test_vector = Vector2(4, 6)
test_tuple = (1, 1)
... | <commit_before><commit_msg>Add vector2 substraction unit tests<commit_after> | import pytest
from ppb_vector import Vector2
def test_substraction_vectors():
test_vector1 = Vector2(0, 1)
test_vector2 = Vector2(0, 1)
result = test_vector1 - test_vector2
assert result == Vector2(0, 0)
def test_substraction_vector_tuple():
test_vector = Vector2(4, 6)
test_tuple = (1, 1)
... | Add vector2 substraction unit testsimport pytest
from ppb_vector import Vector2
def test_substraction_vectors():
test_vector1 = Vector2(0, 1)
test_vector2 = Vector2(0, 1)
result = test_vector1 - test_vector2
assert result == Vector2(0, 0)
def test_substraction_vector_tuple():
test_vector = Vecto... | <commit_before><commit_msg>Add vector2 substraction unit tests<commit_after>import pytest
from ppb_vector import Vector2
def test_substraction_vectors():
test_vector1 = Vector2(0, 1)
test_vector2 = Vector2(0, 1)
result = test_vector1 - test_vector2
assert result == Vector2(0, 0)
def test_substractio... | |
3ec5c0a742054177be525182f42b69d48f837aff | rache/utils.py | rache/utils.py | import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', 'redis://localh... | import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', 'redis://localh... | Support unix sockets in the Redis URL parser. | Support unix sockets in the Redis URL parser.
| Python | bsd-3-clause | brutasse/rache | import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', 'redis://localh... | import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', 'redis://localh... | <commit_before>import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', ... | import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', 'redis://localh... | import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', 'redis://localh... | <commit_before>import os
try:
from urllib import parse
except ImportError:
import urlparse as parse
def parse_redis_url():
config = {
'host': 'localhost',
'port': 6379,
'password': None,
'db': 0,
}
parsed_redis = parse.urlparse(
os.environ.get('REDIS_URL', ... |
cf3b675913e584f0a3dd54fceb6d14ff85bbbad4 | tools/sofa-edr.py | tools/sofa-edr.py | #!/usr/bin/env python3
import subprocess
import time
import argparse
if __name__ == '__main__':
bwa_is_recorded = False
smb_is_recorded = False
htvc_is_recorded = False
parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.')
parser.add_argument('--trac... | Add an event-driven recording tool | Add an event-driven recording tool
| Python | apache-2.0 | cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa | Add an event-driven recording tool | #!/usr/bin/env python3
import subprocess
import time
import argparse
if __name__ == '__main__':
bwa_is_recorded = False
smb_is_recorded = False
htvc_is_recorded = False
parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.')
parser.add_argument('--trac... | <commit_before><commit_msg>Add an event-driven recording tool<commit_after> | #!/usr/bin/env python3
import subprocess
import time
import argparse
if __name__ == '__main__':
bwa_is_recorded = False
smb_is_recorded = False
htvc_is_recorded = False
parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.')
parser.add_argument('--trac... | Add an event-driven recording tool#!/usr/bin/env python3
import subprocess
import time
import argparse
if __name__ == '__main__':
bwa_is_recorded = False
smb_is_recorded = False
htvc_is_recorded = False
parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.... | <commit_before><commit_msg>Add an event-driven recording tool<commit_after>#!/usr/bin/env python3
import subprocess
import time
import argparse
if __name__ == '__main__':
bwa_is_recorded = False
smb_is_recorded = False
htvc_is_recorded = False
parser = argparse.ArgumentParser(description='A SOFA wrapp... | |
7482de022b8876df8d8c49f2cb4586496ec4549e | yatsm/regression/numba_accel.py | yatsm/regression/numba_accel.py | """ Regression related functions optimized using Numba, if available
If Numba is not avaiable, functions are still usable as not JIT'd functions
"""
# @nb.jit()
def rmse(y, yhat):
""" Calculate and return Root Mean Squared Error (RMSE)
Args:
y (np.ndarray): known values
yhat (np.ndarray): pr... | Add faster RMSE via numba | Add faster RMSE via numba
| Python | mit | ceholden/yatsm,c11/yatsm,valpasq/yatsm,c11/yatsm,ceholden/yatsm,valpasq/yatsm | Add faster RMSE via numba | """ Regression related functions optimized using Numba, if available
If Numba is not avaiable, functions are still usable as not JIT'd functions
"""
# @nb.jit()
def rmse(y, yhat):
""" Calculate and return Root Mean Squared Error (RMSE)
Args:
y (np.ndarray): known values
yhat (np.ndarray): pr... | <commit_before><commit_msg>Add faster RMSE via numba<commit_after> | """ Regression related functions optimized using Numba, if available
If Numba is not avaiable, functions are still usable as not JIT'd functions
"""
# @nb.jit()
def rmse(y, yhat):
""" Calculate and return Root Mean Squared Error (RMSE)
Args:
y (np.ndarray): known values
yhat (np.ndarray): pr... | Add faster RMSE via numba""" Regression related functions optimized using Numba, if available
If Numba is not avaiable, functions are still usable as not JIT'd functions
"""
# @nb.jit()
def rmse(y, yhat):
""" Calculate and return Root Mean Squared Error (RMSE)
Args:
y (np.ndarray): known values
... | <commit_before><commit_msg>Add faster RMSE via numba<commit_after>""" Regression related functions optimized using Numba, if available
If Numba is not avaiable, functions are still usable as not JIT'd functions
"""
# @nb.jit()
def rmse(y, yhat):
""" Calculate and return Root Mean Squared Error (RMSE)
Args:
... | |
6cf9f9c83861e7e32f9ce90f2c35b5b73aa7fb10 | manila/db/sqlalchemy/migrate_repo/versions/010_change_project_user_quotas_deleted_column_type.py | manila/db/sqlalchemy/migrate_repo/versions/010_change_project_user_quotas_deleted_column_type.py | # Copyright 2013 Mirantis Inc.
#
# 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 agre... | Change 'deleted' to Boolean in project_user_quotas | Change 'deleted' to Boolean in project_user_quotas
Change-Id: I7604ba4b938d5ff73bcf3b1f9152cc6aa4f1c0c8
Closes-Bug: #1274165
| Python | apache-2.0 | sajuptpm/manila,NetApp/manila,jcsp/manila,scality/manila,jcsp/manila,openstack/manila,NetApp/manila,weiting-chen/manila,weiting-chen/manila,vponomaryov/manila,vponomaryov/manila,bswartz/manila,bswartz/manila,redhat-openstack/manila,openstack/manila,sajuptpm/manila,redhat-openstack/manila,scality/manila | Change 'deleted' to Boolean in project_user_quotas
Change-Id: I7604ba4b938d5ff73bcf3b1f9152cc6aa4f1c0c8
Closes-Bug: #1274165 | # Copyright 2013 Mirantis Inc.
#
# 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 agre... | <commit_before><commit_msg>Change 'deleted' to Boolean in project_user_quotas
Change-Id: I7604ba4b938d5ff73bcf3b1f9152cc6aa4f1c0c8
Closes-Bug: #1274165<commit_after> | # Copyright 2013 Mirantis Inc.
#
# 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 agre... | Change 'deleted' to Boolean in project_user_quotas
Change-Id: I7604ba4b938d5ff73bcf3b1f9152cc6aa4f1c0c8
Closes-Bug: #1274165# Copyright 2013 Mirantis Inc.
#
# 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 c... | <commit_before><commit_msg>Change 'deleted' to Boolean in project_user_quotas
Change-Id: I7604ba4b938d5ff73bcf3b1f9152cc6aa4f1c0c8
Closes-Bug: #1274165<commit_after># Copyright 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance ... | |
99dd76aadea730c2b33fcaa435a0e3b6a0f67567 | IntegrationTestPreprocessingdMRI.py | IntegrationTestPreprocessingdMRI.py | # -*- coding: utf-8 -*-
import unittest
from os.path import expanduser, join, isdir
import numpy as np
from dipy.data.fetcher import fetch_scil_b0, read_siemens_scil_b0
from createBrainMask import createBrainMaskFromb0Data
class IntegrationTestPreprocessingdMRI(unittest.TestCase):
dataDirectory = None
def ... | Test that brain mask has plausible volume | Test that brain mask has plausible volume
| Python | bsd-3-clause | jsjol/GaussianProcessRegressionForDiffusionMRI,jsjol/GaussianProcessRegressionForDiffusionMRI | Test that brain mask has plausible volume | # -*- coding: utf-8 -*-
import unittest
from os.path import expanduser, join, isdir
import numpy as np
from dipy.data.fetcher import fetch_scil_b0, read_siemens_scil_b0
from createBrainMask import createBrainMaskFromb0Data
class IntegrationTestPreprocessingdMRI(unittest.TestCase):
dataDirectory = None
def ... | <commit_before><commit_msg>Test that brain mask has plausible volume<commit_after> | # -*- coding: utf-8 -*-
import unittest
from os.path import expanduser, join, isdir
import numpy as np
from dipy.data.fetcher import fetch_scil_b0, read_siemens_scil_b0
from createBrainMask import createBrainMaskFromb0Data
class IntegrationTestPreprocessingdMRI(unittest.TestCase):
dataDirectory = None
def ... | Test that brain mask has plausible volume# -*- coding: utf-8 -*-
import unittest
from os.path import expanduser, join, isdir
import numpy as np
from dipy.data.fetcher import fetch_scil_b0, read_siemens_scil_b0
from createBrainMask import createBrainMaskFromb0Data
class IntegrationTestPreprocessingdMRI(unittest.Test... | <commit_before><commit_msg>Test that brain mask has plausible volume<commit_after># -*- coding: utf-8 -*-
import unittest
from os.path import expanduser, join, isdir
import numpy as np
from dipy.data.fetcher import fetch_scil_b0, read_siemens_scil_b0
from createBrainMask import createBrainMaskFromb0Data
class Integ... | |
e5a269ab0eaea3052c76764c844233d06a10b422 | IPython/core/tests/test_callbacks.py | IPython/core/tests/test_callbacks.py | import unittest
try: # Python 3.3 +
from unittest.mock import Mock
except ImportError:
from mock import Mock
from IPython.core import callbacks
import IPython.testing.tools as tt
def ping_received():
pass
class CallbackTests(unittest.TestCase):
def setUp(self):
self.cbm = callbacks.CallbackM... | Add tests for callback infrastructure | Add tests for callback infrastructure
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | Add tests for callback infrastructure | import unittest
try: # Python 3.3 +
from unittest.mock import Mock
except ImportError:
from mock import Mock
from IPython.core import callbacks
import IPython.testing.tools as tt
def ping_received():
pass
class CallbackTests(unittest.TestCase):
def setUp(self):
self.cbm = callbacks.CallbackM... | <commit_before><commit_msg>Add tests for callback infrastructure<commit_after> | import unittest
try: # Python 3.3 +
from unittest.mock import Mock
except ImportError:
from mock import Mock
from IPython.core import callbacks
import IPython.testing.tools as tt
def ping_received():
pass
class CallbackTests(unittest.TestCase):
def setUp(self):
self.cbm = callbacks.CallbackM... | Add tests for callback infrastructureimport unittest
try: # Python 3.3 +
from unittest.mock import Mock
except ImportError:
from mock import Mock
from IPython.core import callbacks
import IPython.testing.tools as tt
def ping_received():
pass
class CallbackTests(unittest.TestCase):
def setUp(self):
... | <commit_before><commit_msg>Add tests for callback infrastructure<commit_after>import unittest
try: # Python 3.3 +
from unittest.mock import Mock
except ImportError:
from mock import Mock
from IPython.core import callbacks
import IPython.testing.tools as tt
def ping_received():
pass
class CallbackTests(u... | |
f5849aeb1c811c8f244b2ec1db3750bc8beea441 | bin/isbn_format.py | bin/isbn_format.py | #!/usr/bin/env python
import sys
import os
import yaml
import isbnlib
metafile = sys.argv[1]
metadata = open(metafile, 'r').read()
yamldata = yaml.load(metadata)
identifier = {}
for id in yamldata["identifier"]:
if "key" in id:
isbnlike = isbnlib.get_isbnlike(id["text"])[0]
if isbnlib.is_isbn13(... | Add python scipt for parsing meta data and extracting validated ISBNs | Add python scipt for parsing meta data and extracting validated ISBNs
| Python | agpl-3.0 | alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile | Add python scipt for parsing meta data and extracting validated ISBNs | #!/usr/bin/env python
import sys
import os
import yaml
import isbnlib
metafile = sys.argv[1]
metadata = open(metafile, 'r').read()
yamldata = yaml.load(metadata)
identifier = {}
for id in yamldata["identifier"]:
if "key" in id:
isbnlike = isbnlib.get_isbnlike(id["text"])[0]
if isbnlib.is_isbn13(... | <commit_before><commit_msg>Add python scipt for parsing meta data and extracting validated ISBNs<commit_after> | #!/usr/bin/env python
import sys
import os
import yaml
import isbnlib
metafile = sys.argv[1]
metadata = open(metafile, 'r').read()
yamldata = yaml.load(metadata)
identifier = {}
for id in yamldata["identifier"]:
if "key" in id:
isbnlike = isbnlib.get_isbnlike(id["text"])[0]
if isbnlib.is_isbn13(... | Add python scipt for parsing meta data and extracting validated ISBNs#!/usr/bin/env python
import sys
import os
import yaml
import isbnlib
metafile = sys.argv[1]
metadata = open(metafile, 'r').read()
yamldata = yaml.load(metadata)
identifier = {}
for id in yamldata["identifier"]:
if "key" in id:
isbnlik... | <commit_before><commit_msg>Add python scipt for parsing meta data and extracting validated ISBNs<commit_after>#!/usr/bin/env python
import sys
import os
import yaml
import isbnlib
metafile = sys.argv[1]
metadata = open(metafile, 'r').read()
yamldata = yaml.load(metadata)
identifier = {}
for id in yamldata["identifi... | |
6e425814bf24eb2f7e0d2ba6d3cce109426904f8 | analytics/tests/test_fixtures.py | analytics/tests/test_fixtures.py | from zerver.lib.test_classes import ZulipTestCase
from analytics.lib.counts import CountStat
from analytics.lib.fixtures import generate_time_series_data
# A very light test suite; the code being tested is not run in production.
class TestFixtures(ZulipTestCase):
def test_deterministic_settings(self):
# t... | Add a few tests for fixtures.py. | analytics: Add a few tests for fixtures.py.
The code in fixtures.py is only called from populate_analytics_db, and is
only used for generating pretty fixture data for manual testing. This commit
adds tests for a few things that were easy to add tests for, and provides
some minimal coverage of the file, but is not mean... | Python | apache-2.0 | rishig/zulip,showell/zulip,ryanbackman/zulip,mahim97/zulip,mahim97/zulip,timabbott/zulip,amanharitsh123/zulip,rht/zulip,shubhamdhama/zulip,jackrzhang/zulip,vabs22/zulip,brockwhittaker/zulip,zulip/zulip,punchagan/zulip,tommyip/zulip,vaidap/zulip,brainwane/zulip,timabbott/zulip,punchagan/zulip,andersk/zulip,eeshangarg/zu... | analytics: Add a few tests for fixtures.py.
The code in fixtures.py is only called from populate_analytics_db, and is
only used for generating pretty fixture data for manual testing. This commit
adds tests for a few things that were easy to add tests for, and provides
some minimal coverage of the file, but is not mean... | from zerver.lib.test_classes import ZulipTestCase
from analytics.lib.counts import CountStat
from analytics.lib.fixtures import generate_time_series_data
# A very light test suite; the code being tested is not run in production.
class TestFixtures(ZulipTestCase):
def test_deterministic_settings(self):
# t... | <commit_before><commit_msg>analytics: Add a few tests for fixtures.py.
The code in fixtures.py is only called from populate_analytics_db, and is
only used for generating pretty fixture data for manual testing. This commit
adds tests for a few things that were easy to add tests for, and provides
some minimal coverage o... | from zerver.lib.test_classes import ZulipTestCase
from analytics.lib.counts import CountStat
from analytics.lib.fixtures import generate_time_series_data
# A very light test suite; the code being tested is not run in production.
class TestFixtures(ZulipTestCase):
def test_deterministic_settings(self):
# t... | analytics: Add a few tests for fixtures.py.
The code in fixtures.py is only called from populate_analytics_db, and is
only used for generating pretty fixture data for manual testing. This commit
adds tests for a few things that were easy to add tests for, and provides
some minimal coverage of the file, but is not mean... | <commit_before><commit_msg>analytics: Add a few tests for fixtures.py.
The code in fixtures.py is only called from populate_analytics_db, and is
only used for generating pretty fixture data for manual testing. This commit
adds tests for a few things that were easy to add tests for, and provides
some minimal coverage o... | |
7a97694d14e9ed02ae38ab713267d4c722079c9c | kolibri/core/webpack/test/test_webpack_tags.py | kolibri/core/webpack/test/test_webpack_tags.py | from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from ..hooks import WebpackBundleHook
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
entry_file = "assets/src/kolibri_core_app.js"
class KolibriTagNavigationTestCase(TestCase)... | from __future__ import absolute_import, print_function, unicode_literals
import json
import tempfile
from django.test import TestCase
from ..hooks import WebpackBundleHook
TEST_STATS_FILE = None
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
src_file = "assets/src/kolibri_core_a... | Create a faked hook that does not try to read a live stats file | Create a faked hook that does not try to read a live stats file
| Python | mit | jonboiser/kolibri,jtamiace/kolibri,66eli77/kolibri,66eli77/kolibri,mrpau/kolibri,rtibbles/kolibri,learningequality/kolibri,lyw07/kolibri,jtamiace/kolibri,jtamiace/kolibri,mrpau/kolibri,ralphiee22/kolibri,jayoshih/kolibri,learningequality/kolibri,DXCanas/kolibri,jonboiser/kolibri,benjaoming/kolibri,christianmemije/kolib... | from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from ..hooks import WebpackBundleHook
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
entry_file = "assets/src/kolibri_core_app.js"
class KolibriTagNavigationTestCase(TestCase)... | from __future__ import absolute_import, print_function, unicode_literals
import json
import tempfile
from django.test import TestCase
from ..hooks import WebpackBundleHook
TEST_STATS_FILE = None
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
src_file = "assets/src/kolibri_core_a... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from ..hooks import WebpackBundleHook
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
entry_file = "assets/src/kolibri_core_app.js"
class KolibriTagNavigationTes... | from __future__ import absolute_import, print_function, unicode_literals
import json
import tempfile
from django.test import TestCase
from ..hooks import WebpackBundleHook
TEST_STATS_FILE = None
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
src_file = "assets/src/kolibri_core_a... | from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from ..hooks import WebpackBundleHook
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
entry_file = "assets/src/kolibri_core_app.js"
class KolibriTagNavigationTestCase(TestCase)... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from ..hooks import WebpackBundleHook
class TestHook(WebpackBundleHook):
unique_slug = "non_default_frontend"
entry_file = "assets/src/kolibri_core_app.js"
class KolibriTagNavigationTes... |
a9595cff570efe78228d02c9dd05f7b10ccd30f7 | Python/demos/d11_PostProcessing.py | Python/demos/d11_PostProcessing.py | #%% Demo 11: Postprocessing
#
# This demo demonstrates the available postprocessing tools in TIGRE.by calling the "Measure_Quality.m" function with detailed description.
#
#
#--------------------------------------------------------------------------
#--------------------------------------------------------------------... | Add structure of demo 11 | Add structure of demo 11
| Python | bsd-3-clause | CERN/TIGRE,CERN/TIGRE,CERN/TIGRE,CERN/TIGRE | Add structure of demo 11 | #%% Demo 11: Postprocessing
#
# This demo demonstrates the available postprocessing tools in TIGRE.by calling the "Measure_Quality.m" function with detailed description.
#
#
#--------------------------------------------------------------------------
#--------------------------------------------------------------------... | <commit_before><commit_msg>Add structure of demo 11<commit_after> | #%% Demo 11: Postprocessing
#
# This demo demonstrates the available postprocessing tools in TIGRE.by calling the "Measure_Quality.m" function with detailed description.
#
#
#--------------------------------------------------------------------------
#--------------------------------------------------------------------... | Add structure of demo 11#%% Demo 11: Postprocessing
#
# This demo demonstrates the available postprocessing tools in TIGRE.by calling the "Measure_Quality.m" function with detailed description.
#
#
#--------------------------------------------------------------------------
#--------------------------------------------... | <commit_before><commit_msg>Add structure of demo 11<commit_after>#%% Demo 11: Postprocessing
#
# This demo demonstrates the available postprocessing tools in TIGRE.by calling the "Measure_Quality.m" function with detailed description.
#
#
#--------------------------------------------------------------------------
#---... | |
8d4e705cec2592f9e5f3fa14b8a7ca9610a1f5cc | services/netflix.py | services/netflix.py | import foauth.providers
class Netflix(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'https://www.netflix.com/'
docs_url = 'http://developer.netflix.com/docs'
# URLs to interact with the API
request_token_url = 'http://api.netflix.com/oauth/request_token'
authorize... | Add Netflix back in ... maybe | Add Netflix back in ... maybe
| Python | bsd-3-clause | foauth/foauth.org,foauth/foauth.org,foauth/oauth-proxy,foauth/foauth.org | Add Netflix back in ... maybe | import foauth.providers
class Netflix(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'https://www.netflix.com/'
docs_url = 'http://developer.netflix.com/docs'
# URLs to interact with the API
request_token_url = 'http://api.netflix.com/oauth/request_token'
authorize... | <commit_before><commit_msg>Add Netflix back in ... maybe<commit_after> | import foauth.providers
class Netflix(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'https://www.netflix.com/'
docs_url = 'http://developer.netflix.com/docs'
# URLs to interact with the API
request_token_url = 'http://api.netflix.com/oauth/request_token'
authorize... | Add Netflix back in ... maybeimport foauth.providers
class Netflix(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'https://www.netflix.com/'
docs_url = 'http://developer.netflix.com/docs'
# URLs to interact with the API
request_token_url = 'http://api.netflix.com/oauth... | <commit_before><commit_msg>Add Netflix back in ... maybe<commit_after>import foauth.providers
class Netflix(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'https://www.netflix.com/'
docs_url = 'http://developer.netflix.com/docs'
# URLs to interact with the API
request_... | |
d289f8ef30bf1657c8570252ac2361fade5c43ac | package/dataset.py | package/dataset.py | __author__ = 'luigolas'
from package.image_set import ImageSet
import re
# import numpy as np
# import package.image as image
# import package.evaluator as evaluator
# import itertools
# import cv2
class Dataset():
def __init__(self):
self.id_regex = "P[1-6]_[0-9]{3}"
self.probe = None
s... | Add basic Dataset. No ImgSet nor Preposcessing | Add basic Dataset. No ImgSet nor Preposcessing
| Python | mit | Luigolas/PyReID | Add basic Dataset. No ImgSet nor Preposcessing | __author__ = 'luigolas'
from package.image_set import ImageSet
import re
# import numpy as np
# import package.image as image
# import package.evaluator as evaluator
# import itertools
# import cv2
class Dataset():
def __init__(self):
self.id_regex = "P[1-6]_[0-9]{3}"
self.probe = None
s... | <commit_before><commit_msg>Add basic Dataset. No ImgSet nor Preposcessing<commit_after> | __author__ = 'luigolas'
from package.image_set import ImageSet
import re
# import numpy as np
# import package.image as image
# import package.evaluator as evaluator
# import itertools
# import cv2
class Dataset():
def __init__(self):
self.id_regex = "P[1-6]_[0-9]{3}"
self.probe = None
s... | Add basic Dataset. No ImgSet nor Preposcessing__author__ = 'luigolas'
from package.image_set import ImageSet
import re
# import numpy as np
# import package.image as image
# import package.evaluator as evaluator
# import itertools
# import cv2
class Dataset():
def __init__(self):
self.id_regex = "P[1-6]... | <commit_before><commit_msg>Add basic Dataset. No ImgSet nor Preposcessing<commit_after>__author__ = 'luigolas'
from package.image_set import ImageSet
import re
# import numpy as np
# import package.image as image
# import package.evaluator as evaluator
# import itertools
# import cv2
class Dataset():
def __init... | |
f3c30f2ef57411c466dfed0718873939e6bd3174 | ceph_deploy/tests/parser/test_mon.py | ceph_deploy/tests/parser/test_mon.py | import pytest
from ceph_deploy.cli import get_parser
SUBCMDS_WITH_ARGS = ['add', 'destroy']
SUBCMDS_WITHOUT_ARGS = ['create', 'create-initial']
class TestParserMON(object):
def setup(self):
self.parser = get_parser()
def test_mon_help(self, capsys):
with pytest.raises(SystemExit):
... | Add tests to for mon, mon create-initial | [RM-11742] Add tests to for mon, mon create-initial
Signed-off-by: Travis Rhoden <[email protected]>
| Python | mit | codenrhoden/ceph-deploy,ceph/ceph-deploy,codenrhoden/ceph-deploy,imzhulei/ceph-deploy,branto1/ceph-deploy,SUSE/ceph-deploy,SUSE/ceph-deploy,osynge/ceph-deploy,osynge/ceph-deploy,trhoden/ceph-deploy,zhouyuan/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,branto1/ceph-deploy,ghxandsky/ceph-deploy,ceph/ceph-deploy,isyippee/ce... | [RM-11742] Add tests to for mon, mon create-initial
Signed-off-by: Travis Rhoden <[email protected]> | import pytest
from ceph_deploy.cli import get_parser
SUBCMDS_WITH_ARGS = ['add', 'destroy']
SUBCMDS_WITHOUT_ARGS = ['create', 'create-initial']
class TestParserMON(object):
def setup(self):
self.parser = get_parser()
def test_mon_help(self, capsys):
with pytest.raises(SystemExit):
... | <commit_before><commit_msg>[RM-11742] Add tests to for mon, mon create-initial
Signed-off-by: Travis Rhoden <[email protected]><commit_after> | import pytest
from ceph_deploy.cli import get_parser
SUBCMDS_WITH_ARGS = ['add', 'destroy']
SUBCMDS_WITHOUT_ARGS = ['create', 'create-initial']
class TestParserMON(object):
def setup(self):
self.parser = get_parser()
def test_mon_help(self, capsys):
with pytest.raises(SystemExit):
... | [RM-11742] Add tests to for mon, mon create-initial
Signed-off-by: Travis Rhoden <[email protected]>import pytest
from ceph_deploy.cli import get_parser
SUBCMDS_WITH_ARGS = ['add', 'destroy']
SUBCMDS_WITHOUT_ARGS = ['create', 'create-initial']
class TestParserMON(object):
def... | <commit_before><commit_msg>[RM-11742] Add tests to for mon, mon create-initial
Signed-off-by: Travis Rhoden <[email protected]><commit_after>import pytest
from ceph_deploy.cli import get_parser
SUBCMDS_WITH_ARGS = ['add', 'destroy']
SUBCMDS_WITHOUT_ARGS = ['create', 'create-initial'... | |
95bfc900e0ed45cb8cab6649def194dee2d694e3 | solarnmf_main_ts.py | solarnmf_main_ts.py | #solarnmf_main_ts.py
#Will Barnes
#31 March 2015
#Import needed modules
import solarnmf_functs as snf
import solarnmf_plot_routines as spr
#Read in and format the time series
results = snf.make_t_matrix("data",filename='/home/wtb2/Desktop/gaussian_test.dat')
#Get the dimensions of the T matrix
ny,nx = results['T'].... | Add main function to start needed functions for a time series run | Add main function to start needed functions for a time series run
| Python | mit | wtbarnes/solarnmf | Add main function to start needed functions for a time series run | #solarnmf_main_ts.py
#Will Barnes
#31 March 2015
#Import needed modules
import solarnmf_functs as snf
import solarnmf_plot_routines as spr
#Read in and format the time series
results = snf.make_t_matrix("data",filename='/home/wtb2/Desktop/gaussian_test.dat')
#Get the dimensions of the T matrix
ny,nx = results['T'].... | <commit_before><commit_msg>Add main function to start needed functions for a time series run<commit_after> | #solarnmf_main_ts.py
#Will Barnes
#31 March 2015
#Import needed modules
import solarnmf_functs as snf
import solarnmf_plot_routines as spr
#Read in and format the time series
results = snf.make_t_matrix("data",filename='/home/wtb2/Desktop/gaussian_test.dat')
#Get the dimensions of the T matrix
ny,nx = results['T'].... | Add main function to start needed functions for a time series run#solarnmf_main_ts.py
#Will Barnes
#31 March 2015
#Import needed modules
import solarnmf_functs as snf
import solarnmf_plot_routines as spr
#Read in and format the time series
results = snf.make_t_matrix("data",filename='/home/wtb2/Desktop/gaussian_test... | <commit_before><commit_msg>Add main function to start needed functions for a time series run<commit_after>#solarnmf_main_ts.py
#Will Barnes
#31 March 2015
#Import needed modules
import solarnmf_functs as snf
import solarnmf_plot_routines as spr
#Read in and format the time series
results = snf.make_t_matrix("data",f... | |
ce53f3f7132c5b066d36f5e90d0b6c23c692fe9a | chapter03/maxProductOfTwoNumbers.py | chapter03/maxProductOfTwoNumbers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
fourNumbers = input('Write four numbers separated by commas')
target = []
def multiplyToOthers(index):
results = [4]
for x in range(0,4):
if (index != x):
result = fourNumbers[index] * fourNumbers[x]
results.insert(x, result)
else:
... | Add multiplication between two numbers algorythm. Not optimized. | Add multiplication between two numbers algorythm. Not optimized.
| Python | apache-2.0 | MindCookin/python-exercises | Add multiplication between two numbers algorythm. Not optimized. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
fourNumbers = input('Write four numbers separated by commas')
target = []
def multiplyToOthers(index):
results = [4]
for x in range(0,4):
if (index != x):
result = fourNumbers[index] * fourNumbers[x]
results.insert(x, result)
else:
... | <commit_before><commit_msg>Add multiplication between two numbers algorythm. Not optimized.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
fourNumbers = input('Write four numbers separated by commas')
target = []
def multiplyToOthers(index):
results = [4]
for x in range(0,4):
if (index != x):
result = fourNumbers[index] * fourNumbers[x]
results.insert(x, result)
else:
... | Add multiplication between two numbers algorythm. Not optimized.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
fourNumbers = input('Write four numbers separated by commas')
target = []
def multiplyToOthers(index):
results = [4]
for x in range(0,4):
if (index != x):
result = fourNumbers[ind... | <commit_before><commit_msg>Add multiplication between two numbers algorythm. Not optimized.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
fourNumbers = input('Write four numbers separated by commas')
target = []
def multiplyToOthers(index):
results = [4]
for x in range(0,4):
if (in... | |
d6ce90994b8ec0f8db6802adfdcafeea63c30419 | doc/examples/transform/plot_fundamental_matrix.py | doc/examples/transform/plot_fundamental_matrix.py | """
=============================
Fundamental matrix estimation
=============================
This example demonstrates how to robustly estimate epipolar geometry between two
views using sparse ORB feature correspondences.
The fundamental matrix relates corresponding points between a pair of
uncalibrated images. The ... | Add simple fundamental matrix example | Add simple fundamental matrix example
| Python | bsd-3-clause | paalge/scikit-image,paalge/scikit-image,paalge/scikit-image | Add simple fundamental matrix example | """
=============================
Fundamental matrix estimation
=============================
This example demonstrates how to robustly estimate epipolar geometry between two
views using sparse ORB feature correspondences.
The fundamental matrix relates corresponding points between a pair of
uncalibrated images. The ... | <commit_before><commit_msg>Add simple fundamental matrix example<commit_after> | """
=============================
Fundamental matrix estimation
=============================
This example demonstrates how to robustly estimate epipolar geometry between two
views using sparse ORB feature correspondences.
The fundamental matrix relates corresponding points between a pair of
uncalibrated images. The ... | Add simple fundamental matrix example"""
=============================
Fundamental matrix estimation
=============================
This example demonstrates how to robustly estimate epipolar geometry between two
views using sparse ORB feature correspondences.
The fundamental matrix relates corresponding points betwee... | <commit_before><commit_msg>Add simple fundamental matrix example<commit_after>"""
=============================
Fundamental matrix estimation
=============================
This example demonstrates how to robustly estimate epipolar geometry between two
views using sparse ORB feature correspondences.
The fundamental m... | |
a99cf1ae28cb42f15ed57ed175162fdcfafe0198 | opps/articles/forms.py | opps/articles/forms.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from .models import Post, Album, Link
from redactor.widgets import RedactorEditor
class PostAdminForm(forms.ModelForm):
class Meta:
model = Post
widgets = {'content': RedactorEditor()}
class... | Create articles form (to admin) | Create articles form (to admin)
| Python | mit | jeanmask/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps | Create articles form (to admin) | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from .models import Post, Album, Link
from redactor.widgets import RedactorEditor
class PostAdminForm(forms.ModelForm):
class Meta:
model = Post
widgets = {'content': RedactorEditor()}
class... | <commit_before><commit_msg>Create articles form (to admin)<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from .models import Post, Album, Link
from redactor.widgets import RedactorEditor
class PostAdminForm(forms.ModelForm):
class Meta:
model = Post
widgets = {'content': RedactorEditor()}
class... | Create articles form (to admin)#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from .models import Post, Album, Link
from redactor.widgets import RedactorEditor
class PostAdminForm(forms.ModelForm):
class Meta:
model = Post
widgets = {'cont... | <commit_before><commit_msg>Create articles form (to admin)<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from .models import Post, Album, Link
from redactor.widgets import RedactorEditor
class PostAdminForm(forms.ModelForm):
class Meta:
... | |
1bcc8afc27653b4fb712df5d741ec78c11229bb0 | benchmarks/benchmarks/bench_lib.py | benchmarks/benchmarks/bench_lib.py | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100), (10, 10, 10)... | Add basic benchmarks for numpy.pad | BENCH: Add basic benchmarks for numpy.pad
| Python | bsd-3-clause | WarrenWeckesser/numpy,seberg/numpy,jakirkham/numpy,WarrenWeckesser/numpy,gfyoung/numpy,shoyer/numpy,endolith/numpy,pbrod/numpy,simongibbons/numpy,madphysicist/numpy,mhvk/numpy,abalkin/numpy,Eric89GXL/numpy,mhvk/numpy,jorisvandenbossche/numpy,mhvk/numpy,rgommers/numpy,simongibbons/numpy,mattip/numpy,pizzathief/numpy,gfy... | BENCH: Add basic benchmarks for numpy.pad | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100), (10, 10, 10)... | <commit_before><commit_msg>BENCH: Add basic benchmarks for numpy.pad<commit_after> | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100), (10, 10, 10)... | BENCH: Add basic benchmarks for numpy.pad"""Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
... | <commit_before><commit_msg>BENCH: Add basic benchmarks for numpy.pad<commit_after>"""Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["sha... | |
9151b60566d991e4bf0c9877de608fe88b3763fc | go_optouts/tests/test_server.py | go_optouts/tests/test_server.py | import yaml
from twisted.internet.defer import inlineCallbacks
from twisted.web.server import Site
from vumi.tests.helpers import VumiTestCase
from go_optouts.server import HealthResource, read_yaml_config, ApiSite
from go_optouts.tests.utils import SiteHelper
class TestHealthResource(VumiTestCase):
@inlineCa... | Add tests for server utilities. | Add tests for server utilities.
| Python | bsd-3-clause | praekelt/go-optouts-api,praekelt/go-optouts-api | Add tests for server utilities. | import yaml
from twisted.internet.defer import inlineCallbacks
from twisted.web.server import Site
from vumi.tests.helpers import VumiTestCase
from go_optouts.server import HealthResource, read_yaml_config, ApiSite
from go_optouts.tests.utils import SiteHelper
class TestHealthResource(VumiTestCase):
@inlineCa... | <commit_before><commit_msg>Add tests for server utilities.<commit_after> | import yaml
from twisted.internet.defer import inlineCallbacks
from twisted.web.server import Site
from vumi.tests.helpers import VumiTestCase
from go_optouts.server import HealthResource, read_yaml_config, ApiSite
from go_optouts.tests.utils import SiteHelper
class TestHealthResource(VumiTestCase):
@inlineCa... | Add tests for server utilities.import yaml
from twisted.internet.defer import inlineCallbacks
from twisted.web.server import Site
from vumi.tests.helpers import VumiTestCase
from go_optouts.server import HealthResource, read_yaml_config, ApiSite
from go_optouts.tests.utils import SiteHelper
class TestHealthResourc... | <commit_before><commit_msg>Add tests for server utilities.<commit_after>import yaml
from twisted.internet.defer import inlineCallbacks
from twisted.web.server import Site
from vumi.tests.helpers import VumiTestCase
from go_optouts.server import HealthResource, read_yaml_config, ApiSite
from go_optouts.tests.utils im... | |
f50644484f4b05fbb25adfd6430b6207441d8b2e | src/ggrc_basic_permissions/migrations/versions/20131008124800_8f33d9bd2043_fix_system_roles.py | src/ggrc_basic_permissions/migrations/versions/20131008124800_8f33d9bd2043_fix_system_roles.py | """
Revision ID: 8f33d9bd2043
Revises: 758b4012b5f
Create Date: 2013-09-20 14:12:32.846302
"""
# revision identifiers, used by Alembic.
revision = '8f33d9bd2043'
down_revision = '758b4012b5f'
import json
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from sqlalchemy.sql import table, c... | Add migration to fix system roles | Add migration to fix system roles
* `ObjectEditor` and `Reader` were missing `ProgramDirective`,
`ProgramControl`, and `Person` permissions (CRUD, except `Person`,
which is CRU.
* `ObjectControl` and `ObjectDocument` were combined due to a missing
comma in a previous migration.
| Python | apache-2.0 | hasanalom/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,jmakov/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,hasanalom/ggrc-core,j0gurt/ggrc-core,uskudnik/ggrc-core,uskudnik/ggrc-core,hyperNURb/ggrc-core,jmakov/ggrc-core,prasannav7/ggrc-c... | Add migration to fix system roles
* `ObjectEditor` and `Reader` were missing `ProgramDirective`,
`ProgramControl`, and `Person` permissions (CRUD, except `Person`,
which is CRU.
* `ObjectControl` and `ObjectDocument` were combined due to a missing
comma in a previous migration. | """
Revision ID: 8f33d9bd2043
Revises: 758b4012b5f
Create Date: 2013-09-20 14:12:32.846302
"""
# revision identifiers, used by Alembic.
revision = '8f33d9bd2043'
down_revision = '758b4012b5f'
import json
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from sqlalchemy.sql import table, c... | <commit_before><commit_msg>Add migration to fix system roles
* `ObjectEditor` and `Reader` were missing `ProgramDirective`,
`ProgramControl`, and `Person` permissions (CRUD, except `Person`,
which is CRU.
* `ObjectControl` and `ObjectDocument` were combined due to a missing
comma in a previous migration.<commit_... | """
Revision ID: 8f33d9bd2043
Revises: 758b4012b5f
Create Date: 2013-09-20 14:12:32.846302
"""
# revision identifiers, used by Alembic.
revision = '8f33d9bd2043'
down_revision = '758b4012b5f'
import json
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from sqlalchemy.sql import table, c... | Add migration to fix system roles
* `ObjectEditor` and `Reader` were missing `ProgramDirective`,
`ProgramControl`, and `Person` permissions (CRUD, except `Person`,
which is CRU.
* `ObjectControl` and `ObjectDocument` were combined due to a missing
comma in a previous migration."""
Revision ID: 8f33d9bd2043
Revi... | <commit_before><commit_msg>Add migration to fix system roles
* `ObjectEditor` and `Reader` were missing `ProgramDirective`,
`ProgramControl`, and `Person` permissions (CRUD, except `Person`,
which is CRU.
* `ObjectControl` and `ObjectDocument` were combined due to a missing
comma in a previous migration.<commit_... | |
f6b2e92328d6bc3fc01916ffd6fa872da7afeb4f | barbican/model/migration/alembic_migrations/versions/39a96e67e990_add_missing_constraints.py | barbican/model/migration/alembic_migrations/versions/39a96e67e990_add_missing_constraints.py | """Add missing constraints
Revision ID: 39a96e67e990
Revises: 4ecde3a3a72a
Create Date: 2016-01-26 13:18:06.113621
"""
# revision identifiers, used by Alembic.
revision = '39a96e67e990'
down_revision = '4ecde3a3a72a'
from alembic import op
import sqlalchemy as sa
def upgrade():
# Add missing projects table ke... | Add missing database constraints and defaults | Add missing database constraints and defaults
The project table was missing a constraint on the external_id column.
The secret and container ACLs tables were missing a default value of
True for the project_access column.
Change-Id: I5bd4bc9bca830a37d841434c07a80ce857b676bb
| Python | apache-2.0 | openstack/barbican,openstack/barbican | Add missing database constraints and defaults
The project table was missing a constraint on the external_id column.
The secret and container ACLs tables were missing a default value of
True for the project_access column.
Change-Id: I5bd4bc9bca830a37d841434c07a80ce857b676bb | """Add missing constraints
Revision ID: 39a96e67e990
Revises: 4ecde3a3a72a
Create Date: 2016-01-26 13:18:06.113621
"""
# revision identifiers, used by Alembic.
revision = '39a96e67e990'
down_revision = '4ecde3a3a72a'
from alembic import op
import sqlalchemy as sa
def upgrade():
# Add missing projects table ke... | <commit_before><commit_msg>Add missing database constraints and defaults
The project table was missing a constraint on the external_id column.
The secret and container ACLs tables were missing a default value of
True for the project_access column.
Change-Id: I5bd4bc9bca830a37d841434c07a80ce857b676bb<commit_after> | """Add missing constraints
Revision ID: 39a96e67e990
Revises: 4ecde3a3a72a
Create Date: 2016-01-26 13:18:06.113621
"""
# revision identifiers, used by Alembic.
revision = '39a96e67e990'
down_revision = '4ecde3a3a72a'
from alembic import op
import sqlalchemy as sa
def upgrade():
# Add missing projects table ke... | Add missing database constraints and defaults
The project table was missing a constraint on the external_id column.
The secret and container ACLs tables were missing a default value of
True for the project_access column.
Change-Id: I5bd4bc9bca830a37d841434c07a80ce857b676bb"""Add missing constraints
Revision ID: 39a9... | <commit_before><commit_msg>Add missing database constraints and defaults
The project table was missing a constraint on the external_id column.
The secret and container ACLs tables were missing a default value of
True for the project_access column.
Change-Id: I5bd4bc9bca830a37d841434c07a80ce857b676bb<commit_after>"""A... | |
35f7331a7086fe1598667ca4907feb7caca975a4 | py/arranging-coins.py | py/arranging-coins.py | class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
return int((-1 + int((1 + 8 * n + .5) ** .5)) / 2)
| Add py solution for 441. Arranging Coins | Add py solution for 441. Arranging Coins
441. Arranging Coins: https://leetcode.com/problems/arranging-coins/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 441. Arranging Coins
441. Arranging Coins: https://leetcode.com/problems/arranging-coins/ | class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
return int((-1 + int((1 + 8 * n + .5) ** .5)) / 2)
| <commit_before><commit_msg>Add py solution for 441. Arranging Coins
441. Arranging Coins: https://leetcode.com/problems/arranging-coins/<commit_after> | class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
return int((-1 + int((1 + 8 * n + .5) ** .5)) / 2)
| Add py solution for 441. Arranging Coins
441. Arranging Coins: https://leetcode.com/problems/arranging-coins/class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
return int((-1 + int((1 + 8 * n + .5) ** .5)) / 2)
| <commit_before><commit_msg>Add py solution for 441. Arranging Coins
441. Arranging Coins: https://leetcode.com/problems/arranging-coins/<commit_after>class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
return int((-1 + int((1 + 8 * n + .5) ** ... | |
45e78bd7cbfa93a96255df9b5144ce25a609eb9b | py/shopping-offers.py | py/shopping-offers.py | from collections import Counter
from operator import mul
class Solution(object):
def shoppingOffers(self, price, special, needs):
"""
:type price: List[int]
:type special: List[List[int]]
:type needs: List[int]
:rtype: int
"""
c = Counter()
c[tuple(nee... | Add py solution for 638. Shopping Offers | Add py solution for 638. Shopping Offers
638. Shopping Offers: https://leetcode.com/problems/shopping-offers/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 638. Shopping Offers
638. Shopping Offers: https://leetcode.com/problems/shopping-offers/ | from collections import Counter
from operator import mul
class Solution(object):
def shoppingOffers(self, price, special, needs):
"""
:type price: List[int]
:type special: List[List[int]]
:type needs: List[int]
:rtype: int
"""
c = Counter()
c[tuple(nee... | <commit_before><commit_msg>Add py solution for 638. Shopping Offers
638. Shopping Offers: https://leetcode.com/problems/shopping-offers/<commit_after> | from collections import Counter
from operator import mul
class Solution(object):
def shoppingOffers(self, price, special, needs):
"""
:type price: List[int]
:type special: List[List[int]]
:type needs: List[int]
:rtype: int
"""
c = Counter()
c[tuple(nee... | Add py solution for 638. Shopping Offers
638. Shopping Offers: https://leetcode.com/problems/shopping-offers/from collections import Counter
from operator import mul
class Solution(object):
def shoppingOffers(self, price, special, needs):
"""
:type price: List[int]
:type special: List[List[... | <commit_before><commit_msg>Add py solution for 638. Shopping Offers
638. Shopping Offers: https://leetcode.com/problems/shopping-offers/<commit_after>from collections import Counter
from operator import mul
class Solution(object):
def shoppingOffers(self, price, special, needs):
"""
:type price: Li... | |
a642619fa9b8b0ef7bb7dd66ecacf2d175494acd | tests/unit/returners/test_pgjsonb.py | tests/unit/returners/test_pgjsonb.py | # -*- coding: utf-8 -*-
'''
tests.unit.returners.pgjsonb_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the PGJsonb returner (pgjsonb).
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Testing libs
from tests.support.mixins impo... | Rename test pgjsonb returner test file to match naming convention | Rename test pgjsonb returner test file to match naming convention
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Rename test pgjsonb returner test file to match naming convention | # -*- coding: utf-8 -*-
'''
tests.unit.returners.pgjsonb_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the PGJsonb returner (pgjsonb).
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Testing libs
from tests.support.mixins impo... | <commit_before><commit_msg>Rename test pgjsonb returner test file to match naming convention<commit_after> | # -*- coding: utf-8 -*-
'''
tests.unit.returners.pgjsonb_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the PGJsonb returner (pgjsonb).
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Testing libs
from tests.support.mixins impo... | Rename test pgjsonb returner test file to match naming convention# -*- coding: utf-8 -*-
'''
tests.unit.returners.pgjsonb_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the PGJsonb returner (pgjsonb).
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import l... | <commit_before><commit_msg>Rename test pgjsonb returner test file to match naming convention<commit_after># -*- coding: utf-8 -*-
'''
tests.unit.returners.pgjsonb_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the PGJsonb returner (pgjsonb).
'''
# Import Python libs
from __future__ import absolute_import, ... | |
1c01ff6e4510abcb7a69fe61e1a5b8ef17818529 | demo/chaco_demo.py | demo/chaco_demo.py | # Copyright (c) 2015, Warren Weckesser. All rights reserved.
# This software is licensed according to the "BSD 2-clause" license.
#
# Use chaco to display the eye diagram computed by eyediagram.grid_count.
import numpy as np
# ETS imports...
from traits.api import HasTraits, Instance
from traitsui.api import Item, G... | Add a demo that uses chaco to plot the eye diagram. | ENH: Add a demo that uses chaco to plot the eye diagram.
| Python | bsd-2-clause | WarrenWeckesser/eyediagram | ENH: Add a demo that uses chaco to plot the eye diagram. | # Copyright (c) 2015, Warren Weckesser. All rights reserved.
# This software is licensed according to the "BSD 2-clause" license.
#
# Use chaco to display the eye diagram computed by eyediagram.grid_count.
import numpy as np
# ETS imports...
from traits.api import HasTraits, Instance
from traitsui.api import Item, G... | <commit_before><commit_msg>ENH: Add a demo that uses chaco to plot the eye diagram.<commit_after> | # Copyright (c) 2015, Warren Weckesser. All rights reserved.
# This software is licensed according to the "BSD 2-clause" license.
#
# Use chaco to display the eye diagram computed by eyediagram.grid_count.
import numpy as np
# ETS imports...
from traits.api import HasTraits, Instance
from traitsui.api import Item, G... | ENH: Add a demo that uses chaco to plot the eye diagram.# Copyright (c) 2015, Warren Weckesser. All rights reserved.
# This software is licensed according to the "BSD 2-clause" license.
#
# Use chaco to display the eye diagram computed by eyediagram.grid_count.
import numpy as np
# ETS imports...
from traits.api imp... | <commit_before><commit_msg>ENH: Add a demo that uses chaco to plot the eye diagram.<commit_after># Copyright (c) 2015, Warren Weckesser. All rights reserved.
# This software is licensed according to the "BSD 2-clause" license.
#
# Use chaco to display the eye diagram computed by eyediagram.grid_count.
import numpy as... | |
9b836c695ca6ab64031bdd3f55f42ee9fc7bbb20 | tests/curious_tests/test_api_batch.py | tests/curious_tests/test_api_batch.py | import json
from django.test import TestCase
from django.db import connection
from curious import model_registry
from curious_tests.models import Blog, Entry
import curious_tests.models
class TestBatchFetch(TestCase):
N = 20
def setUp(self):
blog = Blog(name='Databases')
blog.save()
self.blog = blog
... | Add test for batch fetch object API | Add test for batch fetch object API
| Python | mit | ginkgobioworks/curious,benjiec/curious,ginkgobioworks/curious,benjiec/curious,benjiec/curious,ginkgobioworks/curious | Add test for batch fetch object API | import json
from django.test import TestCase
from django.db import connection
from curious import model_registry
from curious_tests.models import Blog, Entry
import curious_tests.models
class TestBatchFetch(TestCase):
N = 20
def setUp(self):
blog = Blog(name='Databases')
blog.save()
self.blog = blog
... | <commit_before><commit_msg>Add test for batch fetch object API<commit_after> | import json
from django.test import TestCase
from django.db import connection
from curious import model_registry
from curious_tests.models import Blog, Entry
import curious_tests.models
class TestBatchFetch(TestCase):
N = 20
def setUp(self):
blog = Blog(name='Databases')
blog.save()
self.blog = blog
... | Add test for batch fetch object APIimport json
from django.test import TestCase
from django.db import connection
from curious import model_registry
from curious_tests.models import Blog, Entry
import curious_tests.models
class TestBatchFetch(TestCase):
N = 20
def setUp(self):
blog = Blog(name='Databases')
... | <commit_before><commit_msg>Add test for batch fetch object API<commit_after>import json
from django.test import TestCase
from django.db import connection
from curious import model_registry
from curious_tests.models import Blog, Entry
import curious_tests.models
class TestBatchFetch(TestCase):
N = 20
def setUp(sel... | |
480fda37fd552a756a4a0feaf061cc0794e33e65 | list.py | list.py | #!/usr/bin/python
import os
import json
import pprint
DATA_DIR = "data"
def load():
contents = {}
for filename in os.listdir(DATA_DIR):
if filename.startswith("."): continue
path = os.path.join(DATA_DIR, filename)
content = {}
for line in file(path).readlines():
... | Load analyzed mod content .csvs as json | Load analyzed mod content .csvs as json
| Python | bsd-3-clause | agaricusb/ModAnalyzer,agaricusb/ModAnalyzer | Load analyzed mod content .csvs as json | #!/usr/bin/python
import os
import json
import pprint
DATA_DIR = "data"
def load():
contents = {}
for filename in os.listdir(DATA_DIR):
if filename.startswith("."): continue
path = os.path.join(DATA_DIR, filename)
content = {}
for line in file(path).readlines():
... | <commit_before><commit_msg>Load analyzed mod content .csvs as json<commit_after> | #!/usr/bin/python
import os
import json
import pprint
DATA_DIR = "data"
def load():
contents = {}
for filename in os.listdir(DATA_DIR):
if filename.startswith("."): continue
path = os.path.join(DATA_DIR, filename)
content = {}
for line in file(path).readlines():
... | Load analyzed mod content .csvs as json#!/usr/bin/python
import os
import json
import pprint
DATA_DIR = "data"
def load():
contents = {}
for filename in os.listdir(DATA_DIR):
if filename.startswith("."): continue
path = os.path.join(DATA_DIR, filename)
content = {}
for line ... | <commit_before><commit_msg>Load analyzed mod content .csvs as json<commit_after>#!/usr/bin/python
import os
import json
import pprint
DATA_DIR = "data"
def load():
contents = {}
for filename in os.listdir(DATA_DIR):
if filename.startswith("."): continue
path = os.path.join(DATA_DIR, filename... | |
6e9fada3539abca49579340e20b06fc19554e2a6 | sc2reader/__init__.py | sc2reader/__init__.py | from __future__ import absolute_import
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defaultSC2Reader = factories.SC2Factory()
register_datapack = __defaultSC2Reader.re... | from __future__ import absolute_import
# import submodules
from sc2reader import listeners, data, scripts, processors
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defa... | Add explicit submodule imports to resolve certain runtime import issues. | Add explicit submodule imports to resolve certain runtime import issues.
| Python | mit | GraylinKim/sc2reader,vlaufer/sc2reader,ggtracker/sc2reader,GraylinKim/sc2reader,StoicLoofah/sc2reader,ggtracker/sc2reader,StoicLoofah/sc2reader,vlaufer/sc2reader | from __future__ import absolute_import
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defaultSC2Reader = factories.SC2Factory()
register_datapack = __defaultSC2Reader.re... | from __future__ import absolute_import
# import submodules
from sc2reader import listeners, data, scripts, processors
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defa... | <commit_before>from __future__ import absolute_import
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defaultSC2Reader = factories.SC2Factory()
register_datapack = __defa... | from __future__ import absolute_import
# import submodules
from sc2reader import listeners, data, scripts, processors
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defa... | from __future__ import absolute_import
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defaultSC2Reader = factories.SC2Factory()
register_datapack = __defaultSC2Reader.re... | <commit_before>from __future__ import absolute_import
from sc2reader import factories, log_utils
# setup the library logging
log_utils.setup()
# For backwards compatibility
SC2Reader = factories.SC2Factory
# Expose a nice module level interface
__defaultSC2Reader = factories.SC2Factory()
register_datapack = __defa... |
02197b1fcaafb3bec1437a093b1c4170c82b55de | scripts/vac-load.py | scripts/vac-load.py | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import translate
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: vac-load.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('Load V... | Load Wright fiction JSON format. | Load Wright fiction JSON format.
| Python | apache-2.0 | ViralTexts/vt-passim,ViralTexts/vt-passim,ViralTexts/vt-passim | Load Wright fiction JSON format. | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import translate
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: vac-load.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('Load V... | <commit_before><commit_msg>Load Wright fiction JSON format.<commit_after> | from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import translate
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: vac-load.py <input> <output>", file=sys.stderr)
exit(-1)
spark = SparkSession.builder.appName('Load V... | Load Wright fiction JSON format.from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import translate
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: vac-load.py <input> <output>", file=sys.stderr)
exit(-1)
spark = Spar... | <commit_before><commit_msg>Load Wright fiction JSON format.<commit_after>from __future__ import print_function
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import translate
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: vac-load.py <input> <output>", file=sys.... | |
2ae585068ea0ba0501e28c27c56bf45359459540 | py/remove-boxes.py | py/remove-boxes.py | from collections import defaultdict, Counter
from itertools import groupby
class Solution(object):
def removeBoxes(self, boxes):
"""
:type boxes: List[int]
:rtype: int
"""
table = defaultdict(Counter)
table_max = Counter()
B = []
for k, l in groupby(bo... | Add py solution for 546. Remove Boxes | Add py solution for 546. Remove Boxes
546. Remove Boxes: https://leetcode.com/problems/remove-boxes/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 546. Remove Boxes
546. Remove Boxes: https://leetcode.com/problems/remove-boxes/ | from collections import defaultdict, Counter
from itertools import groupby
class Solution(object):
def removeBoxes(self, boxes):
"""
:type boxes: List[int]
:rtype: int
"""
table = defaultdict(Counter)
table_max = Counter()
B = []
for k, l in groupby(bo... | <commit_before><commit_msg>Add py solution for 546. Remove Boxes
546. Remove Boxes: https://leetcode.com/problems/remove-boxes/<commit_after> | from collections import defaultdict, Counter
from itertools import groupby
class Solution(object):
def removeBoxes(self, boxes):
"""
:type boxes: List[int]
:rtype: int
"""
table = defaultdict(Counter)
table_max = Counter()
B = []
for k, l in groupby(bo... | Add py solution for 546. Remove Boxes
546. Remove Boxes: https://leetcode.com/problems/remove-boxes/from collections import defaultdict, Counter
from itertools import groupby
class Solution(object):
def removeBoxes(self, boxes):
"""
:type boxes: List[int]
:rtype: int
"""
tab... | <commit_before><commit_msg>Add py solution for 546. Remove Boxes
546. Remove Boxes: https://leetcode.com/problems/remove-boxes/<commit_after>from collections import defaultdict, Counter
from itertools import groupby
class Solution(object):
def removeBoxes(self, boxes):
"""
:type boxes: List[int]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.