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
a726625e13ac08d0b6c2c686de476b6e78bc0f48
dlstats/fetchers/test__skeleton.py
dlstats/fetchers/test__skeleton.py
import unittest from datetime import datetime from _skeleton import Dataset class DatasetTestCase(unittest.TestCase): def test_full_example(self): self.assertIsInstance(Dataset(provider='Test provider',name='GDP',dataset_code='nama_gdp_fr',dimension_list=[{'name':'COUNTRY','values':[('FR','France'),('DE','...
Add unit test for _skeleton
Add unit test for _skeleton
Python
agpl-3.0
MichelJuillard/dlstats,mmalter/dlstats,Widukind/dlstats,MichelJuillard/dlstats,mmalter/dlstats,Widukind/dlstats,MichelJuillard/dlstats,mmalter/dlstats
Add unit test for _skeleton
import unittest from datetime import datetime from _skeleton import Dataset class DatasetTestCase(unittest.TestCase): def test_full_example(self): self.assertIsInstance(Dataset(provider='Test provider',name='GDP',dataset_code='nama_gdp_fr',dimension_list=[{'name':'COUNTRY','values':[('FR','France'),('DE','...
<commit_before><commit_msg>Add unit test for _skeleton<commit_after>
import unittest from datetime import datetime from _skeleton import Dataset class DatasetTestCase(unittest.TestCase): def test_full_example(self): self.assertIsInstance(Dataset(provider='Test provider',name='GDP',dataset_code='nama_gdp_fr',dimension_list=[{'name':'COUNTRY','values':[('FR','France'),('DE','...
Add unit test for _skeletonimport unittest from datetime import datetime from _skeleton import Dataset class DatasetTestCase(unittest.TestCase): def test_full_example(self): self.assertIsInstance(Dataset(provider='Test provider',name='GDP',dataset_code='nama_gdp_fr',dimension_list=[{'name':'COUNTRY','value...
<commit_before><commit_msg>Add unit test for _skeleton<commit_after>import unittest from datetime import datetime from _skeleton import Dataset class DatasetTestCase(unittest.TestCase): def test_full_example(self): self.assertIsInstance(Dataset(provider='Test provider',name='GDP',dataset_code='nama_gdp_fr'...
e54c82c336827c1fc835837006885c245a05e5cb
html_stripper.py
html_stripper.py
from html.parser import HTMLParser class HTMLStripper(HTMLParser): def __init__(self): super().__init__() self.reset() self.strict = False self.convert_charrefs= True self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): retur...
Add html stripper for announcements
Add html stripper for announcements
Python
mit
karenang/ivle-bot,karen/ivle-bot
Add html stripper for announcements
from html.parser import HTMLParser class HTMLStripper(HTMLParser): def __init__(self): super().__init__() self.reset() self.strict = False self.convert_charrefs= True self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): retur...
<commit_before><commit_msg>Add html stripper for announcements<commit_after>
from html.parser import HTMLParser class HTMLStripper(HTMLParser): def __init__(self): super().__init__() self.reset() self.strict = False self.convert_charrefs= True self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): retur...
Add html stripper for announcementsfrom html.parser import HTMLParser class HTMLStripper(HTMLParser): def __init__(self): super().__init__() self.reset() self.strict = False self.convert_charrefs= True self.fed = [] def handle_data(self, d): self.fed.append(d) ...
<commit_before><commit_msg>Add html stripper for announcements<commit_after>from html.parser import HTMLParser class HTMLStripper(HTMLParser): def __init__(self): super().__init__() self.reset() self.strict = False self.convert_charrefs= True self.fed = [] def handle_dat...
55dd21610a2ed1befed6b4560528e8a6bf3602e2
imgur_cli/cli.py
imgur_cli/cli.py
import argparse import logging import os import imgurpython from collections import namedtuple logger = logging.getLogger(__name__) def imgur_credentials(): ImgurCredentials = namedtuple('ImgurCredentials', ['client_id', 'client_secret', 'access_token', 'refresh_token', 'mashape_key']) try: from con...
Define function to retrieve imgur credentials
Define function to retrieve imgur credentials
Python
mit
ueg1990/imgur-cli
Define function to retrieve imgur credentials
import argparse import logging import os import imgurpython from collections import namedtuple logger = logging.getLogger(__name__) def imgur_credentials(): ImgurCredentials = namedtuple('ImgurCredentials', ['client_id', 'client_secret', 'access_token', 'refresh_token', 'mashape_key']) try: from con...
<commit_before><commit_msg>Define function to retrieve imgur credentials<commit_after>
import argparse import logging import os import imgurpython from collections import namedtuple logger = logging.getLogger(__name__) def imgur_credentials(): ImgurCredentials = namedtuple('ImgurCredentials', ['client_id', 'client_secret', 'access_token', 'refresh_token', 'mashape_key']) try: from con...
Define function to retrieve imgur credentialsimport argparse import logging import os import imgurpython from collections import namedtuple logger = logging.getLogger(__name__) def imgur_credentials(): ImgurCredentials = namedtuple('ImgurCredentials', ['client_id', 'client_secret', 'access_token', 'refresh_toke...
<commit_before><commit_msg>Define function to retrieve imgur credentials<commit_after>import argparse import logging import os import imgurpython from collections import namedtuple logger = logging.getLogger(__name__) def imgur_credentials(): ImgurCredentials = namedtuple('ImgurCredentials', ['client_id', 'clie...
2c8752cd586f6d02ce8da4bc3a79660889ed7f3f
climlab/tests/test_bandrc.py
climlab/tests/test_bandrc.py
import numpy as np import climlab import pytest # The fixtures are reusable pieces of code to set up the input to the tests. # Without fixtures, we would have to do a lot of cutting and pasting # I inferred which fixtures to use from the notebook # Latitude-dependent grey radiation.ipynb @pytest.fixture() def model():...
Add some minimal testing for BandRCModel to the test suite.
Add some minimal testing for BandRCModel to the test suite.
Python
mit
cjcardinale/climlab,brian-rose/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab
Add some minimal testing for BandRCModel to the test suite.
import numpy as np import climlab import pytest # The fixtures are reusable pieces of code to set up the input to the tests. # Without fixtures, we would have to do a lot of cutting and pasting # I inferred which fixtures to use from the notebook # Latitude-dependent grey radiation.ipynb @pytest.fixture() def model():...
<commit_before><commit_msg>Add some minimal testing for BandRCModel to the test suite.<commit_after>
import numpy as np import climlab import pytest # The fixtures are reusable pieces of code to set up the input to the tests. # Without fixtures, we would have to do a lot of cutting and pasting # I inferred which fixtures to use from the notebook # Latitude-dependent grey radiation.ipynb @pytest.fixture() def model():...
Add some minimal testing for BandRCModel to the test suite.import numpy as np import climlab import pytest # The fixtures are reusable pieces of code to set up the input to the tests. # Without fixtures, we would have to do a lot of cutting and pasting # I inferred which fixtures to use from the notebook # Latitude-de...
<commit_before><commit_msg>Add some minimal testing for BandRCModel to the test suite.<commit_after>import numpy as np import climlab import pytest # The fixtures are reusable pieces of code to set up the input to the tests. # Without fixtures, we would have to do a lot of cutting and pasting # I inferred which fixtur...
cd910f95753a138e2df48a1370e666bee49ad1dd
py/binary-number-with-alternating-bits.py
py/binary-number-with-alternating-bits.py
class Solution(object): def hasAlternatingBits(self, n): """ :type n: int :rtype: bool """ power_2 = (n ^ (n >> 1)) + 1 return (power_2 & -power_2) == power_2
Add py solution for 693. Binary Number with Alternating Bits
Add py solution for 693. Binary Number with Alternating Bits 693. Binary Number with Alternating Bits: https://leetcode.com/problems/binary-number-with-alternating-bits/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 693. Binary Number with Alternating Bits 693. Binary Number with Alternating Bits: https://leetcode.com/problems/binary-number-with-alternating-bits/
class Solution(object): def hasAlternatingBits(self, n): """ :type n: int :rtype: bool """ power_2 = (n ^ (n >> 1)) + 1 return (power_2 & -power_2) == power_2
<commit_before><commit_msg>Add py solution for 693. Binary Number with Alternating Bits 693. Binary Number with Alternating Bits: https://leetcode.com/problems/binary-number-with-alternating-bits/<commit_after>
class Solution(object): def hasAlternatingBits(self, n): """ :type n: int :rtype: bool """ power_2 = (n ^ (n >> 1)) + 1 return (power_2 & -power_2) == power_2
Add py solution for 693. Binary Number with Alternating Bits 693. Binary Number with Alternating Bits: https://leetcode.com/problems/binary-number-with-alternating-bits/class Solution(object): def hasAlternatingBits(self, n): """ :type n: int :rtype: bool """ power_2 = (n ^ ...
<commit_before><commit_msg>Add py solution for 693. Binary Number with Alternating Bits 693. Binary Number with Alternating Bits: https://leetcode.com/problems/binary-number-with-alternating-bits/<commit_after>class Solution(object): def hasAlternatingBits(self, n): """ :type n: int :rtype:...
5470661c6f171f1e9da609c3bf67ece21cf6d6eb
examples/return_400.py
examples/return_400.py
import hug from falcon import HTTP_400 @hug.get() def only_positive(positive: int, response): if positive < 0: response.status = HTTP_400
Add example for response status code
Add example for response status code
Python
mit
timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug,timothycrosley/hug
Add example for response status code
import hug from falcon import HTTP_400 @hug.get() def only_positive(positive: int, response): if positive < 0: response.status = HTTP_400
<commit_before><commit_msg>Add example for response status code<commit_after>
import hug from falcon import HTTP_400 @hug.get() def only_positive(positive: int, response): if positive < 0: response.status = HTTP_400
Add example for response status codeimport hug from falcon import HTTP_400 @hug.get() def only_positive(positive: int, response): if positive < 0: response.status = HTTP_400
<commit_before><commit_msg>Add example for response status code<commit_after>import hug from falcon import HTTP_400 @hug.get() def only_positive(positive: int, response): if positive < 0: response.status = HTTP_400
b57c24b23fa9566178455da895ea63baf6e16ff4
tests/scanner_tests.py
tests/scanner_tests.py
from shadetree.obd.scanner import decode_bitwise_pids DURANGO_SUPPORTED_PIDS_RESPONSE = 'BE 3E B8 10 ' JETTA_DIESEL_SUPPORTED_PIDS_RESPONSE = '98 3B 80 19 ' def test_decode_bitwise_pids_durango(): """ Verify we correctly parse information about supported PIDs on a 1999 Dodge Durango """ supported...
Test cases to verify parsing of bitwise encoded PIDs
Test cases to verify parsing of bitwise encoded PIDs
Python
mit
corbinbs/shadetree,s-s-boika/obdlib,QualiApps/obdlib,QualiApps/obdlib,s-s-boika/obdlib
Test cases to verify parsing of bitwise encoded PIDs
from shadetree.obd.scanner import decode_bitwise_pids DURANGO_SUPPORTED_PIDS_RESPONSE = 'BE 3E B8 10 ' JETTA_DIESEL_SUPPORTED_PIDS_RESPONSE = '98 3B 80 19 ' def test_decode_bitwise_pids_durango(): """ Verify we correctly parse information about supported PIDs on a 1999 Dodge Durango """ supported...
<commit_before><commit_msg>Test cases to verify parsing of bitwise encoded PIDs<commit_after>
from shadetree.obd.scanner import decode_bitwise_pids DURANGO_SUPPORTED_PIDS_RESPONSE = 'BE 3E B8 10 ' JETTA_DIESEL_SUPPORTED_PIDS_RESPONSE = '98 3B 80 19 ' def test_decode_bitwise_pids_durango(): """ Verify we correctly parse information about supported PIDs on a 1999 Dodge Durango """ supported...
Test cases to verify parsing of bitwise encoded PIDsfrom shadetree.obd.scanner import decode_bitwise_pids DURANGO_SUPPORTED_PIDS_RESPONSE = 'BE 3E B8 10 ' JETTA_DIESEL_SUPPORTED_PIDS_RESPONSE = '98 3B 80 19 ' def test_decode_bitwise_pids_durango(): """ Verify we correctly parse information about supporte...
<commit_before><commit_msg>Test cases to verify parsing of bitwise encoded PIDs<commit_after>from shadetree.obd.scanner import decode_bitwise_pids DURANGO_SUPPORTED_PIDS_RESPONSE = 'BE 3E B8 10 ' JETTA_DIESEL_SUPPORTED_PIDS_RESPONSE = '98 3B 80 19 ' def test_decode_bitwise_pids_durango(): """ Verify we c...
c757c6ad714afb393c65c1b82bca31de357332fc
python/util_test.py
python/util_test.py
# # (C) Copyright IBM Corp. 2017 # # 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 writi...
Add test coverage for utility module
Add test coverage for utility module
Python
apache-2.0
lresende/toree-gateway,lresende/toree-gateway
Add test coverage for utility module
# # (C) Copyright IBM Corp. 2017 # # 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 writi...
<commit_before><commit_msg>Add test coverage for utility module<commit_after>
# # (C) Copyright IBM Corp. 2017 # # 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 writi...
Add test coverage for utility module# # (C) Copyright IBM Corp. 2017 # # 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 ...
<commit_before><commit_msg>Add test coverage for utility module<commit_after># # (C) Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
7c1b0d4efd000fee8f065f2f5815075833811331
scripts/reporting/svn_report.py
scripts/reporting/svn_report.py
''' This file creates a .csv file containing the name of each laptop and its last changed date ''' import argparse import csv from datetime import datetime, timezone import os import svn.local import pandas as pd ''' Constants -- paths for reports, default save names, SLA, columns, and sites TO-DO: Change SLA_DAYS to ...
Change file location and rename
Change file location and rename
Python
bsd-3-clause
sibis-platform/ncanda-data-integration,sibis-platform/ncanda-data-integration
Change file location and rename
''' This file creates a .csv file containing the name of each laptop and its last changed date ''' import argparse import csv from datetime import datetime, timezone import os import svn.local import pandas as pd ''' Constants -- paths for reports, default save names, SLA, columns, and sites TO-DO: Change SLA_DAYS to ...
<commit_before><commit_msg>Change file location and rename<commit_after>
''' This file creates a .csv file containing the name of each laptop and its last changed date ''' import argparse import csv from datetime import datetime, timezone import os import svn.local import pandas as pd ''' Constants -- paths for reports, default save names, SLA, columns, and sites TO-DO: Change SLA_DAYS to ...
Change file location and rename''' This file creates a .csv file containing the name of each laptop and its last changed date ''' import argparse import csv from datetime import datetime, timezone import os import svn.local import pandas as pd ''' Constants -- paths for reports, default save names, SLA, columns, and s...
<commit_before><commit_msg>Change file location and rename<commit_after>''' This file creates a .csv file containing the name of each laptop and its last changed date ''' import argparse import csv from datetime import datetime, timezone import os import svn.local import pandas as pd ''' Constants -- paths for reports...
f3f363e8911d3a635d68c7dbe767ee2585ed4f36
checkDuplicates.py
checkDuplicates.py
import pandas as pd from astropy import coordinates as coord from astropy import units as u class Sweetcat: """Load SWEET-Cat database""" def __init__(self): self.fname_sc = 'WEBSITE_online_EU-NASA_full_database.rdb' # Loading the SweetCat database self.readSC() def read...
Check for duplicates based on coordinates and select only one database (EU/NASA)
Check for duplicates based on coordinates and select only one database (EU/NASA)
Python
mit
DanielAndreasen/SWEET-Cat
Check for duplicates based on coordinates and select only one database (EU/NASA)
import pandas as pd from astropy import coordinates as coord from astropy import units as u class Sweetcat: """Load SWEET-Cat database""" def __init__(self): self.fname_sc = 'WEBSITE_online_EU-NASA_full_database.rdb' # Loading the SweetCat database self.readSC() def read...
<commit_before><commit_msg>Check for duplicates based on coordinates and select only one database (EU/NASA)<commit_after>
import pandas as pd from astropy import coordinates as coord from astropy import units as u class Sweetcat: """Load SWEET-Cat database""" def __init__(self): self.fname_sc = 'WEBSITE_online_EU-NASA_full_database.rdb' # Loading the SweetCat database self.readSC() def read...
Check for duplicates based on coordinates and select only one database (EU/NASA)import pandas as pd from astropy import coordinates as coord from astropy import units as u class Sweetcat: """Load SWEET-Cat database""" def __init__(self): self.fname_sc = 'WEBSITE_online_EU-NASA_full_database.rdb' ...
<commit_before><commit_msg>Check for duplicates based on coordinates and select only one database (EU/NASA)<commit_after>import pandas as pd from astropy import coordinates as coord from astropy import units as u class Sweetcat: """Load SWEET-Cat database""" def __init__(self): self.fname_sc = 'WEBSI...
7401d1ecd6b3323b266cf02eabd42a2c4e40d988
tests/test_test.py
tests/test_test.py
"""tests/test_test.py. Test to ensure basic test functionality works as expected. Copyright (C) 2019 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, i...
Add initial tests for test module
Add initial tests for test module
Python
mit
timothycrosley/hug,timothycrosley/hug,timothycrosley/hug
Add initial tests for test module
"""tests/test_test.py. Test to ensure basic test functionality works as expected. Copyright (C) 2019 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, i...
<commit_before><commit_msg>Add initial tests for test module<commit_after>
"""tests/test_test.py. Test to ensure basic test functionality works as expected. Copyright (C) 2019 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, i...
Add initial tests for test module"""tests/test_test.py. Test to ensure basic test functionality works as expected. Copyright (C) 2019 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in th...
<commit_before><commit_msg>Add initial tests for test module<commit_after>"""tests/test_test.py. Test to ensure basic test functionality works as expected. Copyright (C) 2019 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentat...
925da64adf0b74ba18eb78acd9127e3a6dc6f903
tests/test_reported.py
tests/test_reported.py
# -*- coding: utf-8 -*- from pyrql import parse CMP_OPS = ['eq', 'lt', 'le', 'gt', 'ge', 'ne'] class TestReportedErrors: def test_like_with_string_parameter(self): expr = 'like(name,*new jack city*)' rep = {'name': 'like', 'args': ['name', '*new jack city*']} pd = parse(expr) ...
Add test cases for reported issues
Add test cases for reported issues
Python
mit
pjwerneck/pyrql
Add test cases for reported issues
# -*- coding: utf-8 -*- from pyrql import parse CMP_OPS = ['eq', 'lt', 'le', 'gt', 'ge', 'ne'] class TestReportedErrors: def test_like_with_string_parameter(self): expr = 'like(name,*new jack city*)' rep = {'name': 'like', 'args': ['name', '*new jack city*']} pd = parse(expr) ...
<commit_before><commit_msg>Add test cases for reported issues<commit_after>
# -*- coding: utf-8 -*- from pyrql import parse CMP_OPS = ['eq', 'lt', 'le', 'gt', 'ge', 'ne'] class TestReportedErrors: def test_like_with_string_parameter(self): expr = 'like(name,*new jack city*)' rep = {'name': 'like', 'args': ['name', '*new jack city*']} pd = parse(expr) ...
Add test cases for reported issues# -*- coding: utf-8 -*- from pyrql import parse CMP_OPS = ['eq', 'lt', 'le', 'gt', 'ge', 'ne'] class TestReportedErrors: def test_like_with_string_parameter(self): expr = 'like(name,*new jack city*)' rep = {'name': 'like', 'args': ['name', '*new jack city*']}...
<commit_before><commit_msg>Add test cases for reported issues<commit_after># -*- coding: utf-8 -*- from pyrql import parse CMP_OPS = ['eq', 'lt', 'le', 'gt', 'ge', 'ne'] class TestReportedErrors: def test_like_with_string_parameter(self): expr = 'like(name,*new jack city*)' rep = {'name': 'li...
d53358a6a0a564a5b4982f7f3dfdfd1163d6a295
databroker/tests/test_v2/test_no_run_stop.py
databroker/tests/test_v2/test_no_run_stop.py
# This is a special test because we corrupt the generated data. # That is why it does not reuse the standard fixures. import tempfile from suitcase.jsonl import Serializer from bluesky import RunEngine from bluesky.plans import count from ophyd.sim import det from databroker._drivers.jsonl import BlueskyJSONLCatalog ...
Add test covering no RunStop for v2.
Add test covering no RunStop for v2.
Python
bsd-3-clause
ericdill/databroker,ericdill/databroker
Add test covering no RunStop for v2.
# This is a special test because we corrupt the generated data. # That is why it does not reuse the standard fixures. import tempfile from suitcase.jsonl import Serializer from bluesky import RunEngine from bluesky.plans import count from ophyd.sim import det from databroker._drivers.jsonl import BlueskyJSONLCatalog ...
<commit_before><commit_msg>Add test covering no RunStop for v2.<commit_after>
# This is a special test because we corrupt the generated data. # That is why it does not reuse the standard fixures. import tempfile from suitcase.jsonl import Serializer from bluesky import RunEngine from bluesky.plans import count from ophyd.sim import det from databroker._drivers.jsonl import BlueskyJSONLCatalog ...
Add test covering no RunStop for v2.# This is a special test because we corrupt the generated data. # That is why it does not reuse the standard fixures. import tempfile from suitcase.jsonl import Serializer from bluesky import RunEngine from bluesky.plans import count from ophyd.sim import det from databroker._driver...
<commit_before><commit_msg>Add test covering no RunStop for v2.<commit_after># This is a special test because we corrupt the generated data. # That is why it does not reuse the standard fixures. import tempfile from suitcase.jsonl import Serializer from bluesky import RunEngine from bluesky.plans import count from oph...
ace782a3f4c616f9e22e1a1ce29f053b71391845
cms/migrations/0002_update_template_field.py
cms/migrations/0002_update_template_field.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0001_initial'), ] operations = [ migrations.AlterField( model_name='page', name='template', ...
Add missing migration for column description.
Add missing migration for column description.
Python
bsd-3-clause
pbs/django-cms,pbs/django-cms,pbs/django-cms,pbs/django-cms
Add missing migration for column description.
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0001_initial'), ] operations = [ migrations.AlterField( model_name='page', name='template', ...
<commit_before><commit_msg>Add missing migration for column description.<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0001_initial'), ] operations = [ migrations.AlterField( model_name='page', name='template', ...
Add missing migration for column description.# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0001_initial'), ] operations = [ migrations.AlterField( mode...
<commit_before><commit_msg>Add missing migration for column description.<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0001_initial'), ] operations = [ ...
ca002a18b7e392bbdca9d7e0ed8c39739dc5b4a3
pog_absolute_pointing.py
pog_absolute_pointing.py
import numpy as np from Chandra.Time import DateTime import plot_aimpoint # Get 99th percential absolute pointing radius plot_aimpoint.opt = plot_aimpoint.get_opt() asols = plot_aimpoint.get_asol() # Last six months of data asols = asols[asols['time'] > DateTime(-183).secs] # center of box of range of data mid_dy = (...
Add code to get 99th percentile absolute pointing for POG
Add code to get 99th percentile absolute pointing for POG
Python
bsd-2-clause
sot/aimpoint_mon,sot/aimpoint_mon
Add code to get 99th percentile absolute pointing for POG
import numpy as np from Chandra.Time import DateTime import plot_aimpoint # Get 99th percential absolute pointing radius plot_aimpoint.opt = plot_aimpoint.get_opt() asols = plot_aimpoint.get_asol() # Last six months of data asols = asols[asols['time'] > DateTime(-183).secs] # center of box of range of data mid_dy = (...
<commit_before><commit_msg>Add code to get 99th percentile absolute pointing for POG<commit_after>
import numpy as np from Chandra.Time import DateTime import plot_aimpoint # Get 99th percential absolute pointing radius plot_aimpoint.opt = plot_aimpoint.get_opt() asols = plot_aimpoint.get_asol() # Last six months of data asols = asols[asols['time'] > DateTime(-183).secs] # center of box of range of data mid_dy = (...
Add code to get 99th percentile absolute pointing for POGimport numpy as np from Chandra.Time import DateTime import plot_aimpoint # Get 99th percential absolute pointing radius plot_aimpoint.opt = plot_aimpoint.get_opt() asols = plot_aimpoint.get_asol() # Last six months of data asols = asols[asols['time'] > DateTim...
<commit_before><commit_msg>Add code to get 99th percentile absolute pointing for POG<commit_after>import numpy as np from Chandra.Time import DateTime import plot_aimpoint # Get 99th percential absolute pointing radius plot_aimpoint.opt = plot_aimpoint.get_opt() asols = plot_aimpoint.get_asol() # Last six months of d...
72dcd6857f5f895f0fb9325681302f5875bc50ec
profile_collection/startup/31-capillaries.py
profile_collection/startup/31-capillaries.py
#6.342 mm apart #6.074 def capillary6_in(): mov(diff.xh,12.41) mov(diff.yh,-12.58) def capillary7_in(): mov(diff.xh,6.075) mov(diff.yh,-12.58) def capillary8_in(): mov(diff.xh,-.26695) mov(diff.yh,-12.58) def capillary9_in(): mov(diff.xh,-6.609) mov(diff.yh,-12.58) def ...
Add a new user-defined file
Add a new user-defined file capillaries.py for capillary samples
Python
bsd-2-clause
NSLS-II-CHX/ipython_ophyd,NSLS-II-CHX/ipython_ophyd
Add a new user-defined file capillaries.py for capillary samples
#6.342 mm apart #6.074 def capillary6_in(): mov(diff.xh,12.41) mov(diff.yh,-12.58) def capillary7_in(): mov(diff.xh,6.075) mov(diff.yh,-12.58) def capillary8_in(): mov(diff.xh,-.26695) mov(diff.yh,-12.58) def capillary9_in(): mov(diff.xh,-6.609) mov(diff.yh,-12.58) def ...
<commit_before><commit_msg>Add a new user-defined file capillaries.py for capillary samples<commit_after>
#6.342 mm apart #6.074 def capillary6_in(): mov(diff.xh,12.41) mov(diff.yh,-12.58) def capillary7_in(): mov(diff.xh,6.075) mov(diff.yh,-12.58) def capillary8_in(): mov(diff.xh,-.26695) mov(diff.yh,-12.58) def capillary9_in(): mov(diff.xh,-6.609) mov(diff.yh,-12.58) def ...
Add a new user-defined file capillaries.py for capillary samples#6.342 mm apart #6.074 def capillary6_in(): mov(diff.xh,12.41) mov(diff.yh,-12.58) def capillary7_in(): mov(diff.xh,6.075) mov(diff.yh,-12.58) def capillary8_in(): mov(diff.xh,-.26695) mov(diff.yh,-12.58) def capillary...
<commit_before><commit_msg>Add a new user-defined file capillaries.py for capillary samples<commit_after>#6.342 mm apart #6.074 def capillary6_in(): mov(diff.xh,12.41) mov(diff.yh,-12.58) def capillary7_in(): mov(diff.xh,6.075) mov(diff.yh,-12.58) def capillary8_in(): mov(diff.xh,-.26695) ...
f1ee6ce108626342b42a2d2a7b5aa4779af87e6c
plot-histogram.py
plot-histogram.py
import matplotlib.pyplot as plt import sys if __name__ == "__main__": with open(sys.argv[1]) as f: data = map(float, f.readlines()) plt.hist(list(data), 100) plt.show()
Add python code to plot the histogram
Add python code to plot the histogram
Python
mit
chengluyu/SDU-Computer-Networks
Add python code to plot the histogram
import matplotlib.pyplot as plt import sys if __name__ == "__main__": with open(sys.argv[1]) as f: data = map(float, f.readlines()) plt.hist(list(data), 100) plt.show()
<commit_before><commit_msg>Add python code to plot the histogram<commit_after>
import matplotlib.pyplot as plt import sys if __name__ == "__main__": with open(sys.argv[1]) as f: data = map(float, f.readlines()) plt.hist(list(data), 100) plt.show()
Add python code to plot the histogramimport matplotlib.pyplot as plt import sys if __name__ == "__main__": with open(sys.argv[1]) as f: data = map(float, f.readlines()) plt.hist(list(data), 100) plt.show()
<commit_before><commit_msg>Add python code to plot the histogram<commit_after>import matplotlib.pyplot as plt import sys if __name__ == "__main__": with open(sys.argv[1]) as f: data = map(float, f.readlines()) plt.hist(list(data), 100) plt.show()
7da94fd5576f4c052e79a8068164c101054d5ae7
python/simple.py
python/simple.py
import requests # http://python-requests.org/ # Premium user authentication process and API access example r = requests.post('https://api.masterleague.net/auth/token/', data={'username': 'user', 'password': '12345'}) if 'token' not in r.json(): print(r.text) raise ValueError("Unable to extract authentication...
Add Python / `requests` example
Add Python / `requests` example
Python
mit
masterleague-net/api-examples
Add Python / `requests` example
import requests # http://python-requests.org/ # Premium user authentication process and API access example r = requests.post('https://api.masterleague.net/auth/token/', data={'username': 'user', 'password': '12345'}) if 'token' not in r.json(): print(r.text) raise ValueError("Unable to extract authentication...
<commit_before><commit_msg>Add Python / `requests` example<commit_after>
import requests # http://python-requests.org/ # Premium user authentication process and API access example r = requests.post('https://api.masterleague.net/auth/token/', data={'username': 'user', 'password': '12345'}) if 'token' not in r.json(): print(r.text) raise ValueError("Unable to extract authentication...
Add Python / `requests` exampleimport requests # http://python-requests.org/ # Premium user authentication process and API access example r = requests.post('https://api.masterleague.net/auth/token/', data={'username': 'user', 'password': '12345'}) if 'token' not in r.json(): print(r.text) raise ValueError("U...
<commit_before><commit_msg>Add Python / `requests` example<commit_after>import requests # http://python-requests.org/ # Premium user authentication process and API access example r = requests.post('https://api.masterleague.net/auth/token/', data={'username': 'user', 'password': '12345'}) if 'token' not in r.json(): ...
daa4565abe4059e8588ddf374fde0f51d9ec784e
test/integration/test_node_propagation.py
test/integration/test_node_propagation.py
class TestPropagation(object): def test_node_propagation(self): """ Tests that check node propagation 1) Spin up four servers. 2) Make the first one send a sync request to all three others. 3) Count the numbers of requests made. 4) Check databases to see that they al...
Create a skeleton for node propagation integration tests
Create a skeleton for node propagation integration tests
Python
mit
thiderman/network-kitten
Create a skeleton for node propagation integration tests
class TestPropagation(object): def test_node_propagation(self): """ Tests that check node propagation 1) Spin up four servers. 2) Make the first one send a sync request to all three others. 3) Count the numbers of requests made. 4) Check databases to see that they al...
<commit_before><commit_msg>Create a skeleton for node propagation integration tests<commit_after>
class TestPropagation(object): def test_node_propagation(self): """ Tests that check node propagation 1) Spin up four servers. 2) Make the first one send a sync request to all three others. 3) Count the numbers of requests made. 4) Check databases to see that they al...
Create a skeleton for node propagation integration testsclass TestPropagation(object): def test_node_propagation(self): """ Tests that check node propagation 1) Spin up four servers. 2) Make the first one send a sync request to all three others. 3) Count the numbers of reque...
<commit_before><commit_msg>Create a skeleton for node propagation integration tests<commit_after>class TestPropagation(object): def test_node_propagation(self): """ Tests that check node propagation 1) Spin up four servers. 2) Make the first one send a sync request to all three othe...
380a87e71c347eab5d9c5d22a255753e62e1d739
Original_python_game.py
Original_python_game.py
import random GuessesTaken = 0 print ("Hello and welcome to my higher or lower number guessing game.") print ("Whats your name?") myName = input() number = random.randint(1, 20) number1 = random.randint(1, 20) number2 = random.randint(1, 20) number3 = random.randint(1, 20) number4 = random.randint(1, 20) number5 = r...
Add the original game code to the files to show progress made during the week using classes and other skills
Add the original game code to the files to show progress made during the week using classes and other skills
Python
mit
Baseyoyoyo/Higher-or-Lower,Baseyoyoyo/Higher-or-Lower
Add the original game code to the files to show progress made during the week using classes and other skills
import random GuessesTaken = 0 print ("Hello and welcome to my higher or lower number guessing game.") print ("Whats your name?") myName = input() number = random.randint(1, 20) number1 = random.randint(1, 20) number2 = random.randint(1, 20) number3 = random.randint(1, 20) number4 = random.randint(1, 20) number5 = r...
<commit_before><commit_msg>Add the original game code to the files to show progress made during the week using classes and other skills<commit_after>
import random GuessesTaken = 0 print ("Hello and welcome to my higher or lower number guessing game.") print ("Whats your name?") myName = input() number = random.randint(1, 20) number1 = random.randint(1, 20) number2 = random.randint(1, 20) number3 = random.randint(1, 20) number4 = random.randint(1, 20) number5 = r...
Add the original game code to the files to show progress made during the week using classes and other skillsimport random GuessesTaken = 0 print ("Hello and welcome to my higher or lower number guessing game.") print ("Whats your name?") myName = input() number = random.randint(1, 20) number1 = random.randint(1, 20)...
<commit_before><commit_msg>Add the original game code to the files to show progress made during the week using classes and other skills<commit_after>import random GuessesTaken = 0 print ("Hello and welcome to my higher or lower number guessing game.") print ("Whats your name?") myName = input() number = random.randi...
5e574a24d95e686bc2592af439e148e68036c61d
tests/unit/cloud/clouds/nova_test.py
tests/unit/cloud/clouds/nova_test.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing Libs from salttesting import TestCase from salt.cloud.clouds import nova from salttesting.mock import MagicMock, patch from tests.unit.cloud.clouds impor...
Add unit test for nova connector
Add unit test for nova connector
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
Add unit test for nova connector
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing Libs from salttesting import TestCase from salt.cloud.clouds import nova from salttesting.mock import MagicMock, patch from tests.unit.cloud.clouds impor...
<commit_before><commit_msg>Add unit test for nova connector<commit_after>
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing Libs from salttesting import TestCase from salt.cloud.clouds import nova from salttesting.mock import MagicMock, patch from tests.unit.cloud.clouds impor...
Add unit test for nova connector# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing Libs from salttesting import TestCase from salt.cloud.clouds import nova from salttesting.mock import MagicMock, patch fr...
<commit_before><commit_msg>Add unit test for nova connector<commit_after># -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing Libs from salttesting import TestCase from salt.cloud.clouds import nova from sa...
8fe5e768f20abfdd790870075950b6537c5cad6a
ptest.py
ptest.py
#!/usr/bin/python3 from sys import exit class Ptest(object): def __init__(self, module_name): self.module_name = module_name self.passed = 0 self.failed = 0 print('\nRunning tests for module "', module_name, '"', sep='') def report(self, test_name, test_result): if t...
Add class containing test state and report + print methods
Add class containing test state and report + print methods Class Ptest represents the state of unit testing for one module. It has two methods, report and print_statistics. Report records the status of a single unit test, and report_statistics prints the ratios of passing and failing for current module.
Python
unlicense
Mikko-Finell/ptest
Add class containing test state and report + print methods Class Ptest represents the state of unit testing for one module. It has two methods, report and print_statistics. Report records the status of a single unit test, and report_statistics prints the ratios of passing and failing for current module.
#!/usr/bin/python3 from sys import exit class Ptest(object): def __init__(self, module_name): self.module_name = module_name self.passed = 0 self.failed = 0 print('\nRunning tests for module "', module_name, '"', sep='') def report(self, test_name, test_result): if t...
<commit_before><commit_msg>Add class containing test state and report + print methods Class Ptest represents the state of unit testing for one module. It has two methods, report and print_statistics. Report records the status of a single unit test, and report_statistics prints the ratios of passing and failing for cur...
#!/usr/bin/python3 from sys import exit class Ptest(object): def __init__(self, module_name): self.module_name = module_name self.passed = 0 self.failed = 0 print('\nRunning tests for module "', module_name, '"', sep='') def report(self, test_name, test_result): if t...
Add class containing test state and report + print methods Class Ptest represents the state of unit testing for one module. It has two methods, report and print_statistics. Report records the status of a single unit test, and report_statistics prints the ratios of passing and failing for current module.#!/usr/bin/pyth...
<commit_before><commit_msg>Add class containing test state and report + print methods Class Ptest represents the state of unit testing for one module. It has two methods, report and print_statistics. Report records the status of a single unit test, and report_statistics prints the ratios of passing and failing for cur...
a15e363718ab41c5e02b9eaa919fb689cd266af6
nose2/tests/_common.py
nose2/tests/_common.py
"""Common functionality.""" import os.path import tempfile import shutil import sys class TestCase(unittest2.TestCase): """TestCase extension. If the class variable _RUN_IN_TEMP is True (default: False), tests will be performed in a temporary directory, which is deleted afterwards. """ ...
Add common module for our tests
Add common module for our tests
Python
bsd-2-clause
ptthiem/nose2,ojengwa/nose2,ezigman/nose2,ojengwa/nose2,leth/nose2,ezigman/nose2,ptthiem/nose2,little-dude/nose2,leth/nose2,little-dude/nose2
Add common module for our tests
"""Common functionality.""" import os.path import tempfile import shutil import sys class TestCase(unittest2.TestCase): """TestCase extension. If the class variable _RUN_IN_TEMP is True (default: False), tests will be performed in a temporary directory, which is deleted afterwards. """ ...
<commit_before><commit_msg>Add common module for our tests<commit_after>
"""Common functionality.""" import os.path import tempfile import shutil import sys class TestCase(unittest2.TestCase): """TestCase extension. If the class variable _RUN_IN_TEMP is True (default: False), tests will be performed in a temporary directory, which is deleted afterwards. """ ...
Add common module for our tests"""Common functionality.""" import os.path import tempfile import shutil import sys class TestCase(unittest2.TestCase): """TestCase extension. If the class variable _RUN_IN_TEMP is True (default: False), tests will be performed in a temporary directory, which i...
<commit_before><commit_msg>Add common module for our tests<commit_after>"""Common functionality.""" import os.path import tempfile import shutil import sys class TestCase(unittest2.TestCase): """TestCase extension. If the class variable _RUN_IN_TEMP is True (default: False), tests will be pe...
44b6b0ff5efc6d9fcda4f886640663b68e7d6c14
pybaseball/league_batting_stats.py
pybaseball/league_batting_stats.py
""" TODO pull batting stats over specified time period allow option to get stats for full seasons instead of ranges """ import requests import pandas as pd from bs4 import BeautifulSoup def get_soup(start_dt, end_dt): # get most recent standings if date not specified if((start_dt is None) or (end_dt is None)): ...
Add initial code for getting batting stats over a specified timeframe
Add initial code for getting batting stats over a specified timeframe
Python
mit
jldbc/pybaseball
Add initial code for getting batting stats over a specified timeframe
""" TODO pull batting stats over specified time period allow option to get stats for full seasons instead of ranges """ import requests import pandas as pd from bs4 import BeautifulSoup def get_soup(start_dt, end_dt): # get most recent standings if date not specified if((start_dt is None) or (end_dt is None)): ...
<commit_before><commit_msg>Add initial code for getting batting stats over a specified timeframe<commit_after>
""" TODO pull batting stats over specified time period allow option to get stats for full seasons instead of ranges """ import requests import pandas as pd from bs4 import BeautifulSoup def get_soup(start_dt, end_dt): # get most recent standings if date not specified if((start_dt is None) or (end_dt is None)): ...
Add initial code for getting batting stats over a specified timeframe """ TODO pull batting stats over specified time period allow option to get stats for full seasons instead of ranges """ import requests import pandas as pd from bs4 import BeautifulSoup def get_soup(start_dt, end_dt): # get most recent standings ...
<commit_before><commit_msg>Add initial code for getting batting stats over a specified timeframe<commit_after> """ TODO pull batting stats over specified time period allow option to get stats for full seasons instead of ranges """ import requests import pandas as pd from bs4 import BeautifulSoup def get_soup(start_d...
25495d675c44a75d7dedfe123f30a858f9cd60be
test/test_play.py
test/test_play.py
# -*- coding: utf-8 -*- """Tests for the play plugin""" from __future__ import (division, absolute_import, print_function, unicode_literals) from mock import patch, Mock from test._common import unittest from test.helper import TestHelper from beetsplug.play import PlayPlugin class PlayPl...
Add minimal (no asserts) test for play plugin
Add minimal (no asserts) test for play plugin
Python
mit
MyTunesFreeMusic/privacy-policy,diego-plan9/beets,sampsyo/beets,sampsyo/beets,jcoady9/beets,swt30/beets,jcoady9/beets,LordSputnik/beets,jackwilsdon/beets,MyTunesFreeMusic/privacy-policy,parapente/beets,ibmibmibm/beets,ibmibmibm/beets,lengtche/beets,Freso/beets,xsteadfastx/beets,LordSputnik/beets,madmouser1/beets,lengtc...
Add minimal (no asserts) test for play plugin
# -*- coding: utf-8 -*- """Tests for the play plugin""" from __future__ import (division, absolute_import, print_function, unicode_literals) from mock import patch, Mock from test._common import unittest from test.helper import TestHelper from beetsplug.play import PlayPlugin class PlayPl...
<commit_before><commit_msg>Add minimal (no asserts) test for play plugin<commit_after>
# -*- coding: utf-8 -*- """Tests for the play plugin""" from __future__ import (division, absolute_import, print_function, unicode_literals) from mock import patch, Mock from test._common import unittest from test.helper import TestHelper from beetsplug.play import PlayPlugin class PlayPl...
Add minimal (no asserts) test for play plugin# -*- coding: utf-8 -*- """Tests for the play plugin""" from __future__ import (division, absolute_import, print_function, unicode_literals) from mock import patch, Mock from test._common import unittest from test.helper import TestHelper from be...
<commit_before><commit_msg>Add minimal (no asserts) test for play plugin<commit_after># -*- coding: utf-8 -*- """Tests for the play plugin""" from __future__ import (division, absolute_import, print_function, unicode_literals) from mock import patch, Mock from test._common import unittest fr...
8aada38d951d039e11e03a6bae9445c784bb4cce
parse-demo.py
parse-demo.py
#!/usr/bin/python3 import sys, os import nltk if len(sys.argv) < 2: print("Please supply a filename.") sys.exit(1) filename = sys.argv[1] with open(filename, 'r') as f: data = f.read() # Break the input down into sentences, then into words, and position tag # those words. sentences = [nltk.pos_tag(nltk...
Write a brief demo using nltk
Write a brief demo using nltk
Python
mit
alexander-bauer/syllabus-summary
Write a brief demo using nltk
#!/usr/bin/python3 import sys, os import nltk if len(sys.argv) < 2: print("Please supply a filename.") sys.exit(1) filename = sys.argv[1] with open(filename, 'r') as f: data = f.read() # Break the input down into sentences, then into words, and position tag # those words. sentences = [nltk.pos_tag(nltk...
<commit_before><commit_msg>Write a brief demo using nltk<commit_after>
#!/usr/bin/python3 import sys, os import nltk if len(sys.argv) < 2: print("Please supply a filename.") sys.exit(1) filename = sys.argv[1] with open(filename, 'r') as f: data = f.read() # Break the input down into sentences, then into words, and position tag # those words. sentences = [nltk.pos_tag(nltk...
Write a brief demo using nltk#!/usr/bin/python3 import sys, os import nltk if len(sys.argv) < 2: print("Please supply a filename.") sys.exit(1) filename = sys.argv[1] with open(filename, 'r') as f: data = f.read() # Break the input down into sentences, then into words, and position tag # those words. s...
<commit_before><commit_msg>Write a brief demo using nltk<commit_after>#!/usr/bin/python3 import sys, os import nltk if len(sys.argv) < 2: print("Please supply a filename.") sys.exit(1) filename = sys.argv[1] with open(filename, 'r') as f: data = f.read() # Break the input down into sentences, then into...
b72f8a9b0d9df7d42c43c6a294cc3aab2cb91641
blog/migrations/0002_auto_20190605_1104.py
blog/migrations/0002_auto_20190605_1104.py
# Generated by Django 2.2.2 on 2019-06-05 08:04 import blog.abstract from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0001_squashed_0006_auto_20180206_2239'), ] operations...
Add missing migrations for limit_choices_to on BlogPage.author
Add missing migrations for limit_choices_to on BlogPage.author
Python
apache-2.0
thelabnyc/wagtail_blog,thelabnyc/wagtail_blog
Add missing migrations for limit_choices_to on BlogPage.author
# Generated by Django 2.2.2 on 2019-06-05 08:04 import blog.abstract from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0001_squashed_0006_auto_20180206_2239'), ] operations...
<commit_before><commit_msg>Add missing migrations for limit_choices_to on BlogPage.author<commit_after>
# Generated by Django 2.2.2 on 2019-06-05 08:04 import blog.abstract from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0001_squashed_0006_auto_20180206_2239'), ] operations...
Add missing migrations for limit_choices_to on BlogPage.author# Generated by Django 2.2.2 on 2019-06-05 08:04 import blog.abstract from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '...
<commit_before><commit_msg>Add missing migrations for limit_choices_to on BlogPage.author<commit_after># Generated by Django 2.2.2 on 2019-06-05 08:04 import blog.abstract from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration):...
b9feeb2a37f0596b48f9582e8953d29485167fc8
tools/sofa-edr.py
tools/sofa-edr.py
#!/usr/bin/env python3 import subprocess import time import argparse if __name__ == '__main__': bwa_is_recorded = False smb_is_recorded = False htvc_is_recorded = False parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.') parser.add_argument('--trac...
Add an event-driven recording tool
Add an event-driven recording tool
Python
apache-2.0
cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa
Add an event-driven recording tool
#!/usr/bin/env python3 import subprocess import time import argparse if __name__ == '__main__': bwa_is_recorded = False smb_is_recorded = False htvc_is_recorded = False parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.') parser.add_argument('--trac...
<commit_before><commit_msg>Add an event-driven recording tool<commit_after>
#!/usr/bin/env python3 import subprocess import time import argparse if __name__ == '__main__': bwa_is_recorded = False smb_is_recorded = False htvc_is_recorded = False parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.') parser.add_argument('--trac...
Add an event-driven recording tool#!/usr/bin/env python3 import subprocess import time import argparse if __name__ == '__main__': bwa_is_recorded = False smb_is_recorded = False htvc_is_recorded = False parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording....
<commit_before><commit_msg>Add an event-driven recording tool<commit_after>#!/usr/bin/env python3 import subprocess import time import argparse if __name__ == '__main__': bwa_is_recorded = False smb_is_recorded = False htvc_is_recorded = False parser = argparse.ArgumentParser(description='A SOFA wrapp...
784fd8b08ee0f268350a2003a9c06522c0678874
python/run.py
python/run.py
import logging import numpy from numpy import genfromtxt from sktensor import sptensor, cp_als # Set logging to DEBUG to see CP-ALS information logging.basicConfig(level=logging.DEBUG) data = genfromtxt('../datasets/movielens-synthesized/ratings-synthesized-50k.csv', delimiter=',') # we need to convert data into two ...
Add python code for doing tensor decomposition with scikit-tensor.
Add python code for doing tensor decomposition with scikit-tensor.
Python
mit
monsendag/goldfish,ntnu-smartmedia/goldfish,monsendag/goldfish,ntnu-smartmedia/goldfish,monsendag/goldfish,ntnu-smartmedia/goldfish
Add python code for doing tensor decomposition with scikit-tensor.
import logging import numpy from numpy import genfromtxt from sktensor import sptensor, cp_als # Set logging to DEBUG to see CP-ALS information logging.basicConfig(level=logging.DEBUG) data = genfromtxt('../datasets/movielens-synthesized/ratings-synthesized-50k.csv', delimiter=',') # we need to convert data into two ...
<commit_before><commit_msg>Add python code for doing tensor decomposition with scikit-tensor.<commit_after>
import logging import numpy from numpy import genfromtxt from sktensor import sptensor, cp_als # Set logging to DEBUG to see CP-ALS information logging.basicConfig(level=logging.DEBUG) data = genfromtxt('../datasets/movielens-synthesized/ratings-synthesized-50k.csv', delimiter=',') # we need to convert data into two ...
Add python code for doing tensor decomposition with scikit-tensor.import logging import numpy from numpy import genfromtxt from sktensor import sptensor, cp_als # Set logging to DEBUG to see CP-ALS information logging.basicConfig(level=logging.DEBUG) data = genfromtxt('../datasets/movielens-synthesized/ratings-synthes...
<commit_before><commit_msg>Add python code for doing tensor decomposition with scikit-tensor.<commit_after>import logging import numpy from numpy import genfromtxt from sktensor import sptensor, cp_als # Set logging to DEBUG to see CP-ALS information logging.basicConfig(level=logging.DEBUG) data = genfromtxt('../datas...
d50814603217ca9ea47324a0ad516ce7418bc9bf
build/generate_standalone_timeline_view.py
build/generate_standalone_timeline_view.py
#!/usr/bin/env python # Copyright (c) 2012 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 parse_deps import sys import os srcdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) ...
Add script to generate a standalone timeline view.
Add script to generate a standalone timeline view. TBR=jgennis@google.com Review URL: https://codereview.appspot.com/6497071
Python
bsd-3-clause
sahiljain/catapult,danbeam/catapult,catapult-project/catapult-csm,scottmcmaster/catapult,sahiljain/catapult,catapult-project/catapult-csm,0x90sled/catapult,benschmaus/catapult,catapult-project/catapult-csm,0x90sled/catapult,zeptonaut/catapult,danbeam/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,b...
Add script to generate a standalone timeline view. TBR=jgennis@google.com Review URL: https://codereview.appspot.com/6497071
#!/usr/bin/env python # Copyright (c) 2012 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 parse_deps import sys import os srcdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) ...
<commit_before><commit_msg>Add script to generate a standalone timeline view. TBR=jgennis@google.com Review URL: https://codereview.appspot.com/6497071<commit_after>
#!/usr/bin/env python # Copyright (c) 2012 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 parse_deps import sys import os srcdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) ...
Add script to generate a standalone timeline view. TBR=jgennis@google.com Review URL: https://codereview.appspot.com/6497071#!/usr/bin/env python # Copyright (c) 2012 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...
<commit_before><commit_msg>Add script to generate a standalone timeline view. TBR=jgennis@google.com Review URL: https://codereview.appspot.com/6497071<commit_after>#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that c...
f34dd8ab047275b8d29366599621443a8bc468c9
databaker/databaker_nbconvert.py
databaker/databaker_nbconvert.py
#!/usr/bin/env python import os import subprocess import sys def main(argv): if len(argv) == 0 or len(argv) > 2: print("Usage: databaker_process.py <notebook_file> <input_file>") print() print("<input_file> is optional; it replaces DATABAKER_INPUT_FILE") print("in the notebook.") ...
Add launcher script for nbconvert
Add launcher script for nbconvert To work around command line argument issues.
Python
agpl-3.0
scraperwiki/databaker,scraperwiki/databaker
Add launcher script for nbconvert To work around command line argument issues.
#!/usr/bin/env python import os import subprocess import sys def main(argv): if len(argv) == 0 or len(argv) > 2: print("Usage: databaker_process.py <notebook_file> <input_file>") print() print("<input_file> is optional; it replaces DATABAKER_INPUT_FILE") print("in the notebook.") ...
<commit_before><commit_msg>Add launcher script for nbconvert To work around command line argument issues.<commit_after>
#!/usr/bin/env python import os import subprocess import sys def main(argv): if len(argv) == 0 or len(argv) > 2: print("Usage: databaker_process.py <notebook_file> <input_file>") print() print("<input_file> is optional; it replaces DATABAKER_INPUT_FILE") print("in the notebook.") ...
Add launcher script for nbconvert To work around command line argument issues.#!/usr/bin/env python import os import subprocess import sys def main(argv): if len(argv) == 0 or len(argv) > 2: print("Usage: databaker_process.py <notebook_file> <input_file>") print() print("<input_file> is o...
<commit_before><commit_msg>Add launcher script for nbconvert To work around command line argument issues.<commit_after>#!/usr/bin/env python import os import subprocess import sys def main(argv): if len(argv) == 0 or len(argv) > 2: print("Usage: databaker_process.py <notebook_file> <input_file>") ...
fc9dd735c96ae21b4a64286e4c9ebcedc0e1fbca
subsetKerning.py
subsetKerning.py
import sys from plistlib import writePlist from defcon import Font __doc__ = ''' Subset kerning in UFO given a list of glyphs provided. Will export new plist files that can be swapped into the UFO. Usage: python subsetKerning.py subsetList font.ufo ''' class SubsetKerning(object): """docstring for SubsetKernin...
Add script to subset kerning plist.
Add script to subset kerning plist.
Python
mit
adobe-type-tools/kern-dump
Add script to subset kerning plist.
import sys from plistlib import writePlist from defcon import Font __doc__ = ''' Subset kerning in UFO given a list of glyphs provided. Will export new plist files that can be swapped into the UFO. Usage: python subsetKerning.py subsetList font.ufo ''' class SubsetKerning(object): """docstring for SubsetKernin...
<commit_before><commit_msg>Add script to subset kerning plist.<commit_after>
import sys from plistlib import writePlist from defcon import Font __doc__ = ''' Subset kerning in UFO given a list of glyphs provided. Will export new plist files that can be swapped into the UFO. Usage: python subsetKerning.py subsetList font.ufo ''' class SubsetKerning(object): """docstring for SubsetKernin...
Add script to subset kerning plist.import sys from plistlib import writePlist from defcon import Font __doc__ = ''' Subset kerning in UFO given a list of glyphs provided. Will export new plist files that can be swapped into the UFO. Usage: python subsetKerning.py subsetList font.ufo ''' class SubsetKerning(object)...
<commit_before><commit_msg>Add script to subset kerning plist.<commit_after>import sys from plistlib import writePlist from defcon import Font __doc__ = ''' Subset kerning in UFO given a list of glyphs provided. Will export new plist files that can be swapped into the UFO. Usage: python subsetKerning.py subsetList f...
945fe81c4a0f970e57ff7c5a13d8c3aa03df5fc6
numscons/checkers/new/common.py
numscons/checkers/new/common.py
from copy import deepcopy def save_and_set(env, opts, keys=None): """Put informations from option configuration into a scons environment, and returns the savedkeys given as config opts args.""" saved_keys = {} if keys is None: keys = opts.keys() for k in keys: saved_keys[k] = (env.h...
Add function to save/restore environment between configuration checks.
Add function to save/restore environment between configuration checks.
Python
bsd-3-clause
cournape/numscons,cournape/numscons,cournape/numscons
Add function to save/restore environment between configuration checks.
from copy import deepcopy def save_and_set(env, opts, keys=None): """Put informations from option configuration into a scons environment, and returns the savedkeys given as config opts args.""" saved_keys = {} if keys is None: keys = opts.keys() for k in keys: saved_keys[k] = (env.h...
<commit_before><commit_msg>Add function to save/restore environment between configuration checks.<commit_after>
from copy import deepcopy def save_and_set(env, opts, keys=None): """Put informations from option configuration into a scons environment, and returns the savedkeys given as config opts args.""" saved_keys = {} if keys is None: keys = opts.keys() for k in keys: saved_keys[k] = (env.h...
Add function to save/restore environment between configuration checks.from copy import deepcopy def save_and_set(env, opts, keys=None): """Put informations from option configuration into a scons environment, and returns the savedkeys given as config opts args.""" saved_keys = {} if keys is None: ...
<commit_before><commit_msg>Add function to save/restore environment between configuration checks.<commit_after>from copy import deepcopy def save_and_set(env, opts, keys=None): """Put informations from option configuration into a scons environment, and returns the savedkeys given as config opts args.""" sa...
e19e45f7c6ff68599503c3ee0d6712974a8b4e66
tests/error_test.py
tests/error_test.py
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et import pycurl import sys import unittest class ErrorTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() def tearDown(self): self.curl.close() # error originating in libcurl def test_pycurl_error_libcurl(...
Document current pycurl exception behavior
Document current pycurl exception behavior
Python
lgpl-2.1
pycurl/pycurl,pycurl/pycurl,pycurl/pycurl
Document current pycurl exception behavior
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et import pycurl import sys import unittest class ErrorTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() def tearDown(self): self.curl.close() # error originating in libcurl def test_pycurl_error_libcurl(...
<commit_before><commit_msg>Document current pycurl exception behavior<commit_after>
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et import pycurl import sys import unittest class ErrorTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() def tearDown(self): self.curl.close() # error originating in libcurl def test_pycurl_error_libcurl(...
Document current pycurl exception behavior#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et import pycurl import sys import unittest class ErrorTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() def tearDown(self): self.curl.close() # error originating in ...
<commit_before><commit_msg>Document current pycurl exception behavior<commit_after>#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et import pycurl import sys import unittest class ErrorTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() def tearDown(self): self....
b6500cc5ae48212b7cabefc313b417a42273274b
tests/test_parse.py
tests/test_parse.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import mock from tldr.parser import parse_page class TestParse(unittest.TestCase): def test_parse_page(self): mock_config = { 'colors': { 'command': 'cyan', ...
Add test for parsing the man page
Add test for parsing the man page
Python
mit
lord63/tldr.py
Add test for parsing the man page
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import mock from tldr.parser import parse_page class TestParse(unittest.TestCase): def test_parse_page(self): mock_config = { 'colors': { 'command': 'cyan', ...
<commit_before><commit_msg>Add test for parsing the man page<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import mock from tldr.parser import parse_page class TestParse(unittest.TestCase): def test_parse_page(self): mock_config = { 'colors': { 'command': 'cyan', ...
Add test for parsing the man page#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import mock from tldr.parser import parse_page class TestParse(unittest.TestCase): def test_parse_page(self): mock_config = { 'colors': { 'c...
<commit_before><commit_msg>Add test for parsing the man page<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import mock from tldr.parser import parse_page class TestParse(unittest.TestCase): def test_parse_page(self): mock_config = { ...
fadac460052cb1a778bf8398879e1cb616c26228
propaganda/migrations/0002_auto_20150802_1841.py
propaganda/migrations/0002_auto_20150802_1841.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('propaganda', '0001_initial'), ] operations = [ migrations.AlterField( model_name='subscriber', name=...
Add new migration for Django 1.8
Add new migration for Django 1.8
Python
bsd-3-clause
nabucosound/django-propaganda
Add new migration for Django 1.8
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('propaganda', '0001_initial'), ] operations = [ migrations.AlterField( model_name='subscriber', name=...
<commit_before><commit_msg>Add new migration for Django 1.8<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('propaganda', '0001_initial'), ] operations = [ migrations.AlterField( model_name='subscriber', name=...
Add new migration for Django 1.8# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('propaganda', '0001_initial'), ] operations = [ migrations.AlterField( model_name...
<commit_before><commit_msg>Add new migration for Django 1.8<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('propaganda', '0001_initial'), ] operations = [ migr...
59a228312bb3091db8bfb6bf9a75ce4ae47431f4
neuralnets/net_test.py
neuralnets/net_test.py
from net import NeuralNet import numpy as np #TODO(Wesley) More tests class TestNeuralNet(object): def test_zero_system(self): net = NeuralNet(3, 2, 4, 1, seed=0) net.weights = [ np.zeros((3,4)), np.zeros((4,4)), np.zeros((4,4)), ...
Add zero system test to neural net
Add zero system test to neural net
Python
mit
WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox
Add zero system test to neural net
from net import NeuralNet import numpy as np #TODO(Wesley) More tests class TestNeuralNet(object): def test_zero_system(self): net = NeuralNet(3, 2, 4, 1, seed=0) net.weights = [ np.zeros((3,4)), np.zeros((4,4)), np.zeros((4,4)), ...
<commit_before><commit_msg>Add zero system test to neural net<commit_after>
from net import NeuralNet import numpy as np #TODO(Wesley) More tests class TestNeuralNet(object): def test_zero_system(self): net = NeuralNet(3, 2, 4, 1, seed=0) net.weights = [ np.zeros((3,4)), np.zeros((4,4)), np.zeros((4,4)), ...
Add zero system test to neural netfrom net import NeuralNet import numpy as np #TODO(Wesley) More tests class TestNeuralNet(object): def test_zero_system(self): net = NeuralNet(3, 2, 4, 1, seed=0) net.weights = [ np.zeros((3,4)), np.zeros((4,4)), np....
<commit_before><commit_msg>Add zero system test to neural net<commit_after>from net import NeuralNet import numpy as np #TODO(Wesley) More tests class TestNeuralNet(object): def test_zero_system(self): net = NeuralNet(3, 2, 4, 1, seed=0) net.weights = [ np.zeros((3,4)), np....
d97b9f6c508dd24da0f86bc1587ea64708c84a89
tools/dist/security/mailinglist.py
tools/dist/security/mailinglist.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...
Add parser for the advisory mail recipients.
Add parser for the advisory mail recipients. * tools/dist/security/mailinglist.py: New. git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1717919 13f79535-47bb-0310-9956-ffa450edef68
Python
apache-2.0
YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion
Add parser for the advisory mail recipients. * tools/dist/security/mailinglist.py: New. git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1717919 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...
<commit_before><commit_msg>Add parser for the advisory mail recipients. * tools/dist/security/mailinglist.py: New. git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1717919 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...
Add parser for the advisory mail recipients. * tools/dist/security/mailinglist.py: New. git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1717919 13f79535-47bb-0310-9956-ffa450edef68# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # dist...
<commit_before><commit_msg>Add parser for the advisory mail recipients. * tools/dist/security/mailinglist.py: New. git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1717919 13f79535-47bb-0310-9956-ffa450edef68<commit_after># # Licensed to the Apache Software Foundation (ASF) under one # or more contributor licens...
009182d0c603f9c1f8fa650f6a9771b38a74c6cc
flexget/plugins/plugin_disable_builtins.py
flexget/plugins/plugin_disable_builtins.py
import logging from flexget import plugin from flexget.plugin import priority, register_plugin log = logging.getLogger('builtins') class PluginDisableBuiltins(object): """ Disables all builtin plugins from a feed. """ def __init__(self): self.disabled = [] def validator(self): ...
import logging from flexget import plugin from flexget.plugin import priority, register_plugin, plugins log = logging.getLogger('builtins') def all_builtins(): """Helper function to return an iterator over all builtin plugins.""" return (plugin for plugin in plugins.itervalues() if plugin.builtin) class Pl...
Add a proper validator for disable_builtins
Add a proper validator for disable_builtins git-svn-id: ad91b9aa7ba7638d69f912c9f5d012e3326e9f74@2243 3942dd89-8c5d-46d7-aeed-044bccf3e60c
Python
mit
thalamus/Flexget,offbyone/Flexget,drwyrm/Flexget,Danfocus/Flexget,poulpito/Flexget,drwyrm/Flexget,malkavi/Flexget,sean797/Flexget,oxc/Flexget,jawilson/Flexget,jacobmetrick/Flexget,ZefQ/Flexget,JorisDeRieck/Flexget,gazpachoking/Flexget,asm0dey/Flexget,drwyrm/Flexget,vfrc2/Flexget,JorisDeRieck/Flexget,jawilson/Flexget,xf...
import logging from flexget import plugin from flexget.plugin import priority, register_plugin log = logging.getLogger('builtins') class PluginDisableBuiltins(object): """ Disables all builtin plugins from a feed. """ def __init__(self): self.disabled = [] def validator(self): ...
import logging from flexget import plugin from flexget.plugin import priority, register_plugin, plugins log = logging.getLogger('builtins') def all_builtins(): """Helper function to return an iterator over all builtin plugins.""" return (plugin for plugin in plugins.itervalues() if plugin.builtin) class Pl...
<commit_before>import logging from flexget import plugin from flexget.plugin import priority, register_plugin log = logging.getLogger('builtins') class PluginDisableBuiltins(object): """ Disables all builtin plugins from a feed. """ def __init__(self): self.disabled = [] def validat...
import logging from flexget import plugin from flexget.plugin import priority, register_plugin, plugins log = logging.getLogger('builtins') def all_builtins(): """Helper function to return an iterator over all builtin plugins.""" return (plugin for plugin in plugins.itervalues() if plugin.builtin) class Pl...
import logging from flexget import plugin from flexget.plugin import priority, register_plugin log = logging.getLogger('builtins') class PluginDisableBuiltins(object): """ Disables all builtin plugins from a feed. """ def __init__(self): self.disabled = [] def validator(self): ...
<commit_before>import logging from flexget import plugin from flexget.plugin import priority, register_plugin log = logging.getLogger('builtins') class PluginDisableBuiltins(object): """ Disables all builtin plugins from a feed. """ def __init__(self): self.disabled = [] def validat...
9e2669539c5d7662bb6d6a89877b30235eef1bc2
xor.py
xor.py
# http://www.codechef.com/DEC14/problems/XORSUB import operator def f(p): if p == []: return 0 elif len(p) == 1: return p[0] else: return reduce(operator.xor, p) def list_powerset(lst): result = [[]] for x in lst: result.extend([subset + [x] for subset in result]) return result t = int(ra...
Write solution to DEC14 XOR question.
Write solution to DEC14 XOR question.
Python
mit
paramsingh/cp,paramsingh/codechef-solutions,paramsingh/cp,paramsingh/codechef-solutions,paramsingh/cp,paramsingh/cp,paramsingh/codechef-solutions,paramsingh/codechef-solutions,paramsingh/cp
Write solution to DEC14 XOR question.
# http://www.codechef.com/DEC14/problems/XORSUB import operator def f(p): if p == []: return 0 elif len(p) == 1: return p[0] else: return reduce(operator.xor, p) def list_powerset(lst): result = [[]] for x in lst: result.extend([subset + [x] for subset in result]) return result t = int(ra...
<commit_before><commit_msg>Write solution to DEC14 XOR question.<commit_after>
# http://www.codechef.com/DEC14/problems/XORSUB import operator def f(p): if p == []: return 0 elif len(p) == 1: return p[0] else: return reduce(operator.xor, p) def list_powerset(lst): result = [[]] for x in lst: result.extend([subset + [x] for subset in result]) return result t = int(ra...
Write solution to DEC14 XOR question.# http://www.codechef.com/DEC14/problems/XORSUB import operator def f(p): if p == []: return 0 elif len(p) == 1: return p[0] else: return reduce(operator.xor, p) def list_powerset(lst): result = [[]] for x in lst: result.extend([subset + [x] for subset in r...
<commit_before><commit_msg>Write solution to DEC14 XOR question.<commit_after># http://www.codechef.com/DEC14/problems/XORSUB import operator def f(p): if p == []: return 0 elif len(p) == 1: return p[0] else: return reduce(operator.xor, p) def list_powerset(lst): result = [[]] for x in lst: re...
fc21bb14600f79a3d9970272fb7edd4eba548262
st2actions/tests/integration/test_python_action_process_wrapper.py
st2actions/tests/integration/test_python_action_process_wrapper.py
# 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 "License"); you may not use th...
Add test for python runner action wrapper process script performance.
Add test for python runner action wrapper process script performance.
Python
apache-2.0
tonybaloney/st2,nzlosh/st2,Plexxi/st2,StackStorm/st2,lakshmi-kannan/st2,peak6/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,lakshmi-kannan/st2,StackStorm/st2,peak6/st2,StackStorm/st2,Plexxi/st2,peak6/st2,nzlosh/st2,nzlosh/st2,nzlosh/st2,tonybaloney/st2,tonybaloney/st2,lakshmi-kannan/st2
Add test for python runner action wrapper process script performance.
# 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 "License"); you may not use th...
<commit_before><commit_msg>Add test for python runner action wrapper process script performance.<commit_after>
# 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 "License"); you may not use th...
Add test for python runner action wrapper process script performance.# 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 ...
<commit_before><commit_msg>Add test for python runner action wrapper process script performance.<commit_after># 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. #...
7b09ba64c0327ecea04cc95057ffa7d5c8d939c8
setuptools/tests/test_setopt.py
setuptools/tests/test_setopt.py
# coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @staticmethod def parse_config(filename): parser = configparser.ConfigParser() with io.open(filename, enco...
Add test for setopt to demonstrate that edit_config retains non-ASCII characters.
Add test for setopt to demonstrate that edit_config retains non-ASCII characters.
Python
mit
pypa/setuptools,pypa/setuptools,pypa/setuptools
Add test for setopt to demonstrate that edit_config retains non-ASCII characters.
# coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @staticmethod def parse_config(filename): parser = configparser.ConfigParser() with io.open(filename, enco...
<commit_before><commit_msg>Add test for setopt to demonstrate that edit_config retains non-ASCII characters.<commit_after>
# coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @staticmethod def parse_config(filename): parser = configparser.ConfigParser() with io.open(filename, enco...
Add test for setopt to demonstrate that edit_config retains non-ASCII characters.# coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @staticmethod def parse_config(filename):...
<commit_before><commit_msg>Add test for setopt to demonstrate that edit_config retains non-ASCII characters.<commit_after># coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @sta...
238d031651cb74d0ca9bed9d38cda836049c9c37
src/sentry/api/serializers/models/grouptagkey.py
src/sentry/api/serializers/models/grouptagkey.py
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label() fo...
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label() fo...
Correct fallback for tag name
Correct fallback for tag name
Python
bsd-3-clause
daevaorn/sentry,gencer/sentry,zenefits/sentry,beeftornado/sentry,imankulov/sentry,BuildingLink/sentry,looker/sentry,looker/sentry,fotinakis/sentry,JamesMura/sentry,mvaled/sentry,alexm92/sentry,ifduyue/sentry,jean/sentry,beeftornado/sentry,fotinakis/sentry,BuildingLink/sentry,ifduyue/sentry,alexm92/sentry,BuildingLink/s...
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label() fo...
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label() fo...
<commit_before>from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label()...
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label() fo...
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label() fo...
<commit_before>from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import GroupTagKey, TagKey @register(GroupTagKey) class GroupTagKeySerializer(Serializer): def get_attrs(self, item_list, user): tag_labels = { t.key: t.get_label()...
5af92f3905f2d0101eeb42ae7cc51bff528ea6ea
syngeo/io.py
syngeo/io.py
# stardard library import sys, os # external libraries import numpy as np from ray import imio, evaluate def add_anything(a, b): return a + b def write_synapse_to_vtk(neurons, coords, fn, im=None, t=(2,0,1), s=(1,-1,1), margin=None): """Output neuron shapes around pre- and post-synapse coordinates. ...
Write bodies given by coordinates to a VTK file
Write bodies given by coordinates to a VTK file
Python
bsd-3-clause
jni/synapse-geometry,janelia-flyem/synapse-geometry
Write bodies given by coordinates to a VTK file
# stardard library import sys, os # external libraries import numpy as np from ray import imio, evaluate def add_anything(a, b): return a + b def write_synapse_to_vtk(neurons, coords, fn, im=None, t=(2,0,1), s=(1,-1,1), margin=None): """Output neuron shapes around pre- and post-synapse coordinates. ...
<commit_before><commit_msg>Write bodies given by coordinates to a VTK file<commit_after>
# stardard library import sys, os # external libraries import numpy as np from ray import imio, evaluate def add_anything(a, b): return a + b def write_synapse_to_vtk(neurons, coords, fn, im=None, t=(2,0,1), s=(1,-1,1), margin=None): """Output neuron shapes around pre- and post-synapse coordinates. ...
Write bodies given by coordinates to a VTK file# stardard library import sys, os # external libraries import numpy as np from ray import imio, evaluate def add_anything(a, b): return a + b def write_synapse_to_vtk(neurons, coords, fn, im=None, t=(2,0,1), s=(1,-1,1), margin=None): """Output neuron sha...
<commit_before><commit_msg>Write bodies given by coordinates to a VTK file<commit_after># stardard library import sys, os # external libraries import numpy as np from ray import imio, evaluate def add_anything(a, b): return a + b def write_synapse_to_vtk(neurons, coords, fn, im=None, t=(2,0,1), s=(1,-1,1), ...
62e17c30ba45458254c0da5b14582aeeac9eab4c
signbank/video/management/commands/makejpeg.py
signbank/video/management/commands/makejpeg.py
"""Convert a video file to flv""" from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.conf import settings from signbank.video.models import GlossVideo import os class Command(BaseCommand): help = 'Create JPEG images for all...
Add command to pre-generate all jpeg images
Add command to pre-generate all jpeg images
Python
bsd-3-clause
Signbank/BSL-signbank,Signbank/BSL-signbank,Signbank/Auslan-signbank,Signbank/Auslan-signbank,Signbank/Auslan-signbank,Signbank/BSL-signbank,Signbank/Auslan-signbank,Signbank/BSL-signbank
Add command to pre-generate all jpeg images
"""Convert a video file to flv""" from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.conf import settings from signbank.video.models import GlossVideo import os class Command(BaseCommand): help = 'Create JPEG images for all...
<commit_before><commit_msg>Add command to pre-generate all jpeg images<commit_after>
"""Convert a video file to flv""" from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.conf import settings from signbank.video.models import GlossVideo import os class Command(BaseCommand): help = 'Create JPEG images for all...
Add command to pre-generate all jpeg images"""Convert a video file to flv""" from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.conf import settings from signbank.video.models import GlossVideo import os class Command(BaseCommand): ...
<commit_before><commit_msg>Add command to pre-generate all jpeg images<commit_after>"""Convert a video file to flv""" from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.conf import settings from signbank.video.models import GlossVideo...
3004dec0e0deadc4df61bafb233cd6b277c9bfef
util/create_mongodb_index.py
util/create_mongodb_index.py
#!/usr/env python3.4 import sys from pymongo import ASCENDING from util.mongodb import connect_to_db from argparse import (ArgumentParser, ArgumentDefaultsHelpFormatter) def main(argv=None): parser = ArgumentParser(description='Run incremental learning ' ...
Add in small utility that creates an index on the MongoDB collection, specifically on the Steam ID number key
Add in small utility that creates an index on the MongoDB collection, specifically on the Steam ID number key
Python
mit
mulhod/reviewer_experience_prediction,mulhod/reviewer_experience_prediction
Add in small utility that creates an index on the MongoDB collection, specifically on the Steam ID number key
#!/usr/env python3.4 import sys from pymongo import ASCENDING from util.mongodb import connect_to_db from argparse import (ArgumentParser, ArgumentDefaultsHelpFormatter) def main(argv=None): parser = ArgumentParser(description='Run incremental learning ' ...
<commit_before><commit_msg>Add in small utility that creates an index on the MongoDB collection, specifically on the Steam ID number key<commit_after>
#!/usr/env python3.4 import sys from pymongo import ASCENDING from util.mongodb import connect_to_db from argparse import (ArgumentParser, ArgumentDefaultsHelpFormatter) def main(argv=None): parser = ArgumentParser(description='Run incremental learning ' ...
Add in small utility that creates an index on the MongoDB collection, specifically on the Steam ID number key#!/usr/env python3.4 import sys from pymongo import ASCENDING from util.mongodb import connect_to_db from argparse import (ArgumentParser, ArgumentDefaultsHelpFormatter) def main(argv=None...
<commit_before><commit_msg>Add in small utility that creates an index on the MongoDB collection, specifically on the Steam ID number key<commit_after>#!/usr/env python3.4 import sys from pymongo import ASCENDING from util.mongodb import connect_to_db from argparse import (ArgumentParser, ArgumentD...
f342a3bb330eab74f31f632c81792f93a6e086e8
create_distributions.py
create_distributions.py
"""Script to automate the creation of Windows and Linux source distributions. The TOPKAPI_example directory is also copied and the .svn directories stripped to make a clean distribution. The manual is included in MSWord format for now because this is how it's stored in SVN. This script currently relies on Linux tools...
Add a script to automate the generation of source distributions for Windows and Linux.
Add a script to automate the generation of source distributions for Windows and Linux.
Python
bsd-3-clause
scottza/PyTOPKAPI,sahg/PyTOPKAPI
Add a script to automate the generation of source distributions for Windows and Linux.
"""Script to automate the creation of Windows and Linux source distributions. The TOPKAPI_example directory is also copied and the .svn directories stripped to make a clean distribution. The manual is included in MSWord format for now because this is how it's stored in SVN. This script currently relies on Linux tools...
<commit_before><commit_msg>Add a script to automate the generation of source distributions for Windows and Linux.<commit_after>
"""Script to automate the creation of Windows and Linux source distributions. The TOPKAPI_example directory is also copied and the .svn directories stripped to make a clean distribution. The manual is included in MSWord format for now because this is how it's stored in SVN. This script currently relies on Linux tools...
Add a script to automate the generation of source distributions for Windows and Linux."""Script to automate the creation of Windows and Linux source distributions. The TOPKAPI_example directory is also copied and the .svn directories stripped to make a clean distribution. The manual is included in MSWord format for no...
<commit_before><commit_msg>Add a script to automate the generation of source distributions for Windows and Linux.<commit_after>"""Script to automate the creation of Windows and Linux source distributions. The TOPKAPI_example directory is also copied and the .svn directories stripped to make a clean distribution. The m...
6ea2d5af752e4765be8ef433139f72538fa3a2dd
tests/test_semsim_wang_termwise.py
tests/test_semsim_wang_termwise.py
#!/usr/bin/env python3 """Test S-value for Table 1 in Wang_2007""" __copyright__ = "Copyright (C) 2020-present, DV Klopfenstein. All rights reserved." __author__ = "DV Klopfenstein" from os.path import join from sys import stdout from goatools.base import get_godag from goatools.semsim.termwise.wang import SsWang fr...
Check that relationships in SsWang are up-to-date
Check that relationships in SsWang are up-to-date
Python
bsd-2-clause
tanghaibao/goatools,tanghaibao/goatools
Check that relationships in SsWang are up-to-date
#!/usr/bin/env python3 """Test S-value for Table 1 in Wang_2007""" __copyright__ = "Copyright (C) 2020-present, DV Klopfenstein. All rights reserved." __author__ = "DV Klopfenstein" from os.path import join from sys import stdout from goatools.base import get_godag from goatools.semsim.termwise.wang import SsWang fr...
<commit_before><commit_msg>Check that relationships in SsWang are up-to-date<commit_after>
#!/usr/bin/env python3 """Test S-value for Table 1 in Wang_2007""" __copyright__ = "Copyright (C) 2020-present, DV Klopfenstein. All rights reserved." __author__ = "DV Klopfenstein" from os.path import join from sys import stdout from goatools.base import get_godag from goatools.semsim.termwise.wang import SsWang fr...
Check that relationships in SsWang are up-to-date#!/usr/bin/env python3 """Test S-value for Table 1 in Wang_2007""" __copyright__ = "Copyright (C) 2020-present, DV Klopfenstein. All rights reserved." __author__ = "DV Klopfenstein" from os.path import join from sys import stdout from goatools.base import get_godag fr...
<commit_before><commit_msg>Check that relationships in SsWang are up-to-date<commit_after>#!/usr/bin/env python3 """Test S-value for Table 1 in Wang_2007""" __copyright__ = "Copyright (C) 2020-present, DV Klopfenstein. All rights reserved." __author__ = "DV Klopfenstein" from os.path import join from sys import stdou...
07fd61306e645b7240883d5d468f94be5ce8a34c
Commands/Triggers.py
Commands/Triggers.py
from IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface import GlobalVars class Command(CommandInterface): triggers = ["triggers"] help = "triggers -- returns a list of all command triggers, must be over PM" def execute(self, Hubbot, message): if message.Use...
Add a command to retrieve all triggers
Add a command to retrieve all triggers
Python
mit
HubbeKing/Hubbot_Twisted
Add a command to retrieve all triggers
from IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface import GlobalVars class Command(CommandInterface): triggers = ["triggers"] help = "triggers -- returns a list of all command triggers, must be over PM" def execute(self, Hubbot, message): if message.Use...
<commit_before><commit_msg>Add a command to retrieve all triggers<commit_after>
from IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface import GlobalVars class Command(CommandInterface): triggers = ["triggers"] help = "triggers -- returns a list of all command triggers, must be over PM" def execute(self, Hubbot, message): if message.Use...
Add a command to retrieve all triggersfrom IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface import GlobalVars class Command(CommandInterface): triggers = ["triggers"] help = "triggers -- returns a list of all command triggers, must be over PM" def execute(self, Hu...
<commit_before><commit_msg>Add a command to retrieve all triggers<commit_after>from IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface import GlobalVars class Command(CommandInterface): triggers = ["triggers"] help = "triggers -- returns a list of all command triggers, m...
b663bf77fe60a108598db4ae8310e8877d06cddd
tests/core_test.py
tests/core_test.py
"""Test CLI module""" import os import sys import tempfile import unittest from mock import mock_open, patch from context import dfman from dfman import config, const, core class TestMainRuntime(unittest.TestCase): @patch('dfman.core.Config') @patch.object(dfman.core.MainRuntime, 'set_output_streams') ...
Add unit tests for core module
Add unit tests for core module
Python
mit
jniedrauer/dfman
Add unit tests for core module
"""Test CLI module""" import os import sys import tempfile import unittest from mock import mock_open, patch from context import dfman from dfman import config, const, core class TestMainRuntime(unittest.TestCase): @patch('dfman.core.Config') @patch.object(dfman.core.MainRuntime, 'set_output_streams') ...
<commit_before><commit_msg>Add unit tests for core module<commit_after>
"""Test CLI module""" import os import sys import tempfile import unittest from mock import mock_open, patch from context import dfman from dfman import config, const, core class TestMainRuntime(unittest.TestCase): @patch('dfman.core.Config') @patch.object(dfman.core.MainRuntime, 'set_output_streams') ...
Add unit tests for core module"""Test CLI module""" import os import sys import tempfile import unittest from mock import mock_open, patch from context import dfman from dfman import config, const, core class TestMainRuntime(unittest.TestCase): @patch('dfman.core.Config') @patch.object(dfman.core.MainRunti...
<commit_before><commit_msg>Add unit tests for core module<commit_after>"""Test CLI module""" import os import sys import tempfile import unittest from mock import mock_open, patch from context import dfman from dfman import config, const, core class TestMainRuntime(unittest.TestCase): @patch('dfman.core.Config...
be59230531d98dc25f806b2290a51a0f4fde1d3b
addons/survey/migrations/8.0.2.0/pre-migration.py
addons/survey/migrations/8.0.2.0/pre-migration.py
# coding: utf-8 from openupgradelib import openupgrade @openupgrade.migrate() def migrate(cr, version): openupgrade.rename_tables(cr, [('survey', 'survey_survey')]) openupgrade.rename_models(cr, [('survey', 'survey.survey')])
Rename model to prevent crash during module upgrade in tests
[ADD] Rename model to prevent crash during module upgrade in tests
Python
agpl-3.0
grap/OpenUpgrade,OpenUpgrade/OpenUpgrade,Endika/OpenUpgrade,Endika/OpenUpgrade,grap/OpenUpgrade,OpenUpgrade/OpenUpgrade,OpenUpgrade/OpenUpgrade,Endika/OpenUpgrade,grap/OpenUpgrade,grap/OpenUpgrade,Endika/OpenUpgrade,grap/OpenUpgrade,OpenUpgrade/OpenUpgrade,grap/OpenUpgrade,OpenUpgrade/OpenUpgrade,Endika/OpenUpgrade,End...
[ADD] Rename model to prevent crash during module upgrade in tests
# coding: utf-8 from openupgradelib import openupgrade @openupgrade.migrate() def migrate(cr, version): openupgrade.rename_tables(cr, [('survey', 'survey_survey')]) openupgrade.rename_models(cr, [('survey', 'survey.survey')])
<commit_before><commit_msg>[ADD] Rename model to prevent crash during module upgrade in tests<commit_after>
# coding: utf-8 from openupgradelib import openupgrade @openupgrade.migrate() def migrate(cr, version): openupgrade.rename_tables(cr, [('survey', 'survey_survey')]) openupgrade.rename_models(cr, [('survey', 'survey.survey')])
[ADD] Rename model to prevent crash during module upgrade in tests# coding: utf-8 from openupgradelib import openupgrade @openupgrade.migrate() def migrate(cr, version): openupgrade.rename_tables(cr, [('survey', 'survey_survey')]) openupgrade.rename_models(cr, [('survey', 'survey.survey')])
<commit_before><commit_msg>[ADD] Rename model to prevent crash during module upgrade in tests<commit_after># coding: utf-8 from openupgradelib import openupgrade @openupgrade.migrate() def migrate(cr, version): openupgrade.rename_tables(cr, [('survey', 'survey_survey')]) openupgrade.rename_models(cr, [('surve...
ecac8bc83491c9cb2312cf2a1c477c53c4832b4d
pykit/transform/dce.py
pykit/transform/dce.py
# -*- coding: utf-8 -*- """ Dead code elimination. """ from pykit.analysis import loop_detection effect_free = set([ 'alloca', 'load', 'new_list', 'new_tuple', 'new_dict', 'new_set', 'new_struct', 'new_data', 'new_exc', 'phi', 'exc_setup', 'exc_catch', 'ptrload', 'ptrcast', 'ptr_isnull', 'getfield', 'get...
Add minimal dead code elimination
Add minimal dead code elimination
Python
bsd-3-clause
Inaimathi/pykit,Inaimathi/pykit,flypy/pykit,ContinuumIO/pykit,ContinuumIO/pykit,flypy/pykit
Add minimal dead code elimination
# -*- coding: utf-8 -*- """ Dead code elimination. """ from pykit.analysis import loop_detection effect_free = set([ 'alloca', 'load', 'new_list', 'new_tuple', 'new_dict', 'new_set', 'new_struct', 'new_data', 'new_exc', 'phi', 'exc_setup', 'exc_catch', 'ptrload', 'ptrcast', 'ptr_isnull', 'getfield', 'get...
<commit_before><commit_msg>Add minimal dead code elimination<commit_after>
# -*- coding: utf-8 -*- """ Dead code elimination. """ from pykit.analysis import loop_detection effect_free = set([ 'alloca', 'load', 'new_list', 'new_tuple', 'new_dict', 'new_set', 'new_struct', 'new_data', 'new_exc', 'phi', 'exc_setup', 'exc_catch', 'ptrload', 'ptrcast', 'ptr_isnull', 'getfield', 'get...
Add minimal dead code elimination# -*- coding: utf-8 -*- """ Dead code elimination. """ from pykit.analysis import loop_detection effect_free = set([ 'alloca', 'load', 'new_list', 'new_tuple', 'new_dict', 'new_set', 'new_struct', 'new_data', 'new_exc', 'phi', 'exc_setup', 'exc_catch', 'ptrload', 'ptrcast...
<commit_before><commit_msg>Add minimal dead code elimination<commit_after># -*- coding: utf-8 -*- """ Dead code elimination. """ from pykit.analysis import loop_detection effect_free = set([ 'alloca', 'load', 'new_list', 'new_tuple', 'new_dict', 'new_set', 'new_struct', 'new_data', 'new_exc', 'phi', 'exc_set...
2fa7855de542bb5ecd303e26d1e9913687478589
server/tests/test_admin.py
server/tests/test_admin.py
"""General functional tests for the API endpoints.""" from django.test import TestCase, Client # from django.urls import reverse from rest_framework import status from server.models import ApiKey, User # from api.v2.tests.tools import SalAPITestCase class AdminTest(TestCase): """Test the admin site is configu...
Set up test suite to ensure server admin routes are added.
Set up test suite to ensure server admin routes are added.
Python
apache-2.0
sheagcraig/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,salopensource/sal
Set up test suite to ensure server admin routes are added.
"""General functional tests for the API endpoints.""" from django.test import TestCase, Client # from django.urls import reverse from rest_framework import status from server.models import ApiKey, User # from api.v2.tests.tools import SalAPITestCase class AdminTest(TestCase): """Test the admin site is configu...
<commit_before><commit_msg>Set up test suite to ensure server admin routes are added.<commit_after>
"""General functional tests for the API endpoints.""" from django.test import TestCase, Client # from django.urls import reverse from rest_framework import status from server.models import ApiKey, User # from api.v2.tests.tools import SalAPITestCase class AdminTest(TestCase): """Test the admin site is configu...
Set up test suite to ensure server admin routes are added."""General functional tests for the API endpoints.""" from django.test import TestCase, Client # from django.urls import reverse from rest_framework import status from server.models import ApiKey, User # from api.v2.tests.tools import SalAPITestCase class ...
<commit_before><commit_msg>Set up test suite to ensure server admin routes are added.<commit_after>"""General functional tests for the API endpoints.""" from django.test import TestCase, Client # from django.urls import reverse from rest_framework import status from server.models import ApiKey, User # from api.v2.t...
c5bbbe4f6430ef20da55ea0f8039091d4f79c491
sql/branch.py
sql/branch.py
import sys from gratipay import wireup from gratipay.models.participant import Participant db = wireup.db(wireup.env()) teams = db.all(""" SELECT t.*::teams FROM teams t """) for team in teams: print("Updating team %s" % team.slug) Participant.from_username(team.owner).update_taking() print("Done...
Add script to update taking for all team owners
Add script to update taking for all team owners
Python
mit
gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com
Add script to update taking for all team owners
import sys from gratipay import wireup from gratipay.models.participant import Participant db = wireup.db(wireup.env()) teams = db.all(""" SELECT t.*::teams FROM teams t """) for team in teams: print("Updating team %s" % team.slug) Participant.from_username(team.owner).update_taking() print("Done...
<commit_before><commit_msg>Add script to update taking for all team owners<commit_after>
import sys from gratipay import wireup from gratipay.models.participant import Participant db = wireup.db(wireup.env()) teams = db.all(""" SELECT t.*::teams FROM teams t """) for team in teams: print("Updating team %s" % team.slug) Participant.from_username(team.owner).update_taking() print("Done...
Add script to update taking for all team ownersimport sys from gratipay import wireup from gratipay.models.participant import Participant db = wireup.db(wireup.env()) teams = db.all(""" SELECT t.*::teams FROM teams t """) for team in teams: print("Updating team %s" % team.slug) Participant.from_us...
<commit_before><commit_msg>Add script to update taking for all team owners<commit_after>import sys from gratipay import wireup from gratipay.models.participant import Participant db = wireup.db(wireup.env()) teams = db.all(""" SELECT t.*::teams FROM teams t """) for team in teams: print("Updating team...
36d0fc3c54dc0c91196c16875c1b1e2d9b0d38ea
example/tests/unit/test_pagination.py
example/tests/unit/test_pagination.py
from collections import OrderedDict from rest_framework.request import Request from rest_framework.test import APIRequestFactory from rest_framework.utils.urls import replace_query_param from rest_framework_json_api.pagination import LimitOffsetPagination factory = APIRequestFactory() class TestLimitOffset: "...
Add basic unit test for LimitOffsetPagination
Add basic unit test for LimitOffsetPagination
Python
bsd-2-clause
martinmaillard/django-rest-framework-json-api,abdulhaq-e/django-rest-framework-json-api,django-json-api/django-rest-framework-json-api,pombredanne/django-rest-framework-json-api,scottfisk/django-rest-framework-json-api,django-json-api/rest_framework_ember,django-json-api/django-rest-framework-json-api,leo-naeka/rest_fr...
Add basic unit test for LimitOffsetPagination
from collections import OrderedDict from rest_framework.request import Request from rest_framework.test import APIRequestFactory from rest_framework.utils.urls import replace_query_param from rest_framework_json_api.pagination import LimitOffsetPagination factory = APIRequestFactory() class TestLimitOffset: "...
<commit_before><commit_msg>Add basic unit test for LimitOffsetPagination<commit_after>
from collections import OrderedDict from rest_framework.request import Request from rest_framework.test import APIRequestFactory from rest_framework.utils.urls import replace_query_param from rest_framework_json_api.pagination import LimitOffsetPagination factory = APIRequestFactory() class TestLimitOffset: "...
Add basic unit test for LimitOffsetPaginationfrom collections import OrderedDict from rest_framework.request import Request from rest_framework.test import APIRequestFactory from rest_framework.utils.urls import replace_query_param from rest_framework_json_api.pagination import LimitOffsetPagination factory = APIRe...
<commit_before><commit_msg>Add basic unit test for LimitOffsetPagination<commit_after>from collections import OrderedDict from rest_framework.request import Request from rest_framework.test import APIRequestFactory from rest_framework.utils.urls import replace_query_param from rest_framework_json_api.pagination impor...
335881f4644a6bb2b5f2abb5b193f39d304dbc71
pages_scrape.py
pages_scrape.py
import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An instance of Goose th...
import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An instance of Goose th...
Fix user agent for the bnn_ sites
Fix user agent for the bnn_ sites
Python
mit
chilland/scraper,openeventdata/scraper
import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An instance of Goose th...
import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An instance of Goose th...
<commit_before>import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An insta...
import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An instance of Goose th...
import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An instance of Goose th...
<commit_before>import logging import requests def scrape(url, extractor): """ Function to request and parse a given URL. Returns only the "relevant" text. Parameters ---------- url : String. URL to request and parse. extractor : Goose class instance. An insta...
c36e390910b62e1ad27066a0be0450c81a6f87c6
d1_common_python/src/d1_common/logging_context.py
d1_common_python/src/d1_common/logging_context.py
# -*- coding: utf-8 -*- """Context manager that enables temporary changes in logging level. Note: Not created by DataONE. Source: https://docs.python.org/2/howto/logging-cookbook.html """ import logging import sys class LoggingContext(object): def __init__(self, logger, level=None, handler=None, close=True): s...
Add context manager for logging
Add context manager for logging Allows temporarily changing logging levels in order to suppress expected messages from 3rd party dependencies.
Python
apache-2.0
DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python
Add context manager for logging Allows temporarily changing logging levels in order to suppress expected messages from 3rd party dependencies.
# -*- coding: utf-8 -*- """Context manager that enables temporary changes in logging level. Note: Not created by DataONE. Source: https://docs.python.org/2/howto/logging-cookbook.html """ import logging import sys class LoggingContext(object): def __init__(self, logger, level=None, handler=None, close=True): s...
<commit_before><commit_msg>Add context manager for logging Allows temporarily changing logging levels in order to suppress expected messages from 3rd party dependencies.<commit_after>
# -*- coding: utf-8 -*- """Context manager that enables temporary changes in logging level. Note: Not created by DataONE. Source: https://docs.python.org/2/howto/logging-cookbook.html """ import logging import sys class LoggingContext(object): def __init__(self, logger, level=None, handler=None, close=True): s...
Add context manager for logging Allows temporarily changing logging levels in order to suppress expected messages from 3rd party dependencies.# -*- coding: utf-8 -*- """Context manager that enables temporary changes in logging level. Note: Not created by DataONE. Source: https://docs.python.org/2/howto/logging-cookbo...
<commit_before><commit_msg>Add context manager for logging Allows temporarily changing logging levels in order to suppress expected messages from 3rd party dependencies.<commit_after># -*- coding: utf-8 -*- """Context manager that enables temporary changes in logging level. Note: Not created by DataONE. Source: https...
4c33fe7a927cde83aa53374e9fcaedfa18e51e77
utilities.py
utilities.py
def delete_collection(ee, id): if 'users' not in id: root_path_in_gee = ee.data.getAssetRoots()[0]['id'] id = root_path_in_gee + '/' + id params = {'id': id} items_in_collection = ee.data.getList(params) for item in items_in_collection: ee.data.deleteAsset(item['id']) ee.data...
Add function to delete collection
Add function to delete collection
Python
apache-2.0
tracek/gee_asset_manager
Add function to delete collection
def delete_collection(ee, id): if 'users' not in id: root_path_in_gee = ee.data.getAssetRoots()[0]['id'] id = root_path_in_gee + '/' + id params = {'id': id} items_in_collection = ee.data.getList(params) for item in items_in_collection: ee.data.deleteAsset(item['id']) ee.data...
<commit_before><commit_msg>Add function to delete collection<commit_after>
def delete_collection(ee, id): if 'users' not in id: root_path_in_gee = ee.data.getAssetRoots()[0]['id'] id = root_path_in_gee + '/' + id params = {'id': id} items_in_collection = ee.data.getList(params) for item in items_in_collection: ee.data.deleteAsset(item['id']) ee.data...
Add function to delete collectiondef delete_collection(ee, id): if 'users' not in id: root_path_in_gee = ee.data.getAssetRoots()[0]['id'] id = root_path_in_gee + '/' + id params = {'id': id} items_in_collection = ee.data.getList(params) for item in items_in_collection: ee.data.de...
<commit_before><commit_msg>Add function to delete collection<commit_after>def delete_collection(ee, id): if 'users' not in id: root_path_in_gee = ee.data.getAssetRoots()[0]['id'] id = root_path_in_gee + '/' + id params = {'id': id} items_in_collection = ee.data.getList(params) for item i...
5f9c7d10957c7b0b0da46b031120fe2434315d0d
ndtable/persistence/simple.py
ndtable/persistence/simple.py
from ndtable.carray import carray, cparams from bloscpack import pack_list, unpack_file from numpy import array, frombuffer def test_simple(): filename = 'output' # hackish, just experimenting! arr = carray(xrange(10000)).chunks ca = [bytes(chunk.viewof) for chunk in arr] pack_list(ca, {}, filenam...
Test of new persistence layer.
Test of new persistence layer.
Python
bsd-2-clause
seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core
Test of new persistence layer.
from ndtable.carray import carray, cparams from bloscpack import pack_list, unpack_file from numpy import array, frombuffer def test_simple(): filename = 'output' # hackish, just experimenting! arr = carray(xrange(10000)).chunks ca = [bytes(chunk.viewof) for chunk in arr] pack_list(ca, {}, filenam...
<commit_before><commit_msg>Test of new persistence layer.<commit_after>
from ndtable.carray import carray, cparams from bloscpack import pack_list, unpack_file from numpy import array, frombuffer def test_simple(): filename = 'output' # hackish, just experimenting! arr = carray(xrange(10000)).chunks ca = [bytes(chunk.viewof) for chunk in arr] pack_list(ca, {}, filenam...
Test of new persistence layer.from ndtable.carray import carray, cparams from bloscpack import pack_list, unpack_file from numpy import array, frombuffer def test_simple(): filename = 'output' # hackish, just experimenting! arr = carray(xrange(10000)).chunks ca = [bytes(chunk.viewof) for chunk in arr]...
<commit_before><commit_msg>Test of new persistence layer.<commit_after>from ndtable.carray import carray, cparams from bloscpack import pack_list, unpack_file from numpy import array, frombuffer def test_simple(): filename = 'output' # hackish, just experimenting! arr = carray(xrange(10000)).chunks ca...
9c0bcd4e0317aa8b76ebbf3c9ecae82d1b90027d
night_sensor/night_feature.py
night_sensor/night_feature.py
""" @author: Sze "Ron" Chau @e-mail: chaus3@wit.edu @source: https://github.com/wodiesan/sweet-skoomabot @desc Night sensor-->RPi for Senior Design 1 """ import logging import os import RPi.GPIO as GPIO import serial import subprocess import sys import time import traceback # GPIO pins. Uses the BC...
Create initial night sensor code for Pi
Create initial night sensor code for Pi
Python
mit
wodiesan/senior_design_spring
Create initial night sensor code for Pi
""" @author: Sze "Ron" Chau @e-mail: chaus3@wit.edu @source: https://github.com/wodiesan/sweet-skoomabot @desc Night sensor-->RPi for Senior Design 1 """ import logging import os import RPi.GPIO as GPIO import serial import subprocess import sys import time import traceback # GPIO pins. Uses the BC...
<commit_before><commit_msg>Create initial night sensor code for Pi<commit_after>
""" @author: Sze "Ron" Chau @e-mail: chaus3@wit.edu @source: https://github.com/wodiesan/sweet-skoomabot @desc Night sensor-->RPi for Senior Design 1 """ import logging import os import RPi.GPIO as GPIO import serial import subprocess import sys import time import traceback # GPIO pins. Uses the BC...
Create initial night sensor code for Pi""" @author: Sze "Ron" Chau @e-mail: chaus3@wit.edu @source: https://github.com/wodiesan/sweet-skoomabot @desc Night sensor-->RPi for Senior Design 1 """ import logging import os import RPi.GPIO as GPIO import serial import subprocess import sys import time imp...
<commit_before><commit_msg>Create initial night sensor code for Pi<commit_after>""" @author: Sze "Ron" Chau @e-mail: chaus3@wit.edu @source: https://github.com/wodiesan/sweet-skoomabot @desc Night sensor-->RPi for Senior Design 1 """ import logging import os import RPi.GPIO as GPIO import serial imp...
e51f3869b4a047489b9bb1e4b88af0e0bdc3078b
paper_to_git/commands/list_command.py
paper_to_git/commands/list_command.py
""" List the Documents and Folders """ from paper_to_git.commands.base import BaseCommand from paper_to_git.models import PaperDoc, PaperFolder __all__ = [ 'ListCommand', ] class ListCommand(BaseCommand): """List the PaperDocs and Folders """ name = 'list' def add(self, parser, command_par...
Add a command to list all the documents.
Add a command to list all the documents.
Python
apache-2.0
maxking/paper-to-git,maxking/paper-to-git
Add a command to list all the documents.
""" List the Documents and Folders """ from paper_to_git.commands.base import BaseCommand from paper_to_git.models import PaperDoc, PaperFolder __all__ = [ 'ListCommand', ] class ListCommand(BaseCommand): """List the PaperDocs and Folders """ name = 'list' def add(self, parser, command_par...
<commit_before><commit_msg>Add a command to list all the documents.<commit_after>
""" List the Documents and Folders """ from paper_to_git.commands.base import BaseCommand from paper_to_git.models import PaperDoc, PaperFolder __all__ = [ 'ListCommand', ] class ListCommand(BaseCommand): """List the PaperDocs and Folders """ name = 'list' def add(self, parser, command_par...
Add a command to list all the documents.""" List the Documents and Folders """ from paper_to_git.commands.base import BaseCommand from paper_to_git.models import PaperDoc, PaperFolder __all__ = [ 'ListCommand', ] class ListCommand(BaseCommand): """List the PaperDocs and Folders """ name = 'list...
<commit_before><commit_msg>Add a command to list all the documents.<commit_after>""" List the Documents and Folders """ from paper_to_git.commands.base import BaseCommand from paper_to_git.models import PaperDoc, PaperFolder __all__ = [ 'ListCommand', ] class ListCommand(BaseCommand): """List the PaperD...
1298cf9c7a40ce73d46067035ded2318c62f7380
tests/drs_test.py
tests/drs_test.py
"""Tests for drudge scripts.""" from sympy import Symbol, IndexedBase from drudge.drs import DrsSymbol from drudge.utils import sympy_key # # Unit tests for the utility classes and functions # ------------------------------------------------ # def test_basic_drs_symb(): """Test the symbol class for basic oper...
Add simple tests for DrsSymbol and DrsIndexed
Add simple tests for DrsSymbol and DrsIndexed Basically it is tested that the class for drudge scripts are basically indistinguishable from the original SymPy classes.
Python
mit
tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge
Add simple tests for DrsSymbol and DrsIndexed Basically it is tested that the class for drudge scripts are basically indistinguishable from the original SymPy classes.
"""Tests for drudge scripts.""" from sympy import Symbol, IndexedBase from drudge.drs import DrsSymbol from drudge.utils import sympy_key # # Unit tests for the utility classes and functions # ------------------------------------------------ # def test_basic_drs_symb(): """Test the symbol class for basic oper...
<commit_before><commit_msg>Add simple tests for DrsSymbol and DrsIndexed Basically it is tested that the class for drudge scripts are basically indistinguishable from the original SymPy classes.<commit_after>
"""Tests for drudge scripts.""" from sympy import Symbol, IndexedBase from drudge.drs import DrsSymbol from drudge.utils import sympy_key # # Unit tests for the utility classes and functions # ------------------------------------------------ # def test_basic_drs_symb(): """Test the symbol class for basic oper...
Add simple tests for DrsSymbol and DrsIndexed Basically it is tested that the class for drudge scripts are basically indistinguishable from the original SymPy classes."""Tests for drudge scripts.""" from sympy import Symbol, IndexedBase from drudge.drs import DrsSymbol from drudge.utils import sympy_key # # Unit t...
<commit_before><commit_msg>Add simple tests for DrsSymbol and DrsIndexed Basically it is tested that the class for drudge scripts are basically indistinguishable from the original SymPy classes.<commit_after>"""Tests for drudge scripts.""" from sympy import Symbol, IndexedBase from drudge.drs import DrsSymbol from d...
188d583caea0e640f41e400839552fe593154eda
set2/crypto9.py
set2/crypto9.py
#!/usr/local/bin/python __author__ = 'Walshman23' import sys sys.path.insert(1, "../common") # Want to locate modules in our 'common' directory # A block cipher transforms a fixed-sized block (usually 8 or 16 bytes) of plaintext into ciphertext. # But we almost never want to transform a single block; we encrypt irr...
Set 2, challenge 9 completed.
Set 2, challenge 9 completed.
Python
bsd-3-clause
walshman23/Cryptopals
Set 2, challenge 9 completed.
#!/usr/local/bin/python __author__ = 'Walshman23' import sys sys.path.insert(1, "../common") # Want to locate modules in our 'common' directory # A block cipher transforms a fixed-sized block (usually 8 or 16 bytes) of plaintext into ciphertext. # But we almost never want to transform a single block; we encrypt irr...
<commit_before><commit_msg>Set 2, challenge 9 completed.<commit_after>
#!/usr/local/bin/python __author__ = 'Walshman23' import sys sys.path.insert(1, "../common") # Want to locate modules in our 'common' directory # A block cipher transforms a fixed-sized block (usually 8 or 16 bytes) of plaintext into ciphertext. # But we almost never want to transform a single block; we encrypt irr...
Set 2, challenge 9 completed.#!/usr/local/bin/python __author__ = 'Walshman23' import sys sys.path.insert(1, "../common") # Want to locate modules in our 'common' directory # A block cipher transforms a fixed-sized block (usually 8 or 16 bytes) of plaintext into ciphertext. # But we almost never want to transform a...
<commit_before><commit_msg>Set 2, challenge 9 completed.<commit_after>#!/usr/local/bin/python __author__ = 'Walshman23' import sys sys.path.insert(1, "../common") # Want to locate modules in our 'common' directory # A block cipher transforms a fixed-sized block (usually 8 or 16 bytes) of plaintext into ciphertext. ...
e88ba0984f3e6045b407342fa7231887142380e2
corehq/apps/accounting/migrations/0031_create_report_builder_roles.py
corehq/apps/accounting/migrations/0031_create_report_builder_roles.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from corehq.apps.hqadmin.management.commands.cchq_prbac_bootstrap import cchq_prbac_bootstrap from corehq.sql_db.operations import HqRunPython class Migration(migrations.Migration): dependencies = [ (...
Add migration to create roles
Add migration to create roles
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq
Add migration to create roles
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from corehq.apps.hqadmin.management.commands.cchq_prbac_bootstrap import cchq_prbac_bootstrap from corehq.sql_db.operations import HqRunPython class Migration(migrations.Migration): dependencies = [ (...
<commit_before><commit_msg>Add migration to create roles<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from corehq.apps.hqadmin.management.commands.cchq_prbac_bootstrap import cchq_prbac_bootstrap from corehq.sql_db.operations import HqRunPython class Migration(migrations.Migration): dependencies = [ (...
Add migration to create roles# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from corehq.apps.hqadmin.management.commands.cchq_prbac_bootstrap import cchq_prbac_bootstrap from corehq.sql_db.operations import HqRunPython class Migration(migrations.Migration): ...
<commit_before><commit_msg>Add migration to create roles<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from corehq.apps.hqadmin.management.commands.cchq_prbac_bootstrap import cchq_prbac_bootstrap from corehq.sql_db.operations import HqRunPython ...
c44001ec697faf7552764f91e52fa927056b1538
euler031.py
euler031.py
#!/usr/bin/python LIMIT = 200 coins = [1, 2, 5, 10, 20, 50, 100, 200] def rec_count(total, step): if total == LIMIT: return 1 if total > LIMIT: return 0 c = 0 for x in coins: if x < step: continue c += rec_count(total + x, x) return c count = 0 for x i...
Add solution for porblem 31
Add solution for porblem 31
Python
mit
cifvts/PyEuler
Add solution for porblem 31
#!/usr/bin/python LIMIT = 200 coins = [1, 2, 5, 10, 20, 50, 100, 200] def rec_count(total, step): if total == LIMIT: return 1 if total > LIMIT: return 0 c = 0 for x in coins: if x < step: continue c += rec_count(total + x, x) return c count = 0 for x i...
<commit_before><commit_msg>Add solution for porblem 31<commit_after>
#!/usr/bin/python LIMIT = 200 coins = [1, 2, 5, 10, 20, 50, 100, 200] def rec_count(total, step): if total == LIMIT: return 1 if total > LIMIT: return 0 c = 0 for x in coins: if x < step: continue c += rec_count(total + x, x) return c count = 0 for x i...
Add solution for porblem 31#!/usr/bin/python LIMIT = 200 coins = [1, 2, 5, 10, 20, 50, 100, 200] def rec_count(total, step): if total == LIMIT: return 1 if total > LIMIT: return 0 c = 0 for x in coins: if x < step: continue c += rec_count(total + x, x) ...
<commit_before><commit_msg>Add solution for porblem 31<commit_after>#!/usr/bin/python LIMIT = 200 coins = [1, 2, 5, 10, 20, 50, 100, 200] def rec_count(total, step): if total == LIMIT: return 1 if total > LIMIT: return 0 c = 0 for x in coins: if x < step: continue ...
1d3719bcd03b92d04efae10933928f953d95c7a4
src/python/BasicMap.py
src/python/BasicMap.py
""" >>> from pyspark.context import SparkContext >>> sc = SparkContext('local', 'test') >>> b = sc.parallelize([1, 2, 3, 4]) >>> sorted(basicSquare(b).collect()) [1, 4, 9, 12] """ import sys from pyspark import SparkContext def basicSquare(nums): """Square the numbers""" return nums.map(lambda x: x * x) if ...
Add a simple basicmap python example
Add a simple basicmap python example
Python
mit
SunGuo/learning-spark,asarraf/learning-spark,SunGuo/learning-spark,jaehyuk/learning-spark,asarraf/learning-spark,negokaz/learning-spark,kod3r/learning-spark,diogoaurelio/learning-spark,databricks/learning-spark,zaxliu/learning-spark,JerryTseng/learning-spark,anjuncc/learning-spark-examples,gaoxuesong/learning-spark,hui...
Add a simple basicmap python example
""" >>> from pyspark.context import SparkContext >>> sc = SparkContext('local', 'test') >>> b = sc.parallelize([1, 2, 3, 4]) >>> sorted(basicSquare(b).collect()) [1, 4, 9, 12] """ import sys from pyspark import SparkContext def basicSquare(nums): """Square the numbers""" return nums.map(lambda x: x * x) if ...
<commit_before><commit_msg>Add a simple basicmap python example<commit_after>
""" >>> from pyspark.context import SparkContext >>> sc = SparkContext('local', 'test') >>> b = sc.parallelize([1, 2, 3, 4]) >>> sorted(basicSquare(b).collect()) [1, 4, 9, 12] """ import sys from pyspark import SparkContext def basicSquare(nums): """Square the numbers""" return nums.map(lambda x: x * x) if ...
Add a simple basicmap python example""" >>> from pyspark.context import SparkContext >>> sc = SparkContext('local', 'test') >>> b = sc.parallelize([1, 2, 3, 4]) >>> sorted(basicSquare(b).collect()) [1, 4, 9, 12] """ import sys from pyspark import SparkContext def basicSquare(nums): """Square the numbers""" r...
<commit_before><commit_msg>Add a simple basicmap python example<commit_after>""" >>> from pyspark.context import SparkContext >>> sc = SparkContext('local', 'test') >>> b = sc.parallelize([1, 2, 3, 4]) >>> sorted(basicSquare(b).collect()) [1, 4, 9, 12] """ import sys from pyspark import SparkContext def basicSquare(...
7655e376696a04aa1c3596274861515953f592e8
openprescribing/frontend/price_per_unit/profile.py
openprescribing/frontend/price_per_unit/profile.py
""" Basic profiling code for working out where we're spending our time Invoke with: ./manage.py shell -c 'from frontend.price_per_unit.profile import profile; profile()' """ from cProfile import Profile import datetime import time from .savings import get_all_savings_for_orgs def test(): get_all_savings_for_org...
Add profiling script for savings code
Add profiling script for savings code This is useful for finding out where the code is spending its time and for testing possible performance improvements.
Python
mit
ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc
Add profiling script for savings code This is useful for finding out where the code is spending its time and for testing possible performance improvements.
""" Basic profiling code for working out where we're spending our time Invoke with: ./manage.py shell -c 'from frontend.price_per_unit.profile import profile; profile()' """ from cProfile import Profile import datetime import time from .savings import get_all_savings_for_orgs def test(): get_all_savings_for_org...
<commit_before><commit_msg>Add profiling script for savings code This is useful for finding out where the code is spending its time and for testing possible performance improvements.<commit_after>
""" Basic profiling code for working out where we're spending our time Invoke with: ./manage.py shell -c 'from frontend.price_per_unit.profile import profile; profile()' """ from cProfile import Profile import datetime import time from .savings import get_all_savings_for_orgs def test(): get_all_savings_for_org...
Add profiling script for savings code This is useful for finding out where the code is spending its time and for testing possible performance improvements.""" Basic profiling code for working out where we're spending our time Invoke with: ./manage.py shell -c 'from frontend.price_per_unit.profile import profile; prof...
<commit_before><commit_msg>Add profiling script for savings code This is useful for finding out where the code is spending its time and for testing possible performance improvements.<commit_after>""" Basic profiling code for working out where we're spending our time Invoke with: ./manage.py shell -c 'from frontend.pr...
2766e8797515497e5569b31696416db68641c9b4
base/models.py
base/models.py
import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return def delete(se...
import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return def delete(se...
Extend MediaRemovalMixin to move media files on updates
base: Extend MediaRemovalMixin to move media files on updates
Python
mit
matus-stehlik/roots,rtrembecky/roots,matus-stehlik/glowing-batman,tbabej/roots,rtrembecky/roots,rtrembecky/roots,matus-stehlik/roots,matus-stehlik/roots,tbabej/roots,matus-stehlik/glowing-batman,tbabej/roots
import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return def delete(se...
import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return def delete(se...
<commit_before>import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return ...
import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return def delete(se...
import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return def delete(se...
<commit_before>import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return ...
24c642063ffcb3313545b2e1ba3abbb62aa98437
nbs/utils/validators.py
nbs/utils/validators.py
# -*- coding: utf-8-*- def validate_cuit(cuit): "from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart" # validaciones minimas if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-": return False base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2] cuit = cuit.replace("-", "") ...
Add cuit validator to utils module
Add cuit validator to utils module
Python
mit
coyotevz/nobix-app
Add cuit validator to utils module
# -*- coding: utf-8-*- def validate_cuit(cuit): "from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart" # validaciones minimas if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-": return False base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2] cuit = cuit.replace("-", "") ...
<commit_before><commit_msg>Add cuit validator to utils module<commit_after>
# -*- coding: utf-8-*- def validate_cuit(cuit): "from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart" # validaciones minimas if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-": return False base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2] cuit = cuit.replace("-", "") ...
Add cuit validator to utils module# -*- coding: utf-8-*- def validate_cuit(cuit): "from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart" # validaciones minimas if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-": return False base = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2] ...
<commit_before><commit_msg>Add cuit validator to utils module<commit_after># -*- coding: utf-8-*- def validate_cuit(cuit): "from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart" # validaciones minimas if len(cuit) != 13 or cuit[2] != "-" or cuit [11] != "-": return False ...
5ba36ca805b002af63c619e17dd00400650da14b
agent_paths.py
agent_paths.py
#!/usr/bin/env python3 from argparse import ArgumentParser import json import os.path import re import sys from generate_simplestreams import json_dump def main(): parser = ArgumentParser() parser.add_argument('input') parser.add_argument('output') args = parser.parse_args() paths_hashes = {} ...
Add script to rewrite the agents used by scc.
Add script to rewrite the agents used by scc.
Python
agpl-3.0
mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju
Add script to rewrite the agents used by scc.
#!/usr/bin/env python3 from argparse import ArgumentParser import json import os.path import re import sys from generate_simplestreams import json_dump def main(): parser = ArgumentParser() parser.add_argument('input') parser.add_argument('output') args = parser.parse_args() paths_hashes = {} ...
<commit_before><commit_msg>Add script to rewrite the agents used by scc.<commit_after>
#!/usr/bin/env python3 from argparse import ArgumentParser import json import os.path import re import sys from generate_simplestreams import json_dump def main(): parser = ArgumentParser() parser.add_argument('input') parser.add_argument('output') args = parser.parse_args() paths_hashes = {} ...
Add script to rewrite the agents used by scc.#!/usr/bin/env python3 from argparse import ArgumentParser import json import os.path import re import sys from generate_simplestreams import json_dump def main(): parser = ArgumentParser() parser.add_argument('input') parser.add_argument('output') args = ...
<commit_before><commit_msg>Add script to rewrite the agents used by scc.<commit_after>#!/usr/bin/env python3 from argparse import ArgumentParser import json import os.path import re import sys from generate_simplestreams import json_dump def main(): parser = ArgumentParser() parser.add_argument('input') ...
f82ef484f6440c2b5b10eb144af09b770fa413c9
.infrastructure/i18n/extract-server-msgs.py
.infrastructure/i18n/extract-server-msgs.py
import os # Keys indicating the fn symbols that pybabel should search for # when finding translations. keys = '-k format -k format_time -k format_date -k format_datetime' # Extraction os.system("pybabel extract -F babel.cfg {} -o messages.pot .".format(keys)) os.system("pybabel init -i messages.pot -d . -o './beavy-s...
Add python script for extracting server i18n msgs
Add python script for extracting server i18n msgs
Python
mpl-2.0
beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy
Add python script for extracting server i18n msgs
import os # Keys indicating the fn symbols that pybabel should search for # when finding translations. keys = '-k format -k format_time -k format_date -k format_datetime' # Extraction os.system("pybabel extract -F babel.cfg {} -o messages.pot .".format(keys)) os.system("pybabel init -i messages.pot -d . -o './beavy-s...
<commit_before><commit_msg>Add python script for extracting server i18n msgs<commit_after>
import os # Keys indicating the fn symbols that pybabel should search for # when finding translations. keys = '-k format -k format_time -k format_date -k format_datetime' # Extraction os.system("pybabel extract -F babel.cfg {} -o messages.pot .".format(keys)) os.system("pybabel init -i messages.pot -d . -o './beavy-s...
Add python script for extracting server i18n msgsimport os # Keys indicating the fn symbols that pybabel should search for # when finding translations. keys = '-k format -k format_time -k format_date -k format_datetime' # Extraction os.system("pybabel extract -F babel.cfg {} -o messages.pot .".format(keys)) os.system...
<commit_before><commit_msg>Add python script for extracting server i18n msgs<commit_after>import os # Keys indicating the fn symbols that pybabel should search for # when finding translations. keys = '-k format -k format_time -k format_date -k format_datetime' # Extraction os.system("pybabel extract -F babel.cfg {} -...
5046ff8ba17899893a9aa30687a1ec58a6e95af2
2014/qualification-round/square-detector.py
2014/qualification-round/square-detector.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys class QuizzesParser: def __init__(self, src): self.src = src with open(src) as f: self.raw = f.read().splitlines() self.amount = int(self.raw[0]) def quizpool(self): cur_line = 1 for i in range(self.a...
Add solution for Square Detector.
Add solution for Square Detector.
Python
mit
changyuheng/hacker-cup-solutions
Add solution for Square Detector.
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys class QuizzesParser: def __init__(self, src): self.src = src with open(src) as f: self.raw = f.read().splitlines() self.amount = int(self.raw[0]) def quizpool(self): cur_line = 1 for i in range(self.a...
<commit_before><commit_msg>Add solution for Square Detector.<commit_after>
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys class QuizzesParser: def __init__(self, src): self.src = src with open(src) as f: self.raw = f.read().splitlines() self.amount = int(self.raw[0]) def quizpool(self): cur_line = 1 for i in range(self.a...
Add solution for Square Detector.#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys class QuizzesParser: def __init__(self, src): self.src = src with open(src) as f: self.raw = f.read().splitlines() self.amount = int(self.raw[0]) def quizpool(self): cur_line ...
<commit_before><commit_msg>Add solution for Square Detector.<commit_after>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys class QuizzesParser: def __init__(self, src): self.src = src with open(src) as f: self.raw = f.read().splitlines() self.amount = int(self.raw[0]) ...
3df4cc086bf6c85eebc12094cc3ca459bd2bcd3d
project/members/tests/test_application.py
project/members/tests/test_application.py
# -*- coding: utf-8 -*- import pytest from members.tests.fixtures.memberlikes import MembershipApplicationFactory from members.tests.fixtures.types import MemberTypeFactory from members.models import Member @pytest.mark.django_db def test_application_approve(): mtypes = [MemberTypeFactory(label='Normal member')] ...
Add unit test for programmatic application and approval
Add unit test for programmatic application and approval
Python
mit
HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,hacklab-fi/asylum,jautero/asylum,rambo/asylum,jautero/asylum,hacklab-fi/asylum,rambo/asylum,HelsinkiHacklab/asylum,rambo/asylum,jautero/asylum,jautero/asylum,hacklab-fi/asylum,hacklab-fi/asylum,rambo/asylum,HelsinkiHacklab/asylum
Add unit test for programmatic application and approval
# -*- coding: utf-8 -*- import pytest from members.tests.fixtures.memberlikes import MembershipApplicationFactory from members.tests.fixtures.types import MemberTypeFactory from members.models import Member @pytest.mark.django_db def test_application_approve(): mtypes = [MemberTypeFactory(label='Normal member')] ...
<commit_before><commit_msg>Add unit test for programmatic application and approval<commit_after>
# -*- coding: utf-8 -*- import pytest from members.tests.fixtures.memberlikes import MembershipApplicationFactory from members.tests.fixtures.types import MemberTypeFactory from members.models import Member @pytest.mark.django_db def test_application_approve(): mtypes = [MemberTypeFactory(label='Normal member')] ...
Add unit test for programmatic application and approval# -*- coding: utf-8 -*- import pytest from members.tests.fixtures.memberlikes import MembershipApplicationFactory from members.tests.fixtures.types import MemberTypeFactory from members.models import Member @pytest.mark.django_db def test_application_approve(): ...
<commit_before><commit_msg>Add unit test for programmatic application and approval<commit_after># -*- coding: utf-8 -*- import pytest from members.tests.fixtures.memberlikes import MembershipApplicationFactory from members.tests.fixtures.types import MemberTypeFactory from members.models import Member @pytest.mark.dja...
aa292c2f180ffcfdfc55114750f22b6c8790a69b
pygraphc/similarity/RosettaJaroWinkler.py
pygraphc/similarity/RosettaJaroWinkler.py
from __future__ import division from itertools import combinations from time import time def jaro(s, t): s_len = len(s) t_len = len(t) if s_len == 0 and t_len == 0: return 1 match_distance = (max(s_len, t_len) // 2) - 1 s_matches = [False] * s_len t_matches = [False] * t_len ma...
Add Jaro-Winkler distance based on code on RosettaCode
Add Jaro-Winkler distance based on code on RosettaCode
Python
mit
studiawan/pygraphc
Add Jaro-Winkler distance based on code on RosettaCode
from __future__ import division from itertools import combinations from time import time def jaro(s, t): s_len = len(s) t_len = len(t) if s_len == 0 and t_len == 0: return 1 match_distance = (max(s_len, t_len) // 2) - 1 s_matches = [False] * s_len t_matches = [False] * t_len ma...
<commit_before><commit_msg>Add Jaro-Winkler distance based on code on RosettaCode<commit_after>
from __future__ import division from itertools import combinations from time import time def jaro(s, t): s_len = len(s) t_len = len(t) if s_len == 0 and t_len == 0: return 1 match_distance = (max(s_len, t_len) // 2) - 1 s_matches = [False] * s_len t_matches = [False] * t_len ma...
Add Jaro-Winkler distance based on code on RosettaCodefrom __future__ import division from itertools import combinations from time import time def jaro(s, t): s_len = len(s) t_len = len(t) if s_len == 0 and t_len == 0: return 1 match_distance = (max(s_len, t_len) // 2) - 1 s_matches = [...
<commit_before><commit_msg>Add Jaro-Winkler distance based on code on RosettaCode<commit_after>from __future__ import division from itertools import combinations from time import time def jaro(s, t): s_len = len(s) t_len = len(t) if s_len == 0 and t_len == 0: return 1 match_distance = (max(s...
0c2fb46c977d8d8ee03d295fee8ddf37cee8cc06
tools/stats/zip_track_recall.py
tools/stats/zip_track_recall.py
#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np import glob import cPickle if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('vid_file') parser.add_ar...
Add script to calculate recalls of track zip files.
Add script to calculate recalls of track zip files.
Python
mit
myfavouritekk/TPN
Add script to calculate recalls of track zip files.
#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np import glob import cPickle if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('vid_file') parser.add_ar...
<commit_before><commit_msg>Add script to calculate recalls of track zip files.<commit_after>
#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np import glob import cPickle if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('vid_file') parser.add_ar...
Add script to calculate recalls of track zip files.#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np import glob import cPickle if __name__ == '__main__': parser = argparse.ArgumentParser() ...
<commit_before><commit_msg>Add script to calculate recalls of track zip files.<commit_after>#!/usr/bin/env python from vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame from vdetlib.utils.common import iou import argparse import numpy as np import glob import cPickle if __name__ == '__main__': ...
f804300765f036f375768e57e081b070a549a800
test-extract-dependencies.py
test-extract-dependencies.py
from dependencies import extract_package import xmlrpc.client as xmlrpclib import random client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') packages = ['gala', 'scikit-learn', 'scipy', 'scikit-image', 'Flask'] random.shuffle(packages) for i, package in enumerate(packages): extract_package(package, to='t...
Add test script with only a few packages
Add test script with only a few packages
Python
mit
hdashnow/python-dependencies
Add test script with only a few packages
from dependencies import extract_package import xmlrpc.client as xmlrpclib import random client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') packages = ['gala', 'scikit-learn', 'scipy', 'scikit-image', 'Flask'] random.shuffle(packages) for i, package in enumerate(packages): extract_package(package, to='t...
<commit_before><commit_msg>Add test script with only a few packages<commit_after>
from dependencies import extract_package import xmlrpc.client as xmlrpclib import random client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') packages = ['gala', 'scikit-learn', 'scipy', 'scikit-image', 'Flask'] random.shuffle(packages) for i, package in enumerate(packages): extract_package(package, to='t...
Add test script with only a few packagesfrom dependencies import extract_package import xmlrpc.client as xmlrpclib import random client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') packages = ['gala', 'scikit-learn', 'scipy', 'scikit-image', 'Flask'] random.shuffle(packages) for i, package in enumerate(packa...
<commit_before><commit_msg>Add test script with only a few packages<commit_after>from dependencies import extract_package import xmlrpc.client as xmlrpclib import random client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') packages = ['gala', 'scikit-learn', 'scipy', 'scikit-image', 'Flask'] random.shuffle(pa...
a1eaf66efa2041849e906010b7a4fb9412a9b781
tests/test_instancemethod.py
tests/test_instancemethod.py
# Imports import random import unittest from funky import memoize, timed_memoize class Dummy(object): @memoize def a(self): return random.random() class TestInstanceMethod(unittest.TestCase): def test_dummy(self): dummy = Dummy() v1 = dummy.a() v2 = dummy.a() dumm...
Add instance method unit tests
Improve: Add instance method unit tests
Python
apache-2.0
FriendCode/funky
Improve: Add instance method unit tests
# Imports import random import unittest from funky import memoize, timed_memoize class Dummy(object): @memoize def a(self): return random.random() class TestInstanceMethod(unittest.TestCase): def test_dummy(self): dummy = Dummy() v1 = dummy.a() v2 = dummy.a() dumm...
<commit_before><commit_msg>Improve: Add instance method unit tests<commit_after>
# Imports import random import unittest from funky import memoize, timed_memoize class Dummy(object): @memoize def a(self): return random.random() class TestInstanceMethod(unittest.TestCase): def test_dummy(self): dummy = Dummy() v1 = dummy.a() v2 = dummy.a() dumm...
Improve: Add instance method unit tests# Imports import random import unittest from funky import memoize, timed_memoize class Dummy(object): @memoize def a(self): return random.random() class TestInstanceMethod(unittest.TestCase): def test_dummy(self): dummy = Dummy() v1 = dummy....
<commit_before><commit_msg>Improve: Add instance method unit tests<commit_after># Imports import random import unittest from funky import memoize, timed_memoize class Dummy(object): @memoize def a(self): return random.random() class TestInstanceMethod(unittest.TestCase): def test_dummy(self): ...
78f730b405c6e67988cdc9efab1aa5316c16849f
tests/test_web_response.py
tests/test_web_response.py
import unittest from unittest import mock from aiohttp.web import Request, StreamResponse from aiohttp.protocol import Request as RequestImpl class TestStreamResponse(unittest.TestCase): def make_request(self, method, path, headers=()): self.app = mock.Mock() self.transport = mock.Mock() ...
Add initial test for web response
Add initial test for web response
Python
apache-2.0
elastic-coders/aiohttp,jashandeep-sohi/aiohttp,mind1master/aiohttp,pfreixes/aiohttp,panda73111/aiohttp,AlexLisovoy/aiohttp,arthurdarcet/aiohttp,z2v/aiohttp,saghul/aiohttp,noplay/aiohttp,alexsdutton/aiohttp,Eyepea/aiohttp,jettify/aiohttp,AlexLisovoy/aiohttp,noplay/aiohttp,juliatem/aiohttp,jashandeep-sohi/aiohttp,arthurd...
Add initial test for web response
import unittest from unittest import mock from aiohttp.web import Request, StreamResponse from aiohttp.protocol import Request as RequestImpl class TestStreamResponse(unittest.TestCase): def make_request(self, method, path, headers=()): self.app = mock.Mock() self.transport = mock.Mock() ...
<commit_before><commit_msg>Add initial test for web response<commit_after>
import unittest from unittest import mock from aiohttp.web import Request, StreamResponse from aiohttp.protocol import Request as RequestImpl class TestStreamResponse(unittest.TestCase): def make_request(self, method, path, headers=()): self.app = mock.Mock() self.transport = mock.Mock() ...
Add initial test for web responseimport unittest from unittest import mock from aiohttp.web import Request, StreamResponse from aiohttp.protocol import Request as RequestImpl class TestStreamResponse(unittest.TestCase): def make_request(self, method, path, headers=()): self.app = mock.Mock() self...
<commit_before><commit_msg>Add initial test for web response<commit_after>import unittest from unittest import mock from aiohttp.web import Request, StreamResponse from aiohttp.protocol import Request as RequestImpl class TestStreamResponse(unittest.TestCase): def make_request(self, method, path, headers=()): ...
644a678d3829513361fdc099d759ca964100f2e6
text-files/replace-text.py
text-files/replace-text.py
#!/usr/bin/env python3 # This Python 3 script replaces text in a file, in-place. # For Windows, use: #!python import fileinput import os import sys def isValidFile(filename): return (filename.lower().endswith('.m3u') or filename.lower().endswith('.m3u8')) def processFile(filename): '''Makes cust...
Add script to replace text
Add script to replace text
Python
mit
jleung51/scripts,jleung51/scripts,jleung51/scripts
Add script to replace text
#!/usr/bin/env python3 # This Python 3 script replaces text in a file, in-place. # For Windows, use: #!python import fileinput import os import sys def isValidFile(filename): return (filename.lower().endswith('.m3u') or filename.lower().endswith('.m3u8')) def processFile(filename): '''Makes cust...
<commit_before><commit_msg>Add script to replace text<commit_after>
#!/usr/bin/env python3 # This Python 3 script replaces text in a file, in-place. # For Windows, use: #!python import fileinput import os import sys def isValidFile(filename): return (filename.lower().endswith('.m3u') or filename.lower().endswith('.m3u8')) def processFile(filename): '''Makes cust...
Add script to replace text#!/usr/bin/env python3 # This Python 3 script replaces text in a file, in-place. # For Windows, use: #!python import fileinput import os import sys def isValidFile(filename): return (filename.lower().endswith('.m3u') or filename.lower().endswith('.m3u8')) def processFile(fi...
<commit_before><commit_msg>Add script to replace text<commit_after>#!/usr/bin/env python3 # This Python 3 script replaces text in a file, in-place. # For Windows, use: #!python import fileinput import os import sys def isValidFile(filename): return (filename.lower().endswith('.m3u') or filename.lower...
0bca09339bb49e4540c5be8162e11ea3e8106200
budget.py
budget.py
#!/usr/bin/env python import sys from PySide import QtGui app = QtGui.QApplication(sys.argv) wid = QtGui.QWidget() wid.resize(250, 150) wid.setWindowTitle('Simple') wid.show() sys.exit(app.exec_())
Create a PySide GUI window.
Create a PySide GUI window.
Python
apache-2.0
mattdeckard/wherewithal
Create a PySide GUI window.
#!/usr/bin/env python import sys from PySide import QtGui app = QtGui.QApplication(sys.argv) wid = QtGui.QWidget() wid.resize(250, 150) wid.setWindowTitle('Simple') wid.show() sys.exit(app.exec_())
<commit_before><commit_msg>Create a PySide GUI window.<commit_after>
#!/usr/bin/env python import sys from PySide import QtGui app = QtGui.QApplication(sys.argv) wid = QtGui.QWidget() wid.resize(250, 150) wid.setWindowTitle('Simple') wid.show() sys.exit(app.exec_())
Create a PySide GUI window.#!/usr/bin/env python import sys from PySide import QtGui app = QtGui.QApplication(sys.argv) wid = QtGui.QWidget() wid.resize(250, 150) wid.setWindowTitle('Simple') wid.show() sys.exit(app.exec_())
<commit_before><commit_msg>Create a PySide GUI window.<commit_after>#!/usr/bin/env python import sys from PySide import QtGui app = QtGui.QApplication(sys.argv) wid = QtGui.QWidget() wid.resize(250, 150) wid.setWindowTitle('Simple') wid.show() sys.exit(app.exec_())
bc28f6ab7ba5bb5e82bf38c544a4d091d89973ea
candycrush.py
candycrush.py
#!/usr/bin/env python import os.path import subprocess import time def scaler(OldMin, OldMax, NewMin, NewMax): def fn(OldValue): return (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin return fn def setup_servod(): if not os.path.exists("/dev/servoblaster"): subproc...
Use servoblaster to control servo
Use servoblaster to control servo
Python
agpl-3.0
emilv/candycrush,emilv/candycrush
Use servoblaster to control servo
#!/usr/bin/env python import os.path import subprocess import time def scaler(OldMin, OldMax, NewMin, NewMax): def fn(OldValue): return (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin return fn def setup_servod(): if not os.path.exists("/dev/servoblaster"): subproc...
<commit_before><commit_msg>Use servoblaster to control servo<commit_after>
#!/usr/bin/env python import os.path import subprocess import time def scaler(OldMin, OldMax, NewMin, NewMax): def fn(OldValue): return (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin return fn def setup_servod(): if not os.path.exists("/dev/servoblaster"): subproc...
Use servoblaster to control servo#!/usr/bin/env python import os.path import subprocess import time def scaler(OldMin, OldMax, NewMin, NewMax): def fn(OldValue): return (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin return fn def setup_servod(): if not os.path.exists("/de...
<commit_before><commit_msg>Use servoblaster to control servo<commit_after>#!/usr/bin/env python import os.path import subprocess import time def scaler(OldMin, OldMax, NewMin, NewMax): def fn(OldValue): return (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin return fn def setup...
09592b081a68f912bf9bb73c5269af8398c36f64
tests/test_collection.py
tests/test_collection.py
from unittest import TestCase from ordering import Ordering class TestOrderingAsCollection(TestCase): def setUp(self) -> None: self.ordering = Ordering[int]() self.ordering.insert_start(0) for n in range(10): self.ordering.insert_after(n, n + 1) def test_length(self) -> N...
Add unit test for treating Ordering as a collection
Add unit test for treating Ordering as a collection
Python
mit
madman-bob/python-order-maintenance
Add unit test for treating Ordering as a collection
from unittest import TestCase from ordering import Ordering class TestOrderingAsCollection(TestCase): def setUp(self) -> None: self.ordering = Ordering[int]() self.ordering.insert_start(0) for n in range(10): self.ordering.insert_after(n, n + 1) def test_length(self) -> N...
<commit_before><commit_msg>Add unit test for treating Ordering as a collection<commit_after>
from unittest import TestCase from ordering import Ordering class TestOrderingAsCollection(TestCase): def setUp(self) -> None: self.ordering = Ordering[int]() self.ordering.insert_start(0) for n in range(10): self.ordering.insert_after(n, n + 1) def test_length(self) -> N...
Add unit test for treating Ordering as a collectionfrom unittest import TestCase from ordering import Ordering class TestOrderingAsCollection(TestCase): def setUp(self) -> None: self.ordering = Ordering[int]() self.ordering.insert_start(0) for n in range(10): self.ordering.ins...
<commit_before><commit_msg>Add unit test for treating Ordering as a collection<commit_after>from unittest import TestCase from ordering import Ordering class TestOrderingAsCollection(TestCase): def setUp(self) -> None: self.ordering = Ordering[int]() self.ordering.insert_start(0) for n in...
4249c6456ca21ad6bbec0eccdf66aef629deb511
test_tags.py
test_tags.py
import sys import requests from wikibugs import Wikibugs2 from channelfilter import ChannelFilter import configfetcher conf = configfetcher.ConfigFetcher() w = Wikibugs2(conf) c = ChannelFilter() print("\n\n\n\n\n\n\n\n") page = requests.get(sys.argv[1]).text tags = w.get_tags(page) for tag in tags: print(tag,...
Add basic tag testing script
Add basic tag testing script Change-Id: I55d17f33a931aaa7fcdf9b5833d5dedef40f9c8a
Python
mit
wikimedia/labs-tools-wikibugs2,wikimedia/labs-tools-wikibugs2
Add basic tag testing script Change-Id: I55d17f33a931aaa7fcdf9b5833d5dedef40f9c8a
import sys import requests from wikibugs import Wikibugs2 from channelfilter import ChannelFilter import configfetcher conf = configfetcher.ConfigFetcher() w = Wikibugs2(conf) c = ChannelFilter() print("\n\n\n\n\n\n\n\n") page = requests.get(sys.argv[1]).text tags = w.get_tags(page) for tag in tags: print(tag,...
<commit_before><commit_msg>Add basic tag testing script Change-Id: I55d17f33a931aaa7fcdf9b5833d5dedef40f9c8a<commit_after>
import sys import requests from wikibugs import Wikibugs2 from channelfilter import ChannelFilter import configfetcher conf = configfetcher.ConfigFetcher() w = Wikibugs2(conf) c = ChannelFilter() print("\n\n\n\n\n\n\n\n") page = requests.get(sys.argv[1]).text tags = w.get_tags(page) for tag in tags: print(tag,...
Add basic tag testing script Change-Id: I55d17f33a931aaa7fcdf9b5833d5dedef40f9c8aimport sys import requests from wikibugs import Wikibugs2 from channelfilter import ChannelFilter import configfetcher conf = configfetcher.ConfigFetcher() w = Wikibugs2(conf) c = ChannelFilter() print("\n\n\n\n\n\n\n\n") page = reque...
<commit_before><commit_msg>Add basic tag testing script Change-Id: I55d17f33a931aaa7fcdf9b5833d5dedef40f9c8a<commit_after>import sys import requests from wikibugs import Wikibugs2 from channelfilter import ChannelFilter import configfetcher conf = configfetcher.ConfigFetcher() w = Wikibugs2(conf) c = ChannelFilter()...
b69cc15467456a070333ff00f886f27ca391b85b
webrtc/build/extra_gitignore.py
webrtc/build/extra_gitignore.py
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
Add script for appending entries to .gitignore.
Add script for appending entries to .gitignore. TBR=kjellander Review URL: https://webrtc-codereview.appspot.com/1629004 git-svn-id: 917f5d3ca488f358c4d40eaec14422cf392ccec9@4193 4adac7df-926f-26a2-2b94-8c16560cd09d
Python
bsd-3-clause
mwgoldsmith/ilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,mwgoldsmith/libilbc,mwgoldsmith/ilbc,TimothyGu/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,mwgoldsmith/ilbc,mwgoldsmith/libilbc,TimothyGu/libilbc,mwgoldsmi...
Add script for appending entries to .gitignore. TBR=kjellander Review URL: https://webrtc-codereview.appspot.com/1629004 git-svn-id: 917f5d3ca488f358c4d40eaec14422cf392ccec9@4193 4adac7df-926f-26a2-2b94-8c16560cd09d
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
<commit_before><commit_msg>Add script for appending entries to .gitignore. TBR=kjellander Review URL: https://webrtc-codereview.appspot.com/1629004 git-svn-id: 917f5d3ca488f358c4d40eaec14422cf392ccec9@4193 4adac7df-926f-26a2-2b94-8c16560cd09d<commit_after>
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
Add script for appending entries to .gitignore. TBR=kjellander Review URL: https://webrtc-codereview.appspot.com/1629004 git-svn-id: 917f5d3ca488f358c4d40eaec14422cf392ccec9@4193 4adac7df-926f-26a2-2b94-8c16560cd09d#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of...
<commit_before><commit_msg>Add script for appending entries to .gitignore. TBR=kjellander Review URL: https://webrtc-codereview.appspot.com/1629004 git-svn-id: 917f5d3ca488f358c4d40eaec14422cf392ccec9@4193 4adac7df-926f-26a2-2b94-8c16560cd09d<commit_after>#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project...
b41b2edde5ac7c786b5ce23adec116fe8311d5d7
tests/test_account_service_account.py
tests/test_account_service_account.py
from unittest.mock import ANY, Mock import requests from django.core.management import call_command from saleor.account.models import ServiceAccount from saleor.core.permissions import get_permissions def test_createaccount_command_creates_service_account(): name = "SA name" permissions = ["account.manage_u...
Add tests for createaccount command
Add tests for createaccount command
Python
bsd-3-clause
mociepka/saleor,mociepka/saleor,mociepka/saleor
Add tests for createaccount command
from unittest.mock import ANY, Mock import requests from django.core.management import call_command from saleor.account.models import ServiceAccount from saleor.core.permissions import get_permissions def test_createaccount_command_creates_service_account(): name = "SA name" permissions = ["account.manage_u...
<commit_before><commit_msg>Add tests for createaccount command<commit_after>
from unittest.mock import ANY, Mock import requests from django.core.management import call_command from saleor.account.models import ServiceAccount from saleor.core.permissions import get_permissions def test_createaccount_command_creates_service_account(): name = "SA name" permissions = ["account.manage_u...
Add tests for createaccount commandfrom unittest.mock import ANY, Mock import requests from django.core.management import call_command from saleor.account.models import ServiceAccount from saleor.core.permissions import get_permissions def test_createaccount_command_creates_service_account(): name = "SA name" ...
<commit_before><commit_msg>Add tests for createaccount command<commit_after>from unittest.mock import ANY, Mock import requests from django.core.management import call_command from saleor.account.models import ServiceAccount from saleor.core.permissions import get_permissions def test_createaccount_command_creates_...
cafb83befb2cee459d44a1332e5fc7e57edf81a6
updateGit.py
updateGit.py
from jiradb import * if __name__ == "__main__": log.setLevel(logging.DEBUG) # Add console log handler ch = logging.StreamHandler() ch.setLevel(logging.INFO) ch.setFormatter(logging.Formatter('%(message)s')) log.addHandler(ch) # Add file log handler fh = logging.FileHandler('updateGit.lo...
Add script to update cvsanaly databases
Add script to update cvsanaly databases
Python
mit
benmishkanian/ASF-JIRA-mine,benmishkanian/ASF-JIRA-mine,benmishkanian/ASF-JIRA-mine
Add script to update cvsanaly databases
from jiradb import * if __name__ == "__main__": log.setLevel(logging.DEBUG) # Add console log handler ch = logging.StreamHandler() ch.setLevel(logging.INFO) ch.setFormatter(logging.Formatter('%(message)s')) log.addHandler(ch) # Add file log handler fh = logging.FileHandler('updateGit.lo...
<commit_before><commit_msg>Add script to update cvsanaly databases<commit_after>
from jiradb import * if __name__ == "__main__": log.setLevel(logging.DEBUG) # Add console log handler ch = logging.StreamHandler() ch.setLevel(logging.INFO) ch.setFormatter(logging.Formatter('%(message)s')) log.addHandler(ch) # Add file log handler fh = logging.FileHandler('updateGit.lo...
Add script to update cvsanaly databasesfrom jiradb import * if __name__ == "__main__": log.setLevel(logging.DEBUG) # Add console log handler ch = logging.StreamHandler() ch.setLevel(logging.INFO) ch.setFormatter(logging.Formatter('%(message)s')) log.addHandler(ch) # Add file log handler ...
<commit_before><commit_msg>Add script to update cvsanaly databases<commit_after>from jiradb import * if __name__ == "__main__": log.setLevel(logging.DEBUG) # Add console log handler ch = logging.StreamHandler() ch.setLevel(logging.INFO) ch.setFormatter(logging.Formatter('%(message)s')) log.addH...
469eedab89d22a1051e9d3f6f7f6c94ba946fb37
irctest/server_tests/test_channel_operations.py
irctest/server_tests/test_channel_operations.py
""" Section 3.2 of RFC 2812 <https://tools.ietf.org/html/rfc2812#section-3.2> """ from irctest import cases from irctest.irc_utils.message_parser import Message class JoinTestCase(cases.BaseServerTestCase): def testJoin(self): """“If a JOIN is successful, the user receives a JOIN message as confir...
Add server tests for JOIN.
Add server tests for JOIN.
Python
mit
ProgVal/irctest
Add server tests for JOIN.
""" Section 3.2 of RFC 2812 <https://tools.ietf.org/html/rfc2812#section-3.2> """ from irctest import cases from irctest.irc_utils.message_parser import Message class JoinTestCase(cases.BaseServerTestCase): def testJoin(self): """“If a JOIN is successful, the user receives a JOIN message as confir...
<commit_before><commit_msg>Add server tests for JOIN.<commit_after>
""" Section 3.2 of RFC 2812 <https://tools.ietf.org/html/rfc2812#section-3.2> """ from irctest import cases from irctest.irc_utils.message_parser import Message class JoinTestCase(cases.BaseServerTestCase): def testJoin(self): """“If a JOIN is successful, the user receives a JOIN message as confir...
Add server tests for JOIN.""" Section 3.2 of RFC 2812 <https://tools.ietf.org/html/rfc2812#section-3.2> """ from irctest import cases from irctest.irc_utils.message_parser import Message class JoinTestCase(cases.BaseServerTestCase): def testJoin(self): """“If a JOIN is successful, the user receives a JOIN...
<commit_before><commit_msg>Add server tests for JOIN.<commit_after>""" Section 3.2 of RFC 2812 <https://tools.ietf.org/html/rfc2812#section-3.2> """ from irctest import cases from irctest.irc_utils.message_parser import Message class JoinTestCase(cases.BaseServerTestCase): def testJoin(self): """“If a JOI...
ef52b314eb5e15c34d8b034d7e6f7bdd727b6586
Code/sp500_extractor_v1_no_bs.py
Code/sp500_extractor_v1_no_bs.py
import csv from lxml import html import time import requests """ Make it work, make it right, make it fast Extract the tickers from the S&P 500 table on Wikipedia, process them into a list and save them into a CSV file. # Retrieve HTML from URL with requests http://docs.python-requests.org/en/master/user/quickstart/...
Add sp500_extractor_v1 version that does not use BeautifulSoup.
Add sp500_extractor_v1 version that does not use BeautifulSoup. This version uses the lxml library to parse the HTML string via xpath. Also change urllib to requests for better efficiency. Update initial comment links to show relevant code resources.
Python
agpl-3.0
camisatx/IntroToPython-Fall-2016
Add sp500_extractor_v1 version that does not use BeautifulSoup. This version uses the lxml library to parse the HTML string via xpath. Also change urllib to requests for better efficiency. Update initial comment links to show relevant code resources.
import csv from lxml import html import time import requests """ Make it work, make it right, make it fast Extract the tickers from the S&P 500 table on Wikipedia, process them into a list and save them into a CSV file. # Retrieve HTML from URL with requests http://docs.python-requests.org/en/master/user/quickstart/...
<commit_before><commit_msg>Add sp500_extractor_v1 version that does not use BeautifulSoup. This version uses the lxml library to parse the HTML string via xpath. Also change urllib to requests for better efficiency. Update initial comment links to show relevant code resources.<commit_after>
import csv from lxml import html import time import requests """ Make it work, make it right, make it fast Extract the tickers from the S&P 500 table on Wikipedia, process them into a list and save them into a CSV file. # Retrieve HTML from URL with requests http://docs.python-requests.org/en/master/user/quickstart/...
Add sp500_extractor_v1 version that does not use BeautifulSoup. This version uses the lxml library to parse the HTML string via xpath. Also change urllib to requests for better efficiency. Update initial comment links to show relevant code resources.import csv from lxml import html import time import requests """ Mak...
<commit_before><commit_msg>Add sp500_extractor_v1 version that does not use BeautifulSoup. This version uses the lxml library to parse the HTML string via xpath. Also change urllib to requests for better efficiency. Update initial comment links to show relevant code resources.<commit_after>import csv from lxml import ...
81ade3168faa68ef43456cc35a122b9ef493a23e
plot_ms_flag_acq_fails.py
plot_ms_flag_acq_fails.py
from __future__ import division import matplotlib.pyplot as plt from astropy.table import Table import numpy as np from Ska.DBI import DBI from chandra_aca import star_probs db = DBI(dbi='sybase', server='sybase', user='aca_read') stats = db.fetchall('SELECT * from trak_stats_data ' 'WHERE kalman...
Add script to plot MS flag rate and acq fail rate
Add script to plot MS flag rate and acq fail rate
Python
bsd-3-clause
sot/aca_stats,sot/aca_stats,sot/aca_stats
Add script to plot MS flag rate and acq fail rate
from __future__ import division import matplotlib.pyplot as plt from astropy.table import Table import numpy as np from Ska.DBI import DBI from chandra_aca import star_probs db = DBI(dbi='sybase', server='sybase', user='aca_read') stats = db.fetchall('SELECT * from trak_stats_data ' 'WHERE kalman...
<commit_before><commit_msg>Add script to plot MS flag rate and acq fail rate<commit_after>
from __future__ import division import matplotlib.pyplot as plt from astropy.table import Table import numpy as np from Ska.DBI import DBI from chandra_aca import star_probs db = DBI(dbi='sybase', server='sybase', user='aca_read') stats = db.fetchall('SELECT * from trak_stats_data ' 'WHERE kalman...
Add script to plot MS flag rate and acq fail ratefrom __future__ import division import matplotlib.pyplot as plt from astropy.table import Table import numpy as np from Ska.DBI import DBI from chandra_aca import star_probs db = DBI(dbi='sybase', server='sybase', user='aca_read') stats = db.fetchall('SELECT * from tr...
<commit_before><commit_msg>Add script to plot MS flag rate and acq fail rate<commit_after>from __future__ import division import matplotlib.pyplot as plt from astropy.table import Table import numpy as np from Ska.DBI import DBI from chandra_aca import star_probs db = DBI(dbi='sybase', server='sybase', user='aca_read...
0b3bfeb06a4594a2c188e623835c3a54262cca5d
utilities/book_parser.py
utilities/book_parser.py
# utilities.book_parser # coding=utf-8 from __future__ import unicode_literals import yvs.shared as shared from HTMLParser import HTMLParser class BookParser(HTMLParser): # Resets parser variables (implicitly called on instantiation) def reset(self): HTMLParser.reset(self) self.depth = 0 ...
Write initial Bible book HTML parser
Write initial Bible book HTML parser This parser will be utilized by the add_language utility so as to work towards eliminating PyQuery as a dependency.
Python
mit
caleb531/youversion-suggest,caleb531/youversion-suggest
Write initial Bible book HTML parser This parser will be utilized by the add_language utility so as to work towards eliminating PyQuery as a dependency.
# utilities.book_parser # coding=utf-8 from __future__ import unicode_literals import yvs.shared as shared from HTMLParser import HTMLParser class BookParser(HTMLParser): # Resets parser variables (implicitly called on instantiation) def reset(self): HTMLParser.reset(self) self.depth = 0 ...
<commit_before><commit_msg>Write initial Bible book HTML parser This parser will be utilized by the add_language utility so as to work towards eliminating PyQuery as a dependency.<commit_after>
# utilities.book_parser # coding=utf-8 from __future__ import unicode_literals import yvs.shared as shared from HTMLParser import HTMLParser class BookParser(HTMLParser): # Resets parser variables (implicitly called on instantiation) def reset(self): HTMLParser.reset(self) self.depth = 0 ...
Write initial Bible book HTML parser This parser will be utilized by the add_language utility so as to work towards eliminating PyQuery as a dependency.# utilities.book_parser # coding=utf-8 from __future__ import unicode_literals import yvs.shared as shared from HTMLParser import HTMLParser class BookParser(HTMLPa...
<commit_before><commit_msg>Write initial Bible book HTML parser This parser will be utilized by the add_language utility so as to work towards eliminating PyQuery as a dependency.<commit_after># utilities.book_parser # coding=utf-8 from __future__ import unicode_literals import yvs.shared as shared from HTMLParser im...
596f432eb7d4b3fa5d1bf5dec33cc882546e8233
trunk/metpy/vis/util/gr2_to_mpl_colortable.py
trunk/metpy/vis/util/gr2_to_mpl_colortable.py
#!/usr/bin/env python # This script is used to convert colortables from GRLevelX to data for a # matplotlib colormap import sys from optparse import OptionParser #Set up command line options opt_parser = OptionParser(usage="usage: %prog [options] colortablefile") opt_parser.add_option("-s", "--scale", action="store_tr...
Add a script to convert a GRLevelX colortable file to a dict data structure (and optionally boundaries for norm) for use with Matplotlib.
Add a script to convert a GRLevelX colortable file to a dict data structure (and optionally boundaries for norm) for use with Matplotlib. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@323 150532fb-1d5b-0410-a8ab-efec50f980d4
Python
bsd-3-clause
ahill818/MetPy,ahaberlie/MetPy,ahaberlie/MetPy,Unidata/MetPy,Unidata/MetPy,jrleeman/MetPy,ShawnMurd/MetPy,dopplershift/MetPy,deeplycloudy/MetPy,jrleeman/MetPy,dopplershift/MetPy
Add a script to convert a GRLevelX colortable file to a dict data structure (and optionally boundaries for norm) for use with Matplotlib. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@323 150532fb-1d5b-0410-a8ab-efec50f980d4
#!/usr/bin/env python # This script is used to convert colortables from GRLevelX to data for a # matplotlib colormap import sys from optparse import OptionParser #Set up command line options opt_parser = OptionParser(usage="usage: %prog [options] colortablefile") opt_parser.add_option("-s", "--scale", action="store_tr...
<commit_before><commit_msg>Add a script to convert a GRLevelX colortable file to a dict data structure (and optionally boundaries for norm) for use with Matplotlib. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@323 150532fb-1d5b-0410-a8ab-efec50f980d4<commit_after>
#!/usr/bin/env python # This script is used to convert colortables from GRLevelX to data for a # matplotlib colormap import sys from optparse import OptionParser #Set up command line options opt_parser = OptionParser(usage="usage: %prog [options] colortablefile") opt_parser.add_option("-s", "--scale", action="store_tr...
Add a script to convert a GRLevelX colortable file to a dict data structure (and optionally boundaries for norm) for use with Matplotlib. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@323 150532fb-1d5b-0410-a8ab-efec50f980d4#!/usr/bin/env python # This script is used to convert colortables from GRLevelX to data...
<commit_before><commit_msg>Add a script to convert a GRLevelX colortable file to a dict data structure (and optionally boundaries for norm) for use with Matplotlib. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@323 150532fb-1d5b-0410-a8ab-efec50f980d4<commit_after>#!/usr/bin/env python # This script is used to ...
ef4aeb1e16245c76e7d10091b6fc8b0b289d635f
validateIp.py
validateIp.py
#!/usr/bin/env python import socket def parse(ip): # parse and validate ip address try: socket.inet_pton(socket.AF_INET,ip) return "valid" except socket.error, e: try: socket.inet_pton(socket.AF_INET6,ip) return "valid" except: print "ERRO...
Split IP validation to a module
Split IP validation to a module
Python
apache-2.0
danclegg/py-sony
Split IP validation to a module
#!/usr/bin/env python import socket def parse(ip): # parse and validate ip address try: socket.inet_pton(socket.AF_INET,ip) return "valid" except socket.error, e: try: socket.inet_pton(socket.AF_INET6,ip) return "valid" except: print "ERRO...
<commit_before><commit_msg>Split IP validation to a module<commit_after>
#!/usr/bin/env python import socket def parse(ip): # parse and validate ip address try: socket.inet_pton(socket.AF_INET,ip) return "valid" except socket.error, e: try: socket.inet_pton(socket.AF_INET6,ip) return "valid" except: print "ERRO...
Split IP validation to a module#!/usr/bin/env python import socket def parse(ip): # parse and validate ip address try: socket.inet_pton(socket.AF_INET,ip) return "valid" except socket.error, e: try: socket.inet_pton(socket.AF_INET6,ip) return "valid" ...
<commit_before><commit_msg>Split IP validation to a module<commit_after>#!/usr/bin/env python import socket def parse(ip): # parse and validate ip address try: socket.inet_pton(socket.AF_INET,ip) return "valid" except socket.error, e: try: socket.inet_pton(socket.AF_INET...
0d2c04790fb6c97b37f6e0700bb0162796e3dc4c
tests/web_api/test_scale_serialization.py
tests/web_api/test_scale_serialization.py
# -*- coding: utf-8 -*- from openfisca_web_api.loader.parameters import walk_node from openfisca_core.parameters import ParameterNode, Scale def test_amount_scale(): parameters = [] metadata = {'location':'foo', 'version':'1', 'repository_url':'foo'} root_node = ParameterNode(data = {}) amount_scale_d...
Add unit tests for AmountTaxScale serialization
Add unit tests for AmountTaxScale serialization
Python
agpl-3.0
openfisca/openfisca-core,openfisca/openfisca-core
Add unit tests for AmountTaxScale serialization
# -*- coding: utf-8 -*- from openfisca_web_api.loader.parameters import walk_node from openfisca_core.parameters import ParameterNode, Scale def test_amount_scale(): parameters = [] metadata = {'location':'foo', 'version':'1', 'repository_url':'foo'} root_node = ParameterNode(data = {}) amount_scale_d...
<commit_before><commit_msg>Add unit tests for AmountTaxScale serialization<commit_after>
# -*- coding: utf-8 -*- from openfisca_web_api.loader.parameters import walk_node from openfisca_core.parameters import ParameterNode, Scale def test_amount_scale(): parameters = [] metadata = {'location':'foo', 'version':'1', 'repository_url':'foo'} root_node = ParameterNode(data = {}) amount_scale_d...
Add unit tests for AmountTaxScale serialization# -*- coding: utf-8 -*- from openfisca_web_api.loader.parameters import walk_node from openfisca_core.parameters import ParameterNode, Scale def test_amount_scale(): parameters = [] metadata = {'location':'foo', 'version':'1', 'repository_url':'foo'} root_nod...
<commit_before><commit_msg>Add unit tests for AmountTaxScale serialization<commit_after># -*- coding: utf-8 -*- from openfisca_web_api.loader.parameters import walk_node from openfisca_core.parameters import ParameterNode, Scale def test_amount_scale(): parameters = [] metadata = {'location':'foo', 'version':...
6f7afea4aed4dd77cd06e8dce66e9ed1e6390a00
dummyprint.py
dummyprint.py
#!/usr/bin/env python3 # It does work with Python 2.7, too. from __future__ import print_function from __future__ import unicode_literals try: from SocketServer import TCPServer, BaseRequestHandler except ImportError: # Python 3 from socketserver import TCPServer, BaseRequestHandler class DummyHandler(BaseRe...
Add a dummy label printer server.
Add a dummy label printer server.
Python
mit
chaosdorf/labello,chaosdorf/labello,chaosdorf/labello
Add a dummy label printer server.
#!/usr/bin/env python3 # It does work with Python 2.7, too. from __future__ import print_function from __future__ import unicode_literals try: from SocketServer import TCPServer, BaseRequestHandler except ImportError: # Python 3 from socketserver import TCPServer, BaseRequestHandler class DummyHandler(BaseRe...
<commit_before><commit_msg>Add a dummy label printer server.<commit_after>
#!/usr/bin/env python3 # It does work with Python 2.7, too. from __future__ import print_function from __future__ import unicode_literals try: from SocketServer import TCPServer, BaseRequestHandler except ImportError: # Python 3 from socketserver import TCPServer, BaseRequestHandler class DummyHandler(BaseRe...
Add a dummy label printer server.#!/usr/bin/env python3 # It does work with Python 2.7, too. from __future__ import print_function from __future__ import unicode_literals try: from SocketServer import TCPServer, BaseRequestHandler except ImportError: # Python 3 from socketserver import TCPServer, BaseRequestH...
<commit_before><commit_msg>Add a dummy label printer server.<commit_after>#!/usr/bin/env python3 # It does work with Python 2.7, too. from __future__ import print_function from __future__ import unicode_literals try: from SocketServer import TCPServer, BaseRequestHandler except ImportError: # Python 3 from so...
8f3f9d79d8ce1960ad225e236ca3e11c72de28e0
test/command_line/test_report.py
test/command_line/test_report.py
from __future__ import absolute_import, division, print_function import os import procrunner def test_report_integrated_data(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run( [ "dials.report", os.path.join(dial...
Add test for dials.report on integrated data
Add test for dials.report on integrated data
Python
bsd-3-clause
dials/dials,dials/dials,dials/dials,dials/dials,dials/dials
Add test for dials.report on integrated data
from __future__ import absolute_import, division, print_function import os import procrunner def test_report_integrated_data(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run( [ "dials.report", os.path.join(dial...
<commit_before><commit_msg>Add test for dials.report on integrated data<commit_after>
from __future__ import absolute_import, division, print_function import os import procrunner def test_report_integrated_data(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run( [ "dials.report", os.path.join(dial...
Add test for dials.report on integrated datafrom __future__ import absolute_import, division, print_function import os import procrunner def test_report_integrated_data(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run( [ "...
<commit_before><commit_msg>Add test for dials.report on integrated data<commit_after>from __future__ import absolute_import, division, print_function import os import procrunner def test_report_integrated_data(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result ...
a00dc9b0b1779ee8218917bca4c75823081b7854
InvenTree/part/migrations/0072_bomitemsubstitute.py
InvenTree/part/migrations/0072_bomitemsubstitute.py
# Generated by Django 3.2.5 on 2021-10-12 23:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('part', '0071_alter_partparametertemplate_name'), ] operations = [ migrations.CreateModel( name=...
Add migration file for new database model
Add migration file for new database model
Python
mit
inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree
Add migration file for new database model
# Generated by Django 3.2.5 on 2021-10-12 23:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('part', '0071_alter_partparametertemplate_name'), ] operations = [ migrations.CreateModel( name=...
<commit_before><commit_msg>Add migration file for new database model<commit_after>
# Generated by Django 3.2.5 on 2021-10-12 23:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('part', '0071_alter_partparametertemplate_name'), ] operations = [ migrations.CreateModel( name=...
Add migration file for new database model# Generated by Django 3.2.5 on 2021-10-12 23:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('part', '0071_alter_partparametertemplate_name'), ] operations = [ ...
<commit_before><commit_msg>Add migration file for new database model<commit_after># Generated by Django 3.2.5 on 2021-10-12 23:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('part', '0071_alter_partparametertemplate_n...
a962de79938c73b5c0e0459be7b82265bde76b40
cases/gridworld/lspi.py
cases/gridworld/lspi.py
#!/usr/bin/env python __author__ = "William Dabney" from Domains import GridWorld from Tools import Logger from Agents import LSPI from Representations import Tabular from Policies import eGreedy from Experiments import Experiment def make_experiment(id=1, path="./Results/Temp"): """ Each file specifying an...
Test case for LSPI on gridworld.
Test case for LSPI on gridworld.
Python
bsd-3-clause
silgon/rlpy,MDPvis/rlpy,imanolarrieta/RL,BerkeleyAutomation/rlpy,imanolarrieta/RL,MDPvis/rlpy,rlpy/rlpy,BerkeleyAutomation/rlpy,BerkeleyAutomation/rlpy,rlpy/rlpy,imanolarrieta/RL,silgon/rlpy,silgon/rlpy,MDPvis/rlpy,rlpy/rlpy
Test case for LSPI on gridworld.
#!/usr/bin/env python __author__ = "William Dabney" from Domains import GridWorld from Tools import Logger from Agents import LSPI from Representations import Tabular from Policies import eGreedy from Experiments import Experiment def make_experiment(id=1, path="./Results/Temp"): """ Each file specifying an...
<commit_before><commit_msg>Test case for LSPI on gridworld.<commit_after>
#!/usr/bin/env python __author__ = "William Dabney" from Domains import GridWorld from Tools import Logger from Agents import LSPI from Representations import Tabular from Policies import eGreedy from Experiments import Experiment def make_experiment(id=1, path="./Results/Temp"): """ Each file specifying an...
Test case for LSPI on gridworld.#!/usr/bin/env python __author__ = "William Dabney" from Domains import GridWorld from Tools import Logger from Agents import LSPI from Representations import Tabular from Policies import eGreedy from Experiments import Experiment def make_experiment(id=1, path="./Results/Temp"): ...
<commit_before><commit_msg>Test case for LSPI on gridworld.<commit_after>#!/usr/bin/env python __author__ = "William Dabney" from Domains import GridWorld from Tools import Logger from Agents import LSPI from Representations import Tabular from Policies import eGreedy from Experiments import Experiment def make_exp...
b514cf783d53a5c713911729422239c9b0f0ff99
client/python/examples/edleak_autodetect.py
client/python/examples/edleak_autodetect.py
import sys import rpc.ws import edleak.api import edleak.slice_runner def usage(): print('autodetect [period] [duration]') def print_leaker(leaker): print('-------------------------------') print('class : ' + leaker['leak_factor']['class']) print('leak size : ' + str(leaker['leak_factor']['leak'])) ...
Add automatic leak detection python script in examples
Add automatic leak detection python script in examples
Python
mit
edkit/edkit-agent,edkit/edkit-agent,edkit/edkit-agent
Add automatic leak detection python script in examples
import sys import rpc.ws import edleak.api import edleak.slice_runner def usage(): print('autodetect [period] [duration]') def print_leaker(leaker): print('-------------------------------') print('class : ' + leaker['leak_factor']['class']) print('leak size : ' + str(leaker['leak_factor']['leak'])) ...
<commit_before><commit_msg>Add automatic leak detection python script in examples<commit_after>
import sys import rpc.ws import edleak.api import edleak.slice_runner def usage(): print('autodetect [period] [duration]') def print_leaker(leaker): print('-------------------------------') print('class : ' + leaker['leak_factor']['class']) print('leak size : ' + str(leaker['leak_factor']['leak'])) ...
Add automatic leak detection python script in examplesimport sys import rpc.ws import edleak.api import edleak.slice_runner def usage(): print('autodetect [period] [duration]') def print_leaker(leaker): print('-------------------------------') print('class : ' + leaker['leak_factor']['class']) print('...
<commit_before><commit_msg>Add automatic leak detection python script in examples<commit_after>import sys import rpc.ws import edleak.api import edleak.slice_runner def usage(): print('autodetect [period] [duration]') def print_leaker(leaker): print('-------------------------------') print('class : ' + l...
4175f27a03be52baa8b4245df96a03e6bbd22310
modulation_test.py
modulation_test.py
import pygame import random from demodulate.cfg import * from gen_tone import * if __name__ == "__main__": pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1) pygame.mixer.init() WPM = random.uniform(2,20) pattern = [1,0,1,1,1,0,0,0,0,0,0,0] # morse code 'A' #gen_test_data() data = gen_tone(pattern...
Add test for pygame sound play hook
Add test for pygame sound play hook
Python
mit
nickodell/morse-code
Add test for pygame sound play hook
import pygame import random from demodulate.cfg import * from gen_tone import * if __name__ == "__main__": pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1) pygame.mixer.init() WPM = random.uniform(2,20) pattern = [1,0,1,1,1,0,0,0,0,0,0,0] # morse code 'A' #gen_test_data() data = gen_tone(pattern...
<commit_before><commit_msg>Add test for pygame sound play hook<commit_after>
import pygame import random from demodulate.cfg import * from gen_tone import * if __name__ == "__main__": pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1) pygame.mixer.init() WPM = random.uniform(2,20) pattern = [1,0,1,1,1,0,0,0,0,0,0,0] # morse code 'A' #gen_test_data() data = gen_tone(pattern...
Add test for pygame sound play hookimport pygame import random from demodulate.cfg import * from gen_tone import * if __name__ == "__main__": pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1) pygame.mixer.init() WPM = random.uniform(2,20) pattern = [1,0,1,1,1,0,0,0,0,0,0,0] # morse code 'A' #gen_t...
<commit_before><commit_msg>Add test for pygame sound play hook<commit_after>import pygame import random from demodulate.cfg import * from gen_tone import * if __name__ == "__main__": pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1) pygame.mixer.init() WPM = random.uniform(2,20) pattern = [1,0,1,1,...
76be22f3d1aa86616ecd06a326344f24ff03adbe
DataGeneration/GenerateUniformAddresses.py
DataGeneration/GenerateUniformAddresses.py
# The purpose of this script is to generate a uniformly distributed series of # lat/long coordinates given max/min latitude, max/min longitude, latitude # resolution, and longitude resolution, where resolution is the desired number # of degrees between output coordinates # Outputs a pandas dataframe of lat/long coor...
Add function to generate uniform addresses
Add function to generate uniform addresses Given maximum and minimum latitudes and longitudes as well as resolutions for latitude and longitude in degrees, this function outputs a .csv file with uniformly spaced latitude-longitude pairs bounded by the maximum and minimum latitues and longitudes
Python
mit
opencleveland/RTAHeatMap,skorasaurus/RTAHeatMap
Add function to generate uniform addresses Given maximum and minimum latitudes and longitudes as well as resolutions for latitude and longitude in degrees, this function outputs a .csv file with uniformly spaced latitude-longitude pairs bounded by the maximum and minimum latitues and longitudes
# The purpose of this script is to generate a uniformly distributed series of # lat/long coordinates given max/min latitude, max/min longitude, latitude # resolution, and longitude resolution, where resolution is the desired number # of degrees between output coordinates # Outputs a pandas dataframe of lat/long coor...
<commit_before><commit_msg>Add function to generate uniform addresses Given maximum and minimum latitudes and longitudes as well as resolutions for latitude and longitude in degrees, this function outputs a .csv file with uniformly spaced latitude-longitude pairs bounded by the maximum and minimum latitues and longitu...
# The purpose of this script is to generate a uniformly distributed series of # lat/long coordinates given max/min latitude, max/min longitude, latitude # resolution, and longitude resolution, where resolution is the desired number # of degrees between output coordinates # Outputs a pandas dataframe of lat/long coor...
Add function to generate uniform addresses Given maximum and minimum latitudes and longitudes as well as resolutions for latitude and longitude in degrees, this function outputs a .csv file with uniformly spaced latitude-longitude pairs bounded by the maximum and minimum latitues and longitudes# The purpose of this sc...
<commit_before><commit_msg>Add function to generate uniform addresses Given maximum and minimum latitudes and longitudes as well as resolutions for latitude and longitude in degrees, this function outputs a .csv file with uniformly spaced latitude-longitude pairs bounded by the maximum and minimum latitues and longitu...