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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7eed63eb800804d74ccf63e26037495f8858fc67 | migrations/versions/0354_government_channel.py | migrations/versions/0354_government_channel.py | """
Revision ID: 0354_government_channel
Revises: 0353_broadcast_provider_not_null
Create Date: 2021-05-11 16:17:12.479191
"""
from alembic import op
revision = '0354_government_channel'
down_revision = '0353_broadcast_provider_not_null'
def upgrade():
op.execute("INSERT INTO broadcast_channel_types VALUES ('g... | Add 'government' to broadcast_channel_types table | Add 'government' to broadcast_channel_types table
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add 'government' to broadcast_channel_types table | """
Revision ID: 0354_government_channel
Revises: 0353_broadcast_provider_not_null
Create Date: 2021-05-11 16:17:12.479191
"""
from alembic import op
revision = '0354_government_channel'
down_revision = '0353_broadcast_provider_not_null'
def upgrade():
op.execute("INSERT INTO broadcast_channel_types VALUES ('g... | <commit_before><commit_msg>Add 'government' to broadcast_channel_types table<commit_after> | """
Revision ID: 0354_government_channel
Revises: 0353_broadcast_provider_not_null
Create Date: 2021-05-11 16:17:12.479191
"""
from alembic import op
revision = '0354_government_channel'
down_revision = '0353_broadcast_provider_not_null'
def upgrade():
op.execute("INSERT INTO broadcast_channel_types VALUES ('g... | Add 'government' to broadcast_channel_types table"""
Revision ID: 0354_government_channel
Revises: 0353_broadcast_provider_not_null
Create Date: 2021-05-11 16:17:12.479191
"""
from alembic import op
revision = '0354_government_channel'
down_revision = '0353_broadcast_provider_not_null'
def upgrade():
op.execut... | <commit_before><commit_msg>Add 'government' to broadcast_channel_types table<commit_after>"""
Revision ID: 0354_government_channel
Revises: 0353_broadcast_provider_not_null
Create Date: 2021-05-11 16:17:12.479191
"""
from alembic import op
revision = '0354_government_channel'
down_revision = '0353_broadcast_provider... | |
37222a8ad9c5a9b5bf1753ce35dfce28caba0a5a | py/reverse-words-in-a-string-iii.py | py/reverse-words-in-a-string-iii.py | class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
return ' '.join([x[::-1] for x in s.split(' ')])
| Add py solution for 557. Reverse Words in a String III | Add py solution for 557. Reverse Words in a String III
557. Reverse Words in a String III: https://leetcode.com/problems/reverse-words-in-a-string-iii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 557. Reverse Words in a String III
557. Reverse Words in a String III: https://leetcode.com/problems/reverse-words-in-a-string-iii/ | class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
return ' '.join([x[::-1] for x in s.split(' ')])
| <commit_before><commit_msg>Add py solution for 557. Reverse Words in a String III
557. Reverse Words in a String III: https://leetcode.com/problems/reverse-words-in-a-string-iii/<commit_after> | class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
return ' '.join([x[::-1] for x in s.split(' ')])
| Add py solution for 557. Reverse Words in a String III
557. Reverse Words in a String III: https://leetcode.com/problems/reverse-words-in-a-string-iii/class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
return ' '.join([x[::-1] for x in s.spli... | <commit_before><commit_msg>Add py solution for 557. Reverse Words in a String III
557. Reverse Words in a String III: https://leetcode.com/problems/reverse-words-in-a-string-iii/<commit_after>class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
... | |
12dadc417173d1e70a2f4d9b6817b505fd47679b | test/test_network_service.py | test/test_network_service.py | import uuid
from test.helpers import ProviderTestBase
import test.helpers as helpers
class CloudNetworkServiceTestCase(ProviderTestBase):
def __init__(self, methodName, provider):
super(CloudNetworkServiceTestCase, self).__init__(
methodName=methodName, provider=provider)
def test_crud_... | Add tests for Network service | Add tests for Network service
| Python | mit | ms-azure-cloudbroker/cloudbridge,gvlproject/libcloudbridge,gvlproject/cloudbridge | Add tests for Network service | import uuid
from test.helpers import ProviderTestBase
import test.helpers as helpers
class CloudNetworkServiceTestCase(ProviderTestBase):
def __init__(self, methodName, provider):
super(CloudNetworkServiceTestCase, self).__init__(
methodName=methodName, provider=provider)
def test_crud_... | <commit_before><commit_msg>Add tests for Network service<commit_after> | import uuid
from test.helpers import ProviderTestBase
import test.helpers as helpers
class CloudNetworkServiceTestCase(ProviderTestBase):
def __init__(self, methodName, provider):
super(CloudNetworkServiceTestCase, self).__init__(
methodName=methodName, provider=provider)
def test_crud_... | Add tests for Network serviceimport uuid
from test.helpers import ProviderTestBase
import test.helpers as helpers
class CloudNetworkServiceTestCase(ProviderTestBase):
def __init__(self, methodName, provider):
super(CloudNetworkServiceTestCase, self).__init__(
methodName=methodName, provider=... | <commit_before><commit_msg>Add tests for Network service<commit_after>import uuid
from test.helpers import ProviderTestBase
import test.helpers as helpers
class CloudNetworkServiceTestCase(ProviderTestBase):
def __init__(self, methodName, provider):
super(CloudNetworkServiceTestCase, self).__init__(
... | |
ab9195f85c4cc4b06a41f616be37dba546579abb | results/table-helmholtz-reductions.py | results/table-helmholtz-reductions.py | import os
import sys
import pandas as pd
p4_data = "helmholtz-results/helmholtz_conv-d-4.csv"
p5_data = "helmholtz-results/helmholtz_conv-d-5.csv"
p6_data = "helmholtz-results/helmholtz_conv-d-6.csv"
p7_data = "helmholtz-results/helmholtz_conv-d-7.csv"
data_set = [p4_data, p5_data, p6_data, p7_data]
for data in dat... | Add script for helmholtz residual reductions table | Add script for helmholtz residual reductions table
| Python | mit | thomasgibson/tabula-rasa | Add script for helmholtz residual reductions table | import os
import sys
import pandas as pd
p4_data = "helmholtz-results/helmholtz_conv-d-4.csv"
p5_data = "helmholtz-results/helmholtz_conv-d-5.csv"
p6_data = "helmholtz-results/helmholtz_conv-d-6.csv"
p7_data = "helmholtz-results/helmholtz_conv-d-7.csv"
data_set = [p4_data, p5_data, p6_data, p7_data]
for data in dat... | <commit_before><commit_msg>Add script for helmholtz residual reductions table<commit_after> | import os
import sys
import pandas as pd
p4_data = "helmholtz-results/helmholtz_conv-d-4.csv"
p5_data = "helmholtz-results/helmholtz_conv-d-5.csv"
p6_data = "helmholtz-results/helmholtz_conv-d-6.csv"
p7_data = "helmholtz-results/helmholtz_conv-d-7.csv"
data_set = [p4_data, p5_data, p6_data, p7_data]
for data in dat... | Add script for helmholtz residual reductions tableimport os
import sys
import pandas as pd
p4_data = "helmholtz-results/helmholtz_conv-d-4.csv"
p5_data = "helmholtz-results/helmholtz_conv-d-5.csv"
p6_data = "helmholtz-results/helmholtz_conv-d-6.csv"
p7_data = "helmholtz-results/helmholtz_conv-d-7.csv"
data_set = [p4_... | <commit_before><commit_msg>Add script for helmholtz residual reductions table<commit_after>import os
import sys
import pandas as pd
p4_data = "helmholtz-results/helmholtz_conv-d-4.csv"
p5_data = "helmholtz-results/helmholtz_conv-d-5.csv"
p6_data = "helmholtz-results/helmholtz_conv-d-6.csv"
p7_data = "helmholtz-result... | |
a191377b3490f0f3b14e1cbddda990fa7a73a6e0 | tools/convert_v1_net_data.py | tools/convert_v1_net_data.py | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | Add tool to convert net-data from v1 to v2 | Add tool to convert net-data from v1 to v2
This new tool will convert the old v1 net-data format to v2. This tool
will create a backup of the older net-data file so that its possible to
recover data should anything go wrong in the conversion. Upon completion
the tool will create the v2 file using the existing file for... | Python | apache-2.0 | openstack/tripleo-heat-templates,openstack/tripleo-heat-templates | Add tool to convert net-data from v1 to v2
This new tool will convert the old v1 net-data format to v2. This tool
will create a backup of the older net-data file so that its possible to
recover data should anything go wrong in the conversion. Upon completion
the tool will create the v2 file using the existing file for... | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | <commit_before><commit_msg>Add tool to convert net-data from v1 to v2
This new tool will convert the old v1 net-data format to v2. This tool
will create a backup of the older net-data file so that its possible to
recover data should anything go wrong in the conversion. Upon completion
the tool will create the v2 file ... | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | Add tool to convert net-data from v1 to v2
This new tool will convert the old v1 net-data format to v2. This tool
will create a backup of the older net-data file so that its possible to
recover data should anything go wrong in the conversion. Upon completion
the tool will create the v2 file using the existing file for... | <commit_before><commit_msg>Add tool to convert net-data from v1 to v2
This new tool will convert the old v1 net-data format to v2. This tool
will create a backup of the older net-data file so that its possible to
recover data should anything go wrong in the conversion. Upon completion
the tool will create the v2 file ... | |
7f60ca7163c2448b363b349ee4fbcc6abf19336c | utilities/update_language.py | utilities/update_language.py | # utilities.update_language
# This language utility updates an existing Bible data file for the given
# language (using existing data, such as default version, to recreate the data
# file)
from __future__ import unicode_literals
import argparse
import yvs.shared as shared
from operator import itemgetter
from add_lang... | Add utility for updating existing language file | Add utility for updating existing language file
| Python | mit | caleb531/youversion-suggest,caleb531/youversion-suggest | Add utility for updating existing language file | # utilities.update_language
# This language utility updates an existing Bible data file for the given
# language (using existing data, such as default version, to recreate the data
# file)
from __future__ import unicode_literals
import argparse
import yvs.shared as shared
from operator import itemgetter
from add_lang... | <commit_before><commit_msg>Add utility for updating existing language file<commit_after> | # utilities.update_language
# This language utility updates an existing Bible data file for the given
# language (using existing data, such as default version, to recreate the data
# file)
from __future__ import unicode_literals
import argparse
import yvs.shared as shared
from operator import itemgetter
from add_lang... | Add utility for updating existing language file# utilities.update_language
# This language utility updates an existing Bible data file for the given
# language (using existing data, such as default version, to recreate the data
# file)
from __future__ import unicode_literals
import argparse
import yvs.shared as share... | <commit_before><commit_msg>Add utility for updating existing language file<commit_after># utilities.update_language
# This language utility updates an existing Bible data file for the given
# language (using existing data, such as default version, to recreate the data
# file)
from __future__ import unicode_literals
i... | |
b540a1ebc6b389c1be6cba2bb6b01836ad517d6c | py/replace-words.py | py/replace-words.py | from collections import defaultdict
class Node(object):
def __init__(self):
self.children = defaultdict(Node)
self.end = False
class Solution(object):
def replaceWords(self, dict, sentence):
"""
:type dict: List[str]
:type sentence: str
:rtype: str
"""
... | Add py solution for 648. Replace Words | Add py solution for 648. Replace Words
648. Replace Words: https://leetcode.com/problems/replace-words/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 648. Replace Words
648. Replace Words: https://leetcode.com/problems/replace-words/ | from collections import defaultdict
class Node(object):
def __init__(self):
self.children = defaultdict(Node)
self.end = False
class Solution(object):
def replaceWords(self, dict, sentence):
"""
:type dict: List[str]
:type sentence: str
:rtype: str
"""
... | <commit_before><commit_msg>Add py solution for 648. Replace Words
648. Replace Words: https://leetcode.com/problems/replace-words/<commit_after> | from collections import defaultdict
class Node(object):
def __init__(self):
self.children = defaultdict(Node)
self.end = False
class Solution(object):
def replaceWords(self, dict, sentence):
"""
:type dict: List[str]
:type sentence: str
:rtype: str
"""
... | Add py solution for 648. Replace Words
648. Replace Words: https://leetcode.com/problems/replace-words/from collections import defaultdict
class Node(object):
def __init__(self):
self.children = defaultdict(Node)
self.end = False
class Solution(object):
def replaceWords(self, dict, sentence):
... | <commit_before><commit_msg>Add py solution for 648. Replace Words
648. Replace Words: https://leetcode.com/problems/replace-words/<commit_after>from collections import defaultdict
class Node(object):
def __init__(self):
self.children = defaultdict(Node)
self.end = False
class Solution(object):
... | |
baf7b88f61814e1db34375a71007648d79f14e1d | scripts/python/cleanSimulation.py | scripts/python/cleanSimulation.py | #!/usr/bin/env/ python
# file: cleanSimulation.py
# author: Olivier Mesnard ([email protected])
# description: Clean a PetIBM simulation.
import os
import argparse
def read_inputs():
"""Parses the command-line."""
# create parser
parser = argparse.ArgumentParser(description='Clean PetIBM case',
... | Add script to clean a given PetIBM simulation | Add script to clean a given PetIBM simulation
| Python | bsd-3-clause | mesnardo/PetIBM,barbagroup/PetIBM,mesnardo/PetIBM,mesnardo/PetIBM,piyueh/PetIBM | Add script to clean a given PetIBM simulation | #!/usr/bin/env/ python
# file: cleanSimulation.py
# author: Olivier Mesnard ([email protected])
# description: Clean a PetIBM simulation.
import os
import argparse
def read_inputs():
"""Parses the command-line."""
# create parser
parser = argparse.ArgumentParser(description='Clean PetIBM case',
... | <commit_before><commit_msg>Add script to clean a given PetIBM simulation<commit_after> | #!/usr/bin/env/ python
# file: cleanSimulation.py
# author: Olivier Mesnard ([email protected])
# description: Clean a PetIBM simulation.
import os
import argparse
def read_inputs():
"""Parses the command-line."""
# create parser
parser = argparse.ArgumentParser(description='Clean PetIBM case',
... | Add script to clean a given PetIBM simulation#!/usr/bin/env/ python
# file: cleanSimulation.py
# author: Olivier Mesnard ([email protected])
# description: Clean a PetIBM simulation.
import os
import argparse
def read_inputs():
"""Parses the command-line."""
# create parser
parser = argparse.ArgumentParser(de... | <commit_before><commit_msg>Add script to clean a given PetIBM simulation<commit_after>#!/usr/bin/env/ python
# file: cleanSimulation.py
# author: Olivier Mesnard ([email protected])
# description: Clean a PetIBM simulation.
import os
import argparse
def read_inputs():
"""Parses the command-line."""
# create par... | |
d408a48b126e270575c3d85a8f3748afa46d18a1 | scripts/fixtures.py | scripts/fixtures.py | import datetime
import json
import requests
import kinto_http
def buildid2iso(buildid):
return datetime.datetime.strptime(buildid, "%Y%m%d%H%M%S").isoformat()
def main():
client = kinto_http.Client(server_url="https://kinto-ota.dev.mozaws.net/v1",
bucket="build-hub",
... | Add quick and dirty script | Add quick and dirty script
| Python | mpl-2.0 | mozilla-services/buildhub,mozilla-services/buildhub,mozilla-services/buildhub,mozilla-services/buildhub | Add quick and dirty script | import datetime
import json
import requests
import kinto_http
def buildid2iso(buildid):
return datetime.datetime.strptime(buildid, "%Y%m%d%H%M%S").isoformat()
def main():
client = kinto_http.Client(server_url="https://kinto-ota.dev.mozaws.net/v1",
bucket="build-hub",
... | <commit_before><commit_msg>Add quick and dirty script<commit_after> | import datetime
import json
import requests
import kinto_http
def buildid2iso(buildid):
return datetime.datetime.strptime(buildid, "%Y%m%d%H%M%S").isoformat()
def main():
client = kinto_http.Client(server_url="https://kinto-ota.dev.mozaws.net/v1",
bucket="build-hub",
... | Add quick and dirty scriptimport datetime
import json
import requests
import kinto_http
def buildid2iso(buildid):
return datetime.datetime.strptime(buildid, "%Y%m%d%H%M%S").isoformat()
def main():
client = kinto_http.Client(server_url="https://kinto-ota.dev.mozaws.net/v1",
bu... | <commit_before><commit_msg>Add quick and dirty script<commit_after>import datetime
import json
import requests
import kinto_http
def buildid2iso(buildid):
return datetime.datetime.strptime(buildid, "%Y%m%d%H%M%S").isoformat()
def main():
client = kinto_http.Client(server_url="https://kinto-ota.dev.mozaws.n... | |
c94cb620292f93a4cd3cfc0bb57c5fa38d95a717 | kafka/cluster.py | kafka/cluster.py | import logging
import random
from .conn import BrokerConnection, collect_hosts
from .protocol.metadata import MetadataRequest
logger = logging.getLogger(__name__)
class Cluster(object):
def __init__(self, **kwargs):
if 'bootstrap_servers' not in kwargs:
kargs['bootstrap_servers'] = 'localhos... | Add simple Cluster class to manage broker metadata | Add simple Cluster class to manage broker metadata
| Python | apache-2.0 | Yelp/kafka-python,zackdever/kafka-python,wikimedia/operations-debs-python-kafka,DataDog/kafka-python,scrapinghub/kafka-python,dpkp/kafka-python,scrapinghub/kafka-python,ohmu/kafka-python,mumrah/kafka-python,dpkp/kafka-python,mumrah/kafka-python,gamechanger/kafka-python,zackdever/kafka-python,gamechanger/kafka-python,oh... | Add simple Cluster class to manage broker metadata | import logging
import random
from .conn import BrokerConnection, collect_hosts
from .protocol.metadata import MetadataRequest
logger = logging.getLogger(__name__)
class Cluster(object):
def __init__(self, **kwargs):
if 'bootstrap_servers' not in kwargs:
kargs['bootstrap_servers'] = 'localhos... | <commit_before><commit_msg>Add simple Cluster class to manage broker metadata<commit_after> | import logging
import random
from .conn import BrokerConnection, collect_hosts
from .protocol.metadata import MetadataRequest
logger = logging.getLogger(__name__)
class Cluster(object):
def __init__(self, **kwargs):
if 'bootstrap_servers' not in kwargs:
kargs['bootstrap_servers'] = 'localhos... | Add simple Cluster class to manage broker metadataimport logging
import random
from .conn import BrokerConnection, collect_hosts
from .protocol.metadata import MetadataRequest
logger = logging.getLogger(__name__)
class Cluster(object):
def __init__(self, **kwargs):
if 'bootstrap_servers' not in kwargs:
... | <commit_before><commit_msg>Add simple Cluster class to manage broker metadata<commit_after>import logging
import random
from .conn import BrokerConnection, collect_hosts
from .protocol.metadata import MetadataRequest
logger = logging.getLogger(__name__)
class Cluster(object):
def __init__(self, **kwargs):
... | |
03b4ffb6f0a2badc15b1312fcf8fe737e77bcf86 | test-http-client.py | test-http-client.py | try:
import config_local as config
except:
import config
parts = config.url.split('/')
url_base = parts[2]
if len(parts) > 3:
url_path = '/' + '/'.join(parts[3:])
print(url_base, url_path)
import http.client
conn = http.client.HTTPConnection(url_base)
conn.request('GET', url_path)
response = conn.getresp... | Add test of Python http.client | Add test of Python http.client
| Python | unlicense | mloskot/http-url-test,mloskot/http-url-test,mloskot/http-url-test,mloskot/http-url-test | Add test of Python http.client | try:
import config_local as config
except:
import config
parts = config.url.split('/')
url_base = parts[2]
if len(parts) > 3:
url_path = '/' + '/'.join(parts[3:])
print(url_base, url_path)
import http.client
conn = http.client.HTTPConnection(url_base)
conn.request('GET', url_path)
response = conn.getresp... | <commit_before><commit_msg>Add test of Python http.client<commit_after> | try:
import config_local as config
except:
import config
parts = config.url.split('/')
url_base = parts[2]
if len(parts) > 3:
url_path = '/' + '/'.join(parts[3:])
print(url_base, url_path)
import http.client
conn = http.client.HTTPConnection(url_base)
conn.request('GET', url_path)
response = conn.getresp... | Add test of Python http.clienttry:
import config_local as config
except:
import config
parts = config.url.split('/')
url_base = parts[2]
if len(parts) > 3:
url_path = '/' + '/'.join(parts[3:])
print(url_base, url_path)
import http.client
conn = http.client.HTTPConnection(url_base)
conn.request('GET', url... | <commit_before><commit_msg>Add test of Python http.client<commit_after>try:
import config_local as config
except:
import config
parts = config.url.split('/')
url_base = parts[2]
if len(parts) > 3:
url_path = '/' + '/'.join(parts[3:])
print(url_base, url_path)
import http.client
conn = http.client.HTTPCon... | |
eca7f6a35d3f95352096a455ace91ef5cde51339 | terminus/tests/city_model_test.py | terminus/tests/city_model_test.py | import unittest
import mock
from geometry.point import Point
from models.street import Street
from models.trunk import Trunk
from models.ground_plane import GroundPlane
from models.building import Building
from models.block import Block
from models.city import City
class CityModelTest(unittest.TestCase):
def te... | Add tests for city generation. | Add tests for city generation.
| Python | apache-2.0 | ekumenlabs/terminus,ekumenlabs/terminus | Add tests for city generation. | import unittest
import mock
from geometry.point import Point
from models.street import Street
from models.trunk import Trunk
from models.ground_plane import GroundPlane
from models.building import Building
from models.block import Block
from models.city import City
class CityModelTest(unittest.TestCase):
def te... | <commit_before><commit_msg>Add tests for city generation.<commit_after> | import unittest
import mock
from geometry.point import Point
from models.street import Street
from models.trunk import Trunk
from models.ground_plane import GroundPlane
from models.building import Building
from models.block import Block
from models.city import City
class CityModelTest(unittest.TestCase):
def te... | Add tests for city generation.import unittest
import mock
from geometry.point import Point
from models.street import Street
from models.trunk import Trunk
from models.ground_plane import GroundPlane
from models.building import Building
from models.block import Block
from models.city import City
class CityModelTest(u... | <commit_before><commit_msg>Add tests for city generation.<commit_after>import unittest
import mock
from geometry.point import Point
from models.street import Street
from models.trunk import Trunk
from models.ground_plane import GroundPlane
from models.building import Building
from models.block import Block
from models... | |
61d4ed5dff415350601d2850c0b7e23b3a377657 | tests/pytests/unit/test_minion.py | tests/pytests/unit/test_minion.py | import salt.minion
from tests.support.mock import patch
def test_minion_grains_in_opts():
"""
Minion does not generate grains when they are already in opts
"""
opts = {"random_startup_delay": 0, "grains": {"foo": "bar"}}
with patch("salt.loader.grains") as grainsfunc:
minion = salt.minion.... | Add tests for minion opts in grains | Add tests for minion opts in grains
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add tests for minion opts in grains | import salt.minion
from tests.support.mock import patch
def test_minion_grains_in_opts():
"""
Minion does not generate grains when they are already in opts
"""
opts = {"random_startup_delay": 0, "grains": {"foo": "bar"}}
with patch("salt.loader.grains") as grainsfunc:
minion = salt.minion.... | <commit_before><commit_msg>Add tests for minion opts in grains<commit_after> | import salt.minion
from tests.support.mock import patch
def test_minion_grains_in_opts():
"""
Minion does not generate grains when they are already in opts
"""
opts = {"random_startup_delay": 0, "grains": {"foo": "bar"}}
with patch("salt.loader.grains") as grainsfunc:
minion = salt.minion.... | Add tests for minion opts in grainsimport salt.minion
from tests.support.mock import patch
def test_minion_grains_in_opts():
"""
Minion does not generate grains when they are already in opts
"""
opts = {"random_startup_delay": 0, "grains": {"foo": "bar"}}
with patch("salt.loader.grains") as grains... | <commit_before><commit_msg>Add tests for minion opts in grains<commit_after>import salt.minion
from tests.support.mock import patch
def test_minion_grains_in_opts():
"""
Minion does not generate grains when they are already in opts
"""
opts = {"random_startup_delay": 0, "grains": {"foo": "bar"}}
w... | |
1acf010efb596b3ca8ab2cd714eee6d19505ccf6 | scripts/showlog.py | scripts/showlog.py | #!/usr/bin/python3
import sys
import argparse
from kafka import KafkaConsumer
parser = argparse.ArgumentParser(description='Zoe Kafka log viewer')
parser.add_argument('kafka_address', help='Address of the Kafka broker')
parser.add_argument('--list-logs', action='store_true', help='List all the available service logs... | Add a script to retrieve logs from kafka | Add a script to retrieve logs from kafka
| Python | apache-2.0 | DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe | Add a script to retrieve logs from kafka | #!/usr/bin/python3
import sys
import argparse
from kafka import KafkaConsumer
parser = argparse.ArgumentParser(description='Zoe Kafka log viewer')
parser.add_argument('kafka_address', help='Address of the Kafka broker')
parser.add_argument('--list-logs', action='store_true', help='List all the available service logs... | <commit_before><commit_msg>Add a script to retrieve logs from kafka<commit_after> | #!/usr/bin/python3
import sys
import argparse
from kafka import KafkaConsumer
parser = argparse.ArgumentParser(description='Zoe Kafka log viewer')
parser.add_argument('kafka_address', help='Address of the Kafka broker')
parser.add_argument('--list-logs', action='store_true', help='List all the available service logs... | Add a script to retrieve logs from kafka#!/usr/bin/python3
import sys
import argparse
from kafka import KafkaConsumer
parser = argparse.ArgumentParser(description='Zoe Kafka log viewer')
parser.add_argument('kafka_address', help='Address of the Kafka broker')
parser.add_argument('--list-logs', action='store_true', h... | <commit_before><commit_msg>Add a script to retrieve logs from kafka<commit_after>#!/usr/bin/python3
import sys
import argparse
from kafka import KafkaConsumer
parser = argparse.ArgumentParser(description='Zoe Kafka log viewer')
parser.add_argument('kafka_address', help='Address of the Kafka broker')
parser.add_argum... | |
a66d15d95e7ec62da12ccade0894e78e8dba6673 | cappa/factory.py | cappa/factory.py | from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
def manager_key_to_cappa(manager_key):
... | from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
MANAGER_MAP = {
'pip': Pip,
'pip... | Switch if-else block to dictionary lookup | Switch if-else block to dictionary lookup
| Python | mit | Captricity/cappa,Captricity/cappa | from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
def manager_key_to_cappa(manager_key):
... | from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
MANAGER_MAP = {
'pip': Pip,
'pip... | <commit_before>from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
def manager_key_to_cappa(... | from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
MANAGER_MAP = {
'pip': Pip,
'pip... | from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
def manager_key_to_cappa(manager_key):
... | <commit_before>from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .tsd import Tsd
from .private.pip import PrivatePip
def manager_key_to_cappa(... |
5193535b98513ae67a4d53b0314f1bd322aa2109 | pyecore/javatransmap.py | pyecore/javatransmap.py | import datetime
# Must be completed
# tuple is '(implem_type, use_type_as_factory, default_value)'
javaTransMap = {
'int': (int, False, 0),
'boolean': (bool, False, False),
'byte': (int, False, 0),
'short': (int, False, 0),
'long': (int, False, 0),
'float': (float, False, 0.0),
'char': (str... | Move JavaTransMap to another module | Move JavaTransMap to another module
| Python | bsd-3-clause | pyecore/pyecore,aranega/pyecore | Move JavaTransMap to another module | import datetime
# Must be completed
# tuple is '(implem_type, use_type_as_factory, default_value)'
javaTransMap = {
'int': (int, False, 0),
'boolean': (bool, False, False),
'byte': (int, False, 0),
'short': (int, False, 0),
'long': (int, False, 0),
'float': (float, False, 0.0),
'char': (str... | <commit_before><commit_msg>Move JavaTransMap to another module<commit_after> | import datetime
# Must be completed
# tuple is '(implem_type, use_type_as_factory, default_value)'
javaTransMap = {
'int': (int, False, 0),
'boolean': (bool, False, False),
'byte': (int, False, 0),
'short': (int, False, 0),
'long': (int, False, 0),
'float': (float, False, 0.0),
'char': (str... | Move JavaTransMap to another moduleimport datetime
# Must be completed
# tuple is '(implem_type, use_type_as_factory, default_value)'
javaTransMap = {
'int': (int, False, 0),
'boolean': (bool, False, False),
'byte': (int, False, 0),
'short': (int, False, 0),
'long': (int, False, 0),
'float': (f... | <commit_before><commit_msg>Move JavaTransMap to another module<commit_after>import datetime
# Must be completed
# tuple is '(implem_type, use_type_as_factory, default_value)'
javaTransMap = {
'int': (int, False, 0),
'boolean': (bool, False, False),
'byte': (int, False, 0),
'short': (int, False, 0),
... | |
a7a6e2cd3dd23906a62a94a7c1f6f8d640ee3f0c | pylua/test/test_json.py | pylua/test/test_json.py | #!/usr/bin/env python2
#-*- coding: utf-8 -*-
import json
import logging
logger = logging.getLogger(__name__)
class TestJson:
_JSON_STRING = '''{
"IntParam": 10,
"StrParam": "TestString",
"ArrayParam": [1,2,3],
"ObjParam": {"ObjIntParam": 11, "ObjStrParam": "ObjTestString"}
... | Add test for json parsing. Lua part is not implemented. | Add test for json parsing. Lua part is not implemented.
| Python | mit | malirod/pylua,malirod/pylua | Add test for json parsing. Lua part is not implemented. | #!/usr/bin/env python2
#-*- coding: utf-8 -*-
import json
import logging
logger = logging.getLogger(__name__)
class TestJson:
_JSON_STRING = '''{
"IntParam": 10,
"StrParam": "TestString",
"ArrayParam": [1,2,3],
"ObjParam": {"ObjIntParam": 11, "ObjStrParam": "ObjTestString"}
... | <commit_before><commit_msg>Add test for json parsing. Lua part is not implemented.<commit_after> | #!/usr/bin/env python2
#-*- coding: utf-8 -*-
import json
import logging
logger = logging.getLogger(__name__)
class TestJson:
_JSON_STRING = '''{
"IntParam": 10,
"StrParam": "TestString",
"ArrayParam": [1,2,3],
"ObjParam": {"ObjIntParam": 11, "ObjStrParam": "ObjTestString"}
... | Add test for json parsing. Lua part is not implemented.#!/usr/bin/env python2
#-*- coding: utf-8 -*-
import json
import logging
logger = logging.getLogger(__name__)
class TestJson:
_JSON_STRING = '''{
"IntParam": 10,
"StrParam": "TestString",
"ArrayParam": [1,2,3],
"ObjParam": ... | <commit_before><commit_msg>Add test for json parsing. Lua part is not implemented.<commit_after>#!/usr/bin/env python2
#-*- coding: utf-8 -*-
import json
import logging
logger = logging.getLogger(__name__)
class TestJson:
_JSON_STRING = '''{
"IntParam": 10,
"StrParam": "TestString",
"A... | |
77673e488ee258d0d25c05e5ee3bf109bd2f8a35 | skan/test/test_io.py | skan/test/test_io.py | import numpy as np
import pandas as pd
from skan import io
from skimage._shared._tempfile import temporary_file
def test_write_excel_tables():
num_sheets = np.random.randint(1, 4)
num_cols = np.random.randint(1, 5, size=num_sheets)
num_rows = np.random.randint(20, 40, size=num_sheets)
tables = []
... | Add testing for Excel writer | Add testing for Excel writer
| Python | bsd-3-clause | jni/skan | Add testing for Excel writer | import numpy as np
import pandas as pd
from skan import io
from skimage._shared._tempfile import temporary_file
def test_write_excel_tables():
num_sheets = np.random.randint(1, 4)
num_cols = np.random.randint(1, 5, size=num_sheets)
num_rows = np.random.randint(20, 40, size=num_sheets)
tables = []
... | <commit_before><commit_msg>Add testing for Excel writer<commit_after> | import numpy as np
import pandas as pd
from skan import io
from skimage._shared._tempfile import temporary_file
def test_write_excel_tables():
num_sheets = np.random.randint(1, 4)
num_cols = np.random.randint(1, 5, size=num_sheets)
num_rows = np.random.randint(20, 40, size=num_sheets)
tables = []
... | Add testing for Excel writerimport numpy as np
import pandas as pd
from skan import io
from skimage._shared._tempfile import temporary_file
def test_write_excel_tables():
num_sheets = np.random.randint(1, 4)
num_cols = np.random.randint(1, 5, size=num_sheets)
num_rows = np.random.randint(20, 40, size=nu... | <commit_before><commit_msg>Add testing for Excel writer<commit_after>import numpy as np
import pandas as pd
from skan import io
from skimage._shared._tempfile import temporary_file
def test_write_excel_tables():
num_sheets = np.random.randint(1, 4)
num_cols = np.random.randint(1, 5, size=num_sheets)
num... | |
0ce3e5c87a473c0c861ca7d871a423c0982bdff9 | utils/list_docs_modified_since.py | utils/list_docs_modified_since.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import argparse
from datetime import datetime
from dateutil.parser import parse
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
def main(argv=None):
parser = argparse.ArgumentParser(
description='Print count of objects for a given collect... | Add script for listing docs modified since date | Add script for listing docs modified since date
| Python | bsd-3-clause | barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere | Add script for listing docs modified since date | #!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import argparse
from datetime import datetime
from dateutil.parser import parse
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
def main(argv=None):
parser = argparse.ArgumentParser(
description='Print count of objects for a given collect... | <commit_before><commit_msg>Add script for listing docs modified since date<commit_after> | #!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import argparse
from datetime import datetime
from dateutil.parser import parse
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
def main(argv=None):
parser = argparse.ArgumentParser(
description='Print count of objects for a given collect... | Add script for listing docs modified since date#!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import argparse
from datetime import datetime
from dateutil.parser import parse
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
def main(argv=None):
parser = argparse.ArgumentParser(
descript... | <commit_before><commit_msg>Add script for listing docs modified since date<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import argparse
from datetime import datetime
from dateutil.parser import parse
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
def main(argv=None):
parser = ... | |
91318f3fc3138878ac2dba9fe668b84c4921e1df | bin/check_fasta.py | bin/check_fasta.py | """
Check a fasta file to make sure it is correct
"""
import os
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Check the integrity of a fasta file")
parser.add_argument('-f', help='fasta file to check', required=True)
parser.add_argument('-o', help='o... | Check and rewrite a fasta file | Check and rewrite a fasta file
| Python | mit | linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab | Check and rewrite a fasta file | """
Check a fasta file to make sure it is correct
"""
import os
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Check the integrity of a fasta file")
parser.add_argument('-f', help='fasta file to check', required=True)
parser.add_argument('-o', help='o... | <commit_before><commit_msg>Check and rewrite a fasta file<commit_after> | """
Check a fasta file to make sure it is correct
"""
import os
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Check the integrity of a fasta file")
parser.add_argument('-f', help='fasta file to check', required=True)
parser.add_argument('-o', help='o... | Check and rewrite a fasta file"""
Check a fasta file to make sure it is correct
"""
import os
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Check the integrity of a fasta file")
parser.add_argument('-f', help='fasta file to check', required=True)
par... | <commit_before><commit_msg>Check and rewrite a fasta file<commit_after>"""
Check a fasta file to make sure it is correct
"""
import os
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Check the integrity of a fasta file")
parser.add_argument('-f', help='fas... | |
599f093ba30afbf169f21559ca247eaba99dcebf | samples/custom/forms.py | samples/custom/forms.py | from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
| from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
attrs={'class': 'inline'},
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
| Add inline class to YesNoIgnored field | :memo: Add inline class to YesNoIgnored field
| Python | mit | gcrsaldanha/fiocruz,gems-uff/labsys,gcrsaldanha/fiocruz,gems-uff/labsys,gems-uff/labsys | from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
:memo: Add inline class to YesNoIgnored field | from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
attrs={'class': 'inline'},
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
| <commit_before>from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
<commit_msg>:memo: Add inline class to YesNoIgnored field<commit_after> | from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
attrs={'class': 'inline'},
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
| from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
:memo: Add inline class to YesNoIgnored fieldfrom django import forms
class YesNoIgnoredField(forms.Null... | <commit_before>from django import forms
class YesNoIgnoredField(forms.NullBooleanField):
widget = forms.widgets.RadioSelect(
choices=(
(True, "Sim"), (False, "Não"), (None, "Ignorado"),
),
)
<commit_msg>:memo: Add inline class to YesNoIgnored field<commit_after>from django import f... |
aa21d5360469b5976f82e55d28a5b920e459c3c1 | scripts/syntax_check.py | scripts/syntax_check.py | #!/usr/bin/env python
"""
Run lint checks for Synapse.
Requires pycodestyle to be installed.
Forked from https://gist.github.com/810399
Updated from https://github.com/cbrueffer/pep8-git-hook
"""
from __future__ import print_function
import os
import subprocess
import sys
# don't fill in both of these
# good codes
s... | Add a syntax check script. | Add a syntax check script.
| Python | apache-2.0 | vertexproject/synapse,vertexproject/synapse,vivisect/synapse,vertexproject/synapse | Add a syntax check script. | #!/usr/bin/env python
"""
Run lint checks for Synapse.
Requires pycodestyle to be installed.
Forked from https://gist.github.com/810399
Updated from https://github.com/cbrueffer/pep8-git-hook
"""
from __future__ import print_function
import os
import subprocess
import sys
# don't fill in both of these
# good codes
s... | <commit_before><commit_msg>Add a syntax check script.<commit_after> | #!/usr/bin/env python
"""
Run lint checks for Synapse.
Requires pycodestyle to be installed.
Forked from https://gist.github.com/810399
Updated from https://github.com/cbrueffer/pep8-git-hook
"""
from __future__ import print_function
import os
import subprocess
import sys
# don't fill in both of these
# good codes
s... | Add a syntax check script.#!/usr/bin/env python
"""
Run lint checks for Synapse.
Requires pycodestyle to be installed.
Forked from https://gist.github.com/810399
Updated from https://github.com/cbrueffer/pep8-git-hook
"""
from __future__ import print_function
import os
import subprocess
import sys
# don't fill in bo... | <commit_before><commit_msg>Add a syntax check script.<commit_after>#!/usr/bin/env python
"""
Run lint checks for Synapse.
Requires pycodestyle to be installed.
Forked from https://gist.github.com/810399
Updated from https://github.com/cbrueffer/pep8-git-hook
"""
from __future__ import print_function
import os
import ... | |
1e6a633d09d0e5f6a5a44f24b12216e464f3f8b6 | mygpo/data/models.py | mygpo/data/models.py | from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.Foreig... | Create model for Podcast update results | Create model for Podcast update results
| Python | agpl-3.0 | gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo | Create model for Podcast update results | from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.Foreig... | <commit_before><commit_msg>Create model for Podcast update results<commit_after> | from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.Foreig... | Create model for Podcast update resultsfrom datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that ... | <commit_before><commit_msg>Create model for Podcast update results<commit_after>from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to ... | |
f8fc40540d84c89810581ac33953b5fc0c408800 | oblique-curl-list.py | oblique-curl-list.py | ##[TBT-Tools]=group
##Input_Footprints=vector
##Output_Curl_List= file
import os,sys
outList = Output_Curl_List
if len(outList) == 0:
outDir = os.environ['HOME']
outList = os.path.join(outDir,'curl.list')
from qgis.utils import *
# Get vector from canvas, must be loaded with features selected.
layer = proce... | Add script to generate curl list | Add script to generate curl list
| Python | mit | eyeNsky/qgis-scripts | Add script to generate curl list | ##[TBT-Tools]=group
##Input_Footprints=vector
##Output_Curl_List= file
import os,sys
outList = Output_Curl_List
if len(outList) == 0:
outDir = os.environ['HOME']
outList = os.path.join(outDir,'curl.list')
from qgis.utils import *
# Get vector from canvas, must be loaded with features selected.
layer = proce... | <commit_before><commit_msg>Add script to generate curl list<commit_after> | ##[TBT-Tools]=group
##Input_Footprints=vector
##Output_Curl_List= file
import os,sys
outList = Output_Curl_List
if len(outList) == 0:
outDir = os.environ['HOME']
outList = os.path.join(outDir,'curl.list')
from qgis.utils import *
# Get vector from canvas, must be loaded with features selected.
layer = proce... | Add script to generate curl list##[TBT-Tools]=group
##Input_Footprints=vector
##Output_Curl_List= file
import os,sys
outList = Output_Curl_List
if len(outList) == 0:
outDir = os.environ['HOME']
outList = os.path.join(outDir,'curl.list')
from qgis.utils import *
# Get vector from canvas, must be loaded with ... | <commit_before><commit_msg>Add script to generate curl list<commit_after>##[TBT-Tools]=group
##Input_Footprints=vector
##Output_Curl_List= file
import os,sys
outList = Output_Curl_List
if len(outList) == 0:
outDir = os.environ['HOME']
outList = os.path.join(outDir,'curl.list')
from qgis.utils import *
# Get ... | |
a819ff1266b205414ea09fc1ac1c88ad1f8e427b | profiling/get_du.py | profiling/get_du.py | import sys
sys.path.append('..')
import numpy as np
import pdb
import scipy.optimize
import floq.systems.spins as spins
import floq.evolution as ev
import floq.optimization_task as ot
import floq.optimizer as opt
import floq.fidelity as fid
ncomp = 5
n = 1
freqs = 1.1*np.ones(n)+0.05*np.random.rand(n)
amps = 1.0*np.on... | Add single spin dU as profiling problem | Add single spin dU as profiling problem
| Python | mit | sirmarcel/floq | Add single spin dU as profiling problem | import sys
sys.path.append('..')
import numpy as np
import pdb
import scipy.optimize
import floq.systems.spins as spins
import floq.evolution as ev
import floq.optimization_task as ot
import floq.optimizer as opt
import floq.fidelity as fid
ncomp = 5
n = 1
freqs = 1.1*np.ones(n)+0.05*np.random.rand(n)
amps = 1.0*np.on... | <commit_before><commit_msg>Add single spin dU as profiling problem<commit_after> | import sys
sys.path.append('..')
import numpy as np
import pdb
import scipy.optimize
import floq.systems.spins as spins
import floq.evolution as ev
import floq.optimization_task as ot
import floq.optimizer as opt
import floq.fidelity as fid
ncomp = 5
n = 1
freqs = 1.1*np.ones(n)+0.05*np.random.rand(n)
amps = 1.0*np.on... | Add single spin dU as profiling problemimport sys
sys.path.append('..')
import numpy as np
import pdb
import scipy.optimize
import floq.systems.spins as spins
import floq.evolution as ev
import floq.optimization_task as ot
import floq.optimizer as opt
import floq.fidelity as fid
ncomp = 5
n = 1
freqs = 1.1*np.ones(n)+... | <commit_before><commit_msg>Add single spin dU as profiling problem<commit_after>import sys
sys.path.append('..')
import numpy as np
import pdb
import scipy.optimize
import floq.systems.spins as spins
import floq.evolution as ev
import floq.optimization_task as ot
import floq.optimizer as opt
import floq.fidelity as fid... | |
a28a117d3b0a2f3fe6684b82a08d2b4e277314f5 | src/auditlog_tests/test_settings.py | src/auditlog_tests/test_settings.py | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | Fix typo in test settings | Fix typo in test settings
| Python | mit | chris-griffin/django-auditlog,jjkester/django-auditlog,rauleb/django-auditlog,Zmeylol/auditlog,johnrtipton/django-auditlog,robmagee/django-auditlog,kbussell/django-auditlog | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | <commit_before>"""
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddl... | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | <commit_before>"""
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddl... |
3e960bc09caa616be6f9e98f9a36d91b1b094d5e | examples/uart/uart_driver.py | examples/uart/uart_driver.py | import serial
import sys
def main(infile, outfile, usb_path):
print (f"Running with infile={infile}, outfile={outfile}")
with open(infile, "rb") as f:
data = f.read()
print(f"infile length={len(data)}")
ser = serial.Serial(usb_path, 115200)
ser.write(data)
res = ser.read(len(data))
... | Add python driver for uart example | Add python driver for uart example
| Python | mit | phanrahan/magmathon,phanrahan/magmathon | Add python driver for uart example | import serial
import sys
def main(infile, outfile, usb_path):
print (f"Running with infile={infile}, outfile={outfile}")
with open(infile, "rb") as f:
data = f.read()
print(f"infile length={len(data)}")
ser = serial.Serial(usb_path, 115200)
ser.write(data)
res = ser.read(len(data))
... | <commit_before><commit_msg>Add python driver for uart example<commit_after> | import serial
import sys
def main(infile, outfile, usb_path):
print (f"Running with infile={infile}, outfile={outfile}")
with open(infile, "rb") as f:
data = f.read()
print(f"infile length={len(data)}")
ser = serial.Serial(usb_path, 115200)
ser.write(data)
res = ser.read(len(data))
... | Add python driver for uart exampleimport serial
import sys
def main(infile, outfile, usb_path):
print (f"Running with infile={infile}, outfile={outfile}")
with open(infile, "rb") as f:
data = f.read()
print(f"infile length={len(data)}")
ser = serial.Serial(usb_path, 115200)
ser.write(dat... | <commit_before><commit_msg>Add python driver for uart example<commit_after>import serial
import sys
def main(infile, outfile, usb_path):
print (f"Running with infile={infile}, outfile={outfile}")
with open(infile, "rb") as f:
data = f.read()
print(f"infile length={len(data)}")
ser = serial.S... | |
99369dc3e39a9730c6d936ced0888a1338a57c27 | geosoft/gxpy/tests/runall.py | geosoft/gxpy/tests/runall.py | import multiprocessing
import subprocess
import glob
import timeit
def work(test):
return (test, subprocess.call(['nosetests', '-v', test]))
_exit_code = 0
def run_all_tests():
tests = glob.glob('test_*.py')
pool = multiprocessing.Pool(processes=6)
print(pool.map(work, tests))
return 0
if __name... | Resolve circular imports and syntax issues to restore Python 3.4 support | Resolve circular imports and syntax issues to restore Python 3.4 support
| Python | bsd-2-clause | GeosoftInc/gxpy | Resolve circular imports and syntax issues to restore Python 3.4 support | import multiprocessing
import subprocess
import glob
import timeit
def work(test):
return (test, subprocess.call(['nosetests', '-v', test]))
_exit_code = 0
def run_all_tests():
tests = glob.glob('test_*.py')
pool = multiprocessing.Pool(processes=6)
print(pool.map(work, tests))
return 0
if __name... | <commit_before><commit_msg>Resolve circular imports and syntax issues to restore Python 3.4 support<commit_after> | import multiprocessing
import subprocess
import glob
import timeit
def work(test):
return (test, subprocess.call(['nosetests', '-v', test]))
_exit_code = 0
def run_all_tests():
tests = glob.glob('test_*.py')
pool = multiprocessing.Pool(processes=6)
print(pool.map(work, tests))
return 0
if __name... | Resolve circular imports and syntax issues to restore Python 3.4 supportimport multiprocessing
import subprocess
import glob
import timeit
def work(test):
return (test, subprocess.call(['nosetests', '-v', test]))
_exit_code = 0
def run_all_tests():
tests = glob.glob('test_*.py')
pool = multiprocessing.Po... | <commit_before><commit_msg>Resolve circular imports and syntax issues to restore Python 3.4 support<commit_after>import multiprocessing
import subprocess
import glob
import timeit
def work(test):
return (test, subprocess.call(['nosetests', '-v', test]))
_exit_code = 0
def run_all_tests():
tests = glob.glob('... | |
28dd0de65ebab3ef039a1bf1290e206205fb0dea | control/Control/src/balancer/initial_placement_rr.py | control/Control/src/balancer/initial_placement_rr.py | from logs import sonarlog
from workload.timeutil import * # @UnusedWildImport
import conf_domains
import conf_nodes
import initial_placement
# Setup logging
logger = sonarlog.getLogger('initial_placement')
class RRPlacement(initial_placement.InitialPlacement):
def execute(self):
# Execute super code
... | Add rudimentary initial placement RR controller | Add rudimentary initial placement RR controller
| Python | mit | jacksonicson/paper.IS2015,jacksonicson/paper.IS2015,jacksonicson/paper.IS2015,jacksonicson/paper.IS2015,jacksonicson/paper.IS2015 | Add rudimentary initial placement RR controller | from logs import sonarlog
from workload.timeutil import * # @UnusedWildImport
import conf_domains
import conf_nodes
import initial_placement
# Setup logging
logger = sonarlog.getLogger('initial_placement')
class RRPlacement(initial_placement.InitialPlacement):
def execute(self):
# Execute super code
... | <commit_before><commit_msg>Add rudimentary initial placement RR controller<commit_after> | from logs import sonarlog
from workload.timeutil import * # @UnusedWildImport
import conf_domains
import conf_nodes
import initial_placement
# Setup logging
logger = sonarlog.getLogger('initial_placement')
class RRPlacement(initial_placement.InitialPlacement):
def execute(self):
# Execute super code
... | Add rudimentary initial placement RR controllerfrom logs import sonarlog
from workload.timeutil import * # @UnusedWildImport
import conf_domains
import conf_nodes
import initial_placement
# Setup logging
logger = sonarlog.getLogger('initial_placement')
class RRPlacement(initial_placement.InitialPlacement):
de... | <commit_before><commit_msg>Add rudimentary initial placement RR controller<commit_after>from logs import sonarlog
from workload.timeutil import * # @UnusedWildImport
import conf_domains
import conf_nodes
import initial_placement
# Setup logging
logger = sonarlog.getLogger('initial_placement')
class RRPlacement(in... | |
ba1198c4a622aa4bb039355043a3eab5b8f3614c | tests/test_exporters.py | tests/test_exporters.py | # -*- coding: utf-8 -*-
"""Tests for custom exporters."""
from nbconvert.tests.base import TestsBase
from nbformat import v4, write
import io
import os
class TestNbConvertExporters(TestsBase):
def test_embedhtml(self):
with self.create_temp_cwd():
nb = v4.new_notebook(cells=[
... | Add tests for toc2 and html_embed exporters | Add tests for toc2 and html_embed exporters
| Python | bsd-3-clause | juhasch/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,juhasch/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,juhasch/IPytho... | Add tests for toc2 and html_embed exporters | # -*- coding: utf-8 -*-
"""Tests for custom exporters."""
from nbconvert.tests.base import TestsBase
from nbformat import v4, write
import io
import os
class TestNbConvertExporters(TestsBase):
def test_embedhtml(self):
with self.create_temp_cwd():
nb = v4.new_notebook(cells=[
... | <commit_before><commit_msg>Add tests for toc2 and html_embed exporters<commit_after> | # -*- coding: utf-8 -*-
"""Tests for custom exporters."""
from nbconvert.tests.base import TestsBase
from nbformat import v4, write
import io
import os
class TestNbConvertExporters(TestsBase):
def test_embedhtml(self):
with self.create_temp_cwd():
nb = v4.new_notebook(cells=[
... | Add tests for toc2 and html_embed exporters# -*- coding: utf-8 -*-
"""Tests for custom exporters."""
from nbconvert.tests.base import TestsBase
from nbformat import v4, write
import io
import os
class TestNbConvertExporters(TestsBase):
def test_embedhtml(self):
with self.create_temp_cwd():
nb... | <commit_before><commit_msg>Add tests for toc2 and html_embed exporters<commit_after># -*- coding: utf-8 -*-
"""Tests for custom exporters."""
from nbconvert.tests.base import TestsBase
from nbformat import v4, write
import io
import os
class TestNbConvertExporters(TestsBase):
def test_embedhtml(self):
wi... | |
e91079ecab2d324ae5428239bcf792ab149faa4a | jacquard/storage/tests/test_dummy.py | jacquard/storage/tests/test_dummy.py | import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
| Cover the dummy storage engine with tests | Cover the dummy storage engine with tests
| Python | mit | prophile/jacquard,prophile/jacquard | Cover the dummy storage engine with tests | import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
| <commit_before><commit_msg>Cover the dummy storage engine with tests<commit_after> | import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
| Cover the dummy storage engine with testsimport unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore('')
| <commit_before><commit_msg>Cover the dummy storage engine with tests<commit_after>import unittest
from jacquard.storage.dummy import DummyStore
from jacquard.storage.testing_utils import StorageGauntlet
class DummyGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return DummyStore... | |
ef010cd80984437e591e85d957223286b703d6c4 | tools/convert-url-history.py | tools/convert-url-history.py | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add initial URL history importer | Add initial URL history importer
| Python | apache-2.0 | rogers0/namebench,google/namebench,protron/namebench,google/namebench,google/namebench | Add initial URL history importer | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | <commit_before><commit_msg>Add initial URL history importer<commit_after> | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add initial URL history importer#!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | <commit_before><commit_msg>Add initial URL history importer<commit_after>#!/usr/bin/env python
# Copyright 2009 Google 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 a... | |
3f3bb40f0913e6ddd57b8c0bfa94aecb4a3b5dda | run_tests.py | run_tests.py | #!/usr/bin/env python
import unittest
import argparse
import logging
def run():
parser = argparse.ArgumentParser()
parser.add_argument('--print-log', action='store_true',
help='Print the log.')
args = parser.parse_args()
if args.print_log:
logging.basicConfig(level=lo... | Create initial test runner script. | Create initial test runner script.
| Python | agpl-3.0 | izrik/wikiware,izrik/wikiware,izrik/blogware,izrik/blogware,izrik/wikiware,izrik/blogware | Create initial test runner script. | #!/usr/bin/env python
import unittest
import argparse
import logging
def run():
parser = argparse.ArgumentParser()
parser.add_argument('--print-log', action='store_true',
help='Print the log.')
args = parser.parse_args()
if args.print_log:
logging.basicConfig(level=lo... | <commit_before><commit_msg>Create initial test runner script.<commit_after> | #!/usr/bin/env python
import unittest
import argparse
import logging
def run():
parser = argparse.ArgumentParser()
parser.add_argument('--print-log', action='store_true',
help='Print the log.')
args = parser.parse_args()
if args.print_log:
logging.basicConfig(level=lo... | Create initial test runner script.#!/usr/bin/env python
import unittest
import argparse
import logging
def run():
parser = argparse.ArgumentParser()
parser.add_argument('--print-log', action='store_true',
help='Print the log.')
args = parser.parse_args()
if args.print_log:
... | <commit_before><commit_msg>Create initial test runner script.<commit_after>#!/usr/bin/env python
import unittest
import argparse
import logging
def run():
parser = argparse.ArgumentParser()
parser.add_argument('--print-log', action='store_true',
help='Print the log.')
args = parse... | |
7d24695c7e94e787b5d66854db7cc6dc1abcbf10 | polyaxon/tracker/publish_tracker.py | polyaxon/tracker/publish_tracker.py | import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.write_key = key
... | import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.write_key = key
... | Update check on cluster id | Update check on cluster id
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.write_key = key
... | import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.write_key = key
... | <commit_before>import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.wr... | import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.write_key = key
... | import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.write_key = key
... | <commit_before>import analytics
from django.db import InterfaceError, OperationalError, ProgrammingError
from tracker.service import TrackerService
class PublishTrackerService(TrackerService):
def __init__(self, key=''):
self.cluster_id = None
self.analytics = analytics
self.analytics.wr... |
261a554647a8b220ce87155fd05acd8d1dda0914 | test/storage/test_google_storage.py | test/storage/test_google_storage.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Add Google Storage storage tests. Tests are based on the S3 ones. | Add Google Storage storage tests. Tests are based on the S3 ones.
git-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1179577 13f79535-47bb-0310-9956-ffa450edef68
| Python | apache-2.0 | niteoweb/libcloud,cryptickp/libcloud,techhat/libcloud,Verizon/libcloud,mathspace/libcloud,samuelchong/libcloud,vongazman/libcloud,andrewsomething/libcloud,pquentin/libcloud,kater169/libcloud,JamesGuthrie/libcloud,sahildua2305/libcloud,pantheon-systems/libcloud,pquentin/libcloud,watermelo/libcloud,Keisuke69/libcloud,Zul... | Add Google Storage storage tests. Tests are based on the S3 ones.
git-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1179577 13f79535-47bb-0310-9956-ffa450edef68 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | <commit_before><commit_msg>Add Google Storage storage tests. Tests are based on the S3 ones.
git-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1179577 13f79535-47bb-0310-9956-ffa450edef68<commit_after> | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Add Google Storage storage tests. Tests are based on the S3 ones.
git-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1179577 13f79535-47bb-0310-9956-ffa450edef68# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for... | <commit_before><commit_msg>Add Google Storage storage tests. Tests are based on the S3 ones.
git-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1179577 13f79535-47bb-0310-9956-ffa450edef68<commit_after># Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOT... | |
44b068dbfee594babe72462476ddb9b94c17bb16 | tests/test_spawner/test_env_vars.py | tests/test_spawner/test_env_vars.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from unittest.mock import MagicMock
from scheduler.spawners.templates.env_vars import get_resources_env_vars
class TestEnvVars(TestCase):
def test_get_resources_env_vars(self):
vars = get_resources_env_vars(None)
assert len(vars)
asser... | Add unit test for function get_resources_env_vars | Add unit test for function get_resources_env_vars
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | Add unit test for function get_resources_env_vars | # -*- coding: utf-8 -*-
from unittest import TestCase
from unittest.mock import MagicMock
from scheduler.spawners.templates.env_vars import get_resources_env_vars
class TestEnvVars(TestCase):
def test_get_resources_env_vars(self):
vars = get_resources_env_vars(None)
assert len(vars)
asser... | <commit_before><commit_msg>Add unit test for function get_resources_env_vars<commit_after> | # -*- coding: utf-8 -*-
from unittest import TestCase
from unittest.mock import MagicMock
from scheduler.spawners.templates.env_vars import get_resources_env_vars
class TestEnvVars(TestCase):
def test_get_resources_env_vars(self):
vars = get_resources_env_vars(None)
assert len(vars)
asser... | Add unit test for function get_resources_env_vars# -*- coding: utf-8 -*-
from unittest import TestCase
from unittest.mock import MagicMock
from scheduler.spawners.templates.env_vars import get_resources_env_vars
class TestEnvVars(TestCase):
def test_get_resources_env_vars(self):
vars = get_resources_env_... | <commit_before><commit_msg>Add unit test for function get_resources_env_vars<commit_after># -*- coding: utf-8 -*-
from unittest import TestCase
from unittest.mock import MagicMock
from scheduler.spawners.templates.env_vars import get_resources_env_vars
class TestEnvVars(TestCase):
def test_get_resources_env_vars... | |
75740fe37174230faa7d9a434c844d4aa88e4091 | python/ImagePlot.py | python/ImagePlot.py | from PIL import Image, ImageDraw
import sys
print(sys.argv);
if len(sys.argv) < 3 :
print("File path need to be passed as 1st argument")
exit()
im = Image.open(sys.argv[1])
draw = ImageDraw.Draw(im)
try:
#fp = open(sys.argv[1])
with open(sys.argv[2]) as fp:
lines = fp.readlines()
for line in line... | Add python script to draw points on an image | Add python script to draw points on an image
| Python | mit | NaturalIntelligence/imglab,NaturalIntelligence/imglab | Add python script to draw points on an image | from PIL import Image, ImageDraw
import sys
print(sys.argv);
if len(sys.argv) < 3 :
print("File path need to be passed as 1st argument")
exit()
im = Image.open(sys.argv[1])
draw = ImageDraw.Draw(im)
try:
#fp = open(sys.argv[1])
with open(sys.argv[2]) as fp:
lines = fp.readlines()
for line in line... | <commit_before><commit_msg>Add python script to draw points on an image<commit_after> | from PIL import Image, ImageDraw
import sys
print(sys.argv);
if len(sys.argv) < 3 :
print("File path need to be passed as 1st argument")
exit()
im = Image.open(sys.argv[1])
draw = ImageDraw.Draw(im)
try:
#fp = open(sys.argv[1])
with open(sys.argv[2]) as fp:
lines = fp.readlines()
for line in line... | Add python script to draw points on an imagefrom PIL import Image, ImageDraw
import sys
print(sys.argv);
if len(sys.argv) < 3 :
print("File path need to be passed as 1st argument")
exit()
im = Image.open(sys.argv[1])
draw = ImageDraw.Draw(im)
try:
#fp = open(sys.argv[1])
with open(sys.argv[2]) as fp:
... | <commit_before><commit_msg>Add python script to draw points on an image<commit_after>from PIL import Image, ImageDraw
import sys
print(sys.argv);
if len(sys.argv) < 3 :
print("File path need to be passed as 1st argument")
exit()
im = Image.open(sys.argv[1])
draw = ImageDraw.Draw(im)
try:
#fp = open(sys.ar... | |
21cb0df67afeb3a02ad44290f8100ed875c02e5b | scripts/echo_usb.py | scripts/echo_usb.py | #!/usr/bin/env python
import serial
import os
import sys
import time
# Open a serial port
print 'Connecting to /dev/serial/by-id/usb-eecs567_final_project-if00'
tries = 0
while True:
try:
ser = serial.Serial("/dev/serial/by-id/usb-eecs567_final_project-if00", 115200)
break
except Exception as ... | Add a script to spit usb to terminal | SCRIPTS: Add a script to spit usb to terminal
| Python | mit | fnivek/eecs567-final-project,fnivek/eecs567-final-project,fnivek/eecs567-final-project,fnivek/eecs567-final-project,fnivek/eecs567-final-project | SCRIPTS: Add a script to spit usb to terminal | #!/usr/bin/env python
import serial
import os
import sys
import time
# Open a serial port
print 'Connecting to /dev/serial/by-id/usb-eecs567_final_project-if00'
tries = 0
while True:
try:
ser = serial.Serial("/dev/serial/by-id/usb-eecs567_final_project-if00", 115200)
break
except Exception as ... | <commit_before><commit_msg>SCRIPTS: Add a script to spit usb to terminal<commit_after> | #!/usr/bin/env python
import serial
import os
import sys
import time
# Open a serial port
print 'Connecting to /dev/serial/by-id/usb-eecs567_final_project-if00'
tries = 0
while True:
try:
ser = serial.Serial("/dev/serial/by-id/usb-eecs567_final_project-if00", 115200)
break
except Exception as ... | SCRIPTS: Add a script to spit usb to terminal#!/usr/bin/env python
import serial
import os
import sys
import time
# Open a serial port
print 'Connecting to /dev/serial/by-id/usb-eecs567_final_project-if00'
tries = 0
while True:
try:
ser = serial.Serial("/dev/serial/by-id/usb-eecs567_final_project-if00", 1... | <commit_before><commit_msg>SCRIPTS: Add a script to spit usb to terminal<commit_after>#!/usr/bin/env python
import serial
import os
import sys
import time
# Open a serial port
print 'Connecting to /dev/serial/by-id/usb-eecs567_final_project-if00'
tries = 0
while True:
try:
ser = serial.Serial("/dev/serial... | |
c5747c2cf7d59b9905e2bedddbc9cf791c300b05 | scripts/create_initial_admin_user.py | scripts/create_initial_admin_user.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create an initial user with admin privileges to begin BYCEPS setup.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from byceps.services.authentication.password import service... | Add script to create an activated user from the command line | Add script to create an activated user from the command line
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps | Add script to create an activated user from the command line | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create an initial user with admin privileges to begin BYCEPS setup.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from byceps.services.authentication.password import service... | <commit_before><commit_msg>Add script to create an activated user from the command line<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create an initial user with admin privileges to begin BYCEPS setup.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db
from byceps.services.authentication.password import service... | Add script to create an activated user from the command line#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create an initial user with admin privileges to begin BYCEPS setup.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.database import db... | <commit_before><commit_msg>Add script to create an activated user from the command line<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create an initial user with admin privileges to begin BYCEPS setup.
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
imp... | |
3fab900ad5d31941ec0f05d9a10e9f9a63bf8853 | MComponents/MTestComponent.py | MComponents/MTestComponent.py | __author__ = 'Samvid Mistry'
from PySide.QtCore import *
from PySide.QtGui import *
from MAnimations.MCircularReveal import MCircularReveal
from MComponents.MShape import MShape
from MUtilities import MColors
class MTestComponent(MShape):
def __init__(self):
MShape.__init__(self)
self.max_width ... | Test component for running animation tests | Test component for running animation tests
| Python | mit | GelaniNijraj/PyMaterial,samvidmistry/PyMaterial | Test component for running animation tests | __author__ = 'Samvid Mistry'
from PySide.QtCore import *
from PySide.QtGui import *
from MAnimations.MCircularReveal import MCircularReveal
from MComponents.MShape import MShape
from MUtilities import MColors
class MTestComponent(MShape):
def __init__(self):
MShape.__init__(self)
self.max_width ... | <commit_before><commit_msg>Test component for running animation tests<commit_after> | __author__ = 'Samvid Mistry'
from PySide.QtCore import *
from PySide.QtGui import *
from MAnimations.MCircularReveal import MCircularReveal
from MComponents.MShape import MShape
from MUtilities import MColors
class MTestComponent(MShape):
def __init__(self):
MShape.__init__(self)
self.max_width ... | Test component for running animation tests__author__ = 'Samvid Mistry'
from PySide.QtCore import *
from PySide.QtGui import *
from MAnimations.MCircularReveal import MCircularReveal
from MComponents.MShape import MShape
from MUtilities import MColors
class MTestComponent(MShape):
def __init__(self):
MSh... | <commit_before><commit_msg>Test component for running animation tests<commit_after>__author__ = 'Samvid Mistry'
from PySide.QtCore import *
from PySide.QtGui import *
from MAnimations.MCircularReveal import MCircularReveal
from MComponents.MShape import MShape
from MUtilities import MColors
class MTestComponent(MSh... | |
76254f7f76915d4f21ec8406313e998ddbafffe2 | app/svm_prediction.py | app/svm_prediction.py | #!/usr/bin/env python
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
import validate_dataset as validate
# Make predictions using Support Vector Machines
svm = SVC()
# load train data from validate
svm.fit(validate.X_train, validate.Y_train)
# get predi... | Add predication from Support Vector Machines. | Add predication from Support Vector Machines.
| Python | mit | lucasb/iris-machine-learning | Add predication from Support Vector Machines. | #!/usr/bin/env python
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
import validate_dataset as validate
# Make predictions using Support Vector Machines
svm = SVC()
# load train data from validate
svm.fit(validate.X_train, validate.Y_train)
# get predi... | <commit_before><commit_msg>Add predication from Support Vector Machines.<commit_after> | #!/usr/bin/env python
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
import validate_dataset as validate
# Make predictions using Support Vector Machines
svm = SVC()
# load train data from validate
svm.fit(validate.X_train, validate.Y_train)
# get predi... | Add predication from Support Vector Machines.#!/usr/bin/env python
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
import validate_dataset as validate
# Make predictions using Support Vector Machines
svm = SVC()
# load train data from validate
svm.fit(va... | <commit_before><commit_msg>Add predication from Support Vector Machines.<commit_after>#!/usr/bin/env python
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
import validate_dataset as validate
# Make predictions using Support Vector Machines
svm = SVC()
#... | |
e931fbb53557efc5be63015e1ce0055efef965c4 | aids/strings/is_palindrome.py | aids/strings/is_palindrome.py | '''
In this module, we determine if a given string is a palindrome
'''
def is_palindrome(string):
'''
Return True if given string is a palindrome
'''
if len(string) < 2:
return True
if string[0] == string[-1]:
return is_palindrome(string[1:-1])
return False
| Add function to determine if string is a palindrome | Add function to determine if string is a palindrome | Python | mit | ueg1990/aids | Add function to determine if string is a palindrome | '''
In this module, we determine if a given string is a palindrome
'''
def is_palindrome(string):
'''
Return True if given string is a palindrome
'''
if len(string) < 2:
return True
if string[0] == string[-1]:
return is_palindrome(string[1:-1])
return False
| <commit_before><commit_msg>Add function to determine if string is a palindrome<commit_after> | '''
In this module, we determine if a given string is a palindrome
'''
def is_palindrome(string):
'''
Return True if given string is a palindrome
'''
if len(string) < 2:
return True
if string[0] == string[-1]:
return is_palindrome(string[1:-1])
return False
| Add function to determine if string is a palindrome'''
In this module, we determine if a given string is a palindrome
'''
def is_palindrome(string):
'''
Return True if given string is a palindrome
'''
if len(string) < 2:
return True
if string[0] == string[-1]:
return is_palindrome(string[1:-1])
return Fals... | <commit_before><commit_msg>Add function to determine if string is a palindrome<commit_after>'''
In this module, we determine if a given string is a palindrome
'''
def is_palindrome(string):
'''
Return True if given string is a palindrome
'''
if len(string) < 2:
return True
if string[0] == string[-1]:
return... | |
0fd8d6248878db9f6ca7e945f8155f5f6cdc031d | gui/ninja_plugin/ninja_nysa/nysa_plugin/editor/fpga_designer/errors.py | gui/ninja_plugin/ninja_nysa/nysa_plugin/editor/fpga_designer/errors.py | class FPGADesignerError(Exception):
"""
Errors associated with the FPGA designer
Error associated with:
-loading the configuration file
-generating configuration files
"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
| Put the Exceptions in a seperate file | Put the Exceptions in a seperate file
| Python | mit | CospanDesign/nysa,CospanDesign/nysa | Put the Exceptions in a seperate file | class FPGADesignerError(Exception):
"""
Errors associated with the FPGA designer
Error associated with:
-loading the configuration file
-generating configuration files
"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
| <commit_before><commit_msg>Put the Exceptions in a seperate file<commit_after> | class FPGADesignerError(Exception):
"""
Errors associated with the FPGA designer
Error associated with:
-loading the configuration file
-generating configuration files
"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
| Put the Exceptions in a seperate fileclass FPGADesignerError(Exception):
"""
Errors associated with the FPGA designer
Error associated with:
-loading the configuration file
-generating configuration files
"""
def __init__(self, value):
self.value = value
def __str__(self... | <commit_before><commit_msg>Put the Exceptions in a seperate file<commit_after>class FPGADesignerError(Exception):
"""
Errors associated with the FPGA designer
Error associated with:
-loading the configuration file
-generating configuration files
"""
def __init__(self, value):
... | |
6937eb931e3577dac57cc36c69c755be5d71d654 | Testing/test_Misc.py | Testing/test_Misc.py | import unittest
import os
import scipy
from SloppyCell.ReactionNetworks import *
from AlgTestNets import algebraic_net_assignment
base_net = algebraic_net_assignment.copy()
class test_Misc(unittest.TestCase):
def test_AssignedVarBug(self):
""" Test handling of assigned variables initialized to concentra... | Add test to check for bug led to change in Network_mod.updateAssignedVariables | Add test to check for bug led to change in Network_mod.updateAssignedVariables
| Python | bsd-3-clause | GutenkunstLab/SloppyCell,GutenkunstLab/SloppyCell | Add test to check for bug led to change in Network_mod.updateAssignedVariables | import unittest
import os
import scipy
from SloppyCell.ReactionNetworks import *
from AlgTestNets import algebraic_net_assignment
base_net = algebraic_net_assignment.copy()
class test_Misc(unittest.TestCase):
def test_AssignedVarBug(self):
""" Test handling of assigned variables initialized to concentra... | <commit_before><commit_msg>Add test to check for bug led to change in Network_mod.updateAssignedVariables<commit_after> | import unittest
import os
import scipy
from SloppyCell.ReactionNetworks import *
from AlgTestNets import algebraic_net_assignment
base_net = algebraic_net_assignment.copy()
class test_Misc(unittest.TestCase):
def test_AssignedVarBug(self):
""" Test handling of assigned variables initialized to concentra... | Add test to check for bug led to change in Network_mod.updateAssignedVariablesimport unittest
import os
import scipy
from SloppyCell.ReactionNetworks import *
from AlgTestNets import algebraic_net_assignment
base_net = algebraic_net_assignment.copy()
class test_Misc(unittest.TestCase):
def test_AssignedVarBug(s... | <commit_before><commit_msg>Add test to check for bug led to change in Network_mod.updateAssignedVariables<commit_after>import unittest
import os
import scipy
from SloppyCell.ReactionNetworks import *
from AlgTestNets import algebraic_net_assignment
base_net = algebraic_net_assignment.copy()
class test_Misc(unittest... | |
3efee0a55103114548013fd7111bf5d9dd0c0bdd | tests/test_others.py | tests/test_others.py | from typing import Optional
import typer
from typer.main import solve_typer_info_defaults, solve_typer_info_help
from typer.models import TyperInfo
from typer.testing import CliRunner
runner = CliRunner()
def test_optional():
app = typer.Typer()
@app.command()
def opt(user: Optional[str] = None):
... | Add 4 extra tests for edge cases | :white_check_mark: Add 4 extra tests for edge cases
| Python | mit | tiangolo/typer,tiangolo/typer | :white_check_mark: Add 4 extra tests for edge cases | from typing import Optional
import typer
from typer.main import solve_typer_info_defaults, solve_typer_info_help
from typer.models import TyperInfo
from typer.testing import CliRunner
runner = CliRunner()
def test_optional():
app = typer.Typer()
@app.command()
def opt(user: Optional[str] = None):
... | <commit_before><commit_msg>:white_check_mark: Add 4 extra tests for edge cases<commit_after> | from typing import Optional
import typer
from typer.main import solve_typer_info_defaults, solve_typer_info_help
from typer.models import TyperInfo
from typer.testing import CliRunner
runner = CliRunner()
def test_optional():
app = typer.Typer()
@app.command()
def opt(user: Optional[str] = None):
... | :white_check_mark: Add 4 extra tests for edge casesfrom typing import Optional
import typer
from typer.main import solve_typer_info_defaults, solve_typer_info_help
from typer.models import TyperInfo
from typer.testing import CliRunner
runner = CliRunner()
def test_optional():
app = typer.Typer()
@app.comma... | <commit_before><commit_msg>:white_check_mark: Add 4 extra tests for edge cases<commit_after>from typing import Optional
import typer
from typer.main import solve_typer_info_defaults, solve_typer_info_help
from typer.models import TyperInfo
from typer.testing import CliRunner
runner = CliRunner()
def test_optional()... | |
88f6b30250c4385e0ff8492381e0ba1e75fe0c71 | test/test_logger.py | test/test_logger.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from subprocrunner import (
set_logger,
set_log_level,
)
class Test_set_logger(object):
@pytest.mark.para... | Add test cases for the logger | Add test cases for the logger
| Python | mit | thombashi/subprocrunner,thombashi/subprocrunner | Add test cases for the logger | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from subprocrunner import (
set_logger,
set_log_level,
)
class Test_set_logger(object):
@pytest.mark.para... | <commit_before><commit_msg>Add test cases for the logger<commit_after> | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from subprocrunner import (
set_logger,
set_log_level,
)
class Test_set_logger(object):
@pytest.mark.para... | Add test cases for the logger# encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from subprocrunner import (
set_logger,
set_log_level,
)
class Test_set_logger(ob... | <commit_before><commit_msg>Add test cases for the logger<commit_after># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from subprocrunner import (
set_logger,
se... | |
edc2bb7e4dea1359479940990b13c189e1d57a4a | cartel-generation.py | cartel-generation.py | #!/usr/bin/python
import csv
import sys
import getopt
def help():
print 'cartel-generation.py -c <input-csv-file> -o <output-svg-file>'
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hc:o:",["csv=","osvg="])
except getopt.GetoptError:
help()
sys... | Add a basic script with getopt to read command line parameters | Add a basic script with getopt to read command line parameters
| Python | mit | jmtrivial/cartel-generation | Add a basic script with getopt to read command line parameters | #!/usr/bin/python
import csv
import sys
import getopt
def help():
print 'cartel-generation.py -c <input-csv-file> -o <output-svg-file>'
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hc:o:",["csv=","osvg="])
except getopt.GetoptError:
help()
sys... | <commit_before><commit_msg>Add a basic script with getopt to read command line parameters<commit_after> | #!/usr/bin/python
import csv
import sys
import getopt
def help():
print 'cartel-generation.py -c <input-csv-file> -o <output-svg-file>'
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hc:o:",["csv=","osvg="])
except getopt.GetoptError:
help()
sys... | Add a basic script with getopt to read command line parameters#!/usr/bin/python
import csv
import sys
import getopt
def help():
print 'cartel-generation.py -c <input-csv-file> -o <output-svg-file>'
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hc:o:",["csv=",... | <commit_before><commit_msg>Add a basic script with getopt to read command line parameters<commit_after>#!/usr/bin/python
import csv
import sys
import getopt
def help():
print 'cartel-generation.py -c <input-csv-file> -o <output-svg-file>'
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, a... | |
18eeec0557b8acc78849295d6f9358696296f8ad | make_inline_config.py | make_inline_config.py | # Transform config/index.html so that all of its image, font, CSS, and script
# dependencies are inlined, and convert the result into a data URI.
#
# This makes it possible to view the Urchin configuration page without an
# internet connection.
#
# See https://github.com/pebble/clay for a more robust implementation of ... | Add script to generate inlined config page | Add script to generate inlined config page
| Python | mit | mddub/urchin-cgm,mddub/urchin-cgm,mddub/urchin-cgm,mddub/urchin-cgm,mddub/urchin-cgm | Add script to generate inlined config page | # Transform config/index.html so that all of its image, font, CSS, and script
# dependencies are inlined, and convert the result into a data URI.
#
# This makes it possible to view the Urchin configuration page without an
# internet connection.
#
# See https://github.com/pebble/clay for a more robust implementation of ... | <commit_before><commit_msg>Add script to generate inlined config page<commit_after> | # Transform config/index.html so that all of its image, font, CSS, and script
# dependencies are inlined, and convert the result into a data URI.
#
# This makes it possible to view the Urchin configuration page without an
# internet connection.
#
# See https://github.com/pebble/clay for a more robust implementation of ... | Add script to generate inlined config page# Transform config/index.html so that all of its image, font, CSS, and script
# dependencies are inlined, and convert the result into a data URI.
#
# This makes it possible to view the Urchin configuration page without an
# internet connection.
#
# See https://github.com/pebble... | <commit_before><commit_msg>Add script to generate inlined config page<commit_after># Transform config/index.html so that all of its image, font, CSS, and script
# dependencies are inlined, and convert the result into a data URI.
#
# This makes it possible to view the Urchin configuration page without an
# internet conn... | |
f2a6897aaa20d2c5a312b1a87d5a7f515f3cdd4b | lightware_parse.py | lightware_parse.py | #!/usr/bin/env python
import serial
s = serial.Serial('/dev/ttyUSB0', baudrate=115200)
while True:
line = s.readline()
dist = line.lstrip(' ').split(' ')[0]
print dist
| Add lightware LRF parsing code | Add lightware LRF parsing code
| Python | mit | UCSD-E4E/aerial_lidar,UCSD-E4E/aerial_lidar,UCSD-E4E/aerial_lidar,UCSD-E4E/aerial_lidar,UCSD-E4E/aerial_lidar,UCSD-E4E/aerial_lidar | Add lightware LRF parsing code | #!/usr/bin/env python
import serial
s = serial.Serial('/dev/ttyUSB0', baudrate=115200)
while True:
line = s.readline()
dist = line.lstrip(' ').split(' ')[0]
print dist
| <commit_before><commit_msg>Add lightware LRF parsing code<commit_after> | #!/usr/bin/env python
import serial
s = serial.Serial('/dev/ttyUSB0', baudrate=115200)
while True:
line = s.readline()
dist = line.lstrip(' ').split(' ')[0]
print dist
| Add lightware LRF parsing code#!/usr/bin/env python
import serial
s = serial.Serial('/dev/ttyUSB0', baudrate=115200)
while True:
line = s.readline()
dist = line.lstrip(' ').split(' ')[0]
print dist
| <commit_before><commit_msg>Add lightware LRF parsing code<commit_after>#!/usr/bin/env python
import serial
s = serial.Serial('/dev/ttyUSB0', baudrate=115200)
while True:
line = s.readline()
dist = line.lstrip(' ').split(' ')[0]
print dist
| |
ab40c975c863ab7d19f05695473cb7c42ec33e9e | prototypes/fabfile.py | prototypes/fabfile.py |
def test_local_failures():
local('false 1', fail='ignore')
local('false 2', fail='warn')
local('echo must print')
local('false 3') # default fail is abort
local('echo must NOT print')
def test_remote_failures():
set(fab_hosts = ['127.0.0.1', 'localhost'])
run('false 1', fail='ignore')
... | Add a file for testing the fab_fail modes and possibly other stuff. | Add a file for testing the fab_fail modes and possibly other stuff.
| Python | bsd-2-clause | fernandezcuesta/fabric,mathiasertl/fabric,bspink/fabric,rane-hs/fabric-py3,itoed/fabric,sdelements/fabric,tolbkni/fabric,TarasRudnyk/fabric,tekapo/fabric,felix-d/fabric,qinrong/fabric,haridsv/fabric,likesxuqiang/fabric,xLegoz/fabric,bitprophet/fabric,ploxiln/fabric,StackStorm/fabric,amaniak/fabric,MjAbuz/fabric,cmattoo... | Add a file for testing the fab_fail modes and possibly other stuff. |
def test_local_failures():
local('false 1', fail='ignore')
local('false 2', fail='warn')
local('echo must print')
local('false 3') # default fail is abort
local('echo must NOT print')
def test_remote_failures():
set(fab_hosts = ['127.0.0.1', 'localhost'])
run('false 1', fail='ignore')
... | <commit_before><commit_msg>Add a file for testing the fab_fail modes and possibly other stuff.<commit_after> |
def test_local_failures():
local('false 1', fail='ignore')
local('false 2', fail='warn')
local('echo must print')
local('false 3') # default fail is abort
local('echo must NOT print')
def test_remote_failures():
set(fab_hosts = ['127.0.0.1', 'localhost'])
run('false 1', fail='ignore')
... | Add a file for testing the fab_fail modes and possibly other stuff.
def test_local_failures():
local('false 1', fail='ignore')
local('false 2', fail='warn')
local('echo must print')
local('false 3') # default fail is abort
local('echo must NOT print')
def test_remote_failures():
set(fab_hosts =... | <commit_before><commit_msg>Add a file for testing the fab_fail modes and possibly other stuff.<commit_after>
def test_local_failures():
local('false 1', fail='ignore')
local('false 2', fail='warn')
local('echo must print')
local('false 3') # default fail is abort
local('echo must NOT print')
def te... | |
ed6bafbed82b35913965a6d95ba11b4f3eaf4b02 | tests/test_model.py | tests/test_model.py | import ckanext.archiver.model as archiver_model
try:
from ckan.tests.helpers import reset_db
from ckan.tests import factories as ckan_factories
except ImportError:
from ckan.new_tests.helpers import reset_db
from ckan.new_tests import factories as ckan_factories
from ckan import model
Archival = archiv... | Test for previous ResourceGroup change. | Test for previous ResourceGroup change.
| Python | mit | datagovuk/ckanext-archiver,ckan/ckanext-archiver,ckan/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,ckan/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,datagovuk/ckanext-archiver,datagovuk/ckanext-archiver | Test for previous ResourceGroup change. | import ckanext.archiver.model as archiver_model
try:
from ckan.tests.helpers import reset_db
from ckan.tests import factories as ckan_factories
except ImportError:
from ckan.new_tests.helpers import reset_db
from ckan.new_tests import factories as ckan_factories
from ckan import model
Archival = archiv... | <commit_before><commit_msg>Test for previous ResourceGroup change.<commit_after> | import ckanext.archiver.model as archiver_model
try:
from ckan.tests.helpers import reset_db
from ckan.tests import factories as ckan_factories
except ImportError:
from ckan.new_tests.helpers import reset_db
from ckan.new_tests import factories as ckan_factories
from ckan import model
Archival = archiv... | Test for previous ResourceGroup change.import ckanext.archiver.model as archiver_model
try:
from ckan.tests.helpers import reset_db
from ckan.tests import factories as ckan_factories
except ImportError:
from ckan.new_tests.helpers import reset_db
from ckan.new_tests import factories as ckan_factories
fr... | <commit_before><commit_msg>Test for previous ResourceGroup change.<commit_after>import ckanext.archiver.model as archiver_model
try:
from ckan.tests.helpers import reset_db
from ckan.tests import factories as ckan_factories
except ImportError:
from ckan.new_tests.helpers import reset_db
from ckan.new_te... | |
f065102e7f6d302097418d6d8d07dd6e3cc38f11 | tests/test_money.py | tests/test_money.py | from decimal import Decimal
from django.test import TestCase
from shop.money.money_maker import AbstractMoney, MoneyMaker
class AbstractMoneyTest(TestCase):
def test_is_abstract(self):
self.assertRaises(TypeError, lambda: AbstractMoney(1))
class MoneyMakerTest(TestCase):
def test_create_new_mone... | Add a few simple tests for the money_maker module | Add a few simple tests for the money_maker module
| Python | bsd-3-clause | nimbis/django-shop,jrief/django-shop,nimbis/django-shop,awesto/django-shop,divio/django-shop,nimbis/django-shop,nimbis/django-shop,rfleschenberg/django-shop,awesto/django-shop,rfleschenberg/django-shop,rfleschenberg/django-shop,khchine5/django-shop,khchine5/django-shop,divio/django-shop,awesto/django-shop,khchine5/djan... | Add a few simple tests for the money_maker module | from decimal import Decimal
from django.test import TestCase
from shop.money.money_maker import AbstractMoney, MoneyMaker
class AbstractMoneyTest(TestCase):
def test_is_abstract(self):
self.assertRaises(TypeError, lambda: AbstractMoney(1))
class MoneyMakerTest(TestCase):
def test_create_new_mone... | <commit_before><commit_msg>Add a few simple tests for the money_maker module<commit_after> | from decimal import Decimal
from django.test import TestCase
from shop.money.money_maker import AbstractMoney, MoneyMaker
class AbstractMoneyTest(TestCase):
def test_is_abstract(self):
self.assertRaises(TypeError, lambda: AbstractMoney(1))
class MoneyMakerTest(TestCase):
def test_create_new_mone... | Add a few simple tests for the money_maker modulefrom decimal import Decimal
from django.test import TestCase
from shop.money.money_maker import AbstractMoney, MoneyMaker
class AbstractMoneyTest(TestCase):
def test_is_abstract(self):
self.assertRaises(TypeError, lambda: AbstractMoney(1))
class MoneyM... | <commit_before><commit_msg>Add a few simple tests for the money_maker module<commit_after>from decimal import Decimal
from django.test import TestCase
from shop.money.money_maker import AbstractMoney, MoneyMaker
class AbstractMoneyTest(TestCase):
def test_is_abstract(self):
self.assertRaises(TypeError,... | |
7536d46435bd4841f538a4d9ca6fc58b3b0113bf | test/569-duplicate-points.py | test/569-duplicate-points.py | import sys
def assert_no_repeated_points(coords):
last_coord = coords[0]
for i in range(1, len(coords)):
coord = coords[i]
if coord == last_coord:
raise Exception("Coordinate %r (at %d) == %r (at %d), but "
"coordinates should not be repeated." %
... | Add test for duplicate / repeated points. | Add test for duplicate / repeated points.
| Python | mit | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | Add test for duplicate / repeated points. | import sys
def assert_no_repeated_points(coords):
last_coord = coords[0]
for i in range(1, len(coords)):
coord = coords[i]
if coord == last_coord:
raise Exception("Coordinate %r (at %d) == %r (at %d), but "
"coordinates should not be repeated." %
... | <commit_before><commit_msg>Add test for duplicate / repeated points.<commit_after> | import sys
def assert_no_repeated_points(coords):
last_coord = coords[0]
for i in range(1, len(coords)):
coord = coords[i]
if coord == last_coord:
raise Exception("Coordinate %r (at %d) == %r (at %d), but "
"coordinates should not be repeated." %
... | Add test for duplicate / repeated points.import sys
def assert_no_repeated_points(coords):
last_coord = coords[0]
for i in range(1, len(coords)):
coord = coords[i]
if coord == last_coord:
raise Exception("Coordinate %r (at %d) == %r (at %d), but "
"coordi... | <commit_before><commit_msg>Add test for duplicate / repeated points.<commit_after>import sys
def assert_no_repeated_points(coords):
last_coord = coords[0]
for i in range(1, len(coords)):
coord = coords[i]
if coord == last_coord:
raise Exception("Coordinate %r (at %d) == %r (at %d), ... | |
3f0a0b200b7bc1d1d054d7d3982f1fafae2318c1 | eheritage/injest/qld_ehp_site_parser.py | eheritage/injest/qld_ehp_site_parser.py | # import requests
import lxml.html
import sys
with open(sys.argv[1]) as f:
data = f.read()
dom = lxml.html.fromstring(data)
for el in dom.xpath("//div[@class='article']//td[@class='formLayoutLabelTD']"):
name = el.findtext('.').strip()
print name
# if name == 'Place Components':
... | Add some code for screen scraping QLD data | Add some code for screen scraping QLD data
| Python | bsd-3-clause | uq-eresearch/eheritage,uq-eresearch/eheritage,uq-eresearch/eheritage | Add some code for screen scraping QLD data | # import requests
import lxml.html
import sys
with open(sys.argv[1]) as f:
data = f.read()
dom = lxml.html.fromstring(data)
for el in dom.xpath("//div[@class='article']//td[@class='formLayoutLabelTD']"):
name = el.findtext('.').strip()
print name
# if name == 'Place Components':
... | <commit_before><commit_msg>Add some code for screen scraping QLD data<commit_after> | # import requests
import lxml.html
import sys
with open(sys.argv[1]) as f:
data = f.read()
dom = lxml.html.fromstring(data)
for el in dom.xpath("//div[@class='article']//td[@class='formLayoutLabelTD']"):
name = el.findtext('.').strip()
print name
# if name == 'Place Components':
... | Add some code for screen scraping QLD data# import requests
import lxml.html
import sys
with open(sys.argv[1]) as f:
data = f.read()
dom = lxml.html.fromstring(data)
for el in dom.xpath("//div[@class='article']//td[@class='formLayoutLabelTD']"):
name = el.findtext('.').strip()
print name
... | <commit_before><commit_msg>Add some code for screen scraping QLD data<commit_after># import requests
import lxml.html
import sys
with open(sys.argv[1]) as f:
data = f.read()
dom = lxml.html.fromstring(data)
for el in dom.xpath("//div[@class='article']//td[@class='formLayoutLabelTD']"):
name = el.... | |
84e68dd23b031785aea517daf7c1f760587c44ff | tests/test_core/test_auth.py | tests/test_core/test_auth.py | """Test kytos.core.auth module."""
import getpass
from unittest import TestCase
from unittest.mock import patch
def input_password():
"""Get password value"""
password = getpass.getpass()
return password
def input_value():
"""Get input value"""
value = input()
return value
class TestAuth(T... | Create unit test for Auth module | Create unit test for Auth module
| Python | mit | kytos/kyco,kytos/kytos | Create unit test for Auth module | """Test kytos.core.auth module."""
import getpass
from unittest import TestCase
from unittest.mock import patch
def input_password():
"""Get password value"""
password = getpass.getpass()
return password
def input_value():
"""Get input value"""
value = input()
return value
class TestAuth(T... | <commit_before><commit_msg>Create unit test for Auth module<commit_after> | """Test kytos.core.auth module."""
import getpass
from unittest import TestCase
from unittest.mock import patch
def input_password():
"""Get password value"""
password = getpass.getpass()
return password
def input_value():
"""Get input value"""
value = input()
return value
class TestAuth(T... | Create unit test for Auth module"""Test kytos.core.auth module."""
import getpass
from unittest import TestCase
from unittest.mock import patch
def input_password():
"""Get password value"""
password = getpass.getpass()
return password
def input_value():
"""Get input value"""
value = input()
... | <commit_before><commit_msg>Create unit test for Auth module<commit_after>"""Test kytos.core.auth module."""
import getpass
from unittest import TestCase
from unittest.mock import patch
def input_password():
"""Get password value"""
password = getpass.getpass()
return password
def input_value():
"""G... | |
7d1d1a073971b97680e9a9316bd199acebc9919d | gem/migrations/0014_add_default_tags.py | gem/migrations/0014_add_default_tags.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from molo.core.models import (
SiteLanguage, Tag, TagIndexPage, Main, PageTranslation)
def add_default_tags(apps, schema_editor):
main_lang = SiteLanguage.objects.filter(
is_active=True, is_main_language=... | Add migration for default tags | Add migration for default tags
| Python | bsd-2-clause | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | Add migration for default tags | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from molo.core.models import (
SiteLanguage, Tag, TagIndexPage, Main, PageTranslation)
def add_default_tags(apps, schema_editor):
main_lang = SiteLanguage.objects.filter(
is_active=True, is_main_language=... | <commit_before><commit_msg>Add migration for default tags<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from molo.core.models import (
SiteLanguage, Tag, TagIndexPage, Main, PageTranslation)
def add_default_tags(apps, schema_editor):
main_lang = SiteLanguage.objects.filter(
is_active=True, is_main_language=... | Add migration for default tags# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from molo.core.models import (
SiteLanguage, Tag, TagIndexPage, Main, PageTranslation)
def add_default_tags(apps, schema_editor):
main_lang = SiteLanguage.objects.filter(
is_... | <commit_before><commit_msg>Add migration for default tags<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from molo.core.models import (
SiteLanguage, Tag, TagIndexPage, Main, PageTranslation)
def add_default_tags(apps, schema_editor):
main_lang =... | |
7f04090c574b48b0e1de4590017c7f9960c515fb | nova/policies/ips.py | nova/policies/ips.py | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Add policy description for Servers IPs | Add policy description for Servers IPs
This commit adds policy doc for Servers IPs policies.
Partial implement blueprint policy-docs
Change-Id: I94a7c023dd97413d30f5be9edc313caeb47cb633
| Python | apache-2.0 | vmturbo/nova,mikalstill/nova,gooddata/openstack-nova,openstack/nova,Juniper/nova,rahulunair/nova,vmturbo/nova,rajalokan/nova,Juniper/nova,gooddata/openstack-nova,vmturbo/nova,rahulunair/nova,vmturbo/nova,mahak/nova,rahulunair/nova,rajalokan/nova,rajalokan/nova,mikalstill/nova,klmitch/nova,klmitch/nova,gooddata/openstac... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | <commit_before># Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | <commit_before># Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... |
37e6ae1dfaa0b3d4615c29236e6783a8f685ebc0 | mangacork/scripts/check_len_chapter.py | mangacork/scripts/check_len_chapter.py | import os
from os.path import (isfile, walk)
filename = ''
def id_chapters():
print(os.chdir('../static/images'))
for root, dirs, files in os.walk(os.getcwd()):
if len(dirs) > 0:
filename = str(dirs[0])
def write_file():
f = open(filename, 'w')
f.write('hello world')
f.close... | Add script to write chapter | Add script to write chapter
| Python | mit | ma3lstrom/manga-cork,ma3lstrom/manga-cork,ma3lstrom/manga-cork | Add script to write chapter | import os
from os.path import (isfile, walk)
filename = ''
def id_chapters():
print(os.chdir('../static/images'))
for root, dirs, files in os.walk(os.getcwd()):
if len(dirs) > 0:
filename = str(dirs[0])
def write_file():
f = open(filename, 'w')
f.write('hello world')
f.close... | <commit_before><commit_msg>Add script to write chapter<commit_after> | import os
from os.path import (isfile, walk)
filename = ''
def id_chapters():
print(os.chdir('../static/images'))
for root, dirs, files in os.walk(os.getcwd()):
if len(dirs) > 0:
filename = str(dirs[0])
def write_file():
f = open(filename, 'w')
f.write('hello world')
f.close... | Add script to write chapterimport os
from os.path import (isfile, walk)
filename = ''
def id_chapters():
print(os.chdir('../static/images'))
for root, dirs, files in os.walk(os.getcwd()):
if len(dirs) > 0:
filename = str(dirs[0])
def write_file():
f = open(filename, 'w')
f.write... | <commit_before><commit_msg>Add script to write chapter<commit_after>import os
from os.path import (isfile, walk)
filename = ''
def id_chapters():
print(os.chdir('../static/images'))
for root, dirs, files in os.walk(os.getcwd()):
if len(dirs) > 0:
filename = str(dirs[0])
def write_file()... | |
c7a73618be923f5e191e4334728b52fca1300a21 | indra/databases/mgi_client.py | indra/databases/mgi_client.py | from collections import defaultdict
from indra.util import read_unicode_csv
from indra.resources import get_resource_path
def get_id_from_name(name):
return mgi_name_to_id.get(name)
def get_name_from_id(mgi_id):
return mgi_id_to_name.get(mgi_id)
def get_synonyms(mgi_id):
return mgi_synonyms.get(mgi_i... | Add initial MGI client implementation | Add initial MGI client implementation
| Python | bsd-2-clause | bgyori/indra,sorgerlab/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra,bgyori/indra | Add initial MGI client implementation | from collections import defaultdict
from indra.util import read_unicode_csv
from indra.resources import get_resource_path
def get_id_from_name(name):
return mgi_name_to_id.get(name)
def get_name_from_id(mgi_id):
return mgi_id_to_name.get(mgi_id)
def get_synonyms(mgi_id):
return mgi_synonyms.get(mgi_i... | <commit_before><commit_msg>Add initial MGI client implementation<commit_after> | from collections import defaultdict
from indra.util import read_unicode_csv
from indra.resources import get_resource_path
def get_id_from_name(name):
return mgi_name_to_id.get(name)
def get_name_from_id(mgi_id):
return mgi_id_to_name.get(mgi_id)
def get_synonyms(mgi_id):
return mgi_synonyms.get(mgi_i... | Add initial MGI client implementationfrom collections import defaultdict
from indra.util import read_unicode_csv
from indra.resources import get_resource_path
def get_id_from_name(name):
return mgi_name_to_id.get(name)
def get_name_from_id(mgi_id):
return mgi_id_to_name.get(mgi_id)
def get_synonyms(mgi_i... | <commit_before><commit_msg>Add initial MGI client implementation<commit_after>from collections import defaultdict
from indra.util import read_unicode_csv
from indra.resources import get_resource_path
def get_id_from_name(name):
return mgi_name_to_id.get(name)
def get_name_from_id(mgi_id):
return mgi_id_to_... | |
4a985c3695c5781ab90c35b929eb21c3207d11ff | bluebottle/files/tests/test_models.py | bluebottle/files/tests/test_models.py | from django.test import TestCase
from bluebottle.files.tests.factories import ImageFactory
class FileTestCase(TestCase):
def test_file_properties(self):
image = ImageFactory.create()
self.assertEqual(str(image), str(image.id))
self.assertGreater(len(str(image)), 8)
| Add test for file model | Add test for file model
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Add test for file model | from django.test import TestCase
from bluebottle.files.tests.factories import ImageFactory
class FileTestCase(TestCase):
def test_file_properties(self):
image = ImageFactory.create()
self.assertEqual(str(image), str(image.id))
self.assertGreater(len(str(image)), 8)
| <commit_before><commit_msg>Add test for file model<commit_after> | from django.test import TestCase
from bluebottle.files.tests.factories import ImageFactory
class FileTestCase(TestCase):
def test_file_properties(self):
image = ImageFactory.create()
self.assertEqual(str(image), str(image.id))
self.assertGreater(len(str(image)), 8)
| Add test for file modelfrom django.test import TestCase
from bluebottle.files.tests.factories import ImageFactory
class FileTestCase(TestCase):
def test_file_properties(self):
image = ImageFactory.create()
self.assertEqual(str(image), str(image.id))
self.assertGreater(len(str(image)), 8)... | <commit_before><commit_msg>Add test for file model<commit_after>from django.test import TestCase
from bluebottle.files.tests.factories import ImageFactory
class FileTestCase(TestCase):
def test_file_properties(self):
image = ImageFactory.create()
self.assertEqual(str(image), str(image.id))
... | |
860440c97fe9d972ba72d56e5ef18a278f0597c0 | svg-xml-script-template.py | svg-xml-script-template.py | #!/usr/bin/env python3
"""
SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
SPDX-FileCopyrightText: 2020 Noah Davis <[email protected]>
SPDX-FileCopyrightText: 2020 Niccolò Venerandi <[email protected]>
"""
import sys
from lxml import etree
"""
This is a template for making scripts that modify SVGs by parsing... | Add template for making python scripts that edit SVGs | Add template for making python scripts that edit SVGs
| Python | lgpl-2.1 | KDE/breeze-icons,KDE/breeze-icons,KDE/breeze-icons,KDE/breeze-icons,KDE/breeze-icons | Add template for making python scripts that edit SVGs | #!/usr/bin/env python3
"""
SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
SPDX-FileCopyrightText: 2020 Noah Davis <[email protected]>
SPDX-FileCopyrightText: 2020 Niccolò Venerandi <[email protected]>
"""
import sys
from lxml import etree
"""
This is a template for making scripts that modify SVGs by parsing... | <commit_before><commit_msg>Add template for making python scripts that edit SVGs<commit_after> | #!/usr/bin/env python3
"""
SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
SPDX-FileCopyrightText: 2020 Noah Davis <[email protected]>
SPDX-FileCopyrightText: 2020 Niccolò Venerandi <[email protected]>
"""
import sys
from lxml import etree
"""
This is a template for making scripts that modify SVGs by parsing... | Add template for making python scripts that edit SVGs#!/usr/bin/env python3
"""
SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
SPDX-FileCopyrightText: 2020 Noah Davis <[email protected]>
SPDX-FileCopyrightText: 2020 Niccolò Venerandi <[email protected]>
"""
import sys
from lxml import etree
"""
This is a te... | <commit_before><commit_msg>Add template for making python scripts that edit SVGs<commit_after>#!/usr/bin/env python3
"""
SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
SPDX-FileCopyrightText: 2020 Noah Davis <[email protected]>
SPDX-FileCopyrightText: 2020 Niccolò Venerandi <[email protected]>
"""
import sy... | |
97db65bc9ece1ffef292b60b67391182cdaae8fb | migrations/versions/0133_set_services_sms_prefix.py | migrations/versions/0133_set_services_sms_prefix.py | import os
from app import config
"""
Revision ID: 0133_set_services_sms_prefix
Revises: 0132_add_sms_prefix_setting
Create Date: 2017-11-03 15:55:35.657488
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0133_set_services_sms_prefix'
down_revision = '0132_add... | Migrate prefix SMS setting to be true or false | Migrate prefix SMS setting to be true or false
We want services to have control over this setting, rather than deriving
it from the value of their sender. This commit does that derivation one
last time, and stores it in the column, where it can be changed as and
when needed.
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Migrate prefix SMS setting to be true or false
We want services to have control over this setting, rather than deriving
it from the value of their sender. This commit does that derivation one
last time, and stores it in the column, where it can be changed as and
when needed. | import os
from app import config
"""
Revision ID: 0133_set_services_sms_prefix
Revises: 0132_add_sms_prefix_setting
Create Date: 2017-11-03 15:55:35.657488
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0133_set_services_sms_prefix'
down_revision = '0132_add... | <commit_before><commit_msg>Migrate prefix SMS setting to be true or false
We want services to have control over this setting, rather than deriving
it from the value of their sender. This commit does that derivation one
last time, and stores it in the column, where it can be changed as and
when needed.<commit_after> | import os
from app import config
"""
Revision ID: 0133_set_services_sms_prefix
Revises: 0132_add_sms_prefix_setting
Create Date: 2017-11-03 15:55:35.657488
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0133_set_services_sms_prefix'
down_revision = '0132_add... | Migrate prefix SMS setting to be true or false
We want services to have control over this setting, rather than deriving
it from the value of their sender. This commit does that derivation one
last time, and stores it in the column, where it can be changed as and
when needed.import os
from app import config
"""
Revisi... | <commit_before><commit_msg>Migrate prefix SMS setting to be true or false
We want services to have control over this setting, rather than deriving
it from the value of their sender. This commit does that derivation one
last time, and stores it in the column, where it can be changed as and
when needed.<commit_after>imp... | |
159006e87cbbb08689284ae2534f556f66c0159b | alabaster/__init__.py | alabaster/__init__.py | import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pagename, template... | import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pagename, template... | Declare extension version and parallel read safety | Declare extension version and parallel read safety
This is necessary for Sphinx' parallel read feature to work, since we import alabaster all the time now. | Python | bsd-3-clause | bgeron/alabaster,jupytercalpoly/jupyter-alabaster-theme,ellisonbg/jupyter-alabaster-theme,nikolas/alabaster,charnpreetsingh/jupyter-alabaster-theme,jupytercalpoly/jupyter-alabaster-theme,charnpreetsingh/jupyter-alabaster-theme,bgeron/alabaster,ellisonbg/jupyter-alabaster-theme,nikolas/alabaster,charnpreetsingh/jupyter-... | import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pagename, template... | import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pagename, template... | <commit_before>import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pag... | import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pagename, template... | import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pagename, template... | <commit_before>import os
from alabaster import _version as version
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pag... |
71ddadda05f70e53ee3d7ec496797c11ad080583 | tests/functional/test_lintmigrations_command.py | tests/functional/test_lintmigrations_command.py | from unittest.mock import patch
from django.core.management import call_command
from django.test import TransactionTestCase
class LintMigrationsCommandTestCase(TransactionTestCase):
databases = {"default", "sqlite"}
def test_plain(self):
with self.assertRaises(SystemExit):
call_command("... | Add funtional tests for lintmigrations command | Add funtional tests for lintmigrations command
| Python | apache-2.0 | 3YOURMIND/django-migration-linter | Add funtional tests for lintmigrations command | from unittest.mock import patch
from django.core.management import call_command
from django.test import TransactionTestCase
class LintMigrationsCommandTestCase(TransactionTestCase):
databases = {"default", "sqlite"}
def test_plain(self):
with self.assertRaises(SystemExit):
call_command("... | <commit_before><commit_msg>Add funtional tests for lintmigrations command<commit_after> | from unittest.mock import patch
from django.core.management import call_command
from django.test import TransactionTestCase
class LintMigrationsCommandTestCase(TransactionTestCase):
databases = {"default", "sqlite"}
def test_plain(self):
with self.assertRaises(SystemExit):
call_command("... | Add funtional tests for lintmigrations commandfrom unittest.mock import patch
from django.core.management import call_command
from django.test import TransactionTestCase
class LintMigrationsCommandTestCase(TransactionTestCase):
databases = {"default", "sqlite"}
def test_plain(self):
with self.assert... | <commit_before><commit_msg>Add funtional tests for lintmigrations command<commit_after>from unittest.mock import patch
from django.core.management import call_command
from django.test import TransactionTestCase
class LintMigrationsCommandTestCase(TransactionTestCase):
databases = {"default", "sqlite"}
def t... | |
3cc84213d5d4c552705a8fdbf999b6dd9e428ebe | tests/test_channel_shim.py | tests/test_channel_shim.py | import gevent
from gevent import queue
from wal_e import channel
def test_channel_shim():
v = tuple(int(x) for x in gevent.__version__.split('.'))
if v >= (0, 13, 0) and v < (1, 0, 0):
assert isinstance(channel.Channel(), queue.Queue)
elif v >= (1, 0, 0):
assert isinstance(channel.Channe... | Add some checks that the Channel shim chooses gevent.queue.Channel | Add some checks that the Channel shim chooses gevent.queue.Channel
Previously, there was no checks to make sure that gevent.queue.Channel
was used when possible.
| Python | bsd-3-clause | DataDog/wal-e,equa/wal-e,heroku/wal-e,wal-e/wal-e,fdr/wal-e,nagual13/wal-e,x86Labs/wal-e,RichardKnop/wal-e,intoximeters/wal-e,ArtemZ/wal-e,ajmarks/wal-e,tenstartups/wal-e | Add some checks that the Channel shim chooses gevent.queue.Channel
Previously, there was no checks to make sure that gevent.queue.Channel
was used when possible. | import gevent
from gevent import queue
from wal_e import channel
def test_channel_shim():
v = tuple(int(x) for x in gevent.__version__.split('.'))
if v >= (0, 13, 0) and v < (1, 0, 0):
assert isinstance(channel.Channel(), queue.Queue)
elif v >= (1, 0, 0):
assert isinstance(channel.Channe... | <commit_before><commit_msg>Add some checks that the Channel shim chooses gevent.queue.Channel
Previously, there was no checks to make sure that gevent.queue.Channel
was used when possible.<commit_after> | import gevent
from gevent import queue
from wal_e import channel
def test_channel_shim():
v = tuple(int(x) for x in gevent.__version__.split('.'))
if v >= (0, 13, 0) and v < (1, 0, 0):
assert isinstance(channel.Channel(), queue.Queue)
elif v >= (1, 0, 0):
assert isinstance(channel.Channe... | Add some checks that the Channel shim chooses gevent.queue.Channel
Previously, there was no checks to make sure that gevent.queue.Channel
was used when possible.import gevent
from gevent import queue
from wal_e import channel
def test_channel_shim():
v = tuple(int(x) for x in gevent.__version__.split('.'))
... | <commit_before><commit_msg>Add some checks that the Channel shim chooses gevent.queue.Channel
Previously, there was no checks to make sure that gevent.queue.Channel
was used when possible.<commit_after>import gevent
from gevent import queue
from wal_e import channel
def test_channel_shim():
v = tuple(int(x) for... | |
45a165c5516f3658e45073c0689748dd8b39cadb | migrations/versions/8da7405903f6_.py | migrations/versions/8da7405903f6_.py | """Add BackgroundTasks settings table.
Revision ID: 8da7405903f6
Revises: 69efa7247067
Create Date: 2020-09-05 20:02:53.642956
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8da7405903f6'
down_revision = '69efa7247067'
branch_labels = None
depends_on = None
... | Add BackgroundTasks table migration file. | Add BackgroundTasks table migration file.
| Python | mpl-2.0 | mrf345/FQM,mrf345/FQM,mrf345/FQM,mrf345/FQM | Add BackgroundTasks table migration file. | """Add BackgroundTasks settings table.
Revision ID: 8da7405903f6
Revises: 69efa7247067
Create Date: 2020-09-05 20:02:53.642956
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8da7405903f6'
down_revision = '69efa7247067'
branch_labels = None
depends_on = None
... | <commit_before><commit_msg>Add BackgroundTasks table migration file.<commit_after> | """Add BackgroundTasks settings table.
Revision ID: 8da7405903f6
Revises: 69efa7247067
Create Date: 2020-09-05 20:02:53.642956
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8da7405903f6'
down_revision = '69efa7247067'
branch_labels = None
depends_on = None
... | Add BackgroundTasks table migration file."""Add BackgroundTasks settings table.
Revision ID: 8da7405903f6
Revises: 69efa7247067
Create Date: 2020-09-05 20:02:53.642956
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8da7405903f6'
down_revision = '69efa7247067'... | <commit_before><commit_msg>Add BackgroundTasks table migration file.<commit_after>"""Add BackgroundTasks settings table.
Revision ID: 8da7405903f6
Revises: 69efa7247067
Create Date: 2020-09-05 20:02:53.642956
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8da... | |
7cfe8666e9146a9065b9942a5bdf16d4f1acd44d | utils/graph500-generator/graph500-binary-to-text.py | utils/graph500-generator/graph500-binary-to-text.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# © 2014 Mihai Capotă
"""Transform the output of the Graph 500 generator into text."""
from __future__ import division, print_function
import argparse
import struct
def main():
argparser = argparse.ArgumentParser()
argparser.add_... | Add script to decode Graph 500 generator output | Add script to decode Graph 500 generator output
| Python | apache-2.0 | tudelft-atlarge/graphalytics,tudelft-atlarge/graphalytics,tudelft-atlarge/graphalytics,tudelft-atlarge/graphalytics,ldbc/ldbc_graphalytics,ldbc/ldbc_graphalytics,tudelft-atlarge/graphalytics,ldbc/ldbc_graphalytics,ldbc/ldbc_graphalytics,ldbc/ldbc_graphalytics | Add script to decode Graph 500 generator output | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# © 2014 Mihai Capotă
"""Transform the output of the Graph 500 generator into text."""
from __future__ import division, print_function
import argparse
import struct
def main():
argparser = argparse.ArgumentParser()
argparser.add_... | <commit_before><commit_msg>Add script to decode Graph 500 generator output<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# © 2014 Mihai Capotă
"""Transform the output of the Graph 500 generator into text."""
from __future__ import division, print_function
import argparse
import struct
def main():
argparser = argparse.ArgumentParser()
argparser.add_... | Add script to decode Graph 500 generator output#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# © 2014 Mihai Capotă
"""Transform the output of the Graph 500 generator into text."""
from __future__ import division, print_function
import argparse
import struct
def main():
argparser ... | <commit_before><commit_msg>Add script to decode Graph 500 generator output<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# © 2014 Mihai Capotă
"""Transform the output of the Graph 500 generator into text."""
from __future__ import division, print_function
import argparse
i... | |
dd70fcd512962c5248928a1c9b897fc33249f567 | judge/utils/views.py | judge/utils/views.py | from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
'title'... | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
__author__ = 'Quantum'
def generic_message(request, title, message, status=None):
return render(request, 'generic_message.jade', {
'message': message,
'title': title
}, status=status)
class TitleMi... | Use the render shortcut which defaults to RequestContext and allows passing a status code | Use the render shortcut which defaults to RequestContext and allows passing a status code
| Python | agpl-3.0 | Minkov/site,monouno/site,monouno/site,Phoenix1369/site,DMOJ/site,monouno/site,DMOJ/site,Minkov/site,Phoenix1369/site,DMOJ/site,Minkov/site,Phoenix1369/site,monouno/site,monouno/site,DMOJ/site,Minkov/site,Phoenix1369/site | from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
'title'... | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
__author__ = 'Quantum'
def generic_message(request, title, message, status=None):
return render(request, 'generic_message.jade', {
'message': message,
'title': title
}, status=status)
class TitleMi... | <commit_before>from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
... | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
__author__ = 'Quantum'
def generic_message(request, title, message, status=None):
return render(request, 'generic_message.jade', {
'message': message,
'title': title
}, status=status)
class TitleMi... | from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
'title'... | <commit_before>from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
... |
b3790a607a9f48561ce7a3da9242927510974808 | packs/rackspace/actions/lib/action.py | packs/rackspace/actions/lib/action.py | from st2actions.runners.pythonrunner import Action
import pyrax
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username = self.config['u... | import pyrax
from st2actions.runners.pythonrunner import Action
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username = self.config[... | Make sure region name is uppercase. | Make sure region name is uppercase.
| Python | apache-2.0 | jtopjian/st2contrib,tonybaloney/st2contrib,pidah/st2contrib,armab/st2contrib,StackStorm/st2contrib,pinterb/st2contrib,meirwah/st2contrib,psychopenguin/st2contrib,dennybaa/st2contrib,pearsontechnology/st2contrib,lmEshoo/st2contrib,tonybaloney/st2contrib,meirwah/st2contrib,pearsontechnology/st2contrib,tonybaloney/st2cont... | from st2actions.runners.pythonrunner import Action
import pyrax
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username = self.config['u... | import pyrax
from st2actions.runners.pythonrunner import Action
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username = self.config[... | <commit_before>from st2actions.runners.pythonrunner import Action
import pyrax
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username =... | import pyrax
from st2actions.runners.pythonrunner import Action
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username = self.config[... | from st2actions.runners.pythonrunner import Action
import pyrax
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username = self.config['u... | <commit_before>from st2actions.runners.pythonrunner import Action
import pyrax
__all__ = [
'PyraxBaseAction'
]
class PyraxBaseAction(Action):
def __init__(self, config):
super(PyraxBaseAction, self).__init__(config)
self.pyrax = self._get_client()
def _get_client(self):
username =... |
dff45c77bfd2dcb6a51fb259e2de1f14c2c7e587 | euler005.py | euler005.py | #!/usr/bin/python
from math import pow, sqrt, log, floor
from functools import reduce
LIMIT = 21
"""
Python version of my old first attempt to solve this
"""
factors = [0] * LIMIT
for dividend in range (2, LIMIT):
x = dividend
for i in range (2,x):
factor = 2
while i > 1:
count =... | Add solutions for problem 5 | Add solutions for problem 5
| Python | mit | cifvts/PyEuler | Add solutions for problem 5 | #!/usr/bin/python
from math import pow, sqrt, log, floor
from functools import reduce
LIMIT = 21
"""
Python version of my old first attempt to solve this
"""
factors = [0] * LIMIT
for dividend in range (2, LIMIT):
x = dividend
for i in range (2,x):
factor = 2
while i > 1:
count =... | <commit_before><commit_msg>Add solutions for problem 5<commit_after> | #!/usr/bin/python
from math import pow, sqrt, log, floor
from functools import reduce
LIMIT = 21
"""
Python version of my old first attempt to solve this
"""
factors = [0] * LIMIT
for dividend in range (2, LIMIT):
x = dividend
for i in range (2,x):
factor = 2
while i > 1:
count =... | Add solutions for problem 5#!/usr/bin/python
from math import pow, sqrt, log, floor
from functools import reduce
LIMIT = 21
"""
Python version of my old first attempt to solve this
"""
factors = [0] * LIMIT
for dividend in range (2, LIMIT):
x = dividend
for i in range (2,x):
factor = 2
while... | <commit_before><commit_msg>Add solutions for problem 5<commit_after>#!/usr/bin/python
from math import pow, sqrt, log, floor
from functools import reduce
LIMIT = 21
"""
Python version of my old first attempt to solve this
"""
factors = [0] * LIMIT
for dividend in range (2, LIMIT):
x = dividend
for i in rang... | |
7f41195e85c468f495beb320bf574e664b17fb12 | scripts/osfstorage/migrate_metadata.py | scripts/osfstorage/migrate_metadata.py | # -*- coding: utf-8 -*-
"""Script which ensures that every file version's
content_type, size, and date_modified fields are consistent
with the metadata from waterbutler.
"""
from website.addons.osfstorage.model import OsfStorageFileVersion
def main():
for each in OsfStorageFileVersion.find():
each.update_... | Add migration script to ensure metadata fields are set | Add migration script to ensure metadata fields are set
| Python | apache-2.0 | leb2dg/osf.io,MerlinZhang/osf.io,KAsante95/osf.io,GaryKriebel/osf.io,reinaH/osf.io,ticklemepierce/osf.io,pattisdr/osf.io,billyhunt/osf.io,Nesiehr/osf.io,brianjgeiger/osf.io,samchrisinger/osf.io,danielneis/osf.io,zamattiac/osf.io,felliott/osf.io,chennan47/osf.io,TomBaxter/osf.io,icereval/osf.io,emetsger/osf.io,Nesiehr/o... | Add migration script to ensure metadata fields are set | # -*- coding: utf-8 -*-
"""Script which ensures that every file version's
content_type, size, and date_modified fields are consistent
with the metadata from waterbutler.
"""
from website.addons.osfstorage.model import OsfStorageFileVersion
def main():
for each in OsfStorageFileVersion.find():
each.update_... | <commit_before><commit_msg>Add migration script to ensure metadata fields are set<commit_after> | # -*- coding: utf-8 -*-
"""Script which ensures that every file version's
content_type, size, and date_modified fields are consistent
with the metadata from waterbutler.
"""
from website.addons.osfstorage.model import OsfStorageFileVersion
def main():
for each in OsfStorageFileVersion.find():
each.update_... | Add migration script to ensure metadata fields are set# -*- coding: utf-8 -*-
"""Script which ensures that every file version's
content_type, size, and date_modified fields are consistent
with the metadata from waterbutler.
"""
from website.addons.osfstorage.model import OsfStorageFileVersion
def main():
for each... | <commit_before><commit_msg>Add migration script to ensure metadata fields are set<commit_after># -*- coding: utf-8 -*-
"""Script which ensures that every file version's
content_type, size, and date_modified fields are consistent
with the metadata from waterbutler.
"""
from website.addons.osfstorage.model import OsfStor... | |
625e2335878b711ce16901b1beb378e74747f7ab | tools/dev/mklog.py | tools/dev/mklog.py | #!/usr/bin/env python
#
# Read a diff from stdin, and output a log message template to stdout.
# Hint: It helps if the diff was generated using 'svn diff -x -p'
#
# Note: Don't completely trust the generated log message. This script
# depends on the correct output of 'diff -x -p', which can sometimes get
# confused.
... | Add a new script which can potentially be used to generate log message templates in the Subversion-approved format. | Add a new script which can potentially be used to generate log message
templates in the Subversion-approved format.
It is currently really stupid; I'm committing it in the hopes that others
find it useful and can improve upon it.
* tools/dev/mklog.py:
New.
| Python | apache-2.0 | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | Add a new script which can potentially be used to generate log message
templates in the Subversion-approved format.
It is currently really stupid; I'm committing it in the hopes that others
find it useful and can improve upon it.
* tools/dev/mklog.py:
New. | #!/usr/bin/env python
#
# Read a diff from stdin, and output a log message template to stdout.
# Hint: It helps if the diff was generated using 'svn diff -x -p'
#
# Note: Don't completely trust the generated log message. This script
# depends on the correct output of 'diff -x -p', which can sometimes get
# confused.
... | <commit_before><commit_msg>Add a new script which can potentially be used to generate log message
templates in the Subversion-approved format.
It is currently really stupid; I'm committing it in the hopes that others
find it useful and can improve upon it.
* tools/dev/mklog.py:
New.<commit_after> | #!/usr/bin/env python
#
# Read a diff from stdin, and output a log message template to stdout.
# Hint: It helps if the diff was generated using 'svn diff -x -p'
#
# Note: Don't completely trust the generated log message. This script
# depends on the correct output of 'diff -x -p', which can sometimes get
# confused.
... | Add a new script which can potentially be used to generate log message
templates in the Subversion-approved format.
It is currently really stupid; I'm committing it in the hopes that others
find it useful and can improve upon it.
* tools/dev/mklog.py:
New.#!/usr/bin/env python
#
# Read a diff from stdin, and output... | <commit_before><commit_msg>Add a new script which can potentially be used to generate log message
templates in the Subversion-approved format.
It is currently really stupid; I'm committing it in the hopes that others
find it useful and can improve upon it.
* tools/dev/mklog.py:
New.<commit_after>#!/usr/bin/env pyth... | |
16144d2edf80d634182e1ff185dc4f39e467871d | st2common/tests/unit/test_util_payload.py | st2common/tests/unit/test_util_payload.py | # -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Licen... | Add tests for new payload module | Add tests for new payload module
| Python | apache-2.0 | nzlosh/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,StackStorm/st2 | Add tests for new payload module | # -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Licen... | <commit_before><commit_msg>Add tests for new payload module<commit_after> | # -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Licen... | Add tests for new payload module# -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache Li... | <commit_before><commit_msg>Add tests for new payload module<commit_after># -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF lice... | |
2038e57a88ceebf35ec8196c12d0e075bdf98003 | buedafab/deploy/utils.py | buedafab/deploy/utils.py | """General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the submodules as ... | """General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the submodules as ... | Fix variable we're looking for. | Fix variable we're looking for.
| Python | mit | bueda/ops,alexmerser/ops,madteckhead/ops,spbrien/bueda-ops | """General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the submodules as ... | """General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the submodules as ... | <commit_before>"""General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the... | """General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the submodules as ... | """General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the submodules as ... | <commit_before>"""General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the... |
7031126f3839a389b16d48404e5ad085d815fe83 | py/solve-the-equation.py | py/solve-the-equation.py | import re
class Solution(object):
def solveEquation(self, equation):
"""
:type equation: str
:rtype: str
"""
lhs, rhs = equation.split('=')
lcoef = sum(int(m + "1" if m in ["-", "+", ""] else m) for m in re.findall(r'([+-]?\d*)x', lhs))
rcoef = sum(int(m + "1"... | Add py solution for 640. Solve the Equation | Add py solution for 640. Solve the Equation
640. Solve the Equation: https://leetcode.com/problems/solve-the-equation/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 640. Solve the Equation
640. Solve the Equation: https://leetcode.com/problems/solve-the-equation/ | import re
class Solution(object):
def solveEquation(self, equation):
"""
:type equation: str
:rtype: str
"""
lhs, rhs = equation.split('=')
lcoef = sum(int(m + "1" if m in ["-", "+", ""] else m) for m in re.findall(r'([+-]?\d*)x', lhs))
rcoef = sum(int(m + "1"... | <commit_before><commit_msg>Add py solution for 640. Solve the Equation
640. Solve the Equation: https://leetcode.com/problems/solve-the-equation/<commit_after> | import re
class Solution(object):
def solveEquation(self, equation):
"""
:type equation: str
:rtype: str
"""
lhs, rhs = equation.split('=')
lcoef = sum(int(m + "1" if m in ["-", "+", ""] else m) for m in re.findall(r'([+-]?\d*)x', lhs))
rcoef = sum(int(m + "1"... | Add py solution for 640. Solve the Equation
640. Solve the Equation: https://leetcode.com/problems/solve-the-equation/import re
class Solution(object):
def solveEquation(self, equation):
"""
:type equation: str
:rtype: str
"""
lhs, rhs = equation.split('=')
lcoef = s... | <commit_before><commit_msg>Add py solution for 640. Solve the Equation
640. Solve the Equation: https://leetcode.com/problems/solve-the-equation/<commit_after>import re
class Solution(object):
def solveEquation(self, equation):
"""
:type equation: str
:rtype: str
"""
lhs, rh... | |
02eaba1a420edddf72ed27a302dfb1314f9501e5 | tests/test_config.py | tests/test_config.py | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | Add very simple test for configuration process | Add very simple test for configuration process
| Python | apache-2.0 | angus-ai/angus-sdk-python | Add very simple test for configuration process | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | <commit_before><commit_msg>Add very simple test for configuration process<commit_after> | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | Add very simple test for configuration process# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you... | <commit_before><commit_msg>Add very simple test for configuration process<commit_after># -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright owners... | |
c477427a35a0edaf90f53cf6b9e4cf33d5a4f0cc | tests/test_remote.py | tests/test_remote.py | # Empty test file just for coverage / syntax-checking purposes
# flake8: noqa
import nbdiff.server.remote_server
import nbdiff.server.database
import nbdiff.server.command.AboutUsCommand
import nbdiff.server.command.ComparisonCommand
import nbdiff.server.command.ContactUsCommand
import nbdiff.server.command.DiffComm... | Add empty test file that imports all remote command files for syntax-checking/coverage reporting. | Add empty test file that imports all remote command files for syntax-checking/coverage reporting.
| Python | mit | tarmstrong/nbdiff,tarmstrong/nbdiff,tarmstrong/nbdiff,tarmstrong/nbdiff | Add empty test file that imports all remote command files for syntax-checking/coverage reporting. | # Empty test file just for coverage / syntax-checking purposes
# flake8: noqa
import nbdiff.server.remote_server
import nbdiff.server.database
import nbdiff.server.command.AboutUsCommand
import nbdiff.server.command.ComparisonCommand
import nbdiff.server.command.ContactUsCommand
import nbdiff.server.command.DiffComm... | <commit_before><commit_msg>Add empty test file that imports all remote command files for syntax-checking/coverage reporting.<commit_after> | # Empty test file just for coverage / syntax-checking purposes
# flake8: noqa
import nbdiff.server.remote_server
import nbdiff.server.database
import nbdiff.server.command.AboutUsCommand
import nbdiff.server.command.ComparisonCommand
import nbdiff.server.command.ContactUsCommand
import nbdiff.server.command.DiffComm... | Add empty test file that imports all remote command files for syntax-checking/coverage reporting.# Empty test file just for coverage / syntax-checking purposes
# flake8: noqa
import nbdiff.server.remote_server
import nbdiff.server.database
import nbdiff.server.command.AboutUsCommand
import nbdiff.server.command.Comp... | <commit_before><commit_msg>Add empty test file that imports all remote command files for syntax-checking/coverage reporting.<commit_after># Empty test file just for coverage / syntax-checking purposes
# flake8: noqa
import nbdiff.server.remote_server
import nbdiff.server.database
import nbdiff.server.command.AboutUs... | |
bbb156a9abce7c9210a21f3c4875833261ff7407 | scripts/set_alpha.py | scripts/set_alpha.py | #!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| Add script to set angle of attack | Add script to set angle of attack
| Python | mit | petebachant/actuatorLine-2D-turbinesFoam,petebachant/actuatorLine-2D-turbinesFoam,petebachant/actuatorLine-2D-turbinesFoam | Add script to set angle of attack | #!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| <commit_before><commit_msg>Add script to set angle of attack<commit_after> | #!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| Add script to set angle of attack#!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| <commit_before><commit_msg>Add script to set angle of attack<commit_after>#!/usr/bin/env python
import sys
alpha_deg = sys.argv[1]
with open("system/fvOptions", "w") as f:
with open("system/fvOptions.template") as template:
txt = template.read()
f.write(txt.format(alpha_deg=alpha_deg))
| |
a4341da7e35b95907436dfa557139dccbb03d962 | examples/red_green.py | examples/red_green.py |
# PS Move API
# Copyright (c) 2011 Thomas Perl <thp.io/about>
# All Rights Reserved
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'build'))
import time
import math
import psmove
move = psmove.PSMove()
i = 0
while True:
r = int(128+128*math.sin(i))
move.set_leds(r, 25... | Add a simple Python example | Add a simple Python example
| Python | bsd-2-clause | fourks/moveonpc,Hazer/moveonpc,seanjensengrey/moveonpc,cosmo1911/moveonpc,bab178/moveonpc,Zer01neDev/moveonpc,merryLee/moveonpc,Zer01neDev/moveonpc,fourks/moveonpc,bab178/moveonpc,merryLee/moveonpc,cosmo1911/moveonpc,seanjensengrey/moveonpc,cosmo1911/moveonpc,fourks/moveonpc,merryLee/moveonpc,seanjensengrey/moveonpc,se... | Add a simple Python example |
# PS Move API
# Copyright (c) 2011 Thomas Perl <thp.io/about>
# All Rights Reserved
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'build'))
import time
import math
import psmove
move = psmove.PSMove()
i = 0
while True:
r = int(128+128*math.sin(i))
move.set_leds(r, 25... | <commit_before><commit_msg>Add a simple Python example<commit_after> |
# PS Move API
# Copyright (c) 2011 Thomas Perl <thp.io/about>
# All Rights Reserved
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'build'))
import time
import math
import psmove
move = psmove.PSMove()
i = 0
while True:
r = int(128+128*math.sin(i))
move.set_leds(r, 25... | Add a simple Python example
# PS Move API
# Copyright (c) 2011 Thomas Perl <thp.io/about>
# All Rights Reserved
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'build'))
import time
import math
import psmove
move = psmove.PSMove()
i = 0
while True:
r = int(128+128*math.sin(... | <commit_before><commit_msg>Add a simple Python example<commit_after>
# PS Move API
# Copyright (c) 2011 Thomas Perl <thp.io/about>
# All Rights Reserved
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'build'))
import time
import math
import psmove
move = psmove.PSMove()
i = 0
... | |
e57e210f7e475b6ab15a6c874c4a3a763a483b99 | _cookbook/_division.py | _cookbook/_division.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''@package _cookbook
Number Division (True or floor division).
Copyright (c) 2014 Li Yun <[email protected]>
All Rights Reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMIT... | Create cookbook of Number Division in Python | Create cookbook of Number Division in Python
| Python | apache-2.0 | leven-cn/admin-linux,leven-cn/admin-linux | Create cookbook of Number Division in Python | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''@package _cookbook
Number Division (True or floor division).
Copyright (c) 2014 Li Yun <[email protected]>
All Rights Reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMIT... | <commit_before><commit_msg>Create cookbook of Number Division in Python<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''@package _cookbook
Number Division (True or floor division).
Copyright (c) 2014 Li Yun <[email protected]>
All Rights Reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMIT... | Create cookbook of Number Division in Python#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''@package _cookbook
Number Division (True or floor division).
Copyright (c) 2014 Li Yun <[email protected]>
All Rights Reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR ... | <commit_before><commit_msg>Create cookbook of Number Division in Python<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''@package _cookbook
Number Division (True or floor division).
Copyright (c) 2014 Li Yun <[email protected]>
All Rights Reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND... | |
b000fc19657b80c46ca9c2d7e6dfdaa16e4d400f | scripts/slave/apply_svn_patch.py | scripts/slave/apply_svn_patch.py | #!/usr/bin/python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import subprocess
import sys
def main():
parser = optparse.OptionParser()
parser.add_option('-p', '--patch-url',
... | Add a script which can apply a try job SVN patch via an annotated step. | Add a script which can apply a try job SVN patch via an annotated step.
Review URL: https://chromiumcodereview.appspot.com/24688002
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@225287 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | Add a script which can apply a try job SVN patch via an annotated step.
Review URL: https://chromiumcodereview.appspot.com/24688002
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@225287 0039d316-1c4b-4281-b951-d872f2087c98 | #!/usr/bin/python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import subprocess
import sys
def main():
parser = optparse.OptionParser()
parser.add_option('-p', '--patch-url',
... | <commit_before><commit_msg>Add a script which can apply a try job SVN patch via an annotated step.
Review URL: https://chromiumcodereview.appspot.com/24688002
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@225287 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | #!/usr/bin/python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import subprocess
import sys
def main():
parser = optparse.OptionParser()
parser.add_option('-p', '--patch-url',
... | Add a script which can apply a try job SVN patch via an annotated step.
Review URL: https://chromiumcodereview.appspot.com/24688002
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@225287 0039d316-1c4b-4281-b951-d872f2087c98#!/usr/bin/python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of thi... | <commit_before><commit_msg>Add a script which can apply a try job SVN patch via an annotated step.
Review URL: https://chromiumcodereview.appspot.com/24688002
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@225287 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>#!/usr/bin/python
# Copyright 2013 The Chromium A... | |
257531907b7bcca1b89172d8c50d4a35b3f25117 | docs/examples/ccsd.py | docs/examples/ccsd.py | """Automatic derivation of CCSD equations.
"""
import urllib.request
from pyspark import SparkConf, SparkContext
from sympy import IndexedBase, Rational
from drudge import PartHoleDrudge, CR, AN
conf = SparkConf().setAppName('CCSD-derivation')
ctx = SparkContext(conf=conf)
dr = PartHoleDrudge(ctx)
p = dr.names
c_... | Add example for CCSD theory | Add example for CCSD theory
When run serially, it takes about five minutes on Macbook Pro 2015.
This is a big success.
| Python | mit | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | Add example for CCSD theory
When run serially, it takes about five minutes on Macbook Pro 2015.
This is a big success. | """Automatic derivation of CCSD equations.
"""
import urllib.request
from pyspark import SparkConf, SparkContext
from sympy import IndexedBase, Rational
from drudge import PartHoleDrudge, CR, AN
conf = SparkConf().setAppName('CCSD-derivation')
ctx = SparkContext(conf=conf)
dr = PartHoleDrudge(ctx)
p = dr.names
c_... | <commit_before><commit_msg>Add example for CCSD theory
When run serially, it takes about five minutes on Macbook Pro 2015.
This is a big success.<commit_after> | """Automatic derivation of CCSD equations.
"""
import urllib.request
from pyspark import SparkConf, SparkContext
from sympy import IndexedBase, Rational
from drudge import PartHoleDrudge, CR, AN
conf = SparkConf().setAppName('CCSD-derivation')
ctx = SparkContext(conf=conf)
dr = PartHoleDrudge(ctx)
p = dr.names
c_... | Add example for CCSD theory
When run serially, it takes about five minutes on Macbook Pro 2015.
This is a big success."""Automatic derivation of CCSD equations.
"""
import urllib.request
from pyspark import SparkConf, SparkContext
from sympy import IndexedBase, Rational
from drudge import PartHoleDrudge, CR, AN
c... | <commit_before><commit_msg>Add example for CCSD theory
When run serially, it takes about five minutes on Macbook Pro 2015.
This is a big success.<commit_after>"""Automatic derivation of CCSD equations.
"""
import urllib.request
from pyspark import SparkConf, SparkContext
from sympy import IndexedBase, Rational
fro... | |
80f0ba529cdd2ffd26bc74f5c2a22cfb315ce93a | bamova/bamov2npy.py | bamova/bamov2npy.py | import sys
import numpy as np
def read_phi(flname, n_steps, n_loci, stride):
sampled_phis = np.zeros((n_steps / stride, n_loci))
fl = open(flname)
current_iter_idx = 0 # index used for storage
last_iter_idx = 0 # index used to identify when we finish a step
for ln in fl:
cols = ln.strip().split(",")
iter_idx ... | Add script for converting bamova phi text output to binary npy file | Add script for converting bamova phi text output to binary npy file
| Python | apache-2.0 | rnowling/pop-gen-models | Add script for converting bamova phi text output to binary npy file | import sys
import numpy as np
def read_phi(flname, n_steps, n_loci, stride):
sampled_phis = np.zeros((n_steps / stride, n_loci))
fl = open(flname)
current_iter_idx = 0 # index used for storage
last_iter_idx = 0 # index used to identify when we finish a step
for ln in fl:
cols = ln.strip().split(",")
iter_idx ... | <commit_before><commit_msg>Add script for converting bamova phi text output to binary npy file<commit_after> | import sys
import numpy as np
def read_phi(flname, n_steps, n_loci, stride):
sampled_phis = np.zeros((n_steps / stride, n_loci))
fl = open(flname)
current_iter_idx = 0 # index used for storage
last_iter_idx = 0 # index used to identify when we finish a step
for ln in fl:
cols = ln.strip().split(",")
iter_idx ... | Add script for converting bamova phi text output to binary npy fileimport sys
import numpy as np
def read_phi(flname, n_steps, n_loci, stride):
sampled_phis = np.zeros((n_steps / stride, n_loci))
fl = open(flname)
current_iter_idx = 0 # index used for storage
last_iter_idx = 0 # index used to identify when we fini... | <commit_before><commit_msg>Add script for converting bamova phi text output to binary npy file<commit_after>import sys
import numpy as np
def read_phi(flname, n_steps, n_loci, stride):
sampled_phis = np.zeros((n_steps / stride, n_loci))
fl = open(flname)
current_iter_idx = 0 # index used for storage
last_iter_idx ... | |
b839fd3a98dd943a19f5f852da89eae43470b89f | robot/robot/src/autonomous/hot_shoot.py | robot/robot/src/autonomous/hot_shoot.py |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
class main(object):
'''autonomous program'''
DEFAULT = False
MODE_NAME = "Hot shoot"
def __init__ (self, components):
''' initialize'''
super().__init__()
self.drive = components['d... | Add an autonomous mode based on the hot goal | Add an autonomous mode based on the hot goal
| Python | bsd-3-clause | frc1418/2014 | Add an autonomous mode based on the hot goal |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
class main(object):
'''autonomous program'''
DEFAULT = False
MODE_NAME = "Hot shoot"
def __init__ (self, components):
''' initialize'''
super().__init__()
self.drive = components['d... | <commit_before><commit_msg>Add an autonomous mode based on the hot goal<commit_after> |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
class main(object):
'''autonomous program'''
DEFAULT = False
MODE_NAME = "Hot shoot"
def __init__ (self, components):
''' initialize'''
super().__init__()
self.drive = components['d... | Add an autonomous mode based on the hot goal
try:
import wpilib
except ImportError:
from pyfrc import wpilib
class main(object):
'''autonomous program'''
DEFAULT = False
MODE_NAME = "Hot shoot"
def __init__ (self, components):
''' initialize'''
super().__... | <commit_before><commit_msg>Add an autonomous mode based on the hot goal<commit_after>
try:
import wpilib
except ImportError:
from pyfrc import wpilib
class main(object):
'''autonomous program'''
DEFAULT = False
MODE_NAME = "Hot shoot"
def __init__ (self, components):
... | |
7a37c8a55ce74766b16d35c61a4f0197cdcc6663 | cyber/python/cyber_py/cyber_py3.py | cyber/python/cyber_py/cyber_py3.py | #!/usr/bin/env python3
# ****************************************************************************
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | Implement python wrapper for py_init. | Cyber: Implement python wrapper for py_init.
| Python | apache-2.0 | xiaoxq/apollo,jinghaomiao/apollo,jinghaomiao/apollo,ApolloAuto/apollo,ycool/apollo,xiaoxq/apollo,ycool/apollo,xiaoxq/apollo,ApolloAuto/apollo,ycool/apollo,jinghaomiao/apollo,xiaoxq/apollo,ApolloAuto/apollo,ApolloAuto/apollo,ycool/apollo,xiaoxq/apollo,xiaoxq/apollo,ycool/apollo,ApolloAuto/apollo,ApolloAuto/apollo,jingha... | Cyber: Implement python wrapper for py_init. | #!/usr/bin/env python3
# ****************************************************************************
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | <commit_before><commit_msg>Cyber: Implement python wrapper for py_init.<commit_after> | #!/usr/bin/env python3
# ****************************************************************************
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | Cyber: Implement python wrapper for py_init.#!/usr/bin/env python3
# ****************************************************************************
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | <commit_before><commit_msg>Cyber: Implement python wrapper for py_init.<commit_after>#!/usr/bin/env python3
# ****************************************************************************
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ... | |
ef64604235fc3d113288298a1d48e02290400360 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.13',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.14',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | Update the PyPI version to 0.2.13 | Update the PyPI version to 0.2.13
| Python | mit | electronick1/todoist-python,Doist/todoist-python | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.13',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.14',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | <commit_before># -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.13',
packages=['todoist', 'todoist.managers'],
aut... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.14',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.13',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | <commit_before># -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.13',
packages=['todoist', 'todoist.managers'],
aut... |
b9f161820ae881227702167b2ba33d478936df8d | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
install_requires = (
)
description = "An archive population utility."
setup(
name='cnx-archive-population',
version='0.1',
author='Connexions team',
author_email='[email protected]',
url="https://github.com/connexions/cnx-archive... | Make it a package for better dependency resolution. | Make it a package for better dependency resolution.
| Python | agpl-3.0 | pumazi/cnx-population,pumazi/cnx-populate | Make it a package for better dependency resolution. | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
install_requires = (
)
description = "An archive population utility."
setup(
name='cnx-archive-population',
version='0.1',
author='Connexions team',
author_email='[email protected]',
url="https://github.com/connexions/cnx-archive... | <commit_before><commit_msg>Make it a package for better dependency resolution.<commit_after> | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
install_requires = (
)
description = "An archive population utility."
setup(
name='cnx-archive-population',
version='0.1',
author='Connexions team',
author_email='[email protected]',
url="https://github.com/connexions/cnx-archive... | Make it a package for better dependency resolution.# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
install_requires = (
)
description = "An archive population utility."
setup(
name='cnx-archive-population',
version='0.1',
author='Connexions team',
author_email='[email protected]',... | <commit_before><commit_msg>Make it a package for better dependency resolution.<commit_after># -*- coding: utf-8 -*-
from setuptools import setup, find_packages
install_requires = (
)
description = "An archive population utility."
setup(
name='cnx-archive-population',
version='0.1',
author='Connexion... | |
bdafa10312d050b78f23af439262d4c99d07b191 | jobs/migrations/0009_auto_20150317_1815.py | jobs/migrations/0009_auto_20150317_1815.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import markupfield.fields
class Migration(migrations.Migration):
dependencies = [
('jobs', '0008_auto_20150316_1205'),
]
operations = [
migrations.AlterField(
model_name=... | Add missing migration for verbose_name changes in the jobs app. | Add missing migration for verbose_name changes in the jobs app.
Refs #641.
| Python | apache-2.0 | malemburg/pythondotorg,SujaySKumar/pythondotorg,fe11x/pythondotorg,fe11x/pythondotorg,lebronhkh/pythondotorg,manhhomienbienthuy/pythondotorg,Mariatta/pythondotorg,lebronhkh/pythondotorg,manhhomienbienthuy/pythondotorg,Mariatta/pythondotorg,lepture/pythondotorg,berkerpeksag/pythondotorg,willingc/pythondotorg,ahua/python... | Add missing migration for verbose_name changes in the jobs app.
Refs #641. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import markupfield.fields
class Migration(migrations.Migration):
dependencies = [
('jobs', '0008_auto_20150316_1205'),
]
operations = [
migrations.AlterField(
model_name=... | <commit_before><commit_msg>Add missing migration for verbose_name changes in the jobs app.
Refs #641.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import markupfield.fields
class Migration(migrations.Migration):
dependencies = [
('jobs', '0008_auto_20150316_1205'),
]
operations = [
migrations.AlterField(
model_name=... | Add missing migration for verbose_name changes in the jobs app.
Refs #641.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import markupfield.fields
class Migration(migrations.Migration):
dependencies = [
('jobs', '0008_auto_20150316_1205'),
]... | <commit_before><commit_msg>Add missing migration for verbose_name changes in the jobs app.
Refs #641.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import markupfield.fields
class Migration(migrations.Migration):
dependencies = [
(... | |
d3b34eeebfb22e8dc5f31b0ee849187ea8042f92 | migrations/versions/1444ba317b65_.py | migrations/versions/1444ba317b65_.py | """empty message
Revision ID: 1444ba317b65
Revises: None
Create Date: 2013-11-25 10:32:40.678287
"""
# revision identifiers, used by Alembic.
revision = '1444ba317b65'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | Update db models and migrations to comply with tests | Update db models and migrations to comply with tests
Update test cases to include more scenarios. This required changes in the
db models and collector code.
Delete old migrations and start with a single, new migration.
Signed-off-by: Christoph Kassen <[email protected]>
| Python | apache-2.0 | TelekomCloud/pony-express | Update db models and migrations to comply with tests
Update test cases to include more scenarios. This required changes in the
db models and collector code.
Delete old migrations and start with a single, new migration.
Signed-off-by: Christoph Kassen <[email protected]> | """empty message
Revision ID: 1444ba317b65
Revises: None
Create Date: 2013-11-25 10:32:40.678287
"""
# revision identifiers, used by Alembic.
revision = '1444ba317b65'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | <commit_before><commit_msg>Update db models and migrations to comply with tests
Update test cases to include more scenarios. This required changes in the
db models and collector code.
Delete old migrations and start with a single, new migration.
Signed-off-by: Christoph Kassen <21a19229d09eaaba535d395ba11b820b0886ba... | """empty message
Revision ID: 1444ba317b65
Revises: None
Create Date: 2013-11-25 10:32:40.678287
"""
# revision identifiers, used by Alembic.
revision = '1444ba317b65'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | Update db models and migrations to comply with tests
Update test cases to include more scenarios. This required changes in the
db models and collector code.
Delete old migrations and start with a single, new migration.
Signed-off-by: Christoph Kassen <[email protected]>"""empty mess... | <commit_before><commit_msg>Update db models and migrations to comply with tests
Update test cases to include more scenarios. This required changes in the
db models and collector code.
Delete old migrations and start with a single, new migration.
Signed-off-by: Christoph Kassen <21a19229d09eaaba535d395ba11b820b0886ba... | |
b51f399b4ac59011a37ade0cb488cb866cb11623 | __main__.py | __main__.py | import facebook
from getpass import getpass
token = getpass('User Access Token: ')
graph = facebook.GraphAPI(token)
friends = graph.get_connections("me", "friends")
friend_list = [friend['name'] for friend in friends['data']]
print friend_list
| Create simple script to get first page of friends list. | Create simple script to get first page of friends list.
| Python | mit | brendancsmith/cohort-facebook,brendancsmith/cohort-facebook | Create simple script to get first page of friends list. | import facebook
from getpass import getpass
token = getpass('User Access Token: ')
graph = facebook.GraphAPI(token)
friends = graph.get_connections("me", "friends")
friend_list = [friend['name'] for friend in friends['data']]
print friend_list
| <commit_before><commit_msg>Create simple script to get first page of friends list.<commit_after> | import facebook
from getpass import getpass
token = getpass('User Access Token: ')
graph = facebook.GraphAPI(token)
friends = graph.get_connections("me", "friends")
friend_list = [friend['name'] for friend in friends['data']]
print friend_list
| Create simple script to get first page of friends list.import facebook
from getpass import getpass
token = getpass('User Access Token: ')
graph = facebook.GraphAPI(token)
friends = graph.get_connections("me", "friends")
friend_list = [friend['name'] for friend in friends['data']]
print friend_list
| <commit_before><commit_msg>Create simple script to get first page of friends list.<commit_after>import facebook
from getpass import getpass
token = getpass('User Access Token: ')
graph = facebook.GraphAPI(token)
friends = graph.get_connections("me", "friends")
friend_list = [friend['name'] for friend in friends['da... | |
ff15b059b85ac992709e85c68e91e21ffe718078 | util/make_new_dif.py | util/make_new_dif.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
# make_new_dif.py is a script for quickly applying replacement operations to
# dif_template.h.tpl. See sw/device/lib/dif/dif_template.h.tpl for more
... | Add a script for instantiating dif_template.tpl.h | [dif/util] Add a script for instantiating dif_template.tpl.h
Signed-off-by: Miguel Young de la Sota <[email protected]>
| Python | apache-2.0 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan | [dif/util] Add a script for instantiating dif_template.tpl.h
Signed-off-by: Miguel Young de la Sota <[email protected]> | #!/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
# make_new_dif.py is a script for quickly applying replacement operations to
# dif_template.h.tpl. See sw/device/lib/dif/dif_template.h.tpl for more
... | <commit_before><commit_msg>[dif/util] Add a script for instantiating dif_template.tpl.h
Signed-off-by: Miguel Young de la Sota <[email protected]><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
# make_new_dif.py is a script for quickly applying replacement operations to
# dif_template.h.tpl. See sw/device/lib/dif/dif_template.h.tpl for more
... | [dif/util] Add a script for instantiating dif_template.tpl.h
Signed-off-by: Miguel Young de la Sota <[email protected]>#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-... | <commit_before><commit_msg>[dif/util] Add a script for instantiating dif_template.tpl.h
Signed-off-by: Miguel Young de la Sota <[email protected]><commit_after>#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for de... | |
44a66ff4a31763c71c5fa5a31967fc019a1bad2a | sa-extract/sa2cdec.py | sa-extract/sa2cdec.py | #!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:
print >>sys.stderr, 'WARNING: No alignments:', line
try:
(lhs, src, tgt, fea... | Add script to convert from sa-extract's unnamed format to cdec's more readable named format | Add script to convert from sa-extract's unnamed format to cdec's more readable named format
| Python | apache-2.0 | carhaas/cdec-semparse,carhaas/cdec-semparse,veer66/cdec,pks/cdec-dtrain,carhaas/cdec-semparse,veer66/cdec,redpony/cdec,carhaas/cdec-semparse,pks/cdec-dtrain,m5w/atools,pks/cdec-dtrain,redpony/cdec,pks/cdec-dtrain,pks/cdec-dtrain,veer66/cdec,redpony/cdec,redpony/cdec,veer66/cdec,m5w/atools,veer66/cdec,veer66/cdec,redpon... | Add script to convert from sa-extract's unnamed format to cdec's more readable named format | #!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:
print >>sys.stderr, 'WARNING: No alignments:', line
try:
(lhs, src, tgt, fea... | <commit_before><commit_msg>Add script to convert from sa-extract's unnamed format to cdec's more readable named format<commit_after> | #!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:
print >>sys.stderr, 'WARNING: No alignments:', line
try:
(lhs, src, tgt, fea... | Add script to convert from sa-extract's unnamed format to cdec's more readable named format#!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:... | <commit_before><commit_msg>Add script to convert from sa-extract's unnamed format to cdec's more readable named format<commit_after>#!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = ... | |
4de8de5efc5d74bcb5647d2c13dc863c60a9fa58 | ibei/devossolarcell.py | ibei/devossolarcell.py | # -*- coding: utf-8 -*-
import numpy as np
from astropy import constants, units
from sympy.mpmath import polylog
from physicalproperty import PhysicalProperty, find_PhysicalProperty
class DeVosSolarcell(SQSolarcell):
"""
DeVos single-junction solar cell
This class implements a solar cell as described by... | Split DeVosSolarcell class into its own file | Split DeVosSolarcell class into its own file
| Python | mit | jrsmith3/tec,jrsmith3/tec,jrsmith3/ibei | Split DeVosSolarcell class into its own file | # -*- coding: utf-8 -*-
import numpy as np
from astropy import constants, units
from sympy.mpmath import polylog
from physicalproperty import PhysicalProperty, find_PhysicalProperty
class DeVosSolarcell(SQSolarcell):
"""
DeVos single-junction solar cell
This class implements a solar cell as described by... | <commit_before><commit_msg>Split DeVosSolarcell class into its own file<commit_after> | # -*- coding: utf-8 -*-
import numpy as np
from astropy import constants, units
from sympy.mpmath import polylog
from physicalproperty import PhysicalProperty, find_PhysicalProperty
class DeVosSolarcell(SQSolarcell):
"""
DeVos single-junction solar cell
This class implements a solar cell as described by... | Split DeVosSolarcell class into its own file# -*- coding: utf-8 -*-
import numpy as np
from astropy import constants, units
from sympy.mpmath import polylog
from physicalproperty import PhysicalProperty, find_PhysicalProperty
class DeVosSolarcell(SQSolarcell):
"""
DeVos single-junction solar cell
This c... | <commit_before><commit_msg>Split DeVosSolarcell class into its own file<commit_after># -*- coding: utf-8 -*-
import numpy as np
from astropy import constants, units
from sympy.mpmath import polylog
from physicalproperty import PhysicalProperty, find_PhysicalProperty
class DeVosSolarcell(SQSolarcell):
"""
DeV... | |
a6f7316f7ad8065f77dc121318127b86f3431394 | tests/test_extract.py | tests/test_extract.py | # -*- coding: utf-8 -*-
"""
test_extract
~~~~~~~~~~~~
Test data extraction on small document examples.
:copyright: Copyright 2016 by Matt Swain.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fu... | Add more general extraction tests | Add more general extraction tests
| Python | mit | mcs07/ChemDataExtractor,mcs07/ChemDataExtractor,mcs07/ChemDataExtractor | Add more general extraction tests | # -*- coding: utf-8 -*-
"""
test_extract
~~~~~~~~~~~~
Test data extraction on small document examples.
:copyright: Copyright 2016 by Matt Swain.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fu... | <commit_before><commit_msg>Add more general extraction tests<commit_after> | # -*- coding: utf-8 -*-
"""
test_extract
~~~~~~~~~~~~
Test data extraction on small document examples.
:copyright: Copyright 2016 by Matt Swain.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fu... | Add more general extraction tests# -*- coding: utf-8 -*-
"""
test_extract
~~~~~~~~~~~~
Test data extraction on small document examples.
:copyright: Copyright 2016 by Matt Swain.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from __future__ import division
from __future_... | <commit_before><commit_msg>Add more general extraction tests<commit_after># -*- coding: utf-8 -*-
"""
test_extract
~~~~~~~~~~~~
Test data extraction on small document examples.
:copyright: Copyright 2016 by Matt Swain.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from ... | |
f8350d23dae60aa3e100e1249275923b5933d1ac | tests/functional/test_h2_required.py | tests/functional/test_h2_required.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Add validation for known h2 services | Add validation for known h2 services
| Python | apache-2.0 | pplu/botocore,boto/botocore | Add validation for known h2 services | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | <commit_before><commit_msg>Add validation for known h2 services<commit_after> | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Add validation for known h2 services# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
... | <commit_before><commit_msg>Add validation for known h2 services<commit_after># Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located... | |
064e834ed602ba14d492f64468c538967b5753dc | zoe_master/tests/state_manager_test.py | zoe_master/tests/state_manager_test.py | # Copyright (c) 2016, Daniele Venzano
#
# 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 w... | Add a new test for the state manager | Add a new test for the state manager
| Python | apache-2.0 | DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe | Add a new test for the state manager | # Copyright (c) 2016, Daniele Venzano
#
# 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 w... | <commit_before><commit_msg>Add a new test for the state manager<commit_after> | # Copyright (c) 2016, Daniele Venzano
#
# 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 w... | Add a new test for the state manager# Copyright (c) 2016, Daniele Venzano
#
# 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... | <commit_before><commit_msg>Add a new test for the state manager<commit_after># Copyright (c) 2016, Daniele Venzano
#
# 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... | |
3c0a992cbcc54c15835d2d95cf4f7e94f4764af0 | digestive/__init__.py | digestive/__init__.py | from os import path
class Source:
"""
Data source context manager and reader.
"""
def __init__(self, source):
self.source = source
self.fd = None
def __len__(self):
return path.getsize(self.source)
def __enter__(self):
self.open()
return self
def... | Define Source and Sink classes | Define Source and Sink classes
| Python | isc | akaIDIOT/Digestive | Define Source and Sink classes | from os import path
class Source:
"""
Data source context manager and reader.
"""
def __init__(self, source):
self.source = source
self.fd = None
def __len__(self):
return path.getsize(self.source)
def __enter__(self):
self.open()
return self
def... | <commit_before><commit_msg>Define Source and Sink classes<commit_after> | from os import path
class Source:
"""
Data source context manager and reader.
"""
def __init__(self, source):
self.source = source
self.fd = None
def __len__(self):
return path.getsize(self.source)
def __enter__(self):
self.open()
return self
def... | Define Source and Sink classesfrom os import path
class Source:
"""
Data source context manager and reader.
"""
def __init__(self, source):
self.source = source
self.fd = None
def __len__(self):
return path.getsize(self.source)
def __enter__(self):
self.open(... | <commit_before><commit_msg>Define Source and Sink classes<commit_after>from os import path
class Source:
"""
Data source context manager and reader.
"""
def __init__(self, source):
self.source = source
self.fd = None
def __len__(self):
return path.getsize(self.source)
... | |
8803e65d61c590b25effc954287944b5d7aa5787 | spec/web_service_spec.py | spec/web_service_spec.py | from expects import expect, equal
from primestg.report import Report
import responses
import requests
from primestg.service import Service
from zeep.transports import Transport
with description('Web services run'):
with before.all:
self.s = Service()
with it('asking for S02 report'):
with resp... | Add first version of test w/responses | Add first version of test w/responses
| Python | agpl-3.0 | gisce/primestg | Add first version of test w/responses | from expects import expect, equal
from primestg.report import Report
import responses
import requests
from primestg.service import Service
from zeep.transports import Transport
with description('Web services run'):
with before.all:
self.s = Service()
with it('asking for S02 report'):
with resp... | <commit_before><commit_msg>Add first version of test w/responses<commit_after> | from expects import expect, equal
from primestg.report import Report
import responses
import requests
from primestg.service import Service
from zeep.transports import Transport
with description('Web services run'):
with before.all:
self.s = Service()
with it('asking for S02 report'):
with resp... | Add first version of test w/responsesfrom expects import expect, equal
from primestg.report import Report
import responses
import requests
from primestg.service import Service
from zeep.transports import Transport
with description('Web services run'):
with before.all:
self.s = Service()
with it('askin... | <commit_before><commit_msg>Add first version of test w/responses<commit_after>from expects import expect, equal
from primestg.report import Report
import responses
import requests
from primestg.service import Service
from zeep.transports import Transport
with description('Web services run'):
with before.all:
... | |
29f8e40a26f1774615ea4fceb6ea4a8990dcc7e8 | example/query_bugs.py | example/query_bugs.py | #!/usr/bin/env python
import bugsy
from pdb import set_trace as bp
# This example demonstrates querying bugs with an API key for product "Foo"
bugzilla = bugsy.Bugsy(username='REDACTED', api_key='REDACTED')
bugs = bugzilla.search_for\
.product('Foo')\
.search()
for bug in bugs:
print(str(bug.id)... | Add a bug query example | Add a bug query example
| Python | apache-2.0 | AutomatedTester/Bugsy | Add a bug query example | #!/usr/bin/env python
import bugsy
from pdb import set_trace as bp
# This example demonstrates querying bugs with an API key for product "Foo"
bugzilla = bugsy.Bugsy(username='REDACTED', api_key='REDACTED')
bugs = bugzilla.search_for\
.product('Foo')\
.search()
for bug in bugs:
print(str(bug.id)... | <commit_before><commit_msg>Add a bug query example<commit_after> | #!/usr/bin/env python
import bugsy
from pdb import set_trace as bp
# This example demonstrates querying bugs with an API key for product "Foo"
bugzilla = bugsy.Bugsy(username='REDACTED', api_key='REDACTED')
bugs = bugzilla.search_for\
.product('Foo')\
.search()
for bug in bugs:
print(str(bug.id)... | Add a bug query example#!/usr/bin/env python
import bugsy
from pdb import set_trace as bp
# This example demonstrates querying bugs with an API key for product "Foo"
bugzilla = bugsy.Bugsy(username='REDACTED', api_key='REDACTED')
bugs = bugzilla.search_for\
.product('Foo')\
.search()
for bug in bugs... | <commit_before><commit_msg>Add a bug query example<commit_after>#!/usr/bin/env python
import bugsy
from pdb import set_trace as bp
# This example demonstrates querying bugs with an API key for product "Foo"
bugzilla = bugsy.Bugsy(username='REDACTED', api_key='REDACTED')
bugs = bugzilla.search_for\
.product('... | |
e70a73b8c365329f7a8cf86ad527b12358752266 | sa-extract/sa2cdec.py | sa-extract/sa2cdec.py | #!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:
print >>sys.stderr, 'WARNING: No alignments:', line
try:
(lhs, src, tgt, fea... | Add script to convert from sa-extract's unnamed format to cdec's more readable named format | Add script to convert from sa-extract's unnamed format to cdec's more readable named format
| Python | apache-2.0 | pks/cdec-dtrain-legacy,kho/mr-cdec,kho/mr-cdec,pks/cdec-dtrain-legacy,pks/cdec-dtrain-legacy,kho/mr-cdec,kho/mr-cdec,pks/cdec-dtrain-legacy,kho/mr-cdec,pks/cdec-dtrain-legacy,pks/cdec-dtrain-legacy,kho/mr-cdec | Add script to convert from sa-extract's unnamed format to cdec's more readable named format | #!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:
print >>sys.stderr, 'WARNING: No alignments:', line
try:
(lhs, src, tgt, fea... | <commit_before><commit_msg>Add script to convert from sa-extract's unnamed format to cdec's more readable named format<commit_after> | #!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:
print >>sys.stderr, 'WARNING: No alignments:', line
try:
(lhs, src, tgt, fea... | Add script to convert from sa-extract's unnamed format to cdec's more readable named format#!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
except:... | <commit_before><commit_msg>Add script to convert from sa-extract's unnamed format to cdec's more readable named format<commit_after>#!/usr/bin/env python
import sys
featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
for line in sys.stdin:
try:
(lhs, src, tgt, feats, align) = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.