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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df4e3d8a1db1b9195b70d95eb4fdcd45a7ca4b23 | util/device_profile_data.py | util/device_profile_data.py | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Parse device output to extract LLVM profile data.
The profile data obtained from the device is raw. Thus, it must be indexed
before it can be used... | Implement a script for extracting profile data from device output | [util] Implement a script for extracting profile data from device output
This change introduces a python script that extracts profile data from
device output.
Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com>
| Python | apache-2.0 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan | [util] Implement a script for extracting profile data from device output
This change introduces a python script that extracts profile data from
device output.
Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com> | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Parse device output to extract LLVM profile data.
The profile data obtained from the device is raw. Thus, it must be indexed
before it can be used... | <commit_before><commit_msg>[util] Implement a script for extracting profile data from device output
This change introduces a python script that extracts profile data from
device output.
Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com><commit_after> | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Parse device output to extract LLVM profile data.
The profile data obtained from the device is raw. Thus, it must be indexed
before it can be used... | [util] Implement a script for extracting profile data from device output
This change introduces a python script that extracts profile data from
device output.
Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com>#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the... | <commit_before><commit_msg>[util] Implement a script for extracting profile data from device output
This change introduces a python script that extracts profile data from
device output.
Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com><commit_after>#!/usr/bin/env python3
# Copyright l... | |
dbc6e2b41ca6afc759e7bdad102e40fc7404d7de | Wrappers/Dials/SpaceGroup.py | Wrappers/Dials/SpaceGroup.py | from __future__ import absolute_import, division, print_function
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Streams import Chatter, Debug
def DialsSpaceGroup(DriverType=None):
"""A factory for DialsSpaceGroupWrapper classes."""
DriverInstance = DriverFactory.Driver(Drive... | Add missing wrapper for dials.space_group | Add missing wrapper for dials.space_group
| Python | bsd-3-clause | xia2/xia2,xia2/xia2 | Add missing wrapper for dials.space_group | from __future__ import absolute_import, division, print_function
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Streams import Chatter, Debug
def DialsSpaceGroup(DriverType=None):
"""A factory for DialsSpaceGroupWrapper classes."""
DriverInstance = DriverFactory.Driver(Drive... | <commit_before><commit_msg>Add missing wrapper for dials.space_group<commit_after> | from __future__ import absolute_import, division, print_function
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Streams import Chatter, Debug
def DialsSpaceGroup(DriverType=None):
"""A factory for DialsSpaceGroupWrapper classes."""
DriverInstance = DriverFactory.Driver(Drive... | Add missing wrapper for dials.space_groupfrom __future__ import absolute_import, division, print_function
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Streams import Chatter, Debug
def DialsSpaceGroup(DriverType=None):
"""A factory for DialsSpaceGroupWrapper classes."""
Dr... | <commit_before><commit_msg>Add missing wrapper for dials.space_group<commit_after>from __future__ import absolute_import, division, print_function
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Streams import Chatter, Debug
def DialsSpaceGroup(DriverType=None):
"""A factory for D... | |
a948e35ddc1121d26a851fe1f06032115302c038 | visuals_EM/plotly_arrows.py | visuals_EM/plotly_arrows.py | import numpy as np
import plotly.graph_objs as go
def p2c(r, theta, phi):
"""Convert polar unit vector to cartesians"""
return [r * np.sin(theta) * np.cos(phi),
r * np.sin(theta) * np.sin(phi),
r * np.cos(theta)]
class Arrow:
def __init__(self, theta, phi, out, width=5, color='rgb(0,0... | Convert arrows notebook to importable py file | Convert arrows notebook to importable py file
| Python | mit | cydcowley/Imperial-Visualizations,cydcowley/Imperial-Visualizations,cydcowley/Imperial-Visualizations,cydcowley/Imperial-Visualizations | Convert arrows notebook to importable py file | import numpy as np
import plotly.graph_objs as go
def p2c(r, theta, phi):
"""Convert polar unit vector to cartesians"""
return [r * np.sin(theta) * np.cos(phi),
r * np.sin(theta) * np.sin(phi),
r * np.cos(theta)]
class Arrow:
def __init__(self, theta, phi, out, width=5, color='rgb(0,0... | <commit_before><commit_msg>Convert arrows notebook to importable py file<commit_after> | import numpy as np
import plotly.graph_objs as go
def p2c(r, theta, phi):
"""Convert polar unit vector to cartesians"""
return [r * np.sin(theta) * np.cos(phi),
r * np.sin(theta) * np.sin(phi),
r * np.cos(theta)]
class Arrow:
def __init__(self, theta, phi, out, width=5, color='rgb(0,0... | Convert arrows notebook to importable py fileimport numpy as np
import plotly.graph_objs as go
def p2c(r, theta, phi):
"""Convert polar unit vector to cartesians"""
return [r * np.sin(theta) * np.cos(phi),
r * np.sin(theta) * np.sin(phi),
r * np.cos(theta)]
class Arrow:
def __init__(s... | <commit_before><commit_msg>Convert arrows notebook to importable py file<commit_after>import numpy as np
import plotly.graph_objs as go
def p2c(r, theta, phi):
"""Convert polar unit vector to cartesians"""
return [r * np.sin(theta) * np.cos(phi),
r * np.sin(theta) * np.sin(phi),
r * np.cos... | |
f0d8821b42a017e95dc9528e051e7700bfde64e1 | examples/deploytemplate-cli.py | examples/deploytemplate-cli.py | # deploytemplate.py
# authenticates using CLI e.g. run this in the Azure Cloud Shell
# takes a deployment template URI and a local parameters file and deploys it
# Arguments: -u templateUri
# -p parameters JSON file
# -l location
# -g existing resource group
# -s subscription... | Save cloud shell deploy template example | Save cloud shell deploy template example
| Python | mit | gbowerman/azurerm | Save cloud shell deploy template example | # deploytemplate.py
# authenticates using CLI e.g. run this in the Azure Cloud Shell
# takes a deployment template URI and a local parameters file and deploys it
# Arguments: -u templateUri
# -p parameters JSON file
# -l location
# -g existing resource group
# -s subscription... | <commit_before><commit_msg>Save cloud shell deploy template example<commit_after> | # deploytemplate.py
# authenticates using CLI e.g. run this in the Azure Cloud Shell
# takes a deployment template URI and a local parameters file and deploys it
# Arguments: -u templateUri
# -p parameters JSON file
# -l location
# -g existing resource group
# -s subscription... | Save cloud shell deploy template example# deploytemplate.py
# authenticates using CLI e.g. run this in the Azure Cloud Shell
# takes a deployment template URI and a local parameters file and deploys it
# Arguments: -u templateUri
# -p parameters JSON file
# -l location
# -g existing res... | <commit_before><commit_msg>Save cloud shell deploy template example<commit_after># deploytemplate.py
# authenticates using CLI e.g. run this in the Azure Cloud Shell
# takes a deployment template URI and a local parameters file and deploys it
# Arguments: -u templateUri
# -p parameters JSON file
# ... | |
604a413173c1699e954bf689ea948f5fcc58c9d6 | events/migrations/0022_auto_20160229_2111.py | events/migrations/0022_auto_20160229_2111.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('events', '0021_auto_20160217_1832'),
]
operations = [
migrations.AlterMo... | Add a migration for earlier changes | Add a migration for earlier changes
| Python | mit | tuomas777/linkedevents,aapris/linkedevents,tuomas777/linkedevents,tuomas777/linkedevents,aapris/linkedevents,City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents,aapris/linkedevents | Add a migration for earlier changes | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('events', '0021_auto_20160217_1832'),
]
operations = [
migrations.AlterMo... | <commit_before><commit_msg>Add a migration for earlier changes<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('events', '0021_auto_20160217_1832'),
]
operations = [
migrations.AlterMo... | Add a migration for earlier changes# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('events', '0021_auto_20160217_1832'),
]
operat... | <commit_before><commit_msg>Add a migration for earlier changes<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('events', '002... | |
af7a16eb085ae9a436dbd787e487a9228b66652f | srw/find_object.py | srw/find_object.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import logging
import ds9
logging.basicConfig(
level='DEBUG', format='%(asctime)s|%(name)s|%(levelname)s|%(message)s')
logger = logging.getLogger(__name__)
def main(args):
logger.de... | Copy file contents into path | Copy file contents into path
| Python | mit | mindriot101/srw | Copy file contents into path | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import logging
import ds9
logging.basicConfig(
level='DEBUG', format='%(asctime)s|%(name)s|%(levelname)s|%(message)s')
logger = logging.getLogger(__name__)
def main(args):
logger.de... | <commit_before><commit_msg>Copy file contents into path<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import logging
import ds9
logging.basicConfig(
level='DEBUG', format='%(asctime)s|%(name)s|%(levelname)s|%(message)s')
logger = logging.getLogger(__name__)
def main(args):
logger.de... | Copy file contents into path#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import logging
import ds9
logging.basicConfig(
level='DEBUG', format='%(asctime)s|%(name)s|%(levelname)s|%(message)s')
logger = logging.getLogger(__name__)
d... | <commit_before><commit_msg>Copy file contents into path<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import argparse
import logging
import ds9
logging.basicConfig(
level='DEBUG', format='%(asctime)s|%(name)s|%(levelname)s|%(message)s')... | |
39a65299bd72019cce3691cabd5f2d8afebc61ac | suite/ppcbranch.py | suite/ppcbranch.py | #!/usr/bin/env python
# Capstone by Nguyen Anh Quynnh <aquynh@gmail.com>
# PPC Branch testing suite by kratolp
from __future__ import print_function
import sys
from capstone import *
CODE32 = b"\x48\x01\x05\x15" # bl .+0x10514
CODE32 += b"\x4B\xff\xff\xfd" # bl .-0x4
CODE32 += b"\x48\x00\x00\x0c" # b .+0xc
CODE32 +=... | Add ppc branch test suite | Add ppc branch test suite
| Python | bsd-3-clause | dynm/capstone,bughoho/capstone,pyq881120/capstone,zneak/capstone,capturePointer/capstone,NeilBryant/capstone,dynm/capstone,code4bones/capstone,pyq881120/capstone,pranith/capstone,sigma-random/capstone,xia0pin9/capstone,xia0pin9/capstone,techvoltage/capstone,8l/capstone,krytarowski/capstone,dynm/capstone,bowlofstew/caps... | Add ppc branch test suite | #!/usr/bin/env python
# Capstone by Nguyen Anh Quynnh <aquynh@gmail.com>
# PPC Branch testing suite by kratolp
from __future__ import print_function
import sys
from capstone import *
CODE32 = b"\x48\x01\x05\x15" # bl .+0x10514
CODE32 += b"\x4B\xff\xff\xfd" # bl .-0x4
CODE32 += b"\x48\x00\x00\x0c" # b .+0xc
CODE32 +=... | <commit_before><commit_msg>Add ppc branch test suite<commit_after> | #!/usr/bin/env python
# Capstone by Nguyen Anh Quynnh <aquynh@gmail.com>
# PPC Branch testing suite by kratolp
from __future__ import print_function
import sys
from capstone import *
CODE32 = b"\x48\x01\x05\x15" # bl .+0x10514
CODE32 += b"\x4B\xff\xff\xfd" # bl .-0x4
CODE32 += b"\x48\x00\x00\x0c" # b .+0xc
CODE32 +=... | Add ppc branch test suite#!/usr/bin/env python
# Capstone by Nguyen Anh Quynnh <aquynh@gmail.com>
# PPC Branch testing suite by kratolp
from __future__ import print_function
import sys
from capstone import *
CODE32 = b"\x48\x01\x05\x15" # bl .+0x10514
CODE32 += b"\x4B\xff\xff\xfd" # bl .-0x4
CODE32 += b"\x48\x00\x00... | <commit_before><commit_msg>Add ppc branch test suite<commit_after>#!/usr/bin/env python
# Capstone by Nguyen Anh Quynnh <aquynh@gmail.com>
# PPC Branch testing suite by kratolp
from __future__ import print_function
import sys
from capstone import *
CODE32 = b"\x48\x01\x05\x15" # bl .+0x10514
CODE32 += b"\x4B\xff\xff... | |
4a561e594aa026ea038f0df4a65bd0438beaa112 | webapp/apps/staff/views.py | webapp/apps/staff/views.py | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth.models import User
def index_view(request):
users = User.objects.al... | Add list of users to staff/users | Add list of users to staff/users
Return a list of users to staff/users index view
| Python | apache-2.0 | patrickspencer/compass-python,patrickspencer/compass,patrickspencer/compass,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass,patrickspencer/compass,patrickspencer/compass | Add list of users to staff/users
Return a list of users to staff/users index view | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth.models import User
def index_view(request):
users = User.objects.al... | <commit_before><commit_msg>Add list of users to staff/users
Return a list of users to staff/users index view<commit_after> | from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth.models import User
def index_view(request):
users = User.objects.al... | Add list of users to staff/users
Return a list of users to staff/users index viewfrom django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django.contrib import messages
from django.cont... | <commit_before><commit_msg>Add list of users to staff/users
Return a list of users to staff/users index view<commit_after>from django.shortcuts import get_object_or_404, render, redirect
from django.shortcuts import render
from apps.staff.forms import NewUserForm
from django.contrib.auth.models import User
from django... | |
51c954e49d19ebb5e707ec3cd164d3fd9ba5fbe0 | pcs/packets/ipv6ext.py | pcs/packets/ipv6ext.py | # Copyright (C) 2013, Neville-neil Consulting
# All Rights Reserved.
#
# Redistribution And Use In Source And Binary Forms, With Or Without
# Modification, Are Permitted Provided That The Following Conditions Are
# Met:
#
# Redistributions Of Source Code Must Retain The Above Copyright Notice,
# This List Of Conditions... | Add a class that implements the IPv6 routing header. | Add a class that implements the IPv6 routing header. | Python | bsd-3-clause | gvnn3/PCS,gvnn3/PCS | Add a class that implements the IPv6 routing header. | # Copyright (C) 2013, Neville-neil Consulting
# All Rights Reserved.
#
# Redistribution And Use In Source And Binary Forms, With Or Without
# Modification, Are Permitted Provided That The Following Conditions Are
# Met:
#
# Redistributions Of Source Code Must Retain The Above Copyright Notice,
# This List Of Conditions... | <commit_before><commit_msg>Add a class that implements the IPv6 routing header.<commit_after> | # Copyright (C) 2013, Neville-neil Consulting
# All Rights Reserved.
#
# Redistribution And Use In Source And Binary Forms, With Or Without
# Modification, Are Permitted Provided That The Following Conditions Are
# Met:
#
# Redistributions Of Source Code Must Retain The Above Copyright Notice,
# This List Of Conditions... | Add a class that implements the IPv6 routing header.# Copyright (C) 2013, Neville-neil Consulting
# All Rights Reserved.
#
# Redistribution And Use In Source And Binary Forms, With Or Without
# Modification, Are Permitted Provided That The Following Conditions Are
# Met:
#
# Redistributions Of Source Code Must Retain T... | <commit_before><commit_msg>Add a class that implements the IPv6 routing header.<commit_after># Copyright (C) 2013, Neville-neil Consulting
# All Rights Reserved.
#
# Redistribution And Use In Source And Binary Forms, With Or Without
# Modification, Are Permitted Provided That The Following Conditions Are
# Met:
#
# Red... | |
ab36778ec3c8ed69ce798816161ee35a368e2dc2 | tests/test_base.py | tests/test_base.py | # Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | Improve unit tests for python-glanceclient.glanceclient.common.base | Improve unit tests for python-glanceclient.glanceclient.common.base
Add several tests for glanceclient.common.base module
Fixes: bug #1144158
Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248
| Python | apache-2.0 | ntt-sic/python-glanceclient,citrix-openstack-build/python-glanceclient,metacloud/python-glanceclient,alexpilotti/python-glanceclient,metacloud/python-glanceclient,klmitch/python-glanceclient,klmitch/python-glanceclient,citrix-openstack-build/python-glanceclient,varunarya10/python-glanceclient,JioCloud/python-glanceclie... | Improve unit tests for python-glanceclient.glanceclient.common.base
Add several tests for glanceclient.common.base module
Fixes: bug #1144158
Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248 | # Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | <commit_before><commit_msg>Improve unit tests for python-glanceclient.glanceclient.common.base
Add several tests for glanceclient.common.base module
Fixes: bug #1144158
Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248<commit_after> | # Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | Improve unit tests for python-glanceclient.glanceclient.common.base
Add several tests for glanceclient.common.base module
Fixes: bug #1144158
Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248# Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! Inc.
# All Rights Reserved.
#
# Licensed under the Apac... | <commit_before><commit_msg>Improve unit tests for python-glanceclient.glanceclient.common.base
Add several tests for glanceclient.common.base module
Fixes: bug #1144158
Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248<commit_after># Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! Inc.
# All Rights... | |
086aad14864ddeae8cf050f5ed2b0f57773a4fad | tests/link_tests/substitution_tests.py | tests/link_tests/substitution_tests.py | from utils import LinkTest, main
import re
class SubstitutionTest(LinkTest):
def testSubstititonFunction(self):
text = """
<pattern>
"""
subs = [
(r"<pattern>", lambda m: 'Hello world!')
]
expect = """
Hello world!
"""
self.assertS... | Add substitution and scrape_header tests | Add substitution and scrape_header tests
| Python | mit | albert12132/templar,albert12132/templar | Add substitution and scrape_header tests | from utils import LinkTest, main
import re
class SubstitutionTest(LinkTest):
def testSubstititonFunction(self):
text = """
<pattern>
"""
subs = [
(r"<pattern>", lambda m: 'Hello world!')
]
expect = """
Hello world!
"""
self.assertS... | <commit_before><commit_msg>Add substitution and scrape_header tests<commit_after> | from utils import LinkTest, main
import re
class SubstitutionTest(LinkTest):
def testSubstititonFunction(self):
text = """
<pattern>
"""
subs = [
(r"<pattern>", lambda m: 'Hello world!')
]
expect = """
Hello world!
"""
self.assertS... | Add substitution and scrape_header testsfrom utils import LinkTest, main
import re
class SubstitutionTest(LinkTest):
def testSubstititonFunction(self):
text = """
<pattern>
"""
subs = [
(r"<pattern>", lambda m: 'Hello world!')
]
expect = """
Hello... | <commit_before><commit_msg>Add substitution and scrape_header tests<commit_after>from utils import LinkTest, main
import re
class SubstitutionTest(LinkTest):
def testSubstititonFunction(self):
text = """
<pattern>
"""
subs = [
(r"<pattern>", lambda m: 'Hello world!')
... | |
b7af9190f9edf015508665c9b257432434311279 | iri_to_uri.py | iri_to_uri.py | from urllib.parse import quote, urlsplit, urlunsplit
def transform(iri): # преобразует кириллицу в URI
parts = urlsplit(iri)
uri = urlunsplit((parts.scheme, parts.netloc.encode('idna').decode(
'ascii'), quote(parts.path), quote(parts.query, '='), quote(parts.fragment),))
return uri
| Revert "fix deep night bugs :)" | Revert "fix deep night bugs :)"
| Python | mit | dimishpatriot/img_pars | Revert "fix deep night bugs :)" | from urllib.parse import quote, urlsplit, urlunsplit
def transform(iri): # преобразует кириллицу в URI
parts = urlsplit(iri)
uri = urlunsplit((parts.scheme, parts.netloc.encode('idna').decode(
'ascii'), quote(parts.path), quote(parts.query, '='), quote(parts.fragment),))
return uri
| <commit_before><commit_msg>Revert "fix deep night bugs :)"<commit_after> | from urllib.parse import quote, urlsplit, urlunsplit
def transform(iri): # преобразует кириллицу в URI
parts = urlsplit(iri)
uri = urlunsplit((parts.scheme, parts.netloc.encode('idna').decode(
'ascii'), quote(parts.path), quote(parts.query, '='), quote(parts.fragment),))
return uri
| Revert "fix deep night bugs :)"from urllib.parse import quote, urlsplit, urlunsplit
def transform(iri): # преобразует кириллицу в URI
parts = urlsplit(iri)
uri = urlunsplit((parts.scheme, parts.netloc.encode('idna').decode(
'ascii'), quote(parts.path), quote(parts.query, '='), quote(parts.fragment),)... | <commit_before><commit_msg>Revert "fix deep night bugs :)"<commit_after>from urllib.parse import quote, urlsplit, urlunsplit
def transform(iri): # преобразует кириллицу в URI
parts = urlsplit(iri)
uri = urlunsplit((parts.scheme, parts.netloc.encode('idna').decode(
'ascii'), quote(parts.path), quote(p... | |
a78c0cec23365ed6861b68f40fd7481787aa2d81 | tests/organize/test_views.py | tests/organize/test_views.py | from django.urls import reverse
def test_form_thank_you(client):
# Access the thank you page
resp = client.get(reverse('organize:form_thank_you'))
assert resp.status_code == 200
def test_index(client):
# Access the organize homepage
resp = client.get(reverse('organize:index'))
assert resp.st... | Add tests for organize views | Add tests for organize views
| Python | bsd-3-clause | DjangoGirls/djangogirls,DjangoGirls/djangogirls,DjangoGirls/djangogirls | Add tests for organize views | from django.urls import reverse
def test_form_thank_you(client):
# Access the thank you page
resp = client.get(reverse('organize:form_thank_you'))
assert resp.status_code == 200
def test_index(client):
# Access the organize homepage
resp = client.get(reverse('organize:index'))
assert resp.st... | <commit_before><commit_msg>Add tests for organize views<commit_after> | from django.urls import reverse
def test_form_thank_you(client):
# Access the thank you page
resp = client.get(reverse('organize:form_thank_you'))
assert resp.status_code == 200
def test_index(client):
# Access the organize homepage
resp = client.get(reverse('organize:index'))
assert resp.st... | Add tests for organize viewsfrom django.urls import reverse
def test_form_thank_you(client):
# Access the thank you page
resp = client.get(reverse('organize:form_thank_you'))
assert resp.status_code == 200
def test_index(client):
# Access the organize homepage
resp = client.get(reverse('organize... | <commit_before><commit_msg>Add tests for organize views<commit_after>from django.urls import reverse
def test_form_thank_you(client):
# Access the thank you page
resp = client.get(reverse('organize:form_thank_you'))
assert resp.status_code == 200
def test_index(client):
# Access the organize homepag... | |
4036fbd858217677a3f21cf95ae5ec611ca23e61 | scipy/linalg/tests/test_build.py | scipy/linalg/tests/test_build.py | from subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.testing import TestCase, dec
from scipy.linalg import flapack
# XXX: this is copied from numpy trunk. Can be removed when we will depend on
# numpy 1.3
class FindDependenciesLdd:
def __init__(self):
self.cmd = ['l... | Add fortran ABI mismatch test for scipy.linalg. | Add fortran ABI mismatch test for scipy.linalg.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@5023 d6536bca-fef9-0310-8506-e4c0a848fbcf
| Python | bsd-3-clause | scipy/scipy-svn,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,scipy/scipy-svn,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,scipy/scipy-svn,scipy/scipy-svn,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt | Add fortran ABI mismatch test for scipy.linalg.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@5023 d6536bca-fef9-0310-8506-e4c0a848fbcf | from subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.testing import TestCase, dec
from scipy.linalg import flapack
# XXX: this is copied from numpy trunk. Can be removed when we will depend on
# numpy 1.3
class FindDependenciesLdd:
def __init__(self):
self.cmd = ['l... | <commit_before><commit_msg>Add fortran ABI mismatch test for scipy.linalg.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@5023 d6536bca-fef9-0310-8506-e4c0a848fbcf<commit_after> | from subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.testing import TestCase, dec
from scipy.linalg import flapack
# XXX: this is copied from numpy trunk. Can be removed when we will depend on
# numpy 1.3
class FindDependenciesLdd:
def __init__(self):
self.cmd = ['l... | Add fortran ABI mismatch test for scipy.linalg.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@5023 d6536bca-fef9-0310-8506-e4c0a848fbcffrom subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.testing import TestCase, dec
from scipy.linalg import flapack
# XXX: this is copie... | <commit_before><commit_msg>Add fortran ABI mismatch test for scipy.linalg.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@5023 d6536bca-fef9-0310-8506-e4c0a848fbcf<commit_after>from subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.testing import TestCase, dec
from scipy.li... | |
4899fdff735e0dd099764327eb6e1c88ca40fb58 | Home/feedPigeons.py | Home/feedPigeons.py | def checkio(n):
return feed(n, 1, 0)
def feed(n, pigeon, last):
if n <= last:
return last
if last < n <= pigeon:
return n
if n > pigeon:
return feed(n - pigeon, 2 * pigeon - last + 1, pigeon)
if __name__ == '__main__':
assert checkio(0) == 0, 0
assert checkio(1) == 1,... | Fix the "Feed Pigeon" problem | Fix the "Feed Pigeon" problem
| Python | mit | edwardzhu/checkio-solution | Fix the "Feed Pigeon" problem | def checkio(n):
return feed(n, 1, 0)
def feed(n, pigeon, last):
if n <= last:
return last
if last < n <= pigeon:
return n
if n > pigeon:
return feed(n - pigeon, 2 * pigeon - last + 1, pigeon)
if __name__ == '__main__':
assert checkio(0) == 0, 0
assert checkio(1) == 1,... | <commit_before><commit_msg>Fix the "Feed Pigeon" problem<commit_after> | def checkio(n):
return feed(n, 1, 0)
def feed(n, pigeon, last):
if n <= last:
return last
if last < n <= pigeon:
return n
if n > pigeon:
return feed(n - pigeon, 2 * pigeon - last + 1, pigeon)
if __name__ == '__main__':
assert checkio(0) == 0, 0
assert checkio(1) == 1,... | Fix the "Feed Pigeon" problemdef checkio(n):
return feed(n, 1, 0)
def feed(n, pigeon, last):
if n <= last:
return last
if last < n <= pigeon:
return n
if n > pigeon:
return feed(n - pigeon, 2 * pigeon - last + 1, pigeon)
if __name__ == '__main__':
assert checkio(0) == 0, ... | <commit_before><commit_msg>Fix the "Feed Pigeon" problem<commit_after>def checkio(n):
return feed(n, 1, 0)
def feed(n, pigeon, last):
if n <= last:
return last
if last < n <= pigeon:
return n
if n > pigeon:
return feed(n - pigeon, 2 * pigeon - last + 1, pigeon)
if __name__ ==... | |
07da39fcc68027d4373a467cbb08c35a5d941545 | spreadflow_core/test/matchers.py | spreadflow_core/test/matchers.py | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from testtools import matchers
class MatchesInvocation(matchers.MatchesListwise):
"""
Matches an invocation recorded by :class:`unittest.mock.Mock.call_args`
Args:
*args: Matchers matchi... | Add a custom testtools matcher for verifying invocations | Add a custom testtools matcher for verifying invocations
| Python | mit | znerol/spreadflow-core,spreadflow/spreadflow-core | Add a custom testtools matcher for verifying invocations | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from testtools import matchers
class MatchesInvocation(matchers.MatchesListwise):
"""
Matches an invocation recorded by :class:`unittest.mock.Mock.call_args`
Args:
*args: Matchers matchi... | <commit_before><commit_msg>Add a custom testtools matcher for verifying invocations<commit_after> | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from testtools import matchers
class MatchesInvocation(matchers.MatchesListwise):
"""
Matches an invocation recorded by :class:`unittest.mock.Mock.call_args`
Args:
*args: Matchers matchi... | Add a custom testtools matcher for verifying invocationsfrom __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from testtools import matchers
class MatchesInvocation(matchers.MatchesListwise):
"""
Matches an invocation recorded by :class:`unittest.mock.M... | <commit_before><commit_msg>Add a custom testtools matcher for verifying invocations<commit_after>from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from testtools import matchers
class MatchesInvocation(matchers.MatchesListwise):
"""
Matches an invoc... | |
de10ebd4192576a7a9f9fc73871cc56479f4d686 | dedupsqlfs/lib/cache/_base.py | dedupsqlfs/lib/cache/_base.py | # -*- coding: utf8 -*-
"""
@author Sergey Dryabzhinsky
"""
from time import time
class TimedCache(object):
"""
Cache storage with timers
"""
_enable_timers = True
def __init__(self):
self._time_spent = {}
self._op_count = {}
pass
def setEnableTimers(self, flag=True):... | Fix release - add missed file - forced | Fix release - add missed file - forced
| Python | mit | sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs | Fix release - add missed file - forced | # -*- coding: utf8 -*-
"""
@author Sergey Dryabzhinsky
"""
from time import time
class TimedCache(object):
"""
Cache storage with timers
"""
_enable_timers = True
def __init__(self):
self._time_spent = {}
self._op_count = {}
pass
def setEnableTimers(self, flag=True):... | <commit_before><commit_msg>Fix release - add missed file - forced<commit_after> | # -*- coding: utf8 -*-
"""
@author Sergey Dryabzhinsky
"""
from time import time
class TimedCache(object):
"""
Cache storage with timers
"""
_enable_timers = True
def __init__(self):
self._time_spent = {}
self._op_count = {}
pass
def setEnableTimers(self, flag=True):... | Fix release - add missed file - forced# -*- coding: utf8 -*-
"""
@author Sergey Dryabzhinsky
"""
from time import time
class TimedCache(object):
"""
Cache storage with timers
"""
_enable_timers = True
def __init__(self):
self._time_spent = {}
self._op_count = {}
pass
... | <commit_before><commit_msg>Fix release - add missed file - forced<commit_after># -*- coding: utf8 -*-
"""
@author Sergey Dryabzhinsky
"""
from time import time
class TimedCache(object):
"""
Cache storage with timers
"""
_enable_timers = True
def __init__(self):
self._time_spent = {}
... | |
fe65f99972a940b13652e98778fdaec8f98142bc | limit_tabs.py | limit_tabs.py | """Same idea as ZenTabs, but simplified logic since we know tabs are already
ordered by MRU.
Unlike ZenTabs, this also makes it much easier to customize tabs that you
don't want to be closeable.
It also tweaks the formula: tabs that are not closable are *not* included
in the liit.
"""
from .lib import settled_event
... | Add LimitTabs plugin to replace ZenTabs | Add LimitTabs plugin to replace ZenTabs
| Python | mit | russelldavis/sublimerc | Add LimitTabs plugin to replace ZenTabs | """Same idea as ZenTabs, but simplified logic since we know tabs are already
ordered by MRU.
Unlike ZenTabs, this also makes it much easier to customize tabs that you
don't want to be closeable.
It also tweaks the formula: tabs that are not closable are *not* included
in the liit.
"""
from .lib import settled_event
... | <commit_before><commit_msg>Add LimitTabs plugin to replace ZenTabs<commit_after> | """Same idea as ZenTabs, but simplified logic since we know tabs are already
ordered by MRU.
Unlike ZenTabs, this also makes it much easier to customize tabs that you
don't want to be closeable.
It also tweaks the formula: tabs that are not closable are *not* included
in the liit.
"""
from .lib import settled_event
... | Add LimitTabs plugin to replace ZenTabs"""Same idea as ZenTabs, but simplified logic since we know tabs are already
ordered by MRU.
Unlike ZenTabs, this also makes it much easier to customize tabs that you
don't want to be closeable.
It also tweaks the formula: tabs that are not closable are *not* included
in the lii... | <commit_before><commit_msg>Add LimitTabs plugin to replace ZenTabs<commit_after>"""Same idea as ZenTabs, but simplified logic since we know tabs are already
ordered by MRU.
Unlike ZenTabs, this also makes it much easier to customize tabs that you
don't want to be closeable.
It also tweaks the formula: tabs that are n... | |
1fcf95eb58a186f8fbb2d901a0242b3b39d960d2 | examples/tv_to_rdf.py | examples/tv_to_rdf.py | #!/usr/bin/env python
"""
Converts an tag/value file to RDF format.
Usage: tv_to_rdf <tagvaluefile> <rdffile>
"""
import sys
import codecs
from spdx.parsers.tagvalue import Parser
from spdx.parsers.loggers import StandardLogger
from spdx.parsers.tagvaluebuilders import Builder
from spdx.writers.rdf import write_docume... | Add example file to convert tv to rdf | Add example file to convert tv to rdf
Signed-off-by: Tushar Mittal <fbbe7fbe5386ca0b80ae985499e622beebee2b12@gmail.com>
| Python | apache-2.0 | spdx/tools-python | Add example file to convert tv to rdf
Signed-off-by: Tushar Mittal <fbbe7fbe5386ca0b80ae985499e622beebee2b12@gmail.com> | #!/usr/bin/env python
"""
Converts an tag/value file to RDF format.
Usage: tv_to_rdf <tagvaluefile> <rdffile>
"""
import sys
import codecs
from spdx.parsers.tagvalue import Parser
from spdx.parsers.loggers import StandardLogger
from spdx.parsers.tagvaluebuilders import Builder
from spdx.writers.rdf import write_docume... | <commit_before><commit_msg>Add example file to convert tv to rdf
Signed-off-by: Tushar Mittal <fbbe7fbe5386ca0b80ae985499e622beebee2b12@gmail.com><commit_after> | #!/usr/bin/env python
"""
Converts an tag/value file to RDF format.
Usage: tv_to_rdf <tagvaluefile> <rdffile>
"""
import sys
import codecs
from spdx.parsers.tagvalue import Parser
from spdx.parsers.loggers import StandardLogger
from spdx.parsers.tagvaluebuilders import Builder
from spdx.writers.rdf import write_docume... | Add example file to convert tv to rdf
Signed-off-by: Tushar Mittal <fbbe7fbe5386ca0b80ae985499e622beebee2b12@gmail.com>#!/usr/bin/env python
"""
Converts an tag/value file to RDF format.
Usage: tv_to_rdf <tagvaluefile> <rdffile>
"""
import sys
import codecs
from spdx.parsers.tagvalue import Parser
from spdx.parsers.l... | <commit_before><commit_msg>Add example file to convert tv to rdf
Signed-off-by: Tushar Mittal <fbbe7fbe5386ca0b80ae985499e622beebee2b12@gmail.com><commit_after>#!/usr/bin/env python
"""
Converts an tag/value file to RDF format.
Usage: tv_to_rdf <tagvaluefile> <rdffile>
"""
import sys
import codecs
from spdx.parsers.t... | |
6e878dae6669b7344723e5c49e0dec736b86fc19 | raco/relation_key.py | raco/relation_key.py | """Representation of a Myria relation key.
Myria relations are identified by a tuple of user, program, relation_name."""
class RelationKey(object):
def __init__(user='public', program='adhoc', relation=None):
assert relation
self.user = user
self.program = program
self.relation = r... | Add a class to represent myria relation keys | Add a class to represent myria relation keys
| Python | bsd-3-clause | uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco | Add a class to represent myria relation keys | """Representation of a Myria relation key.
Myria relations are identified by a tuple of user, program, relation_name."""
class RelationKey(object):
def __init__(user='public', program='adhoc', relation=None):
assert relation
self.user = user
self.program = program
self.relation = r... | <commit_before><commit_msg>Add a class to represent myria relation keys<commit_after> | """Representation of a Myria relation key.
Myria relations are identified by a tuple of user, program, relation_name."""
class RelationKey(object):
def __init__(user='public', program='adhoc', relation=None):
assert relation
self.user = user
self.program = program
self.relation = r... | Add a class to represent myria relation keys"""Representation of a Myria relation key.
Myria relations are identified by a tuple of user, program, relation_name."""
class RelationKey(object):
def __init__(user='public', program='adhoc', relation=None):
assert relation
self.user = user
self... | <commit_before><commit_msg>Add a class to represent myria relation keys<commit_after>"""Representation of a Myria relation key.
Myria relations are identified by a tuple of user, program, relation_name."""
class RelationKey(object):
def __init__(user='public', program='adhoc', relation=None):
assert relat... | |
432a798f340dd9e0ecb47bf5661a606d2a078547 | test_echo.py | test_echo.py | from echo_client import client
def test_1():
assert client('This is a unicode test') == 'This is a unicode test'
def test_2():
assert client(u'This is an é unicode test') == u'This is an é unicode test'
| Add tests for echo server; unicode input not passing tests yet | Add tests for echo server; unicode input not passing tests yet
| Python | mit | jwarren116/network-tools,jwarren116/network-tools | Add tests for echo server; unicode input not passing tests yet | from echo_client import client
def test_1():
assert client('This is a unicode test') == 'This is a unicode test'
def test_2():
assert client(u'This is an é unicode test') == u'This is an é unicode test'
| <commit_before><commit_msg>Add tests for echo server; unicode input not passing tests yet<commit_after> | from echo_client import client
def test_1():
assert client('This is a unicode test') == 'This is a unicode test'
def test_2():
assert client(u'This is an é unicode test') == u'This is an é unicode test'
| Add tests for echo server; unicode input not passing tests yetfrom echo_client import client
def test_1():
assert client('This is a unicode test') == 'This is a unicode test'
def test_2():
assert client(u'This is an é unicode test') == u'This is an é unicode test'
| <commit_before><commit_msg>Add tests for echo server; unicode input not passing tests yet<commit_after>from echo_client import client
def test_1():
assert client('This is a unicode test') == 'This is a unicode test'
def test_2():
assert client(u'This is an é unicode test') == u'This is an é unicode test'
| |
da194d8c0b832a372d697ff4d3c87339334037d5 | os_disk_config/tests/test_impl_blivet.py | os_disk_config/tests/test_impl_blivet.py | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | Add initial blivet unit test | Add initial blivet unit test
Just a super simple sanity check of the class constructor. More
tests to follow.
| Python | apache-2.0 | rdo-management/os-disk-config,agroup/os-disk-config | Add initial blivet unit test
Just a super simple sanity check of the class constructor. More
tests to follow. | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | <commit_before><commit_msg>Add initial blivet unit test
Just a super simple sanity check of the class constructor. More
tests to follow.<commit_after> | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | Add initial blivet unit test
Just a super simple sanity check of the class constructor. More
tests to follow.# Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#... | <commit_before><commit_msg>Add initial blivet unit test
Just a super simple sanity check of the class constructor. More
tests to follow.<commit_after># Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | |
1a29e5ab7e58b8eef69358d2fdfb0e9e26367fe2 | app/sense.py | app/sense.py | #!/usr/bin/env python3
from Sensor import SenseController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
DEVICE = "PiSense"
class Handler:
def __init__(self, display, logger, sensor):
self.display = display
self.logger = logger
se... | Create app to record Pi Sense data | Create app to record Pi Sense data
| Python | mit | thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x | Create app to record Pi Sense data | #!/usr/bin/env python3
from Sensor import SenseController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
DEVICE = "PiSense"
class Handler:
def __init__(self, display, logger, sensor):
self.display = display
self.logger = logger
se... | <commit_before><commit_msg>Create app to record Pi Sense data<commit_after> | #!/usr/bin/env python3
from Sensor import SenseController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
DEVICE = "PiSense"
class Handler:
def __init__(self, display, logger, sensor):
self.display = display
self.logger = logger
se... | Create app to record Pi Sense data#!/usr/bin/env python3
from Sensor import SenseController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
DEVICE = "PiSense"
class Handler:
def __init__(self, display, logger, sensor):
self.display = display
... | <commit_before><commit_msg>Create app to record Pi Sense data<commit_after>#!/usr/bin/env python3
from Sensor import SenseController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
DEVICE = "PiSense"
class Handler:
def __init__(self, display, logger, sens... | |
e86ee27ec1142dcd44990c97f3531dd7940313b7 | lamp_state_machine.py | lamp_state_machine.py | import unittest
class LampStateMachine(unittest.TestCase):
OFF = 0
LOW = 33
MEDIUM = 66
HIGH = 100
NO_TOUCH_DETECTED = 0
TOUCH_DETECTED = 1
__lamp_state_machine = \
{
OFF: [OFF, LOW],
LOW: [LOW, MEDIUM],
MEDIUM: [MEDIUM, HIGH],
HIGH: [HIGH, OFF]
}
def get_next_... | Add a new class to handle the valid states for the touch lamp | Add a new class to handle the valid states for the touch lamp
| Python | bsd-2-clause | thelukemccarthy/Wakeup-Lamp,thelukemccarthy/Wakeup-Lamp,thelukemccarthy/Wakeup-Lamp,thelukemccarthy/Wakeup-Lamp | Add a new class to handle the valid states for the touch lamp | import unittest
class LampStateMachine(unittest.TestCase):
OFF = 0
LOW = 33
MEDIUM = 66
HIGH = 100
NO_TOUCH_DETECTED = 0
TOUCH_DETECTED = 1
__lamp_state_machine = \
{
OFF: [OFF, LOW],
LOW: [LOW, MEDIUM],
MEDIUM: [MEDIUM, HIGH],
HIGH: [HIGH, OFF]
}
def get_next_... | <commit_before><commit_msg>Add a new class to handle the valid states for the touch lamp<commit_after> | import unittest
class LampStateMachine(unittest.TestCase):
OFF = 0
LOW = 33
MEDIUM = 66
HIGH = 100
NO_TOUCH_DETECTED = 0
TOUCH_DETECTED = 1
__lamp_state_machine = \
{
OFF: [OFF, LOW],
LOW: [LOW, MEDIUM],
MEDIUM: [MEDIUM, HIGH],
HIGH: [HIGH, OFF]
}
def get_next_... | Add a new class to handle the valid states for the touch lampimport unittest
class LampStateMachine(unittest.TestCase):
OFF = 0
LOW = 33
MEDIUM = 66
HIGH = 100
NO_TOUCH_DETECTED = 0
TOUCH_DETECTED = 1
__lamp_state_machine = \
{
OFF: [OFF, LOW],
LOW: [LOW, MEDIUM],
MEDIUM: [MED... | <commit_before><commit_msg>Add a new class to handle the valid states for the touch lamp<commit_after>import unittest
class LampStateMachine(unittest.TestCase):
OFF = 0
LOW = 33
MEDIUM = 66
HIGH = 100
NO_TOUCH_DETECTED = 0
TOUCH_DETECTED = 1
__lamp_state_machine = \
{
OFF: [OFF, LOW],
... | |
ecfaa761d65009e7a1e59e795f332783b79f2492 | python/balcaza/activity/rstats/format.py | python/balcaza/activity/rstats/format.py | from balcaza.t2types import RExpression, TextFile
def RExpressionToString(rserve):
return rserve.code(
'''sink(text)
print(rexpr)
sink()
''',
inputs = dict(
rexpr = RExpression
),
defaultInput = 'rexpr',
outputs = dict(
text = TextFile
),
defaultOutput = 'text'
)
| Add R print to string library | Add R print to string library
| Python | lgpl-2.1 | jongiddy/balcazapy,jongiddy/balcazapy,jongiddy/balcazapy | Add R print to string library | from balcaza.t2types import RExpression, TextFile
def RExpressionToString(rserve):
return rserve.code(
'''sink(text)
print(rexpr)
sink()
''',
inputs = dict(
rexpr = RExpression
),
defaultInput = 'rexpr',
outputs = dict(
text = TextFile
),
defaultOutput = 'text'
)
| <commit_before><commit_msg>Add R print to string library<commit_after> | from balcaza.t2types import RExpression, TextFile
def RExpressionToString(rserve):
return rserve.code(
'''sink(text)
print(rexpr)
sink()
''',
inputs = dict(
rexpr = RExpression
),
defaultInput = 'rexpr',
outputs = dict(
text = TextFile
),
defaultOutput = 'text'
)
| Add R print to string libraryfrom balcaza.t2types import RExpression, TextFile
def RExpressionToString(rserve):
return rserve.code(
'''sink(text)
print(rexpr)
sink()
''',
inputs = dict(
rexpr = RExpression
),
defaultInput = 'rexpr',
outputs = dict(
text = TextFile
),
defaultOutput = 'text'
)
| <commit_before><commit_msg>Add R print to string library<commit_after>from balcaza.t2types import RExpression, TextFile
def RExpressionToString(rserve):
return rserve.code(
'''sink(text)
print(rexpr)
sink()
''',
inputs = dict(
rexpr = RExpression
),
defaultInput = 'rexpr',
outputs = dict(
text = Text... | |
6b04c7a36f9a430cb2a101b267f64946b3db06b1 | fmn/rules/fedbadges.py | fmn/rules/fedbadges.py | def fedbadges_badge_award(config, message):
""" Fedbadges: A new badge has been awarded to someone
TODO description for the web interface goes here
"""
return message['topic'].endswith('fedbadges.badge.award')
def fedbadges_person_rank_advance(config, message):
""" Fedbadges: The rank of someone ... | Add filters for the badges messages | Add filters for the badges messages | Python | lgpl-2.1 | jeremycline/fmn,jeremycline/fmn,jeremycline/fmn | Add filters for the badges messages | def fedbadges_badge_award(config, message):
""" Fedbadges: A new badge has been awarded to someone
TODO description for the web interface goes here
"""
return message['topic'].endswith('fedbadges.badge.award')
def fedbadges_person_rank_advance(config, message):
""" Fedbadges: The rank of someone ... | <commit_before><commit_msg>Add filters for the badges messages<commit_after> | def fedbadges_badge_award(config, message):
""" Fedbadges: A new badge has been awarded to someone
TODO description for the web interface goes here
"""
return message['topic'].endswith('fedbadges.badge.award')
def fedbadges_person_rank_advance(config, message):
""" Fedbadges: The rank of someone ... | Add filters for the badges messagesdef fedbadges_badge_award(config, message):
""" Fedbadges: A new badge has been awarded to someone
TODO description for the web interface goes here
"""
return message['topic'].endswith('fedbadges.badge.award')
def fedbadges_person_rank_advance(config, message):
... | <commit_before><commit_msg>Add filters for the badges messages<commit_after>def fedbadges_badge_award(config, message):
""" Fedbadges: A new badge has been awarded to someone
TODO description for the web interface goes here
"""
return message['topic'].endswith('fedbadges.badge.award')
def fedbadges_p... | |
40d5f91fc2577da74fcaec5efd4684927d1561bb | src/ggrc/migrations/versions/20160422143804_5599d1769f25_rename_status_field_values.py | src/ggrc/migrations/versions/20160422143804_5599d1769f25_rename_status_field_values.py | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: urban@reciprocitylabs.com
# Maintained By: urban@reciprocitylabs.com
"""
Rename status field values
Create Date: 2016-04-22 14:38:04.330718
"""
# ... | Add migration to rename status enum values | Add migration to rename status enum values
Change status values for requests and assessments
| Python | apache-2.0 | edofic/ggrc-core,prasannav7/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc... | Add migration to rename status enum values
Change status values for requests and assessments | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: urban@reciprocitylabs.com
# Maintained By: urban@reciprocitylabs.com
"""
Rename status field values
Create Date: 2016-04-22 14:38:04.330718
"""
# ... | <commit_before><commit_msg>Add migration to rename status enum values
Change status values for requests and assessments<commit_after> | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: urban@reciprocitylabs.com
# Maintained By: urban@reciprocitylabs.com
"""
Rename status field values
Create Date: 2016-04-22 14:38:04.330718
"""
# ... | Add migration to rename status enum values
Change status values for requests and assessments# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: urban@reciprocitylabs.com
# Maintained By: urban@recipr... | <commit_before><commit_msg>Add migration to rename status enum values
Change status values for requests and assessments<commit_after># Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: urban@reciproc... | |
36a7061a61b5216499d3a284d6d41f1373b7e85e | tests/test_cli.py | tests/test_cli.py | import os
import subprocess
PROJECT_DIR = os.getcwd()
TEST_PROJECT_DIR = os.path.join(PROJECT_DIR, 'test_project')
def test_configuration_argument_in_cli():
"""Verify that's configuration option has been added to managements commands"""
os.chdir(TEST_PROJECT_DIR)
p = subprocess.Popen(['python', 'manage.p... | Add a test for configuration argument | Add a test for configuration argument
This test do not use mock, and only searches the `configuration` option in
the help messages.
| Python | bsd-3-clause | blindroot/django-configurations,cato-/django-configurations,NextHub/django-configurations,jazzband/django-configurations,nangia/django-configurations,pombredanne/django-configurations,jezdez/django-configurations,seenureddy/django-configurations,jazzband/django-configurations,incuna/django-configurations,gatherhealth/d... | Add a test for configuration argument
This test do not use mock, and only searches the `configuration` option in
the help messages. | import os
import subprocess
PROJECT_DIR = os.getcwd()
TEST_PROJECT_DIR = os.path.join(PROJECT_DIR, 'test_project')
def test_configuration_argument_in_cli():
"""Verify that's configuration option has been added to managements commands"""
os.chdir(TEST_PROJECT_DIR)
p = subprocess.Popen(['python', 'manage.p... | <commit_before><commit_msg>Add a test for configuration argument
This test do not use mock, and only searches the `configuration` option in
the help messages.<commit_after> | import os
import subprocess
PROJECT_DIR = os.getcwd()
TEST_PROJECT_DIR = os.path.join(PROJECT_DIR, 'test_project')
def test_configuration_argument_in_cli():
"""Verify that's configuration option has been added to managements commands"""
os.chdir(TEST_PROJECT_DIR)
p = subprocess.Popen(['python', 'manage.p... | Add a test for configuration argument
This test do not use mock, and only searches the `configuration` option in
the help messages.import os
import subprocess
PROJECT_DIR = os.getcwd()
TEST_PROJECT_DIR = os.path.join(PROJECT_DIR, 'test_project')
def test_configuration_argument_in_cli():
"""Verify that's configu... | <commit_before><commit_msg>Add a test for configuration argument
This test do not use mock, and only searches the `configuration` option in
the help messages.<commit_after>import os
import subprocess
PROJECT_DIR = os.getcwd()
TEST_PROJECT_DIR = os.path.join(PROJECT_DIR, 'test_project')
def test_configuration_argume... | |
09f5fb12074e419c82c76d856c208116e0f43a70 | hkm/migrations/0035_auto_20181212_1435.py | hkm/migrations/0035_auto_20181212_1435.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-12 12:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hkm', '0034_postal_code_to_charfield'),
]
operations = [
migrations.AlterFi... | Add uncommitted migration from past changes | Add uncommitted migration from past changes
Refs -
| Python | mit | andersinno/kuvaselaamo,andersinno/kuvaselaamo,andersinno/kuvaselaamo | Add uncommitted migration from past changes
Refs - | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-12 12:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hkm', '0034_postal_code_to_charfield'),
]
operations = [
migrations.AlterFi... | <commit_before><commit_msg>Add uncommitted migration from past changes
Refs -<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-12 12:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hkm', '0034_postal_code_to_charfield'),
]
operations = [
migrations.AlterFi... | Add uncommitted migration from past changes
Refs -# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-12 12:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hkm', '0034_postal_code_to_charfield'),
... | <commit_before><commit_msg>Add uncommitted migration from past changes
Refs -<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-12 12:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('... | |
8bf9bb5929bd73699b7daacedbed6b2e54fa36e7 | avena/tests/test-filter.py | avena/tests/test-filter.py | #!/usr/bin/env python
from numpy import all, allclose, array, float32
from .. import filter
x = array([
[0, 1, 0],
[1, 1, 1],
[0, 1, 0],
], dtype=float32)
def test_low_pass_filter():
y = filter._low_pass_filter(x.shape, 1)
assert all(x == y)
z = filter._high_pass_filter(x.shape, 1)
ass... | Add unit tests for the filter module. | Add unit tests for the filter module.
| Python | isc | eliteraspberries/avena | Add unit tests for the filter module. | #!/usr/bin/env python
from numpy import all, allclose, array, float32
from .. import filter
x = array([
[0, 1, 0],
[1, 1, 1],
[0, 1, 0],
], dtype=float32)
def test_low_pass_filter():
y = filter._low_pass_filter(x.shape, 1)
assert all(x == y)
z = filter._high_pass_filter(x.shape, 1)
ass... | <commit_before><commit_msg>Add unit tests for the filter module.<commit_after> | #!/usr/bin/env python
from numpy import all, allclose, array, float32
from .. import filter
x = array([
[0, 1, 0],
[1, 1, 1],
[0, 1, 0],
], dtype=float32)
def test_low_pass_filter():
y = filter._low_pass_filter(x.shape, 1)
assert all(x == y)
z = filter._high_pass_filter(x.shape, 1)
ass... | Add unit tests for the filter module.#!/usr/bin/env python
from numpy import all, allclose, array, float32
from .. import filter
x = array([
[0, 1, 0],
[1, 1, 1],
[0, 1, 0],
], dtype=float32)
def test_low_pass_filter():
y = filter._low_pass_filter(x.shape, 1)
assert all(x == y)
z = filter.... | <commit_before><commit_msg>Add unit tests for the filter module.<commit_after>#!/usr/bin/env python
from numpy import all, allclose, array, float32
from .. import filter
x = array([
[0, 1, 0],
[1, 1, 1],
[0, 1, 0],
], dtype=float32)
def test_low_pass_filter():
y = filter._low_pass_filter(x.shape, ... | |
fbc71aa9efc1aba4f8bd9294af24d17574b614da | problem_39.py | problem_39.py | from time import time
from math import pow, sqrt
LIMIT = 1000
PERIMETERS = [[0 for i in range(j)] for j in range(LIMIT/2)]
def most_common(lst):
return max(set(lst), key=lst.count)
def main():
for a in range(1, LIMIT/2):
for b in range(a+1, LIMIT/2):
c = sqrt(pow(a, 2) + pow(b, 2)) # ... | Add problem 39, right triangle perimeter options | Add problem 39, right triangle perimeter options
| Python | mit | dimkarakostas/project-euler | Add problem 39, right triangle perimeter options | from time import time
from math import pow, sqrt
LIMIT = 1000
PERIMETERS = [[0 for i in range(j)] for j in range(LIMIT/2)]
def most_common(lst):
return max(set(lst), key=lst.count)
def main():
for a in range(1, LIMIT/2):
for b in range(a+1, LIMIT/2):
c = sqrt(pow(a, 2) + pow(b, 2)) # ... | <commit_before><commit_msg>Add problem 39, right triangle perimeter options<commit_after> | from time import time
from math import pow, sqrt
LIMIT = 1000
PERIMETERS = [[0 for i in range(j)] for j in range(LIMIT/2)]
def most_common(lst):
return max(set(lst), key=lst.count)
def main():
for a in range(1, LIMIT/2):
for b in range(a+1, LIMIT/2):
c = sqrt(pow(a, 2) + pow(b, 2)) # ... | Add problem 39, right triangle perimeter optionsfrom time import time
from math import pow, sqrt
LIMIT = 1000
PERIMETERS = [[0 for i in range(j)] for j in range(LIMIT/2)]
def most_common(lst):
return max(set(lst), key=lst.count)
def main():
for a in range(1, LIMIT/2):
for b in range(a+1, LIMIT/2):... | <commit_before><commit_msg>Add problem 39, right triangle perimeter options<commit_after>from time import time
from math import pow, sqrt
LIMIT = 1000
PERIMETERS = [[0 for i in range(j)] for j in range(LIMIT/2)]
def most_common(lst):
return max(set(lst), key=lst.count)
def main():
for a in range(1, LIMIT/... | |
0219b1ad7e093ffc2e7c0f455e59be0294fc6175 | tests/test_rapids.py | tests/test_rapids.py | import unittest
import cudf
from cuml.cluster import DBSCAN
from common import gpu_test
class TestRapids(unittest.TestCase):
def test_dbscan(self):
# Create and populate a GPU DataFrame
gdf_float = cudf.DataFrame()
gdf_float['0'] = [1.0, 2.0, 5.0]
gdf_float['1'] = [4.0, 2.0, 1.0]... | Add tests for cuml & cudf to prevent regresssion. | Add tests for cuml & cudf to prevent regresssion.
http://b/144522678
| Python | apache-2.0 | Kaggle/docker-python,Kaggle/docker-python | Add tests for cuml & cudf to prevent regresssion.
http://b/144522678 | import unittest
import cudf
from cuml.cluster import DBSCAN
from common import gpu_test
class TestRapids(unittest.TestCase):
def test_dbscan(self):
# Create and populate a GPU DataFrame
gdf_float = cudf.DataFrame()
gdf_float['0'] = [1.0, 2.0, 5.0]
gdf_float['1'] = [4.0, 2.0, 1.0]... | <commit_before><commit_msg>Add tests for cuml & cudf to prevent regresssion.
http://b/144522678<commit_after> | import unittest
import cudf
from cuml.cluster import DBSCAN
from common import gpu_test
class TestRapids(unittest.TestCase):
def test_dbscan(self):
# Create and populate a GPU DataFrame
gdf_float = cudf.DataFrame()
gdf_float['0'] = [1.0, 2.0, 5.0]
gdf_float['1'] = [4.0, 2.0, 1.0]... | Add tests for cuml & cudf to prevent regresssion.
http://b/144522678import unittest
import cudf
from cuml.cluster import DBSCAN
from common import gpu_test
class TestRapids(unittest.TestCase):
def test_dbscan(self):
# Create and populate a GPU DataFrame
gdf_float = cudf.DataFrame()
gdf_... | <commit_before><commit_msg>Add tests for cuml & cudf to prevent regresssion.
http://b/144522678<commit_after>import unittest
import cudf
from cuml.cluster import DBSCAN
from common import gpu_test
class TestRapids(unittest.TestCase):
def test_dbscan(self):
# Create and populate a GPU DataFrame
... | |
66f05b105e9330dc213bc76c25f8c3b569dad3be | problem_2/solution.py | problem_2/solution.py | f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
| Add Python implementation for problem 2 | Add Python implementation for problem 2
| Python | mit | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | Add Python implementation for problem 2 | f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
| <commit_before><commit_msg>Add Python implementation for problem 2<commit_after> | f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
| Add Python implementation for problem 2f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
| <commit_before><commit_msg>Add Python implementation for problem 2<commit_after>f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
| |
f5544c1902d38b674d319f19b3d2c3f02ca54342 | hanzidefs.py | hanzidefs.py | import collections
import sys
from CEDICT_Parser import parser, pinyin
usage = "Usage: python hanzidefs.py cedict_ts.u8 inputtext.txt > outputdefs.tsv"
def get_all_hanzi(txt):
# count all the characters in CJK range
counts = collections.Counter([c for c in txt if '\u4e00' <= c <= '\u9fff'])
sys.... | Write script to print defs | Write script to print defs
| Python | agpl-3.0 | erjiang/hanzidefs | Write script to print defs | import collections
import sys
from CEDICT_Parser import parser, pinyin
usage = "Usage: python hanzidefs.py cedict_ts.u8 inputtext.txt > outputdefs.tsv"
def get_all_hanzi(txt):
# count all the characters in CJK range
counts = collections.Counter([c for c in txt if '\u4e00' <= c <= '\u9fff'])
sys.... | <commit_before><commit_msg>Write script to print defs<commit_after> | import collections
import sys
from CEDICT_Parser import parser, pinyin
usage = "Usage: python hanzidefs.py cedict_ts.u8 inputtext.txt > outputdefs.tsv"
def get_all_hanzi(txt):
# count all the characters in CJK range
counts = collections.Counter([c for c in txt if '\u4e00' <= c <= '\u9fff'])
sys.... | Write script to print defsimport collections
import sys
from CEDICT_Parser import parser, pinyin
usage = "Usage: python hanzidefs.py cedict_ts.u8 inputtext.txt > outputdefs.tsv"
def get_all_hanzi(txt):
# count all the characters in CJK range
counts = collections.Counter([c for c in txt if '\u4e00' <=... | <commit_before><commit_msg>Write script to print defs<commit_after>import collections
import sys
from CEDICT_Parser import parser, pinyin
usage = "Usage: python hanzidefs.py cedict_ts.u8 inputtext.txt > outputdefs.tsv"
def get_all_hanzi(txt):
# count all the characters in CJK range
counts = collectio... | |
eec83626f31015bf4729de77dd637d08e7cc34ff | comics/comics/lunchdn.py | comics/comics/lunchdn.py | # encoding: utf-8
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Lunch (dn.no)"
language = "no"
url = "https://www.dn.no/topic/Lunch/"
active = True
rights = "Børge Lund"
class Crawler(Craw... | Add crawler for "Lunch" from dn.no | Add crawler for "Lunch" from dn.no
| Python | agpl-3.0 | jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics | Add crawler for "Lunch" from dn.no | # encoding: utf-8
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Lunch (dn.no)"
language = "no"
url = "https://www.dn.no/topic/Lunch/"
active = True
rights = "Børge Lund"
class Crawler(Craw... | <commit_before><commit_msg>Add crawler for "Lunch" from dn.no<commit_after> | # encoding: utf-8
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Lunch (dn.no)"
language = "no"
url = "https://www.dn.no/topic/Lunch/"
active = True
rights = "Børge Lund"
class Crawler(Craw... | Add crawler for "Lunch" from dn.no# encoding: utf-8
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Lunch (dn.no)"
language = "no"
url = "https://www.dn.no/topic/Lunch/"
active = True
rights =... | <commit_before><commit_msg>Add crawler for "Lunch" from dn.no<commit_after># encoding: utf-8
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Lunch (dn.no)"
language = "no"
url = "https://www.dn.no/top... | |
675698600b600a27d02b29b91a0fc4a30e03de1a | python/sieve_atkin.py | python/sieve_atkin.py | import sys
import math
args = sys.argv
N = len(args) > 1 and int(sys.argv[1]) or 1000
nsqrt = int((math.pow(N, 0.5)))
is_prime = [False] * N
for x in xrange(1, nsqrt):
for y in xrange(1, nsqrt):
n = 4 * (x * x) + (y * y)
if n <= N and n % 12 in [1,5]:
is_prime[n] = True
n = 3... | Add sieve of atkin in python | Add sieve of atkin in python
| Python | mit | Zorbash/linguaphone,Zorbash/linguaphone,Zorbash/linguaphone | Add sieve of atkin in python | import sys
import math
args = sys.argv
N = len(args) > 1 and int(sys.argv[1]) or 1000
nsqrt = int((math.pow(N, 0.5)))
is_prime = [False] * N
for x in xrange(1, nsqrt):
for y in xrange(1, nsqrt):
n = 4 * (x * x) + (y * y)
if n <= N and n % 12 in [1,5]:
is_prime[n] = True
n = 3... | <commit_before><commit_msg>Add sieve of atkin in python<commit_after> | import sys
import math
args = sys.argv
N = len(args) > 1 and int(sys.argv[1]) or 1000
nsqrt = int((math.pow(N, 0.5)))
is_prime = [False] * N
for x in xrange(1, nsqrt):
for y in xrange(1, nsqrt):
n = 4 * (x * x) + (y * y)
if n <= N and n % 12 in [1,5]:
is_prime[n] = True
n = 3... | Add sieve of atkin in pythonimport sys
import math
args = sys.argv
N = len(args) > 1 and int(sys.argv[1]) or 1000
nsqrt = int((math.pow(N, 0.5)))
is_prime = [False] * N
for x in xrange(1, nsqrt):
for y in xrange(1, nsqrt):
n = 4 * (x * x) + (y * y)
if n <= N and n % 12 in [1,5]:
is_pr... | <commit_before><commit_msg>Add sieve of atkin in python<commit_after>import sys
import math
args = sys.argv
N = len(args) > 1 and int(sys.argv[1]) or 1000
nsqrt = int((math.pow(N, 0.5)))
is_prime = [False] * N
for x in xrange(1, nsqrt):
for y in xrange(1, nsqrt):
n = 4 * (x * x) + (y * y)
if n <=... | |
14aa8b554165efff430d4b1d5c04aa9ec14edb6c | tests/api/views/about_test.py | tests/api/views/about_test.py | def test_imprint(app, client):
app.config['SKYLINES_IMPRINT'] = u'foobar'
res = client.get('/imprint')
assert res.status_code == 200
assert res.json == {
u'content': u'foobar',
}
def test_team(client):
res = client.get('/team')
assert res.status_code == 200
content = res.json... | Add tests for "about" views | tests/api: Add tests for "about" views
| Python | agpl-3.0 | skylines-project/skylines,Harry-R/skylines,Turbo87/skylines,Harry-R/skylines,skylines-project/skylines,Turbo87/skylines,shadowoneau/skylines,shadowoneau/skylines,Harry-R/skylines,shadowoneau/skylines,skylines-project/skylines,RBE-Avionik/skylines,Turbo87/skylines,RBE-Avionik/skylines,shadowoneau/skylines,RBE-Avionik/sk... | tests/api: Add tests for "about" views | def test_imprint(app, client):
app.config['SKYLINES_IMPRINT'] = u'foobar'
res = client.get('/imprint')
assert res.status_code == 200
assert res.json == {
u'content': u'foobar',
}
def test_team(client):
res = client.get('/team')
assert res.status_code == 200
content = res.json... | <commit_before><commit_msg>tests/api: Add tests for "about" views<commit_after> | def test_imprint(app, client):
app.config['SKYLINES_IMPRINT'] = u'foobar'
res = client.get('/imprint')
assert res.status_code == 200
assert res.json == {
u'content': u'foobar',
}
def test_team(client):
res = client.get('/team')
assert res.status_code == 200
content = res.json... | tests/api: Add tests for "about" viewsdef test_imprint(app, client):
app.config['SKYLINES_IMPRINT'] = u'foobar'
res = client.get('/imprint')
assert res.status_code == 200
assert res.json == {
u'content': u'foobar',
}
def test_team(client):
res = client.get('/team')
assert res.stat... | <commit_before><commit_msg>tests/api: Add tests for "about" views<commit_after>def test_imprint(app, client):
app.config['SKYLINES_IMPRINT'] = u'foobar'
res = client.get('/imprint')
assert res.status_code == 200
assert res.json == {
u'content': u'foobar',
}
def test_team(client):
res ... | |
864cf50cc543f53b21fced877baa3bdf4f582997 | lazyblacksmith/utils/time.py | lazyblacksmith/utils/time.py | # -*- encoding: utf-8 -*-
import pytz
from datetime import datetime
def utcnow():
utc_now = datetime.utcnow()
utc_now = utc_now.replace(tzinfo=pytz.utc)
return utc_now | Add util function for utcnow with pytz | Add util function for utcnow with pytz
| Python | bsd-3-clause | Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith | Add util function for utcnow with pytz | # -*- encoding: utf-8 -*-
import pytz
from datetime import datetime
def utcnow():
utc_now = datetime.utcnow()
utc_now = utc_now.replace(tzinfo=pytz.utc)
return utc_now | <commit_before><commit_msg>Add util function for utcnow with pytz<commit_after> | # -*- encoding: utf-8 -*-
import pytz
from datetime import datetime
def utcnow():
utc_now = datetime.utcnow()
utc_now = utc_now.replace(tzinfo=pytz.utc)
return utc_now | Add util function for utcnow with pytz# -*- encoding: utf-8 -*-
import pytz
from datetime import datetime
def utcnow():
utc_now = datetime.utcnow()
utc_now = utc_now.replace(tzinfo=pytz.utc)
return utc_now | <commit_before><commit_msg>Add util function for utcnow with pytz<commit_after># -*- encoding: utf-8 -*-
import pytz
from datetime import datetime
def utcnow():
utc_now = datetime.utcnow()
utc_now = utc_now.replace(tzinfo=pytz.utc)
return utc_now | |
46b63025f982062af178dcbaa1f5a6843895371f | bandoleers/args.py | bandoleers/args.py | import argparse
import logging
import sys
import bandoleers
class ArgumentParser(argparse.ArgumentParser):
"""
Implements some common command-line behaviors.
This is a slightly extended version of the standard
:class:`argparse.ArgumentParser` class that does three
things for you:
* exits wi... | Add extended version of argparse.ArgumentParser. | Add extended version of argparse.ArgumentParser.
| Python | bsd-3-clause | aweber/bandoleers | Add extended version of argparse.ArgumentParser. | import argparse
import logging
import sys
import bandoleers
class ArgumentParser(argparse.ArgumentParser):
"""
Implements some common command-line behaviors.
This is a slightly extended version of the standard
:class:`argparse.ArgumentParser` class that does three
things for you:
* exits wi... | <commit_before><commit_msg>Add extended version of argparse.ArgumentParser.<commit_after> | import argparse
import logging
import sys
import bandoleers
class ArgumentParser(argparse.ArgumentParser):
"""
Implements some common command-line behaviors.
This is a slightly extended version of the standard
:class:`argparse.ArgumentParser` class that does three
things for you:
* exits wi... | Add extended version of argparse.ArgumentParser.import argparse
import logging
import sys
import bandoleers
class ArgumentParser(argparse.ArgumentParser):
"""
Implements some common command-line behaviors.
This is a slightly extended version of the standard
:class:`argparse.ArgumentParser` class tha... | <commit_before><commit_msg>Add extended version of argparse.ArgumentParser.<commit_after>import argparse
import logging
import sys
import bandoleers
class ArgumentParser(argparse.ArgumentParser):
"""
Implements some common command-line behaviors.
This is a slightly extended version of the standard
:... | |
0607730872442207574d166649b0dd6e0ce78509 | analytics/nltk_collocations.py | analytics/nltk_collocations.py | #!/usr/bin/env python3
"""
This receives text from stdin and does a collocation analysis
"""
import sys
import nltk
from nltk.collocations import *
def read_lines_stdin():
lines = []
for line in sys.stdin:
lines.append(line)
return lines
if __name__ == '__main__':
tweets = read_lines_stdin()... | Add bigram and trigram analyzer | [F] Add bigram and trigram analyzer
| Python | mit | suchkultur/trumpeltier | [F] Add bigram and trigram analyzer | #!/usr/bin/env python3
"""
This receives text from stdin and does a collocation analysis
"""
import sys
import nltk
from nltk.collocations import *
def read_lines_stdin():
lines = []
for line in sys.stdin:
lines.append(line)
return lines
if __name__ == '__main__':
tweets = read_lines_stdin()... | <commit_before><commit_msg>[F] Add bigram and trigram analyzer<commit_after> | #!/usr/bin/env python3
"""
This receives text from stdin and does a collocation analysis
"""
import sys
import nltk
from nltk.collocations import *
def read_lines_stdin():
lines = []
for line in sys.stdin:
lines.append(line)
return lines
if __name__ == '__main__':
tweets = read_lines_stdin()... | [F] Add bigram and trigram analyzer#!/usr/bin/env python3
"""
This receives text from stdin and does a collocation analysis
"""
import sys
import nltk
from nltk.collocations import *
def read_lines_stdin():
lines = []
for line in sys.stdin:
lines.append(line)
return lines
if __name__ == '__main_... | <commit_before><commit_msg>[F] Add bigram and trigram analyzer<commit_after>#!/usr/bin/env python3
"""
This receives text from stdin and does a collocation analysis
"""
import sys
import nltk
from nltk.collocations import *
def read_lines_stdin():
lines = []
for line in sys.stdin:
lines.append(line)
... | |
330a938ea62e680b4aff2378e1e29b564f9049a1 | python/vyos/authutils.py | python/vyos/authutils.py | # authutils -- miscelanneous functions for handling passwords and publis keys
#
# Copyright (C) 2018 VyOS maintainers and contributors
#
# This library is free software; you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License as published by the Free Software Foundation;
# ei... | Add a library for misc functions for handling passwords, SSH keys etc. | Add a library for misc functions for handling passwords, SSH keys etc.
| Python | lgpl-2.1 | vyos/vyos-1x,vyos/vyos-1x,vyos/vyos-1x,vyos/vyos-1x | Add a library for misc functions for handling passwords, SSH keys etc. | # authutils -- miscelanneous functions for handling passwords and publis keys
#
# Copyright (C) 2018 VyOS maintainers and contributors
#
# This library is free software; you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License as published by the Free Software Foundation;
# ei... | <commit_before><commit_msg>Add a library for misc functions for handling passwords, SSH keys etc.<commit_after> | # authutils -- miscelanneous functions for handling passwords and publis keys
#
# Copyright (C) 2018 VyOS maintainers and contributors
#
# This library is free software; you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License as published by the Free Software Foundation;
# ei... | Add a library for misc functions for handling passwords, SSH keys etc.# authutils -- miscelanneous functions for handling passwords and publis keys
#
# Copyright (C) 2018 VyOS maintainers and contributors
#
# This library is free software; you can redistribute it and/or modify it under the terms of
# the GNU Lesser Gen... | <commit_before><commit_msg>Add a library for misc functions for handling passwords, SSH keys etc.<commit_after># authutils -- miscelanneous functions for handling passwords and publis keys
#
# Copyright (C) 2018 VyOS maintainers and contributors
#
# This library is free software; you can redistribute it and/or modify i... | |
7069a8826f06338e0d95981316972147314c6e81 | dn1/vozilo_test.py | dn1/vozilo_test.py | __author__ = 'nino'
import unittest
from jadrolinija import Vozilo
class VoziloTest(unittest.TestCase):
def test_something(self):
v = Vozilo('NM DK-34J', 425)
self.assertEqual(v.tablica, 'NM DK-34J')
self.assertEqual(v.dolzina, 425)
if __name__ == '__main__':
unittest.main()
| Add unittests for Task 4 | Add unittests for Task 4
| Python | mit | nbasic/racunalnistvo-1 | Add unittests for Task 4 | __author__ = 'nino'
import unittest
from jadrolinija import Vozilo
class VoziloTest(unittest.TestCase):
def test_something(self):
v = Vozilo('NM DK-34J', 425)
self.assertEqual(v.tablica, 'NM DK-34J')
self.assertEqual(v.dolzina, 425)
if __name__ == '__main__':
unittest.main()
| <commit_before><commit_msg>Add unittests for Task 4<commit_after> | __author__ = 'nino'
import unittest
from jadrolinija import Vozilo
class VoziloTest(unittest.TestCase):
def test_something(self):
v = Vozilo('NM DK-34J', 425)
self.assertEqual(v.tablica, 'NM DK-34J')
self.assertEqual(v.dolzina, 425)
if __name__ == '__main__':
unittest.main()
| Add unittests for Task 4__author__ = 'nino'
import unittest
from jadrolinija import Vozilo
class VoziloTest(unittest.TestCase):
def test_something(self):
v = Vozilo('NM DK-34J', 425)
self.assertEqual(v.tablica, 'NM DK-34J')
self.assertEqual(v.dolzina, 425)
if __name__ == '__main__':
... | <commit_before><commit_msg>Add unittests for Task 4<commit_after>__author__ = 'nino'
import unittest
from jadrolinija import Vozilo
class VoziloTest(unittest.TestCase):
def test_something(self):
v = Vozilo('NM DK-34J', 425)
self.assertEqual(v.tablica, 'NM DK-34J')
self.assertEqual(v.dolz... | |
48e94dff15394fe04ed61102dd51a7543912706a | host-test/pipe-test.py | host-test/pipe-test.py | import json
import subprocess
import struct
import sys
import unittest
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
def get_exe():
if sys.platform == 'darwin':
return "host-osx/build/Release/chrome-token-signing.app/Con... | Add generic "pipe" test for native component | Add generic "pipe" test for native component
| Python | lgpl-2.1 | metsma/chrome-token-signing,cristiano-andrade/chrome-token-signing,fabiorusso/chrome-token-signing,metsma/chrome-token-signing,open-eid/chrome-token-signing,metsma/chrome-token-signing,cristiano-andrade/chrome-token-signing,cristiano-andrade/chrome-token-signing,open-eid/chrome-token-signing,fabiorusso/chrome-token-sig... | Add generic "pipe" test for native component | import json
import subprocess
import struct
import sys
import unittest
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
def get_exe():
if sys.platform == 'darwin':
return "host-osx/build/Release/chrome-token-signing.app/Con... | <commit_before><commit_msg>Add generic "pipe" test for native component<commit_after> | import json
import subprocess
import struct
import sys
import unittest
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
def get_exe():
if sys.platform == 'darwin':
return "host-osx/build/Release/chrome-token-signing.app/Con... | Add generic "pipe" test for native componentimport json
import subprocess
import struct
import sys
import unittest
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
def get_exe():
if sys.platform == 'darwin':
return "host-os... | <commit_before><commit_msg>Add generic "pipe" test for native component<commit_after>import json
import subprocess
import struct
import sys
import unittest
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
def get_exe():
if sys.plat... | |
4fe4408736268e3a2c8437cca70625b4fc1a4a3c | i3pystatus/pianobar.py | i3pystatus/pianobar.py | from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/pauses
- Right ... | from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/pauses
- Right ... | Fix blank lines and whitespaces | Fix blank lines and whitespaces
| Python | mit | m45t3r/i3pystatus,facetoe/i3pystatus,ismaelpuerto/i3pystatus,ismaelpuerto/i3pystatus,plumps/i3pystatus,schroeji/i3pystatus,teto/i3pystatus,plumps/i3pystatus,teto/i3pystatus,facetoe/i3pystatus,ncoop/i3pystatus,Elder-of-Ozone/i3pystatus,enkore/i3pystatus,juliushaertl/i3pystatus,enkore/i3pystatus,yang-ling/i3pystatus,Maic... | from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/pauses
- Right ... | from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/pauses
- Right ... | <commit_before>from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/paus... | from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/pauses
- Right ... | from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/pauses
- Right ... | <commit_before>from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
Mouse events:
- Left click play/paus... |
271f5921b8a15abe3f29296ec0b474167cd415cf | concord_ml/data/computations.py | concord_ml/data/computations.py | import time
from concord.computation import Computation, Metadata
def current_time_millis():
return round(time.time() * 1000)
class Generator(Computation):
def __init__(self, iterable, name, ostreams, time_delta=500):
self.ostreams = ostreams
self.name = name
self.time_delta = time_... | Add basic framework for generators | Add basic framework for generators
| Python | apache-2.0 | concord/bfd,alanhdu/bfd,concord/ml,AndrewAday/bfd | Add basic framework for generators | import time
from concord.computation import Computation, Metadata
def current_time_millis():
return round(time.time() * 1000)
class Generator(Computation):
def __init__(self, iterable, name, ostreams, time_delta=500):
self.ostreams = ostreams
self.name = name
self.time_delta = time_... | <commit_before><commit_msg>Add basic framework for generators<commit_after> | import time
from concord.computation import Computation, Metadata
def current_time_millis():
return round(time.time() * 1000)
class Generator(Computation):
def __init__(self, iterable, name, ostreams, time_delta=500):
self.ostreams = ostreams
self.name = name
self.time_delta = time_... | Add basic framework for generatorsimport time
from concord.computation import Computation, Metadata
def current_time_millis():
return round(time.time() * 1000)
class Generator(Computation):
def __init__(self, iterable, name, ostreams, time_delta=500):
self.ostreams = ostreams
self.name = na... | <commit_before><commit_msg>Add basic framework for generators<commit_after>import time
from concord.computation import Computation, Metadata
def current_time_millis():
return round(time.time() * 1000)
class Generator(Computation):
def __init__(self, iterable, name, ostreams, time_delta=500):
self.o... | |
be1f66af24e3a286cd82f092c3ee7e5b6ad9df69 | tests/test_helpers.py | tests/test_helpers.py | import tempfile
import unittest
import ephem
from pygcvs.helpers import dict_to_body, read_gcvs
GCVS_CONTENTS = """
NNo GCVS 2000.0 Type Max Min I Min II Epoch Year Period M-m Spectrum References Other design
------------------ ------... | Add basic tests for helper functions. | Add basic tests for helper functions.
| Python | mit | zsiciarz/pygcvs | Add basic tests for helper functions. | import tempfile
import unittest
import ephem
from pygcvs.helpers import dict_to_body, read_gcvs
GCVS_CONTENTS = """
NNo GCVS 2000.0 Type Max Min I Min II Epoch Year Period M-m Spectrum References Other design
------------------ ------... | <commit_before><commit_msg>Add basic tests for helper functions.<commit_after> | import tempfile
import unittest
import ephem
from pygcvs.helpers import dict_to_body, read_gcvs
GCVS_CONTENTS = """
NNo GCVS 2000.0 Type Max Min I Min II Epoch Year Period M-m Spectrum References Other design
------------------ ------... | Add basic tests for helper functions.import tempfile
import unittest
import ephem
from pygcvs.helpers import dict_to_body, read_gcvs
GCVS_CONTENTS = """
NNo GCVS 2000.0 Type Max Min I Min II Epoch Year Period M-m Spectrum References O... | <commit_before><commit_msg>Add basic tests for helper functions.<commit_after>import tempfile
import unittest
import ephem
from pygcvs.helpers import dict_to_body, read_gcvs
GCVS_CONTENTS = """
NNo GCVS 2000.0 Type Max Min I Min II Epoch Year Period ... | |
c60ec4b373a812e8207a2f1c22c11ff2a24ee268 | tests/test_scanner.py | tests/test_scanner.py | import pytest
from katana.expr import Expr, Token
from katana.parser import Scanner
class TestScanner:
scanner = Scanner([
Expr('dollar', r'\$'),
Expr('number', r'[0-9]+'),
])
def test_scan_complete(self):
assert self.scanner.scan('$12') == [
Token('dollar', '$'),
... | Add tests for Scanner class | Add tests for Scanner class
| Python | mit | eugene-eeo/katana | Add tests for Scanner class | import pytest
from katana.expr import Expr, Token
from katana.parser import Scanner
class TestScanner:
scanner = Scanner([
Expr('dollar', r'\$'),
Expr('number', r'[0-9]+'),
])
def test_scan_complete(self):
assert self.scanner.scan('$12') == [
Token('dollar', '$'),
... | <commit_before><commit_msg>Add tests for Scanner class<commit_after> | import pytest
from katana.expr import Expr, Token
from katana.parser import Scanner
class TestScanner:
scanner = Scanner([
Expr('dollar', r'\$'),
Expr('number', r'[0-9]+'),
])
def test_scan_complete(self):
assert self.scanner.scan('$12') == [
Token('dollar', '$'),
... | Add tests for Scanner classimport pytest
from katana.expr import Expr, Token
from katana.parser import Scanner
class TestScanner:
scanner = Scanner([
Expr('dollar', r'\$'),
Expr('number', r'[0-9]+'),
])
def test_scan_complete(self):
assert self.scanner.scan('$12') == [
... | <commit_before><commit_msg>Add tests for Scanner class<commit_after>import pytest
from katana.expr import Expr, Token
from katana.parser import Scanner
class TestScanner:
scanner = Scanner([
Expr('dollar', r'\$'),
Expr('number', r'[0-9]+'),
])
def test_scan_complete(self):
assert ... | |
0ce008663983a312a6f5d7211aa3767fd6c5f747 | migrations/versions/0072_add_dvla_orgs.py | migrations/versions/0072_add_dvla_orgs.py | """empty message
Revision ID: 0072_add_dvla_orgs
Revises: 0071_add_job_error_state
Create Date: 2017-04-19 15:25:45.155886
"""
# revision identifiers, used by Alembic.
revision = '0072_add_dvla_orgs'
down_revision = '0071_add_job_error_state'
from alembic import op
import sqlalchemy as sa
def upgrade():
### c... | Add DVLA org migration with default values | Add DVLA org migration with default values
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add DVLA org migration with default values | """empty message
Revision ID: 0072_add_dvla_orgs
Revises: 0071_add_job_error_state
Create Date: 2017-04-19 15:25:45.155886
"""
# revision identifiers, used by Alembic.
revision = '0072_add_dvla_orgs'
down_revision = '0071_add_job_error_state'
from alembic import op
import sqlalchemy as sa
def upgrade():
### c... | <commit_before><commit_msg>Add DVLA org migration with default values<commit_after> | """empty message
Revision ID: 0072_add_dvla_orgs
Revises: 0071_add_job_error_state
Create Date: 2017-04-19 15:25:45.155886
"""
# revision identifiers, used by Alembic.
revision = '0072_add_dvla_orgs'
down_revision = '0071_add_job_error_state'
from alembic import op
import sqlalchemy as sa
def upgrade():
### c... | Add DVLA org migration with default values"""empty message
Revision ID: 0072_add_dvla_orgs
Revises: 0071_add_job_error_state
Create Date: 2017-04-19 15:25:45.155886
"""
# revision identifiers, used by Alembic.
revision = '0072_add_dvla_orgs'
down_revision = '0071_add_job_error_state'
from alembic import op
import s... | <commit_before><commit_msg>Add DVLA org migration with default values<commit_after>"""empty message
Revision ID: 0072_add_dvla_orgs
Revises: 0071_add_job_error_state
Create Date: 2017-04-19 15:25:45.155886
"""
# revision identifiers, used by Alembic.
revision = '0072_add_dvla_orgs'
down_revision = '0071_add_job_erro... | |
e55dd3d22f8ef23087bd21504d402c7c6f7aa4ba | test/mask_test.py | test/mask_test.py | #################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.... | Add something of a pygame.mask test suite | Add something of a pygame.mask test suite
| Python | lgpl-2.1 | CTPUG/pygame_cffi,CTPUG/pygame_cffi,caseyc37/pygame_cffi,CTPUG/pygame_cffi,caseyc37/pygame_cffi,caseyc37/pygame_cffi | Add something of a pygame.mask test suite | #################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.... | <commit_before><commit_msg>Add something of a pygame.mask test suite<commit_after> | #################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.... | Add something of a pygame.mask test suite#################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == ... | <commit_before><commit_msg>Add something of a pygame.mask test suite<commit_after>#################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(p... | |
8882c77e6b96df7548357bce0a1c995fa2600e39 | test/test_iebi.py | test/test_iebi.py | # -*- coding: utf-8 -*-
import numpy as np
import ibei
from astropy import units
import unittest
temp_sun = 5762.
temp_earth = 288.
bandgap = 1.15
class Issues(unittest.TestCase):
"""
Tests output types of the calculator methods.
"""
def test_issue_1_devos_efficiency(self):
"""
Unit sy... | Add tests for issues causing exceptions | Add tests for issues causing exceptions
| Python | mit | jrsmith3/tec,jrsmith3/tec,jrsmith3/ibei | Add tests for issues causing exceptions | # -*- coding: utf-8 -*-
import numpy as np
import ibei
from astropy import units
import unittest
temp_sun = 5762.
temp_earth = 288.
bandgap = 1.15
class Issues(unittest.TestCase):
"""
Tests output types of the calculator methods.
"""
def test_issue_1_devos_efficiency(self):
"""
Unit sy... | <commit_before><commit_msg>Add tests for issues causing exceptions<commit_after> | # -*- coding: utf-8 -*-
import numpy as np
import ibei
from astropy import units
import unittest
temp_sun = 5762.
temp_earth = 288.
bandgap = 1.15
class Issues(unittest.TestCase):
"""
Tests output types of the calculator methods.
"""
def test_issue_1_devos_efficiency(self):
"""
Unit sy... | Add tests for issues causing exceptions# -*- coding: utf-8 -*-
import numpy as np
import ibei
from astropy import units
import unittest
temp_sun = 5762.
temp_earth = 288.
bandgap = 1.15
class Issues(unittest.TestCase):
"""
Tests output types of the calculator methods.
"""
def test_issue_1_devos_effici... | <commit_before><commit_msg>Add tests for issues causing exceptions<commit_after># -*- coding: utf-8 -*-
import numpy as np
import ibei
from astropy import units
import unittest
temp_sun = 5762.
temp_earth = 288.
bandgap = 1.15
class Issues(unittest.TestCase):
"""
Tests output types of the calculator methods.
... | |
e0a363bce00dca2545fe33d947bbd7f04d1d7234 | tests/test_dot.py | tests/test_dot.py | import pytest
from desmod.dot import component_to_dot
from desmod.component import Component
from desmod.simulation import SimEnvironment
@pytest.fixture
def top():
top = Top(parent=None, env=SimEnvironment(config={}))
top.elaborate()
return top
class Top(Component):
base_name = ''
def __init_... | Add unit tests for desmod.dot | Add unit tests for desmod.dot
| Python | mit | SanDisk-Open-Source/desmod,bgmerrell/desmod | Add unit tests for desmod.dot | import pytest
from desmod.dot import component_to_dot
from desmod.component import Component
from desmod.simulation import SimEnvironment
@pytest.fixture
def top():
top = Top(parent=None, env=SimEnvironment(config={}))
top.elaborate()
return top
class Top(Component):
base_name = ''
def __init_... | <commit_before><commit_msg>Add unit tests for desmod.dot<commit_after> | import pytest
from desmod.dot import component_to_dot
from desmod.component import Component
from desmod.simulation import SimEnvironment
@pytest.fixture
def top():
top = Top(parent=None, env=SimEnvironment(config={}))
top.elaborate()
return top
class Top(Component):
base_name = ''
def __init_... | Add unit tests for desmod.dotimport pytest
from desmod.dot import component_to_dot
from desmod.component import Component
from desmod.simulation import SimEnvironment
@pytest.fixture
def top():
top = Top(parent=None, env=SimEnvironment(config={}))
top.elaborate()
return top
class Top(Component):
ba... | <commit_before><commit_msg>Add unit tests for desmod.dot<commit_after>import pytest
from desmod.dot import component_to_dot
from desmod.component import Component
from desmod.simulation import SimEnvironment
@pytest.fixture
def top():
top = Top(parent=None, env=SimEnvironment(config={}))
top.elaborate()
... | |
3f0c1c24528d8ce818434d8b553136d315b0d548 | tests/basics/try_finally2.py | tests/basics/try_finally2.py | # check that the Python stack does not overflow when the finally
# block itself uses more stack than the rest of the function
def f1(a, b):
pass
def test1():
val = 1
try:
raise ValueError()
finally:
f1(2, 2) # use some stack
print(val) # check that the local variable is the same
... | Add test case for overflowing Py stack in try-finally. | tests/basics: Add test case for overflowing Py stack in try-finally.
| Python | mit | blazewicz/micropython,adafruit/circuitpython,SHA2017-badge/micropython-esp32,trezor/micropython,toolmacher/micropython,mhoffma/micropython,tobbad/micropython,dxxb/micropython,deshipu/micropython,henriknelson/micropython,turbinenreiter/micropython,infinnovation/micropython,MrSurly/micropython,selste/micropython,pramasou... | tests/basics: Add test case for overflowing Py stack in try-finally. | # check that the Python stack does not overflow when the finally
# block itself uses more stack than the rest of the function
def f1(a, b):
pass
def test1():
val = 1
try:
raise ValueError()
finally:
f1(2, 2) # use some stack
print(val) # check that the local variable is the same
... | <commit_before><commit_msg>tests/basics: Add test case for overflowing Py stack in try-finally.<commit_after> | # check that the Python stack does not overflow when the finally
# block itself uses more stack than the rest of the function
def f1(a, b):
pass
def test1():
val = 1
try:
raise ValueError()
finally:
f1(2, 2) # use some stack
print(val) # check that the local variable is the same
... | tests/basics: Add test case for overflowing Py stack in try-finally.# check that the Python stack does not overflow when the finally
# block itself uses more stack than the rest of the function
def f1(a, b):
pass
def test1():
val = 1
try:
raise ValueError()
finally:
f1(2, 2) # use some s... | <commit_before><commit_msg>tests/basics: Add test case for overflowing Py stack in try-finally.<commit_after># check that the Python stack does not overflow when the finally
# block itself uses more stack than the rest of the function
def f1(a, b):
pass
def test1():
val = 1
try:
raise ValueError()
... | |
12d90ff5a24bff3151219187b960ac7f5eecc146 | tools/heapcheck/PRESUBMIT.py | tools/heapcheck/PRESUBMIT.py | # Copyright (c) 2010 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
def CheckChang... | Add presubmit checks for suppressions. | Heapchecker: Add presubmit checks for suppressions.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3197014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@57132 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,rop... | Heapchecker: Add presubmit checks for suppressions.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3197014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@57132 0039d316-1c4b-4281-b951-d872f2087c98 | # Copyright (c) 2010 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
def CheckChang... | <commit_before><commit_msg>Heapchecker: Add presubmit checks for suppressions.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3197014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@57132 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | # Copyright (c) 2010 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
def CheckChang... | Heapchecker: Add presubmit checks for suppressions.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3197014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@57132 0039d316-1c4b-4281-b951-d872f2087c98# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed... | <commit_before><commit_msg>Heapchecker: Add presubmit checks for suppressions.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3197014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@57132 0039d316-1c4b-4281-b951-d872f2087c98<commit_after># Copyright (c) 2010 The Chromium Authors. All rights reserv... | |
17180021f96897a659d472555c3e2588ca94d41b | hours_slept_time_series.py | hours_slept_time_series.py | import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
dates = list(raw_data.keys())
sleep_durations = []
for date, sleeps in raw_data.items():
total = 0
for s in sleeps:
sleep... | Add sleep duration time series plotter | Add sleep duration time series plotter
| Python | mit | f-jiang/sleep-pattern-grapher | Add sleep duration time series plotter | import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
dates = list(raw_data.keys())
sleep_durations = []
for date, sleeps in raw_data.items():
total = 0
for s in sleeps:
sleep... | <commit_before><commit_msg>Add sleep duration time series plotter<commit_after> | import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
dates = list(raw_data.keys())
sleep_durations = []
for date, sleeps in raw_data.items():
total = 0
for s in sleeps:
sleep... | Add sleep duration time series plotterimport plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
dates = list(raw_data.keys())
sleep_durations = []
for date, sleeps in raw_data.items():
total ... | <commit_before><commit_msg>Add sleep duration time series plotter<commit_after>import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
dates = list(raw_data.keys())
sleep_durations = []
for dat... | |
db6871ee917cccf9f9d9010f60521e3454f66ea8 | 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 | fzadow/CATMAID,htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID,htem/CATMAID,htem/CATMAID,fzadow/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... | |
fba9cb1278afab3c16ec4077770a33c09950e1a7 | waterbutler/core/path.py | waterbutler/core/path.py | import os
class WaterButlerPathPart:
DECODE = lambda x: x
ENCODE = lambda x: x
def __init__(self, part, _id=None):
self._id = _id
self._part = part
@property
def identifier(self):
return self._id
@property
def value(self):
return self.__class__.DECODE(self... | Add a new variant of WaterButlerPath | Add a new variant of WaterButlerPath
| Python | apache-2.0 | rdhyee/waterbutler,rafaeldelucena/waterbutler,CenterForOpenScience/waterbutler,TomBaxter/waterbutler,felliott/waterbutler,Johnetordoff/waterbutler,cosenal/waterbutler,icereval/waterbutler,chrisseto/waterbutler,hmoco/waterbutler,RCOSDP/waterbutler,Ghalko/waterbutler,kwierman/waterbutler | Add a new variant of WaterButlerPath | import os
class WaterButlerPathPart:
DECODE = lambda x: x
ENCODE = lambda x: x
def __init__(self, part, _id=None):
self._id = _id
self._part = part
@property
def identifier(self):
return self._id
@property
def value(self):
return self.__class__.DECODE(self... | <commit_before><commit_msg>Add a new variant of WaterButlerPath<commit_after> | import os
class WaterButlerPathPart:
DECODE = lambda x: x
ENCODE = lambda x: x
def __init__(self, part, _id=None):
self._id = _id
self._part = part
@property
def identifier(self):
return self._id
@property
def value(self):
return self.__class__.DECODE(self... | Add a new variant of WaterButlerPathimport os
class WaterButlerPathPart:
DECODE = lambda x: x
ENCODE = lambda x: x
def __init__(self, part, _id=None):
self._id = _id
self._part = part
@property
def identifier(self):
return self._id
@property
def value(self):
... | <commit_before><commit_msg>Add a new variant of WaterButlerPath<commit_after>import os
class WaterButlerPathPart:
DECODE = lambda x: x
ENCODE = lambda x: x
def __init__(self, part, _id=None):
self._id = _id
self._part = part
@property
def identifier(self):
return self._id
... | |
78fa145bca4416726acb7c279754589ba0b2d1c0 | ProcessGCodeJob.py | ProcessGCodeJob.py | from UM.Job import Job
from UM.Application import Application
import os
class ProcessGCodeJob(Job):
def __init__(self, message):
super().__init__()
self._message = message
def run(self):
with open(self._message.filename) as f:
data = f.read(None)
Application.g... | Add a job to handle processing of GCode from the backend | Add a job to handle processing of GCode from the backend
| Python | agpl-3.0 | markwal/Cura,totalretribution/Cura,derekhe/Cura,lo0ol/Ultimaker-Cura,totalretribution/Cura,fieldOfView/Cura,bq/Ultimaker-Cura,hmflash/Cura,hmflash/Cura,Curahelper/Cura,fxtentacle/Cura,quillford/Cura,fieldOfView/Cura,markwal/Cura,fxtentacle/Cura,DeskboxBrazil/Cura,ynotstartups/Wanhao,ynotstartups/Wanhao,senttech/Cura,qu... | Add a job to handle processing of GCode from the backend | from UM.Job import Job
from UM.Application import Application
import os
class ProcessGCodeJob(Job):
def __init__(self, message):
super().__init__()
self._message = message
def run(self):
with open(self._message.filename) as f:
data = f.read(None)
Application.g... | <commit_before><commit_msg>Add a job to handle processing of GCode from the backend<commit_after> | from UM.Job import Job
from UM.Application import Application
import os
class ProcessGCodeJob(Job):
def __init__(self, message):
super().__init__()
self._message = message
def run(self):
with open(self._message.filename) as f:
data = f.read(None)
Application.g... | Add a job to handle processing of GCode from the backendfrom UM.Job import Job
from UM.Application import Application
import os
class ProcessGCodeJob(Job):
def __init__(self, message):
super().__init__()
self._message = message
def run(self):
with open(self._message.filename) as f:
... | <commit_before><commit_msg>Add a job to handle processing of GCode from the backend<commit_after>from UM.Job import Job
from UM.Application import Application
import os
class ProcessGCodeJob(Job):
def __init__(self, message):
super().__init__()
self._message = message
def run(self):
... | |
ae3a567c695477013d34316e160ab09055f8feeb | src/MultiProcessing.py | src/MultiProcessing.py | import multiprocessing
import time
class Consumer(multiprocessing.Process):
def __init__(self, task_queue, result_queue):
multiprocessing.Process.__init__(self)
self.task_queue = task_queue
self.result_queue = result_queue
def run(self):
proc_name = self.name
... | Make changes to generate ts.csv and only one csv for each market for the day. | Make changes to generate ts.csv and only one csv for each market for the day.
| Python | mit | aviatorBeijing/CapMarket,aviatorBeijing/CapMarket | Make changes to generate ts.csv and only one csv for each market for the day. | import multiprocessing
import time
class Consumer(multiprocessing.Process):
def __init__(self, task_queue, result_queue):
multiprocessing.Process.__init__(self)
self.task_queue = task_queue
self.result_queue = result_queue
def run(self):
proc_name = self.name
... | <commit_before><commit_msg>Make changes to generate ts.csv and only one csv for each market for the day.<commit_after> | import multiprocessing
import time
class Consumer(multiprocessing.Process):
def __init__(self, task_queue, result_queue):
multiprocessing.Process.__init__(self)
self.task_queue = task_queue
self.result_queue = result_queue
def run(self):
proc_name = self.name
... | Make changes to generate ts.csv and only one csv for each market for the day.import multiprocessing
import time
class Consumer(multiprocessing.Process):
def __init__(self, task_queue, result_queue):
multiprocessing.Process.__init__(self)
self.task_queue = task_queue
self.result... | <commit_before><commit_msg>Make changes to generate ts.csv and only one csv for each market for the day.<commit_after>import multiprocessing
import time
class Consumer(multiprocessing.Process):
def __init__(self, task_queue, result_queue):
multiprocessing.Process.__init__(self)
self.tas... | |
aef0765b2d76f371bda6e7ce3575bbede1b2a2a2 | tests/test_init.py | tests/test_init.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
class TestInit(TestCase):
def test_centerline_import__import_successful(self):
"""ImportError should not be raised!"""
from centerline import Centerline
| Test the import of the Centerline class | Test the import of the Centerline class
| Python | mit | fitodic/polygon-centerline,fitodic/centerline,fitodic/centerline | Test the import of the Centerline class | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
class TestInit(TestCase):
def test_centerline_import__import_successful(self):
"""ImportError should not be raised!"""
from centerline import Centerline
| <commit_before><commit_msg>Test the import of the Centerline class<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
class TestInit(TestCase):
def test_centerline_import__import_successful(self):
"""ImportError should not be raised!"""
from centerline import Centerline
| Test the import of the Centerline class# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
class TestInit(TestCase):
def test_centerline_import__import_successful(self):
"""ImportError should not be raised!"""
from centerline import Centerline
| <commit_before><commit_msg>Test the import of the Centerline class<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
class TestInit(TestCase):
def test_centerline_import__import_successful(self):
"""ImportError should not be raised!"""
fr... | |
b53d1b632d14904800f74d4c31f7a42b30e3ef7a | decorators.py | decorators.py | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | Add a decorator for requiring a specific type | Add a decorator for requiring a specific type
Preperation for moving the rule matching into a class so adding more
rules is simpler, and applying rules to more than two types makes sense.
| Python | bsd-3-clause | rasher/reddit-modbot | Add a decorator for requiring a specific type
Preperation for moving the rule matching into a class so adding more
rules is simpler, and applying rules to more than two types makes sense. | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | <commit_before><commit_msg>Add a decorator for requiring a specific type
Preperation for moving the rule matching into a class so adding more
rules is simpler, and applying rules to more than two types makes sense.<commit_after> | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | Add a decorator for requiring a specific type
Preperation for moving the rule matching into a class so adding more
rules is simpler, and applying rules to more than two types makes sense.#!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'po... | <commit_before><commit_msg>Add a decorator for requiring a specific type
Preperation for moving the rule matching into a class so adding more
rules is simpler, and applying rules to more than two types makes sense.<commit_after>#!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or p... | |
a2fba4f0f90f069c0fcacc597fc1690f6d9d7609 | atlantic/bathy/get_bathy.py | atlantic/bathy/get_bathy.py | #!/usr/bin/env python
"""Simple implementation of a file fetcher"""
import sys
import os
import urllib
import subprocess
def get_bathy(url, destination=os.getcwd(), force=False):
r"""Get bathymetry file located at `url`
Will check downloaded file's suffix to see if the file needs to be extracted
"""
... | Add bathy download script for atlantic | Add bathy download script for atlantic
| Python | mit | mandli/surge-examples | Add bathy download script for atlantic | #!/usr/bin/env python
"""Simple implementation of a file fetcher"""
import sys
import os
import urllib
import subprocess
def get_bathy(url, destination=os.getcwd(), force=False):
r"""Get bathymetry file located at `url`
Will check downloaded file's suffix to see if the file needs to be extracted
"""
... | <commit_before><commit_msg>Add bathy download script for atlantic<commit_after> | #!/usr/bin/env python
"""Simple implementation of a file fetcher"""
import sys
import os
import urllib
import subprocess
def get_bathy(url, destination=os.getcwd(), force=False):
r"""Get bathymetry file located at `url`
Will check downloaded file's suffix to see if the file needs to be extracted
"""
... | Add bathy download script for atlantic#!/usr/bin/env python
"""Simple implementation of a file fetcher"""
import sys
import os
import urllib
import subprocess
def get_bathy(url, destination=os.getcwd(), force=False):
r"""Get bathymetry file located at `url`
Will check downloaded file's suffix to see if the ... | <commit_before><commit_msg>Add bathy download script for atlantic<commit_after>#!/usr/bin/env python
"""Simple implementation of a file fetcher"""
import sys
import os
import urllib
import subprocess
def get_bathy(url, destination=os.getcwd(), force=False):
r"""Get bathymetry file located at `url`
Will chec... | |
816c87ba5f38760adfc87877a1c403da3f0bc054 | test/test_pips.py | test/test_pips.py | import pytest
@pytest.mark.parametrize("name", [
("ansible"),
("docker-py"),
("mkdocs"),
("mkdocs-material"),
])
def test_pips(host, name):
assert name in host.pip_package.get_packages() | Add tests for pip packages | Add tests for pip packages
| Python | mit | wicksy/CV,wicksy/CV,wicksy/CV | Add tests for pip packages | import pytest
@pytest.mark.parametrize("name", [
("ansible"),
("docker-py"),
("mkdocs"),
("mkdocs-material"),
])
def test_pips(host, name):
assert name in host.pip_package.get_packages() | <commit_before><commit_msg>Add tests for pip packages<commit_after> | import pytest
@pytest.mark.parametrize("name", [
("ansible"),
("docker-py"),
("mkdocs"),
("mkdocs-material"),
])
def test_pips(host, name):
assert name in host.pip_package.get_packages() | Add tests for pip packagesimport pytest
@pytest.mark.parametrize("name", [
("ansible"),
("docker-py"),
("mkdocs"),
("mkdocs-material"),
])
def test_pips(host, name):
assert name in host.pip_package.get_packages() | <commit_before><commit_msg>Add tests for pip packages<commit_after>import pytest
@pytest.mark.parametrize("name", [
("ansible"),
("docker-py"),
("mkdocs"),
("mkdocs-material"),
])
def test_pips(host, name):
assert name in host.pip_package.get_packages() | |
ca8151832647864cd6e63dc84cbed8c77955d91e | recipes/solaryears.py | recipes/solaryears.py | """
A tropical solar year is the length from spring equinox
to the following spring equinox.
This recipe was implemented to reply to a topic opened
at http://skyscript.co.uk/forums/viewtopic.php?t=8563
and shows that the solar year has an amplitude of more
than 25 minutes, considering the ... | Add solar years to recipes | Add solar years to recipes
| Python | mit | flatangle/flatlib | Add solar years to recipes | """
A tropical solar year is the length from spring equinox
to the following spring equinox.
This recipe was implemented to reply to a topic opened
at http://skyscript.co.uk/forums/viewtopic.php?t=8563
and shows that the solar year has an amplitude of more
than 25 minutes, considering the ... | <commit_before><commit_msg>Add solar years to recipes<commit_after> | """
A tropical solar year is the length from spring equinox
to the following spring equinox.
This recipe was implemented to reply to a topic opened
at http://skyscript.co.uk/forums/viewtopic.php?t=8563
and shows that the solar year has an amplitude of more
than 25 minutes, considering the ... | Add solar years to recipes"""
A tropical solar year is the length from spring equinox
to the following spring equinox.
This recipe was implemented to reply to a topic opened
at http://skyscript.co.uk/forums/viewtopic.php?t=8563
and shows that the solar year has an amplitude of more
than 25... | <commit_before><commit_msg>Add solar years to recipes<commit_after>"""
A tropical solar year is the length from spring equinox
to the following spring equinox.
This recipe was implemented to reply to a topic opened
at http://skyscript.co.uk/forums/viewtopic.php?t=8563
and shows that the solar ... | |
80bcce3208941df6b51d97fabdacaa93bb764376 | clbundler/buildtools.py | clbundler/buildtools.py | import os
import system
def cmake_generator(toolchain, arch):
"""Return name of CMake generator for toolchain"""
generator = ""
if toolchain.startswith("vc"):
if toolchain == "vc9":
generator = "Visual Studio 9 2008"
else:
generator = "Visual Studio " + vc_version(t... | Add functions for running cmake and vcbuild | Add functions for running cmake and vcbuild
| Python | mit | peterl94/CLbundler,peterl94/CLbundler | Add functions for running cmake and vcbuild | import os
import system
def cmake_generator(toolchain, arch):
"""Return name of CMake generator for toolchain"""
generator = ""
if toolchain.startswith("vc"):
if toolchain == "vc9":
generator = "Visual Studio 9 2008"
else:
generator = "Visual Studio " + vc_version(t... | <commit_before><commit_msg>Add functions for running cmake and vcbuild<commit_after> | import os
import system
def cmake_generator(toolchain, arch):
"""Return name of CMake generator for toolchain"""
generator = ""
if toolchain.startswith("vc"):
if toolchain == "vc9":
generator = "Visual Studio 9 2008"
else:
generator = "Visual Studio " + vc_version(t... | Add functions for running cmake and vcbuildimport os
import system
def cmake_generator(toolchain, arch):
"""Return name of CMake generator for toolchain"""
generator = ""
if toolchain.startswith("vc"):
if toolchain == "vc9":
generator = "Visual Studio 9 2008"
else:
... | <commit_before><commit_msg>Add functions for running cmake and vcbuild<commit_after>import os
import system
def cmake_generator(toolchain, arch):
"""Return name of CMake generator for toolchain"""
generator = ""
if toolchain.startswith("vc"):
if toolchain == "vc9":
generator = "Visual ... | |
3b146038ca6aebfdc11920cc688903124ccc2b3a | src/ggrc/converters/handlers/document.py | src/ggrc/converters/handlers/document.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.converters import g... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.converters import g... | Add import parser for url and evidence | Add import parser for url and evidence
| Python | apache-2.0 | selahssea/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,sela... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.converters import g... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.converters import g... | <commit_before># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.conv... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.converters import g... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.converters import g... | <commit_before># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handlers for special object mappings."""
from flask import current_app
from ggrc import models
from ggrc.login import get_current_user_id
from ggrc.converters import errors
from ggrc.conv... |
e101f2687a6857f218b9dab277e323edf377a0fb | tests/test_partitioned_model.py | tests/test_partitioned_model.py |
from psqlextra.models import PostgresPartitionedModel
from psqlextra.types import PostgresPartitioningMethod
from .fake_model import define_fake_partitioning_model
def test_partitioned_model_abstract():
"""Tests whether :see:PostgresPartitionedModel is abstract."""
assert PostgresPartitionedModel._meta.abs... | Add tests for PostgresPartitionedModel meta options | Add tests for PostgresPartitionedModel meta options
| Python | mit | SectorLabs/django-postgres-extra | Add tests for PostgresPartitionedModel meta options |
from psqlextra.models import PostgresPartitionedModel
from psqlextra.types import PostgresPartitioningMethod
from .fake_model import define_fake_partitioning_model
def test_partitioned_model_abstract():
"""Tests whether :see:PostgresPartitionedModel is abstract."""
assert PostgresPartitionedModel._meta.abs... | <commit_before><commit_msg>Add tests for PostgresPartitionedModel meta options<commit_after> |
from psqlextra.models import PostgresPartitionedModel
from psqlextra.types import PostgresPartitioningMethod
from .fake_model import define_fake_partitioning_model
def test_partitioned_model_abstract():
"""Tests whether :see:PostgresPartitionedModel is abstract."""
assert PostgresPartitionedModel._meta.abs... | Add tests for PostgresPartitionedModel meta options
from psqlextra.models import PostgresPartitionedModel
from psqlextra.types import PostgresPartitioningMethod
from .fake_model import define_fake_partitioning_model
def test_partitioned_model_abstract():
"""Tests whether :see:PostgresPartitionedModel is abstract... | <commit_before><commit_msg>Add tests for PostgresPartitionedModel meta options<commit_after>
from psqlextra.models import PostgresPartitionedModel
from psqlextra.types import PostgresPartitioningMethod
from .fake_model import define_fake_partitioning_model
def test_partitioned_model_abstract():
"""Tests whether ... | |
db23070f9b740d559b84724ad0ed61e38eb15dec | multigraph.py | multigraph.py | """
An extension of a standard cligraph for plotting
graphs with subplots using gridspec
"""
import matplotlib
import matplotlib.gridspec as gridspec
from cligraph import CLIgraph
class MultiGraph(CLIgraph):
def __init__(self, num_plots_x, num_plots_y, **kwargs):
super(MultiGraph, self).__init__(**kwar... | Split support for suplots into a MultiGraph subclass | Split support for suplots into a MultiGraph subclass
| Python | agpl-3.0 | bsmithers/CLIgraphs | Split support for suplots into a MultiGraph subclass | """
An extension of a standard cligraph for plotting
graphs with subplots using gridspec
"""
import matplotlib
import matplotlib.gridspec as gridspec
from cligraph import CLIgraph
class MultiGraph(CLIgraph):
def __init__(self, num_plots_x, num_plots_y, **kwargs):
super(MultiGraph, self).__init__(**kwar... | <commit_before><commit_msg>Split support for suplots into a MultiGraph subclass<commit_after> | """
An extension of a standard cligraph for plotting
graphs with subplots using gridspec
"""
import matplotlib
import matplotlib.gridspec as gridspec
from cligraph import CLIgraph
class MultiGraph(CLIgraph):
def __init__(self, num_plots_x, num_plots_y, **kwargs):
super(MultiGraph, self).__init__(**kwar... | Split support for suplots into a MultiGraph subclass"""
An extension of a standard cligraph for plotting
graphs with subplots using gridspec
"""
import matplotlib
import matplotlib.gridspec as gridspec
from cligraph import CLIgraph
class MultiGraph(CLIgraph):
def __init__(self, num_plots_x, num_plots_y, **kwar... | <commit_before><commit_msg>Split support for suplots into a MultiGraph subclass<commit_after>"""
An extension of a standard cligraph for plotting
graphs with subplots using gridspec
"""
import matplotlib
import matplotlib.gridspec as gridspec
from cligraph import CLIgraph
class MultiGraph(CLIgraph):
def __init... | |
de57486712d60995dd4e75ace21b9ce4f824a552 | WeeklyLogParser.py | WeeklyLogParser.py | import sys
import re
"""
To do:
- Add web interaction to get the string argument
directly from web instead of having to manually put the
argument as a command line argument
"""
try:
dates = sys.argv[1]
listDates = dates.split('\n')
xfConsumptionRegex = re.compile(r'[\d,]+$')
xfConsumptionWeekly = [int(re.sub(... | Add parser for weekly log | Add parser for weekly log
| Python | mit | josecolella/Dynatrace-Resources | Add parser for weekly log | import sys
import re
"""
To do:
- Add web interaction to get the string argument
directly from web instead of having to manually put the
argument as a command line argument
"""
try:
dates = sys.argv[1]
listDates = dates.split('\n')
xfConsumptionRegex = re.compile(r'[\d,]+$')
xfConsumptionWeekly = [int(re.sub(... | <commit_before><commit_msg>Add parser for weekly log<commit_after> | import sys
import re
"""
To do:
- Add web interaction to get the string argument
directly from web instead of having to manually put the
argument as a command line argument
"""
try:
dates = sys.argv[1]
listDates = dates.split('\n')
xfConsumptionRegex = re.compile(r'[\d,]+$')
xfConsumptionWeekly = [int(re.sub(... | Add parser for weekly logimport sys
import re
"""
To do:
- Add web interaction to get the string argument
directly from web instead of having to manually put the
argument as a command line argument
"""
try:
dates = sys.argv[1]
listDates = dates.split('\n')
xfConsumptionRegex = re.compile(r'[\d,]+$')
xfConsump... | <commit_before><commit_msg>Add parser for weekly log<commit_after>import sys
import re
"""
To do:
- Add web interaction to get the string argument
directly from web instead of having to manually put the
argument as a command line argument
"""
try:
dates = sys.argv[1]
listDates = dates.split('\n')
xfConsumptionR... | |
833d0ee1622530200ebd2614bc6939abba30493c | setup/bin/swc-nano-installer.py | setup/bin/swc-nano-installer.py | #!/usr/bin/env python
"""Software Carpentry Nano Installer for Windows
Installs nano and makes it the default editor in msysgit
To use:
1. Install Python
2. Install msysgit
http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
3. Run swc_nano_installer.py
You should be able to simply d... | Add a Nano installer for Windows | Add a Nano installer for Windows
1. Downloads and installs Nano into the users home directory
2. Adds Nano to the path
3. Makes Nano the default editor
| Python | bsd-2-clause | selimnairb/2014-02-25-swctest,selimnairb/2014-02-25-swctest,selimnairb/2014-02-25-swctest,selimnairb/2014-02-25-swctest,selimnairb/2014-02-25-swctest,selimnairb/2014-02-25-swctest,swcarpentry/windows-installer,wking/swc-windows-installer,ethanwhite/windows-installer | Add a Nano installer for Windows
1. Downloads and installs Nano into the users home directory
2. Adds Nano to the path
3. Makes Nano the default editor | #!/usr/bin/env python
"""Software Carpentry Nano Installer for Windows
Installs nano and makes it the default editor in msysgit
To use:
1. Install Python
2. Install msysgit
http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
3. Run swc_nano_installer.py
You should be able to simply d... | <commit_before><commit_msg>Add a Nano installer for Windows
1. Downloads and installs Nano into the users home directory
2. Adds Nano to the path
3. Makes Nano the default editor<commit_after> | #!/usr/bin/env python
"""Software Carpentry Nano Installer for Windows
Installs nano and makes it the default editor in msysgit
To use:
1. Install Python
2. Install msysgit
http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
3. Run swc_nano_installer.py
You should be able to simply d... | Add a Nano installer for Windows
1. Downloads and installs Nano into the users home directory
2. Adds Nano to the path
3. Makes Nano the default editor#!/usr/bin/env python
"""Software Carpentry Nano Installer for Windows
Installs nano and makes it the default editor in msysgit
To use:
1. Install Python
2. Install... | <commit_before><commit_msg>Add a Nano installer for Windows
1. Downloads and installs Nano into the users home directory
2. Adds Nano to the path
3. Makes Nano the default editor<commit_after>#!/usr/bin/env python
"""Software Carpentry Nano Installer for Windows
Installs nano and makes it the default editor in msysg... | |
2ab1e008ab5626b96767bb40a6e365c464019d0f | skrt/text.py | skrt/text.py | FG_COLORS = {
'black' : '30',
'red' : '31',
'green' : '32',
'yellow' : '33',
'blue' : '34',
'purple' : '35',
'cyan' : '36',
'white' : '37',
}
FXS = {
'normal' : '0',
'bold' : '1',
'underline': '4',
}
BG_COLORS = {
'black' : '40',
'red' : '41',
'green' : '42',
... | Add utility for terminal colors | Add utility for terminal colors
| Python | mit | nvander1/skrt | Add utility for terminal colors | FG_COLORS = {
'black' : '30',
'red' : '31',
'green' : '32',
'yellow' : '33',
'blue' : '34',
'purple' : '35',
'cyan' : '36',
'white' : '37',
}
FXS = {
'normal' : '0',
'bold' : '1',
'underline': '4',
}
BG_COLORS = {
'black' : '40',
'red' : '41',
'green' : '42',
... | <commit_before><commit_msg>Add utility for terminal colors<commit_after> | FG_COLORS = {
'black' : '30',
'red' : '31',
'green' : '32',
'yellow' : '33',
'blue' : '34',
'purple' : '35',
'cyan' : '36',
'white' : '37',
}
FXS = {
'normal' : '0',
'bold' : '1',
'underline': '4',
}
BG_COLORS = {
'black' : '40',
'red' : '41',
'green' : '42',
... | Add utility for terminal colorsFG_COLORS = {
'black' : '30',
'red' : '31',
'green' : '32',
'yellow' : '33',
'blue' : '34',
'purple' : '35',
'cyan' : '36',
'white' : '37',
}
FXS = {
'normal' : '0',
'bold' : '1',
'underline': '4',
}
BG_COLORS = {
'black' : '40',
'red'... | <commit_before><commit_msg>Add utility for terminal colors<commit_after>FG_COLORS = {
'black' : '30',
'red' : '31',
'green' : '32',
'yellow' : '33',
'blue' : '34',
'purple' : '35',
'cyan' : '36',
'white' : '37',
}
FXS = {
'normal' : '0',
'bold' : '1',
'underline': '4',
}
BG... | |
33f651c3f6e697b2a9a2bf30006b1d2facaba103 | fmn/rules/fas.py | fmn/rules/fas.py | def fas_group_create(config, message):
""" Fas: New group created.
TODO description for the web interface goes here
"""
return message['topic'].endswith('fas.group.create')
def fas_group_member_apply(config, message):
""" Fas: A member requested to join a group.
TODO description for the web ... | Add filters for the FAS messages | Add filters for the FAS messages
| Python | lgpl-2.1 | jeremycline/fmn,jeremycline/fmn,jeremycline/fmn | Add filters for the FAS messages | def fas_group_create(config, message):
""" Fas: New group created.
TODO description for the web interface goes here
"""
return message['topic'].endswith('fas.group.create')
def fas_group_member_apply(config, message):
""" Fas: A member requested to join a group.
TODO description for the web ... | <commit_before><commit_msg>Add filters for the FAS messages<commit_after> | def fas_group_create(config, message):
""" Fas: New group created.
TODO description for the web interface goes here
"""
return message['topic'].endswith('fas.group.create')
def fas_group_member_apply(config, message):
""" Fas: A member requested to join a group.
TODO description for the web ... | Add filters for the FAS messagesdef fas_group_create(config, message):
""" Fas: New group created.
TODO description for the web interface goes here
"""
return message['topic'].endswith('fas.group.create')
def fas_group_member_apply(config, message):
""" Fas: A member requested to join a group.
... | <commit_before><commit_msg>Add filters for the FAS messages<commit_after>def fas_group_create(config, message):
""" Fas: New group created.
TODO description for the web interface goes here
"""
return message['topic'].endswith('fas.group.create')
def fas_group_member_apply(config, message):
""" Fa... | |
069e6a31208e98d565811216aea1b5a4b18f4391 | tests/api.py | tests/api.py | import unittest
import carseour
"""
Run tests from the main carseour directory: python -m unittest tests.api
"""
class TestAPI(unittest.TestCase):
def setUp(self):
self.data = carseour.live()
def tearDown(self):
pass
def test_valid_api(self):
self.assertEqual(self.data.mVersion, c... | Add a few tests to see that we actually can retrieve information from the API and that our helper methods seem to work | Add a few tests to see that we actually can retrieve information from the API and that our helper methods seem to work
| Python | mit | matslindh/carseour,matslindh/carseour | Add a few tests to see that we actually can retrieve information from the API and that our helper methods seem to work | import unittest
import carseour
"""
Run tests from the main carseour directory: python -m unittest tests.api
"""
class TestAPI(unittest.TestCase):
def setUp(self):
self.data = carseour.live()
def tearDown(self):
pass
def test_valid_api(self):
self.assertEqual(self.data.mVersion, c... | <commit_before><commit_msg>Add a few tests to see that we actually can retrieve information from the API and that our helper methods seem to work<commit_after> | import unittest
import carseour
"""
Run tests from the main carseour directory: python -m unittest tests.api
"""
class TestAPI(unittest.TestCase):
def setUp(self):
self.data = carseour.live()
def tearDown(self):
pass
def test_valid_api(self):
self.assertEqual(self.data.mVersion, c... | Add a few tests to see that we actually can retrieve information from the API and that our helper methods seem to workimport unittest
import carseour
"""
Run tests from the main carseour directory: python -m unittest tests.api
"""
class TestAPI(unittest.TestCase):
def setUp(self):
self.data = carseour.live... | <commit_before><commit_msg>Add a few tests to see that we actually can retrieve information from the API and that our helper methods seem to work<commit_after>import unittest
import carseour
"""
Run tests from the main carseour directory: python -m unittest tests.api
"""
class TestAPI(unittest.TestCase):
def setUp... | |
be82e8070e01c24ca909171e1b6f0bac4edeafb6 | broad_scan.py | broad_scan.py | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 25 19:43:13 2015
@author: jensv
Do a broad scan of skin geometry, epsilo, and spline knots.
"""
import numpy as np
import skin_core_scanner_simple as scss
lambda_bar_space = [0.01, 6., 75]
k_bar_space = [0.01, 3., 75]
for skin_width in np.logspace(0.001, 0.9, 25):
... | Add a script to run a broad scan. | Add a script to run a broad scan.
A broad scan of skin geometry, epsilo, and spline knots.
| Python | mit | jensv/fluxtubestability,jensv/fluxtubestability | Add a script to run a broad scan.
A broad scan of skin geometry, epsilo, and spline knots. | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 25 19:43:13 2015
@author: jensv
Do a broad scan of skin geometry, epsilo, and spline knots.
"""
import numpy as np
import skin_core_scanner_simple as scss
lambda_bar_space = [0.01, 6., 75]
k_bar_space = [0.01, 3., 75]
for skin_width in np.logspace(0.001, 0.9, 25):
... | <commit_before><commit_msg>Add a script to run a broad scan.
A broad scan of skin geometry, epsilo, and spline knots.<commit_after> | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 25 19:43:13 2015
@author: jensv
Do a broad scan of skin geometry, epsilo, and spline knots.
"""
import numpy as np
import skin_core_scanner_simple as scss
lambda_bar_space = [0.01, 6., 75]
k_bar_space = [0.01, 3., 75]
for skin_width in np.logspace(0.001, 0.9, 25):
... | Add a script to run a broad scan.
A broad scan of skin geometry, epsilo, and spline knots.# -*- coding: utf-8 -*-
"""
Created on Sun Oct 25 19:43:13 2015
@author: jensv
Do a broad scan of skin geometry, epsilo, and spline knots.
"""
import numpy as np
import skin_core_scanner_simple as scss
lambda_bar_space = [0.0... | <commit_before><commit_msg>Add a script to run a broad scan.
A broad scan of skin geometry, epsilo, and spline knots.<commit_after># -*- coding: utf-8 -*-
"""
Created on Sun Oct 25 19:43:13 2015
@author: jensv
Do a broad scan of skin geometry, epsilo, and spline knots.
"""
import numpy as np
import skin_core_scanne... | |
eb6d70524bf68cbd151958fbd82689c7e7f4abd1 | test/test_service.py | test/test_service.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | Add Unit Tests for Service | Add Unit Tests for Service
Ref #127
| Python | agpl-3.0 | Alignak-monitoring-contrib/alignak-app,Alignak-monitoring-contrib/alignak-app | Add Unit Tests for Service
Ref #127 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | <commit_before><commit_msg>Add Unit Tests for Service
Ref #127<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | Add Unit Tests for Service
Ref #127#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Li... | <commit_before><commit_msg>Add Unit Tests for Service
Ref #127<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the ... | |
26c78aacc8e632290dce532de2540f94d85da062 | migration/versions/551819450a3c_display_name.py | migration/versions/551819450a3c_display_name.py | """display_name
Add display_name field to User (again)
Revision ID: 551819450a3c
Revises: 187dd4ba924a
Create Date: 2013-04-08 21:43:51.436466
"""
#
#
# revision identifiers, used by Alembic.
revision = '551819450a3c'
down_revision = '187dd4ba924a'
from alembic import op
from alembic.operations import Operations a... | Add migration script for added display_name column in a4919a7 | Add migration script for added display_name column in a4919a7 | Python | agpl-3.0 | moschlar/SAUCE,moschlar/SAUCE,moschlar/SAUCE,moschlar/SAUCE | Add migration script for added display_name column in a4919a7 | """display_name
Add display_name field to User (again)
Revision ID: 551819450a3c
Revises: 187dd4ba924a
Create Date: 2013-04-08 21:43:51.436466
"""
#
#
# revision identifiers, used by Alembic.
revision = '551819450a3c'
down_revision = '187dd4ba924a'
from alembic import op
from alembic.operations import Operations a... | <commit_before><commit_msg>Add migration script for added display_name column in a4919a7<commit_after> | """display_name
Add display_name field to User (again)
Revision ID: 551819450a3c
Revises: 187dd4ba924a
Create Date: 2013-04-08 21:43:51.436466
"""
#
#
# revision identifiers, used by Alembic.
revision = '551819450a3c'
down_revision = '187dd4ba924a'
from alembic import op
from alembic.operations import Operations a... | Add migration script for added display_name column in a4919a7"""display_name
Add display_name field to User (again)
Revision ID: 551819450a3c
Revises: 187dd4ba924a
Create Date: 2013-04-08 21:43:51.436466
"""
#
#
# revision identifiers, used by Alembic.
revision = '551819450a3c'
down_revision = '187dd4ba924a'
from ... | <commit_before><commit_msg>Add migration script for added display_name column in a4919a7<commit_after>"""display_name
Add display_name field to User (again)
Revision ID: 551819450a3c
Revises: 187dd4ba924a
Create Date: 2013-04-08 21:43:51.436466
"""
#
#
# revision identifiers, used by Alembic.
revision = '551819450a... | |
e954624c56348f484d8e99c595770582281f4a02 | upgrade_db.py | upgrade_db.py | #!/usr/bin/env python3
import json
import sys
from pathlib import Path
from alembic.config import main as alembic
if __name__ == '__main__':
path = sys.argv[1] if len(sys.argv) >= 2 else 'config.json'
with open(path) as f:
config = json.load(f)
url = config['db']['connect_string']
alembic... | Add basic script to apply migrations | Add basic script to apply migrations
| Python | mit | FallenWarrior2k/cardinal.py,FallenWarrior2k/cardinal.py | Add basic script to apply migrations | #!/usr/bin/env python3
import json
import sys
from pathlib import Path
from alembic.config import main as alembic
if __name__ == '__main__':
path = sys.argv[1] if len(sys.argv) >= 2 else 'config.json'
with open(path) as f:
config = json.load(f)
url = config['db']['connect_string']
alembic... | <commit_before><commit_msg>Add basic script to apply migrations<commit_after> | #!/usr/bin/env python3
import json
import sys
from pathlib import Path
from alembic.config import main as alembic
if __name__ == '__main__':
path = sys.argv[1] if len(sys.argv) >= 2 else 'config.json'
with open(path) as f:
config = json.load(f)
url = config['db']['connect_string']
alembic... | Add basic script to apply migrations#!/usr/bin/env python3
import json
import sys
from pathlib import Path
from alembic.config import main as alembic
if __name__ == '__main__':
path = sys.argv[1] if len(sys.argv) >= 2 else 'config.json'
with open(path) as f:
config = json.load(f)
url = config[... | <commit_before><commit_msg>Add basic script to apply migrations<commit_after>#!/usr/bin/env python3
import json
import sys
from pathlib import Path
from alembic.config import main as alembic
if __name__ == '__main__':
path = sys.argv[1] if len(sys.argv) >= 2 else 'config.json'
with open(path) as f:
... | |
1a398980d05af4daf5410c7c40f22c2e8f52d5f2 | lms/djangoapps/django_comment_client/tests/test_middleware.py | lms/djangoapps/django_comment_client/tests/test_middleware.py | import string
import random
import collections
from django.test import TestCase
import comment_client
import django.http
import django_comment_client.middleware as middleware
class AjaxExceptionTestCase(TestCase):
# TODO: check whether the correct error message is produced.
# The error mes... | Add tests for diango-comment-client middleware | Add tests for diango-comment-client middleware
| Python | agpl-3.0 | vasyarv/edx-platform,TsinghuaX/edx-platform,ovnicraft/edx-platform,eduNEXT/edunext-platform,pku9104038/edx-platform,proversity-org/edx-platform,vikas1885/test1,xinjiguaike/edx-platform,miptliot/edx-platform,stvstnfrd/edx-platform,ahmadiga/min_edx,rue89-tech/edx-platform,SivilTaram/edx-platform,apigee/edx-platform,LICEF... | Add tests for diango-comment-client middleware | import string
import random
import collections
from django.test import TestCase
import comment_client
import django.http
import django_comment_client.middleware as middleware
class AjaxExceptionTestCase(TestCase):
# TODO: check whether the correct error message is produced.
# The error mes... | <commit_before><commit_msg>Add tests for diango-comment-client middleware<commit_after> | import string
import random
import collections
from django.test import TestCase
import comment_client
import django.http
import django_comment_client.middleware as middleware
class AjaxExceptionTestCase(TestCase):
# TODO: check whether the correct error message is produced.
# The error mes... | Add tests for diango-comment-client middlewareimport string
import random
import collections
from django.test import TestCase
import comment_client
import django.http
import django_comment_client.middleware as middleware
class AjaxExceptionTestCase(TestCase):
# TODO: check whether the corre... | <commit_before><commit_msg>Add tests for diango-comment-client middleware<commit_after>import string
import random
import collections
from django.test import TestCase
import comment_client
import django.http
import django_comment_client.middleware as middleware
class AjaxExceptionTestCase(Te... | |
03c5da23653d99d7d01c29b6c66204bb21d9467d | test_infra/test_cdn.py | test_infra/test_cdn.py | import pytest
import requests
MLS_URL = 'https://location.services.mozilla.com/v1/country' \
'?key=ec4d0c4b-b9ac-4d72-9197-289160930e14'
@pytest.mark.parametrize('url', (
'/',
'/firefox/',
'/firefox/new/',
'/about/',
))
@pytest.mark.nondestructive
def test_locale_redirect(url, base_url):
... | Add tests for CDN infra | Add tests for CDN infra
Add tests for:
* /media/* urls
* locale redirects and vary headers
* geolocation
| Python | mpl-2.0 | mozilla/bedrock,mozilla/bedrock,mozilla/bedrock,craigcook/bedrock,alexgibson/bedrock,MichaelKohler/bedrock,alexgibson/bedrock,pascalchevrel/bedrock,sylvestre/bedrock,mozilla/bedrock,pascalchevrel/bedrock,MichaelKohler/bedrock,flodolo/bedrock,sylvestre/bedrock,craigcook/bedrock,craigcook/bedrock,alexgibson/bedrock,flodo... | Add tests for CDN infra
Add tests for:
* /media/* urls
* locale redirects and vary headers
* geolocation | import pytest
import requests
MLS_URL = 'https://location.services.mozilla.com/v1/country' \
'?key=ec4d0c4b-b9ac-4d72-9197-289160930e14'
@pytest.mark.parametrize('url', (
'/',
'/firefox/',
'/firefox/new/',
'/about/',
))
@pytest.mark.nondestructive
def test_locale_redirect(url, base_url):
... | <commit_before><commit_msg>Add tests for CDN infra
Add tests for:
* /media/* urls
* locale redirects and vary headers
* geolocation<commit_after> | import pytest
import requests
MLS_URL = 'https://location.services.mozilla.com/v1/country' \
'?key=ec4d0c4b-b9ac-4d72-9197-289160930e14'
@pytest.mark.parametrize('url', (
'/',
'/firefox/',
'/firefox/new/',
'/about/',
))
@pytest.mark.nondestructive
def test_locale_redirect(url, base_url):
... | Add tests for CDN infra
Add tests for:
* /media/* urls
* locale redirects and vary headers
* geolocationimport pytest
import requests
MLS_URL = 'https://location.services.mozilla.com/v1/country' \
'?key=ec4d0c4b-b9ac-4d72-9197-289160930e14'
@pytest.mark.parametrize('url', (
'/',
'/firefox/',
... | <commit_before><commit_msg>Add tests for CDN infra
Add tests for:
* /media/* urls
* locale redirects and vary headers
* geolocation<commit_after>import pytest
import requests
MLS_URL = 'https://location.services.mozilla.com/v1/country' \
'?key=ec4d0c4b-b9ac-4d72-9197-289160930e14'
@pytest.mark.parametri... | |
a2353846c97f94a23c01a51f8589cd3b8ff17376 | test/test_receiver.py | test/test_receiver.py | import os
import tempfile
import unittest
import bin.receiver
from ssm.ssm2 import Ssm2Exception
class getDNsTest(unittest.TestCase):
def setUp(self):
self.tf, self.tf_path = tempfile.mkstemp()
os.close(self.tf)
def test_empty_dns_file(self):
self.assertRaises(Ssm2Exception, bin.rece... | Add skeleton test for bin/receiver | Add skeleton test for bin/receiver
- Add skeleton test for bin/receiver so that the coverage stats become
more accurate.
| Python | apache-2.0 | tofu-rocketry/ssm,apel/ssm,tofu-rocketry/ssm,stfc/ssm,stfc/ssm,apel/ssm | Add skeleton test for bin/receiver
- Add skeleton test for bin/receiver so that the coverage stats become
more accurate. | import os
import tempfile
import unittest
import bin.receiver
from ssm.ssm2 import Ssm2Exception
class getDNsTest(unittest.TestCase):
def setUp(self):
self.tf, self.tf_path = tempfile.mkstemp()
os.close(self.tf)
def test_empty_dns_file(self):
self.assertRaises(Ssm2Exception, bin.rece... | <commit_before><commit_msg>Add skeleton test for bin/receiver
- Add skeleton test for bin/receiver so that the coverage stats become
more accurate.<commit_after> | import os
import tempfile
import unittest
import bin.receiver
from ssm.ssm2 import Ssm2Exception
class getDNsTest(unittest.TestCase):
def setUp(self):
self.tf, self.tf_path = tempfile.mkstemp()
os.close(self.tf)
def test_empty_dns_file(self):
self.assertRaises(Ssm2Exception, bin.rece... | Add skeleton test for bin/receiver
- Add skeleton test for bin/receiver so that the coverage stats become
more accurate.import os
import tempfile
import unittest
import bin.receiver
from ssm.ssm2 import Ssm2Exception
class getDNsTest(unittest.TestCase):
def setUp(self):
self.tf, self.tf_path = tempfil... | <commit_before><commit_msg>Add skeleton test for bin/receiver
- Add skeleton test for bin/receiver so that the coverage stats become
more accurate.<commit_after>import os
import tempfile
import unittest
import bin.receiver
from ssm.ssm2 import Ssm2Exception
class getDNsTest(unittest.TestCase):
def setUp(self)... | |
b9a9a684d94efe94523a4172ce0074ede906b5bc | tests/test_profiles.py | tests/test_profiles.py | import numpy as np
import unittest
from desc.io import InputReader
from desc.equilibrium import Equilibrium
from desc.profiles import PowerSeriesProfile
class TestProfiles(unittest.TestCase):
def test_same_result(self):
input_path = "examples/DESC/SOLOVEV"
ir = InputReader(input_path)
eq1... | Add tests for profile classes | Add tests for profile classes
| Python | mit | PlasmaControl/DESC,PlasmaControl/DESC | Add tests for profile classes | import numpy as np
import unittest
from desc.io import InputReader
from desc.equilibrium import Equilibrium
from desc.profiles import PowerSeriesProfile
class TestProfiles(unittest.TestCase):
def test_same_result(self):
input_path = "examples/DESC/SOLOVEV"
ir = InputReader(input_path)
eq1... | <commit_before><commit_msg>Add tests for profile classes<commit_after> | import numpy as np
import unittest
from desc.io import InputReader
from desc.equilibrium import Equilibrium
from desc.profiles import PowerSeriesProfile
class TestProfiles(unittest.TestCase):
def test_same_result(self):
input_path = "examples/DESC/SOLOVEV"
ir = InputReader(input_path)
eq1... | Add tests for profile classesimport numpy as np
import unittest
from desc.io import InputReader
from desc.equilibrium import Equilibrium
from desc.profiles import PowerSeriesProfile
class TestProfiles(unittest.TestCase):
def test_same_result(self):
input_path = "examples/DESC/SOLOVEV"
ir = InputRe... | <commit_before><commit_msg>Add tests for profile classes<commit_after>import numpy as np
import unittest
from desc.io import InputReader
from desc.equilibrium import Equilibrium
from desc.profiles import PowerSeriesProfile
class TestProfiles(unittest.TestCase):
def test_same_result(self):
input_path = "ex... | |
72c085ac3fde2a294a09b2065e1fe38a33f8841c | functest/tests/unit/features/test_odl_sfc.py | functest/tests/unit/features/test_odl_sfc.py | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for odl_sfc | Add unit tests for odl_sfc
Change-Id: I8eb037a8c2427695d42207897064b79cb2b03a5d
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com>
| Python | apache-2.0 | opnfv/functest,opnfv/functest,mywulin/functest,mywulin/functest | Add unit tests for odl_sfc
Change-Id: I8eb037a8c2427695d42207897064b79cb2b03a5d
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | <commit_before><commit_msg>Add unit tests for odl_sfc
Change-Id: I8eb037a8c2427695d42207897064b79cb2b03a5d
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com><commit_after> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for odl_sfc
Change-Id: I8eb037a8c2427695d42207897064b79cb2b03a5d
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available un... | <commit_before><commit_msg>Add unit tests for odl_sfc
Change-Id: I8eb037a8c2427695d42207897064b79cb2b03a5d
Signed-off-by: Cédric Ollivier <d48310251a4a484d041bc5d09a9ac4d86d20f793@orange.com><commit_after>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accom... | |
e069020558c53b24eb164aaaf6124130fdd2daab | shop/models/fields.py | shop/models/fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FALG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FALG = True
try:
if POSTGRES_FALG:
from django.contrib.postgres.fields import JSONField
else:
raise ImportError
except... | Add new the JSONField Wrapper | Add new the JSONField Wrapper
| Python | bsd-3-clause | divio/django-shop,nimbis/django-shop,nimbis/django-shop,jrief/django-shop,khchine5/django-shop,divio/django-shop,khchine5/django-shop,khchine5/django-shop,nimbis/django-shop,khchine5/django-shop,jrief/django-shop,awesto/django-shop,jrief/django-shop,awesto/django-shop,awesto/django-shop,nimbis/django-shop,divio/django-... | Add new the JSONField Wrapper | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FALG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FALG = True
try:
if POSTGRES_FALG:
from django.contrib.postgres.fields import JSONField
else:
raise ImportError
except... | <commit_before><commit_msg>Add new the JSONField Wrapper<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FALG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FALG = True
try:
if POSTGRES_FALG:
from django.contrib.postgres.fields import JSONField
else:
raise ImportError
except... | Add new the JSONField Wrapper# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FALG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FALG = True
try:
if POSTGRES_FALG:
from django.contrib.postgres.fields import JSONField
else:
... | <commit_before><commit_msg>Add new the JSONField Wrapper<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FALG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FALG = True
try:
if POSTGRES_FALG:
from django.contrib.postg... | |
dc4ce85a621e0ffccfa9dbf400f558333e813df4 | aids/strings/remove_duplicates.py | aids/strings/remove_duplicates.py | '''
In this module we remove duplicates in a string
'''
def remove_duplicates(string):
'''
Remove duplicated characters in string
'''
result = []
seen = set()
for char in string:
if char not in seen:
seen.add(char)
result.append(char)
return ''.join(result) | Add function to remove duplicates from a string | Add function to remove duplicates from a string
| Python | mit | ueg1990/aids | Add function to remove duplicates from a string | '''
In this module we remove duplicates in a string
'''
def remove_duplicates(string):
'''
Remove duplicated characters in string
'''
result = []
seen = set()
for char in string:
if char not in seen:
seen.add(char)
result.append(char)
return ''.join(result) | <commit_before><commit_msg>Add function to remove duplicates from a string<commit_after> | '''
In this module we remove duplicates in a string
'''
def remove_duplicates(string):
'''
Remove duplicated characters in string
'''
result = []
seen = set()
for char in string:
if char not in seen:
seen.add(char)
result.append(char)
return ''.join(result) | Add function to remove duplicates from a string'''
In this module we remove duplicates in a string
'''
def remove_duplicates(string):
'''
Remove duplicated characters in string
'''
result = []
seen = set()
for char in string:
if char not in seen:
seen.add(char)
result.... | <commit_before><commit_msg>Add function to remove duplicates from a string<commit_after>'''
In this module we remove duplicates in a string
'''
def remove_duplicates(string):
'''
Remove duplicated characters in string
'''
result = []
seen = set()
for char in string:
if char not in seen:
... | |
7f84c6914182cd83192661dfe165fad9c59014ef | indra/tests/test_grounding_resources.py | indra/tests/test_grounding_resources.py | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions ... | Add tests to check validity of gmap and misg_map | Add tests to check validity of gmap and misg_map
| Python | bsd-2-clause | johnbachman/indra,sorgerlab/belpy,johnbachman/indra,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/indra,johnbachman/indra | Add tests to check validity of gmap and misg_map | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions ... | <commit_before><commit_msg>Add tests to check validity of gmap and misg_map<commit_after> | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions ... | Add tests to check validity of gmap and misg_mapimport os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently ha... | <commit_before><commit_msg>Add tests to check validity of gmap and misg_map<commit_after>import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map... | |
8b8208a5a4790b199d0f35ca834f0982788c99c1 | ConnectTor.py | ConnectTor.py | #!/usr/bin/python
import urllib, urllib2
import socks
import socket
import sys
import commands
# Connect Tor Network
def GET_MY_IP_Address():
return commands.getoutput("/sbin/ifconfig").split("\n")[1].split(':')[1].split(" ")[0]
def Connect_Tor():
while True:
try:
token = 1
socks.setde... | Connect Tor Network with Python | Connect Tor Network with Python
Connect Tor Network with Python
1. apt-get install tor
2. apt-get install privoxy
(we need to edit our privoxy config (/etc/privoxy/config) and add the
following line -> forward-socks4a / localhost:9050 .)
3. Start tor & privoxy service
( service tor privoxy start)
| Python | mit | namegpark/Tor-Network-Connection | Connect Tor Network with Python
Connect Tor Network with Python
1. apt-get install tor
2. apt-get install privoxy
(we need to edit our privoxy config (/etc/privoxy/config) and add the
following line -> forward-socks4a / localhost:9050 .)
3. Start tor & privoxy service
( service tor privoxy start) | #!/usr/bin/python
import urllib, urllib2
import socks
import socket
import sys
import commands
# Connect Tor Network
def GET_MY_IP_Address():
return commands.getoutput("/sbin/ifconfig").split("\n")[1].split(':')[1].split(" ")[0]
def Connect_Tor():
while True:
try:
token = 1
socks.setde... | <commit_before><commit_msg>Connect Tor Network with Python
Connect Tor Network with Python
1. apt-get install tor
2. apt-get install privoxy
(we need to edit our privoxy config (/etc/privoxy/config) and add the
following line -> forward-socks4a / localhost:9050 .)
3. Start tor & privoxy service
( service tor privoxy ... | #!/usr/bin/python
import urllib, urllib2
import socks
import socket
import sys
import commands
# Connect Tor Network
def GET_MY_IP_Address():
return commands.getoutput("/sbin/ifconfig").split("\n")[1].split(':')[1].split(" ")[0]
def Connect_Tor():
while True:
try:
token = 1
socks.setde... | Connect Tor Network with Python
Connect Tor Network with Python
1. apt-get install tor
2. apt-get install privoxy
(we need to edit our privoxy config (/etc/privoxy/config) and add the
following line -> forward-socks4a / localhost:9050 .)
3. Start tor & privoxy service
( service tor privoxy start)#!/usr/bin/python
... | <commit_before><commit_msg>Connect Tor Network with Python
Connect Tor Network with Python
1. apt-get install tor
2. apt-get install privoxy
(we need to edit our privoxy config (/etc/privoxy/config) and add the
following line -> forward-socks4a / localhost:9050 .)
3. Start tor & privoxy service
( service tor privoxy ... | |
4cf8ae2ab95e9c7ed1a091532f12a4211f7580b7 | textingtree.py | textingtree.py | import os
import requests
import tinycss2
from tinycss2 import color3
from flask import Flask, Response, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def merry_christmas():
return 'Merry Christmas!'
@app.route('/sms', methods=['POST'])
def sms():
body = request.values.get('Body', None)
... | Add application code with SMS route to accept SMS and route to Spark Core via their API | Add application code with SMS route to accept SMS and route to Spark Core via their API
| Python | mit | willdages/The-Texting-Tree | Add application code with SMS route to accept SMS and route to Spark Core via their API | import os
import requests
import tinycss2
from tinycss2 import color3
from flask import Flask, Response, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def merry_christmas():
return 'Merry Christmas!'
@app.route('/sms', methods=['POST'])
def sms():
body = request.values.get('Body', None)
... | <commit_before><commit_msg>Add application code with SMS route to accept SMS and route to Spark Core via their API<commit_after> | import os
import requests
import tinycss2
from tinycss2 import color3
from flask import Flask, Response, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def merry_christmas():
return 'Merry Christmas!'
@app.route('/sms', methods=['POST'])
def sms():
body = request.values.get('Body', None)
... | Add application code with SMS route to accept SMS and route to Spark Core via their APIimport os
import requests
import tinycss2
from tinycss2 import color3
from flask import Flask, Response, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def merry_christmas():
return 'Merry Christmas!'
@app.route... | <commit_before><commit_msg>Add application code with SMS route to accept SMS and route to Spark Core via their API<commit_after>import os
import requests
import tinycss2
from tinycss2 import color3
from flask import Flask, Response, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def merry_christmas():... | |
bbaddeed4cc57af287b61ec79e74e5061c1b2e84 | app/segment.py | app/segment.py | class Segment:
'''A representation of a phonetic segment, stored in terms of features.'''
def __init__(self, positive, negative):
self._positive = positive
self._negative = negative
@classmethod
def from_dictionary(cls, feature_dictionary):
'''Initialise the segment from a dict... | Create Segment class with positive and negative properties | Create Segment class with positive and negative properties
| Python | mit | kdelwat/LangEvolve,kdelwat/LangEvolve,kdelwat/LangEvolve | Create Segment class with positive and negative properties | class Segment:
'''A representation of a phonetic segment, stored in terms of features.'''
def __init__(self, positive, negative):
self._positive = positive
self._negative = negative
@classmethod
def from_dictionary(cls, feature_dictionary):
'''Initialise the segment from a dict... | <commit_before><commit_msg>Create Segment class with positive and negative properties<commit_after> | class Segment:
'''A representation of a phonetic segment, stored in terms of features.'''
def __init__(self, positive, negative):
self._positive = positive
self._negative = negative
@classmethod
def from_dictionary(cls, feature_dictionary):
'''Initialise the segment from a dict... | Create Segment class with positive and negative propertiesclass Segment:
'''A representation of a phonetic segment, stored in terms of features.'''
def __init__(self, positive, negative):
self._positive = positive
self._negative = negative
@classmethod
def from_dictionary(cls, feature_... | <commit_before><commit_msg>Create Segment class with positive and negative properties<commit_after>class Segment:
'''A representation of a phonetic segment, stored in terms of features.'''
def __init__(self, positive, negative):
self._positive = positive
self._negative = negative
@classmet... | |
1637f26fc9ee852e0eda33056bca7dd442e0df05 | data.py | data.py | from twitter import *
#Put in token, token_key, con_secret, con_secret_key
t = Twitter(
auth=OAuth('', '',
'', ''))
#get user status
print(t.statuses.user_timeline(screen_name="AndrewKLeech"))
| Access twitter, get user info | Access twitter, get user info
| Python | mit | AndrewKLeech/Pip-Boy | Access twitter, get user info | from twitter import *
#Put in token, token_key, con_secret, con_secret_key
t = Twitter(
auth=OAuth('', '',
'', ''))
#get user status
print(t.statuses.user_timeline(screen_name="AndrewKLeech"))
| <commit_before><commit_msg>Access twitter, get user info<commit_after> | from twitter import *
#Put in token, token_key, con_secret, con_secret_key
t = Twitter(
auth=OAuth('', '',
'', ''))
#get user status
print(t.statuses.user_timeline(screen_name="AndrewKLeech"))
| Access twitter, get user infofrom twitter import *
#Put in token, token_key, con_secret, con_secret_key
t = Twitter(
auth=OAuth('', '',
'', ''))
#get user status
print(t.statuses.user_timeline(screen_name="AndrewKLeech"))
| <commit_before><commit_msg>Access twitter, get user info<commit_after>from twitter import *
#Put in token, token_key, con_secret, con_secret_key
t = Twitter(
auth=OAuth('', '',
'', ''))
#get user status
print(t.statuses.user_timeline(screen_name="AndrewKLeech"))
| |
4f7b2096da44b17abc3f8cac77e40bee527b48aa | algorithms/140_word_break_ii.py | algorithms/140_word_break_ii.py | #!/usr/bin/env python
#
# Given a string s and a dictionary of words dict, add spaces in s to construct
# a sentence where each word is a valid dictionary word. Return all such possible
# sentences.
#
# LeetCode Runtime: 44 ms (beats 100% of Python coders)
# Author: oleg@osv.im
import sys
class Solution(object):
... | Add 140: Word Break II | Add 140: Word Break II
| Python | apache-2.0 | ovaskevich/leetcode,ovaskevich/leetcode | Add 140: Word Break II | #!/usr/bin/env python
#
# Given a string s and a dictionary of words dict, add spaces in s to construct
# a sentence where each word is a valid dictionary word. Return all such possible
# sentences.
#
# LeetCode Runtime: 44 ms (beats 100% of Python coders)
# Author: oleg@osv.im
import sys
class Solution(object):
... | <commit_before><commit_msg>Add 140: Word Break II<commit_after> | #!/usr/bin/env python
#
# Given a string s and a dictionary of words dict, add spaces in s to construct
# a sentence where each word is a valid dictionary word. Return all such possible
# sentences.
#
# LeetCode Runtime: 44 ms (beats 100% of Python coders)
# Author: oleg@osv.im
import sys
class Solution(object):
... | Add 140: Word Break II#!/usr/bin/env python
#
# Given a string s and a dictionary of words dict, add spaces in s to construct
# a sentence where each word is a valid dictionary word. Return all such possible
# sentences.
#
# LeetCode Runtime: 44 ms (beats 100% of Python coders)
# Author: oleg@osv.im
import sys
class ... | <commit_before><commit_msg>Add 140: Word Break II<commit_after>#!/usr/bin/env python
#
# Given a string s and a dictionary of words dict, add spaces in s to construct
# a sentence where each word is a valid dictionary word. Return all such possible
# sentences.
#
# LeetCode Runtime: 44 ms (beats 100% of Python coders)
... | |
ffe2b546218bce0f03ac09736b89c5b098a2c0f1 | tests/test_eccodes.py | tests/test_eccodes.py | import os.path
import numpy as np
import pytest
from eccodes import *
SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), 'sample-data')
TEST_DATA = os.path.join(SAMPLE_DATA_FOLDER, 'era5-levels-members.grib')
# GRIB
def test_grib_read():
gid = codes_grib_new_from_samples('regular_ll_sfc_grib1')
as... | Add tests for basic functionality | Add tests for basic functionality
| Python | apache-2.0 | ecmwf/eccodes-python,ecmwf/eccodes-python | Add tests for basic functionality | import os.path
import numpy as np
import pytest
from eccodes import *
SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), 'sample-data')
TEST_DATA = os.path.join(SAMPLE_DATA_FOLDER, 'era5-levels-members.grib')
# GRIB
def test_grib_read():
gid = codes_grib_new_from_samples('regular_ll_sfc_grib1')
as... | <commit_before><commit_msg>Add tests for basic functionality<commit_after> | import os.path
import numpy as np
import pytest
from eccodes import *
SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), 'sample-data')
TEST_DATA = os.path.join(SAMPLE_DATA_FOLDER, 'era5-levels-members.grib')
# GRIB
def test_grib_read():
gid = codes_grib_new_from_samples('regular_ll_sfc_grib1')
as... | Add tests for basic functionalityimport os.path
import numpy as np
import pytest
from eccodes import *
SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), 'sample-data')
TEST_DATA = os.path.join(SAMPLE_DATA_FOLDER, 'era5-levels-members.grib')
# GRIB
def test_grib_read():
gid = codes_grib_new_from_sampl... | <commit_before><commit_msg>Add tests for basic functionality<commit_after>import os.path
import numpy as np
import pytest
from eccodes import *
SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), 'sample-data')
TEST_DATA = os.path.join(SAMPLE_DATA_FOLDER, 'era5-levels-members.grib')
# GRIB
def test_grib_re... | |
59917abe1c07dd92636e3f00f74a9e9a95947f0f | lowfat/migrations/0150_update_default_year.py | lowfat/migrations/0150_update_default_year.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-23 09:39
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0149_add_fund_approval_chain'),
]
operations = [
... | Update default year in migrations | Update default year in migrations
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | Update default year in migrations | # -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-23 09:39
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0149_add_fund_approval_chain'),
]
operations = [
... | <commit_before><commit_msg>Update default year in migrations<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-23 09:39
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0149_add_fund_approval_chain'),
]
operations = [
... | Update default year in migrations# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-23 09:39
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0149_add_fund_approval_chain'),
... | <commit_before><commit_msg>Update default year in migrations<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-23 09:39
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('l... | |
9732f5e1bb667b6683c9e97db03d293373909da6 | tests/test_process.py | tests/test_process.py | import unittest
import logging
import time
from util import get_hostname
from tests.common import load_check
from nose.plugins.attrib import attr
logging.basicConfig()
@attr('process')
class ProcessTestCase(unittest.TestCase):
def build_config(self, config, n):
critical_low = [2, 2, 2, -1, 2, -2, 2]
... | Add tests for process check | Add tests for process check
This test call the check method in process 7 times and check the process_check
output. The result should be:
1 OK
2 WARNING
4 CRITICAL
| Python | bsd-3-clause | jraede/dd-agent,benmccann/dd-agent,packetloop/dd-agent,PagerDuty/dd-agent,benmccann/dd-agent,truthbk/dd-agent,jshum/dd-agent,citrusleaf/dd-agent,gphat/dd-agent,AniruddhaSAtre/dd-agent,AniruddhaSAtre/dd-agent,jvassev/dd-agent,urosgruber/dd-agent,jraede/dd-agent,Mashape/dd-agent,huhongbo/dd-agent,oneandoneis2/dd-agent,br... | Add tests for process check
This test call the check method in process 7 times and check the process_check
output. The result should be:
1 OK
2 WARNING
4 CRITICAL | import unittest
import logging
import time
from util import get_hostname
from tests.common import load_check
from nose.plugins.attrib import attr
logging.basicConfig()
@attr('process')
class ProcessTestCase(unittest.TestCase):
def build_config(self, config, n):
critical_low = [2, 2, 2, -1, 2, -2, 2]
... | <commit_before><commit_msg>Add tests for process check
This test call the check method in process 7 times and check the process_check
output. The result should be:
1 OK
2 WARNING
4 CRITICAL<commit_after> | import unittest
import logging
import time
from util import get_hostname
from tests.common import load_check
from nose.plugins.attrib import attr
logging.basicConfig()
@attr('process')
class ProcessTestCase(unittest.TestCase):
def build_config(self, config, n):
critical_low = [2, 2, 2, -1, 2, -2, 2]
... | Add tests for process check
This test call the check method in process 7 times and check the process_check
output. The result should be:
1 OK
2 WARNING
4 CRITICALimport unittest
import logging
import time
from util import get_hostname
from tests.common import load_check
from nose.plugins.attrib import attr
logging.ba... | <commit_before><commit_msg>Add tests for process check
This test call the check method in process 7 times and check the process_check
output. The result should be:
1 OK
2 WARNING
4 CRITICAL<commit_after>import unittest
import logging
import time
from util import get_hostname
from tests.common import load_check
from n... | |
9247d831dfa8ea5b11f870bf3ad75951b8b16891 | bvspca/animals/wagtail_hooks.py | bvspca/animals/wagtail_hooks.py | from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from bvspca.animals.models import Animal
class AnimalModelAdmin(ModelAdmin):
model = Animal
menu_label = 'Animals'
menu_icon = 'fa-paw'
menu_order = 100
add_to_settings_menu = False
list_display = ('title', 'petpoi... | Add modeladmin entry for animals | Add modeladmin entry for animals
| Python | mit | nfletton/bvspca,nfletton/bvspca,nfletton/bvspca,nfletton/bvspca | Add modeladmin entry for animals | from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from bvspca.animals.models import Animal
class AnimalModelAdmin(ModelAdmin):
model = Animal
menu_label = 'Animals'
menu_icon = 'fa-paw'
menu_order = 100
add_to_settings_menu = False
list_display = ('title', 'petpoi... | <commit_before><commit_msg>Add modeladmin entry for animals<commit_after> | from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from bvspca.animals.models import Animal
class AnimalModelAdmin(ModelAdmin):
model = Animal
menu_label = 'Animals'
menu_icon = 'fa-paw'
menu_order = 100
add_to_settings_menu = False
list_display = ('title', 'petpoi... | Add modeladmin entry for animalsfrom wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from bvspca.animals.models import Animal
class AnimalModelAdmin(ModelAdmin):
model = Animal
menu_label = 'Animals'
menu_icon = 'fa-paw'
menu_order = 100
add_to_settings_menu = False
... | <commit_before><commit_msg>Add modeladmin entry for animals<commit_after>from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from bvspca.animals.models import Animal
class AnimalModelAdmin(ModelAdmin):
model = Animal
menu_label = 'Animals'
menu_icon = 'fa-paw'
menu_order = ... | |
1f5b624e7fac4883f8a86305364f55af0703bb32 | images/minimal/ipython_notebook_config.py | images/minimal/ipython_notebook_config.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# For headerssent by the upstream reverse proxy... | Set up an IPython config for the minimal image | Set up an IPython config for the minimal image
| Python | bsd-3-clause | ianabc/tmpnb,zischwartz/tmpnb,captainsafia/tmpnb,zischwartz/tmpnb,malev/tmpnb,parente/tmpnb,malev/tmpnb,iamjakob/tmpnb,rgbkrk/tmpnb,betatim/tmpnb,jupyter/tmpnb,cannin/tmpnb,captainsafia/tmpnb,willjharmer/tmpnb,captainsafia/tmpnb,marscher/tmpnb,parente/tmpnb,ianabc/tmpnb,jupyter/tmpnb,cannin/tmpnb,willjharmer/tmpnb,beta... | Set up an IPython config for the minimal image | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# For headerssent by the upstream reverse proxy... | <commit_before><commit_msg>Set up an IPython config for the minimal image<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# For headerssent by the upstream reverse proxy... | Set up an IPython config for the minimal image#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
#... | <commit_before><commit_msg>Set up an IPython config for the minimal image<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-For... | |
11aac46ef2e3fc867e1879ae8e7bc77e5e0aedc2 | test/session_lock_test.py | test/session_lock_test.py | from infiniteworld import SessionLockLost, MCInfdevOldLevel
from templevel import TempLevel
import unittest
class SessionLockTest(unittest.TestCase):
def test_session_lock(self):
temp = TempLevel("AnvilWorld")
level = temp.level
level2 = MCInfdevOldLevel(level.filename)
def touch():... | Add quick test for session locks. | Tests: Add quick test for session locks.
| Python | isc | mcedit/pymclevel,arruda/pymclevel,ahh2131/mchisel,mcedit/pymclevel,arruda/pymclevel,ahh2131/mchisel | Tests: Add quick test for session locks. | from infiniteworld import SessionLockLost, MCInfdevOldLevel
from templevel import TempLevel
import unittest
class SessionLockTest(unittest.TestCase):
def test_session_lock(self):
temp = TempLevel("AnvilWorld")
level = temp.level
level2 = MCInfdevOldLevel(level.filename)
def touch():... | <commit_before><commit_msg>Tests: Add quick test for session locks.<commit_after> | from infiniteworld import SessionLockLost, MCInfdevOldLevel
from templevel import TempLevel
import unittest
class SessionLockTest(unittest.TestCase):
def test_session_lock(self):
temp = TempLevel("AnvilWorld")
level = temp.level
level2 = MCInfdevOldLevel(level.filename)
def touch():... | Tests: Add quick test for session locks.from infiniteworld import SessionLockLost, MCInfdevOldLevel
from templevel import TempLevel
import unittest
class SessionLockTest(unittest.TestCase):
def test_session_lock(self):
temp = TempLevel("AnvilWorld")
level = temp.level
level2 = MCInfdevOldLe... | <commit_before><commit_msg>Tests: Add quick test for session locks.<commit_after>from infiniteworld import SessionLockLost, MCInfdevOldLevel
from templevel import TempLevel
import unittest
class SessionLockTest(unittest.TestCase):
def test_session_lock(self):
temp = TempLevel("AnvilWorld")
level = ... | |
92f41cf20097de534d8ffe8e85cd29f9e292946e | utils/sort_score_files.py | utils/sort_score_files.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import argparse
import json
import math
import numpy as np
import operator
def parse_json_file(json_file_path):
with open(json_file_path, "r") as fd:
json_data = json.load(fd)
return json_dat... | Add a script to sort score files according to their mean scores. | Add a script to sort score files according to their mean scores.
| Python | mit | jdhp-sap/data-pipeline-standalone-scripts,jdhp-sap/sap-cta-data-pipeline,jdhp-sap/data-pipeline-standalone-scripts,jdhp-sap/sap-cta-data-pipeline | Add a script to sort score files according to their mean scores. | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import argparse
import json
import math
import numpy as np
import operator
def parse_json_file(json_file_path):
with open(json_file_path, "r") as fd:
json_data = json.load(fd)
return json_dat... | <commit_before><commit_msg>Add a script to sort score files according to their mean scores.<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import argparse
import json
import math
import numpy as np
import operator
def parse_json_file(json_file_path):
with open(json_file_path, "r") as fd:
json_data = json.load(fd)
return json_dat... | Add a script to sort score files according to their mean scores.#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import argparse
import json
import math
import numpy as np
import operator
def parse_json_file(json_file_path):
with open(json_file_path, "... | <commit_before><commit_msg>Add a script to sort score files according to their mean scores.<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import argparse
import json
import math
import numpy as np
import operator
def parse_json_file(json_fi... | |
31a9789668e9de589f8a4a181b01733c1854e97d | src/people/management/commands/draw_people.py | src/people/management/commands/draw_people.py | import sys
import argparse
import csv
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from people.models import Person
class Command(BaseCommand):
help = "Draw people at random amongst people who volunteered for it, while ensuring parity between women/men" \
... | Add command to draw people | Add command to draw people
| Python | agpl-3.0 | lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django | Add command to draw people | import sys
import argparse
import csv
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from people.models import Person
class Command(BaseCommand):
help = "Draw people at random amongst people who volunteered for it, while ensuring parity between women/men" \
... | <commit_before><commit_msg>Add command to draw people<commit_after> | import sys
import argparse
import csv
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from people.models import Person
class Command(BaseCommand):
help = "Draw people at random amongst people who volunteered for it, while ensuring parity between women/men" \
... | Add command to draw peopleimport sys
import argparse
import csv
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from people.models import Person
class Command(BaseCommand):
help = "Draw people at random amongst people who volunteered for it, while ensuring par... | <commit_before><commit_msg>Add command to draw people<commit_after>import sys
import argparse
import csv
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from people.models import Person
class Command(BaseCommand):
help = "Draw people at random amongst people w... | |
aef53625ebedd9e2af7676014910e8a98de46f96 | crowdgezwitscher/twitter/migrations/0007_auto_20180121_2232.py | crowdgezwitscher/twitter/migrations/0007_auto_20180121_2232.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-01-21 22:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('twitter', '0006_auto_20170408_2226'),
]
operations = [
... | Add (forgotten) migration for Twitter model changes. | Add (forgotten) migration for Twitter model changes.
| Python | mit | Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher | Add (forgotten) migration for Twitter model changes. | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-01-21 22:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('twitter', '0006_auto_20170408_2226'),
]
operations = [
... | <commit_before><commit_msg>Add (forgotten) migration for Twitter model changes.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-01-21 22:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('twitter', '0006_auto_20170408_2226'),
]
operations = [
... | Add (forgotten) migration for Twitter model changes.# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-01-21 22:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('twitter', '00... | <commit_before><commit_msg>Add (forgotten) migration for Twitter model changes.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-01-21 22:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
... | |
495c922c221125bc86ca8a75b03e8c8738c41a7f | test/command_line/tst_hot_pixel_mask_to_xy.py | test/command_line/tst_hot_pixel_mask_to_xy.py | from __future__ import division
import os
import libtbx.load_env
from libtbx import easy_run
have_dials_regression = libtbx.env.has_module("dials_regression")
if have_dials_regression:
dials_regression = libtbx.env.find_in_repositories(
relative_path="dials_regression",
test=os.path.isdir)
def exercise_hot... | Test for jiffy to get hot pixel coordinates as x, y | Test for jiffy to get hot pixel coordinates as x, y
| Python | bsd-3-clause | dials/dials,dials/dials,dials/dials,dials/dials,dials/dials | Test for jiffy to get hot pixel coordinates as x, y | from __future__ import division
import os
import libtbx.load_env
from libtbx import easy_run
have_dials_regression = libtbx.env.has_module("dials_regression")
if have_dials_regression:
dials_regression = libtbx.env.find_in_repositories(
relative_path="dials_regression",
test=os.path.isdir)
def exercise_hot... | <commit_before><commit_msg>Test for jiffy to get hot pixel coordinates as x, y<commit_after> | from __future__ import division
import os
import libtbx.load_env
from libtbx import easy_run
have_dials_regression = libtbx.env.has_module("dials_regression")
if have_dials_regression:
dials_regression = libtbx.env.find_in_repositories(
relative_path="dials_regression",
test=os.path.isdir)
def exercise_hot... | Test for jiffy to get hot pixel coordinates as x, yfrom __future__ import division
import os
import libtbx.load_env
from libtbx import easy_run
have_dials_regression = libtbx.env.has_module("dials_regression")
if have_dials_regression:
dials_regression = libtbx.env.find_in_repositories(
relative_path="dials_regr... | <commit_before><commit_msg>Test for jiffy to get hot pixel coordinates as x, y<commit_after>from __future__ import division
import os
import libtbx.load_env
from libtbx import easy_run
have_dials_regression = libtbx.env.has_module("dials_regression")
if have_dials_regression:
dials_regression = libtbx.env.find_in_re... | |
a590e100a23a0c225467b34b7c4481ece45905ad | tests/test_shells/postproc.py | tests/test_shells/postproc.py | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['USER']
with cod... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['USER']
with cod... | Fix functional shell tests in travis | Fix functional shell tests in travis
Hostname in travis contains random numbers meaning that it occasionally may
contain a PID as well. Thus it must be replaced first. | Python | mit | Liangjianghao/powerline,bartvm/powerline,lukw00/powerline,kenrachynski/powerline,Luffin/powerline,DoctorJellyface/powerline,Luffin/powerline,areteix/powerline,cyrixhero/powerline,seanfisk/powerline,EricSB/powerline,dragon788/powerline,blindFS/powerline,magus424/powerline,wfscheper/powerline,dragon788/powerline,wfschepe... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['USER']
with cod... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['USER']
with cod... | <commit_before>#!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['U... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['USER']
with cod... | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['USER']
with cod... | <commit_before>#!/usr/bin/env python
from __future__ import unicode_literals
import os
import socket
import sys
import codecs
fname = sys.argv[1]
new_fname = fname + '.new'
pid_fname = 'tests/shell/3rd/pid'
with open(pid_fname, 'r') as P:
pid = P.read().strip()
hostname = socket.gethostname()
user = os.environ['U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.