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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ff1ed506bba57de35424362a1661cac5236b2f4b | tools/add_model.py | tools/add_model.py | #! /usr/bin/env python
import os
import sys
import json
import clstm
import shutil
from kraken.lib.models import load_clstm
rnn = load_clstm(sys.argv[1])
alphabet = []
cls = clstm.Classes()
cls.resize(1)
for i in range(1, rnn.rnn.noutput()):
cls[0] = i
alphabet.append(rnn.rnn.decode(cls))
s = {}
s['summary... | Add simple tools for creating metadata | Add simple tools for creating metadata
| Python | apache-2.0 | mittagessen/kraken-models | Add simple tools for creating metadata | #! /usr/bin/env python
import os
import sys
import json
import clstm
import shutil
from kraken.lib.models import load_clstm
rnn = load_clstm(sys.argv[1])
alphabet = []
cls = clstm.Classes()
cls.resize(1)
for i in range(1, rnn.rnn.noutput()):
cls[0] = i
alphabet.append(rnn.rnn.decode(cls))
s = {}
s['summary... | <commit_before><commit_msg>Add simple tools for creating metadata<commit_after> | #! /usr/bin/env python
import os
import sys
import json
import clstm
import shutil
from kraken.lib.models import load_clstm
rnn = load_clstm(sys.argv[1])
alphabet = []
cls = clstm.Classes()
cls.resize(1)
for i in range(1, rnn.rnn.noutput()):
cls[0] = i
alphabet.append(rnn.rnn.decode(cls))
s = {}
s['summary... | Add simple tools for creating metadata#! /usr/bin/env python
import os
import sys
import json
import clstm
import shutil
from kraken.lib.models import load_clstm
rnn = load_clstm(sys.argv[1])
alphabet = []
cls = clstm.Classes()
cls.resize(1)
for i in range(1, rnn.rnn.noutput()):
cls[0] = i
alphabet.append(r... | <commit_before><commit_msg>Add simple tools for creating metadata<commit_after>#! /usr/bin/env python
import os
import sys
import json
import clstm
import shutil
from kraken.lib.models import load_clstm
rnn = load_clstm(sys.argv[1])
alphabet = []
cls = clstm.Classes()
cls.resize(1)
for i in range(1, rnn.rnn.noutput... | |
0eb5f0f5e971a9e3bb74c774f8582c0fb8b82378 | kubernetes/test/test_api_client.py | kubernetes/test/test_api_client.py | # coding: utf-8
import atexit
import weakref
import unittest
import kubernetes
class TestApiClient(unittest.TestCase):
def test_context_manager_closes_threadpool(self):
with kubernetes.client.ApiClient() as client:
self.assertIsNotNone(client.pool)
pool_ref = weakref.ref(client... | Add test to ensure kubernetes client threadpool is cleaned up | Add test to ensure kubernetes client threadpool is cleaned up
| Python | apache-2.0 | kubernetes-client/python,kubernetes-client/python | Add test to ensure kubernetes client threadpool is cleaned up | # coding: utf-8
import atexit
import weakref
import unittest
import kubernetes
class TestApiClient(unittest.TestCase):
def test_context_manager_closes_threadpool(self):
with kubernetes.client.ApiClient() as client:
self.assertIsNotNone(client.pool)
pool_ref = weakref.ref(client... | <commit_before><commit_msg>Add test to ensure kubernetes client threadpool is cleaned up<commit_after> | # coding: utf-8
import atexit
import weakref
import unittest
import kubernetes
class TestApiClient(unittest.TestCase):
def test_context_manager_closes_threadpool(self):
with kubernetes.client.ApiClient() as client:
self.assertIsNotNone(client.pool)
pool_ref = weakref.ref(client... | Add test to ensure kubernetes client threadpool is cleaned up# coding: utf-8
import atexit
import weakref
import unittest
import kubernetes
class TestApiClient(unittest.TestCase):
def test_context_manager_closes_threadpool(self):
with kubernetes.client.ApiClient() as client:
self.assertIsN... | <commit_before><commit_msg>Add test to ensure kubernetes client threadpool is cleaned up<commit_after># coding: utf-8
import atexit
import weakref
import unittest
import kubernetes
class TestApiClient(unittest.TestCase):
def test_context_manager_closes_threadpool(self):
with kubernetes.client.ApiClien... | |
8e4da46443d9766bc4cdc22f49d55daf4837c5e6 | Basics/challenge_1.py | Basics/challenge_1.py | #!/usr/bin/env python
import codecs
def hex_2_b64(s):
return codecs.encode(codecs.decode(s, 'hex'), 'base64').decode()
if __name__ == '__main__':
print(hex_2_b64("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d")),
| Set 1 - Challenge 1 | Set 1 - Challenge 1
| Python | apache-2.0 | Scythe14/Crypto | Set 1 - Challenge 1 | #!/usr/bin/env python
import codecs
def hex_2_b64(s):
return codecs.encode(codecs.decode(s, 'hex'), 'base64').decode()
if __name__ == '__main__':
print(hex_2_b64("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d")),
| <commit_before><commit_msg>Set 1 - Challenge 1<commit_after> | #!/usr/bin/env python
import codecs
def hex_2_b64(s):
return codecs.encode(codecs.decode(s, 'hex'), 'base64').decode()
if __name__ == '__main__':
print(hex_2_b64("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d")),
| Set 1 - Challenge 1#!/usr/bin/env python
import codecs
def hex_2_b64(s):
return codecs.encode(codecs.decode(s, 'hex'), 'base64').decode()
if __name__ == '__main__':
print(hex_2_b64("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d")),
| <commit_before><commit_msg>Set 1 - Challenge 1<commit_after>#!/usr/bin/env python
import codecs
def hex_2_b64(s):
return codecs.encode(codecs.decode(s, 'hex'), 'base64').decode()
if __name__ == '__main__':
print(hex_2_b64("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757... | |
32996b01b0689cccb5ea12e4c6171b2880688684 | watchdog_kj_kultura/organizations_requests/migrations/0004_template_description.py | watchdog_kj_kultura/organizations_requests/migrations/0004_template_description.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 20:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizations_requests', '0003_template_introduction'),
]
operations = [
mi... | Add missing migration for Template | Add missing migration for Template
| Python | mit | watchdogpolska/watchdog-kj-kultura,watchdogpolska/watchdog-kj-kultura,watchdogpolska/watchdog-kj-kultura | Add missing migration for Template | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 20:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizations_requests', '0003_template_introduction'),
]
operations = [
mi... | <commit_before><commit_msg>Add missing migration for Template<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 20:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizations_requests', '0003_template_introduction'),
]
operations = [
mi... | Add missing migration for Template# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 20:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizations_requests', '0003_template_introduction'),
... | <commit_before><commit_msg>Add missing migration for Template<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 20:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizations_req... | |
20924798362dee42c4de75057d3eb257fe507e72 | CvViewer.py | CvViewer.py | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Test application to display live images from an Allied Vision camera using OpenCV 3
#
# External dependencies
import cv2
import Vimba
# Initialize Vimba
Vimba.VmbStartup()
# Initialize the camera
camera = Vimba.VmbCamera( '50-0503323406' )
# Open the camera
camera.Op... | Add a viewer for the Allied Vision camera using OpenCV. | Add a viewer for the Allied Vision camera using OpenCV.
| Python | mit | microy/Vimba | Add a viewer for the Allied Vision camera using OpenCV. | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Test application to display live images from an Allied Vision camera using OpenCV 3
#
# External dependencies
import cv2
import Vimba
# Initialize Vimba
Vimba.VmbStartup()
# Initialize the camera
camera = Vimba.VmbCamera( '50-0503323406' )
# Open the camera
camera.Op... | <commit_before><commit_msg>Add a viewer for the Allied Vision camera using OpenCV.<commit_after> | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Test application to display live images from an Allied Vision camera using OpenCV 3
#
# External dependencies
import cv2
import Vimba
# Initialize Vimba
Vimba.VmbStartup()
# Initialize the camera
camera = Vimba.VmbCamera( '50-0503323406' )
# Open the camera
camera.Op... | Add a viewer for the Allied Vision camera using OpenCV.#! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Test application to display live images from an Allied Vision camera using OpenCV 3
#
# External dependencies
import cv2
import Vimba
# Initialize Vimba
Vimba.VmbStartup()
# Initialize the camera
camera = Vimba.V... | <commit_before><commit_msg>Add a viewer for the Allied Vision camera using OpenCV.<commit_after>#! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Test application to display live images from an Allied Vision camera using OpenCV 3
#
# External dependencies
import cv2
import Vimba
# Initialize Vimba
Vimba.VmbStartup()... | |
e52d780b15e43ce7bade0b662284fad28f0fba83 | setup.py | setup.py | #!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateutil",
ver... | #!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateutil",
ver... | Use zip_safe=False, as suggested by Stephan Richter. | Use zip_safe=False, as suggested by Stephan Richter.
| Python | bsd-3-clause | adamgreig/python-dateutil,sprymix/dateutil,pganssle/dateutil-test-codecov,emsoftware/python-dateutil,Bachmann1234/dateutil,jenshnielsen/dateutil,pganssle/dateutil-test-codecov,sprymix/python-dateutil,abalkin/dateutil,mjschultz/dateutil,abalkin/dateutil | #!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateutil",
ver... | #!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateutil",
ver... | <commit_before>#!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateu... | #!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateutil",
ver... | #!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateutil",
ver... | <commit_before>#!/usr/bin/python
from os.path import isfile, join
import glob
import os
import re
from setuptools import setup
if isfile("MANIFEST"):
os.unlink("MANIFEST")
VERSION = re.search('__version__ = "([^"]+)"',
open("dateutil/__init__.py").read()).group(1)
setup(name="python-dateu... |
281bbe58981dea111a432bbd98ff5e32a7107b66 | models.py | models.py | from sqlalchemy import Column, Integer, Float, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class NbaGame(Base):
__tablename__ = 'nba_game'
id = Column(Integer, primary_key=True)
date = Column(String)
opp = Column(String)
score = Column(String)
minu... | Install sqlalchemy, add nba game model | Install sqlalchemy, add nba game model
| Python | mit | arosenberg01/asdata | Install sqlalchemy, add nba game model | from sqlalchemy import Column, Integer, Float, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class NbaGame(Base):
__tablename__ = 'nba_game'
id = Column(Integer, primary_key=True)
date = Column(String)
opp = Column(String)
score = Column(String)
minu... | <commit_before><commit_msg>Install sqlalchemy, add nba game model<commit_after> | from sqlalchemy import Column, Integer, Float, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class NbaGame(Base):
__tablename__ = 'nba_game'
id = Column(Integer, primary_key=True)
date = Column(String)
opp = Column(String)
score = Column(String)
minu... | Install sqlalchemy, add nba game modelfrom sqlalchemy import Column, Integer, Float, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class NbaGame(Base):
__tablename__ = 'nba_game'
id = Column(Integer, primary_key=True)
date = Column(String)
opp = Column(Strin... | <commit_before><commit_msg>Install sqlalchemy, add nba game model<commit_after>from sqlalchemy import Column, Integer, Float, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class NbaGame(Base):
__tablename__ = 'nba_game'
id = Column(Integer, primary_key=True)
dat... | |
cb484a45562e14d2cb25f53c839973c6a99549a1 | tests/nts/conftest.py | tests/nts/conftest.py | # -*- coding: utf-8 -*-
"""
tests.nts.conftest
~~~~~~~~~~~~~~~~~~
"""
import pathlib
import pytest
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import TestCase
NTS_TEST_SUITE_PATH = pathlib.Path(__file__).parent
@pytest.hookimpl(hookwrapper=True, trylast=True)
def pytest_collectio... | Enforce non TestCase usage under `tests/nts` | Enforce non TestCase usage under `tests/nts`
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Enforce non TestCase usage under `tests/nts` | # -*- coding: utf-8 -*-
"""
tests.nts.conftest
~~~~~~~~~~~~~~~~~~
"""
import pathlib
import pytest
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import TestCase
NTS_TEST_SUITE_PATH = pathlib.Path(__file__).parent
@pytest.hookimpl(hookwrapper=True, trylast=True)
def pytest_collectio... | <commit_before><commit_msg>Enforce non TestCase usage under `tests/nts`<commit_after> | # -*- coding: utf-8 -*-
"""
tests.nts.conftest
~~~~~~~~~~~~~~~~~~
"""
import pathlib
import pytest
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import TestCase
NTS_TEST_SUITE_PATH = pathlib.Path(__file__).parent
@pytest.hookimpl(hookwrapper=True, trylast=True)
def pytest_collectio... | Enforce non TestCase usage under `tests/nts`# -*- coding: utf-8 -*-
"""
tests.nts.conftest
~~~~~~~~~~~~~~~~~~
"""
import pathlib
import pytest
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import TestCase
NTS_TEST_SUITE_PATH = pathlib.Path(__file__).parent
@pytest.hookimpl(hookwrap... | <commit_before><commit_msg>Enforce non TestCase usage under `tests/nts`<commit_after># -*- coding: utf-8 -*-
"""
tests.nts.conftest
~~~~~~~~~~~~~~~~~~
"""
import pathlib
import pytest
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import TestCase
NTS_TEST_SUITE_PATH = pathlib.Path(__f... | |
b59e2bc59a0c8a648189e01047cf729c82aadfe0 | tests/currencycloud/test_resource.py | tests/currencycloud/test_resource.py | import pytest
from mock import patch
from currencycloud import Client, Config
from currencycloud.http import Http
from currencycloud.resources.resource import Resource
from currencycloud.resources.actions import UpdateMixin, DeleteMixin
class TestResource:
class PersonClient(Http):
def delete(self, resou... | Test update and delete actions | Test update and delete actions
| Python | mit | CurrencyCloud/currencycloud-python | Test update and delete actions | import pytest
from mock import patch
from currencycloud import Client, Config
from currencycloud.http import Http
from currencycloud.resources.resource import Resource
from currencycloud.resources.actions import UpdateMixin, DeleteMixin
class TestResource:
class PersonClient(Http):
def delete(self, resou... | <commit_before><commit_msg>Test update and delete actions<commit_after> | import pytest
from mock import patch
from currencycloud import Client, Config
from currencycloud.http import Http
from currencycloud.resources.resource import Resource
from currencycloud.resources.actions import UpdateMixin, DeleteMixin
class TestResource:
class PersonClient(Http):
def delete(self, resou... | Test update and delete actionsimport pytest
from mock import patch
from currencycloud import Client, Config
from currencycloud.http import Http
from currencycloud.resources.resource import Resource
from currencycloud.resources.actions import UpdateMixin, DeleteMixin
class TestResource:
class PersonClient(Http):
... | <commit_before><commit_msg>Test update and delete actions<commit_after>import pytest
from mock import patch
from currencycloud import Client, Config
from currencycloud.http import Http
from currencycloud.resources.resource import Resource
from currencycloud.resources.actions import UpdateMixin, DeleteMixin
class Tes... | |
7a03f8012518ce56f214242c97fe3ce958f098e4 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | Use HTTPS URL for repository. | Use HTTPS URL for repository.
| Python | apache-2.0 | Aloomaio/facebook-sdk,mobolic/facebook-sdk | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | <commit_before>#!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Grap... | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | #!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Graph API and the o... | <commit_before>#!/usr/bin/env python
from distutils.core import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='facebook-sdk',
version='0.3.2',
description='This client library is designed to support the Facebook '
'Grap... |
bb0e8faf73298d3b5ce78853b9a70cb8c34b9965 | trace_viewer/trace_viewer_project.py | trace_viewer/trace_viewer_project.py | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path = os.path.abspat... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path = os.path.abspat... | Allow other_paths to be passed into TraceViewerProject | Allow other_paths to be passed into TraceViewerProject
This allows external embedders to subclass TraceViewerProject and thus
use trace viewer. | Python | bsd-3-clause | catapult-project/catapult-csm,sahiljain/catapult,catapult-project/catapult-csm,sahiljain/catapult,catapult-project/catapult-csm,dstockwell/catapult,danbeam/catapult,catapult-project/catapult-csm,0x90sled/catapult,dstockwell/catapult,catapult-project/catapult,scottmcmaster/catapult,sahiljain/catapult,sahiljain/catapult,... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path = os.path.abspat... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path = os.path.abspat... | <commit_before># Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path =... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path = os.path.abspat... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path = os.path.abspat... | <commit_before># Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path =... |
b5dec2c004e380da6214bffdd3761b0e46dab3a0 | tests/test_archive.py | tests/test_archive.py | from json import load
from django_archive import __version__
from .base import BaseArchiveTestCase
from .sample.models import Sample
class ArchiveTestCase(BaseArchiveTestCase):
"""
Test that the archive command includes correct data in the archive
"""
def setUp(self):
Sample().save()
... | Add test for verifying archive contents. | Add test for verifying archive contents.
| Python | mit | nathan-osman/django-archive,nathan-osman/django-archive | Add test for verifying archive contents. | from json import load
from django_archive import __version__
from .base import BaseArchiveTestCase
from .sample.models import Sample
class ArchiveTestCase(BaseArchiveTestCase):
"""
Test that the archive command includes correct data in the archive
"""
def setUp(self):
Sample().save()
... | <commit_before><commit_msg>Add test for verifying archive contents.<commit_after> | from json import load
from django_archive import __version__
from .base import BaseArchiveTestCase
from .sample.models import Sample
class ArchiveTestCase(BaseArchiveTestCase):
"""
Test that the archive command includes correct data in the archive
"""
def setUp(self):
Sample().save()
... | Add test for verifying archive contents.from json import load
from django_archive import __version__
from .base import BaseArchiveTestCase
from .sample.models import Sample
class ArchiveTestCase(BaseArchiveTestCase):
"""
Test that the archive command includes correct data in the archive
"""
def set... | <commit_before><commit_msg>Add test for verifying archive contents.<commit_after>from json import load
from django_archive import __version__
from .base import BaseArchiveTestCase
from .sample.models import Sample
class ArchiveTestCase(BaseArchiveTestCase):
"""
Test that the archive command includes correct... | |
6d65637dec129863ac4a96bb28b476f032bbff84 | nova/db/sqlalchemy/migrate_repo/versions/143_rename_instance_info_cache_sequence.py | nova/db/sqlalchemy/migrate_repo/versions/143_rename_instance_info_cache_sequence.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | Rename instance_info_cache unique key constraints. | Rename instance_info_cache unique key constraints.
Rename (via drop and recreate) the instance_uuid unique
constraints on the instance_info_cache table so they reflect
the column change name (UUID conversion) we complete in Folsom.
Fixes LP Bug #1080837.
Change-Id: I9dd01ebc896c1d7b51c212980e48db16bad18dec
| Python | apache-2.0 | plumgrid/plumgrid-nova,redhat-openstack/nova,yrobla/nova,gooddata/openstack-nova,orbitfp7/nova,edulramirez/nova,imsplitbit/nova,leilihh/novaha,cernops/nova,cloudbase/nova,shahar-stratoscale/nova,akash1808/nova,zaina/nova,orbitfp7/nova,jianghuaw/nova,whitepages/nova,hanlind/nova,cloudbase/nova,spring-week-topos/nova-wee... | Rename instance_info_cache unique key constraints.
Rename (via drop and recreate) the instance_uuid unique
constraints on the instance_info_cache table so they reflect
the column change name (UUID conversion) we complete in Folsom.
Fixes LP Bug #1080837.
Change-Id: I9dd01ebc896c1d7b51c212980e48db16bad18dec | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | <commit_before><commit_msg>Rename instance_info_cache unique key constraints.
Rename (via drop and recreate) the instance_uuid unique
constraints on the instance_info_cache table so they reflect
the column change name (UUID conversion) we complete in Folsom.
Fixes LP Bug #1080837.
Change-Id: I9dd01ebc896c1d7b51c2129... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | Rename instance_info_cache unique key constraints.
Rename (via drop and recreate) the instance_uuid unique
constraints on the instance_info_cache table so they reflect
the column change name (UUID conversion) we complete in Folsom.
Fixes LP Bug #1080837.
Change-Id: I9dd01ebc896c1d7b51c212980e48db16bad18dec# vim: tab... | <commit_before><commit_msg>Rename instance_info_cache unique key constraints.
Rename (via drop and recreate) the instance_uuid unique
constraints on the instance_info_cache table so they reflect
the column change name (UUID conversion) we complete in Folsom.
Fixes LP Bug #1080837.
Change-Id: I9dd01ebc896c1d7b51c2129... | |
41ab8dbe59cc3ffb41b352cf228fb62e00612d1b | test_bvg_cli.py | test_bvg_cli.py | import httpretty
from bvg_cli import BVG_URL
from bvg_cli import request_departures, request_station_ids
from html_dumps import DEPARTURE_HTML, STATION_HTML
@httpretty.activate
def test_request_station_server_error():
httpretty.register_uri(httpretty.GET, BVG_URL, status=500)
_, ok = request_station_ids('an... | Add tests with mocked http responses | Add tests with mocked http responses
| Python | mit | behrtam/bvg-cli,behrtam/bvg-cli | Add tests with mocked http responses | import httpretty
from bvg_cli import BVG_URL
from bvg_cli import request_departures, request_station_ids
from html_dumps import DEPARTURE_HTML, STATION_HTML
@httpretty.activate
def test_request_station_server_error():
httpretty.register_uri(httpretty.GET, BVG_URL, status=500)
_, ok = request_station_ids('an... | <commit_before><commit_msg>Add tests with mocked http responses<commit_after> | import httpretty
from bvg_cli import BVG_URL
from bvg_cli import request_departures, request_station_ids
from html_dumps import DEPARTURE_HTML, STATION_HTML
@httpretty.activate
def test_request_station_server_error():
httpretty.register_uri(httpretty.GET, BVG_URL, status=500)
_, ok = request_station_ids('an... | Add tests with mocked http responsesimport httpretty
from bvg_cli import BVG_URL
from bvg_cli import request_departures, request_station_ids
from html_dumps import DEPARTURE_HTML, STATION_HTML
@httpretty.activate
def test_request_station_server_error():
httpretty.register_uri(httpretty.GET, BVG_URL, status=500)... | <commit_before><commit_msg>Add tests with mocked http responses<commit_after>import httpretty
from bvg_cli import BVG_URL
from bvg_cli import request_departures, request_station_ids
from html_dumps import DEPARTURE_HTML, STATION_HTML
@httpretty.activate
def test_request_station_server_error():
httpretty.registe... | |
ae02408361b2f6c426138799da756af56ada67f0 | utils.py | utils.py | """
Utility classes and funcitons for template mathcing framework.
"""
class BoundingBox(object):
def __init__(self, lr, ul):
self.lrx = lr[0]
self.lry = lr[1]
self.lr = lr
self.ulx = ul[0]
self.uly = ul[1]
self.ul = ul
self.llx = ul[0]
self.lly =... | Move utilities to separate file | Move utilities to separate file
| Python | mit | rmsare/scarplet,stgl/scarplet | Move utilities to separate file | """
Utility classes and funcitons for template mathcing framework.
"""
class BoundingBox(object):
def __init__(self, lr, ul):
self.lrx = lr[0]
self.lry = lr[1]
self.lr = lr
self.ulx = ul[0]
self.uly = ul[1]
self.ul = ul
self.llx = ul[0]
self.lly =... | <commit_before><commit_msg>Move utilities to separate file<commit_after> | """
Utility classes and funcitons for template mathcing framework.
"""
class BoundingBox(object):
def __init__(self, lr, ul):
self.lrx = lr[0]
self.lry = lr[1]
self.lr = lr
self.ulx = ul[0]
self.uly = ul[1]
self.ul = ul
self.llx = ul[0]
self.lly =... | Move utilities to separate file"""
Utility classes and funcitons for template mathcing framework.
"""
class BoundingBox(object):
def __init__(self, lr, ul):
self.lrx = lr[0]
self.lry = lr[1]
self.lr = lr
self.ulx = ul[0]
self.uly = ul[1]
self.ul = ul
self... | <commit_before><commit_msg>Move utilities to separate file<commit_after>"""
Utility classes and funcitons for template mathcing framework.
"""
class BoundingBox(object):
def __init__(self, lr, ul):
self.lrx = lr[0]
self.lry = lr[1]
self.lr = lr
self.ulx = ul[0]
self.uly =... | |
f9988a1419e6adefa163ef0dd92c9f33f2ccf562 | anchorhub/tests/test_main.py | anchorhub/tests/test_main.py | """
test_main.py - Tests for main.py
main.py:
http://www.github.com/samjabrahams/anchorhub/main.py
"""
import anchorhub.main as main
def test_one():
"""
main.py: Test defaults with local directory as input.
"""
main.main(['.'])
| Add basic tests for main.py | Add basic tests for main.py
Needs to be updated as main.py becomes complete.
| Python | apache-2.0 | samjabrahams/anchorhub | Add basic tests for main.py
Needs to be updated as main.py becomes complete. | """
test_main.py - Tests for main.py
main.py:
http://www.github.com/samjabrahams/anchorhub/main.py
"""
import anchorhub.main as main
def test_one():
"""
main.py: Test defaults with local directory as input.
"""
main.main(['.'])
| <commit_before><commit_msg>Add basic tests for main.py
Needs to be updated as main.py becomes complete.<commit_after> | """
test_main.py - Tests for main.py
main.py:
http://www.github.com/samjabrahams/anchorhub/main.py
"""
import anchorhub.main as main
def test_one():
"""
main.py: Test defaults with local directory as input.
"""
main.main(['.'])
| Add basic tests for main.py
Needs to be updated as main.py becomes complete."""
test_main.py - Tests for main.py
main.py:
http://www.github.com/samjabrahams/anchorhub/main.py
"""
import anchorhub.main as main
def test_one():
"""
main.py: Test defaults with local directory as input.
"""
main.main(['... | <commit_before><commit_msg>Add basic tests for main.py
Needs to be updated as main.py becomes complete.<commit_after>"""
test_main.py - Tests for main.py
main.py:
http://www.github.com/samjabrahams/anchorhub/main.py
"""
import anchorhub.main as main
def test_one():
"""
main.py: Test defaults with local dir... | |
bc781453ac14c58fa64f51b5ab91e78dd300621a | tests/devices_test/size_test.py | tests/devices_test/size_test.py |
import unittest
from blivet.devices import StorageDevice
from blivet import errors
from blivet.formats import getFormat
from blivet.size import Size
class StorageDeviceSizeTest(unittest.TestCase):
def _getDevice(self, *args, **kwargs):
return StorageDevice(*args, **kwargs)
def testSizeSetter(self):
... | Add unit tests for device size setters and getters. | Add unit tests for device size setters and getters.
| Python | lgpl-2.1 | rvykydal/blivet,rvykydal/blivet,vojtechtrefny/blivet,vpodzime/blivet,vojtechtrefny/blivet,jkonecny12/blivet,AdamWill/blivet,rhinstaller/blivet,vpodzime/blivet,AdamWill/blivet,jkonecny12/blivet,rhinstaller/blivet | Add unit tests for device size setters and getters. |
import unittest
from blivet.devices import StorageDevice
from blivet import errors
from blivet.formats import getFormat
from blivet.size import Size
class StorageDeviceSizeTest(unittest.TestCase):
def _getDevice(self, *args, **kwargs):
return StorageDevice(*args, **kwargs)
def testSizeSetter(self):
... | <commit_before><commit_msg>Add unit tests for device size setters and getters.<commit_after> |
import unittest
from blivet.devices import StorageDevice
from blivet import errors
from blivet.formats import getFormat
from blivet.size import Size
class StorageDeviceSizeTest(unittest.TestCase):
def _getDevice(self, *args, **kwargs):
return StorageDevice(*args, **kwargs)
def testSizeSetter(self):
... | Add unit tests for device size setters and getters.
import unittest
from blivet.devices import StorageDevice
from blivet import errors
from blivet.formats import getFormat
from blivet.size import Size
class StorageDeviceSizeTest(unittest.TestCase):
def _getDevice(self, *args, **kwargs):
return StorageDevi... | <commit_before><commit_msg>Add unit tests for device size setters and getters.<commit_after>
import unittest
from blivet.devices import StorageDevice
from blivet import errors
from blivet.formats import getFormat
from blivet.size import Size
class StorageDeviceSizeTest(unittest.TestCase):
def _getDevice(self, *ar... | |
685e2c52e2e8cd7c2f691cd3c9a25704a65fbc5b | tools/git_hooks/find_duplicates.py | tools/git_hooks/find_duplicates.py | from os import walk
from os.path import join
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser("Find duplicate file names within a directory structure")
parser.add_argument("dirs", help="Directories to search for duplicate file names"
, nargs="*")
... | Add a git hook script that will list all duplicate files within the directories specified | Add a git hook script that will list all duplicate files within the directories specified
| Python | apache-2.0 | cvtsi2sd/mbed-os,mazimkhan/mbed-os,pradeep-gr/mbed-os5-onsemi,c1728p9/mbed-os,fanghuaqi/mbed,kjbracey-arm/mbed,mikaleppanen/mbed-os,NXPmicro/mbed,mbedmicro/mbed,adamgreen/mbed,bcostm/mbed-os,nvlsianpu/mbed,Archcady/mbed-os,svogl/mbed-os,adamgreen/mbed,arostm/mbed-os,mmorenobarm/mbed-os,screamerbg/mbed,mikaleppanen/mbed... | Add a git hook script that will list all duplicate files within the directories specified | from os import walk
from os.path import join
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser("Find duplicate file names within a directory structure")
parser.add_argument("dirs", help="Directories to search for duplicate file names"
, nargs="*")
... | <commit_before><commit_msg>Add a git hook script that will list all duplicate files within the directories specified<commit_after> | from os import walk
from os.path import join
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser("Find duplicate file names within a directory structure")
parser.add_argument("dirs", help="Directories to search for duplicate file names"
, nargs="*")
... | Add a git hook script that will list all duplicate files within the directories specifiedfrom os import walk
from os.path import join
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser("Find duplicate file names within a directory structure")
parser.add_argument("dirs", help... | <commit_before><commit_msg>Add a git hook script that will list all duplicate files within the directories specified<commit_after>from os import walk
from os.path import join
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser("Find duplicate file names within a directory structu... | |
0da1fe90725bdb1729ee8835886e86756a4a91f8 | win/data/tools/make-portable-python.py | win/data/tools/make-portable-python.py | '''Module that when called from the command line will go through all
files in the Scripts directory of the current python and will change the
python path hardcoded in these files from a full python path, to just
python.exe.
'''
import sys
import os
from os import listdir, remove, rename
from os.path import dirname, jo... | Add make python portable script. | Add make python portable script.
| Python | mit | kivy/kivy-sdk-packager,kivy/kivy-sdk-packager | Add make python portable script. | '''Module that when called from the command line will go through all
files in the Scripts directory of the current python and will change the
python path hardcoded in these files from a full python path, to just
python.exe.
'''
import sys
import os
from os import listdir, remove, rename
from os.path import dirname, jo... | <commit_before><commit_msg>Add make python portable script.<commit_after> | '''Module that when called from the command line will go through all
files in the Scripts directory of the current python and will change the
python path hardcoded in these files from a full python path, to just
python.exe.
'''
import sys
import os
from os import listdir, remove, rename
from os.path import dirname, jo... | Add make python portable script.'''Module that when called from the command line will go through all
files in the Scripts directory of the current python and will change the
python path hardcoded in these files from a full python path, to just
python.exe.
'''
import sys
import os
from os import listdir, remove, rename... | <commit_before><commit_msg>Add make python portable script.<commit_after>'''Module that when called from the command line will go through all
files in the Scripts directory of the current python and will change the
python path hardcoded in these files from a full python path, to just
python.exe.
'''
import sys
import ... | |
a5e244b630fdd8220ebb1f5228aab20e3d44ca41 | monty/fnmatch.py | monty/fnmatch.py | # coding: utf-8
"""This module provides support for Unix shell-style wildcards"""
from __future__ import unicode_literals, absolute_import
import fnmatch
from monty.string import list_strings
class WildCard(object):
"""
This object provides an easy-to-use interface for filename matching with
shell patte... | Revert "Remove WildCard module. Functionality is already available in glob. Not sure why" | Revert "Remove WildCard module. Functionality is already available in glob. Not sure why"
This reverts commit 44502648df007fd32d5818f2ac0d1df98d9b4550.
| Python | mit | gmatteo/monty,gmatteo/monty,materialsvirtuallab/monty,davidwaroquiers/monty,davidwaroquiers/monty,materialsvirtuallab/monty | Revert "Remove WildCard module. Functionality is already available in glob. Not sure why"
This reverts commit 44502648df007fd32d5818f2ac0d1df98d9b4550. | # coding: utf-8
"""This module provides support for Unix shell-style wildcards"""
from __future__ import unicode_literals, absolute_import
import fnmatch
from monty.string import list_strings
class WildCard(object):
"""
This object provides an easy-to-use interface for filename matching with
shell patte... | <commit_before><commit_msg>Revert "Remove WildCard module. Functionality is already available in glob. Not sure why"
This reverts commit 44502648df007fd32d5818f2ac0d1df98d9b4550.<commit_after> | # coding: utf-8
"""This module provides support for Unix shell-style wildcards"""
from __future__ import unicode_literals, absolute_import
import fnmatch
from monty.string import list_strings
class WildCard(object):
"""
This object provides an easy-to-use interface for filename matching with
shell patte... | Revert "Remove WildCard module. Functionality is already available in glob. Not sure why"
This reverts commit 44502648df007fd32d5818f2ac0d1df98d9b4550.# coding: utf-8
"""This module provides support for Unix shell-style wildcards"""
from __future__ import unicode_literals, absolute_import
import fnmatch
from monty.s... | <commit_before><commit_msg>Revert "Remove WildCard module. Functionality is already available in glob. Not sure why"
This reverts commit 44502648df007fd32d5818f2ac0d1df98d9b4550.<commit_after># coding: utf-8
"""This module provides support for Unix shell-style wildcards"""
from __future__ import unicode_literals, abso... | |
4ca382fa691ae91f531a238df9ba13234b311b55 | utils/remove_limit.py | utils/remove_limit.py | #!/usr/bin/env python
"""
Utility to remove limit warnings from Filter API output.
If --warnings was used, you will have the following in output:
{"limit": {"track": 2530, "timestamp_ms": "1482168932301"}}
This utility removes any limit warnings from output.
Usage:
remove_limit.py aleppo.json > aleppo_no_warnin... | Add utility to remove limit warnings. | Add utility to remove limit warnings.
| Python | cc0-1.0 | remagio/twarc,DocNow/twarc,remagio/twarc,edsu/twarc,hugovk/twarc | Add utility to remove limit warnings. | #!/usr/bin/env python
"""
Utility to remove limit warnings from Filter API output.
If --warnings was used, you will have the following in output:
{"limit": {"track": 2530, "timestamp_ms": "1482168932301"}}
This utility removes any limit warnings from output.
Usage:
remove_limit.py aleppo.json > aleppo_no_warnin... | <commit_before><commit_msg>Add utility to remove limit warnings.<commit_after> | #!/usr/bin/env python
"""
Utility to remove limit warnings from Filter API output.
If --warnings was used, you will have the following in output:
{"limit": {"track": 2530, "timestamp_ms": "1482168932301"}}
This utility removes any limit warnings from output.
Usage:
remove_limit.py aleppo.json > aleppo_no_warnin... | Add utility to remove limit warnings.#!/usr/bin/env python
"""
Utility to remove limit warnings from Filter API output.
If --warnings was used, you will have the following in output:
{"limit": {"track": 2530, "timestamp_ms": "1482168932301"}}
This utility removes any limit warnings from output.
Usage:
remove_li... | <commit_before><commit_msg>Add utility to remove limit warnings.<commit_after>#!/usr/bin/env python
"""
Utility to remove limit warnings from Filter API output.
If --warnings was used, you will have the following in output:
{"limit": {"track": 2530, "timestamp_ms": "1482168932301"}}
This utility removes any limit wa... | |
6b8f84e3feab1cb4c08f3ca52269db9f2c86d36f | examples/endless_turn.py | examples/endless_turn.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyAX-12
# The MIT License
#
# Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Sof... | Add an endless turn demo. | Add an endless turn demo.
| Python | mit | jeremiedecock/pyax12,jeremiedecock/pyax12 | Add an endless turn demo. | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyAX-12
# The MIT License
#
# Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Sof... | <commit_before><commit_msg>Add an endless turn demo.<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyAX-12
# The MIT License
#
# Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Sof... | Add an endless turn demo.#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyAX-12
# The MIT License
#
# Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwar... | <commit_before><commit_msg>Add an endless turn demo.<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyAX-12
# The MIT License
#
# Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and ass... | |
755f3f3f8e39a338ea9f56fdb2c8f39787180c49 | tests/import_tests.py | tests/import_tests.py | from nose.tools import ok_
import oemof.db as oemofdb
def test_oemofdb_imports():
ok_(oemofdb.connection)
ok_(oemofdb.engine)
ok_(oemofdb.url)
| Test minimal package import functionality | Test minimal package import functionality
Ok, it's not really minimal, but it's one way to be sure, that the
package actually exists, is importable and some of it's exported things
are accessible.
| Python | mit | oemof/oemof.db | Test minimal package import functionality
Ok, it's not really minimal, but it's one way to be sure, that the
package actually exists, is importable and some of it's exported things
are accessible. | from nose.tools import ok_
import oemof.db as oemofdb
def test_oemofdb_imports():
ok_(oemofdb.connection)
ok_(oemofdb.engine)
ok_(oemofdb.url)
| <commit_before><commit_msg>Test minimal package import functionality
Ok, it's not really minimal, but it's one way to be sure, that the
package actually exists, is importable and some of it's exported things
are accessible.<commit_after> | from nose.tools import ok_
import oemof.db as oemofdb
def test_oemofdb_imports():
ok_(oemofdb.connection)
ok_(oemofdb.engine)
ok_(oemofdb.url)
| Test minimal package import functionality
Ok, it's not really minimal, but it's one way to be sure, that the
package actually exists, is importable and some of it's exported things
are accessible.from nose.tools import ok_
import oemof.db as oemofdb
def test_oemofdb_imports():
ok_(oemofdb.connection)
ok_(oem... | <commit_before><commit_msg>Test minimal package import functionality
Ok, it's not really minimal, but it's one way to be sure, that the
package actually exists, is importable and some of it's exported things
are accessible.<commit_after>from nose.tools import ok_
import oemof.db as oemofdb
def test_oemofdb_imports()... | |
5df72de23fe87d0fe20df02007db79ec5bb8f843 | write.py | write.py | #!/usr/bin/env blender
import sys
import os
import bpy
import addon_utils
def _main(args):
print("Writing", args)
default, state = addon_utils.check("io_EDM")
if not state:
import io_EDM
io_EDM.register()
# Call the import operator
bpy.ops.export_mesh.edm(filepath="test.edm")
if __name__ == "__m... | Add a very simple test writing script | Add a very simple test writing script
| Python | mit | ndevenish/Blender_ioEDM,ndevenish/Blender_ioEDM | Add a very simple test writing script | #!/usr/bin/env blender
import sys
import os
import bpy
import addon_utils
def _main(args):
print("Writing", args)
default, state = addon_utils.check("io_EDM")
if not state:
import io_EDM
io_EDM.register()
# Call the import operator
bpy.ops.export_mesh.edm(filepath="test.edm")
if __name__ == "__m... | <commit_before><commit_msg>Add a very simple test writing script<commit_after> | #!/usr/bin/env blender
import sys
import os
import bpy
import addon_utils
def _main(args):
print("Writing", args)
default, state = addon_utils.check("io_EDM")
if not state:
import io_EDM
io_EDM.register()
# Call the import operator
bpy.ops.export_mesh.edm(filepath="test.edm")
if __name__ == "__m... | Add a very simple test writing script#!/usr/bin/env blender
import sys
import os
import bpy
import addon_utils
def _main(args):
print("Writing", args)
default, state = addon_utils.check("io_EDM")
if not state:
import io_EDM
io_EDM.register()
# Call the import operator
bpy.ops.export_mesh.edm(file... | <commit_before><commit_msg>Add a very simple test writing script<commit_after>#!/usr/bin/env blender
import sys
import os
import bpy
import addon_utils
def _main(args):
print("Writing", args)
default, state = addon_utils.check("io_EDM")
if not state:
import io_EDM
io_EDM.register()
# Call the impor... | |
2c301d7f0d52188893c0e83326003dbf84a7424a | fix_movies.py | fix_movies.py | #!/usr/bin/python
# we've been outputting stuff to text so now I get to wedge it into a database
# funtimes
# set up the database with `sqlite3 netflix_genres.sqlite < create_tables.sql`
import codecs
import sqlite3
import sys
conn = sqlite3.connect('netflix_genres.sqlite')
c = conn.cursor()
# for row in c.execute... | Document work in fixing movies table | Document work in fixing movies table
| Python | unlicense | george08/netflix-o-matic | Document work in fixing movies table | #!/usr/bin/python
# we've been outputting stuff to text so now I get to wedge it into a database
# funtimes
# set up the database with `sqlite3 netflix_genres.sqlite < create_tables.sql`
import codecs
import sqlite3
import sys
conn = sqlite3.connect('netflix_genres.sqlite')
c = conn.cursor()
# for row in c.execute... | <commit_before><commit_msg>Document work in fixing movies table<commit_after> | #!/usr/bin/python
# we've been outputting stuff to text so now I get to wedge it into a database
# funtimes
# set up the database with `sqlite3 netflix_genres.sqlite < create_tables.sql`
import codecs
import sqlite3
import sys
conn = sqlite3.connect('netflix_genres.sqlite')
c = conn.cursor()
# for row in c.execute... | Document work in fixing movies table#!/usr/bin/python
# we've been outputting stuff to text so now I get to wedge it into a database
# funtimes
# set up the database with `sqlite3 netflix_genres.sqlite < create_tables.sql`
import codecs
import sqlite3
import sys
conn = sqlite3.connect('netflix_genres.sqlite')
c = c... | <commit_before><commit_msg>Document work in fixing movies table<commit_after>#!/usr/bin/python
# we've been outputting stuff to text so now I get to wedge it into a database
# funtimes
# set up the database with `sqlite3 netflix_genres.sqlite < create_tables.sql`
import codecs
import sqlite3
import sys
conn = sqlit... | |
836eb50eae358cd077b58ba0d5c884f8c83919dc | main/readability_graph_brown.py | main/readability_graph_brown.py | from feature import simple
import graph
from nltk.corpus import brown
def calc_readability(corpus):
texts = []
results = []
for fileid in corpus.fileids():
sentlist = brown.sents(fileids=[fileid])
text = ' '.join([ ' '.join(ss) for ss in sentlist ])
texts.append(text)
for text... | Add readability grapher for brown corpus | Add readability grapher for brown corpus
| Python | mit | worldwise001/stylometry | Add readability grapher for brown corpus | from feature import simple
import graph
from nltk.corpus import brown
def calc_readability(corpus):
texts = []
results = []
for fileid in corpus.fileids():
sentlist = brown.sents(fileids=[fileid])
text = ' '.join([ ' '.join(ss) for ss in sentlist ])
texts.append(text)
for text... | <commit_before><commit_msg>Add readability grapher for brown corpus<commit_after> | from feature import simple
import graph
from nltk.corpus import brown
def calc_readability(corpus):
texts = []
results = []
for fileid in corpus.fileids():
sentlist = brown.sents(fileids=[fileid])
text = ' '.join([ ' '.join(ss) for ss in sentlist ])
texts.append(text)
for text... | Add readability grapher for brown corpusfrom feature import simple
import graph
from nltk.corpus import brown
def calc_readability(corpus):
texts = []
results = []
for fileid in corpus.fileids():
sentlist = brown.sents(fileids=[fileid])
text = ' '.join([ ' '.join(ss) for ss in sentlist ])... | <commit_before><commit_msg>Add readability grapher for brown corpus<commit_after>from feature import simple
import graph
from nltk.corpus import brown
def calc_readability(corpus):
texts = []
results = []
for fileid in corpus.fileids():
sentlist = brown.sents(fileids=[fileid])
text = ' '.... | |
5aa9fd6b9c30fc4861596c2efed456e01ab49f22 | python/decrypt_img.py | python/decrypt_img.py | import requests
import json
# Decrypt a previously encrypted image using the passphrase 'superpass'
# https://pixlab.io/#/cmd?id=encrypt && https://pixlab.io/#/cmd?id=decrypt
# Password used for decryption
pwd = 'superpass'
req = requests.get('https://api.pixlab.io/decrypt',params={'img':'https://pixlab.xyz/wxfnq588... | Decrypt a previously encrypted image | Decrypt a previously encrypted image | Python | bsd-2-clause | symisc/pixlab,symisc/pixlab,symisc/pixlab | Decrypt a previously encrypted image | import requests
import json
# Decrypt a previously encrypted image using the passphrase 'superpass'
# https://pixlab.io/#/cmd?id=encrypt && https://pixlab.io/#/cmd?id=decrypt
# Password used for decryption
pwd = 'superpass'
req = requests.get('https://api.pixlab.io/decrypt',params={'img':'https://pixlab.xyz/wxfnq588... | <commit_before><commit_msg>Decrypt a previously encrypted image<commit_after> | import requests
import json
# Decrypt a previously encrypted image using the passphrase 'superpass'
# https://pixlab.io/#/cmd?id=encrypt && https://pixlab.io/#/cmd?id=decrypt
# Password used for decryption
pwd = 'superpass'
req = requests.get('https://api.pixlab.io/decrypt',params={'img':'https://pixlab.xyz/wxfnq588... | Decrypt a previously encrypted imageimport requests
import json
# Decrypt a previously encrypted image using the passphrase 'superpass'
# https://pixlab.io/#/cmd?id=encrypt && https://pixlab.io/#/cmd?id=decrypt
# Password used for decryption
pwd = 'superpass'
req = requests.get('https://api.pixlab.io/decrypt',params... | <commit_before><commit_msg>Decrypt a previously encrypted image<commit_after>import requests
import json
# Decrypt a previously encrypted image using the passphrase 'superpass'
# https://pixlab.io/#/cmd?id=encrypt && https://pixlab.io/#/cmd?id=decrypt
# Password used for decryption
pwd = 'superpass'
req = requests.g... | |
182afef414d6ae9cd1ebd7d38be56cd77aaad663 | tests/test_Levitt1971_Fig4.py | tests/test_Levitt1971_Fig4.py | from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, INCORRECT,
CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, CORRECT,
... | Include Levitt figure 4 test | Include Levitt figure 4 test
| Python | mit | codles/UpDownMethods | Include Levitt figure 4 test | from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, INCORRECT,
CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, CORRECT,
... | <commit_before><commit_msg>Include Levitt figure 4 test<commit_after> | from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, INCORRECT,
CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, CORRECT,
... | Include Levitt figure 4 testfrom UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, INCORRECT,
CORRECT, CORRECT, INCORRECT, INCOR... | <commit_before><commit_msg>Include Levitt figure 4 test<commit_after>from UpDownMethods import CORRECT, INCORRECT
import UpDownMethods as ud
import numpy as np
import matplotlib.pyplot as plt
import unittest
#
# Simulation parameters
#
responses = [CORRECT, CORRECT, INCORRECT, INCORRECT, INCORRECT, INCORRECT,
... | |
f2b334c0238e6b3bc37169a7e5681451da9ce424 | Python/155_MinStack.py | Python/155_MinStack.py | class MinStack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self._s = []
self.t = len(self._s)-1
self.curMin = 2147483647
def push(self, x):
"""
:type x: int
:rtype: nothing
"""
self.curMin = x i... | Add solution for 155 min stack. (tooooooo slow) | Add solution for 155 min stack. (tooooooo slow)
| Python | mit | comicxmz001/LeetCode,comicxmz001/LeetCode | Add solution for 155 min stack. (tooooooo slow) | class MinStack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self._s = []
self.t = len(self._s)-1
self.curMin = 2147483647
def push(self, x):
"""
:type x: int
:rtype: nothing
"""
self.curMin = x i... | <commit_before><commit_msg>Add solution for 155 min stack. (tooooooo slow)<commit_after> | class MinStack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self._s = []
self.t = len(self._s)-1
self.curMin = 2147483647
def push(self, x):
"""
:type x: int
:rtype: nothing
"""
self.curMin = x i... | Add solution for 155 min stack. (tooooooo slow)class MinStack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self._s = []
self.t = len(self._s)-1
self.curMin = 2147483647
def push(self, x):
"""
:type x: int
:rtype... | <commit_before><commit_msg>Add solution for 155 min stack. (tooooooo slow)<commit_after>class MinStack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self._s = []
self.t = len(self._s)-1
self.curMin = 2147483647
def push(self, x):
... | |
d989180c24ef7bd114f4138935a35b73e05036c4 | senlin/tests/tempest/api/policies/test_policy_type.py | senlin/tests/tempest/api/policies/test_policy_type.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add API tests for policy type list/show | Add API tests for policy type list/show
Add API tests for policy type list/show
Change-Id: I0d14727264491bbb6a9a668246fc267ab2245611
| Python | apache-2.0 | openstack/senlin,stackforge/senlin,openstack/senlin,stackforge/senlin,openstack/senlin | Add API tests for policy type list/show
Add API tests for policy type list/show
Change-Id: I0d14727264491bbb6a9a668246fc267ab2245611 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before><commit_msg>Add API tests for policy type list/show
Add API tests for policy type list/show
Change-Id: I0d14727264491bbb6a9a668246fc267ab2245611<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add API tests for policy type list/show
Add API tests for policy type list/show
Change-Id: I0d14727264491bbb6a9a668246fc267ab2245611# 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
#
# ht... | <commit_before><commit_msg>Add API tests for policy type list/show
Add API tests for policy type list/show
Change-Id: I0d14727264491bbb6a9a668246fc267ab2245611<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obta... | |
642f513a181f8d4b14b6ecf784002d3010d4e98c | create_master.py | create_master.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Program: Create Master
Programmer: Michael Fryar, Training Analytics Associate, EPoD
Date created: February 16, 2018
Purpose: Create a master file of engagement data and append previous enagement
records to this file. Going forward, new data will be appended to this fi... | Create master engagement data file and append old engagement records | Create master engagement data file and append old engagement records
Going forward, learner engagement downloads will be appended to a master
file. This commit adds a script I wrote to create a master file for each
course and append existing engagement records.
| Python | mit | mefryar/epodx-dashboards,mefryar/epodx-dashboards | Create master engagement data file and append old engagement records
Going forward, learner engagement downloads will be appended to a master
file. This commit adds a script I wrote to create a master file for each
course and append existing engagement records. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Program: Create Master
Programmer: Michael Fryar, Training Analytics Associate, EPoD
Date created: February 16, 2018
Purpose: Create a master file of engagement data and append previous enagement
records to this file. Going forward, new data will be appended to this fi... | <commit_before><commit_msg>Create master engagement data file and append old engagement records
Going forward, learner engagement downloads will be appended to a master
file. This commit adds a script I wrote to create a master file for each
course and append existing engagement records.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Program: Create Master
Programmer: Michael Fryar, Training Analytics Associate, EPoD
Date created: February 16, 2018
Purpose: Create a master file of engagement data and append previous enagement
records to this file. Going forward, new data will be appended to this fi... | Create master engagement data file and append old engagement records
Going forward, learner engagement downloads will be appended to a master
file. This commit adds a script I wrote to create a master file for each
course and append existing engagement records.#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Program:... | <commit_before><commit_msg>Create master engagement data file and append old engagement records
Going forward, learner engagement downloads will be appended to a master
file. This commit adds a script I wrote to create a master file for each
course and append existing engagement records.<commit_after>#!/usr/bin/env py... | |
254ca39eb2c70d1468854de18954121c9b399810 | data_prep.py | data_prep.py | __author__ = 'jacob'
import tarfile
import glob
import os
atlas_filenames = glob.iglob(os.path.join("data", "atlas", "*.tgz"))
cms_filenames = glob.iglob(os.path.join("data", "cms", "*.tgz"))
for fname in atlas_filenames:
tar = tarfile.open(fname, "r:gz")
tar.extractall(path=os.path.join("data", "atlas"))
... | Add simple data extraction for the ATLAS and CMS compressed files | Add simple data extraction for the ATLAS and CMS compressed files
| Python | mit | jacobbieker/ATLAS-Luminosity | Add simple data extraction for the ATLAS and CMS compressed files | __author__ = 'jacob'
import tarfile
import glob
import os
atlas_filenames = glob.iglob(os.path.join("data", "atlas", "*.tgz"))
cms_filenames = glob.iglob(os.path.join("data", "cms", "*.tgz"))
for fname in atlas_filenames:
tar = tarfile.open(fname, "r:gz")
tar.extractall(path=os.path.join("data", "atlas"))
... | <commit_before><commit_msg>Add simple data extraction for the ATLAS and CMS compressed files<commit_after> | __author__ = 'jacob'
import tarfile
import glob
import os
atlas_filenames = glob.iglob(os.path.join("data", "atlas", "*.tgz"))
cms_filenames = glob.iglob(os.path.join("data", "cms", "*.tgz"))
for fname in atlas_filenames:
tar = tarfile.open(fname, "r:gz")
tar.extractall(path=os.path.join("data", "atlas"))
... | Add simple data extraction for the ATLAS and CMS compressed files__author__ = 'jacob'
import tarfile
import glob
import os
atlas_filenames = glob.iglob(os.path.join("data", "atlas", "*.tgz"))
cms_filenames = glob.iglob(os.path.join("data", "cms", "*.tgz"))
for fname in atlas_filenames:
tar = tarfile.open(fname, "... | <commit_before><commit_msg>Add simple data extraction for the ATLAS and CMS compressed files<commit_after>__author__ = 'jacob'
import tarfile
import glob
import os
atlas_filenames = glob.iglob(os.path.join("data", "atlas", "*.tgz"))
cms_filenames = glob.iglob(os.path.join("data", "cms", "*.tgz"))
for fname in atlas_f... | |
ca892587c46070c7e59ee7e893992785ac64965b | kufpybio/restapi.py | kufpybio/restapi.py | import os
import urllib.request
class RESTAPI(object):
"""A general class that handles the local file access or the
retrival of tha file.
"""
def _get_data(self, path_template, url_template, entity_id):
file_path = self._file_path(path_template, entity_id)
if not os.path.exists(file_... | Add a general REST API class | Add a general REST API class
| Python | isc | konrad/kufpybio | Add a general REST API class | import os
import urllib.request
class RESTAPI(object):
"""A general class that handles the local file access or the
retrival of tha file.
"""
def _get_data(self, path_template, url_template, entity_id):
file_path = self._file_path(path_template, entity_id)
if not os.path.exists(file_... | <commit_before><commit_msg>Add a general REST API class<commit_after> | import os
import urllib.request
class RESTAPI(object):
"""A general class that handles the local file access or the
retrival of tha file.
"""
def _get_data(self, path_template, url_template, entity_id):
file_path = self._file_path(path_template, entity_id)
if not os.path.exists(file_... | Add a general REST API classimport os
import urllib.request
class RESTAPI(object):
"""A general class that handles the local file access or the
retrival of tha file.
"""
def _get_data(self, path_template, url_template, entity_id):
file_path = self._file_path(path_template, entity_id)
... | <commit_before><commit_msg>Add a general REST API class<commit_after>import os
import urllib.request
class RESTAPI(object):
"""A general class that handles the local file access or the
retrival of tha file.
"""
def _get_data(self, path_template, url_template, entity_id):
file_path = self._fi... | |
3c1cbe7d701e1c465bdb70a570b905a44e3df73f | tests/view/results/test_finders.py | tests/view/results/test_finders.py | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-12 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 o... | Add tests for results finder. | Add tests for results finder.
| Python | bsd-2-clause | mozilla/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mozilla/moztrap,bobsilverberg/moztrap,mozilla/moztrap,shinglyu/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,mccarrmb/moztrap,mozilla/moztrap,mozilla/moztrap,bobsilverberg/moztrap... | Add tests for results finder. | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-12 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 o... | <commit_before><commit_msg>Add tests for results finder.<commit_after> | # Case Conductor is a Test Case Management system.
# Copyright (C) 2011-12 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 o... | Add tests for results finder.# Case Conductor is a Test Case Management system.
# Copyright (C) 2011-12 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software F... | <commit_before><commit_msg>Add tests for results finder.<commit_after># Case Conductor is a Test Case Management system.
# Copyright (C) 2011-12 Mozilla
#
# This file is part of Case Conductor.
#
# Case Conductor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | |
fd47b9235a95146fc0ccbaf10f4b5c2c217fe401 | libsrc/test/TestXdmfPythonArray.py | libsrc/test/TestXdmfPythonArray.py | import Xdmf
from Xdmf import *
if __name__ == '__main__':
array = Xdmf.XdmfArray()
array.SetNumberType(Xdmf.XDMF_INT64_TYPE)
assert(array.GetNumberType() == Xdmf.XDMF_INT64_TYPE)
array.SetShapeFromString("3 3")
assert(array.GetShapeAsString() == "3 3")
assert(array.GetNumberOfElements() == 9... | Add Xdmf Python Test that writes values to an XdmfArray | ENH: Add Xdmf Python Test that writes values to an XdmfArray
| Python | bsd-3-clause | cjh1/Xdmf2,cjh1/Xdmf2,cjh1/Xdmf2 | ENH: Add Xdmf Python Test that writes values to an XdmfArray | import Xdmf
from Xdmf import *
if __name__ == '__main__':
array = Xdmf.XdmfArray()
array.SetNumberType(Xdmf.XDMF_INT64_TYPE)
assert(array.GetNumberType() == Xdmf.XDMF_INT64_TYPE)
array.SetShapeFromString("3 3")
assert(array.GetShapeAsString() == "3 3")
assert(array.GetNumberOfElements() == 9... | <commit_before><commit_msg>ENH: Add Xdmf Python Test that writes values to an XdmfArray<commit_after> | import Xdmf
from Xdmf import *
if __name__ == '__main__':
array = Xdmf.XdmfArray()
array.SetNumberType(Xdmf.XDMF_INT64_TYPE)
assert(array.GetNumberType() == Xdmf.XDMF_INT64_TYPE)
array.SetShapeFromString("3 3")
assert(array.GetShapeAsString() == "3 3")
assert(array.GetNumberOfElements() == 9... | ENH: Add Xdmf Python Test that writes values to an XdmfArrayimport Xdmf
from Xdmf import *
if __name__ == '__main__':
array = Xdmf.XdmfArray()
array.SetNumberType(Xdmf.XDMF_INT64_TYPE)
assert(array.GetNumberType() == Xdmf.XDMF_INT64_TYPE)
array.SetShapeFromString("3 3")
assert(array.GetShapeAsSt... | <commit_before><commit_msg>ENH: Add Xdmf Python Test that writes values to an XdmfArray<commit_after>import Xdmf
from Xdmf import *
if __name__ == '__main__':
array = Xdmf.XdmfArray()
array.SetNumberType(Xdmf.XDMF_INT64_TYPE)
assert(array.GetNumberType() == Xdmf.XDMF_INT64_TYPE)
array.SetShapeFromSt... | |
35ff343d39dec11909bfffee86b4d467178f5fe8 | acq4/util/threadrun.py | acq4/util/threadrun.py | try:
import queue
except ImportError:
import Queue as queue
from .future import Future
from . import Qt
def runInThread(thread, func, *args, **kwds):
"""Run a function in another thread and return the result.
The remote thread must be running a Qt event loop.
"""
return ThreadCallFuture(threa... | Add utility for calling functions across threads directly | Add utility for calling functions across threads directly
| Python | mit | acq4/acq4,pbmanis/acq4,pbmanis/acq4,pbmanis/acq4,campagnola/acq4,pbmanis/acq4,acq4/acq4,campagnola/acq4,campagnola/acq4,acq4/acq4,campagnola/acq4,acq4/acq4 | Add utility for calling functions across threads directly | try:
import queue
except ImportError:
import Queue as queue
from .future import Future
from . import Qt
def runInThread(thread, func, *args, **kwds):
"""Run a function in another thread and return the result.
The remote thread must be running a Qt event loop.
"""
return ThreadCallFuture(threa... | <commit_before><commit_msg>Add utility for calling functions across threads directly<commit_after> | try:
import queue
except ImportError:
import Queue as queue
from .future import Future
from . import Qt
def runInThread(thread, func, *args, **kwds):
"""Run a function in another thread and return the result.
The remote thread must be running a Qt event loop.
"""
return ThreadCallFuture(threa... | Add utility for calling functions across threads directlytry:
import queue
except ImportError:
import Queue as queue
from .future import Future
from . import Qt
def runInThread(thread, func, *args, **kwds):
"""Run a function in another thread and return the result.
The remote thread must be running a... | <commit_before><commit_msg>Add utility for calling functions across threads directly<commit_after>try:
import queue
except ImportError:
import Queue as queue
from .future import Future
from . import Qt
def runInThread(thread, func, *args, **kwds):
"""Run a function in another thread and return the result.... | |
b55918ee959d8b168b940f44236b9bbab6daed1c | src/hack4lt/models.py | src/hack4lt/models.py | import re
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.core import validators
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_string
from django.utils import timezone
f... | Add CustomUser user model named Hacker. | Add CustomUser user model named Hacker.
| Python | bsd-3-clause | niekas/Hack4LT | Add CustomUser user model named Hacker. | import re
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.core import validators
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_string
from django.utils import timezone
f... | <commit_before><commit_msg>Add CustomUser user model named Hacker.<commit_after> | import re
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.core import validators
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_string
from django.utils import timezone
f... | Add CustomUser user model named Hacker.import re
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.core import validators
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_str... | <commit_before><commit_msg>Add CustomUser user model named Hacker.<commit_after>import re
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.core import validators
from django.core.mail import send_mail
from django.db import models
from dj... | |
c9d352b6dbb5d094e97d578d6dd3696c31d02217 | hyper/http20/error_code_registry.py | hyper/http20/error_code_registry.py | # -*- coding: utf-8 -*-
"""
hyper/http20/error_code_registry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Global error code registry containing the established HTTP/2 error codes.
The registry is based on a 32-bit space so we use the error code to index into
the array.
The current registry is available at:
https://tools.ietf.org... | Add HTTP2 error code registry | Add HTTP2 error code registry
| Python | mit | irvind/hyper,lawnmowerlatte/hyper,irvind/hyper,Lukasa/hyper,jdecuyper/hyper,fredthomsen/hyper,jdecuyper/hyper,lawnmowerlatte/hyper,Lukasa/hyper,plucury/hyper,masaori335/hyper,masaori335/hyper,plucury/hyper,fredthomsen/hyper | Add HTTP2 error code registry | # -*- coding: utf-8 -*-
"""
hyper/http20/error_code_registry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Global error code registry containing the established HTTP/2 error codes.
The registry is based on a 32-bit space so we use the error code to index into
the array.
The current registry is available at:
https://tools.ietf.org... | <commit_before><commit_msg>Add HTTP2 error code registry<commit_after> | # -*- coding: utf-8 -*-
"""
hyper/http20/error_code_registry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Global error code registry containing the established HTTP/2 error codes.
The registry is based on a 32-bit space so we use the error code to index into
the array.
The current registry is available at:
https://tools.ietf.org... | Add HTTP2 error code registry# -*- coding: utf-8 -*-
"""
hyper/http20/error_code_registry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Global error code registry containing the established HTTP/2 error codes.
The registry is based on a 32-bit space so we use the error code to index into
the array.
The current registry is availab... | <commit_before><commit_msg>Add HTTP2 error code registry<commit_after># -*- coding: utf-8 -*-
"""
hyper/http20/error_code_registry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Global error code registry containing the established HTTP/2 error codes.
The registry is based on a 32-bit space so we use the error code to index into
th... | |
0979da2fa3fdb59029c1e1e9f12a84388ab4f711 | templatetags/uuid.py | templatetags/uuid.py | # -*- coding: utf-8 -*-
#
# File: uuid.py
# Author: Kenson Man <[email protected]>
# Desc: The template-tag used to generate a uuid into output.
# Sample:
# {%uuid%} # Generate a UUID and output
# {%uuid as abc%} # Generate a UUID and store into abc
#
from django.template import Library, Node, Templ... | Add the UUID template-tag that generate the UUID | Add the UUID template-tag that generate the UUID
| Python | apache-2.0 | kensonman/webframe,kensonman/webframe,kensonman/webframe | Add the UUID template-tag that generate the UUID | # -*- coding: utf-8 -*-
#
# File: uuid.py
# Author: Kenson Man <[email protected]>
# Desc: The template-tag used to generate a uuid into output.
# Sample:
# {%uuid%} # Generate a UUID and output
# {%uuid as abc%} # Generate a UUID and store into abc
#
from django.template import Library, Node, Templ... | <commit_before><commit_msg>Add the UUID template-tag that generate the UUID<commit_after> | # -*- coding: utf-8 -*-
#
# File: uuid.py
# Author: Kenson Man <[email protected]>
# Desc: The template-tag used to generate a uuid into output.
# Sample:
# {%uuid%} # Generate a UUID and output
# {%uuid as abc%} # Generate a UUID and store into abc
#
from django.template import Library, Node, Templ... | Add the UUID template-tag that generate the UUID# -*- coding: utf-8 -*-
#
# File: uuid.py
# Author: Kenson Man <[email protected]>
# Desc: The template-tag used to generate a uuid into output.
# Sample:
# {%uuid%} # Generate a UUID and output
# {%uuid as abc%} # Generate a UUID and store into abc
#
... | <commit_before><commit_msg>Add the UUID template-tag that generate the UUID<commit_after># -*- coding: utf-8 -*-
#
# File: uuid.py
# Author: Kenson Man <[email protected]>
# Desc: The template-tag used to generate a uuid into output.
# Sample:
# {%uuid%} # Generate a UUID and output
# {%uuid as abc%... | |
eb98ff894b15068291c22fcfb87356e4af193646 | alembic/versions/fa7e12c88c5_add_filter_field_to_users.py | alembic/versions/fa7e12c88c5_add_filter_field_to_users.py | """Add filter field to users.
Revision ID: fa7e12c88c5
Revises: 2325abc7de81
Create Date: 2015-10-13 21:06:15.875359
"""
# revision identifiers, used by Alembic.
revision = 'fa7e12c88c5'
down_revision = '2325abc7de81'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalch... | Add filter field to users (migration). | Add filter field to users (migration).
| Python | agpl-3.0 | MSPARP/newparp,MSPARP/newparp,MSPARP/newparp | Add filter field to users (migration). | """Add filter field to users.
Revision ID: fa7e12c88c5
Revises: 2325abc7de81
Create Date: 2015-10-13 21:06:15.875359
"""
# revision identifiers, used by Alembic.
revision = 'fa7e12c88c5'
down_revision = '2325abc7de81'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalch... | <commit_before><commit_msg>Add filter field to users (migration).<commit_after> | """Add filter field to users.
Revision ID: fa7e12c88c5
Revises: 2325abc7de81
Create Date: 2015-10-13 21:06:15.875359
"""
# revision identifiers, used by Alembic.
revision = 'fa7e12c88c5'
down_revision = '2325abc7de81'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalch... | Add filter field to users (migration)."""Add filter field to users.
Revision ID: fa7e12c88c5
Revises: 2325abc7de81
Create Date: 2015-10-13 21:06:15.875359
"""
# revision identifiers, used by Alembic.
revision = 'fa7e12c88c5'
down_revision = '2325abc7de81'
branch_labels = None
depends_on = None
from alembic import o... | <commit_before><commit_msg>Add filter field to users (migration).<commit_after>"""Add filter field to users.
Revision ID: fa7e12c88c5
Revises: 2325abc7de81
Create Date: 2015-10-13 21:06:15.875359
"""
# revision identifiers, used by Alembic.
revision = 'fa7e12c88c5'
down_revision = '2325abc7de81'
branch_labels = None... | |
eff1cc5dabd366ca4cbf6e8c97b97727327f29d5 | test/option--.py | test/option--.py | #!/usr/bin/env python
__revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__"
import TestCmd
import os.path
import string
import sys
test = TestCmd.TestCmd(program = 'scons.py',
workdir = '',
interpreter = 'python')
test.write('build.py', r"""
import sys
f... | Add a test for -- terminating option processing. | Add a test for -- terminating option processing.
| Python | mit | azatoth/scons,azatoth/scons,azatoth/scons,azatoth/scons,azatoth/scons | Add a test for -- terminating option processing. | #!/usr/bin/env python
__revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__"
import TestCmd
import os.path
import string
import sys
test = TestCmd.TestCmd(program = 'scons.py',
workdir = '',
interpreter = 'python')
test.write('build.py', r"""
import sys
f... | <commit_before><commit_msg>Add a test for -- terminating option processing.<commit_after> | #!/usr/bin/env python
__revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__"
import TestCmd
import os.path
import string
import sys
test = TestCmd.TestCmd(program = 'scons.py',
workdir = '',
interpreter = 'python')
test.write('build.py', r"""
import sys
f... | Add a test for -- terminating option processing.#!/usr/bin/env python
__revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__"
import TestCmd
import os.path
import string
import sys
test = TestCmd.TestCmd(program = 'scons.py',
workdir = '',
interpreter = 'py... | <commit_before><commit_msg>Add a test for -- terminating option processing.<commit_after>#!/usr/bin/env python
__revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__"
import TestCmd
import os.path
import string
import sys
test = TestCmd.TestCmd(program = 'scons.py',
workdir = '',... | |
53edb67dd3a7a88d9133a85cd2fe1a9d22a3a436 | doc/examples/plot_piecewise_affine.py | doc/examples/plot_piecewise_affine.py | """
===============================
Piecewise Affine Transformation
===============================
This example shows how to use the Piecewise Affine Transformation.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import PiecewiseAffineTransform, warp
from skimage import data
image = ... | Add example script for piecewise affine transform | Add example script for piecewise affine transform
| Python | bsd-3-clause | jwiggins/scikit-image,jwiggins/scikit-image,ofgulban/scikit-image,SamHames/scikit-image,chintak/scikit-image,rjeli/scikit-image,newville/scikit-image,ofgulban/scikit-image,juliusbierk/scikit-image,oew1v07/scikit-image,almarklein/scikit-image,chriscrosscutler/scikit-image,pratapvardhan/scikit-image,chintak/scikit-image,... | Add example script for piecewise affine transform | """
===============================
Piecewise Affine Transformation
===============================
This example shows how to use the Piecewise Affine Transformation.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import PiecewiseAffineTransform, warp
from skimage import data
image = ... | <commit_before><commit_msg>Add example script for piecewise affine transform<commit_after> | """
===============================
Piecewise Affine Transformation
===============================
This example shows how to use the Piecewise Affine Transformation.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import PiecewiseAffineTransform, warp
from skimage import data
image = ... | Add example script for piecewise affine transform"""
===============================
Piecewise Affine Transformation
===============================
This example shows how to use the Piecewise Affine Transformation.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import PiecewiseAffineTr... | <commit_before><commit_msg>Add example script for piecewise affine transform<commit_after>"""
===============================
Piecewise Affine Transformation
===============================
This example shows how to use the Piecewise Affine Transformation.
"""
import numpy as np
import matplotlib.pyplot as plt
from s... | |
e85dd9773b6c76a0b437bee182d2aafedd3ead8d | cenaming/us_states.py | cenaming/us_states.py |
STATE_NAMES = (
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California',
'Colorado',
'Connecticut',
'Delaware',
'Florida',
'Georgia',
'Hawaii',
'Idaho',
'Illinois',
'Indiana',
'Iowa',
'Kansas',
'Kentucky',
'Louisiana',
'Maine',
'Maryland'... | Add list of US state names. | Add list of US state names.
| Python | mit | portfoliome/cenaming | Add list of US state names. |
STATE_NAMES = (
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California',
'Colorado',
'Connecticut',
'Delaware',
'Florida',
'Georgia',
'Hawaii',
'Idaho',
'Illinois',
'Indiana',
'Iowa',
'Kansas',
'Kentucky',
'Louisiana',
'Maine',
'Maryland'... | <commit_before><commit_msg>Add list of US state names.<commit_after> |
STATE_NAMES = (
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California',
'Colorado',
'Connecticut',
'Delaware',
'Florida',
'Georgia',
'Hawaii',
'Idaho',
'Illinois',
'Indiana',
'Iowa',
'Kansas',
'Kentucky',
'Louisiana',
'Maine',
'Maryland'... | Add list of US state names.
STATE_NAMES = (
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California',
'Colorado',
'Connecticut',
'Delaware',
'Florida',
'Georgia',
'Hawaii',
'Idaho',
'Illinois',
'Indiana',
'Iowa',
'Kansas',
'Kentucky',
'Louisiana',
... | <commit_before><commit_msg>Add list of US state names.<commit_after>
STATE_NAMES = (
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California',
'Colorado',
'Connecticut',
'Delaware',
'Florida',
'Georgia',
'Hawaii',
'Idaho',
'Illinois',
'Indiana',
'Iowa',
'K... | |
03edf22323d78989210a4cbefda7597158d33b42 | fire_rs/planning/front_observation.py | fire_rs/planning/front_observation.py | import logging
import numpy as np
import matplotlib.pyplot as plt
from fire_rs.geodata import environment
import fire_rs.firemodel.propagation as propagation
import fire_rs.display
import fire_rs.planning.observation_path_search
def burn(area_bounds, ignition_point, wind):
"""Burn some area from an ignition point... | Test the regression path planning on simulated fire fronts | Test the regression path planning on simulated fire fronts
| Python | bsd-2-clause | fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop | Test the regression path planning on simulated fire fronts | import logging
import numpy as np
import matplotlib.pyplot as plt
from fire_rs.geodata import environment
import fire_rs.firemodel.propagation as propagation
import fire_rs.display
import fire_rs.planning.observation_path_search
def burn(area_bounds, ignition_point, wind):
"""Burn some area from an ignition point... | <commit_before><commit_msg>Test the regression path planning on simulated fire fronts<commit_after> | import logging
import numpy as np
import matplotlib.pyplot as plt
from fire_rs.geodata import environment
import fire_rs.firemodel.propagation as propagation
import fire_rs.display
import fire_rs.planning.observation_path_search
def burn(area_bounds, ignition_point, wind):
"""Burn some area from an ignition point... | Test the regression path planning on simulated fire frontsimport logging
import numpy as np
import matplotlib.pyplot as plt
from fire_rs.geodata import environment
import fire_rs.firemodel.propagation as propagation
import fire_rs.display
import fire_rs.planning.observation_path_search
def burn(area_bounds, ignition_... | <commit_before><commit_msg>Test the regression path planning on simulated fire fronts<commit_after>import logging
import numpy as np
import matplotlib.pyplot as plt
from fire_rs.geodata import environment
import fire_rs.firemodel.propagation as propagation
import fire_rs.display
import fire_rs.planning.observation_path... | |
6e5460b61f0b12e913b12d609c87df3f8e3e8afb | froide/foirequest/migrations/0041_auto_20191024_2025.py | froide/foirequest/migrations/0041_auto_20191024_2025.py | # Generated by Django 2.2.2 on 2019-10-24 18:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foirequest', '0040_auto_20190718_1815'),
]
operations = [
migrations.AlterField(
model_name='foimessage',
name='kind... | Add upload to foimessage kind choices | Add upload to foimessage kind choices | Python | mit | fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide | Add upload to foimessage kind choices | # Generated by Django 2.2.2 on 2019-10-24 18:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foirequest', '0040_auto_20190718_1815'),
]
operations = [
migrations.AlterField(
model_name='foimessage',
name='kind... | <commit_before><commit_msg>Add upload to foimessage kind choices<commit_after> | # Generated by Django 2.2.2 on 2019-10-24 18:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foirequest', '0040_auto_20190718_1815'),
]
operations = [
migrations.AlterField(
model_name='foimessage',
name='kind... | Add upload to foimessage kind choices# Generated by Django 2.2.2 on 2019-10-24 18:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foirequest', '0040_auto_20190718_1815'),
]
operations = [
migrations.AlterField(
model_name... | <commit_before><commit_msg>Add upload to foimessage kind choices<commit_after># Generated by Django 2.2.2 on 2019-10-24 18:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foirequest', '0040_auto_20190718_1815'),
]
operations = [
migr... | |
9f05f7f9367c89d5fd2073adb3969f2b010bdf1f | tools/id4glossary.py | tools/id4glossary.py | #!/usr/bin/env python
"""Pandoc filter to convert add ids to glossary entries.
Usage:
pandoc source.md --filter=id4glossary.py --output=output.html
"""
import pandocfilters as pf
def normalize_keyword(keyword):
"""Normalize keyword for became id
- Replace white space with '-'
- Convert to lowercase"... | Add id to glossary entry | Add id to glossary entry
This is needed to enable users jump to glossary entries.
| Python | mit | RobIsaTeam/courses,easyreporting/fmri_reporting,easyreporting/fmri_reporting,easyreporting/fmri_reporting,RobIsaTeam/courses,easyreporting/fmri_reporting,easyreporting/fmri_reporting,easyreporting/fmri_reporting | Add id to glossary entry
This is needed to enable users jump to glossary entries. | #!/usr/bin/env python
"""Pandoc filter to convert add ids to glossary entries.
Usage:
pandoc source.md --filter=id4glossary.py --output=output.html
"""
import pandocfilters as pf
def normalize_keyword(keyword):
"""Normalize keyword for became id
- Replace white space with '-'
- Convert to lowercase"... | <commit_before><commit_msg>Add id to glossary entry
This is needed to enable users jump to glossary entries.<commit_after> | #!/usr/bin/env python
"""Pandoc filter to convert add ids to glossary entries.
Usage:
pandoc source.md --filter=id4glossary.py --output=output.html
"""
import pandocfilters as pf
def normalize_keyword(keyword):
"""Normalize keyword for became id
- Replace white space with '-'
- Convert to lowercase"... | Add id to glossary entry
This is needed to enable users jump to glossary entries.#!/usr/bin/env python
"""Pandoc filter to convert add ids to glossary entries.
Usage:
pandoc source.md --filter=id4glossary.py --output=output.html
"""
import pandocfilters as pf
def normalize_keyword(keyword):
"""Normalize key... | <commit_before><commit_msg>Add id to glossary entry
This is needed to enable users jump to glossary entries.<commit_after>#!/usr/bin/env python
"""Pandoc filter to convert add ids to glossary entries.
Usage:
pandoc source.md --filter=id4glossary.py --output=output.html
"""
import pandocfilters as pf
def normali... | |
655a18258d13c00e39e1f0cbf9369215d5d084ae | parse_setup_data.py | parse_setup_data.py | #!/usr/bin/env python
# Copyright (C) 2014 Instituto Nokia de Tecnologia - INdT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any... | Add initial script for parsing Setup Data packets | Add initial script for parsing Setup Data packets
| Python | mit | lizardo/nrf8001,lizardo/nrf8001,lizardo/nrf8001 | Add initial script for parsing Setup Data packets | #!/usr/bin/env python
# Copyright (C) 2014 Instituto Nokia de Tecnologia - INdT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any... | <commit_before><commit_msg>Add initial script for parsing Setup Data packets<commit_after> | #!/usr/bin/env python
# Copyright (C) 2014 Instituto Nokia de Tecnologia - INdT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any... | Add initial script for parsing Setup Data packets#!/usr/bin/env python
# Copyright (C) 2014 Instituto Nokia de Tecnologia - INdT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ver... | <commit_before><commit_msg>Add initial script for parsing Setup Data packets<commit_after>#!/usr/bin/env python
# Copyright (C) 2014 Instituto Nokia de Tecnologia - INdT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | |
6ce12955861c1f586d69dedffc014a1d5bab5432 | util/item_name_gen.py | util/item_name_gen.py | '''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % base
num = num // base
a... | Add item name gen script | Add item name gen script
| Python | unlicense | ArchiveTeam/twitpic-grab2,ArchiveTeam/twitpic-grab2 | Add item name gen script | '''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % base
num = num // base
a... | <commit_before><commit_msg>Add item name gen script<commit_after> | '''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % base
num = num // base
a... | Add item name gen script'''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % base
num... | <commit_before><commit_msg>Add item name gen script<commit_after>'''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while ... | |
65f8b529af8672ac074d4c45684d8e0f7baaab2c | ideascube/conf/kb_jor_croixrouge.py | ideascube/conf/kb_jor_croixrouge.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'ar'
IDEASCUBE_NAME = 'Red Cross'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'wikipedia',
'languages': ['ar', 'en']
},
{
... | Add conf for Red Cross Jordanie | Add conf for Red Cross Jordanie
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | Add conf for Red Cross Jordanie | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'ar'
IDEASCUBE_NAME = 'Red Cross'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'wikipedia',
'languages': ['ar', 'en']
},
{
... | <commit_before><commit_msg>Add conf for Red Cross Jordanie<commit_after> | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'ar'
IDEASCUBE_NAME = 'Red Cross'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'wikipedia',
'languages': ['ar', 'en']
},
{
... | Add conf for Red Cross Jordanie# -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'ar'
IDEASCUBE_NAME = 'Red Cross'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'wikipedia',
'languages': ['a... | <commit_before><commit_msg>Add conf for Red Cross Jordanie<commit_after># -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'ar'
IDEASCUBE_NAME = 'Red Cross'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'i... | |
6d255990983405fe7eb1322c9d02414c859d1e96 | tests/app/test_openid_listener.py | tests/app/test_openid_listener.py | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# 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 la... | Add tests for the openid lister for FederationReaderServer | Add tests for the openid lister for FederationReaderServer
Check all possible variants of openid and federation listener on/off
possibilities.
Signed-off-by: Jason Robinson <[email protected]>
| Python | apache-2.0 | matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse | Add tests for the openid lister for FederationReaderServer
Check all possible variants of openid and federation listener on/off
possibilities.
Signed-off-by: Jason Robinson <[email protected]> | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# 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 la... | <commit_before><commit_msg>Add tests for the openid lister for FederationReaderServer
Check all possible variants of openid and federation listener on/off
possibilities.
Signed-off-by: Jason Robinson <[email protected]><commit_after> | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# 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 la... | Add tests for the openid lister for FederationReaderServer
Check all possible variants of openid and federation listener on/off
possibilities.
Signed-off-by: Jason Robinson <[email protected]># -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# Licensed under the Apache Licens... | <commit_before><commit_msg>Add tests for the openid lister for FederationReaderServer
Check all possible variants of openid and federation listener on/off
possibilities.
Signed-off-by: Jason Robinson <[email protected]><commit_after># -*- coding: utf-8 -*-
# Copyright 2018 New Vector... | |
a24d0fce91f3f7a261a410d859ecd4250276fa28 | python/smqtk/tests/utils/test_image_utils.py | python/smqtk/tests/utils/test_image_utils.py | import os
import unittest
import nose.tools as ntools
from smqtk.representation.data_element.file_element import DataFileElement
from smqtk.tests import TEST_DATA_DIR
from smqtk.utils.image_utils import is_loadable_image, is_valid_element
class TestIsLoadableImage(unittest.TestCase):
def setUp(self):
s... | Add unit tests for image_utils | Add unit tests for image_utils
| Python | bsd-3-clause | Purg/SMQTK,Purg/SMQTK,Purg/SMQTK,Purg/SMQTK,Purg/SMQTK,Purg/SMQTK,Purg/SMQTK,Purg/SMQTK,Purg/SMQTK | Add unit tests for image_utils | import os
import unittest
import nose.tools as ntools
from smqtk.representation.data_element.file_element import DataFileElement
from smqtk.tests import TEST_DATA_DIR
from smqtk.utils.image_utils import is_loadable_image, is_valid_element
class TestIsLoadableImage(unittest.TestCase):
def setUp(self):
s... | <commit_before><commit_msg>Add unit tests for image_utils<commit_after> | import os
import unittest
import nose.tools as ntools
from smqtk.representation.data_element.file_element import DataFileElement
from smqtk.tests import TEST_DATA_DIR
from smqtk.utils.image_utils import is_loadable_image, is_valid_element
class TestIsLoadableImage(unittest.TestCase):
def setUp(self):
s... | Add unit tests for image_utilsimport os
import unittest
import nose.tools as ntools
from smqtk.representation.data_element.file_element import DataFileElement
from smqtk.tests import TEST_DATA_DIR
from smqtk.utils.image_utils import is_loadable_image, is_valid_element
class TestIsLoadableImage(unittest.TestCase):
... | <commit_before><commit_msg>Add unit tests for image_utils<commit_after>import os
import unittest
import nose.tools as ntools
from smqtk.representation.data_element.file_element import DataFileElement
from smqtk.tests import TEST_DATA_DIR
from smqtk.utils.image_utils import is_loadable_image, is_valid_element
class ... | |
4a89c8c136f4af1ec699a53211a9423efe33c3be | libbmc/papers/tearpages.py | libbmc/papers/tearpages.py | """
This file contains the necessary functions to determine whether we should tear
the first page from a PDF file, and actually tear it.
"""
import tearpages
# List of bad publishers which adds an extra useless first page, which can be
# teared. Please, submit a PR to include new ones which I may not be aware of!
BAD... | Add some functions to tear first pages from a PDF | Add some functions to tear first pages from a PDF
| Python | mit | Phyks/libbmc | Add some functions to tear first pages from a PDF | """
This file contains the necessary functions to determine whether we should tear
the first page from a PDF file, and actually tear it.
"""
import tearpages
# List of bad publishers which adds an extra useless first page, which can be
# teared. Please, submit a PR to include new ones which I may not be aware of!
BAD... | <commit_before><commit_msg>Add some functions to tear first pages from a PDF<commit_after> | """
This file contains the necessary functions to determine whether we should tear
the first page from a PDF file, and actually tear it.
"""
import tearpages
# List of bad publishers which adds an extra useless first page, which can be
# teared. Please, submit a PR to include new ones which I may not be aware of!
BAD... | Add some functions to tear first pages from a PDF"""
This file contains the necessary functions to determine whether we should tear
the first page from a PDF file, and actually tear it.
"""
import tearpages
# List of bad publishers which adds an extra useless first page, which can be
# teared. Please, submit a PR to ... | <commit_before><commit_msg>Add some functions to tear first pages from a PDF<commit_after>"""
This file contains the necessary functions to determine whether we should tear
the first page from a PDF file, and actually tear it.
"""
import tearpages
# List of bad publishers which adds an extra useless first page, which... | |
69fe4ba3cc0338b4cd962e0571b9ae1d54e139ee | website/addons/base/serializer.py | website/addons/base/serializer.py | import abc
from website.util import web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, addon_node_settings, user):
self.addon_node_settings = addon_node_settings
self.user = user
@abc.abstractproperty
def serialized_urls(self):
pass
... | Add base class for serializing addons. | Add base class for serializing addons.
| Python | apache-2.0 | SSJohns/osf.io,chrisseto/osf.io,aaxelb/osf.io,Nesiehr/osf.io,petermalcolm/osf.io,kwierman/osf.io,MerlinZhang/osf.io,ZobairAlijan/osf.io,SSJohns/osf.io,caseyrygt/osf.io,DanielSBrown/osf.io,baylee-d/osf.io,jmcarp/osf.io,ticklemepierce/osf.io,CenterForOpenScience/osf.io,njantrania/osf.io,asanfilippo7/osf.io,HarryRybacki/o... | Add base class for serializing addons. | import abc
from website.util import web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, addon_node_settings, user):
self.addon_node_settings = addon_node_settings
self.user = user
@abc.abstractproperty
def serialized_urls(self):
pass
... | <commit_before><commit_msg>Add base class for serializing addons.<commit_after> | import abc
from website.util import web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, addon_node_settings, user):
self.addon_node_settings = addon_node_settings
self.user = user
@abc.abstractproperty
def serialized_urls(self):
pass
... | Add base class for serializing addons.import abc
from website.util import web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, addon_node_settings, user):
self.addon_node_settings = addon_node_settings
self.user = user
@abc.abstractproperty
def se... | <commit_before><commit_msg>Add base class for serializing addons.<commit_after>import abc
from website.util import web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, addon_node_settings, user):
self.addon_node_settings = addon_node_settings
self.user = u... | |
0d897c469d168d0362e71c26d039163fd0d3bdd2 | zerver/management/commands/client-activity.py | zerver/management/commands/client-activity.py | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.models import UserActivity, UserProfile, Realm, \
get_realm, get_user_profile_by_email
import datetime
class Command(BaseCommand):
help = """Report rough client activity ... | Add a utility to report some rough recent client activity metrics. | Add a utility to report some rough recent client activity metrics.
(imported from commit 27b4a70871939b2728fcbe0ce5824326ff4decc2)
| Python | apache-2.0 | pradiptad/zulip,esander91/zulip,JPJPJPOPOP/zulip,hustlzp/zulip,MayB/zulip,AZtheAsian/zulip,ApsOps/zulip,MayB/zulip,amallia/zulip,bowlofstew/zulip,ufosky-server/zulip,showell/zulip,vabs22/zulip,qq1012803704/zulip,mohsenSy/zulip,he15his/zulip,atomic-labs/zulip,andersk/zulip,johnnygaddarr/zulip,tiansiyuan/zulip,AZtheAsian... | Add a utility to report some rough recent client activity metrics.
(imported from commit 27b4a70871939b2728fcbe0ce5824326ff4decc2) | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.models import UserActivity, UserProfile, Realm, \
get_realm, get_user_profile_by_email
import datetime
class Command(BaseCommand):
help = """Report rough client activity ... | <commit_before><commit_msg>Add a utility to report some rough recent client activity metrics.
(imported from commit 27b4a70871939b2728fcbe0ce5824326ff4decc2)<commit_after> | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.models import UserActivity, UserProfile, Realm, \
get_realm, get_user_profile_by_email
import datetime
class Command(BaseCommand):
help = """Report rough client activity ... | Add a utility to report some rough recent client activity metrics.
(imported from commit 27b4a70871939b2728fcbe0ce5824326ff4decc2)from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.models import UserActivity, UserProfile, Realm, \... | <commit_before><commit_msg>Add a utility to report some rough recent client activity metrics.
(imported from commit 27b4a70871939b2728fcbe0ce5824326ff4decc2)<commit_after>from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.db.models import Count
from zerver.models i... | |
582ceb3f429415251c06f576712a3b2ddbf4496a | src/ggrc/migrations/versions/20161109010604_4afe69ce3c38_remove_invalid_person_objects.py | src/ggrc/migrations/versions/20161109010604_4afe69ce3c38_remove_invalid_person_objects.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Remove invalid person objects
Create Date: 2016-11-09 01:06:04.745331
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic imp... | Remove bad data form object_people table | Remove bad data form object_people table
The InterviewResponse object was not properly removed from all tables
when the model was deleted. Memcache then tried to remove this non
existent model, which resulted in an exception. This migration makes
sure that such bad data is properly purged from our database.
| Python | apache-2.0 | AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core... | Remove bad data form object_people table
The InterviewResponse object was not properly removed from all tables
when the model was deleted. Memcache then tried to remove this non
existent model, which resulted in an exception. This migration makes
sure that such bad data is properly purged from our database. | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Remove invalid person objects
Create Date: 2016-11-09 01:06:04.745331
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic imp... | <commit_before><commit_msg>Remove bad data form object_people table
The InterviewResponse object was not properly removed from all tables
when the model was deleted. Memcache then tried to remove this non
existent model, which resulted in an exception. This migration makes
sure that such bad data is properly purged fr... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Remove invalid person objects
Create Date: 2016-11-09 01:06:04.745331
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic imp... | Remove bad data form object_people table
The InterviewResponse object was not properly removed from all tables
when the model was deleted. Memcache then tried to remove this non
existent model, which resulted in an exception. This migration makes
sure that such bad data is properly purged from our database.# Copyright... | <commit_before><commit_msg>Remove bad data form object_people table
The InterviewResponse object was not properly removed from all tables
when the model was deleted. Memcache then tried to remove this non
existent model, which resulted in an exception. This migration makes
sure that such bad data is properly purged fr... | |
61625103a328f3377afd5565d246d3bc43bee766 | murano/db/migration/alembic_migrations/versions/016_increase_task_description_text_size.py | murano/db/migration/alembic_migrations/versions/016_increase_task_description_text_size.py | # Copyright 2016 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Increase description column length in task table | Increase description column length in task table
Previously we changed description column in environment
table from TEXT to LONGTEXT but forgot to do the same
for similar column in the task task table
Change-Id: I3a2bd0204a9fac2d583d8742ca72868bd20c49b4
Closes-Bug: #1616997
| Python | apache-2.0 | DavidPurcell/murano_temp,DavidPurcell/murano_temp,openstack/murano,DavidPurcell/murano_temp,DavidPurcell/murano_temp,openstack/murano | Increase description column length in task table
Previously we changed description column in environment
table from TEXT to LONGTEXT but forgot to do the same
for similar column in the task task table
Change-Id: I3a2bd0204a9fac2d583d8742ca72868bd20c49b4
Closes-Bug: #1616997 | # Copyright 2016 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before><commit_msg>Increase description column length in task table
Previously we changed description column in environment
table from TEXT to LONGTEXT but forgot to do the same
for similar column in the task task table
Change-Id: I3a2bd0204a9fac2d583d8742ca72868bd20c49b4
Closes-Bug: #1616997<commit_after> | # Copyright 2016 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Increase description column length in task table
Previously we changed description column in environment
table from TEXT to LONGTEXT but forgot to do the same
for similar column in the task task table
Change-Id: I3a2bd0204a9fac2d583d8742ca72868bd20c49b4
Closes-Bug: #1616997# Copyright 2016 OpenStack Foundation.
#
# L... | <commit_before><commit_msg>Increase description column length in task table
Previously we changed description column in environment
table from TEXT to LONGTEXT but forgot to do the same
for similar column in the task task table
Change-Id: I3a2bd0204a9fac2d583d8742ca72868bd20c49b4
Closes-Bug: #1616997<commit_after># C... | |
8999ac7e9808a47a5f751edb2fed6d421357112c | aurorawatchuk/examples/get_status.py | aurorawatchuk/examples/get_status.py | #!/usr/bin/env python
import aurorawatchuk
import datetime
import logging
import os
import time
logger = logging.getLogger(__name__)
# Set logging level to debug to that HTTP GETs are indicated
logging.basicConfig(level=logging.DEBUG)
# If desired set user agent string. Must be set before first use.
aurorawatchuk.u... | Add example to show basic usage | Add example to show basic usage
| Python | mit | stevemarple/python-aurorawatchuk | Add example to show basic usage | #!/usr/bin/env python
import aurorawatchuk
import datetime
import logging
import os
import time
logger = logging.getLogger(__name__)
# Set logging level to debug to that HTTP GETs are indicated
logging.basicConfig(level=logging.DEBUG)
# If desired set user agent string. Must be set before first use.
aurorawatchuk.u... | <commit_before><commit_msg>Add example to show basic usage<commit_after> | #!/usr/bin/env python
import aurorawatchuk
import datetime
import logging
import os
import time
logger = logging.getLogger(__name__)
# Set logging level to debug to that HTTP GETs are indicated
logging.basicConfig(level=logging.DEBUG)
# If desired set user agent string. Must be set before first use.
aurorawatchuk.u... | Add example to show basic usage#!/usr/bin/env python
import aurorawatchuk
import datetime
import logging
import os
import time
logger = logging.getLogger(__name__)
# Set logging level to debug to that HTTP GETs are indicated
logging.basicConfig(level=logging.DEBUG)
# If desired set user agent string. Must be set be... | <commit_before><commit_msg>Add example to show basic usage<commit_after>#!/usr/bin/env python
import aurorawatchuk
import datetime
import logging
import os
import time
logger = logging.getLogger(__name__)
# Set logging level to debug to that HTTP GETs are indicated
logging.basicConfig(level=logging.DEBUG)
# If desi... | |
3ca5a70286974457bce38a52cce81c8e076f0a0c | python/hashlib_md5_sha/md5sum_string.py | python/hashlib_md5_sha/md5sum_string.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | Add a snippet in 'python/hashlib_md5_sha'. | Add a snippet in 'python/hashlib_md5_sha'.
| Python | mit | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | Add a snippet in 'python/hashlib_md5_sha'. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | <commit_before><commit_msg>Add a snippet in 'python/hashlib_md5_sha'.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | Add a snippet in 'python/hashlib_md5_sha'.#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Soft... | <commit_before><commit_msg>Add a snippet in 'python/hashlib_md5_sha'.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation file... | |
b5d8303f4def7de4814f73d02d5e143cbeb2baa7 | code/ex3.2-aio_multiple_requests.py | code/ex3.2-aio_multiple_requests.py | import asyncio
import aiohttp
import time
URLS = [
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
]
@asyncio.coroutine
def request_greetings():
response_tasks = yield from asyncio.wait([aiohttp.get(url) for url in URLS])
text_tasks = yield from asyncio.wait(
[ta... | Add ex3.2: multiple aiohttp requests | Add ex3.2: multiple aiohttp requests
| Python | mit | MA3STR0/PythonAsyncWorkshop | Add ex3.2: multiple aiohttp requests | import asyncio
import aiohttp
import time
URLS = [
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
]
@asyncio.coroutine
def request_greetings():
response_tasks = yield from asyncio.wait([aiohttp.get(url) for url in URLS])
text_tasks = yield from asyncio.wait(
[ta... | <commit_before><commit_msg>Add ex3.2: multiple aiohttp requests<commit_after> | import asyncio
import aiohttp
import time
URLS = [
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
]
@asyncio.coroutine
def request_greetings():
response_tasks = yield from asyncio.wait([aiohttp.get(url) for url in URLS])
text_tasks = yield from asyncio.wait(
[ta... | Add ex3.2: multiple aiohttp requestsimport asyncio
import aiohttp
import time
URLS = [
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
]
@asyncio.coroutine
def request_greetings():
response_tasks = yield from asyncio.wait([aiohttp.get(url) for url in URLS])
text_tasks = ... | <commit_before><commit_msg>Add ex3.2: multiple aiohttp requests<commit_after>import asyncio
import aiohttp
import time
URLS = [
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
]
@asyncio.coroutine
def request_greetings():
response_tasks = yield from asyncio.wait([aiohttp.get... | |
d491c60d089e5c6872cb0e0abf8cdd0e0a4e3bee | migrations/0002_auto_20190327_1951.py | migrations/0002_auto_20190327_1951.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-27 19:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('downloads', '0001_initial'),
]
operations = [
migrations.AlterField(
... | Update migrations for Django 1.11 and Python 3 | Update migrations for Django 1.11 and Python 3
| Python | mit | mback2k/django-app-downloads,mback2k/django-app-downloads | Update migrations for Django 1.11 and Python 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-27 19:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('downloads', '0001_initial'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Update migrations for Django 1.11 and Python 3<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-27 19:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('downloads', '0001_initial'),
]
operations = [
migrations.AlterField(
... | Update migrations for Django 1.11 and Python 3# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-27 19:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('downloads', '0001_initial'),
]
opera... | <commit_before><commit_msg>Update migrations for Django 1.11 and Python 3<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-27 19:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('down... | |
586c83a2c72637af611b4a9855e7a057c48163e2 | scripts/delete_sqs_queues.py | scripts/delete_sqs_queues.py | import boto3
import csv
from datetime import datetime
from pprint import pprint
import os
client = boto3.client('sqs', region_name=os.getenv('AWS_REGION'))
def _formatted_date_from_timestamp(timestamp):
return datetime.fromtimestamp(
int(timestamp)
).strftime('%Y-%m-%d %H:%M:%S')
def get_queues():
... | Add a script to delete sqs queues: * Uses boto to retrieve/delete queues * Additional functions to output/read from csv | Add a script to delete sqs queues:
* Uses boto to retrieve/delete queues
* Additional functions to output/read from csv
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add a script to delete sqs queues:
* Uses boto to retrieve/delete queues
* Additional functions to output/read from csv | import boto3
import csv
from datetime import datetime
from pprint import pprint
import os
client = boto3.client('sqs', region_name=os.getenv('AWS_REGION'))
def _formatted_date_from_timestamp(timestamp):
return datetime.fromtimestamp(
int(timestamp)
).strftime('%Y-%m-%d %H:%M:%S')
def get_queues():
... | <commit_before><commit_msg>Add a script to delete sqs queues:
* Uses boto to retrieve/delete queues
* Additional functions to output/read from csv<commit_after> | import boto3
import csv
from datetime import datetime
from pprint import pprint
import os
client = boto3.client('sqs', region_name=os.getenv('AWS_REGION'))
def _formatted_date_from_timestamp(timestamp):
return datetime.fromtimestamp(
int(timestamp)
).strftime('%Y-%m-%d %H:%M:%S')
def get_queues():
... | Add a script to delete sqs queues:
* Uses boto to retrieve/delete queues
* Additional functions to output/read from csvimport boto3
import csv
from datetime import datetime
from pprint import pprint
import os
client = boto3.client('sqs', region_name=os.getenv('AWS_REGION'))
def _formatted_date_from_timestamp(timesta... | <commit_before><commit_msg>Add a script to delete sqs queues:
* Uses boto to retrieve/delete queues
* Additional functions to output/read from csv<commit_after>import boto3
import csv
from datetime import datetime
from pprint import pprint
import os
client = boto3.client('sqs', region_name=os.getenv('AWS_REGION'))
d... | |
5921c252cc25eca91c637ed69e0a53719274b42c | day4-2.py | day4-2.py | """Module to find real rooms in data and sum their sector IDs."""
def main():
"""Run the main function."""
with open('data/day4data.txt', 'r') as f:
dataList = f.readlines()
realRoomList = []
roomNames = []
sum = 0
for line in dataList:
data = line.strip("\n").split('-')
... | Add day 4 part 2. | Add day 4 part 2.
| Python | mit | SayWhat1/adventofcode2016 | Add day 4 part 2. | """Module to find real rooms in data and sum their sector IDs."""
def main():
"""Run the main function."""
with open('data/day4data.txt', 'r') as f:
dataList = f.readlines()
realRoomList = []
roomNames = []
sum = 0
for line in dataList:
data = line.strip("\n").split('-')
... | <commit_before><commit_msg>Add day 4 part 2.<commit_after> | """Module to find real rooms in data and sum their sector IDs."""
def main():
"""Run the main function."""
with open('data/day4data.txt', 'r') as f:
dataList = f.readlines()
realRoomList = []
roomNames = []
sum = 0
for line in dataList:
data = line.strip("\n").split('-')
... | Add day 4 part 2."""Module to find real rooms in data and sum their sector IDs."""
def main():
"""Run the main function."""
with open('data/day4data.txt', 'r') as f:
dataList = f.readlines()
realRoomList = []
roomNames = []
sum = 0
for line in dataList:
data = line.strip("\n"... | <commit_before><commit_msg>Add day 4 part 2.<commit_after>"""Module to find real rooms in data and sum their sector IDs."""
def main():
"""Run the main function."""
with open('data/day4data.txt', 'r') as f:
dataList = f.readlines()
realRoomList = []
roomNames = []
sum = 0
for line in... | |
ad74be9696d54d1c50f83d54791cff8e00db86da | python/takepicture.py | python/takepicture.py | import os
#from pathlib import Path
#import path
import picamera
from time import sleep
from threading import Thread
def takePictureGlobal(picturetaken_callback, peripheral_id):
camera = picamera.PiCamera()
try:
camera.sharpness = 0
camera.contrast = 0
camera.brightness = 70
camera.satu... | Add support of event and camera | Add support of event and camera
| Python | mit | dmayrand/DivAE-client-beta,dmayrand/DivAE-client-beta,dmayrand/Clients-for-actionKATA,dmayrand/Clients-for-actionKATA | Add support of event and camera | import os
#from pathlib import Path
#import path
import picamera
from time import sleep
from threading import Thread
def takePictureGlobal(picturetaken_callback, peripheral_id):
camera = picamera.PiCamera()
try:
camera.sharpness = 0
camera.contrast = 0
camera.brightness = 70
camera.satu... | <commit_before><commit_msg>Add support of event and camera<commit_after> | import os
#from pathlib import Path
#import path
import picamera
from time import sleep
from threading import Thread
def takePictureGlobal(picturetaken_callback, peripheral_id):
camera = picamera.PiCamera()
try:
camera.sharpness = 0
camera.contrast = 0
camera.brightness = 70
camera.satu... | Add support of event and cameraimport os
#from pathlib import Path
#import path
import picamera
from time import sleep
from threading import Thread
def takePictureGlobal(picturetaken_callback, peripheral_id):
camera = picamera.PiCamera()
try:
camera.sharpness = 0
camera.contrast = 0
camera.br... | <commit_before><commit_msg>Add support of event and camera<commit_after>import os
#from pathlib import Path
#import path
import picamera
from time import sleep
from threading import Thread
def takePictureGlobal(picturetaken_callback, peripheral_id):
camera = picamera.PiCamera()
try:
camera.sharpness = 0
... | |
8eaad95972f5ae67d658ad017de466815376f9f0 | remove_nth_node_from_end_of_list.py | remove_nth_node_from_end_of_list.py | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @return a ListNode
def removeNthFromEnd(self, head, n):
if n < 0 or head == None:
return head
d = {}
current = head
l = ... | Remove Nth Node From End of List 58ms should be more optimal | Remove Nth Node From End of List 58ms
should be more optimal
| Python | mit | zhiyelee/leetcode,zhiyelee/leetcode,zhiyelee/leetcode | Remove Nth Node From End of List 58ms
should be more optimal | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @return a ListNode
def removeNthFromEnd(self, head, n):
if n < 0 or head == None:
return head
d = {}
current = head
l = ... | <commit_before><commit_msg>Remove Nth Node From End of List 58ms
should be more optimal<commit_after> | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @return a ListNode
def removeNthFromEnd(self, head, n):
if n < 0 or head == None:
return head
d = {}
current = head
l = ... | Remove Nth Node From End of List 58ms
should be more optimal# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @return a ListNode
def removeNthFromEnd(self, head, n):
if n < 0 or head == None:
retur... | <commit_before><commit_msg>Remove Nth Node From End of List 58ms
should be more optimal<commit_after># Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @return a ListNode
def removeNthFromEnd(self, head, n):
if... | |
c935f85d62d0375d07685eeff14859e5a5a9b161 | tests/test_spotifile.py | tests/test_spotifile.py | import unittest
import os
from subprocess import check_call
from sh import ls
mountpoint = '/tmp/spotifile_test_mount'
class SpotifileTestClass(unittest.TestCase):
@classmethod
def setUpClass(cls):
if not os.path.exists(mountpoint):
os.mkdir(mountpoint)
@classmethod
def tearDownClass(cls):
if os.path.exis... | Add simple test to check that we populate the root as expected | tests: Add simple test to check that we populate the root as expected
Signed-off-by: Anton Lofgren <[email protected]>
| Python | bsd-3-clause | catharsis/spotifile,raoulh/spotifile,chelmertz/spotifile,raoulh/spotifile,raoulh/spotifile,chelmertz/spotifile,chelmertz/spotifile,catharsis/spotifile,catharsis/spotifile | tests: Add simple test to check that we populate the root as expected
Signed-off-by: Anton Lofgren <[email protected]> | import unittest
import os
from subprocess import check_call
from sh import ls
mountpoint = '/tmp/spotifile_test_mount'
class SpotifileTestClass(unittest.TestCase):
@classmethod
def setUpClass(cls):
if not os.path.exists(mountpoint):
os.mkdir(mountpoint)
@classmethod
def tearDownClass(cls):
if os.path.exis... | <commit_before><commit_msg>tests: Add simple test to check that we populate the root as expected
Signed-off-by: Anton Lofgren <[email protected]><commit_after> | import unittest
import os
from subprocess import check_call
from sh import ls
mountpoint = '/tmp/spotifile_test_mount'
class SpotifileTestClass(unittest.TestCase):
@classmethod
def setUpClass(cls):
if not os.path.exists(mountpoint):
os.mkdir(mountpoint)
@classmethod
def tearDownClass(cls):
if os.path.exis... | tests: Add simple test to check that we populate the root as expected
Signed-off-by: Anton Lofgren <[email protected]>import unittest
import os
from subprocess import check_call
from sh import ls
mountpoint = '/tmp/spotifile_test_mount'
class SpotifileTestClass(unittest.TestCase):
@cl... | <commit_before><commit_msg>tests: Add simple test to check that we populate the root as expected
Signed-off-by: Anton Lofgren <[email protected]><commit_after>import unittest
import os
from subprocess import check_call
from sh import ls
mountpoint = '/tmp/spotifile_test_mount'
class Sp... | |
959e30bed3dcaee03df929f8ec2848d07c745dc9 | tests/webcam_read_qr.py | tests/webcam_read_qr.py | #!/usr/bin/env python
"""
This module sets up a video stream from internal or connected webcam using Gstreamer.
You can then take snapshots.
import qrtools
qr = qrtools.QR()
qr.decode("cam.jpg")
print qr.data
"""
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gst', '1.0')
from gi.repository import Gt... | Put gst code into Avocado test format. Needs to be edited to take a snapshot and read the qr code. | Put gst code into Avocado test format. Needs to be edited to take a snapshot and read the qr code.
| Python | mit | daveol/Fedora-Test-Laptop,daveol/Fedora-Test-Laptop | Put gst code into Avocado test format. Needs to be edited to take a snapshot and read the qr code. | #!/usr/bin/env python
"""
This module sets up a video stream from internal or connected webcam using Gstreamer.
You can then take snapshots.
import qrtools
qr = qrtools.QR()
qr.decode("cam.jpg")
print qr.data
"""
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gst', '1.0')
from gi.repository import Gt... | <commit_before><commit_msg>Put gst code into Avocado test format. Needs to be edited to take a snapshot and read the qr code.<commit_after> | #!/usr/bin/env python
"""
This module sets up a video stream from internal or connected webcam using Gstreamer.
You can then take snapshots.
import qrtools
qr = qrtools.QR()
qr.decode("cam.jpg")
print qr.data
"""
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gst', '1.0')
from gi.repository import Gt... | Put gst code into Avocado test format. Needs to be edited to take a snapshot and read the qr code.#!/usr/bin/env python
"""
This module sets up a video stream from internal or connected webcam using Gstreamer.
You can then take snapshots.
import qrtools
qr = qrtools.QR()
qr.decode("cam.jpg")
print qr.data
"""
import... | <commit_before><commit_msg>Put gst code into Avocado test format. Needs to be edited to take a snapshot and read the qr code.<commit_after>#!/usr/bin/env python
"""
This module sets up a video stream from internal or connected webcam using Gstreamer.
You can then take snapshots.
import qrtools
qr = qrtools.QR()
qr.de... | |
84cf7b425c58a6c1b9c08fb1605cd3b3dfd24b21 | tests/test_utils.py | tests/test_utils.py | from edx_shopify.utils import hmac_is_valid
from django.test import TestCase
class SignatureVerificationTest(TestCase):
def test_hmac_is_valid(self):
correct_hmac = [
('hello', 'world', '8ayXAutfryPKKRpNxG3t3u4qeMza8KQSvtdxTP/7HMQ='),
('bye', 'bye', 'HHfaL+C4HxPTexmlKO9pwEHuAXkErA... | Add a test for signature checking | Add a test for signature checking
| Python | agpl-3.0 | hastexo/edx-shopify,fghaas/edx-shopify | Add a test for signature checking | from edx_shopify.utils import hmac_is_valid
from django.test import TestCase
class SignatureVerificationTest(TestCase):
def test_hmac_is_valid(self):
correct_hmac = [
('hello', 'world', '8ayXAutfryPKKRpNxG3t3u4qeMza8KQSvtdxTP/7HMQ='),
('bye', 'bye', 'HHfaL+C4HxPTexmlKO9pwEHuAXkErA... | <commit_before><commit_msg>Add a test for signature checking<commit_after> | from edx_shopify.utils import hmac_is_valid
from django.test import TestCase
class SignatureVerificationTest(TestCase):
def test_hmac_is_valid(self):
correct_hmac = [
('hello', 'world', '8ayXAutfryPKKRpNxG3t3u4qeMza8KQSvtdxTP/7HMQ='),
('bye', 'bye', 'HHfaL+C4HxPTexmlKO9pwEHuAXkErA... | Add a test for signature checkingfrom edx_shopify.utils import hmac_is_valid
from django.test import TestCase
class SignatureVerificationTest(TestCase):
def test_hmac_is_valid(self):
correct_hmac = [
('hello', 'world', '8ayXAutfryPKKRpNxG3t3u4qeMza8KQSvtdxTP/7HMQ='),
('bye', 'bye'... | <commit_before><commit_msg>Add a test for signature checking<commit_after>from edx_shopify.utils import hmac_is_valid
from django.test import TestCase
class SignatureVerificationTest(TestCase):
def test_hmac_is_valid(self):
correct_hmac = [
('hello', 'world', '8ayXAutfryPKKRpNxG3t3u4qeMza8KQS... | |
8a79cf5235bebd514b8eb0a788e4b491e01feea9 | verdenskart/src/utils/data_fetcher.py | verdenskart/src/utils/data_fetcher.py | import logging
import requests
def get_world_topology():
ans = requests.get("https://restcountries.eu/rest/v2/all?fields=name;capital;region;subregion;latlng;alpha3Code;borders")
if ans.status_code != 200:
raise RuntimeError("Unable to get country data")
countries = {country.pop("alpha3Code"): cou... | Read country topology from restcountries.eu | Read country topology from restcountries.eu
| Python | bsd-2-clause | expertanalytics/fagkveld | Read country topology from restcountries.eu | import logging
import requests
def get_world_topology():
ans = requests.get("https://restcountries.eu/rest/v2/all?fields=name;capital;region;subregion;latlng;alpha3Code;borders")
if ans.status_code != 200:
raise RuntimeError("Unable to get country data")
countries = {country.pop("alpha3Code"): cou... | <commit_before><commit_msg>Read country topology from restcountries.eu<commit_after> | import logging
import requests
def get_world_topology():
ans = requests.get("https://restcountries.eu/rest/v2/all?fields=name;capital;region;subregion;latlng;alpha3Code;borders")
if ans.status_code != 200:
raise RuntimeError("Unable to get country data")
countries = {country.pop("alpha3Code"): cou... | Read country topology from restcountries.euimport logging
import requests
def get_world_topology():
ans = requests.get("https://restcountries.eu/rest/v2/all?fields=name;capital;region;subregion;latlng;alpha3Code;borders")
if ans.status_code != 200:
raise RuntimeError("Unable to get country data")
... | <commit_before><commit_msg>Read country topology from restcountries.eu<commit_after>import logging
import requests
def get_world_topology():
ans = requests.get("https://restcountries.eu/rest/v2/all?fields=name;capital;region;subregion;latlng;alpha3Code;borders")
if ans.status_code != 200:
raise Runtim... | |
dc3bc21e8cf7c0a0244dd7d2584a206656bc8444 | tests/Settings/TestContainerRegistry.py | tests/Settings/TestContainerRegistry.py | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import os.path
import UM.Settings
from UM.Resources import Resources
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
@pytest.fixture
def container_registry():
Resources.addSearchPath(os.pa... | Add a test for ContainerRegistry | Add a test for ContainerRegistry
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | Add a test for ContainerRegistry | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import os.path
import UM.Settings
from UM.Resources import Resources
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
@pytest.fixture
def container_registry():
Resources.addSearchPath(os.pa... | <commit_before><commit_msg>Add a test for ContainerRegistry<commit_after> | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import os.path
import UM.Settings
from UM.Resources import Resources
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
@pytest.fixture
def container_registry():
Resources.addSearchPath(os.pa... | Add a test for ContainerRegistry# Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import os.path
import UM.Settings
from UM.Resources import Resources
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
@pytest.fixture
def container_registry():
... | <commit_before><commit_msg>Add a test for ContainerRegistry<commit_after># Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import os.path
import UM.Settings
from UM.Resources import Resources
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
@p... | |
7fe7b751ef61fffd59a751df99a4bfc6715f10f8 | globaleaks/tests/test_storm.py | globaleaks/tests/test_storm.py | from twisted.internet import defer
from twisted.trial import unittest
from storm.twisted.testing import FakeThreadPool
from storm.twisted.transact import transact, Transactor
from storm.locals import *
from storm.databases.sqlite import SQLite
from storm.uri import URI
from globaleaks.db.models import TXModel
from g... | Add unittest for storm to illustrate it's usage. Also useful to understand when and if they break our usage of it. | Add unittest for storm to illustrate it's usage.
Also useful to understand when and if they break our usage of it.
| Python | agpl-3.0 | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks | Add unittest for storm to illustrate it's usage.
Also useful to understand when and if they break our usage of it. | from twisted.internet import defer
from twisted.trial import unittest
from storm.twisted.testing import FakeThreadPool
from storm.twisted.transact import transact, Transactor
from storm.locals import *
from storm.databases.sqlite import SQLite
from storm.uri import URI
from globaleaks.db.models import TXModel
from g... | <commit_before><commit_msg>Add unittest for storm to illustrate it's usage.
Also useful to understand when and if they break our usage of it.<commit_after> | from twisted.internet import defer
from twisted.trial import unittest
from storm.twisted.testing import FakeThreadPool
from storm.twisted.transact import transact, Transactor
from storm.locals import *
from storm.databases.sqlite import SQLite
from storm.uri import URI
from globaleaks.db.models import TXModel
from g... | Add unittest for storm to illustrate it's usage.
Also useful to understand when and if they break our usage of it.from twisted.internet import defer
from twisted.trial import unittest
from storm.twisted.testing import FakeThreadPool
from storm.twisted.transact import transact, Transactor
from storm.locals import *
fr... | <commit_before><commit_msg>Add unittest for storm to illustrate it's usage.
Also useful to understand when and if they break our usage of it.<commit_after>from twisted.internet import defer
from twisted.trial import unittest
from storm.twisted.testing import FakeThreadPool
from storm.twisted.transact import transact, ... | |
b98fee0ccb127dbca6f1c20bb1c1025a20cb1e7c | teknologr/members/migrations/0015_auto_20181119_2256.py | teknologr/members/migrations/0015_auto_20181119_2256.py | # Generated by Django 2.1.2 on 2018-11-19 20:56
from django.db import migrations
def move_phone_numbers(apps, schema_editor):
Member = apps.get_model('members', 'Member')
for member in Member.objects.all():
if member.mobile_phone:
member.phone = member.mobile_phone
member.save... | Add data migrations for moving phone numbers to phone field | Add data migrations for moving phone numbers to phone field
| Python | mit | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | Add data migrations for moving phone numbers to phone field | # Generated by Django 2.1.2 on 2018-11-19 20:56
from django.db import migrations
def move_phone_numbers(apps, schema_editor):
Member = apps.get_model('members', 'Member')
for member in Member.objects.all():
if member.mobile_phone:
member.phone = member.mobile_phone
member.save... | <commit_before><commit_msg>Add data migrations for moving phone numbers to phone field<commit_after> | # Generated by Django 2.1.2 on 2018-11-19 20:56
from django.db import migrations
def move_phone_numbers(apps, schema_editor):
Member = apps.get_model('members', 'Member')
for member in Member.objects.all():
if member.mobile_phone:
member.phone = member.mobile_phone
member.save... | Add data migrations for moving phone numbers to phone field# Generated by Django 2.1.2 on 2018-11-19 20:56
from django.db import migrations
def move_phone_numbers(apps, schema_editor):
Member = apps.get_model('members', 'Member')
for member in Member.objects.all():
if member.mobile_phone:
... | <commit_before><commit_msg>Add data migrations for moving phone numbers to phone field<commit_after># Generated by Django 2.1.2 on 2018-11-19 20:56
from django.db import migrations
def move_phone_numbers(apps, schema_editor):
Member = apps.get_model('members', 'Member')
for member in Member.objects.all():
... | |
a7ab2de6b55e02e3946cb16e2fabecad92731ebd | src/sample_image.py | src/sample_image.py | __author__ = 'team-entaku'
import cv2
import sys
if __name__ == "__main__":
file_name = sys.argv[1]
im = cv2.imread(file_name, 0)
cv2.imshow('im', im)
cv2.waitKey(0)
cv2.destroyAllWindows()
| Add a sample for a reading image | Add a sample for a reading image
| Python | mit | entaku/kusarigama | Add a sample for a reading image | __author__ = 'team-entaku'
import cv2
import sys
if __name__ == "__main__":
file_name = sys.argv[1]
im = cv2.imread(file_name, 0)
cv2.imshow('im', im)
cv2.waitKey(0)
cv2.destroyAllWindows()
| <commit_before><commit_msg>Add a sample for a reading image<commit_after> | __author__ = 'team-entaku'
import cv2
import sys
if __name__ == "__main__":
file_name = sys.argv[1]
im = cv2.imread(file_name, 0)
cv2.imshow('im', im)
cv2.waitKey(0)
cv2.destroyAllWindows()
| Add a sample for a reading image__author__ = 'team-entaku'
import cv2
import sys
if __name__ == "__main__":
file_name = sys.argv[1]
im = cv2.imread(file_name, 0)
cv2.imshow('im', im)
cv2.waitKey(0)
cv2.destroyAllWindows()
| <commit_before><commit_msg>Add a sample for a reading image<commit_after>__author__ = 'team-entaku'
import cv2
import sys
if __name__ == "__main__":
file_name = sys.argv[1]
im = cv2.imread(file_name, 0)
cv2.imshow('im', im)
cv2.waitKey(0)
cv2.destroyAllWindows()
| |
92a42c693cc5c38c0d02174722a87217fdd2eb3b | oweb/libs/shortcuts.py | oweb/libs/shortcuts.py | # app imports
from oweb.exceptions import OWebDoesNotExist
def get_object_or_404(klass, *args, **kwargs):
"""
Uses get() to return an object, or raises a Http404 exception if the object
does not exist.
klass may be a Model, Manager, or QuerySet object. All other passed
arguments and keyword argume... | Make our own version of get_object_or_404 and get_list_or_404 | Make our own version of get_object_or_404 and get_list_or_404
| Python | mit | Mischback/django-oweb,Mischback/django-oweb | Make our own version of get_object_or_404 and get_list_or_404 | # app imports
from oweb.exceptions import OWebDoesNotExist
def get_object_or_404(klass, *args, **kwargs):
"""
Uses get() to return an object, or raises a Http404 exception if the object
does not exist.
klass may be a Model, Manager, or QuerySet object. All other passed
arguments and keyword argume... | <commit_before><commit_msg>Make our own version of get_object_or_404 and get_list_or_404<commit_after> | # app imports
from oweb.exceptions import OWebDoesNotExist
def get_object_or_404(klass, *args, **kwargs):
"""
Uses get() to return an object, or raises a Http404 exception if the object
does not exist.
klass may be a Model, Manager, or QuerySet object. All other passed
arguments and keyword argume... | Make our own version of get_object_or_404 and get_list_or_404# app imports
from oweb.exceptions import OWebDoesNotExist
def get_object_or_404(klass, *args, **kwargs):
"""
Uses get() to return an object, or raises a Http404 exception if the object
does not exist.
klass may be a Model, Manager, or Query... | <commit_before><commit_msg>Make our own version of get_object_or_404 and get_list_or_404<commit_after># app imports
from oweb.exceptions import OWebDoesNotExist
def get_object_or_404(klass, *args, **kwargs):
"""
Uses get() to return an object, or raises a Http404 exception if the object
does not exist.
... | |
e32ace92c94e83b82bddf1ad348621c408b47a24 | tests/test_overlap.py | tests/test_overlap.py | import nose
import cle
import os
class MockBackend(cle.backends.Backend):
def __init__(self, requested_base, size, **kwargs):
super(MockBackend, self).__init__('/dev/zero', **kwargs)
self.requested_base = requested_base
self.size = size
def get_max_addr(self):
return self.rebas... | Add test case for object overlapping and requested base addresses | Add test case for object overlapping and requested base addresses
| Python | bsd-2-clause | angr/cle | Add test case for object overlapping and requested base addresses | import nose
import cle
import os
class MockBackend(cle.backends.Backend):
def __init__(self, requested_base, size, **kwargs):
super(MockBackend, self).__init__('/dev/zero', **kwargs)
self.requested_base = requested_base
self.size = size
def get_max_addr(self):
return self.rebas... | <commit_before><commit_msg>Add test case for object overlapping and requested base addresses<commit_after> | import nose
import cle
import os
class MockBackend(cle.backends.Backend):
def __init__(self, requested_base, size, **kwargs):
super(MockBackend, self).__init__('/dev/zero', **kwargs)
self.requested_base = requested_base
self.size = size
def get_max_addr(self):
return self.rebas... | Add test case for object overlapping and requested base addressesimport nose
import cle
import os
class MockBackend(cle.backends.Backend):
def __init__(self, requested_base, size, **kwargs):
super(MockBackend, self).__init__('/dev/zero', **kwargs)
self.requested_base = requested_base
self.s... | <commit_before><commit_msg>Add test case for object overlapping and requested base addresses<commit_after>import nose
import cle
import os
class MockBackend(cle.backends.Backend):
def __init__(self, requested_base, size, **kwargs):
super(MockBackend, self).__init__('/dev/zero', **kwargs)
self.reque... | |
1d2dcd5a777119cbfb98274d73ee14c9190f1c24 | tests/test_scraper.py | tests/test_scraper.py | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
scraper... | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
scraper... | Test for URL in every scraper. | Test for URL in every scraper.
| Python | mit | peterjanes/dosage,webcomics/dosage,Freestila/dosage,mbrandis/dosage,blade2005/dosage,webcomics/dosage,peterjanes/dosage,mbrandis/dosage,Freestila/dosage,wummel/dosage,wummel/dosage,blade2005/dosage | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
scraper... | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
scraper... | <commit_before># -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
... | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
scraper... | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
scraper... | <commit_before># -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
... |
cad64c150479adcd9db07a8d3fb65d81f49b6d1e | locations/spiders/superonefoods.py | locations/spiders/superonefoods.py | # -*- coding: utf-8 -*-
import json
import scrapy
import re
from locations.items import GeojsonPointItem
class SuperonefoodsSpider(scrapy.Spider):
name = "superonefoods"
allowed_domains = ["www.superonefoods.com"]
start_urls = (
'https://www.superonefoods.com/store-finder',
)
def parse(self, response):
# re... | Add Spider to Wilco Fram Stores | Add Spider to Wilco Fram Stores
| Python | mit | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | Add Spider to Wilco Fram Stores | # -*- coding: utf-8 -*-
import json
import scrapy
import re
from locations.items import GeojsonPointItem
class SuperonefoodsSpider(scrapy.Spider):
name = "superonefoods"
allowed_domains = ["www.superonefoods.com"]
start_urls = (
'https://www.superonefoods.com/store-finder',
)
def parse(self, response):
# re... | <commit_before><commit_msg>Add Spider to Wilco Fram Stores<commit_after> | # -*- coding: utf-8 -*-
import json
import scrapy
import re
from locations.items import GeojsonPointItem
class SuperonefoodsSpider(scrapy.Spider):
name = "superonefoods"
allowed_domains = ["www.superonefoods.com"]
start_urls = (
'https://www.superonefoods.com/store-finder',
)
def parse(self, response):
# re... | Add Spider to Wilco Fram Stores# -*- coding: utf-8 -*-
import json
import scrapy
import re
from locations.items import GeojsonPointItem
class SuperonefoodsSpider(scrapy.Spider):
name = "superonefoods"
allowed_domains = ["www.superonefoods.com"]
start_urls = (
'https://www.superonefoods.com/store-finder',
)
de... | <commit_before><commit_msg>Add Spider to Wilco Fram Stores<commit_after># -*- coding: utf-8 -*-
import json
import scrapy
import re
from locations.items import GeojsonPointItem
class SuperonefoodsSpider(scrapy.Spider):
name = "superonefoods"
allowed_domains = ["www.superonefoods.com"]
start_urls = (
'https://www... | |
4f6488cbb42e552daa67ee04159072fb9669a75e | tests/unit/test_packaging.py | tests/unit/test_packaging.py | import pytest
from pip._vendor.packaging import specifiers
from pip._internal.utils.packaging import check_requires_python
@pytest.mark.parametrize('version_info, requires_python, expected', [
((3, 6, 5), '== 3.6.4', False),
((3, 6, 5), '== 3.6.5', True),
((3, 6, 5), None, True),
])
def test_check_requir... | Add some tests for check_requires_python(). | Add some tests for check_requires_python().
| Python | mit | rouge8/pip,rouge8/pip,sbidoul/pip,pradyunsg/pip,pfmoore/pip,xavfernandez/pip,pradyunsg/pip,xavfernandez/pip,pfmoore/pip,pypa/pip,xavfernandez/pip,sbidoul/pip,rouge8/pip,pypa/pip | Add some tests for check_requires_python(). | import pytest
from pip._vendor.packaging import specifiers
from pip._internal.utils.packaging import check_requires_python
@pytest.mark.parametrize('version_info, requires_python, expected', [
((3, 6, 5), '== 3.6.4', False),
((3, 6, 5), '== 3.6.5', True),
((3, 6, 5), None, True),
])
def test_check_requir... | <commit_before><commit_msg>Add some tests for check_requires_python().<commit_after> | import pytest
from pip._vendor.packaging import specifiers
from pip._internal.utils.packaging import check_requires_python
@pytest.mark.parametrize('version_info, requires_python, expected', [
((3, 6, 5), '== 3.6.4', False),
((3, 6, 5), '== 3.6.5', True),
((3, 6, 5), None, True),
])
def test_check_requir... | Add some tests for check_requires_python().import pytest
from pip._vendor.packaging import specifiers
from pip._internal.utils.packaging import check_requires_python
@pytest.mark.parametrize('version_info, requires_python, expected', [
((3, 6, 5), '== 3.6.4', False),
((3, 6, 5), '== 3.6.5', True),
((3, 6... | <commit_before><commit_msg>Add some tests for check_requires_python().<commit_after>import pytest
from pip._vendor.packaging import specifiers
from pip._internal.utils.packaging import check_requires_python
@pytest.mark.parametrize('version_info, requires_python, expected', [
((3, 6, 5), '== 3.6.4', False),
... | |
d218b92cb598801a6fbca5421f216860107d7956 | apps/curia_vista/management/commands/update_departments.py | apps/curia_vista/management/commands/update_departments.py | from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import departments from parlament.ch'
@transaction.atomic
def handle(self, *args... | Add import script for department data | Add import script for department data
| Python | agpl-3.0 | rettichschnidi/politkarma,rettichschnidi/politkarma,rettichschnidi/politkarma,rettichschnidi/politkarma | Add import script for department data | from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import departments from parlament.ch'
@transaction.atomic
def handle(self, *args... | <commit_before><commit_msg>Add import script for department data<commit_after> | from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import departments from parlament.ch'
@transaction.atomic
def handle(self, *args... | Add import script for department datafrom xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import departments from parlament.ch'
@transact... | <commit_before><commit_msg>Add import script for department data<commit_after>from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import depa... | |
5806153edfde7d6e27b628c38eb0f9333642711d | sydent/http/servlets/getvalidated3pidservlet.py | sydent/http/servlets/getvalidated3pidservlet.py | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright 2014 matrix.org
#
# 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 req... | Add the file for the new servlet | Add the file for the new servlet
| Python | apache-2.0 | matrix-org/sydent,matrix-org/sydent,matrix-org/sydent | Add the file for the new servlet | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright 2014 matrix.org
#
# 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 req... | <commit_before><commit_msg>Add the file for the new servlet<commit_after> | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright 2014 matrix.org
#
# 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 req... | Add the file for the new servlet# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright 2014 matrix.org
#
# 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/lic... | <commit_before><commit_msg>Add the file for the new servlet<commit_after># -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright 2014 matrix.org
#
# 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 Lic... | |
814f2aafebc04d75d4f3d99fa42b09c6054a2b16 | domainchecks/tests/test_commands.py | domainchecks/tests/test_commands.py | from datetime import timedelta
from io import StringIO
from unittest.mock import Mock, patch
from django.core.management import call_command
from django.test import TestCase
from . import factories
class CheckDomainsCommandTestCase(TestCase):
"""Management command for running the domain checks."""
def call... | Add tests for the checkdomains command. | Add tests for the checkdomains command.
| Python | bsd-2-clause | mlavin/video-examples,mlavin/video-examples,mlavin/video-examples | Add tests for the checkdomains command. | from datetime import timedelta
from io import StringIO
from unittest.mock import Mock, patch
from django.core.management import call_command
from django.test import TestCase
from . import factories
class CheckDomainsCommandTestCase(TestCase):
"""Management command for running the domain checks."""
def call... | <commit_before><commit_msg>Add tests for the checkdomains command.<commit_after> | from datetime import timedelta
from io import StringIO
from unittest.mock import Mock, patch
from django.core.management import call_command
from django.test import TestCase
from . import factories
class CheckDomainsCommandTestCase(TestCase):
"""Management command for running the domain checks."""
def call... | Add tests for the checkdomains command.from datetime import timedelta
from io import StringIO
from unittest.mock import Mock, patch
from django.core.management import call_command
from django.test import TestCase
from . import factories
class CheckDomainsCommandTestCase(TestCase):
"""Management command for runn... | <commit_before><commit_msg>Add tests for the checkdomains command.<commit_after>from datetime import timedelta
from io import StringIO
from unittest.mock import Mock, patch
from django.core.management import call_command
from django.test import TestCase
from . import factories
class CheckDomainsCommandTestCase(Test... | |
2dc179a309dd4152193de8b2d34a3c25150b1128 | deposit/osf/migrations/0001_initial.py | deposit/osf/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-28 11:43
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | Add migration for OSF model | Add migration for OSF model
| Python | agpl-3.0 | wetneb/dissemin,wetneb/dissemin,wetneb/dissemin,dissemin/dissemin,dissemin/dissemin,dissemin/dissemin,wetneb/dissemin,dissemin/dissemin,dissemin/dissemin | Add migration for OSF model | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-28 11:43
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | <commit_before><commit_msg>Add migration for OSF model<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-28 11:43
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | Add migration for OSF model# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-28 11:43
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependen... | <commit_before><commit_msg>Add migration for OSF model<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-28 11:43
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migr... | |
7a17603060c488875109ec1bee42eeafbf11bdcf | exercises/test_stack_balanced_parents.py | exercises/test_stack_balanced_parents.py | #!/usr/local/bin/python3
"""
Unittest for stack_balanced_parens.py
"""
import stack_balanced_parens
import unittest
class TestStackParens(unittest.TestCase):
def test_balanced(self):
expression = "{[()]}"
self.assertTrue(stack_balanced_parens.isBalanced(expression))
def test_unbalanced(self):
... | Add unit test for stack_balanced_parens.py | Add unit test for stack_balanced_parens.py
| Python | mit | myleneh/code | Add unit test for stack_balanced_parens.py | #!/usr/local/bin/python3
"""
Unittest for stack_balanced_parens.py
"""
import stack_balanced_parens
import unittest
class TestStackParens(unittest.TestCase):
def test_balanced(self):
expression = "{[()]}"
self.assertTrue(stack_balanced_parens.isBalanced(expression))
def test_unbalanced(self):
... | <commit_before><commit_msg>Add unit test for stack_balanced_parens.py<commit_after> | #!/usr/local/bin/python3
"""
Unittest for stack_balanced_parens.py
"""
import stack_balanced_parens
import unittest
class TestStackParens(unittest.TestCase):
def test_balanced(self):
expression = "{[()]}"
self.assertTrue(stack_balanced_parens.isBalanced(expression))
def test_unbalanced(self):
... | Add unit test for stack_balanced_parens.py#!/usr/local/bin/python3
"""
Unittest for stack_balanced_parens.py
"""
import stack_balanced_parens
import unittest
class TestStackParens(unittest.TestCase):
def test_balanced(self):
expression = "{[()]}"
self.assertTrue(stack_balanced_parens.isBalanced(exp... | <commit_before><commit_msg>Add unit test for stack_balanced_parens.py<commit_after>#!/usr/local/bin/python3
"""
Unittest for stack_balanced_parens.py
"""
import stack_balanced_parens
import unittest
class TestStackParens(unittest.TestCase):
def test_balanced(self):
expression = "{[()]}"
self.assert... | |
385e7194e8cf7db736001e50023cc13fbba27366 | py/bulb-switcher-ii.py | py/bulb-switcher-ii.py | from itertools import combinations, cycle, islice
class Solution(object):
def flipLights(self, n, m):
"""
:type n: int
:type m: int
:rtype: int
"""
if m > 4:
return self.flipLights(n, 4 - m % 2)
if n > 6:
return self.flipLights(6, m)
... | Add py solution for 672. Bulb Switcher II | Add py solution for 672. Bulb Switcher II
672. Bulb Switcher II: https://leetcode.com/problems/bulb-switcher-ii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 672. Bulb Switcher II
672. Bulb Switcher II: https://leetcode.com/problems/bulb-switcher-ii/ | from itertools import combinations, cycle, islice
class Solution(object):
def flipLights(self, n, m):
"""
:type n: int
:type m: int
:rtype: int
"""
if m > 4:
return self.flipLights(n, 4 - m % 2)
if n > 6:
return self.flipLights(6, m)
... | <commit_before><commit_msg>Add py solution for 672. Bulb Switcher II
672. Bulb Switcher II: https://leetcode.com/problems/bulb-switcher-ii/<commit_after> | from itertools import combinations, cycle, islice
class Solution(object):
def flipLights(self, n, m):
"""
:type n: int
:type m: int
:rtype: int
"""
if m > 4:
return self.flipLights(n, 4 - m % 2)
if n > 6:
return self.flipLights(6, m)
... | Add py solution for 672. Bulb Switcher II
672. Bulb Switcher II: https://leetcode.com/problems/bulb-switcher-ii/from itertools import combinations, cycle, islice
class Solution(object):
def flipLights(self, n, m):
"""
:type n: int
:type m: int
:rtype: int
"""
if m > ... | <commit_before><commit_msg>Add py solution for 672. Bulb Switcher II
672. Bulb Switcher II: https://leetcode.com/problems/bulb-switcher-ii/<commit_after>from itertools import combinations, cycle, islice
class Solution(object):
def flipLights(self, n, m):
"""
:type n: int
:type m: int
... | |
d818cabe31867de6b23035b309d15ba0ba12117b | dockci/migrations/0005.py | dockci/migrations/0005.py | """
Rename "build" models to "job" models
"""
import py.path
import yaml
from yaml import safe_load as yaml_load
builds_path = py.path.local().join('data', 'builds')
jobs_path = py.path.local().join('data', 'jobs')
for project_path in builds_path.listdir():
build_files = project_path.listdir(
lambda fil... | Add build -> job migration | Add build -> job migration
| Python | isc | RickyCook/DockCI,sprucedev/DockCI,RickyCook/DockCI,sprucedev/DockCI,RickyCook/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,sprucedev/DockCI-Agent,sprucedev/DockCI,sprucedev/DockCI | Add build -> job migration | """
Rename "build" models to "job" models
"""
import py.path
import yaml
from yaml import safe_load as yaml_load
builds_path = py.path.local().join('data', 'builds')
jobs_path = py.path.local().join('data', 'jobs')
for project_path in builds_path.listdir():
build_files = project_path.listdir(
lambda fil... | <commit_before><commit_msg>Add build -> job migration<commit_after> | """
Rename "build" models to "job" models
"""
import py.path
import yaml
from yaml import safe_load as yaml_load
builds_path = py.path.local().join('data', 'builds')
jobs_path = py.path.local().join('data', 'jobs')
for project_path in builds_path.listdir():
build_files = project_path.listdir(
lambda fil... | Add build -> job migration"""
Rename "build" models to "job" models
"""
import py.path
import yaml
from yaml import safe_load as yaml_load
builds_path = py.path.local().join('data', 'builds')
jobs_path = py.path.local().join('data', 'jobs')
for project_path in builds_path.listdir():
build_files = project_path.l... | <commit_before><commit_msg>Add build -> job migration<commit_after>"""
Rename "build" models to "job" models
"""
import py.path
import yaml
from yaml import safe_load as yaml_load
builds_path = py.path.local().join('data', 'builds')
jobs_path = py.path.local().join('data', 'jobs')
for project_path in builds_path.li... | |
da590cef665abf8898ab056bb8048c3541df181f | src/server/RemoteFunctionCaller.py | src/server/RemoteFunctionCaller.py | import time
class TimeoutError(Exception):
pass
class RemoteError(Exception):
pass
class RemoteFunction:
def __init__(self, sender, seq, name, timeout=5, timeoutCb = None):
self.sender = sender
self.seq = seq
self.name = name
self.timeout = timeout
self.timeoutCb =... | Add class for transparently calling functions over a socket | Add class for transparently calling functions over a socket
| Python | mit | cnlohr/bridgesim,cnlohr/bridgesim,cnlohr/bridgesim,cnlohr/bridgesim | Add class for transparently calling functions over a socket | import time
class TimeoutError(Exception):
pass
class RemoteError(Exception):
pass
class RemoteFunction:
def __init__(self, sender, seq, name, timeout=5, timeoutCb = None):
self.sender = sender
self.seq = seq
self.name = name
self.timeout = timeout
self.timeoutCb =... | <commit_before><commit_msg>Add class for transparently calling functions over a socket<commit_after> | import time
class TimeoutError(Exception):
pass
class RemoteError(Exception):
pass
class RemoteFunction:
def __init__(self, sender, seq, name, timeout=5, timeoutCb = None):
self.sender = sender
self.seq = seq
self.name = name
self.timeout = timeout
self.timeoutCb =... | Add class for transparently calling functions over a socketimport time
class TimeoutError(Exception):
pass
class RemoteError(Exception):
pass
class RemoteFunction:
def __init__(self, sender, seq, name, timeout=5, timeoutCb = None):
self.sender = sender
self.seq = seq
self.name = n... | <commit_before><commit_msg>Add class for transparently calling functions over a socket<commit_after>import time
class TimeoutError(Exception):
pass
class RemoteError(Exception):
pass
class RemoteFunction:
def __init__(self, sender, seq, name, timeout=5, timeoutCb = None):
self.sender = sender
... | |
2c3c073298d134e13d100f84877c5065c3d60fdd | batdisplay.py | batdisplay.py | #!/usr/bin/python
import os # for instance management
from gi.repository import Gtk, Gdk, GObject
# milliseconds of window getting displayed
DISPLAY_DURATION = 4000
# this will get set in order to keep this obj. alive while
LIVING_ID = False
# path to a temporary file for a pid.
MY_BAT_WARNING_PATH = "/tmp/battery... | Add gtk window containing some warning text, very similar to former display classes. | Add gtk window containing some warning text, very similar to former display classes.
| Python | mit | 0ortmann/SysDisplays | Add gtk window containing some warning text, very similar to former display classes. | #!/usr/bin/python
import os # for instance management
from gi.repository import Gtk, Gdk, GObject
# milliseconds of window getting displayed
DISPLAY_DURATION = 4000
# this will get set in order to keep this obj. alive while
LIVING_ID = False
# path to a temporary file for a pid.
MY_BAT_WARNING_PATH = "/tmp/battery... | <commit_before><commit_msg>Add gtk window containing some warning text, very similar to former display classes.<commit_after> | #!/usr/bin/python
import os # for instance management
from gi.repository import Gtk, Gdk, GObject
# milliseconds of window getting displayed
DISPLAY_DURATION = 4000
# this will get set in order to keep this obj. alive while
LIVING_ID = False
# path to a temporary file for a pid.
MY_BAT_WARNING_PATH = "/tmp/battery... | Add gtk window containing some warning text, very similar to former display classes.#!/usr/bin/python
import os # for instance management
from gi.repository import Gtk, Gdk, GObject
# milliseconds of window getting displayed
DISPLAY_DURATION = 4000
# this will get set in order to keep this obj. alive while
LIVING_I... | <commit_before><commit_msg>Add gtk window containing some warning text, very similar to former display classes.<commit_after>#!/usr/bin/python
import os # for instance management
from gi.repository import Gtk, Gdk, GObject
# milliseconds of window getting displayed
DISPLAY_DURATION = 4000
# this will get set in ord... | |
d960d614be9ddbdad997e57458b4634f591d79ad | pony_stable/build-testutils.py | pony_stable/build-testutils.py | import sys
from base_django import DjangoBuild
from pony_build import client as pony
class TestUtilsBuild(DjangoBuild):
def __init__(self):
super(TestUtilsBuild, self).__init__()
self.repo_url = "git://github.com/ericholscher/django-test-utils"
self.name = "django-test-utils"
self.... | Add a build for Django Test Utils. | Add a build for Django Test Utils.
| Python | mit | ericholscher/pony_barn,ericholscher/pony_barn | Add a build for Django Test Utils. | import sys
from base_django import DjangoBuild
from pony_build import client as pony
class TestUtilsBuild(DjangoBuild):
def __init__(self):
super(TestUtilsBuild, self).__init__()
self.repo_url = "git://github.com/ericholscher/django-test-utils"
self.name = "django-test-utils"
self.... | <commit_before><commit_msg>Add a build for Django Test Utils.<commit_after> | import sys
from base_django import DjangoBuild
from pony_build import client as pony
class TestUtilsBuild(DjangoBuild):
def __init__(self):
super(TestUtilsBuild, self).__init__()
self.repo_url = "git://github.com/ericholscher/django-test-utils"
self.name = "django-test-utils"
self.... | Add a build for Django Test Utils.import sys
from base_django import DjangoBuild
from pony_build import client as pony
class TestUtilsBuild(DjangoBuild):
def __init__(self):
super(TestUtilsBuild, self).__init__()
self.repo_url = "git://github.com/ericholscher/django-test-utils"
self.name =... | <commit_before><commit_msg>Add a build for Django Test Utils.<commit_after>import sys
from base_django import DjangoBuild
from pony_build import client as pony
class TestUtilsBuild(DjangoBuild):
def __init__(self):
super(TestUtilsBuild, self).__init__()
self.repo_url = "git://github.com/ericholsch... | |
59db12020433e4787555cfeccaeae65f872f59b6 | tests/test_html_formatter.py | tests/test_html_formatter.py | # -*- coding: utf-8 -*-
"""
Pygments HTML formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2006 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import unittest
import StringIO
import random
from pygments import lexers, formatters
from pygments.token import _TokenType
class... | Add a reminder to write a HTML formatter test. | [svn] Add a reminder to write a HTML formatter test.
| Python | bsd-2-clause | tomstuart/pygments,spencerlyon2/pygments,erickt/pygments,tomstuart/pygments,erickt/pygments,tomstuart/pygments,spencerlyon2/pygments,tomstuart/pygments,spencerlyon2/pygments,erickt/pygments,tomstuart/pygments,erickt/pygments,erickt/pygments,erickt/pygments,tomstuart/pygments,erickt/pygments,erickt/pygments,erickt/pygme... | [svn] Add a reminder to write a HTML formatter test. | # -*- coding: utf-8 -*-
"""
Pygments HTML formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2006 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import unittest
import StringIO
import random
from pygments import lexers, formatters
from pygments.token import _TokenType
class... | <commit_before><commit_msg>[svn] Add a reminder to write a HTML formatter test.<commit_after> | # -*- coding: utf-8 -*-
"""
Pygments HTML formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2006 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import unittest
import StringIO
import random
from pygments import lexers, formatters
from pygments.token import _TokenType
class... | [svn] Add a reminder to write a HTML formatter test.# -*- coding: utf-8 -*-
"""
Pygments HTML formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2006 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import unittest
import StringIO
import random
from pygments import lexers, for... | <commit_before><commit_msg>[svn] Add a reminder to write a HTML formatter test.<commit_after># -*- coding: utf-8 -*-
"""
Pygments HTML formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2006 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import unittest
import StringIO
import... | |
fe4bf332628b104865ca79a218800c0182c9faaa | teuthology/test/test_lock.py | teuthology/test/test_lock.py | from .. import lock
class TestLock(object):
def test_canonicalize_hostname(self):
host_base = 'box1'
result = lock.canonicalize_hostname(host_base)
assert result == '[email protected]'
def test_decanonicalize_hostname(self):
host = '[email protected]... | Add unit tests for (de)canonicalize_hostname() | Add unit tests for (de)canonicalize_hostname()
Signed-off-by: Zack Cerza <[email protected]>
| Python | mit | dmick/teuthology,caibo2014/teuthology,ivotron/teuthology,ceph/teuthology,tchaikov/teuthology,michaelsevilla/teuthology,dreamhost/teuthology,yghannam/teuthology,SUSE/teuthology,ktdreyer/teuthology,t-miyamae/teuthology,t-miyamae/teuthology,SUSE/teuthology,robbat2/teuthology,SUSE/teuthology,robbat2/teuthology,tchaikov/teu... | Add unit tests for (de)canonicalize_hostname()
Signed-off-by: Zack Cerza <[email protected]> | from .. import lock
class TestLock(object):
def test_canonicalize_hostname(self):
host_base = 'box1'
result = lock.canonicalize_hostname(host_base)
assert result == '[email protected]'
def test_decanonicalize_hostname(self):
host = '[email protected]... | <commit_before><commit_msg>Add unit tests for (de)canonicalize_hostname()
Signed-off-by: Zack Cerza <[email protected]><commit_after> | from .. import lock
class TestLock(object):
def test_canonicalize_hostname(self):
host_base = 'box1'
result = lock.canonicalize_hostname(host_base)
assert result == '[email protected]'
def test_decanonicalize_hostname(self):
host = '[email protected]... | Add unit tests for (de)canonicalize_hostname()
Signed-off-by: Zack Cerza <[email protected]>from .. import lock
class TestLock(object):
def test_canonicalize_hostname(self):
host_base = 'box1'
result = lock.canonicalize_hostname(host_base)
assert result... | <commit_before><commit_msg>Add unit tests for (de)canonicalize_hostname()
Signed-off-by: Zack Cerza <[email protected]><commit_after>from .. import lock
class TestLock(object):
def test_canonicalize_hostname(self):
host_base = 'box1'
result = lock.canonicalize_... | |
f782fe44d7a27e01a7529922040768a657432a4b | app.py | app.py | from flask import Flask, jsonify, Response
app = Flask(__name__)
@app.route('/')
def api_root():
message = {
'status': 200,
'message': 'Hello World'
}
resp = jsonify(message)
resp.status_code = 200
return resp
@app.errorhandler(404)
def not_found(error=None):
message =... | Add basic Hello World example | Add basic Hello World example
| Python | apache-2.0 | apache/cloudstack-gcestack | Add basic Hello World example | from flask import Flask, jsonify, Response
app = Flask(__name__)
@app.route('/')
def api_root():
message = {
'status': 200,
'message': 'Hello World'
}
resp = jsonify(message)
resp.status_code = 200
return resp
@app.errorhandler(404)
def not_found(error=None):
message =... | <commit_before><commit_msg>Add basic Hello World example<commit_after> | from flask import Flask, jsonify, Response
app = Flask(__name__)
@app.route('/')
def api_root():
message = {
'status': 200,
'message': 'Hello World'
}
resp = jsonify(message)
resp.status_code = 200
return resp
@app.errorhandler(404)
def not_found(error=None):
message =... | Add basic Hello World examplefrom flask import Flask, jsonify, Response
app = Flask(__name__)
@app.route('/')
def api_root():
message = {
'status': 200,
'message': 'Hello World'
}
resp = jsonify(message)
resp.status_code = 200
return resp
@app.errorhandler(404)
def not_fou... | <commit_before><commit_msg>Add basic Hello World example<commit_after>from flask import Flask, jsonify, Response
app = Flask(__name__)
@app.route('/')
def api_root():
message = {
'status': 200,
'message': 'Hello World'
}
resp = jsonify(message)
resp.status_code = 200
return... | |
cfb190ea86ea64f23a882a6e8b4212388c351d21 | scripts/clean_array.py | scripts/clean_array.py | import glob
import os
import shutil
import sys
ample_root="/home/jmht/ample-dev1"
sys.path.insert(0,os.path.join(ample_root,"python"))
import clusterize
pdb_codes=["1MIX", "1P9G", "1UCS", "1XKR", "2BL2", "2EFR", "2FM9", "2JKU", "2QIH", "2QSK", "2UUI", "2XFD", "2YKT", "3CI9", "3CVF", "3GD8", "3GHF", "3HAP", "3HFE"]
#... | CLean up crashed array jobs | CLean up crashed array jobs
| Python | bsd-3-clause | rigdenlab/ample,rigdenlab/ample,linucks/ample,linucks/ample | CLean up crashed array jobs | import glob
import os
import shutil
import sys
ample_root="/home/jmht/ample-dev1"
sys.path.insert(0,os.path.join(ample_root,"python"))
import clusterize
pdb_codes=["1MIX", "1P9G", "1UCS", "1XKR", "2BL2", "2EFR", "2FM9", "2JKU", "2QIH", "2QSK", "2UUI", "2XFD", "2YKT", "3CI9", "3CVF", "3GD8", "3GHF", "3HAP", "3HFE"]
#... | <commit_before><commit_msg>CLean up crashed array jobs<commit_after> | import glob
import os
import shutil
import sys
ample_root="/home/jmht/ample-dev1"
sys.path.insert(0,os.path.join(ample_root,"python"))
import clusterize
pdb_codes=["1MIX", "1P9G", "1UCS", "1XKR", "2BL2", "2EFR", "2FM9", "2JKU", "2QIH", "2QSK", "2UUI", "2XFD", "2YKT", "3CI9", "3CVF", "3GD8", "3GHF", "3HAP", "3HFE"]
#... | CLean up crashed array jobsimport glob
import os
import shutil
import sys
ample_root="/home/jmht/ample-dev1"
sys.path.insert(0,os.path.join(ample_root,"python"))
import clusterize
pdb_codes=["1MIX", "1P9G", "1UCS", "1XKR", "2BL2", "2EFR", "2FM9", "2JKU", "2QIH", "2QSK", "2UUI", "2XFD", "2YKT", "3CI9", "3CVF", "3GD8"... | <commit_before><commit_msg>CLean up crashed array jobs<commit_after>import glob
import os
import shutil
import sys
ample_root="/home/jmht/ample-dev1"
sys.path.insert(0,os.path.join(ample_root,"python"))
import clusterize
pdb_codes=["1MIX", "1P9G", "1UCS", "1XKR", "2BL2", "2EFR", "2FM9", "2JKU", "2QIH", "2QSK", "2UUI... | |
dfd4396d616c07b69be4acb1f974bf5b4c3e4ffb | scripts/create-user.py | scripts/create-user.py | #!/usr/bin/python
# This is a small helper script to create a CATMAID user.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
# Requires the file .catmaid-db to be present in your
# home directory, with the following format:
#
# host: localhost
# database: catmaid
# username: ca... | Add a script for creating a new user | Add a script for creating a new user
| Python | agpl-3.0 | htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID,fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID,htem/CATMAID,htem/CATMAID | Add a script for creating a new user | #!/usr/bin/python
# This is a small helper script to create a CATMAID user.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
# Requires the file .catmaid-db to be present in your
# home directory, with the following format:
#
# host: localhost
# database: catmaid
# username: ca... | <commit_before><commit_msg>Add a script for creating a new user<commit_after> | #!/usr/bin/python
# This is a small helper script to create a CATMAID user.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
# Requires the file .catmaid-db to be present in your
# home directory, with the following format:
#
# host: localhost
# database: catmaid
# username: ca... | Add a script for creating a new user#!/usr/bin/python
# This is a small helper script to create a CATMAID user.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
# Requires the file .catmaid-db to be present in your
# home directory, with the following format:
#
# host: localhos... | <commit_before><commit_msg>Add a script for creating a new user<commit_after>#!/usr/bin/python
# This is a small helper script to create a CATMAID user.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
# Requires the file .catmaid-db to be present in your
# home directory, with... | |
eb5f4c24965a60c36656118da92aeb0ca9736608 | altair/examples/airport_connections.py | altair/examples/airport_connections.py | """
Connections Among U.S. Airports Interactive
-------------------------------------------
This example shows all the connections between major U.S. airports. Lookup transformations
are used to find the coordinates of each airport and connecting airports. Connections
are displayed on mouseover via a single selection... | Add example for Connections Among U.S. Airports Interactive | DOC: Add example for Connections Among U.S. Airports Interactive
| Python | bsd-3-clause | jakevdp/altair,altair-viz/altair | DOC: Add example for Connections Among U.S. Airports Interactive | """
Connections Among U.S. Airports Interactive
-------------------------------------------
This example shows all the connections between major U.S. airports. Lookup transformations
are used to find the coordinates of each airport and connecting airports. Connections
are displayed on mouseover via a single selection... | <commit_before><commit_msg>DOC: Add example for Connections Among U.S. Airports Interactive<commit_after> | """
Connections Among U.S. Airports Interactive
-------------------------------------------
This example shows all the connections between major U.S. airports. Lookup transformations
are used to find the coordinates of each airport and connecting airports. Connections
are displayed on mouseover via a single selection... | DOC: Add example for Connections Among U.S. Airports Interactive"""
Connections Among U.S. Airports Interactive
-------------------------------------------
This example shows all the connections between major U.S. airports. Lookup transformations
are used to find the coordinates of each airport and connecting airports... | <commit_before><commit_msg>DOC: Add example for Connections Among U.S. Airports Interactive<commit_after>"""
Connections Among U.S. Airports Interactive
-------------------------------------------
This example shows all the connections between major U.S. airports. Lookup transformations
are used to find the coordinate... | |
e956e2258037e698adcf86a57085bdb2aa7576e5 | competitions/urls.py | competitions/urls.py | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^registration/successf... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^registration/successf... | Correct url of the SeasonDetailView | competitions: Correct url of the SeasonDetailView
| Python | mit | rtrembecky/roots,rtrembecky/roots,tbabej/roots,matus-stehlik/roots,matus-stehlik/roots,matus-stehlik/roots,matus-stehlik/glowing-batman,tbabej/roots,tbabej/roots,matus-stehlik/glowing-batman,rtrembecky/roots | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^registration/successf... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^registration/successf... | <commit_before>from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^regist... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^registration/successf... | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^registration/successf... | <commit_before>from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import CompetitionRegistrationView, SeasonDetailView
urlpatterns = patterns('',
url(r'^$', CompetitionRegistrationView.as_view(),
name='competitions_competition_register'),
url(r'^regist... |
e2627f3c98c45791a23fd80fcdc80f5aaf8acf4c | terminus/tests/city_visitor_test.py | terminus/tests/city_visitor_test.py | import unittest
import mock
from generators.city_visitor import CityVisitor
class CityVisitorTest(unittest.TestCase):
def test_city_visitor(self):
city = mock.Mock()
visitor = CityVisitor(city)
visitor.run()
city.accept.assert_called()
| Add test for city visitor. | Add test for city visitor.
| Python | apache-2.0 | ekumenlabs/terminus,ekumenlabs/terminus | Add test for city visitor. | import unittest
import mock
from generators.city_visitor import CityVisitor
class CityVisitorTest(unittest.TestCase):
def test_city_visitor(self):
city = mock.Mock()
visitor = CityVisitor(city)
visitor.run()
city.accept.assert_called()
| <commit_before><commit_msg>Add test for city visitor.<commit_after> | import unittest
import mock
from generators.city_visitor import CityVisitor
class CityVisitorTest(unittest.TestCase):
def test_city_visitor(self):
city = mock.Mock()
visitor = CityVisitor(city)
visitor.run()
city.accept.assert_called()
| Add test for city visitor.import unittest
import mock
from generators.city_visitor import CityVisitor
class CityVisitorTest(unittest.TestCase):
def test_city_visitor(self):
city = mock.Mock()
visitor = CityVisitor(city)
visitor.run()
city.accept.assert_called()
| <commit_before><commit_msg>Add test for city visitor.<commit_after>import unittest
import mock
from generators.city_visitor import CityVisitor
class CityVisitorTest(unittest.TestCase):
def test_city_visitor(self):
city = mock.Mock()
visitor = CityVisitor(city)
visitor.run()
city.... | |
a3c55d151a1a358f04d431b28e8512b68337825a | kremlin/forms.py | kremlin/forms.py | """
# # #### ##### # # ##### # # # #
# # # # # ## ## # # # ## # #
### #### #### # # # # # # # # #####
# # # # # # # # ## # # #
# # # ##### # # # # # # # #
Kremlin Mag... | Add WTForms version of upload form, WTForms is miles better. | Add WTForms version of upload form, WTForms is miles better.
| Python | bsd-2-clause | glasnost/kremlin,glasnost/kremlin,glasnost/kremlin | Add WTForms version of upload form, WTForms is miles better. | """
# # #### ##### # # ##### # # # #
# # # # # ## ## # # # ## # #
### #### #### # # # # # # # # #####
# # # # # # # # ## # # #
# # # ##### # # # # # # # #
Kremlin Mag... | <commit_before><commit_msg>Add WTForms version of upload form, WTForms is miles better.<commit_after> | """
# # #### ##### # # ##### # # # #
# # # # # ## ## # # # ## # #
### #### #### # # # # # # # # #####
# # # # # # # # ## # # #
# # # ##### # # # # # # # #
Kremlin Mag... | Add WTForms version of upload form, WTForms is miles better."""
# # #### ##### # # ##### # # # #
# # # # # ## ## # # # ## # #
### #### #### # # # # # # # # #####
# # # # # # # # ## # # #
# # # #... | <commit_before><commit_msg>Add WTForms version of upload form, WTForms is miles better.<commit_after>"""
# # #### ##### # # ##### # # # #
# # # # # ## ## # # # ## # #
### #### #### # # # # # # # # #####
# # # # # # # #... | |
ae46fab579822b0aaffeca271b50b2a2d89e3909 | tests/app/main/test_application.py | tests/app/main/test_application.py | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | Add test for analytics JavaScript | Add test for analytics JavaScript
| Python | mit | alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphag... | Add test for analytics JavaScript | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | <commit_before><commit_msg>Add test for analytics JavaScript<commit_after> | import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res = self.client.get('/suppliers/sta... | Add test for analytics JavaScriptimport mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_should_be_in_javascript(self):
res ... | <commit_before><commit_msg>Add test for analytics JavaScript<commit_after>import mock
from nose.tools import assert_equal, assert_true
from ..helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def setup(self):
super(TestApplication, self).setup()
def test_analytics_code_sh... | |
b1fc5436ecf69d1fe5852568fb1e8e551c7bd9b3 | pfile_tools/scripts/dump_pfile_header.py | pfile_tools/scripts/dump_pfile_header.py | #!/usr/bin/env python
import sys
import optparse
from pfile_tools import headers, struct_utils
def known_revisions():
return sorted(headers.REVISIONS().keys())
def build_option_parser():
revision_opt_strs = ", ".join([str(r) for r in known_revisions()])
p = optparse.OptionParser(
usage="usage: ... | Add friendly header dumper program. | Add friendly header dumper program. | Python | bsd-3-clause | njvack/pfile-tools | Add friendly header dumper program. | #!/usr/bin/env python
import sys
import optparse
from pfile_tools import headers, struct_utils
def known_revisions():
return sorted(headers.REVISIONS().keys())
def build_option_parser():
revision_opt_strs = ", ".join([str(r) for r in known_revisions()])
p = optparse.OptionParser(
usage="usage: ... | <commit_before><commit_msg>Add friendly header dumper program.<commit_after> | #!/usr/bin/env python
import sys
import optparse
from pfile_tools import headers, struct_utils
def known_revisions():
return sorted(headers.REVISIONS().keys())
def build_option_parser():
revision_opt_strs = ", ".join([str(r) for r in known_revisions()])
p = optparse.OptionParser(
usage="usage: ... | Add friendly header dumper program.#!/usr/bin/env python
import sys
import optparse
from pfile_tools import headers, struct_utils
def known_revisions():
return sorted(headers.REVISIONS().keys())
def build_option_parser():
revision_opt_strs = ", ".join([str(r) for r in known_revisions()])
p = optparse.O... | <commit_before><commit_msg>Add friendly header dumper program.<commit_after>#!/usr/bin/env python
import sys
import optparse
from pfile_tools import headers, struct_utils
def known_revisions():
return sorted(headers.REVISIONS().keys())
def build_option_parser():
revision_opt_strs = ", ".join([str(r) for r ... | |
352fa259d439a9be5c299470868e2fa82ecd835f | client/python/tests/unittest_runner.py | client/python/tests/unittest_runner.py | #!/usr/bin/env python
import os
import re
import sys
import shutil
import subprocess
__author__ = "Christopher Choi <[email protected]>"
# SETTINGS
keep_unittest_logs = False
unittests_bin_dir = "tests"
unittests_log_dir = "unittests_log"
unittests_file_pattern = "^[a-zA-Z0-9_]*_tests.*$"
class TC:
HEADER = '\0... | Add test folder for python | Add test folder for python
| Python | apache-2.0 | wallarelvo/backfire,wallarelvo/backfire | Add test folder for python | #!/usr/bin/env python
import os
import re
import sys
import shutil
import subprocess
__author__ = "Christopher Choi <[email protected]>"
# SETTINGS
keep_unittest_logs = False
unittests_bin_dir = "tests"
unittests_log_dir = "unittests_log"
unittests_file_pattern = "^[a-zA-Z0-9_]*_tests.*$"
class TC:
HEADER = '\0... | <commit_before><commit_msg>Add test folder for python<commit_after> | #!/usr/bin/env python
import os
import re
import sys
import shutil
import subprocess
__author__ = "Christopher Choi <[email protected]>"
# SETTINGS
keep_unittest_logs = False
unittests_bin_dir = "tests"
unittests_log_dir = "unittests_log"
unittests_file_pattern = "^[a-zA-Z0-9_]*_tests.*$"
class TC:
HEADER = '\0... | Add test folder for python#!/usr/bin/env python
import os
import re
import sys
import shutil
import subprocess
__author__ = "Christopher Choi <[email protected]>"
# SETTINGS
keep_unittest_logs = False
unittests_bin_dir = "tests"
unittests_log_dir = "unittests_log"
unittests_file_pattern = "^[a-zA-Z0-9_]*_tests.*$"
... | <commit_before><commit_msg>Add test folder for python<commit_after>#!/usr/bin/env python
import os
import re
import sys
import shutil
import subprocess
__author__ = "Christopher Choi <[email protected]>"
# SETTINGS
keep_unittest_logs = False
unittests_bin_dir = "tests"
unittests_log_dir = "unittests_log"
unittests_f... | |
d62201e3be36c1dff0276800d2c0f765572a1abb | src/WaveBlocksND/Quadrature.py | src/WaveBlocksND/Quadrature.py | """The WaveBlocks Project
@author: R. Bourquin
@copyright: Copyright (C) 2013 R. Bourquin
@license: Modified BSD License
"""
__all__ = ["Quadrature"]
class Quadrature(object):
r"""This class is an abstract interface to quadratures in general.
"""
def __init__(self):
r"""General interface for q... | Define interface for quadrature evaluator (first try) | Define interface for quadrature evaluator (first try)
| Python | bsd-3-clause | WaveBlocks/WaveBlocksND,WaveBlocks/WaveBlocksND | Define interface for quadrature evaluator (first try) | """The WaveBlocks Project
@author: R. Bourquin
@copyright: Copyright (C) 2013 R. Bourquin
@license: Modified BSD License
"""
__all__ = ["Quadrature"]
class Quadrature(object):
r"""This class is an abstract interface to quadratures in general.
"""
def __init__(self):
r"""General interface for q... | <commit_before><commit_msg>Define interface for quadrature evaluator (first try)<commit_after> | """The WaveBlocks Project
@author: R. Bourquin
@copyright: Copyright (C) 2013 R. Bourquin
@license: Modified BSD License
"""
__all__ = ["Quadrature"]
class Quadrature(object):
r"""This class is an abstract interface to quadratures in general.
"""
def __init__(self):
r"""General interface for q... | Define interface for quadrature evaluator (first try)"""The WaveBlocks Project
@author: R. Bourquin
@copyright: Copyright (C) 2013 R. Bourquin
@license: Modified BSD License
"""
__all__ = ["Quadrature"]
class Quadrature(object):
r"""This class is an abstract interface to quadratures in general.
"""
de... | <commit_before><commit_msg>Define interface for quadrature evaluator (first try)<commit_after>"""The WaveBlocks Project
@author: R. Bourquin
@copyright: Copyright (C) 2013 R. Bourquin
@license: Modified BSD License
"""
__all__ = ["Quadrature"]
class Quadrature(object):
r"""This class is an abstract interface t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.